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
oeis/004/A004528.asm
neoneye/loda-programs
11
12628
; A004528: Ratios of successive terms are 1,2,2,2,3,4,4,4,5,6,6,6,7... ; Submitted by <NAME> ; 1,1,2,4,8,24,96,384,1536,7680,46080,276480,1658880,11612160,92897280,743178240,5945425920,53508833280,535088332800,5350883328000,53508833280000,588597166080000,7063165992960000 mov $1,3 mov $2,1 mov $4,1 lpb $0 sub $0,1 add $1,3 mov $3,$2 add $2,$1 mod $3,2 add $5,$3 mul $4,$5 lpe mov $0,$4
asm/fibon.asm
pedroreissantos/pepe
0
171960
<gh_stars>0 ; PEPE gerado por 'lcc' (IST: prs 2005) ; 'rl' serve como frame-pointer e 'r0' como acumulador ; os registos 'r1' a 'r10' sao preservados nas chamadas PLACE 0 CALL main SWE 240 ; exit(code in r0) ; global fib ; TEXT fib: ; ncalls=2 PUSH r9 PUSH r10 PUSH rl MOV rl, sp ; P_i EQU 8 MOV r10, [rl + 8] CMP r10,1 JGT L2 MOV r0, [rl + 8] JMP L1 L2: MOV r10, [rl + 8] SUB r10,1 PUSH r10 CALL fib ADD sp,2 MOV r10,r0 MOV r9, [rl + 8] SUB r9,2 PUSH r9 CALL fib ADD sp,2 MOV r9,r0 MOV r0,r10 ADD r0,r9 L1: MOV sp, rl POP rl POP r10 POP r9 RET ; global main main: ; ncalls=4 PUSH r10 PUSH rl MOV rl, sp ; P_argc EQU 6 ; P_argv EQU 8 MOV r10, 8 ADD r10, rl MOV r10,[r10] MOV r10,[r10 + 2] PUSH r10 CALL atoi ADD sp,2 MOV r10,r0 PUSH r10 CALL fib ADD sp,2 MOV r10,r0 PUSH r10 CALL printi ADD sp,2 CALL printLN MOV r0,0 L4: MOV sp, rl POP rl POP r10 RET ; extern printLN ; extern atoi ; extern printi
six_sessions/OpenSixSessions.applescript
supermitch/iterm-scripts
0
1511
on open_six_sessions(jump_user, box_user, boxes) tell application "iTerm" tell current window create tab with default profile end tell # Create sessions. tell current session of current window split vertically with default profile split vertically with default profile end tell tell session 1 of current tab of current window split horizontally with default profile end tell tell session 3 of current tab of current window split horizontally with default profile end tell tell session 5 of current tab of current window split horizontally with default profile end tell # Establish connections & execute actions. repeat with i from 1 to count of boxes tell session i of current tab of current window write text "ssh " & jump_user & "@<jump ip>" write text "ssh " & box_user & "@nnn.nnn.nnn." & (item i of boxes) write text "echo -ne \"\\033]0;nnn.nnn.nnn." & (item i of boxes) & "\\007\"" # Title is IP end tell end repeat end tell end open_six_sessions
source/visibility/program-predefined_operators.adb
reznikmm/gela
0
1819
-- SPDX-FileCopyrightText: 2019-2021 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Defining_Identifiers; with Program.Elements.Defining_Names; with Program.Elements.Defining_Operator_Symbols; with Program.Elements.Function_Declarations; with Program.Elements.Identifiers; with Program.Elements.Parameter_Specifications; with Program.Symbols; package body Program.Predefined_Operators is package E renames Program.Elements; procedure Create_Operator (Self : in out Program.Visibility.Context'Class; Symbol : Program.Symbols.Symbol; Type_View : Program.Visibility.View; Setter : not null Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access; Factory : Program.Implicit_Element_Factories.Element_Factory; Vectors : Program.Element_Vector_Factories.Element_Vector_Factory; Decl : out E.Function_Declarations.Function_Declaration_Access); --------------------- -- Create_Operator -- --------------------- procedure Create_Operator (Self : in out Program.Visibility.Context'Class; Symbol : Program.Symbols.Symbol; Type_View : Program.Visibility.View; Setter : not null Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access; Factory : Program.Implicit_Element_Factories.Element_Factory; Vectors : Program.Element_Vector_Factories.Element_Vector_Factory; Decl : out E.Function_Declarations.Function_Declaration_Access) is procedure New_Parameter (Spec : out E.Parameter_Specifications.Parameter_Specification_Access); ------------------- -- New_Parameter -- ------------------- procedure New_Parameter (Spec : out E.Parameter_Specifications.Parameter_Specification_Access) is Type_Name : constant E.Defining_Names.Defining_Name_Access := Program.Visibility.Name (Type_View); Vector : E.Defining_Identifiers.Defining_Identifier_Vector_Access; Tipe_Id : constant E.Identifiers.Identifier_Access := Factory.Create_Identifier (Is_Part_Of_Implicit => True); Id : constant E.Defining_Identifiers.Defining_Identifier_Access := Factory.Create_Defining_Identifier (Is_Part_Of_Implicit => True); begin Setter.Set_Corresponding_Defining_Name (E.Element_Access (Tipe_Id), Type_Name); Vector := Vectors.Create_Defining_Identifier_Vector (Program.Element_Vectors.Single_Element (E.Element_Access (Id))); Spec := Factory.Create_Parameter_Specification (Names => Vector, Parameter_Subtype => E.Element_Access (Tipe_Id), Default_Expression => null, Is_Part_Of_Implicit => True); Self.Create_Parameter (Symbol => Program.Symbols.Left, Name => Id.all'Access, Mode => Program.Visibility.In_Mode, Has_Default => False); Self.Leave_Declarative_Region; Self.Set_Object_Type (Type_View); end New_Parameter; Type_Name : constant E.Defining_Names.Defining_Name_Access := Program.Visibility.Name (Type_View); Tipe : constant E.Identifiers.Identifier_Access := Factory.Create_Identifier (Is_Part_Of_Implicit => True); Name : constant E.Defining_Operator_Symbols .Defining_Operator_Symbol_Access := Factory.Create_Defining_Operator_Symbol (Is_Part_Of_Implicit => True); Left : E.Parameter_Specifications.Parameter_Specification_Access; Right : E.Parameter_Specifications.Parameter_Specification_Access; List : E.Parameter_Specifications.Parameter_Specification_Vector_Access; begin Self.Create_Function (Symbol, Name.all'Access); New_Parameter (Left); New_Parameter (Right); Self.Set_Result_Type (Type_View); Self.Leave_Declarative_Region; List := Vectors.Create_Parameter_Specification_Vector (Program.Element_Vectors.Two_Elements (E.Element_Access (Left), E.Element_Access (Right))); Setter.Set_Corresponding_Defining_Name (E.Element_Access (Tipe), Type_Name); Decl := Factory.Create_Function_Declaration (Name => Name.all'Access, Parameters => List, Result_Subtype => E.Element_Access (Tipe), Result_Expression => null, Aspects => null, Is_Part_Of_Implicit => True); end Create_Operator; -------------------------------- -- Create_Operators_For_Array -- -------------------------------- procedure Create_Operators_For_Array (Self : in out Program.Visibility.Context'Class; Type_View : Program.Visibility.View; Setter : not null Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access; Factory : Program.Implicit_Element_Factories.Element_Factory; Vectors : Program.Element_Vector_Factories.Element_Vector_Factory; Result : out Program.Element_Vectors.Element_Vector_Access) is Indexes : constant Program.Visibility.View_Array := Program.Visibility.Indexes (Type_View); Ampersand : E.Function_Declarations.Function_Declaration_Access; begin if Indexes'Length /= 1 then -- FIXME: Check nonlimited return; end if; Create_Operator (Self, Symbol => Program.Symbols.Ampersand_Symbol, Type_View => Type_View, Setter => Setter, Factory => Factory, Vectors => Vectors, Decl => Ampersand); Result := Vectors.Create_Element_Vector (Program.Element_Vectors.Single_Element (E.Element_Access (Ampersand))); end Create_Operators_For_Array; ---------------------------------- -- Create_Operators_For_Integer -- ---------------------------------- procedure Create_Operators_For_Integer (Self : in out Program.Visibility.Context'Class; Type_View : Program.Visibility.View; Setter : not null Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access; Factory : Program.Implicit_Element_Factories.Element_Factory; Vectors : Program.Element_Vector_Factories.Element_Vector_Factory; Result : out Program.Element_Vectors.Element_Vector_Access) is Hyphen : E.Function_Declarations.Function_Declaration_Access; begin Create_Operator (Self, Symbol => Program.Symbols.Hyphen_Symbol, Type_View => Type_View, Setter => Setter, Factory => Factory, Vectors => Vectors, Decl => Hyphen); Result := Vectors.Create_Element_Vector (Program.Element_Vectors.Single_Element (E.Element_Access (Hyphen))); end Create_Operators_For_Integer; end Program.Predefined_Operators;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35502l.ada
best08618/asylo
7
23265
<reponame>best08618/asylo<gh_stars>1-10 -- C35502L.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 'POS' AND 'VAL' YIELD THE CORRECT RESULTS WHEN -- THE PREFIX IS A FORMAL DISCRETE TYPE WHOSE ACTUAL ARGUMENT IS -- AN ENUMERATION TYPE OTHER THAN A BOOLEAN OR A CHARACTER TYPE. -- RJW 5/27/86 WITH REPORT; USE REPORT; PROCEDURE C35502L IS TYPE ENUM IS (A, BC, ABC, A_B_C, ABCD); SUBTYPE SUBENUM IS ENUM RANGE A .. BC; TYPE NEWENUM IS NEW ENUM; SUBTYPE SUBNEW IS NEWENUM RANGE A .. BC; BEGIN TEST ("C35502L", "CHECK THAT 'POS' AND 'VAL' YIELD THE " & "CORRECT RESULTS WHEN THE PREFIX IS A " & "FORMAL DISCRETE TYPE WHOSE ACTUAL ARGUMENT " & "IS AN ENUMERATION TYPE OTHER THAN A " & "CHARACTER OR A BOOLEAN TYPE" ); DECLARE GENERIC TYPE E IS (<>); STR : STRING; PROCEDURE P; PROCEDURE P IS SUBTYPE SE IS E RANGE E'VAL(0) .. E'VAL(1); POSITION : INTEGER; BEGIN POSITION := 0; FOR E1 IN E LOOP IF SE'POS (E1) /= POSITION THEN FAILED ( "INCORRECT SE'POS (" & E'IMAGE (E1) & ")" ); END IF; IF SE'VAL (POSITION) /= E1 THEN FAILED ( "INCORRECT " & STR & "'VAL (" & INTEGER'IMAGE (POSITION) & ")" ); END IF; POSITION := POSITION + 1; END LOOP; BEGIN IF E'VAL (-1) = E'VAL (1) THEN FAILED ( "NO EXCEPTION RAISED FOR " & STR & "'VAL (-1) - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED FOR " & STR & "'VAL (-1) - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR " & STR & "'VAL (-1)" ); END; BEGIN IF E'VAL (5) = E'VAL (4) THEN FAILED ( "NO EXCEPTION RAISED FOR " & STR & "'VAL (5) - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED FOR " & STR & "'VAL (5) - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR " & STR & "'VAL (5)" ); END; END P; PROCEDURE PE IS NEW P ( ENUM, "ENUM" ); PROCEDURE PN IS NEW P ( NEWENUM, "NEWENUM" ); BEGIN PE; PN; END; DECLARE GENERIC TYPE E IS (<>); FUNCTION F (E1 : E) RETURN BOOLEAN; FUNCTION F (E1 : E) RETURN BOOLEAN IS BEGIN RETURN E'VAL (0) = E1; END F; FUNCTION FE IS NEW F (ENUM); BEGIN DECLARE FUNCTION A_B_C RETURN ENUM IS BEGIN RETURN ENUM'VAL (IDENT_INT (0)); END A_B_C; BEGIN IF FE (A_B_C) THEN NULL; ELSE FAILED ( "INCORRECT VAL FOR A_B_C WHEN HIDDEN " & "BY A FUNCTION" ); END IF; IF FE (C35502L.A_B_C) THEN FAILED ( "INCORRECT VAL FOR C35502L.A_B_C" ); END IF; END; END; RESULT; END C35502L;
src/stars/tests/tests/pseudoOps/sge_sgeu_test.asm
kevintmcdonnell/stars
9
92095
<reponame>kevintmcdonnell/stars<gh_stars>1-10 .text main: # Testing with same values li $t0, 10 li $t1, 10 # Should be 1 sge $a0, $t0, $t1 li $v0, 1 syscall # Should be 1 sgeu $a0, $t0, $t1 li $v0, 1 syscall # Testing with diff values li $t0, -10 li $t1, 10 # Should be 0 sge $a0, $t0, $t1 li $v0, 1 syscall # Should be 1 sgeu $a0, $t0, $t1 li $v0, 1 syscall
Practica6/Practica6/practica6_c.asm
Pedejeca135/ELECTRONICA-B_UASLP
1
1167
/* * practica6_c.asm * * Created: 3/11/2020 6:51:40 PM * Author: pjco9 */ LDI r17, 0x00 STS $0027, r17 LDI r17, 0xFF STS $002A, r17 start: LDI r25,0b0111_0011 STS $002B,r25 call checa call delay_1segundo call checa LDI r25,0x7B STS $002B,r25 call checa call delay_1segundo call checa LDI r25,0x5E STS $002B,r25 call checa call delay_1segundo call checa LDI r25,0x70 STS $002B,r25 call checa call delay_1segundo call checa LDI r25,0x5C STS $002B,r25 call checa call delay_1segundo jmp start delay_1segundo: ldi r18, 82 ldi r19, 43 ldi r20, 0 L3: dec r20 brne L3 dec r19 brne L3 dec r18 brne L3 lpm nop ret checa: LDS r17, $0026 SBRC r17,0 JMP delay ret // logic delay: ldi r18, 2 ldi r19, 160 ldi r20, 147 L1: dec r20 brne L1 dec r19 brne L1 dec r18 brne L1 nop rompe: LDS r17, $0026 SBRS r17, 0 JMP delay2 jmp rompe delay2: ldi r18, 2 ldi r19, 160 ldi r20, 147 L2: dec r20 brne L2 dec r19 brne L2 dec r18 brne L2 nop jmp start
src/Data/Finitude/FinType.agda
tizmd/agda-finitary
0
16762
<filename>src/Data/Finitude/FinType.agda module Data.Finitude.FinType where open import Relation.Binary.PropositionalEquality as P using (_≡_) open import Data.Nat as ℕ open import Data.Fin as Fin using (Fin; #_) open import Data.Finitude open import Function.Equality using (_⟨$⟩_) open import Function.Injection as Inj using (Injective) open import Function.Inverse as Inv using (Inverse) open import Data.Vec open import Data.Vec.Membership.Propositional open import Data.Vec.Membership.Propositional.Properties open import Data.Vec.Membership.Propositional.Distinct as Distinct using (Distinct) record FinType {a} (A : Set a) : Set a where field size : ℕ finitude : Finitude (P.setoid A) size open import Data.Vec.Properties index : A → Fin size index = Inverse.to finitude ⟨$⟩_ index-injective : ∀ {x y} → index x ≡ index y → x ≡ y index-injective = Inverse.injective finitude enum : Fin size → A enum = Inverse.from finitude ⟨$⟩_ enum-injective : ∀ {i j} → enum i ≡ enum j → i ≡ j enum-injective = Inverse.injective (Inv.sym finitude) elems : Vec A size elems = tabulate enum elems-distinct : Distinct elems elems-distinct = Distinct.tabulate (Inverse.injection (Inv.sym finitude)) _∈elems : ∀ x → x ∈ elems x ∈elems rewrite P.sym (Inverse.left-inverse-of finitude x) = ∈-tabulate⁺ enum (index x) open FinType ⦃ ... ⦄ using (index ; _∈elems) size : ∀ {a} (A : Set a) ⦃ fin : FinType A ⦄ → ℕ size A {{ fin }} = FinType.size fin elems : ∀ {a} (A : Set a) ⦃ fin : FinType A ⦄ → Vec A (size A) elems A {{ fin }} = FinType.elems fin instance open import Data.Bool open import Data.Unit open import Data.Empty empty : FinType ⊥ empty = record { size = 0 ; finitude = record { to = P.→-to-⟶ λ() ; from = P.→-to-⟶ λ() ; inverse-of = record { left-inverse-of = λ () ; right-inverse-of = λ () } } } unit : FinType ⊤ unit = record { size = 1 ; finitude = record { to = P.→-to-⟶ λ _ → Fin.zero ; from = P.→-to-⟶ λ _ → tt ; inverse-of = record { left-inverse-of = λ _ → P.refl ; right-inverse-of = λ { Fin.zero → P.refl ; (Fin.suc ()) } } } } bool : FinType Bool bool = record { size = 2 ; finitude = record { to = P.→-to-⟶ λ { false → # 0 ; true → # 1 } ; from = P.→-to-⟶ λ { Fin.zero → false ; (Fin.suc Fin.zero) → true ; (Fin.suc (Fin.suc ())) } ; inverse-of = record { left-inverse-of = λ { false → P.refl ; true → P.refl } ; right-inverse-of = λ { Fin.zero → P.refl ; (Fin.suc Fin.zero) → P.refl ; (Fin.suc (Fin.suc ())) } } } } private bools : Vec Bool _ bools = elems Bool example : bools ≡ false ∷ true ∷ [] example = P.refl
oeis/119/A119575.asm
neoneye/loda-programs
11
160318
<reponame>neoneye/loda-programs ; A119575: Binomial(2*n,n)*(n+3)^2/(n+1). ; Submitted by <NAME>(s2) ; 9,16,50,180,686,2688,10692,42900,173030,700128,2838524,11522056,46802700,190182400,772913160,3141129780,12764118870,51857916000,210638666700,855355383960,3472419702180,14092569803520,57176602275000 mov $2,$0 seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). add $2,3 pow $2,2 mul $0,$2
Miei-sorgenti/new/Simulazione/writea.asm
DigiOhhh/LabArchitettura2-2017-2018
1
10078
<reponame>DigiOhhh/LabArchitettura2-2017-2018 # (A) Utilizzando le direttive assembly, si scriva un segmento dati che contenga: # una variabile intera a, inizializzata con un valore a piacere; # una stringa s con valore ``Fine''; # un array V di 5 elementi, dove ogni elemento è inizializzato a 1. # # (B) Si scriva poi un segmento testo che: # per i che va da 0 a 4, memorizzi il valore a+i nella posizione i dell'array; # memorizzi nella variabile a l'indirizzo del penultimo elemento dell'array; # stampi la stringa s. .data a: .word 9 s: .asciiz "Fine" .align 2 V: .word 1 1 1 1 1 .text .globl main main: la $s0, a la $s1, s la $s2, V lw $t0, ($s0) li $t1, 0 for: beq $t1, 4, continue mul $t2, $t1, 4 add $t2, $t2, $s2 lw $t3, ($t2) add $t3, $t3, $t0 sw $t3, ($t2) addi $t1, $t1, 1 j for continue: li $t0, 4 li $t1, 3 mul $t0, $t0, $t1 add $t0, $t0, $s2 lw $t0, ($t0) sw $t0, ($s0) li $v0, 4 move $a0, $s1 syscall li $v0, 10 syscall
programs/oeis/076/A076121.asm
neoneye/loda
22
17098
; A076121: Complete list of possible cribbage hands. ; 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,28,29 mov $1,$0 sub $0,7 trn $0,7 div $0,5 pow $0,2 add $0,$1
4-high/gel/source/gel-window.ads
charlie5/lace
20
11015
<filename>4-high/gel/source/gel-window.ads with gel.Keyboard.local, gel.Mouse.local, openGL.Surface, lace.Subject_and_deferred_Observer; private with ada.Calendar; package gel.Window -- -- Models a UI Window. -- is type Item is limited new lace.Subject_and_deferred_Observer.item with private; type View is access all Item'Class; --------- --- Forge -- package Forge is function new_Window (Name : in String; Width : in Positive; Height : in Positive) return View; end Forge; overriding procedure destroy (Self : in out Item); procedure free (Self : in out View); -------------- --- Exceptions -- Error : exception; -------------- --- Attributes -- function is_Open (Self : in Item) return Boolean; function is_Exposed (Self : in Item) return Boolean; function Keyboard (Self : access Item) return access gel.Keyboard.item'class; function Mouse (Self : access Item) return access gel.Mouse.item'class; function Width (Self : in Item) return Positive; function Height (Self : in Item) return Positive; function is_being_Resized (Self : in Item'Class) return Boolean; function Surface (Self : in Item) return openGL.Surface.view; -------------- --- Operations -- procedure emit_Events (Self : in out Item) is null; procedure enable_GL (Self : in Item) is null; procedure disable_GL (Self : in Item) is null; procedure swap_GL (Self : in out Item) is null; ---------- -- Events -- procedure emit_enter_Event (Self : in out Item'Class); procedure emit_leave_Event (Self : in out Item'Class); procedure emit_focus_in_Event (Self : in out Item'Class); procedure emit_focus_out_Event (Self : in out Item'Class); procedure emit_keymap_notify_Event (Self : in out Item'Class); procedure emit_Expose_Event (Self : in out Item'Class); procedure emit_graphics_Exposure_Event (Self : in out Item'Class); procedure emit_no_Exposure_Event (Self : in out Item'Class); procedure emit_visibility_Notify_Event (Self : in out Item'Class); procedure emit_create_Notify_Event (Self : in out Item'Class); procedure emit_destroy_Notify_Event (Self : in out Item'Class); procedure emit_unmap_Notify_Event (Self : in out Item'Class); procedure emit_map_Notify_Event (Self : in out Item'Class); procedure emit_map_Request_Event (Self : in out Item'Class); procedure emit_reparent_Notify_Event (Self : in out Item'Class); procedure emit_configure_Notify_Event (Self : in out Item'Class); procedure emit_configure_Request_Event (Self : in out Item'Class); procedure emit_gravity_Notify_Event (Self : in out Item'Class); procedure emit_resize_Request_Event (Self : in out Item'Class; Width, Height : in Positive); procedure emit_circulate_Notify_Event (Self : in out Item'Class); procedure emit_circulate_Request_Event (Self : in out Item'Class); procedure emit_property_Notify_Event (Self : in out Item'Class); procedure emit_selection_Clear_Event (Self : in out Item'Class); procedure emit_selection_Request_Event (Self : in out Item'Class); procedure emit_selection_Notify_Event (Self : in out Item'Class); procedure emit_colormap_Notify_Event (Self : in out Item'Class); procedure emit_client_Message_Event (Self : in out Item'Class); procedure emit_mapping_Notify_Event (Self : in out Item'Class); private type String_view is access all String; type Item is limited new lace.Subject_and_deferred_Observer.item with record Width : Positive; Height : Positive; Surface : openGL.Surface.view := new openGL.Surface.item; Keyboard : gel.Keyboard.local.view; Mouse : gel.Mouse .local.view; is_Open : Boolean := True; is_Exposed : Boolean := True; last_resize_Time : ada.Calendar.Time; end record; procedure Size_is (Self : in out Item; Width, Height : in Positive); package private_Forge is function to_Window (Name : in String; Width : in Positive; Height : in Positive) return Item; end private_Forge; type create_Window_Function is access function (Name : in String; Width : in Positive; Height : in Positive) return View; procedure use_create_Window (create_Window : in create_Window_Function); end gel.Window;
source/amf/ocl/amf-internals-ocl_expression_in_ocls.ads
svn2github/matreshka
24
26565
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Internals.OCL_Elements; with AMF.OCL.Expression_In_Ocls; with AMF.OCL.Ocl_Expressions; with AMF.OCL.Variables.Collections; with AMF.String_Collections; with AMF.UML.Behaviors; with AMF.UML.Classifiers; with AMF.UML.Comments.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Elements.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Parameterable_Elements; with AMF.UML.Parameters; with AMF.UML.String_Expressions; with AMF.UML.Template_Parameters; with AMF.UML.Types; with AMF.Visitors; package AMF.Internals.OCL_Expression_In_Ocls is type OCL_Expression_In_Ocl_Proxy is limited new AMF.Internals.OCL_Elements.OCL_Element_Proxy and AMF.OCL.Expression_In_Ocls.OCL_Expression_In_Ocl with null record; overriding function Get_Body_Expression (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access; -- Getter of ExpressionInOcl::bodyExpression. -- overriding procedure Set_Body_Expression (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access); -- Setter of ExpressionInOcl::bodyExpression. -- overriding function Get_Context_Variable (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.OCL.Variables.OCL_Variable_Access; -- Getter of ExpressionInOcl::contextVariable. -- overriding procedure Set_Context_Variable (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.OCL.Variables.OCL_Variable_Access); -- Setter of ExpressionInOcl::contextVariable. -- overriding function Get_Result_Variable (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.OCL.Variables.OCL_Variable_Access; -- Getter of ExpressionInOcl::resultVariable. -- overriding procedure Set_Result_Variable (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.OCL.Variables.OCL_Variable_Access); -- Setter of ExpressionInOcl::resultVariable. -- overriding function Get_Parameter_Variable (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.OCL.Variables.Collections.Ordered_Set_Of_OCL_Variable; -- Getter of ExpressionInOcl::parameterVariable. -- overriding function Get_Generated_Type (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Getter of ExpressionInOcl::generatedType. -- overriding procedure Set_Generated_Type (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Classifiers.UML_Classifier_Access); -- Setter of ExpressionInOcl::generatedType. -- overriding function Get_Behavior (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Behaviors.UML_Behavior_Access; -- Getter of OpaqueExpression::behavior. -- -- Specifies the behavior of the opaque expression. overriding procedure Set_Behavior (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Behaviors.UML_Behavior_Access); -- Setter of OpaqueExpression::behavior. -- -- Specifies the behavior of the opaque expression. overriding function Get_Body (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.String_Collections.Sequence_Of_String; -- Getter of OpaqueExpression::body. -- -- The text of the expression, possibly in multiple languages. overriding function Get_Language (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.String_Collections.Ordered_Set_Of_String; -- Getter of OpaqueExpression::language. -- -- Specifies the languages in which the expression is stated. The -- interpretation of the expression body depends on the languages. If the -- languages are unspecified, they might be implicit from the expression -- body or the context. Languages are matched to body strings by order. overriding function Get_Result (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Parameters.UML_Parameter_Access; -- Getter of OpaqueExpression::result. -- -- Restricts an opaque expression to return exactly one return result. -- When the invocation of the opaque expression completes, a single set of -- values is returned to its owner. This association is derived from the -- single return result parameter of the associated behavior. overriding function Get_Type (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Types.UML_Type_Access; -- Getter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding procedure Set_Type (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Types.UML_Type_Access); -- Setter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding function Get_Client_Dependency (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_String; -- Getter of NamedElement::name. -- -- The name of the NamedElement. overriding procedure Set_Name (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.Optional_String); -- Setter of NamedElement::name. -- -- The name of the NamedElement. overriding function Get_Name_Expression (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Get_Visibility (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Optional_UML_Visibility_Kind; -- Getter of NamedElement::visibility. -- -- Determines where the NamedElement appears within different Namespaces -- within the overall model, and its accessibility. overriding procedure Set_Visibility (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Optional_UML_Visibility_Kind); -- Setter of NamedElement::visibility. -- -- Determines where the NamedElement appears within different Namespaces -- within the overall model, and its accessibility. overriding function Get_Owned_Comment (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Comments.Collections.Set_Of_UML_Comment; -- Getter of Element::ownedComment. -- -- The Comments owned by this element. overriding function Get_Owned_Element (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Elements.Collections.Set_Of_UML_Element; -- Getter of Element::ownedElement. -- -- The Elements owned by this element. overriding function Get_Owner (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Elements.UML_Element_Access; -- Getter of Element::owner. -- -- The Element that owns this element. overriding function Get_Visibility (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.UML_Visibility_Kind; -- Getter of PackageableElement::visibility. -- -- Indicates that packageable elements must always have a visibility, -- i.e., visibility is not optional. overriding procedure Set_Visibility (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.UML_Visibility_Kind); -- Setter of PackageableElement::visibility. -- -- Indicates that packageable elements must always have a visibility, -- i.e., visibility is not optional. overriding function Get_Owning_Template_Parameter (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding procedure Set_Owning_Template_Parameter (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding function Get_Template_Parameter (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding procedure Set_Template_Parameter (Self : not null access OCL_Expression_In_Ocl_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding function Is_Integral (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation OpaqueExpression::isIntegral. -- -- The query isIntegral() tells whether an expression is intended to -- produce an integer. overriding function Is_Non_Negative (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation OpaqueExpression::isNonNegative. -- -- The query isNonNegative() tells whether an integer expression has a -- non-negative value. overriding function Is_Positive (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation OpaqueExpression::isPositive. -- -- The query isPositive() tells whether an integer expression has a -- positive value. overriding function Result (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Parameters.UML_Parameter_Access; -- Operation OpaqueExpression::result. -- -- Missing derivation for OpaqueExpression::/result : Parameter overriding function Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Integer; -- Operation OpaqueExpression::value. -- -- The query value() gives an integer value for an expression intended to -- produce one. overriding function Boolean_Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_Boolean; -- Operation ValueSpecification::booleanValue. -- -- The query booleanValue() gives a single Boolean value when one can be -- computed. overriding function Integer_Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_Integer; -- Operation ValueSpecification::integerValue. -- -- The query integerValue() gives a single Integer value when one can be -- computed. overriding function Is_Compatible_With (Self : not null access constant OCL_Expression_In_Ocl_Proxy; P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return Boolean; -- Operation ValueSpecification::isCompatibleWith. -- -- The query isCompatibleWith() determines if this parameterable element -- is compatible with the specified parameterable element. By default -- parameterable element P is compatible with parameterable element Q if -- the kind of P is the same or a subtype as the kind of Q. In addition, -- for ValueSpecification, the type must be conformant with the type of -- the specified parameterable element. overriding function Is_Computable (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation ValueSpecification::isComputable. -- -- The query isComputable() determines whether a value specification can -- be computed in a model. This operation cannot be fully defined in OCL. -- A conforming implementation is expected to deliver true for this -- operation for all value specifications that it can compute, and to -- compute all of those for which the operation is true. A conforming -- implementation is expected to be able to compute the value of all -- literals. overriding function Is_Null (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation ValueSpecification::isNull. -- -- The query isNull() returns true when it can be computed that the value -- is null. overriding function Real_Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_Real; -- Operation ValueSpecification::realValue. -- -- The query realValue() gives a single Real value when one can be -- computed. overriding function String_Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_String; -- Operation ValueSpecification::stringValue. -- -- The query stringValue() gives a single String value when one can be -- computed. overriding function Unlimited_Value (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.Optional_Unlimited_Natural; -- Operation ValueSpecification::unlimitedValue. -- -- The query unlimitedValue() gives a single UnlimitedNatural value when -- one can be computed. overriding function All_Namespaces (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace; -- Operation NamedElement::allNamespaces. -- -- The query allNamespaces() gives the sequence of namespaces in which the -- NamedElement is nested, working outwards. overriding function All_Owning_Packages (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant OCL_Expression_In_Ocl_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding function Qualified_Name (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return League.Strings.Universal_String; -- Operation NamedElement::qualifiedName. -- -- When there is a name, and all of the containing namespaces have a name, -- the qualified name is constructed from the names of the containing -- namespaces. overriding function Separator (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return League.Strings.Universal_String; -- Operation NamedElement::separator. -- -- The query separator() gives the string that is used to separate names -- when constructing a qualified name. overriding function All_Owned_Elements (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return AMF.UML.Elements.Collections.Set_Of_UML_Element; -- Operation Element::allOwnedElements. -- -- The query allOwnedElements() gives all of the direct and indirect owned -- elements of an element. overriding function Must_Be_Owned (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation Element::mustBeOwned. -- -- The query mustBeOwned() indicates whether elements of this type must -- have an owner. Subclasses of Element that do not require an owner must -- override this operation. overriding function Is_Template_Parameter (Self : not null access constant OCL_Expression_In_Ocl_Proxy) return Boolean; -- Operation ParameterableElement::isTemplateParameter. -- -- The query isTemplateParameter() determines if this parameterable -- element is exposed as a formal template parameter. overriding procedure Enter_Element (Self : not null access constant OCL_Expression_In_Ocl_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Leave_Element (Self : not null access constant OCL_Expression_In_Ocl_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Visit_Element (Self : not null access constant OCL_Expression_In_Ocl_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); end AMF.Internals.OCL_Expression_In_Ocls;
CSC 35/Project/project.asm
jvniorrr/CSUS-Computer-Science
0
168149
# project.asm # <NAME> # Section 01 # # 1. Assemble : as -o project.0 project.asm # 2. Link : ld -o a.out project.o csc35.0 # 3. Execute : ./a.out .intel_syntax noprefix .data # DESCRIPTIONS # description: .ascii "====================\n" .ascii "CALIFORNIA GOLD RUSH\n" .ascii "====================\n\n\0" endDescription: .ascii "====== GAME OVER ======\n\0" endDescriptionTwo: .ascii "You ended the game with $\0" endDescriptionThree: .ascii "Your endurance was \0" endDescriptionFourLove: .ascii "\nYour love was \0" endDescriptionFour: .ascii "%\n\0" rules: .ascii "1. 20 weeks (5 months)\n" .ascii "2. Your endurance and love drops 10% to 30% each week. If your endurance reaches 0%, the game ends.\n" .ascii "3. Going to camp adds 50% to 75% to your endurance, and adds 20% to 30% to your love, but costs $25 to $100.\n" .ascii "4. Staking out a new claim will cost a week of work.\n" .ascii "5. Going to the bar adds 40% to 70% to your endurance, 10% to 30% to your love, but costs $20 to $70\n" .ascii "6. Go fishing with your buddies adds 15% to 40% endurance and increases money by $5 to $20.\n\n\0" weekStatement: .ascii "WEEK \0" weeklyStatement: .ascii "\n\nIt\'s Sunday!\n" .ascii "You have $\0" # print their total money following this statement enduranceStatement: .ascii "\nYour endurance is at \0" loveStatement: .ascii "%\nYour love is at \0" gameChoices: .ascii "%" .ascii "\n1. Do Nothing, 2. Go to camp (-$25 to -$100), 3. Stake a new claim, 4. Go to the bar (-$20 to -$70), 5. Go fishing with your buddies (+$5 to +$20).\n\0" # CHARACTER MONEY AND ENDURANCE # wallet: .quad 100 endurance: .quad 100 love: .quad 150 totalGold: .quad 0 # LABELS FOR WEEKLY MINING BLOCK # minedGold: .ascii "\nYou mined $\0" minedGoldTwo: .ascii " in gold.\n\0" # LABELS FOR WEEKLY ENDURANCE BLOCK # enduranceLost: .ascii "You lost \0" enduranceLostTwo: .ascii "% endurance.\n\n\0" # LABELS FOR LOVE ENDURANCE BLOCK # loveLost: .ascii "You lost \0" loveGained: .ascii "You regained \0" loveGainedOptTwo: .ascii "\nYou regained \0" loveLostTwo: .ascii "% love.\n\0" # LABELS FOR GOING TO CAMP OPTION 2# townCost: .ascii "\nGoing to town cost you $\0" townEndurance: .ascii "\nYou regained \0" townEnduranceOptTwo: .ascii "You regained \0" townEnduranceTwo: .ascii "% endurance.\n\0" # LABELS FOR STAKE CLAIM OPTION 3 # leftClaim: .ascii "\nYou head off into the wilderness to stake a new claim. You left $\0" leftClaimTwo: .ascii " behind\n\n\0" # LABELS FOR STAKE CLAIM OPTION 4 - Going to bar # barCost: .ascii "\nGoing to the bar cost you $\0" barEndurance: .ascii "\nYou regained \0" barEnduranceOptTwo: .ascii "You regained \0" barEnduranceTwo: .ascii "% endurance.\n\0" # LABELS FOR STAKE CLAIM OPTION 5 - Going to fish # fishCost: .ascii "\nAfter going fishing with friends, you gained $\0" fishEndurance: .ascii "\nYou regained \0" fishEnduranceTwo: .ascii "% endurance.\n\0" # LABELS FOR ASCII ART # asciiArtTwo: .ascii " .88888888:.\n" .ascii " 88888888.88888.\n" .ascii " .8888888888888888.\n" .ascii " 888888888888888888\n" .ascii " 88' _`88'_ `88888\n" .ascii " 88 88 88 88 88888\n" .ascii " 88_88_::_88_:88888\n" .ascii " 88:::,::,:::::8888\n" .ascii " 88`:::::::::'`8888\n" .ascii " .88 `::::' 8:88.\n" .ascii " 8888 `8:888.\n" .ascii " .8888' `888888.\n" .ascii " .8888:.. .::. ...:'8888888:.\n" .ascii " .8888.' :' `'::`88:88888\n" .ascii " .8888 ' `.888:8888.\n" .ascii " 888:8 . 888:88888\n" .ascii " .888:88 .: 888:88888:\n" .ascii " 8888888. :: 88:888888\n" .ascii " `.::.888. :: .88888888\n" .ascii " .::::::.888. :: :::`8888'.:.\n" .ascii " ::::::::::.888 ' .::::::::::::\n" .ascii " ::::::::::::.8 ' .:8::::::::::::.\n" .ascii " .::::::::::::::. .:888:::::::::::::\n" .ascii " :::::::::::::::88:.__..:88888:::::::::::'\n" .ascii " `'.:::::::::::88888888888.88:::::::::'\n" .ascii " `':::_:' -- '' -'-' `':_::::'`\n\n\0" asciiHappyFace: .ascii " oooo$$$$$$$$$$$$oooo\n" .ascii " oo$$$$$$$$$$$$$$$$$$$$$$$$o\n" .ascii " oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$\n" .ascii " o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$\n" .ascii "oo $ $ \"$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$\n" .ascii "\"$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$\n" .ascii " $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$\n" .ascii " $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ \"\"\"$$$\n" .ascii " \"$$$\"\"\"\"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \"$$$\n" .ascii " $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \"$$$o\n" .ascii " o$$\" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o\n" .ascii " $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\" \"$$$$$$ooooo$$$$o\n" .ascii " o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$\n" .ascii " $$$$$$$$\"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$\"\"\"\"\"\"\"\"\n" .ascii " \"\"\"\" $$$$ \"$$$$$$$$$$$$$$$$$$$$$$$$$$$$\" o$$$\n" .ascii " \"$$$o \"\"\"$$$$$$$$$$$$$$$$$$\"$$\" $$$\n" .ascii " $$$o \"$$\"\"$$$$$$\"\"\"\" o$$$\n" .ascii " $$$$o o$$$\"\n" .ascii " \"$$$$o o$$$$$$o\"$$$$o o$$$$\n" .ascii " \"$$$$$oo \"\"$$$$o$$$$$o o$$$$\"\"\n" .ascii " \"\"$$$$$oooo \"$$$o$$$$$$$$$\"\"\"\n" .ascii " \"\"$$$$$$$oo $$$$$$$$$$\n" .ascii " \"\"\"\"$$$$$$$$$$$\n" .ascii " $$$$$$$$$$$$\n" .ascii " $$$$$$$$$$\"\n" .ascii " \"$$$\"\"\"\"\n\n\0" asciiGoodBye: .ascii " bbyyeebb \n" .ascii " yy8888888888 \n" .ascii " bb888888 \n" .ascii " 8888 \n" .ascii " 8888 bb \n" .ascii " 8888 8888 \n" .ascii " 8888 8888 \n" .ascii " ee88bb 8888eeee8888 yy888888yy 8888 88 \n" .ascii " 8888 888888888888888888 8888888888888888 8888 88 \n" .ascii " 8888 888888bb 8888yy 88888888 88888888888888 8888 88 \n" .ascii " 8888 888888yy 8888 888888 bb8888yyyy 88888888e 8888 88 \n" .ascii " ee8888yyyy888888888888 8888 888888yy 888888 8888 bb8888 8888 \n" .ascii " bb88888888888888bb 8888888888888888bb 8888 888 bee88888888ee8888yy 8888 \n" .ascii " bb yy88888888bbyybb 8888 888 88888yy 888888bb 8888ee88 \n" .ascii " yy888888888888888888 8888 ee88bb 888888888888 yy \n" .ascii " bbbb888888eeeebb 8888 yy8888bb 8888 888888 8888 \n" .ascii " 8888 bb888888ee 8888 yy88bb 8888 yybbyyyybb \n" .ascii " 8888bb bb8888yy8888 88 8888 8888 8888 bbyy8888888888yy \n" .ascii " 888888888888bb 8888 88 8888 8888bb 8888 yy88888888888888yy \n" .ascii " yyeeeebb ee88 ee88ee bb88ee 888888yy 88yy bb8888yy 888888 \n" .ascii " yy88888888888888 bb88888888yy888888bb ee88bbbb 8888bb \n" .ascii " yy8888888888bb ee888888888888 88yyyy8888eeee888888bb \n" .ascii " yybbyy yybbyy8888 88 yy8888888888eebb \n" .ascii " 88bb 88 yy88eeeebbbb \n" .ascii " 88 8888 \n" .ascii " 88 yy8888yy \n" .ascii " 88 bb8888888888888888888888\n" .ascii " 88 ee88ee888888888888bb\n" .ascii " 8888 yyyybbeeyy \n" .ascii " 8888 \n" .ascii " bb88ee ee88yy \n" .ascii " 8888yy8888ee88888888 \n" .ascii " 888888888888888888bb \n" .ascii " yy888888ee88ee88bb \n\n\0" .text .global _start _start: # --------------------------------------------- # ASCII ART w/ COLOR # --------------------------------------------- InitializehappyFaceArtLoopColor: lea rcx, asciiHappyFace call LengthStringZ # get the length of string to iterate it mov r8, rcx mov rdi, 0 # set a counter variable so dont pass index happyFaceArtLoop: # add break if not its infinite loop cmp r8, rdi je InitializeLetterLoopColor mov rcx, 7 call Random # get a random color to print the text call SetForeColor # Set the text color movb cl, [asciiHappyFace+rdi] # load the ascii character and print call PrintChar add rdi, 1 # increment rdi or our index jmp happyFaceArtLoop # jump back to while loop # --------------------------------------------- # COLORFUL TEXT INTRO # --------------------------------------------- InitializeLetterLoopColor: lea rcx, description call LengthStringZ # get the length of string to iterate it mov r8, rcx mov rdi, 0 # set a counter variable so dont pass index LetterLoop: # add break if not its infinite loop cmp r8, rdi je Initialize mov rcx, 7 call Random # get a random color to print the text call SetForeColor # Set the text color movb cl, [description+rdi] # load the ascii character and print call PrintChar add rdi, 1 # increment rdi or our index jmp LetterLoop # jump back to while loop Initialize: # reset text color mov rcx, 7 call SetForeColor lea rcx, rules call PrintStringZ # print the rules of the game # setup the initial gold stake claim mov rcx, 1001 call Random mov totalGold, rcx # use a pre defined register to store a counter variable mov rax, 0 # COUNTER = rax jmp mainGame mainGame: add rax, 1 # add to our counter variable mov rcx, rax cmpq rcx, 21 je end # end the game after the 20th week # add a check for endurance to see if its lower than 0 mov rcx, endurance cmpq rcx, 0 jle end # change the color mov rcx, 6 # register, color cyan call SetForeColor lea rcx, weekStatement call PrintStringZ mov rcx, rax call PrintInt # print "Week X" # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, weeklyStatement call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, wallet call PrintInt # print "You have $XXX" # change the color mov rcx, 7 # register, color white / reset call SetForeColor lea rcx, enduranceStatement call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, endurance call PrintInt # print "Your endurance is at XX%" # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, loveStatement call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, love call PrintInt # print "Your love is at XX%" # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, gameChoices call PrintStringZ # print "1. Do Nothing, 2. Go to camp (-$25 to -$100), 3. Stake a new claim, 4. Go to the bar (-$20 to -$70), 5. Go fishing with your buddies (+$5 to +$20)" # retrieve input from user for game choice # change the color mov rcx, 1 # register, color red call SetForeColor call ScanInt cmpq rcx, 1 je weeklyMine # if choice is to do nothing cmpq rcx, 2 je goToCamp # if choice is to go to camp cmpq rcx, 3 je stakeNewClaim # if the choice is to stake a new claim cmpq rcx, 4 je goToBar # if the choice is to go the bar cmpq rcx, 5 je goToFish # if the choice is to go the fish goToFish: # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, fishCost call PrintStringZ # print "Going fishing with friends gained you $XX" # change the color mov rcx, 2 # register, color green call SetForeColor # the net gain of fishing is between 5-20 mov rcx, 16 call Random add rcx, 5 # create a random number variable storing num between 5-20 call PrintInt add wallet, rcx # add the gain after fishing to users wallet # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, fishEndurance call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor # the cost of going fishing is + 15-40 endurance mov rcx, 26 call Random add rcx, 15 call PrintInt add endurance, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, fishEnduranceTwo call PrintStringZ # print "You regained XX% endurance" jmp weeklyMine goToBar: # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, barCost call PrintStringZ # print "Going to the bar cost you $XX" # change the color mov rcx, 2 # register, color green call SetForeColor # the cost of going to the bar is between 20-70 mov rcx, 51 call Random add rcx, 20 # create a random number variable storing num between 20-70 call PrintInt sub wallet, rcx # subtract the cost of going to twon from users wallet # change the color mov rcx, 7 # register, color white call SetForeColor # print after going to the bar you gained love lea rcx, loveGainedOptTwo call PrintStringZ # remove love from the user for going to camp # change the color mov rcx, 2 # register, color green call SetForeColor # the result of going to camp is love between 10 to 30% for seeing family mov rcx, 21 call Random add rcx, 10 call PrintInt add love, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, loveLostTwo call PrintStringZ # print You regained X% endurance lea rcx, barEnduranceOptTwo call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor # the cost of going to camp is + 40-70 endurance mov rcx, 31 call Random add rcx, 40 call PrintInt add endurance, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, barEnduranceTwo call PrintStringZ # print "You regained XX% endurance" jmp weeklyMine goToCamp: # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, townCost call PrintStringZ # print "Going to town cost you $XX" # change the color mov rcx, 2 # register, color green call SetForeColor # the cost of going to camp is between 25-100 mov rcx, 76 call Random add rcx, 25 # create a random number variable storing num between 20-100 call PrintInt sub wallet, rcx # subtract the cost of going to twon from users wallet # change the color mov rcx, 7 # register, color white/reset call SetForeColor # print after going to camp you gained love; using townEndurance since it has a new lin it which we need lea rcx, townEndurance call PrintStringZ # remove love from the user for going to camp # change the color mov rcx, 2 # register, color green call SetForeColor # the result of going to camp is love between 20 to 30% for seeing family mov rcx, 11 call Random add rcx, 20 call PrintInt add love, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, loveLostTwo call PrintStringZ # change the color mov rcx, 7 # register, color white call SetForeColor # print the endurance the user gained lea rcx, townEnduranceOptTwo call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor # the cost of going to camp is 50-75 endurance mov rcx, 26 call Random add rcx, 50 call PrintInt add endurance, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, townEnduranceTwo call PrintStringZ # print "You regained XX% endurance" jmp weeklyMine stakeNewClaim: # change the color mov rcx, 7 # register, color white/reset call SetForeColor # -if user claims new stake create random value for our totalGold lea rcx, leftClaim # Print "You head off into the wilderness to stake a new claim. You left $XX begind" call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, totalGold call PrintInt # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, leftClaimTwo call PrintStringZ mov rcx, 1001 call Random mov totalGold, rcx # store the total gold at a site jmp wearAndTear weeklyMine: # change the color mov rcx, 7 # register, color white/reset call SetForeColor # you mined $16 in gold lea rcx, minedGold call PrintStringZ # the user mined X amount from the total stake # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, totalGold call Random call PrintInt # subtract the mined amount from total stake sub totalGold, rcx add wallet, rcx # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, minedGoldTwo call PrintStringZ jmp wearAndTear wearAndTear: # remove love because away from family lea rcx, loveLost call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor # create a random variable to get the endurance lost (value between 10-30) mov rcx, 21 call Random add rcx, 10 sub love, rcx call PrintInt # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, loveLostTwo call PrintStringZ lea rcx, enduranceLost call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor # create a random variable to get the endurance lost (value between 10-30) mov rcx, 21 call Random add rcx, 10 sub endurance, rcx call PrintInt # change the color mov rcx, 7 # register, color white call SetForeColor lea rcx, enduranceLostTwo call PrintStringZ jmp mainGame end: lea rcx, endDescription call PrintStringZ lea rcx, endDescriptionTwo call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, wallet call PrintInt # change the color mov rcx, 7 # register, color white/reset call SetForeColor # print your love was at end lea rcx, endDescriptionFourLove call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, love call PrintInt # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, endDescriptionFour call PrintStringZ lea rcx, endDescriptionThree call PrintStringZ # change the color mov rcx, 2 # register, color green call SetForeColor mov rcx, endurance call PrintInt # change the color mov rcx, 7 # register, color white/reset call SetForeColor lea rcx, endDescriptionFour call PrintStringZ # --------------------------------------------- # ASCII ART w/ COLOR # --------------------------------------------- InitializeGoodByeColor: lea rcx, asciiGoodBye call LengthStringZ # get the length of string to iterate it mov r8, rcx mov rdi, 0 # set a counter variable so dont pass index GoodByeLoop: # add break if not its infinite loop cmp r8, rdi je CompleteEnd mov rcx, 7 call Random # get a random color to print the text call SetForeColor # Set the text color movb cl, [asciiGoodBye+rdi] # load the ascii character and print call PrintChar add rdi, 1 # increment rdi or our index jmp GoodByeLoop # jump back to while loop CompleteEnd: # change the color mov rcx, 7 # register, color white/reset call SetForeColor call Exit
programs/oeis/164/A164346.asm
karttu/loda
1
24097
<reponame>karttu/loda<filename>programs/oeis/164/A164346.asm ; A164346: a(n) = 3 * 4^n. ; 3,12,48,192,768,3072,12288,49152,196608,786432,3145728,12582912,50331648,201326592,805306368,3221225472,12884901888,51539607552,206158430208,824633720832,3298534883328,13194139533312,52776558133248,211106232532992,844424930131968,3377699720527872 mov $1,4 pow $1,$0 mul $1,3
Source/Levels/L0213.asm
AbePralle/FGB
0
174775
; L0213.asm storming moonbase obliteration ; Generated 07.09.2000 by mlevel ; Modified 07.31.2000 by <NAME> INCLUDE "Source/Defs.inc" INCLUDE "Source/Levels.inc" ;--------------------------------------------------------------------- SECTION "Level0213Section",ROMX ;--------------------------------------------------------------------- L0213_Contents:: DW L0213_Load DW L0213_Init DW L0213_Check DW L0213_Map ;--------------------------------------------------------------------- ; Load ;--------------------------------------------------------------------- L0213_Load: DW ((L0213_LoadFinished - L0213_Load2)) ;size L0213_Load2: call ParseMap ret L0213_LoadFinished: ;--------------------------------------------------------------------- ; Map ;--------------------------------------------------------------------- L0213_Map: INCBIN "Data/Levels/L0213_intro_ba3.lvl" ;--------------------------------------------------------------------- ; Init ;--------------------------------------------------------------------- VAR_LIGHT EQU 0 VAR_STATIC EQU 1 VAR_FACEON EQU 2 MONITORINDEX EQU 36 LIGHTINDEX EQU 40 FACEINDEX EQU 44 STATICINDEX EQU 48 L0213_Init: DW ((L0213_InitFinished - L0213_Init2)) ;size L0213_Init2: ld a,[bgTileMap+LIGHTINDEX] ;tile index of first light ld [levelVars+VAR_LIGHT],a ld a,[bgTileMap+STATICINDEX] ;tile index of monitor ld [levelVars+VAR_STATIC],a xor a ld [levelVars+VAR_FACEON],a ;have general gyro face west ld bc,classGeneralGyro call FindClassIndex ld c,a call GetFirst ld a,DIR_WEST call SetFacing ld b,METHOD_DRAW call CallMethod ld bc,classGeneralGyro ld de,classDoNothing call ChangeClass ret L0213_InitFinished: ;--------------------------------------------------------------------- ; Check ;--------------------------------------------------------------------- L0213_Check: DW ((L0213_CheckFinished - L0213_Check2)) ;size L0213_Check2: ;animate dice lights ld a,[levelVars+VAR_LIGHT] ld b,a ;slow lights ldio a,[updateTimer] swap a and %00000011 add b ld hl,bgTileMap+LIGHTINDEX call ((.updateTwoLights - L0213_Check2) + levelCheckRAM) ;fast lights ldio a,[updateTimer] swap a rlca and %00000011 add b call ((.updateTwoLights - L0213_Check2) + levelCheckRAM) ;animate static ld a,[levelVars+VAR_STATIC] ld b,a ldio a,[updateTimer] rrca and %00000010 add b ld hl,bgTileMap+STATICINDEX ld [hl+],a inc a ld [hl+],a ;----cycle monitor displays----------------------------------- ld a,MAPBANK ldio [$ff70],a ;pick a random location ld a,22 call GetRandomNumZeroToN ;ld a,31 ;call GetRandomNumMask ;cp 23 ;jr nc,.afterScreen sla a ld d,0 ld e,a ld hl,((.monitorLocations-L0213_Check2)+levelCheckRAM) add hl,de ld a,[hl+] ld h,[hl] ld l,a ;is this static? ld a,[hl] cp STATICINDEX jr z,.staticToFace ;is this the face? ld a,[hl] cp FACEINDEX jr z,.turnOffFace ;is the face on elsewhere? ld a,[levelVars+VAR_FACEON] or a jr nz,.afterScreen ;face is on; skip ;turn this to static to become the face ld a,1 ld [levelVars+VAR_FACEON],a ld a,STATICINDEX jr .pickedScreen .turnOffFace xor a ld [levelVars+VAR_FACEON],a ld a,MONITORINDEX ;monitor jr .pickedScreen .staticToFace ld a,FACEINDEX ;face .pickedScreen ld [hl+],a inc a ld [hl+],a inc a cp STATICINDEX+2 jr nz,.afterStaticCheck sub 2 .afterStaticCheck ld de,30 ;map pitch add hl,de ld [hl+],a inc a ld [hl+],a .afterScreen ;----Check to see if confronting General Gyro----------------- ld hl,hero0_data call ((.checkConfrontGyro - L0213_Check2) + levelCheckRAM) ld hl,hero1_data call ((.checkConfrontGyro - L0213_Check2) + levelCheckRAM) ret .updateTwoLights ld [hl+],a call ((.incCount4 - L0213_Check2) + levelCheckRAM) ld [hl+],a ret .incCount4 sub b inc a and %00000011 add b ret .checkConfrontGyro inc hl ld a,[hl-] or a ;look at the hero class index I've been given ret z ;not present if zero ld c,a ;save class index ld a,[hl] ;get my joy index ld [dialogJoyIndex],a ;save that in case I talk ld de,HERODATA_TYPE add hl,de ld a,[hl] ;get my type ld [dialogSpeakerIndex],a ;save that for talking too ;get my object then my zone call GetFirst call GetCurZone cp 9 ;in same zone as Gyro? ret nz ;all for naught ld hl,$1302 ;next level ld a,l ld [curLevelIndex],a ld a,h ld [curLevelIndex+1],a call YankRemotePlayer ld a,1 ld [timeToChangeLevel],a ret .monitorLocations DW $d021,$d033,$d056,$d058,$d05a,$d05c ;6 DW $d262,$d264,$d266 ;3 DW $d2d2,$d312,$d352,$d392 ;4 DW $d255,$d295,$d2d5,$d315,$d355,$d395 ;6 DW $d25c,$d29c,$d2dc,$d31c ;4 23 L0213_CheckFinished: PRINT "0213 Script Sizes (Load/Init/Check) (of $500): " PRINT (L0213_LoadFinished - L0213_Load2) PRINT " / " PRINT (L0213_InitFinished - L0213_Init2) PRINT " / " PRINT (L0213_CheckFinished - L0213_Check2) PRINT "\n"
Find Interlaced Videos.scpt
verbiate/Find-Interlaced-Videos
0
362
<gh_stars>0 tell application "Finder" to set folderRoot to (choose folder with prompt "Please select directory.") on returnNumbersInString(inputString) set s to quoted form of inputString do shell script "sed s/[a-zA-Z\\']//g <<< " & s's quoted form set dx to the result set numlist to {} repeat with i from 1 to count of words in dx set this_item to word i of dx try set this_item to this_item as number set the end of numlist to this_item end try end repeat return numlist end returnNumbersInString on gimmieFilesInSubfolders(inputFolder) tell application "Finder" to get every file in the entire contents of (inputFolder) as alias list end gimmieFilesInSubfolders set filePile to gimmieFilesInSubfolders(folderRoot) repeat with theFile in filePile --do shell script "echo " & theFile & " >>~/Desktop/test.txt" try set this_posix_item to (the POSIX path of (theFile)) log this_posix_item tell application "System Events" --set path_only to POSIX path of ((container of theFile) as text) -- set path_only to characters 1 thru -((offset of "/" in (reverse of items of this_posix_item as string)) + 1) of this_posix_item as string -- log path_only end tell set filename_only to do shell script "basename " & quoted form of this_posix_item -- do shell script ("cd " & quoted form of path_only) -- delay 1 set output to do shell script ("/usr/local/bin/ffmpeg -y -i " & quoted form of this_posix_item & " -map 0:v:0 -filter:v idet -frames:v 500 -an -f rawvideo /dev/null 2>&1") set text item delimiters to {"Multi frame detection:"} set trimmedNums to text items 2 thru 2 of output as string log trimmedNums -- set output to do shell script ("ls") --do shell script "echo " & output & " >>~/Desktop/test.txt" set justNums to returnNumbersInString(trimmedNums) --log justNums set tffValue to the first item of justNums --log tffValue set bffValue to the second item of justNums --log bffValue set progValue to the (third item of justNums) + 5 --Margin of error for text files --log progValue set isVideoInterlaced to false if progValue is less than tffValue then set isVideoInterlaced to true log isVideoInterlaced do shell script "echo TFF: " & this_posix_item & " >>~/Desktop/Interlaced.txt" log "TFF" else if progValue is less than bffValue then set isVideoInterlaced to true log isVideoInterlaced do shell script "echo BFF: " & this_posix_item & " >>~/Desktop/Interlaced.txt" log "BFF" end if end try end repeat display dialog "Done scanning this folder and subfolders for interlaced files. Check Interlaced.txt on the desktop for the full list." --beep --log "Done scanning this folder and subfolders for interlaced files"
programs/oeis/077/A077020.asm
karttu/loda
1
98829
; A077020: a(n) is the unique odd positive solution x of 2^n = 7x^2+y^2. ; 1,1,1,3,1,5,7,3,17,11,23,45,1,91,89,93,271,85,457,627,287,1541,967,2115,4049,181,8279,7917,8641,24475,7193,41757,56143,27371,139657,84915,194399,364229,24569,753027,703889,802165,2209943,605613,3814273,5025499,2603047,12654045,7447951,17860139,32756041,2964237,68476319,62547845,74404793,199500483,50690897,348310069,449691863,246928275,1146312001,652455451,1640168551,2945079453,335257649,6225416555,5554901257,6895931853,18005734367,4213870661,31797598073,40225339395,23369856751,103820535541,57080822039,150560249043,264721893121,36398604965,565842391207,493045181277,638639601137,1624729963691,347450761417,2902009165965,3596910688799,2207107643131,9400929020729,4986713734467,13815144306991,23788571775925,3841716838057,51418860389907,43735426713793,59102294066021,146573147493607,28368559361565,264777735625649,321514854348779,208040616902519,851070325600077,434989091795039,1267151559405115,2137129742995193,397173375815037,4671432861805423,3877086110175349,5465779613435497 cal $0,76632 ; Solve 2^n - 2 = 7(x^2 - x) + (y^2 - y) for (x,y) with x>0, y>0; sequence gives value of x. mov $1,$0 sub $1,1 mul $1,2 add $1,1
45/beef/cw/kernel/glock.asm
minblock/msdos
0
26829
;* ;* COW : Character Oriented Windows ;* ;* glock.asm : Global memory allocator - Locking procedures .xlist include kernel.inc include galloc.inc .list sBegin KERNEL assumes CS,KERNEL assumes DS,NOTHING ;* DS usually points to MOB assumes SS,DATA ;* get variables from here ;* * low level subroutines externNP <glock,gunlock> ; GMEM.ASM externNP <xhandle> ; GWINTERF.ASM ; The remainder of this file implements the exported interface to the ; global memory manager. ; HANDLE far PASCAL LockSegment( WORD ); ; HANDLE far PASCAL UnlockSegment( WORD ); ; char far * far PASCAL GlobalLock( HANDLE ); ; BOOL far PASCAL GlobalUnlock( HANDLE ); cPublic LockSegment ; parmW seg cBegin nogen call xhandle ; Get handle jz xhandlex ; Ignore invalid or discarded objects call glock jmp short xhandlex cEnd nogen ;LockSegment cPublic UnlockSegment ; parmW seg cBegin nogen call xhandle ; Get handle jz xhandlex ; Ignore invalid or discarded objects call gunlock jmp short xhandlex cEnd nogen ;UnlockSegment cPublic GlobalLock ; parmW h cBegin nogen lock0: call xhandle ; Call ghandle with handle in DX jz lock1 ; Ignore invalid or discarded objects IFDEF DEBUG cmp ch,0FFh ; Debugging check for count overflow jne lock_ok cCall CowAssertFailed DB "GlobalLock: Object usage count overflow$" lock_ok: ENDIF ;DEBUG call glock ; Increment lock count lock1: xor ax,ax mov cx,dx xhandlex: dec ds:[di].gi_lrulock pop di pop ds ret 2 cEnd nogen ;GlobalLock cPublic GlobalUnlock ; parmW h cBegin nogen call xhandle ; Call ghandle with handle in DX jz xhandlex ; Ignore invalid or discarded objects IFDEF DEBUG cmp ch,00h ; Debugging check for count underflow jne unlock_ok cCall CowAssertFailed DB "Global Unlock underflow$" unlock_ok: ENDIF ;DEBUG call gunlock mov ax,cx jmp xhandlex cEnd nogen ;GlobalUnlock sEnd KERNEL END
test/autogen/gen_i8080.asm
tgtakaoka/libasm
15
97608
<filename>test/autogen/gen_i8080.asm ;;; AUTO GENERATED FILE ;;; generated by: gen_i8080 -u -C 8080 -o gen_i8080.asm -l gen_i8080.lst CPU 8080 ORG 0100H NOP LXI B, 0302H STAX B INX B INR B DCR B MVI B, 7 RLC DAD B LDAX B DCX B INR C DCR C MVI C, 15 RRC LXI D, 1312H STAX D INX D INR D DCR D MVI D, 23 RAL DAD D LDAX D DCX D INR E DCR E MVI E, 31 RAR LXI H, 2322H SHLD 2423H INX H INR H DCR H MVI H, 27H DAA DAD H LHLD 2C2BH DCX H INR L DCR L MVI L, 2FH CMA LXI SP, 3332H STA 3433H INX SP INR M DCR M MVI M, 37H STC DAD SP LDA 3C3BH DCX SP INR A DCR A MVI A, 3FH CMC MOV B, B MOV B, C MOV B, D MOV B, E MOV B, H MOV B, L MOV B, M MOV B, A MOV C, B MOV C, C MOV C, D MOV C, E MOV C, H MOV C, L MOV C, M MOV C, A MOV D, B MOV D, C MOV D, D MOV D, E MOV D, H MOV D, L MOV D, M MOV D, A MOV E, B MOV E, C MOV E, D MOV E, E MOV E, H MOV E, L MOV E, M MOV E, A MOV H, B MOV H, C MOV H, D MOV H, E MOV H, H MOV H, L MOV H, M MOV H, A MOV L, B MOV L, C MOV L, D MOV L, E MOV L, H MOV L, L MOV L, M MOV L, A MOV M, B MOV M, C MOV M, D MOV M, E MOV M, H MOV M, L HLT MOV M, A MOV A, B MOV A, C MOV A, D MOV A, E MOV A, H MOV A, L MOV A, M MOV A, A ADD B ADD C ADD D ADD E ADD H ADD L ADD M ADD A ADC B ADC C ADC D ADC E ADC H ADC L ADC M ADC A SUB B SUB C SUB D SUB E SUB H SUB L SUB M SUB A SBB B SBB C SBB D SBB E SBB H SBB L SBB M SBB A ANA B ANA C ANA D ANA E ANA H ANA L ANA M ANA A XRA B XRA C XRA D XRA E XRA H XRA L XRA M XRA A ORA B ORA C ORA D ORA E ORA H ORA L ORA M ORA A CMP B CMP C CMP D CMP E CMP H CMP L CMP M CMP A RNZ POP B JNZ 0C4C3H JMP 0C5C4H CNZ 0C6C5H PUSH B ADI 0C7H RST 0 RZ RET JZ 0CCCBH CZ 0CECDH CALL 0CFCEH ACI 0CFH RNC POP D JNC 0D4D3H OUT 0D4H CNC 0D6D5H PUSH D SUI 0D7H RC JC 0DCDBH IN 0DCH CC 0DEDDH SBI 0DFH RPO POP H JPO 0E4E3H XTHL CPO 0E6E5H PUSH H ANI 0E7H RPE PCHL JPE 0ECEBH XCHG CPE 0EEEDH XRI 0EFH RP POP PSW JP 0F4F3H DI CP 0F6F5H PUSH PSW ORI 0F7H RM SPHL JM 0FCFBH EI CM 0FEFDH CPI 0FFH
orka_simd/src/x86/generic/orka-simd-avx-doubles-math.adb
onox/orka
52
9956
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2017 onox <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Orka.SIMD.AVX.Doubles.Arithmetic; with Orka.SIMD.AVX.Doubles.Swizzle; package body Orka.SIMD.AVX.Doubles.Math is function Cross_Product (Left, Right : m256d) return m256d is use SIMD.AVX.Doubles.Arithmetic; use SIMD.AVX.Doubles.Swizzle; function Shuffle (Elements : m256d) return m256d with Inline; function Shuffle (Elements : m256d) return m256d is Mask_1_0_1_0 : constant Unsigned_32 := 1 or 0 * 2 or 1 * 4 or 0 * 8; Mask_1_2_0_0 : constant Unsigned_32 := 1 or 2 * 16 or 0 * 8 or 0 * 128; Mask_0_1_1_1 : constant Unsigned_32 := 0 or 1 * 2 or 1 * 4 or 1 * 8; YXWZ : constant m256d := Permute_Within_Lanes (Elements, Mask_1_0_1_0); WZXY : constant m256d := Permute_Lanes (YXWZ, Elements, Mask_1_2_0_0); YZXY : constant m256d := Blend (YXWZ, WZXY, Mask_0_1_1_1); begin return YZXY; end Shuffle; Left_YZX : constant m256d := Shuffle (Left); Right_YZX : constant m256d := Shuffle (Right); -- Z := Left (X) * Right (Y) - Left (Y) * Right (X) -- X := Left (Y) * Right (Z) - Left (Z) * Right (Y) -- Y := Left (Z) * Right (X) - Left (X) * Right (Z) Result_ZXY : constant m256d := Left * Right_YZX - Left_YZX * Right; begin return Shuffle (Result_ZXY); end Cross_Product; end Orka.SIMD.AVX.Doubles.Math;
kernel/arch/i386/sys/idt-asm.asm
foliagecanine/tritium-os
17
1482
<reponame>foliagecanine/tritium-os<gh_stars>10-100 global irq0 global irq1 global irq2 global irq3 global irq4 global irq5 global irq6 global irq7 global irq8 global irq9 global irq10 global irq11 global irq12 global irq13 global irq14 global irq15 global default_handler global load_idt ;global irq0_handler ;global irq1_handler ;global irq2_handler ;global irq3_handler ;global irq4_handler ;global irq5_handler ;global irq6_handler ;global irq7_handler ;global irq8_handler ;global irq9_handler ;global irq10_handler ;global irq11_handler ;global irq12_handler ;global irq13_handler ;global irq14_handler ;global irq15_handler extern irq0_handler extern irq1_handler extern irq2_handler extern irq3_handler extern irq4_handler extern irq5_handler extern irq6_handler extern irq7_handler extern irq8_handler extern irq9_handler extern irq10_handler extern irq11_handler extern irq12_handler extern irq13_handler extern irq14_handler extern irq15_handler extern unhandled_interrupt extern exception_page_fault extern temp_tss extern new_temp_tss extern ready_esp extern fxsave_region extern syscall_temp_tss extern run_syscall global switch_task global run_syscall_asm orig_eax dd 0 retaddr dd 0 errcode dd 0 global page_fault page_fault: mov dword [orig_eax],eax pop eax mov dword [errcode],eax mov [ready_esp],esp pop eax mov dword [retaddr],eax push eax mov eax, dword [orig_eax] pusha mov eax, dword [errcode] push eax mov eax, dword [retaddr] push eax call exception_page_fault popa iret switch_task: mov esp,dword [ready_esp] fxsave [fxsave_region] add esp,0xC pop eax mov eax,dword [new_temp_tss+56] ;esp push eax sub esp,0xC pop eax mov eax,dword [new_temp_tss+32] ;eip push eax mov eax,dword [new_temp_tss+36] ;eflags push eax popf mov eax,dword [new_temp_tss+40] mov ebx,dword [new_temp_tss+52] mov ecx,dword [new_temp_tss+44] mov edx,dword [new_temp_tss+48] mov edi,dword [new_temp_tss+68] mov esi,dword [new_temp_tss+64] mov ebp,dword [new_temp_tss+60] fxrstor [fxsave_region] iret run_syscall_asm: mov dword [ready_esp],esp fxsave [fxsave_region] mov dword [syscall_temp_tss+40],eax mov dword [syscall_temp_tss+52],ebx mov dword [syscall_temp_tss+44],ecx mov dword [syscall_temp_tss+48],edx mov dword [syscall_temp_tss+68],edi mov dword [syscall_temp_tss+64],esi mov dword [syscall_temp_tss+60],ebp pushf pop eax mov dword [syscall_temp_tss+36],eax ;eflags pop eax push eax mov dword [syscall_temp_tss+32],eax ;eip add esp,0xC pop eax push eax sub esp,0xC mov dword [syscall_temp_tss+56],eax ;esp mov eax, dword [syscall_temp_tss+40] call run_syscall ;mov esp,dword [ready_esp] ; I have no clue why, but ready_esp can be clobbered. ready_esp should only be used by task switching now. add esp,0xC pop ebx mov ebx,dword [syscall_temp_tss+56] ;esp push ebx sub esp,0xC pop ebx mov ebx,dword [syscall_temp_tss+32] ;eip push ebx mov ebx,dword [syscall_temp_tss+36] ;eflags push ebx popf mov ebx,dword [syscall_temp_tss+52] mov ecx,dword [syscall_temp_tss+44] mov edx,dword [syscall_temp_tss+48] mov edi,dword [syscall_temp_tss+68] mov esi,dword [syscall_temp_tss+64] mov ebp,dword [syscall_temp_tss+60] fxrstor [fxsave_region] iret irq0: mov dword [ready_esp],esp mov dword [temp_tss+40],eax mov dword [temp_tss+52],ebx mov dword [temp_tss+44],ecx mov dword [temp_tss+48],edx mov dword [temp_tss+68],edi mov dword [temp_tss+64],esi mov dword [temp_tss+60],ebp pushf pop eax mov dword [temp_tss+36],eax ;eflags pop eax push eax mov dword [temp_tss+32],eax ;eip add esp,0xC pop eax push eax sub esp,0xC mov dword [temp_tss+56],eax ;esp mov eax, dword [temp_tss+40] pusha call irq0_handler popa iret irq1: pusha call irq1_handler popa iret irq2: pusha call irq2_handler popa iret irq3: pusha call irq3_handler popa iret irq4: pusha call irq4_handler popa iret irq5: pusha call irq5_handler popa iret irq6: pusha call irq6_handler popa iret irq7: pusha call irq7_handler popa iret irq8: pusha call irq8_handler popa iret irq9: pusha call irq9_handler popa iret irq10: pusha call irq10_handler popa iret irq11: pusha call irq11_handler popa iret irq12: pusha call irq12_handler popa iret irq13: pusha call irq13_handler popa iret irq14: pusha call irq14_handler popa iret irq15: pusha call irq15_handler popa iret default_handler: pusha call unhandled_interrupt popa iret load_idt: mov edx, [esp + 4] lidt [edx] sti ret global test_int test_int: xor eax, eax int 0x80 ret extern last_stack extern last_entrypoint ; Load all the segment registers with the usermode data selector ; Then push the stack segment and the stack pointer (we need to change this) ; Then modify the flags so they enable interrupts on iret ; Push the code selector on the stack ; Push the entrypoint of the program in memory, then iret to enter usermode global enter_usermode enter_usermode: cli mov ax,0x23 mov ax, ds mov ax, es mov ax, fs mov ax, gs push 0x23 mov eax,[last_stack] push eax pushf pop eax or eax,0x200 push eax push 0x1B mov eax,[last_entrypoint] push eax mov eax,0 mov ebx,0 mov ecx,0xBFFFE000 mov edx,0xBFFFF000 mov esi,0 mov edi,0 mov ebp,0 iret ; Exit usermode global exit_usermode exit_usermode: cli mov ax,0x10 mov ax, ds mov ax, es mov ax, fs mov ax, gs push 0x10 mov eax,[last_stack] push eax pushf pop eax mov eax,0x200 push eax push 0x8 mov eax,[last_entrypoint] push eax iret ; The following was modified from Omarrx024's VESA tutorial on the OSDev Wiki ; (https://wiki.osdev.org/User:Omarrx024/VESA_Tutorial) ; This code is used under CC0 1.0 (see https://wiki.osdev.org/OSDev_Wiki:Copyrights for details) ; VESA32 function: ; Switch to realmode, change resolution, and return to protected mode. ; ; Inputs: ; ch - Function (0=change resolution, 1=Get resolution of available mode #ax) ; mode 0: ; ax - Resolution width ; bx - Resolution height ; cl - Bit depth (bpp) ; mode 1: ; ax - mode number ; ; Outputs: ; mode 0: ; al - Error code ; 0 = success ; 1 = mode not found ; 2 = BIOS error ; ebx - Framebuffer address (physical) ; mode 1: ; ax - Width ; bx - Height ; cl - BPP ; ; Note: you will most likely have to reload the PIT ; Macros to make it easier to access data and code copied to 0x7C00 %define INT32_LENGTH (_int32_end-_int32) %define FIXADDR(addr) (((addr)-_int32)+0x7C00) ; Macros for the storevars at 0x7C00 %define sv_width FIXADDR(storevars.width) %define sv_height FIXADDR(storevars.height) %define sv_bpp FIXADDR(storevars.bpp) %define sv_func FIXADDR(storevars.func) %define sv_segment FIXADDR(storevars.segment) %define sv_offset FIXADDR(storevars.offset) %define sv_mode FIXADDR(storevars.mode) global vesa32 vesa32: cli ; Store registers so we can use them mov [storevars.width],ax mov [storevars.height],bx mov [storevars.bpp],cl mov [storevars.func],ch ; Copy the _int32 function (et al) to 0x7C00 (below 1MiB) mov esi,_int32 mov edi,0x7C00 mov ecx,INT32_LENGTH cld rep movsb ; Relocate the stored variables to where the rest of the data is mov ax,[storevars.width] mov [sv_width],ax mov ax,[storevars.height] mov [sv_height],ax mov al,[storevars.bpp] mov [sv_bpp],al ; Jump to code under 1MiB so we can run in 16 bit mode jmp 0x00007C00 [BITS 32] _int32: ; Store any remaining registers so we don't mess anything up in C mov [store32.edx],edx mov [store32.esi],esi mov [store32.edi],edi mov [store32.esp],esp mov [store32.ebp],ebp ; Store the cr3 in case the BIOS messes it up mov eax,cr3 mov [store32.cr3],eax ; Disable paging mov eax,cr0 and eax,0x7FFFFFFF mov cr0,eax ; Store existing GDTs and IDTs and load temporary ones sgdt [FIXADDR(gdt32)] sidt [FIXADDR(idt32)] lgdt [FIXADDR(gdt16)] lidt [FIXADDR(idt16)] ; Switch to 16 bit protected mode jmp word 0x08:FIXADDR(_intp16) [BITS 16] _intp16: ; Load all the segment registers with the data segment mov ax,0x10 mov ds,ax mov es,ax mov fs,ax mov gs,ax mov ss,ax ; Disable protected mode mov eax,cr0 and al, 0xFE mov cr0,eax ; Jump to realmode jmp word 0x0000:FIXADDR(_intr16) _intr16: ; Load all the data segments with 0 mov ax,0 mov ss,ax mov ds,ax mov es,ax mov fs,ax mov gs,ax ; Set a temporary stack mov sp,0x7B00 ; Get a list of modes push es mov ax,0x4F00 mov di,FIXADDR(vbe_info) int 0x10 pop es ; Check for error cmp ax, 0x4F jne .error ; Set up the registers with the segment:offset of the modes mov ax, word[FIXADDR(vbe_info.vmodeoff)] mov [sv_offset],ax mov ax, word[FIXADDR(vbe_info.vmodeseg)] mov [sv_segment],ax mov ax, [sv_segment] mov fs,ax mov si, [sv_offset] mov al,[sv_func] cmp al,1 je .getmode cmp al,0 jne .error2 .find_mode: ; Increment the mode mov dx,[fs:si] add si,2 mov [sv_offset],si mov [sv_mode], dx mov ax,0 mov fs,ax ; Make sure we haven't run out of modes cmp word[sv_mode],0xFFFF je .error2 ; List the values for the selected mode push es mov ax,0x4f01 mov cx,[sv_mode] mov di, FIXADDR(vbe_screen) int 0x10 pop es ; Check for error cmp ax, 0x4F jne .error ; Check width mov ax, [sv_width] cmp ax, [FIXADDR(vbe_screen.width)] jne .next_mode ; Check height mov ax, [sv_height] cmp ax, [FIXADDR(vbe_screen.height)] jne .next_mode ; Check bpp mov al, [sv_bpp] cmp al, [FIXADDR(vbe_screen.bpp)] jne .next_mode ; We've found our mode. Now switch to it push es mov ax, 0x4F02 mov bx, [sv_mode] or bx, 0x4000 mov di,0 int 0x10 pop es ; Check for any errors cmp ax, 0x4F jne .error ; Set up return values mov ax,0 mov ebx,[FIXADDR(vbe_screen.buffer)] ; Start the transition back to protected mode jmp .returnpm ; Any BIOS errors use this function .error: mov ax,2 jmp .returnpm ; This error is only for if the requested mode could not be found .error2: mov ax,1 jmp .returnpm ; Get the address for the next mode .next_mode: mov ax, [sv_segment] mov fs,ax mov si, [sv_offset] jmp .find_mode ; Get the values for mode stored in ax at start .getmode: mov ax, [sv_width] add ax,ax add si,ax mov dx, [fs:si] mov [sv_mode],dx mov ax,0 mov fs,ax cmp word [sv_mode],0xFFFF je .error2 push es mov ax,0x4f01 mov cx,[sv_mode] mov di, FIXADDR(vbe_screen) int 0x10 pop es cmp ax,0x4F jne .error mov ax,[FIXADDR(vbe_screen.width)] mov [FIXADDR(storevars.width)],ax mov ax,[FIXADDR(vbe_screen.height)] mov [FIXADDR(storevars.height)],ax mov al,[FIXADDR(vbe_screen.bpp)] mov [FIXADDR(storevars.bpp)],al mov ax,0 ; Return to protected mode! .returnpm: ; Store the return values mov [FIXADDR(storevars.error)],ax mov [FIXADDR(storevars.buffer)],ebx ; Turn on protected mode (this is same as "or cr0,1") mov eax,cr0 inc eax mov cr0,eax ; Load 32 bit GDT lgdt [FIXADDR(gdt32)] ; Jump to 32 bit protected mode jmp 0x08:FIXADDR(returnpm32) [BITS 32] ; We're back in 32 bit protected mode land! returnpm32: ; Load all the data segments mov ax,0x10 mov ss,ax mov ds,ax mov es,ax mov fs,ax mov gs,ax ; Use the protected mode IDT lidt [FIXADDR(idt32)] ; Re-enable paging mov eax,cr0 or eax,0x80000000 mov cr0,eax ; Restore cr3 mov eax,[store32.cr3] mov cr3,eax ; Reload GDT with paging enabled (otherwise we will triple fault on sti) lgdt [FIXADDR(gdt32)] ; Restore PIC (see idt.c for values) mov al,0x11 out 0x20,al out 0xA0,al mov al,0x20 out 0x21,al mov al,40 out 0xA1,al mov al,4 out 0x21,al sub al,2 out 0xA1,al dec al out 0x21,al out 0xA1,al xor al,al out 0x21,al out 0xA1,al mov al,[sv_func] cmp al,1 je .mode1 mov eax,[FIXADDR(storevars.error)] mov ebx,[FIXADDR(storevars.buffer)] jmp .restore .mode1: mov ax,[FIXADDR(storevars.width)] mov bx,[FIXADDR(storevars.height)] mov cl,[FIXADDR(storevars.bpp)] mov ch,[FIXADDR(storevars.error)] .restore: ; Restore all registers except output registers mov edx,[store32.edx] mov esi,[store32.esi] mov edi,[store32.edi] mov esp,[store32.esp] mov ebp,[store32.ebp] ; Re-enable interrupts sti ; Finally, return to the callee ret gdt32: dw 0 dd 0 idt32: dw 0 dd 0 idt16: dw 0x03FF dd 0 gdt16_struct: dq 0 dw 0xFFFF dw 0 db 0 db 10011010b db 10001111b db 0 dw 0xFFFF dw 0 db 0 db 10010010b db 10001111b db 0 gdt16: dw gdt16 - gdt16_struct - 1 dd FIXADDR(gdt16_struct) storevars: .width dw 0 .height dw 0 .bpp db 0 .func db 0 .segment dw 0 .offset dw 0 .mode dw 0 .buffer dd 0 .error db 0 vbe_screen: .attr dw 0 .unused0 db 0 .unused1 db 0 .unused2 dw 0 .unused3 dw 0 .unused4 dw 0 .unused5 dw 0 .unused7 dd 0 .pitch dw 0 .width dw 0 .height dw 0 .unused8 db 0 .unused9 db 0 .unusedA db 0 .bpp db 0 .unusedB db 0 .unusedC db 0 .unusedD db 0 .unusedE db 0 .reserved0 db 0 .redmask db 0 .redpos db 0 .greenmask db 0 .greenpos db 0 .bluemask db 0 .bluepos db 0 .rmask db 0 .rpos db 0 .cattrs db 0 .buffer dd 0 .sm_off dd 0 .sm_size dw 0 .table times 206 db 0 vbe_info: .signature db "VBE2" .version dw 0 .oem dd 0 .cap dd 0 .vmodeoff dw 0 .vmodeseg dw 0 .vmem dw 0 .softrev dw 0 .vendor dd 0 .pname dd 0 .prev dd 0 .reserved times 222 db 0 .oemdata times 256 db 0 _int32_end: store32: .ecx dd 0 .edx dd 0 .esi dd 0 .edi dd 0 .esp dd 0 .ebp dd 0 .cr3 dd 0
tests/asm/32/disp.asm
ReneNyffenegger/udis86
710
172159
[bits 32] mov eax, [eax-0x10] add eax, [esi+0x10] add eax, [0x10] add eax, [esi+edi*4+0x10] add eax, [bx+si-0x4877]
a.asm
Ericles-Porty/Assembly-Lessons
2
241571
.data a: .word 10 b: .word 15 c: .word 35 d: .word 25 .text lw $s0, a lw $s1, b lw $s2, c lw $s3, d add $t0, $s0, $s1 sub $t1, $s2, $s3 sub $s0, $t0, $t1
Cubical/Experiments/NatMinusTwo/Base.agda
dan-iel-lee/cubical
0
4039
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-} module Cubical.Experiments.NatMinusTwo.Base where open import Cubical.Core.Primitives open import Cubical.Data.Nat open import Cubical.Data.Empty record ℕ₋₂ : Type₀ where constructor -2+_ field n : ℕ pattern neg2 = -2+ zero pattern neg1 = -2+ (suc zero) pattern ℕ→ℕ₋₂ n = -2+ (suc (suc n)) pattern -1+_ n = -2+ (suc n) 2+_ : ℕ₋₂ → ℕ 2+ (-2+ n) = n pred₋₂ : ℕ₋₂ → ℕ₋₂ pred₋₂ neg2 = neg2 pred₋₂ neg1 = neg2 pred₋₂ (ℕ→ℕ₋₂ zero) = neg1 pred₋₂ (ℕ→ℕ₋₂ (suc n)) = (ℕ→ℕ₋₂ n) suc₋₂ : ℕ₋₂ → ℕ₋₂ suc₋₂ (-2+ n) = -2+ (suc n) -- Natural number and negative integer literals for ℕ₋₂ open import Cubical.Data.Nat.Literals public instance fromNatℕ₋₂ : HasFromNat ℕ₋₂ fromNatℕ₋₂ = record { Constraint = λ _ → Unit ; fromNat = ℕ→ℕ₋₂ } instance fromNegℕ₋₂ : HasFromNeg ℕ₋₂ fromNegℕ₋₂ = record { Constraint = λ { (suc (suc (suc _))) → ⊥ ; _ → Unit } ; fromNeg = λ { zero → 0 ; (suc zero) → neg1 ; (suc (suc zero)) → neg2 } }
models/recipe.als
zaphar/kitchen
3
1892
<gh_stars>1-10 sig Recipe { , desc: String , title: String , ingredients: set Ingredient } sig Cat { , name: String } abstract sig Unit { } sig Tsp extends Unit {} sig Tbsp extends Unit {} sig Cup extends Unit {} sig Pint extends Unit {} sig Quart extends Unit {} sig Gallon extends Unit {} abstract sig Wgt extends Unit { } sig MilliGram extends Wgt {} sig Gram extends Wgt {} sig KiloGram extends Wgt {} abstract sig Amt {} sig Count extends Amt { , value: Int } sig Frac extends Amt { , numerator: Int , denominator: Int } sig Ingredient { , category: Cat , name: String , unit: Unit , amt: Amt }
src/hwio/serial.asm
furrtek/GB303
90
93416
<gh_stars>10-100 serial: push af push bc push de push hl ld hl,MIDIBUFFER ld a,(MIDIBPUT) add l jr nc,+ inc h +: ld l,a ldh a,($01) ld (hl),a ld a,(MIDIBPUT) inc a and $3F ld (MIDIBPUT),a call serialhnd ld a,(SYNCMODE) cp SYNC_LSDJMIDI jr z,+ cp SYNC_NANO jr z,+ ld a,$80 ;Slave ldh ($02),a +: pop hl pop de pop bc pop af reti serialhnd: ld a,(SYNCMODE) cp SYNC_NONE ret z cp SYNC_LSDJS jr z,synch_lsdjslave cp SYNC_LSDJMIDI jr z,sync_lsdjmidi cp SYNC_NANO ret z cp SYNC_MIDI jr z,synch_midi ret sync_lsdjmidi: call sy_common or a ret z cp $80 ret c cp $FD ret z cp $FE ret z and $7F jr z,+ ld (MIDINOTENB),a ld a,1 ;Note on ld (MIDINOTECMD),a ret +: ld a,2 ;Note off ld (MIDINOTECMD),a ret sy_common: ld a,(MIDIBPUT) ld (MIDIBGET),a dec a and $3F ld hl,MIDIBUFFER add l jr nc,+ inc h +: ld l,a ld a,(hl) ret synch_lsdjslave: call sy_common or a jr nz,+ xor a ld (SONGPTR),a ld (LSDJTICK),a ld a,2 ;Start to play song from start ld (PLAYING),a call pscommon ret +: ld a,(LSDJTICK) inc a cp 6 jr nz,+ ld a,1 ld (BEAT),a xor a +: ld (LSDJTICK),a ret synch_midi: ld a,1 ld (PLAYING),a ;See if we got a valid command somewhere in the buffer ld a,(MIDIBGET) ld b,a -: ld a,b ld hl,MIDIBPUT cp (hl) jr nz,+ ld a,b ld (MIDIBGET),a ;Matched put pointer and didn't find anything ret +: ld hl,MIDIBUFFER add l jr nc,+ inc h +: ld l,a ld a,(hl) and $F0 ;Ignore channel cp $90 ;Note on any channel jr z,midi_noteon cp $80 jr z,midi_noteoff ld a,b inc a and $3F ld b,a jr - midi_noteoff: call MIDI3bytes ret c inc b ld a,b and $3F ld (MIDIBGET),a call getMIDIbyteinc ;Note value (ignore) and $7F ;ld (MIDINOTENB),a call getMIDIbyteinc ;Velocity (ignore) and $7F noteoffvel: ld a,2 ;Note off ld (MIDINOTECMD),a ret midi_noteon: call MIDI3bytes ret c inc b ld a,b and $3F ld (MIDIBGET),a call getMIDIbyteinc ;Note value and $7F ld (MIDINOTENB),a call getMIDIbyteinc ;Velocity (ignore) and $7F jr z,noteoffvel ld a,1 ;Note on ld (MIDINOTECMD),a ret MIDI3bytes: push bc ld a,(MIDIBGET) ;See if we got at least 3 bytes in buffer ld b,a ld a,(MIDIBPUT) sub b and $3F pop bc cp 3 ret getMIDIbyteinc: ld hl,MIDIBUFFER ld a,(MIDIBGET) ld b,a add l jr nc,+ inc h +: ld l,a ld a,b ld b,(hl) inc a and $3F ld (MIDIBGET),a ld a,b ret ;serialhnd: ld a,(LINK_RX) cp $FF jr z,+ ;No LSDJ cp $70 jr c,+ ;Invalid or no new message cp $7F jr z,+ ;Special cp $7E jr z,+ cp $7D jr z,+ sub $70 ld b,a ld a,(LASTSERIAL) cp $80 ld a,b jr nz,++ cp $10 jr nz,+++ jr ++ +++: ld (TOPLAY),a ++: ld (LASTSERIAL),a +: ;ld a,(LSDJTICK) ;inc a ;cp 24 ;jr nz,+ ;ld a,1 ;ld (LSDJSTEP),a ;xor a +: ;ld (LSDJTICK),a ;ld a,$80 ;ldh ($02),a ;call play xor a ldh ($01),a ldh ($02),a ret
src/Categories/Category/Instance/Properties/Setoids/LCCC.agda
bblfish/agda-categories
5
10692
{-# OPTIONS --without-K --safe #-} module Categories.Category.Instance.Properties.Setoids.LCCC where open import Level open import Data.Product using (Σ; _,_) open import Function.Equality as Func using (Π; _⟶_) open import Relation.Binary using (Setoid) import Relation.Binary.PropositionalEquality as ≡ open import Categories.Category open import Categories.Category.Slice open import Categories.Category.Slice.Properties open import Categories.Category.CartesianClosed open import Categories.Category.CartesianClosed.Canonical using (module Equivalence) renaming (CartesianClosed to Canonical) open import Categories.Category.CartesianClosed.Locally using (Locally) open import Categories.Category.Cartesian open import Categories.Category.Instance.Span open import Categories.Category.Instance.Setoids open import Categories.Category.Instance.Properties.Setoids.Complete open import Categories.Category.Monoidal.Instance.Setoids open import Categories.Functor open import Categories.Object.Terminal open import Categories.Diagram.Pullback open import Categories.Diagram.Pullback.Limit import Categories.Object.Product as Prod open Π using (_⟨$⟩_) module _ {o ℓ} where module _ {A X : Setoid o ℓ} where private module A = Setoid A module X = Setoid X record InverseImage (a : Setoid.Carrier A) (f : X ⟶ A) : Set (o ⊔ ℓ) where constructor pack field x : X.Carrier fx≈a : f ⟨$⟩ x A.≈ a inverseImage-transport : ∀ {a a′} {f : X ⟶ A} → a A.≈ a′ → InverseImage a f → InverseImage a′ f inverseImage-transport eq img = pack x (A.trans fx≈a eq) where open InverseImage img module _ {A X Y : Setoid o ℓ} where private module A = Setoid A module X = Setoid X module Y = Setoid Y -- the inverse image part of an exponential object the slice category of Setoids -- it's a morphism from f to g, which in set theory is -- f⁻¹(a) ⟶ g⁻¹(a) -- here, we need to take care of some coherence condition. record InverseImageMap (a : Setoid.Carrier A) (f : X ⟶ A) (g : Y ⟶ A) : Set (o ⊔ ℓ) where field f⇒g : InverseImage a f → InverseImage a g cong : ∀ (x x′ : InverseImage a f) → InverseImage.x x X.≈ InverseImage.x x′ → InverseImage.x (f⇒g x) Y.≈ InverseImage.x (f⇒g x′) inverseImageMap-transport : ∀ {a a′} {f : X ⟶ A} {g : Y ⟶ A} → a A.≈ a′ → InverseImageMap a f g → InverseImageMap a′ f g inverseImageMap-transport eq h = record { f⇒g = λ img → inverseImage-transport eq (f⇒g (inverseImage-transport (A.sym eq) img)) ; cong = λ x x′ eq′ → cong (inverseImage-transport (A.sym eq) x) (inverseImage-transport (A.sym eq) x′) eq′ } where open InverseImageMap h record SlExp (f : X ⟶ A) (g : Y ⟶ A) : Set (o ⊔ ℓ) where field idx : A.Carrier map : InverseImageMap idx f g open InverseImageMap map public record SlExp≈ {f : X ⟶ A} {g : Y ⟶ A} (h i : SlExp f g) : Set (o ⊔ ℓ) where private module h = SlExp h module i = SlExp i field idx≈ : h.idx A.≈ i.idx map≈ : ∀ (img : InverseImage h.idx f) → InverseImage.x (h.f⇒g img) Y.≈ InverseImage.x (i.f⇒g (inverseImage-transport idx≈ img)) -- map≈′ : ∀ (img : InverseImage i.idx f) → InverseImage.x (i.f⇒g img) Y.≈ InverseImage.x (h.f⇒g (inverseImage-transport idx≈ img)) SlExp-Setoid : ∀ {A X Y : Setoid o ℓ} (f : X ⟶ A) (g : Y ⟶ A) → Setoid (o ⊔ ℓ) (o ⊔ ℓ) SlExp-Setoid {A} {X} {Y} f g = record { Carrier = SlExp f g ; _≈_ = SlExp≈ ; isEquivalence = record { refl = λ {h} → record { idx≈ = A.refl ; map≈ = λ img → SlExp.cong h img (inverseImage-transport A.refl img) X.refl } ; sym = λ {h i} eq → let open SlExp≈ eq in record { idx≈ = A.sym idx≈ ; map≈ = λ img → Y.trans (SlExp.cong i img (inverseImage-transport idx≈ (inverseImage-transport (A.sym idx≈) img)) X.refl) (Y.sym (map≈ (inverseImage-transport (A.sym idx≈) img))) } ; trans = λ {h i j} eq eq′ → let module eq = SlExp≈ eq module eq′ = SlExp≈ eq′ in record { idx≈ = A.trans eq.idx≈ eq′.idx≈ ; map≈ = λ img → Y.trans (eq.map≈ img) (Y.trans (eq′.map≈ (inverseImage-transport eq.idx≈ img)) (SlExp.cong j (inverseImage-transport eq′.idx≈ (inverseImage-transport eq.idx≈ img)) (inverseImage-transport (A.trans eq.idx≈ eq′.idx≈) img) X.refl)) } } } where module A = Setoid A module X = Setoid X module Y = Setoid Y module _ {o} where private S : Category (suc o) o o S = Setoids o o module S = Category S module _ (A : S.Obj) where private Sl = Slice S A module Sl = Category Sl open Setoid A open Prod (Slice S A) slice-terminal : Terminal Sl slice-terminal = record { ⊤ = sliceobj {Y = A} record { _⟨$⟩_ = λ x → x ; cong = λ eq → eq } ; ⊤-is-terminal = record { ! = λ { {sliceobj f} → slicearr {h = f} (Π.cong f) } ; !-unique = λ { {X} (slicearr △) eq → let module X = SliceObj X in sym (△ (Setoid.sym X.Y eq)) } } } F₀ : Sl.Obj → Sl.Obj → SpanObj → Setoid o o F₀ X Y center = A F₀ X Y left = SliceObj.Y X F₀ X Y right = SliceObj.Y Y slice-product : (X Y : Sl.Obj) → Product X Y slice-product X Y = pullback⇒product S XY-pullback where module X = SliceObj X module Y = SliceObj Y F : Functor (Category.op Span) (Setoids o o) F = record { F₀ = F₀ X Y ; F₁ = λ { span-id → Func.id ; span-arrˡ → X.arr ; span-arrʳ → Y.arr } ; identity = λ {Z} → S.Equiv.refl {F₀ X Y Z} {F₀ X Y Z} {Func.id} ; homomorphism = λ { {_} {_} {_} {span-id} {span-id} eq → eq ; {_} {_} {_} {span-id} {span-arrˡ} → Π.cong X.arr ; {_} {_} {_} {span-id} {span-arrʳ} → Π.cong Y.arr ; {_} {_} {_} {span-arrˡ} {span-id} → Π.cong X.arr ; {_} {_} {_} {span-arrʳ} {span-id} → Π.cong Y.arr } ; F-resp-≈ = λ { {_} {_} {span-id} ≡.refl eq → eq ; {_} {_} {span-arrˡ} ≡.refl → Π.cong X.arr ; {_} {_} {span-arrʳ} ≡.refl → Π.cong Y.arr } } XY-pullback : Pullback S X.arr Y.arr XY-pullback = limit⇒pullback S {F = F} (Setoids-Complete 0ℓ 0ℓ 0ℓ o o F) module slice-terminal = Terminal slice-terminal module slice-product X Y = Product (slice-product X Y) cartesian : Cartesian Sl cartesian = record { terminal = slice-terminal ; products = record { product = slice-product _ _ } } module cartesian = Cartesian cartesian _^_ : Sl.Obj → Sl.Obj → Sl.Obj f ^ g = sliceobj {Y = SlExp-Setoid g.arr f.arr} record { _⟨$⟩_ = SlExp.idx ; cong = SlExp≈.idx≈ } where module f = SliceObj f module g = SliceObj g prod = slice-product.A×B eval : {f g : Sl.Obj} → prod (f ^ g) g Sl.⇒ f eval {f} {g} = slicearr {h = h} λ { {J₁ , arr₁} {J₂ , arr₂} eq → let open SlExp (J₁ left) in trans (InverseImage.fx≈a (f⇒g (pack (J₁ right) _))) (trans (arr₁ span-arrˡ) (trans (eq center) (sym (arr₂ span-arrʳ)))) } where module f = SliceObj f module g = SliceObj g module fY = Setoid f.Y h : SliceObj.Y (prod (f ^ g) g) S.⇒ f.Y h = record { _⟨$⟩_ = λ { (J , arr) → let module exp = SlExp (J left) in InverseImage.x (exp.f⇒g (pack (J right) (trans (arr span-arrʳ) (sym (arr span-arrˡ))))) } ; cong = λ { {J₁ , arr₁} {J₂ , arr₂} eq → let open SlExp≈ (eq left) open SlExp (J₂ left) in fY.trans (map≈ _) (cong _ _ (eq right)) } } module _ {f g : Sl.Obj} where private module f = SliceObj f module g = SliceObj g module fY = Setoid f.Y module gY = Setoid g.Y Jpb : ∀ x → InverseImage (f.arr ⟨$⟩ x) g.arr → ∀ j → Setoid.Carrier (F₀ f g j) Jpb x img center = f.arr ⟨$⟩ x Jpb x img left = x Jpb x img right = InverseImage.x img xypb : ∀ x → InverseImage (f.arr ⟨$⟩ x) g.arr → Setoid.Carrier (SliceObj.Y (prod f g)) xypb x img = Jpb x img , λ { {center} span-id → refl ; {left} span-id → fY.refl ; {right} span-id → gY.refl ; span-arrˡ → refl ; span-arrʳ → fx≈a } where open InverseImage img renaming (x to y) module _ {h : Sl.Obj} (α : prod f g Sl.⇒ h) where private module α = Slice⇒ α module h = SliceObj h module hY = Setoid h.Y βmap : fY.Carrier → SlExp g.arr h.arr βmap x = record { idx = f.arr ⟨$⟩ x ; map = record { f⇒g = λ img → let open InverseImage img renaming (x to y) in pack (α.h ⟨$⟩ xypb x img) (trans (α.△ {xypb x img} {xypb x img} (Setoid.refl (SliceObj.Y (prod f g)) {xypb x img})) fx≈a) ; cong = λ img img′ eq → let module img = InverseImage img module img′ = InverseImage img′ in Π.cong α.h λ { center → refl ; left → fY.refl ; right → eq } } } βcong : {i j : fY.Carrier} → i fY.≈ j → SlExp≈ (βmap i) (βmap j) βcong {i} {j} eq = record { idx≈ = Π.cong f.arr eq ; map≈ = λ img → let open InverseImage img in Π.cong α.h λ { center → Π.cong f.arr eq ; left → eq ; right → gY.refl } } β : f.Y S.⇒ SliceObj.Y (h ^ g) β = record { _⟨$⟩_ = βmap ; cong = βcong } curry : f Sl.⇒ (h ^ g) curry = slicearr {h = β} (Π.cong f.arr) module _ {f g h : Sl.Obj} {α β : prod f g Sl.⇒ h} where private module f = SliceObj f module g = SliceObj g module gY = Setoid g.Y curry-resp-≈ : α Sl.≈ β → curry α Sl.≈ curry β curry-resp-≈ eq eq′ = record { idx≈ = Π.cong f.arr eq′ ; map≈ = λ img → let open InverseImage img in eq λ { center → Π.cong f.arr eq′ ; left → eq′ ; right → gY.refl } } module _ {f g h : Sl.Obj} {α : f Sl.⇒ (g ^ h)} {β : prod f h Sl.⇒ g} where private module f = SliceObj f module g = SliceObj g module h = SliceObj h module α = Slice⇒ α module β = Slice⇒ β module fY = Setoid f.Y module gY = Setoid g.Y module hY = Setoid h.Y curry-unique : eval Sl.∘ (α cartesian.⁂ Sl.id) Sl.≈ β → α Sl.≈ curry β curry-unique eq {z} {w} eq′ = record { idx≈ = α.△ eq′ ; map≈ = λ img → let open InverseImage img in gY.trans (InverseImageMap.cong (SlExp.map (α.h ⟨$⟩ z)) img _ hY.refl) (eq {xypb z (inverseImage-transport (trans (α.△ eq′) (Π.cong f.arr (fY.sym eq′))) img)} {xypb w (inverseImage-transport (α.△ eq′) img)} λ { center → Π.cong f.arr eq′ ; left → eq′ ; right → hY.refl }) } slice-canonical : Canonical Sl slice-canonical = record { ⊤ = slice-terminal.⊤ ; _×_ = slice-product.A×B ; ! = slice-terminal.! ; π₁ = slice-product.π₁ _ _ ; π₂ = slice-product.π₂ _ _ ; ⟨_,_⟩ = slice-product.⟨_,_⟩ _ _ ; !-unique = slice-terminal.!-unique ; π₁-comp = λ {_ _ f _ g} → slice-product.project₁ _ _ {_} {f} {g} ; π₂-comp = λ {_ _ f _ g} → slice-product.project₂ _ _ {_} {f} {g} ; ⟨,⟩-unique = λ {_ _ _ f g h} → slice-product.unique _ _ {_} {h} {f} {g} ; _^_ = _^_ ; eval = eval ; curry = curry ; eval-comp = λ { {_} {_} {_} {α} {J , arr₁} eq → let module α = Slice⇒ α in Π.cong α.h λ { center → trans (arr₁ span-arrˡ) (eq center) ; left → eq left ; right → eq right } } ; curry-resp-≈ = λ {_ _ _} {α β} → curry-resp-≈ {_} {_} {_} {α} {β} ; curry-unique = λ {_ _ _} {α β} → curry-unique {_} {_} {_} {α} {β} } Setoids-sliceCCC : CartesianClosed (Slice S A) Setoids-sliceCCC = Equivalence.fromCanonical (Slice S A) slice-canonical Setoids-LCCC : Locally S Setoids-LCCC = record { sliceCCC = Setoids-sliceCCC }
Task/Run-length-encoding/Ada/run-length-encoding.ada
LaudateCorpus1/RosettaCodeData
1
14862
with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Fixed; use Ada.Strings.Fixed; procedure Test_Run_Length_Encoding is function Encode (Data : String) return String is begin if Data'Length = 0 then return ""; else declare Code : constant Character := Data (Data'First); Index : Integer := Data'First + 1; begin while Index <= Data'Last and then Code = Data (Index) loop Index := Index + 1; end loop; declare Prefix : constant String := Integer'Image (Index - Data'First); begin return Prefix (2..Prefix'Last) & Code & Encode (Data (Index..Data'Last)); end; end; end if; end Encode; function Decode (Data : String) return String is begin if Data'Length = 0 then return ""; else declare Index : Integer := Data'First; Count : Natural := 0; begin while Index < Data'Last and then Data (Index) in '0'..'9' loop Count := Count * 10 + Character'Pos (Data (Index)) - Character'Pos ('0'); Index := Index + 1; end loop; if Index > Data'First then return Count * Data (Index) & Decode (Data (Index + 1..Data'Last)); else return Data; end if; end; end if; end Decode; begin Put_Line (Encode ("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW")); Put_Line (Decode ("12W1B12W3B24W1B14W")); end Test_Run_Length_Encoding;
src/el-variables.adb
jquorning/ada-el
6
18246
<reponame>jquorning/ada-el ----------------------------------------------------------------------- -- el-variables -- Variable mapper -- Copyright (C) 2011, 2012, 2013, 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. ----------------------------------------------------------------------- package body EL.Variables is -- ------------------------------ -- Get the Value_Expression that corresponds to the given variable name. -- ------------------------------ function Get_Variable (Mapper : in Variable_Mapper'Class; Name : in Unbounded_String) return EL.Expressions.Value_Expression is VE : constant EL.Expressions.Expression := Mapper.Get_Variable (Name); begin return EL.Expressions.Create_Expression (VE); end Get_Variable; -- ------------------------------ -- Set the variable to the given value expression. -- ------------------------------ procedure Set_Variable (Mapper : in out Variable_Mapper'Class; Name : in Unbounded_String; Value : in EL.Expressions.Value_Expression) is begin Mapper.Set_Variable (Name, EL.Expressions.Expression (Value)); end Set_Variable; end EL.Variables;
liboled/c/sdcc_iy/font/oled_font8_set_xy.asm
juzzas/oled_demos
1
244052
<reponame>juzzas/oled_demos ; copyright 2021 <NAME> ; ; permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated ; documentation files (the "software"), to deal in the software without restriction, including without limitation the ; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit ; persons to whom the software is furnished to do so, subject to the following conditions: ; ; the above copyright notice and this permission notice shall be included in all copies or substantial portions of the ; software. ; ; the software is provided "as is", without warranty of any kind, express or implied, including but not limited to the ; warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the authors or ; copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or ; otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. ; extern void oled_font8_set_rc(struct oled_font8_context *context, uint8_t row, uint8_t column) __z88dk_callee; DEFC OLED_WIDTH = 128 SECTION code_user PUBLIC _oled_font8_set_xy _oled_font8_set_xy: POP AF ; return address POP IY ; arg1 - context POP BC ; arg2 - co-ordinates (B = Y, C = X) PUSH AF ; return address back on stack after clearing ; struct oled_font8_context ; row offset? LD A, B AND 0x07 LD (IY + 4), A ; find row SRL B SRL B SRL B ; put buffer base ptr in HL LD L, (IY + 0) LD H, (IY + 1) ; add C to HL LD A, C ADD A, L ; A = A+L LD L, A ; L = A+L ADC A, H ; A = A+L+H+carry SUB L ; A = H+carry LD H, A ; H = H+carry ; add 128 for each row LD DE, OLED_WIDTH LD A, B loop_add: OR A JR Z, skip_add ADD HL, DE DEC A JR loop_add skip_add: LD (IY + 2), L LD (IY + 3), H RET
engine/engine.g4
willow-lang/willow
0
1390
<filename>engine/engine.g4 // engine for willow code generation package engine;
src/spdx.ads
Fabien-Chouteau/spdx_ada
0
15982
<reponame>Fabien-Chouteau/spdx_ada with Ada.Containers.Vectors; package SPDX is type Expression (<>) is private; function Parse (Str : String; Allow_Custom : Boolean := False) return Expression; -- Parse an SPDX expression from string. -- -- If Allow_Custom is True, the parser will accept custom license id with -- the format: "custom-[0-9a-zA-Z.-]+". function Valid (This : Expression) return Boolean; -- Return True if the SPDX expression is valid function Error (This : Expression) return String with Pre => not Valid (This); -- Return the error message for an invalid SPDX expression function Img (This : Expression) return String with Pre => Valid (This); -- Return the string representation of a valid SPDX expression function Has_Custom (This : Expression) return Boolean; -- Return True if the expression contains a custom license ID private subtype Id_Characters is Character with Dynamic_Predicate => Id_Characters in 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '-' | '.'; subtype Id_String is String with Dynamic_Predicate => (for all C of Id_String => C in Id_Characters); subtype Whitespace_Characters is Character with Dynamic_Predicate => Whitespace_Characters in ' ' | ASCII.HT; type Token_Kind is (Op_Or_Later, Op_With, Op_Or, Op_And, Id_Str, Paren_Open, Paren_Close); subtype Operator is Token_Kind range Op_Or_Later .. Op_And; type Location is record From, To : Natural; end record; type Token is record Kind : Token_Kind; Loc : Location; -- Position in the parsed string end record; package Token_Vector is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Token); type Error_Kind is (None, Or_Later_Misplaced, Invalid_Char, Operator_Lowcase, Unexpected_Token, Paren_Close_Expected, License_Id_Expected, Invalid_License_Id, Exception_Id_Expected, Invalid_Exception_Id, Empty_Expression); type Expression (Str_Len : Natural) is record Str : String (1 .. Str_Len); Tokens : Token_Vector.Vector; Error : Error_Kind := None; Err_Loc : Location; Allow_Custom : Boolean := False; Has_Custom_Id : Boolean := False; end record; procedure Tokenize (This : in out Expression) with Pre => This.Tokens.Is_Empty; end SPDX;
proglangs-learning/Agda/sv20/assign2/SetTheory/Algebra.agda
helq/old_code
0
3526
module sv20.assign2.SetTheory.Algebra where open import sv20.assign2.SetTheory.Subset open import sv20.assign2.SetTheory.Logic open import sv20.assign2.SetTheory.ZAxioms infix 6 _∪_ infix 6 _-_ infix 6 _∩_ -- Properties involving operations between sets, algebra of sets. -- In this module some properties involving union, difference -- and intersection of set are proved. -- First, some properties of the union between sets, justified by the -- union axiom. _∪_ : 𝓢 → 𝓢 → 𝓢 x ∪ y = proj₁ (union x y) -- {-# ATP definition _∪_ #-} -- Theorem 20, p. 27 (Suppes 1960) ∪-d : (x y : 𝓢) → ∀ {z} → z ∈ x ∪ y ⇔ z ∈ x ∨ z ∈ y ∪-d x y = proj₂ _ (union x y) -- ∧-projections of past theorem for convenience. ∪-d₁ : (A B : 𝓢) → ∀ {x} → x ∈ (A ∪ B) → x ∈ A ∨ x ∈ B ∪-d₁ A B = ∧-proj₁ (∪-d A B) ∪-d₂ : (A B : 𝓢) → ∀ {x} → x ∈ A ∨ x ∈ B → x ∈ (A ∪ B) ∪-d₂ A B = ∧-proj₂ (∪-d A B) -- Theorem 21, p. 27 (Suppes 1960) A∪B≡B∪A : (A B : 𝓢) → A ∪ B ≡ B ∪ A A∪B≡B∪A A B = equalitySubset (A ∪ B) (B ∪ A) (p₁ , p₂) where p₁ : (x : 𝓢) → x ∈ (A ∪ B) → x ∈ (B ∪ A) p₁ x x₁ = ∪-d₂ B A (∨-sym _ _ (∪-d₁ A B x₁)) p₂ : (x : 𝓢) → x ∈ (B ∪ A) → x ∈ (A ∪ B) p₂ x x₁ = ∪-d₂ A B (∨-sym _ _ (∪-d₁ B A x₁)) -- Theorem 23, p. 27 (Suppes 1960) A∪A≡A : (A : 𝓢) → A ∪ A ≡ A A∪A≡A A = equalitySubset (A ∪ A) A (p₁ , p₂) where p₁ : (x :  𝓢) → x ∈ (A ∪ A) → x ∈ A p₁ x x₁ = ∨-idem _ (∪-d₁ A A x₁) p₂ : (x : 𝓢) → x ∈ A → x ∈ (A ∪ A) p₂ x x₁ = ∪-d₂ A A (inj₁ x₁) -- Theorem 25, p. 27 (Suppes 1960) ∪-prop : (A B : 𝓢) → A ⊆ A ∪ B ∪-prop A B t x = ∪-d₂ _ _ (inj₁ x) ⊆∪ : (x A B : 𝓢) → x ⊆ A ∧ x ⊆ B → x ⊆ A ∪ B ⊆∪ x A B (x₁ , x₂) t x₃ = trans-⊆ _ _ _ (x₁ , (∪-prop _ _)) _ x₃ ∪-prop₂ : (x A B : 𝓢) → x ⊆ A ∨ x ⊆ B → x ⊆ A ∪ B ∪-prop₂ x A B (inj₁ x₁) t x₂ = ∪-d₂ _ _ (inj₁ (x₁ _ x₂)) ∪-prop₂ x A B (inj₂ x₁) t x₂ = ∪-d₂ _ _ (inj₂ (x₁ _ x₂)) ∪-prop₃ : (A B : 𝓢) → B ⊆ A ∪ B ∪-prop₃ A B t x = ∪-d₂ _ _ (inj₂ x) -- Theorem 27, p. 27 (Suppes 1960) ∪-prop₄ : (x y A : 𝓢) → x ⊆ A → y ⊆ A → x ∪ y ⊆ A ∪-prop₄ x y A x⊆A y⊆A t t∈x∪y = ∨-idem _ p₂ where p₁ : t ∈ x ∨ t ∈ y p₁ = ∪-d₁ _ _ t∈x∪y p₂ : t ∈ A ∨ t ∈ A p₂ = ∨-prop₅ p₁ (x⊆A _) (y⊆A _) -- Properties about the intersection opertaion. Its existence is justified -- as an axiom derived from the sub axiom schema. _∩_ : 𝓢 → 𝓢 → 𝓢 x ∩ y = proj₁ (sub (λ z → z ∈ y) x) -- Instantiation of the subset axiom schema needed for justifiying -- the operation. sub₂ : (x y : 𝓢) → ∃ (λ B → {z : 𝓢} → (z ∈ B ⇔ z ∈ x ∧ z ∈ y)) sub₂ x y = sub (λ z → z ∈ y) x -- Theorem 12, p.25 (Suppes 1960) ∩-def : (x y : 𝓢) → ∀ {z} → z ∈ x ∩ y ⇔ z ∈ x ∧ z ∈ y ∩-def x y = proj₂ _ (sub₂ x y) -- Projections of ∩-def, useful for avoiding repeating this -- projections later. ∩-d₁ : (x A B : 𝓢) → x ∈ (A ∩ B) → x ∈ A ∧ x ∈ B ∩-d₁ x A B = ∧-proj₁ (∩-def A B) ∩-d₂ : (x A B : 𝓢) → x ∈ A ∧ x ∈ B → x ∈ (A ∩ B) ∩-d₂ x A B = ∧-proj₂ (∩-def A B) -- Theorem 13, p.26 (Suppes 1960) ∩-sym : (A B : 𝓢) → A ∩ B ≡ B ∩ A ∩-sym A B = equalitySubset (A ∩ B) (B ∩ A) (p₁ , p₂) where p₁ : (x : 𝓢) → x ∈ A ∩ B → x ∈ B ∩ A p₁ x x∈A∩B = ∩-d₂ x B A (x∈B , x∈A) where x∈A : x ∈ A x∈A = ∧-proj₁ (∩-d₁ x A B x∈A∩B) x∈B : x ∈ B x∈B = ∧-proj₂ (∩-d₁ x A B x∈A∩B) p₂ : (x :  𝓢) → x ∈ B ∩ A → x ∈ A ∩ B p₂ x x∈B∩A = ∩-d₂ x A B (x∈A , x∈B) where x∈A : x ∈ A x∈A = ∧-proj₂ (∩-d₁ x B A x∈B∩A) x∈B : x ∈ B x∈B = ∧-proj₁ (∩-d₁ x B A x∈B∩A) -- Theorem 14, p. 26 (Suppes 1960). ∩-dist : (A B C : 𝓢) → (A ∩ B) ∩ C ≡ A ∩ (B ∩ C) ∩-dist A B C = equalitySubset ((A ∩ B) ∩ C) (A ∩ (B ∩ C)) (p₁ , p₂) where p₁ : (x : 𝓢) → x ∈ (A ∩ B) ∩ C → x ∈ A ∩ (B ∩ C) p₁ x x₁ = ∩-d₂ x A (B ∩ C) (x∈A , x∈B∩C) where x∈B∩C : x ∈ B ∩ C x∈B∩C = ∩-d₂ x B C (x∈B , x∈C) where x∈A∩B : x ∈ A ∩ B x∈A∩B = ∧-proj₁ (∩-d₁ x (A ∩ B) _ x₁) x∈B : x ∈ B x∈B = ∧-proj₂ (∩-d₁ x _ B x∈A∩B) x∈C : x ∈ C x∈C = ∧-proj₂ (∩-d₁ x _ C x₁) x∈A : x ∈ A x∈A = ∧-proj₁ (∩-d₁ x A _ x∈A∩B) where x∈A∩B : x ∈ A ∩ B x∈A∩B = ∧-proj₁ (∩-d₁ x (A ∩ B) _ x₁) p₂ : (x : 𝓢) → x ∈ A ∩ (B ∩ C) → x ∈ (A ∩ B) ∩ C p₂ x x₁ = ∩-d₂ x (A ∩ B) C (x∈A∩B , x∈C) where x∈A∩B : x ∈ A ∩ B x∈A∩B = ∩-d₂ x A B (x∈A , x∈B) where x∈A : x ∈ A x∈A = ∧-proj₁ (∩-d₁ x A _ x₁) x∈B∩C : x ∈ B ∩ C x∈B∩C = ∧-proj₂ (∩-d₁ x _ (B ∩ C) x₁) x∈B : x ∈ B x∈B = ∧-proj₁ (∩-d₁ x B _ x∈B∩C) x∈C : x ∈ C x∈C = ∧-proj₂ (∩-d₁ x _ C x∈B∩C) where x∈B∩C : x ∈ B ∩ C x∈B∩C = ∧-proj₂ (∩-d₁ x _ (B ∩ C) x₁) -- Theorem 15, p. 26 (Suppes). ∩-itself : (A : 𝓢) → A ∩ A ≡ A ∩-itself A = equalitySubset (A ∩ A) A (p₁ , p₂) where p₁ : (x : 𝓢) → x ∈ A ∩ A → x ∈ A p₁ x x₁ = ∧-proj₁ (∩-d₁ _ A _ x₁) p₂ : (x :  𝓢) → x ∈ A → x ∈ A ∩ A p₂ x x₁ = ∩-d₂ _ A A (x₁ , x₁) -- Theorem 17, p. 26 (Suppes 1960). A∩B⊆A : (A B : 𝓢) → A ∩ B ⊆ A A∩B⊆A A B _ p = ∧-proj₁ (∩-d₁ _ A _ p) -- Properties involving the difference between sets. The existence of this -- sets is also justified as an instance of the subset axiom schema. -- Instantiation of the subset schema that will justify the operation -- of difference between sets. sub₃ : (x y : 𝓢) → ∃ (λ B → {z : 𝓢} → (z ∈ B ⇔ z ∈ x ∧ z ∉ y)) sub₃ x y = sub (λ z → z ∉ y) x _-_ : 𝓢 → 𝓢 → 𝓢 x - y = proj₁ (sub₃ x y) -- Theorem 31, p.28 (Suppes 1960). dif-def : (x y : 𝓢) → ∀ {z} → z ∈ (x - y) ⇔ z ∈ x ∧ z ∉ y dif-def x y = proj₂ _ (sub₃ x y) -- Again both ∧-projections of the past theorem. dif-d₁ : (A B z : 𝓢) → z ∈ A - B → z ∈ A ∧ z ∉ B dif-d₁ A B z = ∧-proj₁ (dif-def A B) dif-d₂ : (A B z : 𝓢) → z ∈ A ∧ z ∉ B → z ∈ A - B dif-d₂ A B z = ∧-proj₂ (dif-def A B) -- Theorem 33, p. 29 (Suppes 1960). ∩- : (A B : 𝓢) → A ∩ (A - B) ≡ A - B ∩- A B = equalitySubset (A ∩ (A - B)) (A - B) (p₁ , p₂) where p₁ : (x : 𝓢) → x ∈ A ∩ (A - B) → x ∈ A - B p₁ x x∈∩- = dif-d₂ A B x (x∈A , x∉B) where x∈A : x ∈ A x∈A = ∧-proj₁ (∩-d₁ x A _ x∈∩-) x∈A-B : x ∈ A - B x∈A-B = ∧-proj₂ (∩-d₁ x _ (A - B) x∈∩-) x∉B : x ∉ B x∉B = ∧-proj₂ (dif-d₁ A B x x∈A-B) p₂ : (x : 𝓢) → x ∈ A - B → x ∈ A ∩ (A - B) p₂ x x∈A-B = ∩-d₂ x A (A - B) ((∧-proj₁ (dif-d₁ A B x x∈A-B)) , x∈A-B) -- References -- -- <NAME> (1960). Axiomatic Set Theory. -- The University Series in Undergraduate Mathematics. -- <NAME>, inc. -- -- Enderton, <NAME>. (1977). Elements of Set Theory. -- Academic Press Inc.
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_578.asm
ljhsiun2/medusa
9
18434
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1817a, %rsi lea addresses_A_ht+0xc754, %rdi nop nop nop xor %r15, %r15 mov $111, %rcx rep movsw nop xor %rbx, %rbx lea addresses_A_ht+0xbd54, %rax cmp %r12, %r12 movl $0x61626364, (%rax) cmp $36662, %rsi lea addresses_UC_ht+0x18f64, %r15 add %rax, %rax mov $0x6162636465666768, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%r15) nop nop nop nop dec %rax lea addresses_D_ht+0xa854, %rsi lea addresses_UC_ht+0x1edf0, %rdi nop nop nop mfence mov $87, %rcx rep movsl nop and %rdi, %rdi lea addresses_UC_ht+0xf854, %rsi lea addresses_normal_ht+0x1db54, %rdi nop nop nop nop nop cmp $38835, %rax mov $106, %rcx rep movsl nop xor $4140, %rsi lea addresses_normal_ht+0x94d4, %rsi nop nop nop nop inc %rbx mov $0x6162636465666768, %rdx movq %rdx, (%rsi) nop nop nop nop nop xor %r15, %r15 lea addresses_UC_ht+0xede3, %rax nop and $22460, %rbx mov (%rax), %edx nop xor $49490, %r12 lea addresses_WC_ht+0xfe54, %rsi lea addresses_WT_ht+0x14f00, %rdi nop nop sub $51525, %rdx mov $120, %rcx rep movsw sub $51281, %rdx lea addresses_normal_ht+0x1e3c4, %rsi lea addresses_UC_ht+0x1e354, %rdi clflush (%rdi) nop nop nop nop and $11532, %rax mov $19, %rcx rep movsl nop nop xor %rax, %rax lea addresses_UC_ht+0x1a9c4, %rsi lea addresses_UC_ht+0x9354, %rdi nop xor %rax, %rax mov $9, %rcx rep movsq nop nop and %rcx, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %rax push %rcx push %rdx // Faulty Load lea addresses_WC+0x15f54, %r15 add $7522, %rdx mov (%r15), %r13d lea oracles, %rdx and $0xff, %r13 shlq $12, %r13 mov (%rdx,%r13,1), %r13 pop %rdx pop %rcx pop %rax pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 7}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 7}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 0}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
bahamut/source/palettes.asm
higan-emu/bahamut-lagoon-translation-kit
2
242814
<gh_stars>1-10 namespace palette { constant white = color(31,31,29) constant gray = color(15,15,15) constant black = color( 2, 2, 2) constant yellow = color(30,30, 2) constant shadow = color(20,20,20) constant green = color(17,31,17) constant ivory = color(31,31,15) constant navy = color( 2, 2,12) constant red = color(31,12,12) constant silver = color(21,21,21) constant crimson = color(21, 8, 8) seek(codeCursor) namespace chapter { enqueue pc seek($e87cdd); { //add yellow text color dw white //color 1 dw black //color 2 dw yellow //color 3 } dequeue pc } namespace field { enqueue pc seek($c6a052); { //add yellow and ivory text colors dw ivory //color 9 dw gray //color 10 dw black //color 11 ds 2 //color 12 dw white //color 13 dw black //color 14 dw yellow //color 15 } dequeue pc } namespace combat { enqueue pc seek($c1ca4d); { //add yellow text color dw white //color 1 dw black //color 2 dw yellow //color 3 } seek($e64b42); { //convert yellow text color to ivory dw white //color 1 dw gray //color 2 dw navy //color 3 ds 2 //color 4 dw ivory //color 5 } dequeue pc } namespace menu { enqueue pc seek($ee53a4); jsl hook seek($ee85d2); { //add green and ivory text colors dw white //color 1 dw gray //color 2 dw black //color 3 ds 2 //color 4 dw shadow //color 5 dw gray //color 6 dw black //color 7 ds 2 //color 8 dw green //color 9 dw gray //color 10 dw black //color 11 ds 2 //color 12 dw ivory //color 13 dw gray //color 14 dw black //color 15 } dequeue pc //add yellow text color and rearrange palette order //------ //ee53a1 lda #$0000 //ee53a4 sta $7e41e6 //------ function hook { php; rep #$20; pha lda.w #white; sta $7e41e2 //color 1 lda.w #black; sta $7e41e4 //color 2 lda.w #yellow; sta $7e41e6 //color 3 pla; plp; rtl } } namespace titleScreen { enqueue pc seek($e89de0); dw black, silver, white //inactive menu item palette seek($e89e00); dw black, crimson, red //selected menu item palette dequeue pc } namespace endingScreen { enqueue pc seek($e8ddf0); insert "../en/binaries/fonts/font-ending-palette.bin" dequeue pc } codeCursor = pc() }
platforms/m3/temp/Tstack_ondemand_v1.10_debug2.asm
lab11/M-ulator
19
243281
<reponame>lab11/M-ulator<gh_stars>10-100 Tstack_ondemand_v1.10_debug2/Tstack_ondemand_v1.10_debug2.elf: file format elf32-littlearm Disassembly of section .text: 00000000 <hang-0x80>: 0: 00002000 .word 0x00002000 4: 00000091 .word 0x00000091 ... 10: 00000080 .word 0x00000080 14: 00000080 .word 0x00000080 18: 00000080 .word 0x00000080 1c: 00000080 .word 0x00000080 20: 00000080 .word 0x00000080 24: 00000080 .word 0x00000080 28: 00000080 .word 0x00000080 2c: 00000000 .word 0x00000000 30: 00000080 .word 0x00000080 34: 00000080 .word 0x00000080 ... 40: 000007f1 .word 0x000007f1 44: 000007fd .word 0x000007fd 48: 00000809 .word 0x00000809 4c: 0000082d .word 0x0000082d 50: 00000845 .word 0x00000845 54: 0000085d .word 0x0000085d 58: 00000875 .word 0x00000875 5c: 0000088d .word 0x0000088d 60: 000008a5 .word 0x000008a5 64: 000008bd .word 0x000008bd 68: 000008d5 .word 0x000008d5 6c: 000008e5 .word 0x000008e5 70: 000008f5 .word 0x000008f5 74: 00000905 .word 0x00000905 ... 00000080 <hang>: 80: e7fe b.n 80 <hang> ... 00000090 <_start>: 90: f000 fc40 bl 914 <main> 94: e7fc b.n 90 <_start> Disassembly of section .text.delay: 00000096 <delay>: 96: b500 push {lr} 98: 2300 movs r3, #0 9a: e001 b.n a0 <delay+0xa> 9c: 46c0 nop ; (mov r8, r8) 9e: 3301 adds r3, #1 a0: 4283 cmp r3, r0 a2: d1fb bne.n 9c <delay+0x6> a4: bd00 pop {pc} Disassembly of section .text.config_timerwd: 000000a8 <config_timerwd>: a8: 4b03 ldr r3, [pc, #12] ; (b8 <config_timerwd+0x10>) aa: 2200 movs r2, #0 ac: 601a str r2, [r3, #0] ae: 4a03 ldr r2, [pc, #12] ; (bc <config_timerwd+0x14>) b0: 6010 str r0, [r2, #0] b2: 2201 movs r2, #1 b4: 601a str r2, [r3, #0] b6: 4770 bx lr b8: a0001200 .word 0xa0001200 bc: a0001204 .word 0xa0001204 Disassembly of section .text.set_wakeup_timer: 000000c0 <set_wakeup_timer>: c0: b500 push {lr} c2: 2900 cmp r1, #0 c4: d003 beq.n ce <set_wakeup_timer+0xe> c6: 23c0 movs r3, #192 ; 0xc0 c8: 029b lsls r3, r3, #10 ca: 4318 orrs r0, r3 cc: e001 b.n d2 <set_wakeup_timer+0x12> ce: 0440 lsls r0, r0, #17 d0: 0c40 lsrs r0, r0, #17 d2: 4b04 ldr r3, [pc, #16] ; (e4 <set_wakeup_timer+0x24>) d4: 6018 str r0, [r3, #0] d6: 2a00 cmp r2, #0 d8: d002 beq.n e0 <set_wakeup_timer+0x20> da: 4b03 ldr r3, [pc, #12] ; (e8 <set_wakeup_timer+0x28>) dc: 2201 movs r2, #1 de: 601a str r2, [r3, #0] e0: bd00 pop {pc} e2: 46c0 nop ; (mov r8, r8) e4: a0000044 .word 0xa0000044 e8: a0001300 .word 0xa0001300 Disassembly of section .text.enable_reg_irq: 000000ec <enable_reg_irq>: ec: 4b04 ldr r3, [pc, #16] ; (100 <enable_reg_irq+0x14>) ee: 2201 movs r2, #1 f0: 4252 negs r2, r2 f2: 601a str r2, [r3, #0] f4: 4b03 ldr r3, [pc, #12] ; (104 <enable_reg_irq+0x18>) f6: 22ff movs r2, #255 ; 0xff f8: 0092 lsls r2, r2, #2 fa: 601a str r2, [r3, #0] fc: 4770 bx lr fe: 46c0 nop ; (mov r8, r8) 100: e000e280 .word 0xe000e280 104: e000e100 .word 0xe000e100 Disassembly of section .text.set_halt_until_mbus_rx: 00000108 <set_halt_until_mbus_rx>: 108: 4b04 ldr r3, [pc, #16] ; (11c <set_halt_until_mbus_rx+0x14>) 10a: 4a05 ldr r2, [pc, #20] ; (120 <set_halt_until_mbus_rx+0x18>) 10c: 6819 ldr r1, [r3, #0] 10e: 400a ands r2, r1 110: 2190 movs r1, #144 ; 0x90 112: 0209 lsls r1, r1, #8 114: 430a orrs r2, r1 116: 601a str r2, [r3, #0] 118: 4770 bx lr 11a: 46c0 nop ; (mov r8, r8) 11c: a0000028 .word 0xa0000028 120: ffff0fff .word 0xffff0fff Disassembly of section .text.set_halt_until_mbus_tx: 00000124 <set_halt_until_mbus_tx>: 124: 4b04 ldr r3, [pc, #16] ; (138 <set_halt_until_mbus_tx+0x14>) 126: 4a05 ldr r2, [pc, #20] ; (13c <set_halt_until_mbus_tx+0x18>) 128: 6819 ldr r1, [r3, #0] 12a: 400a ands r2, r1 12c: 21a0 movs r1, #160 ; 0xa0 12e: 0209 lsls r1, r1, #8 130: 430a orrs r2, r1 132: 601a str r2, [r3, #0] 134: 4770 bx lr 136: 46c0 nop ; (mov r8, r8) 138: a0000028 .word 0xa0000028 13c: ffff0fff .word 0xffff0fff Disassembly of section .text.mbus_write_message32: 00000140 <mbus_write_message32>: 140: 4b02 ldr r3, [pc, #8] ; (14c <mbus_write_message32+0xc>) 142: 0100 lsls r0, r0, #4 144: 4318 orrs r0, r3 146: 6001 str r1, [r0, #0] 148: 2001 movs r0, #1 14a: 4770 bx lr 14c: a0003000 .word 0xa0003000 Disassembly of section .text.mbus_write_message: 00000150 <mbus_write_message>: 150: 2300 movs r3, #0 152: b500 push {lr} 154: 429a cmp r2, r3 156: d00a beq.n 16e <mbus_write_message+0x1e> 158: 4b06 ldr r3, [pc, #24] ; (174 <mbus_write_message+0x24>) 15a: 3a01 subs r2, #1 15c: 0600 lsls r0, r0, #24 15e: 4302 orrs r2, r0 160: 601a str r2, [r3, #0] 162: 4b05 ldr r3, [pc, #20] ; (178 <mbus_write_message+0x28>) 164: 2223 movs r2, #35 ; 0x23 166: 6019 str r1, [r3, #0] 168: 4b04 ldr r3, [pc, #16] ; (17c <mbus_write_message+0x2c>) 16a: 601a str r2, [r3, #0] 16c: 2301 movs r3, #1 16e: 1c18 adds r0, r3, #0 170: bd00 pop {pc} 172: 46c0 nop ; (mov r8, r8) 174: a0002000 .word 0xa0002000 178: a0002004 .word 0xa0002004 17c: a000200c .word 0xa000200c Disassembly of section .text.mbus_enumerate: 00000180 <mbus_enumerate>: 180: 0603 lsls r3, r0, #24 182: 2080 movs r0, #128 ; 0x80 184: 0580 lsls r0, r0, #22 186: 4318 orrs r0, r3 188: 4b01 ldr r3, [pc, #4] ; (190 <mbus_enumerate+0x10>) 18a: 6018 str r0, [r3, #0] 18c: 4770 bx lr 18e: 46c0 nop ; (mov r8, r8) 190: a0003000 .word 0xa0003000 Disassembly of section .text.mbus_sleep_all: 00000194 <mbus_sleep_all>: 194: 4b01 ldr r3, [pc, #4] ; (19c <mbus_sleep_all+0x8>) 196: 2200 movs r2, #0 198: 601a str r2, [r3, #0] 19a: 4770 bx lr 19c: a0003010 .word 0xa0003010 Disassembly of section .text.mbus_remote_register_write: 000001a0 <mbus_remote_register_write>: 1a0: b507 push {r0, r1, r2, lr} 1a2: 0212 lsls r2, r2, #8 1a4: 0a12 lsrs r2, r2, #8 1a6: 0609 lsls r1, r1, #24 1a8: 4311 orrs r1, r2 1aa: 0100 lsls r0, r0, #4 1ac: 9101 str r1, [sp, #4] 1ae: b2c0 uxtb r0, r0 1b0: a901 add r1, sp, #4 1b2: 2201 movs r2, #1 1b4: f7ff ffcc bl 150 <mbus_write_message> 1b8: bd07 pop {r0, r1, r2, pc} Disassembly of section .text.radio_power_off: 000001bc <radio_power_off>: 1bc: 4a15 ldr r2, [pc, #84] ; (214 <radio_power_off+0x58>) 1be: b508 push {r3, lr} 1c0: 2300 movs r3, #0 1c2: 6013 str r3, [r2, #0] 1c4: 4a14 ldr r2, [pc, #80] ; (218 <radio_power_off+0x5c>) 1c6: 2004 movs r0, #4 1c8: 6013 str r3, [r2, #0] 1ca: 4b14 ldr r3, [pc, #80] ; (21c <radio_power_off+0x60>) 1cc: 4a14 ldr r2, [pc, #80] ; (220 <radio_power_off+0x64>) 1ce: 6819 ldr r1, [r3, #0] 1d0: 400a ands r2, r1 1d2: 601a str r2, [r3, #0] 1d4: 6819 ldr r1, [r3, #0] 1d6: 2280 movs r2, #128 ; 0x80 1d8: 02d2 lsls r2, r2, #11 1da: 430a orrs r2, r1 1dc: 601a str r2, [r3, #0] 1de: 681a ldr r2, [r3, #0] 1e0: 2102 movs r1, #2 1e2: f7ff ffdd bl 1a0 <mbus_remote_register_write> 1e6: 4b0f ldr r3, [pc, #60] ; (224 <radio_power_off+0x68>) 1e8: 2101 movs r1, #1 1ea: 881a ldrh r2, [r3, #0] 1ec: 2004 movs r0, #4 1ee: 430a orrs r2, r1 1f0: 801a strh r2, [r3, #0] 1f2: 881a ldrh r2, [r3, #0] 1f4: 2102 movs r1, #2 1f6: 430a orrs r2, r1 1f8: 801a strh r2, [r3, #0] 1fa: 881a ldrh r2, [r3, #0] 1fc: 2108 movs r1, #8 1fe: 4382 bics r2, r0 200: 801a strh r2, [r3, #0] 202: 881a ldrh r2, [r3, #0] 204: 438a bics r2, r1 206: 801a strh r2, [r3, #0] 208: 681a ldr r2, [r3, #0] 20a: 210d movs r1, #13 20c: f7ff ffc8 bl 1a0 <mbus_remote_register_write> 210: bd08 pop {r3, pc} 212: 46c0 nop ; (mov r8, r8) 214: 000013c0 .word 0x000013c0 218: 00001370 .word 0x00001370 21c: 00001338 .word 0x00001338 220: fff7ffff .word 0xfff7ffff 224: 00001330 .word 0x00001330 Disassembly of section .text.ldo_power_off: 00000228 <ldo_power_off>: 228: b508 push {r3, lr} 22a: 4b08 ldr r3, [pc, #32] ; (24c <ldo_power_off+0x24>) 22c: 2280 movs r2, #128 ; 0x80 22e: 6819 ldr r1, [r3, #0] 230: 0152 lsls r2, r2, #5 232: 430a orrs r2, r1 234: 601a str r2, [r3, #0] 236: 6819 ldr r1, [r3, #0] 238: 2280 movs r2, #128 ; 0x80 23a: 0112 lsls r2, r2, #4 23c: 430a orrs r2, r1 23e: 601a str r2, [r3, #0] 240: 681a ldr r2, [r3, #0] 242: 2005 movs r0, #5 244: 2112 movs r1, #18 246: f7ff ffab bl 1a0 <mbus_remote_register_write> 24a: bd08 pop {r3, pc} 24c: 00001358 .word 0x00001358 Disassembly of section .text.temp_power_off: 00000250 <temp_power_off>: 250: b508 push {r3, lr} 252: 4b0b ldr r3, [pc, #44] ; (280 <temp_power_off+0x30>) 254: 2280 movs r2, #128 ; 0x80 256: 6819 ldr r1, [r3, #0] 258: 0252 lsls r2, r2, #9 25a: 430a orrs r2, r1 25c: 601a str r2, [r3, #0] 25e: 6819 ldr r1, [r3, #0] 260: 4a08 ldr r2, [pc, #32] ; (284 <temp_power_off+0x34>) 262: 2005 movs r0, #5 264: 400a ands r2, r1 266: 601a str r2, [r3, #0] 268: 6819 ldr r1, [r3, #0] 26a: 2280 movs r2, #128 ; 0x80 26c: 0392 lsls r2, r2, #14 26e: 430a orrs r2, r1 270: 601a str r2, [r3, #0] 272: 681a ldr r2, [r3, #0] 274: 210e movs r1, #14 276: f7ff ff93 bl 1a0 <mbus_remote_register_write> 27a: f7ff ffd5 bl 228 <ldo_power_off> 27e: bd08 pop {r3, pc} 280: 0000134c .word 0x0000134c 284: ffbfffff .word 0xffbfffff Disassembly of section .text.unlikely.batadc_reset: 00000288 <batadc_reset>: 288: b508 push {r3, lr} 28a: 2006 movs r0, #6 28c: 213b movs r1, #59 ; 0x3b 28e: 4a03 ldr r2, [pc, #12] ; (29c <batadc_reset+0x14>) 290: f7ff ff86 bl 1a0 <mbus_remote_register_write> 294: 2064 movs r0, #100 ; 0x64 296: f7ff fefe bl 96 <delay> 29a: bd08 pop {r3, pc} 29c: 000fe7ff .word 0x000fe7ff Disassembly of section .text.batadc_resetrelease: 000002a0 <batadc_resetrelease>: 2a0: b508 push {r3, lr} 2a2: 2006 movs r0, #6 2a4: 213b movs r1, #59 ; 0x3b 2a6: 4a03 ldr r2, [pc, #12] ; (2b4 <batadc_resetrelease+0x14>) 2a8: f7ff ff7a bl 1a0 <mbus_remote_register_write> 2ac: 2064 movs r0, #100 ; 0x64 2ae: f7ff fef2 bl 96 <delay> 2b2: bd08 pop {r3, pc} 2b4: 000fefff .word 0x000fefff Disassembly of section .text.reset_pmu_solar_short: 000002b8 <reset_pmu_solar_short>: 2b8: b510 push {r4, lr} 2ba: 24c2 movs r4, #194 ; 0xc2 2bc: 00e4 lsls r4, r4, #3 2be: 1c22 adds r2, r4, #0 2c0: 210e movs r1, #14 2c2: 2006 movs r0, #6 2c4: f7ff ff6c bl 1a0 <mbus_remote_register_write> 2c8: 2064 movs r0, #100 ; 0x64 2ca: f7ff fee4 bl 96 <delay> 2ce: 1c22 adds r2, r4, #0 2d0: 210e movs r1, #14 2d2: 2006 movs r0, #6 2d4: f7ff ff64 bl 1a0 <mbus_remote_register_write> 2d8: 2064 movs r0, #100 ; 0x64 2da: f7ff fedc bl 96 <delay> 2de: 2282 movs r2, #130 ; 0x82 2e0: 210e movs r1, #14 2e2: 00d2 lsls r2, r2, #3 2e4: 2006 movs r0, #6 2e6: f7ff ff5b bl 1a0 <mbus_remote_register_write> 2ea: 2064 movs r0, #100 ; 0x64 2ec: f7ff fed3 bl 96 <delay> 2f0: bd10 pop {r4, pc} Disassembly of section .text.radio_power_on: 000002f4 <radio_power_on>: 2f4: b538 push {r3, r4, r5, lr} 2f6: 4b1d ldr r3, [pc, #116] ; (36c <radio_power_on+0x78>) 2f8: 2200 movs r2, #0 2fa: 601a str r2, [r3, #0] 2fc: 4a1c ldr r2, [pc, #112] ; (370 <radio_power_on+0x7c>) 2fe: 4c1d ldr r4, [pc, #116] ; (374 <radio_power_on+0x80>) 300: 2301 movs r3, #1 302: 6013 str r3, [r2, #0] 304: 8822 ldrh r2, [r4, #0] 306: 210d movs r1, #13 308: 439a bics r2, r3 30a: 8022 strh r2, [r4, #0] 30c: 6822 ldr r2, [r4, #0] 30e: 2004 movs r0, #4 310: f7ff ff46 bl 1a0 <mbus_remote_register_write> 314: 2064 movs r0, #100 ; 0x64 316: f7ff febe bl 96 <delay> 31a: 4d17 ldr r5, [pc, #92] ; (378 <radio_power_on+0x84>) 31c: 4b17 ldr r3, [pc, #92] ; (37c <radio_power_on+0x88>) 31e: 682a ldr r2, [r5, #0] 320: 2102 movs r1, #2 322: 4013 ands r3, r2 324: 602b str r3, [r5, #0] 326: 682a ldr r2, [r5, #0] 328: 2004 movs r0, #4 32a: f7ff ff39 bl 1a0 <mbus_remote_register_write> 32e: 2096 movs r0, #150 ; 0x96 330: 0040 lsls r0, r0, #1 332: f7ff feb0 bl 96 <delay> 336: 682a ldr r2, [r5, #0] 338: 2380 movs r3, #128 ; 0x80 33a: 031b lsls r3, r3, #12 33c: 4313 orrs r3, r2 33e: 602b str r3, [r5, #0] 340: 682a ldr r2, [r5, #0] 342: 2102 movs r1, #2 344: 2004 movs r0, #4 346: f7ff ff2b bl 1a0 <mbus_remote_register_write> 34a: 2064 movs r0, #100 ; 0x64 34c: f7ff fea3 bl 96 <delay> 350: 8823 ldrh r3, [r4, #0] 352: 2202 movs r2, #2 354: 4393 bics r3, r2 356: 8023 strh r3, [r4, #0] 358: 6822 ldr r2, [r4, #0] 35a: 210d movs r1, #13 35c: 2004 movs r0, #4 35e: f7ff ff1f bl 1a0 <mbus_remote_register_write> 362: 2064 movs r0, #100 ; 0x64 364: f7ff fe97 bl 96 <delay> 368: bd38 pop {r3, r4, r5, pc} 36a: 46c0 nop ; (mov r8, r8) 36c: 00001370 .word 0x00001370 370: 000013c0 .word 0x000013c0 374: 00001330 .word 0x00001330 378: 00001338 .word 0x00001338 37c: fffbffff .word 0xfffbffff Disassembly of section .text.operation_sleep_notimer: 00000380 <operation_sleep_notimer>: 380: b508 push {r3, lr} 382: f7ff ff51 bl 228 <ldo_power_off> 386: 4b08 ldr r3, [pc, #32] ; (3a8 <operation_sleep_notimer+0x28>) 388: 681b ldr r3, [r3, #0] 38a: 2b00 cmp r3, #0 38c: d001 beq.n 392 <operation_sleep_notimer+0x12> 38e: f7ff ff15 bl 1bc <radio_power_off> 392: 2000 movs r0, #0 394: 1c02 adds r2, r0, #0 396: 1c01 adds r1, r0, #0 398: f7ff fe92 bl c0 <set_wakeup_timer> 39c: 2200 movs r2, #0 39e: 2378 movs r3, #120 ; 0x78 3a0: 601a str r2, [r3, #0] 3a2: f7ff fef7 bl 194 <mbus_sleep_all> 3a6: e7fe b.n 3a6 <operation_sleep_notimer+0x26> 3a8: 000013c0 .word 0x000013c0 Disassembly of section .text.send_radio_data_ppm: 000003ac <send_radio_data_ppm>: 3ac: b570 push {r4, r5, r6, lr} 3ae: 4b2b ldr r3, [pc, #172] ; (45c <send_radio_data_ppm+0xb0>) 3b0: 020a lsls r2, r1, #8 3b2: 6819 ldr r1, [r3, #0] 3b4: 0a12 lsrs r2, r2, #8 3b6: 0e09 lsrs r1, r1, #24 3b8: 0609 lsls r1, r1, #24 3ba: 4311 orrs r1, r2 3bc: 6019 str r1, [r3, #0] 3be: 681a ldr r2, [r3, #0] 3c0: 1c05 adds r5, r0, #0 3c2: 2103 movs r1, #3 3c4: 2004 movs r0, #4 3c6: f7ff feeb bl 1a0 <mbus_remote_register_write> 3ca: 4b25 ldr r3, [pc, #148] ; (460 <send_radio_data_ppm+0xb4>) 3cc: 681a ldr r2, [r3, #0] 3ce: 2a00 cmp r2, #0 3d0: d10d bne.n 3ee <send_radio_data_ppm+0x42> 3d2: 2201 movs r2, #1 3d4: 601a str r2, [r3, #0] 3d6: 4b23 ldr r3, [pc, #140] ; (464 <send_radio_data_ppm+0xb8>) 3d8: 2004 movs r0, #4 3da: 881a ldrh r2, [r3, #0] 3dc: 210d movs r1, #13 3de: 4302 orrs r2, r0 3e0: 801a strh r2, [r3, #0] 3e2: 681a ldr r2, [r3, #0] 3e4: f7ff fedc bl 1a0 <mbus_remote_register_write> 3e8: 2064 movs r0, #100 ; 0x64 3ea: f7ff fe54 bl 96 <delay> 3ee: f7ff fe8b bl 108 <set_halt_until_mbus_rx> 3f2: 4e1d ldr r6, [pc, #116] ; (468 <send_radio_data_ppm+0xbc>) 3f4: 2300 movs r3, #0 3f6: 6033 str r3, [r6, #0] 3f8: 4b1a ldr r3, [pc, #104] ; (464 <send_radio_data_ppm+0xb8>) 3fa: 2108 movs r1, #8 3fc: 881a ldrh r2, [r3, #0] 3fe: 2004 movs r0, #4 400: 430a orrs r2, r1 402: 801a strh r2, [r3, #0] 404: 681a ldr r2, [r3, #0] 406: 210d movs r1, #13 408: f7ff feca bl 1a0 <mbus_remote_register_write> 40c: 2432 movs r4, #50 ; 0x32 40e: 6833 ldr r3, [r6, #0] 410: 2b00 cmp r3, #0 412: d015 beq.n 440 <send_radio_data_ppm+0x94> 414: f7ff fe86 bl 124 <set_halt_until_mbus_tx> 418: 2300 movs r3, #0 41a: 6033 str r3, [r6, #0] 41c: 429d cmp r5, r3 41e: d004 beq.n 42a <send_radio_data_ppm+0x7e> 420: 4a0f ldr r2, [pc, #60] ; (460 <send_radio_data_ppm+0xb4>) 422: 6013 str r3, [r2, #0] 424: f7ff feca bl 1bc <radio_power_off> 428: e016 b.n 458 <send_radio_data_ppm+0xac> 42a: 4b0e ldr r3, [pc, #56] ; (464 <send_radio_data_ppm+0xb8>) 42c: 2108 movs r1, #8 42e: 881a ldrh r2, [r3, #0] 430: 2004 movs r0, #4 432: 438a bics r2, r1 434: 801a strh r2, [r3, #0] 436: 681a ldr r2, [r3, #0] 438: 210d movs r1, #13 43a: f7ff feb1 bl 1a0 <mbus_remote_register_write> 43e: e00b b.n 458 <send_radio_data_ppm+0xac> 440: 2064 movs r0, #100 ; 0x64 442: 3c01 subs r4, #1 444: f7ff fe27 bl 96 <delay> 448: 2c00 cmp r4, #0 44a: d1e0 bne.n 40e <send_radio_data_ppm+0x62> 44c: f7ff fe6a bl 124 <set_halt_until_mbus_tx> 450: 20bb movs r0, #187 ; 0xbb 452: 4906 ldr r1, [pc, #24] ; (46c <send_radio_data_ppm+0xc0>) 454: f7ff fe74 bl 140 <mbus_write_message32> 458: bd70 pop {r4, r5, r6, pc} 45a: 46c0 nop ; (mov r8, r8) 45c: 00001a04 .word 0x00001a04 460: 00001370 .word 0x00001370 464: 00001330 .word 0x00001330 468: 000013a4 .word 0x000013a4 46c: fafafafa .word 0xfafafafa Disassembly of section .text.operation_temp_run: 00000470 <operation_temp_run>: 470: b538 push {r3, r4, r5, lr} 472: 4bb9 ldr r3, [pc, #740] ; (758 <operation_temp_run+0x2e8>) 474: 681a ldr r2, [r3, #0] 476: 2a00 cmp r2, #0 478: d122 bne.n 4c0 <operation_temp_run+0x50> 47a: 2101 movs r1, #1 47c: 6019 str r1, [r3, #0] 47e: 4bb7 ldr r3, [pc, #732] ; (75c <operation_temp_run+0x2ec>) 480: 601a str r2, [r3, #0] 482: 4bb7 ldr r3, [pc, #732] ; (760 <operation_temp_run+0x2f0>) 484: 681b ldr r3, [r3, #0] 486: 2b00 cmp r3, #0 488: d104 bne.n 494 <operation_temp_run+0x24> 48a: 4bb6 ldr r3, [pc, #728] ; (764 <operation_temp_run+0x2f4>) 48c: 681b ldr r3, [r3, #0] 48e: 185b adds r3, r3, r1 490: 2b04 cmp r3, #4 492: d801 bhi.n 498 <operation_temp_run+0x28> 494: f7ff ff2e bl 2f4 <radio_power_on> 498: 4bb3 ldr r3, [pc, #716] ; (768 <operation_temp_run+0x2f8>) 49a: 4ab4 ldr r2, [pc, #720] ; (76c <operation_temp_run+0x2fc>) 49c: 6819 ldr r1, [r3, #0] 49e: 2005 movs r0, #5 4a0: 400a ands r2, r1 4a2: 601a str r2, [r3, #0] 4a4: 681a ldr r2, [r3, #0] 4a6: 2112 movs r1, #18 4a8: f7ff fe7a bl 1a0 <mbus_remote_register_write> 4ac: 4bb0 ldr r3, [pc, #704] ; (770 <operation_temp_run+0x300>) 4ae: 2101 movs r1, #1 4b0: 6818 ldr r0, [r3, #0] 4b2: 1c0a adds r2, r1, #0 4b4: b280 uxth r0, r0 4b6: f7ff fe03 bl c0 <set_wakeup_timer> 4ba: f7ff fe6b bl 194 <mbus_sleep_all> 4be: e7fe b.n 4be <operation_temp_run+0x4e> 4c0: 681c ldr r4, [r3, #0] 4c2: 2c01 cmp r4, #1 4c4: d115 bne.n 4f2 <operation_temp_run+0x82> 4c6: 2203 movs r2, #3 4c8: 601a str r2, [r3, #0] 4ca: 4ba7 ldr r3, [pc, #668] ; (768 <operation_temp_run+0x2f8>) 4cc: 4aa9 ldr r2, [pc, #676] ; (774 <operation_temp_run+0x304>) 4ce: 6819 ldr r1, [r3, #0] 4d0: 2005 movs r0, #5 4d2: 400a ands r2, r1 4d4: 601a str r2, [r3, #0] 4d6: 681a ldr r2, [r3, #0] 4d8: 2112 movs r1, #18 4da: f7ff fe61 bl 1a0 <mbus_remote_register_write> 4de: 4ba4 ldr r3, [pc, #656] ; (770 <operation_temp_run+0x300>) 4e0: 1c21 adds r1, r4, #0 4e2: 6818 ldr r0, [r3, #0] 4e4: 1c22 adds r2, r4, #0 4e6: b280 uxth r0, r0 4e8: f7ff fdea bl c0 <set_wakeup_timer> 4ec: f7ff fe52 bl 194 <mbus_sleep_all> 4f0: e7fe b.n 4f0 <operation_temp_run+0x80> 4f2: 681a ldr r2, [r3, #0] 4f4: 2a03 cmp r2, #3 4f6: d124 bne.n 542 <operation_temp_run+0xd2> 4f8: 4c9f ldr r4, [pc, #636] ; (778 <operation_temp_run+0x308>) 4fa: 2202 movs r2, #2 4fc: 601a str r2, [r3, #0] 4fe: 6822 ldr r2, [r4, #0] 500: 2380 movs r3, #128 ; 0x80 502: 03db lsls r3, r3, #15 504: 4313 orrs r3, r2 506: 6023 str r3, [r4, #0] 508: 6822 ldr r2, [r4, #0] 50a: 4b9c ldr r3, [pc, #624] ; (77c <operation_temp_run+0x30c>) 50c: 210e movs r1, #14 50e: 4013 ands r3, r2 510: 6023 str r3, [r4, #0] 512: 6822 ldr r2, [r4, #0] 514: 2005 movs r0, #5 516: f7ff fe43 bl 1a0 <mbus_remote_register_write> 51a: 2064 movs r0, #100 ; 0x64 51c: f7ff fdbb bl 96 <delay> 520: 6822 ldr r2, [r4, #0] 522: 4b97 ldr r3, [pc, #604] ; (780 <operation_temp_run+0x310>) 524: 2005 movs r0, #5 526: 4013 ands r3, r2 528: 6023 str r3, [r4, #0] 52a: 6822 ldr r2, [r4, #0] 52c: 210e movs r1, #14 52e: f7ff fe37 bl 1a0 <mbus_remote_register_write> 532: 2101 movs r1, #1 534: 200a movs r0, #10 536: 1c0a adds r2, r1, #0 538: f7ff fdc2 bl c0 <set_wakeup_timer> 53c: f7ff fe2a bl 194 <mbus_sleep_all> 540: e7fe b.n 540 <operation_temp_run+0xd0> 542: 681a ldr r2, [r3, #0] 544: 2a02 cmp r2, #2 546: d11f bne.n 588 <operation_temp_run+0x118> 548: 4d8e ldr r5, [pc, #568] ; (784 <operation_temp_run+0x314>) 54a: 2300 movs r3, #0 54c: 4c8e ldr r4, [pc, #568] ; (788 <operation_temp_run+0x318>) 54e: 602b str r3, [r5, #0] 550: 682b ldr r3, [r5, #0] 552: 2b00 cmp r3, #0 554: d004 beq.n 560 <operation_temp_run+0xf0> 556: 4a81 ldr r2, [pc, #516] ; (75c <operation_temp_run+0x2ec>) 558: 2300 movs r3, #0 55a: 602b str r3, [r5, #0] 55c: 6013 str r3, [r2, #0] 55e: e00f b.n 580 <operation_temp_run+0x110> 560: 200a movs r0, #10 562: f7ff fd98 bl 96 <delay> 566: 3c01 subs r4, #1 568: 4888 ldr r0, [pc, #544] ; (78c <operation_temp_run+0x31c>) 56a: f7ff fd9d bl a8 <config_timerwd> 56e: 2c00 cmp r4, #0 570: d1ee bne.n 550 <operation_temp_run+0xe0> 572: 20fa movs r0, #250 ; 0xfa 574: 4986 ldr r1, [pc, #536] ; (790 <operation_temp_run+0x320>) 576: f7ff fde3 bl 140 <mbus_write_message32> 57a: 4b78 ldr r3, [pc, #480] ; (75c <operation_temp_run+0x2ec>) 57c: 2201 movs r2, #1 57e: 601a str r2, [r3, #0] 580: 4b75 ldr r3, [pc, #468] ; (758 <operation_temp_run+0x2e8>) 582: 2206 movs r2, #6 584: 601a str r2, [r3, #0] 586: e0e5 b.n 754 <operation_temp_run+0x2e4> 588: 681b ldr r3, [r3, #0] 58a: 2b06 cmp r3, #6 58c: d000 beq.n 590 <operation_temp_run+0x120> 58e: e0ce b.n 72e <operation_temp_run+0x2be> 590: 4b72 ldr r3, [pc, #456] ; (75c <operation_temp_run+0x2ec>) 592: 4a80 ldr r2, [pc, #512] ; (794 <operation_temp_run+0x324>) 594: 681b ldr r3, [r3, #0] 596: 2b00 cmp r3, #0 598: d002 beq.n 5a0 <operation_temp_run+0x130> 59a: 4b7f ldr r3, [pc, #508] ; (798 <operation_temp_run+0x328>) 59c: 6013 str r3, [r2, #0] 59e: e002 b.n 5a6 <operation_temp_run+0x136> 5a0: 6811 ldr r1, [r2, #0] 5a2: 4b7e ldr r3, [pc, #504] ; (79c <operation_temp_run+0x32c>) 5a4: 6019 str r1, [r3, #0] 5a6: 4b7e ldr r3, [pc, #504] ; (7a0 <operation_temp_run+0x330>) 5a8: 4c6b ldr r4, [pc, #428] ; (758 <operation_temp_run+0x2e8>) 5aa: 6819 ldr r1, [r3, #0] 5ac: 2904 cmp r1, #4 5ae: d80a bhi.n 5c6 <operation_temp_run+0x156> 5b0: 6819 ldr r1, [r3, #0] 5b2: 6810 ldr r0, [r2, #0] 5b4: 4a7b ldr r2, [pc, #492] ; (7a4 <operation_temp_run+0x334>) 5b6: 0089 lsls r1, r1, #2 5b8: 5088 str r0, [r1, r2] 5ba: 681a ldr r2, [r3, #0] 5bc: 3201 adds r2, #1 5be: 601a str r2, [r3, #0] 5c0: 2302 movs r3, #2 5c2: 6023 str r3, [r4, #0] 5c4: e0c6 b.n 754 <operation_temp_run+0x2e4> 5c6: 2500 movs r5, #0 5c8: 601d str r5, [r3, #0] 5ca: f7ff fe41 bl 250 <temp_power_off> 5ce: 6025 str r5, [r4, #0] 5d0: 4d64 ldr r5, [pc, #400] ; (764 <operation_temp_run+0x2f4>) 5d2: 20cc movs r0, #204 ; 0xcc 5d4: 6829 ldr r1, [r5, #0] 5d6: f7ff fdb3 bl 140 <mbus_write_message32> 5da: 2064 movs r0, #100 ; 0x64 5dc: f7ff fd5b bl 96 <delay> 5e0: 4b71 ldr r3, [pc, #452] ; (7a8 <operation_temp_run+0x338>) 5e2: 20cc movs r0, #204 ; 0xcc 5e4: 6819 ldr r1, [r3, #0] 5e6: f7ff fdab bl 140 <mbus_write_message32> 5ea: 2064 movs r0, #100 ; 0x64 5ec: f7ff fd53 bl 96 <delay> 5f0: 4c6c ldr r4, [pc, #432] ; (7a4 <operation_temp_run+0x334>) 5f2: 20c0 movs r0, #192 ; 0xc0 5f4: 6821 ldr r1, [r4, #0] 5f6: f7ff fda3 bl 140 <mbus_write_message32> 5fa: 2064 movs r0, #100 ; 0x64 5fc: f7ff fd4b bl 96 <delay> 600: 6861 ldr r1, [r4, #4] 602: 20c1 movs r0, #193 ; 0xc1 604: f7ff fd9c bl 140 <mbus_write_message32> 608: 2064 movs r0, #100 ; 0x64 60a: f7ff fd44 bl 96 <delay> 60e: 68a1 ldr r1, [r4, #8] 610: 20c2 movs r0, #194 ; 0xc2 612: f7ff fd95 bl 140 <mbus_write_message32> 616: 2064 movs r0, #100 ; 0x64 618: f7ff fd3d bl 96 <delay> 61c: 68e1 ldr r1, [r4, #12] 61e: 20c3 movs r0, #195 ; 0xc3 620: f7ff fd8e bl 140 <mbus_write_message32> 624: 2064 movs r0, #100 ; 0x64 626: f7ff fd36 bl 96 <delay> 62a: 6921 ldr r1, [r4, #16] 62c: 20c4 movs r0, #196 ; 0xc4 62e: f7ff fd87 bl 140 <mbus_write_message32> 632: 682b ldr r3, [r5, #0] 634: 4a5d ldr r2, [pc, #372] ; (7ac <operation_temp_run+0x33c>) 636: 3301 adds r3, #1 638: 602b str r3, [r5, #0] 63a: 4b5d ldr r3, [pc, #372] ; (7b0 <operation_temp_run+0x340>) 63c: 6819 ldr r1, [r3, #0] 63e: 4291 cmp r1, r2 640: d80b bhi.n 65a <operation_temp_run+0x1ea> 642: 4a54 ldr r2, [pc, #336] ; (794 <operation_temp_run+0x324>) 644: 6819 ldr r1, [r3, #0] 646: 6810 ldr r0, [r2, #0] 648: 4a5a ldr r2, [pc, #360] ; (7b4 <operation_temp_run+0x344>) 64a: 0089 lsls r1, r1, #2 64c: 5088 str r0, [r1, r2] 64e: 6819 ldr r1, [r3, #0] 650: 4a59 ldr r2, [pc, #356] ; (7b8 <operation_temp_run+0x348>) 652: 6011 str r1, [r2, #0] 654: 681a ldr r2, [r3, #0] 656: 3201 adds r2, #1 658: 601a str r2, [r3, #0] 65a: 4b41 ldr r3, [pc, #260] ; (760 <operation_temp_run+0x2f0>) 65c: 681b ldr r3, [r3, #0] 65e: 2b00 cmp r3, #0 660: d004 beq.n 66c <operation_temp_run+0x1fc> 662: 4b4c ldr r3, [pc, #304] ; (794 <operation_temp_run+0x324>) 664: 2000 movs r0, #0 666: 6819 ldr r1, [r3, #0] 668: f7ff fea0 bl 3ac <send_radio_data_ppm> 66c: 4b3d ldr r3, [pc, #244] ; (764 <operation_temp_run+0x2f4>) 66e: 681b ldr r3, [r3, #0] 670: 2b04 cmp r3, #4 672: d809 bhi.n 688 <operation_temp_run+0x218> 674: 4851 ldr r0, [pc, #324] ; (7bc <operation_temp_run+0x34c>) 676: f7ff fd0e bl 96 <delay> 67a: 2001 movs r0, #1 67c: 4950 ldr r1, [pc, #320] ; (7c0 <operation_temp_run+0x350>) 67e: f7ff fe95 bl 3ac <send_radio_data_ppm> 682: 4b50 ldr r3, [pc, #320] ; (7c4 <operation_temp_run+0x354>) 684: 6818 ldr r0, [r3, #0] 686: e028 b.n 6da <operation_temp_run+0x26a> 688: 4844 ldr r0, [pc, #272] ; (79c <operation_temp_run+0x32c>) 68a: 494f ldr r1, [pc, #316] ; (7c8 <operation_temp_run+0x358>) 68c: 6804 ldr r4, [r0, #0] 68e: 680a ldr r2, [r1, #0] 690: 4b4e ldr r3, [pc, #312] ; (7cc <operation_temp_run+0x35c>) 692: 3264 adds r2, #100 ; 0x64 694: 4294 cmp r4, r2 696: d201 bcs.n 69c <operation_temp_run+0x22c> 698: 2201 movs r2, #1 69a: e018 b.n 6ce <operation_temp_run+0x25e> 69c: 6805 ldr r5, [r0, #0] 69e: 680c ldr r4, [r1, #0] 6a0: 4a4b ldr r2, [pc, #300] ; (7d0 <operation_temp_run+0x360>) 6a2: 34c8 adds r4, #200 ; 0xc8 6a4: 42a5 cmp r5, r4 6a6: d201 bcs.n 6ac <operation_temp_run+0x23c> 6a8: 6812 ldr r2, [r2, #0] 6aa: e010 b.n 6ce <operation_temp_run+0x25e> 6ac: 6805 ldr r5, [r0, #0] 6ae: 680c ldr r4, [r1, #0] 6b0: 34f5 adds r4, #245 ; 0xf5 6b2: 34ff adds r4, #255 ; 0xff 6b4: 42a5 cmp r5, r4 6b6: d201 bcs.n 6bc <operation_temp_run+0x24c> 6b8: 6852 ldr r2, [r2, #4] 6ba: e008 b.n 6ce <operation_temp_run+0x25e> 6bc: 6800 ldr r0, [r0, #0] 6be: 4c45 ldr r4, [pc, #276] ; (7d4 <operation_temp_run+0x364>) 6c0: 6809 ldr r1, [r1, #0] 6c2: 1909 adds r1, r1, r4 6c4: 4288 cmp r0, r1 6c6: d201 bcs.n 6cc <operation_temp_run+0x25c> 6c8: 6892 ldr r2, [r2, #8] 6ca: e000 b.n 6ce <operation_temp_run+0x25e> 6cc: 68d2 ldr r2, [r2, #12] 6ce: 601a str r2, [r3, #0] 6d0: 4b41 ldr r3, [pc, #260] ; (7d8 <operation_temp_run+0x368>) 6d2: 6818 ldr r0, [r3, #0] 6d4: 4b3d ldr r3, [pc, #244] ; (7cc <operation_temp_run+0x35c>) 6d6: 681b ldr r3, [r3, #0] 6d8: 4358 muls r0, r3 6da: 2101 movs r1, #1 6dc: b280 uxth r0, r0 6de: 1c0a adds r2, r1, #0 6e0: f7ff fcee bl c0 <set_wakeup_timer> 6e4: 4b3d ldr r3, [pc, #244] ; (7dc <operation_temp_run+0x36c>) 6e6: 681b ldr r3, [r3, #0] 6e8: 2b00 cmp r3, #0 6ea: d004 beq.n 6f6 <operation_temp_run+0x286> 6ec: 4b3c ldr r3, [pc, #240] ; (7e0 <operation_temp_run+0x370>) 6ee: 2200 movs r2, #0 6f0: 601a str r2, [r3, #0] 6f2: f7ff fd63 bl 1bc <radio_power_off> 6f6: 4a3b ldr r2, [pc, #236] ; (7e4 <operation_temp_run+0x374>) 6f8: 6813 ldr r3, [r2, #0] 6fa: 2b00 cmp r3, #0 6fc: d006 beq.n 70c <operation_temp_run+0x29c> 6fe: 4b27 ldr r3, [pc, #156] ; (79c <operation_temp_run+0x32c>) 700: 6819 ldr r1, [r3, #0] 702: 4b31 ldr r3, [pc, #196] ; (7c8 <operation_temp_run+0x358>) 704: 6019 str r1, [r3, #0] 706: 2300 movs r3, #0 708: 6013 str r3, [r2, #0] 70a: e00a b.n 722 <operation_temp_run+0x2b2> 70c: 4a26 ldr r2, [pc, #152] ; (7a8 <operation_temp_run+0x338>) 70e: 6811 ldr r1, [r2, #0] 710: 2900 cmp r1, #0 712: d009 beq.n 728 <operation_temp_run+0x2b8> 714: 4913 ldr r1, [pc, #76] ; (764 <operation_temp_run+0x2f4>) 716: 2032 movs r0, #50 ; 0x32 718: 6809 ldr r1, [r1, #0] 71a: 6812 ldr r2, [r2, #0] 71c: 4090 lsls r0, r2 71e: 4281 cmp r1, r0 720: d902 bls.n 728 <operation_temp_run+0x2b8> 722: 4a31 ldr r2, [pc, #196] ; (7e8 <operation_temp_run+0x378>) 724: 6013 str r3, [r2, #0] 726: e013 b.n 750 <operation_temp_run+0x2e0> 728: f7ff fd34 bl 194 <mbus_sleep_all> 72c: e7fe b.n 72c <operation_temp_run+0x2bc> 72e: 4b12 ldr r3, [pc, #72] ; (778 <operation_temp_run+0x308>) 730: 4a2e ldr r2, [pc, #184] ; (7ec <operation_temp_run+0x37c>) 732: 6819 ldr r1, [r3, #0] 734: 2005 movs r0, #5 736: 400a ands r2, r1 738: 601a str r2, [r3, #0] 73a: 6819 ldr r1, [r3, #0] 73c: 2280 movs r2, #128 ; 0x80 73e: 0392 lsls r2, r2, #14 740: 430a orrs r2, r1 742: 601a str r2, [r3, #0] 744: 681a ldr r2, [r3, #0] 746: 210e movs r1, #14 748: f7ff fd2a bl 1a0 <mbus_remote_register_write> 74c: f7ff fd80 bl 250 <temp_power_off> 750: f7ff fe16 bl 380 <operation_sleep_notimer> 754: bd38 pop {r3, r4, r5, pc} 756: 46c0 nop ; (mov r8, r8) 758: 0000139c .word 0x0000139c 75c: 00001388 .word 0x00001388 760: 00001394 .word 0x00001394 764: 00001378 .word 0x00001378 768: 00001358 .word 0x00001358 76c: fffff7ff .word 0xfffff7ff 770: 00001320 .word 0x00001320 774: ffffefff .word 0xffffefff 778: 0000134c .word 0x0000134c 77c: ffdfffff .word 0xffdfffff 780: fffeffff .word 0xfffeffff 784: 000013a4 .word 0x000013a4 788: 00004e20 .word 0x00004e20 78c: 000fffff .word 0x000fffff 790: fafafafa .word 0xfafafafa 794: 000013b8 .word 0x000013b8 798: 00000666 .word 0x00000666 79c: 00001324 .word 0x00001324 7a0: 000013ac .word 0x000013ac 7a4: 00001a08 .word 0x00001a08 7a8: 00001390 .word 0x00001390 7ac: 0000018f .word 0x0000018f 7b0: 00001380 .word 0x00001380 7b4: 000013c4 .word 0x000013c4 7b8: 00001374 .word 0x00001374 7bc: 00001388 .word 0x00001388 7c0: 00faf000 .word 0x00faf000 7c4: 000013a0 .word 0x000013a0 7c8: 00001350 .word 0x00001350 7cc: 0000132c .word 0x0000132c 7d0: 00001360 .word 0x00001360 7d4: 000005dc .word 0x000005dc 7d8: 000013bc .word 0x000013bc 7dc: 000013c0 .word 0x000013c0 7e0: 00001370 .word 0x00001370 7e4: 0000138c .word 0x0000138c 7e8: 000013b4 .word 0x000013b4 7ec: ffbfffff .word 0xffbfffff Disassembly of section .text.handler_ext_int_0: 000007f0 <handler_ext_int_0>: 7f0: 4b01 ldr r3, [pc, #4] ; (7f8 <handler_ext_int_0+0x8>) 7f2: 2201 movs r2, #1 7f4: 601a str r2, [r3, #0] 7f6: 4770 bx lr 7f8: e000e280 .word 0xe000e280 Disassembly of section .text.handler_ext_int_1: 000007fc <handler_ext_int_1>: 7fc: 4b01 ldr r3, [pc, #4] ; (804 <handler_ext_int_1+0x8>) 7fe: 2202 movs r2, #2 800: 601a str r2, [r3, #0] 802: 4770 bx lr 804: e000e280 .word 0xe000e280 Disassembly of section .text.handler_ext_int_2: 00000808 <handler_ext_int_2>: 808: 4b05 ldr r3, [pc, #20] ; (820 <handler_ext_int_2+0x18>) 80a: 2204 movs r2, #4 80c: 601a str r2, [r3, #0] 80e: 4b05 ldr r3, [pc, #20] ; (824 <handler_ext_int_2+0x1c>) 810: 2210 movs r2, #16 812: 601a str r2, [r3, #0] 814: 23a0 movs r3, #160 ; 0xa0 816: 061b lsls r3, r3, #24 818: 681a ldr r2, [r3, #0] 81a: 4b03 ldr r3, [pc, #12] ; (828 <handler_ext_int_2+0x20>) 81c: 601a str r2, [r3, #0] 81e: 4770 bx lr 820: e000e280 .word 0xe000e280 824: 000013a4 .word 0x000013a4 828: 000013b8 .word 0x000013b8 Disassembly of section .text.handler_ext_int_3: 0000082c <handler_ext_int_3>: 82c: 4b03 ldr r3, [pc, #12] ; (83c <handler_ext_int_3+0x10>) 82e: 2208 movs r2, #8 830: 601a str r2, [r3, #0] 832: 4b03 ldr r3, [pc, #12] ; (840 <handler_ext_int_3+0x14>) 834: 2211 movs r2, #17 836: 601a str r2, [r3, #0] 838: 4770 bx lr 83a: 46c0 nop ; (mov r8, r8) 83c: e000e280 .word 0xe000e280 840: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_4: 00000844 <handler_ext_int_4>: 844: 4b03 ldr r3, [pc, #12] ; (854 <handler_ext_int_4+0x10>) 846: 2210 movs r2, #16 848: 601a str r2, [r3, #0] 84a: 4b03 ldr r3, [pc, #12] ; (858 <handler_ext_int_4+0x14>) 84c: 2212 movs r2, #18 84e: 601a str r2, [r3, #0] 850: 4770 bx lr 852: 46c0 nop ; (mov r8, r8) 854: e000e280 .word 0xe000e280 858: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_5: 0000085c <handler_ext_int_5>: 85c: 4b03 ldr r3, [pc, #12] ; (86c <handler_ext_int_5+0x10>) 85e: 2220 movs r2, #32 860: 601a str r2, [r3, #0] 862: 4b03 ldr r3, [pc, #12] ; (870 <handler_ext_int_5+0x14>) 864: 2213 movs r2, #19 866: 601a str r2, [r3, #0] 868: 4770 bx lr 86a: 46c0 nop ; (mov r8, r8) 86c: e000e280 .word 0xe000e280 870: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_6: 00000874 <handler_ext_int_6>: 874: 4b03 ldr r3, [pc, #12] ; (884 <handler_ext_int_6+0x10>) 876: 2240 movs r2, #64 ; 0x40 878: 601a str r2, [r3, #0] 87a: 4b03 ldr r3, [pc, #12] ; (888 <handler_ext_int_6+0x14>) 87c: 2214 movs r2, #20 87e: 601a str r2, [r3, #0] 880: 4770 bx lr 882: 46c0 nop ; (mov r8, r8) 884: e000e280 .word 0xe000e280 888: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_7: 0000088c <handler_ext_int_7>: 88c: 4b03 ldr r3, [pc, #12] ; (89c <handler_ext_int_7+0x10>) 88e: 2280 movs r2, #128 ; 0x80 890: 601a str r2, [r3, #0] 892: 4b03 ldr r3, [pc, #12] ; (8a0 <handler_ext_int_7+0x14>) 894: 2215 movs r2, #21 896: 601a str r2, [r3, #0] 898: 4770 bx lr 89a: 46c0 nop ; (mov r8, r8) 89c: e000e280 .word 0xe000e280 8a0: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_8: 000008a4 <handler_ext_int_8>: 8a4: 4b03 ldr r3, [pc, #12] ; (8b4 <handler_ext_int_8+0x10>) 8a6: 2280 movs r2, #128 ; 0x80 8a8: 0052 lsls r2, r2, #1 8aa: 601a str r2, [r3, #0] 8ac: 4b02 ldr r3, [pc, #8] ; (8b8 <handler_ext_int_8+0x14>) 8ae: 2216 movs r2, #22 8b0: 601a str r2, [r3, #0] 8b2: 4770 bx lr 8b4: e000e280 .word 0xe000e280 8b8: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_9: 000008bc <handler_ext_int_9>: 8bc: 4b03 ldr r3, [pc, #12] ; (8cc <handler_ext_int_9+0x10>) 8be: 2280 movs r2, #128 ; 0x80 8c0: 0092 lsls r2, r2, #2 8c2: 601a str r2, [r3, #0] 8c4: 4b02 ldr r3, [pc, #8] ; (8d0 <handler_ext_int_9+0x14>) 8c6: 2217 movs r2, #23 8c8: 601a str r2, [r3, #0] 8ca: 4770 bx lr 8cc: e000e280 .word 0xe000e280 8d0: 000013a4 .word 0x000013a4 Disassembly of section .text.handler_ext_int_10: 000008d4 <handler_ext_int_10>: 8d4: 4b02 ldr r3, [pc, #8] ; (8e0 <handler_ext_int_10+0xc>) 8d6: 2280 movs r2, #128 ; 0x80 8d8: 00d2 lsls r2, r2, #3 8da: 601a str r2, [r3, #0] 8dc: 4770 bx lr 8de: 46c0 nop ; (mov r8, r8) 8e0: e000e280 .word 0xe000e280 Disassembly of section .text.handler_ext_int_11: 000008e4 <handler_ext_int_11>: 8e4: 4b02 ldr r3, [pc, #8] ; (8f0 <handler_ext_int_11+0xc>) 8e6: 2280 movs r2, #128 ; 0x80 8e8: 0112 lsls r2, r2, #4 8ea: 601a str r2, [r3, #0] 8ec: 4770 bx lr 8ee: 46c0 nop ; (mov r8, r8) 8f0: e000e280 .word 0xe000e280 Disassembly of section .text.handler_ext_int_12: 000008f4 <handler_ext_int_12>: 8f4: 4b02 ldr r3, [pc, #8] ; (900 <handler_ext_int_12+0xc>) 8f6: 2280 movs r2, #128 ; 0x80 8f8: 0152 lsls r2, r2, #5 8fa: 601a str r2, [r3, #0] 8fc: 4770 bx lr 8fe: 46c0 nop ; (mov r8, r8) 900: e000e280 .word 0xe000e280 Disassembly of section .text.handler_ext_int_13: 00000904 <handler_ext_int_13>: 904: 4b02 ldr r3, [pc, #8] ; (910 <handler_ext_int_13+0xc>) 906: 2280 movs r2, #128 ; 0x80 908: 0192 lsls r2, r2, #6 90a: 601a str r2, [r3, #0] 90c: 4770 bx lr 90e: 46c0 nop ; (mov r8, r8) 910: e000e280 .word 0xe000e280 Disassembly of section .text.startup.main: 00000914 <main>: 914: b5f0 push {r4, r5, r6, r7, lr} 916: b085 sub sp, #20 918: f7ff fbe8 bl ec <enable_reg_irq> 91c: 48f5 ldr r0, [pc, #980] ; (cf4 <main+0x3e0>) 91e: f7ff fbc3 bl a8 <config_timerwd> 922: 4af5 ldr r2, [pc, #980] ; (cf8 <main+0x3e4>) 924: 49f5 ldr r1, [pc, #980] ; (cfc <main+0x3e8>) 926: 6813 ldr r3, [r2, #0] 928: 428b cmp r3, r1 92a: d100 bne.n 92e <main+0x1a> 92c: e17f b.n c2e <main+0x31a> 92e: 4bf4 ldr r3, [pc, #976] ; (d00 <main+0x3ec>) 930: 2780 movs r7, #128 ; 0x80 932: 6818 ldr r0, [r3, #0] 934: 017f lsls r7, r7, #5 936: 4338 orrs r0, r7 938: 6018 str r0, [r3, #0] 93a: 681c ldr r4, [r3, #0] 93c: 48f1 ldr r0, [pc, #964] ; (d04 <main+0x3f0>) 93e: 250f movs r5, #15 940: 4020 ands r0, r4 942: 2480 movs r4, #128 ; 0x80 944: 01a4 lsls r4, r4, #6 946: 4320 orrs r0, r4 948: 6018 str r0, [r3, #0] 94a: 681c ldr r4, [r3, #0] 94c: 48ee ldr r0, [pc, #952] ; (d08 <main+0x3f4>) 94e: 2606 movs r6, #6 950: 4020 ands r0, r4 952: 2480 movs r4, #128 ; 0x80 954: 0224 lsls r4, r4, #8 956: 4320 orrs r0, r4 958: 6018 str r0, [r3, #0] 95a: 681c ldr r4, [r3, #0] 95c: 20c0 movs r0, #192 ; 0xc0 95e: 02c0 lsls r0, r0, #11 960: 4320 orrs r0, r4 962: 6018 str r0, [r3, #0] 964: 6818 ldr r0, [r3, #0] 966: 4be9 ldr r3, [pc, #932] ; (d0c <main+0x3f8>) 968: 2400 movs r4, #0 96a: 6018 str r0, [r3, #0] 96c: 4be8 ldr r3, [pc, #928] ; (d10 <main+0x3fc>) 96e: 2064 movs r0, #100 ; 0x64 970: 601c str r4, [r3, #0] 972: 4be8 ldr r3, [pc, #928] ; (d14 <main+0x400>) 974: 6011 str r1, [r2, #0] 976: 601c str r4, [r3, #0] 978: 4be7 ldr r3, [pc, #924] ; (d18 <main+0x404>) 97a: 601c str r4, [r3, #0] 97c: 4be7 ldr r3, [pc, #924] ; (d1c <main+0x408>) 97e: 601c str r4, [r3, #0] 980: f7ff fb89 bl 96 <delay> 984: 2004 movs r0, #4 986: f7ff fbfb bl 180 <mbus_enumerate> 98a: 2064 movs r0, #100 ; 0x64 98c: f7ff fb83 bl 96 <delay> 990: 2005 movs r0, #5 992: f7ff fbf5 bl 180 <mbus_enumerate> 996: 2064 movs r0, #100 ; 0x64 998: f7ff fb7d bl 96 <delay> 99c: 2003 movs r0, #3 99e: f7ff fbef bl 180 <mbus_enumerate> 9a2: 2064 movs r0, #100 ; 0x64 9a4: f7ff fb77 bl 96 <delay> 9a8: 2006 movs r0, #6 9aa: f7ff fbe9 bl 180 <mbus_enumerate> 9ae: 2064 movs r0, #100 ; 0x64 9b0: f7ff fb71 bl 96 <delay> 9b4: 2117 movs r1, #23 9b6: 4ada ldr r2, [pc, #872] ; (d20 <main+0x40c>) 9b8: 2006 movs r0, #6 9ba: f7ff fbf1 bl 1a0 <mbus_remote_register_write> 9be: 2064 movs r0, #100 ; 0x64 9c0: f7ff fb69 bl 96 <delay> 9c4: 2117 movs r1, #23 9c6: 4ad6 ldr r2, [pc, #856] ; (d20 <main+0x40c>) 9c8: 2006 movs r0, #6 9ca: f7ff fbe9 bl 1a0 <mbus_remote_register_write> 9ce: 2064 movs r0, #100 ; 0x64 9d0: f7ff fb61 bl 96 <delay> 9d4: 2118 movs r1, #24 9d6: 4ad3 ldr r2, [pc, #844] ; (d24 <main+0x410>) 9d8: 2006 movs r0, #6 9da: f7ff fbe1 bl 1a0 <mbus_remote_register_write> 9de: 2064 movs r0, #100 ; 0x64 9e0: f7ff fb59 bl 96 <delay> 9e4: 2119 movs r1, #25 9e6: 4ad0 ldr r2, [pc, #832] ; (d28 <main+0x414>) 9e8: 2006 movs r0, #6 9ea: f7ff fbd9 bl 1a0 <mbus_remote_register_write> 9ee: 2064 movs r0, #100 ; 0x64 9f0: f7ff fb51 bl 96 <delay> 9f4: 211a movs r1, #26 9f6: 4acd ldr r2, [pc, #820] ; (d2c <main+0x418>) 9f8: 2006 movs r0, #6 9fa: f7ff fbd1 bl 1a0 <mbus_remote_register_write> 9fe: 2064 movs r0, #100 ; 0x64 a00: f7ff fb49 bl 96 <delay> a04: 2115 movs r1, #21 a06: 4aca ldr r2, [pc, #808] ; (d30 <main+0x41c>) a08: 2006 movs r0, #6 a0a: f7ff fbc9 bl 1a0 <mbus_remote_register_write> a0e: 2064 movs r0, #100 ; 0x64 a10: f7ff fb41 bl 96 <delay> a14: 2116 movs r1, #22 a16: 4ac7 ldr r2, [pc, #796] ; (d34 <main+0x420>) a18: 2006 movs r0, #6 a1a: f7ff fbc1 bl 1a0 <mbus_remote_register_write> a1e: 2064 movs r0, #100 ; 0x64 a20: f7ff fb39 bl 96 <delay> a24: 2105 movs r1, #5 a26: 4ac4 ldr r2, [pc, #784] ; (d38 <main+0x424>) a28: 2006 movs r0, #6 a2a: f7ff fbb9 bl 1a0 <mbus_remote_register_write> a2e: 2064 movs r0, #100 ; 0x64 a30: f7ff fb31 bl 96 <delay> a34: 2105 movs r1, #5 a36: 4ac1 ldr r2, [pc, #772] ; (d3c <main+0x428>) a38: 2006 movs r0, #6 a3a: f7ff fbb1 bl 1a0 <mbus_remote_register_write> a3e: 2064 movs r0, #100 ; 0x64 a40: f7ff fb29 bl 96 <delay> a44: 2136 movs r1, #54 ; 0x36 a46: 4abe ldr r2, [pc, #760] ; (d40 <main+0x42c>) a48: 2006 movs r0, #6 a4a: f7ff fba9 bl 1a0 <mbus_remote_register_write> a4e: 2064 movs r0, #100 ; 0x64 a50: f7ff fb21 bl 96 <delay> a54: f7ff fc30 bl 2b8 <reset_pmu_solar_short> a58: 4bba ldr r3, [pc, #744] ; (d44 <main+0x430>) a5a: 2005 movs r0, #5 a5c: 681a ldr r2, [r3, #0] a5e: 2119 movs r1, #25 a60: 0e12 lsrs r2, r2, #24 a62: 0612 lsls r2, r2, #24 a64: 433a orrs r2, r7 a66: 601a str r2, [r3, #0] a68: 681a ldr r2, [r3, #0] a6a: f7ff fb99 bl 1a0 <mbus_remote_register_write> a6e: 4bb6 ldr r3, [pc, #728] ; (d48 <main+0x434>) a70: 2280 movs r2, #128 ; 0x80 a72: 6819 ldr r1, [r3, #0] a74: 0412 lsls r2, r2, #16 a76: 430a orrs r2, r1 a78: 601a str r2, [r3, #0] a7a: 6819 ldr r1, [r3, #0] a7c: 4ab3 ldr r2, [pc, #716] ; (d4c <main+0x438>) a7e: 2005 movs r0, #5 a80: 400a ands r2, r1 a82: 21c0 movs r1, #192 ; 0xc0 a84: 0309 lsls r1, r1, #12 a86: 430a orrs r2, r1 a88: 601a str r2, [r3, #0] a8a: 681a ldr r2, [r3, #0] a8c: 21f0 movs r1, #240 ; 0xf0 a8e: 438a bics r2, r1 a90: 601a str r2, [r3, #0] a92: 681a ldr r2, [r3, #0] a94: 210e movs r1, #14 a96: 43aa bics r2, r5 a98: 601a str r2, [r3, #0] a9a: 681a ldr r2, [r3, #0] a9c: f7ff fb80 bl 1a0 <mbus_remote_register_write> aa0: 4bab ldr r3, [pc, #684] ; (d50 <main+0x43c>) aa2: 2170 movs r1, #112 ; 0x70 aa4: 681a ldr r2, [r3, #0] aa6: 2005 movs r0, #5 aa8: 430a orrs r2, r1 aaa: 601a str r2, [r3, #0] aac: 6819 ldr r1, [r3, #0] aae: 4aa9 ldr r2, [pc, #676] ; (d54 <main+0x440>) ab0: 400a ands r2, r1 ab2: 601a str r2, [r3, #0] ab4: 681a ldr r2, [r3, #0] ab6: 1c29 adds r1, r5, #0 ab8: 43aa bics r2, r5 aba: 4332 orrs r2, r6 abc: 601a str r2, [r3, #0] abe: 681a ldr r2, [r3, #0] ac0: f7ff fb6e bl 1a0 <mbus_remote_register_write> ac4: 4ba4 ldr r3, [pc, #656] ; (d58 <main+0x444>) ac6: 2180 movs r1, #128 ; 0x80 ac8: 681a ldr r2, [r3, #0] aca: 0109 lsls r1, r1, #4 acc: 430a orrs r2, r1 ace: 601a str r2, [r3, #0] ad0: 681a ldr r2, [r3, #0] ad2: 2005 movs r0, #5 ad4: 4317 orrs r7, r2 ad6: 601f str r7, [r3, #0] ad8: 6819 ldr r1, [r3, #0] ada: 2280 movs r2, #128 ; 0x80 adc: 0392 lsls r2, r2, #14 ade: 430a orrs r2, r1 ae0: 601a str r2, [r3, #0] ae2: 6819 ldr r1, [r3, #0] ae4: 22c0 movs r2, #192 ; 0xc0 ae6: 01d2 lsls r2, r2, #7 ae8: 430a orrs r2, r1 aea: 601a str r2, [r3, #0] aec: 6819 ldr r1, [r3, #0] aee: 4a9b ldr r2, [pc, #620] ; (d5c <main+0x448>) af0: 2704 movs r7, #4 af2: 400a ands r2, r1 af4: 2180 movs r1, #128 ; 0x80 af6: 0349 lsls r1, r1, #13 af8: 430a orrs r2, r1 afa: 601a str r2, [r3, #0] afc: 681a ldr r2, [r3, #0] afe: 2112 movs r1, #18 b00: f7ff fb4e bl 1a0 <mbus_remote_register_write> b04: 2005 movs r0, #5 b06: 22c0 movs r2, #192 ; 0xc0 b08: 4082 lsls r2, r0 b0a: 2118 movs r1, #24 b0c: f7ff fb48 bl 1a0 <mbus_remote_register_write> b10: 4b93 ldr r3, [pc, #588] ; (d60 <main+0x44c>) b12: 4a94 ldr r2, [pc, #592] ; (d64 <main+0x450>) b14: 6819 ldr r1, [r3, #0] b16: 2004 movs r0, #4 b18: 400a ands r2, r1 b1a: 21bc movs r1, #188 ; 0xbc b1c: 0409 lsls r1, r1, #16 b1e: 430a orrs r2, r1 b20: 601a str r2, [r3, #0] b22: 6819 ldr r1, [r3, #0] b24: 4a90 ldr r2, [pc, #576] ; (d68 <main+0x454>) b26: 400a ands r2, r1 b28: 601a str r2, [r3, #0] b2a: 6819 ldr r1, [r3, #0] b2c: 4a8f ldr r2, [pc, #572] ; (d6c <main+0x458>) b2e: 400a ands r2, r1 b30: 2180 movs r1, #128 ; 0x80 b32: 0109 lsls r1, r1, #4 b34: 430a orrs r2, r1 b36: 601a str r2, [r3, #0] b38: 6819 ldr r1, [r3, #0] b3a: 4a8d ldr r2, [pc, #564] ; (d70 <main+0x45c>) b3c: 400a ands r2, r1 b3e: 21c0 movs r1, #192 ; 0xc0 b40: 0289 lsls r1, r1, #10 b42: 430a orrs r2, r1 b44: 601a str r2, [r3, #0] b46: 681a ldr r2, [r3, #0] b48: 1c21 adds r1, r4, #0 b4a: f7ff fb29 bl 1a0 <mbus_remote_register_write> b4e: 4b89 ldr r3, [pc, #548] ; (d74 <main+0x460>) b50: 211f movs r1, #31 b52: 681a ldr r2, [r3, #0] b54: 2004 movs r0, #4 b56: 438a bics r2, r1 b58: 2110 movs r1, #16 b5a: 430a orrs r2, r1 b5c: 601a str r2, [r3, #0] b5e: 6819 ldr r1, [r3, #0] b60: 4a85 ldr r2, [pc, #532] ; (d78 <main+0x464>) b62: 400a ands r2, r1 b64: 21b8 movs r1, #184 ; 0xb8 b66: 0089 lsls r1, r1, #2 b68: 430a orrs r2, r1 b6a: 601a str r2, [r3, #0] b6c: 6819 ldr r1, [r3, #0] b6e: 4a83 ldr r2, [pc, #524] ; (d7c <main+0x468>) b70: 400a ands r2, r1 b72: 21a0 movs r1, #160 ; 0xa0 b74: 0249 lsls r1, r1, #9 b76: 430a orrs r2, r1 b78: 601a str r2, [r3, #0] b7a: 681a ldr r2, [r3, #0] b7c: 210b movs r1, #11 b7e: f7ff fb0f bl 1a0 <mbus_remote_register_write> b82: 4b7f ldr r3, [pc, #508] ; (d80 <main+0x46c>) b84: 22c0 movs r2, #192 ; 0xc0 b86: 6819 ldr r1, [r3, #0] b88: 0352 lsls r2, r2, #13 b8a: 430a orrs r2, r1 b8c: 601a str r2, [r3, #0] b8e: 6819 ldr r1, [r3, #0] b90: 4a7c ldr r2, [pc, #496] ; (d84 <main+0x470>) b92: 2004 movs r0, #4 b94: 400a ands r2, r1 b96: 2180 movs r1, #128 ; 0x80 b98: 0109 lsls r1, r1, #4 b9a: 430a orrs r2, r1 b9c: 601a str r2, [r3, #0] b9e: 681a ldr r2, [r3, #0] ba0: 217f movs r1, #127 ; 0x7f ba2: 438a bics r2, r1 ba4: 2160 movs r1, #96 ; 0x60 ba6: 430a orrs r2, r1 ba8: 601a str r2, [r3, #0] baa: 681a ldr r2, [r3, #0] bac: 2101 movs r1, #1 bae: f7ff faf7 bl 1a0 <mbus_remote_register_write> bb2: 4b75 ldr r3, [pc, #468] ; (d88 <main+0x474>) bb4: 213f movs r1, #63 ; 0x3f bb6: 781a ldrb r2, [r3, #0] bb8: 1c38 adds r0, r7, #0 bba: 438a bics r2, r1 bbc: 433a orrs r2, r7 bbe: 701a strb r2, [r3, #0] bc0: 681a ldr r2, [r3, #0] bc2: 210c movs r1, #12 bc4: f7ff faec bl 1a0 <mbus_remote_register_write> bc8: 22c8 movs r2, #200 ; 0xc8 bca: 1c38 adds r0, r7, #0 bcc: 1c29 adds r1, r5, #0 bce: 0152 lsls r2, r2, #5 bd0: f7ff fae6 bl 1a0 <mbus_remote_register_write> bd4: 4b6d ldr r3, [pc, #436] ; (d8c <main+0x478>) bd6: 4a6e ldr r2, [pc, #440] ; (d90 <main+0x47c>) bd8: 2003 movs r0, #3 bda: 601a str r2, [r3, #0] bdc: 4b6d ldr r3, [pc, #436] ; (d94 <main+0x480>) bde: 1c21 adds r1, r4, #0 be0: 6018 str r0, [r3, #0] be2: 4b6d ldr r3, [pc, #436] ; (d98 <main+0x484>) be4: 601c str r4, [r3, #0] be6: 4b6d ldr r3, [pc, #436] ; (d9c <main+0x488>) be8: 601c str r4, [r3, #0] bea: 4b6d ldr r3, [pc, #436] ; (da0 <main+0x48c>) bec: 601c str r4, [r3, #0] bee: 4b6d ldr r3, [pc, #436] ; (da4 <main+0x490>) bf0: 601c str r4, [r3, #0] bf2: 4b6d ldr r3, [pc, #436] ; (da8 <main+0x494>) bf4: 601c str r4, [r3, #0] bf6: 4b6d ldr r3, [pc, #436] ; (dac <main+0x498>) bf8: 601c str r4, [r3, #0] bfa: 4b6d ldr r3, [pc, #436] ; (db0 <main+0x49c>) bfc: 601c str r4, [r3, #0] bfe: 4b6d ldr r3, [pc, #436] ; (db4 <main+0x4a0>) c00: 601c str r4, [r3, #0] c02: 4b6d ldr r3, [pc, #436] ; (db8 <main+0x4a4>) c04: 601c str r4, [r3, #0] c06: 4b6d ldr r3, [pc, #436] ; (dbc <main+0x4a8>) c08: 781a ldrb r2, [r3, #0] c0a: 43aa bics r2, r5 c0c: 4332 orrs r2, r6 c0e: 701a strb r2, [r3, #0] c10: 681a ldr r2, [r3, #0] c12: f7ff fac5 bl 1a0 <mbus_remote_register_write> c16: 2064 movs r0, #100 ; 0x64 c18: f7ff fa3d bl 96 <delay> c1c: 1c30 adds r0, r6, #0 c1e: 213a movs r1, #58 ; 0x3a c20: 4a67 ldr r2, [pc, #412] ; (dc0 <main+0x4ac>) c22: f7ff fabd bl 1a0 <mbus_remote_register_write> c26: 2064 movs r0, #100 ; 0x64 c28: f7ff fa35 bl 96 <delay> c2c: e20c b.n 1048 <main+0x734> c2e: 2378 movs r3, #120 ; 0x78 c30: 681b ldr r3, [r3, #0] c32: 4f60 ldr r7, [pc, #384] ; (db4 <main+0x4a0>) c34: 603b str r3, [r7, #0] c36: 683c ldr r4, [r7, #0] c38: 683e ldr r6, [r7, #0] c3a: 683a ldr r2, [r7, #0] c3c: 683d ldr r5, [r7, #0] c3e: 0e24 lsrs r4, r4, #24 c40: 0c2d lsrs r5, r5, #16 c42: b2eb uxtb r3, r5 c44: 9203 str r2, [sp, #12] c46: 9301 str r3, [sp, #4] c48: 2c00 cmp r4, #0 c4a: d100 bne.n c4e <main+0x33a> c4c: e347 b.n 12de <main+0x9ca> c4e: 4b32 ldr r3, [pc, #200] ; (d18 <main+0x404>) c50: 681b ldr r3, [r3, #0] c52: 9302 str r3, [sp, #8] c54: 2b00 cmp r3, #0 c56: d114 bne.n c82 <main+0x36e> c58: f7ff fa64 bl 124 <set_halt_until_mbus_tx> c5c: 4959 ldr r1, [pc, #356] ; (dc4 <main+0x4b0>) c5e: 20aa movs r0, #170 ; 0xaa c60: f7ff fa6e bl 140 <mbus_write_message32> c64: 6839 ldr r1, [r7, #0] c66: 20aa movs r0, #170 ; 0xaa c68: f7ff fa6a bl 140 <mbus_write_message32> c6c: 9902 ldr r1, [sp, #8] c6e: 4b4e ldr r3, [pc, #312] ; (da8 <main+0x494>) c70: 6019 str r1, [r3, #0] c72: 4b27 ldr r3, [pc, #156] ; (d10 <main+0x3fc>) c74: 6019 str r1, [r3, #0] c76: f7ff faa1 bl 1bc <radio_power_off> c7a: f7ff fad5 bl 228 <ldo_power_off> c7e: f7ff fae7 bl 250 <temp_power_off> c82: 9a03 ldr r2, [sp, #12] c84: 0a13 lsrs r3, r2, #8 c86: 2c01 cmp r4, #1 c88: d000 beq.n c8c <main+0x378> c8a: e0a1 b.n dd0 <main+0x4bc> c8c: 22ff movs r2, #255 ; 0xff c8e: 4f41 ldr r7, [pc, #260] ; (d94 <main+0x480>) c90: 4013 ands r3, r2 c92: 603b str r3, [r7, #0] c94: 4b20 ldr r3, [pc, #128] ; (d18 <main+0x404>) c96: 4015 ands r5, r2 c98: 4016 ands r6, r2 c9a: 022d lsls r5, r5, #8 c9c: 6819 ldr r1, [r3, #0] c9e: 1976 adds r6, r6, r5 ca0: 42b1 cmp r1, r6 ca2: d21e bcs.n ce2 <main+0x3ce> ca4: 681a ldr r2, [r3, #0] ca6: 3201 adds r2, #1 ca8: 601a str r2, [r3, #0] caa: 681a ldr r2, [r3, #0] cac: 2a01 cmp r2, #1 cae: d109 bne.n cc4 <main+0x3b0> cb0: f7ff fb20 bl 2f4 <radio_power_on> cb4: 2002 movs r0, #2 cb6: 1c21 adds r1, r4, #0 cb8: 1c22 adds r2, r4, #0 cba: f7ff fa01 bl c0 <set_wakeup_timer> cbe: f7ff fa69 bl 194 <mbus_sleep_all> cc2: e7fe b.n cc2 <main+0x3ae> cc4: 6819 ldr r1, [r3, #0] cc6: 4b40 ldr r3, [pc, #256] ; (dc8 <main+0x4b4>) cc8: 2000 movs r0, #0 cca: 18c9 adds r1, r1, r3 ccc: f7ff fb6e bl 3ac <send_radio_data_ppm> cd0: 6838 ldr r0, [r7, #0] cd2: 1c21 adds r1, r4, #0 cd4: b280 uxth r0, r0 cd6: 1c22 adds r2, r4, #0 cd8: f7ff f9f2 bl c0 <set_wakeup_timer> cdc: f7ff fa5a bl 194 <mbus_sleep_all> ce0: e7fe b.n ce0 <main+0x3cc> ce2: 2200 movs r2, #0 ce4: 601a str r2, [r3, #0] ce6: 1c20 adds r0, r4, #0 ce8: 4938 ldr r1, [pc, #224] ; (dcc <main+0x4b8>) cea: f7ff fb5f bl 3ac <send_radio_data_ppm> cee: f7ff fb47 bl 380 <operation_sleep_notimer> cf2: 46c0 nop ; (mov r8, r8) cf4: 000fffff .word 0x000fffff cf8: 0000137c .word 0x0000137c cfc: deadbeef .word 0xdeadbeef d00: 00001344 .word 0x00001344 d04: ffff9fff .word 0xffff9fff d08: fffe7fff .word 0xfffe7fff d0c: a000002c .word 0xa000002c d10: 0000139c .word 0x0000139c d14: 00001378 .word 0x00001378 d18: 000013b0 .word 0x000013b0 d1c: 000013a4 .word 0x000013a4 d20: 0000c204 .word 0x0000c204 d24: 0000c24a .word 0x0000c24a d28: 00000221 .word 0x00000221 d2c: 00001088 .word 0x00001088 d30: 0000c226 .word 0x0000c226 d34: 0000d10f .word 0x0000d10f d38: 0000082c .word 0x0000082c d3c: 00000aac .word 0x00000aac d40: 00000111 .word 0x00000111 d44: 0000135c .word 0x0000135c d48: 0000134c .word 0x0000134c d4c: fff1ffff .word 0xfff1ffff d50: 0000133c .word 0x0000133c d54: ff7fffff .word 0xff7fffff d58: 00001358 .word 0x00001358 d5c: ffe07fff .word 0xffe07fff d60: 00001340 .word 0x00001340 d64: ff03ffff .word 0xff03ffff d68: fffffe1f .word 0xfffffe1f d6c: ffffe1ff .word 0xffffe1ff d70: fffc7fff .word 0xfffc7fff d74: 00001328 .word 0x00001328 d78: ffffe01f .word 0xffffe01f d7c: fff01fff .word 0xfff01fff d80: 00001334 .word 0x00001334 d84: ffff03ff .word 0xffff03ff d88: 00001348 .word 0x00001348 d8c: 000013bc .word 0x000013bc d90: 000083d6 .word 0x000083d6 d94: 000013a0 .word 0x000013a0 d98: 00001380 .word 0x00001380 d9c: 00001374 .word 0x00001374 da0: 00001394 .word 0x00001394 da4: 0000138c .word 0x0000138c da8: 000013b4 .word 0x000013b4 dac: 00001370 .word 0x00001370 db0: 000013c0 .word 0x000013c0 db4: 00001384 .word 0x00001384 db8: 00001390 .word 0x00001390 dbc: 00001354 .word 0x00001354 dc0: 00080800 .word 0x00080800 dc4: abcd1234 .word 0xabcd1234 dc8: 00abc000 .word 0x00abc000 dcc: 00faf000 .word 0x00faf000 dd0: 2c02 cmp r4, #2 dd2: d129 bne.n e28 <main+0x514> dd4: 22ff movs r2, #255 ; 0xff dd6: 4013 ands r3, r2 dd8: 4016 ands r6, r2 dda: 021b lsls r3, r3, #8 ddc: 18f6 adds r6, r6, r3 dde: 49da ldr r1, [pc, #872] ; (1148 <main+0x834>) de0: 230f movs r3, #15 de2: 4ada ldr r2, [pc, #872] ; (114c <main+0x838>) de4: 402b ands r3, r5 de6: 600e str r6, [r1, #0] de8: 6013 str r3, [r2, #0] dea: 2310 movs r3, #16 dec: 401d ands r5, r3 dee: 4bd8 ldr r3, [pc, #864] ; (1150 <main+0x83c>) df0: 49d8 ldr r1, [pc, #864] ; (1154 <main+0x840>) df2: 601d str r5, [r3, #0] df4: 4cd8 ldr r4, [pc, #864] ; (1158 <main+0x844>) df6: 2300 movs r3, #0 df8: 600b str r3, [r1, #0] dfa: 6821 ldr r1, [r4, #0] dfc: 4299 cmp r1, r3 dfe: d000 beq.n e02 <main+0x4ee> e00: e1d8 b.n 11b4 <main+0x8a0> e02: 6810 ldr r0, [r2, #0] e04: 2101 movs r1, #1 e06: 1c0a adds r2, r1, #0 e08: b280 uxth r0, r0 e0a: f7ff f959 bl c0 <set_wakeup_timer> e0e: 2301 movs r3, #1 e10: 9901 ldr r1, [sp, #4] e12: 6023 str r3, [r4, #0] e14: 4bd1 ldr r3, [pc, #836] ; (115c <main+0x848>) e16: 094a lsrs r2, r1, #5 e18: 601a str r2, [r3, #0] e1a: 4bd1 ldr r3, [pc, #836] ; (1160 <main+0x84c>) e1c: 681a ldr r2, [r3, #0] e1e: 3201 adds r2, #1 e20: 601a str r2, [r3, #0] e22: f7ff f9b7 bl 194 <mbus_sleep_all> e26: e7fe b.n e26 <main+0x512> e28: 2c03 cmp r4, #3 e2a: d14a bne.n ec2 <main+0x5ae> e2c: 27ff movs r7, #255 ; 0xff e2e: 4ac7 ldr r2, [pc, #796] ; (114c <main+0x838>) e30: 403b ands r3, r7 e32: 6013 str r3, [r2, #0] e34: 4bca ldr r3, [pc, #808] ; (1160 <main+0x84c>) e36: 403e ands r6, r7 e38: 681a ldr r2, [r3, #0] e3a: 42b2 cmp r2, r6 e3c: d300 bcc.n e40 <main+0x52c> e3e: e24a b.n 12d6 <main+0x9c2> e40: 681a ldr r2, [r3, #0] e42: 3201 adds r2, #1 e44: 601a str r2, [r3, #0] e46: 681d ldr r5, [r3, #0] e48: 2d01 cmp r5, #1 e4a: d11f bne.n e8c <main+0x578> e4c: 2100 movs r1, #0 e4e: 1c22 adds r2, r4, #0 e50: 2006 movs r0, #6 e52: f7ff f9a5 bl 1a0 <mbus_remote_register_write> e56: 2064 movs r0, #100 ; 0x64 e58: f7ff f91d bl 96 <delay> e5c: 2064 movs r0, #100 ; 0x64 e5e: f7ff f91a bl 96 <delay> e62: 23a0 movs r3, #160 ; 0xa0 e64: 061b lsls r3, r3, #24 e66: 681b ldr r3, [r3, #0] e68: 401f ands r7, r3 e6a: 4bbe ldr r3, [pc, #760] ; (1164 <main+0x850>) e6c: 601f str r7, [r3, #0] e6e: f7ff fa0b bl 288 <batadc_reset> e72: 2064 movs r0, #100 ; 0x64 e74: f7ff f90f bl 96 <delay> e78: f7ff fa3c bl 2f4 <radio_power_on> e7c: 2002 movs r0, #2 e7e: 1c29 adds r1, r5, #0 e80: 1c2a adds r2, r5, #0 e82: f7ff f91d bl c0 <set_wakeup_timer> e86: f7ff f985 bl 194 <mbus_sleep_all> e8a: e7fe b.n e8a <main+0x576> e8c: 6818 ldr r0, [r3, #0] e8e: 2301 movs r3, #1 e90: 4018 ands r0, r3 e92: d005 beq.n ea0 <main+0x58c> e94: 4bb3 ldr r3, [pc, #716] ; (1164 <main+0x850>) e96: 4ab4 ldr r2, [pc, #720] ; (1168 <main+0x854>) e98: 6819 ldr r1, [r3, #0] e9a: 2000 movs r0, #0 e9c: 1889 adds r1, r1, r2 e9e: e004 b.n eaa <main+0x596> ea0: 4bb2 ldr r3, [pc, #712] ; (116c <main+0x858>) ea2: 6819 ldr r1, [r3, #0] ea4: 23c0 movs r3, #192 ; 0xc0 ea6: 041b lsls r3, r3, #16 ea8: 18c9 adds r1, r1, r3 eaa: f7ff fa7f bl 3ac <send_radio_data_ppm> eae: 4ba7 ldr r3, [pc, #668] ; (114c <main+0x838>) eb0: 2101 movs r1, #1 eb2: 6818 ldr r0, [r3, #0] eb4: 1c0a adds r2, r1, #0 eb6: b280 uxth r0, r0 eb8: f7ff f902 bl c0 <set_wakeup_timer> ebc: f7ff f96a bl 194 <mbus_sleep_all> ec0: e7fe b.n ec0 <main+0x5ac> ec2: 2c04 cmp r4, #4 ec4: d177 bne.n fb6 <main+0x6a2> ec6: 22ff movs r2, #255 ; 0xff ec8: 49a0 ldr r1, [pc, #640] ; (114c <main+0x838>) eca: 4013 ands r3, r2 ecc: 600b str r3, [r1, #0] ece: 4ba8 ldr r3, [pc, #672] ; (1170 <main+0x85c>) ed0: 4016 ands r6, r2 ed2: 4aa8 ldr r2, [pc, #672] ; (1174 <main+0x860>) ed4: 601e str r6, [r3, #0] ed6: 6819 ldr r1, [r3, #0] ed8: 6812 ldr r2, [r2, #0] eda: 4291 cmp r1, r2 edc: d301 bcc.n ee2 <main+0x5ce> ede: 2200 movs r2, #0 ee0: 601a str r2, [r3, #0] ee2: 4c9f ldr r4, [pc, #636] ; (1160 <main+0x84c>) ee4: 6823 ldr r3, [r4, #0] ee6: 2b02 cmp r3, #2 ee8: d840 bhi.n f6c <main+0x658> eea: 6823 ldr r3, [r4, #0] eec: 3301 adds r3, #1 eee: 6023 str r3, [r4, #0] ef0: 6825 ldr r5, [r4, #0] ef2: 2d01 cmp r5, #1 ef4: d109 bne.n f0a <main+0x5f6> ef6: f7ff f9fd bl 2f4 <radio_power_on> efa: 2002 movs r0, #2 efc: 1c29 adds r1, r5, #0 efe: 1c2a adds r2, r5, #0 f00: f7ff f8de bl c0 <set_wakeup_timer> f04: f7ff f946 bl 194 <mbus_sleep_all> f08: e7fe b.n f08 <main+0x5f4> f0a: 4a9b ldr r2, [pc, #620] ; (1178 <main+0x864>) f0c: 6821 ldr r1, [r4, #0] f0e: 2000 movs r0, #0 f10: 1889 adds r1, r1, r2 f12: f7ff fa4b bl 3ac <send_radio_data_ppm> f16: 4b8d ldr r3, [pc, #564] ; (114c <main+0x838>) f18: 6822 ldr r2, [r4, #0] f1a: 6818 ldr r0, [r3, #0] f1c: 2101 movs r1, #1 f1e: b280 uxth r0, r0 f20: 1c0a adds r2, r1, #0 f22: f7ff f8cd bl c0 <set_wakeup_timer> f26: f7ff f935 bl 194 <mbus_sleep_all> f2a: e7fe b.n f2a <main+0x616> f2c: 6821 ldr r1, [r4, #0] f2e: 20dd movs r0, #221 ; 0xdd f30: f7ff f906 bl 140 <mbus_write_message32> f34: 2064 movs r0, #100 ; 0x64 f36: f7ff f8ae bl 96 <delay> f3a: 6823 ldr r3, [r4, #0] f3c: 4d8f ldr r5, [pc, #572] ; (117c <main+0x868>) f3e: 009b lsls r3, r3, #2 f40: 5959 ldr r1, [r3, r5] f42: 20dd movs r0, #221 ; 0xdd f44: f7ff f8fc bl 140 <mbus_write_message32> f48: 2064 movs r0, #100 ; 0x64 f4a: f7ff f8a4 bl 96 <delay> f4e: 488c ldr r0, [pc, #560] ; (1180 <main+0x86c>) f50: f7ff f8aa bl a8 <config_timerwd> f54: 6823 ldr r3, [r4, #0] f56: 2000 movs r0, #0 f58: 009b lsls r3, r3, #2 f5a: 5959 ldr r1, [r3, r5] f5c: f7ff fa26 bl 3ac <send_radio_data_ppm> f60: 4888 ldr r0, [pc, #544] ; (1184 <main+0x870>) f62: f7ff f898 bl 96 <delay> f66: 6823 ldr r3, [r4, #0] f68: 3b01 subs r3, #1 f6a: 6023 str r3, [r4, #0] f6c: 4b80 ldr r3, [pc, #512] ; (1170 <main+0x85c>) f6e: 2500 movs r5, #0 f70: 681a ldr r2, [r3, #0] f72: 4985 ldr r1, [pc, #532] ; (1188 <main+0x874>) f74: 42aa cmp r2, r5 f76: d102 bne.n f7e <main+0x66a> f78: 680d ldr r5, [r1, #0] f7a: 1e6a subs r2, r5, #1 f7c: 4195 sbcs r5, r2 f7e: 6818 ldr r0, [r3, #0] f80: 2200 movs r2, #0 f82: 4290 cmp r0, r2 f84: d007 beq.n f96 <main+0x682> f86: 681a ldr r2, [r3, #0] f88: 4b7a ldr r3, [pc, #488] ; (1174 <main+0x860>) f8a: 6809 ldr r1, [r1, #0] f8c: 681b ldr r3, [r3, #0] f8e: 188a adds r2, r1, r2 f90: 4293 cmp r3, r2 f92: 4192 sbcs r2, r2 f94: 4252 negs r2, r2 f96: 4315 orrs r5, r2 f98: 4c7b ldr r4, [pc, #492] ; (1188 <main+0x874>) f9a: d1c7 bne.n f2c <main+0x618> f9c: 487b ldr r0, [pc, #492] ; (118c <main+0x878>) f9e: f7ff f87a bl 96 <delay> fa2: 2001 movs r0, #1 fa4: 497a ldr r1, [pc, #488] ; (1190 <main+0x87c>) fa6: f7ff fa01 bl 3ac <send_radio_data_ppm> faa: 4b6d ldr r3, [pc, #436] ; (1160 <main+0x84c>) fac: 601d str r5, [r3, #0] fae: 4b71 ldr r3, [pc, #452] ; (1174 <main+0x860>) fb0: 681b ldr r3, [r3, #0] fb2: 6023 str r3, [r4, #0] fb4: e69b b.n cee <main+0x3da> fb6: 2c07 cmp r4, #7 fb8: d149 bne.n 104e <main+0x73a> fba: 24ff movs r4, #255 ; 0xff fbc: 4f63 ldr r7, [pc, #396] ; (114c <main+0x838>) fbe: 4023 ands r3, r4 fc0: 603b str r3, [r7, #0] fc2: 4b6a ldr r3, [pc, #424] ; (116c <main+0x858>) fc4: 2500 movs r5, #0 fc6: 601d str r5, [r3, #0] fc8: 4b65 ldr r3, [pc, #404] ; (1160 <main+0x84c>) fca: 4026 ands r6, r4 fcc: 681a ldr r2, [r3, #0] fce: 42b2 cmp r2, r6 fd0: d235 bcs.n 103e <main+0x72a> fd2: 681a ldr r2, [r3, #0] fd4: 3201 adds r2, #1 fd6: 601a str r2, [r3, #0] fd8: 681e ldr r6, [r3, #0] fda: 2e01 cmp r6, #1 fdc: d11f bne.n 101e <main+0x70a> fde: 1c29 adds r1, r5, #0 fe0: 2203 movs r2, #3 fe2: 2006 movs r0, #6 fe4: f7ff f8dc bl 1a0 <mbus_remote_register_write> fe8: 2064 movs r0, #100 ; 0x64 fea: f7ff f854 bl 96 <delay> fee: 2064 movs r0, #100 ; 0x64 ff0: f7ff f851 bl 96 <delay> ff4: 23a0 movs r3, #160 ; 0xa0 ff6: 061b lsls r3, r3, #24 ff8: 681b ldr r3, [r3, #0] ffa: 401c ands r4, r3 ffc: 4b59 ldr r3, [pc, #356] ; (1164 <main+0x850>) ffe: 601c str r4, [r3, #0] 1000: f7ff f942 bl 288 <batadc_reset> 1004: 2064 movs r0, #100 ; 0x64 1006: f7ff f846 bl 96 <delay> 100a: f7ff f973 bl 2f4 <radio_power_on> 100e: 2002 movs r0, #2 1010: 1c31 adds r1, r6, #0 1012: 1c32 adds r2, r6, #0 1014: f7ff f854 bl c0 <set_wakeup_timer> 1018: f7ff f8bc bl 194 <mbus_sleep_all> 101c: e7fe b.n 101c <main+0x708> 101e: 4b51 ldr r3, [pc, #324] ; (1164 <main+0x850>) 1020: 1c28 adds r0, r5, #0 1022: 6819 ldr r1, [r3, #0] 1024: 4b50 ldr r3, [pc, #320] ; (1168 <main+0x854>) 1026: 18c9 adds r1, r1, r3 1028: f7ff f9c0 bl 3ac <send_radio_data_ppm> 102c: 6838 ldr r0, [r7, #0] 102e: 2101 movs r1, #1 1030: b280 uxth r0, r0 1032: 1c0a adds r2, r1, #0 1034: f7ff f844 bl c0 <set_wakeup_timer> 1038: f7ff f8ac bl 194 <mbus_sleep_all> 103c: e7fe b.n 103c <main+0x728> 103e: 2001 movs r0, #1 1040: 4953 ldr r1, [pc, #332] ; (1190 <main+0x87c>) 1042: 601d str r5, [r3, #0] 1044: f7ff f9b2 bl 3ac <send_radio_data_ppm> 1048: f7ff f92a bl 2a0 <batadc_resetrelease> 104c: e64f b.n cee <main+0x3da> 104e: 2c08 cmp r4, #8 1050: d132 bne.n 10b8 <main+0x7a4> 1052: 4a46 ldr r2, [pc, #280] ; (116c <main+0x858>) 1054: 2400 movs r4, #0 1056: 6014 str r4, [r2, #0] 1058: 4a41 ldr r2, [pc, #260] ; (1160 <main+0x84c>) 105a: 6811 ldr r1, [r2, #0] 105c: 3101 adds r1, #1 105e: 6011 str r1, [r2, #0] 1060: 6817 ldr r7, [r2, #0] 1062: 2f01 cmp r7, #1 1064: d005 beq.n 1072 <main+0x75e> 1066: 22ff movs r2, #255 ; 0xff 1068: 4013 ands r3, r2 106a: 4016 ands r6, r2 106c: 021b lsls r3, r3, #8 106e: 18f6 adds r6, r6, r3 1070: e019 b.n 10a6 <main+0x792> 1072: f7ff f93f bl 2f4 <radio_power_on> 1076: 2002 movs r0, #2 1078: 1c39 adds r1, r7, #0 107a: 1c3a adds r2, r7, #0 107c: f7ff f820 bl c0 <set_wakeup_timer> 1080: f7ff f888 bl 194 <mbus_sleep_all> 1084: e7fe b.n 1084 <main+0x770> 1086: 22bb movs r2, #187 ; 0xbb 1088: 0412 lsls r2, r2, #16 108a: 18a1 adds r1, r4, r2 108c: 2000 movs r0, #0 108e: f7ff f98d bl 3ac <send_radio_data_ppm> 1092: 483e ldr r0, [pc, #248] ; (118c <main+0x878>) 1094: f7fe ffff bl 96 <delay> 1098: 4839 ldr r0, [pc, #228] ; (1180 <main+0x86c>) 109a: f7ff f805 bl a8 <config_timerwd> 109e: 483b ldr r0, [pc, #236] ; (118c <main+0x878>) 10a0: 3401 adds r4, #1 10a2: f7fe fff8 bl 96 <delay> 10a6: 42b4 cmp r4, r6 10a8: d1ed bne.n 1086 <main+0x772> 10aa: 07eb lsls r3, r5, #31 10ac: d501 bpl.n 10b2 <main+0x79e> 10ae: f7ff f903 bl 2b8 <reset_pmu_solar_short> 10b2: 2200 movs r2, #0 10b4: 4b2a ldr r3, [pc, #168] ; (1160 <main+0x84c>) 10b6: e10f b.n 12d8 <main+0x9c4> 10b8: 2c13 cmp r4, #19 10ba: d171 bne.n 11a0 <main+0x88c> 10bc: 27ff movs r7, #255 ; 0xff 10be: 4c23 ldr r4, [pc, #140] ; (114c <main+0x838>) 10c0: 403b ands r3, r7 10c2: 2064 movs r0, #100 ; 0x64 10c4: 6023 str r3, [r4, #0] 10c6: f7fe ffe6 bl 96 <delay> 10ca: 4b32 ldr r3, [pc, #200] ; (1194 <main+0x880>) 10cc: 9a01 ldr r2, [sp, #4] 10ce: 6818 ldr r0, [r3, #0] 10d0: 0911 lsrs r1, r2, #4 10d2: 4a31 ldr r2, [pc, #196] ; (1198 <main+0x884>) 10d4: 0149 lsls r1, r1, #5 10d6: 4002 ands r2, r0 10d8: 430a orrs r2, r1 10da: 601a str r2, [r3, #0] 10dc: 220f movs r2, #15 10de: 4015 ands r5, r2 10e0: 026a lsls r2, r5, #9 10e2: 492e ldr r1, [pc, #184] ; (119c <main+0x888>) 10e4: 681d ldr r5, [r3, #0] 10e6: 2004 movs r0, #4 10e8: 400d ands r5, r1 10ea: 4315 orrs r5, r2 10ec: 601d str r5, [r3, #0] 10ee: 681a ldr r2, [r3, #0] 10f0: 2100 movs r1, #0 10f2: f7ff f855 bl 1a0 <mbus_remote_register_write> 10f6: 2064 movs r0, #100 ; 0x64 10f8: f7fe ffcd bl 96 <delay> 10fc: 4b18 ldr r3, [pc, #96] ; (1160 <main+0x84c>) 10fe: 403e ands r6, r7 1100: 681a ldr r2, [r3, #0] 1102: 42b2 cmp r2, r6 1104: d300 bcc.n 1108 <main+0x7f4> 1106: e0e6 b.n 12d6 <main+0x9c2> 1108: 681a ldr r2, [r3, #0] 110a: 3201 adds r2, #1 110c: 601a str r2, [r3, #0] 110e: 681d ldr r5, [r3, #0] 1110: 2d01 cmp r5, #1 1112: d109 bne.n 1128 <main+0x814> 1114: f7ff f8ee bl 2f4 <radio_power_on> 1118: 2002 movs r0, #2 111a: 1c29 adds r1, r5, #0 111c: 1c2a adds r2, r5, #0 111e: f7fe ffcf bl c0 <set_wakeup_timer> 1122: f7ff f837 bl 194 <mbus_sleep_all> 1126: e7fe b.n 1126 <main+0x812> 1128: 6819 ldr r1, [r3, #0] 112a: 4b0f ldr r3, [pc, #60] ; (1168 <main+0x854>) 112c: 2000 movs r0, #0 112e: 18c9 adds r1, r1, r3 1130: f7ff f93c bl 3ac <send_radio_data_ppm> 1134: 6820 ldr r0, [r4, #0] 1136: 2101 movs r1, #1 1138: b280 uxth r0, r0 113a: 1c0a adds r2, r1, #0 113c: f7fe ffc0 bl c0 <set_wakeup_timer> 1140: f7ff f828 bl 194 <mbus_sleep_all> 1144: e7fe b.n 1144 <main+0x830> 1146: 46c0 nop ; (mov r8, r8) 1148: 000013bc .word 0x000013bc 114c: 000013a0 .word 0x000013a0 1150: 00001394 .word 0x00001394 1154: 0000138c .word 0x0000138c 1158: 000013b4 .word 0x000013b4 115c: 00001390 .word 0x00001390 1160: 000013b0 .word 0x000013b0 1164: 00001398 .word 0x00001398 1168: 00bbb000 .word 0x00bbb000 116c: 00001378 .word 0x00001378 1170: 000013a8 .word 0x000013a8 1174: 00001380 .word 0x00001380 1178: 00abc000 .word 0x00abc000 117c: 000013c4 .word 0x000013c4 1180: 000fffff .word 0x000fffff 1184: 00001388 .word 0x00001388 1188: 00001374 .word 0x00001374 118c: 00002710 .word 0x00002710 1190: 00faf000 .word 0x00faf000 1194: 00001340 .word 0x00001340 1198: fffffe1f .word 0xfffffe1f 119c: ffffe1ff .word 0xffffe1ff 11a0: 2c14 cmp r4, #20 11a2: d116 bne.n 11d2 <main+0x8be> 11a4: 4a4f ldr r2, [pc, #316] ; (12e4 <main+0x9d0>) 11a6: 2301 movs r3, #1 11a8: 6013 str r3, [r2, #0] 11aa: 4a4f ldr r2, [pc, #316] ; (12e8 <main+0x9d4>) 11ac: 6013 str r3, [r2, #0] 11ae: 4a4f ldr r2, [pc, #316] ; (12ec <main+0x9d8>) 11b0: 6013 str r3, [r2, #0] 11b2: 2300 movs r3, #0 11b4: 4a4e ldr r2, [pc, #312] ; (12f0 <main+0x9dc>) 11b6: 6013 str r3, [r2, #0] 11b8: 4a4e ldr r2, [pc, #312] ; (12f4 <main+0x9e0>) 11ba: 6013 str r3, [r2, #0] 11bc: 4a4e ldr r2, [pc, #312] ; (12f8 <main+0x9e4>) 11be: 6013 str r3, [r2, #0] 11c0: 4a4e ldr r2, [pc, #312] ; (12fc <main+0x9e8>) 11c2: 6013 str r3, [r2, #0] 11c4: 2278 movs r2, #120 ; 0x78 11c6: 6013 str r3, [r2, #0] 11c8: 4a4d ldr r2, [pc, #308] ; (1300 <main+0x9ec>) 11ca: 6013 str r3, [r2, #0] 11cc: 4a4d ldr r2, [pc, #308] ; (1304 <main+0x9f0>) 11ce: 6013 str r3, [r2, #0] 11d0: e085 b.n 12de <main+0x9ca> 11d2: 2c15 cmp r4, #21 11d4: d12b bne.n 122e <main+0x91a> 11d6: 4b4c ldr r3, [pc, #304] ; (1308 <main+0x9f4>) 11d8: 681a ldr r2, [r3, #0] 11da: 0212 lsls r2, r2, #8 11dc: d004 beq.n 11e8 <main+0x8d4> 11de: 681a ldr r2, [r3, #0] 11e0: 4b4a ldr r3, [pc, #296] ; (130c <main+0x9f8>) 11e2: 0212 lsls r2, r2, #8 11e4: 0a12 lsrs r2, r2, #8 11e6: 601a str r2, [r3, #0] 11e8: 4b45 ldr r3, [pc, #276] ; (1300 <main+0x9ec>) 11ea: 681a ldr r2, [r3, #0] 11ec: 2a04 cmp r2, #4 11ee: d872 bhi.n 12d6 <main+0x9c2> 11f0: 681a ldr r2, [r3, #0] 11f2: 3201 adds r2, #1 11f4: 601a str r2, [r3, #0] 11f6: 681c ldr r4, [r3, #0] 11f8: 2c01 cmp r4, #1 11fa: d109 bne.n 1210 <main+0x8fc> 11fc: f7ff f87a bl 2f4 <radio_power_on> 1200: 2002 movs r0, #2 1202: 1c21 adds r1, r4, #0 1204: 1c22 adds r2, r4, #0 1206: f7fe ff5b bl c0 <set_wakeup_timer> 120a: f7fe ffc3 bl 194 <mbus_sleep_all> 120e: e7fe b.n 120e <main+0x8fa> 1210: 4b3e ldr r3, [pc, #248] ; (130c <main+0x9f8>) 1212: 2000 movs r0, #0 1214: 6819 ldr r1, [r3, #0] 1216: f7ff f8c9 bl 3ac <send_radio_data_ppm> 121a: 4b3d ldr r3, [pc, #244] ; (1310 <main+0x9fc>) 121c: 2101 movs r1, #1 121e: 6818 ldr r0, [r3, #0] 1220: 1c0a adds r2, r1, #0 1222: b280 uxth r0, r0 1224: f7fe ff4c bl c0 <set_wakeup_timer> 1228: f7fe ffb4 bl 194 <mbus_sleep_all> 122c: e7fe b.n 122c <main+0x918> 122e: 2c20 cmp r4, #32 1230: d10c bne.n 124c <main+0x938> 1232: 4b35 ldr r3, [pc, #212] ; (1308 <main+0x9f4>) 1234: 681a ldr r2, [r3, #0] 1236: 0212 lsls r2, r2, #8 1238: d004 beq.n 1244 <main+0x930> 123a: 681a ldr r2, [r3, #0] 123c: 4b35 ldr r3, [pc, #212] ; (1314 <main+0xa00>) 123e: 0212 lsls r2, r2, #8 1240: 0a12 lsrs r2, r2, #8 1242: 601a str r2, [r3, #0] 1244: 4b2e ldr r3, [pc, #184] ; (1300 <main+0x9ec>) 1246: 2200 movs r2, #0 1248: 601a str r2, [r3, #0] 124a: e550 b.n cee <main+0x3da> 124c: 2c16 cmp r4, #22 124e: d146 bne.n 12de <main+0x9ca> 1250: 9901 ldr r1, [sp, #4] 1252: 29ff cmp r1, #255 ; 0xff 1254: d007 beq.n 1266 <main+0x952> 1256: 2303 movs r3, #3 1258: 401d ands r5, r3 125a: 4b2b ldr r3, [pc, #172] ; (1308 <main+0x9f4>) 125c: 00ad lsls r5, r5, #2 125e: 681a ldr r2, [r3, #0] 1260: 4b2d ldr r3, [pc, #180] ; (1318 <main+0xa04>) 1262: b292 uxth r2, r2 1264: 50ea str r2, [r5, r3] 1266: 4b26 ldr r3, [pc, #152] ; (1300 <main+0x9ec>) 1268: 681a ldr r2, [r3, #0] 126a: 2a04 cmp r2, #4 126c: d833 bhi.n 12d6 <main+0x9c2> 126e: 681a ldr r2, [r3, #0] 1270: 3201 adds r2, #1 1272: 601a str r2, [r3, #0] 1274: 681c ldr r4, [r3, #0] 1276: 2c01 cmp r4, #1 1278: d109 bne.n 128e <main+0x97a> 127a: f7ff f83b bl 2f4 <radio_power_on> 127e: 2002 movs r0, #2 1280: 1c21 adds r1, r4, #0 1282: 1c22 adds r2, r4, #0 1284: f7fe ff1c bl c0 <set_wakeup_timer> 1288: f7fe ff84 bl 194 <mbus_sleep_all> 128c: e7fe b.n 128c <main+0x978> 128e: 4c22 ldr r4, [pc, #136] ; (1318 <main+0xa04>) 1290: 2000 movs r0, #0 1292: 6821 ldr r1, [r4, #0] 1294: f7ff f88a bl 3ac <send_radio_data_ppm> 1298: 4820 ldr r0, [pc, #128] ; (131c <main+0xa08>) 129a: f7fe fefc bl 96 <delay> 129e: 6861 ldr r1, [r4, #4] 12a0: 2000 movs r0, #0 12a2: f7ff f883 bl 3ac <send_radio_data_ppm> 12a6: 481d ldr r0, [pc, #116] ; (131c <main+0xa08>) 12a8: f7fe fef5 bl 96 <delay> 12ac: 68a1 ldr r1, [r4, #8] 12ae: 2000 movs r0, #0 12b0: f7ff f87c bl 3ac <send_radio_data_ppm> 12b4: 4819 ldr r0, [pc, #100] ; (131c <main+0xa08>) 12b6: f7fe feee bl 96 <delay> 12ba: 68e1 ldr r1, [r4, #12] 12bc: 2000 movs r0, #0 12be: f7ff f875 bl 3ac <send_radio_data_ppm> 12c2: 4b13 ldr r3, [pc, #76] ; (1310 <main+0x9fc>) 12c4: 2101 movs r1, #1 12c6: 6818 ldr r0, [r3, #0] 12c8: 1c0a adds r2, r1, #0 12ca: b280 uxth r0, r0 12cc: f7fe fef8 bl c0 <set_wakeup_timer> 12d0: f7fe ff60 bl 194 <mbus_sleep_all> 12d4: e7fe b.n 12d4 <main+0x9c0> 12d6: 2200 movs r2, #0 12d8: 601a str r2, [r3, #0] 12da: 2001 movs r0, #1 12dc: e504 b.n ce8 <main+0x3d4> 12de: f7ff f8c7 bl 470 <operation_temp_run> 12e2: e7fc b.n 12de <main+0x9ca> 12e4: 00001394 .word 0x00001394 12e8: 0000138c .word 0x0000138c 12ec: 000013b4 .word 0x000013b4 12f0: 00001378 .word 0x00001378 12f4: 000013ac .word 0x000013ac 12f8: 00001380 .word 0x00001380 12fc: 00001374 .word 0x00001374 1300: 000013b0 .word 0x000013b0 1304: 00001388 .word 0x00001388 1308: 00001384 .word 0x00001384 130c: 00001350 .word 0x00001350 1310: 000013a0 .word 0x000013a0 1314: 00001320 .word 0x00001320 1318: 00001360 .word 0x00001360 131c: 00001388 .word 0x00001388
test/Fail/TerminationNoCoinductiveProjectionFromVariable.agda
alhassy/agda
3
17310
{-# OPTIONS --copatterns #-} mutual data D : Set where c : R → D record R : Set where coinductive field out : D open R mutual d : D d = c r r : R out r = d f : D → {A : Set} → A f (c x) = f (out x) -- should not termination check absurd : {A : Set} → A absurd = f d
src/main/antlr4/org/ASUX/language/antlr4/YAMLANTLR4Parser.g4
org-asux/org.ASUX.language.ANTLR4
0
6355
<reponame>org-asux/org.ASUX.language.ANTLR4<gh_stars>0 parser grammar YAMLANTLR4Parser ; // ================================== options { tokenVocab= YAMLANTLR4Lexer; } // Imported Grammar Files // See how @ https://www.antlr.org/api/maven-plugin/latest/examples/import.html // place your import grammars in the directory: src/main/antlr4/imports // ================================== /* WARNING: Use the following @header.. ONLY if this .g4 file is at the TOP of the <sourceDirectory> as defined within POM.XML re: antlr4 plugin // @header { // package org.ASUX.language; // } In case of this .g4 file, this .g4 file is under src/main/java/org/asux/language So, antlr4 automatically detects/deduces the java-package name from the folder path. So.. what would happen if the above @header was UN-commented? Well .. you will end up having 2 'package declarations' in the generated java files. JAVAC will barf. */ // ================================== /* BSD 3-Clause License Copyright (c) 2019, <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: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. */ /* ================================== PARSER RULES (all LOWERcase) ================================== */ yaml_commands : yaml_command ( SEMICOLON NEWLINE* yaml_command )* EOF ; yaml_command: ( yaml_command_read | yaml_command_list | yaml_command_delete | yaml_command_replace | yaml_command_insert | yaml_command_macro | yaml_command_table | yaml_command_batch ) ; yaml_command_read: optionals YAML optionals YAML_READ optionals regularexpression (PROJECT projectionpath)? optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_list: optionals YAML optionals YAML_LIST optionals regularexpression optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_delete: optionals YAML optionals YAML_DELETE optionals regularexpression optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_replace: optionals YAML optionals YAML_REPLACE optionals regularexpression newcontent optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_insert: optionals YAML optionals YAML_INSERT optionals regularexpression newcontent optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_table: optionals YAML optionals YAML_TABLE optionals regularexpression columnslist optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_macro: optionals YAML optionals YAML_MACRO optionals macroProperties optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; yaml_command_batch: optionals YAML optionals YAML_BATCH optionals batchFilePath optionals INPUT_FROM inputSrc=(HYPHEN|FILEPATH) OUTPUT_TO outputSink=(HYPHEN|FILEPATH) optionals; // ================================== optionals : ( ( DELIMITER_OPT delimiter+=delimiter_text ) | ( YAMLLIBRARY_OPT yamlImplementation+=YAMLLIBRARY_LIST ) | VERBOSE | SHOWSTATS | yamlQuoteChar=QUOTEYAMLCONTENT )* ; // ================================== delimiter_text : delimiter_char | SINGLEQUOTEDTEXT | DOUBLEQUOTEDTEXT ; delimiter_char : COMMA | AT | SLASH | PERCENT | UNDERSCORE | PERIOD ; // !!!!!! Warning. Do NOT add 'SEMICOLON' to the list of delimiters. // !!!!!! Warning. Do NOT add 'COLON' to the list of delimiters.. .. until you can figure out how JSON and this can CO-EXIST any_quoted_text : SINGLEQUOTEDTEXT | DOUBLEQUOTEDTEXT | SINGLEDOUBLEQUOTEDTEXT | DOUBLESINGLEQUOTEDTEXT ; //================================================================================= //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //================================================================================= // WARNING: Do NOT move 'regularexpression' or 'projectionpath' to 'PARSER' section // ATTENTION: an XML-path or a YAML-Path can look like a file-path with a leading '/' .. .. hence the use of FILEPATH regularexpression: FILEPATH | any_quoted_text | SIMPLEWORD | ( COMMA | ANYWORD | INDEX_EXPR | NONQUOTEDTEXT )+ // see notes below !!!!!!!!!!!!!!!!!! { if ( $ctx.getText().startsWith("--") ) { // !!!!!!!!!!!!!!!!!!!!!!!!!! Yeah !!!!!!!!!!!!!!!!!! This code works. Try providing '--XYZ' instead of a RegExp! System.err.println( $ctx.getText() +" command-line option is unknown" ); final RecognitionException re = new RecognitionException( this, this.getInputStream(), $ctx ); notifyErrorListeners( getCurrentToken(), "This command-line option is unknown", re ); } }; // we need both 'BRACKETS' and "NUMBERS" in the definition as "[1]" will be parsed as 3 separate tokens as: BRACKETS NUMBER BRACKETS batchFilePath : FILEPATH_ATPREFIX | FILEPATH | any_quoted_text; //================================================================================= //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //================================================================================= newcontent : ( FILEPATH_ATPREFIX | any_quoted_text | IN_MEMORY_LABEL ) ; // inlinejson macroProperties : INLINEPROPERTIES | FILEPATH_ATPREFIX ; columnslist : SINGLEQUOTEDTEXT | DOUBLEQUOTEDTEXT | ANYWORD ; // Attention: Ensure the list of EXPLICIT single-chars above, matches the list for Parser's delimiter_char projectionpath: any_quoted_text | SIMPLEWORD | ANYWORD; // ================================== inlinejson : JSONBEGIN inlinejsonelem ( COMMA inlinejsonelem ) * JSONEND ; inlinejsonelem : ( SIMPLEWORD | any_quoted_text ) COLON ( SIMPLEWORD | any_quoted_text | inlinejson ) ; //EOF
oeis/186/A186244.asm
neoneye/loda-programs
11
17404
; A186244: Number of ternary strings of length n containing 00. ; Submitted by <NAME> ; 0,0,1,5,21,79,281,963,3217,10547,34089,108955,345137,1085331,3392377,10549739,32667201,100782787,309946697,950599131,2908512145,8880484019,27064776729,82350874699,250212362465,759269653155,2301393567721,6968615051195,21081883066161,63726593719699,192493746026681,581071056857643,1753020737863297,5285856985725827,15930775636030089,47992325810067355,144523384591861457,435062965902857331,1309267336286436697,3938944510269585419,11847275410785036321,35624994995128219747,107102206270883440937 mov $1,1 mov $2,1 lpb $0 mov $3,1 lpb $3 add $2,1 sub $2,$3 mod $2,2 mov $4,$1 cmp $4,1 cmp $4,0 sub $3,$4 mul $7,2 add $7,$6 add $7,$1 lpe sub $0,1 add $2,2 mul $1,$2 mul $7,$5 mov $5,-1 sub $6,$7 add $7,$6 lpe mov $0,$6 div $0,3
specs/ada/server/ike/tkmrpc-operation_handlers-ike-esa_select.adb
DrenfongWong/tkm-rpc
0
3517
with Tkmrpc.Servers.Ike; with Tkmrpc.Results; with Tkmrpc.Request.Ike.Esa_Select.Convert; with Tkmrpc.Response.Ike.Esa_Select.Convert; package body Tkmrpc.Operation_Handlers.Ike.Esa_Select is ------------------------------------------------------------------------- procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type) is Specific_Req : Request.Ike.Esa_Select.Request_Type; Specific_Res : Response.Ike.Esa_Select.Response_Type; begin Specific_Res := Response.Ike.Esa_Select.Null_Response; Specific_Req := Request.Ike.Esa_Select.Convert.From_Request (S => Req); if Specific_Req.Data.Esa_Id'Valid then Servers.Ike.Esa_Select (Result => Specific_Res.Header.Result, Esa_Id => Specific_Req.Data.Esa_Id); Res := Response.Ike.Esa_Select.Convert.To_Response (S => Specific_Res); else Res.Header.Result := Results.Invalid_Parameter; end if; end Handle; end Tkmrpc.Operation_Handlers.Ike.Esa_Select;
Structure/Operator/Vector/Subspaces/DirectSum.agda
Lolirofle/stuff-in-agda
6
5729
<filename>Structure/Operator/Vector/Subspaces/DirectSum.agda import Lvl open import Structure.Operator.Vector open import Structure.Setoid open import Type module Structure.Operator.Vector.Subspaces.DirectSum {ℓᵥ ℓₛ ℓᵥₑ ℓₛₑ} {V : Type{ℓᵥ}} ⦃ equiv-V : Equiv{ℓᵥₑ}(V) ⦄ {S : Type{ℓₛ}} ⦃ equiv-S : Equiv{ℓₛₑ}(S) ⦄ {_+ᵥ_ : V → V → V} {_⋅ₛᵥ_ : S → V → V} {_+ₛ_ _⋅ₛ_ : S → S → S} ⦃ vectorSpace : VectorSpace(_+ᵥ_)(_⋅ₛᵥ_)(_+ₛ_)(_⋅ₛ_) ⦄ where open VectorSpace(vectorSpace) open import Data.Tuple as Tuple using (_,_) open import Logic.Propositional open import Logic.Predicate import Lvl open import Sets.ExtensionalPredicateSet as PredSet using (PredSet ; _∈_ ; [∋]-binaryRelator) open import Structure.Container.SetLike using (SetElement) private open module SetLikeFunctionProperties{ℓ} = Structure.Container.SetLike.FunctionProperties{C = PredSet{ℓ}(V)}{E = V}(_∈_) open import Structure.Operator open import Structure.Operator.Proofs.Util open import Structure.Operator.Properties open import Structure.Operator.Vector open import Structure.Operator.Vector.Subspace ⦃ vectorSpace = vectorSpace ⦄ open import Syntax.Transitivity private variable ℓ ℓ₁ ℓ₂ ℓₗ : Lvl.Level module _ where module _ where -- TODO: This operator can also be constructed for vector spaces, not just subspaces _+ˢᵘᵇ_ : SubspaceObject{ℓ₁} → SubspaceObject{ℓ₂} → SubspaceObject ([∃]-intro V₁ ⦃ p₁ ⦄) +ˢᵘᵇ ([∃]-intro V₂ ⦃ p₂ ⦄) = [∃]-intro (PredSet.map₂(_+ᵥ_) V₁ V₂) ⦃ p ⦄ where p : Subspace(PredSet.map₂(_+ᵥ_) V₁ V₂) ∃.witness (Structure.Container.SetLike.FunctionProperties._closed-under₂_.proof (Subspace.add-closure p) ([∃]-intro(a₁ , a₂)) ([∃]-intro(b₁ , b₂))) = ((a₁ +ᵥ b₁) , (a₂ +ᵥ b₂)) ∃.proof (Structure.Container.SetLike.FunctionProperties._closed-under₂_.proof (Subspace.add-closure p) {a}{b} ([∃]-intro ([∧]-intro a₁ a₂) ⦃ [∧]-intro ([∧]-intro a₁V₁ a₂V₂) a₁a₂a ⦄) ([∃]-intro (b₁ , b₂) ⦃ [∧]-intro ([∧]-intro b₁V₁ b₂V₂) b₁b₂b ⦄)) = [∧]-intro ([∧]-intro l₁ l₂) r where l₁ : (a₁ +ᵥ b₁) ∈ V₁ l₁ = (V₁ closureUnder₂(_+ᵥ_)) a₁V₁ b₁V₁ l₂ : (a₂ +ᵥ b₂) ∈ V₂ l₂ = (V₂ closureUnder₂(_+ᵥ_)) a₂V₂ b₂V₂ r : (a₁ +ᵥ b₁) +ᵥ (a₂ +ᵥ b₂) ≡ a +ᵥ b r = (a₁ +ᵥ b₁) +ᵥ (a₂ +ᵥ b₂) 🝖[ _≡_ ]-[ One.associate-commute4-c {_▫_ = _+ᵥ_} ⦃ op = [+ᵥ]-binary-operator ⦄ ⦃ assoc = [+ᵥ]-associativity ⦄ ⦃ comm = [+ᵥ]-commutativity ⦄ ] -- TODO: Why are the instances not inferred? (a₁ +ᵥ a₂) +ᵥ (b₁ +ᵥ b₂) 🝖[ _≡_ ]-[ congruence₂(_+ᵥ_) ⦃ [+ᵥ]-binary-operator ⦄ a₁a₂a b₁b₂b ] a +ᵥ b 🝖-end ∃.witness (Structure.Container.SetLike.FunctionProperties._closed-under₁_.proof (Subspace.mul-closure p {s}) ([∃]-intro(v₁ , v₂))) = ((s ⋅ₛᵥ v₁) , (s ⋅ₛᵥ v₂)) ∃.proof (Structure.Container.SetLike.FunctionProperties._closed-under₁_.proof (Subspace.mul-closure p {s}) {v} ([∃]-intro(v₁ , v₂) ⦃ [∧]-intro ([∧]-intro v₁V₁ v₂V₂) v₁v₂v ⦄)) = [∧]-intro ([∧]-intro l₁ l₂) r where l₁ : (s ⋅ₛᵥ v₁) ∈ V₁ l₁ = (V₁ closureUnder₁(s ⋅ₛᵥ_)) v₁V₁ l₂ : (s ⋅ₛᵥ v₂) ∈ V₂ l₂ = (V₂ closureUnder₁(s ⋅ₛᵥ_)) v₂V₂ r : (s ⋅ₛᵥ v₁) +ᵥ (s ⋅ₛᵥ v₂) ≡ (s ⋅ₛᵥ v) r = (s ⋅ₛᵥ v₁) +ᵥ (s ⋅ₛᵥ v₂) 🝖[ _≡_ ]-[ distributivityₗ(_⋅ₛᵥ_)(_+ᵥ_) ]-sym s ⋅ₛᵥ (v₁ +ᵥ v₂) 🝖[ _≡_ ]-[ congruence₂ᵣ(_⋅ₛᵥ_)(s) v₁v₂v ] s ⋅ₛᵥ v 🝖-end -- TODO: Formulate -- [⊕ˢᵘᵇ]-span-vectorSpace : (V₁ ⊕ V₂ ⊕ … ≡ₛ 𝐔) ↔ (∀{v₁}{v₂}{…} → (v₁ ∈ V₁) → (v₂ ∈ V₂) → … → (v₁ + v₂ + … ≡ 𝟎ᵥ) → ((v₁ ≡ 𝟎ᵥ) ∧ (v₂ ≡ 𝟎ᵥ) ∧ …)) -- [⊕ˢᵘᵇ]-span-existence-finite-space : Finite → ∃(\{(V₁ , V₂ , …) → V₁ ⊕ V₂ ⊕ … ≡ₛ 𝐔}) -- TODO: Just take the "standard" "axis aligned" subspaces
Platform Code/LAPIS_SensorPlatform_Firmware/Firmware/_output/_obj/i2c.asm
kbahar/ROHM_SensorPlatform_Multi-Sensor-Shield
0
177234
;; Compile Options : /TML610112 /MS /near /Icommon /Imain /Iirq /Itimer /Iclock /Itbc /Iuart /Ii2c /SS 256 /SD /Oa /Ot /W 3 /Wc /Fa_output\_obj\ ;; Version Number : Ver.3.41.8 ;; File Name : i2c.c type (ML610112) model small, near $$NINITVAR segment data 2h #0h $$NINITTAB segment table 2h any $$i2c_checkIRQ$i2c segment code 2h #0h $$i2c_clearIRQ$i2c segment code 2h #0h $$i2c_continue$i2c segment code 2h #0h $$i2c_getTransSize$i2c segment code 2h #0h $$i2c_init$i2c segment code 2h #0h $$i2c_startReceive$i2c segment code 2h #0h $$i2c_startSend$i2c segment code 2h #0h $$i2c_stop$i2c segment code 2h #0h CVERSION 3.41.8 CGLOBAL 01H 02H 0000H "i2c_getTransSize" 08H 02H 08H 00H 80H 00H 00H 00H 01H CGLOBAL 01H 03H 0000H "i2c_stop" 08H 02H 05H 00H 80H 00H 00H 00H 07H CGLOBAL 01H 03H 0000H "i2c_startReceive" 08H 02H 03H 00H 82H 04H 00H 00H 01H CGLOBAL 01H 03H 0000H "i2c_continue" 08H 02H 04H 00H 81H 06H 00H 00H 01H CGLOBAL 01H 03H 0000H "i2c_startSend" 08H 02H 02H 00H 82H 04H 00H 00H 01H CGLOBAL 01H 03H 0000H "i2c_init" 08H 02H 01H 00H 83H 0cH 00H 00H 01H CGLOBAL 01H 03H 0000H "i2c_clearIRQ" 08H 02H 07H 00H 80H 00H 00H 00H 07H CGLOBAL 01H 03H 0000H "i2c_checkIRQ" 08H 02H 06H 00H 80H 00H 00H 00H 01H CSTRUCTTAG 0000H 0000H 0001H 0009H 00000010H "_Notag" CSTRUCTMEM 42H 00000001H 00000000H "mode" 02H 00H 00H CSTRUCTMEM 42H 00000002H 00000002H "addr" 04H 03H 00H 00H 00H CSTRUCTMEM 42H 00000002H 00000004H "addr_size" 02H 00H 01H CSTRUCTMEM 42H 00000002H 00000006H "data" 04H 03H 00H 00H 00H CSTRUCTMEM 42H 00000002H 00000008H "data_size" 02H 00H 01H CSTRUCTMEM 42H 00000002H 0000000AH "cnt" 02H 00H 01H CSTRUCTMEM 43H 00000002H 0000000CH "callBack" 0AH 03H 00H 02H 00H 00H 00H 00H 00H 00H 07H CSTRUCTMEM 42H 00000001H 0000000EH "errStat" 02H 00H 00H CSTRUCTMEM 42H 00000001H 0000000FH "status" 02H 00H 00H CSTRUCTTAG 0000H 0000H 0000H 0008H 00000001H "_Notag" CSTRUCTMEM 52H 00000001H 00000000H "b0" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000001H "b1" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000002H "b2" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000003H "b3" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000004H "b4" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000005H "b5" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000006H "b6" 02H 00H 00H CSTRUCTMEM 52H 00000001H 00000007H "b7" 02H 00H 00H CTYPEDEF 0000H 0000H 43H "cbfI2c" 0AH 03H 00H 02H 00H 00H 00H 00H 00H 00H 07H CTYPEDEF 0000H 0000H 43H "tI2cCtrlParam" 04H 00H 05H 01H 00H CTYPEDEF 0000H 0000H 43H "_BYTE_FIELD" 04H 00H 05H 00H 00H CSGLOBAL 43H 0010H "_gsCtrlParam" 04H 00H 05H 01H 00H CFILE 0001H 00000023H "main\\mcu.h" CFILE 0002H 0000085AH "main\\ML610112.H" CFILE 0003H 00000045H "i2c\\i2c.h" CFILE 0000H 0000022BH "i2c\\i2c.c" rseg $$i2c_init$i2c CFUNCTION 1 _i2c_init : CBLOCK 1 1 151 ;;{ CLINEA 0000H 0001H 0097H 0001H 0001H push lr push fp mov fp, sp push xr8 push xr4 mov r8, r0 mov er10, er2 CBLOCK 1 2 151 CRET 000AH CARGUMENT 46H 0001H 001CH "mode" 02H 00H 00H CARGUMENT 46H 0002H 0029H "kHz" 02H 00H 01H CARGUMENT 42H 0001H 0004H "syn" 02H 00H 00H CLOCAL 4AH 0001H 0000H 0002H "setbit" 02H 00H 00H CLOCAL 46H 0001H 0016H 0002H "down" 02H 00H 00H CLOCAL 46H 0002H 0026H 0002H "rate_cyc" 02H 00H 08H CLOCAL 46H 0002H 0027H 0002H "rate_khz" 02H 00H 08H ;; if( syn > (unsigned char)I2C_SYN_ON ){ CLINEA 0000H 0001H 009EH 0002H 0027H l r0, 4[fp] cmp r0, #01h ble _$L1 CBLOCK 1 3 158 ;; return( I2C_R_ERR_SYN ); CLINEA 0000H 0001H 009FH 0003H 001AH mov er0, #-1 CBLOCKEND 1 3 160 CBLOCKEND 1 2 226 ;;} CLINEA 0000H 0001H 00E2H 0001H 0001H _$L0 : pop xr4 pop xr8 mov sp, fp pop fp pop pc ;; } CLINEA 0000H 0000H 00A0H 0002H 0002H _$L1 : ;; if( mode == (unsigned char)I2C_MOD_STD ){ CLINEA 0000H 0001H 00A2H 0002H 002AH cmp r8, #00h bne _$L3 CBLOCK 1 4 162 ;; rate_cyc = (unsigned short)I2C_STD_CYC; CLINEA 0000H 0001H 00A3H 0003H 0029H mov r4, #050h mov r5, #00h ;; rate_khz = (unsigned short)I2C_STD_KHZ; CLINEA 0000H 0001H 00A4H 0003H 0029H mov r6, #064h mov r7, #00h CBLOCKEND 1 4 165 ;; else if( mode == (unsigned char)I2C_MOD_FST ){ CLINEA 0000H 0001H 00A6H 0002H 002FH bal _$L5 _$L3 : cmp r8, #01h beq _$M1 b _$L6 _$M1 : CBLOCK 1 5 166 ;; rate_cyc = (unsigned short)I2C_FST_CYC; CLINEA 0000H 0001H 00A7H 0003H 0029H mov er4, #20 ;; rate_khz = (unsigned short)I2C_FST_KHZ; CLINEA 0000H 0001H 00A8H 0003H 0029H mov r6, #090h mov r7, #01h CBLOCKEND 1 5 169 ;; } CLINEA 0000H 0000H 00ACH 0002H 0002H _$L5 : ;; if( ( kHz / rate_cyc ) <= rate_khz ){ CLINEA 0000H 0001H 00AEH 0002H 0026H mov er0, er10 mov er2, er4 bl __uidivu8sw cmp er0, er6 bgt _$L9 CBLOCK 1 7 174 ;; down = (unsigned char)I2C_DW_0; CLINEA 0000H 0001H 00AFH 0003H 0021H mov r0, #00h ;; else if( ( kHz / (unsigned short)( ( rate_cyc * 11 ) / 10 ) ) <= rate_khz ){ CLINEA 0000H 0001H 00B1H 0002H 004DH bal _$L17 _$L9 : mov er0, er4 sllc r1, #02h sll r0, #02h add er0, er4 add er0, er0 add er0, er4 mov r2, #0ah div er0, r2 mov er2, er0 mov er0, er10 bl __uidivu8sw cmp er0, er6 bgt _$L12 CBLOCK 1 8 177 ;; down = (unsigned char)I2C_DW_10; CLINEA 0000H 0001H 00B2H 0003H 0022H mov r0, #01h ;; else if( ( kHz / (unsigned short)( ( rate_cyc * 12 ) / 10 ) ) <= rate_khz ){ CLINEA 0000H 0001H 00B4H 0002H 004DH bal _$L17 _$L12 : mov er0, er4 add er0, er4 add er0, er4 sllc r1, #02h sll r0, #02h mov r2, #0ah div er0, r2 mov er2, er0 mov er0, er10 bl __uidivu8sw cmp er0, er6 bgt _$L15 CBLOCK 1 9 180 ;; down = (unsigned char)I2C_DW_20; CLINEA 0000H 0001H 00B5H 0003H 0022H mov r0, #02h CBLOCKEND 1 9 182 ;; else if( ( kHz / (unsigned short)( ( rate_cyc * 13 ) / 10 ) ) <= rate_khz ){ CLINEA 0000H 0001H 00B7H 0002H 004DH bal _$L17 _$L15 : mov er0, er4 add er0, er4 add er0, er4 sllc r1, #02h sll r0, #02h add er0, er4 mov r2, #0ah div er0, r2 mov er2, er0 mov er0, er10 bl __uidivu8sw cmp er0, er6 bgt _$L18 CBLOCK 1 10 183 ;; down = (unsigned char)I2C_DW_30; CLINEA 0000H 0001H 00B8H 0003H 0022H mov r0, #03h CBLOCKEND 1 10 185 ;; } CLINEA 0000H 0000H 00BCH 0002H 0002H _$L17 : mov r2, r0 CBLOCKEND 1 8 226 ;; _gsCtrlParam.mode = 0; CLINEA 0000H 0001H 00BFH 0002H 0018H mov r0, #00h st r0, NEAR __gsCtrlParam ;; _gsCtrlParam.addr = (void *)0; CLINEA 0000H 0001H 00C0H 0002H 0020H mov er0, #0 st er0, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size = 0; CLINEA 0000H 0001H 00C1H 0002H 001CH st er0, NEAR __gsCtrlParam+04h ;; _gsCtrlParam.data = (void *)0; CLINEA 0000H 0001H 00C2H 0002H 0020H st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.data_size = 0; CLINEA 0000H 0001H 00C3H 0002H 001CH st er0, NEAR __gsCtrlParam+08h ;; _gsCtrlParam.cnt = 0; CLINEA 0000H 0001H 00C4H 0002H 0017H st er0, NEAR __gsCtrlParam+0ah ;; _gsCtrlParam.callBack = (void *)0; CLINEA 0000H 0001H 00C5H 0002H 0023H st er0, NEAR __gsCtrlParam+0ch ;; _gsCtrlParam.errStat = 0; CLINEA 0000H 0001H 00C6H 0002H 001AH st r0, NEAR __gsCtrlParam+0eh ;; _gsCtrlParam.status = 0; CLINEA 0000H 0001H 00C7H 0002H 001AH st r0, NEAR __gsCtrlParam+0fh ;; I20EN = 0; CLINEA 0000H 0001H 00CBH 0002H 000BH rb 0f2a4h.0 ;; PB5DIR = 0; /* Output */ CLINEA 0000H 0001H 00CEH 0002H 001AH rb 0f259h.5 ;; PB5C0 = 0; CLINEA 0000H 0001H 00CFH 0002H 000BH rb 0f25ah.5 ;; PB5C1 = 1; /* Nch */ CLINEA 0000H 0001H 00D0H 0002H 0016H sb 0f25bh.5 ;; PB5MD0 = 0; CLINEA 0000H 0001H 00D1H 0002H 000CH rb 0f25ch.5 ;; PB5MD1 = 1; /* I2C SCL */ CLINEA 0000H 0001H 00D2H 0002H 001BH sb 0f25dh.5 ;; PB6DIR = 0; /* Output */ CLINEA 0000H 0001H 00D4H 0002H 001AH rb 0f259h.6 ;; PB6C0 = 0; CLINEA 0000H 0001H 00D5H 0002H 000BH rb 0f25ah.6 ;; PB6C1 = 1; /* Nch */ CLINEA 0000H 0001H 00D6H 0002H 0016H sb 0f25bh.6 ;; PB6MD0 = 0; CLINEA 0000H 0001H 00D7H 0002H 000CH rb 0f25ch.6 ;; PB6MD1 = 1; /* I2C SD */ CLINEA 0000H 0001H 00D8H 0002H 001AH sb 0f25dh.6 ;; I2C0MOD = setbit; CLINEA 0000H 0001H 00DFH 0002H 0012H mov r0, r8 sll r0, #01h mov r1, r2 sll r1, #02h or r1, r0 l r0, 4[fp] sll r0, #04h or r0, r1 or r0, #01h st r0, 0f2a4h ;; return ( I2C_R_OK ); CLINEA 0000H 0001H 00E1H 0002H 0015H mov er0, #0 b _$L0 CBLOCKEND 1 7 226 ;; else{ CLINEA 0000H 0000H 00AAH 0002H 0006H _$L6 : CBLOCK 1 6 170 ;; return( I2C_R_ERR_MODE ); CLINEA 0000H 0001H 00ABH 0003H 001BH mov er0, #-2 b _$L0 CBLOCKEND 1 6 172 ;; else{ CLINEA 0000H 0000H 00BAH 0002H 0006H _$L18 : CBLOCK 1 11 186 ;; return( I2C_R_ERR_FREQ ); CLINEA 0000H 0001H 00BBH 0003H 001BH mov er0, #-3 b _$L0 CBLOCKEND 1 11 188 CBLOCKEND 1 1 226 CFUNCTIONEND 1 rseg $$i2c_startSend$i2c CFUNCTION 2 _i2c_startSend : CBLOCK 2 1 243 ;;{ CLINEA 0000H 0001H 00F3H 0001H 0001H push fp mov fp, sp push er8 mov r8, r0 CBLOCK 2 2 243 CARGUMENT 46H 0001H 001CH "slave_adr" 02H 00H 00H CARGUMENT 46H 0002H 0025H "addr" 04H 03H 00H 00H 00H CARGUMENT 42H 0002H 0002H "addr_size" 02H 00H 01H CARGUMENT 42H 0002H 0004H "data" 04H 03H 00H 00H 00H CARGUMENT 42H 0002H 0006H "data_size" 02H 00H 01H CARGUMENT 43H 0002H 0008H "func" 0AH 03H 00H 02H 00H 00H 00H 00H 00H 00H 07H CLOCAL 46H 0001H 0014H 0002H "errStat" 02H 00H 00H ;; _gsCtrlParam.mode = 0; /* send */ CLINEA 0000H 0001H 00F7H 0002H 0023H mov r0, #00h st r0, NEAR __gsCtrlParam ;; _gsCtrlParam.addr = addr; CLINEA 0000H 0001H 00F8H 0002H 001BH st er2, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size = addr_size; CLINEA 0000H 0001H 00F9H 0002H 0024H l er0, 2[fp] st er0, NEAR __gsCtrlParam+04h ;; _gsCtrlParam.data = data; CLINEA 0000H 0001H 00FAH 0002H 001BH l er0, 4[fp] st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.data_size = data_size; CLINEA 0000H 0001H 00FBH 0002H 0024H l er0, 6[fp] st er0, NEAR __gsCtrlParam+08h ;; _gsCtrlParam.cnt = 0; CLINEA 0000H 0001H 00FCH 0002H 0017H mov er0, #0 st er0, NEAR __gsCtrlParam+0ah ;; _gsCtrlParam.callBack = func; CLINEA 0000H 0001H 00FDH 0002H 001EH l er0, 8[fp] st er0, NEAR __gsCtrlParam+0ch ;; _gsCtrlParam.errStat = 0; CLINEA 0000H 0001H 00FEH 0002H 001AH mov r0, #00h st r0, NEAR __gsCtrlParam+0eh ;; _gsCtrlParam.status = 0; CLINEA 0000H 0001H 00FFH 0002H 001AH st r0, NEAR __gsCtrlParam+0fh ;; if( (_gsCtrlParam.addr_size == 0) && (_gsCtrlParam.data_size == 0) ){ CLINEA 0000H 0001H 0101H 0002H 0046H l er0, NEAR __gsCtrlParam+04h bne _$L22 l er0, NEAR __gsCtrlParam+08h bne _$L22 CBLOCK 2 3 257 ;; return(I2C_R_TRANS_FIN); CLINEA 0000H 0001H 0102H 0003H 001AH mov er0, #1 CBLOCKEND 2 3 259 CBLOCKEND 2 2 272 ;;} CLINEA 0000H 0001H 0110H 0001H 0001H _$L21 : pop er8 mov sp, fp pop fp rt ;; } CLINEA 0000H 0000H 0103H 0002H 0002H _$L22 : ;; errStat = (unsigned char)( I2C0STAT & (unsigned char)I2C0STAT_I20BB ); CLINEA 0000H 0001H 0105H 0002H 0048H l r0, 0f2a5h and r0, #01h ;; if( errStat == (unsigned char)I2C0STAT_I20BB ){ CLINEA 0000H 0001H 0106H 0002H 0030H cmp r0, #01h bne _$L29 CBLOCK 2 4 262 ;; return ( I2C_R_BUS_BUSY ); CLINEA 0000H 0001H 0107H 0003H 001CH mov er0, #-1 bal _$L21 CBLOCKEND 2 4 264 ;; } CLINEA 0000H 0000H 0108H 0002H 0002H _$L29 : ;; _gsCtrlParam.status = I2C_SEND_SLAVE_ADDRESS; CLINEA 0000H 0001H 010BH 0002H 002EH mov r0, #01h st r0, NEAR __gsCtrlParam+0fh ;; I2C0SA = (unsigned char)( slave_adr << 1 ); /* send mode */ CLINEA 0000H 0001H 010DH 0002H 003CH mov r0, r8 sll r0, #01h st r0, 0f2a1h ;; I2C0CON = (unsigned char)I2C0CON_I20ST; /* Start condition */ CLINEA 0000H 0001H 010EH 0002H 003FH mov r0, #01h st r0, 0f2a3h ;; return ( I2C_R_TRANS_START_OK ); CLINEA 0000H 0001H 010FH 0002H 0021H mov er0, #0 bal _$L21 CBLOCKEND 2 1 272 CFUNCTIONEND 2 rseg $$i2c_startReceive$i2c CFUNCTION 3 _i2c_startReceive : CBLOCK 3 1 288 ;;{ CLINEA 0000H 0001H 0120H 0001H 0001H push fp mov fp, sp push er8 mov r8, r0 CBLOCK 3 2 288 CARGUMENT 46H 0001H 001CH "slave_adr" 02H 00H 00H CARGUMENT 46H 0002H 0025H "addr" 04H 03H 00H 00H 00H CARGUMENT 42H 0002H 0002H "addr_size" 02H 00H 01H CARGUMENT 42H 0002H 0004H "data" 04H 03H 00H 00H 00H CARGUMENT 42H 0002H 0006H "data_size" 02H 00H 01H CARGUMENT 43H 0002H 0008H "func" 0AH 03H 00H 02H 00H 00H 00H 00H 00H 00H 07H CLOCAL 46H 0001H 0014H 0002H "errStat" 02H 00H 00H ;; _gsCtrlParam.mode = 1; /* receive */ CLINEA 0000H 0001H 0125H 0002H 0026H mov r0, #01h st r0, NEAR __gsCtrlParam ;; _gsCtrlParam.addr = addr; CLINEA 0000H 0001H 0126H 0002H 001BH st er2, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size = addr_size; CLINEA 0000H 0001H 0127H 0002H 0024H l er0, 2[fp] st er0, NEAR __gsCtrlParam+04h ;; _gsCtrlParam.data = data; CLINEA 0000H 0001H 0128H 0002H 001BH l er0, 4[fp] st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.data_size = data_size; CLINEA 0000H 0001H 0129H 0002H 0024H l er0, 6[fp] st er0, NEAR __gsCtrlParam+08h ;; _gsCtrlParam.cnt = 0; CLINEA 0000H 0001H 012AH 0002H 0017H mov er0, #0 st er0, NEAR __gsCtrlParam+0ah ;; _gsCtrlParam.callBack = func; CLINEA 0000H 0001H 012BH 0002H 001EH l er0, 8[fp] st er0, NEAR __gsCtrlParam+0ch ;; _gsCtrlParam.errStat = 0; CLINEA 0000H 0001H 012CH 0002H 001AH mov r0, #00h st r0, NEAR __gsCtrlParam+0eh ;; _gsCtrlParam.status = 0; CLINEA 0000H 0001H 012DH 0002H 001AH st r0, NEAR __gsCtrlParam+0fh ;; if( (_gsCtrlParam.addr_size == 0) && (_gsCtrlParam.data_size == 0) ){ CLINEA 0000H 0001H 012FH 0002H 0046H l er0, NEAR __gsCtrlParam+04h bne _$L32 l er0, NEAR __gsCtrlParam+08h bne _$L32 CBLOCK 3 3 303 ;; return(I2C_R_TRANS_FIN); CLINEA 0000H 0001H 0130H 0003H 001AH mov er0, #1 CBLOCKEND 3 3 305 CBLOCKEND 3 2 321 ;;} CLINEA 0000H 0001H 0141H 0001H 0001H _$L31 : pop er8 mov sp, fp pop fp rt ;; } CLINEA 0000H 0000H 0131H 0002H 0002H _$L32 : ;; errStat = (unsigned char)( I2C0STAT & (unsigned char)I2C0STAT_I20BB ); CLINEA 0000H 0001H 0133H 0002H 0048H l r0, 0f2a5h and r0, #01h ;; if( errStat == (unsigned char)I2C0STAT_I20BB ){ CLINEA 0000H 0001H 0134H 0002H 0030H cmp r0, #01h bne _$L39 CBLOCK 3 4 308 ;; return ( I2C_R_BUS_BUSY ); CLINEA 0000H 0001H 0135H 0003H 001CH mov er0, #-1 bal _$L31 CBLOCKEND 3 4 310 ;; } CLINEA 0000H 0000H 0136H 0002H 0002H _$L39 : ;; _gsCtrlParam.status = I2C_SEND_SLAVE_ADDRESS; CLINEA 0000H 0001H 0138H 0002H 002EH mov r0, #01h st r0, NEAR __gsCtrlParam+0fh ;; if(_gsCtrlParam.addr_size == 0){ CLINEA 0000H 0001H 0139H 0002H 0021H l er0, NEAR __gsCtrlParam+04h bne _$L41 CBLOCK 3 5 313 ;; I2C0SA = (unsigned char)( ( slave_adr << 1 ) | I2C0SA_I20RW ); /* Receive mode */ CLINEA 0000H 0001H 013AH 0003H 0054H mov r0, r8 sll r0, #01h or r0, #01h CBLOCKEND 3 5 315 ;; else{ CLINEA 0000H 0001H 013CH 0002H 0006H bal _$L43 _$L41 : CBLOCK 3 6 316 ;; I2C0SA = (unsigned char)( ( slave_adr << 1 )/* | I2C0SA_I20RW*/ ); /* Send mode */ CLINEA 0000H 0001H 013DH 0003H 0054H mov r0, r8 sll r0, #01h CBLOCKEND 3 6 318 ;; } CLINEA 0000H 0000H 013EH 0002H 0002H _$L43 : st r0, 0f2a1h ;; I2C0CON = (unsigned char)I2C0CON_I20ST; /* Start condition */ CLINEA 0000H 0001H 013FH 0003H 003FH mov r0, #01h st r0, 0f2a3h ;; return ( I2C_R_TRANS_START_OK ); CLINEA 0000H 0001H 0140H 0002H 0021H mov er0, #0 bal _$L31 CBLOCKEND 3 1 321 CFUNCTIONEND 3 rseg $$i2c_continue$i2c CFUNCTION 4 _i2c_continue : CBLOCK 4 1 335 ;;{ CLINEA 0000H 0001H 014FH 0001H 0001H push lr push bp push er4 CBLOCK 4 2 335 CRET 0004H CLOCAL 46H 0001H 0015H 0002H "i2c0stat" 02H 00H 00H CLOCAL 46H 0001H 0018H 0002H "setbit" 02H 00H 00H CLOCAL 47H 0002H 0026H 0002H "callbackFunc" 0AH 03H 00H 02H 00H 00H 00H 00H 00H 00H 07H ;; i2c0stat = I2C0STAT; CLINEA 0000H 0001H 0154H 0002H 0015H l r0, 0f2a5h mov r1, r0 ;; switch(_gsCtrlParam.status){ CLINEA 0000H 0001H 0155H 0002H 001DH l r0, NEAR __gsCtrlParam+0fh CBLOCK 4 3 341 beq _$L93 ;; switch(_gsCtrlParam.status){ CLINEA 0000H 0000H 0155H 0002H 001DH cmp r0, #01h beq _$L50 ;; switch(_gsCtrlParam.status){ CLINEA 0000H 0000H 0155H 0002H 001DH cmp r0, #02h bne _$M5 b _$L67 _$M5 : ;; switch(_gsCtrlParam.status){ CLINEA 0000H 0000H 0155H 0002H 001DH cmp r0, #03h bne _$M6 b _$L80 _$M6 : ;; switch(_gsCtrlParam.status){ CLINEA 0000H 0000H 0155H 0002H 001DH cmp r0, #04h bne _$M7 b _$L87 _$M7 : ;; case I2C_TRANS_END: CLINEA 0000H 0001H 01CFH 0003H 0015H _$L93 : ;; if( _gsCtrlParam.callBack != (void *)0 ){ CLINEA 0000H 0001H 01D1H 0004H 002CH l er0, NEAR __gsCtrlParam+0ch beq _$L94 CBLOCK 4 27 465 ;; callbackFunc = _gsCtrlParam.callBack; CLINEA 0000H 0001H 01D2H 0005H 0029H mov er4, er0 ;; _gsCtrlParam.callBack = (void *)0; CLINEA 0000H 0001H 01D3H 0005H 0026H mov er0, #0 st er0, NEAR __gsCtrlParam+0ch ;; callbackFunc( _gsCtrlParam.cnt, _gsCtrlParam.errStat ); CLINEA 0000H 0001H 01D4H 0005H 003BH l r2, NEAR __gsCtrlParam+0eh l er0, NEAR __gsCtrlParam+0ah bl er4 CBLOCKEND 4 27 469 ;; } CLINEA 0000H 0000H 01D5H 0004H 0004H _$L94 : CBLOCKEND 4 3 471 ;; return ( I2C_R_TRANS_FIN ); CLINEA 0000H 0001H 01D8H 0002H 001CH mov er0, #1 CBLOCKEND 4 2 473 ;;} CLINEA 0000H 0001H 01D9H 0001H 0001H _$L44 : pop er4 pop bp pop pc ;; case I2C_SEND_SLAVE_ADDRESS: CLINEA 0000H 0001H 0156H 0003H 001EH _$L50 : ;; if((i2c0stat&I2C0STAT_I20ER) == I2C0STAT_I20ER){ CLINEA 0000H 0001H 0158H 0004H 0033H mov r0, r1 and r0, #04h cmp r0, #04h bne _$L51 CBLOCK 4 4 344 ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 0159H 0005H 0028H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; _gsCtrlParam.errStat = I2C_ERR_SEND_ERR; CLINEA 0000H 0001H 015AH 0005H 002CH mov r0, #02h st r0, NEAR __gsCtrlParam+0eh ;; I2C0CON = (unsigned char)0x00; /* stop i2c */ CLINEA 0000H 0001H 015BH 0005H 0031H mov r0, #00h st r0, 0f2a3h ;; if( _gsCtrlParam.callBack != (void *)0 ){ CLINEA 0000H 0001H 015CH 0005H 002DH l er0, NEAR __gsCtrlParam+0ch beq _$L53 CBLOCK 4 5 348 ;; callbackFunc = _gsCtrlParam.callBack; CLINEA 0000H 0001H 015DH 0006H 002AH mov er4, er0 ;; _gsCtrlParam.callBack = (void *)0; CLINEA 0000H 0001H 015EH 0006H 0027H mov er0, #0 st er0, NEAR __gsCtrlParam+0ch ;; callbackFunc( _gsCtrlParam.cnt, _gsCtrlParam.errStat ); CLINEA 0000H 0001H 015FH 0006H 003CH l r2, NEAR __gsCtrlParam+0eh l er0, NEAR __gsCtrlParam+0ah bl er4 CBLOCKEND 4 5 352 ;; } CLINEA 0000H 0000H 0160H 0005H 0005H _$L53 : ;; return ( I2C_R_TRANS_FIN ); CLINEA 0000H 0001H 0161H 0005H 001FH mov er0, #1 bal _$L44 CBLOCKEND 4 4 354 ;; else if((i2c0stat&I2C0STAT_I20ACR) == I2C0STAT_I20ACR){ CLINEA 0000H 0000H 0164H 0004H 003AH _$L51 : mov r0, r1 and r0, #02h cmp r0, #02h bne _$L56 CBLOCK 4 6 356 ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 0165H 0005H 0028H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; _gsCtrlParam.errStat = I2C_ERR_ACR; CLINEA 0000H 0001H 0166H 0005H 0027H mov r0, #01h st r0, NEAR __gsCtrlParam+0eh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 0167H 0005H 0040H mov r0, #02h st r0, 0f2a3h ;; else{ CLINEA 0000H 0001H 016AH 0004H 0008H bal _$L66 _$L56 : CBLOCK 4 7 362 ;; if(_gsCtrlParam.addr_size != 0){ CLINEA 0000H 0001H 016BH 0005H 0024H l er0, NEAR __gsCtrlParam+04h beq _$L59 CBLOCK 4 8 363 ;; _gsCtrlParam.status = I2C_SEND_ADDRESS; CLINEA 0000H 0001H 016CH 0006H 002CH mov r0, #02h st r0, NEAR __gsCtrlParam+0fh ;; I2C0TD = (unsigned char)*_gsCtrlParam.addr; CLINEA 0000H 0001H 016DH 0006H 0030H l bp, NEAR __gsCtrlParam+02h l r0, [bp] st r0, 0f2a2h ;; _gsCtrlParam.addr++; CLINEA 0000H 0000H 016EH 0006H 0019H mov er0, bp add er0, #1 st er0, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size--; CLINEA 0000H 0000H 016FH 0006H 001EH l er0, NEAR __gsCtrlParam+04h add er0, #-1 st er0, NEAR __gsCtrlParam+04h ;; I2C0CON = (unsigned char)I2C0CON_I20ST; /* i2c start */ CLINEA 0000H 0001H 0170H 0006H 003CH mov r0, #01h st r0, 0f2a3h ;; else{ CLINEA 0000H 0001H 0172H 0005H 0009H bal _$L66 _$L59 : CBLOCK 4 9 370 ;; if(_gsCtrlParam.mode != 0 ){ CLINEA 0000H 0001H 0173H 0006H 0021H l r0, NEAR __gsCtrlParam beq _$L62 CBLOCK 4 10 371 ;; _gsCtrlParam.status = I2C_RECEIVE_DATA; CLINEA 0000H 0001H 0174H 0007H 002DH mov r0, #04h st r0, NEAR __gsCtrlParam+0fh ;; setbit = I2C0CON_I20ST; CLINEA 0000H 0001H 0175H 0007H 001DH mov r4, #01h ;; if( ( _gsCtrlParam.data_size - 1) == _gsCtrlParam.cnt ){ CLINEA 0000H 0001H 0176H 0007H 003EH l er0, NEAR __gsCtrlParam+08h add er0, #-1 l er2, NEAR __gsCtrlParam+0ah cmp er0, er2 bne _$L64 CBLOCK 4 11 374 ;; setbit |= (unsigned char)I2C0CON_I20ACT; CLINEA 0000H 0001H 0177H 0008H 002FH mov r4, #081h CBLOCKEND 4 11 376 ;; } CLINEA 0000H 0000H 0178H 0007H 0007H _$L64 : ;; I2C0CON = setbit; CLINEA 0000H 0001H 0179H 0007H 0017H st r4, 0f2a3h CBLOCKEND 4 10 378 ;; else{ CLINEA 0000H 0001H 017BH 0006H 000AH bal _$L66 _$L62 : CBLOCK 4 12 379 ;; _gsCtrlParam.status = I2C_SEND_DATA; CLINEA 0000H 0001H 017CH 0007H 002AH mov r0, #03h st r0, NEAR __gsCtrlParam+0fh ;; I2C0TD = (unsigned char)*_gsCtrlParam.data; CLINEA 0000H 0001H 017DH 0007H 0031H l bp, NEAR __gsCtrlParam+06h l r0, [bp] st r0, 0f2a2h ;; _gsCtrlParam.data++; CLINEA 0000H 0000H 017EH 0007H 001AH mov er0, bp add er0, #1 st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.cnt++; CLINEA 0000H 0000H 017FH 0007H 0019H l er0, NEAR __gsCtrlParam+0ah add er0, #1 st er0, NEAR __gsCtrlParam+0ah ;; I2C0CON = (unsigned char)I2C0CON_I20ST; CLINEA 0000H 0001H 0180H 0007H 002DH mov r0, #01h st r0, 0f2a3h CBLOCKEND 4 12 385 ;; } CLINEA 0000H 0000H 0181H 0006H 0006H _$L66 : CBLOCKEND 4 9 386 CBLOCKEND 4 7 387 CBLOCKEND 4 8 473 CBLOCKEND 4 6 473 ;; return(I2C_R_TRANS_CONT_OK); CLINEA 0000H 0001H 0184H 0004H 001FH mov er0, #0 b _$L44 ;; case I2C_SEND_ADDRESS: CLINEA 0000H 0001H 0186H 0003H 0018H _$L67 : ;; if((i2c0stat&I2C0STAT_I20ACR) == I2C0STAT_I20ACR){ CLINEA 0000H 0001H 0187H 0004H 0035H mov r0, r1 and r0, #02h cmp r0, #02h bne _$L68 CBLOCK 4 13 391 ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 0188H 0005H 0028H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; _gsCtrlParam.errStat = I2C_ERR_ACR; CLINEA 0000H 0001H 0189H 0005H 0027H mov r0, #01h st r0, NEAR __gsCtrlParam+0eh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 018AH 0005H 0040H mov r0, #02h st r0, 0f2a3h ;; else{ CLINEA 0000H 0001H 018CH 0004H 0008H b _$L79 _$L68 : CBLOCK 4 14 396 ;; if( _gsCtrlParam.addr_size != 0 ){ CLINEA 0000H 0001H 018DH 0005H 0026H l er0, NEAR __gsCtrlParam+04h beq _$L71 CBLOCK 4 15 397 ;; I2C0TD = (unsigned char)*_gsCtrlParam.addr; CLINEA 0000H 0001H 018EH 0006H 0030H l bp, NEAR __gsCtrlParam+02h l r0, [bp] st r0, 0f2a2h ;; _gsCtrlParam.addr++; CLINEA 0000H 0000H 018FH 0006H 0019H mov er0, bp add er0, #1 st er0, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size--; CLINEA 0000H 0000H 0190H 0006H 001EH l er0, NEAR __gsCtrlParam+04h add er0, #-1 st er0, NEAR __gsCtrlParam+04h ;; I2C0CON = (unsigned char)I2C0CON_I20ST; /* i2c start */ CLINEA 0000H 0001H 0191H 0006H 003CH mov r0, #01h st r0, 0f2a3h ;; else{ CLINEA 0000H 0001H 0194H 0005H 0009H bal _$L79 _$L71 : CBLOCK 4 16 404 ;; if(_gsCtrlParam.data_size == 0){ CLINEA 0000H 0001H 0195H 0006H 0025H l er0, NEAR __gsCtrlParam+08h bne _$L74 CBLOCK 4 17 405 ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 0196H 0007H 002AH mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 0197H 0007H 0042H mov r0, #02h st r0, 0f2a3h ;; else{ CLINEA 0000H 0001H 0199H 0006H 000AH bal _$L79 _$L74 : CBLOCK 4 18 409 ;; if(_gsCtrlParam.mode != 0 ){/* receive mode */ CLINEA 0000H 0001H 019AH 0007H 0034H l r0, NEAR __gsCtrlParam beq _$L77 CBLOCK 4 19 410 ;; _gsCtrlParam.status = I2C_SEND_SLAVE_ADDRESS; CLINEA 0000H 0001H 019BH 0008H 0034H mov r0, #01h st r0, NEAR __gsCtrlParam+0fh ;; I20RW = 1; /* Receive mode */ CLINEA 0000H 0001H 019CH 0008H 0025H sb 0f2a1h.0 ;; I20RS = 1; /* Restart condition */ CLINEA 0000H 0001H 019DH 0008H 002AH sb 0f2a3h.2 CBLOCKEND 4 19 414 ;; else{/* send mode */ CLINEA 0000H 0001H 019FH 0007H 001AH bal _$L79 _$L77 : CBLOCK 4 20 415 ;; _gsCtrlParam.status = I2C_SEND_DATA; CLINEA 0000H 0001H 01A0H 0008H 002BH mov r0, #03h st r0, NEAR __gsCtrlParam+0fh ;; I2C0TD = (unsigned char)*_gsCtrlParam.data; CLINEA 0000H 0001H 01A1H 0008H 0032H l bp, NEAR __gsCtrlParam+06h l r0, [bp] st r0, 0f2a2h ;; _gsCtrlParam.data++; CLINEA 0000H 0000H 01A2H 0008H 001BH mov er0, bp add er0, #1 st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.cnt++; CLINEA 0000H 0000H 01A3H 0008H 001AH l er0, NEAR __gsCtrlParam+0ah add er0, #1 st er0, NEAR __gsCtrlParam+0ah ;; I2C0CON = (unsigned char)I2C0CON_I20ST; CLINEA 0000H 0001H 01A4H 0008H 002EH mov r0, #01h st r0, 0f2a3h CBLOCKEND 4 20 421 ;; } CLINEA 0000H 0000H 01A5H 0007H 0007H _$L79 : CBLOCKEND 4 18 422 CBLOCKEND 4 16 423 CBLOCKEND 4 17 473 CBLOCKEND 4 14 424 CBLOCKEND 4 15 473 ;; return ( I2C_R_TRANS_CONT_OK ); CLINEA 0000H 0001H 01A9H 0004H 0022H mov er0, #0 b _$L44 CBLOCKEND 4 13 473 ;; case I2C_SEND_DATA: CLINEA 0000H 0001H 01ABH 0003H 0015H _$L80 : ;; if((i2c0stat&I2C0STAT_I20ACR) == I2C0STAT_I20ACR){ CLINEA 0000H 0001H 01ACH 0004H 0035H mov r0, r1 and r0, #02h cmp r0, #02h bne _$L81 CBLOCK 4 21 428 ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 01ADH 0005H 0028H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; _gsCtrlParam.errStat = I2C_ERR_ACR; CLINEA 0000H 0001H 01AEH 0005H 0027H mov r0, #01h st r0, NEAR __gsCtrlParam+0eh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 01AFH 0005H 0040H mov r0, #02h ;; else if( _gsCtrlParam.data_size != _gsCtrlParam.cnt ){ CLINEA 0000H 0001H 01B1H 0004H 0039H bal _$L86 _$L81 : l er0, NEAR __gsCtrlParam+08h l er2, NEAR __gsCtrlParam+0ah cmp er0, er2 beq _$L84 CBLOCK 4 22 433 ;; I2C0TD = (unsigned char)*_gsCtrlParam.data; CLINEA 0000H 0001H 01B2H 0005H 002FH l bp, NEAR __gsCtrlParam+06h l r0, [bp] st r0, 0f2a2h ;; _gsCtrlParam.data++; CLINEA 0000H 0000H 01B3H 0005H 0018H mov er0, bp add er0, #1 st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.cnt++; CLINEA 0000H 0000H 01B4H 0005H 0017H mov er0, er2 add er0, #1 st er0, NEAR __gsCtrlParam+0ah ;; I2C0CON = (unsigned char)I2C0CON_I20ST; CLINEA 0000H 0001H 01B5H 0005H 002BH mov r0, #01h CBLOCKEND 4 22 438 ;; else{ CLINEA 0000H 0001H 01B7H 0004H 0008H bal _$L86 _$L84 : CBLOCK 4 23 439 ;; _gsCtrlParam.status = (unsigned char)I2C_TRANS_END; CLINEA 0000H 0001H 01B8H 0005H 0037H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 01BAH 0005H 0040H mov r0, #02h CBLOCKEND 4 23 443 ;; } CLINEA 0000H 0000H 01BBH 0004H 0004H _$L86 : st r0, 0f2a3h ;; return ( I2C_R_TRANS_CONT_OK ); CLINEA 0000H 0001H 01BCH 0004H 0022H mov er0, #0 b _$L44 CBLOCKEND 4 21 473 ;; case I2C_RECEIVE_DATA: CLINEA 0000H 0001H 01BEH 0003H 0018H _$L87 : ;; *_gsCtrlParam.data = I2C0RD; CLINEA 0000H 0001H 01BFH 0004H 001FH l bp, NEAR __gsCtrlParam+06h l r0, 0f2a0h st r0, [bp] ;; _gsCtrlParam.data++; CLINEA 0000H 0000H 01C0H 0004H 0017H l er0, NEAR __gsCtrlParam+06h add er0, #1 st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.cnt++; CLINEA 0000H 0000H 01C1H 0004H 0016H l er0, NEAR __gsCtrlParam+0ah add er0, #1 st er0, NEAR __gsCtrlParam+0ah ;; if( _gsCtrlParam.data_size != _gsCtrlParam.cnt ){ CLINEA 0000H 0001H 01C2H 0004H 0034H l er0, NEAR __gsCtrlParam+08h l er2, NEAR __gsCtrlParam+0ah cmp er0, er2 beq _$L88 CBLOCK 4 24 450 ;; setbit = (unsigned char)I2C0CON_I20ST; CLINEA 0000H 0001H 01C3H 0005H 002AH mov r4, #01h ;; if( ( _gsCtrlParam.data_size - 1) == _gsCtrlParam.cnt ){ CLINEA 0000H 0001H 01C4H 0005H 003CH add er0, #-1 cmp er0, er2 bne _$L90 CBLOCK 4 25 452 ;; setbit |= (unsigned char)I2C0CON_I20ACT; CLINEA 0000H 0001H 01C5H 0006H 002DH mov r4, #081h CBLOCKEND 4 25 454 ;; } CLINEA 0000H 0000H 01C6H 0005H 0005H _$L90 : ;; I2C0CON = setbit; CLINEA 0000H 0001H 01C7H 0005H 0015H st r4, 0f2a3h CBLOCKEND 4 24 456 ;; else{ CLINEA 0000H 0001H 01C9H 0004H 0008H bal _$L92 _$L88 : CBLOCK 4 26 457 ;; _gsCtrlParam.status = (unsigned char)I2C_TRANS_END; CLINEA 0000H 0001H 01CAH 0005H 0037H mov r0, #00h st r0, NEAR __gsCtrlParam+0fh ;; I2C0CON = (unsigned char)I2C0CON_I20SP; /* Stop condition */ CLINEA 0000H 0001H 01CBH 0005H 0040H mov r0, #02h st r0, 0f2a3h CBLOCKEND 4 26 460 ;; } CLINEA 0000H 0000H 01CCH 0004H 0004H _$L92 : ;; return(I2C_R_TRANS_CONT_OK); CLINEA 0000H 0001H 01CDH 0004H 001FH mov er0, #0 b _$L44 CBLOCKEND 4 1 473 CFUNCTIONEND 4 rseg $$i2c_stop$i2c CFUNCTION 5 _i2c_stop : CBLOCK 5 1 483 ;;{ CLINEA 0000H 0001H 01E3H 0001H 0001H CBLOCK 5 2 483 ;; I20ST = 0; CLINEA 0000H 0001H 01E4H 0002H 000BH rb 0f2a3h.0 ;; _gsCtrlParam.mode = 0; CLINEA 0000H 0001H 01E5H 0002H 0018H mov r0, #00h st r0, NEAR __gsCtrlParam ;; _gsCtrlParam.addr = (void *)0; CLINEA 0000H 0001H 01E6H 0002H 0020H mov er0, #0 st er0, NEAR __gsCtrlParam+02h ;; _gsCtrlParam.addr_size = 0; CLINEA 0000H 0001H 01E7H 0002H 001CH st er0, NEAR __gsCtrlParam+04h ;; _gsCtrlParam.data = (void *)0; CLINEA 0000H 0001H 01E8H 0002H 0020H st er0, NEAR __gsCtrlParam+06h ;; _gsCtrlParam.data_size = 0; CLINEA 0000H 0001H 01E9H 0002H 001CH st er0, NEAR __gsCtrlParam+08h ;; _gsCtrlParam.cnt = 0; CLINEA 0000H 0001H 01EAH 0002H 0017H st er0, NEAR __gsCtrlParam+0ah ;; _gsCtrlParam.callBack = (void *)0; CLINEA 0000H 0001H 01EBH 0002H 0023H st er0, NEAR __gsCtrlParam+0ch ;; _gsCtrlParam.errStat = 0; CLINEA 0000H 0001H 01ECH 0002H 001AH st r0, NEAR __gsCtrlParam+0eh ;; _gsCtrlParam.status = I2C_TRANS_END; CLINEA 0000H 0001H 01EDH 0002H 0026H st r0, NEAR __gsCtrlParam+0fh CBLOCKEND 5 2 494 ;;} CLINEA 0000H 0001H 01EEH 0001H 0001H rt CBLOCKEND 5 1 494 CFUNCTIONEND 5 rseg $$i2c_checkIRQ$i2c CFUNCTION 6 _i2c_checkIRQ : CBLOCK 6 1 506 ;;{ CLINEA 0000H 0001H 01FAH 0001H 0001H CBLOCK 6 2 506 CLOCAL 46H 0001H 0014H 0002H "qua0" 02H 00H 00H CLOCAL 47H 0002H 0024H 0002H "ret" 02H 00H 01H ;; qua0 = (unsigned char)( IRQ2 & (unsigned char)IRQ2_QI2C0 ); CLINEA 0000H 0001H 01FEH 0002H 003CH l r0, 0f01ah and r0, #080h ;; if( qua0 == (unsigned char)IRQ2_QI2C0 ){ CLINEA 0000H 0001H 01FFH 0002H 0029H cmp r0, #080h bne _$L98 CBLOCK 6 3 511 ;; ret = ( I2C_R_IRQ ); CLINEA 0000H 0001H 0200H 0003H 0016H mov er0, #1 CBLOCKEND 6 3 513 ;; else{ CLINEA 0000H 0001H 0202H 0002H 0006H rt _$L98 : CBLOCK 6 4 514 ;; ret = ( I2C_R_NON_IRQ ); CLINEA 0000H 0001H 0203H 0003H 001AH mov er0, #0 CBLOCKEND 6 4 516 ;; return ret; CLINEA 0000H 0001H 0206H 0002H 000CH CBLOCKEND 6 2 519 ;;} CLINEA 0000H 0000H 0207H 0001H 0001H rt CBLOCKEND 6 1 519 CFUNCTIONEND 6 rseg $$i2c_clearIRQ$i2c CFUNCTION 7 _i2c_clearIRQ : CBLOCK 7 1 529 ;;{ CLINEA 0000H 0001H 0211H 0001H 0001H CBLOCK 7 2 529 ;; QI2CM = 0; CLINEA 0000H 0001H 0215H 0002H 000BH rb 0f01ah.7 CBLOCKEND 7 2 535 ;;} CLINEA 0000H 0001H 0217H 0001H 0001H rt CBLOCKEND 7 1 535 CFUNCTIONEND 7 rseg $$i2c_getTransSize$i2c CFUNCTION 8 _i2c_getTransSize : CBLOCK 8 1 546 ;;{ CLINEA 0000H 0001H 0222H 0001H 0001H CBLOCK 8 2 546 ;; return _gsCtrlParam.cnt; CLINEA 0000H 0001H 0223H 0002H 0019H l er0, NEAR __gsCtrlParam+0ah CBLOCKEND 8 2 548 ;;} CLINEA 0000H 0000H 0224H 0001H 0001H rt CBLOCKEND 8 1 548 CFUNCTIONEND 8 public _i2c_getTransSize public _i2c_stop public _i2c_startReceive public _i2c_continue public _i2c_startSend public _i2c_init public _i2c_clearIRQ public _i2c_checkIRQ extrn code near : _main rseg $$NINITTAB db 00h align dw 00h dw 00h dw 00h dw 00h dw 00h dw 00h db 00h db 00h rseg $$NINITVAR __gsCtrlParam : ds 010h extrn code : __uidivu8sw end
data/mapObjects/PokemonMansion1F.asm
AmateurPanda92/pokemon-rby-dx
9
88574
PokemonMansion1F_Object: db $2e ; border block db 8 ; warps warp 4, 27, 0, -1 warp 5, 27, 0, -1 warp 6, 27, 0, -1 warp 7, 27, 0, -1 warp 5, 10, 0, POKEMON_MANSION_2F warp 21, 23, 0, POKEMON_MANSION_B1F warp 26, 27, 0, -1 warp 27, 27, 0, -1 db 0 ; signs db 3 ; objects object SPRITE_OAK_AIDE, 17, 17, STAY, LEFT, 1, OPP_SCIENTIST, 4 object SPRITE_BALL, 14, 3, STAY, NONE, 2, ESCAPE_ROPE object SPRITE_BALL, 18, 21, STAY, NONE, 3, CARBOS ; warp-to warp_to 4, 27, POKEMON_MANSION_1F_WIDTH warp_to 5, 27, POKEMON_MANSION_1F_WIDTH warp_to 6, 27, POKEMON_MANSION_1F_WIDTH warp_to 7, 27, POKEMON_MANSION_1F_WIDTH warp_to 5, 10, POKEMON_MANSION_1F_WIDTH ; POKEMON_MANSION_2F warp_to 21, 23, POKEMON_MANSION_1F_WIDTH ; POKEMON_MANSION_B1F warp_to 26, 27, POKEMON_MANSION_1F_WIDTH warp_to 27, 27, POKEMON_MANSION_1F_WIDTH
programs/oeis/187/A187318.asm
neoneye/loda
22
85866
; A187318: a(n) = floor(9*n/5). ; 0,1,3,5,7,9,10,12,14,16,18,19,21,23,25,27,28,30,32,34,36,37,39,41,43,45,46,48,50,52,54,55,57,59,61,63,64,66,68,70,72,73,75,77,79,81,82,84,86,88,90,91,93,95,97,99,100,102,104,106,108,109,111,113,115,117,118,120,122,124,126,127,129,131,133,135,136,138,140,142,144,145,147,149 mul $0,9 div $0,5
src/main/antlr4/thosakwe/fray/grammar/FrayInterpolation.g4
thosakwe/fray
2
2540
<reponame>thosakwe/fray grammar FrayInterpolation; SIMPLE_STRING: ((~'%')|('\\%'))+; ID_STRING: '%' [A-Za-z_] [A-Za-z0-9_]*; COMPLEX_STRING: '%{' ~('}'|'\n')* '}'; string: interpolationElement*; interpolationElement: SIMPLE_STRING #NoInterpolation | ID_STRING #IdentifierInterpolation | COMPLEX_STRING #ComplexInterpolation ;
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_21829_820.asm
ljhsiun2/medusa
9
100605
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x10bb9, %r9 dec %r13 movl $0x61626364, (%r9) nop nop nop nop nop add $40146, %rbp lea addresses_A_ht+0x1beb9, %r14 nop nop nop add %r10, %r10 movl $0x61626364, (%r14) nop add $41828, %r14 lea addresses_A_ht+0x5ff9, %rbp nop nop nop nop nop add $18238, %r10 vmovups (%rbp), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r9 nop nop nop nop nop sub $849, %rbp lea addresses_D_ht+0x14cb9, %r9 clflush (%r9) dec %r14 mov $0x6162636465666768, %rbp movq %rbp, %xmm5 and $0xffffffffffffffc0, %r9 vmovntdq %ymm5, (%r9) nop nop nop nop sub %r13, %r13 lea addresses_D_ht+0xa1b9, %r14 nop sub $63081, %rbx movb $0x61, (%r14) nop nop nop nop inc %r9 lea addresses_UC_ht+0xb679, %rsi lea addresses_D_ht+0x9cb9, %rdi sub %r8, %r8 mov $82, %rcx rep movsb nop nop nop nop nop xor %r13, %r13 lea addresses_WC_ht+0x17e39, %r9 nop nop add $32545, %rdi movb $0x61, (%r9) nop add %r8, %r8 lea addresses_WT_ht+0x41b9, %rdi nop nop nop nop nop cmp $63901, %rsi mov (%rdi), %r8d nop nop add %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %r9 push %rbx push %rdx // Store lea addresses_normal+0x2239, %r10 nop and $13503, %rdx mov $0x5152535455565758, %r9 movq %r9, (%r10) nop nop nop and $13092, %r10 // Load lea addresses_WC+0x12d39, %r11 nop nop cmp $24742, %r10 movb (%r11), %r12b nop nop nop nop and $23358, %r9 // Faulty Load lea addresses_US+0x71b9, %rdx clflush (%rdx) nop nop nop nop and %r15, %r15 mov (%rdx), %r12 lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rdx pop %rbx pop %r9 pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 4}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}} {'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 */
PRG/objects/7-F1.asm
narfman0/smb3_pp1
0
83637
<reponame>narfman0/smb3_pp1<gh_stars>0 .byte $00 ; Unknown purpose .byte OBJ_PSWITCHDOOR, $0C, $0B .byte OBJ_BOOMBOOMFLY, $6C, $17 .byte $FF ; Terminator
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_18093_1621.asm
ljhsiun2/medusa
9
170802
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r8 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x1947c, %rsi lea addresses_UC_ht+0x171fc, %rdi dec %rbp mov $31, %rcx rep movsl nop nop nop nop sub %rsi, %rsi lea addresses_normal_ht+0x13a42, %rsi lea addresses_D_ht+0x145fc, %rdi clflush (%rsi) nop nop nop nop add %r8, %r8 mov $1, %rcx rep movsl nop nop nop sub $62555, %rdi lea addresses_WC_ht+0x177fc, %rsi nop nop nop nop nop sub %rdi, %rdi movb (%rsi), %cl nop nop nop nop xor $14997, %r8 lea addresses_UC_ht+0x15c18, %rsi lea addresses_WT_ht+0x197fc, %rdi nop xor $29357, %rbp mov $98, %rcx rep movsb nop nop nop sub %r8, %r8 lea addresses_WC_ht+0x37fc, %r10 nop nop nop nop nop add %rbx, %rbx mov (%r10), %r8 nop nop nop nop cmp %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r9 push %rbp push %rbx push %rdx push %rsi // Load lea addresses_normal+0x5bfc, %rbp nop nop dec %r9 movb (%rbp), %dl // Exception!!! nop mov (0), %r12 nop nop nop nop nop add $22249, %rsi // Faulty Load lea addresses_US+0x17fc, %r12 nop nop nop nop nop cmp $6760, %rbx mov (%r12), %dx lea oracles, %rsi and $0xff, %rdx shlq $12, %rdx mov (%rsi,%rdx,1), %rdx pop %rsi pop %rdx pop %rbx pop %rbp pop %r9 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}} {'00': 18093} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Working Disassembly/Levels/Misc/Object list - Sonic & Knuckles.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
0
12041
dc.l Obj_Ring ; 0 dc.l Obj_Monitor ; 1 dc.l Obj_PathSwap ; 2 dc.l Obj_03_2 ; 3 dc.l Obj_CollapsingPlatform; 4 dc.l Obj_AIZLRZEMZRock ; 5 dc.l Obj_MHZPulleyLift ; 6 dc.l Obj_Spring ; 7 dc.l Obj_Spikes ; 8 dc.l Obj_MHZCurledVine ; 9 dc.l Obj_MHZStickyVine ; 10 dc.l Obj_MHZSwingBarHorizontal; 11 dc.l Obj_MHZSwingBarVertical; 12 dc.l Obj_BreakableWall ; 13 dc.l Obj_0E ; 14 dc.l Obj_CollapsingBridge; 15 dc.l Obj_MHZSwingVine ; 16 dc.l Obj_MHZMushroomPlatform; 17 dc.l Obj_MHZMushroomParachute; 18 dc.l Obj_MHZMushroomCatapult; 19 dc.l Obj_14_2 ; 20 dc.l Obj_15_2 ; 21 dc.l Obj_16_2 ; 22 dc.l Obj_LRZSinkingRock ; 23 dc.l Obj_LRZFallingSpike; 24 dc.l Obj_LRZDoor ; 25 dc.l Obj_LRZBigDoor ; 26 dc.l Obj_LRZFireballLauncher; 27 dc.l Obj_LRZButtonHorizontal; 28 dc.l Obj_LRZShootingTrigger; 29 dc.l Obj_LRZDashElevator; 30 dc.l Obj_LRZLavaFall ; 31 dc.l Obj_LRZSwingingSpikeBall; 32 dc.l Obj_LRZSmashingSpikePlatform; 33 dc.l Obj_LRZSpikeBall ; 34 dc.l Obj_MHZMushroomCap ; 35 dc.l Obj_AutomaticTunnel ; 36 dc.l Obj_LRZChainedPlatforms; 37 dc.l Obj_26 ; 38 dc.l Obj_27 ; 39 dc.l Obj_28_Invisible_Barrier; 40 dc.l Obj_LRZFlameThrower; 41 dc.l Obj_CorkFloor ; 42 dc.l Obj_LRZOrbitingSpikeBallHorizontal; 43 dc.l Obj_LRZOrbitingSpikeBallVertical; 44 dc.l Obj_LRZSolidMovingPlatforms; 45 dc.l Obj_LRZSolidRock ; 46 dc.l Obj_StillSprite ; 47 dc.l Obj_AnimatedStillSprite; 48 dc.l Obj_LRZCollapsingBridge; 49 dc.l Obj_LRZTurbineSprites; 50 dc.l Obj_Button ; 51 dc.l Obj_StarPost ; 52 dc.l Obj_AIZForegroundPlant; 53 dc.l Obj_BreakableBar ; 54 dc.l Obj_LRZSpikeBallLauncher; 55 dc.l Obj_38_2 ; 56 dc.l Obj_SOZSpawningSandBlocks; 57 dc.l Obj_3A_2 ; 58 dc.l Obj_3B_2 ; 59 dc.l Obj_Door ; 60 dc.l Obj_RetractingSpring; 61 dc.l Obj_SOZPushableRock; 62 dc.l Obj_SOZSpringVine ; 63 dc.l Obj_SOZRisingSandWall; 64 dc.l Obj_SOZLightSwitch ; 65 dc.l Obj_SOZFloatingPillar; 66 dc.l Obj_SOZSwingingPlatform; 67 dc.l Obj_SOZBreakableSandRock; 68 dc.l Obj_SOZPushSwitch ; 69 dc.l Obj_SOZDoor ; 70 dc.l Obj_SOZSandCork ; 71 dc.l Obj_SOZRapelWire ; 72 dc.l Obj_SOZSolidSprites; 73 dc.l Obj_DEZFloatingPlatform; 74 dc.l Obj_TiltingBridge ; 75 dc.l Obj_DEZHangCarrier ; 76 dc.l Obj_DEZTorpedoLauncher; 77 dc.l Obj_DEZLiftPad ; 78 dc.l Obj_DEZStaircase ; 79 dc.l Obj_50_2 ; 80 dc.l Obj_FloatingPlatform; 81 dc.l Obj_DEZLightning ; 82 dc.l Obj_DEZConveyorPad ; 83 dc.l Obj_Bubbler ; 84 dc.l Obj_DEZEnergyBridge; 85 dc.l Obj_56_2 ; 86 dc.l Obj_DEZTunnelLauncher; 87 dc.l Obj_DEZGravitySwitch; 88 dc.l Obj_59_2 ; 89 dc.l Obj_5A_2 ; 90 dc.l Obj_5B_2 ; 91 dc.l Obj_5C_2 ; 92 dc.l Obj_DEZRetractingSpring; 93 dc.l Obj_DEZHoverMachine; 94 dc.l Obj_5F_2 ; 95 dc.l Obj_DEZBumperWall ; 96 dc.l Obj_DEZGravityPuzzle; 97 dc.l Obj_Ring ; 98 dc.l Obj_Ring ; 99 dc.l Obj_Ring ; 100 dc.l Obj_Ring ; 101 dc.l Obj_Ring ; 102 dc.l Obj_Ring ; 103 dc.l Obj_Ring ; 104 dc.l Obj_Ring ; 105 dc.l Obj_InvisibleHurtBlockHorizontal; 106 dc.l Obj_InvisibleHurtBlockVertical; 107 dc.l Obj_TensionBridge ; 108 dc.l Obj_6D_2 ; 109 dc.l Obj_6E_2 ; 110 dc.l Obj_Ring ; 111 dc.l Obj_Ring ; 112 dc.l Obj_Ring ; 113 dc.l Obj_Ring ; 114 dc.l Obj_Ring ; 115 dc.l Obj_SSZRetractingSpring; 116 dc.l Obj_SSZSwingingCarrier; 117 dc.l Obj_SSZRotatingPlatform; 118 dc.l Obj_77_2 ; 119 dc.l Obj_FBZDEZPlayerLauncher; 120 dc.l Obj_SSZHPZTeleporter; 121 dc.l Obj_SSZElevatorBar ; 122 dc.l Obj_SSZCollapsingBridgeDiagonal; 123 dc.l Obj_SSZCollapsingBridge; 124 dc.l Obj_SSZBouncyCloud; 125 dc.l Obj_SSZCollapsingColumn; 126 dc.l Obj_SSZFloatingPlatform; 127 dc.l Obj_HiddenMonitor ; 128 dc.l Obj_81 ; 129 dc.l Obj_CutsceneKnuckles ; 130 dc.l Obj_83 ; 131 dc.l Obj_84 ; 132 dc.l Obj_SSEntryRing ; 133 dc.l Obj_86 ; 134 dc.l Obj_87 ; 135 dc.l Obj_88 ; 136 dc.l Obj_89 ; 137 dc.l Obj_8A ; 138 dc.l Obj_8B ; 139 dc.l Obj_Madmole ; 140 dc.l Obj_Mushmeanie ; 141 dc.l Obj_Dragonfly ; 142 dc.l Obj_Butterdroid ; 143 dc.l Obj_Cluckoid ; 144 dc.l Obj_91_2 ; 145 dc.l Obj_MHZ_Miniboss ; 146 dc.l Obj_MHZ_EndBoss ; 147 dc.l Obj_Skorp ; 148 dc.l Obj_Sandworm ; 149 dc.l Obj_Rockn ; 150 dc.l Obj_SOZ_Miniboss ; 151 dc.l Obj_SOZ_EndBoss ; 152 dc.l Obj_Fireworm ; 153 dc.l Obj_LRZExplodingRock; 154 dc.l Obj_Toxomister ; 155 dc.l Obj_LRZRockCrusher ; 156 dc.l Obj_LRZ_Miniboss ; 157 dc.l Obj_9E_2 ; 158 dc.l Obj_Ring ; 159 dc.l Obj_EggRobo ; 160 dc.l Obj_SSZGHZBoss ; 161 dc.l Obj_SSZMTZBoss ; 162 dc.l Obj_A3_2 ; 163 dc.l Obj_Spikebonker ; 164 dc.l Obj_Chainspike ; 165 dc.l Obj_DEZ_Miniboss ; 166 dc.l Obj_DEZ_EndBoss ; 167 dc.l Obj_A8_2 ; 168 dc.l Obj_A9_2 ; 169 dc.l Obj_SOZ_Ghosts ; 170 dc.l Obj_AB_2 ; 171 dc.l Obj_AC_2_SOZ2_Ghost_Capsule; 172 dc.l Obj_AD_2 ; 173 dc.l Obj_AE_2 ; 174 dc.l Obj_AF_2 ; 175 dc.l Obj_B0_2 ; 176 dc.l Obj_B1_2 ; 177 dc.l Obj_B2_2 ; 178 dc.l Obj_B3_2 ; 179 dc.l Obj_B4_2 ; 180 dc.l Obj_B5_2 ; 181 dc.l Obj_B6_2 ; 182 dc.l Obj_DDZAsteroid ; 183 dc.l Obj_DDZMissile ; 184
oeis/142/A142774.asm
neoneye/loda-programs
11
99933
; A142774: Primes congruent to 47 mod 59. ; Submitted by <NAME> ; 47,283,401,991,1109,1699,2053,2879,3469,3823,4177,4649,5003,5711,6301,7127,7481,7717,8543,8779,9133,10313,10667,10903,11257,12437,12791,13381,13499,14207,14561,14797,15269,15859,16567,16921,17393,17747,18691,19163,19753,20107,21169,21523,22349,23057,23293,24001,24473,24709,25771,25889,26479,26597,26833,26951,27541,28603,29311,29429,30137,30491,30727,31081,31907,32143,32261,32497,32969,34031,34267,34739,35447,35801,36037,37217,37571,39341,40639,40993,42409,43117,43943,44179,44533,44651,44887 mov $1,23 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,59 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,117
src/center.applescript
XReyRobert/termtile
1,450
2164
on run argv global _cache set _cache to {} set ScreenUtils to load script alias ((path to me as text) & "::screenUtils.scpt") set _config to run script alias ((path to me as text) & "::config.scpt") set _terminalApp to terminalApp of _config try tell ScreenUtils to set _screen to getScreenWithFrontmostWindowOfApp(_terminalApp) on error return end try using terms from application "Terminal" tell application _terminalApp -- Terminal is kind of wierd if _terminalApp = "Terminal" set originY of _screen to 23 end if set _bounds to bounds of window 0 set _windowWidth to (item 3 of _bounds) - (item 1 of _bounds) set _windowHeight to (item 4 of _bounds) - (item 2 of _bounds) set _upperW to (originX of _screen) + ((width of _screen) - _windowWidth) / 2 set _upperH to (originY of _screen) + ((height of _screen) - _windowHeight) / 2 set _lowerW to _upperW + _windowWidth set _lowerH to _upperH + _windowHeight set bounds of window 0 to {_upperW, _upperH, _lowerW, _lowerH} end tell end using terms from end run
contrib/ayacc/src/str_pack.adb
faelys/gela-asis
4
30089
package body STR_Pack is SCCS_ID : constant String := "@(#) str_pack.ada, Version 1.2"; Rcs_ID : constant String := "$Header: str_pack.a,v 0.1 86/04/01 15:13:01 ada Exp $"; function Upper_Case (S : in STR) return STR is Upper_STR : STR (S.Name'Length) := S; begin for I in 1..S.Length loop if S.Name(I) in 'a'..'z' then Upper_STR.Name(I) := Character'Val(Character'Pos(S.Name(I)) - Character'Pos('a') + Character'Pos('A')); end if; end loop; return Upper_STR; end Upper_Case; function Lower_Case (S : in STR) return STR is Lower_STR : STR (S.Name'Length) := S; begin for I in 1..S.Length loop if S.Name(I) in 'A'..'Z' then Lower_STR.Name(I) := Character'Val(Character'Pos(S.Name(I)) - Character'Pos('A') + Character'Pos('a')); end if; end loop; return Lower_STR; end Lower_Case; procedure Upper_Case(S: in out STR) is begin S := Upper_Case (S); end Upper_Case; procedure Lower_Case(S: in out STR) is begin S := Lower_Case (S); end Lower_Case; procedure Assign (Value: in STR; To: in out STR) is begin To := Value; end Assign; procedure Assign (Value: in String; To: in out STR) is begin To.Name(1..Value'Length) := Value; To.Length := Value'Length; end Assign; procedure Assign (Value: in Character; To: in out STR) is begin To.Name(1) := Value; To.Length := 1; end Assign; procedure Append (Tail: in STR; To: in out STR) is F, L : Natural; begin F := To.Length + 1; L := F + Tail.Length - 1; To.Name(F..L) := Tail.Name(1..Tail.Length); To.Length := L; end Append; procedure Append (Tail: in String; To: in out STR) is F, L: Natural; begin F := To.Length + 1; L := F + Tail'Length - 1; To.Name(F .. L) := Tail; To.Length := L; end Append; procedure Append (Tail: in Character; To: in out STR) is begin To.Length := To.Length + 1; To.Name(To.Length) := Tail; end Append; function Length_of(S: STR) return Integer is begin return S.Length; end Length_of; function Value_of(S: STR) return String is begin return S.Name(1..S.Length); end Value_of; function Is_Empty(S: STR) return Boolean is begin return S.Length = 0; end Is_Empty; end STR_Pack;
programs/oeis/156/A156040.asm
neoneye/loda
22
102434
<filename>programs/oeis/156/A156040.asm ; A156040: Number of compositions (ordered partitions) of n into 3 parts (some of which may be zero), where the first is at least as great as each of the others. ; 1,1,3,4,6,8,11,13,17,20,24,28,33,37,43,48,54,60,67,73,81,88,96,104,113,121,131,140,150,160,171,181,193,204,216,228,241,253,267,280,294,308,323,337,353,368,384,400,417,433,451,468,486,504,523,541,561,580,600,620,641,661,683,704,726,748,771,793,817,840,864,888,913,937,963,988,1014,1040,1067,1093,1121,1148,1176,1204,1233,1261,1291,1320,1350,1380,1411,1441,1473,1504,1536,1568,1601,1633,1667,1700 add $0,2 pow $0,2 mov $1,2 add $1,$0 div $1,6 mov $0,$1
third_party/antlr_grammars_v4/less/LessLexer.g4
mikhan808/rsyntaxtextarea-antlr4-extension
4
4797
<reponame>mikhan808/rsyntaxtextarea-antlr4-extension<gh_stars>1-10 /* [The "MIT License"] Copyright (c) 2014 <NAME> All rights reserved. */ lexer grammar LessLexer; NULL : 'null' ; IN : 'in' ; Unit : ('%' | 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc' | 'em' | 'ex' | 'deg' | 'rad' | 'grad' | 'ms' | 's' | 'hz' | 'khz') ; Ellipsis : '...' ; InterpolationStart : AT BlockStart -> pushMode (IDENTIFY) ; //Separators LPAREN : '(' ; RPAREN : ')' ; BlockStart : '{' ; BlockEnd : '}' ; LBRACK : '[' ; RBRACK : ']' ; GT : '>' ; TIL : '~' ; LT : '<' ; COLON : ':' ; SEMI : ';' ; COMMA : ',' ; DOT : '.' ; DOLLAR : '$' ; AT : '@' ; PARENTREF : '&' ; HASH : '#' ; COLONCOLON : '::' ; PLUS : '+' ; TIMES : '*' ; DIV : '/' ; MINUS : '-' ; PERC : '%' ; EQEQ : '==' ; GTEQ : '>=' ; LTEQ : '<=' ; NOTEQ : '!=' ; EQ : '=' ; PIPE_EQ : '|=' ; TILD_EQ : '~=' ; // URLs // http://lesscss.org/features/#variables-feature-urls URL : 'url' ; UrlStart : URL LPAREN -> pushMode (URL_STARTED) ; IMPORT : '@import' ; MEDIA : '@media' ; EXTEND : ':extend' ; IMPORTANT : '!important' ; ARGUMENTS : '@arguments' ; REST : '@rest' ; // Import options // http://lesscss.org/features/#import-options REFERENCE : 'reference' ; INLINE : 'inline' ; LESS : 'less' ; CSS : 'css' ; ONCE : 'once' ; MULTIPLE : 'multiple' ; // Mixin Guards WHEN : 'when' ; NOT : 'not' ; AND : 'and' ; Identifier : (('_' | '.' | 'a' .. 'z' | 'A' .. 'Z' | '\u0100' .. '\ufffe') ('_' | '-' | '.' | 'a' .. 'z' | 'A' .. 'Z' | '\u0100' .. '\ufffe' | '0' .. '9')* | '-' ('_' | '.' | 'a' .. 'z' | 'A' .. 'Z' | '\u0100' .. '\ufffe') ('_' | '-' | '.' | 'a' .. 'z' | 'A' .. 'Z' | '\u0100' .. '\ufffe' | '0' .. '9')*) -> pushMode (IDENTIFY) ; fragment STRING : '"' (~ ('"' | '\n' | '\r'))* '"' | '\'' (~ ('\'' | '\n' | '\r'))* '\'' ; // string literals StringLiteral : STRING ; Number : '-' (('0' .. '9')* '.')? ('0' .. '9') + | (('0' .. '9')* '.')? ('0' .. '9') + ; Color : '#' ('0' .. '9' | 'a' .. 'f' | 'A' .. 'F') + ; // Whitespace -- ignored WS : (' ' | '\t' | '\n' | '\r' | '\r\n') + -> skip ; // Single-line comments SL_COMMENT : '//' (~ ('\n' | '\r'))* ('\n' | '\r' ('\n')?) -> skip ; // multiple-line comments COMMENT : '/*' .*? '*/' -> skip ; FUNCTION_NAME : COLOR | CONVERT | DATA_URI | DEFAULT | UNIT | GET_UNIT | SVG_GRADIENT | ESCAPE | E | FORMAT | REPLACE | LENGTH | EXTRACT | CEIL | FLOOR | PERCENTAGE | ROUND | SQRT | ABS | SIN | ASIN | COS | ACOS | TAN | ATAN | PI | POW | MOD | MIN | MAX | ISNUMBER | ISSTRING | ISCOLOR | ISKEYWORD | ISURL | ISPIXEL | ISEM | ISPERCENTAGE | ISUNIT | RGB | RGBA | ARGB | HSL | HSLA | HSV | HSVA | HUE | SATURATION | LIGHTNESS | HSVHUE | HSVSATURATION | HSVVALUE | RED | GREEN | BLUE | ALPHA | LUMA | LUMINANCE | SATURATE | DESATURATE | LIGHTEN | DARKEN | FADEIN | FADEOUT | FADE | SPIN | MIX | GREYSCALE | CONTRAST | MULTIPLY | SCREEN | OVERLAY | SOFTLIGHT | HARDLIGHT | DIFFERENCE | EXCLUSION | AVERAGE | NEGATION ; // Function reference // Misc http://lesscss.org/functions/#misc-functions COLOR : 'color' ; CONVERT : 'convert' ; DATA_URI : 'data-uri' ; DEFAULT : 'default' ; UNIT : 'unit' ; GET_UNIT : 'get-unit' ; SVG_GRADIENT : 'svg-gradient' ; // String http://lesscss.org/functions/#string-functions ESCAPE : 'escape' ; E : 'e' ; FORMAT : '%' ; REPLACE : 'replace' ; // List http://lesscss.org/functions/#list-functions LENGTH : 'length' ; EXTRACT : 'extract' ; // Math http://lesscss.org/functions/#math-functions CEIL : 'ceil' ; FLOOR : 'floor' ; PERCENTAGE : 'percentage' ; ROUND : 'round' ; SQRT : 'sqrt' ; ABS : 'abs' ; SIN : 'sin' ; ASIN : 'asin' ; COS : 'cos' ; ACOS : 'acos' ; TAN : 'tan' ; ATAN : 'atan' ; PI : 'pi' ; POW : 'pow' ; MOD : 'mod' ; MIN : 'min' ; MAX : 'max' ; // Type http://lesscss.org/functions/#type-functions ISNUMBER : 'isnumber' ; ISSTRING : 'isstring' ; ISCOLOR : 'iscolor' ; ISKEYWORD : 'iskeyword' ; ISURL : 'isurl' ; ISPIXEL : 'ispixel' ; ISEM : 'isem' ; ISPERCENTAGE : 'ispercentage' ; ISUNIT : 'isunit' ; // Color http://lesscss.org/functions/#color-definition RGB : 'rgb' ; RGBA : 'rgba' ; ARGB : 'argb' ; HSL : 'hsl' ; HSLA : 'hsla' ; HSV : 'hsv' ; HSVA : 'hsva' ; // Color channel http://lesscss.org/functions/#color-channel HUE : 'hue' ; SATURATION : 'saturation' ; LIGHTNESS : 'lightness' ; HSVHUE : 'hsvhue' ; HSVSATURATION : 'hsvsaturation' ; HSVVALUE : 'hsvvalue' ; RED : 'red' ; GREEN : 'green' ; BLUE : 'blue' ; ALPHA : 'alpha' ; LUMA : 'luma' ; LUMINANCE : 'luminance' ; // Color operation http://lesscss.org/functions/#color-operations SATURATE : 'saturate' ; DESATURATE : 'desaturate' ; LIGHTEN : 'lighten' ; DARKEN : 'darken' ; FADEIN : 'fadein' ; FADEOUT : 'fadeout' ; FADE : 'fade' ; SPIN : 'spin' ; MIX : 'mix' ; GREYSCALE : 'greyscale' ; CONTRAST : 'contrast' ; // Color blending http://lesscss.org/functions/#color-blending MULTIPLY : 'multiply' ; SCREEN : 'screen' ; OVERLAY : 'overlay' ; SOFTLIGHT : 'softlight' ; HARDLIGHT : 'hardlight' ; DIFFERENCE : 'difference' ; EXCLUSION : 'exclusion' ; AVERAGE : 'average' ; NEGATION : 'negation' ; mode URL_STARTED; UrlEnd : RPAREN -> popMode ; Url : STRING | (~ (')' | '\n' | '\r' | ';')) + ; mode IDENTIFY; BlockStart_ID : BlockStart -> popMode , type (BlockStart) ; SPACE : WS -> popMode , skip ; DOLLAR_ID : DOLLAR -> type (DOLLAR) ; InterpolationStartAfter : InterpolationStart ; InterpolationEnd_ID : BlockEnd -> type (BlockEnd) ; IdentifierAfter : Identifier ; Ellipsis_ID : Ellipsis -> popMode , type (Ellipsis) ; DOT_ID : DOT -> popMode , type (DOT) ; LPAREN_ID : LPAREN -> popMode , type (LPAREN) ; RPAREN_ID : RPAREN -> popMode , type (RPAREN) ; COLON_ID : COLON -> popMode , type (COLON) ; COMMA_ID : COMMA -> popMode , type (COMMA) ; SEMI_ID : SEMI -> popMode , type (SEMI) ;
Categories/FunctorCategory.agda
copumpkin/categories
98
8534
<filename>Categories/FunctorCategory.agda {-# OPTIONS --universe-polymorphism #-} module Categories.FunctorCategory where open import Data.Product open import Categories.Category import Categories.Functor as Cat open import Categories.Functor hiding (equiv; id; _∘_; _≡_) open import Categories.NaturalTransformation open import Categories.Product open import Categories.Square Functors : ∀ {o ℓ e} {o′ ℓ′ e′} → Category o ℓ e → Category o′ ℓ′ e′ → Category _ _ _ Functors C D = record { Obj = Functor C D ; _⇒_ = NaturalTransformation ; _≡_ = _≡_ ; _∘_ = _∘₁_ ; id = id ; assoc = λ {_} {_} {_} {_} {f} {g} {h} → assoc₁ {X = f} {g} {h} ; identityˡ = λ {_} {_} {f} → identity₁ˡ {X = f} ; identityʳ = λ {_} {_} {f} → identity₁ʳ {X = f} ; equiv = λ {F} {G} → equiv {F = F} {G = G} ; ∘-resp-≡ = λ {_} {_} {_} {f} {h} {g} {i} → ∘₁-resp-≡ {f = f} {h} {g} {i} } eval : ∀ {o ℓ e} {o′ ℓ′ e′} {C : Category o ℓ e}{D : Category o′ ℓ′ e′} → Functor (Product (Functors C D) C) D eval {C = C} {D = D} = record { F₀ = λ x → let F , c = x in F₀ F c; F₁ = λ { {F , c₁} {G , c₂} (ε , f) → F₁ G f D.∘ η ε _}; identity = λ { {F , c} → begin F₁ F C.id D.∘ D.id ↓⟨ D.identityʳ ⟩ F₁ F C.id ↓⟨ identity F ⟩ D.id ∎}; homomorphism = λ { {F , c₁} {G , c₂} {H , c₃} {ε₁ , f₁} {ε₂ , f₂} → begin F₁ H (f₂ C.∘ f₁) D.∘ η ε₂ c₁ D.∘ η ε₁ c₁ ↑⟨ D.assoc ⟩ (F₁ H (f₂ C.∘ f₁) D.∘ η ε₂ c₁) D.∘ η ε₁ c₁ ↓⟨ D.∘-resp-≡ˡ (begin F₁ H (C [ f₂ ∘ f₁ ]) D.∘ η ε₂ c₁ ↓⟨ D.∘-resp-≡ˡ (homomorphism H) ⟩ (F₁ H f₂ D.∘ F₁ H f₁) D.∘ η ε₂ c₁ ↓⟨ D.assoc ⟩ F₁ H f₂ D.∘ F₁ H f₁ D.∘ η ε₂ c₁ ↑⟨ D.∘-resp-≡ʳ (commute ε₂ f₁) ⟩ F₁ H f₂ D.∘ η ε₂ c₂ D.∘ F₁ G f₁ ↑⟨ D.assoc ⟩ (F₁ H f₂ D.∘ η ε₂ c₂) D.∘ F₁ G f₁ ∎) ⟩ ((F₁ H f₂ D.∘ η ε₂ c₂) D.∘ F₁ G f₁) D.∘ η ε₁ c₁ ↓⟨ D.assoc ⟩ (F₁ H f₂ D.∘ η ε₂ c₂) D.∘ F₁ G f₁ D.∘ η ε₁ c₁ ∎ }; F-resp-≡ = λ { {F , c₁} {G , c₂} {ε₁ , f₁} {ε₂ , f₂} (ε₁≡ε₂ , f₁≡f₂) → D.∘-resp-≡ (F-resp-≡ G f₁≡f₂) ε₁≡ε₂} } where module C = Category C module D = Category D open Functor open NaturalTransformation open D.HomReasoning Cat[-∘_] : ∀ {o₁ ℓ₁ e₁ o₂ ℓ₂ e₂ o₃ ℓ₃ e₃} {A : Category o₁ ℓ₁ e₁} {B : Category o₂ ℓ₂ e₂} {C : Category o₃ ℓ₃ e₃} -> Functor A B -> Functor (Functors B C) (Functors A C) Cat[-∘_] {C = C} r = record { F₀ = λ X → X Cat.∘ r ; F₁ = λ η → η ∘ʳ r ; identity = C.Equiv.refl ; homomorphism = C.Equiv.refl ; F-resp-≡ = λ x → x } where module C = Category C
org.alloytools.alloy.diff/misc/multiplicities/tests/fieldTest2v1.als
jringert/alloy-diff
1
104
module b2 sig Branch{} sig Branch2{ field2 : Branch } sig Bankv2{ branches: one Branch }
programs/oeis/047/A047286.asm
neoneye/loda
22
19818
; A047286: Numbers that are congruent to {1, 2, 3, 6} mod 7. ; 1,2,3,6,8,9,10,13,15,16,17,20,22,23,24,27,29,30,31,34,36,37,38,41,43,44,45,48,50,51,52,55,57,58,59,62,64,65,66,69,71,72,73,76,78,79,80,83,85,86,87,90,92,93,94,97,99,100,101,104,106,107,108,111,113,114,115,118,120,121,122,125,127,128,129,132,134,135,136,139,141,142,143,146,148,149,150,153,155,156,157,160,162,163,164,167,169,170,171,174 seq $0,47269 ; Numbers that are congruent to {0, 1, 2, 5} mod 6. add $1,$0 div $1,6 add $1,$0 add $1,1 mov $0,$1
translations-methods/lab4/src/main/java/antlr/Generator.g4
Lascor22/ITMO-university
0
710
<filename>translations-methods/lab4/src/main/java/antlr/Generator.g4 grammar Generator; @header { package antlr; import generator.Grammar; import generator.domain.*; } start returns [Grammar g] @init { $g = new Grammar(); }: program[$g] EOF; program[Grammar g]: header[$g] imports[$g] tokens[$g] startState[$g] states[$g]; header[Grammar g]: 'grammar' NAME ';' { $g.setName($NAME.text); }; imports[Grammar g]: '@imp' '{' import_line[$g]* '}'; import_line[Grammar g]: ('import' import_name {$g.addImport($import_name.name.toString());} ';'); import_name returns[StringBuilder name] @init { $name = new StringBuilder(); }: n1=NAME {$name.append($n1.text);} ('.' n2=NAME {$name.append('.').append($n2.text);})*; tokens[Grammar g]: '@tokens' '{' token_line[$g]* '}'; token_line[Grammar g] locals [boolean hasSkip] @init { $hasSkip = false; }: NAME ':' REGEX (skip_attr {$hasSkip = true;})? ';' { if ($hasSkip) { $g.addSkipToken($NAME.text, $REGEX.text); } else { $g.addToken($NAME.text, $REGEX.text); } }; startState[Grammar g]: '@start' '=' NAME ';' { $g.setStartState($NAME.text); }; skip_attr : '->' 'skip'; states[Grammar g]: '@states' '{' (state_line {$g.addState($state_line.state);})+ '}'; state_line returns [State state] @init { $state = new State(); }: NAME {$state.setName($NAME.text);} ('[' parameters_state[$state] ']')? ('returns' '[' returns_state[$state] ']')? ':' r1=rule_line {$state.addRule($r1.r);} ('|' r2=rule_line {$state.addRule($r2.r);})* ';'; parameters_state[State state] : type1=NAME name1=NAME {$state.addParameter($type1.text, $name1.text);} (',' type2=NAME name2=NAME {$state.addParameter($type2.text, $name2.text);})*; returns_state[State state] : type1=NAME name1=NAME {$state.addReturn($type1.text, $name1.text);} (',' type2=NAME name2=NAME {$state.addReturn($type2.text, $name2.text);})*; rule_line returns [Rule r] locals [StringBuilder parameters, StringBuilder code] @init { $r = new Rule(); $parameters = new StringBuilder(); $code = new StringBuilder(); }: (NAME (parameters_rule[$parameters])? (code_block[$code])? {$r.addItem($NAME.text, $parameters.toString(), $code.toString()); $parameters = new StringBuilder(); $code = new StringBuilder();})+; parameters_rule[StringBuilder s] : '[' n1=NAME {$s.append($n1.text);} (',' n2=NAME {$s.append(", ").append($n2.text);})* ']'; code_block[StringBuilder s] : CODE_TEXT { $s.append($CODE_TEXT.text); $s.deleteCharAt(0); $s.deleteCharAt($s.length() - 1); }; WS: [ \t\n]+ -> skip; NAME : [a-zA-Z][a-zA-Z0-9_]*; REGEX : '"' (~('"'))* '"'; CODE_TEXT: '#' (~('#'))+ '#';
commands/apps/ferdi/ferdi-open-service-by-name.applescript
afrazkhan/script-commands
5
1257
<gh_stars>1-10 #!/usr/bin/osascript # Dependency: This script requires Ferdi to be installed: https://getferdi.com/ # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Open Service by Name # @raycast.mode silent # Optional parameters: # @raycast.icon images/ferdi.png # @raycast.packageName Ferdi # @raycast.argument1 { "type": "text", "placeholder": "Name", "optional": true } # Documentation: # @raycast.author <NAME> # @raycast.authorURL https://github.com/jaklan on run argv ### Configuration ### # Delay time before triggering the click (used only when Ferdi needs to be initialised) set clickDelay to 5 ### End of configuration ### if application "Ferdi" is running then do shell script "open -a Ferdi" else do shell script "open -a Ferdi" delay clickDelay end if tell application "System Events" to tell process "Ferdi" if item 1 of argv = "" then click menu item 7 of menu 1 of menu bar item "Services" of menu bar 1 else set serviceNames to name of menu items of menu 1 of menu bar item "Services" of menu bar 1 set serviceNames to items 7 through -1 of serviceNames repeat with serviceName in serviceNames if serviceName contains item 1 of argv then click menu item serviceName of menu 1 of menu bar item "Services" of menu bar 1 exit repeat end if end repeat end if end tell end run
src/grammar/BabaIsYouLexer.g4
HowyoungZhou/baba-is-demo
3
5426
<filename>src/grammar/BabaIsYouLexer.g4 // Baba Is You Lexer // From Baba Is You Wiki under CC-BY-SA // https://babaiswiki.fandom.com/wiki/Baba_Is_You_Wiki lexer grammar BabaIsYouLexer; // Nouns // A ALGAE : A L G A E; ALL : A L L; ANNI : A N N I; // B BABA : B A B A; BAT : B A T; BELT : B E L T; BIRD : B I R D; BOG : B O G; BOLT : B O L T; BOX : B O X; BRICK : B R I C K; BUBBLE : B U B B L E; BUG : B U G; // C CAKE : C A K E; CASH : C A S H; CIRCLE : C I R C L E; CLIFF : C L I F F; CLOUD : C L O U D; COG : C O G; CRAB : C R A B; CRYSTAL : C R Y S T A L; CUP : C U P; CURSOR : C U R S O R; // D DOOR : D O O R; DOT : D O T; DUST : D U S T; // E EMPTY : E M P T Y; EYE : E Y E; // F FENCE : F E N C E; FIRE : F I R E; FLAG : F L A G; FLOWER : F L O W E R; FOLIAGE : F O L I A G E; FOOT : F O O T; FRUIT : F R U I T; FUNGI : F U N G I; FUNGUS : F U N G U S; // G GEM : G E M; GHOST : G H O S T; GRASS : G R A S S; GROUP : G R O U P; // H HAND : H A N D; HEDGE : H E D G E; HUSK : H U S K; HUSKS : H U S K S; // I ICE : I C E; IMAGE : I M A G E; // J JELLY : J E L L Y; // K KEKE : K E K E; KEY : K E Y; // L LADDER : L A D D E R; LAVA : L A V A; LEAF : L E A F; LEVEL : L E V E L; LINE : L I N E; LOVE : L O V E; // M ME : M E; MOON : M O O N; // O ORB : O R B; // P PILLAR : P I L L A R; PIPE : P I P E; // R REED : R E E D; ROBOT : R O B O T; ROCK : R O C K; ROCKET : R O C K E T; ROSE : R O S E; RUBBLE : R U B B L E; // S SHIRT : S H I R T; SIGN : S I G N; SKULL : S K U L L; SPIKE : S P I K E; SQUARE : S Q U A R E; STAR : S T A R; STATUE : S T A T U E; STUMP : S T U M P; SUN : S U N; // T TEXT : T E X T; TILE : T I L E; TRACK : T R A C K; TRAIN : T R A I N; TREE : T R E E; TREES : T R E E S; TRIANGLE : T R I A N G L E; // U UFO : U F O; // W WALL : W A L L; WATER : W A T E R; WORM : W O R M; // Letters A : [aA]; B : [bB]; C : [cC]; D : [dD]; E : [eE]; F : [fF]; G : [gG]; H : [hH]; I : [iI]; J : [jJ]; K : [kK]; L : [lL]; M : [mM]; N : [nN]; O : [oO]; P : [pP]; Q : [qQ]; R : [rR]; S : [sS]; T : [tT]; U : [uU]; V : [vV]; W : [wW]; X : [xX]; Y : [yY]; Z : [zZ]; // Operators // A ABOVE : A B O V E; OP_AND : A N D; // F FACING : F A C I N G; FEAR : F E A R; FOLLOW : F O L L O W; // H HAS : H A S; // I IDLE : I D L E; IS : I S; // L LONELY : L O N E L Y; // M MAKE : M A K E; MIMIC : M I M I C; // N NEAR : N E A R; OP_NOT : N O T; // O ON : O N; // P PLAY : P L A Y; POWERED : P O W E R E D; // S SELDOM : S E L D O M; // W WITHOUT : W I T H O U T; // Properties // B BACK : B A C K; BEST : B E S T; BONUS : B O N U S; BROKEN : B R O K E N; // C CHILL : C H I L L; CRASH : C R A S H; // D DEFEAT : D E F E A T; DETURN : D E T U R N; DONE : D O N E; // E END : E N D; // F FALL : F A L L; P_FLOAT : F L O A T; // H HIDE : H I D E; HOT : H O T; // M MELT : M E L T; P_MORE : M O R E; MOVE : M O V E; // N NUDGE : N U D G E; // O OPEN : O P E N; // P POWER : P O W E R; PULL : P U L L; PUSH : P U S H; // S SAD : S A D; SAFE : S A F E; SELECT : S E L E C T; SHIFT : S H I F T; SHUT : S H U T; SINK : S I N K; SLEEP : S L E E P; STILL : S T I L L; STOP : S T O P; SWAP : S W A P; // T TELE : T E L E; TURN : T U R N; // W WEAK : W E A K; WIN : W I N; WONDER : W O N D E R; WORD : W O R D; // Y YOU : Y O U; YOU2 : Y O U '2'; // Directions UP : U P; DOWN : D O W N; LEFT : L E F T; RIGHT : R I G H T; // Colors ROSY : R O S Y; PINK : P I N K; RED : R E D; ORANGE : O R A N G E; YELLOW : Y E L L O W; LIME : L I M E; GREEN : G R E E N; CYAN : C Y A N; BLUE : B L U E; PURPLE : P U R P L E; BROWN : B R O W N; BLACK : B L A C K; GREY : G R E Y; SILVER : S I L V E R; WHITE : W H I T E; SPACES : [ \u000B\t\r\n] -> channel(HIDDEN) ;
programs/oeis/021/A021088.asm
neoneye/loda
22
243728
; A021088: Decimal expansion of 1/84. ; 0,1,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1 add $0,1 mov $1,10 pow $1,$0 sub $1,6 mul $1,9 div $1,18 add $1,4 div $1,42 mod $1,10 mov $0,$1
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_1782.asm
ljhsiun2/medusa
9
101232
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1bb09, %rcx nop nop nop and %r15, %r15 movw $0x6162, (%rcx) nop nop nop nop nop inc %r8 lea addresses_UC_ht+0x1ed8f, %r12 clflush (%r12) nop nop add $40403, %rdi mov (%r12), %r15w nop nop nop and $12391, %rdi lea addresses_WC_ht+0x1aec9, %rdi sub $38851, %rdx movw $0x6162, (%rdi) xor $13020, %rdx lea addresses_WT_ht+0xa699, %rdx nop nop nop nop sub $54178, %r8 movw $0x6162, (%rdx) add %rcx, %rcx lea addresses_WC_ht+0x12809, %rsi lea addresses_normal_ht+0xee29, %rdi nop nop nop inc %r8 mov $81, %rcx rep movsw nop nop nop nop nop xor %rcx, %rcx lea addresses_normal_ht+0x16709, %r15 nop nop nop nop nop cmp %r12, %r12 mov $0x6162636465666768, %r8 movq %r8, %xmm6 vmovups %ymm6, (%r15) nop nop nop nop and $5852, %r12 lea addresses_D_ht+0x1db09, %rbx nop inc %rcx vmovups (%rbx), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %r8 nop xor $4167, %r15 lea addresses_WT_ht+0x19d09, %rsi nop cmp $45839, %r8 movups (%rsi), %xmm3 vpextrq $1, %xmm3, %rbx nop nop nop add %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %r8 push %r9 push %rbp push %rbx // Load lea addresses_normal+0x5689, %rbx nop xor %rbp, %rbp mov (%rbx), %r9d nop nop nop sub %r15, %r15 // Store lea addresses_PSE+0x9806, %r15 nop cmp $16878, %r10 mov $0x5152535455565758, %r14 movq %r14, %xmm7 vmovups %ymm7, (%r15) nop nop nop nop nop and %rbx, %rbx // Store lea addresses_D+0x2963, %r8 nop nop nop xor $21720, %rbp movb $0x51, (%r8) nop nop nop nop cmp %r9, %r9 // Faulty Load mov $0x7a6c650000000309, %r14 and %r10, %r10 movb (%r14), %r8b lea oracles, %r15 and $0xff, %r8 shlq $12, %r8 mov (%r15,%r8,1), %r8 pop %rbx pop %rbp pop %r9 pop %r8 pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': 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 */
src/main/fragment/mos6502-common/vbuaa_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuxx)_then_la1.asm
jbrandwood/kickc
2
241789
ldy {c2},x cmp {c1},y bcc {la1}
src/test/ref/pointer-pointer-3.asm
jbrandwood/kickc
2
167288
// Tests pointer to pointer in a more complex setup // Commodore 64 PRG executable file .file [name="pointer-pointer-3.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(__start) .label screen1 = $400 .label screen2 = $400+$28 .label screen = 4 .segment Code __start: { // byte* screen = (char*)$400 lda #<$400 sta.z screen lda #>$400 sta.z screen+1 jsr main rts } main: { // setscreen(&screen, screen1) lda #<screen1 sta.z setscreen.val lda #>screen1 sta.z setscreen.val+1 jsr setscreen // screen[0] = 'a' lda #'a' ldy #0 sta (screen),y // setscreen(&screen, screen2) lda #<screen2 sta.z setscreen.val lda #>screen2 sta.z setscreen.val+1 jsr setscreen // screen[0] = 'a' lda #'a' ldy #0 sta (screen),y // } rts } // void setscreen(char **screen, __zp(2) char *val) setscreen: { .label val = 2 // *screen = val lda.z val sta.z @screen lda.z val+1 sta.z @screen+1 // } rts }
old/Structure/Logic/Classical/NaturalDeduction/Proofs.agda
Lolirofle/stuff-in-agda
6
11444
import Structure.Logic.Classical.NaturalDeduction module Structure.Logic.Classical.NaturalDeduction.Proofs {ℓₗ} {Formula} {ℓₘₗ} {Proof} {ℓₒ} {Domain} ⦃ classicLogic : _ ⦄ where open Structure.Logic.Classical.NaturalDeduction.ClassicalLogic {ℓₗ} {Formula} {ℓₘₗ} {Proof} {ℓₒ} {Domain} (classicLogic) open import Functional hiding (Domain) -- TODO: Move the ones which are constructive [↔]-with-[∧]ₗ : ∀{a₁ a₂ b} → Proof(a₁ ⟷ a₂) → Proof((a₁ ∧ b) ⟷ (a₂ ∧ b)) [↔]-with-[∧]ₗ (proof) = ([↔].intro (a₂b ↦ [∧].intro (([↔].elimₗ proof) ([∧].elimₗ a₂b)) ([∧].elimᵣ a₂b)) (a₁b ↦ [∧].intro (([↔].elimᵣ proof) ([∧].elimₗ a₁b)) ([∧].elimᵣ a₁b)) ) [↔]-with-[∧]ᵣ : ∀{a b₁ b₂} → Proof(b₁ ⟷ b₂) → Proof((a ∧ b₁) ⟷ (a ∧ b₂)) [↔]-with-[∧]ᵣ (proof) = ([↔].intro (ab₂ ↦ [∧].intro ([∧].elimₗ ab₂) (([↔].elimₗ proof) ([∧].elimᵣ ab₂))) (ab₁ ↦ [∧].intro ([∧].elimₗ ab₁) (([↔].elimᵣ proof) ([∧].elimᵣ ab₁))) ) [↔]-with-[∧] : ∀{a₁ a₂ b₁ b₂} → Proof(a₁ ⟷ a₂) → Proof(b₁ ⟷ b₂) → Proof((a₁ ∧ b₁) ⟷ (a₂ ∧ b₂)) [↔]-with-[∧] (a₁a₂) (b₁b₂) = ([↔].intro (a₂b₂ ↦ [∧].intro (([↔].elimₗ a₁a₂) ([∧].elimₗ a₂b₂)) (([↔].elimₗ b₁b₂) ([∧].elimᵣ a₂b₂))) (a₁b₁ ↦ [∧].intro (([↔].elimᵣ a₁a₂) ([∧].elimₗ a₁b₁)) (([↔].elimᵣ b₁b₂) ([∧].elimᵣ a₁b₁))) ) [↔]-with-[∨]ₗ : ∀{a₁ a₂ b} → Proof(a₁ ⟷ a₂) → Proof((a₁ ∨ b) ⟷ (a₂ ∨ b)) [↔]-with-[∨]ₗ (proof) = ([↔].intro ([∨].elim([∨].introₗ ∘ ([↔].elimₗ proof)) [∨].introᵣ) ([∨].elim([∨].introₗ ∘ ([↔].elimᵣ proof)) [∨].introᵣ) ) [↔]-with-[∨]ᵣ : ∀{a b₁ b₂} → Proof(b₁ ⟷ b₂) → Proof((a ∨ b₁) ⟷ (a ∨ b₂)) [↔]-with-[∨]ᵣ (proof) = ([↔].intro ([∨].elim [∨].introₗ ([∨].introᵣ ∘ ([↔].elimₗ proof))) ([∨].elim [∨].introₗ ([∨].introᵣ ∘ ([↔].elimᵣ proof))) ) [↔]-with-[∨] : ∀{a₁ a₂ b₁ b₂} → Proof(a₁ ⟷ a₂) → Proof(b₁ ⟷ b₂) → Proof((a₁ ∨ b₁) ⟷ (a₂ ∨ b₂)) [↔]-with-[∨] (a₁a₂) (b₁b₂) = ([↔].intro ([∨].elim ([∨].introₗ ∘ ([↔].elimₗ a₁a₂)) ([∨].introᵣ ∘ ([↔].elimₗ b₁b₂))) ([∨].elim ([∨].introₗ ∘ ([↔].elimᵣ a₁a₂)) ([∨].introᵣ ∘ ([↔].elimᵣ b₁b₂))) ) [↔]-with-[∀] : ∀{f g} → (∀{x} → Proof(f(x) ⟷ g(x))) → Proof((∀ₗ f) ⟷ (∀ₗ g)) [↔]-with-[∀] (proof) = ([↔].intro (allg ↦ [∀].intro(\{x} → [↔].elimₗ (proof{x}) ([∀].elim(allg){x}))) (allf ↦ [∀].intro(\{x} → [↔].elimᵣ (proof{x}) ([∀].elim(allf){x}))) ) [↔]-with-[∃] : ∀{f g} → (∀{x} → Proof(f(x) ⟷ g(x))) → Proof((∃ₗ f) ⟷ (∃ₗ g)) [↔]-with-[∃] (proof) = ([↔].intro ([∃].elim(\{x} → gx ↦ [∃].intro{_}{x}([↔].elimₗ (proof{x}) (gx)))) ([∃].elim(\{x} → fx ↦ [∃].intro{_}{x}([↔].elimᵣ (proof{x}) (fx)))) ) -- [→]-with-[∀] : ∀{p f g} → (∀{x} → Proof(f(x) ⟶ g(x))) → Proof((∀ₗ f) ⟶ (∀ₗ g)) -- [→]-with-[∀] (proof) = -- [→]-with-[∀] : ∀{p f g} → (∀{x} → Proof(f(x) ⟶ g(x))) → Proof(∀ₗ(x ↦ p(x) ⟶ f(x))) → Proof(∀ₗ(x ↦ p(x) ⟶ g(x))) -- [→]-with-[∀] (proof) = [∨][∧]-distributivityₗ : ∀{a b c} → Proof((a ∨ (b ∧ c)) ⟷ (a ∨ b)∧(a ∨ c)) [∨][∧]-distributivityₗ = ([↔].intro (a∨b∧a∨c ↦ ([∨].elim (a ↦ [∨].introₗ a) (b ↦ ([∨].elim (a ↦ [∨].introₗ a) (c ↦ [∨].introᵣ([∧].intro b c)) ([∧].elimᵣ a∨b∧a∨c) ) ) ([∧].elimₗ a∨b∧a∨c) ) ) (a∨b∧c ↦ ([∨].elim (a ↦ [∧].intro([∨].introₗ a)([∨].introₗ a)) (b∧c ↦ [∧].intro([∨].introᵣ([∧].elimₗ b∧c))([∨].introᵣ([∧].elimᵣ b∧c))) (a∨b∧c) ) ) ) [∨][∧]-distributivityᵣ : ∀{a b c} → Proof(((a ∧ b) ∨ c) ⟷ (a ∨ c)∧(b ∨ c)) [∨][∧]-distributivityᵣ = ([↔].intro (a∨c∧b∨c ↦ ([∨].elim (a ↦ ([∨].elim (b ↦ [∨].introₗ([∧].intro a b)) (c ↦ [∨].introᵣ c) ([∧].elimᵣ a∨c∧b∨c) ) ) (c ↦ [∨].introᵣ c) ([∧].elimₗ a∨c∧b∨c) ) ) (a∧b∨c ↦ ([∨].elim (a∧b ↦ [∧].intro([∨].introₗ([∧].elimₗ a∧b))([∨].introₗ([∧].elimᵣ a∧b))) (c ↦ [∧].intro([∨].introᵣ c)([∨].introᵣ c)) (a∧b∨c) ) ) ) [∧][∨]-distributivityₗ : ∀{a b c} → Proof((a ∧ (b ∨ c)) ⟷ (a ∧ b)∨(a ∧ c)) [∧][∨]-distributivityₗ = ([↔].intro (a∧b∨a∧c ↦ ([∨].elim (a∧b ↦ [∧].intro([∧].elimₗ a∧b)([∨].introₗ([∧].elimᵣ a∧b))) (a∧c ↦ [∧].intro([∧].elimₗ a∧c)([∨].introᵣ([∧].elimᵣ a∧c))) (a∧b∨a∧c) ) ) (a∧b∨c ↦ ([∨].elim (b ↦ [∨].introₗ([∧].intro([∧].elimₗ a∧b∨c)(b))) (c ↦ [∨].introᵣ([∧].intro([∧].elimₗ a∧b∨c)(c))) ([∧].elimᵣ a∧b∨c) ) ) ) [∧][∨]-distributivityᵣ : ∀{a b c} → Proof(((a ∨ b) ∧ c) ⟷ (a ∧ c)∨(b ∧ c)) [∧][∨]-distributivityᵣ = ([↔].intro (a∧c∨b∧c ↦ ([∨].elim (a∧c ↦ [∧].intro([∨].introₗ([∧].elimₗ a∧c))([∧].elimᵣ a∧c)) (b∧c ↦ [∧].intro([∨].introᵣ([∧].elimₗ b∧c))([∧].elimᵣ b∧c)) (a∧c∨b∧c) ) ) (a∨b∧c ↦ ([∨].elim (a ↦ [∨].introₗ([∧].intro(a)([∧].elimᵣ a∨b∧c))) (b ↦ [∨].introᵣ([∧].intro(b)([∧].elimᵣ a∨b∧c))) ([∧].elimₗ a∨b∧c) ) ) ) postulate [≡]-substitute-this-is-almost-trivial : ∀{φ : Domain → Formula}{a b} → Proof(((a ≡ b) ∧ φ(a)) ⟷ φ(b)) postulate [→][∧]-distributivityₗ : ∀{X Y Z} → Proof((X ⟶ (Y ∧ Z)) ⟷ ((X ⟶ Y) ∧ (X ⟶ Z))) postulate [∀]-unrelatedₗ-[→] : ∀{P : Domain → Formula}{Q : Formula} → Proof(∀ₗ(x ↦ (P(x) ⟶ Q)) ⟷ (∃ₗ(x ↦ P(x)) ⟶ Q)) postulate [∀]-unrelatedᵣ-[→] : ∀{P : Formula}{Q : Domain → Formula} → Proof(∀ₗ(x ↦ (P ⟶ Q(x))) ⟷ (P ⟶ ∀ₗ(x ↦ Q(x)))) postulate [∃]-unrelatedₗ-[→] : ∀{P : Domain → Formula}{Q : Formula} → Proof(∃ₗ(x ↦ (P(x) ⟶ Q)) ⟷ (∀ₗ(x ↦ P(x)) ⟶ Q)) postulate [∃]-unrelatedᵣ-[→] : ∀{P : Formula}{Q : Domain → Formula} → Proof(∃ₗ(x ↦ (P ⟶ Q(x))) ⟷ (P ⟶ ∃ₗ(x ↦ Q(x)))) -- TODO: Is equivalence unprovable? I think so Unique-unrelatedᵣ-[→]ᵣ : ∀{P : Formula}{Q : Domain → Formula} → Proof(Unique(x ↦ (P ⟶ Q(x))) ⟶ (P ⟶ Unique(x ↦ Q(x)))) Unique-unrelatedᵣ-[→]ᵣ {P}{Q} = [→].intro(uniquepq ↦ [→].intro(p ↦ [∀].intro(\{x} → [∀].intro(\{y} → [→].intro(qxqy ↦ ([→].elim ([∀].elim([∀].elim uniquepq{x}){y}) (([↔].elimᵣ [→][∧]-distributivityₗ) ([→].intro(p ↦ qxqy))) ) ))))) -- Proving these equivalent: -- ∀ₗ(x ↦ ∀ₗ(y ↦ (P ⟶ Q(x)) ∧ (P ⟶ Q(y)) ⟶ (x ≡ y)) -- P ⟶ ∀ₗ(x ↦ ∀ₗ(y ↦ Q(x) ∧ Q(y) ⟶ (x ≡ y)) -- test : Proof(∀ₗ(x ↦ ∀ₗ(y ↦ (P ⟶ Q(x)) ∧ (P ⟶ Q(y)) ⟶ (x ≡ y))) ⟷ ∀ₗ(x ↦ ∀ₗ(y ↦ (P ⟶ Q(x) ∧ Q(y)) ⟶ (x ≡ y)))) -- test = ([↔]-with-[∀] ([↔]-with-[∀] ([→][∧]-distributivityₗ))) -- TODO: Is left provable? Above left seems unprovable [∃!]-unrelatedᵣ-[→]ᵣ : ∀{P : Formula}{Q : Domain → Formula} → Proof(∃ₗ!(x ↦ (P ⟶ Q(x))) ⟶ (P ⟶ ∃ₗ!(x ↦ Q(x)))) [∃!]-unrelatedᵣ-[→]ᵣ {P}{Q} = ([→].intro(proof ↦ ([↔].elimₗ [→][∧]-distributivityₗ) ([∧].intro (([↔].elimᵣ [∃]-unrelatedᵣ-[→]) ([∧].elimₗ proof)) (([→].elim Unique-unrelatedᵣ-[→]ᵣ) ([∧].elimᵣ proof)) ) )) -- TODO: I think this is similar to the skolemization process of going from ∀∃ to ∃function∀ [∃]-fn-witness : ∀{P : Domain → Domain → Formula} → ⦃ _ : Proof(∀ₗ(x ↦ ∃ₗ(y ↦ P(x)(y)))) ⦄ → Domain → Domain [∃]-fn-witness{P} ⦃ proof ⦄ (x) = [∃]-witness ⦃ [∀].elim(proof){x} ⦄ [∃]-fn-proof : ∀{P : Domain → Domain → Formula} → ⦃ p : Proof(∀ₗ(x ↦ ∃ₗ(y ↦ P(x)(y)))) ⦄ → Proof(∀ₗ(x ↦ P(x)([∃]-fn-witness{P} ⦃ p ⦄ (x)))) [∃]-fn-proof{P} ⦃ proof ⦄ = ([∀].intro(\{x} → [∃]-proof {P(x)} ⦃ [∀].elim proof{x} ⦄ )) [∃!]-fn-witness : ∀{P : Domain → Domain → Formula} → ⦃ _ : Proof(∀ₗ(x ↦ ∃ₗ!(y ↦ P(x)(y)))) ⦄ → Domain → Domain [∃!]-fn-witness{P} ⦃ proof ⦄ (x) = [∃!]-witness ⦃ [∀].elim(proof){x} ⦄ {- [∃!]-fn-proof : ∀{P : Domain → Domain → Formula} → ⦃ p : Proof(∀ₗ(x ↦ ∃ₗ!(y ↦ P(x)(y)))) ⦄ → Proof(∀ₗ(x ↦ P(x)([∃!]-fn-witness{P} ⦃ p ⦄ (x)))) [∃!]-fn-proof{P} ⦃ proof ⦄ = ([∀].intro(\{x} → [∃!]-proof {P(x)} ⦃ [∀].elim proof{x} ⦄ )) -} [∃!]-fn-proof : ∀{P : Domain → Domain → Formula} → ⦃ p : Proof(∀ₗ(x ↦ ∃ₗ!(y ↦ P(x)(y)))) ⦄ → ∀{x} → Proof(P(x)([∃!]-fn-witness{P} ⦃ p ⦄ (x))) [∃!]-fn-proof{P} ⦃ proof ⦄ {x} = [∃!]-proof {P(x)} ⦃ [∀].elim proof{x} ⦄ postulate [∃!]-fn-unique : ∀{P : Domain → Domain → Formula} → ⦃ p : Proof(∀ₗ(x ↦ ∃ₗ!(y ↦ P(x)(y)))) ⦄ → ∀{x} → Proof(∀ₗ(y ↦ P(x)(y) ⟶ (y ≡ [∃!]-fn-witness{P} ⦃ p ⦄ (x))))
3-mid/impact/source/2d/dynamics/contacts/impact-d2-toi_solver.adb
charlie5/lace
20
20453
with impact.d2.Fixture, impact.d2.Shape, ada.unchecked_Deallocation; package body impact.d2.toi_Solver is use type int32; procedure destruct (Self : in out b2TOISolver) is begin Self.clear; end destruct; procedure Initialize (Self : in out b2TOISolver; contacts : in Contact.views; toiBody : access Solid.b2Body'Class) is begin Self.clear; Self.m_count := contacts'Length; Self.m_toiBody := toiBody; Self.m_constraints := new b2TOIConstraints (1 .. Self.m_count); for i in 1 .. Self.m_count loop declare use impact.d2.Fixture; contact : constant impact.d2.Contact.view := contacts (i); fixtureA : constant access b2Fixture := contact.GetFixtureA; fixtureB : constant access b2Fixture := contact.GetFixtureB; shapeA : constant Shape.view := fixtureA.GetShape.all'Access; shapeB : constant Shape.view := fixtureB.GetShape.all'Access; radiusA : float32 := shapeA.m_radius; radiusB : float32 := shapeB.m_radius; bodyA : constant Solid_view := fixtureA.GetBody.all'Access; bodyB : constant Solid_view := fixtureB.GetBody.all'Access; manifold : access collision.b2Manifold := contact.GetManifold; pragma Assert (manifold.pointCount > 0); constraint : b2TOIConstraint renames Self.m_constraints (i); cp : access collision.b2ManifoldPoint; begin constraint.bodyA := bodyA; constraint.bodyB := bodyB; constraint.localNormal := manifold.localNormal; constraint.localPoint := manifold.localPoint; constraint.kind := manifold.Kind; constraint.pointCount := manifold.pointCount; constraint.radius := radiusA + radiusB; for j in 1 .. constraint.pointCount loop cp := manifold.points (j)'Access; constraint.localPoints (j) := cp.localPoint; end loop; end; end loop; end Initialize; procedure Clear (Self : in out b2TOISolver) is procedure free is new ada.unchecked_Deallocation (b2TOIConstraints, b2TOIConstraints_view); begin if Self.m_constraints /= null then free (Self.m_constraints); end if; end Clear; type b2TOISolverManifold is record normal : b2Vec2; point : b2Vec2; separation : float32; end record; procedure initialize (Self : in out b2TOISolverManifold; cc : access b2TOIConstraint; index : in int32 ) is use Collision; pointA, pointB, planePoint, clipPoint : b2Vec2; begin pragma Assert (cc.pointCount > 0); case cc.Kind is when e_circles => pointA := cc.bodyA.GetWorldPoint (cc.localPoint); pointB := cc.bodyB.GetWorldPoint (cc.localPoints (1)); if b2DistanceSquared (pointA, pointB) > b2_epsilon * b2_epsilon then Self.normal := pointB - pointA; Normalize (Self.normal); else Self.normal := (1.0, 0.0); end if; Self.point := 0.5 * (pointA + pointB); Self.separation := b2Dot (pointB - pointA, Self.normal) - cc.radius; when e_faceA => Self.normal := cc.bodyA.GetWorldVector (cc.localNormal); planePoint := cc.bodyA.GetWorldPoint (cc.localPoint); clipPoint := cc.bodyB.GetWorldPoint (cc.localPoints (index)); Self.separation := b2Dot (clipPoint - planePoint, Self.normal) - cc.radius; Self.point := clipPoint; when e_faceB => Self.normal := cc.bodyB.GetWorldVector (cc.localNormal); planePoint := cc.bodyB.GetWorldPoint (cc.localPoint); clipPoint := cc.bodyA.GetWorldPoint (cc.localPoints (index)); Self.separation := b2Dot (clipPoint - planePoint, Self.normal) - cc.radius; Self.point := clipPoint; -- Ensure normal points from A to B Self.normal := -Self.normal; end case; end initialize; -- Push out the toi body to provide clearance for further simulation. -- function Solve (Self : in b2TOISolver; baumgarte : float32) return Boolean is minSeparation : float32 := 0.0; c : access b2TOIConstraint; bodyA, bodyB : access Solid.b2Body'Class; massA, massB, invMassA, invIA, invMassB, invIB : float32; psm : b2TOISolverManifold; begin for i in 1 .. Self.m_count loop c := Self.m_constraints (i)'Access; bodyA := c.bodyA; bodyB := c.bodyB; massA := bodyA.getMass; massB := bodyB.getMass; -- Only the TOI body should move. if bodyA = Self.m_toiBody then massB := 0.0; else massA := 0.0; end if; invMassA := massA * bodyA.m_invMass.all; invIA := massA * bodyA.m_InvI.all; invMassB := massB * bodyB.m_invMass.all; invIB := massB * bodyB.m_invI.all; -- Solve normal constraints for j in 1 .. c.pointCount loop Initialize (psm, c, j); declare normal : constant b2Vec2 := psm.normal; point : constant b2Vec2 := psm.point; separation : constant float32 := psm.separation; rA : constant b2Vec2 := point - bodyA.m_sweep.c; rB : constant b2Vec2 := point - bodyB.m_sweep.c; -- Prevent large corrections and allow slop. C : constant float32 := b2Clamp (baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0); -- Compute the effective mass. rnA : constant float32 := b2Cross (rA, normal); rnB : constant float32 := b2Cross (rB, normal); K : constant float32 := invMassA + invMassB + invIA * rnA * rnA + invIB * rnB * rnB; impulse : float32; P : b2Vec2; begin -- Compute normal impulse if K > 0.0 then impulse := -C / K; else impulse := 0.0; end if; P := impulse * normal; -- Track max constraint error. minSeparation := float32'Min (minSeparation, separation); bodyA.m_sweep.c := bodyA.m_sweep.c - invMassA * P; bodyA.m_sweep.a := bodyA.m_sweep.a - invIA * b2Cross (rA, P); bodyA.SynchronizeTransform; bodyB.m_sweep.c := bodyB.m_sweep.c + invMassB * P; bodyB.m_sweep.a := bodyB.m_sweep.a + invIB * b2Cross (rB, P); bodyB.SynchronizeTransform; end; end loop; end loop; -- We can't expect minSpeparation >= -b2_linearSlop because we don't -- push the separation above -b2_linearSlop. return minSeparation >= -1.5 * b2_linearSlop; end Solve; end impact.d2.toi_Solver;
3-mid/opengl/source/lean/renderer/opengl-impostor-terrain.adb
charlie5/lace
20
4818
with openGL.Camera, openGL.Texture, ada.unchecked_Deallocation; package body openGL.Impostor.terrain is overriding procedure set_Target (Self : in out Item; Target : in openGL.Visual.view) is begin set_Target (openGL.impostor.item (Self), Target); -- Base class call. Self.expand_X := 0.02; Self.expand_Y := 0.02; end set_Target; procedure free (Self : in out View) is procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View); begin destroy (Self.all); deallocate (Self); end free; overriding function current_Camera_look_at_Rotation (Self : in Item) return Matrix_3x3 is begin return Self.current_Camera_look_at_Rotation; end current_Camera_look_at_Rotation; overriding function update_Required (Self : access Item; the_Camera : access Camera.item'Class) return Boolean is begin Self.current_pixel_Region := Self.get_pixel_Region (camera_Spin => the_Camera.Spin, camera_Site => the_Camera.Site, camera_projection_Transform => the_Camera.projection_Transform, camera_Viewport => the_Camera.Viewport); declare use GL; use type GL.glInt; update_Required : Boolean := Self.general_Update_required (the_Camera.Site, Self.current_pixel_Region); copy_x_Offset : gl.glInt := 0; copy_y_Offset : gl.glInt := 0; copy_X : gl.glInt := Self.current_pixel_Region.X; copy_Y : gl.glInt := Self.current_pixel_Region.Y; copy_Width : gl.glSizeI := Self.current_pixel_Region.Width; copy_Height : gl.glSizeI := Self.current_pixel_Region.Height; viewport_Width : constant Integer := the_Camera.Viewport.Max (1) - the_Camera.Viewport.Min (1) + 1; viewport_Height : constant Integer := the_Camera.Viewport.Max (2) - the_Camera.Viewport.Min (2) + 1; Complete_left : Boolean; Complete_right : Boolean; Complete_top : Boolean; Complete_bottom : Boolean; now_Complete : Boolean; begin if copy_X < 0 then copy_x_Offset := -copy_X; copy_X := 0; copy_Width := copy_Width - glSizeI (copy_x_Offset); Complete_left := False; Complete_right := True; if copy_Width < 1 then Self.is_Valid := False; return False; -- NB: Short circuit return ! end if; elsif copy_X + glInt (copy_Width) > glInt (Viewport_Width) then copy_Width := glSizeI (viewport_Width) - glSizeI (copy_X); Complete_left := True; Complete_right := False; if copy_Width < 1 then Self.is_Valid := False; return False; -- NB: Short circuit return ! end if; else Complete_left := True; Complete_right := True; end if; if copy_Y < 0 then copy_y_Offset := -copy_Y; copy_Y := 0; copy_Height := copy_Height - glSizeI (copy_y_Offset); Complete_top := True; Complete_bottom := False; if copy_Height < 1 then Self.is_Valid := False; return False; -- NB: Short circuit return ! end if; elsif copy_Y + glInt (copy_Height) > glInt (Viewport_Height) then copy_Height := glSizeI (viewport_Height) - glSizeI (copy_Y); Complete_top := False; Complete_bottom := True; if copy_Height < 1 then Self.is_Valid := False; return False; -- NB: Short circuit return ! end if; else Complete_top := True; Complete_bottom := True; end if; now_Complete := Complete_left and Complete_right and Complete_top and Complete_bottom; if not update_Required then -- Only do further tests if update not already required. if Self.prior_Complete then if now_Complete and then Self.size_Update_required (Self.current_pixel_Region) then update_Required := True; end if; else if copy_Width > Self.prior_copy_Width then update_Required := True; end if; if copy_Height > Self.prior_copy_Height then update_Required := True; end if; end if; end if; if update_Required then Self.current_Width_pixels := Self.current_pixel_Region.Width; -- Cache current state. Self.current_Height_pixels := Self.current_pixel_Region.Height; Self.current_copy_X_Offset := copy_X_Offset; Self.current_copy_Y_Offset := copy_Y_Offset; Self.current_copy_X := copy_X; Self.current_copy_Y := copy_Y; Self.current_copy_Width := copy_Width; Self.current_copy_Height := copy_Height; Self.current_Complete := now_Complete; Self.prior_copy_Width := Self.current_copy_Width; -- Set prior state. Self.prior_copy_Height := Self.current_copy_Height; Self.prior_Complete := Self.current_Complete; end if; Self.is_Valid := True; Self.current_Camera_look_at_Rotation := the_Camera.Spin; return update_Required; end; end update_Required; overriding procedure pre_update (Self : in out Item; the_Camera : access Camera.item'Class) is pragma unreferenced (the_Camera); begin Self.expand_X := 0.0; Self.expand_Y := 0.0; end pre_update; overriding procedure update (Self : in out Item; the_Camera : access Camera.item'Class; texture_Pool : in Texture.Pool_view) is begin Self.expand_X := 0.0; Self.expand_Y := 0.0; Impostor.item (Self).update (the_Camera, texture_Pool); -- Base class 'update'. end update; overriding procedure post_update (Self : in out Item; the_Camera : access Camera.item'Class) is begin null; end post_update; end openGL.Impostor.terrain;
programs/oeis/049/A049617.asm
neoneye/loda
22
97120
<reponame>neoneye/loda ; A049617: a(n) = Sum_{i=0..2n} (-1)^i * T(i,2n-i) where T is A049615. ; 0,2,5,8,13,18,23,30,39,46,55,66,75,88,101,110,127,144,157,176,193,206,227,250,267,288,313,332,357,386,403,434,467,488,521,546,571,608,645,670,703,744,769,812,853,878,923,970,1003,1046,1087 mov $1,$0 lpb $1 mov $2,$1 div $1,2 seq $2,2088 ; Sum of totient function: a(n) = Sum_{k=1..n} phi(k), cf. A000010. add $0,$2 lpe
oeis/178/A178732.asm
neoneye/loda-programs
11
8702
<filename>oeis/178/A178732.asm ; A178732: a(n) = n XOR 6n, where XOR is bitwise XOR. ; Submitted by <NAME> ; 0,7,14,17,28,27,34,45,56,63,54,73,68,67,90,85,112,119,126,97,108,107,146,157,136,143,134,185,180,179,170,165,224,231,238,241,252,251,194,205,216,223,214,297,292,291,314,309,272,279,286,257,268,267,370,381 mov $5,$0 mul $5,6 mov $2,$5 mov $4,1 lpb $2 mov $2,$5 mov $3,$0 div $0,2 add $3,$5 mod $3,2 mul $3,$4 add $1,$3 sub $2,1 mul $4,2 div $5,2 lpe mov $0,$1
libsrc/_DEVELOPMENT/target/zx/driver/terminal/zx_01_output_char_32_tty_z88dk/zx_01_output_char_32_tty_z88dk_22_at.asm
meesokim/z88dk
0
171404
<gh_stars>0 SECTION code_fcntl PUBLIC zx_01_output_char_32_tty_z88dk_22_at zx_01_output_char_32_tty_z88dk_22_at: ; at x,y ; de = parameters * ex de,hl ld d,(hl) ; d = y coord inc hl ld e,(hl) ; e = x coord ld (ix+14),e ; set x coord ld (ix+15),d ; set y coord ret
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1040.asm
ljhsiun2/medusa
9
16948
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x13751, %r8 and %rcx, %rcx vmovups (%r8), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rax nop sub %r12, %r12 lea addresses_WC_ht+0x1e87b, %rsi lea addresses_UC_ht+0x1adb, %rdi clflush (%rdi) nop nop nop nop add %rax, %rax mov $109, %rcx rep movsb nop nop nop dec %rsi lea addresses_normal_ht+0x96db, %rsi lea addresses_A_ht+0x1dc3b, %rdi nop nop nop nop sub $36957, %rax mov $111, %rcx rep movsl nop nop xor %r8, %r8 lea addresses_D_ht+0x11b, %r12 nop nop nop and $3823, %rbx mov $0x6162636465666768, %rcx movq %rcx, %xmm2 and $0xffffffffffffffc0, %r12 vmovntdq %ymm2, (%r12) nop nop nop nop nop xor %rcx, %rcx lea addresses_UC_ht+0xeedb, %rsi lea addresses_WC_ht+0x8ddb, %rdi nop nop nop nop dec %r15 mov $118, %rcx rep movsl nop nop add %r8, %r8 lea addresses_WC_ht+0x14e2e, %rsi lea addresses_WT_ht+0xcfcd, %rdi nop nop nop dec %r8 mov $20, %rcx rep movsq nop nop nop nop nop sub %rbx, %rbx lea addresses_WT_ht+0x14163, %r12 clflush (%r12) nop nop inc %rax mov $0x6162636465666768, %rcx movq %rcx, %xmm0 vmovups %ymm0, (%r12) nop nop nop nop sub $63304, %rax lea addresses_WT_ht+0x1bf5b, %rsi lea addresses_D_ht+0x13f7b, %rdi clflush (%rdi) nop nop nop sub $30843, %r12 mov $93, %rcx rep movsb nop dec %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %rcx push %rsi // Faulty Load lea addresses_normal+0x112db, %rsi nop nop and $22142, %rcx mov (%rsi), %r13d lea oracles, %r12 and $0xff, %r13 shlq $12, %r13 mov (%r12,%r13,1), %r13 pop %rsi pop %rcx pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'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 */
04/fill/Fill.asm
hsinewu/nand2tetris
0
92371
<filename>04/fill/Fill.asm // This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by <NAME> Schocken, MIT Press. // File name: projects/04/Fill.asm // Runs an infinite loop that listens to the keyboard input. // When a key is pressed (any key), the program blackens the screen, // i.e. writes "black" in every pixel. When no key is pressed, the // program clears the screen, i.e. writes "white" in every pixel. // Put your code here. (INIT) @8192 D=A @maxLine M=D (SET) // set up counter @maxLine D=M @counter M=D // set up ptrScreen @SCREEN D=A @ptrScreen M=D (LINE1) // iteration @ptrScreen A=M M=-1 // incrementation @ptrScreen M=M+1 @counter M=M-1 D=M @LINE1 D; JNE (PRESSED) @KBD D=M @PRESSED D; JNE // JUMP UNSET (UNSET) // set up counter @maxLine D=M @counter M=D // set up ptrScreen @SCREEN D=A @ptrScreen M=D (LINE2) // iteration @ptrScreen A=M M=0 // incrementation @ptrScreen M=M+1 @counter M=M-1 D=M @LINE2 D; JNE (UNPRESSED) @KBD D=M @UNPRESSED D; JEQ @SET 0; JEQ
Ouroboros/External/libjpegTurbo/simd/jiss2int-64.asm
jiangzhu1212/oooii
0
20645
; ; jiss2int-64.asm - accurate integer IDCT (64-bit SSE2) ; ; Copyright 2009 <NAME> <<EMAIL>> for Cendio AB ; Copyright 2009 <NAME> ; ; Based on ; x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; This file contains a slow-but-accurate integer implementation of the ; inverse DCT (Discrete Cosine Transform). The following code is based ; directly on the IJG's original jidctint.c; see the jidctint.c for ; more details. ; ; [TAB8] %include "jsimdext.inc" %include "jdct.inc" ; -------------------------------------------------------------------------- %define CONST_BITS 13 %define PASS1_BITS 2 %define DESCALE_P1 (CONST_BITS-PASS1_BITS) %define DESCALE_P2 (CONST_BITS+PASS1_BITS+3) %if CONST_BITS == 13 F_0_298 equ 2446 ; FIX(0.298631336) F_0_390 equ 3196 ; FIX(0.390180644) F_0_541 equ 4433 ; FIX(0.541196100) F_0_765 equ 6270 ; FIX(0.765366865) F_0_899 equ 7373 ; FIX(0.899976223) F_1_175 equ 9633 ; FIX(1.175875602) F_1_501 equ 12299 ; FIX(1.501321110) F_1_847 equ 15137 ; FIX(1.847759065) F_1_961 equ 16069 ; FIX(1.961570560) F_2_053 equ 16819 ; FIX(2.053119869) F_2_562 equ 20995 ; FIX(2.562915447) F_3_072 equ 25172 ; FIX(3.072711026) %else ; NASM cannot do compile-time arithmetic on floating-point constants. %define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n)) F_0_298 equ DESCALE( 320652955,30-CONST_BITS) ; FIX(0.298631336) F_0_390 equ DESCALE( 418953276,30-CONST_BITS) ; FIX(0.390180644) F_0_541 equ DESCALE( 581104887,30-CONST_BITS) ; FIX(0.541196100) F_0_765 equ DESCALE( 821806413,30-CONST_BITS) ; FIX(0.765366865) F_0_899 equ DESCALE( 966342111,30-CONST_BITS) ; FIX(0.899976223) F_1_175 equ DESCALE(1262586813,30-CONST_BITS) ; FIX(1.175875602) F_1_501 equ DESCALE(1612031267,30-CONST_BITS) ; FIX(1.501321110) F_1_847 equ DESCALE(1984016188,30-CONST_BITS) ; FIX(1.847759065) F_1_961 equ DESCALE(2106220350,30-CONST_BITS) ; FIX(1.961570560) F_2_053 equ DESCALE(2204520673,30-CONST_BITS) ; FIX(2.053119869) F_2_562 equ DESCALE(2751909506,30-CONST_BITS) ; FIX(2.562915447) F_3_072 equ DESCALE(3299298341,30-CONST_BITS) ; FIX(3.072711026) %endif ; -------------------------------------------------------------------------- SECTION SEG_CONST alignz 16 global EXTN(jconst_idct_islow_sse2) EXTN(jconst_idct_islow_sse2): PW_F130_F054 times 4 dw (F_0_541+F_0_765), F_0_541 PW_F054_MF130 times 4 dw F_0_541, (F_0_541-F_1_847) PW_MF078_F117 times 4 dw (F_1_175-F_1_961), F_1_175 PW_F117_F078 times 4 dw F_1_175, (F_1_175-F_0_390) PW_MF060_MF089 times 4 dw (F_0_298-F_0_899),-F_0_899 PW_MF089_F060 times 4 dw -F_0_899, (F_1_501-F_0_899) PW_MF050_MF256 times 4 dw (F_2_053-F_2_562),-F_2_562 PW_MF256_F050 times 4 dw -F_2_562, (F_3_072-F_2_562) PD_DESCALE_P1 times 4 dd 1 << (DESCALE_P1-1) PD_DESCALE_P2 times 4 dd 1 << (DESCALE_P2-1) PB_CENTERJSAMP times 16 db CENTERJSAMPLE alignz 16 ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 64 ; ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) ; jsimd_idct_islow_sse2 (void * dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; ; r10 = jpeg_component_info * compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col %define original_rbp rbp+0 %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 12 align 16 global EXTN(jsimd_idct_islow_sse2) EXTN(jsimd_idct_islow_sse2): push rbp mov rax,rsp ; rax = original rbp sub rsp, byte 4 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [rsp],rax mov rbp,rsp ; rbp = aligned rbp lea rsp, [wk(0)] collect_args ; ---- Pass 1: process columns from input. mov rdx, r10 ; quantptr mov rsi, r11 ; inptr %ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2 mov eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)] or eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)] jnz near .columnDCT movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] por xmm1,xmm0 packsswb xmm1,xmm1 packsswb xmm1,xmm1 movd eax,xmm1 test rax,rax jnz short .columnDCT ; -- AC terms all zero movdqa xmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] pmullw xmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] psllw xmm5,PASS1_BITS movdqa xmm4,xmm5 ; xmm5=in0=(00 01 02 03 04 05 06 07) punpcklwd xmm5,xmm5 ; xmm5=(00 00 01 01 02 02 03 03) punpckhwd xmm4,xmm4 ; xmm4=(04 04 05 05 06 06 07 07) pshufd xmm7,xmm5,0x00 ; xmm7=col0=(00 00 00 00 00 00 00 00) pshufd xmm6,xmm5,0x55 ; xmm6=col1=(01 01 01 01 01 01 01 01) pshufd xmm1,xmm5,0xAA ; xmm1=col2=(02 02 02 02 02 02 02 02) pshufd xmm5,xmm5,0xFF ; xmm5=col3=(03 03 03 03 03 03 03 03) pshufd xmm0,xmm4,0x00 ; xmm0=col4=(04 04 04 04 04 04 04 04) pshufd xmm3,xmm4,0x55 ; xmm3=col5=(05 05 05 05 05 05 05 05) pshufd xmm2,xmm4,0xAA ; xmm2=col6=(06 06 06 06 06 06 06 06) pshufd xmm4,xmm4,0xFF ; xmm4=col7=(07 07 07 07 07 07 07 07) movdqa XMMWORD [wk(8)], xmm6 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm5 ; wk(9)=col3 movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 jmp near .column_end %endif .columnDCT: ; -- Even part movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm4,xmm1 ; xmm1=in2=z2 movdqa xmm5,xmm1 punpcklwd xmm4,xmm3 ; xmm3=in6=z3 punpckhwd xmm5,xmm3 movdqa xmm1,xmm4 movdqa xmm3,xmm5 pmaddwd xmm4,[rel PW_F130_F054] ; xmm4=tmp3L pmaddwd xmm5,[rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1,[rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm3,[rel PW_F054_MF130] ; xmm3=tmp2H movdqa xmm6,xmm0 paddw xmm0,xmm2 ; xmm0=in0+in4 psubw xmm6,xmm2 ; xmm6=in0-in4 pxor xmm7,xmm7 pxor xmm2,xmm2 punpcklwd xmm7,xmm0 ; xmm7=tmp0L punpckhwd xmm2,xmm0 ; xmm2=tmp0H psrad xmm7,(16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS psrad xmm2,(16-CONST_BITS) ; psrad xmm2,16 & pslld xmm2,CONST_BITS movdqa xmm0,xmm7 paddd xmm7,xmm4 ; xmm7=tmp10L psubd xmm0,xmm4 ; xmm0=tmp13L movdqa xmm4,xmm2 paddd xmm2,xmm5 ; xmm2=tmp10H psubd xmm4,xmm5 ; xmm4=tmp13H movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm2 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm0 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm4 ; wk(3)=tmp13H pxor xmm5,xmm5 pxor xmm7,xmm7 punpcklwd xmm5,xmm6 ; xmm5=tmp1L punpckhwd xmm7,xmm6 ; xmm7=tmp1H psrad xmm5,(16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm7,(16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS movdqa xmm2,xmm5 paddd xmm5,xmm1 ; xmm5=tmp11L psubd xmm2,xmm1 ; xmm2=tmp12L movdqa xmm0,xmm7 paddd xmm7,xmm3 ; xmm7=tmp11H psubd xmm0,xmm3 ; xmm0=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm7 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm0 ; wk(7)=tmp12H ; -- Odd part movdqa xmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] pmullw xmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] pmullw xmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm5,xmm6 movdqa xmm7,xmm4 paddw xmm5,xmm3 ; xmm5=z3 paddw xmm7,xmm1 ; xmm7=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm2,xmm5 movdqa xmm0,xmm5 punpcklwd xmm2,xmm7 punpckhwd xmm0,xmm7 movdqa xmm5,xmm2 movdqa xmm7,xmm0 pmaddwd xmm2,[rel PW_MF078_F117] ; xmm2=z3L pmaddwd xmm0,[rel PW_MF078_F117] ; xmm0=z3H pmaddwd xmm5,[rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm7,[rel PW_F117_F078] ; xmm7=z4H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm2,xmm3 movdqa xmm0,xmm3 punpcklwd xmm2,xmm4 punpckhwd xmm0,xmm4 movdqa xmm3,xmm2 movdqa xmm4,xmm0 pmaddwd xmm2,[rel PW_MF060_MF089] ; xmm2=tmp0L pmaddwd xmm0,[rel PW_MF060_MF089] ; xmm0=tmp0H pmaddwd xmm3,[rel PW_MF089_F060] ; xmm3=tmp3L pmaddwd xmm4,[rel PW_MF089_F060] ; xmm4=tmp3H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp0L paddd xmm0, XMMWORD [wk(11)] ; xmm0=tmp0H paddd xmm3,xmm5 ; xmm3=tmp3L paddd xmm4,xmm7 ; xmm4=tmp3H movdqa XMMWORD [wk(8)], xmm2 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm0 ; wk(9)=tmp0H movdqa xmm2,xmm1 movdqa xmm0,xmm1 punpcklwd xmm2,xmm6 punpckhwd xmm0,xmm6 movdqa xmm1,xmm2 movdqa xmm6,xmm0 pmaddwd xmm2,[rel PW_MF050_MF256] ; xmm2=tmp1L pmaddwd xmm0,[rel PW_MF050_MF256] ; xmm0=tmp1H pmaddwd xmm1,[rel PW_MF256_F050] ; xmm1=tmp2L pmaddwd xmm6,[rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm2,xmm5 ; xmm2=tmp1L paddd xmm0,xmm7 ; xmm0=tmp1H paddd xmm1, XMMWORD [wk(10)] ; xmm1=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm7, XMMWORD [wk(1)] ; xmm7=tmp10H movdqa xmm2,xmm5 movdqa xmm0,xmm7 paddd xmm5,xmm3 ; xmm5=data0L paddd xmm7,xmm4 ; xmm7=data0H psubd xmm2,xmm3 ; xmm2=data7L psubd xmm0,xmm4 ; xmm0=data7H movdqa xmm3,[rel PD_DESCALE_P1] ; xmm3=[rel PD_DESCALE_P1] paddd xmm5,xmm3 paddd xmm7,xmm3 psrad xmm5,DESCALE_P1 psrad xmm7,DESCALE_P1 paddd xmm2,xmm3 paddd xmm0,xmm3 psrad xmm2,DESCALE_P1 psrad xmm0,DESCALE_P1 packssdw xmm5,xmm7 ; xmm5=data0=(00 01 02 03 04 05 06 07) packssdw xmm2,xmm0 ; xmm2=data7=(70 71 72 73 74 75 76 77) movdqa xmm4, XMMWORD [wk(4)] ; xmm4=tmp11L movdqa xmm3, XMMWORD [wk(5)] ; xmm3=tmp11H movdqa xmm7,xmm4 movdqa xmm0,xmm3 paddd xmm4,xmm1 ; xmm4=data1L paddd xmm3,xmm6 ; xmm3=data1H psubd xmm7,xmm1 ; xmm7=data6L psubd xmm0,xmm6 ; xmm0=data6H movdqa xmm1,[rel PD_DESCALE_P1] ; xmm1=[rel PD_DESCALE_P1] paddd xmm4,xmm1 paddd xmm3,xmm1 psrad xmm4,DESCALE_P1 psrad xmm3,DESCALE_P1 paddd xmm7,xmm1 paddd xmm0,xmm1 psrad xmm7,DESCALE_P1 psrad xmm0,DESCALE_P1 packssdw xmm4,xmm3 ; xmm4=data1=(10 11 12 13 14 15 16 17) packssdw xmm7,xmm0 ; xmm7=data6=(60 61 62 63 64 65 66 67) movdqa xmm6,xmm5 ; transpose coefficients(phase 1) punpcklwd xmm5,xmm4 ; xmm5=(00 10 01 11 02 12 03 13) punpckhwd xmm6,xmm4 ; xmm6=(04 14 05 15 06 16 07 17) movdqa xmm1,xmm7 ; transpose coefficients(phase 1) punpcklwd xmm7,xmm2 ; xmm7=(60 70 61 71 62 72 63 73) punpckhwd xmm1,xmm2 ; xmm1=(64 74 65 75 66 76 67 77) movdqa xmm3, XMMWORD [wk(6)] ; xmm3=tmp12L movdqa xmm0, XMMWORD [wk(7)] ; xmm0=tmp12H movdqa xmm4, XMMWORD [wk(10)] ; xmm4=tmp1L movdqa xmm2, XMMWORD [wk(11)] ; xmm2=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 01 11 02 12 03 13) movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=(04 14 05 15 06 16 07 17) movdqa XMMWORD [wk(4)], xmm7 ; wk(4)=(60 70 61 71 62 72 63 73) movdqa XMMWORD [wk(5)], xmm1 ; wk(5)=(64 74 65 75 66 76 67 77) movdqa xmm5,xmm3 movdqa xmm6,xmm0 paddd xmm3,xmm4 ; xmm3=data2L paddd xmm0,xmm2 ; xmm0=data2H psubd xmm5,xmm4 ; xmm5=data5L psubd xmm6,xmm2 ; xmm6=data5H movdqa xmm7,[rel PD_DESCALE_P1] ; xmm7=[rel PD_DESCALE_P1] paddd xmm3,xmm7 paddd xmm0,xmm7 psrad xmm3,DESCALE_P1 psrad xmm0,DESCALE_P1 paddd xmm5,xmm7 paddd xmm6,xmm7 psrad xmm5,DESCALE_P1 psrad xmm6,DESCALE_P1 packssdw xmm3,xmm0 ; xmm3=data2=(20 21 22 23 24 25 26 27) packssdw xmm5,xmm6 ; xmm5=data5=(50 51 52 53 54 55 56 57) movdqa xmm1, XMMWORD [wk(2)] ; xmm1=tmp13L movdqa xmm4, XMMWORD [wk(3)] ; xmm4=tmp13H movdqa xmm2, XMMWORD [wk(8)] ; xmm2=tmp0L movdqa xmm7, XMMWORD [wk(9)] ; xmm7=tmp0H movdqa xmm0,xmm1 movdqa xmm6,xmm4 paddd xmm1,xmm2 ; xmm1=data3L paddd xmm4,xmm7 ; xmm4=data3H psubd xmm0,xmm2 ; xmm0=data4L psubd xmm6,xmm7 ; xmm6=data4H movdqa xmm2,[rel PD_DESCALE_P1] ; xmm2=[rel PD_DESCALE_P1] paddd xmm1,xmm2 paddd xmm4,xmm2 psrad xmm1,DESCALE_P1 psrad xmm4,DESCALE_P1 paddd xmm0,xmm2 paddd xmm6,xmm2 psrad xmm0,DESCALE_P1 psrad xmm6,DESCALE_P1 packssdw xmm1,xmm4 ; xmm1=data3=(30 31 32 33 34 35 36 37) packssdw xmm0,xmm6 ; xmm0=data4=(40 41 42 43 44 45 46 47) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 01 11 02 12 03 13) movdqa xmm2, XMMWORD [wk(1)] ; xmm2=(04 14 05 15 06 16 07 17) movdqa xmm4,xmm3 ; transpose coefficients(phase 1) punpcklwd xmm3,xmm1 ; xmm3=(20 30 21 31 22 32 23 33) punpckhwd xmm4,xmm1 ; xmm4=(24 34 25 35 26 36 27 37) movdqa xmm6,xmm0 ; transpose coefficients(phase 1) punpcklwd xmm0,xmm5 ; xmm0=(40 50 41 51 42 52 43 53) punpckhwd xmm6,xmm5 ; xmm6=(44 54 45 55 46 56 47 57) movdqa xmm1,xmm7 ; transpose coefficients(phase 2) punpckldq xmm7,xmm3 ; xmm7=(00 10 20 30 01 11 21 31) punpckhdq xmm1,xmm3 ; xmm1=(02 12 22 32 03 13 23 33) movdqa xmm5,xmm2 ; transpose coefficients(phase 2) punpckldq xmm2,xmm4 ; xmm2=(04 14 24 34 05 15 25 35) punpckhdq xmm5,xmm4 ; xmm5=(06 16 26 36 07 17 27 37) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=(60 70 61 71 62 72 63 73) movdqa xmm4, XMMWORD [wk(5)] ; xmm4=(64 74 65 75 66 76 67 77) movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=(04 14 24 34 05 15 25 35) movdqa XMMWORD [wk(7)], xmm5 ; wk(7)=(06 16 26 36 07 17 27 37) movdqa xmm2,xmm0 ; transpose coefficients(phase 2) punpckldq xmm0,xmm3 ; xmm0=(40 50 60 70 41 51 61 71) punpckhdq xmm2,xmm3 ; xmm2=(42 52 62 72 43 53 63 73) movdqa xmm5,xmm6 ; transpose coefficients(phase 2) punpckldq xmm6,xmm4 ; xmm6=(44 54 64 74 45 55 65 75) punpckhdq xmm5,xmm4 ; xmm5=(46 56 66 76 47 57 67 77) movdqa xmm3,xmm7 ; transpose coefficients(phase 3) punpcklqdq xmm7,xmm0 ; xmm7=col0=(00 10 20 30 40 50 60 70) punpckhqdq xmm3,xmm0 ; xmm3=col1=(01 11 21 31 41 51 61 71) movdqa xmm4,xmm1 ; transpose coefficients(phase 3) punpcklqdq xmm1,xmm2 ; xmm1=col2=(02 12 22 32 42 52 62 72) punpckhqdq xmm4,xmm2 ; xmm4=col3=(03 13 23 33 43 53 63 73) movdqa xmm0, XMMWORD [wk(6)] ; xmm0=(04 14 24 34 05 15 25 35) movdqa xmm2, XMMWORD [wk(7)] ; xmm2=(06 16 26 36 07 17 27 37) movdqa XMMWORD [wk(8)], xmm3 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm4 ; wk(9)=col3 movdqa xmm3,xmm0 ; transpose coefficients(phase 3) punpcklqdq xmm0,xmm6 ; xmm0=col4=(04 14 24 34 44 54 64 74) punpckhqdq xmm3,xmm6 ; xmm3=col5=(05 15 25 35 45 55 65 75) movdqa xmm4,xmm2 ; transpose coefficients(phase 3) punpcklqdq xmm2,xmm5 ; xmm2=col6=(06 16 26 36 46 56 66 76) punpckhqdq xmm4,xmm5 ; xmm4=col7=(07 17 27 37 47 57 67 77) movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 .column_end: ; -- Prefetch the next coefficient block prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32] ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] mov rdi, r12 ; (JSAMPROW *) mov rax, r13 ; -- Even part ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6 ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm6,xmm1 ; xmm1=in2=z2 movdqa xmm5,xmm1 punpcklwd xmm6,xmm2 ; xmm2=in6=z3 punpckhwd xmm5,xmm2 movdqa xmm1,xmm6 movdqa xmm2,xmm5 pmaddwd xmm6,[rel PW_F130_F054] ; xmm6=tmp3L pmaddwd xmm5,[rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1,[rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm2,[rel PW_F054_MF130] ; xmm2=tmp2H movdqa xmm3,xmm7 paddw xmm7,xmm0 ; xmm7=in0+in4 psubw xmm3,xmm0 ; xmm3=in0-in4 pxor xmm4,xmm4 pxor xmm0,xmm0 punpcklwd xmm4,xmm7 ; xmm4=tmp0L punpckhwd xmm0,xmm7 ; xmm0=tmp0H psrad xmm4,(16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS psrad xmm0,(16-CONST_BITS) ; psrad xmm0,16 & pslld xmm0,CONST_BITS movdqa xmm7,xmm4 paddd xmm4,xmm6 ; xmm4=tmp10L psubd xmm7,xmm6 ; xmm7=tmp13L movdqa xmm6,xmm0 paddd xmm0,xmm5 ; xmm0=tmp10H psubd xmm6,xmm5 ; xmm6=tmp13H movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm7 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm6 ; wk(3)=tmp13H pxor xmm5,xmm5 pxor xmm4,xmm4 punpcklwd xmm5,xmm3 ; xmm5=tmp1L punpckhwd xmm4,xmm3 ; xmm4=tmp1H psrad xmm5,(16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm4,(16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS movdqa xmm0,xmm5 paddd xmm5,xmm1 ; xmm5=tmp11L psubd xmm0,xmm1 ; xmm0=tmp12L movdqa xmm7,xmm4 paddd xmm4,xmm2 ; xmm4=tmp11H psubd xmm7,xmm2 ; xmm7=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm4 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm0 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm7 ; wk(7)=tmp12H ; -- Odd part movdqa xmm6, XMMWORD [wk(9)] ; xmm6=col3 movdqa xmm3, XMMWORD [wk(8)] ; xmm3=col1 movdqa xmm1, XMMWORD [wk(11)] ; xmm1=col7 movdqa xmm2, XMMWORD [wk(10)] ; xmm2=col5 movdqa xmm5,xmm6 movdqa xmm4,xmm3 paddw xmm5,xmm1 ; xmm5=z3 paddw xmm4,xmm2 ; xmm4=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm0,xmm5 movdqa xmm7,xmm5 punpcklwd xmm0,xmm4 punpckhwd xmm7,xmm4 movdqa xmm5,xmm0 movdqa xmm4,xmm7 pmaddwd xmm0,[rel PW_MF078_F117] ; xmm0=z3L pmaddwd xmm7,[rel PW_MF078_F117] ; xmm7=z3H pmaddwd xmm5,[rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm4,[rel PW_F117_F078] ; xmm4=z4H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm0,xmm1 movdqa xmm7,xmm1 punpcklwd xmm0,xmm3 punpckhwd xmm7,xmm3 movdqa xmm1,xmm0 movdqa xmm3,xmm7 pmaddwd xmm0,[rel PW_MF060_MF089] ; xmm0=tmp0L pmaddwd xmm7,[rel PW_MF060_MF089] ; xmm7=tmp0H pmaddwd xmm1,[rel PW_MF089_F060] ; xmm1=tmp3L pmaddwd xmm3,[rel PW_MF089_F060] ; xmm3=tmp3H paddd xmm0, XMMWORD [wk(10)] ; xmm0=tmp0L paddd xmm7, XMMWORD [wk(11)] ; xmm7=tmp0H paddd xmm1,xmm5 ; xmm1=tmp3L paddd xmm3,xmm4 ; xmm3=tmp3H movdqa XMMWORD [wk(8)], xmm0 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm7 ; wk(9)=tmp0H movdqa xmm0,xmm2 movdqa xmm7,xmm2 punpcklwd xmm0,xmm6 punpckhwd xmm7,xmm6 movdqa xmm2,xmm0 movdqa xmm6,xmm7 pmaddwd xmm0,[rel PW_MF050_MF256] ; xmm0=tmp1L pmaddwd xmm7,[rel PW_MF050_MF256] ; xmm7=tmp1H pmaddwd xmm2,[rel PW_MF256_F050] ; xmm2=tmp2L pmaddwd xmm6,[rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm0,xmm5 ; xmm0=tmp1L paddd xmm7,xmm4 ; xmm7=tmp1H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm4, XMMWORD [wk(1)] ; xmm4=tmp10H movdqa xmm0,xmm5 movdqa xmm7,xmm4 paddd xmm5,xmm1 ; xmm5=data0L paddd xmm4,xmm3 ; xmm4=data0H psubd xmm0,xmm1 ; xmm0=data7L psubd xmm7,xmm3 ; xmm7=data7H movdqa xmm1,[rel PD_DESCALE_P2] ; xmm1=[rel PD_DESCALE_P2] paddd xmm5,xmm1 paddd xmm4,xmm1 psrad xmm5,DESCALE_P2 psrad xmm4,DESCALE_P2 paddd xmm0,xmm1 paddd xmm7,xmm1 psrad xmm0,DESCALE_P2 psrad xmm7,DESCALE_P2 packssdw xmm5,xmm4 ; xmm5=data0=(00 10 20 30 40 50 60 70) packssdw xmm0,xmm7 ; xmm0=data7=(07 17 27 37 47 57 67 77) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=tmp11L movdqa xmm1, XMMWORD [wk(5)] ; xmm1=tmp11H movdqa xmm4,xmm3 movdqa xmm7,xmm1 paddd xmm3,xmm2 ; xmm3=data1L paddd xmm1,xmm6 ; xmm1=data1H psubd xmm4,xmm2 ; xmm4=data6L psubd xmm7,xmm6 ; xmm7=data6H movdqa xmm2,[rel PD_DESCALE_P2] ; xmm2=[rel PD_DESCALE_P2] paddd xmm3,xmm2 paddd xmm1,xmm2 psrad xmm3,DESCALE_P2 psrad xmm1,DESCALE_P2 paddd xmm4,xmm2 paddd xmm7,xmm2 psrad xmm4,DESCALE_P2 psrad xmm7,DESCALE_P2 packssdw xmm3,xmm1 ; xmm3=data1=(01 11 21 31 41 51 61 71) packssdw xmm4,xmm7 ; xmm4=data6=(06 16 26 36 46 56 66 76) packsswb xmm5,xmm4 ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) packsswb xmm3,xmm0 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm6, XMMWORD [wk(6)] ; xmm6=tmp12L movdqa xmm2, XMMWORD [wk(7)] ; xmm2=tmp12H movdqa xmm1, XMMWORD [wk(10)] ; xmm1=tmp1L movdqa xmm7, XMMWORD [wk(11)] ; xmm7=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa XMMWORD [wk(1)], xmm3 ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm4,xmm6 movdqa xmm0,xmm2 paddd xmm6,xmm1 ; xmm6=data2L paddd xmm2,xmm7 ; xmm2=data2H psubd xmm4,xmm1 ; xmm4=data5L psubd xmm0,xmm7 ; xmm0=data5H movdqa xmm5,[rel PD_DESCALE_P2] ; xmm5=[rel PD_DESCALE_P2] paddd xmm6,xmm5 paddd xmm2,xmm5 psrad xmm6,DESCALE_P2 psrad xmm2,DESCALE_P2 paddd xmm4,xmm5 paddd xmm0,xmm5 psrad xmm4,DESCALE_P2 psrad xmm0,DESCALE_P2 packssdw xmm6,xmm2 ; xmm6=data2=(02 12 22 32 42 52 62 72) packssdw xmm4,xmm0 ; xmm4=data5=(05 15 25 35 45 55 65 75) movdqa xmm3, XMMWORD [wk(2)] ; xmm3=tmp13L movdqa xmm1, XMMWORD [wk(3)] ; xmm1=tmp13H movdqa xmm7, XMMWORD [wk(8)] ; xmm7=tmp0L movdqa xmm5, XMMWORD [wk(9)] ; xmm5=tmp0H movdqa xmm2,xmm3 movdqa xmm0,xmm1 paddd xmm3,xmm7 ; xmm3=data3L paddd xmm1,xmm5 ; xmm1=data3H psubd xmm2,xmm7 ; xmm2=data4L psubd xmm0,xmm5 ; xmm0=data4H movdqa xmm7,[rel PD_DESCALE_P2] ; xmm7=[rel PD_DESCALE_P2] paddd xmm3,xmm7 paddd xmm1,xmm7 psrad xmm3,DESCALE_P2 psrad xmm1,DESCALE_P2 paddd xmm2,xmm7 paddd xmm0,xmm7 psrad xmm2,DESCALE_P2 psrad xmm0,DESCALE_P2 movdqa xmm5,[rel PB_CENTERJSAMP] ; xmm5=[rel PB_CENTERJSAMP] packssdw xmm3,xmm1 ; xmm3=data3=(03 13 23 33 43 53 63 73) packssdw xmm2,xmm0 ; xmm2=data4=(04 14 24 34 44 54 64 74) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) packsswb xmm6,xmm2 ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74) packsswb xmm3,xmm4 ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75) paddb xmm7,xmm5 paddb xmm1,xmm5 paddb xmm6,xmm5 paddb xmm3,xmm5 movdqa xmm0,xmm7 ; transpose coefficients(phase 1) punpcklbw xmm7,xmm1 ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71) punpckhbw xmm0,xmm1 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77) movdqa xmm2,xmm6 ; transpose coefficients(phase 1) punpcklbw xmm6,xmm3 ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73) punpckhbw xmm2,xmm3 ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75) movdqa xmm4,xmm7 ; transpose coefficients(phase 2) punpcklwd xmm7,xmm6 ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33) punpckhwd xmm4,xmm6 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73) movdqa xmm5,xmm2 ; transpose coefficients(phase 2) punpcklwd xmm2,xmm0 ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37) punpckhwd xmm5,xmm0 ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77) movdqa xmm1,xmm7 ; transpose coefficients(phase 3) punpckldq xmm7,xmm2 ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17) punpckhdq xmm1,xmm2 ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37) movdqa xmm3,xmm4 ; transpose coefficients(phase 3) punpckldq xmm4,xmm5 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57) punpckhdq xmm3,xmm5 ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77) pshufd xmm6,xmm7,0x4E ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07) pshufd xmm0,xmm1,0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27) pshufd xmm2,xmm4,0x4E ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47) pshufd xmm5,xmm3,0x4E ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67) mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1 mov rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3 mov rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0 mov rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5 uncollect_args mov rsp,rbp ; rsp <- aligned rbp pop rsp ; rsp <- original rbp pop rbp ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 16
3-mid/opengl/source/lean/model/opengl-model-box.ads
charlie5/lace
20
7698
package openGL.Model.box -- -- Provides an abstract model of a box. -- is type Item is abstract new openGL.Model.item with private; type Side is (Front, Rear, Upper, Lower, Left, Right); function Size (Self : in Item) return Vector_3; private type Item is abstract new openGL.Model.item with record Size : Vector_3; end record; type site_Id is ( Left_Lower_Front, Right_Lower_Front, Right_Upper_Front, Left_Upper_Front, Right_Lower_Rear, Left_Lower_Rear, Left_Upper_Rear, Right_Upper_Rear); type Sites is array (site_Id) of Vector_3; front_Normal : constant Vector_3 := ( 0.0, 0.0, 1.0); rear_Normal : constant Vector_3 := ( 0.0, 0.0, -1.0); upper_Normal : constant Vector_3 := ( 0.0, 1.0, 0.0); lower_Normal : constant Vector_3 := ( 0.0, -1.0, 0.0); left_Normal : constant Vector_3 := (-1.0, 0.0, 0.0); right_Normal : constant Vector_3 := ( 1.0, 0.0, 0.0); function vertex_Sites (Self : in Item'Class) return Sites; end openGL.Model.box;
specs/ada/server/ike/tkmrpc-operation_handlers-ike-nc_create.ads
DrenfongWong/tkm-rpc
0
9795
with Tkmrpc.Request; with Tkmrpc.Response; package Tkmrpc.Operation_Handlers.Ike.Nc_Create is procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type); -- Handler for the nc_create operation. end Tkmrpc.Operation_Handlers.Ike.Nc_Create;
code/AppleScript/Open in Terminal.applescript
desmodyne/DevEnvTools
0
200
<reponame>desmodyne/DevEnvTools<filename>code/AppleScript/Open in Terminal.applescript #!/usr/bin/env osascript # Open in Terminal.applescript # # open a Terminal window at a folder location # # author : <NAME> # contact : <EMAIL> # created : 2017-05-01 # NOTE: this script is intended to be run as application from Finder toolbar # NOTE: alternate AppleScript comment characters: -- or (* ... *); see also # https://developer.apple.com/library/content/documentation/AppleScript/ ... # ... Conceptual/AppleScriptLangGuide/conceptual/ ... # ... ASLR_lexical_conventions.html#//apple_ref/doc/uid/TP40000983-CH214-SW8 # NOTE: insert line continuation character ¬ using Option-l (lower-case L): # https://developer.apple.com/library/content/documentation/AppleScript/ ... # ... Conceptual/AppleScriptLangGuide/conceptual/ ... # ... ASLR_lexical_conventions.html#//apple_ref/doc/uid/TP40000983-CH214-SW9 # NOTE: about getting selected items from Finder (or the Desktop): # + a Finder window will always report at least one selected item # as long as it is open (i.e. not minimized) and has focus # + an open Finder window can lose focus by clicking in an empty Desktop area # + items can also be selected on the Desktop; equivalent to Finder window # TODO: atom AppleScript package syntax highlighting fails with # comments # mac OS /Applications/Utilities/Script Editor.app supports four script formats: # # 1. Script, *.scpt file name pattern # compiled binary file, unsuitable for storage in version control system # 2. Script Bundle, *.scptd package / folder name pattern with contents # Contents/Info.plist # Contents/Resources/description.rtfd/TXT.rtf # Contents/Resources/Scripts/main.scpt # again, main.scpt is a compiled binary file # 3. Application, *.app package / folder name pattern with contents # Contents/Info.plist # Contents/MacOS/applet # Contents/PkgInfo # Contents/Resources/applet.icns # Contents/Resources/applet.rsrc # Contents/Resources/description.rtfd/TXT.rtf # Contents/Resources/Scripts/main.scpt # 4. Text, *.applescript file name pattern # text file, suitable for storage in version control system # # The last format is the only human-readable form and is therefore used to # maintain AppleScripts in a version control system such as git; contained code # is compiled into the binary form automatically and transparently when the # script is called. The other formats will be used once a script is deployed. # ----------------------------------------------------------------------------- # open Terminal window # taken from http://stackoverflow.com/a/7098442, first code example tell application "Finder" to set p to POSIX path of (insertion location as alias) tell application "Terminal" if (exists window 1) and not busy of window 1 then do script "cd " & quoted form of p in window 1 else do script "cd " & quoted form of p end if activate end tell
programs/oeis/274/A274601.asm
neoneye/loda
22
10229
<reponame>neoneye/loda ; A274601: a(n) = 2*3^(s-1) - n, where s is the number of trits of n in balanced ternary form. ; 1,4,3,2,13,12,11,10,9,8,7,6,5,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62 mov $2,$0 lpb $0 mov $0,$2 add $1,1 sub $0,$1 mul $1,3 lpe sub $1,$0 add $1,1 mov $0,$1
test/Fail/MissingTypeSignature.agda
shlevy/agda
1,989
6309
module MissingTypeSignature where data Nat : Set where zero : Nat suc : Nat -> Nat pred zero = zero pred (suc n) = n
src/firmware/Platform/Clock/DaysInMonth.asm
pete-restall/Cluck2Sesame-Prototype
1
12142
#define __CLUCK2SESAME_PLATFORM_CLOCK_ASM #include "Platform.inc" #include "GeneralPurposeRegisters.inc" #include "TableJumps.inc" radix decimal Clock code global lookupNumberOfDaysInMonthBcd lookupNumberOfDaysInMonthBcd: .unknownBank tableDefinitionToJumpWith RBB retlw 0x00 retlw 0x31 retlw 0x28 retlw 0x31 retlw 0x30 retlw 0x31 retlw 0x30 retlw 0x31 retlw 0x31 retlw 0x30 retlw 0x00 retlw 0x00 retlw 0x00 retlw 0x00 retlw 0x00 retlw 0x00 retlw 0x31 retlw 0x30 retlw 0x31 end
SourceCode.asm
torunxxx001/DaigakuJisshu
0
23597
<reponame>torunxxx001/DaigakuJisshu ; edit date in 2010/05/04 20:37 list P=PIC16F84A INCLUDE "P16F84A.INC" __CONFIG _HS_OSC & _WDT_ON & _PWRTE_ON & _CP_OFF ARG0 EQU 0x0C ;引数用変数1 ARG1 EQU 0x0D ;引数用変数2 ARG2 EQU 0x0E ;引数用変数3 SELC EQU 0x0F ;アクション選択カウント変数 FLGS EQU 0x10 ;PICリセット用フラグ WREGTMP EQU 0x11 ;汎用Wレジスタ退避変数 ACMEM1 EQU 0x12 ;ACTION関数用変数1 ACMEM2 EQU 0x13 ;ACTION関数用変数2 ACMEM3 EQU 0x14 ;ACTION関数用変数3 WTMEM1 EQU 0x15 ;WAIT関数用変数1 WTMEM2 EQU 0x16 ;WAIT関数用変数2 WTMEM3 EQU 0x17 ;WAIT関数用変数3 WTMEM4 EQU 0x18 ;WAIT関数用変数4 WTARG0 EQU 0x19 ;WAIT関数用ARG0退避変数 BPMEM1 EQU 0x1A ;BEEP関数用変数1 BPMEM2 EQU 0x1B ;BEEP関数用変数2 BPMEM3 EQU 0x1C ;BEEP関数用変数3 BPMEM4 EQU 0x1D ;BEEP関数用変数4 BPARG0 EQU 0x1E ;BEEP関数用ARG0退避変数 BPARG1 EQU 0x1F ;BEEP関数用ARG1退避変数 PSMEM1 EQU 0x20 ;PLAYSCALE関数用変数1 PSMEM2 EQU 0x21 ;PLAYSCALE関数用変数2 PSMEM3 EQU 0x22 ;PLAYSCALE関数用変数3 PSMEM4 EQU 0x23 ;PLAYSCALE関数用変数4 PSWREG EQU 0x24 ;PLAYSCALE関数用Wレジスタ退避変数 PSARG0 EQU 0x25 ;PLAYSCALE関数用ARG0退避変数 DLWREG EQU 0x26 ;DRAWLED関数用Wレジスタ退避変数 DSMEM1 EQU 0x27 ;DRAWSEG関数用変数1 DSARG0 EQU 0x28 ;DRAWSEG関数用ARG0退避変数 DSWREG EQU 0x29 ;DRAWSEG関数用Wレジスタ退避変数 INTRMEM1 EQU 0x2A ;割込み用変数1 INTRMEM2 EQU 0x2B ;割込み用変数2 INTRWREG EQU 0x2C ;割込み用Wレジスタ退避変数 INTRARG0 EQU 0x2D ;割込み用ARG0退避変数 SEGNUM EQU 0x2E ;8セグ表示用変数 BLEDNUM EQU 0x2F ;8ビットLED表示用変数 RLEDNUM EQU 0x30 ;ルーレットLED表示用変数 DRAWFLG EQU 0x31 ;描画用フラグ変数 ;------------------フラグ分布------------------ ;0-3 :描画フラグ1,2,3,4 ;4-5 :描画選択カウント ;6 :SEGNUM変数の上位4ビットが0でも左側の8セグに表示するか ;7 :描画使用フラグ ;------------------------------------------- SWFLG EQU 0x32 ;スイッチ用フラグ変数 ;------------------フラグ分布------------------ ;0-2 :スイッチフラグ1,2,3 ;7 :スイッチ使用フラグ ;------------------------------------------- ORG 0 GOTO MAIN ORG 0x04 GOTO INTR INTR BTFSC FLGS, 1 ;リセットフラグが1ならば RETFIE ;割込み許可で終了 CLRWDT ;ウォッチドックタイマクリア BTFSS FLGS, 0 ;リセット許可フラグが0なら GOTO C_ESC_SKIP ;リセットボタンのチャックを飛ばす BTFSS PORTA, 4 ;3番目のスイッチが押されていたら BSF FLGS, 1 ;リセットフラグを1に C_ESC_SKIP BTFSS SWFLG, 7 ;スイッチ使用フラグが0ならば GOTO C_SW_SKIP ;スイッチチェックを飛ばす BTFSS PORTA, 2 BSF SWFLG, 0 BTFSS PORTA, 3 BSF SWFLG, 1 BTFSS PORTA, 4 BSF SWFLG, 2 C_SW_SKIP MOVWF INTRWREG ;Wレジスタ退避 BTFSS DRAWFLG, 7 ;描画使用フラグが0ならば GOTO D_RET_END ;描画処理をせずに終了処理へ MOVLW B'1111' ANDWF DRAWFLG, W ;DRAWFLGの下位4ビットと論理和をとって BTFSC STATUS, Z ;ゼロならば GOTO D_RET_END ;描画処理をせずに終了処理へ GOTO D_RET_SKIP ;描画処理へ D_RET_END BCF INTCON, T0IF ;割込みフラグをリセット MOVLW 0xFF MOVWF PORTB ;PORTBの全出力をHIに MOVF INTRWREG, W ;退避していたWレジスタを復元 RETFIE ;割込み許可で終了 D_RET_SKIP MOVF ARG0, W MOVWF INTRARG0 ;ARG0変数退避 SWAPF DRAWFLG, W ;DRAWFLGを入れ替えて、Wレジスタに代入し ADDLW B'1' ;1を加算して ANDLW B'11' ;下位2ビットのみ取り出して MOVWF INTRMEM1 ;INTRMEM1とINTMEM2変数に代入 MOVWF INTRMEM2 SWAPF INTRMEM1, F ;加算された描画選択カウントを上下入れ替えて MOVF DRAWFLG, W ; ANDLW B'11001111' ; IORWF INTRMEM1, W ; MOVWF DRAWFLG ;DRAWFLG変数に戻す CLRF PCLATH ;上位プログラムカウンタを0に MOVF INTRMEM2, W ADDWF PCL, F ;下位プログラムカウンタに描画選択カウントを加算 GOTO INTR_DRAW_1 ;描画処理1へ GOTO INTR_DRAW_2 ;描画処理2へ GOTO INTR_DRAW_3 ;描画処理3へ GOTO INTR_DRAW_4 ;描画処理4へ INTR_DRAW_1 BTFSS DRAWFLG, 0 GOTO INTR_DRAW_END ;描画フラグ1が0ならば描画処理終了へ MOVLW B'0' MOVWF ARG0 MOVF SEGNUM, W ;引数1に0を、WレジスタにSEGNUM変数の値を代入し CALL DRAWSEG ;DRAWSEG関数呼び出し BCF INTCON, T0IF ;割込みフラグをリセット GOTO INTR_DRAW_END ;描画処理終了へ INTR_DRAW_2 BTFSS DRAWFLG, 1 GOTO INTR_DRAW_END ;描画フラグ2が0ならば描画処理終了へ BTFSC DRAWFLG, 6 ;SEGNUM変数の上位ビットアンチェックフラグが1ならば GOTO INTR_DRAW_2SKIP ;常に上位ビットも8セグに表示するようにする MOVF SEGNUM, W ANDLW B'11110000' BTFSC STATUS, Z GOTO INTR_DRAW_END ;SEGNUM変数の上位ビットが0ならば何もせずに描画処理終了へ INTR_DRAW_2SKIP MOVLW B'1' MOVWF ARG0 MOVF SEGNUM, W CALL DRAWSEG ;引数1に1を、WレジスタにSEGNUM変数の値を代入し、DRAWSEG関数呼び出し BCF INTCON, T0IF ;割込みフラグをリセット GOTO INTR_DRAW_END ;描画処理終了へ INTR_DRAW_3 BTFSS DRAWFLG, 2 GOTO INTR_DRAW_END ;描画フラグ3が0ならば描画処理終了へ MOVLW B'11' MOVWF ARG0 ;引数1に、B'11'を代入して COMF BLEDNUM, W ;BLEDNUM変数を反転してWレジスタに代入し CALL DRAWLED ;DRAWLED関数呼び出し BCF INTCON, T0IF ;割込みフラグをリセット GOTO INTR_DRAW_END ;描画処理終了へ INTR_DRAW_4 BTFSS DRAWFLG, 3 GOTO INTR_DRAW_END ;描画フラグ4が0ならば描画処理終了へ MOVLW B'10' MOVWF ARG0 ;引数1に、B'10'を代入して COMF RLEDNUM, W ;RLEDNUM変数を反転してWレジスタに代入し CALL DRAWLED ;DRAWLED関数呼び出し BCF INTCON, T0IF ;割込みフラグをリセット INTR_DRAW_END MOVF INTRARG0, W MOVWF ARG0 ;退避していたARG0変数を復元 MOVF INTRWREG, W ;退避していたWレジスタを復元 RETFIE ;割込み許可で終了 MAIN BSF STATUS, RP0 ;バンク1を選択 CLRF TRISB ;PORTBの入出力設定を、全出力に MOVLW B'10000110' ;プリスケーラをTMR0に使用し MOVWF OPTION_REG ;スケールを1:128に BCF STATUS, RP0 ;バンク0を選択 MOVLW B'10100000' MOVWF INTCON ;TMR0割込み、グローバル割り込みを許可 MOVLW B'11111111' IORWF PORTB, F ;PORTBの出力をすべてHIに CLRF TMR0 CLRF SELC CLRF FLGS CLRF DRAWFLG CLRF SEGNUM CLRF BLEDNUM CLRF RLEDNUM CALL WAIT400MS CALL INITSWITCH ;スイッチ使用設定 CALL INITLED ;LED使用設定 BSF DRAWFLG, 0 ; BSF DRAWFLG, 1 ;描画フラグ1,2を1に MAIN_LOOP CALL CLRSW ;スイッチフラグリセット関数呼び出し CALL WAIT400MS ;スイッチ用ウェイト MOVF SELC, W MOVWF SEGNUM ;SEGNUM変数に、SELC変数を代入 MOVF SELC, W ;SELC変数の内容をWレジスタに代入 BTFSC SWFLG, 2 ;スイッチフラグ2が1ならば CALL ACTION ;ACTION関数呼び出し BCF FLGS, 0 ;リセット許可フラグを0に BTFSC SWFLG, 0 ;スイッチフラグ1が1ならば GOTO SEL_DEC ;SELC変数を減算する BTFSC SWFLG, 1 ;スイッチフラグ2が1ならば GOTO SEL_INC ;SELC変数を加算する GOTO MAIN_LOOP SEL_INC INCF SELC, F MOVF SELC, W SUBLW D'8' BTFSS STATUS, C ;SELC変数が、8を超えたら GOTO INC_OVER GOTO MAIN_LOOP INC_OVER CLRF SELC ;SELC変数を0に GOTO MAIN_LOOP SEL_DEC DECF SELC, F MOVF SELC, W XORLW 0xFF BTFSC STATUS, Z ;SELC変数が0のときに、減算したら GOTO DEC_ZERO GOTO MAIN_LOOP DEC_ZERO MOVLW D'8' MOVWF SELC ;SELC変数を8に GOTO MAIN_LOOP ;MAIN ACTION FUNCTION ACTION MOVWF ACMEM1 ;Wレジスタの内容を、ACMEM1変数へ CALL WAIT400MS MOVF ACMEM1, W SUBLW D'8' BTFSS STATUS, C ;ACMEM1変数の値が8を超えていたら RETURN ;終了 MOVF ACMEM1, W CLRF PCLATH ;上位プログラムカウンタを0に ADDWF PCL, F ;下位プログラムカウンタの内容に、ACMEM1変数の値を代入 GOTO ACT0 GOTO ACT1 GOTO ACT2 GOTO ACT3 GOTO ACT4 GOTO ACT5 GOTO ACT6 GOTO ACT7 GOTO ACT8 ;実験1 図1のLED 駆動回路1を用いて8ビットの2進数の値を1秒間隔で00000000 から00001111 までの値を順次発光させるプログラムを作れ。 ACT0 BSF FLGS, 0 ;リセット許可フラグを1に CLRF DRAWFLG ;描画フラグ用変数をリセット CALL INITLED ;LED使用設定 BSF DRAWFLG, 2 ;描画フラグ3を1に CLRF BLEDNUM ACTION_LOOP0 CALL WAIT1SEC INCF BLEDNUM, F MOVF BLEDNUM, W XORLW B'00001111' BTFSS STATUS, Z GOTO ACTION_LOOP0 ;BLEDNUM変数の値がB'00001111'になったらGOTOをスキップ CALL WAIT1SEC ;1秒待って終わる GOTO ACTION_END ;実験2 2つの8ゼグメントLED を制御して異なる2つの16進数値をあたかも同時に表示されているようするプログラムを作り実行させよ。 ACT1 BSF FLGS, 0 ;リセット許可フラグを1に BSF DRAWFLG, 6 ;SEGHI表示フラグを1に CLRF SEGNUM CLRF DRAWFLG CALL INITLED ;LED使用設定 BSF DRAWFLG, 0 BSF DRAWFLG, 1 ;描画フラグ1,2を1に ACTION_LOOP1 CALL WAIT100MS INCF SEGNUM, F ;100msごとに、SEGNUM変数の値を加算 GOTO ACTION_LOOP1 GOTO ACTION_END ;実験3 圧電スピーカ回路を利用して1 KH zの信号を鳴らすプログラムを作り実行させよ。 ←1秒間再生します ACT2 BSF FLGS, 0 ;リセット許可フラグを1に BCF DRAWFLG, 7 ;描画使用フラグを0に CALL INITBEEP ;ブザー使用設定 MOVLW D'250' MOVWF ARG2 MOVLW D'4' MOVWF ARG1 MOVLW D'100' MOVWF ARG0 MOVLW D'1' CALL BEEP ;1KHzの音を1秒間鳴らすように設定し、BEEP関数呼び出し GOTO ACTION_END ;実験4 圧電スピーカ回路を使って1 KH zの信号を2秒間発振し4秒間発振を止める無限ループプログラムを作り実行させよ。 ACT3 BSF FLGS, 0 ;リセット許可フラグを1に BCF DRAWFLG, 7 ;描画使用フラグを0に CALL INITBEEP ;ブザー使用設定 ACTION_LOOP3 MOVLW D'250' MOVWF ARG2 MOVLW D'8' MOVWF ARG1 MOVLW D'100' MOVWF ARG0 MOVLW D'1' CALL BEEP ;1KHzの音を2秒間鳴らすように設定し、BEEP関数呼び出し MOVLW D'250' MOVWF ARG1 MOVLW D'228' MOVWF ARG0 MOVLW D'7' CALL WAIT ;4秒間待つように設定し、WAIT関数呼び出し GOTO ACTION_LOOP3 GOTO ACTION_END ;実験5 タッチセンサーにタッチすると図3のLED 駆動回路1の出力が点滅を繰り返すプログラムを作り実行させよ。繰り返す周期は1秒にすること。 ACT4 BSF FLGS, 0 ;リセット許可フラグを1に CALL INITTOUCHSENSOR ;タッチセンサー使用設定 ACTION_LOOP4 BTFSC PORTA, 0 GOTO ACTION_LOOP4 ;タッチセンサーが触られるまで待つ CLRF BLEDNUM CLRF DRAWFLG CALL INITLED ;LED使用設定 BSF DRAWFLG, 2 ;描画フラグ3を1に ACTION_LOOP4_2 COMF BLEDNUM, F ;BLEDNUM変数を反転 CALL WAIT1SEC ;1秒待つ GOTO ACTION_LOOP4_2 GOTO ACTION_END ;実験6 3つのうちの1つのみを用いてスイッチを押した回数を表示回路1に表示するプログラムを作り実行させよ。 ACT5 BSF FLGS, 0 ;リセット許可フラグを1に CLRF SEGNUM CLRF BLEDNUM CLRF DRAWFLG CALL INITSWITCH ;スイッチ使用設定 CALL INITLED ;LED使用設定 BSF DRAWFLG, 0 ; BSF DRAWFLG, 1 ; BSF DRAWFLG, 2 ;描画フラグ1,2,3を1に CLRF ACMEM1 ACTION_LOOP5 CALL CLRSW ;スイッチフラグ1,2,3クリア CALL WAIT400MS ;スイッチ用ウェイト BTFSC SWFLG, 0 ;スイッチフラグ1が1ならば INCF BLEDNUM, F ;BLEDNUM変数を加算する BTFSC SWFLG, 1 ;スイッチフラグ2が1ならば CLRF BLEDNUM ;BLEDNUM変数をクリア MOVF BLEDNUM, W MOVWF SEGNUM ;SEGNUM変数にBLEDNUM変数の値を代入 GOTO ACTION_LOOP5 GOTO ACTION_END ;実験7 LED 駆動回路3を用いて数字の1からF までの数字を1秒間隔で順次表示していくプログラムをつくり実行させよ。 ←少し改造しました ACT6 BSF FLGS, 0 ;リセット許可フラグを1に CALL INITSWITCH ;スイッチ使用設定 CLRF DRAWFLG CALL INITLED ;描画使用設定 BSF DRAWFLG, 0 BSF DRAWFLG, 1 BSF DRAWFLG, 2 ;描画フラグ1,2,3を1に CLRF SEGNUM CLRF BLEDNUM ACTION_LOOP6 MOVLW D'10' ;100msを10回繰り返して1秒を作り出す MOVWF ACMEM1 ACTION_LOOP6_2 CALL CLRSW ;スイッチフラグ1,2,3をクリア CALL WAIT100MS BTFSC SWFLG, 0 ;スイッチフラグ1が1ならば CLRF SEGNUM ;SEGNUM変数をクリア BTFSC SWFLG, 0 ;スイッチフラグ1が1ならば CLRF BLEDNUM ;BLEDNUM変数をクリア DECFSZ ACMEM1, F ;ACMEM1変数を減算して GOTO ACTION_LOOP6_2 ;0になったらGOTOをスキップ INCF SEGNUM, F ;SEGNUM変数を加算して BTFSC STATUS, Z ;一周したら INCF BLEDNUM, F ;BLEDNUM変数を加算 GOTO ACTION_LOOP6 GOTO ACTION_END ;実験8 LED 表示回路2を用いて高速で00000000 B から11111111 B まで変化させながら表示させスイッチキーを押したときに表示している値を ;LED 表示回路1に表示するプログラムを作り実行させよ。 ACT7 BSF FLGS, 0 ;リセット許可フラグを1に CALL INITSWITCH ;スイッチ使用設定 CLRF DRAWFLG CALL INITLED ;LED使用設定 BSF DRAWFLG, 0 BSF DRAWFLG, 1 BSF DRAWFLG, 2 ;描画フラグ1,2,3を1に CLRF SEGNUM CLRF BLEDNUM CLRF ACMEM1 ACTION_LOOP7 CALL CLRSW ;スイッチフラグ1,2,3をクリア CALL WAIT400MS ;スイッチ用ウェイト INCF BLEDNUM, F ;BLEDNUMを加算 BTFSS SWFLG, 0 ;スイッチフラグ1が1ならば GOTO ACTION_LOOP7 ;ループを抜ける MOVF BLEDNUM, W MOVWF SEGNUM ;SEGNUM変数に、BLEDNUM変数をコピー CALL WAIT1SEC GOTO ACTION_END ;オリジナル(3オクターブの音階再生プログラム) ACT8 BSF FLGS, 0 ;リセット許可フラグを1に CLRF DRAWFLG CALL INITSWITCH ;スイッチ使用設定 CALL INITLED ;LED使用設定 BSF DRAWFLG, 0 BSF DRAWFLG, 1 ;描画フラグ1,2を1に BSF DRAWFLG, 6 CLRF ACMEM1 CLRF ACMEM2 ACTION_LOOP8 CALL CLRSW ;スイッチ使用設定 CALL WAIT400MS ;スイッチ用ウェイト CLRF SEGNUM ;SEGNUM変数をクリアして MOVF ACMEM2, W ; IORWF SEGNUM, F ; SWAPF ACMEM1, W ; ANDLW B'11110000' ;上位4ビットにACMEM1変数の下位4ビットの内容を IORWF SEGNUM, F ;下位4ビットにACMEM2変数の下位4ビットの内容を代入する BTFSC SWFLG, 0 ;スイッチフラグ1が1ならば INCF ACMEM1, F ;ACMEM1変数を加算する MOVF ACMEM1, W SUBLW D'10' BTFSC STATUS, C ;ACMEM1変数の内容が、10以内ならば GOTO ACTION_SKIP8 ;通常処理へジャンプ CLRF ACMEM1 ;10を超えていたら、ACMEM1の内容をクリアして INCF ACMEM2, F ;ACMEM2の内容を加算 MOVF ACMEM2, W SUBLW D'3' ;ACMEM2が3を超えていなければ BTFSC STATUS, C GOTO ACTION_SKIP8 ;通常処理へ戻る CLRF ACMEM2 ;超えていれば、ACMEM2をクリア ACTION_SKIP8 BTFSS SWFLG, 1 ;スイッチフラグ2が1ならば GOTO ACTION_SKIP8_2 ;GOTO文を飛ばして、音階を再生する BCF DRAWFLG, 7 ;描画使用フラグを0に CALL INITBEEP ;ビープ使用設定 MOVLW D'20' MOVWF ARG0 MOVF SEGNUM, W ;SEGNUM変数の上位4ビットを半音に、下位4ビットをオクターブに設定して CALL PLAYSCALE ;PLAYSCALE関数呼び出し BSF DRAWFLG, 7 ;描画使用フラグを1に CALL INITSWITCH ;スイッチ使用設定 ACTION_SKIP8_2 GOTO ACTION_LOOP8 GOTO ACTION_END ACTION_END CALL INITLED ;LED使用設定 CALL INITSWITCH ;スイッチ使用設定 CALL CLRSW ;スイッチフラグ1,2,3をクリア MOVF DRAWFLG, W ANDLW B'11110000' ;DRAWFLG変数の下位4ビットを0にして ADDLW B'11' ;B'11'を加算する MOVWF DRAWFLG BCF DRAWFLG, 6 ;SEGHI表示フラグを0に RETURN ;1秒待つ関数 ;250*200*2 *10 = 1,000,000 us WAIT1SEC MOVLW D'250' MOVWF ARG1 MOVLW D'200' MOVWF ARG0 MOVLW D'2' CALL WAIT RETURN ;400ミリ秒待つ関数 ;250*160*1 *10 = 400,000 us WAIT400MS MOVLW D'250' MOVWF ARG1 MOVLW D'160' MOVWF ARG0 MOVLW D'1' CALL WAIT RETURN ;100ミリ秒待つ関数 ;250*40*1 *10 = 100,000 us WAIT100MS MOVLW D'250' MOVWF ARG1 MOVLW D'40' MOVWF ARG0 MOVLW D'1' CALL WAIT RETURN ;音階再生関数 ; 使用引数 : Wレジスタ = 音階(上位4ビット:半音、下位4ビット:オクターブ) ; 半音は0~10まで、オクターブは0~3まで可能 ; : ARG0 = 再生時間 (* 50ms) ; 例: Wレジスタ=0 && ARG0=20 (130Hzの音階を1秒間再生する) PLAYSCALE MOVWF PSWREG ;Wレジスタ退避 MOVWF PSMEM1 ;Wレジスタの下位4ビットを MOVWF PSMEM2 ; MOVLW B'1111' ; ANDWF PSMEM1, F ;PSMEM1に SWAPF PSMEM2, F ; ANDWF PSMEM2, W ;上位4ビットを MOVWF PSMEM2 ;PSMEM2とPSMEM3に代入する MOVWF PSMEM3 ; MOVF PSMEM1, W ;PSMEM1が SUBLW D'3' ;3を超えていたら BTFSS STATUS, C ; RETURN ;終了する MOVF PSMEM2, W ;PSMEM2が SUBLW D'10' ;10を超えていたら BTFSS STATUS, C ; RETURN ;終了する MOVF PSMEM2, W ;PSMEM2の半音を引数に CALL GETTONETIME ;半音の定数を取得し MOVWF PSMEM2 ;PSMEM2に代入 MOVF PSMEM3, W ;PSMEM3の半音を引数に CALL GETTONECOUNT ;半音の定数を取得し MOVWF PSMEM3 ;PSMEM3に代入 MOVF PSMEM1, F ;PSMEM1のオクターブが BTFSC STATUS, Z ;0ならば GOTO SKIP_2MUL ;オクターブ上げ処理を飛ばす LOOP_2MUL RRF PSMEM2, F ;オクターブの数の分だけ BCF PSMEM2, 7 ;PSMEM2を2割する RLF PSMEM3, F ;オクターブの数の分だけ BCF PSMEM3, 0 ;PSMEM3を2倍する DECFSZ PSMEM1, F ;オクターブの数だけ繰り返したら GOTO LOOP_2MUL ;ループを抜ける SKIP_2MUL MOVF ARG0, W ;ARG0を MOVWF PSARG0 ;退避する MOVWF PSMEM4 ;ARG0にある再生時間をPSMEM4へ PLAY_LOOP MOVF PSMEM3, W ;50msになるように回数計算した MOVWF ARG2 ;PSMEM3をARG2へ MOVLW D'1' MOVWF ARG1 MOVF PSMEM2, W ;周波数を求めた MOVWF ARG0 ;PSMEM2をARG0へ MOVLW D'3' CALL BEEP ;ビープを鳴らす DECFSZ PSMEM4, F ;再生時間の数だけ50msを繰り返す GOTO PLAY_LOOP MOVF PSARG0, W MOVWF ARG0 ;ARG0復元 MOVF PSWREG, W ;Wレジスタ復元 RETURN ;ビープ再生関数 ; 使用引数 : Wレジスタ,ARG0 = 特殊周波数指定(求め方: X = ((1/Hz)*1000*100)/Y ;(X <= 255):: ARG0 = X, Wレジスタ = Y) ; : ARG1,ARG2 = 内部のループを何回するか(時間の求め方: ARG2*ARG1*ARG0*Wレジスタ*10us) ; : 推奨設定: ARG2 > ARG1 BEEP BCF PORTA, 3 ;ブザーを使用するためにRA3をLOWに MOVWF BPMEM1 ;Wレジスタの内容をBPMEM1に MOVF ARG0, W ; MOVWF BPARG0 ;ARG0の内容を退避 RRF ARG0, W ;ARG0の内容を2割して ANDLW B'1111111' ; MOVWF BPMEM2 ;BPMEM2に代入する MOVF ARG1, W ;ARG1の内容を退避 MOVWF BPARG1 ; MOVWF BPMEM3 ;ARG1の内容をBPMEM3に代入する BEEP_LOOP2 MOVF ARG2, W ; MOVWF BPMEM4 ;ARG2の内容をBPMEM4に代入する MOVF BPMEM2, W ;2割したARG0の内容を MOVWF ARG1 ;ARG1に代入 MOVF BPMEM1, W MOVWF ARG0 MOVLW D'1' BEEP_LOOP1 BCF PORTA, 2 ;ブザー系統の出力をLOWに CALL WAIT ;上で指定した時間だけウェイト BSF PORTA, 2 ;ブザー系統の出力をHIに CALL WAIT ;上で指定した時間だけウェイト DECFSZ BPMEM4, F ;BPMEM4が0になったら GOTO BEEP_LOOP1 ;ループを抜ける DECFSZ BPMEM3, F ;BPMEM3が0になったら GOTO BEEP_LOOP2 ;ブザーのループ終了 MOVF BPARG1, W MOVWF ARG1 ;退避したARG1を復元 MOVF BPARG0, W MOVWF ARG0 ;退避したARG0を復元 MOVF BPMEM1, W ;退避したWレジスタを復元 RETURN ;8セグ表示用関数 ; 使用引数 : Wレジスタ = 表示データ ; : ARG0   = セグメント選択(1:HighSeg, 0:LowSeg) DRAWSEG MOVWF DSWREG ;Wレジスタ退避 MOVWF DSMEM1 ;Wレジスタの内容をDSMEM1に MOVF ARG0, W MOVWF DSARG0 ;ARG0の内容を退避 BTFSC ARG0, 0 ;ARG0が1ならば GOTO DRAW_HIGHSEG ;HISEG描画処理へ MOVLW 0x0F ;下位4ビットを取り出し ANDWF DSMEM1, W ;Wレジスタに代入し CALL CONVSEG ;CONVSEG関数呼び出し MOVWF DSMEM1 ;結果をDSMEM1に代入 MOVLW B'01' ;LEDセレクト番号を指定 MOVWF ARG0 MOVF DSMEM1, W ;描画データをWレジスタに CALL DRAWLED ;DRAWLED関数呼び出し GOTO DRAWSEG_END ;終了処理へ DRAW_HIGHSEG SWAPF DSMEM1, F ;DSMEM1の上下入れ替え MOVLW 0x0F ;下位4ビット取り出し ANDWF DSMEM1, W ;Wレジスタへ代入し CALL CONVSEG ;CONVSEG関数呼び出し MOVWF DSMEM1 ;結果をDSMEM1に MOVLW B'00' ;LEDセレクト番号指定 MOVWF ARG0 MOVF DSMEM1, W ;描画データをWレジスタに代入し CALL DRAWLED ;DRAWLED関数呼び出し DRAWSEG_END MOVF DSARG0, W MOVWF ARG0 ;退避していたARG0の内容を復元 MOVF DSWREG, W ;退避していたWレジスタの内容を復元 RETURN ;LED表示関数 ; 使用引数 : Wレジスタ = 表示データ ; : ARG0 = LEDセレクト番号 DRAWLED MOVWF DLWREG ;Wレジスタの内容を退避 MOVF PORTA, W ;PORTAの状態を取り出し ANDLW B'11111100' ;下位2ビットを0にして IORWF ARG0, W ;ARG0のセレクト番号を書き込み MOVWF PORTA ;PORTAに代入 MOVF DLWREG, W ;表示データを MOVWF PORTB ;PORTBに出力 MOVF DLWREG, W ;退避していたWレジスタの内容を復元 RETURN ;ウェイト関数 ; 使用引数 : WREG, ARG0, ARG1 = 待ち時間( WREG*ARG0*ARG1*10(us) ) ; 推奨設定 : WREG < ARG0 < ARG1 WAIT MOVWF WREGTMP ;Wレジスタの内容を退避 MOVWF WTMEM1 ;Wレジスタの内容をWTMEM1に代入 MOVF ARG1, W ;ARG1の内容を MOVWF WTARG0 ;退避する MOVWF WTMEM2 ;さらにWTMEM2に代入する RRF WTMEM2, F ;ここでWTMEM2の内容を RRF WTMEM2, F ; RRF WTMEM2, F ;8割する MOVF WTMEM2, W ;WTMEM2の内容をWレジスタに書き込み RRF WTMEM2, F ;さらにWTMEM2の内容を2割して RRF WTMEM2, F ;擬似的に10割を作り出す ANDLW B'11111' ;Wレジスタに保存していた8割を MOVWF WTMEM3 ;余分なものを除いてWTMEM3へ代入 MOVF WTMEM2, W ;10割したWTMEM2をWレジスタに代入し ANDLW B'111' ;余分なものを取り除いて SUBWF WTMEM3, W ;WTMEM3からその数を引きWレジスタに代入 SUBWF ARG1, F ;さらにARG1からその数を引く ;以上の処理で長時間の待ち時間で誤差が ;大きくなりすぎないように調整している MOVF ARG1, W ;計算結果が SUBLW D'100' ;100を超えていたら BTFSS STATUS, C INCF ARG1, F ;補正として1引く WAIT_LOOP4 MOVF ARG0, W MOVWF WTMEM2 ;ARG0の内容をWTMEM2に代入 WAIT_LOOP3 MOVF ARG1, W MOVWF WTMEM3 ;ARG1の内容をWTMEM3に代入 WAIT_LOOP2 MOVLW D'10' MOVWF WTMEM4 ;WTMEM4に10を代入 WAIT_LOOP1 NOP NOP DECFSZ WTMEM4, F ;WTMEM4が0になったら GOTO WAIT_LOOP1 ;ループを抜ける DECFSZ WTMEM3, F ;WTMEM3が0になったら GOTO WAIT_LOOP2 ;ループを抜ける DECFSZ WTMEM2, F ;WTMEM2が0になったら GOTO WAIT_LOOP3 ;ループを抜ける DECFSZ WTMEM1, F ;WTMEM1が0になったら GOTO WAIT_LOOP4 ;ウェイトループ終了 MOVF WTARG0, W ;退避していたARG1の内容を MOVWF ARG1 ;復元する MOVF WREGTMP, W ;退避していたWレジスタの内容を復元 RETURN ; スイッチフラグクリア用関数 CLRSW MOVLW B'10000000' ANDWF SWFLG, F RETURN ; 初期化関数群 INITTOUCHSENSOR BSF STATUS, RP0 BSF TRISA, 0 BCF STATUS, RP0 BCF DRAWFLG, 7 RETURN INITCDS BSF STATUS, RP0 BSF TRISA, 1 BCF STATUS, RP0 BSF PORTA, 1 BCF DRAWFLG, 7 RETURN INITSWITCH BSF STATUS, RP0 BSF TRISA, 2 BSF TRISA, 3 BCF STATUS, RP0 CLRF SWFLG BSF SWFLG, 7 RETURN INITBEEP BSF STATUS, RP0 BCF TRISA, 2 BCF TRISA, 3 BCF STATUS, RP0 BCF SWFLG, 7 RETURN INITLED BSF STATUS, RP0 BCF TRISA, 0 BCF TRISA, 1 CLRF TRISB BCF STATUS, RP0 BSF DRAWFLG, 7 RETURN ;----------------定数用テーブル---------------- ORG 0x3C8 ;セグメント用表示定数テーブル CONVSEG MOVWF WREGTMP MOVLW 0x3 MOVWF PCLATH MOVF WREGTMP, W ADDWF PCL, F RETLW B'1000000' RETLW B'1111001' RETLW B'0100100' RETLW B'0110000' RETLW B'0011001' RETLW B'0010010' RETLW B'0000010' RETLW B'1011000' RETLW B'0000000' RETLW B'0010000' RETLW B'0001000' RETLW B'0000011' RETLW B'1000110' RETLW B'0100001' RETLW B'0000110' RETLW B'0001110' ;音階表示プログラム用定数テーブル GETTONETIME MOVWF WREGTMP MOVLW 0x3 MOVWF PCLATH MOVF WREGTMP, W ADDWF PCL, F RETLW D'255' RETLW D'241' RETLW D'227' RETLW D'214' RETLW D'202' RETLW D'191' RETLW D'180' RETLW D'170' RETLW D'161' RETLW D'152' RETLW D'143' RETLW D'135' ;音階表示プログラム用定数テーブル GETTONECOUNT MOVWF WREGTMP MOVLW 0x3 MOVWF PCLATH MOVF WREGTMP, W ADDWF PCL, F RETLW D'7' RETLW D'7' RETLW D'7' RETLW D'8' RETLW D'8' RETLW D'9' RETLW D'9' RETLW D'10' RETLW D'10' RETLW D'11' RETLW D'12' RETLW D'12' END
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_14_1489.asm
ljhsiun2/medusa
9
104432
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_A_ht+0xd05b, %r11 nop nop nop and $47252, %r9 vmovups (%r11), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %rsi nop nop nop xor $63472, %r15 lea addresses_WC_ht+0x12c5b, %r14 nop nop nop nop and $10496, %rcx mov (%r14), %r10d nop nop nop nop add $43082, %r9 lea addresses_WC_ht+0x15c5b, %rsi lea addresses_WT_ht+0x1c997, %rdi nop nop nop sub $33344, %r14 mov $56, %rcx rep movsl nop nop and %r10, %r10 lea addresses_WT_ht+0x849b, %rsi lea addresses_UC_ht+0x1b45b, %rdi clflush (%rdi) nop nop nop and %r14, %r14 mov $107, %rcx rep movsb nop nop nop nop nop dec %rdi lea addresses_UC_ht+0xfa5b, %rdi nop nop nop add %r14, %r14 mov (%rdi), %r10d nop nop nop nop and %r14, %r14 lea addresses_A_ht+0x1556b, %rsi nop nop xor %r11, %r11 movb $0x61, (%rsi) nop nop cmp $31821, %r10 lea addresses_UC_ht+0xe47b, %r9 nop nop nop nop add $13586, %r10 mov $0x6162636465666768, %rsi movq %rsi, %xmm2 vmovups %ymm2, (%r9) nop nop nop nop nop sub $64011, %r10 pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbx push %rdi push %rdx push %rsi // Load lea addresses_RW+0x505b, %rdi nop nop xor $12370, %rbx movups (%rdi), %xmm3 vpextrq $0, %xmm3, %rsi cmp $54096, %rdi // Load lea addresses_WT+0x1ac13, %r14 nop nop nop nop nop xor $25667, %r12 vmovups (%r14), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %rbx nop nop nop nop cmp %r14, %r14 // Store lea addresses_normal+0x7361, %r12 nop nop cmp %rdi, %rdi movb $0x51, (%r12) nop nop nop nop nop sub $7586, %r14 // Store lea addresses_WT+0x18e97, %r11 nop nop nop sub $28114, %r12 movw $0x5152, (%r11) // Exception!!! nop mov (0), %r12 nop cmp $56840, %rsi // Store lea addresses_UC+0x11adb, %r14 nop and $33862, %rsi movl $0x51525354, (%r14) nop nop nop xor $48558, %r14 // Faulty Load mov $0x62e550000000085b, %rdx nop and $43289, %rbx mov (%rdx), %r11d lea oracles, %rbx and $0xff, %r11 shlq $12, %r11 mov (%rbx,%r11,1), %r11 pop %rsi pop %rdx pop %rdi pop %rbx pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'00': 14} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
PREV/prev/prgs/final/fucking_huge_dump_test.asm
RokKos/FRI_Programiranje
5
98278
% Code generated by PREV compiler SP GREG Stack_Segment FP GREG #6100000000000000 HP GREG Data_Segment LOC Data_Segment L3 BYTE "facItr:",0 L4 BYTE ": ",0 L5 BYTE "facRec:",0 L6 BYTE ": ",0 L7 BYTE "fibItr:",0 L8 BYTE ": ",0 L9 BYTE "fibRec:",0 L10 BYTE ": ",0 L11 BYTE "Combs:",0 L12 BYTE "BinTree:",0 L13 BYTE "Sudoku:",0 L29 BYTE "solve:",0 L31 BYTE "Sudoku2:",0 ReadSize IS 255 ReadArgs BYTE 0,ReadSize % Code Segment LOC #500 Main PUSHJ $8,_main % STOPPING PROGRAM TRAP 0,Halt,0 % Code for function: _main % --- Prolog --- _main SET $0,696 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,720 SUB SP,SP,$0 JMP L168 L168 SET $0,0 SET $1,$0 LDA $0,L3 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,1 SET $2,$0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 L34 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,10 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L35 L33 SET $0,0 SET $0,$0 SET $1,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 LDA $2,L4 LDO $1,$2,0 SET $1,$2 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,0 SET $0,$0 SET $3,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $2,$254,8 PUSHJ $8,_facItr LDO $0,$254,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 JMP L34 L35 SET $0,0 SET $1,$0 LDA $0,L5 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,1 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L37 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,10 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L38 L36 SET $0,0 SET $0,$0 SET $1,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $2,$0 LDA $1,L6 LDO $0,$1,0 SET $0,$1 STO $2,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,0 SET $0,$0 SET $2,$253 SET $3,8 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $2,$254,8 PUSHJ $8,_facRec LDO $0,$254,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L37 L38 SET $0,0 SET $0,$0 LDA $1,L7 LDO $2,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,1 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 L40 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,10 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L41 L39 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $1,$0 LDA $0,L8 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,0 SET $1,$1 SET $3,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $2,$254,8 PUSHJ $8,_fibItr LDO $1,$254,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L40 L41 SET $0,0 SET $2,$0 LDA $1,L9 LDO $0,$1,0 SET $0,$1 STO $2,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,1 SET $2,$0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 L43 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,10 SET $1,$1 CMP $0,$0,$1 ZSNP $0,$0,1 SET $0,$0 BZ $0,L44 L42 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $1,$0 LDA $0,L10 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,0 SET $0,$0 SET $2,$253 SET $3,8 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $2,$254,8 PUSHJ $8,_fibRec LDO $0,$254,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L43 L44 SET $0,0 SET $1,$0 LDA $2,L11 LDO $0,$2,0 SET $0,$2 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,4 SET $2,$0 SET $0,3 SET $0,$0 STO $1,$254,0 STO $2,$254,8 STO $0,$254,16 PUSHJ $8,_combs LDO $0,$254,0 SET $0,0 SET $2,$0 LDA $1,L12 LDO $0,$1,0 SET $0,$1 STO $2,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,5 SET $0,$0 SET $3,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $1,$0 SET $2,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,7 SET $0,$0 SET $3,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $1,$0 SET $2,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,8 SET $1,$1 SET $3,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $1,$0 SET $0,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,2 SET $0,$0 SET $2,$253 SET $3,24 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $1,$0 SET $2,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,6 SET $1,$1 SET $2,$253 SET $3,24 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $2,$0 SET $0,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,8 SET $1,$1 SET $2,$253 SET $3,24 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_delBT LDO $0,$254,0 SET $1,$0 SET $2,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,0 SET $2,$0 LDA $1,L13 LDO $0,$1,0 SET $0,$1 STO $2,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,0 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,3 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,0 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,0 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,9 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,0 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,9 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,1 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,1 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,8 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,4 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,1 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,6 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,1 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,8 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,2 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,9 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,2 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,2 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,3 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,1 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,4 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,2 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,8 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,5 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,3 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,3 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,6 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,7 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,4 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,5 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,9 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,6 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,7 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,5 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,6 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,1 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,5 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,6 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,7 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,6 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,1 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,3 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,2 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,4 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,7 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,7 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,8 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,5 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,0 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,7 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,1 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,2 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,3 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,4 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,4 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,5 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,9 SET $1,$0 SET $2,$253 SET $0,672 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,6 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,3 SET $0,$0 SET $2,$253 SET $1,672 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,7 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $0,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,8 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $1,$253 SET $2,672 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_sudoku LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,680 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,680 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,10 SET $0,$0 SET $2,256 SET $2,$2 DIV $0,$0,$2 GET $0,rR SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,0 SET $0,$0 JMP L169 % --- Epilogue --- L169 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,696 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _facItr % --- Prolog --- _facItr SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,24 SUB SP,SP,$0 JMP L170 L170 SET $0,1 SET $0,$0 SET $1,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 L46 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSP $0,$0,1 SET $0,$0 BZ $0,L47 L45 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 MUL $0,$0,$1 SET $0,$0 SET $1,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 SUB $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L46 L47 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L171 % --- Epilogue --- L171 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _facRec % --- Prolog --- _facRec SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L172 L172 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L50 L48 SET $0,1 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L49 L50 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,1 SET $2,$2 SUB $2,$3,$2 SET $2,$2 STO $0,$254,0 STO $2,$254,8 PUSHJ $8,_facRec LDO $0,$254,0 SET $0,$0 MUL $0,$1,$0 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L49 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L173 % --- Epilogue --- L173 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _fibItr % --- Prolog --- _fibItr SET $0,40 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L174 L174 SET $0,1 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 SET $0,1 SET $1,$0 SET $2,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $2,$0 SET $0,$253 SET $1,24 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 L52 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 CMP $0,$1,$0 ZSP $0,$0,1 SET $0,$0 BZ $0,L53 L51 SET $1,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $1,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $2,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $2,$0 SET $1,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 SUB $0,$1,$0 SET $2,$0 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 JMP L52 L53 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L175 % --- Epilogue --- L175 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,40 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _fibRec % --- Prolog --- _fibRec SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L176 L176 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,2 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L56 L54 SET $0,1 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 JMP L55 L56 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,1 SET $1,$1 SUB $1,$2,$1 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_fibRec LDO $0,$254,0 SET $1,$0 SET $0,0 SET $0,$0 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,2 SET $3,$3 SUB $2,$2,$3 SET $2,$2 STO $0,$254,0 STO $2,$254,8 PUSHJ $8,_fibRec LDO $0,$254,0 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L55 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L177 % --- Epilogue --- L177 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _combs % --- Prolog --- _combs SET $0,824 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,840 SUB SP,SP,$0 JMP L178 L178 SET $0,0 SET $1,$0 SET $2,$253 SET $0,808 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 L67 SET $0,$253 SET $1,808 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,100 SET $0,$0 CMP $0,$1,$0 ZSN $0,$0,1 SET $0,$0 BZ $0,L68 L66 SET $0,0 SET $0,$0 SET $1,$253 SET $2,800 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $3,$253 SET $2,808 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,$253 SET $1,808 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $1,$253 SET $0,808 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L67 L68 SET $0,$253 SET $1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,L19 LDO $0,$254,0 SET $0,0 SET $0,$0 JMP L179 % --- Epilogue --- L179 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,824 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: L19 % --- Prolog --- L19 SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L180 L180 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L62 L57 SET $0,0 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L60 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSN $0,$0,1 SET $0,$0 BZ $0,L61 L59 SET $0,0 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $0,$0 SET $2,800 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,$253 SET $3,8 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 LDO $0,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,32 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L60 L61 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 JMP L58 L62 SET $0,1 SET $0,$0 SET $2,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 L64 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSNP $0,$0,1 SET $0,$0 BZ $0,L65 L63 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $2,$0 SET $0,800 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,1 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,L19 LDO $0,$254,0 JMP L64 L65 SWYM 0,4,2 %Two labels one after another L58 SET $0,0 SET $0,$0 JMP L181 % --- Epilogue --- L181 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _printBT % --- Prolog --- _printBT SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,32 SUB SP,SP,$0 JMP L182 L182 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSZ $0,$0,1 SET $0,$0 BZ $0,L71 L69 SET $0,0 SET $0,$0 SET $1,36 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 JMP L70 L71 SET $0,0 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,0 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,40 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,44 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_printBT LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,41 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 L70 SET $0,0 SET $0,$0 JMP L183 % --- Epilogue --- L183 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _insBT % --- Prolog --- _insBT SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L184 L184 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L74 L72 SET $0,0 SET $1,$0 SET $0,24 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_new LDO $0,$254,0 SET $2,$0 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,0 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L73 L74 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L80 L75 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,0 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSN $0,$0,1 SET $0,$0 BZ $0,L79 L77 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L78 L79 SET $0,0 SET $1,$0 SET $0,$253 SET $2,8 SET $2,$2 ADD $0,$0,$2 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,16 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_insBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 L78 JMP L76 L80 SWYM 0,4,2 %Two labels one after another L76 SWYM 0,4,2 %Two labels one after another L73 SET $0,$253 SET $1,16 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L185 % --- Epilogue --- L185 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _delBT % --- Prolog --- _delBT SET $0,32 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,56 SUB SP,SP,$0 JMP L186 L186 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L95 L81 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L91 L83 SET $1,$253 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 SET $1,$253 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,0 SET $2,$2 CMP $1,$1,$2 ZSZ $1,$1,1 SET $1,$1 AND $0,$0,$1 SET $0,$0 BZ $0,L87 L85 SET $0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_del LDO $0,$254,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L86 L87 SET $0,$253 SET $1,16 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L90 L88 SET $0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_maxBT LDO $0,$254,0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,0 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,$253 SET $3,16 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_delBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 SET $0,0 JMP L89 L90 SET $0,0 SET $0,$0 SET $1,$253 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_minBT LDO $0,$254,0 SET $0,$0 SET $1,$253 SET $2,16 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $1,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,0 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 SET $0,0 SET $1,$0 SET $2,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_delBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 L89 SWYM 0,4,2 %Two labels one after another L86 JMP L84 L91 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,0 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSN $0,$0,1 SET $0,$0 BZ $0,L94 L92 SET $0,0 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $0,$254,0 STO $1,$254,8 STO $2,$254,16 PUSHJ $8,_delBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 JMP L93 L94 SET $0,0 SET $1,$0 SET $2,$253 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,16 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,_delBT LDO $0,$254,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 L93 SWYM 0,4,2 %Two labels one after another L84 JMP L82 L95 SWYM 0,4,2 %Two labels one after another L82 SET $0,$253 SET $1,16 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L187 % --- Epilogue --- L187 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,32 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _minBT % --- Prolog --- _minBT SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L188 L188 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSZ $0,$0,1 SET $0,$0 BZ $0,L98 L96 SET $0,0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L97 L98 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSZ $0,$0,1 SET $0,$0 BZ $0,L101 L99 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L100 L101 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_minBT LDO $0,$254,0 SET $2,$0 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 L100 SWYM 0,4,2 %Two labels one after another L97 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L189 % --- Epilogue --- L189 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _maxBT % --- Prolog --- _maxBT SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,40 SUB SP,SP,$0 JMP L190 L190 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L104 L102 SET $0,0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L103 L104 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,16 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSZ $0,$0,1 SET $0,$0 BZ $0,L107 L105 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 SET $2,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L106 L107 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_maxBT LDO $0,$254,0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 L106 SWYM 0,4,2 %Two labels one after another L103 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L191 % --- Epilogue --- L191 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _sudoku % --- Prolog --- _sudoku SET $0,24 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,48 SUB SP,SP,$0 JMP L192 L192 SET $0,0 SET $1,$0 LDA $0,L31 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,$253 SET $1,8 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 SET $2,$253 SET $0,0 SET $1,$0 SET $0,81 SET $0,$0 STO $2,$254,0 STO $1,$254,8 STO $0,$254,16 PUSHJ $8,L30 LDO $0,$254,0 SET $0,$0 JMP L193 % --- Epilogue --- L193 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,24 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: L26 % --- Prolog --- L26 SET $0,112 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,112 SUB SP,SP,$0 JMP L194 L194 SET $0,1 SET $1,$0 SET $2,$253 SET $0,96 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,1 SET $2,$0 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 L109 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L110 L108 SET $0,0 SET $0,$0 SET $2,$253 SET $1,80 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $3,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $2,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L109 L110 SET $0,0 SET $2,$0 SET $0,$253 SET $1,88 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 L112 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSN $0,$0,1 SET $0,$0 BZ $0,L119 L111 SET $0,$253 LDO $0,$0,0 SET $1,$0 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,72 SET $2,$2 MUL $1,$1,$2 SET $1,$1 ADD $0,$0,$1 SET $0,$0 SET $1,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 MUL $1,$2,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L118 L113 SET $0,$253 SET $1,80 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 SET $1,$253 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $3,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,8 SET $2,$2 MUL $1,$1,$2 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 BZ $0,L117 L115 SET $0,0 SET $1,$0 SET $2,$253 SET $0,96 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L116 L117 SET $0,1 SET $1,$0 SET $0,$253 SET $2,80 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $2,$253 LDO $2,$2,0 SET $2,$2 SET $3,8 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $4,$253 SET $3,8 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $4,$3 SET $3,72 SET $3,$3 MUL $3,$4,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 SET $4,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $4,$3 SET $3,8 SET $3,$3 MUL $3,$4,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,8 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L116 JMP L114 L118 SWYM 0,4,2 %Two labels one after another L114 SET $0,$253 SET $1,88 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L112 L119 SET $0,$253 SET $1,96 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L195 % --- Epilogue --- L195 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,112 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: L27 % --- Prolog --- L27 SET $0,112 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,112 SUB SP,SP,$0 JMP L196 L196 SET $0,1 SET $2,$0 SET $0,$253 SET $1,96 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 SET $0,1 SET $1,$0 SET $2,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 L121 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L122 L120 SET $0,0 SET $1,$0 SET $2,$253 SET $0,80 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $2,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L121 L122 SET $0,0 SET $1,$0 SET $0,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L124 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,9 SET $1,$1 CMP $0,$0,$1 ZSN $0,$0,1 SET $0,$0 BZ $0,L131 L123 SET $0,$253 LDO $0,$0,0 SET $1,$0 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,88 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,72 SET $2,$2 MUL $1,$1,$2 SET $1,$1 ADD $0,$0,$1 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 MUL $1,$2,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,0 SET $1,$1 CMP $0,$0,$1 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L130 L125 SET $0,$253 SET $1,80 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $2,$0 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,8 SET $2,$2 MUL $0,$0,$2 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 BZ $0,L129 L127 SET $0,0 SET $2,$0 SET $0,$253 SET $1,96 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 STO $2,$0,0 JMP L128 L129 SET $0,1 SET $1,$0 SET $2,$253 SET $0,80 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $2,$0 SET $0,$253 LDO $0,$0,0 SET $3,$0 SET $0,8 SET $0,$0 ADD $0,$3,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $4,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $4,$3 SET $3,72 SET $3,$3 MUL $3,$4,$3 SET $3,$3 ADD $0,$0,$3 SET $0,$0 SET $4,$253 SET $3,8 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $4,$3 SET $3,8 SET $3,$3 MUL $3,$4,$3 SET $3,$3 ADD $0,$0,$3 SET $0,$0 LDO $0,$0,0 SET $3,$0 SET $0,8 SET $0,$0 MUL $0,$3,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 L128 JMP L126 L130 SWYM 0,4,2 %Two labels one after another L126 SET $0,$253 SET $1,88 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $0,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 JMP L124 L131 SET $0,$253 SET $1,96 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L197 % --- Epilogue --- L197 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,112 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: L28 % --- Prolog --- L28 SET $0,128 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,128 SUB SP,SP,$0 JMP L198 L198 SET $0,1 SET $1,$0 SET $0,$253 SET $2,112 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,1 SET $1,$0 SET $0,$253 SET $2,104 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L133 SET $0,$253 SET $1,104 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,9 SET $1,$1 CMP $0,$0,$1 ZSNP $0,$0,1 SET $0,$0 BZ $0,L134 L132 SET $0,0 SET $0,$0 SET $1,$253 SET $2,80 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $3,$253 SET $2,104 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $1,$253 SET $0,104 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $0,$0 SET $2,$253 SET $1,104 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L133 L134 SET $0,0 SET $0,$0 SET $1,$253 SET $2,96 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 L136 SET $1,$253 SET $0,96 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,3 SET $1,$1 CMP $0,$0,$1 ZSN $0,$0,1 SET $0,$0 BZ $0,L146 L135 SET $0,0 SET $1,$0 SET $2,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 L138 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,3 SET $0,$0 CMP $0,$1,$0 ZSN $0,$0,1 SET $0,$0 BZ $0,L145 L137 SET $0,$253 LDO $0,$0,0 SET $1,$0 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $1,16 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,3 SET $1,$1 MUL $1,$2,$1 SET $1,$1 SET $3,$253 SET $2,96 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 ADD $1,$1,$2 SET $2,$1 SET $1,72 SET $1,$1 MUL $1,$2,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,3 SET $2,$2 MUL $1,$1,$2 SET $1,$1 SET $2,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 ADD $1,$1,$2 SET $1,$1 SET $2,8 SET $2,$2 MUL $1,$1,$2 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L144 L139 SET $0,$253 SET $1,80 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $2,$0 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $2,$0 SET $0,$253 SET $3,16 SET $3,$3 ADD $0,$0,$3 SET $0,$0 LDO $0,$0,0 SET $3,$0 SET $0,3 SET $0,$0 MUL $0,$3,$0 SET $0,$0 SET $4,$253 SET $3,96 NEG $3,0,$3 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $3,$3 ADD $0,$0,$3 SET $3,$0 SET $0,72 SET $0,$0 MUL $0,$3,$0 SET $0,$0 ADD $0,$2,$0 SET $2,$0 SET $0,$253 SET $3,8 SET $3,$3 ADD $0,$0,$3 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $3,3 SET $3,$3 MUL $0,$0,$3 SET $0,$0 SET $4,$253 SET $3,88 NEG $3,0,$3 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $3,$3 ADD $0,$0,$3 SET $3,$0 SET $0,8 SET $0,$0 MUL $0,$3,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,8 SET $2,$2 MUL $0,$0,$2 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 BZ $0,L143 L141 SET $0,0 SET $0,$0 SET $2,$253 SET $1,112 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 JMP L142 L143 SET $0,1 SET $0,$0 SET $2,$253 SET $1,80 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 SET $2,$253 LDO $2,$2,0 SET $2,$2 SET $3,8 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $4,$2 SET $2,$253 SET $3,16 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,3 SET $2,$2 MUL $2,$3,$2 SET $2,$2 SET $3,$253 SET $5,96 NEG $5,0,$5 SET $5,$5 ADD $3,$3,$5 SET $3,$3 LDO $3,$3,0 SET $3,$3 ADD $2,$2,$3 SET $2,$2 SET $3,72 SET $3,$3 MUL $2,$2,$3 SET $2,$2 ADD $2,$4,$2 SET $3,$2 SET $4,$253 SET $2,8 SET $2,$2 ADD $2,$4,$2 SET $2,$2 LDO $2,$2,0 SET $4,$2 SET $2,3 SET $2,$2 MUL $2,$4,$2 SET $2,$2 SET $4,$253 SET $5,88 NEG $5,0,$5 SET $5,$5 ADD $4,$4,$5 SET $4,$4 LDO $4,$4,0 SET $4,$4 ADD $2,$2,$4 SET $4,$2 SET $2,8 SET $2,$2 MUL $2,$4,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 L142 JMP L140 L144 SWYM 0,4,2 %Two labels one after another L140 SET $1,$253 SET $0,88 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $1,$0 SET $0,$253 SET $2,88 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 JMP L138 L145 SET $1,$253 SET $0,96 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,96 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L136 L146 SET $0,$253 SET $1,112 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L199 % --- Epilogue --- L199 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,128 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: L30 % --- Prolog --- L30 SET $0,48 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,72 SUB SP,SP,$0 JMP L200 L200 SET $0,0 SET $1,$0 LDA $0,L29 LDO $2,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putString LDO $0,$254,0 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $1,$253 SET $0,8 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,16 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 CMP $0,$0,$1 ZSZ $0,$0,1 SET $0,$0 BZ $0,L158 L147 SET $0,1 SET $0,$0 BZ $0,L157 L149 SET $0,0 SET $2,$0 SET $1,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 L152 SET $0,$253 SET $1,16 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSN $0,$0,1 SET $0,$0 BZ $0,L156 L151 SET $0,0 SET $1,$0 SET $0,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 L154 SET $1,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSN $0,$0,1 SET $0,$0 BZ $0,L155 L153 SET $0,0 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $2,$0 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $2,$253 SET $3,16 NEG $3,0,$3 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,72 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 SET $3,$253 SET $2,24 NEG $2,0,$2 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 LDO $0,$0,0 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putInt LDO $0,$254,0 SET $0,0 SET $1,$0 SET $0,32 SET $0,$0 STO $1,$254,0 STO $0,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $1,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,1 SET $1,$1 ADD $0,$0,$1 SET $2,$0 SET $1,$253 SET $0,24 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L154 L155 SET $0,0 SET $0,$0 SET $1,10 SET $1,$1 SET $2,256 SET $2,$2 DIV $1,$1,$2 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 SET $0,$253 SET $1,16 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $1,$0 SET $2,$253 SET $0,16 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L152 L156 SET $0,0 SET $0,$0 SET $1,10 SET $2,$1 SET $1,256 SET $1,$1 DIV $1,$2,$1 GET $1,rR SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,_putChar LDO $0,$254,0 JMP L150 L157 SWYM 0,4,2 %Two labels one after another L150 SET $0,0 SET $0,1 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 JMP L148 L158 SET $0,$253 LDO $0,$0,0 SET $0,$0 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 SET $2,8 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,8 SET $1,$1 MUL $1,$2,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 CMP $0,$1,$0 ZSNZ $0,$0,1 SET $0,$0 BZ $0,L161 L159 SET $0,0 SET $1,$0 SET $2,$253 SET $0,8 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $2,$0 SET $0,1 SET $0,$0 ADD $0,$2,$0 SET $0,$0 SET $3,$253 SET $2,16 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $2,$2 STO $1,$254,0 STO $0,$254,8 STO $2,$254,16 PUSHJ $8,L30 LDO $0,$254,0 SET $1,$0 SET $0,$253 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 JMP L160 L161 SET $0,0 SET $1,$0 SET $2,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 STO $1,$0,0 SET $0,1 SET $0,$0 SET $2,$253 SET $1,32 NEG $1,0,$1 SET $1,$1 ADD $1,$2,$1 SET $1,$1 STO $0,$1,0 L163 SET $1,$253 SET $0,32 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,9 SET $0,$0 CMP $0,$1,$0 ZSNP $0,$0,1 SET $0,$0 BZ $0,L167 L162 SET $1,$253 SET $0,32 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $1,$253 LDO $1,$1,0 SET $1,$1 SET $2,8 NEG $2,0,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 LDO $1,$1,0 SET $1,$1 SET $2,$253 SET $3,8 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $1,$1,$2 SET $1,$1 STO $0,$1,0 SET $0,0 SET $0,$0 SET $2,$253 SET $1,8 SET $1,$1 ADD $1,$2,$1 SET $1,$1 LDO $1,$1,0 SET $2,$1 SET $1,9 SET $1,$1 DIV $1,$2,$1 SET $1,$1 STO $0,$254,0 STO $1,$254,8 PUSHJ $8,L26 LDO $0,$254,0 SET $0,$0 SET $1,0 SET $1,$1 SET $2,$253 SET $3,8 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $2,$2 SET $3,9 SET $3,$3 DIV $2,$2,$3 GET $2,rR SET $2,$2 STO $1,$254,0 STO $2,$254,8 PUSHJ $8,L27 LDO $1,$254,0 SET $1,$1 AND $0,$0,$1 SET $1,$0 SET $0,0 SET $2,$0 SET $3,$253 SET $0,8 SET $0,$0 ADD $0,$3,$0 SET $0,$0 LDO $0,$0,0 SET $3,$0 SET $0,9 SET $0,$0 DIV $0,$3,$0 SET $3,$0 SET $0,3 SET $0,$0 DIV $0,$3,$0 SET $0,$0 SET $3,$253 SET $4,8 SET $4,$4 ADD $3,$3,$4 SET $3,$3 LDO $3,$3,0 SET $4,$3 SET $3,9 SET $3,$3 DIV $3,$4,$3 GET $3,rR SET $4,$3 SET $3,3 SET $3,$3 DIV $3,$4,$3 SET $3,$3 STO $2,$254,0 STO $0,$254,8 STO $3,$254,16 PUSHJ $8,L28 LDO $0,$254,0 SET $0,$0 AND $0,$1,$0 SET $0,$0 BZ $0,L166 L164 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,0 SET $0,$0 SET $2,$253 SET $3,8 SET $3,$3 ADD $2,$2,$3 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,1 SET $2,$2 ADD $2,$3,$2 SET $2,$2 SET $4,$253 SET $3,16 SET $3,$3 ADD $3,$4,$3 SET $3,$3 LDO $3,$3,0 SET $3,$3 STO $0,$254,0 STO $2,$254,8 STO $3,$254,16 PUSHJ $8,L30 LDO $0,$254,0 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $1,$253 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L165 L166 SWYM 0,4,2 %Two labels one after another L165 SET $0,0 SET $1,$0 SET $0,$253 LDO $0,$0,0 SET $2,$0 SET $0,8 NEG $0,0,$0 SET $0,$0 ADD $0,$2,$0 SET $0,$0 LDO $0,$0,0 SET $0,$0 SET $3,$253 SET $2,8 SET $2,$2 ADD $2,$3,$2 SET $2,$2 LDO $2,$2,0 SET $3,$2 SET $2,8 SET $2,$2 MUL $2,$3,$2 SET $2,$2 ADD $0,$0,$2 SET $0,$0 STO $1,$0,0 SET $0,$253 SET $1,32 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $1,$0 SET $0,1 SET $0,$0 ADD $0,$1,$0 SET $2,$0 SET $1,$253 SET $0,32 NEG $0,0,$0 SET $0,$0 ADD $0,$1,$0 SET $0,$0 STO $2,$0,0 JMP L163 L167 SET $0,0 L160 SWYM 0,4,2 %Two labels one after another L148 SET $0,$253 SET $1,8 NEG $1,0,$1 SET $1,$1 ADD $0,$0,$1 SET $0,$0 LDO $0,$0,0 SET $0,$0 JMP L201 % --- Epilogue --- L201 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,48 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 --- PREV STD LIB --- % Code for function: _new % --- Prolog --- _new SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,24 SUB SP,SP,$0 JMP L202 L202 SET $0,8 ADD $0,FP,$0 LDO $1,$0,0 SET $0,HP % For return value ADD HP,HP,$1 % --- Epilogue --- L203 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 _del POP 8,0 % Memory leak % Code for function: _putChar % --- Prolog --- _putChar SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,24 SUB SP,SP,$0 JMP L204 L204 SET $0,14 ADD $0,FP,$0 %Putting char one position in front %so that we put end char at the end LDB $1,$0,1 STB $1,$0,0 SET $1,0 STB $1,$0,1 SET $255,$0 TRAP 0,Fputs,StdOut % --- Epilogue --- L205 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _putString % --- Prolog --- _putString SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,24 SUB SP,SP,$0 JMP L206 L206 SET $0,8 ADD $0,FP,$0 LDO $1,$0,0 SET $255,$1 TRAP 0,Fputs,StdOut % --- Epilogue --- L207 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _readString % --- Prolog --- _readString SET $0,16 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,24 SUB SP,SP,$0 JMP L208 L208 LDA $255,ReadArgs SET $0,$255 TRAP 0,Fgets,StdIn % --- Epilogue --- L209 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,16 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0 % Code for function: _putInt % --- Prolog --- _putInt SET $0,32 % Storing FP SUB $0,SP,$0 STO FP,$0,0 % STORING RA GET $1,rJ STO $1,$0,8 % Lowering FP SET FP,SP % Lowering SP SET $0,48 SUB SP,SP,$0 JMP L210 % Storing inverse number L210 SET $0,16 SUB $0,FP,$0 SET $1,1 STO $1,$0,0 % While condition of inverse loop _putInt_Inverse_Loop_ SET $0,8 ADD $0,$0,FP LDO $0,$0,0 BZ $0,_putInt_Print_out_loop % While loop of inverse loop SET $0,16 SUB $0,FP,$0 LDO $2,$0,0 MUL $2,$2,10 % Multipling inverse num SET $0,8 ADD $0,$0,FP LDO $3,$0,0 DIV $3,$3,10 STO $3,$0,0 % Storing N GET $1,rR ADD $2,$2,$1 SET $0,16 SUB $0,FP,$0 STO $2,$0,0 JMP _putInt_Inverse_Loop_ % While condition of print loop _putInt_Print_out_loop SET $0,16 SUB $0,FP,$0 LDO $0,$0,0 SET $1,1 CMP $0,$0,$1 ZSP $0,$0,1 BZ $0,_putInt_Print_out_end SET $0,16 SUB $0,FP,$0 LDO $1,$0,0 DIV $1,$1,10 GET $2,rR STO $1,$0,0 ADD $2,$2,48 STO $2,$254,8 PUSHJ $8,_putChar JMP _putInt_Print_out_loop _putInt_Print_out_end JMP L211 % --- Epilogue --- L211 STO $0,FP,0 % Save return value % Highering Stack pointer SET SP,FP % Getting RA SET $0,32 SUB $0,SP,$0 LDO $1,$0,8 PUT rJ,$1 % Getting old FP LDO FP,$0,0 POP 8,0
programs/oeis/028/A028563.asm
neoneye/loda
22
93264
<gh_stars>10-100 ; A028563: a(n) = n*(n+7). ; 0,8,18,30,44,60,78,98,120,144,170,198,228,260,294,330,368,408,450,494,540,588,638,690,744,800,858,918,980,1044,1110,1178,1248,1320,1394,1470,1548,1628,1710,1794,1880,1968,2058,2150,2244,2340,2438,2538,2640,2744,2850,2958,3068,3180,3294,3410,3528,3648,3770,3894,4020,4148,4278,4410,4544,4680,4818,4958,5100,5244,5390,5538,5688,5840,5994,6150,6308,6468,6630,6794,6960,7128,7298,7470,7644,7820,7998,8178,8360,8544,8730,8918,9108,9300,9494,9690,9888,10088,10290,10494 mov $1,$0 add $1,7 mul $0,$1
source/gaws_program.adb
jquorning/Gauss
4
12508
<reponame>jquorning/Gauss<filename>source/gaws_program.adb -- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, not taking more than you give. -- with Ada.Command_Line; with Command_Line; with Options; -- with Exceptions; with Program; with GAWS_IO; procedure GAWS_Program is Parse_Success : Boolean; begin Command_Line.Parse (Parse_Success); if not Options.Be_Quiet then GAWS_IO.Put_Version; GAWS_IO.Put_Blessing; end if; if not Parse_Success then Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; if Options.Show_Version then GAWS_IO.Put_Version; return; end if; if not Options.Be_Quiet then GAWS_IO.Put_Hints; end if; Program.Run; end GAWS_Program;
Dokafile.g4
quantumsheep/doka
3
5592
grammar Dokafile; translation: instructions EOF; instructions: ( Spacing? instruction '\n')*; instruction: if_instruction | include_instruction | native_instruction | nothing | comment; nothing:; comment: Comment; native_instruction: NativeInstructionCall; if_instruction: If Spacing if_expression '\n' instructions ( Spacing? elif_instruction )? Spacing? End; elif_instruction: Elif Spacing if_expression '\n' instructions ( Spacing? (elif_instruction | else_instruction) )?; else_instruction: Else '\n' instructions; if_expression: value Spacing? (OperatorEq | OperatorNe) Spacing? value; value: StringLiteral | Variable; include_instruction: Include Spacing StringLiteral; If: '!IF'; Else: '!ELSE'; Elif: '!ELIF'; End: '!END'; OperatorEq: '=='; OperatorNe: '!='; Variable: '$' Name; Include: '!INCLUDE'; NativeInstructionCall: NativeInstruction Spacing (~ [\r\n] | '\\\n')*; StringLiteral: ('"' StringChar* '"') | ('\'' CharChar+ '\''); Comment: Spacing? '#' (~ [\r\n])*; Spacing: [ \t]+; fragment NativeInstruction: 'FROM' | 'WORKDIR' | 'LABEL' | 'EXPOSE' | 'ENV' | 'ARG' | 'VOLUME' | 'USER' | 'ONBUILD' | 'STOPSIGNAL' | 'HEALTHCHECK' | 'SHELL' | 'ADD' | 'COPY' | 'RUN' | 'CMD' | 'ENTRYPOINT'; fragment Name: [a-zA-Z_] [a-zA-Z0-9_]*; fragment StringChar: ~ ["\r\n] | Escape; fragment CharChar: ~ ['\r\n] | Escape; fragment Escape: '\\\'' | '\\"' | '\\\\' | '\\n' | '\\r';
programs/oeis/217/A217140.asm
neoneye/loda
22
173031
; A217140: a(n) = m/n where m is the least number divisible by n such that phi(m) = phi(m+6n). ; 24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,60,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,60,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36,24,24,24,24,36 add $0,1 mov $1,4 lpb $0 mul $0,3 add $1,1 dif $0,$1 add $1,1 lpe div $1,2 mul $1,12 mov $0,$1
programs/oeis/074/A074294.asm
neoneye/loda
22
97685
; A074294: Integers 1 to 2*k followed by integers 1 to 2*k + 2 and so on. ; 1,2,1,2,3,4,1,2,3,4,5,6,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,2,3,4,5,6,7,8,9,10 mov $3,$0 mov $0,0 lpb $2,4 add $0,2 sub $3,$0 trn $2,$3 lpe mov $1,$3 add $1,1 mov $0,$1
data/mapObjects/fuchsiacity.asm
adhi-thirumala/EvoYellow
16
3515
FuchsiaCityObject: db $f ; border block db $9 ; warps db $d, $5, $0, FUCHSIA_MART db $1b, $b, $0, FUCHSIA_HOUSE_1 db $1b, $13, $0, FUCHSIA_POKECENTER db $1b, $1b, $0, FUCHSIA_HOUSE_2 db $3, $12, $0, SAFARI_ZONE_ENTRANCE db $1b, $5, $0, FUCHSIA_GYM db $d, $16, $0, FUCHSIA_MEETING_ROOM db $1b, $1f, $1, FUCHSIA_HOUSE_3 db $18, $1f, $0, FUCHSIA_HOUSE_3 db $e ; signs db $17, $f, $b ; FuchsiaCityText11 db $f, $19, $c ; FuchsiaCityText12 db $5, $11, $d ; FuchsiaCityText13 db $d, $6, $e ; MartSignText db $1b, $14, $f ; PokeCenterSignText db $1d, $1b, $10 ; FuchsiaCityText16 db $f, $15, $11 ; FuchsiaCityText17 db $1d, $5, $12 ; FuchsiaCityText18 db $7, $21, $13 ; FuchsiaCityText19 db $7, $1b, $14 ; FuchsiaCityText20 db $7, $d, $15 ; FuchsiaCityText21 db $d, $1f, $16 ; FuchsiaCityText22 db $f, $d, $17 ; FuchsiaCityText23 db $7, $7, $18 ; FuchsiaCityText24 db $a ; objects object SPRITE_BUG_CATCHER, $a, $c, WALK, $2, $1 ; person object SPRITE_GAMBLER, $1c, $11, WALK, $2, $2 ; person object SPRITE_FISHER2, $1e, $e, STAY, DOWN, $3 ; person object SPRITE_BUG_CATCHER, $18, $8, STAY, UP, $4 ; person object SPRITE_CHANSEY, $1f, $5, STAY, DOWN, $5 ; person object SPRITE_BALL, $19, $6, STAY, NONE, $6 ; person object SPRITE_SLOWBRO, $c, $6, WALK, $2, $7 ; person object SPRITE_SLOWBRO, $1e, $c, WALK, $2, $8 ; person object SPRITE_SEEL, $8, $11, WALK, $0, $9 ; person object SPRITE_OMANYTE, $6, $5, STAY, NONE, $a ; person ; warp-to EVENT_DISP FUCHSIA_CITY_WIDTH, $d, $5 ; FUCHSIA_MART EVENT_DISP FUCHSIA_CITY_WIDTH, $1b, $b ; FUCHSIA_HOUSE_1 EVENT_DISP FUCHSIA_CITY_WIDTH, $1b, $13 ; FUCHSIA_POKECENTER EVENT_DISP FUCHSIA_CITY_WIDTH, $1b, $1b ; FUCHSIA_HOUSE_2 EVENT_DISP FUCHSIA_CITY_WIDTH, $3, $12 ; SAFARI_ZONE_ENTRANCE EVENT_DISP FUCHSIA_CITY_WIDTH, $1b, $5 ; FUCHSIA_GYM EVENT_DISP FUCHSIA_CITY_WIDTH, $d, $16 ; FUCHSIA_MEETING_ROOM EVENT_DISP FUCHSIA_CITY_WIDTH, $1b, $1f ; FUCHSIA_HOUSE_3 EVENT_DISP FUCHSIA_CITY_WIDTH, $18, $1f ; FUCHSIA_HOUSE_3
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1142.asm
ljhsiun2/medusa
9
173516
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r14 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0x1c90f, %r9 and %r12, %r12 mov (%r9), %rdi nop nop cmp $40076, %r9 lea addresses_WC_ht+0x4a4f, %rax nop nop nop nop cmp $19117, %r11 mov $0x6162636465666768, %r10 movq %r10, %xmm0 movups %xmm0, (%rax) nop sub %r12, %r12 lea addresses_normal_ht+0x1974f, %r10 nop nop nop nop nop sub $20374, %r14 mov $0x6162636465666768, %rdi movq %rdi, (%r10) cmp $63318, %r12 lea addresses_normal_ht+0x19b8f, %rsi lea addresses_A_ht+0x1a24f, %rdi sub %r9, %r9 mov $38, %rcx rep movsw nop nop nop nop nop cmp $8599, %rsi lea addresses_UC_ht+0x17f4f, %rax clflush (%rax) nop nop sub %r10, %r10 mov (%rax), %r14w nop nop nop nop nop xor %r11, %r11 lea addresses_WT_ht+0x16e4f, %rsi lea addresses_WT_ht+0x11e4f, %rdi nop nop nop nop and %r11, %r11 mov $32, %rcx rep movsl nop nop nop nop and %rax, %rax lea addresses_normal_ht+0x1774f, %rsi lea addresses_WT_ht+0x7cbf, %rdi clflush (%rdi) nop nop nop nop nop xor %r9, %r9 mov $77, %rcx rep movsq nop nop xor $17557, %r9 lea addresses_UC_ht+0x414f, %rdi cmp %r14, %r14 vmovups (%rdi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rcx xor %r10, %r10 lea addresses_WT_ht+0x1ecf6, %rax nop sub $44535, %rsi movups (%rax), %xmm7 vpextrq $0, %xmm7, %rcx nop and %rcx, %rcx lea addresses_WC_ht+0xd04f, %rsi add $45114, %rax mov (%rsi), %r10 nop dec %rdi lea addresses_WT_ht+0x16d77, %rdi nop nop nop nop xor $38323, %r11 movb $0x61, (%rdi) add %r14, %r14 lea addresses_UC_ht+0xfe9f, %rsi lea addresses_WT_ht+0x504f, %rdi nop nop nop nop nop cmp $3600, %r10 mov $111, %rcx rep movsq nop nop nop nop cmp $47097, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r14 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r9 push %rbp push %rcx push %rdx // Store lea addresses_WT+0x1b64f, %r15 nop nop nop nop nop inc %r13 mov $0x5152535455565758, %r9 movq %r9, %xmm1 vmovups %ymm1, (%r15) nop nop nop nop dec %rcx // Load lea addresses_WC+0x900f, %r15 nop nop nop nop inc %rbp movb (%r15), %r12b xor $46480, %rcx // Store mov $0x2d1b5d000000074b, %r13 nop nop nop nop and $18811, %r15 mov $0x5152535455565758, %rbp movq %rbp, %xmm0 vmovups %ymm0, (%r13) and $29574, %rbp // Faulty Load lea addresses_D+0x12e4f, %rdx nop nop nop nop nop sub $29963, %rcx movups (%rdx), %xmm2 vpextrq $0, %xmm2, %r9 lea oracles, %r12 and $0xff, %r9 shlq $12, %r9 mov (%r12,%r9,1), %r9 pop %rdx pop %rcx pop %rbp pop %r9 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': True, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': True, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': True, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 8}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
src/main/agda/leafsF.agda
hablapps/safeoptics
0
7216
<filename>src/main/agda/leafsF.agda {-# OPTIONS --verbose=10 #-} module leafsF where open import Data.Nat open import Data.Vec open import Agda.Builtin.Sigma open import Data.Product open import Data.Fin using (fromℕ) open import trees open import optics open import lemmas leafsTreeF : {A : Set} -> (t : Tree A) -> Vec A (#leafs t) × (Vec A (#leafs t) -> Tree A) leafsTreeF empty = ([] , λ _ -> empty) -- leafsTreeF (node empty root empty) = (root ∷ [] , λ { (hd ∷ []) -> node empty hd empty }) leafsTreeF {A} (node t₁ x t₂) with t₁ | t₂ ... | empty | empty = (x ∷ [] , λ { (hd ∷ []) -> node empty hd empty }) leafsTreeF _ | node t11 x1 t12 | t2 with leafsTreeF (node t11 x1 t12) | leafsTreeF t2 ... | (g₁ , p₁) | (g₂ , p₂) = -- (g₁ ++ g₂ , λ v -> node (p₁ (take n₁ v)) x (p₂ (drop n₁ v))) ({!!} , λ v -> node (p₁ {!!}) x1 (p₂ {!!})) where n₁ = #leafs (node t11 x1 t12) n₂ = #leafs t2 leafsTreeF (node t₁ x t₂) | _ | (node _ _ _) with leafsTreeF t₁ | leafsTreeF t₂ ... | (g₁ , p₁) | (g₂ , p₂) = -- (g₁ ++ g₂ , λ v -> node (p₁ (take n₁ v)) x (p₂ (drop n₁ v))) ({!!} , λ v -> node (p₁ {!!}) x (p₂ {!!})) where n₁ = #leafs t₁ n₂ = #leafs t₂ module tests where tree1 : Tree ℕ tree1 = node (node empty 1 empty) 3 empty open Traversal
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/taft_type1.adb
best08618/asylo
7
27821
<reponame>best08618/asylo -- { dg-do run } with Taft_Type1_Pkg1; procedure Taft_Type1 is begin Taft_Type1_Pkg1.Check; end;
Groups/FreeProduct/Setoid.agda
Smaug123/agdaproofs
4
4875
{-# OPTIONS --safe --warning=error #-} open import Sets.EquivalenceRelations open import Functions.Definition open import Agda.Primitive using (Level; lzero; lsuc; _⊔_; Setω) open import Setoids.Setoids open import Groups.Definition open import LogicalFormulae open import Orders.WellFounded.Definition open import Numbers.Naturals.Semiring open import Groups.Lemmas module Groups.FreeProduct.Setoid {i : _} {I : Set i} (decidableIndex : (x y : I) → ((x ≡ y) || ((x ≡ y) → False))) {a b : _} {A : I → Set a} {S : (i : I) → Setoid {a} {b} (A i)} {_+_ : (i : I) → (A i) → (A i) → A i} (decidableGroups : (i : I) → (x y : A i) → ((Setoid._∼_ (S i) x y)) || ((Setoid._∼_ (S i) x y) → False)) (G : (i : I) → Group (S i) (_+_ i)) where open import Groups.FreeProduct.Definition decidableIndex decidableGroups G =RP' : {m n : _} (s1 : ReducedSequenceBeginningWith m) (s2 : ReducedSequenceBeginningWith n) → Set b =RP' (ofEmpty i g nonZero) (ofEmpty j h nonZero₁) with decidableIndex i j =RP' (ofEmpty i g nonZero) (ofEmpty .i h nonZero₁) | inl refl = Setoid._∼_ (S i) g h =RP' (ofEmpty i g nonZero) (ofEmpty j h nonZero₁) | inr x = False' =RP' (ofEmpty i g nonZero) (prependLetter i₁ g₁ nonZero₁ s2 x) = False' =RP' (prependLetter i g nonZero s1 x) (ofEmpty i₁ g₁ nonZero₁) = False' =RP' (prependLetter i g nonZero s1 x) (prependLetter j h nonZero₁ s2 x₁) with decidableIndex i j =RP' (prependLetter i g nonZero s1 x) (prependLetter .i h nonZero₁ s2 x₁) | inl refl = Setoid._∼_ (S i) g h && =RP' s1 s2 =RP' (prependLetter i g nonZero s1 x) (prependLetter j h nonZero₁ s2 x₁) | inr x₂ = False' _=RP_ : Rel ReducedSequence empty =RP empty = True' empty =RP nonempty i x = False' nonempty i x =RP empty = False' nonempty i x =RP nonempty j y = =RP' x y =RP'reflex : {i : _} (x : ReducedSequenceBeginningWith i) → =RP' x x =RP'reflex (ofEmpty i g nonZero) with decidableIndex i i =RP'reflex (ofEmpty i g nonZero) | inl refl = Equivalence.reflexive (Setoid.eq (S i)) =RP'reflex (ofEmpty i g nonZero) | inr x = exFalso (x refl) =RP'reflex (prependLetter i g nonZero x x₁) with decidableIndex i i =RP'reflex (prependLetter i g nonZero x x₁) | inl refl = Equivalence.reflexive (Setoid.eq (S i)) ,, =RP'reflex x =RP'reflex (prependLetter i g nonZero x x₁) | inr bad = exFalso (bad refl) private reflex : Reflexive _=RP_ reflex {empty} = record {} reflex {nonempty i (ofEmpty .i g nonZero)} with decidableIndex i i reflex {nonempty i (ofEmpty .i g nonZero)} | inl refl = Equivalence.reflexive (Setoid.eq (S i)) ... | inr bad = exFalso (bad refl) reflex {nonempty i (prependLetter .i g nonZero x x₁)} with decidableIndex i i reflex {nonempty i (prependLetter .i g nonZero x x₁)} | inl refl = Equivalence.reflexive (Setoid.eq (S i)) ,, =RP'reflex x reflex {nonempty i (prependLetter .i g nonZero x x₁)} | inr bad = exFalso (bad refl) =RP'symm : {i j : _} (x : ReducedSequenceBeginningWith i) (y : ReducedSequenceBeginningWith j) → =RP' x y → =RP' y x =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) with decidableIndex i j =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) | inl pr with decidableIndex j i =RP'symm (ofEmpty .j g nonZero) (ofEmpty j h nonZero2) | inl refl | inl refl = Equivalence.symmetric (Setoid.eq (S j)) {g} {h} =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) | inl pr | inr x = exFalso (x (equalityCommutative pr)) =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) | inr x with decidableIndex j i =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) | inr x | inl pr = exFalso (x (equalityCommutative pr)) =RP'symm (ofEmpty i g nonZero) (ofEmpty j h nonZero2) | inr x | inr _ = id =RP'symm (ofEmpty i g nonZero) (prependLetter i₁ g₁ nonZero₁ y x) = id =RP'symm (prependLetter i g nonZero x x₁) (ofEmpty i₁ g₁ nonZero₁) = id =RP'symm (prependLetter i g nonZero x x₁) (prependLetter j h nonZero2 y pr2) pr with decidableIndex i j =RP'symm (prependLetter .j g nonZero x x₁) (prependLetter j h nonZero2 y pr2) pr | inl refl with decidableIndex j j =RP'symm (prependLetter .j g nonZero x x₁) (prependLetter j h nonZero2 y pr2) (fst ,, snd) | inl refl | inl refl = Equivalence.symmetric (Setoid.eq (S j)) fst ,, =RP'symm x y snd =RP'symm (prependLetter .j g nonZero x x₁) (prependLetter j h nonZero2 y pr2) pr | inl refl | inr bad = exFalso (bad refl) =RP'symm (prependLetter i g nonZero x x₁) (prependLetter j h nonZero2 y pr2) () | inr i!=j private symm : Symmetric _=RP_ symm {empty} {empty} x = record {} symm {nonempty i m} {nonempty i₁ n} x = =RP'symm m n x =RP'trans : {i j k : _} (x : ReducedSequenceBeginningWith i) (y : ReducedSequenceBeginningWith j) (z : ReducedSequenceBeginningWith k) → =RP' x y → =RP' y z → =RP' x z =RP'trans (ofEmpty i g nonZero) (ofEmpty j g₁ nonZero₁) (ofEmpty k g₂ nonZero₂) x=y y=z with decidableIndex i j =RP'trans (ofEmpty .j g nonZero) (ofEmpty j g₁ nonZero₁) (ofEmpty k g₂ nonZero₂) x=y y=z | inl refl with decidableIndex j k =RP'trans (ofEmpty .j g nonZero) (ofEmpty j g₁ nonZero₁) (ofEmpty .j g₂ nonZero₂) x=y y=z | inl refl | inl refl = Equivalence.transitive (Setoid.eq (S j)) x=y y=z =RP'trans (prependLetter i g nonZero x x₁) (prependLetter j g₁ nonZero₁ y x₂) (prependLetter k g₂ nonZero₂ z x₃) x=y y=z with decidableIndex i j =RP'trans (prependLetter .j g nonZero x x₁) (prependLetter j g₁ nonZero₁ y x₂) (prependLetter k g₂ nonZero₂ z x₃) x=y y=z | inl refl with decidableIndex j k =RP'trans (prependLetter .j g nonZero x x₁) (prependLetter j g₁ nonZero₁ y x₂) (prependLetter .j g₂ nonZero₂ z x₃) (fst1 ,, snd1) (fst2 ,, snd2) | inl refl | inl refl = Equivalence.transitive (Setoid.eq (S j)) fst1 fst2 ,, =RP'trans x y z snd1 snd2 private trans : (x y z : ReducedSequence) → x =RP y → y =RP z → x =RP z trans empty empty empty x=y y=z = record {} trans (nonempty i x) (nonempty i₁ y) (nonempty i₂ z) x=y y=z = =RP'trans x y z x=y y=z notEqualIfStartDifferent : {j1 j2 : I} (neq : (j1 ≡ j2) → False) → (x1 : ReducedSequenceBeginningWith j1) (x2 : ReducedSequenceBeginningWith j2) → =RP' x1 x2 → False notEqualIfStartDifferent neq (ofEmpty i g nonZero) (ofEmpty j g₁ nonZero₁) eq with decidableIndex i j notEqualIfStartDifferent neq (ofEmpty i g nonZero) (ofEmpty j g₁ nonZero₁) eq | inl i=j = neq i=j notEqualIfStartDifferent neq (prependLetter i g nonZero x1 x) (prependLetter j g₁ nonZero₁ x2 x₁) eq with decidableIndex i j notEqualIfStartDifferent neq (prependLetter i g nonZero x1 x) (prependLetter j g₁ nonZero₁ x2 x₁) eq | inl eq' = neq eq' freeProductSetoid : Setoid ReducedSequence Setoid._∼_ freeProductSetoid = _=RP_ Equivalence.reflexive (Setoid.eq freeProductSetoid) {x} = reflex {x} Equivalence.symmetric (Setoid.eq freeProductSetoid) {a} {b} = symm {a} {b} Equivalence.transitive (Setoid.eq freeProductSetoid) {x} {y} {z} = trans x y z
lang/german/syst.asm
olifink/smsqe
0
161546
; Text for System section language include 'dev8_mac_text' mkxstr syst,'S',{System} end
src/geekos/lspawn.asm
potados99/geekos
4
244497
; Low level interrupt/thread handling code for GeekOS. ; Copyright (c) 2004 <NAME> <<EMAIL>> ; Copyright (c) 2004 <NAME> <<EMAIL>> ; $Revision: 1.1 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". ; Dirty code to run an executable in kernel mode. ; You shouldn't normally change this file ! ; Trampoline gets called with two selectors (code/data) ; and the entry address. We push the CS,DS,IP and do a 'retf' ; to force an inter-selector jump to the new program. ; When the new program is done, the leave/lret in entry.c ; will bring us back here. ; ; ---------------------------------------------------------------------- ; low-level spawn stuff ; ---------------------------------------------------------------------- %include "symbol.asm" %include "defs.asm" [BITS 32] ; ---------------------------------------------------------------------- ; Definitions ; ---------------------------------------------------------------------- ; EXPORT Trampoline ; ---------------------------------------------------------------------- ; Code ; ---------------------------------------------------------------------- [SECTION .text] align 8 Trampoline: ;; first we fetch the code selector off the stack mov ebx, [esp+4] ;; then we fetch the data selector off the stack mov eax, [esp+8] ;; and finally the entry address mov ecx, [esp+0xc] push ds push es mov ds, ax mov es, ax ;; push KERNEL_CS/EIP so that we return here ;; after running the program push dword KERNEL_CS push dword .backhere ;; now make the inter-selector jump ;; we land in different cs/ds descriptors push ebx push ecx retf .backhere: pop es pop ds ret
tests/Windows/basic/ApiLoops32/apiloops_32.asm
ncatlin/rgat
381
246080
.686p ;enable instructions .xmm ;enable instructions .model flat, stdcall ;use C naming convention (stdcall is default) .data ;initialized data message db "delmefff",0dh,0ah,0 message_end db 0 .data? .stack 4096 ;stack (optional, linker will default) .code ;code GetStdHandle PROTO STDCALL :DWORD ExitProcess PROTO STDCALL :DWORD WriteFile proto, hFile:dword, lpBuffer:near32, ;A handle to the device nNumberOfCharsToWrite:dword, ;The maximum number of bytes to be written. lpNumberOfbytesWritten:near32, ;A pointer to the variable that receives the number of bytes written lpOverlapped:near32 public main includelib msvcrtd includelib oldnames includelib kernel32 includelib legacy_stdio_definitions.lib ;for scanf, printf, ... main: ; exec count now 0 ; block 0, node 0, execs once mov ecx, 100 mov esi, ecx push -12 ;block 6 ;this tests how api calls are handled inside a deinstrumented loop loop1: mov eax, 20 ;node 3 mov ebx, 10 xchg eax, ebx push -11 call GetStdHandle ;7,8. block 1 is the thunk here ;block 2 ; mov ebx, eax ;9 push 0 lea eax, [ebp-4] ;11 push eax push (message_end - message) push offset message push ebx ;15 call writefile ;16,17 block 3 is the thunk here ;block 4 mov ecx, esi dec ecx mov esi, ecx jnz loop1 ;node 5, [->1 (x99), ->6 (x1)] call GetStdHandle ;block 5 ;block 7 ; exec count now 501 mov ecx, 1000 ;node 6 push ecx jmp loop2 ;block 8 ; exec count now 503 ;node 8-12, execs 1000 times ;test how api calls are handled at the base of a deinstrumented loop loop2: pop ecx dec ecx jz loop2end ;node 12, [->8 (x999), ->13 (x1)] ;block 9 mov eax, 20 mov ebx, 10 xchg eax, ebx push ecx push 1 call GetStdHandle ;block 10 in here jmp loop2 loop2end: ; exec count now 5503 mov ecx, 10000 push ecx push 2 jmp loop3 ; exec count now 5505 ;node 15-19, execs 10000 times ; this tests how api calls are handed at the top of a deinstrumented loop loop3: call GetStdHandle mov eax, 20 mov ebx, 10 xchg eax, ebx pop ecx dec ecx push ecx push 2 jnz loop3 ;node 19 [->15 (x9999), ->20 (x1)] pop eax ; exec count now 55505 mov ecx, 100000 jmp loop4 ; exec count now 55507 ;node 22-26, execs 100000 times loop4: mov eax, 20 mov ebx, 10 xchg eax, ebx dec ecx jnz loop4 ;node 24 [->22 (x99999), ->27 (x1)] ; exec count now 55507 mov ecx, 10000000 jmp loop5 ; exec count now 555509 ;node 29-33, execs 10000000 times loop5: mov eax, 20 mov ebx, 10 xchg eax, ebx dec ecx jnz loop5 ;node 33 [->29 (x999999), ->34 (x1)] ; exec count now 50555509 ; block ID 11 inc ecx ;node 34 inc ecx ;node 35 inc ecx ;node 36 inc ecx ;node 37 jmp final ;node 38 ;these should not execute or appear on the graph inc esi inc esi inc esi inc esi ; exec count now 50555514 final: xor ecx, ecx ret ;node 40 - ret to basethreadinitthunk ; exec count now 50,555,516 end main end
OS Term Project/assemblyInput6.asm
bubblecounter/OS-Simulation
0
102656
LUI S0 0000000000000001 ORI S0 S0 0000000000000001 LUI S1 0000000000000001 SUB S2 S0 S1 ADDI S2 S2 0000000000000010 SUBI S2 S2 0000000000000001
Microprocessor lab/TypeCopyDelete/typeCopyDelete.nasm
IamVaibhavsar/Second_Year_Lab_Assignments
34
28636
%include"macro.nasm" ;Write X86 menu driven Assembly Language Program (ALP) to implement OS (DOS) commands TYPE, COPY and DELETE using file operations. ;User is supposed to provide command line arguments in all cases. global _start _start: section .text menu: display msg4,len4 display msg1,len1 read choice,02 mov al,byte[choice] cmp al,31H je typec cmp al,32H je copyc cmp al,33H je deletec cmp al,34H je exit typec: pop rcx ;3 pop rcx ;assg6.asm pop rcx ;t1.txt mov [filename1],rcx fopen [filename1] cmp rax,-1H je error mov [filehandle1],rax fread [filehandle1],buffer,buf_len dec rax mov [ac_buf_len],rax display buffer,[ac_buf_len] jmp menu copyc: pop rcx ;t2.txt mov [filename2],rcx fopen [filename2] cmp rax,-1H je error mov [filehandle2],rax fwrite [filehandle2],buffer,[ac_buf_len] fclose [filehandle1] fclose [filehandle2] jmp menu deletec: fdelete [filename1] cmp rax,-1H je delete_error jmp menu error: display msg2,len2 delete_error: display msg3,len3 exit: mov rax,60 mov rdi,0 syscall section .data msg1 db "Menu",10 db "1.Type",10 db "2.Copy",10 db "3.Delete",10 db "4.Exit",10 db "Enter choice",10 len1 equ $-msg1 msg2 db 10,"file opening is unsuccessful" len2 equ $-msg2 msg3 db 10,"file deletion is unsuccessful" len3 equ $-msg3 msg4 db "",10 len4 equ $-msg4 section .bss filename1 resb 100 filename2 resb 100 buffer resb 100 buf_len resb 100 ac_buf_len resb 100 filehandle1 resb 100 filehandle2 resb 100 choice resb 02
4.3.asm
Jon2G/ASMCalculator
0
1344
<filename>4.3.asm ;----------------------------------------------------------------------------------------------------------- ;DECLARACION DE MACROS ;----------------------------------------------------------------------------------------------------------- ENTRADA MACRO CARACTER ;Delcaracion de la Macro 'ENTRADA' con los parametros: CARACTER ;El proposito de esta macro es enviar a Al el caracter que ;esta apunto de entrar al display por medio del procedimiento ;ENTRADA_PROC (Actua como paso de parametros) MOV Al,CARACTER ;Asigna el contenido de CARACTER a Al CALL ENTRADA_PROC ;Llamada al procedimiento 'ENTRADA_PROC' ENDM ;Fin de la Macro ;----------------------ERROR----------------------- ERROR MACRO MENSAJE ;Delcaracion de la Macro 'ERROR' con los parametros: MENSAJE SalvaRegistros ;Guarda el estado actual de los registros de proposito general mov ah,09h ;asigna 9 a ah (imprime cadena) mov bl,0F4h ;fondo/texto mov cx, 43h ;Asigna 43h a cx LEA Dx,vacia_str ;asigna a Dx la direccion inicial desplazamiento de la variable 'vacia_str' GotoXY 05h,02h ;mueve el cursor a las coordenadas (5,2) int 10h ;Interrupcion 10h (Servicios de Pantalla) int 21h ;Interrupcion 21h (funciones de el DOS API) GotoXY 05h,03h ;mueve el cursor a las coordenadas (5,3) int 10h ;Interrupcion 10h (Servicios de Pantalla) LEA Dx,MENSAJE ;asigna a Dx la direccion inicial desplazamiento de la variable 'MENSAJE' int 21h ;Interrupcion 21h (funciones de el DOS API) PAUSA ;Llamada a la Macro PAUSA RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ENDM ;Fin de la Macro DISPLAY MACRO MENSAJE ;Delcaracion de la Macro 'DISPLAY' con los parametros: MENSAJE SalvaRegistros ;Guarda el estado actual de los registros de proposito general mov ah,09h ;asigna 9 a ah (imprime cadena) mov bl,0Ah ;Asigna 0Ah a bl mov cx, 43h ;Asigna 43h a cx LEA Dx,vacia_str ;asigna a Dx la direccion inicial desplazamiento de la variable 'vacia_str' GotoXY 05h,02h ;mueve el cursor a las coordenadas (5,2) int 10h ;Interrupcion 10h (Servicios de Pantalla) int 21h ;Interrupcion 21h (funciones de el DOS API) GotoXY 05h,03h ;mueve el cursor a las coordenadas (5,3) int 10h ;Interrupcion 10h (Servicios de Pantalla) ; GotoXY 05h,03h ;mueve el cursor a las coordenadas (5,3) mov ah,09h ;asigna 9 a ah (imprime cadena) LEA Dx,vacia_str ;asigna a Dx la direccion inicial desplazamiento de la variable 'vacia_str' int 21h ;Interrupcion 21h (funciones de el DOS API) GotoXY 05h,03h ;mueve el cursor a las coordenadas (5,3) mov ah,09h ;asigna 9 a ah (imprime cadena) ; LEA Dx,MENSAJE ;asigna a Dx la direccion inicial desplazamiento de la variable 'MENSAJE' int 21h ;Interrupcion 21h (funciones de el DOS API) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ENDM ;Fin de la Macro ;---------------------PRINT CHAR------------------- PRINT_CHAR MACRO CARACTER,pX,pY ;Delcaracion de la Macro 'PRINT_CHAR' con los parametros: CARACTER,pX,pY SalvaRegistros ;Guarda el estado actual de los registros de proposito general ;GOTOXY pX,pY ;mueve el cursor a las coordenadas (Px,Py) ;este segmento es solo para emu en bolrand se elimina MOV Ah, 02h ;goto xy MOV Bh, 00 ;Asigna el contenido de 00 a Bh MOV dh, pY ;posicion del cursor en y MOV dl, pX ;posicion del cursor en x int 10h ;Interrupcion 10h (Servicios de Pantalla) ;fin solo para emu MOV DL,CARACTER ;Asigna el contenido de CARACTER a DL MOV AH,02 ;Asigna 02 a AH INT 21H ;Interrupcion 21h (funciones de el DOS API) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ENDM ;Fin de la Macro ;----------------------COLOR----------------------- COLOR MACRO ALTO,ANCHO,X,Y,C ;Delcaracion de la Macro 'COLOR' con los parametros: ALTO,ANCHO,X,Y,C SalvaRegistros ;Guarda el estado actual de los registros de proposito general MOV DX,0000h ;Asigna 0000h a DX MOV CX,0000h ;Asigna 0000h a CX MOV CL,X ;posicion inicial en x MOV CH,Y ;posicion inicial en y ; MOV AL,X ;Asigna el contenido de X a AL ADD AL,ANCHO ;Suma el valor de AL con el de ANCHO, el resultado queda en AL MOV DL,AL ;posicion final en x ; MOV AL,Y ;Asigna el contenido de Y a AL ADD AL,ALTO ;Suma el valor de AL con el de ALTO, el resultado queda en AL MOV DH,AL ;posicion final en y MOV AH,06H ;Asigna 06H a AH MOV AL,00H ;Asigna 00H a AL MOV BH,C ;color de fondo y letra despues de borrar INT 10H ;Interrupcion 10h (Servicios de Pantalla) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ENDM ;Fin de la Macro ;----------------------PAUSA----------------------- PAUSA MACRO ;Delcaracion de la Macro 'PAUSA' con los parametros: SalvaRegistros ;Guarda el estado actual de los registros de proposito general XOR AX,AX ;Resituye el registro AX a ceros por medio de XOR INT 16h ;Interrupcion 16h (funciones de llamada al teclado) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ENDM ;Fin de la Macro ;______________________MACR_XY_____________________ GotoXY MACRO gx,gy ;Delcaracion de la Macro 'GotoXY' con los parametros: gx,gy SalvaRegistros ;Guarda el estado actual de los registros de proposito general MOV Ah, 02h ;goto xy MOV Bh, 00 ;Asigna el contenido de 00 a Bh MOV dh, gy ;posicion del cursor en y MOV dl, gx ;posicion del cursor en x int 10h ;Interrupcion 10h (Servicios de Pantalla) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron endm ;Fin de la Macro ;______________________MACR_SALVAR_____________________ ;Guarda el estado actual de los registros de proposito general en la direccion ;de tabla indicada por el desplazamiento "registros_tbl SalvaRegistros MACRO ;Delcaracion de la Macro 'SalvaRegistros' con los parametros: MOV [registros_tbl],Ax ;Asigna el contenido de Ax a [registros_tbl] MOV [registros_tbl+2h],Bx ;Asigna el contenido de Bx a [registros_tbl+2h] MOV [registros_tbl+4h],Cx ;Asigna el contenido de Cx a [registros_tbl+4h] MOV [registros_tbl+6h],Dx ;Asigna el contenido de Dx a [registros_tbl+6h] endm ;Fin de la Macro ;______________________MACR_RECUPERAR_____________________ ;Reestablece los registros de proposito general al ultimo estado ;en el que se salvaron en la direccion de tabla indicada por el desplazamiento "registros_tbl RecuperaRegistros MACRO ;Delcaracion de la Macro 'RecuperaRegistros' con los parametros: MOV Ax,[registros_tbl] ;Asigna el contenido de [registros_tbl] a Ax MOV Bx,[registros_tbl+2h] ;Asigna el contenido de [registros_tbl+2h] a Bx MOV Cx,[registros_tbl+4h] ;Asigna el contenido de [registros_tbl+4h] a Cx MOV Dx,[registros_tbl+6h] ;Asigna el contenido de [registros_tbl+6h] a Dx endm ;Fin de la Macro ;______________________MACR_RESTITUIR_____________________ ;Restituye los registros Ax a Dx en ceros RestituyeRegistros MACRO ;Delcaracion de la Macro 'RestituyeRegistros' con los parametros: XOR AX,AX ;Resituye el registro AX a ceros por medio de XOR XOR BX,BX ;Resituye el registro BX a ceros por medio de XOR XOR CX,CX ;Resituye el registro CX a ceros por medio de XOR XOR DX,DX ;Resituye el registro DX a ceros por medio de XOR endm ;Fin de la Macro ;----------------------------------------------------------------------------------------------------------- ;Esta macro llama al procedimiento ImprimirXY que ;imprime una cadena en las coordendas dadas por X y Y ;el proposito de la macro es enviar los paramteros al procedimiento ;salvando y restaurando posteriormente el estado de los registros Imprime MACRO cadena,X,Y ;Delcaracion de la Macro 'Imprime' con los parametros: cadena,X,Y SalvaRegistros ;Guarda el estado actual de los registros de proposito general RestituyeRegistros ;Restituye los registros de prosito general en 0 MOV ch,X ;Asigna el contenido de X a ch MOV cl,Y ;Asigna el contenido de Y a cl LEA Bx,cadena ;asigna a Bx la direccion inicial desplazamiento de la variable 'cadena' CALL ImprimirXY ;Llamada al procedimiento 'ImprimirXY' RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron endm ;Fin de la Macro ; Marco MACRO alto,ancho,X,Y ;Delcaracion de la Macro 'Marco' con los parametros: alto,ancho,X,Y SalvaRegistros ;Guarda el estado actual de los registros de proposito general mov [temp_tbl],alto ;Asigna el contenido de alto a [temp_tbl] mov [temp_tbl+1],ancho ;Asigna el contenido de ancho a [temp_tbl+1] mov [temp_tbl+2],X ;Asigna el contenido de X a [temp_tbl+2] mov [temp_tbl+3],Y ;Asigna el contenido de Y a [temp_tbl+3] RestituyeRegistros ;Restituye los registros de prosito general en 0 CALL MarcoXY ;Llamada al procedimiento 'MarcoXY' RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron endm ;Fin de la Macro ; Linea MACRO longuitud,X,Y ;Delcaracion de la Macro 'Linea' con los parametros: longuitud,X,Y SalvaRegistros ;Guarda el estado actual de los registros de proposito general mov [temp_tbl],longuitud ;Asigna el contenido de longuitud a [temp_tbl] mov [temp_tbl+2h],X ;Asigna el contenido de X a [temp_tbl+2h] mov [temp_tbl+4h],Y ;Asigna el contenido de Y a [temp_tbl+4h] CALL LineaXY ;Llamada al procedimiento 'LineaXY' RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron endm ;Fin de la Macro ;FIN DE LAS MACROS ;----------------------------------------------------------------------------------------------------------- .model small ;Directiva de inicio simplificada para el modelo de datos 'SMALL' .stack ;Directiva de inicializacion de la pila simplificada ;INICIA SEGMENTO DE DATOS ;----------------------------------------------------------------------------------------------------------- .data ;Directiva de inicializacion de el segmento de datos simplificado resultado_str db 44h dup(0),"$" ; posicion_pila dw 0000h ; ;VARIABLES PARA LEER LA ENTRADA posicion_entrada dw 0000h ; ;----------------------------------------------------------------------------------------------------------- renglones_pila db 00h ;cuenta los renglones de la pila de operaciones aux db 00h ;variable auxiliar registros_tbl dw 0000h,0000h,0000h,0000h ;guarda el estado previo de los registros temp_tbl db 00h,00h,00h,00h ;actua como un segmento de datos extra temporal de un byte caratula_str db" ______ _____ " ;Caratula del programa db"_____ __ __ ______ ",13, ; db" | ____|/ ____|" ; db"_ _| \/ | ____|",13, ; db" | |__ | (___ " ; db" | | | \ / | |__",13, ; db" | __| \___ \ " ; db" | | | |\/| | __|",13, ; db" | |____ ____) |" ; db"_| |_| | | | |____ ",13, ; db" |______|_____/|" ; db"_____|_| |_|______|",13, ; db" _____ _ _ _ _ _ _ " ; db" _ _____ _ _ " ,13, ; db" / ____| | | | | | | | | |" ; db" | | /\ / ____| /\ | \ | |",13, ; db" | | | | | | | | |__| | |" ; db" | | / \ | | / \ | \| |",13, ; db" | | | | | | | | __ | |" ; db" | |/ /\ \| | / /\ \ | . ` |",13, ; db" | |____| |__| | |____| | | | |" ; db"__| / ____ | |____ / ____ \| |\ |",13, ; db" \_____|\____/|______|_| |_|\_" ; db"___/_/ \_\_____/_/ \_|_| \_|",13,13,13, ; db" Proyecto: --> 'Calculadora' <--","$" ; despedida_str db" _ _ _ _",13 ;Declaracion de mensaje de despedida db" | | | | | | | |",13, ; db" | |__| | __ _ ___| |_ __ _ | |_ _ ___ __ _ " ; db"___ ",13, ; db" | __ |/ _` / __| __/ _` | | | | | |/ _ \/ _` |/" ; db" _ \",13, ; db" | | | | (_| \__ | || (_| | | | |_| | __| (_| | " ; db"(_) |",13, ; db" |_| |_|\__,_|___/\__\__,_| |_|\__,_|\___|\__, |\" ; db"___/",13, ; db" __/ |",13, ; db" |___/",13, ; db" Proyecto: --> 'Calculadora' <--","$" ; display_str db"Utilice las fechas y el teclado numerico para naveg" ;Declaracion de variable para el display db"ar.",14 DUP(0),'$' ; seleccion_invalida db">>>>>>>>>>>>>>>>>>>>>>>>>>ENTRADA INVALIDA<<<<<<<" ; db"<<<<<<<<<<<<<<<<<<",07h,"$" ; div_x_cero db">>>>>>>>>>>>>>>>>ERROR MATEMATICO DIVISION POR CE" ;Declaracion de mensaje por error division entre cero db"RO<<<<<<<<<<<<<<<<",07h,"$" ; Mas10_numeros db">>>>>DESBORADMIENTO INTERNO (NO PUEDE HABER MAS D" ;Declaracion de mensaje por desbordamiento de digitos db"E 9 DIGITOS)<<<<<<",07h,"$" ; sintax_error_msj db">>>>>>>>>>>>>>>>>>>>>>>>>>ERROR SINTACTICO<<<<<<<" ;Declaracion de mensaje por error de sintaxis db"<<<<<<<<<<<<<<<<<<",07h,"$" ; vacia_str db 67 DUP(0),'$' ;Cadena vacia suma_Simbolo db " ",13, ;Texto para el boton 'Suma' db " + ",13, ; db "--> SUMA <--","$" ; resta_Simbolo db " ",13, ;Texto para el boton 'Resta' db " - ",13, ; db "--> RESTA <--","$" ; mul_Simbolo db " ",13, ;Texto para el boton 'Multiplica' db " x ",13, ; db "->MULTIPLICA<-","$" ; div_Simbolo db " ",13, ;Texto para el boton 'Divide' db " ",0F6h," ",13, ; db "--> DIVIDE <--","$" ; pila_operaciones db "Utilice las flechas y el teclado numerico", ;Declaracion de texto que aparecera en la memoria operacional db "para navegar",13 ; db "Para ingresar las operaciones digite el primer operando seguido de",13 ; db "un operador y enseguida el segundo operando.",13 ; db 67 DUP(0B0H),13 ; db "Sus operaciones aparaceran aqui.",13 ; db 67 DUP(0B0H),13 ; db "Presione (Esc) en cualquier momento para salir.",13,"$" ; sin_punto db 0h ;variable que nos indica que no debe imprimirse el punto decimal ;----------------------------------------------------------------------------------------------------------- ;OPERANDOS PARA LA SUMA Y RESTA ; num1 db 0Ah dup(0),'$' ; decimales_1 db 0Ah dup(0),'$' ; num2 db 0Ah dup(0),'$' ; decimales_2 db 0Ah dup(0),'$' ; num_res db 14h dup(0),'$' ; decimales_Res db 14h dup(0),'$' ; ajuste_decimales_1 db 0Ah dup(0),'$' ; ajuste_decimales_2 db 0Ah dup(0),'$' ; Acarreo_ParaEntero db 0 ; operacion db 0h ;ALMACENA LA OPERACION INVOCADA DESPUES DEL AJUSTE PRE-OPERACIONAL hay_acarreo db 00h ; ;----------------------------------------------------------------------------------------------------------- ;OPERANDOS PARA LA DIVISION ; num_res_div db 0Ah dup(0),'$' ; decimales_Res_div db 0Ah dup(0),'$' ; resultado_entero_div db 01h ; es_negativo_resuido_div db 00h ; indefinida db 'Indeterminado' ; dividi_una_vez db 00h ; ;----------------------------------------------------------------------------------------------------------- ;OPERANDOS PARA LA MULTIPLICACION num_1_mul db 0,0,0,0,0,0,0,0,0 ; decimal_1_mul db 0,0,0,0,0,0,0,0,0 ; num_2_mul db 0,0,0,0,0,0,0,0,0 ; decimal_2_mul db 0,0,0,0,0,0,0,0,0 ; num_res_mul db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; decimal_res_mul db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; acarreo db 0 ; ;----------------------------------------------------------------------------------------------------------- ;VARIABLES PARA LA LEY DE LOS SIGNOS num1_signo db 00h ; num2_signo db 00h ; es_negativo_res db 00h ; ;----------------------------------------------------------------------------------------------------------- ;VARIABLES PARA LA INTERACCION CON EL MOUSE Y TECLADO curX dw 0 ; curY dw 0 ; seleccion db 00h ; ;----------------------------------------------------------------------------------------------------------- .code ;Directiva simplificada de inicio del segmento de Codigo ;_________________________________________PROCEDIMIENTO PRINCIPAL_________________________________________ begin proc FAR ;Inicia procedimiento principal MOV Ax, @data ;Asigna el contenido de @data a Ax MOV ds, Ax ;Asigna el contenido de Ax a ds ;INICIA Call Cls ;Llamada al procedimiento 'Cls' Call Caratula ;Llamada al procedimiento 'Caratula' mov posicion_pila,00h ;Asigna 00h a posicion_pila Call Interfaz ;Llamada al procedimiento 'Interfaz' ;FIN MOV Ah,4ch ;Asigna 4ch a Ah int 21h ;Interrupcion 21h (funciones de el DOS API) SALIR: ;Etiqueta 'SALIR' MOV Ah,4ch ;Asigna 4ch a Ah int 21h ;Interrupcion 21h (funciones de el DOS API) begin endp ;Fin del procedimiento ;______________________PROCEDIMIENTOS______________________ ;______________________PROC_INTERFAZ________________ Interfaz proc near ;Inicia prodecimiento cercano 'Interfaz' inicio_Interfaz: ;Etiqueta 'inicio_Interfaz' RestituyeRegistros ;Restituye los registros de prosito general en 0 Call Cls ;Llamada al procedimiento 'Cls' Marco 0Fh,45h,04h,01h ;dibuja el marco principal de la calculadora DISPLAY display_str ;Llamada a la Macro DISPLAY con los parametros : display_str Marco 03h,45h,04h,01h ;dibuja el display de la calculadora ;---------BOTONES-------------------------------- ;-->dibujar cuadro para la suma CMP seleccion,00h ;Compara seleccion con 00h JNE no_0 ;Salta si no es igual a la etiqueta 'no_0' COLOR 04h,0Eh,06h,05h,0A9h ;Llamada a la Macro COLOR con los parametros : 04h,0Eh,06h,05h,0A9h no_0: ;Etiqueta 'no_0' Imprime suma_Simbolo,06h,06h ;imprime el contenido de la cadena suma_simbolo en las Marco 04h,0Eh,06h,05h ;coordenadas especificadas ;-->dibujar cuadro para la resta CMP seleccion,01h ;Compara seleccion con 01h JNE no_1 ;Salta si no es igual a la etiqueta 'no_1' COLOR 04h,0Eh,16h,05h,0A9h ;Llamada a la Macro COLOR con los parametros : 04h,0Eh,16h,05h,0A9h no_1: ;Etiqueta 'no_1' Imprime resta_Simbolo,16h,06h ;imprime el contenido de la cadena suma_simbolo en las Marco 04h,0Eh,16h,05h ;coordenadas especificadas ;llama a la macro marco ;-->dibujar cuadro para la multiplicacion CMP seleccion,02h ;Compara seleccion con 02h JNE no_2 ;Salta si no es igual a la etiqueta 'no_2' COLOR 04h,0Fh,026h,05h,0A9h ;Llamada a la Macro COLOR con los parametros : 04h,0Fh,026h,05h,0A9h no_2: ;Etiqueta 'no_2' Imprime mul_Simbolo,026h,06h ;imprime el contenido de la cadena suma_simbolo en las Marco 04h,0Fh,026h,05h ;coordenadas especificadas ;-->dibujar cuadro para la division CMP seleccion,03h ;Compara seleccion con 03h JNE no_3 ;Salta si no es igual a la etiqueta 'no_3' COLOR 04h,0Fh,037h,05h,0A9h ;Llamada a la Macro COLOR con los parametros : 04h,0Fh,037h,05h,0A9h no_3: ;Etiqueta 'no_3' Imprime div_Simbolo,037h,06h ;imprime el contenido de la cadena suma_simbolo en las Marco 04h,0Fh,037h,05h ;coordenadas especificadas ;--------PANEL NUMERICO-------------------- RestituyeRegistros ;Restituye los registros de prosito general en 0 MOV aux,01H ;ASIGNA 1 a aux (variable auxiliar que sirve como contador) pnl_imprime: ;Etiqueta 'pnl_imprime' MOV AL,06H ;Asigna 6 a Al (posicion inicial en x de los cuadros) MUL aux ;Multiplica aux*Al para obtener la siguiente posicion de x ADD aux,03h ;aumenta aux en 3 para obtener el valor de la seleccion de el cuadro actual MOV Dl,aux ;mueve el valor del cuadro actual a Dl para compararlo SUB aux,03h ;resta aux para no afectar al contador CMP seleccion,Dl ;compara el valor de la seleccion con el valor del cuadro actual JNE no_colorees ;salta si el cuadro no es la seleccion actual COLOR 04h,04h,AL,0Ah,0A9h ;Dibuja un cuadro de color verde el la posicion de Al y 0Ah no_colorees: ;Etiqueta 'no_colorees' MOV Cl,30h ;Asigna 30h a Cl (caracter inicial 0) ADD CL,aux ;Suma 1 a Cl para obtener el siguiente numero ADD AL,02h ;Suma 2 a Al para obtener la posicion en x de el numero DEC CL ;Decrementa Cl para que los numeros empiezen en 0 PRINT_CHAR Cl,Al,0Ch ;Imprime el numero Cl en la posicion de Al y 0Ch SUB Al,02h ;Resta 02h a Al para obtener la posicion inical de el cuadro en x de modo que coincida con el cuadro de color Marco 04h,04h,Al,0Ah ;Dibuja un marco de 4x4 en la posicion Al,0Ah INC aux ;incrementa aux (contador) en 1 CMP aux,0Ch ;compara aux==12 JE pnl_end ; salta al fin si aux==12 JMP pnl_imprime ;salta a imprimir el siguiente cuadro si aux!=12 pnl_end: ;etiqueta para salir ;-->dibujar el signo = PRINT_CHAR 3Dh,44h,0Ch ;como se imprimio el caracter ':' debemos reemplazarlo por '=' ;--------PILA DE OPERACIONES------------------------ ;here ;inicio_Interfaz: Marco 08h,45h,04h,10h ;Llamada a la Macro Marco con los parametros : 08h,45h,04h,10h imprime pila_operaciones,05h,11h ;Llamada a la Macro imprime con los parametros : pila_operaciones,05h,11h ;--------ESQUINAS DE LOS CUADROS-------------------- PRINT_CHAR 0CCh,04h,04h ;esquina superior izquierda PRINT_CHAR 0CCh,04h,10h ;esquina media izquierda PRINT_CHAR 0B9h,49h,04h ;esquina superior derecha PRINT_CHAR 0B9h,49h,10h ;esquina media derecha RestituyeRegistros ;Restituye los registros de prosito general en 0 CALL MOUSE ;Llamada al procedimiento 'MOUSE' nuevo_click: ;Etiqueta 'nuevo_click' ;--------Leer flechas y cambiar seleccion-----------; CMP AX,4D00h ;si se presiono derecha JE Derecha ;salta a la etiqueta Derecha CMP AX,4B00h ;si se presiono izquierda JE Izquierda ;salta a la etiqueta Izquierda CMP AX,4800h ;Compara AX con 4800h JE Arriba ;Salta si es igual a la etiqueta 'Arriba' CMP AX,5000h ;Compara AX con 5000h JE Abajo ;Salta si es igual a la etiqueta 'Abajo' CMP AX,01C0Dh ;Compara AX con 01C0Dh JE Enter_ ;Salta si es igual a la etiqueta 'Enter_' CMP AX,0E08h ;Compara AX con 0E08h JNE no_retroceso ;Salta si no es igual a la etiqueta 'no_retroceso' JMP entra ;Salta a la etiqueta 'entra' no_retroceso: ;Etiqueta 'no_retroceso' CMP AX,5239h ;Compara AX con 5239h JLE NUM_01 ;Salta a la etiqueta 'NUM_01' si es menor o igual CMP AX,532Eh ;Compara AX con 532Eh JE NUM_01 ;Salta si es igual a la etiqueta 'NUM_01' JMP Invalida ;salta a la etiqueta Invalida Derecha: ;Etiqueta 'Derecha' INC seleccion ;Incrementa en uno el valor de seleccion CMP seleccion,04h ;si la seleccion es igual a 4 JE Bajar ;Salta a la etiqueta bajar CMP seleccion,0Fh ;si la seleccion es igual a 15 JE Subir ;Salta a la etiqueta subir JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Izquierda: ;Etiqueta 'Izquierda' DEC seleccion ;Decrementa en uno el valor de seleccion CMP seleccion,0FFh ;si la seleccion es negativa JE Ultimo ;Salta a la etiqueta ultimo JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Arriba: ;Etiqueta 'Arriba' CMP seleccion,03h ;Compara seleccion con 03h JLE Abajo ;Salta a la etiqueta 'Abajo' si es menor o igual CMP seleccion,06h ;Compara seleccion con 06h JLE Subir ;Salta a la etiqueta 'Subir' si es menor o igual CMP seleccion,09h ;Compara seleccion con 09h JLE RestaBtn ;Salta a la etiqueta 'RestaBtn' si es menor o igual CMP seleccion,0Ch ;Compara seleccion con 0Ch JLE MulBtn ;Salta a la etiqueta 'MulBtn' si es menor o igual CMP seleccion,0Fh ;si la seleccion es igual a 15 JLE DivBtn ;Salta a la etiqueta 'DivBtn' si es menor o igual JMP Abajo ;Salta a la etiqueta 'Abajo' NUM_01: ;Etiqueta 'NUM_01' JMP NUM ;Salta a la etiqueta 'NUM' Abajo: ;Etiqueta 'Abajo' CMP seleccion,00h ;Compara seleccion con 00h JLE Btn1 ;Salta a la etiqueta 'Btn1' si es menor o igual CMP seleccion,01h ;Compara seleccion con 01h JLE Btn3 ;Salta a la etiqueta 'Btn3' si es menor o igual CMP seleccion,02h ;Compara seleccion con 02h JLE Btn6 ;Salta a la etiqueta 'Btn6' si es menor o igual CMP seleccion,03h ;Compara seleccion con 03h JLE Btn9 ;Salta a la etiqueta 'Btn9' si es menor o igual JMP Arriba ;Salta a la etiqueta 'Arriba' Enter_: ;Etiqueta 'Enter_' CMP seleccion,00h ;Compara seleccion con 00h JE MAS ;Salta si es igual a la etiqueta 'MAS' CMP seleccion,01h ;Compara seleccion con 01h JE MENOS ;Salta si es igual a la etiqueta 'MENOS' CMP seleccion,02h ;Compara seleccion con 02h JE POR ;Salta si es igual a la etiqueta 'POR' CMP seleccion,03h ;Compara seleccion con 03h JE ENTRE ;Salta si es igual a la etiqueta 'ENTRE' JNE NUM ;Salta si no es igual a la etiqueta 'NUM' Bajar: ;Etiqueta 'Bajar' MOV seleccion,04h ;asigna 4 a la seleccion (valor del primer boton de la segunda fila) JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Subir: ;Etiqueta 'Subir' MOV seleccion,00h ;asigna 0 a la seleccion (valor del primer boton de la primer fila) JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Ultimo: ;Etiqueta 'Ultimo' MOV seleccion,0Eh ;Asigna 0Eh a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) RestaBtn: ;Etiqueta 'RestaBtn' MOV seleccion,01h ;Asigna 01h a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) MulBtn: ;Etiqueta 'MulBtn' MOV seleccion,02h ;Asigna 02h a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) DivBtn: ;Etiqueta 'DivBtn' MOV seleccion,03h ;Asigna 03h a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Btn1: ;Etiqueta 'Btn1' MOV seleccion,05h ;Asigna 05h a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Btn3: ;Etiqueta 'Btn3' MOV seleccion,07h ;Asigna 07h a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Btn6: ;Etiqueta 'Btn6' MOV seleccion,0Ah ;Asigna 0Ah a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Btn9: ;Etiqueta 'Btn9' MOV seleccion,0Dh ;Asigna 0Dh a seleccion JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) MAS: ;Etiqueta 'MAS' MOV aux,'+' ;Asigna el contenido de '+' a aux JMP entra ;Salta a la etiqueta 'entra' MENOS: ;Etiqueta 'MENOS' MOV aux,'-' ;Asigna el contenido de '-' a aux JMP entra ;Salta a la etiqueta 'entra' POR: ;Etiqueta 'POR' MOV aux,'x' ;Asigna el contenido de 'x' a aux JMP entra ;Salta a la etiqueta 'entra' ENTRE: ;Etiqueta 'ENTRE' MOV aux,0F6h ;Asigna 0F6h a aux JMP entra ;Salta a la etiqueta 'entra' NUM: ;Etiqueta 'NUM' MOV Dl,seleccion ;Asigna el contenido de seleccion a Dl SUB Dl,04h ;Resta 04h a Dl ADD Dl,30h ;AGREGA 30h a Dl MOV aux,Dl ;Asigna el contenido de Dl a aux CMP AL,2Bh ;Compara AL con 2Bh JE MAS ;Salta si es igual a la etiqueta 'MAS' CMP AL,2Dh ;Compara AL con 2Dh JE MENOS ;Salta si es igual a la etiqueta 'MENOS' CMP AL,2Fh ;Compara AL con 2Fh JE ENTRE ;Salta si es igual a la etiqueta 'ENTRE' CMP AL,2Ah ;Compara AL con 2Ah JE POR ;Salta si es igual a la etiqueta 'POR' CMP AX,1C0Dh ;Compara AX con 1C0Dh JE entra ;Salta si es igual a la etiqueta 'entra' CMP Al,39h ;Compara Al con 39h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,38h ;Compara Al con 38h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,37h ;Compara Al con 37h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,36h ;Compara Al con 36h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,35h ;Compara Al con 35h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,34h ;Compara Al con 34h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,33h ;Compara Al con 33h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,32h ;Compara Al con 32h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,31h ;Compara Al con 31h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP Al,30h ;Compara Al con 30h JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' CMP AX,0B3Dh ;si se presiono la telca shif+= JE num_igual ;Salta si es igual a la etiqueta 'num_igual' CMP Al,2Eh ;si se presiono la telca . (izquierdo) JE num_tecla ;Salta si es igual a la etiqueta 'num_tecla' JMP Invalida ;salta a la etiqueta Invalida num_tecla: ;Etiqueta 'num_tecla' MOV aux,Al ;Asigna el contenido de Al a aux JMP entra ;Salta a la etiqueta 'entra' num_igual: ;Etiqueta 'num_igual' MOV aux,03Ah ;Asigna 03Ah a aux JMP entra ;Salta a la etiqueta 'entra' entra: ;Etiqueta 'entra' ENTRADA Aux ;Llamada a la Macro ENTRADA con los parametros : Aux DISPLAY display_str ;Llamada a la Macro DISPLAY con los parametros : display_str JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) Invalida: ;Etiqueta 'Invalida' CMP AX,0E08h ;Compara AX con 0E08h JNE inv_ ;Salta si no es igual a la etiqueta 'inv_' JMP entra ;Salta a la etiqueta 'entra' inv_: ;Etiqueta 'inv_' CMP Ax,011Bh ;SI Al es la tecla ESC JNE Invalida_Interfaz ;Salta si no es igual a la etiqueta 'Invalida_Interfaz' Call Adios ;termina el programa Invalida_Interfaz: ;Etiqueta 'Invalida_Interfaz' ERROR seleccion_invalida ;Llamada a la Macro ERROR con los parametros : seleccion_invalida JMP inicio_Interfaz ;salta al inicio de la interfaz (recarga) RestituyeRegistros ;Restituye los registros de prosito general en 0 RET ;Retorna el control a la direccion de el SP desde donde se llamo Interfaz endp ;Fin del procedimiento LineaXY proc near ;Inicia prodecimiento cercano 'LineaXY' MOV Dl,0CDh ;Asigna 0CDh a Dl MOV Cl,[temp_tbl] ;Asigna el contenido de [temp_tbl] a Cl MOV Ah,02h ;Asigna 02h a Ah Impr_linea: ;Etiqueta 'Impr_linea' GotoXY [temp_tbl+2h],[temp_tbl+4h] ;mueve el cursor a las coordenadas ([temp_tbl+2h],[temp_tbl+4h]) int 21h ;Interrupcion 21h (funciones de el DOS API) inc [temp_tbl+2h] ;Incrementa en uno el valor de [temp_tbl+2h] Loop Impr_linea ;Salta a la etiqueta 'Impr_linea' y decrementa CX mientras no sea cero RET ;Retorna el control a la direccion de el SP desde donde se llamo LineaXY endp ;Fin del procedimiento ;______________________PROC_ImprimirXY (solo debe ser llamado por macro imprimir)________________ ImprimirXY proc near ;Inicia prodecimiento cercano 'ImprimirXY' GotoXY ch,cl ;mueve el cursor a las coordenadas (ch,cl) MOV DI,0FFFFh ;Asigna 0FFFFh a DI MOV Ah,02 ;Asigna 02 a Ah Impr_siguiente: ;Etiqueta 'Impr_siguiente' INC DI ;Incrementa en uno el valor de DI MOV DL,[Bx+DI] ;Asigna el contenido de [Bx+DI] a DL CMP DL,13d ;Compara DL con 13d JE NuevaLinea ;Salta si es igual a la etiqueta 'NuevaLinea' CMP DL,'$' ;Compara DL con '$' JE Impr_salir ;Salta si es igual a la etiqueta 'Impr_salir' int 21h ;Interrupcion 21h (funciones de el DOS API) JMP Impr_siguiente ;Salta a la etiqueta 'Impr_siguiente' NuevaLinea: ;Etiqueta 'NuevaLinea' inc cl ;Incrementa en uno el valor de cl MOV dh,cl ;Asigna el contenido de cl a dh GotoXY ch,cl ;mueve el cursor a las coordenadas (ch,cl) JMP Impr_siguiente ;Salta a la etiqueta 'Impr_siguiente' Impr_salir: ;Etiqueta 'Impr_salir' RET ;Retorna el control a la direccion de el SP desde donde se llamo ImprimirXY endp ;Fin del procedimiento ;______________________CLS_PROC______________________ Cls proc near ;Inicia prodecimiento cercano 'Cls' MOV ch, 32 ;asigna 32 a ch (oculta buffer del cursor) MOV Ah, 1 ;instruccion 1 de la int 10 int 10h ;Interrupcion 10h (Servicios de Pantalla) MOV Ah, 06h ;limpia la pantalla MOV al, 00h ;coordenas de inicio en x MOV Bh, 0F1h ;F:Color Blanco(Fondo),1:Azul(Texto) MOV Cx, 0000h ;coordenas de inicio en y MOV Dx, 184Fh ;tama�o de la pantalla () int 10h ;Interrupcion 10h (Servicios de Pantalla) RET ;Retorna el control a la direccion de el SP desde donde se llamo Cls endp ;Fin del procedimiento ;______________________MarcoXY solo llamado por la Macro Marco______________________ MarcoXY proc near ;Inicia prodecimiento cercano 'MarcoXY' GotoXY [temp_tbl+2h],[temp_tbl+3h] ;mueve el cursor a las coordenadas especificadas MOV dl,0C9h ;asina a dl en primer caracter (esquina izquierda) MOV Ah,02 ;Asigna 02 a Ah int 21h ;Interrupcion 21h (funciones de el DOS API) MOV Cl,[temp_tbl+1h] ;asigna a Cl el ancho del cuadro DEC Cl ;decrementa Cl para obtener el valor real de el ancho MOV dl,0CDh ;asigna a dl el segundo caracter (linea) Car_filaArr: ;Etiqueta 'Car_filaArr' int 21h ;Interrupcion 21h (funciones de el DOS API) Loop Car_filaArr ;Salta a la etiqueta 'Car_filaArr' y decrementa CX mientras no sea cero MOV dl,0BBh ;asigna a dl el segundo caracter (esquina derecha) int 21h ;Interrupcion 21h (funciones de el DOS API) MOV Al,[temp_tbl+3h] ;mueve a al el valor de la coordenada en Y ADD Al,[temp_tbl] ;suma (Y+alto) para obtener la posicion de la esquina inferior izquierda GotoXY [temp_tbl+2h],Al ;mueve el cursor a las coordenadas especificadas MOV dl,0C8h ;asina a dl el caracter (esquina izquierda) int 21h ;Interrupcion 21h (funciones de el DOS API) MOV Cl,[temp_tbl+1h] ;asigna a Cl el ancho del cuadro DEC Cl ;decrementa Cl para obtener el valor real de el ancho MOV dl,0CDh ;asigna a dl el segundo caracter (linea) Car_filaAba: ;Etiqueta 'Car_filaAba' int 21h ;Interrupcion 21h (funciones de el DOS API) Loop Car_filaAba ;Salta a la etiqueta 'Car_filaAba' y decrementa CX mientras no sea cero MOV dl,0BCh ;asigna a dl el caracter (esquina inferior derecha) int 21h ;Interrupcion 21h (funciones de el DOS API) MOV DL,0BAh ;asigna a dl el caracter (columna) MOV Bl,[temp_tbl+3h] ;mueve a Bl el valor de la coordenada en Y INC Bl ;incrementa al para saltar la esquina superior MOV Cl,[temp_tbl] ;Asigna el contenido de [temp_tbl] a Cl DEC Cl ;decrementa Cl para obtener el valor real de el ancho Car_columnaIzq: ;Etiqueta 'Car_columnaIzq' GotoXY [temp_tbl+2h],Bl ;mueve el cursor a las coordenadas especificadas int 21h ;Interrupcion 21h (funciones de el DOS API) Inc Bl ;incrementa Bl para bajar una posicion en Y Loop Car_columnaIzq ;salta mientras Cl no sea 0 MOV Al,[temp_tbl+2h] ;asigna a Al el valor de X ADD Al,[temp_tbl+1h] ;suma (x+ancho) para obtener el ancho del marco MOV [temp_tbl+2h],Al ;mueve a X el valor del ancho del marco MOV Bl,[temp_tbl+3h] ;mueve a Bl el valor de la coordenada en Y INC Bl ;incrementa al para saltar la esquina superior MOV Cl,[temp_tbl] ;Asigna el contenido de [temp_tbl] a Cl DEC Cl ;decrementa Cl para obtener el valor real de el ancho MOV DL,0BAh ;asigna a dl el caracter (columna) Car_columnaDer: ;Etiqueta 'Car_columnaDer' GotoXY [temp_tbl+2h],Bl ;mueve el cursor a las coordenadas especificadas int 21h ;Interrupcion 21h (funciones de el DOS API) INC Bl ;incrementa al para saltar la esquina superior Loop Car_columnaDer ;Salta a la etiqueta 'Car_columnaDer' y decrementa CX mientras no sea cero RET ;Retorna el control a la direccion de el SP desde donde se llamo MarcoXY endp ;Fin del procedimiento ;______________________PROC_CARATULA________________ Caratula proc near ;Inicia prodecimiento cercano 'Caratula' Call Cls ;Llamada al procedimiento 'Cls' Marco 16h,4Eh,0h,1h ;Llamada a la Macro Marco con los parametros : 16h,4Eh,0h,1h Imprime caratula_str,02h,02H ;Llamada a la Macro Imprime con los parametros : caratula_str,02h,02H XOR Ax,Ax ;Resituye el registro Ax a ceros por medio de XOR int 16h ;Interrupcion 16h (funciones de llamada al teclado) RET ;Retorna el control a la direccion de el SP desde donde se llamo Caratula endp ;Fin del procedimiento ;______________________PROC_Adios________________ Adios proc near ;Inicia prodecimiento cercano 'Adios' Call Cls ;Llamada al procedimiento 'Cls' Marco 16h,4Eh,0h,1h ;Llamada a la Macro Marco con los parametros : 16h,4Eh,0h,1h Imprime despedida_str,02h,02H ;Llamada a la Macro Imprime con los parametros : despedida_str,02h,02H GotoXY 0h,017h ;Llamada a la Macro GotoXY con los parametros : 0h,017h MOV AH,4CH ;Asigna 4CH a AH INT 21H ;Interrupcion 21h (funciones de el DOS API) RET ;Retorna el control a la direccion de el SP desde donde se llamo Adios endp ;Fin del procedimiento ;______________________PROC_Resolver________________ RESOLVER proc near ;Inicia prodecimiento cercano 'RESOLVER' CALL AJUSTA_OPERANDOS ;Llamada al procedimiento 'AJUSTA_OPERANDOS' CMP operacion,'+' ;Compara operacion con '+' JE Suma_Op ;Salta si es igual a la etiqueta 'Suma_Op' CMP operacion,'-' ;Compara operacion con '-' JE Resta_Op ;Salta si es igual a la etiqueta 'Resta_Op' CMP operacion,'x' ;Compara operacion con 'x' JE Multiplicacion_Op ;Salta si es igual a la etiqueta 'Multiplicacion_Op' CMP operacion,0F6h ;Compara operacion con 0F6h JE Division_Op ;Salta si es igual a la etiqueta 'Division_Op' JMP Agrega_pila ;Salta a la etiqueta 'Agrega_pila' Suma_Op: ;Etiqueta 'Suma_Op' CALL SUMA ;Llamada al procedimiento 'SUMA' JMP Agrega_pila ;Salta a la etiqueta 'Agrega_pila' Resta_Op: ;Etiqueta 'Resta_Op' CALL RESTA ;Llamada al procedimiento 'RESTA' JMP Agrega_pila ;Salta a la etiqueta 'Agrega_pila' Multiplicacion_Op: ;Etiqueta 'Multiplicacion_Op' CALL MULTIPLICA ;Llamada al procedimiento 'MULTIPLICA' JMP Agrega_pila ;Salta a la etiqueta 'Agrega_pila' Division_Op: ;Etiqueta 'Division_Op' CALL DIVIDE ;Llamada al procedimiento 'DIVIDE' JMP Agrega_pila ;Salta a la etiqueta 'Agrega_pila' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ENVIAR A LA PILA LA OPERACION Agrega_pila: ;Etiqueta 'Agrega_pila' cmp renglones_pila,07h ;Compara renglones_pila con 07h JAE reinicia_pila ;Salta a la etiqueta 'reinicia_pila' si es mayor o igual JMP continuar ;Salta a la etiqueta 'continuar' reinicia_pila: ;Etiqueta 'reinicia_pila' mov renglones_pila,00h ;Asigna 00h a renglones_pila mov posicion_pila,00h ;Asigna 00h a posicion_pila continuar: ;Etiqueta 'continuar' ;;Envia la ultima operacion a la pila de operaciones MOV SI,0000h ;Asigna 0000h a SI mov DI,posicion_pila ;Asigna el contenido de posicion_pila a DI agregar_operacion: ;Etiqueta 'agregar_operacion' MOV AL,display_str[SI] ;Asigna el contenido de display_str[SI] a AL CMP AL,'$' ;Compara AL con '$' JE agregar_resultado ;Salta si es igual a la etiqueta 'agregar_resultado' MOV pila_operaciones[DI],AL ;Asigna el contenido de AL a pila_operaciones[DI] INC SI ;Incrementa en uno el valor de SI INC DI ;Incrementa en uno el valor de DI JMP agregar_operacion ;Salta a la etiqueta 'agregar_operacion' agregar_resultado: ;Etiqueta 'agregar_resultado' MOV pila_operaciones[DI],'=' ;Asigna el contenido de '=' a pila_operaciones[DI] MOV SI,0000h ;Asigna 0000h a SI copy_result_str: ;Etiqueta 'copy_result_str' ;;RESULTADO DESPUES DE SIGNO = MOV AL,resultado_str[SI] ;Asigna el contenido de resultado_str[SI] a AL INC SI ;Incrementa en uno el valor de SI CMP AL,07h ;Compara AL con 07h JNE add_restdo ;Salta si no es igual a la etiqueta 'add_restdo' JMP copy_result_str ;Salta a la etiqueta 'copy_result_str' add_restdo: ;Etiqueta 'add_restdo' CMP AL,'$' ;Compara AL con '$' JE fin_add_restdo ;Salta si es igual a la etiqueta 'fin_add_restdo' INC DI ;Incrementa en uno el valor de DI MOV pila_operaciones[DI],AL ;Asigna el contenido de AL a pila_operaciones[DI] JMP copy_result_str ;Salta a la etiqueta 'copy_result_str' fin_add_restdo: ;Etiqueta 'fin_add_restdo' ;;agrega el salto de linea en la pila INC DI ;Incrementa en uno el valor de DI MOV pila_operaciones[DI],13d ;Asigna 13d a pila_operaciones[DI] INC DI ;Incrementa en uno el valor de DI mov posicion_pila,DI ;Asigna el contenido de DI a posicion_pila mov pila_operaciones[DI],'$' ;Asigna el contenido de '$' a pila_operaciones[DI] inc renglones_pila ; ;;Fin Envia vacia: ;limpiar el display MOV display_str[0],'$' ;corta la cadena del display MOV posicion_entrada,0h ;establece la posicion de la cadena display en cero RET ;Retorna el control a la direccion de el SP desde donde se llamo Resolver endp ;Fin del procedimiento ;______________________PROC_AJUSTE_PRE_OPERACIONAL________________ AJUSTA_OPERANDOS PROC NEAR ;Inicia prodecimiento cercano 'AJUSTA_OPERANDOS' ;en este procedimiento aux contiene el numero que estamos procesando ;0 para el numero_1 y 1 para el numero_2 MOV aux,00h ;lo iniciamos en 0 para el primer operando MOV operacion,00h ;Asigna 00h a operacion ;LEER LA OPERACION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;LEER LA OPERACION DESDE EL PRIMER DIGITO MAS A LA IZQUIERDA MOV SI,00h ;Asigna 00h a SI siguiente_caracter_de_entrada: ;Etiqueta 'siguiente_caracter_de_entrada' MOV AL,display_str[SI] ;Asigna el contenido de display_str[SI] a AL CMP Al,'-' ;Compara Al con '-' JE signo_negativo_detectado ;Salta si es igual a la etiqueta 'signo_negativo_detectado' CMP Al,'+' ;Compara Al con '+' JE signo_positivo_detectado ;Salta si es igual a la etiqueta 'signo_positivo_detectado' CMP Al,'x' ;Compara Al con 'x' JE operador_detectado ;Salta si es igual a la etiqueta 'operador_detectado' CMP Al,0F6h ;Compara Al con 0F6h JE operador_detectado ;Salta si es igual a la etiqueta 'operador_detectado' JMP numero ;Salta a la etiqueta 'numero' signo_negativo_detectado: ;Etiqueta 'signo_negativo_detectado' CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JNE segundo_operando_negativo ;de lo contrario estamos procesando el signo de el segundo operando XOR num1_signo, 01b ;Aplica la operacion XOR con num1_signo y 01b JMP continue ;Salta a la etiqueta 'continue' segundo_operando_negativo: ;Etiqueta 'segundo_operando_negativo' XOR num2_signo, 01b ;Aplica la operacion XOR con num2_signo y 01b signo_positivo_detectado: ;Etiqueta 'signo_positivo_detectado' CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JNE posible_operacional_suma ;Salta si no es igual a la etiqueta 'posible_operacional_suma' ;si no se toma como signo operacional si es que no existe alguno de mayor jerarquia ; como (*,/,-) JMP continue ;Salta a la etiqueta 'continue' operador_detectado: ;Etiqueta 'operador_detectado' ; si hay un doble operador CMP operacion,'x' ;Compara operacion con 'x' JE sintaxs_error_jmp ;Salta si es igual a la etiqueta 'sintaxs_error_jmp' CMP operacion,0F6h ;Compara operacion con 0F6h JE sintaxs_error_jmp ;Salta si es igual a la etiqueta 'sintaxs_error_jmp' CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JE sintaxs_error_jmp ;Salta si es igual a la etiqueta 'sintaxs_error_jmp' MOV operacion,Al ;Asigna el contenido de Al a operacion ; JMP continue ;Salta a la etiqueta 'continue' posible_operacional_suma: ;Etiqueta 'posible_operacional_suma' CMP operacion,'x' ;Compara operacion con 'x' JE continue ;Salta si es igual a la etiqueta 'continue' CMP operacion,'-' ;Compara operacion con '-' JE continue ;Salta si es igual a la etiqueta 'continue' CMP operacion,0F6h ;Compara operacion con 0F6h JE continue ;Salta si es igual a la etiqueta 'continue' ;solo se asigna el operador suma si no existe uno de mayor jerarquia de lo contrario ;el signo mas se considera un indicador de signo MOV operacion,'+' ;Asigna el contenido de '+' a operacion continue: ;Etiqueta 'continue' INC SI ;Incrementa en uno el valor de SI ;CMP SI,POSICION_ENTRADA ;JL siguiente_caracter_de_entrada JMP siguiente_caracter_de_entrada ;Salta a la etiqueta 'siguiente_caracter_de_entrada' numero: ;Etiqueta 'numero' MOV DI,09h ;iniciamos el destino en la ultima posicion de los numeros enteros ; JMP siguiente_numero ;Salta a la etiqueta 'siguiente_numero' sintaxs_error_jmp: ;Etiqueta 'sintaxs_error_jmp' JMP sintaxs_error ;Salta a la etiqueta 'sintaxs_error' ; siguiente_numero: ;Etiqueta 'siguiente_numero' MOV AL,display_str[SI] ;Asigna el contenido de display_str[SI] a AL CMP AL,'.' ;si se estan comenzando los numeros decimales JE decimal ;Salta si es igual a la etiqueta 'decimal' SUB AL,30h ;restamos 30h para obtener el numero real CMP AL,09h ;Compara AL con 09h JA no_mas_numero ;si ya terminaron los numeros ADD AL,30h ;AGREGA 30h a AL CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JNE num_2_e ;si no es de el numero 1 y es entero MOV num1[DI],Al ;Asigna el contenido de Al a num1[DI] DEC DI ;Decrementa en uno el valor de DI JNS continue_numero ;Salta a la etiqueta 'continue_numero' si no hay signo el ZF JMP mas_10_numeros ;Salta a la etiqueta 'mas_10_numeros' num_2_e: ;Etiqueta 'num_2_e' MOV num2[DI],Al ;Asigna el contenido de Al a num2[DI] DEC DI ;Decrementa en uno el valor de DI JNS continue_numero ;Salta a la etiqueta 'continue_numero' si no hay signo el ZF JMP mas_10_numeros ;Salta a la etiqueta 'mas_10_numeros' continue_numero: ;Etiqueta 'continue_numero' INC SI ;Incrementa en uno el valor de SI JMP siguiente_numero ;Salta a la etiqueta 'siguiente_numero' no_mas_numero: ;Etiqueta 'no_mas_numero' XOR aux,01b ;si aux era 0 lo volvemos 1 CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JE termine ;Salta si es igual a la etiqueta 'termine' JMP siguiente_caracter_de_entrada ;Salta a la etiqueta 'siguiente_caracter_de_entrada' ;numero o simbolos si es que existen decimal: ;Etiqueta 'decimal' MOV DI,01h ;Asigna 01h a DI continue_decimal: ;Etiqueta 'continue_decimal' INC SI ;Incrementa en uno el valor de SI MOV Al,display_str[SI] ;Asigna el contenido de display_str[SI] a Al CMP AL,'.' ;si se estan comenzando los numeros decimales JE no_mas_numero_d ;Salta si es igual a la etiqueta 'no_mas_numero_d' CMP AL,'-' ;Compara AL con '-' JE no_mas_numero_d ;Salta si es igual a la etiqueta 'no_mas_numero_d' CMP AL,'x' ;Compara AL con 'x' JE no_mas_numero_d ;Salta si es igual a la etiqueta 'no_mas_numero_d' CMP AL,0F6h ;entre � (alt +246) JE no_mas_numero_d ;Salta si es igual a la etiqueta 'no_mas_numero_d' JMP entrada_correcta_decimal ;Salta a la etiqueta 'entrada_correcta_decimal' entrada_correcta_decimal: ;Etiqueta 'entrada_correcta_decimal' SUB AL,30h ;restamos 30h para obtener el numero real CMP AL,09h ;Compara AL con 09h JA no_mas_numero_d ;si ya terminaron los numeros ;ADD AL,30h CMP aux,00h ;si aux es 1 estamos procesando los signos del primer operando JNE num_2_e_d ;Salta si no es igual a la etiqueta 'num_2_e_d' MOV decimales_1[DI],Al ;Asigna el contenido de Al a decimales_1[DI] INC DI ;Incrementa en uno el valor de DI CMP DI,0Bh ;Compara DI con 0Bh JL continue_decimal ;Salta a la etiqueta 'continue_decimal' si es menor JMP mas_10_numeros ;Salta a la etiqueta 'mas_10_numeros' num_2_e_d: ;Etiqueta 'num_2_e_d' MOV decimales_2[DI],Al ;Asigna el contenido de Al a decimales_2[DI] INC DI ;Incrementa en uno el valor de DI CMP DI,0Bh ;Compara DI con 0Bh JL continue_decimal ;Salta a la etiqueta 'continue_decimal' si es menor JMP mas_10_numeros ;Salta a la etiqueta 'mas_10_numeros' no_mas_numero_d: ;Etiqueta 'no_mas_numero_d' JMP no_mas_numero ;Salta a la etiqueta 'no_mas_numero' termine: ;Etiqueta 'termine' ;si ambos son negativos o positivos=> MOV AL,num2_signo ;Asigna el contenido de num2_signo a AL CMP num1_signo,Al ;Compara num1_signo con Al JE signos_iguales ;Salta si es igual a la etiqueta 'signos_iguales' JMP signos_diferentes ;Salta a la etiqueta 'signos_diferentes' signos_iguales: ;Etiqueta 'signos_iguales' ;si la operacion es suma,division o multipliacion CMP operacion,'x' ;Compara operacion con 'x' JE diferente_mul ;+*+=> (+) le correponde a la multiplicacion CMP operacion,0F6h ;Compara operacion con 0F6h JE diferente_mul ;+*+=> (+) le correponde a la multiplicacion CMP operacion,'+' ;Compara operacion con '+' JE iguales_mult ;+-+ => (+,-) le corresponde a la resta CMP operacion,'-' ;Compara operacion con '-' JE iguales_suma_neg ;Salta si es igual a la etiqueta 'iguales_suma_neg' signos_diferentes: ;Etiqueta 'signos_diferentes' MOV AL,num2_signo ;Asigna el contenido de num2_signo a AL CMP num1_signo,Al ;Compara num1_signo con Al JA neg_pos ;si el signo del primer operando es (-) y el segundo es (+) => (-)>(+)=? JMP pos_neg ;si el signo del primer operando es (+) y el segundo es (-) => (+)>(-)=? ;si el signo del primer operando es (-) y el segundo es (+) => (-)>(+)=? neg_pos: ;Etiqueta 'neg_pos' CMP operacion,'+' ;Compara operacion con '+' JE resta_invertida ;con los operandos invertidos CMP operacion,'-' ;Compara operacion con '-' JE resta_invertida ;con los operandos invertidos CMP operacion,'x' ;Compara operacion con 'x' JE diferente_mul ;+*+=> (+) le correponde a la multiplicacion CMP operacion,0F6h ;Compara operacion con 0F6h JE diferente_mul ;+*+=> (+) le correponde a la multiplicacion JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iguales_mult: ;Etiqueta 'iguales_mult' ;el resultado conservara su signo MOV es_negativo_res,Al ;Asigna el contenido de Al a es_negativo_res JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' iguales_suma_neg: ;Etiqueta 'iguales_suma_neg' MOV operacion,'+' ;Asigna el contenido de '+' a operacion MOV es_negativo_res,Al ;Asigna el contenido de Al a es_negativo_res JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diferente_mul: ;Etiqueta 'diferente_mul' MOV AL,num2_signo ;Asigna el contenido de num2_signo a AL XOR AL,num1_signo ;Aplica la operacion XOR con AL y num1_signo MOV es_negativo_res,Al ;Asigna el contenido de Al a es_negativo_res JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; resta_invertida: ;Etiqueta 'resta_invertida' ;copiamos el numero num2 a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI num2_inversion_cpy: ;Etiqueta 'num2_inversion_cpy' MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_inversion_cpy ;Salta a la etiqueta 'num2_inversion_cpy' si es menor o igual ;copiamos el numero (num1) menor a num2 MOV SI,00h ;Asigna 00h a SI num2_inversion1_cpy: ;Etiqueta 'num2_inversion1_cpy' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV num2[SI],AL ;Asigna el contenido de AL a num2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_inversion1_cpy ;Salta a la etiqueta 'num2_inversion1_cpy' si es menor o igual ;copiamos el numero en ajuste_decimales_1 a num1 MOV SI,00h ;Asigna 00h a SI num1_inversion_cpy: ;Etiqueta 'num1_inversion_cpy' MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV num1[SI],AL ;Asigna el contenido de AL a num1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num1_inversion_cpy ;Salta a la etiqueta 'num1_inversion_cpy' si es menor o igual ;;INVERTIR LOS DECIMALES TAMBIEN ;------------------------------------------------------------------ ;copiamos el numero mayor (decimales_2) a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI dec2_inversion_cpy: ;Etiqueta 'dec2_inversion_cpy' MOV AL,decimales_2[SI] ;Asigna el contenido de decimales_2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_inversion_cpy ;Salta a la etiqueta 'dec2_inversion_cpy' si es menor o igual ;copiamos el numero (decimales_1) menor a decimales_2 MOV SI,00h ;Asigna 00h a SI dec2_inversion1_cpy: ;Etiqueta 'dec2_inversion1_cpy' MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimales_2[SI],AL ;Asigna el contenido de AL a decimales_2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_inversion1_cpy ;Salta a la etiqueta 'dec2_inversion1_cpy' si es menor o igual ;copiamos el numero mayor guardado en ajuste_decimales_1 a decimales_1 MOV SI,00h ;Asigna 00h a SI dec1_inversion_cpy: ;Etiqueta 'dec1_inversion_cpy' MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV decimales_1[SI],AL ;Asigna el contenido de AL a decimales_1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec1_inversion_cpy ;Salta a la etiqueta 'dec1_inversion_cpy' si es menor o igual MOV operacion,'-' ;Asigna el contenido de '-' a operacion JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' ;------------------------------------------------------------------ ;si el signo del primer operando es (+) y el segundo es (-) => (+)>(-)=? pos_neg: ;Etiqueta 'pos_neg' CMP operacion,'+' ;Compara operacion con '+' JE resta_invertida ;con los operandos invertidos CMP operacion,'-' ;Compara operacion con '-' JE suma_pos ; CMP operacion ,'x' ;se multiplican los signos en ambos casos (-)*(-)=+ (+)*(+)=+ -*+=- JE pos_neg_mul ;Salta si es igual a la etiqueta 'pos_neg_mul' CMP operacion,0F6h ;Compara operacion con 0F6h JE pos_neg_mul ;Salta si es igual a la etiqueta 'pos_neg_mul' suma_pos: ;Etiqueta 'suma_pos' MOV operacion,'+' ;Asigna el contenido de '+' a operacion MOV es_negativo_res,00h ;Asigna 00h a es_negativo_res JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' pos_neg_mul: ;Etiqueta 'pos_neg_mul' MOV AL,num2_signo ;Asigna el contenido de num2_signo a AL XOR AL,num1_signo ;Aplica la operacion XOR con AL y num1_signo MOV es_negativo_res,Al ;Asigna el contenido de Al a es_negativo_res JMP ley_signos_end ;Salta a la etiqueta 'ley_signos_end' ley_signos_end: ;Etiqueta 'ley_signos_end' ;;INVERTIMOS LAS PARTES ENTERAS DE LOS OPERANDOS PORQUE SE GUARDARON AL REVEZ ;lo copiamos ajustado a una variable auxiliar para ajustes de este tipo MOV CX,09h ;Asigna 09h a CX MOV SI,00h ;Asigna 00h a SI Count_1: ;Etiqueta 'Count_1' INC SI ;Incrementa en uno el valor de SI MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL CMP AL,00h ;Compara AL con 00h JNE fin_count1 ;Salta si no es igual a la etiqueta 'fin_count1' Loop Count_1 ;Salta a la etiqueta 'Count_1' y decrementa CX mientras no sea cero fin_count1: ;Etiqueta 'fin_count1' MOV BX,SI ;Asigna el contenido de SI a BX MOV DI,09h ;iniciamos el destino en la ultima posicion de los numeros enteros return_num1: ;Etiqueta 'return_num1' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV ajuste_decimales_1[DI],Al ;Asigna el contenido de Al a ajuste_decimales_1[DI] DEC DI ;Decrementa en uno el valor de DI INC SI ;Incrementa en uno el valor de SI CMP SI,0Ah ;Compara SI con 0Ah JL return_num1 ;Salta a la etiqueta 'return_num1' si es menor ;pasamos de la variable temporal ajustada a la definitiva MOV CX,09h ;Asigna 09h a CX adjust_num1: ;Etiqueta 'adjust_num1' MOV DI,CX ;Asigna el contenido de CX a DI MOV AL,ajuste_decimales_1[DI] ;Asigna el contenido de ajuste_decimales_1[DI] a AL SUB AL,30h ;restamos 30h para obtener el numero real CMP AL,0D0h ;Compara AL con 0D0h JE fix_al1 ;Salta si es igual a la etiqueta 'fix_al1' fixed_al1: ;Etiqueta 'fixed_al1' MOV num1[DI],AL ;Asigna el contenido de AL a num1[DI] DEC CX ;Decrementa en uno el valor de CX JNS adjust_num1 ;Salta a la etiqueta 'adjust_num1' si no hay signo el ZF ;para el numero 2 MOV CX,09h ;Asigna 09h a CX MOV SI,00h ;Asigna 00h a SI Count_2: ;Etiqueta 'Count_2' INC SI ;Incrementa en uno el valor de SI MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL CMP AL,00h ;Compara AL con 00h JNE fin_count2 ;Salta si no es igual a la etiqueta 'fin_count2' Loop Count_2 ;Salta a la etiqueta 'Count_2' y decrementa CX mientras no sea cero fin_count2: ;Etiqueta 'fin_count2' MOV BX,SI ;Asigna el contenido de SI a BX MOV DI,09h ;iniciamos el destino en la ultima posicion de los numeros enteros return_num2: ;Etiqueta 'return_num2' MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL MOV ajuste_decimales_2[DI],Al ;Asigna el contenido de Al a ajuste_decimales_2[DI] DEC DI ;Decrementa en uno el valor de DI INC SI ;Incrementa en uno el valor de SI CMP SI,0Ah ;Compara SI con 0Ah JL return_num2 ;Salta a la etiqueta 'return_num2' si es menor ;pasamos de la variable temporal ajustada a la definitiva MOV CX,09h ;Asigna 09h a CX adjust_num2: ;Etiqueta 'adjust_num2' MOV DI,CX ;Asigna el contenido de CX a DI MOV AL,ajuste_decimales_2[DI] ;Asigna el contenido de ajuste_decimales_2[DI] a AL SUB AL,30h ;restamos 30h para obtener el numero real CMP AL,0D0h ;Compara AL con 0D0h JE fix_al2 ;Salta si es igual a la etiqueta 'fix_al2' fixed_al2: ;Etiqueta 'fixed_al2' MOV num2[DI],AL ;Asigna el contenido de AL a num2[DI] DEC CX ;Decrementa en uno el valor de CX JNS adjust_num2 ;Salta a la etiqueta 'adjust_num2' si no hay signo el ZF RET ;Retorna el control a la direccion de el SP desde donde se llamo fix_al1: ;Etiqueta 'fix_al1' ADD AL,30h ;AGREGA 30h a AL JMP fixed_al1 ;Salta a la etiqueta 'fixed_al1' fix_al2: ;Etiqueta 'fix_al2' ADD AL,30h ;AGREGA 30h a AL JMP fixed_al2 ;Salta a la etiqueta 'fixed_al2' JMP fin_ajusta_operandos ;Salta a la etiqueta 'fin_ajusta_operandos' mas_10_numeros: ;Etiqueta 'mas_10_numeros' ERROR Mas10_numeros ;Llamada a la Macro ERROR con los parametros : Mas10_numeros MOV resultado_str[00h],'E' ;Asigna el contenido de 'E' a resultado_str[00h] MOV resultado_str[01h],'R' ;Asigna el contenido de 'R' a resultado_str[01h] MOV resultado_str[02h],'R' ;Asigna el contenido de 'R' a resultado_str[02h] MOV resultado_str[03h],'O' ;Asigna el contenido de 'O' a resultado_str[03h] MOV resultado_str[04h],'R' ;Asigna el contenido de 'R' a resultado_str[04h] MOV resultado_str[05h],'$' ;Asigna el contenido de '$' a resultado_str[05h] MOV operacion,00h ;Asigna 00h a operacion RET ;Retorna el control a la direccion de el SP desde donde se llamo sintaxs_error: ;Etiqueta 'sintaxs_error' ERROR sintax_error_msj ;Llamada a la Macro ERROR con los parametros : sintax_error_msj MOV resultado_str[00h],'E' ;Asigna el contenido de 'E' a resultado_str[00h] MOV resultado_str[01h],'R' ;Asigna el contenido de 'R' a resultado_str[01h] MOV resultado_str[02h],'R' ;Asigna el contenido de 'R' a resultado_str[02h] MOV resultado_str[03h],'O' ;Asigna el contenido de 'O' a resultado_str[03h] MOV resultado_str[04h],'R' ;Asigna el contenido de 'R' a resultado_str[04h] MOV resultado_str[05h],'$' ;Asigna el contenido de '$' a resultado_str[05h] MOV operacion,00h ;Asigna 00h a operacion RET ;Retorna el control a la direccion de el SP desde donde se llamo fin_ajusta_operandos: ;Etiqueta 'fin_ajusta_operandos' RET ;Retorna el control a la direccion de el SP desde donde se llamo AJUSTA_OPERANDOS ENDP ;Fin del procedimiento ;______________________PROC_SUMA________________ SUMA PROC NEAR ;Inicia prodecimiento cercano 'SUMA' ;SUMAR PARTES ENTERAS SIN IMPORTAR ACARREOS MOV DI,13h ;Asigna 13h a DI MOV SI,09h ;Asigna 09h a SI JMP siguiente_entero ;Salta a la etiqueta 'siguiente_entero' fin_enteros: ;Etiqueta 'fin_enteros' MOV num_res[SI],'$' ;Asigna el contenido de '$' a num_res[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_entero ;Salta a la etiqueta 'siguiente_entero' siguiente_entero: ;Etiqueta 'siguiente_entero' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_enteros ;Salta si es igual a la etiqueta 'fin_enteros' ADD AL,num2[SI] ;Suma el valor de AL con el de num2[SI], el resultado queda en AL MOV num_res[DI],AL ;Asigna el contenido de AL a num_res[DI] DEC DI ;Decrementa en uno el valor de DI DEC SI ;Decrementa en uno el valor de SI JNS siguiente_entero ;Salta a la etiqueta 'siguiente_entero' si no hay signo el ZF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MOV num1[0Ah],'$' ;Asigna el contenido de '$' a num1[0Ah] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;SUMAR PARTES DECIMALES SIN IMPORTAR ACARREOS MOV SI,0Ah ;Asigna 0Ah a SI JMP siguiente_decimal ;Salta a la etiqueta 'siguiente_decimal' fin_decimales: ;Etiqueta 'fin_decimales' ;MOV decimales_Res[SI],'$' DEC SI ;Decrementa en uno el valor de SI JMP siguiente_decimal ;Salta a la etiqueta 'siguiente_decimal' siguiente_decimal: ;Etiqueta 'siguiente_decimal' MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_decimales ;Salta si es igual a la etiqueta 'fin_decimales' ADD AL,decimales_2[SI] ;Suma el valor de AL con el de decimales_2[SI], el resultado queda en AL MOV decimales_Res[SI],AL ;Asigna el contenido de AL a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_decimal ;Salta a la etiqueta 'siguiente_decimal' si no hay signo el ZF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JMP primer_vezSumando ;Salta a la etiqueta 'primer_vezSumando' acarreo_del_Acarreo: ;Etiqueta 'acarreo_del_Acarreo' MOV hay_acarreo,00h ;Asigna 00h a hay_acarreo primer_vezSumando: ;Etiqueta 'primer_vezSumando' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AJUSTAR LOS ACARREOS DECIMALES MOV SI,0Ah ;Asigna 0Ah a SI JMP siguiente_Acarreo_decimal ;Salta a la etiqueta 'siguiente_Acarreo_decimal' ; es_fin_decimal: ;Etiqueta 'es_fin_decimal' DEC SI ;Decrementa en uno el valor de SI JMP siguiente_Acarreo_decimal ;Salta a la etiqueta 'siguiente_Acarreo_decimal' ; AcarreoDecimal: ;Etiqueta 'AcarreoDecimal' MOV hay_acarreo,01h ;Asigna 01h a hay_acarreo MOV Al,decimales_Res[SI] ;Asigna el contenido de decimales_Res[SI] a Al AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) ;;si es el primer numero decimal deselo a los enteros cmp SI,0000h ;Compara SI con 0000h JNE no_es_primero ;Salta si no es igual a la etiqueta 'no_es_primero' JMP es_primero ;Salta a la etiqueta 'es_primero' ;; no_es_primero: ;Etiqueta 'no_es_primero' ADD decimales_Res[SI-1],Ah ;AGREGA Ah a decimales_Res[SI-1] MOV decimales_Res[SI],Al ;Asigna el contenido de Al a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_Acarreo_decimal ;Salta a la etiqueta 'siguiente_Acarreo_decimal' es_primero: ;Etiqueta 'es_primero' ;;--> es primero MOV decimales_Res[SI],Al ;Asigna el contenido de Al a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI ;;fin el primero siguiente_Acarreo_decimal: ;Etiqueta 'siguiente_Acarreo_decimal' CMP SI,0FFFFh ;Compara SI con 0FFFFh JE fin_ajuste_AcarreoDecimal ;Salta si es igual a la etiqueta 'fin_ajuste_AcarreoDecimal' CMP decimales_Res[SI],'$' ;Compara decimales_Res[SI] con '$' JE es_fin_decimal ;Salta si es igual a la etiqueta 'es_fin_decimal' CMP decimales_Res[SI],0Ah ;Compara decimales_Res[SI] con 0Ah JAE AcarreoDecimal ;Salta a la etiqueta 'AcarreoDecimal' si es mayor o igual DEC SI ;Decrementa en uno el valor de SI JNS siguiente_Acarreo_decimal ;Salta a la etiqueta 'siguiente_Acarreo_decimal' si no hay signo el ZF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; fin_ajuste_AcarreoDecimal: ;Etiqueta 'fin_ajuste_AcarreoDecimal' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AJUSTAR LOS ACARREOS ENTEROS MOV SI,13h ;Asigna 13h a SI JMP siguiente_Acarreo_entero ;Salta a la etiqueta 'siguiente_Acarreo_entero' ; es_fin_entero: ;Etiqueta 'es_fin_entero' DEC SI ;Decrementa en uno el valor de SI JS acarreos_pendientes_suma ;Salta a la etiqueta 'acarreos_pendientes_suma' si hay signo el ZF JMP siguiente_Acarreo_entero ;Salta a la etiqueta 'siguiente_Acarreo_entero' ; AcarreoEntero: ;Etiqueta 'AcarreoEntero' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CMP SI,0000h MOV hay_acarreo,01h ;Asigna 01h a hay_acarreo MOV Al,num_res[SI] ;Asigna el contenido de num_res[SI] a Al AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) ADD num_res[SI-1],Ah ;AGREGA Ah a num_res[SI-1] MOV num_res[SI],Al ;Asigna el contenido de Al a num_res[SI] DEC SI ;Decrementa en uno el valor de SI siguiente_Acarreo_entero: ;Etiqueta 'siguiente_Acarreo_entero' CMP decimales_Res[SI-1],'$' ;Compara decimales_Res[SI-1] con '$' JE es_fin_entero ;Salta si es igual a la etiqueta 'es_fin_entero' CMP num_res[SI],0Ah ;Compara num_res[SI] con 0Ah JAE AcarreoEntero ;Salta a la etiqueta 'AcarreoEntero' si es mayor o igual DEC SI ;Decrementa en uno el valor de SI JNS siguiente_Acarreo_entero ;Salta a la etiqueta 'siguiente_Acarreo_entero' si no hay signo el ZF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; acarreos_pendientes_suma: ;Etiqueta 'acarreos_pendientes_suma' ;;;;;;;;;;;;;;;;AGREGAR ACARREOS PENDIENTES MOV AL,num_res[13h] ;Asigna el contenido de num_res[13h] a AL ADD AL,decimales_Res[0h] ;Suma el valor de AL con el de decimales_Res[0h], el resultado queda en AL MOV num_res[13h],Al ;Asigna el contenido de Al a num_res[13h] MOV decimales_Res[0h],00h ;limpiar el acarreo CMP hay_acarreo,01h ;Compara hay_acarreo con 01h JNE no_mas_acarreo ;Salta si no es igual a la etiqueta 'no_mas_acarreo' JMP acarreo_del_Acarreo ;Salta a la etiqueta 'acarreo_del_Acarreo' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;AJUSTAR PARA IMPRESION ;;ajustar la parte entera no_mas_acarreo: ;Etiqueta 'no_mas_acarreo' MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste ;Salta a la etiqueta 'inicia_ajuste' salta_fin: ;Etiqueta 'salta_fin' DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste ;Salta a la etiqueta 'inicia_ajuste' inicia_ajuste: ;Etiqueta 'inicia_ajuste' MOV AL,num_res[SI] ;Asigna el contenido de num_res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin ;Salta si es igual a la etiqueta 'salta_fin' ADD AL,30h ;AGREGA 30h a AL MOV num_res[SI],AL ;lo devuelve convertido en ascii a la posicion de donde lo tomo DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste ;Salta a la etiqueta 'inicia_ajuste' si no hay signo el ZF ;;ajustar la parte decimal MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste_d ;Salta a la etiqueta 'inicia_ajuste_d' salta_fin_d: ;Etiqueta 'salta_fin_d' DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste_d ;Salta a la etiqueta 'inicia_ajuste_d' inicia_ajuste_d: ;Etiqueta 'inicia_ajuste_d' MOV AL,decimales_Res[SI] ;Asigna el contenido de decimales_Res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin_d ;Salta si es igual a la etiqueta 'salta_fin_d' ADD AL,30h ;AGREGA 30h a AL MOV decimales_Res[SI],AL ;Asigna el contenido de AL a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste_d ;Salta a la etiqueta 'inicia_ajuste_d' si no hay signo el ZF MOV decimales_Res[0h],07h ;limpiar el acarreo CALL AJUSTE_PARA_IMPRESION ;Llamada al procedimiento 'AJUSTE_PARA_IMPRESION' RET ;Retorna el control a la direccion de el SP desde donde se llamo SUMA ENDP ;Fin del procedimiento ;----------------------RESTA PROC------------------------------------------ RESTA PROC NEAR ;Inicia prodecimiento cercano 'RESTA' ;DETERMINAR CUAL NUMERO ES MAYOR ;reccorer el num1 y num2 desde la posicion 0 MOV SI,00h ;Asigna 00h a SI cual_es_mayor_res: ; etiqueta INC SI ;Incrementa en uno el valor de SI MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL ;COMPARAR NUM1 CON NUM2 CMP num1[SI],AL ;compara el contenido de AL con num1[SI] ;si num1 es mayor ya podemos restar JA acomodados_para_la_resta ;salta a la etiqueta acomodados_para_la_resta si es mayor JE iguales ;salta a la etiqueta iguales si son iguales JMP num2_mayor ;si no significa que num2 es mayor y salta a la etiqueta acomodados_para_la_resta: ;etiqueta MOV es_negativo_res,01h ;asigna 01h a es_negativo_res JMP ya_puedes_restar ;salta a la etiqueta ya_puedes_restar iguales: ;etiqueta ;REVISAR LOS DECIMALES MOV SI,01H decim_mayor: MOV AL,decimales_2[SI] MOV AH,decimales_1[SI] CMP AL,AH JA num2_mayor CMP SI,09H INC SI JL decim_mayor JMP acomodados_para_la_resta MOV es_negativo_res,00h ;Asigna 00h a es_negativo_res CMP SI,09h ;Compara SI con 09h JE ya_puedes_restar ; si son iguales salta a acomodados_para_la_resta JMP cual_es_mayor_res ;salta a la etiqueta cual_es_mayor_res num2_mayor: ;etiqueta ;copiamos el numero mayor (num2) a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI num2_mayor_cpy: ;etiqueta MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_mayor_cpy ;salta a num2_mayor_cpy si es menor o igual ;copiamos el numero (num1) menor a num2 MOV SI,00h ;Asigna 00h a SI num2_menor_cpy: ;etiqueta MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV num2[SI],AL ;Asigna el contenido de AL a num2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_menor_cpy ;salta a num2_mayor_cpy si es menor o igual ;copiamos el numero mayor guardado en ajuste_decimales_1 a num1 MOV SI,00h ;Asigna 00h a SI num1_ajuste_cpy: ;etiqueta MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV num1[SI],AL ;Asigna el contenido de AL a num1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num1_ajuste_cpy ;salta a num1_mayor_cpy si es menor o igual ;;INVERTIR LOS DECIMALES TAMBIEN ;------------------------------------------------------------------ ;copiamos el numero mayor (decimales_2) a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI dec2_mayor_cpy: ;etiqueta MOV AL,decimales_2[SI] ;Asigna el contenido de decimales_2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_mayor_cpy ;salta a dec2_mayor_cpy si es menor o igual ;copiamos el numero (decimales_1) menor a decimales_2 MOV SI,00h ;Asigna 00h a SI dec2_menor_cpy: ;etiqueta MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimales_2[SI],AL ;Asigna el contenido de AL a decimales_2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_menor_cpy ;salta a dec2_mayor_cpy si es menor o igual ;copiamos el numero mayor guardado en ajuste_decimales_1 a decimales_1 MOV SI,00h ;Asigna 00h a SI dec1_ajuste_cpy: ;etiqueta MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV decimales_1[SI],AL ;Asigna el contenido de AL a decimales_1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec1_ajuste_cpy ;salta a dec1_mayor_cpy si es menor o igual ;MOV es_negativo_res,01h;asigna 01h a es_negativo_res ;------------------------------------------------------------------ ya_puedes_restar: ;Etiqueta 'ya_puedes_restar' ;RESTAR PARTES DECIMALES MOV SI,09h ;Asigna 09h a SI JMP siguiente_decimal_res ;salta a la etiqueta siguiente_entero_res fin_decimal_res: ;etiqueta MOV decimales_Res[SI],'$' ;asigna fin de cadena a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_decimal_res ;salta a la etiqueta siguiente_entero_res siguiente_decimal_res: ;etiqueta MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_decimal_res ; salta a la etiqueta fin_decimal_res si es igual CMP AL,decimales_2[SI] ;asigna el contenido de la direccion de memoria de decimales_2 direccionada por SI a AL JL pide_prestado_d ;salta a la etiqueta pide_prestado_d si es menor JMP resta_conNormalidad_d ; salta a la etiqueta resta_conNormalidad_d pide_prestado_d: ;etiqueta CMP SI,0000h ;compara si el SI esta limpio JE prestamo_desde_los_enteros ; si es igual salta a prestamo_desde_los_enteros DEC decimales_1[SI-1] ;decrementa decimales_1[SI-1] ADD decimales_1[SI],0Ah ;suma 0Ah a decimales_1[SI] resta_conNormalidad_d: ;etiqueta MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL SUB AL,decimales_2[SI] ;asigna el contenido de la direccion de memoria de decimales_2 direccionada por SI a AL MOV decimales_Res[SI],AL ;Asigna el contenido de AL a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_decimal_res ;salta a siguiente_decimal_res si no tiene signo JMP enteros_res ;salta a la etiqueta enteros_res ;AJUSTAR ACARREO DECIMAL NEGATIVO PARA LOS ENTEROS prestamo_desde_los_enteros: ;etiqueta DEC num1[09h] ;decrementa num1[09h] MOV decimales_Res[0h],00h ;limpiar el acarreo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;RESTAR PARTES ENTERAS enteros_res: ;etiqueta MOV SI,09h ;Asigna 09h a SI MOV DI,13h ;Asigna 13h a DI JMP siguiente_entero_res ;salta a la etiqueta siguiente_entero_res fin_enteros_res: ;etiqueta MOV num_res[SI],'$' ;Asigna el contenido de '$' a num_res[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_entero_res ;salta a la etiqueta siguiente_entero_res siguiente_entero_res: ;etiqueta MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_enteros_res ;salta a fin_enteros_res si es igual CMP AL,num2[SI] ;compara el contenido de num2[SI] con AL JL pide_prestado_e ;salta a pide_prestado_e si es menor JMP resta_conNormalidad_e ;salta a la etiqueta resta_conNormalidad_e pide_prestado_e: ;etiqueta DEC num1[SI-1] ;decrementa num1[SI-1] ADD num1[SI],0Ah ;suma 0Ah a num1[SI] resta_conNormalidad_e: ;etiqueta MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL SUB AL,num2[SI] ;asigna el contenido de la direccion de memoria de num2 direccionada por SI a AL MOV num_res[DI],AL ;Asigna el contenido de AL a num_res[DI] DEC DI ;Decrementa en uno el valor de DI DEC SI ;Decrementa en uno el valor de SI JNS siguiente_entero_res ;salta a siguiente_entero_res si no tiene signo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;AJUSTAR PARA IMPRESION ;;ajustar la parte entera MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste_res ;salta a la etiqueta inicia_ajuste_res salta_fin_res: ;etiqueta DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste_res ;salta a la etiqueta inicia_ajuste_res inicia_ajuste_res: ;etiqueta MOV AL,num_res[SI] ;Asigna el contenido de num_res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin_res ;Si es igual salta a salta_fin_res ADD AL,30h ;AGREGA 30h a AL MOV num_res[SI],AL ;lo devuelve convertido en ascii a la posicion de donde lo tomo DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste_res ;salta a inicia_ajuste_res si no tiene signo ;;ajustar la parte decimal MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste_d_res ;salta a la etiqueta inicia_ajuste_res salta_fin_d_res: ;etiqueta DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste_d_res ;salta a la etiqueta inicia_ajuste_res inicia_ajuste_d_res: ;etiqueta MOV AL,decimales_Res[SI] ;Asigna el contenido de decimales_Res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin_d_res ;Si es igual salta a salta_fin_res ADD AL,30h ;AGREGA 30h a AL MOV decimales_Res[SI],AL ;Asigna el contenido de AL a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste_d_res ;salta a inicia_ajuste_res si no tiene signo MOV decimales_Res[0h],07h ;limpiar el acarreo CALL AJUSTE_PARA_IMPRESION ;Llamada al procedimiento 'AJUSTE_PARA_IMPRESION' RET ;Retorna el control a la direccion de el SP desde donde se llamo RESTA ENDP ;fin del procedimento resta ;-------------------------------MULTIPLICA---------------------------------------------- MULTIPLICA PROC NEAR ;Inicia prodecimiento cercano 'MULTIPLICA' MOV CX,09h ;Asigna 09h a CX cpy_mul_e: ;Etiqueta 'cpy_mul_e' MOV SI,CX ;Asigna el contenido de CX a SI MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV num_1_mul[SI-1],Al ;Asigna el contenido de Al a num_1_mul[SI-1] MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL MOV num_2_mul[SI-1],Al ;Asigna el contenido de Al a num_2_mul[SI-1] LOOP cpy_mul_e ;Salta a la etiqueta 'cpy_mul_e' y decrementa CX mientras no sea cero MOV CX,09h ;Asigna 09h a CX cpy_mul_d: ;Etiqueta 'cpy_mul_d' MOV SI,CX ;Asigna el contenido de CX a SI MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimal_1_mul[SI-1],Al ;Asigna el contenido de Al a decimal_1_mul[SI-1] MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimal_2_mul[SI-1],Al ;Asigna el contenido de Al a decimal_2_mul[SI-1] LOOP cpy_mul_d ;Salta a la etiqueta 'cpy_mul_d' y decrementa CX mientras no sea cero mov si,0000h ;Asigna 0000h a si mov di,0000h ;Asigna 0000h a di LEA di,num_res_mul[23h] ;Asigna a DX la direccion inicial de desplzamiento de la variable: 'di,num_res_mul[23h]' LEA si,num_1_mul[11h] ;Asigna a DX la direccion inicial de desplzamiento de la variable: 'si,num_1_mul[11h]' LEA bx,num_2_mul ;Asigna a DX la direccion inicial de desplzamiento de la variable: 'bx,num_2_mul' mov cx,18 ;Asigna 18 a cx p_ciclo_mul: ;Etiqueta 'p_ciclo_mul' PUSH cx ;Envia cx a la pila PUSH di ;Envia di a la pila mov ax,17 ;Asigna 17 a ax mov cx,18 ;Asigna 18 a cx s_ciclo_mul: ;Etiqueta 's_ciclo_mul' mov dx,ax ;Asigna el contenido de ax a dx XLAT ;Transfiere el contenido de la direccion de memoria dada por la suma de (BX + Al) a Al mov dh,[si] ;Asigna el contenido de [si] a dh mul dh ;Multiplica Al por dh AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) add al,[di] ;Suma el valor de al con el de [di], el resultado queda en al add al,acarreo ;Suma el valor de al con el de acarreo, el resultado queda en al mov acarreo,ah ;Asigna ah a acarreo mov ah,0h ;Asigna 0h a ah AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) mov [di],al ;Asigna el contenido de al a [di] mov al,acarreo ;Asigna el contenido de acarreo a al add al,ah ;AGREGA ah a al mov acarreo,al ;Asigna el contenido de al a acarreo dec di ;Decrementa en uno el valor de di mov dh,0 ;Asigna 0 a dh mov ax,dx ;Asigna el contenido de dx a ax dec ax ;Decrementa en uno el valor de ax LOOP s_ciclo_mul ;Salta a la etiqueta 's_ciclo_mul' y decrementa CX mientras no sea cero mov ax,[di] ;Asigna el contenido de [di] a ax add al,acarreo ;Suma el valor de al con el de acarreo, el resultado queda en al mov [di],al ;Asigna el contenido de al a [di] POP di ;Saca di de la pila POP cx ;Saca cx de la pila dec si ;Decrementa en uno el valor de si dec di ;Decrementa en uno el valor de di mov acarreo,0h ;Asigna 0h a acarreo LOOP p_ciclo_mul ;Salta a la etiqueta 'p_ciclo_mul' y decrementa CX mientras no sea cero mov cx,36 ;Asigna 36 a cx LEA di,num_res_mul ;Asigna a DX la direccion inicial de desplzamiento de la variable: 'di,num_res_mul' ciclo_A: ;Etiqueta 'ciclo_A' mov al,[di] ;Asigna el contenido de [di] a al add al,30h ;AGREGA 30h a al mov [di],al ;Asigna el contenido de al a [di] inc di ;Incrementa en uno el valor de di LOOP ciclo_A ;Salta a la etiqueta 'ciclo_A' y decrementa CX mientras no sea cero MOV CX,11h ;Asigna 11h a CX cpy_res_e: ;Etiqueta 'cpy_res_e' MOV SI,CX ;Asigna el contenido de CX a SI MOV AL,num_res_mul[SI] ;Asigna el contenido de num_res_mul[SI] a AL MOV num_res[SI+2],Al ;Asigna el contenido de Al a num_res[SI+2] LOOP cpy_res_e ;Salta a la etiqueta 'cpy_res_e' y decrementa CX mientras no sea cero MOV CX,11h ;Asigna 11h a CX cpy_res_d: ;Etiqueta 'cpy_res_d' MOV SI,CX ;Asigna el contenido de CX a SI MOV AL,decimal_res_mul[SI] ;Asigna el contenido de decimal_res_mul[SI] a AL MOV decimales_res[SI],Al ;Asigna el contenido de Al a decimales_res[SI] LOOP cpy_res_d ;Salta a la etiqueta 'cpy_res_d' y decrementa CX mientras no sea cero MOV decimales_res[0h],07h ;Asigna 07h a decimales_res[0h] MOV decimales_res[12h],30H ;Asigna 30H a decimales_res[12h] MOV decimales_res[13h],30H ;Asigna 30H a decimales_res[13h] MOV num_res[00h],30h ;Asigna 30h a num_res[00h] MOV num_res[01h],30h ;Asigna 30h a num_res[01h] MOV num_res[02h],30h ;Asigna 30h a num_res[02h] CALL AJUSTE_PARA_IMPRESION ;Llamada al procedimiento 'AJUSTE_PARA_IMPRESION' RET ;Retorna el control a la direccion de el SP desde donde se llamo MULTIPLICA ENDP ;Fin del procedimiento ;;;;----------------------------------DIVIDE------------------------------ DIVIDE PROC NEAR ;Inicia prodecimiento cercano 'DIVIDE' MOV resultado_entero_div,01h ;Asigna 01h a resultado_entero_div ;---------------------------------------------------------------------------------- ;;REVISAR QUE LA DIVISION NO SEA x/0 MOV SI,09h ;Asigna 09h a SI revisa_indefinidos: ;Etiqueta 'revisa_indefinidos' CMP num2[SI],00H ;Compara num2[SI] con 00H JNE no_es_indefinida_jmp ;Salta si no es igual a la etiqueta 'no_es_indefinida_jmp' CMP decimales_2[SI],00H ;Compara decimales_2[SI] con 00H JNE no_es_indefinida_jmp ;Salta si no es igual a la etiqueta 'no_es_indefinida_jmp' DEC SI ;Decrementa en uno el valor de SI JNS revisa_indefinidos ;Salta a la etiqueta 'revisa_indefinidos' si no hay signo el ZF MOV CX,0Dh ;longuitud de la palabra "Indeterminado" MOV SI,00h ;Asigna 00h a SI JMP indeterminado_cpy ;Salta a la etiqueta 'indeterminado_cpy' no_es_indefinida_jmp: ;Etiqueta 'no_es_indefinida_jmp' JMP no_es_indefinida ;Salta a la etiqueta 'no_es_indefinida' indeterminado_cpy: ;Etiqueta 'indeterminado_cpy' MOV AL,indefinida[SI] ;Asigna el contenido de indefinida[SI] a AL MOV num_res[SI],Al ;Asigna el contenido de Al a num_res[SI] INC SI ;Incrementa en uno el valor de SI Loop indeterminado_cpy ;Salta a la etiqueta 'indeterminado_cpy' y decrementa CX mientras no sea cero MOV decimales_Res[00h],07h ;borrar los decimales MOV decimales_Res[01h],07h ;borrar los decimales CALL AJUSTE_PARA_IMPRESION ;Llamada al procedimiento 'AJUSTE_PARA_IMPRESION' ERROR div_x_cero ;Llamada a la Macro ERROR con los parametros : div_x_cero RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_indefinida: ;Etiqueta 'no_es_indefinida' ;;COPIAR LOS OPERANDOS ORIGINALES EN LAS VARIABLES ESPECIALES ;;PARA LA DIVISION MOV DI,0000h ;Asigna 0000h a DI aun_hay_resuido: ;Etiqueta 'aun_hay_resuido' ;------------------------------------------------------------------------------------INICIA_RESTA ;DETERMINAR CUAL NUMERO ES MAYOR ;reccorer el num1 y num2 desde la posicion 0 MOV SI,00h ;Asigna 00h a SI cual_es_mayor_div: ;Etiqueta 'cual_es_mayor_div' INC SI ;Incrementa en uno el valor de SI MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL ;COMPARAR num1 CON num2 CMP num1[SI],AL ;compara el contenido de AL con num1[SI] ;si num1 es mayor ya podemos restar JA acomodados_para_la_resta_div ;Salta si es mayor a la etiqueta 'acomodados_para_la_resta_div' ;si son iguales_div JE iguales_div ;Salta si es igual a la etiqueta 'iguales_div' ;si no significa que num2 es mayor JMP num2_mayor_div ;Salta a la etiqueta 'num2_mayor_div' acomodados_para_la_resta_div: ;Etiqueta 'acomodados_para_la_resta_div' JMP ya_puedes_restar_div ;Salta a la etiqueta 'ya_puedes_restar_div' iguales_div: ;Etiqueta 'iguales_div' MOV es_negativo_resuido_div,00h ;no hay signo en la parte entera CMP SI,09h ;Compara SI con 09h JE revisar_parte_decimal ;Salta si es igual a la etiqueta 'revisar_parte_decimal' JMP cual_es_mayor_div ;Salta a la etiqueta 'cual_es_mayor_div' ;----------------------------------------------------------------------------- revisar_parte_decimal: ;Etiqueta 'revisar_parte_decimal' ;revisar su parte decimal para determinar el mayor MOV SI,00h ;Asigna 00h a SI cual_es_mayor_dec: ;Etiqueta 'cual_es_mayor_dec' INC SI ;Incrementa en uno el valor de SI MOV AL,decimales_2[SI] ;Asigna el contenido de decimales_2[SI] a AL ;COMPARAR num1 CON num2 CMP decimales_1[SI],AL ;Compara decimales_1[SI] con AL ;si num1 es mayor ya podemos restar JA acomodados_para_la_resta_div ;Salta si es mayor a la etiqueta 'acomodados_para_la_resta_div' ;si no significa que num2 es mayor JL num2_mayor_div ;Salta a la etiqueta 'num2_mayor_div' si es menor CMP SI,09h ;Compara SI con 09h JL cual_es_mayor_dec ;Salta a la etiqueta 'cual_es_mayor_dec' si es menor JMP ya_puedes_restar_div ;Salta a la etiqueta 'ya_puedes_restar_div' ;----------------------------------------------------------------------------- ;------------------->inicia ajuste para que num 1 sea siempre mayor num2_mayor_div: ;Etiqueta 'num2_mayor_div' MOV es_negativo_resuido_div,01h ;Asigna 01h a es_negativo_resuido_div MOV resultado_entero_div,00h ;Asigna 00h a resultado_entero_div JMP la_resta_ya_es_negativa ;Salta a la etiqueta 'la_resta_ya_es_negativa' ;copiamos el numero mayor (num2) a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI num2_mayor_div_cpy: ;Etiqueta 'num2_mayor_div_cpy' MOV AL,num2[SI] ;Asigna el contenido de num2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_mayor_div_cpy ;Salta a la etiqueta 'num2_mayor_div_cpy' si es menor o igual ;copiamos el numero (num1) menor a num2 MOV SI,00h ;Asigna 00h a SI num2_menor_cpy_div: ;Etiqueta 'num2_menor_cpy_div' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV num2[SI],AL ;Asigna el contenido de AL a num2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num2_menor_cpy_div ;Salta a la etiqueta 'num2_menor_cpy_div' si es menor o igual ;copiamos el numero mayor guardado en ajuste_decimales_1 a num1 MOV SI,00h ;Asigna 00h a SI num1_ajuste_cpy_div: ;Etiqueta 'num1_ajuste_cpy_div' MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV num1[SI],AL ;Asigna el contenido de AL a num1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE num1_ajuste_cpy_div ;Salta a la etiqueta 'num1_ajuste_cpy_div' si es menor o igual ;;INVERTIR LOS DECIMALES TAMBIEN ;------------------------------------------------------------------ ;copiamos el numero mayor (decimales_2) a la variable temporal ajuste_decimales_1 MOV SI,00h ;Asigna 00h a SI dec2_mayor_cpy_div: ;Etiqueta 'dec2_mayor_cpy_div' MOV AL,decimales_2[SI] ;Asigna el contenido de decimales_2[SI] a AL MOV ajuste_decimales_1[SI],AL ;Asigna el contenido de AL a ajuste_decimales_1[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_mayor_cpy_div ;Salta a la etiqueta 'dec2_mayor_cpy_div' si es menor o igual ;copiamos el numero (decimales_1) menor a decimales_2 MOV SI,00h ;Asigna 00h a SI dec2_menor_cpy_div: ;Etiqueta 'dec2_menor_cpy_div' MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimales_2[SI],AL ;Asigna el contenido de AL a decimales_2[SI] INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec2_menor_cpy_div ;Salta a la etiqueta 'dec2_menor_cpy_div' si es menor o igual ;copiamos el numero mayor guardado en ajuste_decimales_1 a decimales_1 MOV SI,00h ;Asigna 00h a SI dec1_ajuste_cpy_div: ;Etiqueta 'dec1_ajuste_cpy_div' MOV AL,ajuste_decimales_1[SI] ;Asigna el contenido de ajuste_decimales_1[SI] a AL MOV decimales_1[SI],AL ;Asigna el contenido de AL a decimales_1[SI] MOV ajuste_decimales_1[SI],00h ;limpiamos la variable temporal INC SI ;Incrementa en uno el valor de SI CMP SI,09h ;Compara SI con 09h JLE dec1_ajuste_cpy_div ;Salta a la etiqueta 'dec1_ajuste_cpy_div' si es menor o igual ;------------------------------------------------------------------ ya_puedes_restar_div: ;Etiqueta 'ya_puedes_restar_div' MOV dividi_una_vez,01h ;Asigna 01h a dividi_una_vez ;RESTAR PARTES DECIMALES MOV SI,09h ;Asigna 09h a SI JMP siguiente_decimal_res_div ;salta a la etiqueta siguiente_entero_res_div fin_decimal_res_div: ;Etiqueta 'fin_decimal_res_div' MOV decimales_Res_div[SI],'$' ;Asigna el contenido de '$' a decimales_Res_div[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_decimal_res_div ;salta a la etiqueta siguiente_entero_res_div siguiente_decimal_res_div: ;Etiqueta 'siguiente_decimal_res_div' MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_decimal_res_div ;Salta si es igual a la etiqueta 'fin_decimal_res_div' CMP AL,decimales_2[SI] ;asigna el contenido de la direccion de memoria de decimales_2 direccionada por SI a AL JL pide_prestado_d_div ;Salta a la etiqueta 'pide_prestado_d_div' si es menor JMP resta_conNormalidad_d_div ;Salta a la etiqueta 'resta_conNormalidad_d_div' pide_prestado_d_div: ;Etiqueta 'pide_prestado_d_div' CMP SI,0000h ;compara si el SI esta limpio JE prestamo_desde_los_enteros_div ;Salta si es igual a la etiqueta 'prestamo_desde_los_enteros_div' DEC decimales_1[SI-1] ;decrementa decimales_1[SI-1] ADD decimales_1[SI],0Ah ;suma 0Ah a decimales_1[SI] resta_conNormalidad_d_div: ;Etiqueta 'resta_conNormalidad_d_div' MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL SUB AL,decimales_2[SI] ;asigna el contenido de la direccion de memoria de decimales_2 direccionada por SI a AL MOV decimales_Res_div[SI],AL ;Asigna el contenido de AL a decimales_Res_div[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_decimal_res_div ;Salta a la etiqueta 'siguiente_decimal_res_div' si no hay signo el ZF JMP enteros_res_div ;Salta a la etiqueta 'enteros_res_div' ;AJUSTAR ACARREO DECIMAL NEGATIVO PARA LOS ENTEROS prestamo_desde_los_enteros_div: ;Etiqueta 'prestamo_desde_los_enteros_div' DEC num1[09h] ;decrementa num1[09h] MOV decimales_Res_div[0h],00h ;limpiar el acarreo ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; enteros_res_div: ;Etiqueta 'enteros_res_div' ;RESTAR PARTES ENTERAS MOV SI,09h ;Asigna 09h a SI JMP siguiente_entero_res_div ;salta a la etiqueta siguiente_entero_res_div fin_enteros_res_div: ;Etiqueta 'fin_enteros_res_div' MOV num_res_div[SI],'$' ;Asigna el contenido de '$' a num_res_div[SI] DEC SI ;Decrementa en uno el valor de SI JMP siguiente_entero_res_div ;salta a la etiqueta siguiente_entero_res_div siguiente_entero_res_div: ;Etiqueta 'siguiente_entero_res_div' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL CMP AL,24h ;si es el fin de cadena JE fin_enteros_res_div ;Salta si es igual a la etiqueta 'fin_enteros_res_div' CMP AL,num2[SI] ;compara el contenido de num2[SI] con AL JL pide_prestado_e_div ;Salta a la etiqueta 'pide_prestado_e_div' si es menor JMP resta_conNormalidad_e_div ;Salta a la etiqueta 'resta_conNormalidad_e_div' pide_prestado_e_div: ;Etiqueta 'pide_prestado_e_div' DEC num1[SI-1] ;decrementa num1[SI-1] ADD num1[SI],0Ah ;suma 0Ah a num1[SI] resta_conNormalidad_e_div: ;Etiqueta 'resta_conNormalidad_e_div' MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL SUB AL,num2[SI] ;asigna el contenido de la direccion de memoria de num2 direccionada por SI a AL MOV num_res_div[SI],AL ;Asigna el contenido de AL a num_res_div[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_entero_res_div ;Salta a la etiqueta 'siguiente_entero_res_div' si no hay signo el ZF ;-------------------------------------------------------------------------------------FIN_RESTA ;COPIAR NUM_RES_DIV A NUM1 MOV SI,09H ;Asigna 09H a SI siguiente_resultado_resta: ;Etiqueta 'siguiente_resultado_resta' ;para su parte entera MOV Al,num_res_div[SI] ;Asigna el contenido de num_res_div[SI] a Al MOV num1[SI],Al ;Asigna el contenido de Al a num1[SI] ;para su parte decimal MOV AL,decimales_Res_div[SI] ;Asigna el contenido de decimales_Res_div[SI] a AL MOV decimales_1[SI],AL ;Asigna el contenido de AL a decimales_1[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_resultado_resta ;Salta a la etiqueta 'siguiente_resultado_resta' si no hay signo el ZF ;;INICIA INCREMENTO DE CONTADOR PARA EL RESULTADO CMP resultado_entero_div,01h ;Compara resultado_entero_div con 01h JE enteros_div ;Salta si es igual a la etiqueta 'enteros_div' JMP decimales_div ;Salta a la etiqueta 'decimales_div' enteros_div: ;Etiqueta 'enteros_div' INC num_res[13h] ;agregamos 1 a la ultima posicion de el resultado entero ;ajustar los acarreos MOV SI,14h ;Asigna 14h a SI siguiente_posicion_enteros_div: ;Etiqueta 'siguiente_posicion_enteros_div' DEC SI ;Decrementa en uno el valor de SI JS fin_incremento_contador ;Salta a la etiqueta 'fin_incremento_contador' si hay signo el ZF CMP num_res[SI],0Ah ;Compara num_res[SI] con 0Ah JL siguiente_posicion_enteros_div ;Salta a la etiqueta 'siguiente_posicion_enteros_div' si es menor JAE desempaca_div_e ;Salta a la etiqueta 'desempaca_div_e' si es mayor o igual JMP fin_incremento_contador ;Salta a la etiqueta 'fin_incremento_contador' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; desempaca_div_e: ;Etiqueta 'desempaca_div_e' MOV AL,num_res[SI] ;Asigna el contenido de num_res[SI] a AL AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) MOV num_res[SI],AL ;lo devuelve convertido en ascii a la posicion de donde lo tomo ADD num_res[SI-1],Ah ;AGREGA Ah a num_res[SI-1] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JMP siguiente_posicion_enteros_div ;Salta a la etiqueta 'siguiente_posicion_enteros_div' decimales_div: ;Etiqueta 'decimales_div' ;------------------------------------------------------------------------------------------- INC decimales_res[DI] ;agregamos 1 a la posicion actual del resultado decimal ;ajustar los acarreos MOV SI,14h ;Asigna 14h a SI siguiente_posicion_decimales_div: ;Etiqueta 'siguiente_posicion_decimales_div' DEC SI ;Decrementa en uno el valor de SI CMP decimales_res[SI],0Ah ;Compara decimales_res[SI] con 0Ah JLE siguiente_posicion_decimales_div ;Salta a la etiqueta 'siguiente_posicion_decimales_div' si es menor o igual JMP fin_incremento_contador ;Salta a la etiqueta 'fin_incremento_contador' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; XOR AX,AX ;Resituye el registro AX a ceros por medio de XOR INT 16h ;Interrupcion 16h (funciones de llamada al teclado) MOV AL,decimales_res[SI] ;Asigna el contenido de decimales_res[SI] a AL AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) MOV CL,AL ;Asigna el contenido de AL a CL ADD AL,CL ;Suma el valor de AL con el de CL, el resultado queda en AL MOV decimales_res[SI-1],Ah ;Asigna Ah a decimales_res[SI-1] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JMP siguiente_posicion_decimales_div ;Salta a la etiqueta 'siguiente_posicion_decimales_div' ;------------------------------------------------------------------------------------------- fin_incremento_contador: ;Etiqueta 'fin_incremento_contador' JMP aun_hay_resuido ;Salta a la etiqueta 'aun_hay_resuido' la_resta_ya_es_negativa: ;Etiqueta 'la_resta_ya_es_negativa' CMP dividi_una_vez,01h ;Compara dividi_una_vez con 01h JNE resultado_menor_que_cero ;Salta si no es igual a la etiqueta 'resultado_menor_que_cero' JMP resultado_mayor_que_cero ;Salta a la etiqueta 'resultado_mayor_que_cero' resultado_menor_que_cero: ;Etiqueta 'resultado_menor_que_cero' ;;si el resultado es 0.xxxxxxx copiamos el operador num1 a num_res_div para que lo ;;multiplique por 10 MOV resultado_entero_div,00h ;Asigna 00h a resultado_entero_div MOV SI,09h ;Asigna 09h a SI cpy_menor_cero: ;Etiqueta 'cpy_menor_cero' ;para los enteros MOV AL,num1[SI] ;Asigna el contenido de num1[SI] a AL MOV Num_res_div[SI],Al ;Asigna el contenido de Al a Num_res_div[SI] ;para los decimales MOV AL,decimales_1[SI] ;Asigna el contenido de decimales_1[SI] a AL MOV decimales_res_div[SI],Al ;Asigna el contenido de Al a decimales_res_div[SI] DEC SI ;Decrementa en uno el valor de SI JNS cpy_menor_cero ;Salta a la etiqueta 'cpy_menor_cero' si no hay signo el ZF resultado_mayor_que_cero: ;Etiqueta 'resultado_mayor_que_cero' ;------------------------------------------------------------------------------ ;;MULTIPLICAR EL RESUIDO GUARADO EN NUM_RES_DIV Y DECIAMALES_RES_DIV X10 ;incrementar el 1 el destino decimal INC DI ;Incrementa en uno el valor de DI CMP DI,14H ;Compara DI con 14H JNE no_periodico_div ;Salta si no es igual a la etiqueta 'no_periodico_div' JMP periodico_div ;Salta a la etiqueta 'periodico_div' no_periodico_div: ;Etiqueta 'no_periodico_div' MOV SI,09H ;Asigna 09H a SI multiplica_siguiente_resuido: ;Etiqueta 'multiplica_siguiente_resuido' ;multiplicar su parte entera MOV AL,Num_res_div[SI] ;Asigna el contenido de Num_res_div[SI] a AL MOV AUX,0AH ;Asigna 0AH a AUX MUL Aux ;Multiplica Al por Aux MOV Num_res_div[SI],Al ;Asigna el contenido de Al a Num_res_div[SI] ;multiplicar su parte decimal MOV AL,decimales_res_div[SI] ;Asigna el contenido de decimales_res_div[SI] a AL MUL Aux ;Multiplica Al por Aux MOV decimales_res_div[SI],Al ;Asigna el contenido de Al a decimales_res_div[SI] DEC SI ;Decrementa en uno el valor de SI JNS multiplica_siguiente_resuido ;Salta a la etiqueta 'multiplica_siguiente_resuido' si no hay signo el ZF ;------------------------------------------------------------------------------ ;AJUSTAR LOS ACARREOS PROVOCADOS POR LA MULTIPLICACION POR 10 ;para el acarreo decimal MOV SI,09H ;Asigna 09H a SI siguiente_res_div_mul10: ;Etiqueta 'siguiente_res_div_mul10' MOV AL,decimales_res_div[SI] ;Asigna el contenido de decimales_res_div[SI] a AL CMP AL,0AH ;Compara AL con 0AH JAE acarreo_por_resuido ;Salta a la etiqueta 'acarreo_por_resuido' si es mayor o igual DEC SI ;Decrementa en uno el valor de SI JNS siguiente_res_div_mul10 ;Salta a la etiqueta 'siguiente_res_div_mul10' si no hay signo el ZF JMP fin_res_div_mul10 ;Salta a la etiqueta 'fin_res_div_mul10' acarreo_por_resuido: ;Etiqueta 'acarreo_por_resuido' AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) MOV decimales_res_div[SI],Al ;Asigna el contenido de Al a decimales_res_div[SI] MOV CL,decimales_res_div[SI-1] ;Asigna el contenido de decimales_res_div[SI-1] a CL ADD Ah,CL ;Suma el valor de Ah con el de CL, el resultado queda en Ah MOV decimales_res_div[SI-1],Ah ;Asigna Ah a decimales_res_div[SI-1] JNS siguiente_res_div_mul10 ;Salta a la etiqueta 'siguiente_res_div_mul10' si no hay signo el ZF fin_res_div_mul10: ;Etiqueta 'fin_res_div_mul10' ;-------------------------------------------------- ;Agregar acarreo pendiente guarado en la primer posicion de decimales_res_div MOV AL,decimales_res_div[00h] ;Asigna el contenido de decimales_res_div[00h] a AL MOV decimales_res_div[00h],00h ;Asigna 00h a decimales_res_div[00h] MOV CL,num_res_div[09h] ;Asigna el contenido de num_res_div[09h] a CL ADD AL,CL ;Suma el valor de AL con el de CL, el resultado queda en AL MOV num_res_div[09h],Al ;Asigna el contenido de Al a num_res_div[09h] ;-------------------------------------------------- ;para el acarreo entero MOV SI,09H ;Asigna 09H a SI siguiente_res_div_mul10_e: ;Etiqueta 'siguiente_res_div_mul10_e' MOV AL,num_res_div[SI] ;Asigna el contenido de num_res_div[SI] a AL CMP AL,0AH ;Compara AL con 0AH JAE acarreo_por_resuido_e ;Salta a la etiqueta 'acarreo_por_resuido_e' si es mayor o igual DEC SI ;Decrementa en uno el valor de SI JNS siguiente_res_div_mul10_e ;Salta a la etiqueta 'siguiente_res_div_mul10_e' si no hay signo el ZF JMP fin_res_div_mul10_e ;Salta a la etiqueta 'fin_res_div_mul10_e' acarreo_por_resuido_e: ;Etiqueta 'acarreo_por_resuido_e' AAM ;Desempaca AL (Divide Al entre 10 cociente:resuido AH:AL) MOV num_res_div[SI],Al ;Asigna el contenido de Al a num_res_div[SI] MOV CL,num_res_div[SI-1] ;Asigna el contenido de num_res_div[SI-1] a CL ADD Ah,CL ;Suma el valor de Ah con el de CL, el resultado queda en Ah MOV num_res_div[SI-1],Ah ;Asigna Ah a num_res_div[SI-1] JNS siguiente_res_div_mul10_e ;Salta a la etiqueta 'siguiente_res_div_mul10_e' si no hay signo el ZF fin_res_div_mul10_e: ;Etiqueta 'fin_res_div_mul10_e' ;------------------------------------------------------------------------------ ;copiar el resuido ajustado a las variables de operacion num1 y decimales_1 MOV SI,09H ;Asigna 09H a SI siguiente_resuido_div: ;Etiqueta 'siguiente_resuido_div' ;para su parte entera MOV Al,num_res_div[SI] ;Asigna el contenido de num_res_div[SI] a Al MOV num1[SI],Al ;Asigna el contenido de Al a num1[SI] ;para su parte decimal MOV AL,decimales_Res_div[SI] ;Asigna el contenido de decimales_Res_div[SI] a AL MOV decimales_1[SI],AL ;Asigna el contenido de AL a decimales_1[SI] DEC SI ;Decrementa en uno el valor de SI JNS siguiente_resuido_div ;Salta a la etiqueta 'siguiente_resuido_div' si no hay signo el ZF ;------------------------------------------------------------------------------ ;saltamos a 'restar' el residuo JMP aun_hay_resuido ;Salta a la etiqueta 'aun_hay_resuido' periodico_div: ;Etiqueta 'periodico_div' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;AJUSTAR PARA IMPRESION ;;ajustar la parte entera MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste_div ;Salta a la etiqueta 'inicia_ajuste_div' salta_fin_div: ;Etiqueta 'salta_fin_div' DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste_div ;Salta a la etiqueta 'inicia_ajuste_div' inicia_ajuste_div: ;Etiqueta 'inicia_ajuste_div' MOV AL,num_res[SI] ;Asigna el contenido de num_res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin_div ;Salta si es igual a la etiqueta 'salta_fin_div' ADD AL,30h ;AGREGA 30h a AL MOV num_res[SI],AL ;lo devuelve convertido en ascii a la posicion de donde lo tomo DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste_div ;Salta a la etiqueta 'inicia_ajuste_div' si no hay signo el ZF ;;ajustar la parte decimal MOV SI,13h ;Asigna 13h a SI JMP inicia_ajuste_d_div ;Salta a la etiqueta 'inicia_ajuste_d_div' salta_fin_d_div: ;Etiqueta 'salta_fin_d_div' DEC SI ;Decrementa en uno el valor de SI JMP inicia_ajuste_d_div ;Salta a la etiqueta 'inicia_ajuste_d_div' inicia_ajuste_d_div: ;Etiqueta 'inicia_ajuste_d_div' MOV AL,decimales_Res[SI] ;Asigna el contenido de decimales_Res[SI] a AL CMP AL,24h ;si es el fin de cadena JE salta_fin_d_div ;Salta si es igual a la etiqueta 'salta_fin_d_div' ADD AL,30h ;AGREGA 30h a AL MOV decimales_Res[SI],AL ;Asigna el contenido de AL a decimales_Res[SI] DEC SI ;Decrementa en uno el valor de SI JNS inicia_ajuste_d_div ;Salta a la etiqueta 'inicia_ajuste_d_div' si no hay signo el ZF MOV decimales_Res[0h],07h ;limpiar el acarreo CALL AJUSTE_PARA_IMPRESION ;Llamada al procedimiento 'AJUSTE_PARA_IMPRESION' RET ;Retorna el control a la direccion de el SP desde donde se llamo DIVIDE ENDP ;Fin del procedimiento ;------------------------------------------------------------------------- ;______________________PROC_AJUSTE ASCII POST OPERACIONAL________________ AJUSTE_PARA_IMPRESION PROC NEAR ;Inicia prodecimiento cercano 'AJUSTE_PARA_IMPRESION' CALL AJUSTE_CEROS_IZQUIERDA ;remover ceros a la izquierda antes de imprimir ;;AJUSTAR PARA IMPRESION ;;ajustar la parte entera MOV DI,0000H ;Asigna 0000H a DI MOV SI,0000H ;Asigna 0000H a SI ;REVISAMOS SI TIENE SIGNO PARA MOSTRARLO EN EL RESULTADO CMP es_negativo_res,01h ;Compara es_negativo_res con 01h JE agrega_signo_resultado ;Salta si es igual a la etiqueta 'agrega_signo_resultado' JMP sin_signo_resultado ;Salta a la etiqueta 'sin_signo_resultado' agrega_signo_resultado: ;Etiqueta 'agrega_signo_resultado' MOV resultado_str[DI],'-' ;Asigna el contenido de '-' a resultado_str[DI] INC DI ;Incrementa en uno el valor de DI sin_signo_resultado: ;Etiqueta 'sin_signo_resultado' MOV es_negativo_res,00h ;Asigna 00h a es_negativo_res MOV CX,14H ;longuitud del resultado en su parte entera siguiente_resultado_str: ;Etiqueta 'siguiente_resultado_str' MOV AL,num_res[SI] ;Asigna el contenido de num_res[SI] a AL MOV resultado_str[DI],AL ;Asigna el contenido de AL a resultado_str[DI] INC SI ;Incrementa en uno el valor de SI INC DI ;Incrementa en uno el valor de DI LOOP siguiente_resultado_str ;Salta a la etiqueta 'siguiente_resultado_str' y decrementa CX mientras no sea cero CMP sin_punto,01h ;Compara sin_punto con 01h JE sin_punto_impresion ;Salta si es igual a 'sin_punto_impresion' MOV resultado_str[DI],'.' ;Asigna el contenido de '.' a resultado_str[DI] INC DI ;Incrementa en uno el valor de DI sin_punto_impresion: ;Etiqueta 'sin_punto_impresion' MOV CX,014H ;longuitud del resultado en su parte decimal exceptuando el primer decimal MOV SI,0001H ;INICIAMOS DESPUES DEL PRIMER DIGITO DECIMAL MOV decimales_res[0h],07h ;Asigna 07h a decimales_res[0h] siguiente_decimal_str: ;Etiqueta 'siguiente_decimal_str' MOV AL,decimales_res[SI] ;Asigna el contenido de decimales_res[SI] a AL MOV resultado_str[DI],AL ;Asigna el contenido de AL a resultado_str[DI] INC SI ;Incrementa en uno el valor de SI INC DI ;Incrementa en uno el valor de DI LOOP siguiente_decimal_str ;Salta a la etiqueta 'siguiente_decimal_str' y decrementa CX mientras no sea cero MOV resultado_str[DI],'$' ;Termina la cadena del resultado RET ;Retorna el control a la direccion de el SP desde donde se llamo AJUSTE_PARA_IMPRESION ENDP ;Fin del procedimiento ;---------------------ENTRADA------------------- ENTRADA_PROC proc near ;Inicia prodecimiento cercano 'ENTRADA_' SalvaRegistros ;Guarda el estado actual de los registros de proposito general ;Guarda el estado actual de los registros de proposito general CMP posicion_entrada,00h ;Compara posicion_entrada con 00h JE primer_entrada ;Salta si es igual a la etiqueta 'primer_entrada' JMP no_primer_entrada ;Salta a la etiqueta 'no_primer_entrada' primer_entrada: ;Etiqueta 'primer_entrada' MOV resultado_entero_div,00h ;Asigna 00h a resultado_entero_div MOV es_negativo_resuido_div,00h ;no hay signo en la parte entera MOV num1_signo,00h ;Asigna 00h a num1_signo MOV num2_signo,00h ;Asigna 00h a num2_signo MOV es_negativo_res,00h ;Asigna 00h a es_negativo_res MOV operacion,00h ;Asigna 00h a operacion MOV dividi_una_vez,00h ;Asigna 00h a dividi_una_vez MOV acarreo,00h ;Asigna 00h a acarreo MOV DI,0000H ;Asigna 0000H a DI MOV sin_punto,0h ;Asigna 0h a sin_punto limpia_anterior_entrada: ;Etiqueta 'limpia_anterior_entrada' MOV num1[DI],00h ;Asigna 00h a num1[DI] MOV num2[DI],00h ;Asigna 00h a num2[DI] MOV decimales_1[DI],00h ;Asigna 00h a decimales_1[DI] MOV decimales_2[DI],00h ;Asigna 00h a decimales_2[DI] MOV num_res_div[DI],00h ;Asigna 00h a num_res_div[DI] MOV decimales_Res_div[DI],00h ;Asigna 00h a decimales_Res_div[DI] MOV ajuste_decimales_1[DI],00h ;Asigna 00h a ajuste_decimales_1[DI] MOV ajuste_decimales_2[DI],00h ;Asigna 00h a ajuste_decimales_2[DI] MOV num_1_mul[DI],00h ;Asigna 00h a num_1_mul[DI] MOV num_2_mul[DI],00h ;Asigna 00h a num_2_mul[DI] MOV decimal_1_mul[DI],00h ;Asigna 00h a decimal_1_mul[DI] MOV decimal_2_mul[DI],00h ;Asigna 00h a decimal_2_mul[DI] INC DI ;Incrementa en uno el valor de DI CMP DI,09H ;Compara DI con 09H JLE limpia_anterior_entrada ;Salta a la etiqueta 'limpia_anterior_entrada' si es menor o igual MOV DI,0000H ;Asigna 0000H a DI limpia_anterior_resultado: ;Etiqueta 'limpia_anterior_resultado' MOV num_res[DI],00h ;Asigna 00h a num_res[DI] MOV decimales_Res[DI],00h ;Asigna 00h a decimales_Res[DI] INC DI ;Incrementa en uno el valor de DI CMP DI,13H ;Compara DI con 13H JLE limpia_anterior_resultado ;Salta a la etiqueta 'limpia_anterior_resultado' si es menor o igual MOV DI,0000H ;Asigna 0000H a DI clean_mult: ;Etiqueta 'clean_mult' MOV num_res_mul[DI],00H ;Asigna 00H a num_res_mul[DI] MOV decimal_res_mul[DI],00H ;Asigna 00H a decimal_res_mul[DI] INC DI ;Incrementa en uno el valor de DI CMP DI,11H ;Compara DI con 11H JLE clean_mult ;Salta a la etiqueta 'clean_mult' si es menor o igual MOV DI,0000H ;Asigna 0000H a DI JMP no_primer_entrada ;Salta a la etiqueta 'no_primer_entrada' no_primer_entrada: ;Etiqueta 'no_primer_entrada' CMP AL,03Ah ;si el caracter es '=' JE Enm_Resuelve ;Salta si es igual a la etiqueta 'Enm_Resuelve' CMP AX,0E0Ch ;si el caracter nos indica un retroceso JE retrocede ;Salta si es igual a la etiqueta 'retrocede' JMP no_retrocede ;Salta a la etiqueta 'no_retrocede' posicion_cero: ;Etiqueta 'posicion_cero' MOV DI,0000h ;Asigna 0000h a DI JMP borra_entrada ;Salta a la etiqueta 'borra_entrada' retrocede: ;Etiqueta 'retrocede' MOV DI,posicion_entrada ;Asigna el contenido de posicion_entrada a DI DEC DI ;Decrementa en uno el valor de DI JS posicion_cero ;Salta a la etiqueta 'posicion_cero' si hay signo el ZF borra_entrada: ;Etiqueta 'borra_entrada' MOV posicion_entrada,DI ;Asigna el contenido de DI a posicion_entrada MOV display_str[DI],"$" ;Asigna el contenido de "$" a display_str[DI] JMP Enm_Salir ;Salta a la etiqueta 'Enm_Salir' no_retrocede: ;Etiqueta 'no_retrocede' MOV DI,posicion_entrada ;Asigna el contenido de posicion_entrada a DI MOV DL,AL ;posicion final en x MOV display_str[DI],Dl ;Asigna el contenido de Dl a display_str[DI] MOV display_str[DI+1],"$" ;Asigna el contenido de "$" a display_str[DI+1] INC posicion_entrada ;Incrementa en uno el valor de posicion_entrada JMP Enm_Salir ;Salta a la etiqueta 'Enm_Salir' Enm_Resuelve: ;Etiqueta 'Enm_Resuelve' CALL RESOLVER ;Llamada al procedimiento 'RESOLVER' Enm_Salir: ;Etiqueta 'Enm_Salir' RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron RET ;Retorna el control a la direccion de el SP desde donde se llamo ENTRADA_PROC ENDP ;Fin del procedimiento ;----------------------------REMOVER CEROS A LA IZQUIERDA PROC----------------------------- AJUSTE_CEROS_IZQUIERDA PROC NEAR ;Inicia prodecimiento cercano 'AJUSTE_CEROS_IZQUIERDA' ;;REMOVER LOS CEROS A LA IZUIERDA DEL RESULTADO Y REEMPLAZARLOS CON 20h ;;ajustar la parte entera MOV DI,00h ;Asigna 00h a DI siguiente_cero: ;Etiqueta 'siguiente_cero' CMP num_res[DI],30h ;si el digito mas a la izquierda es cero JNE no_hay_mas_ceros_enteros ;si el numero es diferente de cero ya terminamos el ajuste ;si es cero y no es el unico removerlo! CMP DI,13h ;Compara DI con 00h JE resultado_es_cero ;Salta si es igual a 'resultado_es_cero' MOV num_res[DI],07h ;reemplazar ceros por 07h (campana) INC DI ;Incrementa en uno el valor de DI CMP DI,13h ;evitar el ultimo cero por si el resultado es cero (0+0=0) JLE siguiente_cero ;Salta a la etiqueta 'siguiente_cero' si es menor o igual JMP no_hay_mas_ceros_enteros ;Salta a la etiqueta 'resultado_es_cero' resultado_es_cero: ;Etiqueta 'resultado_es_cero' MOV num_res[DI],30h ;Asigna 30h a num_res[DI] ;;ajustar la parte decimal no_hay_mas_ceros_enteros: ;Etiqueta 'no_hay_mas_ceros_enteros' MOV DI,13h ;Asigna 13h a DI siguiente_cero_decimal: ;Etiqueta 'siguiente_cero_decimal' CMP decimales_Res[DI],30h ;Compara decimales_Res[DI] con 30h JNE fin_ajuste_cero_decimal ;si el numero es diferente de cero ya terminamos el ajuste ;si es cero removerlo! MOV decimales_Res[DI],07h ;Asigna 07h a decimales_Res[DI] DEC DI ;Decrementa en uno el valor de DI CMP DI,01h ;si el resultado es cero salta a 'sin_punto_x_cero' JL sin_punto_x_cero ;hasta el principio de los decimales JAE siguiente_cero_decimal ;Salta a la etiqueta 'siguiente_cero_decimal' si es mayor o igual fin_ajuste_cero_decimal: ;Etiqueta 'fin_ajuste_cero_decimal' RET ;Retorna el control a la direccion de el SP desde donde se llamo sin_punto_x_cero: ;etiqueta 'sin_punto_x_cero' MOV sin_punto,01h ;enciende la bandera que nos indica que no hay punto RET ;Retorna el control a la direccion de el SP desde donde se llamo AJUSTE_CEROS_IZQUIERDA ENDP ;Fin del procedimiento ;----------------------MOUSE Y TECLADO MOUSE PROC NEAR ;Inicia prodecimiento cercano 'MOUSE' SalvaRegistros ;Guarda el estado actual de los registros de proposito general RestituyeRegistros ;Restituye los registros de prosito general en 0 check_mouse_buttons: ;Etiqueta 'check_mouse_buttons' mov ax, 05h ;asignamosa Ax 05 para que junto con la int 33 y MOV bx,00h ;en bx enviamos el boton del mouse el cual queremos saber si se presiono ;click izquierdo=0, cick derecho=1 int 33h ;regresa la veces que se preisono en bx y las coordenadas X,Y del mouse en CX,DX mov curX, cx ;Asigna el contenido de cx a curX mov curY, dx ;Asigna el contenido de dx a curY cmp bx, 1 ; si se presiono al menos una vez JAE click ;ocultar el mouse y ejecutar la seleccion ;ESPERAR POR EL TECLADO XOR AX,AX ;Resituye el registro AX a ceros por medio de XOR mov ah, 01h ;Asigna 01h a ah int 16h ;Interrupcion 16h (funciones de llamada al teclado) jnz TECLA_PRESIONADA ;Salta a la etiqueta 'TECLA_PRESIONADA' si no hay signo el ZF jmp check_mouse_buttons ;Salta a la etiqueta 'check_mouse_buttons' TECLA_PRESIONADA: ;Etiqueta 'TECLA_PRESIONADA' MOV registros_tbl[0h],AX ;Asigna el contenido de AX a registros_tbl[0h] MOV AH,0Ch ;Asigna 0Ch a AH MOV AL,0 ;Asigna 0 a AL INT 21H ;Interrupcion 21h (funciones de el DOS API) RecuperaRegistros ;Reestablece los registros de proposito general al ultimo estado en el que se salvaron ret ;Retorna el control a la direccion de el SP desde donde se llamo click: ;Etiqueta 'click' XOR BX,BX ;Resituye el registro BX a ceros por medio de XOR JMP click_valido ;Salta a la etiqueta 'click_valido' click_invalido: ;Etiqueta 'click_invalido' JMP check_mouse_buttons ;Salta a la etiqueta 'check_mouse_buttons' click_valido: ;Etiqueta 'click_valido' ;LOS BOTONES DE LOS OPERADORES Y NUMEROS EN X VAN DESDE 28h HASTA 70h EN Y CMP curY,28h ;si es menor o igual que 28h no esta en ningun boton JL click_invalido ;Salta a la etiqueta 'click_invalido' si es menor CMP curY,70h ;si es mayor o igual que 70h no esta en ningun boton JAE click_invalido ;Salta a la etiqueta 'click_invalido' si es mayor o igual CMP curY,50h ;los botones numeros y igual van desde el 50h en Y JAE numeros ;si es mayor o igual a 50h estamos en el panel de operadores JMP operadores ;si es menor que 50h estamos el en panel numerico operadores: ;Etiqueta 'operadores' ;COMPARAMOS SOBRE QUE OPERACION SE DIO CLICK ;la suma va del 30h al A0h CMP CurX,0A0h ;Compara CurX con 0A0h JA no_es_suma ;Salta si es mayor a la etiqueta 'no_es_suma' MOV seleccion,00h ;asigna 0 a la seleccion (valor del primer boton de la primer fila) MOV AL,2BH ;Asigna 2BH a AL ret ;Retorna el control a la direccion de el SP desde donde se llamo no_es_suma: ;Etiqueta 'no_es_suma' ;la resta va hasta el 110h CMP CurX,130h ;Compara CurX con 130h JA no_es_resta ;Salta si es mayor a la etiqueta 'no_es_resta' MOV seleccion,01h ;Asigna 01h a seleccion MOV AL,2Dh ;Asigna 2Dh a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_resta: ;Etiqueta 'no_es_resta' ;la multiplicacion va hasta el 1AA CMP CurX,1AAh ;Compara CurX con 1AAh JA no_es_multiplica ;Salta si es mayor a la etiqueta 'no_es_multiplica' MOV seleccion,02h ;Asigna 02h a seleccion MOV AL,2Ah ;Asigna 2Ah a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_multiplica: ;Etiqueta 'no_es_multiplica' ;la division va hasta el 1F0h CMP CurX,230h ;Compara CurX con 230h JA no_es_divide ;Salta si es mayor a la etiqueta 'no_es_divide' MOV seleccion,03h ;Asigna 03h a seleccion MOV AL,2Fh ;Asigna 2Fh a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_divide: ;Etiqueta 'no_es_divide' ;si no fue ningun operando el click es erroneo JMP check_mouse_buttons ;Salta a la etiqueta 'check_mouse_buttons' RET ;Retorna el control a la direccion de el SP desde donde se llamo numeros: ;Etiqueta 'numeros' ;el numero 0 va desde el 30h al 50h CMP CurX,50h ;Compara CurX con 50h JA no_es_cero ;Salta si es mayor a la etiqueta 'no_es_cero' MOV SELECCION,04h ;Asigna 04h a SELECCION MOV AL,30h ;Asigna 30h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_cero: ;Etiqueta 'no_es_cero' ;el numero 1 va desde el 50h al 70h CMP CurX,80h ;Compara CurX con 80h JA no_es_uno ;Salta si es mayor a la etiqueta 'no_es_uno' MOV SELECCION,05h ;Asigna 05h a SELECCION MOV AL,31h ;Asigna 31h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_uno: ;Etiqueta 'no_es_uno' ;el numero 2 va desde el 70h al A0h CMP CurX,0B0h ;Compara CurX con 0B0h JA no_es_dos ;Salta si es mayor a la etiqueta 'no_es_dos' MOV SELECCION,06h ;Asigna 06h a SELECCION MOV AL,32h ;Asigna 32h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_dos: ;Etiqueta 'no_es_dos' ;el numero 3 va desde el 90h al B0h CMP CurX,0E0h ;Compara CurX con 0E0h JA no_es_tres ;Salta si es mayor a la etiqueta 'no_es_tres' MOV SELECCION,07h ;Asigna 07h a SELECCION MOV AL,33h ;Asigna 33h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_tres: ;Etiqueta 'no_es_tres' ;el numero 4 va desde el 30h al 50h CMP CurX,0110h ;Compara CurX con 0110h JA no_es_cuatro ;Salta si es mayor a la etiqueta 'no_es_cuatro' MOV SELECCION,08h ;Asigna 08h a SELECCION MOV AL,34h ;Asigna 34h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_cuatro: ;Etiqueta 'no_es_cuatro' ;el numero 5 va desde el 30h al 50h CMP CurX,0140h ;Compara CurX con 0140h JA no_es_cinco ;Salta si es mayor a la etiqueta 'no_es_cinco' MOV SELECCION,09h ;Asigna 09h a SELECCION MOV AL,35h ;Asigna 35h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_cinco: ;Etiqueta 'no_es_cinco' ;el numero 6 va desde el 30h al 50h CMP CurX,170h ;Compara CurX con 170h JA no_es_seis ;Salta si es mayor a la etiqueta 'no_es_seis' MOV SELECCION,0Ah ;Asigna 0Ah a SELECCION MOV AL,36h ;Asigna 36h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_seis: ;Etiqueta 'no_es_seis' ;el numero 7 va desde el 30h al 50h CMP CurX,1A0h ;Compara CurX con 1A0h JA no_es_siete ;Salta si es mayor a la etiqueta 'no_es_siete' MOV SELECCION,0Bh ;Asigna 0Bh a SELECCION MOV AL,37h ;Asigna 37h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_siete: ;Etiqueta 'no_es_siete' ;el numero 8 va desde el 30h al 50h CMP CurX,1D0h ;Compara CurX con 1D0h JA no_es_ocho ;Salta si es mayor a la etiqueta 'no_es_ocho' MOV SELECCION,0Ch ;Asigna 0Ch a SELECCION MOV AL,38h ;Asigna 38h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_ocho: ;Etiqueta 'no_es_ocho' ;el numero 9 va desde el 30h al 50h CMP CurX,200h ;Compara CurX con 200h JA no_es_nueve ;Salta si es mayor a la etiqueta 'no_es_nueve' MOV SELECCION,0Dh ;Asigna 0Dh a SELECCION MOV AL,39h ;Asigna 39h a AL RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_nueve: ;Etiqueta 'no_es_nueve' ;el signo = va desde el 30h al 50h CMP CurX,230h ;Compara CurX con 230h JA no_es_igual ;Salta si es mayor a la etiqueta 'no_es_igual' MOV SELECCION,0Eh ;Asigna 0Eh a SELECCION MOV AX,0B3Dh ;Asigna 0B3Dh a AX RET ;Retorna el control a la direccion de el SP desde donde se llamo no_es_igual: ;Etiqueta 'no_es_igual' RET ;Retorna el control a la direccion de el SP desde donde se llamo STOP: ;Etiqueta 'STOP' XOR AX,AX ;Resituye el registro AX a ceros por medio de XOR INT 16H ;Interrupcion 16h (funciones de llamada al teclado) RET ;Retorna el control a la direccion de el SP desde donde se llamo MOUSE endp ;Fin del procedimiento end begin ;Fin de programa
tests/test build script and options/opt syntax/syntax_abfl.asm
NEO-SPECTRUMAN/sjasmplus
1
166508
; SYNTAX option "abfl@": ; @ is error "unrecognized" (but outside of list file!) ; l is "unimplemented yet" (comments below are for future implementation) ld bc,hl ; warning ld bc,hl ; warning removed by using "fake" in this comment sub a,b ; sub b sub a,,b ; sub a : sub b ld b,h,,c,l ; ld b,h : ld c,l (same as first fake) ld b,h, c,l ; error hl: ; warning ld a,(hl) ; OK: memory reference ld a,[hl] ; OK: memory reference add a,(5) ; error (memory reference = illegal instruction) add a,[6] ; error (memory reference = illegal instruction) add a,7 ; OK ld b,(8) ; error (memory reference = illegal instruction) ld b,[9] ; error (memory reference = illegal instruction) ld b,10 ; OK ld bc,hl ;fake (warning suppressed by "fake") ld bc,hl ;ok (removed, doesn't suppress any more)