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
|
---|---|---|---|---|
programs/oeis/060/A060819.asm | jmorken/loda | 1 | 91403 | <reponame>jmorken/loda
; A060819: a(n) = n / gcd(n,4).
; 1,1,3,1,5,3,7,2,9,5,11,3,13,7,15,4,17,9,19,5,21,11,23,6,25,13,27,7,29,15,31,8,33,17,35,9,37,19,39,10,41,21,43,11,45,23,47,12,49,25,51,13,53,27,55,14,57,29,59,15,61,31,63,16,65,33,67,17,69,35,71,18,73,37,75,19,77,39,79,20,81,41,83,21,85,43,87,22,89,45,91,23,93,47,95,24,97,49,99,25,101,51,103,26,105,53,107,27,109,55,111,28,113,57,115,29,117,59,119,30,121,61,123,31,125,63,127,32,129,65,131,33,133,67,135,34,137,69,139,35,141,71,143,36,145,73,147,37,149,75,151,38,153,77,155,39,157,79,159,40,161,81,163,41,165,83,167,42,169,85,171,43,173,87,175,44,177,89,179,45,181,91,183,46,185,93,187,47,189,95,191,48,193,97,195,49,197,99,199,50,201,101,203,51,205,103,207,52,209,105,211,53,213,107,215,54,217,109,219,55,221,111,223,56,225,113,227,57,229,115,231,58,233,117,235,59,237,119,239,60,241,121,243,61,245,123,247,62,249,125
add $0,1
dif $0,2
dif $0,2
mov $1,$0
|
src/Partiality-algebra/Pi.agda | nad/partiality-monad | 2 | 1184 | ------------------------------------------------------------------------
-- Pi with partiality algebra families as codomains
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
module Partiality-algebra.Pi where
open import Equality.Propositional.Cubical
open import Logical-equivalence using (_⇔_)
open import Prelude hiding (T)
open import H-level equality-with-J
open import H-level.Closure equality-with-J
open import Partiality-algebra as PA hiding (id; _∘_)
open Partiality-algebra-with
open Partiality-algebra
-- Applies an increasing sequence of functions to a value.
at-with :
∀ {a b p q} {A : Type a} {T : A → Type p} {B : A → Type b}
(P : (x : A) → Partiality-algebra-with (T x) q (B x)) →
let module P x = Partiality-algebra-with (P x) in
(∃ λ (f : ℕ → (x : A) → T x) →
∀ n x → P._⊑_ x (f n x) (f (suc n) x)) →
(x : A) → ∃ λ (f : ℕ → T x) →
∀ n → P._⊑_ x (f n) (f (suc n))
at-with _ s x = Σ-map (λ f n → f n x) (λ f n → f n x) s
-- Applies an increasing sequence of functions to a value.
at :
∀ {a b p q} {A : Type a} {B : A → Type b}
(P : (x : A) → Partiality-algebra p q (B x)) →
let module P x = Partiality-algebra (P x) in
(∃ λ (f : ℕ → (x : A) → P.T x) →
∀ n x → P._⊑_ x (f n x) (f (suc n) x)) →
(x : A) → ∃ λ (f : ℕ → P.T x) →
∀ n → P._⊑_ x (f n) (f (suc n))
at P = at-with (partiality-algebra-with ∘ P)
-- A kind of dependent function space from types to
-- Partiality-algebra-with families.
Π-with : ∀ {a b p q}
(A : Type a) {T : A → Type p} {B : A → Type b} →
((x : A) → Partiality-algebra-with (T x) q (B x)) →
Partiality-algebra-with
((x : A) → T x) (a ⊔ q) ((x : A) → B x)
_⊑_ (Π-with A P) = λ f g → ∀ x → _⊑_ (P x) (f x) (g x)
never (Π-with A P) = λ x → never (P x)
now (Π-with A P) = λ f x → now (P x) (f x)
⨆ (Π-with A P) = λ s x → ⨆ (P x) (at-with P s x)
antisymmetry (Π-with A P) = λ p q → ⟨ext⟩ λ x →
antisymmetry (P x) (p x) (q x)
T-is-set-unused (Π-with A P) = Π-closure ext 2 λ x →
T-is-set-unused (P x)
⊑-refl (Π-with A P) = λ f x → ⊑-refl (P x) (f x)
⊑-trans (Π-with A P) = λ f g x → ⊑-trans (P x) (f x) (g x)
never⊑ (Π-with A P) = λ f x → never⊑ (P x) (f x)
upper-bound (Π-with A P) = λ s n x →
upper-bound (P x) (at-with P s x) n
least-upper-bound (Π-with A P) = λ s ub is-ub x →
least-upper-bound
(P x) (at-with P s x) (ub x)
(λ n → is-ub n x)
⊑-propositional (Π-with A P) = Π-closure ext 1 λ x →
⊑-propositional (P x)
-- A kind of dependent function space from types to partiality algebra
-- families.
Π : ∀ {a b p q} →
(A : Type a) {B : A → Type b} →
((x : A) → Partiality-algebra p q (B x)) →
Partiality-algebra (a ⊔ p) (a ⊔ q) ((x : A) → B x)
T (Π A P) = (x : A) → T (P x)
partiality-algebra-with (Π A P) = Π-with A (partiality-algebra-with ∘ P)
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_425.asm | ljhsiun2/medusa | 9 | 174105 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xeb1, %rsi
lea addresses_D_ht+0x134a9, %rdi
nop
nop
nop
nop
cmp $61401, %r10
mov $28, %rcx
rep movsl
nop
nop
nop
xor %rsi, %rsi
lea addresses_UC_ht+0xef51, %rsi
lea addresses_WT_ht+0x5ab1, %rdi
clflush (%rdi)
nop
nop
xor $3205, %r8
mov $77, %rcx
rep movsq
nop
nop
nop
nop
nop
add $24965, %r10
lea addresses_WT_ht+0x9cb1, %rcx
sub %r11, %r11
mov (%rcx), %rsi
nop
nop
nop
nop
and $50312, %r11
lea addresses_UC_ht+0x144b1, %r11
clflush (%r11)
inc %rdx
mov $0x6162636465666768, %r10
movq %r10, %xmm5
movups %xmm5, (%r11)
nop
nop
add %r8, %r8
lea addresses_WT_ht+0x181b1, %r11
nop
nop
nop
nop
sub %r10, %r10
mov (%r11), %esi
nop
nop
nop
nop
xor $14384, %rcx
lea addresses_A_ht+0x1452f, %rdi
nop
nop
nop
nop
inc %r10
mov $0x6162636465666768, %rcx
movq %rcx, (%rdi)
sub $1878, %rsi
lea addresses_normal_ht+0xf8b1, %r10
clflush (%r10)
nop
nop
nop
dec %rdx
mov (%r10), %r8w
add %rcx, %rcx
lea addresses_UC_ht+0xf4b1, %rsi
lea addresses_UC_ht+0x90b1, %rdi
nop
nop
nop
nop
and $23993, %r15
mov $38, %rcx
rep movsb
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x140b1, %r8
nop
nop
nop
nop
xor %rdi, %rdi
mov (%r8), %r11
nop
nop
inc %r11
lea addresses_normal_ht+0x10701, %r15
nop
nop
nop
xor %r11, %r11
movw $0x6162, (%r15)
nop
nop
nop
nop
cmp $17219, %rdx
lea addresses_D_ht+0x1e5a1, %r11
nop
nop
and %r10, %r10
movw $0x6162, (%r11)
nop
nop
nop
sub %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r9
push %rax
push %rcx
push %rdx
push %rsi
// Store
lea addresses_A+0x15e31, %rdx
nop
nop
and $27246, %rcx
movl $0x51525354, (%rdx)
nop
nop
nop
nop
nop
sub $30362, %r11
// Load
lea addresses_A+0xecb1, %r9
clflush (%r9)
sub %rsi, %rsi
mov (%r9), %rcx
nop
nop
nop
nop
and %rax, %rax
// Store
mov $0x358c7100000007a5, %r11
nop
nop
nop
nop
nop
add %rax, %rax
movw $0x5152, (%r11)
nop
nop
nop
sub %rcx, %rcx
// Store
mov $0xfb1, %r12
nop
nop
sub %r9, %r9
movl $0x51525354, (%r12)
nop
inc %rax
// Faulty Load
lea addresses_normal+0x198b1, %rdx
clflush (%rdx)
nop
xor %rsi, %rsi
mov (%rdx), %ecx
lea oracles, %rsi
and $0xff, %rcx
shlq $12, %rcx
mov (%rsi,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rcx
pop %rax
pop %r9
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'same': True, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'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
*/
|
stress/stressall.adb | yannickmoy/SPARKNaCl | 76 | 27582 | with GF_Stress;
with Diff_Car_Stress;
with Car_Stress;
with Pack_Stress;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Traceback.Symbolic; use GNAT.Traceback.Symbolic;
procedure Stressall
is
begin
Put_Line ("GF Stress");
GF_Stress;
Put_Line ("Diff Car Stress");
Diff_Car_Stress;
Put_Line ("Car Stress");
Car_Stress;
Put_Line ("Pack Stress");
Pack_Stress;
exception
when E : others =>
Put_Line (Exception_Message (E));
Put_Line (Exception_Information (E));
Put_Line (Symbolic_Traceback (E));
end Stressall;
|
2.statement/generated-asm/251.if_likely.asm | takenobu-hs/haskell-ghc-cmm-examples | 1 | 172423 |
==================== Asm code ====================
.section .text
.align 8
.globl func1
.type func1, @function
func1:
_c4:
cmpq %r14,%rbx
jbe _c3
_c1:
movl $111,%ebx
_c2:
jmp *(%rbp)
_c3:
movl $100,%ebx
jmp _c2
.size func1, .-func1
|
source/environment/a-colipa.ads | ytomino/drake | 33 | 12499 | <filename>source/environment/a-colipa.ads
pragma License (Unrestricted);
-- extended unit
with Ada.Command_Line.Generic_Parsing;
package Ada.Command_Line.Parsing is
new Generic_Parsing (
Input_Cursor => Natural,
Has_Element => Has_Element,
Input_Iterator_Interfaces => Iterator_Interfaces,
Input_Iterator => Concrete_Iterator'(null record), -- Iterate
Argument => Argument);
-- Command line parser.
|
memsim-master/src/memgen.adb | strenkml/EE368 | 0 | 28558 |
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Memory; use Memory;
with Parser; use Parser;
with HDL_Generator; use HDL_Generator;
with Simplify_Memory;
procedure MemGen is
mem : Memory_Pointer;
name : Unbounded_String := To_Unbounded_String("mem");
addr_width : Positive := 32 - 3;
mem_index : Integer := -1;
simplify : Boolean := True;
procedure Show_Usage is
begin
Put_Line("usage: " & Command_Name & " [options] <memory>");
Put_Line("options:");
Put_Line(" -width <int> Address width (default" &
Positive'Image(addr_width) & ")");
Put_Line(" -nosimplify Disable memory simplification");
end Show_Usage;
begin
-- Parse arguments.
declare
i : Positive := 1;
arg : Unbounded_String;
begin
while i <= Argument_Count loop
arg := To_Unbounded_String(Argument(i));
if arg = "-width" and i + 1 <= Argument_Count then
i := i + 1;
addr_width := Positive'Value(Argument(i));
elsif arg = "-name" and i + 1 <= Argument_Count then
i := i + 1;
name := To_Unbounded_String(Argument(i));
elsif arg = "-nosimplify" then
simplify := False;
elsif mem_index < 0 then
mem_index := i;
else
Show_Usage;
return;
end if;
i := i + 1;
end loop;
end;
if mem_index < 0 then
Show_Usage;
return;
end if;
-- Parse the memory subsystem.
mem := Parser.Parse(Argument(mem_index));
if mem = null then
Put_Line("error: could not open memory: " & Argument(1));
return;
end if;
-- Simplify the memory subsystem if desired.
Put_Line("-- Input: " & To_String(To_String(mem.all)));
if simplify then
mem := Simplify_Memory(mem);
Put_Line("-- Simplified: " & To_String(To_String(mem.all)));
end if;
-- Output the VHDL for the memory subsystem.
Put_Line(Generate(mem, To_String(name), addr_width));
-- Clean up.
Destroy(mem);
end MemGen;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c2/c23006e.ada | best08618/asylo | 7 | 15513 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c2/c23006e.ada
-- C23006E.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 UNDERSCORES ARE SIGNIFICANT IN THE NAMES OF GENERIC
-- LIBRARY UNIT SUBPROGRAMS.
-- JBG 5/26/85
GENERIC
PROCEDURE C23006E_PROC (X : OUT INTEGER);
PROCEDURE C23006E_PROC (X : OUT INTEGER) IS
BEGIN
X := 1;
END C23006E_PROC;
GENERIC
PROCEDURE C230063PROC (X : OUT INTEGER);
PROCEDURE C230063PROC (X : OUT INTEGER) IS
BEGIN
X := 2;
END C230063PROC;
GENERIC
FUNCTION C23006E_GFUNC RETURN INTEGER;
FUNCTION C23006E_GFUNC RETURN INTEGER IS
BEGIN
RETURN 3;
END C23006E_GFUNC;
GENERIC
FUNCTION C23006EGFUNC RETURN INTEGER;
WITH REPORT; USE REPORT;
PRAGMA ELABORATE (REPORT);
FUNCTION C23006EGFUNC RETURN INTEGER IS
BEGIN
RETURN IDENT_INT(4);
END C23006EGFUNC;
WITH C23006E_PROC;
PRAGMA ELABORATE (C23006E_PROC);
PROCEDURE P1 IS NEW C23006E_PROC;
WITH C23006E_GFUNC;
PRAGMA ELABORATE (C23006E_GFUNC);
FUNCTION F1 IS NEW C23006E_GFUNC;
WITH P1, F1, C230063PROC, C23006EGFUNC;
WITH REPORT; USE REPORT;
PROCEDURE C23006E IS
X1, X2 : INTEGER;
PROCEDURE P2 IS NEW C230063PROC;
FUNCTION F2 IS NEW C23006EGFUNC;
BEGIN
TEST ("C23006E", "CHECK UNDERSCORES ARE SIGNIFICANT " &
"FOR GENERIC LIBRARY SUBPROGRAM IDENTIFIERS");
P1 (X1);
P2 (X2);
IF X1 + IDENT_INT(1) /= X2 THEN
FAILED ("INCORRECT PROCEDURE IDENTIFICATION");
END IF;
IF F1 + IDENT_INT(1) /= F2 THEN
FAILED ("INCORRECT FUNCTION IDENTIFICATION");
END IF;
RESULT;
END C23006E;
|
Testing-File/Test_Ex8.asm | srsarangi/riscv-emulator | 0 | 6659 | <reponame>srsarangi/riscv-emulator
/ RISC-V assembly code to implement a function
int foo(void)
{
return 2;
}
/
.foo:
addi x5, x0, 2
jalr x0, 0(x1)
.main:
addi x6, x0, 3
jal x1, .foo
add x7, x5, x6
.print x7
end
|
programs/oeis/157/A157319.asm | karttu/loda | 0 | 174948 | ; A157319: Possible total points for a single team in a game of American football, ignoring safeties (and time constraints).
; 0,3,6,7,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77
mov $1,$0
mov $2,$0
lpb $2,1
mov $4,$1
add $1,2
lpb $4,1
add $1,1
add $3,$4
mov $4,5
add $5,3
lpe
add $2,$5
sub $2,$3
add $3,$2
trn $2,1
lpe
|
libsrc/_DEVELOPMENT/stdio/z80/asm_fclose_unlocked.asm | teknoplop/z88dk | 0 | 81786 | <reponame>teknoplop/z88dk
; ===============================================================
; Apr 2014
; ===============================================================
;
; int fclose_unlocked(FILE *stream)
;
; Close the file.
;
; ===============================================================
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdio
PUBLIC asm_fclose_unlocked, asm0_fclose_unlocked, asm1_fclose_unlocked
EXTERN __stdio_open_file_list, asm_p_forward_list_remove, error_ebadf_mc
EXTERN STDIO_MSG_FLSH, STDIO_MSG_CLOS, l_jpix, __fcntl_fd_from_fdstruct
EXTERN asm0_close, __stdio_file_destructor, error_znc, asm_heap_free, __stdio_heap
EXTERN __stdio_closed_file_list, asm_p_forward_list_alt_push_back
asm_fclose_unlocked:
; enter : ix = FILE *
;
; exit : ix = FILE *
;
; success
;
; hl = 0
; carry reset
;
; fail if invalid FILE
;
; hl = -1
; carry set, errno set
;
; uses : all except ix, iy
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $04
EXTERN __stdio_lock_file_list
call __stdio_lock_file_list
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
asm0_fclose_unlocked:
; remove FILE from open list
push ix
pop bc ; bc = FILE *
dec bc
dec bc ; bc = & FILE.link
ld hl,__stdio_open_file_list
call asm_p_forward_list_remove
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $04
push af
EXTERN __stdio_unlock_file_list
call __stdio_unlock_file_list
pop af
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
jp c, error_ebadf_mc ; if FILE* is invalid
; close FILE and underlying fd
call asm1_fclose_unlocked
; append FILE to closed list
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $04
call __stdio_lock_file_list
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
push ix
pop de ; de = FILE *
dec de
dec de ; de = & FILE.link
ld bc,__stdio_closed_file_list
call asm_p_forward_list_alt_push_back
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $04
call __stdio_unlock_file_list
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
jp error_znc ; indicate success
asm1_fclose_unlocked:
; ix = FILE *
; close FILE
ld a,STDIO_MSG_FLSH
call l_jpix
ld a,STDIO_MSG_CLOS
call l_jpix
; memstreams do not have an underlying fd
ld a,(ix+3)
inc a
and $07
jr z, close_memstream
; close any underlying fd
; ix = FILE *
ld e,(ix+1)
ld d,(ix+2) ; de = FDSTRUCT *
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $08
EXTERN __fcntl_lock_fdtbl
call __fcntl_lock_fdbtl
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call __fcntl_fd_from_fdstruct
jr c, no_underlying_fd
ld (hl),0
dec hl
ld (hl),0 ; clear fd entry
no_underlying_fd:
; de = FDSTRUCT *
; ix = FILE *
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $08
EXTERN __fcntl_unlock_fdtbl
call __fcntl_unlock_fdtbl
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
push de
ex (sp),ix ; ix = FDSTRUCT *
; ix = FDSTRUCT *
; stack = FILE *
ld c,2 ; ref_count_adj = 2
call asm0_close ; close underlying fd
pop ix ; ix = FILE *
; disassociate FILE
jp __stdio_file_destructor
close_memstream:
; ix = FILE *
push ix
pop hl ; hl = FILE *
dec hl
dec hl ; hl = & FILE.link
ld de,(__stdio_heap)
call asm_heap_free ; memstream FILE allocated from stdio heap
jp error_znc ; indicate success
|
programs/oeis/185/A185057.asm | neoneye/loda | 22 | 168254 | ; A185057: a(n) = n^n! (mod 5).
; 0,1,4,4,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1
mov $2,$0
lpb $2
pow $0,2
mod $0,5
div $2,2
sub $2,1
lpe
|
src/Embedding/Erased.agda | nad/equality | 3 | 2595 | <reponame>nad/equality
------------------------------------------------------------------------
-- Embeddings with erased "proofs"
------------------------------------------------------------------------
-- Partially following the HoTT book.
{-# OPTIONS --without-K --safe #-}
open import Equality
module Embedding.Erased
{reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where
open import Prelude hiding (id; _∘_)
open import Bijection eq using (_↔_)
open Derived-definitions-and-properties eq
open import Embedding eq as Emb using (Is-embedding; Embedding)
open import Equivalence eq as Eq using (_≃_)
open import Equivalence.Erased eq as EEq
using (_≃ᴱ_; Is-equivalenceᴱ)
open import Equivalence.Erased.Contractible-preimages eq as ECP
using (_⁻¹ᴱ_)
open import Erased.Level-1 eq using (Erased; []-cong-axiomatisation)
open import Function-universe eq hiding (id; _∘_; equivalence)
open import H-level.Closure eq
open import Preimage eq using (_⁻¹_)
private
variable
a b ℓ t : Level
A B C : Type a
f k x y : A
------------------------------------------------------------------------
-- Embeddings
-- The property of being an embedding with erased "proofs".
Is-embeddingᴱ : {A : Type a} {B : Type b} → (A → B) → Type (a ⊔ b)
Is-embeddingᴱ f = ∀ x y → Is-equivalenceᴱ (cong {x = x} {y = y} f)
-- Is-embeddingᴱ is propositional in erased contexts (assuming
-- extensionality).
@0 Is-embeddingᴱ-propositional :
{A : Type a} {B : Type b} {f : A → B} →
Extensionality (a ⊔ b) (a ⊔ b) →
Is-proposition (Is-embeddingᴱ f)
Is-embeddingᴱ-propositional {b = b} ext =
Π-closure (lower-extensionality b lzero ext) 1 λ _ →
Π-closure (lower-extensionality b lzero ext) 1 λ _ →
EEq.Is-equivalenceᴱ-propositional ext _
-- Embeddings with erased proofs.
record Embeddingᴱ (From : Type f) (To : Type t) : Type (f ⊔ t) where
field
to : From → To
is-embedding : Is-embeddingᴱ to
equivalence : (x ≡ y) ≃ᴱ (to x ≡ to y)
equivalence = EEq.⟨ _ , is-embedding _ _ ⟩
------------------------------------------------------------------------
-- Some conversion functions
-- The type family above could have been defined using Σ.
Embeddingᴱ-as-Σ : Embeddingᴱ A B ↔ ∃ λ (f : A → B) → Is-embeddingᴱ f
Embeddingᴱ-as-Σ = record
{ surjection = record
{ logical-equivalence = record
{ to = λ emb → Embeddingᴱ.to emb , Embeddingᴱ.is-embedding emb
; from = λ { (f , is) → record { to = f; is-embedding = is } }
}
; right-inverse-of = refl
}
; left-inverse-of = refl
}
-- Conversions between Is-embedding and Is-embeddingᴱ.
Is-embedding→Is-embeddingᴱ : Is-embedding f → Is-embeddingᴱ f
Is-embedding→Is-embeddingᴱ {f = f} =
(∀ x y → Eq.Is-equivalence (cong {x = x} {y = y} f)) ↝⟨ (∀-cong _ λ _ → ∀-cong _ λ _ → EEq.Is-equivalence→Is-equivalenceᴱ) ⟩□
(∀ x y → Is-equivalenceᴱ (cong {x = x} {y = y} f)) □
@0 Is-embedding≃Is-embeddingᴱ :
{A : Type a} {B : Type b} {f : A → B} →
Is-embedding f ↝[ a ∣ a ⊔ b ] Is-embeddingᴱ f
Is-embedding≃Is-embeddingᴱ {f = f} {k = k} ext =
(∀ x y → Eq.Is-equivalence (cong {x = x} {y = y} f)) ↝⟨ (∀-cong ext λ _ → ∀-cong ext λ _ → from-equivalence
EEq.Is-equivalence≃Is-equivalenceᴱ) ⟩□
(∀ x y → Is-equivalenceᴱ (cong {x = x} {y = y} f)) □
@0 Is-embeddingᴱ→Is-embedding : Is-embeddingᴱ f → Is-embedding f
Is-embeddingᴱ→Is-embedding = inverse-ext? Is-embedding≃Is-embeddingᴱ _
-- Conversions between Embedding and Embeddingᴱ.
Embedding→Embeddingᴱ : Embedding A B → Embeddingᴱ A B
Embedding→Embeddingᴱ {A = A} {B = B} =
Embedding A B ↔⟨ Emb.Embedding-as-Σ ⟩
(∃ λ (f : A → B) → Is-embedding f) ↝⟨ (∃-cong λ _ → Is-embedding→Is-embeddingᴱ) ⟩
(∃ λ (f : A → B) → Is-embeddingᴱ f) ↔⟨ inverse Embeddingᴱ-as-Σ ⟩□
Embeddingᴱ A B □
@0 Embedding≃Embeddingᴱ :
{A : Type a} {B : Type b} →
Embedding A B ↝[ a ∣ a ⊔ b ] Embeddingᴱ A B
Embedding≃Embeddingᴱ {A = A} {B = B} ext =
Embedding A B ↔⟨ Emb.Embedding-as-Σ ⟩
(∃ λ (f : A → B) → Is-embedding f) ↝⟨ (∃-cong λ _ → Is-embedding≃Is-embeddingᴱ ext) ⟩
(∃ λ (f : A → B) → Is-embeddingᴱ f) ↔⟨ inverse Embeddingᴱ-as-Σ ⟩□
Embeddingᴱ A B □
@0 Embeddingᴱ→Embedding : Embeddingᴱ A B → Embedding A B
Embeddingᴱ→Embedding = inverse-ext? Embedding≃Embeddingᴱ _
-- Data corresponding to the erased proofs of an embedding with
-- erased proofs.
Erased-proofs :
{A : Type a} {B : Type b} →
(to : A → B) →
(∀ {x y} → to x ≡ to y → x ≡ y) →
Type (a ⊔ b)
Erased-proofs to from =
∀ {x y} → EEq.Erased-proofs (cong {x = x} {y = y} to) from
-- Extracts "erased proofs" from a regular embedding.
[proofs] :
(A↝B : Embedding A B) →
Erased-proofs
(Embedding.to A↝B)
(_≃_.from (Embedding.equivalence A↝B))
[proofs] A↝B = EEq.[proofs] (Embedding.equivalence A↝B)
-- Converts two functions and some erased proofs to an embedding with
-- erased proofs.
--
-- Note that Agda can in many cases infer "to" and "from" from the
-- first explicit argument, see (for instance) _∘_ below.
[Embedding]→Embeddingᴱ :
{to : A → B} {from : ∀ {x y} → to x ≡ to y → x ≡ y} →
@0 Erased-proofs to from →
Embeddingᴱ A B
[Embedding]→Embeddingᴱ {to = to} {from = from} ep = record
{ to = to
; is-embedding = λ _ _ → _≃ᴱ_.is-equivalence (EEq.[≃]→≃ᴱ ep)
}
------------------------------------------------------------------------
-- Preorder
-- Embeddingᴱ is a preorder.
id : Embeddingᴱ A A
id = Embedding→Embeddingᴱ Emb.id
infixr 9 _∘_
_∘_ : Embeddingᴱ B C → Embeddingᴱ A B → Embeddingᴱ A C
f ∘ g =
[Embedding]→Embeddingᴱ
([proofs] (Embeddingᴱ→Embedding f Emb.∘ Embeddingᴱ→Embedding g))
------------------------------------------------------------------------
-- "Preimages"
-- If f is an embedding (with erased proofs), then f ⁻¹ᴱ y is
-- propositional (in an erased context).
--
-- This result is based on the proof of Theorem 4.6.3 in the HoTT book
-- (first edition).
@0 embedding→⁻¹ᴱ-propositional :
Is-embeddingᴱ f →
∀ y → Is-proposition (f ⁻¹ᴱ y)
embedding→⁻¹ᴱ-propositional {f = f} =
Is-embeddingᴱ f ↝⟨ Is-embeddingᴱ→Is-embedding ⟩
Is-embedding f ↝⟨ Emb.embedding→⁻¹-propositional ⟩
(∀ y → Is-proposition (f ⁻¹ y)) ↝⟨ (∀-cong _ λ _ → H-level-cong _ 1 ECP.⁻¹≃⁻¹ᴱ) ⟩□
(∀ y → Is-proposition (f ⁻¹ᴱ y)) □
------------------------------------------------------------------------
-- Results that depend on an axiomatisation of []-cong (for a single
-- universe level)
module []-cong₁ (ax : []-cong-axiomatisation ℓ) where
----------------------------------------------------------------------
-- More conversion functions
-- Equivalences (with erased proofs) from Erased A to B are
-- embeddings (with erased proofs).
Is-equivalenceᴱ→Is-embeddingᴱ-Erased :
{A : Type ℓ} {f : Erased A → B} →
Is-equivalenceᴱ f → Is-embeddingᴱ f
Is-equivalenceᴱ→Is-embeddingᴱ-Erased eq _ _ =
_≃ᴱ_.is-equivalence $ inverse $
EEq.[]-cong₁.to≡to≃ᴱ≡-Erased ax EEq.⟨ _ , eq ⟩
-- Equivalences with erased proofs between Erased A and B can be
-- converted to embeddings with erased proofs.
Erased≃→Embedding :
{A : Type ℓ} →
Erased A ≃ᴱ B → Embeddingᴱ (Erased A) B
Erased≃→Embedding EEq.⟨ f , is-equiv ⟩ = record
{ to = f
; is-embedding = Is-equivalenceᴱ→Is-embeddingᴱ-Erased is-equiv
}
------------------------------------------------------------------------
-- Results that depend on an axiomatisation of []-cong (for all
-- universe levels)
module []-cong (ax : ∀ {ℓ} → []-cong-axiomatisation ℓ) where
private
open module BC₁ {ℓ} =
[]-cong₁ (ax {ℓ = ℓ})
public
|
src/utilities/point_list.ads | SKNZ/BoiteMaker | 0 | 19210 | with generic_linked_list;
with point;
package point_list is new generic_linked_list (point.point_t);
|
src/day-3/adventofcode-day_3.ads | persan/advent-of-code-2020 | 0 | 29137 | with Ada.Containers.Indefinite_Vectors;
-- https://adventofcode.com/2020/day/3
--
--- Day 3: Toboggan Trajectory ---
--
-- With the toboggan login problems resolved, you set off toward the airport.
-- While travel by toboggan might be easy, it's certainly not safe:
-- there's very minimal steering and the area is covered in trees.
-- You'll need to see which angles will take you near the fewest trees.
--
-- Due to the local geology, trees in this area only grow on exact integer coordinates in a grid.
-- You make a map (your puzzle input) of the open squares (.) and trees (#) you can see. For example:
--
-- ..##.......
-- #...#...#..
-- .#....#..#.
-- ..#.#...#.#
-- .#...##..#.
-- ..#.##.....
-- .#.#.#....#
-- .#........#
-- #.##...#...
-- #...##....#
-- .#..#...#.#
--
-- These aren't the only trees, though; due to something you read about once involving arboreal genetics and biome stability,
-- the same pattern repeats to the right many times:
--
-- ..##.........##.........##.........##.........##.........##....... --->
-- #...#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..
-- .#....#..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#.
-- ..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#
-- .#...##..#..#...##..#..#...##..#..#...##..#..#...##..#..#...##..#.
-- ..#.##.......#.##.......#.##.......#.##.......#.##.......#.##..... --->
-- .#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#
-- .#........#.#........#.#........#.#........#.#........#.#........#
-- #.##...#...#.##...#...#.##...#...#.##...#...#.##...#...#.##...#...
-- #...##....##...##....##...##....##...##....##...##....##...##....#
-- .#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.# --->
--
-- You start on the open square (.)
-- in the top-left corner and need to reach the bottom (below the bottom-most row on your map).
--
-- The toboggan can only follow a few specific slopes
-- (you opted for a cheaper model that prefers rational numbers);
-- start by counting all the trees you would encounter for the slope right 3, down 1:
--
-- From your starting position at the top-left, check the position that is right 3 and down 1.
-- Then, check the position that is right 3 and down 1 from there, and so on until you go past the bottom of the map.
--
-- The locations you'd check in the above example are marked here with
-- O where there was an open square and X where there was a tree:
--
-- ..##.........##.........##.........##.........##.........##....... --->
-- #..O#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..
-- .#....X..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#.
-- ..#.#...#O#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#
-- .#...##..#..X...##..#..#...##..#..#...##..#..#...##..#..#...##..#.
-- ..#.##.......#.X#.......#.##.......#.##.......#.##.......#.##..... --->
-- .#.#.#....#.#.#.#.O..#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#
-- .#........#.#........X.#........#.#........#.#........#.#........#
-- #.##...#...#.##...#...#.X#...#...#.##...#...#.##...#...#.##...#...
-- #...##....##...##....##...#X....##...##....##...##....##...##....#
-- .#..#...#.#.#..#...#.#.#..#...X.#.#..#...#.#.#..#...#.#.#..#...#.# --->
--
-- In this example, traversing the map using this slope would cause you to encounter 7 trees.
--
-- Starting at the top-left corner of your map and following a slope of
-- right 3 and down 1, how many trees would you encounter?
package Adventofcode.Day_3 is
package Slopes is new Ada.Containers.Indefinite_Vectors (Natural, String);
type Slope_Type is new Slopes.Vector with null record;
function Race (Slope : Slope_Type; Right : Natural := 3; Down : Natural := 1) return Long_Long_Integer;
procedure Read (Into_Slope : in out Slope_Type; Path : String);
end Adventofcode.Day_3;
|
src/usb-utils.adb | JeremyGrosser/usb_embedded | 14 | 22135 | <filename>src/usb-utils.adb
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2021, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements; use System.Storage_Elements;
package body USB.Utils is
----------
-- Copy --
----------
procedure Copy (Src, Dst : System.Address; Count : Natural) is
Src_Arr : UInt8_Array (1 .. Count) with Address => Src;
Dst_Arr : UInt8_Array (1 .. Count) with Address => Dst;
begin
Dst_Arr := Src_Arr;
end Copy;
----------
-- Copy --
----------
procedure Copy (Src, Dst : System.Address; Count : HAL.UInt32) is
begin
Copy (Src, Dst, Natural (Count));
end Copy;
----------
-- Copy --
----------
procedure Copy (Src, Dst : System.Address; Count : HAL.UInt11) is
begin
Copy (Src, Dst, Natural (Count));
end Copy;
--------------
-- Allocate --
--------------
function Allocate (This : in out Basic_RAM_Allocator;
Alignment : UInt8;
Len : UInt11)
return System.Address
is
begin
-- First align the Top pointer according to requested alignment
Align_Top (This, Alignment);
-- Check if top is within range, otherwise there is no memory left
if This.Top not in This.Buffer'Range then
return System.Null_Address;
end if;
declare
New_Top : constant Natural := This.Top + Natural (Len);
Ret : System.Address;
begin
-- Check if allocation fits in the buffer
if New_Top - 1 > This.Buffer'Last then
return System.Null_Address;
end if;
Ret := This.Buffer (This.Top)'Address;
This.Top := New_Top;
return Ret;
end;
end Allocate;
---------------
-- Align_Top --
---------------
procedure Align_Top (This : in out Basic_RAM_Allocator;
Alignment : UInt8)
is
begin
-- Top is already outside of buffer range. There is no memory available
-- anymore.
if This.Top not in This.Buffer'Range then
return;
end if;
declare
Addr : constant System.Address := This.Buffer (This.Top)'Address;
Int : constant Integer_Address := To_Integer (Addr);
Align : constant Integer_Address := Integer_Address (Alignment);
Padding : constant Integer_Address :=
(Align - (Int mod Align)) mod Align;
begin
-- This may result in a Top that is outside the range of allocated
-- buffer.
This.Top := This.Top + Natural (Padding);
end;
end Align_Top;
end USB.Utils;
|
archive/agda-3/src/Oscar/Class/IsDecidable.agda | m0davis/oscar | 0 | 412 |
open import Oscar.Prelude
open import Oscar.Data.Decidable
open import Oscar.Data.Proposequality
module Oscar.Class.IsDecidable where
record IsDecidable {𝔬} (𝔒 : Ø 𝔬) : Ø 𝔬 where
infix 4 _≟_
field
_≟_ : (x y : 𝔒) → Decidable (x ≡ y)
open IsDecidable ⦃ … ⦄ public
|
nasm assembly/assgnments/question4.asm | AI-Factor-y/NASM-library | 0 | 1406 | section .data
msg1 : db 'Enter first digit of first number :'
l1 : equ $-msg1
msg2 : db 'Enter second digit of first number :'
l2 : equ $-msg2
msg3 : db ' ',10
l3 : equ $-msg3
section .bss
num11 : resb 1
num12 : resb 1
n1 : resb 1
n2 : resb 1
n3 : resb 1
junk : resb 1
junk1 : resb 1
junk2 : resb 1
ans1 : resb 1
ans2 : resb 1
ans3 : resb 1
ans4 : resw 1
ans0 : resw 1
sum : resw 1
counter : resw 1
section .text
global _start:
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg1
mov edx, l1
int 80h
mov eax, 3
mov ebx, 0
mov ecx, num11
mov edx, 1
int 80h
mov eax, 3
mov ebx, 0
mov ecx, junk
mov edx, 1
int 80h
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, l1
int 80h
mov eax, 3
mov ebx, 0
mov ecx, num12
mov edx, 1
int 80h
mov eax, 3
mov ebx, 0
mov ecx, junk1
mov edx, 1
int 80h
; calculating first number
mov al, byte[num11]
sub al, 30h
mov bl, 10
mov ah, 0
mul bl
mov bx, word[num12]
sub bx, 30h
add ax, bx
mov [n1], ax
mov word[counter],0
mov word[sum],0
for:
mov bx, word[counter]
mov ax, word[n1]
cmp ax,bx
jb exit_for
; sum= sum+counter
mov ax, word[sum]
add ax, bx
mov word[sum], ax
add bx,2
mov word[counter],bx
jmp for
exit_for:
mov dx, 0
mov ax,word[sum]
mov bx, 1000
div bx
mov ax,dx
mov bl, 100
mov ah, 0
div bl
add al, 30h
mov [ans4], ah
mov [ans1], al
mov ax, word[ans4]
mov bl, 10
mov ah, 0
div bl
add al, 30h
add ah, 30h
mov [ans2], al
mov [ans3], ah
mov eax, 4
mov ebx, 1
mov ecx, ans1
mov edx, 1
int 80h
mov eax, 4
mov ebx, 1
mov ecx, ans2
mov edx, 1
int 80h
mov eax, 4
mov ebx, 1
mov ecx, ans3
mov edx, 1
int 80h
mov eax, 1
mov ebx, 0
int 80h
|
src/Projects/eu_projects-times.adb | fintatarta/eugen | 0 | 23642 | <filename>src/Projects/eu_projects-times.adb<gh_stars>0
package body EU_Projects.Times is
-----------------
-- To_Duration --
-----------------
function To_Duration (X : Instant) return Duration is
begin
return Duration(X);
end To_Duration;
function Is_Empty (X : Interval) return Boolean
is
begin
return X.Start > X.Stop;
end Is_Empty;
function "<" (L, R : Interval) return Boolean
is
begin
return (not Is_Empty(L)) and then (not Is_Empty(R)) and then R.Stop < L.Start;
end "<";
function "and" (L, R : Interval) return Interval
is
begin
if Is_Empty (L) or Is_Empty (R) then
return Empty_Interval;
else
return Interval'(Start => Max (L.Start, R.Start),
Stop => Min (L.Stop, R.Stop));
end if;
end "and";
function "or" (L, R : Interval) return Interval
is
begin
if Is_Empty (L) then
return R;
elsif Is_Empty (R) then
return L;
elsif Is_Empty (L and R) then
raise Constraint_Error;
else
return Interval'(Start => Min (L.Start, R.Start),
Stop => Max (L.Stop, R.Stop));
end if;
end "or";
---------
-- "<" --
---------
function "=" (L, R : Instant) return Boolean
is (if L.Tbd /= R.Tbd then
False
elsif L.Tbd then
Standard.True
else
L.N = R.N);
function "<" (L, R : Instant) return Boolean
is (if L.Tbd then
False
elsif R.Tbd then
Standard.True
else
L.N < R.N);
----------
-- "<=" --
----------
function "<=" (L, R : Instant) return Boolean
is (L = R or else L < R);
---------
-- ">" --
---------
function ">" (L, R : Instant) return Boolean
is (R < L);
----------
-- ">=" --
----------
function ">=" (L, R : Instant) return Boolean
is (R <= L);
----------------
-- To_Instant --
----------------
function To_Instant
(Month : Natural;
Week : Natural := 0)
return Instant
is
begin
return Scalar (4 * Integer (Month) + Integer (Week));
end To_Instant;
---------------
-- To_Months --
---------------
function Months (Item : Instant)
return Integer
is (if Item.Tbd then
raise Constraint_Error
else
Item.N / 4);
-----------------
-- To_Duration --
-----------------
function To_Duration
(Month : Natural;
Week : Natural := 0)
return Duration
is
begin
return Duration (Scalar (4 * Integer (Month) + Integer (Week)));
end To_Duration;
---------------
-- To_Months --
---------------
function To_Months
(Item : Duration)
return Integer
is (if Item.Tbd then
raise Constraint_Error
else
Item.N / 4);
-----------------
-- To_Interval --
-----------------
function To_Interval (From, To : Instant) return Interval is
begin
return Interval'(Start => From,
Stop => To);
end To_Interval;
---------
-- "-" --
---------
function "-" (L, R : Instant) return Duration is
begin
return Duration(abs (Scalar_Type (L)-Scalar_Type (R)));
end "-";
---------
-- "+" --
---------
function "+" (L : Instant; R : Duration) return Instant is
begin
return Instant (Scalar_Type (L) + Scalar_Type (R));
end "+";
---------
-- "-" --
---------
function "-" (L : Instant; R : Duration) return Instant is
begin
return Instant (Scalar_Type (L) - Scalar_Type (R));
end "-";
---------
-- "+" --
---------
function "+" (L : Duration; R : Instant) return Instant is
begin
return Instant (L) + R;
end "+";
---------
-- "*" --
---------
function "*" (L : Duration; R : Float) return Duration is
begin
return L * Duration (Scalar (Integer (R)));
end "*";
--------------
-- Start_Of --
--------------
function Start_Of (Item : Interval) return Instant is
begin
return Item.Start;
end Start_Of;
------------
-- End_Of --
------------
function End_Of (Item : Interval) return Instant is
begin
return Item.Stop;
end End_Of;
-----------------
-- Duration_Of --
-----------------
function Duration_Of (Item : Interval) return Duration is
begin
return Item.Stop - Item.Start;
end Duration_Of;
----------------
-- Set_Option --
----------------
function Set_Option (Formatter : Time_Formatter;
Option : Formatting_Option;
Value : String)
return Time_Formatter
is
Result : Time_Formatter := Formatter;
begin
case Option is
when To_Be_Decided_Image =>
Result.Tbd_Image := To_Unbounded_String (Value);
end case;
return Result;
end Set_Option;
-----------
-- Image --
-----------
function Image (Formatter : Time_Formatter;
Item : Instant;
Unit : Unit_Type := Months;
Write_Unit : Boolean := False) return String
is
begin
if Item.Tbd then
return To_String (Formatter.Tbd_Image);
end if;
case Unit is
when Weeks =>
return Image (Item.N) & (if Write_Unit then "w" else "");
when Months =>
declare
Months : constant Scalar_Base := Item.N / 4;
Weeks : constant Scalar_Base := Item.N mod 4;
begin
if Write_Unit then
if Weeks = 0 then
return Chop (Natural'Image (Months)) & "m";
else
return
Image (Months) & "m"
& Image (Weeks) & "w";
end if;
else
return Image (Months);
end if;
end;
end case;
end Image;
end EU_Projects.Times;
|
programs/oeis/039/A039823.asm | karttu/loda | 1 | 10392 | ; A039823: a(n) = ceiling( (n^2 + n + 2)/4 ).
; 1,2,4,6,8,11,15,19,23,28,34,40,46,53,61,69,77,86,96,106,116,127,139,151,163,176,190,204,218,233,249,265,281,298,316,334,352,371,391,411,431,452,474,496,518,541,565,589,613,638,664,690,716,743,771,799,827
add $0,2
bin $0,2
add $0,2
div $0,2
mov $1,$0
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_7290_1391.asm | ljhsiun2/medusa | 9 | 1688 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xb04d, %r11
nop
nop
nop
nop
add $3886, %rsi
movups (%r11), %xmm1
vpextrq $0, %xmm1, %rdi
nop
add $239, %rdi
lea addresses_WC_ht+0x10b69, %rdi
nop
nop
nop
dec %rbp
mov (%rdi), %si
nop
nop
nop
nop
inc %rax
lea addresses_WC_ht+0x1ce89, %rbp
clflush (%rbp)
nop
nop
sub %r8, %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
vmovups %ymm4, (%rbp)
nop
nop
nop
nop
nop
inc %rbp
lea addresses_A_ht+0x14109, %rsi
lea addresses_WT_ht+0xc31b, %rdi
nop
nop
cmp %rax, %rax
mov $18, %rcx
rep movsq
nop
nop
nop
nop
xor $713, %rbp
lea addresses_UC_ht+0x16489, %rdi
nop
nop
nop
cmp %rbp, %rbp
mov (%rdi), %r11
nop
nop
nop
nop
nop
add $58253, %rbp
lea addresses_UC_ht+0x13d29, %rdi
nop
cmp $18143, %rbp
vmovups (%rdi), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r8
nop
nop
add $2456, %rsi
lea addresses_UC_ht+0x6e39, %rsi
lea addresses_UC_ht+0x7c89, %rdi
nop
nop
sub $25222, %r12
mov $64, %rcx
rep movsq
nop
nop
nop
cmp $41682, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r9
push %rax
push %rbx
push %rcx
// Store
lea addresses_UC+0x1e9c1, %rcx
nop
inc %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm1
vmovups %ymm1, (%rcx)
nop
nop
nop
sub $38568, %rbx
// Store
lea addresses_WC+0x13d09, %r14
nop
mfence
mov $0x5152535455565758, %r9
movq %r9, %xmm5
movups %xmm5, (%r14)
nop
nop
inc %r10
// Store
lea addresses_PSE+0x11f09, %r14
clflush (%r14)
nop
nop
xor %rax, %rax
movb $0x51, (%r14)
nop
nop
nop
add %r10, %r10
// Store
lea addresses_normal+0x6689, %r13
nop
nop
cmp $62502, %r9
movl $0x51525354, (%r13)
nop
xor %rbx, %rbx
// Load
lea addresses_PSE+0x8435, %r13
nop
nop
nop
nop
nop
inc %rbx
mov (%r13), %r9w
// Exception!!!
nop
nop
nop
mov (0), %rax
nop
nop
nop
nop
xor %rax, %rax
// Faulty Load
lea addresses_normal+0x4c89, %r13
nop
nop
nop
nop
and %r14, %r14
mov (%r13), %r9d
lea oracles, %rcx
and $0xff, %r9
shlq $12, %r9
mov (%rcx,%r9,1), %r9
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': True}, 'OP': 'REPM'}
{'34': 7290}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
kernel/arch/i386/idt_a.asm | Heasummn/DevOS | 8 | 246469 | <reponame>Heasummn/DevOS
; Interrupt Descriptor Table
global idt_flush
extern idt_p
idt_flush:
lidt [idt_p]
ret
|
Library/Spreadsheet/Spreadsheet/spreadsheetRecalc.asm | bocke/pcgeos | 0 | 169233 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: spreadsheetRecalc.asm
AUTHOR: <NAME>, Mar 22, 1991
ROUTINES:
Name Description
---- -----------
EXT RecalcDependentsNoRedraw Recalculate the dependents of a cell, but
do not redraw
EXT RecalcDependents Recalculate the dependents of a cell and
call CellRedraw when appropriate.
EXT RecalcDependentsWithRedrawCallback Recalculate the dependents of a
cell and use a callback for the cell
redraw.
INT RecalcCellList Recalculate the cell list.
INT RecalcCellListCallback Callback routine for recalculating cell
dependents.
INT RecalcOneCell Recalculate a single cell.
INT RecalcFormulaCell Recalculate a formula cell but don't store
the result.
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 3/22/91 Initial revision
jeremy 7/20/92 Modified code for C use
DESCRIPTION:
Code to do recalculation.
NOTES:
I keep a cell-list which consists of cells to handle and cells
which have been handled.
I use the CRC_ABSOLUTE flag for the cell row to determine if
a cell has been handled already.
I use the CRC_ABSOLUTE flag for the cell column to determine if
a cell has been handled and has been determined to be part of
a circular reference loop.
CF_current.RV_TEXT is a size; FP_nChars is a length.
$Id: spreadsheetRecalc.asm,v 1.1 97/04/07 11:14:05 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpreadsheetNameCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcDependentsNoRedraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate the dependents of a cell, but do not redraw
CALLED BY: FillPasteCommon()
PASS: (ax,cx) - (r,c) of the cell
ds:si - Spreadsheet instance
RETURN: carry - set on error
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 8/ 9/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcDependentsNoRedraw proc far
class SpreadsheetClass
uses bx, dx, bp
.enter
;
; Create a PCT_structure for RecalcCellList.
;
push bp
sub sp, size PCT_vars ; Allocate a stack frame
mov bp, sp ; ss:bp <- ptr to the stack frame
;
; Initialize the common parameters.
;
call SpreadsheetInitCommonParams
;
; Set the redraw callback pointer
;
mov ss:[bp].PCTV_redrawCallback.segment, vseg NoRedrawCallback
mov ss:[bp].PCTV_redrawCallback.offset, offset NoRedrawCallback
call RecalcDependentsWithRedrawCallback
;
; Fix up the stack.
;
add sp, size PCT_vars ; Restore the stack
pop bp
.leave
ret
RecalcDependentsNoRedraw endp
NoRedrawCallback proc far
ret
NoRedrawCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcDependents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate the dependents of a cell and call CellRedraw
when appropriate.
CALLED BY: EnterDataFromEditBar
PASS: ax/cx = Row/column of the cell
ds:si = Spreadsheet instance
RETURN: carry set on error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jeremy 7/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcDependents proc far
class SpreadsheetClass
uses bx, dx, bp
.enter
;
; Create a PCT_structure for RecalcCellList.
;
push bp
sub sp, size PCT_vars ; Allocate a stack frame
mov bp, sp ; ss:bp <- ptr to the stack frame
;
; Initialize the common parameters.
;
call SpreadsheetInitCommonParams
;
; Set the redraw callback pointer
;
mov ss:[bp].PCTV_redrawCallback.segment, vseg CellRedrawDXCX
mov ss:[bp].PCTV_redrawCallback.offset, offset CellRedrawDXCX
call RecalcDependentsWithRedrawCallback
;
; Fix up the stack.
;
add sp, size PCT_vars ; Restore the stack
pop bp
.leave
ret
RecalcDependents endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcDependentsWithRedrawCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate the dependents of a cell and use a callback
for the cell redraw.
CALLED BY: EnterDataFromEditBar
PASS: ax/cx = Row/column of the cell
ss:bp = PCT_struct, initialized with
SpreadsheetInitCommonParams.
ds:si = Spreadsheet instance
RETURN: carry set on error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
jeremy 7/17/92 Added redraw callback so C routines can
use this function
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcDependentsWithRedrawCallback proc far
class SpreadsheetClass
uses ax, bx, cx, dx, di, si, bp, es
.enter
EC < call ECCheckInstancePtr ;>
test ds:[si].SSI_flags, mask SF_MANUAL_RECALC
jnz quitRecalcThisCell ; Quit if not auto-recalc
mov bx, offset cs:AppendDependentsToCellList
call CreateCellList ; bx <- end of cell list
; al <- cumulative CellListEntryFlags
mov cx, mask RLF_FIRST_CELL ; Force first cell to be updated
call RecalcCellList ; Recalculate the cell list
call FreeFinalList ; Free up the cell list
quit:
clc ; Signal: no error
.leave
ret
quitRecalcThisCell:
;
; If we are doing manual recalc then we need to recalc and
; draw this cell.
;
cmp ax, NAME_ROW ; Check for recomputing a name
je quit ; Branch if doing a name.
mov ss:[bp].CP_row, ax ; Set the row/column we're evaluating
mov ss:[bp].CP_column, cx
mov ss:[bp].PCTV_row, ax
mov ss:[bp].PCTV_column, cx
;
; It's not a name, recalculate it.
;
SpreadsheetCellLock ; *es:di <- cell
jnc noCell ; Branch if there's no cell
mov di, es:[di] ; es:di <- cell
call RecalcOneCell ; Recalc the cell
SpreadsheetCellUnlock ; Release the cell
noCell:
mov bx, ss:[bp].PCTV_redrawCallback.segment
mov dx, ss:[bp].PCTV_redrawCallback.offset
xchg ax, dx ; bx:ax <- addr to call
; (dx,cx) <- cell to draw
call ProcCallFixedOrMovable
jmp quit ; Branch to quit
RecalcDependentsWithRedrawCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate the cell list.
CALLED BY: RecalcDependents, ManualRecalc
PASS: ds:si = Spreadsheet instance
ss:bp = PCT_struct, initialized with
SpreadsheetInitCommonParams.
bx = Handle to end of cell list
al = Cumulative CellListEntryFlags
CLEF_PART_CIRCULARITY set if there was a circularity
cx = Initial PCTV_flags
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
You need to free the list yourself.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcCellList proc near
class SpreadsheetClass
uses ax, cx, dx, bp
.enter
EC < call ECCheckInstancePtr ;>
;
; Set our loop counter in case there were no circularities and we
; decide to branch right into the loop.
;
mov dx, 1 ; Assume only one time through the loop
test al, mask CLEF_PART_CIRCULARITY
jz recalcList ; Branch if no circularities
;
; There were circularities. See if we're allowing them and if we are
; then get the iteration counter.
;
test ds:[si].SSI_flags, mask SF_ALLOW_ITERATION
jz recalcList ; Branch if not allowing iteration
;
; There was a circularity and we are allowing iteration. Set the number
; of times we want to recalculate.
;
mov dx, ds:[si].SSI_circCount
recalcList:
;
; Now we can start processing it. First we need the stack frame to pass.
; dx = # of times to go through the loop
;
mov ss:[bp].PCTV_flags, cl ; Set the initial flags
;
; Process the list 'dx' times.
;
mov cx, dx ; cx <- count (1 or greater)
recalcLoop:
;
; Note that we haven't diverged.
;
andnf ss:[bp].PCTV_flags, not mask RLF_DIVERGED
;
; Recalculate the tree.
;
mov ax, offset cs:RecalcCellListCallback
call ForeachCellListEntry ; Call callback for each entry
;
; Before we loop, check to see if we are converging. If we are then
; we can just quit now.
;
test ss:[bp].PCTV_flags, mask RLF_DIVERGED
jz endLoop ; Branch if we're converging
;
; We diverged, try it all over again.
;
loop recalcLoop ; Loop to do it all over again
endLoop:
.leave
ret
RecalcCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcCellListCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for recalculating cell dependents.
CALLED BY: RecalcDependents via ForeachCellListEntry
PASS: ds:si = Spreadsheet instance
ss:bp = PCT_vars structure on the stack
dx = Row
cl = Column
ch = Flags
es:di = Pointer to the current cell list entry
RETURN: carry clear always
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
bREVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcCellListCallback proc near
class SpreadsheetClass
uses ax, bx, cx, dx, es, di
.enter
EC < call ECCheckInstancePtr ;>
;
; Set up ax/cx with the row/column and dh with the flags.
;
mov ax, dx ; ax <- row
mov dh, ch ; dh <- flags
clr ch ; cx <- column
;
; It is possible that the cell doesn't exist. This can only happen
; when the user has replaced the current cell with an empty one. The
; cell gets removed, but is the root of the recalc tree anyway.
; We need to detect this condition and do nothing.
;
SpreadsheetCellLock ; *es:di <- cell data
LONG jnc cellDoesNotExist ; Branch if cell doesn't exist
;
; Cell does exist. Recalculate it appropriately.
;
mov di, es:[di] ; es:di <- cell data
if _PROTECT_CELL
;
; For cell protection, we have to leave the protection bit unchanged.
;
andnf es:[di].CC_recalcFlags, mask CRF_PROTECTION
else
;
; We left the "reserved" bit as it is
;
andnf es:[di].CC_recalcFlags, mask CRF_RESERVED
endif
SpreadsheetCellDirty ; Dirty the cell
;
; We don't want to compute names. We did need to lock the cell in
; order to clear out the recalc flags though.
;
cmp ax, NAME_ROW ; Don't recalc names
je quitUnlock ; Branch if it's a name
mov ss:[bp].CP_row, ax ; Set the row/column we're evaluating
mov ss:[bp].CP_column, cx
mov ss:[bp].PCTV_row, ax
mov ss:[bp].PCTV_column, cx
;
; Check for iterating through circularities. If we are then we don't
; mark cells which are part of a circularity with an error.
;
test ds:[si].SSI_flags, mask SF_ALLOW_ITERATION
jnz recalcCell ; Branch if allowing iteration
;
; We aren't iterating through circularities. Check for an error.
; Check for start of a circularity or part of a circularity.
;
test dh, mask CLEF_PART_CIRCULARITY
jz recalcCell ; Branch if not part of circularity
;
; It is the start of a circular reference. Mark the cell appropriately.
;
; First make sure it isn't already marked as such:
; type = Formula
; return = Error
; value = CE_CIRC_DEPEND
;
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
cmp es:[di].CC_type, CT_FORMULA
jne saveError ; Branch if not already formula
cmp es:[di].CF_return, RT_ERROR
jne saveError ; Branch if not an error result
cmp es:[di].CF_current.RV_ERROR, CE_CIRC_DEPEND
je quitUnlock ; Branch if already this error
saveError:
push ax ; Save the row
mov ax, RT_ERROR ; ax <- type of result
call ResizeFormulaResult ; Resize the cell
mov es:[di].CF_current.RV_ERROR, CE_CIRC_DEPEND
SpreadsheetCellDirty ; Dirty the cell
pop ax ; Restore the row
jmp redrawCell ; Branch to redraw the cell
recalcCell:
call RecalcOneCell ; Recalculate the cell
test ss:[bp].PCTV_flags, mask RLF_CHANGED
jz quitUnlock ; Branch if cell didn't change
redrawCell:
mov dx, ax ; (dx, cx) <- the cell to redraw
call CheckIfLocked ;send recalc locked cells msg if locked
mov ax, ss:[bp].PCTV_redrawCallback.offset
mov bx, ss:[bp].PCTV_redrawCallback.segment
call ProcCallFixedOrMovable ; Draw the cell
; Nukes ax, bx, cx, dx, di
quitUnlock:
SpreadsheetCellUnlock ; Release the cell
quit:
and ss:[bp].PCTV_flags, not mask RLF_FIRST_CELL
clc ; Signal: continue
.leave
ret
cellDoesNotExist:
;
; The cell doesn't exist. We need to redraw it anyway...
;
; ax/cx = Row/Column
; ds:si = Spreadsheet pointer
;
mov dx, ax ; dx/cx = Row/Column
mov ax, ss:[bp].PCTV_redrawCallback.offset
mov bx, ss:[bp].PCTV_redrawCallback.segment
call ProcCallFixedOrMovable
jmp quit
RecalcCellListCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckIfLocked
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: A cell has changed. If it is a locked cell, send
a notification message.
CALLED BY: RecalcCellListCallback
PASS: ds:si - Spreadsheet instance
dx, cx - cell which changed
RETURN: nothing
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
cassie 5/11/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckIfLocked proc near
class SpreadsheetClass
uses si
.enter
;
; If the cell to be drawn is in the locked area, calling the
; redraw callback won't do it. Notify ourselves that this
; cell needs to be redrawn. It will be handled in GeoCalc.
;
mov si, ds:[si].SSI_chunk
mov ax, TEMP_SPREADSHEET_DOC_ORIGIN
call ObjVarFindData
jnc notLocked
cmp dx, ds:[bx].SDO_rowCol.CR_row
jb locked
cmp cx, ds:[bx].SDO_rowCol.CR_column
jae notLocked
locked:
push cx, dx, bp
mov ax, MSG_SPREADSHEET_LOCKED_CELL_RECALC
call ObjCallInstanceNoLock
pop cx, dx, bp
notLocked:
.leave
ret
CheckIfLocked endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcOneCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate a single cell.
CALLED BY: IntelligentRecalc via DoSomethingToDependents
PASS: ss:bp = Pointer to PCT_vars on stack
ds:si = Spreadsheet instance
es:di = Pointer to cell data
RETURN: es:di = Pointer to cell data (may have moved)
ss:bp.PCTV_flags with RLF_CHANGED and RLF_DIVERGED set if
appropriate.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine must be declared "far" since it is passed on the stack
as a callback routine.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcOneCell proc near
uses ax, bx, cx, si, ds
.enter
EC < call ECCheckInstancePtr ;>
;
; Check for a chart cell.
;
cmp ss:[bp].PCTV_row, CHART_ROW
CHART< je recalcChartCell ; Branch if a chart cell >
NOCHART< je quit ; don't handle chart cell >
;
; We don't want to calculate any other non-formula cells.
;
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
cmp es:[di].CC_type, CT_FORMULA
jne quitMayHaveChanged ; Branch if not formula cell
call RecalcFormulaCell ; Recalc the formula
;
; The result is pointed at by ss:bx
;
call SaveResult ; Save the result
quit:
.leave
ret
recalcChartCell::
CHART < call SpreadsheetRecalcChart >
;
; Since a chart cannot have any dependents, we don't modify the
; RLF_CHANGED flag.
;
CHART < jmp quit >
quitMayHaveChanged:
;
; The cell may have changed.
;
; If it's a display-formula cell then we want to force it to redraw so
; we return that it has changed.
;
; Otherwise it's a constant cell so it couldn't have changed.
;
and ss:[bp].PCTV_flags, not mask RLF_CHANGED
;
; If it's the first cell then the user has just entered this data and
; we definitely want to mark it as changed.
;
test ss:[bp].PCTV_flags, mask RLF_FIRST_CELL
jnz hasChanged ; Branch if first cell
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
cmp es:[di].CC_type, CT_DISPLAY_FORMULA
jne quit ; Branch if not display formula
hasChanged:
;
; It's a display formula or it's the first cell, force it to redraw.
;
or ss:[bp].PCTV_flags, mask RLF_CHANGED
jmp quit
RecalcOneCell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RecalcFormulaCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate a formula cell but don't store the result.
CALLED BY: RecalcOneCell, FormulaDisplayCellGetResult
PASS: ss:bp = Pointer to PCT_vars on stack
ds:si = Spreadsheet instance
es:di = Pointer to cell data
RETURN: ss:bx = Pointer to the result
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Evaluate the expression, then if the result is an error, change
the error code on the argument stack from a parser error to a
cell error.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RecalcFormulaCell proc far
uses ax, cx, di, si, ds, es
.enter
EC < call ECCheckInstancePtr ;>
add di, CF_formula ; es:di <- ptr to the formula
segmov ds, es, si ; ds:si <- ptr to the formula
mov si, di
CheckHack< (size PCTV_evalBuffer) eq PARSE_TEXT_BUFFER_SIZE >
mov ss:[bp].EP_flags, 0 ; Evaluate me...
segmov es, ss, di ; es:di <- ptr to scratch buffer
lea di, ss:[bp].PCTV_evalBuffer
mov cx, PARSE_TEXT_BUFFER_SIZE
call ParserEvalExpression ; Evaluate it...
jc errorEval ; Branch on error
;
; Check for an error. If there is one, we want to convert it to a
; cell error.
;
test ss:[bx].ASE_type, mask ESAT_ERROR
jz quit
;
; Convert the parser error to a cell error and stick it back on
; the stack.
;
mov al, ss:[bx].ASE_data.ESAD_error.EED_errorCode
call ConvertParserError ; al <- new error
mov ss:[bx].ASE_data.ESAD_error.EED_errorCode, al
quit:
.leave
ret
errorEval:
;
; There was some serious evaluator error.
; Possible errors include:
; - Out of stack space (expression too complicated)
; - Names are nested too deeply
;
; We just stuff a "too complex" error
;
lea bx, ss:[bp].PCTV_evalBuffer
mov ss:[bx].ASE_type, mask ESAT_ERROR
mov ss:[bx].ASE_data.ESAD_error.EED_errorCode, CE_TOO_COMPLEX
jmp quit
RecalcFormulaCell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SaveResult
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Save the result of a calculation into a cell.
CALLED BY: RecalcOneCell
PASS: ss:bp = Pointer to PCT_vars
ss:bx = Pointer to the result
ds:si = Spreadsheet instance
es:di = Pointer to the cell data
RETURN: es:di = Pointer to cell (may have moved)
ss:bp.PCTV_flags with:
- RLF_CHANGED bit set if the cell changed
- RLF_CHANGED bit clear otherwise
- RLF_DIVERGED bit set if the cell changed by more than
value in SSI_converge. This bit is never cleared
since it is a cumulative marker...
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaveResult proc near
class SpreadsheetClass
uses ax, cx, dx, ds, si
.enter
EC < call ECCheckInstancePtr ;>
;
; Check to see if the cell has changed. If we're doing iteration, then
; this routine will also check for convergence.
;
call CompareResultToCell ; Check for a change
test ss:[bp].PCTV_flags, mask RLF_CHANGED
jz quit ; Branch if no change
;
; Check for an error first, since it's a conglomerate of the
; other bit fields.
;
test ss:[bx].ASE_type, mask ESAT_ERROR
jnz saveError
test ss:[bx].ASE_type, mask ESAT_NUMBER
jnz saveNumber
test ss:[bx].ASE_type, mask ESAT_STRING
jnz saveString
;------------------------------------------------------------------------------
; Some sort of an error
;
mov cl, CE_TYPE ; Bad type is our "generic" error
jmp gotError
saveError:
mov cl, ss:[bx].ASE_data.ESAD_error.EED_errorCode
gotError:
mov ax, RT_ERROR ; al <- new formula result
call ResizeFormulaResult ; Adjust the result of the formula
mov es:[di].CF_current.RV_ERROR, cl
jmp done
;------------------------------------------------------------------------------
; Result is a number
;
saveNumber:
;
; Save a numeric result into the cell.
; ss:bx.ASE_data = ptr to the number to save
;
mov al, RT_VALUE ; al <- new formula result
call ResizeFormulaResult ; Adjust the result of the formula
; dx <- position to save data at
push di ; Save pointer to cell data
mov di, dx ; es:di <- ptr to place to put result
call FloatPopNumber ; Save the number
pop di ; Restore pointer to cell data
jmp done ; Branch to finish up
;------------------------------------------------------------------------------
; Result is a string
;
saveString:
;
; Save a string result into the cell
; ss:bx.ASE_data = the string: length followed by data (no NULL).
;
mov al, RT_TEXT ; al <- new formula result
call ResizeFormulaResult ; Adjust the result of the formula
push ds, si, di ; Save instance ptr, cell ptr
segmov ds, ss, ax ; ds <- source (arg stack)
; Save the string length
mov ax, ds:[bx].ASE_data.ESAD_string.ESD_length
mov cx, ax ; cx <- string length
DBCS< shl ax, 1 ; ax <- size of string >
mov es:[di].CF_current.RV_TEXT, ax
mov di, dx ; es:di <- ptr to put the string
mov si, bx ; ds:si <- ptr to arg-stack element
add si, offset ASE_data + 2 ; ds:si <- ptr to the string
LocalCopyNString ; Copy the string data
pop ds, si, di ; Restore instance ptr, cell ptr
;
; Fall thru to finish up
;
done:
;
; es:di must contain a pointer to the cell data here.
; ds:si must contain a pointer to the spreadsheet instance data.
;
SpreadsheetCellDirty ; Mark the cell as dirty
quit:
.leave
ret
SaveResult endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CompareResultToCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Compare the new result to the old cell data.
CALLED BY: SaveResult
PASS: es:di = Pointer to cell data
ss:bp = Pointer to PCT_vars structure on the stack
ds:si = Spreadsheet instance
ss:bx = Pointer to the new result.
RETURN: ss:bp.PCTV_flags with:
- RLF_CHANGED bit set if the cell changed
- RLF_CHANGED bit clear otherwise
- RLF_DIVERGED bit set if the cell changed by more than
value in SSI_converge. This bit is never cleared
since it is a cumulative marker...
If the RLF_CHANGED bit is clear and the cell contains a number
then the new result (same as the old) will have been removed
from the fp-stack.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 3/91 Initial version
witt 11/17/93 DBCS-ized
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CompareResultToCell proc near
class SpreadsheetClass
uses ax, cx, di, si, ds, es
.enter
EC < call ECCheckInstancePtr ;>
;
; The first cell that ever gets computed is considered to have changed
; but not diverged.
;
test ss:[bp].PCTV_flags, mask RLF_FIRST_CELL
LONG jnz quitChanged
;
; Clear the bit signalling a change in the cell.
;
and ss:[bp].PCTV_flags, not mask RLF_CHANGED
;
; If the cell type is anything other than "formula" then it must have
; changed.
;
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
cmp es:[di].CC_type, CT_FORMULA
LONG jne quitDiverged ; If different, changed and diverged
;
; It was a formula cell (and it is now a formula cell).
;
; Compare the return types.
;
mov al, ss:[bx].ASE_type ; al <- evaluator type bits
mov ah, RT_ERROR ; Assume error type
test al, mask ESAT_ERROR ; Check for evaluator type == error
jnz gotReturnType ; Branch if it is an error
mov ah, RT_VALUE ; Assume value
test al, mask ESAT_NUMBER ; Check for evaluator type == number
jnz gotReturnType ; Branch if it is a number
mov ah, RT_TEXT ; Assume text
test al, mask ESAT_STRING ; Check for evaluator type == text
jnz gotReturnType ; Branch if it is a text
;
; Hmmm... It is something mysterious. Assume it must have changed
;
jmp quitDiverged ; Branch if something mysterious
gotReturnType:
;
; ah = Return type for the new value. Always one of:
; RT_ERROR, RT_VALUE, RT_TEXT
;
cmp ah, es:[di].CF_return ; Check for same return type
LONG jne quitDiverged ; Branch if not the same
;
; We know that the types are the same, now we take the type and do
; a comparison based on the type.
;
cmp ah, RT_ERROR ; Check for error
jne notError ; Branch if not
;
; Compare the error values.
;
mov al, ss:[bx].ASE_data.ESAD_error.EED_errorCode
cmp al, es:[di].CF_current.RV_ERROR
jne quitDiverged ; Branch if errors differ
jmp quit ; Otherwise just quit
notError:
cmp ah, RT_TEXT ; Check for text
jne notText ; Branch if not text
;
; Compare the strings.
;
mov cx, ss:[bx].ASE_data.ESAD_string.ESD_length
if DBCS_PCGEOS
mov si, es:[di].CF_current.RV_TEXT
shr si, 1 ; si <- string length
EC< ERROR_C CELL_DATA_STRING_ODDSIZE
cmp cx, si ; compare lengths
else
cmp cx, es:[di].CF_current.RV_TEXT
endif
jne quitDiverged ; Branch if the lengths differ
;
; cx == String length
;
add di, es:[di].CF_formulaSize
add di, size CellFormula ; es:di <- ptr to the old string
segmov ds, ss, si ; ds:si <- ptr to new string
lea si, ss:[bx].ASE_data+2
SBCS< repe cmpsb ; Check for a change >
DBCS< repe cmpsw ; Check for a change >
jne quitDiverged ; Branch if strings differ
jmp quit ; Otherwise just quit
notText:
;
; Well... It must be a number. The new value is on the fp-stack.
; What we need to do is duplicate it and subtract it from the old
; value. This gives us the amount of change.
;
; If the result is zero then we can just quit.
;
; Otherwise we take the absolute value of the result and compare
; it to SSI_converge. If it is less than SSI_converge then we
; know that while we differ, we are converging.
;
;
; Check for old and new values being the same.
; On fp stack:
; New value
;
push di ; Save ptr
lea di, es:[di].CF_current.RV_VALUE
call FloatCompESDI ; Compare against pointer
; Nukes ax
pop di ; Restore ptr
je quitPopNumber ; Branch if no change
;
; We know that the value changed. That means we need to leave the
; new value on the fp-stack.
; If we are not allowing iteration, then this is all we care about.
;
test ds:[si].SSI_flags, mask SF_ALLOW_ITERATION
jz quitChanged ; Branch if not allowing iteration
;
; Now take the absolute value of the difference between the old and new
; values.
;
call FloatDup ; Duplicate new value
push ds, si ; Save spreadsheet instance
segmov ds, es, si ; ds:si <- ptr to old value
lea si, es:[di].CF_current.RV_VALUE
call FloatPushNumber ; Push the old value on the stack
call FloatSub ; Take the difference
call FloatAbs ; Take the absolute value
pop ds, si ; Restore spreadsheet instance
;
; Now subtract this from the convergence value.
; fp stack:
; New Value
; Top => Difference between old and new
;
lea si, ds:[si].SSI_converge
call FloatPushNumber ; Push convergence value
call FloatCompAndDrop ; Compare and remove values
jbe quitChanged ; Branch if differs by only a little
;
; Difference is larger than the maximum allowed change.
; The value has not converged.
;
quitDiverged:
or ss:[bp].PCTV_flags, mask RLF_DIVERGED
quitChanged:
or ss:[bp].PCTV_flags, mask RLF_CHANGED
quit:
.leave
ret
quitPopNumber:
call FloatDrop ; Remove number from the fp-stack
jmp quit
CompareResultToCell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvertParserError
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert a parser error to a cell error.
CALLED BY: SaveResult
PASS: al = ParserScannerEvaluatorError
RETURN: al = CellError
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
al must be one of the errors in parserErrorTable otherwise
we will die with a fatal error.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvertParserError proc near
uses cx, es, di
.enter
segmov es, cs
mov di, offset cs:parserErrorTable ; es:di <- ptr to the table
mov cx, length parserErrorTable ; cx <- size of the table
repne scasb ; Try to find it...
;
; This error can only happen if someone has mucked with the error
; codes or if the caller is passing a bad value.
;
EC < ERROR_NE PARSER_ERROR_NOT_FOUND >
mov al, cs:[di][(offset cellErrorTable)-(offset parserErrorTable)-1]
.leave
ret
ConvertParserError endp
;
; Two parallel tables. One contains a list of parser errors. The other
; contains the cell errors associated with each of the parser errors. Make
; sure you update them both together.
;
parserErrorTable byte PSEE_OUT_OF_STACK_SPACE,
PSEE_NESTING_TOO_DEEP,
PSEE_ROW_OUT_OF_RANGE,
PSEE_COLUMN_OUT_OF_RANGE,
PSEE_FUNCTION_NO_LONGER_EXISTS,
PSEE_UNDEFINED_NAME,
PSEE_BAD_ARG_COUNT,
PSEE_WRONG_TYPE,
PSEE_DIVIDE_BY_ZERO,
PSEE_CIRCULAR_REF,
PSEE_GEN_ERR,
PSEE_NA,
PSEE_FLOAT_POS_INFINITY,
PSEE_FLOAT_NEG_INFINITY,
PSEE_FLOAT_GEN_ERR,
PSEE_CIRCULAR_DEP,
PSEE_CIRC_NAME_REF,
PSEE_NUMBER_OUT_OF_RANGE
cellErrorTable byte CE_TOO_COMPLEX,
CE_TOO_COMPLEX,
CE_REF_OUT_OF_RANGE,
CE_REF_OUT_OF_RANGE,
CE_NAME,
CE_NAME,
CE_ARG_COUNT,
CE_TYPE,
CE_DIVIDE_BY_ZERO,
CE_CIRCULAR_REF,
CE_GEN_ERR,
CE_NA,
CE_FLOAT_POS_INF,
CE_FLOAT_NEG_INF,
CE_FLOAT_GEN_ERR,
CE_CIRC_DEPEND,
CE_CIRC_NAME_REF,
CE_NUM_OUT_OF_RANGE
.assert (size cellErrorTable eq size parserErrorTable)
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvertCellError
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert a cell error into a PSEE_error
CALLED BY: DerefFormula
PASS: al = Error to convert
RETURN: al = PSEE_error to use
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvertCellError proc near
uses cx, di, es
.enter
segmov es, cs
mov di, offset cs:cellErrorTable ; es:di <- ptr to the table
mov cx, size cellErrorTable ; cx <- size of the table
repne scasb ; Try to find it...
;
; This can only happen if someone has mucked with the error codes
; or if the caller passed a garbage value.
;
EC < ERROR_NE PARSER_ERROR_NOT_FOUND >
sub di, offset cs:cellErrorTable ; di <- offset past entry
mov al, cs:parserErrorTable[di-1] ; al <- the parser error
.leave
ret
ConvertCellError endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ResizeFormulaResult
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Resize a formula cell in order to make space for the result.
CALLED BY: SaveResult
PASS: es:di = Pointer to the cell
ds:si = Spreadsheet instance
al = New type for the cell
if al == ESAT_STRING
ss:bx = Pointer to the EvalArgumentStack
RETURN: es:di = Pointer to the cell (may have moved)
es:dx = Position to save the data at
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
There are only a few interesting cases here:
Text -> Text
Text -> other
other-> Text
In all other cases no resizing of the cell is necessary.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
If an error is returned, the cell will be unlocked.
The new type is saved into the cell, but the cell isn't marked as
dirty. If you don't mark it as dirty before unlocking it the new type
may be lost.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 3/18/91 Initial version
witt 11/17/93 DBCS-ized
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ResizeFormulaResult proc near
uses bx, cx
.enter
EC < call ECCheckInstancePtr ;>
;
; We need to figure out how many bytes to insert/delete from the
; text area at the end of the cell data.
;
clr cx ; Assume not text type
cmp al, RT_TEXT ; Check for new == text
jne gotNewSize ; Branch if it's not
mov cx, ss:[bx].ASE_data.ESAD_string.ESD_length
DBCS< shl cx, 1 ; cx <- string size >
gotNewSize:
;
; cx == the new size. Now we need to get the old size and adjust the
; buffer appropriately.
;
cmp es:[di].CF_return, RT_TEXT ; Check for old == text
jne gotOldSize ; Branch if it isn't
sub cx, es:[di].CF_current.RV_TEXT ; cx <- old size
DBCS< EC< test cx, 1 > >
DBCS< EC< ERROR_NZ CELL_DATA_STRING_ODDSIZE ; Odd ball size! > >
gotOldSize:
;
; cx == change in size.
;
mov bl, al ; bl <- the type of the new data
;
; If both the old and new entries are text cells, and if both strings
; are the same size, then we want to grab the position of the place
; to put the new string here so we can skip a lot of calculation.
;
mov dx, es:[di].CF_formulaSize ; dx <- offset for text cell
add dx, size CellFormula
jcxz findNewDataPos ; Branch if no change in size
;
; Resize the data... The position to resize at is the area after the
; formula.
;
SpreadsheetCellUnlock ; Release the cell
push dx ; Save position to write data
call InsertIntoCurrentCell ; Make the change
pop dx ; Restore position to write data
mov ax, ss:[bp].PCTV_row ; ax <- row
mov cx, ss:[bp].PCTV_column ; cx <- column
SpreadsheetCellLock ; Lock the cell down again
mov di, es:[di]
findNewDataPos:
;
; Now we need to set es:dx == pointer to the place to put the data.
; bl == the new data type
;
mov es:[di].CF_return, bl ; Save the new data type
mov bx, offset CF_current ; Assume non-text type
cmp es:[di].CF_return, RT_TEXT ; Check for text type
jne quitNoError ; Branch if not text type
;
; It's a text cell, save the position that the text is at.
;
mov bx, dx ; Fall thru w/ value in bx
quitNoError:
;
; bx == offset to the place to store the new data.
;
add bx, di ; es:bx <- place to put data
mov dx, bx ; es:dx <- place to put data
.leave
ret
ResizeFormulaResult endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ManualRecalc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Recalculate a spreadsheet manually.
CALLED BY: SpreadsheetRecalc
PASS: ds:si = Instance ptr
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
ext = CellGetExtent()
list = AllocChildList()
RangeEnum( extent ):
Add cell to cell list
CreateCellListFromChildList( list )
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 4/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ManualRecalcVars struct
MRV_rangeParams RangeEnumParams
MRV_tempListHead hptr ; First block handle of temporary list
MRV_tempListBlock hptr ; Block handle of temporary list
ManualRecalcVars ends
ManualRecalc proc far
uses ax, bx, cx, dx
localVars local ManualRecalcVars
.enter
EC < call ECCheckInstancePtr ;>
;
; Fill in the parameters.
;
lea bx, localVars.MRV_rangeParams
call CellGetExtent ; REP_bounds <- extent of spreadsheet
;
; Check for no data at all.
;
cmp localVars.MRV_rangeParams.REP_bounds.R_top, -1
je quit ; Branch if no data
call ManualRecalcSetup ; Setup the frame
;
; Now create the cell list.
;
; bp = Local variables
; ds:si = Spreadsheet instance
;
push bp, si ; Save frame ptr, instance ptr
mov bx, localVars.MRV_tempListBlock
;
; Create stack frame.
;
sub sp, size CreateCellListParams
mov bp, sp ; ss:bp <- ptr to parameters
;
; Initialize it.
;
mov ss:[bp].CCLP_moreCallback, offset cs:AppendDependentsToCellList
;
; Set ss:bp to point at the top of it.
;
add bp, size CreateCellListParams
call CreateCellListFromChildList
; bxi <- end of celllist
add sp, size CreateCellListParams
pop bp, si ; Restore frame ptr, instance ptr
;
; Now recalculate this cell list.
; bx = End of cell list
; al = Flags
;
clr cx ; Don't force first cell to be updated
push bp
sub sp, size PCT_vars ; Allocate a stack frame
mov bp, sp ; ss:bp <- ptr to the stack frame
;
; Initialize the common parameters.
;
call SpreadsheetInitCommonParams
mov ss:[bp].PCTV_redrawCallback.segment, vseg CellRedrawDXCX
mov ss:[bp].PCTV_redrawCallback.offset, offset CellRedrawDXCX
call RecalcCellList ; Recalculate
;
; Fix up the stack.
;
add sp, size PCT_vars ; Restore the stack
pop bp
call FreeFinalList ; Free up the list
quit:
.leave
ret
ManualRecalc endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ManualRecalcSetup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup the ManualRecalcVars
CALLED BY: ManualRecalc, CreateNamePrecedentsList
PASS: ss:bp = Pointer to inheritable ManualRecalcVars with:
MRV_rangeParams.REP_bounds set
RETURN: Rest of the stack frame set up.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ManualRecalcSetup proc near
uses ax, bx, dx
localVars local ManualRecalcVars
.enter inherit
;
; First create the cell list and store the pointer into the
; stack frame.
;
call AllocChildList ; bx <- empty cell
mov localVars.MRV_tempListHead, bx
mov localVars.MRV_tempListBlock, bx
lea bx, localVars.MRV_rangeParams
;
; Now setup and call RangeEnum.
;
mov ss:[bx].REP_callback.segment, SEGMENT_CS
mov ss:[bx].REP_callback.offset, offset cs:MRCallback
;
; We only want cells with data in them and we don't need the cells
; locked because we aren't using the data inside them.
;
mov dl, mask REF_NO_LOCK
call RangeEnum ; Build the cell list
.leave
ret
ManualRecalcSetup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MRCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a cell to the cell list.
CALLED BY: ManualRecalc via RangeEnum
PASS: ds:si = Spreadsheet instance
ax,cx = Row,Column of current cell
ss:bp = Pointer to inheritable ManualRecalcVars
RETURN: carry clear always
dl = unchanged
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MRCallback proc far
uses ax, bx, cx, si
localVars local ManualRecalcVars
.enter inherit
EC < call ECCheckInstancePtr ;>
;
; Add the cell to the cell list.
;
mov bx, localVars.MRV_tempListBlock
;
; bx = Block of list to add to
; ax = Row
; cl = Column
;
clr ch ; No flags
call PushCellListEntry ; Add entry to the list
;
; Set the current block.
;
mov localVars.MRV_tempListBlock, bx
clc ; Signal: continue
.leave
ret
MRCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ForeachDependency
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a callback for each dependent of a cell
CALLED BY: AppendDependentsToCellList, AppendNamePrecedentsToCellList
PASS: ds:si = Spreadsheet instance
es:di = Pointer to the cell
ax = Near routine to call for each cell in the dependency
list.
RETURN: carry set if callback aborted.
ax set by callback only if aborted.
es = Segment address of same block it was when we got here
DESTROYED: nothing (although blocks may move around due to the callback)
PSEUDO CODE/STRATEGY:
Callback will be passed:
All registers the same as were passed in except:
ds:si = Spreadsheet instance
*es:bx = Pointer to dependency list block
(*es:bx)+di = Pointer to the current dependency list entry
dx = Row of the cell
cx = Column of the cell
It can return carry set to abort processing.
It may destroy ax
KNOWN BUGS/SIDE EFFECTS/IDEAS:
The cells are processed in this order:
Foreach block (first to last)
Foreach entry in the block (last to first)
Callback routines can count on this order.
This may be useful. You can tell when you have reached the last
dependency because the following will be true when the callback
is called:
di = size DependencyListHeader
(*es:bx).DLH_next.segment == 0
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ForeachDependency proc near
class SpreadsheetClass
uses bx, cx, dx, di
.enter
EC < call ECCheckInstancePtr ;>
push es:LMBH_handle ; Save the handle of the passed block
mov bx, ds:[si].SSI_cellParams.CFP_file ; bx <- file handle
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
mov dx, es:[di].CC_dependencies.segment ; dx <- group
mov di, es:[di].CC_dependencies.offset ; di <- item
blockLoop:
tst dx ; Check for no entries
jz quit ; Branch if none (carry clear)
push bx ; Save the file handle
xchg ax, dx ; ax <- group, dx <- callback
call DBLock ; *es:di <- first dependency list
mov ax, dx ; ax <- callback
mov bx, di ; *es:di <- ptr to the block
mov di, es:[di] ; es:di <- ptr to dependency list
ChunkSizePtr es, di, cx ; cx <- size of the block
add di, cx ; es:di <- ptr past end of the block
sub di, es:[bx] ; di <- offset into the block
entryLoop:
sub di, size Dependency ; es:di <- ptr to next entry to process
;
; *es:bx= Pointer to block
; ds:si = Spreadsheet instance
; di = Offset to the next item to callback for
; ax = Callback routine
; bx = File handle
;
add di, es:[bx] ; es:di = pointer to item
mov dx, es:[di].D_row ; dx <- row
clr ch
mov cl, es:[di].D_column ; cx <- column
sub di, es:[bx] ; Make di an offset again
;
; Check for an invalid cell entry. The value 0x7fff is
; derived from masking the sign bit from the value -1.
; ***See UpdateRefOrRep::illegalReference for -1, and
; UpdateDepCallback for masking of CRC_ABSOLUTE (1st bit.)
;
; 7/20/95 - ptrinh
;
cmp dx, 0x7fff ; invalid dependency?
je skipEntry
push ax ; Save callback
call ax ; Call the callback
jc abort ; Branch if aborted
pop ax ; Restore callback
skipEntry:
;
; Check that there are more entries to do
;
cmp di, size DependencyListHeader
jne entryLoop ; Branch if there are more to do
;
; We are all done with this block. There may be more.
;
mov di, es:[bx] ; es:di <- ptr to start of block
mov dx, es:[di].DLH_next.segment
mov di, es:[di].DLH_next.offset
pop bx ; Restore the file handle
call DBUnlock ; Release this block
jmp blockLoop ; Branch to process the next block
quit:
pop bx ; bx <- handle of cell block passed in
call MemDerefES ; es <- segment address of block
.leave
ret
abort:
add sp, 2 ; Discard callback pointer from the stack
pop bx ; Restore the file handle
call DBUnlock ; Release the block
stc ; Signal: abort
jmp quit ; Branch, returning ax
ForeachDependency endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a cell list for recalculation and other purposes.
CALLED BY: RecalcDependents, UpdateNameDependents
PASS: ds:si = Spreadsheet instance
ax,cx = Row,Column of the cell to start with
bx = Callback routine for adding dependencies/precedents
Currently you should use either:
AppendDependentsToCellList
AppendNamePrecedentsToCellList
RETURN: bx = Handle to the end of the cell list
al = Cumulative CellListEntryFlags.
CLEF_PART_CIRCULARITY set if there was a circularity
in there somewhere.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
These routines modify the CC_recalcFlags field of the cell
by setting the CRF_IN_FINAL_LIST bit. It is the responsibility
of the caller to make sure that the CRF_IN_FINAL_LIST is
cleared before any recalculation takes place. This is usually
done in the callback supplied to ForeachCellListEntry().
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateCellListParams struct
;
; These should all be set before the call to CreateCellListFromChildList()
;
CCLP_moreCallback word ; Callback to add dependencies or precedents
;
; These are all set by CreateCellListFromChildList()
;
CCLP_childList word ; Block handle at the end of the children list
CCLP_ancestorList word ; Block handle at the end of the ancestor list
CCLP_finalList word ; Block handle at the end of the final list
CCLP_count dword ; # of cells on the final list
CCLP_flags CellListEntryFlags
align word
CreateCellListParams ends
CreateCellList proc near
uses cx
params local CreateCellListParams
.enter
EC < call ECCheckInstancePtr ;>
;
; Initialize the parameters.
;
mov ss:params.CCLP_moreCallback, bx
;
; First we allocate the child list.
;
call AllocChildList ; bx <- handle of empty cell list
;
; Put the starting cell onto the child list.
; Set the flags associated with the first cell (ax/cl)
; bx holds the tempList handle
;
clr ch ; No flags for the cell
call PushCellListEntry ; Push ax/cx onto the list
; bx <- new childList block
;
; Now starting with the child list, create the new cell list.
;
call CreateCellListFromChildList
.leave
ret
CreateCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateCellListFromChildList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Given a child list, create the cell list.
CALLED BY: CreateCellList, ManualRecalc
PASS: bx = Block handle of the last block in the list
ss:bp = Pointer to inheritable CreateCellListParams
ds:si = Spreadsheet instance
RETURN: al = Cumulative CellListEntryFlags.
CLEF_PART_CIRCULARITY set if there was a circularity
in there somewhere.
bx = Block and offset to the end of the final cell list
child list is free'd
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
AncestorList = {}
FinalList = {}
while (not empty(ChildList)) {
cell = Pop(ChildList) /* Move cell to ancestor list */
if (cell == marker) then {
cell = Pop(AncestorList) /* Move cell to recalc list */
cell.flags &= ! inParentList /* No longer a parent */
cell.flags |= inFinalList /* Now in the final list */
Push(cell, FinalList)
} else if (cell.flags & inParentList) {
MarkCircularities() /* Found a circularity */
} else if (cell.flags & inFinalList) {
/*
* Do nothing. We've already found a deeper entry for this
* cell so we can totally disregard this entry.
*/
} else {
Push(cell, AncestorList)
cell.flags |= inParentList
Push(marker, ChildList) /* Mark start of children */
foreach dependency of cell { /* Add dependencies */
Push(dependency, ChildList)
}
}
}
KNOWN BUGS/SIDE EFFECTS/IDEAS:
These routines modify the CC_recalcFlags field of the cell
by setting the CRF_IN_FINAL_LIST bit. It is the responsibility
of the caller to make sure that the CRF_IN_FINAL_LIST is
cleared before any recalculation takes place. This is usually
done in the callback supplied to ForeachCellListEntry().
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateCellListFromChildList proc near
uses cx, dx, es, di
params local CreateCellListParams
.enter inherit
EC < call ECCheckInstancePtr ;>
;
; Save the childList handle/offset.
;
mov params.CCLP_childList, bx
;
; Allocate the ancestorList and the finalList.
;
push bx ; Save end of child list
call AllocAncestorList ; bx <- handle of ancestorList
mov params.CCLP_ancestorList, bx
call AllocFinalList ; bx <- handle of finalList
mov params.CCLP_finalList, bx
pop bx ; Restore end of child list
mov params.CCLP_flags, 0 ; No circularities yet...
mov params.CCLP_count.high,0
mov params.CCLP_count.low, 0
moveLoop:
;
; Copy the entry from the temporary list to the cell list
;
; ss:bp = CreateCellListParams
; bx = Block at the end of the child list
; ds:si = Spreadsheet instance
;
; es:di - will be used as a cell data pointer
; dl - will be used to hold the cell flags
; ax/cl - will hold the cell row/column
; ch - will hold the flags
;
;
; Get the next child list entry.
;
call PopCellListEntry ; ax/cx <- child list entry
; bx updated
jc noMoreEntries ; Branch if no more entries
;
; Check for a marker. This indicates that we have no more children for
; the cell on the parent list. We want to copy the cell on the parent
; list onto the final list.
;
test ch, mask CLEF_MARKER ; Check for found a marker
jnz copyToFinalList ; Branch to copy the cell
;
; The entry isn't a marker. We want to lock the cell and check the
; flags.
;
call LockCell ; es:di <- cell ptr
jnc cellDoesNotExist ; Branch if cell doesn't exist
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
mov dl, es:[di].CC_recalcFlags
;
; Check for the cell being an ancestor of itself. We figure this out
; by finding out if the cell is already in the parent list.
;
test dl, mask CRF_IN_PARENT_LIST
jnz markCircularities ; Branch if it's an ancestor of itself
;
; The cell isn't in the parent list. Check to see if it's in the
; final list already. If it is then the entry in the final list is
; "deeper" than the current entry so we can totally ignore this
; entry.
test dl, mask CRF_IN_FINAL_LIST
jnz unlockAndLoop ; Branch if in final list already
;
; We want to add the cell to the ancestor list and mark it as being
; in that list.
;
call PushOnAncestorList ; Add it to the ancestor list
or es:[di].CC_recalcFlags, mask CRF_IN_PARENT_LIST
mov ch, mask CLEF_MARKER ; Push a marker...
call PushCellListEntry ; Onto the child list
;
; Now we add the descendants of the current entry.
;
call params.CCLP_moreCallback
unlockAndLoop:
call UnlockAndDirtyCell ; Release the cell
jmp moveLoop ; Loop to process next cell
noMoreEntries:
;
; Now we need to free up the childList and the ancestorList
; ds:si = Spreadsheet instance
;
call FreeAncestorList ; Free ancestor list
call FreeChildList ; Free child list
;
; We need to return the block/offset to the end of the list.
;
mov bx, params.CCLP_finalList
mov al, params.CCLP_flags
.leave
ret
copyToFinalList:
;
; Copy the cell that was pop'd onto the final list.
;
call PopFromAncestorList ; Remove cell from ancestor list
;
; Lock the cell and set the flags correctly.
;
call LockCell ; es:di <- cell pointer
EC < ERROR_NC CELL_DOES_NOT_EXIST >
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
and es:[di].CC_recalcFlags, not mask CRF_IN_PARENT_LIST
or es:[di].CC_recalcFlags, mask CRF_IN_FINAL_LIST
;
; Add the cell to the final-list and increment the count of entries on
; that list.
;
call PushOnFinalList ; Add cell to final list
jmp unlockAndLoop ; Branch to release the cell and loop
markCircularities:
;
; The cell is part of a circularity.
;
mov params.CCLP_flags, mask CLEF_PART_CIRCULARITY
call MarkCircularities ; Mark the entries as circularities
jmp unlockAndLoop
cellDoesNotExist:
;
; The cell doesn't exist. This can only happen if the cell is part
; of the root of the final list. In that case, just move the cell
; over to the finalList. We don't need to worry about running into
; it again since it's at the root and doesn't really exist...
;
call PushOnFinalList ; Move it to the final list
jmp moveLoop ; Loop to do the next one
CreateCellListFromChildList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Lock a cell (it must exist).
CALLED BY: CreateCellListFromChildList
PASS: ax = Row
cl = Column
ds:si = ptr to CellFunctionParameters
RETURN: carry set if the cell exists
es:di = Pointer to the cell data
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockCell proc near
uses cx
.enter
;
; The parameter block holds the spreadsheet instance.
;
clr ch ; cx <- column
SpreadsheetCellLock ; *es:di <- cell data
jnc quit ; Branch if cell doesn't exist
mov di, es:[di] ; es:di <- ptr to cell data
quit:
.leave
ret
LockCell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UnlockAndDirtyCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Unlock the cell and dirty it.
CALLED BY: CreateCellListFromChildList
PASS: es = Segment address of the cell data
ds:si = ptr to CellFunctionParameters
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UnlockAndDirtyCell proc near
.enter
;
; The parameter block holds the spreadsheet instance.
;
SpreadsheetCellDirty ; Dirty the cell
SpreadsheetCellUnlock ; Unlock the cell
.leave
ret
UnlockAndDirtyCell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PushOnAncestorList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Push a cell (and flags) onto the ancestor list
CALLED BY: CreateCellListFromChildList
PASS: ss:bp = Pointer to inheritable CreateCellListParams
ax = Row
cl = Column
ch = Flags
RETURN: CCLP_ancestorList updated
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PushOnAncestorList proc near
uses bx
params local CreateCellListParams
.enter inherit
mov bx, params.CCLP_ancestorList
call PushCellListEntry ; Push the entry
mov params.CCLP_ancestorList, bx
.leave
ret
PushOnAncestorList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PopFromAncestorList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pop a cell (and flags) from the ancestor list
CALLED BY: CreateCellListFromChildList
PASS: ss:bp = Pointer to inheritable CreateCellListParams
RETURN: ax = Row
cl = Column
ch = Flags
CCLP_ancestorList updated
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PopFromAncestorList proc near
uses bx
params local CreateCellListParams
.enter inherit
mov bx, params.CCLP_ancestorList
call PopCellListEntry ; Pop the entry
mov params.CCLP_ancestorList, bx
.leave
ret
PopFromAncestorList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PushOnFinalList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Push a cell (and flags) onto the final list
CALLED BY: CreateCellListFromChildList
PASS: ss:bp = Pointer to inheritable CreateCellListParams
ax = Row
cl = Column
ch = Flags
RETURN: CCLP_finalList, CCLP_count updated
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PushOnFinalList proc near
uses bx
params local CreateCellListParams
.enter inherit
mov bx, params.CCLP_finalList
call PushCellListEntry ; Push the entry
mov params.CCLP_finalList, bx
;
; Increment the count of cells in the final list. This is a dword
; value.
;
inc params.CCLP_count.low ; One more cell on final list
jnz quit ; Branch if low word is zero
inc params.CCLP_count.high
quit:
.leave
ret
PushOnFinalList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MarkCircularities
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Mark entries in the ancestor list as being part of a
circularity.
CALLED BY: CreateCellListFromChildList
PASS: ss:bp = Inheritable CreateCellListParams
ax = Row of cell that is a circularity
cl = Column of cell that is a circularity
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
list = Lock( parentList )
loop:
list.offset.flags |= mask CLEF_PART_CIRCULARITY
if (list.offset.row != row || list.offset.column != column) then
PreviousEntry( list, offset )
goto loop
endif
Unlock( list )
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MarkCircularities proc near
uses bx, si, ds
params local CreateCellListParams
.enter inherit
;
; Lock down the end of the ancestor list
;
push ax ; Save row
mov bx, params.CCLP_ancestorList
call MemLock ; Lock the ancestor list
mov ds, ax ; ds <- seg address of ancestor list
pop ax ; Restore row
mov si, ds:CLH_endOfData ; ds:si <- ptr past end of block
sub si, size CellListEntry ; ds:si <- ptr to last entry
markLoop:
;
; ds:si = Last ancestor list entry
; bx = Block handle of ds
;
EC < call ECCheckPointer >
or ds:[si].CLE_flags, mask CLEF_PART_CIRCULARITY
cmp ds:[si].CLE_row, ax ; Check for same row
jne prevEntry ; Branch if not same row
cmp ds:[si].CLE_column, cl ; Check for same column
je done ; Branch if we've marked the loop
prevEntry:
call PreviousEntry ; Move to the previous entry
jmp markLoop ; Loop to process it
done:
call MemUnlock ; Release the list
.leave
ret
MarkCircularities endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocChildList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate a list block for the childList.
CALLED BY: ManualRecalcSetup, CreateCellList
PASS: ds:si = Spreadsheet instance
RETURN: bx = Block handle of first block of child list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocChildList proc near
class SpreadsheetClass
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_childList ; bx <- cached childList block
call CheckAndAllocListBlock ; bx <- block to use
mov ds:[si].SSI_childList, bx ; Save block to use
ret
AllocChildList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocAncestorList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate a list block for the ancestorList
CALLED BY: CreateCellListFromChildList
PASS: ds:si = Spreadsheet instance
RETURN: bx = Block handle of first block of ancestor list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocAncestorList proc near
class SpreadsheetClass
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_ancestorList ; bx <- cached ancestorList block
call CheckAndAllocListBlock ; bx <- block to use
mov ds:[si].SSI_ancestorList, bx ; Save block to use
ret
AllocAncestorList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocFinalList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate a list block for the finalList
CALLED BY: CreateCellListFromChildList
PASS: ds:si = Spreadsheet instance
RETURN: bx = Block handle of first block of final list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocFinalList proc near
class SpreadsheetClass
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_finalList ; bx <- cached finalList block
call CheckAndAllocListBlock ; bx <- block to use
mov ds:[si].SSI_finalList, bx ; Save block to use
ret
AllocFinalList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckAndAllocListBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check on a cached block and allocate a new one if the old
one is discarded (or never existed).
CALLED BY: AllocChildList, AllocAncestorList, AllocFinalList
PASS: bx = Cached block handle
RETURN: bx = Block handle to use
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckAndAllocListBlock proc near
uses ax
.enter
tst bx ; Check for cached block
jz noHandle ; Branch if there is no block
;
; We have a handle, but that doesn't mean that the block still
; exists. It might have been discarded. The only good way to tell
; is to call MemLock.
;
if ERROR_CHECK
; The MemLock approach is not working for error checking situation
; because the EC will fatal first for discarded block
mov ax, MGIT_ADDRESS
call MemGetInfo
tst ax
jz discarded
endif
call MemLock ; ax <- segment address
jc discarded ; Branch if block is discarded
;
; The block exists and we have it locked. We want to make it
; non-discardable before we unlock it.
;
clr al ; No bits to set
mov ah, mask HF_DISCARDABLE ; Bits to clear
call MemModifyFlags ; Change the flags
call MemUnlock ; Release the block
quit:
.leave
ret
discarded:
;
; The handle exists but the block is discarded. Free up this handle
; and fall thru to allocate a new one.
;
call MemFree ; Free old handle
;;; Fall thru
noHandle:
;
; There was no block, make one and cache it.
;
call AllocEmptyCellList ; bx <- new list
jmp quit ; Branch, we have the block
CheckAndAllocListBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocEmptyCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create an empty cell list
CALLED BY: CreateCellList, CreateCellListFromChildList
PASS: nothing
RETURN: bx = Block handle of the new cell list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocEmptyCellList proc near
uses ax, cx, ds
.enter
mov ax, size CellListHeader ; ax <- size
add ax, CELL_LIST_INCREMENT ; Add size for many entries
mov cl, mask HF_SWAPABLE
mov ch, mask HAF_NO_ERR or mask HAF_LOCK
call MemAlloc ; bx <- block handle
; ax <- segment address of the block
mov ds, ax ; ds <- segment address
mov ds:CLH_blockSize, size CellListHeader + CELL_LIST_INCREMENT
mov ds:CLH_endOfData, size CellListHeader
mov ds:CLH_prev, 0 ; No previous block
mov ds:CLH_next, 0 ; No next block
call MemUnlock ; Release the block
.leave
ret
AllocEmptyCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PushCellListEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a CellListEntry to the end of a cell list
CALLED BY: CreateCellList
PASS: bx = Last block of list to add to
ax = Row
cl = Column
ch = Flags
RETURN: bx = Last block of list we added to
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PushCellListEntry proc near
uses ds
.enter
push ax ; Save the row
call MemLock ; Lock the recalc list
mov ds, ax ; ds:si <- ptr to list
pop ax ; Restore the row
call PushCellListLocked ; Push the cell
call MemUnlock ; Release the block
.leave
ret
PushCellListEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PushCellListLocked
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a cell to a list that is already locked.
CALLED BY: PushCellListEntry
PASS: ds = Segment address of the block
bx = Handle of the block
ax = Row
cl = Column
ch = Flags
RETURN: ds = New address of the block
bx = New handle of the block
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PushCellListLocked proc near
uses si
.enter
EC < call ECCheckCellListHeader >
mov si, ds:CLH_endOfData ; si <- offset past end of data
cmp si, ds:CLH_blockSize ; Check for past end of block
jb gotPointer ; Branch if not past end
;
; The pointer is past the end of the block, we need to make the block
; bigger if that's possible.
;
cmp si, MAX_CELL_LIST_BLOCK_SIZE
jbe extendBlock
;
; The block is already too large, we need to actually extend the
; list by adding a new block.
;
push ax, cx ; Save row, column, flags
mov cx, bx ; cx <- current cell list block
call AllocEmptyCellList ; bx <- new cell list block
;
; Now link the old block and new blocks together.
; bx = Handle of the new block
; cx = Handle of the old block
; ds = Segment address of the old block
;
mov ds:CLH_next, bx ; Save link to next block
xchg bx, cx ; bx <- old block, cx <- new block
call MemUnlock ; Release the current block
xchg bx, cx ; bx <- new block, cx <- old block
call MemLock ; ax <- segment address of new block
mov ds, ax ; ds <- segment address of new block
mov ds:CLH_prev, cx ; Save link to previous block
mov si, size CellListHeader ; si <- offset to insert at
pop ax, cx ; Restore row, column, flags
jmp gotPointer ; Branch to add data
extendBlock:
;
; Extend the block by realloc'ing it larger.
; bx = Block handle
; si = Size of the block
; ds = Segment address of the block
;
push ax, cx ; Save row, column, flags
mov ax, si ; ax <- old size
add ax, CELL_LIST_INCREMENT ; ax <- new size
mov ch, mask HAF_NO_ERR ; Just do it
call MemReAlloc ; ax <- new segment address
mov ds, ax ; ds <- new segment address
add ds:CLH_blockSize, CELL_LIST_INCREMENT
pop ax, cx ; Restore row, column, flags
gotPointer:
;
; We have a pointer to the place to put the data.
;
; ds:si = Pointer to place to put the result
; bx = Block handle
; ax = Row
; cl = Column
; ch = Flags
;
EC < call ECCheckCellListHeader >
EC < call ECCheckPointer >
mov ds:[si].CLE_row, ax
mov ds:[si].CLE_column, cl
mov ds:[si].CLE_flags, ch
add si, size CellListEntry ; Advance the pointer
mov ds:CLH_endOfData, si
.leave
ret
PushCellListLocked endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PopCellListEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pop a cell list entry from a cell list.
CALLED BY: MoveCellListEntry
PASS: bx = Block handle of the last block in the list
RETURN: carry set if there are no entries to pop, clear otherwise
bx = Block handle of the last block in the list
ax = Row
cl = Column
ch = Flags
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PopCellListEntry proc near
uses ds, si
.enter
call MemLock ; Lock the block
mov ds, ax ; ds <- segment address of list
mov si, ds:CLH_endOfData ; ds:si <- ptr past the entry
EC < call ECCheckCellListHeader >
cmp si, size CellListHeader ; Check for at start of block
ja gotPointer ; Branch if we have entries to get
;
; We are at the start of a block. We need to get the previous block.
;
mov ax, ds:CLH_prev ; ax <- previous block
;
; Check for no previous block
;
tst ax ; If no previous block
jz quitNoMoreEntries ; Branch if no more
;
; There are more entries in the previous block.
;
call MemFree ; Free the current block (locked)
mov bx, ax ; bx <- block handle
call MemLock ; Lock the new block
mov ds, ax ; ds <- segment address of that block
mov ds:CLH_next, 0 ; Nuke the "next" link
mov si, ds:CLH_blockSize ; ds:si <- ptr past the last entry
gotPointer:
;
; ds:si = Pointer past the entry to get
;
sub si, size CellListEntry
mov ds:CLH_endOfData, si
EC < call ECCheckPointer >
mov ax, ds:[si].CLE_row ; ax <- row
mov cl, ds:[si].CLE_column ; cl <- column
mov ch, ds:[si].CLE_flags ; ch <- flags
clc ; Signal: Got an entry
quit:
;
; bx = block handle of the block to unlock.
; carry set correctly for return.
;
call MemUnlock ; Release the block
.leave
ret
quitNoMoreEntries:
stc ; Signal: no more entries
jmp quit ; Branch to unlock the block
PopCellListEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AppendDependentsToCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Append the dependencies for a cell to a list
CALLED BY: CreateCellListFromChildList
PASS: ax/cl = Cell
es:di = Cell pointer
bx = Block handle of the last list block
ds:si = Pointer to spreadsheet instance
RETURN: bx = Block handle of last block in the list
si = Offset to end of the list block
DESTROYED: dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AddDepsParams struct
ADP_block word ; The block to add to
AddDepsParams ends
AppendDependentsToCellList proc near
uses ax, cx, es, di
params local AddDepsParams
.enter
EC < call ECCheckInstancePtr ;>
;
; Save the block/offset to pass on the stack to the callback routine.
;
mov params.ADP_block, bx ; Save the current block
mov ax, offset cs:AddDepsCallback
;
; ds:si = Spreadsheet instance
; es:di = Pointer to the cell data
; ax = Callback
; bp = Pointer to parameters: block/offset
;
call ForeachDependency
mov bx, params.ADP_block ; bx <- block to return
.leave
ret
AppendDependentsToCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AppendNameDependentsToCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Append the dependencies for a name cell to a list
CALLED BY: CreateCellListFromChildList
PASS: ax/cl = Cell
bx = Block handle of the last list block
ds:si = Pointer to spreadsheet instance
RETURN: bx = Block handle of last block in the list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AppendNameDependentsToCellList proc near
EC < call ECCheckInstancePtr ;>
cmp ax, NAME_ROW ; Check for cell is a name
jne quit ; Branch if it isn't
;
; It's a name, add the dependents.
;
call AppendDependentsToCellList
quit:
ret
AppendNameDependentsToCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AddDepsCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a single dependency to a list.
CALLED BY: AppendDependentsToCellList via ForeachDependency
PASS: dx = Row of the cell
cx = Column of the cell
*es:bx = Pointer to dependeny list block
di = Offset into the block for this entry
RETURN: carry clear always
params.ADP_block updated
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Remember, entries are added last to first. The first call to this
routine is for the last dependent. The last call to this routine is
for the first dependent.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AddDepsCallback proc near
uses ax, bx, cx, si
params local AddDepsParams
.enter inherit
clr ch ; No flags
; cl holds the column
mov ax, dx ; ax <- row
mov bx, params.ADP_block ; bx <- block
call PushCellListEntry ; Add the entry
mov params.ADP_block, bx ; Save new block
clc ; Signal: continue processing
.leave
ret
AddDepsCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AppendNamePrecedentsToCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Append the name precedents for a cell to a list
CALLED BY: CreateCellListFromChildList
PASS: ax/cl = Cell
bx = Block handle of the last list block
ds:si = Pointer to spreadsheet instance
RETURN: bx = Block handle of last block in the list
DESTROYED: dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AppendNamePrecedentsToCellList proc near
uses ax, cx, di, bp, ds, es
.enter
EC < call ECCheckInstancePtr ;>
clr ch ; cx <- Column
;
; Create the stack frame for making the precedents list.
;
push bx ; Save block handle of list block
sub sp, size PCT_vars ; Make space to create precedents list
mov bp, sp ; ss:bp <- ptr to frame
call SpreadsheetInitCommonParams
;
; We want all precedents.
;
mov ss:[bp].EP_flags, mask EF_MAKE_DEPENDENCIES or \
mask EF_ONLY_NAMES
call CreatePrecedentList ; bx <- handle of precedents list
lahf ; Save "no precedents" flag (carry)
add sp, size PCT_vars ; Restore the stack frame
sahf ; Restore "no precedents" flag (carry)
pop bp ; Restore block handle
;
; Carry is set if there is a precedents list.
;
jnc quit ; Quit if no precedents list
;
; Take the precedents list and add the entries to the temporary list.
; ds:si = Spreadsheet instance
;
; bp = Block handle of the cell list
; dx = Offset into the cell list block
;
; bx = Block handle of the precedents list (all entries are names)
;
push bx ; Save block handle
call MemLock ; ds <- segment address of precedents
mov ds, ax
mov di, size DependencyBlock; ds:di <- ptr to dependency block
mov bx, bp ; bx <- block handle of cell list
;
; Find a name entry (anywhere).
;
sub di, size EvalRangeData+1; ds:di <- offset to previous item
; (actually there isn't one, but this
; works for NextNameEntry()).
call NextNameEntry ; di <- next name entry
jc endLoop ; Branch if no more names
findNextName:
;
; bx = Block.offset of temporary list
; ds:di = Pointer to current entry in the precedents list
;
mov ax, NAME_ROW ; ax/cl = Row/column
mov cl, {byte} ds:[di+1].END_name
clr ch ; No flags
call NextNameEntry ; ds:di <- next name entry
pushf ; Save "no more names" flag
;
; ax = Row
; cl = Column
; ch = Flags for this entry
; bx = Block.offset into the cell list
; ds:di = Pointer to next name entry in the precedents list
;
call PushCellListEntry ; Put the entry on the cell list
popf ; Restore "no more names" flag
jnc findNextName ; Loop to process it
endLoop:
mov bp, bx ; bp <- block handle
;
; We're all done adding the entries. Clean up and escape.
;
pop bx ; bx <- precedents list
call MemFree ; Free up the precedents list (locked)
quit:
mov bx, bp ; bx <- block to return
.leave
ret
AppendNamePrecedentsToCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NextNameEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move to the next name entry.
CALLED BY: AppendNamePrecedentsToCellList
PASS: ds:di = Pointer to current list entry.
RETURN: ds:di = Pointer to next entry that is a name
carry set if there are no more entries
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
NextNameEntry proc near
uses ax
.enter
nextLoop:
add di, size EvalRangeData+1; Move to next entry
cmp di, ds:DB_size ; Check for past the end
je noMoreNames ; Branch if no more names
mov al, {byte} ds:[di]
and al, ESAT_NAME
cmp al, ESAT_NAME ; Check for found a name
jne nextLoop ; Branch if not a name
;
; Carry is clear here because the "equal" condition was met.
;
quit:
.leave
ret
noMoreNames:
stc ; Signal: No more names
jmp quit
NextNameEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateNamePrecedentsListForSelection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a name precedents list for the current selection.
CALLED BY:
PASS: ds:si = Spreadsheet instance
RETURN: bx = Block handle containing the name info for all names
referenced directly or otherwise by the cells in the
curent selection
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateNamePrecedentsListForSelectionFar proc far
call CreateNamePrecedentsListForSelection
ret
CreateNamePrecedentsListForSelectionFar endp
CreateNamePrecedentsListForSelection proc near
class SpreadsheetClass
uses ax
localVars local ManualRecalcVars
.enter
EC < call ECCheckInstancePtr ;>
mov ax, ds:[si].SSI_selected.CR_start.CR_row
mov localVars.MRV_rangeParams.REP_bounds.R_top, ax
mov ax, ds:[si].SSI_selected.CR_end.CR_row
mov localVars.MRV_rangeParams.REP_bounds.R_bottom, ax
mov ax, ds:[si].SSI_selected.CR_start.CR_column
mov localVars.MRV_rangeParams.REP_bounds.R_left, ax
mov ax, ds:[si].SSI_selected.CR_end.CR_column
mov localVars.MRV_rangeParams.REP_bounds.R_right, ax
call CreateNamePrecedentsList
.leave
ret
CreateNamePrecedentsListForSelection endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateNamePrecedentsList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a list of all the names which are precedents of the
cells in a given range.
CALLED BY: CreateNamePrecedentsListForSelection
PASS: ds:si = Spreadsheet instance
ss:bp = Pointer to inheritable ManualRecalcVars with:
MRV_rangeParams.REP_bounds set
RETURN: bx = Block handle containing the name info for all names
referenced directly or otherwise by the cells in the
range.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateNamePrecedentsList proc near
uses ax, cx
localVars local ManualRecalcVars
.enter inherit
EC < call ECCheckInstancePtr ;>
push bp ; Save frame ptr
;
; Setup the stack frame.
;
call ManualRecalcSetup ; Setup the stack frame
;
; Now create the cell list.
;
; bp = Local variables
; ds:si = Spreadsheet instance
;
mov bx, localVars.MRV_tempListBlock
;
; Create stack frame.
;
push bp ; Save frame ptr
sub sp, size CreateCellListParams
mov bp, sp ; ss:bp <- ptr to parameters
;
; Initialize it.
;
mov ss:[bp].CCLP_moreCallback, \
offset cs:AppendNamePrecedentsToCellList
;
; Set ss:bp to point at the top of it.
;
add bp, size CreateCellListParams
call CreateCellListFromChildList
; bx <- end of cell list
mov sp, bp ; Restore stack
pop bp ; Restore frame ptr
;
; Now process the entries.
;
mov ax, offset cs:CreateNameListCallback
clr bp ; bp <- block handle of name list
call ForeachCellListEntry
;
; Free up the cell list and leave.
;
call FreeFinalList ; Free up the cell list
mov bx, bp ; bx <- block handle of name list
pop bp ; Restore frame ptr
.leave
ret
CreateNamePrecedentsList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateNameListCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for each entry in the name cell list
CALLED BY: CreateNamePrecedentsList via ForeachCellListEntry
PASS: dx = Row
cl = Column
ch = Flags
ds:si = Spreadsheet instance
bp = Block handle of the name list block
RETURN: carry clear always
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateNameListCallback proc near
.enter
EC < call ECCheckInstancePtr ;>
cmp dx, NAME_ROW ; Check for name entry
jne quit ; Branch if not a name
;
; Not only is it a name, but it's an original name.
;
call AddNameToNameList ; Add the name
quit:
;
; CreateCellListFromChildList() has marked the cell with
; CRF_IN_FINAL_LIST. Normally, this is cleared during recalculation,
; but since this routine is not for generating a recalculation list,
; the flag will never be cleared. So we do it here, because leaving
; the flag set is a bad thing.
;
push ax, es, di
mov ax, dx ; ax <- row #
call LockCell
EC < ERROR_NC CELL_DOES_NOT_EXIST >
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
if _PROTECT_CELL
;
; For cell protection, we don't want to clear the protection bit.
;
andnf es:[di].CC_recalcFlags, (not (mask CellRecalcFlags)) or mask CRF_PROTECTION
else
andnf es:[di].CC_recalcFlags, (not (mask CellRecalcFlags)) or mask CRF_RESERVED
endif
call UnlockAndDirtyCell
pop ax, es, di
clc ; Signal: Continue
.leave
ret
CreateNameListCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AddNameToNameList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a name to the name list
CALLED BY: CreateNameListCallback
PASS: bp = Block handle of the name list (0 for none)
cl = Column of the name
ds:si = Spreadsheet instance
RETURN: bp = Block handle of the name list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AddNameToNameList proc near
uses ax, bx, cx, dx, di, si, ds, es
.enter
EC < call ECCheckInstancePtr ;>
mov bx, bp ; bx <- block handle of name list
;
; Allocate a stack frame and get the information we need.
;
sub sp, size SpreadsheetNameParameters
mov bp, sp ; ss:bp <- frame ptr
mov ss:[bp].SNP_flags, mask NAF_NAME or \
mask NAF_DEFINITION or \
mask NAF_BY_TOKEN or \
mask NAF_TOKEN_DEFINITION
clr ch ; cx <- entry
mov ss:[bp].SNP_listEntry, cx
mov dx, cx ; dx <- token
push bp, bx, dx ; Save frame ptr, block handle, token
mov dx, ss
mov di, si ; ds:di <- ptr to spreadsheet instance
call SpreadsheetGetNameInfo ; Destroys everything
pop bp, bx, dx ; Restore frame ptr, block handle, token
;
; Now that we have the information we need, figure out how large it
; all is.
;
mov cx, ss:[bp].SNP_textLength
DBCS< shl cx, 1 ; cx <- size of name >
add cx, ss:[bp].SNP_defLength
add cx, size NameListEntry ; cx <- total new size needed
tst bx ; Check for no name list yet
jz makeNameList ; Branch if there is none
gotNameList:
;
; We've got the name list, check for enough space in the block.
; bx = Block handle of the name list
; cx = Additional space we need (size)
; dx = Token
;
call MemLock ; ds <- segment address of the bloc
mov ds, ax
mov si, ds:NLH_endOfData ; ds:si <- ptr to end of the block
add cx, si ; cx <- offset after adding the data
cmp cx, ds:NLH_blockSize ; Check for no space here
jae expandNameList ; Branch if no space
gotSpace:
;
; The block is large enough.
;
; bx = Block handle of the name list block
; cx = Offset past end of data
; dx = Token
; ds:si = Pointer to place to put the data
; ss:bp = Pointer to SpreadsheetNameParameters
;
mov ds:NLH_endOfData, cx ; Update end of data
segmov es, ds, di ; es:di <- ptr to the dest
mov di, si
mov ax, dx ; Save the token
stosw
mov al, ss:[bp].SNP_nameFlags
stosw ; Save the flags (*yes*, as a word)
mov ax, ss:[bp].SNP_textLength
stosw ; Save the text length
mov ax, ss:[bp].SNP_defLength
stosw ; Save the definition length
;
; Copy the text.
;
segmov ds, ss, si ; ds:si <- ptr to source
lea si, ss:[bp].SNP_text
mov cx, ss:[bp].SNP_textLength
LocalCopyNString ; Copy the text of the name
;
; Copy the definition.
;
lea si, ss:[bp].SNP_definition
mov cx, ss:[bp].SNP_defLength
rep movsb ; Copy the definition (bytes)
;
; Release the name list block and cleanup.
;
call MemUnlock ; Release the name list block
add sp, size SpreadsheetNameParameters
mov bp, bx ; Return block handle in bp
.leave
ret
makeNameList:
;
; The name-list doesn't exist. Create one.
;
push cx ; Save space for this name
mov ax, size NameListHeader + NAME_LIST_INCREMENT
clr cl
mov ch, mask HAF_NO_ERR or mask HAF_LOCK
call MemAlloc ; bx <- block handle
mov ds, ax
mov ds:NLH_blockSize, size NameListHeader + NAME_LIST_INCREMENT
mov ds:NLH_endOfData, size NameListHeader
call MemUnlock ; Release the block
pop cx ; Restore space for this name
jmp gotNameList
expandNameList:
;
; cx = Offset to new end of the block
;
push cx ; Save offset
mov ax, cx
add ax, NAME_LIST_INCREMENT
mov ch, mask HAF_NO_ERR ; Just do it
call MemReAlloc ; ax <- new segment address
mov ds, ax
add ds:NLH_blockSize, NAME_LIST_INCREMENT
pop cx ; Restore offset
jmp gotSpace
AddNameToNameList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreatePrecedentList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a list of precedents for a given cell.
CALLED BY: CellAddRemoveDeps, AppendNamePrecedentsToCellList
PASS: ds:si = Spreadsheet instance
ss:bp = Initialized PCT_vars structure
EP_flags initialized
ax = Row
cx = Column
RETURN: carry set if the cell has precedents
bx = Block handle of the locked precedents list
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 8/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreatePrecedentList proc far
uses ax, cx, dx, es, di
.enter
EC < call ECCheckInstancePtr ;>
SpreadsheetCellLock ; *es:di <- ptr to cell
jnc quitNoDependents ; Quit if no cell definition
mov di, es:[di] ; es:di <- ptr to cell
;
; Make sure the cell is a formula. If it's not, just quit.
;
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
cmp es:[di].CC_type, CT_DISPLAY_FORMULA
je hasPrecedents ; Branch if is a display formula
cmp es:[di].CC_type, CT_CHART
je hasPrecedents
cmp es:[di].CC_type, CT_FORMULA
jne unlockNoDependents ; Branch if not a formula
hasPrecedents:
;
; The cell is a formula of some type, so it does have precedents.
;
add di, CF_formula ; es:di <- ptr to the formula
;
; First generate dependencies.
;
; ds:si = Spreadsheet instance
; es:di = Pointer to cell formula
;
push ds, si, es ; Save instance ptr, segment of cell
segmov ds, es, ax ; ds:si <- ptr to formula
mov si, di
segmov es, ss, ax ; es:di <- ptr to eval scratch buffer
lea di, ss:[bp].PCTV_evalBuffer
mov cx, PARSE_TEXT_BUFFER_SIZE
call ParserEvalExpression ; Make a dependency block
ERROR_C UNABLE_TO_CREATE_PRECEDENTS_LIST
pop ds, si, es ; Restore instance ptr, segment of cell
;
; ds:si = Spreadsheet instance
; es = Segment address of the cell data
;
SpreadsheetCellUnlock ; Unlock the cell data
;
; There was no error.
; EP_depHandle holds the block handle of the dependencies.
;
mov bx, ss:[bp].EP_depHandle
tst bx ; Check for no dependencies
jz quitNoDependents ; Branch if none
stc ; Signal: has dependents
quit:
.leave
ret
unlockNoDependents:
;
; The cell isn't a formula so it can't generate any dependents.
;
SpreadsheetCellUnlock ; release the cell
quitNoDependents:
clc ; Signal: no dependents
jmp quit ; Quit now.
CreatePrecedentList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FreeChildList, FreeAncestorList, FreeFinalList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Free up the child list.
CALLED BY: CreateCellListFromChildList
PASS: ds:si = Spreadsheet instance
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FreeChildList proc near
class SpreadsheetClass
uses bx
.enter
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_childList ; bx <- first child list block
call FreeCellList
.leave
ret
FreeChildList endp
FreeAncestorList proc near
class SpreadsheetClass
uses bx
.enter
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_ancestorList ; bx <- first ancestor list
call FreeCellList
.leave
ret
FreeAncestorList endp
FreeFinalList proc near
class SpreadsheetClass
uses bx
.enter
EC < call ECCheckInstancePtr ;>
mov bx, ds:[si].SSI_finalList ; bx <- first final list
call FreeCellList
.leave
ret
FreeFinalList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FreeCellList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Free a cell list
CALLED BY: FreeChildList, FreeAncestorList, FreeFinalList
PASS: bx = First block handle of the block list.
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FreeCellList proc near
uses ax, cx, dx, ds
.enter
mov dx, bx ; dx <- first block in the list
call MemLock ; ax <- segment address of the list
mov ds, ax ; ds <- segment address of the list
mov cx, ds:CLH_next ; cx <- next block
;
; Set up the block so that if it doesn't get discarded we will
; actually have something good to work with.
; This means:
; no next block
; end of data is at start of block
;
mov ds:CLH_next, 0 ; No more next block
mov ds:CLH_endOfData, size CellListHeader
call MemUnlock ; Release the first block
blockLoop:
;
; cx = Next block to free up.
;
jcxz done ; Branch if no more
mov bx, cx ; bx <- next block to free
call MemLock ; Lock the block
mov ds, ax ; ds <- segment address of the block
mov cx, ds:CLH_next ; cx <- next block
call MemFree ; free block (locked)
jmp blockLoop ; Loop to nuke the next one
done:
;
; dx = Block handle of the first block in the list
;
mov bx, dx ; bx <- block handle
mov al, mask HF_DISCARDABLE ; Make it discardable
clr ah ; (no flags to clear)
call MemModifyFlags
.leave
ret
FreeCellList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ForeachCellListEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a callback for each entry in the cell list.
CALLED BY: RecalcDependents
PASS: ds:si = Spreadsheet instance
bx = Block at the end of cell list
ax = Address of callback (near routine)
bp = Stack frame to pass to callback
RETURN: carry set if callback aborted
ax = ax returned from callback
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Callback definition should be:
PASS: dx = Row
cl = Column
ch = Flags
ds:si = Spreadsheet instance
ss:bp = Passed stack frame
RETURN: carry set on error
carry clear otherwise
DESTROYED: nothing
KNOWN BUGS/SIDE EFFECTS/IDEAS:
The list is processed in the reverse order (back to front).
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 6/28/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ForeachCellListEntry proc near
uses bx, cx, dx, es, di
.enter
lockBlock:
;
; Get a pointer to the end of the cell list.
;
tst bx ; Check for no block (clears carry)
jz quit ; Branch if no block
push ax ; Save callback
call MemLock ; ax <- segment address of block
mov es, ax ; es <- seg address of block
mov di, es:CLH_endOfData ; es:di <- ptr past data
sub di, size CellListEntry ; es:di <- ptr to last entry in block
pop ax ; Restore callback
entryLoop:
;
; We loop backwards...
;
EC < segxchg ds, es ; ds <- seg addr of cell list >
EC < call ECCheckCellListHeader >
EC < segxchg ds, es ; Restore segments >
cmp di, size CellListHeader ; Check for at start of the block
jae gotEntry ; Branch if not past end
;
; There are no more entries in this block. Release it and move to the
; previous block.
;
mov cx, es:CLH_prev ; cx <- previous block
call MemUnlock ; Release this block
mov bx, cx ; bx <- previous block
jmp lockBlock ; Branch to lock and handle it
gotEntry:
;
; We have an entry.
; es:di = Pointer to the entry
; ds:si = Spreadsheet instance
; ss:bp = Frame ptr
; ax = Callback
; bx = Block handle of current list block
;
EC < call ECCheckPointerESDI >
mov dx, es:[di].CLE_row ; dx <- row
mov cl, es:[di].CLE_column ; cl <- column
mov ch, es:[di].CLE_flags ; ch <- flags
push ax ; Save callback address
call ax ; Call the callback
jc abort ; Branch if callback aborted
pop ax ; Restore callback address
sub di, size CellListEntry ; Move to the next entry
jmp entryLoop ; Loop to handle it
quit:
.leave
ret
abort:
;
; Callback aborted. Unlock the current block.
; The callback address is still on the stack
;
pop cx ; Discard word from the stack
; Preserve ax, it gets returned
call MemUnlock ; Release block (doesn't change flags)
jmp quit ; Branch to finish up.
ForeachCellListEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PreviousEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move to the previous entry in the cell list.
CALLED BY: FindParentGotChildListLocked
PASS: bx = Block handle of the current entry
ds = Segment address of the current entry
si = Offset to the current entry
RETURN: carry set if there is a previous entry
bx = Block handle of the previous entry
ds = Segment address of the previous entry
si = Offset to previous entry
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 1/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PreviousEntry proc near
uses ax
.enter
;
; Check to make sure the block header is intact and that the pointer
; is valid.
;
EC < call ECCheckCellListHeader >
EC < call ECCheckPointer >
cmp si, size CellListHeader ; Check for at start of block
jne gotPointer ; Branch if not at start
;
; We're at the start of a block. We need to lock the previous one.
;
mov ax, ds:CLH_prev ; ax <- previous block handle
tst ax ; Check for no previous block
; Clears the carry
jz quit ; Branch if none
call MemUnlock ; Release the current block
mov bx, ax ; bx <- previous block
call MemLock ; ax <- segment address of block
mov ds, ax ; ds <- segment address of block
mov si, ds:CLH_endOfData ; ds:si <- ptr past end of data
gotPointer:
sub si, size CellListEntry ; Move to previous entry
stc ; Signal: Has previous entry
quit:
.leave
ret
PreviousEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UpdateNameDependents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update the dependents of a name.
CALLED BY: AddRemoveCellDependencies
PASS: ss:bp = PCT_vars
ax = Row of the name
cx = Column of the name
ds:si = Spreadsheet instance
RETURN: nothing
DESTROYED: Parts of the stack frame
PSEUDO CODE/STRATEGY:
- Create a cell list containing the recalc tree rooted at the modified
name whose internal nodes are all names and whose leaves are all
cells.
- For each cell (non name) in the cell list:
Update the dependency lists of that cell
- Free the cell list
- Fixup the stack frame
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UpdateNameDependents proc near
uses ax, bx, dx
.enter
EC < call ECCheckInstancePtr ;>
;
; Create the cell list using our callback as a filter.
;
mov bx, offset cs:AppendNameDependentsToCellList
call CreateCellList ; bx <- end of cell list
;
; Process each cell in the cell list
;
mov ax, offset cs:UpdateNameCallback
call ForeachCellListEntry ; Process the cell list
;
; Free up the cell list and fix up the stack frame.
;
call FreeFinalList ; Free the cell list
.leave
ret
UpdateNameDependents endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UpdateNameCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for processing the cell list.
CALLED BY: UpdateNameDependents via ForeachCellListEntry
PASS: dx = Row
cl = Column
ch = Flags
ds:si = Spreadsheet instance
ss:bp = PCT_vars structure on the stack
RETURN: carry clear always
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UpdateNameCallback proc near
uses ax, cx, dx, es, di
.enter
EC < call ECCheckInstancePtr ;>
mov ax, dx ; ax <- row
clr ch ; cx <- column
;
; We only update the dependents for non-name cells.
;
cmp ax, NAME_ROW ; Check for name
je clearBits ; Branch if it's a name cell
;
; It's a real cell. We want to add/remove the dependencies.
;
mov ss:[bp].EP_flags, mask EF_MAKE_DEPENDENCIES or mask EF_NO_NAMES
mov ss:[bp].CP_row, ax ; Update stack frame
mov ss:[bp].CP_column, cx
mov ss:[bp].PCTV_row, dx
mov ss:[bp].PCTV_column, cx
mov dx, ss:[bp].PCTV_addRem ; dx <- parameter for CellAddRemoveDeps
call CellAddRemoveDeps ; Add or remove dependencies
clearBits:
;
; Now we need to clear the bits in the cell which signal it as part
; of the final recalc list.
;
SpreadsheetCellLock ; *es:di <- cell data
jnc quit ; Branch if cell doesn't exist
mov di, es:[di] ; es:di <- cell data
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
if _PROTECT_CELL
;
; For cell protection, we don't want to clear the protection bit
;
andnf es:[di].CC_recalcFlags, mask CRF_PROTECTION
else
;
; Don't change the reserved bit.
;
andnf es:[di].CC_recalcFlags, mask CRF_RESERVED
endif
call UnlockAndDirtyCell ; unlock and dirty the cell
quit:
clc ; Signal: continue
.leave
ret
UpdateNameCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReplaceNameReferences
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update cells that refer to one name token so that they refer
to another.
CALLED BY: SpreadsheetChangeName
PASS: ds:si = Instance ptr
dx = Old token
ax = New token
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
list = CreatePrecedentList( instance, NAME_ROW, oldToken )
foreach list entry do
ParserRemoveDependencies()
Modify name references from oldToken -> newToken
ParserAddDependencies()
done
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 8/12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReplaceNameParams struct
RNP_oldToken word ; Token to replace
RNP_newToken word ; Value to replace with
ReplaceNameParams ends
ReplaceNameReferences proc near
uses ax, bx, cx, dx, bp
params local ReplaceNameParams
.enter
EC < call ECCheckInstancePtr ;>
;
; Initialize the parameters.
;
mov params.RNP_newToken, ax
mov params.RNP_oldToken, dx
;
; Build a list of cells which reference the old name token.
;
mov ax, NAME_ROW ; ax <- Row
mov cx, dx ; cx <- Column
mov bx, offset cs:AppendDependentsToCellList
call CreateCellList ; bx <- end of cell list
; al <- cumulative CellListEntryFlags
;
; Now process each cell list entry.
;
mov ax, offset cs:ReplaceNameReferencesCallback
call ForeachCellListEntry ; Process the list
call FreeFinalList ; Free up the list
.leave
ret
ReplaceNameReferences endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReplaceNameReferencesCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Replace one name reference with another.
CALLED BY: ForeachCellListEntry
PASS: dx = Row of the cell to update
cl = Column
ch = Flags
ds:si = Spreadsheet instance
ss:bp = Inheritable ReplaceNameParams
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 8/12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReplaceNameReferencesCallback proc near
uses ax, cx, dx, di, es
params local ReplaceNameParams
ForceRef params
.enter inherit
EC < call ECCheckInstancePtr ;>
mov ax, dx ; ax <- row
clr ch ; cx <- Column
push ax, cx ; Save row/column
;
; First remove the old dependencies
;
mov dx, -1 ; Remove dependencies
call UpdateDependenciesFromCell
;
; Lock the cell down... It must exist.
;
SpreadsheetCellLock ; *es:di <- cell data
EC < ERROR_NC CELL_DOES_NOT_EXIST ; The cell must exist >
mov di, es:[di] ; es:di <- ptr to cell
;
; The type must be one of CT_FORMULA or CT_DISPLAY_FORMULA
;
EC < test es:[di].CC_recalcFlags, not (mask CellRecalcFlags) >
EC < ERROR_NZ SPREADSHEET_ILLEGAL_RECALC_FLAGS_IN_CELL >
EC < cmp es:[di].CC_type, CT_FORMULA >
EC < je typeOK >
EC < cmp es:[di].CC_type, CT_DISPLAY_FORMULA >
EC < ERROR_NZ CELL_SHOULD_BE_A_FORMULA >
EC <typeOK: >
if _PROTECT_CELL
;
; if cell protection, we don't want to clear the protection bit
;
andnf es:[di].CC_recalcFlags, mask CRF_PROTECTION
else
andnf es:[di].CC_recalcFlags, mask CRF_RESERVED
endif
add di, size CellFormula ; es:di <- ptr to the expression
mov cx, SEGMENT_CS ; cx:dx <- callback routine
mov dx, offset cs:ReplaceNameInExpressionCallback
call ParserForeachReference ; Process all the names...
call UnlockAndDirtyCell ; unlock and dirty the cell
pop ax, cx ; Restore row/column
;
; Now add the new dependencies
;
clr dx ; Add dependencies
call UpdateDependenciesFromCell
clc ; Signal: continue please
.leave
ret
ReplaceNameReferencesCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReplaceNameInExpressionCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Replace the names in an expression.
CALLED BY: ParserForeachReference
PASS: ds:si = Spreadsheet instance
ss:bp = Inheritable ReplaceNameParams
es:di = Pointer to the reference
al = Type of the reference
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 8/12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReplaceNameInExpressionCallback proc far
uses ax
params local ReplaceNameParams
.enter inherit
EC < call ECCheckInstancePtr ;>
cmp al, PARSER_TOKEN_NAME
jne quit ; Branch if not a name
mov ax, params.RNP_oldToken
cmp ax, es:[di].PTND_name ; Check for same as old name
jne quit ; Branch if not old name
;
; We've found a reference to the old name. Replace it with the new
; one and dirty the block.
;
mov ax, params.RNP_newToken
mov es:[di].PTND_name, ax ; Save new token
SpreadsheetCellDirty ; Dirty the cell
quit:
.leave
ret
ReplaceNameInExpressionCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UpdateDependenciesFromCell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Update a cells dependency list.
CALLED BY: ReplaceNameReferencesCallback
PASS: ax = Row
cx = Column
dx = Parameter to pass to CellAddRemoveDeps
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 8/12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UpdateDependenciesFromCell proc near
uses bp
.enter
sub sp, size PCT_vars ; Allocate stack frame
mov bp, sp ; ss:bp <- ptr to the stack frame
call SpreadsheetInitCommonParams
mov ss:[bp].CP_row, ax ; Save our row/column
mov ss:[bp].CP_column, cx
mov ss:[bp].PCTV_row, ax ; Save our row/column here too
mov ss:[bp].PCTV_column, cx
mov ss:[bp].EP_flags, mask EF_MAKE_DEPENDENCIES
call CellAddRemoveDeps ; Add / Remove dependencies
add sp, size PCT_vars ; Restore stack frame
.leave
ret
UpdateDependenciesFromCell endp
SpreadsheetNameCode ends
|
invaders.asm | TheRalph/MBR_Inviders | 3 | 9862 | <gh_stars>1-10
;*******************************************************************************
; Assemble with nasm -o invader.com -f bin invader.asm
;*******************************************************************************
org 0100h
%define USE_CLEARSCR
;%define USE_DRAW_SPRITE
%define USE_DRAW_MONOCHROM_ICON
%define USE_VSYNC
;%define USE_PRINTSTR
%define USE_PRINTINT
%include 'mydrawM.inc'
%include 'mainInva.inc'
%include 'mydrawF.inc'
end:
mov ax, 0x4C00
int 0x21
|
src/tcg-tile_layers.ads | Fabien-Chouteau/tiled-code-gen | 1 | 29326 | <reponame>Fabien-Chouteau/tiled-code-gen
------------------------------------------------------------------------------
-- --
-- tiled-code-gen --
-- --
-- Copyright (C) 2018 <NAME> --
-- --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with TCG.Tilesets;
with DOM.Core;
package TCG.Tile_Layers is
type Tile_Layer_Id is new Integer;
type Tile_Layer is private;
No_Layer : constant Tile_Layer;
function Load (Root : DOM.Core.Node) return Tile_Layer;
function Name (This : Tile_Layer) return String
with Pre => This /= No_Layer;
function Id (This : Tile_Layer) return Tile_Layer_Id
with Pre => This /= No_Layer;
function Width (This : Tile_Layer) return Natural
with Pre => This /= No_Layer;
function Height (This : Tile_Layer) return Natural
with Pre => This /= No_Layer;
function Tile (This : Tile_Layer;
X, Y : Natural)
return TCG.Tilesets.Map_Tile_Id
with Pre => This /= No_Layer
and then X in 1 .. Width (This)
and then Y in 1 .. Height (This);
procedure Put (This : Tile_Layer)
with Pre => This /= No_Layer;
private
type String_Access is access all String;
type Layer_Tile_Map is array (Natural range <>, Natural range <>)
of Tilesets.Map_Tile_Id;
type Layer_Data (Width, Height : Natural) is record
Name : String_Access := null;
Id : Tile_Layer_Id;
Map : Layer_Tile_Map (1 .. Width, 1 .. Height);
end record;
type Tile_Layer is access all Layer_Data;
No_Layer : constant Tile_Layer := null;
end TCG.Tile_Layers;
|
136/ada/main.adb | notdb/LC-Practice | 0 | 30241 | <filename>136/ada/main.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
procedure Nested is
begin
Put_Line ("Hello World");
end Nested;
begin
Nested;
end Main; |
prog2.asm | GarrisonGE/xv6 | 0 | 11162 | <gh_stars>0
_prog2: 文件格式 elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "types.h"
#include "stat.h"
#include "user.h"
int main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 83 ec 10 sub $0x10,%esp
settick(20);
9: c7 04 24 14 00 00 00 movl $0x14,(%esp)
10: e8 f5 02 00 00 call 30a <settick>
15: ba 40 9c 00 00 mov $0x9c40,%edx
1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
int i,k;
const int loop=40000;
for(i=0;i<loop;i++)
{
asm("nop");
20: 90 nop
21: b8 40 9c 00 00 mov $0x9c40,%eax
26: 66 90 xchg %ax,%ax
for(k=0;k<loop;k++)
{
asm("nop");
28: 90 nop
for(k=0;k<loop;k++)
29: 83 e8 01 sub $0x1,%eax
2c: 75 fa jne 28 <main+0x28>
for(i=0;i<loop;i++)
2e: 83 ea 01 sub $0x1,%edx
31: 75 ed jne 20 <main+0x20>
}
}
exit();
33: e8 2a 02 00 00 call 262 <exit>
38: 66 90 xchg %ax,%ax
3a: 66 90 xchg %ax,%ax
3c: 66 90 xchg %ax,%ax
3e: 66 90 xchg %ax,%ax
00000040 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
40: 55 push %ebp
41: 89 e5 mov %esp,%ebp
43: 8b 45 08 mov 0x8(%ebp),%eax
46: 8b 4d 0c mov 0xc(%ebp),%ecx
49: 53 push %ebx
char *os;
os = s;
while((*s++ = *t++) != 0)
4a: 89 c2 mov %eax,%edx
4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
50: 83 c1 01 add $0x1,%ecx
53: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
57: 83 c2 01 add $0x1,%edx
5a: 84 db test %bl,%bl
5c: 88 5a ff mov %bl,-0x1(%edx)
5f: 75 ef jne 50 <strcpy+0x10>
;
return os;
}
61: 5b pop %ebx
62: 5d pop %ebp
63: c3 ret
64: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
6a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000070 <strcmp>:
int
strcmp(const char *p, const char *q)
{
70: 55 push %ebp
71: 89 e5 mov %esp,%ebp
73: 8b 55 08 mov 0x8(%ebp),%edx
76: 53 push %ebx
77: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
7a: 0f b6 02 movzbl (%edx),%eax
7d: 84 c0 test %al,%al
7f: 74 2d je ae <strcmp+0x3e>
81: 0f b6 19 movzbl (%ecx),%ebx
84: 38 d8 cmp %bl,%al
86: 74 0e je 96 <strcmp+0x26>
88: eb 2b jmp b5 <strcmp+0x45>
8a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
90: 38 c8 cmp %cl,%al
92: 75 15 jne a9 <strcmp+0x39>
p++, q++;
94: 89 d9 mov %ebx,%ecx
96: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
99: 0f b6 02 movzbl (%edx),%eax
p++, q++;
9c: 8d 59 01 lea 0x1(%ecx),%ebx
while(*p && *p == *q)
9f: 0f b6 49 01 movzbl 0x1(%ecx),%ecx
a3: 84 c0 test %al,%al
a5: 75 e9 jne 90 <strcmp+0x20>
a7: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
a9: 29 c8 sub %ecx,%eax
}
ab: 5b pop %ebx
ac: 5d pop %ebp
ad: c3 ret
ae: 0f b6 09 movzbl (%ecx),%ecx
while(*p && *p == *q)
b1: 31 c0 xor %eax,%eax
b3: eb f4 jmp a9 <strcmp+0x39>
b5: 0f b6 cb movzbl %bl,%ecx
b8: eb ef jmp a9 <strcmp+0x39>
ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000000c0 <strlen>:
uint
strlen(const char *s)
{
c0: 55 push %ebp
c1: 89 e5 mov %esp,%ebp
c3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
c6: 80 39 00 cmpb $0x0,(%ecx)
c9: 74 12 je dd <strlen+0x1d>
cb: 31 d2 xor %edx,%edx
cd: 8d 76 00 lea 0x0(%esi),%esi
d0: 83 c2 01 add $0x1,%edx
d3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
d7: 89 d0 mov %edx,%eax
d9: 75 f5 jne d0 <strlen+0x10>
;
return n;
}
db: 5d pop %ebp
dc: c3 ret
for(n = 0; s[n]; n++)
dd: 31 c0 xor %eax,%eax
}
df: 5d pop %ebp
e0: c3 ret
e1: eb 0d jmp f0 <memset>
e3: 90 nop
e4: 90 nop
e5: 90 nop
e6: 90 nop
e7: 90 nop
e8: 90 nop
e9: 90 nop
ea: 90 nop
eb: 90 nop
ec: 90 nop
ed: 90 nop
ee: 90 nop
ef: 90 nop
000000f0 <memset>:
void*
memset(void *dst, int c, uint n)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 8b 55 08 mov 0x8(%ebp),%edx
f6: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
f7: 8b 4d 10 mov 0x10(%ebp),%ecx
fa: 8b 45 0c mov 0xc(%ebp),%eax
fd: 89 d7 mov %edx,%edi
ff: fc cld
100: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
102: 89 d0 mov %edx,%eax
104: 5f pop %edi
105: 5d pop %ebp
106: c3 ret
107: 89 f6 mov %esi,%esi
109: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000110 <strchr>:
char*
strchr(const char *s, char c)
{
110: 55 push %ebp
111: 89 e5 mov %esp,%ebp
113: 8b 45 08 mov 0x8(%ebp),%eax
116: 53 push %ebx
117: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
11a: 0f b6 18 movzbl (%eax),%ebx
11d: 84 db test %bl,%bl
11f: 74 1d je 13e <strchr+0x2e>
if(*s == c)
121: 38 d3 cmp %dl,%bl
123: 89 d1 mov %edx,%ecx
125: 75 0d jne 134 <strchr+0x24>
127: eb 17 jmp 140 <strchr+0x30>
129: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
130: 38 ca cmp %cl,%dl
132: 74 0c je 140 <strchr+0x30>
for(; *s; s++)
134: 83 c0 01 add $0x1,%eax
137: 0f b6 10 movzbl (%eax),%edx
13a: 84 d2 test %dl,%dl
13c: 75 f2 jne 130 <strchr+0x20>
return (char*)s;
return 0;
13e: 31 c0 xor %eax,%eax
}
140: 5b pop %ebx
141: 5d pop %ebp
142: c3 ret
143: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000150 <gets>:
char*
gets(char *buf, int max)
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 57 push %edi
154: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
155: 31 f6 xor %esi,%esi
{
157: 53 push %ebx
158: 83 ec 2c sub $0x2c,%esp
cc = read(0, &c, 1);
15b: 8d 7d e7 lea -0x19(%ebp),%edi
for(i=0; i+1 < max; ){
15e: eb 31 jmp 191 <gets+0x41>
cc = read(0, &c, 1);
160: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
167: 00
168: 89 7c 24 04 mov %edi,0x4(%esp)
16c: c7 04 24 00 00 00 00 movl $0x0,(%esp)
173: e8 02 01 00 00 call 27a <read>
if(cc < 1)
178: 85 c0 test %eax,%eax
17a: 7e 1d jle 199 <gets+0x49>
break;
buf[i++] = c;
17c: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
for(i=0; i+1 < max; ){
180: 89 de mov %ebx,%esi
buf[i++] = c;
182: 8b 55 08 mov 0x8(%ebp),%edx
if(c == '\n' || c == '\r')
185: 3c 0d cmp $0xd,%al
buf[i++] = c;
187: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
18b: 74 0c je 199 <gets+0x49>
18d: 3c 0a cmp $0xa,%al
18f: 74 08 je 199 <gets+0x49>
for(i=0; i+1 < max; ){
191: 8d 5e 01 lea 0x1(%esi),%ebx
194: 3b 5d 0c cmp 0xc(%ebp),%ebx
197: 7c c7 jl 160 <gets+0x10>
break;
}
buf[i] = '\0';
199: 8b 45 08 mov 0x8(%ebp),%eax
19c: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
1a0: 83 c4 2c add $0x2c,%esp
1a3: 5b pop %ebx
1a4: 5e pop %esi
1a5: 5f pop %edi
1a6: 5d pop %ebp
1a7: c3 ret
1a8: 90 nop
1a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000001b0 <stat>:
int
stat(const char *n, struct stat *st)
{
1b0: 55 push %ebp
1b1: 89 e5 mov %esp,%ebp
1b3: 56 push %esi
1b4: 53 push %ebx
1b5: 83 ec 10 sub $0x10,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1b8: 8b 45 08 mov 0x8(%ebp),%eax
1bb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1c2: 00
1c3: 89 04 24 mov %eax,(%esp)
1c6: e8 d7 00 00 00 call 2a2 <open>
if(fd < 0)
1cb: 85 c0 test %eax,%eax
fd = open(n, O_RDONLY);
1cd: 89 c3 mov %eax,%ebx
if(fd < 0)
1cf: 78 27 js 1f8 <stat+0x48>
return -1;
r = fstat(fd, st);
1d1: 8b 45 0c mov 0xc(%ebp),%eax
1d4: 89 1c 24 mov %ebx,(%esp)
1d7: 89 44 24 04 mov %eax,0x4(%esp)
1db: e8 da 00 00 00 call 2ba <fstat>
close(fd);
1e0: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
1e3: 89 c6 mov %eax,%esi
close(fd);
1e5: e8 a0 00 00 00 call 28a <close>
return r;
1ea: 89 f0 mov %esi,%eax
}
1ec: 83 c4 10 add $0x10,%esp
1ef: 5b pop %ebx
1f0: 5e pop %esi
1f1: 5d pop %ebp
1f2: c3 ret
1f3: 90 nop
1f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
1f8: b8 ff ff ff ff mov $0xffffffff,%eax
1fd: eb ed jmp 1ec <stat+0x3c>
1ff: 90 nop
00000200 <atoi>:
int
atoi(const char *s)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 8b 4d 08 mov 0x8(%ebp),%ecx
206: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
207: 0f be 11 movsbl (%ecx),%edx
20a: 8d 42 d0 lea -0x30(%edx),%eax
20d: 3c 09 cmp $0x9,%al
n = 0;
20f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
214: 77 17 ja 22d <atoi+0x2d>
216: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
218: 83 c1 01 add $0x1,%ecx
21b: 8d 04 80 lea (%eax,%eax,4),%eax
21e: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
222: 0f be 11 movsbl (%ecx),%edx
225: 8d 5a d0 lea -0x30(%edx),%ebx
228: 80 fb 09 cmp $0x9,%bl
22b: 76 eb jbe 218 <atoi+0x18>
return n;
}
22d: 5b pop %ebx
22e: 5d pop %ebp
22f: c3 ret
00000230 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
230: 55 push %ebp
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
231: 31 d2 xor %edx,%edx
{
233: 89 e5 mov %esp,%ebp
235: 56 push %esi
236: 8b 45 08 mov 0x8(%ebp),%eax
239: 53 push %ebx
23a: 8b 5d 10 mov 0x10(%ebp),%ebx
23d: 8b 75 0c mov 0xc(%ebp),%esi
while(n-- > 0)
240: 85 db test %ebx,%ebx
242: 7e 12 jle 256 <memmove+0x26>
244: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
248: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
24c: 88 0c 10 mov %cl,(%eax,%edx,1)
24f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
252: 39 da cmp %ebx,%edx
254: 75 f2 jne 248 <memmove+0x18>
return vdst;
}
256: 5b pop %ebx
257: 5e pop %esi
258: 5d pop %ebp
259: c3 ret
0000025a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
25a: b8 01 00 00 00 mov $0x1,%eax
25f: cd 40 int $0x40
261: c3 ret
00000262 <exit>:
SYSCALL(exit)
262: b8 02 00 00 00 mov $0x2,%eax
267: cd 40 int $0x40
269: c3 ret
0000026a <wait>:
SYSCALL(wait)
26a: b8 03 00 00 00 mov $0x3,%eax
26f: cd 40 int $0x40
271: c3 ret
00000272 <pipe>:
SYSCALL(pipe)
272: b8 04 00 00 00 mov $0x4,%eax
277: cd 40 int $0x40
279: c3 ret
0000027a <read>:
SYSCALL(read)
27a: b8 05 00 00 00 mov $0x5,%eax
27f: cd 40 int $0x40
281: c3 ret
00000282 <write>:
SYSCALL(write)
282: b8 10 00 00 00 mov $0x10,%eax
287: cd 40 int $0x40
289: c3 ret
0000028a <close>:
SYSCALL(close)
28a: b8 15 00 00 00 mov $0x15,%eax
28f: cd 40 int $0x40
291: c3 ret
00000292 <kill>:
SYSCALL(kill)
292: b8 06 00 00 00 mov $0x6,%eax
297: cd 40 int $0x40
299: c3 ret
0000029a <exec>:
SYSCALL(exec)
29a: b8 07 00 00 00 mov $0x7,%eax
29f: cd 40 int $0x40
2a1: c3 ret
000002a2 <open>:
SYSCALL(open)
2a2: b8 0f 00 00 00 mov $0xf,%eax
2a7: cd 40 int $0x40
2a9: c3 ret
000002aa <mknod>:
SYSCALL(mknod)
2aa: b8 11 00 00 00 mov $0x11,%eax
2af: cd 40 int $0x40
2b1: c3 ret
000002b2 <unlink>:
SYSCALL(unlink)
2b2: b8 12 00 00 00 mov $0x12,%eax
2b7: cd 40 int $0x40
2b9: c3 ret
000002ba <fstat>:
SYSCALL(fstat)
2ba: b8 08 00 00 00 mov $0x8,%eax
2bf: cd 40 int $0x40
2c1: c3 ret
000002c2 <link>:
SYSCALL(link)
2c2: b8 13 00 00 00 mov $0x13,%eax
2c7: cd 40 int $0x40
2c9: c3 ret
000002ca <mkdir>:
SYSCALL(mkdir)
2ca: b8 14 00 00 00 mov $0x14,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <chdir>:
SYSCALL(chdir)
2d2: b8 09 00 00 00 mov $0x9,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <dup>:
SYSCALL(dup)
2da: b8 0a 00 00 00 mov $0xa,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <getpid>:
SYSCALL(getpid)
2e2: b8 0b 00 00 00 mov $0xb,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <sbrk>:
SYSCALL(sbrk)
2ea: b8 0c 00 00 00 mov $0xc,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <sleep>:
SYSCALL(sleep)
2f2: b8 0d 00 00 00 mov $0xd,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <uptime>:
SYSCALL(uptime)
2fa: b8 0e 00 00 00 mov $0xe,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <info>:
SYSCALL(info)
302: b8 16 00 00 00 mov $0x16,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <settick>:
SYSCALL(settick)
30a: b8 17 00 00 00 mov $0x17,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <tickprintf>:
SYSCALL(tickprintf)
312: b8 18 00 00 00 mov $0x18,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <clone>:
SYSCALL(clone)
31a: b8 19 00 00 00 mov $0x19,%eax
31f: cd 40 int $0x40
321: c3 ret
322: 66 90 xchg %ax,%ax
324: 66 90 xchg %ax,%ax
326: 66 90 xchg %ax,%ax
328: 66 90 xchg %ax,%ax
32a: 66 90 xchg %ax,%ax
32c: 66 90 xchg %ax,%ax
32e: 66 90 xchg %ax,%ax
00000330 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
330: 55 push %ebp
331: 89 e5 mov %esp,%ebp
333: 57 push %edi
334: 56 push %esi
335: 89 c6 mov %eax,%esi
337: 53 push %ebx
338: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
33b: 8b 5d 08 mov 0x8(%ebp),%ebx
33e: 85 db test %ebx,%ebx
340: 74 09 je 34b <printint+0x1b>
342: 89 d0 mov %edx,%eax
344: c1 e8 1f shr $0x1f,%eax
347: 84 c0 test %al,%al
349: 75 75 jne 3c0 <printint+0x90>
neg = 1;
x = -xx;
} else {
x = xx;
34b: 89 d0 mov %edx,%eax
neg = 0;
34d: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
354: 89 75 c0 mov %esi,-0x40(%ebp)
}
i = 0;
357: 31 ff xor %edi,%edi
359: 89 ce mov %ecx,%esi
35b: 8d 5d d7 lea -0x29(%ebp),%ebx
35e: eb 02 jmp 362 <printint+0x32>
do{
buf[i++] = digits[x % base];
360: 89 cf mov %ecx,%edi
362: 31 d2 xor %edx,%edx
364: f7 f6 div %esi
366: 8d 4f 01 lea 0x1(%edi),%ecx
369: 0f b6 92 e4 07 00 00 movzbl 0x7e4(%edx),%edx
}while((x /= base) != 0);
370: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
372: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
375: 75 e9 jne 360 <printint+0x30>
if(neg)
377: 8b 55 c4 mov -0x3c(%ebp),%edx
buf[i++] = digits[x % base];
37a: 89 c8 mov %ecx,%eax
37c: 8b 75 c0 mov -0x40(%ebp),%esi
if(neg)
37f: 85 d2 test %edx,%edx
381: 74 08 je 38b <printint+0x5b>
buf[i++] = '-';
383: 8d 4f 02 lea 0x2(%edi),%ecx
386: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
38b: 8d 79 ff lea -0x1(%ecx),%edi
38e: 66 90 xchg %ax,%ax
390: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
395: 83 ef 01 sub $0x1,%edi
write(fd, &c, 1);
398: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
39f: 00
3a0: 89 5c 24 04 mov %ebx,0x4(%esp)
3a4: 89 34 24 mov %esi,(%esp)
3a7: 88 45 d7 mov %al,-0x29(%ebp)
3aa: e8 d3 fe ff ff call 282 <write>
while(--i >= 0)
3af: 83 ff ff cmp $0xffffffff,%edi
3b2: 75 dc jne 390 <printint+0x60>
putc(fd, buf[i]);
}
3b4: 83 c4 4c add $0x4c,%esp
3b7: 5b pop %ebx
3b8: 5e pop %esi
3b9: 5f pop %edi
3ba: 5d pop %ebp
3bb: c3 ret
3bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = -xx;
3c0: 89 d0 mov %edx,%eax
3c2: f7 d8 neg %eax
neg = 1;
3c4: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
3cb: eb 87 jmp 354 <printint+0x24>
3cd: 8d 76 00 lea 0x0(%esi),%esi
000003d0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
3d3: 57 push %edi
char *s;
int c, i, state;
uint *ap;
state = 0;
3d4: 31 ff xor %edi,%edi
{
3d6: 56 push %esi
3d7: 53 push %ebx
3d8: 83 ec 3c sub $0x3c,%esp
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
3db: 8b 5d 0c mov 0xc(%ebp),%ebx
ap = (uint*)(void*)&fmt + 1;
3de: 8d 45 10 lea 0x10(%ebp),%eax
{
3e1: 8b 75 08 mov 0x8(%ebp),%esi
ap = (uint*)(void*)&fmt + 1;
3e4: 89 45 d4 mov %eax,-0x2c(%ebp)
for(i = 0; fmt[i]; i++){
3e7: 0f b6 13 movzbl (%ebx),%edx
3ea: 83 c3 01 add $0x1,%ebx
3ed: 84 d2 test %dl,%dl
3ef: 75 39 jne 42a <printf+0x5a>
3f1: e9 c2 00 00 00 jmp 4b8 <printf+0xe8>
3f6: 66 90 xchg %ax,%ax
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
3f8: 83 fa 25 cmp $0x25,%edx
3fb: 0f 84 bf 00 00 00 je 4c0 <printf+0xf0>
write(fd, &c, 1);
401: 8d 45 e2 lea -0x1e(%ebp),%eax
404: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
40b: 00
40c: 89 44 24 04 mov %eax,0x4(%esp)
410: 89 34 24 mov %esi,(%esp)
state = '%';
} else {
putc(fd, c);
413: 88 55 e2 mov %dl,-0x1e(%ebp)
write(fd, &c, 1);
416: e8 67 fe ff ff call 282 <write>
41b: 83 c3 01 add $0x1,%ebx
for(i = 0; fmt[i]; i++){
41e: 0f b6 53 ff movzbl -0x1(%ebx),%edx
422: 84 d2 test %dl,%dl
424: 0f 84 8e 00 00 00 je 4b8 <printf+0xe8>
if(state == 0){
42a: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
42c: 0f be c2 movsbl %dl,%eax
if(state == 0){
42f: 74 c7 je 3f8 <printf+0x28>
}
} else if(state == '%'){
431: 83 ff 25 cmp $0x25,%edi
434: 75 e5 jne 41b <printf+0x4b>
if(c == 'd'){
436: 83 fa 64 cmp $0x64,%edx
439: 0f 84 31 01 00 00 je 570 <printf+0x1a0>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
43f: 25 f7 00 00 00 and $0xf7,%eax
444: 83 f8 70 cmp $0x70,%eax
447: 0f 84 83 00 00 00 je 4d0 <printf+0x100>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
44d: 83 fa 73 cmp $0x73,%edx
450: 0f 84 a2 00 00 00 je 4f8 <printf+0x128>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
456: 83 fa 63 cmp $0x63,%edx
459: 0f 84 35 01 00 00 je 594 <printf+0x1c4>
putc(fd, *ap);
ap++;
} else if(c == '%'){
45f: 83 fa 25 cmp $0x25,%edx
462: 0f 84 e0 00 00 00 je 548 <printf+0x178>
write(fd, &c, 1);
468: 8d 45 e6 lea -0x1a(%ebp),%eax
46b: 83 c3 01 add $0x1,%ebx
46e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
475: 00
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
476: 31 ff xor %edi,%edi
write(fd, &c, 1);
478: 89 44 24 04 mov %eax,0x4(%esp)
47c: 89 34 24 mov %esi,(%esp)
47f: 89 55 d0 mov %edx,-0x30(%ebp)
482: c6 45 e6 25 movb $0x25,-0x1a(%ebp)
486: e8 f7 fd ff ff call 282 <write>
putc(fd, c);
48b: 8b 55 d0 mov -0x30(%ebp),%edx
write(fd, &c, 1);
48e: 8d 45 e7 lea -0x19(%ebp),%eax
491: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
498: 00
499: 89 44 24 04 mov %eax,0x4(%esp)
49d: 89 34 24 mov %esi,(%esp)
putc(fd, c);
4a0: 88 55 e7 mov %dl,-0x19(%ebp)
write(fd, &c, 1);
4a3: e8 da fd ff ff call 282 <write>
for(i = 0; fmt[i]; i++){
4a8: 0f b6 53 ff movzbl -0x1(%ebx),%edx
4ac: 84 d2 test %dl,%dl
4ae: 0f 85 76 ff ff ff jne 42a <printf+0x5a>
4b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
}
4b8: 83 c4 3c add $0x3c,%esp
4bb: 5b pop %ebx
4bc: 5e pop %esi
4bd: 5f pop %edi
4be: 5d pop %ebp
4bf: c3 ret
state = '%';
4c0: bf 25 00 00 00 mov $0x25,%edi
4c5: e9 51 ff ff ff jmp 41b <printf+0x4b>
4ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
4d0: 8b 45 d4 mov -0x2c(%ebp),%eax
4d3: b9 10 00 00 00 mov $0x10,%ecx
state = 0;
4d8: 31 ff xor %edi,%edi
printint(fd, *ap, 16, 0);
4da: c7 04 24 00 00 00 00 movl $0x0,(%esp)
4e1: 8b 10 mov (%eax),%edx
4e3: 89 f0 mov %esi,%eax
4e5: e8 46 fe ff ff call 330 <printint>
ap++;
4ea: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
4ee: e9 28 ff ff ff jmp 41b <printf+0x4b>
4f3: 90 nop
4f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
4f8: 8b 45 d4 mov -0x2c(%ebp),%eax
ap++;
4fb: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
s = (char*)*ap;
4ff: 8b 38 mov (%eax),%edi
s = "(null)";
501: b8 dd 07 00 00 mov $0x7dd,%eax
506: 85 ff test %edi,%edi
508: 0f 44 f8 cmove %eax,%edi
while(*s != 0){
50b: 0f b6 07 movzbl (%edi),%eax
50e: 84 c0 test %al,%al
510: 74 2a je 53c <printf+0x16c>
512: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
518: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
51b: 8d 45 e3 lea -0x1d(%ebp),%eax
s++;
51e: 83 c7 01 add $0x1,%edi
write(fd, &c, 1);
521: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
528: 00
529: 89 44 24 04 mov %eax,0x4(%esp)
52d: 89 34 24 mov %esi,(%esp)
530: e8 4d fd ff ff call 282 <write>
while(*s != 0){
535: 0f b6 07 movzbl (%edi),%eax
538: 84 c0 test %al,%al
53a: 75 dc jne 518 <printf+0x148>
state = 0;
53c: 31 ff xor %edi,%edi
53e: e9 d8 fe ff ff jmp 41b <printf+0x4b>
543: 90 nop
544: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
548: 8d 45 e5 lea -0x1b(%ebp),%eax
state = 0;
54b: 31 ff xor %edi,%edi
write(fd, &c, 1);
54d: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
554: 00
555: 89 44 24 04 mov %eax,0x4(%esp)
559: 89 34 24 mov %esi,(%esp)
55c: c6 45 e5 25 movb $0x25,-0x1b(%ebp)
560: e8 1d fd ff ff call 282 <write>
565: e9 b1 fe ff ff jmp 41b <printf+0x4b>
56a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
570: 8b 45 d4 mov -0x2c(%ebp),%eax
573: b9 0a 00 00 00 mov $0xa,%ecx
state = 0;
578: 66 31 ff xor %di,%di
printint(fd, *ap, 10, 1);
57b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
582: 8b 10 mov (%eax),%edx
584: 89 f0 mov %esi,%eax
586: e8 a5 fd ff ff call 330 <printint>
ap++;
58b: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
58f: e9 87 fe ff ff jmp 41b <printf+0x4b>
putc(fd, *ap);
594: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
597: 31 ff xor %edi,%edi
putc(fd, *ap);
599: 8b 00 mov (%eax),%eax
write(fd, &c, 1);
59b: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
5a2: 00
5a3: 89 34 24 mov %esi,(%esp)
putc(fd, *ap);
5a6: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
5a9: 8d 45 e4 lea -0x1c(%ebp),%eax
5ac: 89 44 24 04 mov %eax,0x4(%esp)
5b0: e8 cd fc ff ff call 282 <write>
ap++;
5b5: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
5b9: e9 5d fe ff ff jmp 41b <printf+0x4b>
5be: 66 90 xchg %ax,%ax
000005c0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5c0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5c1: a1 e4 0a 00 00 mov 0xae4,%eax
{
5c6: 89 e5 mov %esp,%ebp
5c8: 57 push %edi
5c9: 56 push %esi
5ca: 53 push %ebx
5cb: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5ce: 8b 08 mov (%eax),%ecx
bp = (Header*)ap - 1;
5d0: 8d 53 f8 lea -0x8(%ebx),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5d3: 39 d0 cmp %edx,%eax
5d5: 72 11 jb 5e8 <free+0x28>
5d7: 90 nop
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5d8: 39 c8 cmp %ecx,%eax
5da: 72 04 jb 5e0 <free+0x20>
5dc: 39 ca cmp %ecx,%edx
5de: 72 10 jb 5f0 <free+0x30>
5e0: 89 c8 mov %ecx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e2: 39 d0 cmp %edx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5e4: 8b 08 mov (%eax),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e6: 73 f0 jae 5d8 <free+0x18>
5e8: 39 ca cmp %ecx,%edx
5ea: 72 04 jb 5f0 <free+0x30>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5ec: 39 c8 cmp %ecx,%eax
5ee: 72 f0 jb 5e0 <free+0x20>
break;
if(bp + bp->s.size == p->s.ptr){
5f0: 8b 73 fc mov -0x4(%ebx),%esi
5f3: 8d 3c f2 lea (%edx,%esi,8),%edi
5f6: 39 cf cmp %ecx,%edi
5f8: 74 1e je 618 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
5fa: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
5fd: 8b 48 04 mov 0x4(%eax),%ecx
600: 8d 34 c8 lea (%eax,%ecx,8),%esi
603: 39 f2 cmp %esi,%edx
605: 74 28 je 62f <free+0x6f>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
607: 89 10 mov %edx,(%eax)
freep = p;
609: a3 e4 0a 00 00 mov %eax,0xae4
}
60e: 5b pop %ebx
60f: 5e pop %esi
610: 5f pop %edi
611: 5d pop %ebp
612: c3 ret
613: 90 nop
614: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
618: 03 71 04 add 0x4(%ecx),%esi
61b: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
61e: 8b 08 mov (%eax),%ecx
620: 8b 09 mov (%ecx),%ecx
622: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
625: 8b 48 04 mov 0x4(%eax),%ecx
628: 8d 34 c8 lea (%eax,%ecx,8),%esi
62b: 39 f2 cmp %esi,%edx
62d: 75 d8 jne 607 <free+0x47>
p->s.size += bp->s.size;
62f: 03 4b fc add -0x4(%ebx),%ecx
freep = p;
632: a3 e4 0a 00 00 mov %eax,0xae4
p->s.size += bp->s.size;
637: 89 48 04 mov %ecx,0x4(%eax)
p->s.ptr = bp->s.ptr;
63a: 8b 53 f8 mov -0x8(%ebx),%edx
63d: 89 10 mov %edx,(%eax)
}
63f: 5b pop %ebx
640: 5e pop %esi
641: 5f pop %edi
642: 5d pop %ebp
643: c3 ret
644: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
64a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000650 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
650: 55 push %ebp
651: 89 e5 mov %esp,%ebp
653: 57 push %edi
654: 56 push %esi
655: 53 push %ebx
656: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
659: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
65c: 8b 1d e4 0a 00 00 mov 0xae4,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
662: 8d 48 07 lea 0x7(%eax),%ecx
665: c1 e9 03 shr $0x3,%ecx
if((prevp = freep) == 0){
668: 85 db test %ebx,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
66a: 8d 71 01 lea 0x1(%ecx),%esi
if((prevp = freep) == 0){
66d: 0f 84 9b 00 00 00 je 70e <malloc+0xbe>
673: 8b 13 mov (%ebx),%edx
675: 8b 7a 04 mov 0x4(%edx),%edi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
678: 39 fe cmp %edi,%esi
67a: 76 64 jbe 6e0 <malloc+0x90>
67c: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax
if(nu < 4096)
683: bb 00 80 00 00 mov $0x8000,%ebx
688: 89 45 e4 mov %eax,-0x1c(%ebp)
68b: eb 0e jmp 69b <malloc+0x4b>
68d: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
690: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
692: 8b 78 04 mov 0x4(%eax),%edi
695: 39 fe cmp %edi,%esi
697: 76 4f jbe 6e8 <malloc+0x98>
699: 89 c2 mov %eax,%edx
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
69b: 3b 15 e4 0a 00 00 cmp 0xae4,%edx
6a1: 75 ed jne 690 <malloc+0x40>
if(nu < 4096)
6a3: 8b 45 e4 mov -0x1c(%ebp),%eax
6a6: 81 fe 00 10 00 00 cmp $0x1000,%esi
6ac: bf 00 10 00 00 mov $0x1000,%edi
6b1: 0f 43 fe cmovae %esi,%edi
6b4: 0f 42 c3 cmovb %ebx,%eax
p = sbrk(nu * sizeof(Header));
6b7: 89 04 24 mov %eax,(%esp)
6ba: e8 2b fc ff ff call 2ea <sbrk>
if(p == (char*)-1)
6bf: 83 f8 ff cmp $0xffffffff,%eax
6c2: 74 18 je 6dc <malloc+0x8c>
hp->s.size = nu;
6c4: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
6c7: 83 c0 08 add $0x8,%eax
6ca: 89 04 24 mov %eax,(%esp)
6cd: e8 ee fe ff ff call 5c0 <free>
return freep;
6d2: 8b 15 e4 0a 00 00 mov 0xae4,%edx
if((p = morecore(nunits)) == 0)
6d8: 85 d2 test %edx,%edx
6da: 75 b4 jne 690 <malloc+0x40>
return 0;
6dc: 31 c0 xor %eax,%eax
6de: eb 20 jmp 700 <malloc+0xb0>
if(p->s.size >= nunits){
6e0: 89 d0 mov %edx,%eax
6e2: 89 da mov %ebx,%edx
6e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
6e8: 39 fe cmp %edi,%esi
6ea: 74 1c je 708 <malloc+0xb8>
p->s.size -= nunits;
6ec: 29 f7 sub %esi,%edi
6ee: 89 78 04 mov %edi,0x4(%eax)
p += p->s.size;
6f1: 8d 04 f8 lea (%eax,%edi,8),%eax
p->s.size = nunits;
6f4: 89 70 04 mov %esi,0x4(%eax)
freep = prevp;
6f7: 89 15 e4 0a 00 00 mov %edx,0xae4
return (void*)(p + 1);
6fd: 83 c0 08 add $0x8,%eax
}
}
700: 83 c4 1c add $0x1c,%esp
703: 5b pop %ebx
704: 5e pop %esi
705: 5f pop %edi
706: 5d pop %ebp
707: c3 ret
prevp->s.ptr = p->s.ptr;
708: 8b 08 mov (%eax),%ecx
70a: 89 0a mov %ecx,(%edx)
70c: eb e9 jmp 6f7 <malloc+0xa7>
base.s.ptr = freep = prevp = &base;
70e: c7 05 e4 0a 00 00 e8 movl $0xae8,0xae4
715: 0a 00 00
base.s.size = 0;
718: ba e8 0a 00 00 mov $0xae8,%edx
base.s.ptr = freep = prevp = &base;
71d: c7 05 e8 0a 00 00 e8 movl $0xae8,0xae8
724: 0a 00 00
base.s.size = 0;
727: c7 05 ec 0a 00 00 00 movl $0x0,0xaec
72e: 00 00 00
731: e9 46 ff ff ff jmp 67c <malloc+0x2c>
736: 66 90 xchg %ax,%ax
738: 66 90 xchg %ax,%ax
73a: 66 90 xchg %ax,%ax
73c: 66 90 xchg %ax,%ax
73e: 66 90 xchg %ax,%ax
00000740 <thread_create>:
#include "mmu.h"
#include "spinlock.h"
struct lock_t lock;
void thread_create(void *(*start_routine)(void*), void *arg){
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 53 push %ebx
744: 83 ec 14 sub $0x14,%esp
void *stack = malloc(PGSIZE*2);//allocate a block of memory for stack of thread
747: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
74e: e8 fd fe ff ff call 650 <malloc>
753: 89 c3 mov %eax,%ebx
if((uint)stack % PGSIZE)
755: 25 ff 0f 00 00 and $0xfff,%eax
75a: 74 08 je 764 <thread_create+0x24>
stack = stack + (PGSIZE - (uint)stack % PGSIZE);
75c: 29 c3 sub %eax,%ebx
75e: 81 c3 00 10 00 00 add $0x1000,%ebx
int id;
id = clone(stack, PGSIZE*2);
764: c7 44 24 04 00 20 00 movl $0x2000,0x4(%esp)
76b: 00
76c: 89 1c 24 mov %ebx,(%esp)
76f: e8 a6 fb ff ff call 31a <clone>
// id == 0 means this process is a thread
if(id == 0){
774: 85 c0 test %eax,%eax
776: 74 06 je 77e <thread_create+0x3e>
(*start_routine)(arg);
free(stack);
exit();
}
}
778: 83 c4 14 add $0x14,%esp
77b: 5b pop %ebx
77c: 5d pop %ebp
77d: c3 ret
(*start_routine)(arg);
77e: 8b 45 0c mov 0xc(%ebp),%eax
781: 89 04 24 mov %eax,(%esp)
784: ff 55 08 call *0x8(%ebp)
free(stack);
787: 89 1c 24 mov %ebx,(%esp)
78a: e8 31 fe ff ff call 5c0 <free>
exit();
78f: e8 ce fa ff ff call 262 <exit>
794: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
79a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000007a0 <lock_init>:
// initiate a lock
void lock_init(struct lock_t *lk){
7a0: 55 push %ebp
7a1: 89 e5 mov %esp,%ebp
lk->locked = 0;
7a3: 8b 45 08 mov 0x8(%ebp),%eax
7a6: c7 00 00 00 00 00 movl $0x0,(%eax)
}
7ac: 5d pop %ebp
7ad: c3 ret
7ae: 66 90 xchg %ax,%ax
000007b0 <lock_acquire>:
void lock_acquire(struct lock_t *lk){
7b0: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
7b1: b9 01 00 00 00 mov $0x1,%ecx
7b6: 89 e5 mov %esp,%ebp
7b8: 8b 55 08 mov 0x8(%ebp),%edx
7bb: 90 nop
7bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
7c0: 89 c8 mov %ecx,%eax
7c2: f0 87 02 lock xchg %eax,(%edx)
while(xchg(&lk->locked, 1) != 0);//atmoic language
7c5: 85 c0 test %eax,%eax
7c7: 75 f7 jne 7c0 <lock_acquire+0x10>
}
7c9: 5d pop %ebp
7ca: c3 ret
7cb: 90 nop
7cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000007d0 <lock_release>:
void lock_release(struct lock_t *lk){
7d0: 55 push %ebp
7d1: 31 c0 xor %eax,%eax
7d3: 89 e5 mov %esp,%ebp
7d5: 8b 55 08 mov 0x8(%ebp),%edx
7d8: f0 87 02 lock xchg %eax,(%edx)
xchg(&lk->locked, 0);
7db: 5d pop %ebp
7dc: c3 ret
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/ada_get_targ.adb | djamal2727/Main-Bearing-Analytical-Model | 0 | 11507 | <filename>Validation/pyFrame3DD-master/gcc-master/gcc/ada/ada_get_targ.adb<gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G E T _ T A R G --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
------------------------------------------------------------------------------
-- Version shared by various Ada based back-ends (e.g. gnat2scil, gnat2why)
with System.OS_Lib; use System.OS_Lib;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
package body Get_Targ is
-----------------------
-- Get_Bits_Per_Unit --
-----------------------
function Get_Bits_Per_Unit return Pos is
begin
return 8;
end Get_Bits_Per_Unit;
-----------------------
-- Get_Bits_Per_Word --
-----------------------
function Get_Bits_Per_Word return Pos is
begin
return 32;
end Get_Bits_Per_Word;
-------------------
-- Get_Char_Size --
-------------------
function Get_Char_Size return Pos is
begin
return 8;
end Get_Char_Size;
----------------------
-- Get_Wchar_T_Size --
----------------------
function Get_Wchar_T_Size return Pos is
begin
return 16;
end Get_Wchar_T_Size;
--------------------
-- Get_Short_Size --
--------------------
function Get_Short_Size return Pos is
begin
return 16;
end Get_Short_Size;
------------------
-- Get_Int_Size --
------------------
function Get_Int_Size return Pos is
begin
return 32;
end Get_Int_Size;
-------------------
-- Get_Long_Size --
-------------------
function Get_Long_Size return Pos is
begin
return 64;
end Get_Long_Size;
------------------------
-- Get_Long_Long_Size --
------------------------
function Get_Long_Long_Size return Pos is
begin
return 64;
end Get_Long_Long_Size;
----------------------
-- Get_Pointer_Size --
----------------------
function Get_Pointer_Size return Pos is
begin
return 64;
end Get_Pointer_Size;
---------------------------
-- Get_Maximum_Alignment --
---------------------------
function Get_Maximum_Alignment return Pos is
begin
return 4;
end Get_Maximum_Alignment;
------------------------------------
-- Get_System_Allocator_Alignment --
------------------------------------
function Get_System_Allocator_Alignment return Nat is
begin
return 1;
end Get_System_Allocator_Alignment;
------------------------
-- Get_Float_Words_BE --
------------------------
function Get_Float_Words_BE return Nat is
begin
return 1;
end Get_Float_Words_BE;
------------------
-- Get_Words_BE --
------------------
function Get_Words_BE return Nat is
begin
return 1;
end Get_Words_BE;
------------------
-- Get_Bytes_BE --
------------------
function Get_Bytes_BE return Nat is
begin
return 1;
end Get_Bytes_BE;
-----------------
-- Get_Bits_BE --
-----------------
function Get_Bits_BE return Nat is
begin
return 1;
end Get_Bits_BE;
---------------------
-- Get_Short_Enums --
---------------------
function Get_Short_Enums return Int is
begin
return 0;
end Get_Short_Enums;
--------------------------
-- Get_Strict_Alignment --
--------------------------
function Get_Strict_Alignment return Nat is
begin
return 1;
end Get_Strict_Alignment;
--------------------------------
-- Get_Double_Float_Alignment --
--------------------------------
function Get_Double_Float_Alignment return Nat is
begin
return 0;
end Get_Double_Float_Alignment;
---------------------------------
-- Get_Double_Scalar_Alignment --
---------------------------------
function Get_Double_Scalar_Alignment return Nat is
begin
return 0;
end Get_Double_Scalar_Alignment;
-----------------------------
-- Get_Max_Unaligned_Field --
-----------------------------
function Get_Max_Unaligned_Field return Pos is
begin
return 64; -- Can be different on some targets (e.g., AAMP)
end Get_Max_Unaligned_Field;
----------------------
-- Digits_From_Size --
----------------------
function Digits_From_Size (Size : Pos) return Pos is
begin
case Size is
when 32 => return 6;
when 48 => return 9;
when 64 => return 15;
when 96 => return 18;
when 128 => return 18;
when others => raise Program_Error;
end case;
end Digits_From_Size;
-----------------------------
-- Register_Back_End_Types --
-----------------------------
procedure Register_Back_End_Types (Call_Back : Register_Type_Proc) is
Float_Str : C_String := (others => ASCII.NUL);
Double_Str : C_String := (others => ASCII.NUL);
begin
Float_Str (Float_Str'First .. Float_Str'First + 4) := "float";
Call_Back
(C_Name => Float_Str, Digs => 6, Complex => False, Count => 0,
Float_Rep => IEEE_Binary,
Precision => 32, Size => 32, Alignment => 32);
Double_Str (Double_Str'First .. Double_Str'First + 5) := "double";
Call_Back
(C_Name => Double_Str,
Digs => 15,
Complex => False,
Count => 0,
Float_Rep => IEEE_Binary,
Precision => 64,
Size => 64,
Alignment => 64);
end Register_Back_End_Types;
---------------------
-- Width_From_Size --
---------------------
function Width_From_Size (Size : Pos) return Pos is
begin
case Size is
when 8 => return 4;
when 16 => return 6;
when 32 => return 11;
when 64 => return 21;
when others => raise Program_Error;
end case;
end Width_From_Size;
------------------------------
-- Get_Back_End_Config_File --
------------------------------
function Get_Back_End_Config_File return String_Ptr is
function Exec_Name return String;
-- Return name of the current executable (from argv[0])
function Get_Target_File (Dir : String) return String_Ptr;
-- Return Dir & "target.atp" if found, null otherwise
---------------
-- Exec_Name --
---------------
function Exec_Name return String is
type Arg_Array is array (Nat) of Big_String_Ptr;
type Arg_Array_Ptr is access all Arg_Array;
gnat_argv : Arg_Array_Ptr;
pragma Import (C, gnat_argv);
begin
for J in 1 .. Natural'Last loop
if gnat_argv (0) (J) = ASCII.NUL then
return gnat_argv (0) (1 .. J - 1);
end if;
end loop;
raise Program_Error;
end Exec_Name;
---------------------
-- Get_Target_File --
---------------------
function Get_Target_File (Dir : String) return String_Ptr is
F : constant String := Dir & "target.atp";
begin
if Is_Regular_File (F) then
return new String'(F);
else
return null;
end if;
end Get_Target_File;
Exec : constant String := Exec_Name;
-- Start of processing for Get_Back_End_Config_File
begin
if Is_Absolute_Path (Exec) then
return Get_Target_File (Dir_Name (Exec));
else
return Get_Target_File (Dir_Name (Locate_Exec_On_Path (Exec).all));
end if;
end Get_Back_End_Config_File;
end Get_Targ;
|
memsim-master/src/variance.ads | strenkml/EE368 | 0 | 11504 | <reponame>strenkml/EE368
generic
type T is digits <>;
package Variance is
type Variance_Type is private;
procedure Reset(v : in out Variance_Type);
procedure Update(v : in out Variance_Type;
value : in T);
function Get_Variance(v : Variance_Type) return T;
private
type Variance_Type is record
sample_count : Long_Integer := 0;
sum : T := 0.0;
sum_squares : T := 0.0;
end record;
end Variance;
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/___ulonglong2fs_callee.asm | jpoikela/z88dk | 640 | 3137 | <reponame>jpoikela/z88dk
SECTION code_clib
SECTION code_fp_math48
PUBLIC ___ulonglong2fs_callee
EXTERN cm48_sdcciyp_ulonglong2ds_callee
defc ___ulonglong2fs_callee = cm48_sdcciyp_ulonglong2ds_callee
|
Cubical/Algebra/CommRing/Instances/UnivariatePoly.agda | guilhermehas/cubical | 1 | 11976 | <filename>Cubical/Algebra/CommRing/Instances/UnivariatePoly.agda
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Instances.UnivariatePoly where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat using (ℕ ; zero ; suc)
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.Polynomials.Univariate.Base
open import Cubical.Algebra.Polynomials.Univariate.Properties
private
variable
ℓ : Level
UnivariatePoly : (CommRing ℓ) → CommRing ℓ
UnivariatePoly R = (PolyMod.Poly R) , str
where
open CommRingStr --(snd R)
str : CommRingStr (PolyMod.Poly R)
0r str = PolyModTheory.0P R
1r str = PolyModTheory.1P R
_+_ str = PolyModTheory._Poly+_ R
_·_ str = PolyModTheory._Poly*_ R
- str = PolyModTheory.Poly- R
isCommRing str = makeIsCommRing (PolyMod.isSetPoly R)
(PolyModTheory.Poly+Assoc R)
(PolyModTheory.Poly+Rid R)
(PolyModTheory.Poly+Inverses R)
(PolyModTheory.Poly+Comm R)
(PolyModTheory.Poly*Associative R)
(PolyModTheory.Poly*Rid R)
(PolyModTheory.Poly*LDistrPoly+ R)
(PolyModTheory.Poly*Commutative R)
nUnivariatePoly : (A' : CommRing ℓ) → (n : ℕ) → CommRing ℓ
nUnivariatePoly A' zero = A'
nUnivariatePoly A' (suc n) = UnivariatePoly (nUnivariatePoly A' n)
|
oeis/020/A020447.asm | neoneye/loda-programs | 11 | 28723 | <reponame>neoneye/loda-programs
; A020447: Expansion of 1/((1-5x)(1-8x)(1-11x)).
; Submitted by <NAME>
; 1,24,393,5480,70161,853944,10066393,116192520,1322205921,14898923864,166735197993,1856912289960,20608880226481,228161663489784,2521496249891193,27830232878409800,306882907287251841,3381715508097175704,37246902627265441993,410100204278978264040,4514176545468659762001,49680536864191606445624,546682666802584254426393,6015083437121168421964680,66178510686279430403196961,728064360870669580404803544,8009513917640248271594700393,88111100685996374681600423720,969273688318842174034693556721
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,8
sub $2,9
mul $3,11
add $3,$1
mul $1,5
add $1,1
add $1,$2
lpe
mov $0,$3
div $0,8
|
examples/src/examples-match_patterns.ads | TNO/Rejuvenation-Ada | 1 | 23941 | <reponame>TNO/Rejuvenation-Ada<gh_stars>1-10
package Examples.Match_Patterns is
procedure Demo;
end Examples.Match_Patterns;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c47004a.ada | best08618/asylo | 7 | 21814 | -- C47004A.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.
--*
-- WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION DENOTES AN INTEGER
-- TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN THE VALUE OF THE
-- OPERAND DOES NOT LIE WITHIN THE RANGE OF THE TYPE MARK.
-- RJW 7/23/86
WITH REPORT; USE REPORT;
PROCEDURE C47004A IS
BEGIN
TEST( "C47004A", "WHEN THE TYPE MARK IN A QUALIFIED " &
"EXPRESSION DENOTES AN INTEGER " &
"TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED " &
"WHEN THE VALUE OF THE OPERAND DOES NOT LIE " &
"WITHIN THE RANGE OF THE TYPE MARK" );
DECLARE
TYPE INT IS RANGE -10 .. 10;
SUBTYPE SINT IS INT RANGE -5 .. 5;
FUNCTION IDENT (I : INT) RETURN INT IS
BEGIN
RETURN INT (IDENT_INT (INTEGER (I)));
END;
BEGIN
IF SINT'(IDENT (10)) = 5 THEN
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SINT - 1");
ELSE
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SINT - 2");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
"OF SUBTYPE SINT" );
END;
DECLARE
SUBTYPE SINTEGER IS INTEGER RANGE -10 .. 10;
BEGIN
IF SINTEGER'(IDENT_INT (20)) = 15 THEN
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SINTEGER - 1");
ELSE
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SINTEGER - 2");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
"OF SUBTYPE SINTEGER" );
END;
DECLARE
TYPE NINTEGER IS NEW INTEGER;
SUBTYPE SNINT IS NINTEGER RANGE -10 .. 10;
FUNCTION IDENT (I : NINTEGER) RETURN NINTEGER IS
BEGIN
RETURN NINTEGER (IDENT_INT (INTEGER (I)));
END;
BEGIN
IF SNINT'(IDENT (-20)) = -10 THEN
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SNINT - 1");
ELSE
FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
"SUBTYPE SNINT - 2");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
"OF SUBTYPE SNINT" );
END;
RESULT;
END C47004A;
|
oeis/138/A138632.asm | neoneye/loda-programs | 11 | 101627 | <reponame>neoneye/loda-programs
; A138632: Nonnegative integers k such that 17*k+9 is prime.
; Submitted by <NAME>
; 2,10,16,20,22,34,44,50,62,64,76,86,94,100,104,106,110,112,122,134,140,142,152,160,164,176,184,194,206,212,226,230,236,244,250,254,262,286,292,310,314,316,320,322,332,344,362,364,370,374,380,386,392,406,412,440,442,446,454,460,476,484,502,512,514,520,526,544,556,566,572,574,590,596,602,626,632,640,644,650,652,656,670,674,694,700,706,712,734,740,770,784,806,826,832,836,842,856,860,866
mov $2,$0
add $2,6
pow $2,2
mov $4,8
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,34
lpe
mov $0,$4
sub $0,42
div $0,17
add $0,2
|
Scheduling.g4 | FNicon/IF4150_DSL_Schedule | 0 | 5096 | <reponame>FNicon/IF4150_DSL_Schedule<filename>Scheduling.g4<gh_stars>0
grammar Scheduling;
ID : [a-zA-Z]+ ; // match lower-case identifiers
NUM : [0-9]+ ;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
command : (create|set|allocate)+;
create : 'create' entity;
allocate : 'allocate' room course class_num allocate_property;
class_num : 'class' NUM;
allocate_property : schedule_day schedule_hour;
entity : schedule schedule_property
|constraint|room room_property|facility|course course_property|lecturer;
schedule : 'schedule' ID;
schedule_property : schedule_day schedule_hour schedule_start;
schedule_day : 'day' NUM;
schedule_hour : 'hour' NUM;
schedule_start : 'start' NUM;
constraint : 'constraint' ID;
room : 'room' ID;
room_property : room_capacity facility*;
room_capacity : 'capacity' NUM;
facility : 'facility' ID 'count' NUM;
//create_course : 'create' course course_property;
//create_lecturer : 'create' lecturer lecturer_property;
set : 'set' entity;
course : 'course' ID;
course_property : course_year course_duration course_class course_capacity facility* lecturer+;
course_capacity : 'capacity' NUM;
course_year : 'year' NUM;
course_duration : 'duration' NUM;
course_class : 'class' NUM;
lecturer : 'lecturer' ID lecturer_property;
lecturer_property : course*;
property : 'property' ID;
|
src/fot/FOTC/Program/Collatz/Collatz.agda | asr/fotc | 11 | 16525 | <filename>src/fot/FOTC/Program/Collatz/Collatz.agda
------------------------------------------------------------------------------
-- The Collatz function: A function without a termination proof
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Program.Collatz.Collatz where
open import FOTC.Base
open import FOTC.Data.Nat
open import FOTC.Data.Nat.UnaryNumbers
open import FOTC.Program.Collatz.Data.Nat
------------------------------------------------------------------------------
-- The Collatz function.
postulate
collatz : D → D
collatz-0 : collatz 0' ≡ 1'
collatz-1 : collatz 1' ≡ 1'
collatz-even : ∀ {n} → Even (succ₁ (succ₁ n)) →
collatz (succ₁ (succ₁ n)) ≡
collatz (div (succ₁ (succ₁ n)) 2')
collatz-noteven : ∀ {n} → NotEven (succ₁ (succ₁ n)) →
collatz (succ₁ (succ₁ n)) ≡
collatz (3' * (succ₁ (succ₁ n)) + 1')
{-# ATP axioms collatz-0 collatz-1 collatz-even collatz-noteven #-}
|
programs/oeis/062/A062249.asm | karttu/loda | 0 | 91850 | <gh_stars>0
; A062249: a(n) = n + d(n), where d(n) = number of divisors of n, cf. A000005.
; 2,4,5,7,7,10,9,12,12,14,13,18,15,18,19,21,19,24,21,26,25,26,25,32,28,30,31,34,31,38,33,38,37,38,39,45,39,42,43,48,43,50,45,50,51,50,49,58,52,56,55,58,55,62,59,64,61,62,61,72,63,66,69,71,69,74,69,74,73,78,73,84,75,78,81,82,81,86,81,90,86,86,85,96,89,90,91,96,91,102,95,98,97,98,99,108,99,104,105,109,103,110,105,112,113,110,109,120,111,118,115,122,115,122,119,122,123,122,123,136,124,126,127,130,129,138,129,136,133,138,133,144,137,138,143,144,139,146,141,152,145,146,147,159,149,150,153,154,151,162,153,160,159,162,159,168,159,162,163,172,165,172,165,170,173,170,169,184,172,178,177,178,175,182,181,186,181,182,181,198,183,190,187,192,189,194,191,194,197,198,193,206,195,198,203,205,199,210,201,212,205,206,207,216,209,210,213,218,213,226,213,218,217,218,219,232,221,222,223,232,225,230,225,236,234,230,229,240,231,238,239,240,235,246,239,242,241,246,241,260,243,248,249,250,251,254,251,256,253,258
mov $5,2
mov $6,$0
mov $7,$0
lpb $5,1
sub $5,1
add $0,$5
sub $0,1
mov $2,$0
mov $4,$0
mov $8,2
lpb $2,1
add $4,2
lpb $4,1
trn $4,$2
add $8,1
lpe
sub $2,1
add $4,$0
lpe
mov $3,$5
lpb $3,1
mov $1,$8
sub $3,1
lpe
lpe
lpb $7,1
sub $1,$8
mov $7,0
lpe
add $1,$6
|
programs/oeis/252/A252736.asm | neoneye/loda | 22 | 4725 | <filename>programs/oeis/252/A252736.asm
; A252736: a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).
; 0,0,0,1,0,1,0,2,1,1,0,2,0,1,1,3,0,2,0,2,1,1,0,3,1,1,2,2,0,2,0,4,1,1,1,3,0,1,1,3,0,2,0,2,2,1,0,4,1,2,1,2,0,3,1,3,1,1,0,3,0,1,2,5,1,2,0,2,1,2,0,4,0,1,2,2,1,2,0,4,3,1,0,3,1,1,1,3,0,3,1,2,1,1,1,5,0,2,2,3
lpb $0
seq $0,117818 ; a(n) = n if n is 1 or a prime, otherwise a(n) = n divided by the least prime factor of n (A032742(n)).
sub $0,1
add $1,2
lpe
div $1,2
mov $0,$1
|
Driver/Printer/PrintCom/Styles/stylesSRCondensed.asm | steakknife/pcgeos | 504 | 178917 | <reponame>steakknife/pcgeos
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Print Drivers
FILE: stylesSRCondensed.asm
AUTHOR: <NAME>
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 3/21/92 Initial revision from epson24Styles.asm
DC_ESCRIPTION:
$Id: stylesSRCondensed.asm,v 1.1 97/04/18 11:51:46 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetCondensed proc near
mov si, offset cs:pr_codes_SetCondensed
jmp SendCodeOut
SetCondensed endp
ResetCondensed proc near
mov si,offset cs:pr_codes_ResetCondensed
jmp SendCodeOut
ResetCondensed endp
|
source/units/program-units-vectors.ads | optikos/oasis | 0 | 12945 | -- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Ada.Containers.Vectors;
with Program.Compilation_Unit_Vectors;
package Program.Units.Vectors is
pragma Preelaborate;
type Unit_Vector is limited new
Program.Compilation_Unit_Vectors.Compilation_Unit_Vector with private;
procedure Clear (Self : in out Unit_Vector);
procedure Append
(Self : in out Unit_Vector;
Value : not null Program.Compilation_Units.Compilation_Unit_Access);
private
package Unit_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => Program.Compilation_Units.Compilation_Unit_Access,
"=" => Program.Compilation_Units."=");
type Unit_Vector is limited new
Program.Compilation_Unit_Vectors.Compilation_Unit_Vector with
record
Data : Unit_Vectors.Vector;
end record;
overriding function Get_Length (Self : Unit_Vector) return Positive;
overriding function Element
(Self : Unit_Vector;
Index : Positive)
return not null Program.Compilation_Units.Compilation_Unit_Access;
overriding function Find_Unit
(Self : Unit_Vector;
Name : Text) return Program.Compilation_Units.Compilation_Unit_Access;
end Program.Units.Vectors;
|
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_lt.asm | Frodevan/z88dk | 640 | 22537 | <reponame>Frodevan/z88dk
SECTION code_fp_math16
PUBLIC l_f16_lt
EXTERN asm_f16_compare_callee
.l_f16_lt
call asm_f16_compare_callee
ret C
dec hl
ret
|
src/kernel/kernel-entry.asm | TheRealJoe24/BrandOS-Legacy | 2 | 177872 | [bits 32]
[extern kmain]
; kernel entry
kernel_entry:
call kmain ; call kernel main function
jmp $ |
smsq/sbas/ressb.asm | olifink/smsqe | 0 | 93796 | ; SuperBASIC reserve SuperBASIC space
section uq
xdef sb_revect
xdef sb_rar32
xdef sb_resar
xdef sb_rbk20
;*** xdef sb_resbk
xdef sb_rgr04
;*** xdef sb_resgr
xdef sb_rnt08
xdef sb_resnt
xdef sb_rrt24
;*** xdef sb_resrt
xdef sb_resbf
xdef sb_rescl
xdef sb_resnl
;*** xdef sb_resdt
xdef sb_resch
;*** xdef sb_resln
xdef sb_ressr
xref sb_insmem
xref sb_error
include 'dev8_keys_sbasic'
include 'dev8_keys_err'
include 'dev8_keys_qdos_sms'
include 'dev8_keys_68000'
include 'dev8_mac_assert'
; The reserve stage post occupies $38+5*6 <$60 bytes
sb_revect
dc.w 2 ; offset of vector entry from start
dc.w sbs_up-sbs_rar32 ; length to copy (excluding vectors)
dc.w 5*6 ; length of vectors to fixup
;+++
; reserve stage posts SuperBASIC d1 bytes (optional), d1/d2/d3 smashed
;---
sbs_rar32
moveq #32,d1 ; the order of these instructions
; ; is critical for compatibility
moveq #sb_arthp,d2 ; with some QL software!!!!
bra.s sbs_dn
moveq #20,d1
moveq #sb_backp,d2
bra.s sbs_dn
moveq #4,d1
moveq #sb_grphp,d2
bra.s sbs_dn
moveq #8,d1
moveq #sb_nmtbp,d2
bra.s sbs_up
moveq #24,d1
moveq #sb_retsp,d2
bra.s sbs_up
bra.s sbs_resbf
bra.s sbs_resbf
bra.s sbs_rescl
bra.s sbs_rescl
moveq #sb_nmlsp,d2
bra.s sbs_up
bra.s sbs_error
bra.s sbs_error
moveq #sb_chanp,d2
bra.s sbs_up
bra.s sbs_error
bra.s sbs_error
sbs_resr
moveq #sb_srcep,d2
addq.l #2,d1 ; extra for spare link pointer
assert sbs_resr-sbs_rar32,$36 ; ensure that staging post matches
sbs_up
dc.w jmp.l
dc.l sbr_up-*
sbs_dn
dc.w jmp.l
dc.l sbr_dn-*
sbs_resbf
dc.w jmp.l
dc.l sb_resbf-*
sbs_rescl
dc.w jmp.l
dc.l sb_rescl-*
sbs_error
dc.w jmp.l
dc.l sb_error-*
;+++
; reserve SuperBASIC d1 bytes (optional), d1/d2/d3 smashed
;---
sb_rar32
moveq #32,d1 ; the order of these instructions
sb_resar ; is critical to the compatibility
moveq #sb_arthp,d2 ; with some QL software!!!!
bra.s sbr_dn
sb_rbk20
moveq #20,d1
sb_resbk
moveq #sb_backp,d2
bra.s sbr_dn
sb_rgr04
moveq #4,d1
sb_resgr
moveq #sb_grphp,d2
bra.s sbr_dn
sb_rnt08
moveq #8,d1
sb_resnt
moveq #sb_nmtbp,d2
bra.s sbr_up
sb_rrt24
moveq #24,d1
sb_resrt
moveq #sb_retsp,d2
bra.s sbr_up
; sb_resbf
bra.l sb_resbf
; sb_rescl
bra.l sb_rescl
sb_resnl
moveq #sb_nmlsp,d2
bra.s sbr_up
; sb_resdt
bra.l sb_error
sb_resch
moveq #sb_chanp,d2
bra.s sbr_up
; sb_resln
bra.l sb_error
sb_ressr
moveq #sb_srcep,d2
addq.l #2,sb_srcep(a6) ; extra for spare link pointer
bsr.s sbr_up
subq.l #2,sb_srcep(a6)
rts
sbr_dn
cmp.l #sb.flag,sb_flag(a6) ; SBASIC?
bne.s sbr_nop
sub.l 0(a6,d2.l),d1 ; -(pointer - required)
add.l sb.loffp(a6,d2.l),d1 ; lower limit -(pointer - required)
bgt.s sbr_alldn
rts
sbr_up
cmp.l #sb.flag,sb_flag(a6) ; SBASIC?
bne.s sbr_nop
add.l 0(a6,d2.l),d1 ; pointer + required
sub.l sb.toffp(a6,d2.l),d1 ; (pointer + required) - top
bgt.s sbr_allup
sbr_nop
rts
sbr_alldn
move.l sb.bofpd(a6,d2.l),d0
sub.l sb.loffp(a6,d2.l),d0
add.l d0,d1 ; total size size required
lsr.l #2,d0 ; 25% spare
add.l d0,d1
add.l #sb.alinc-1+sb.dnspr+sb.dnspr,d1 ; arbitrary round up factor
and.w #-sb.alinc,d1 ; allocation rounded up
move.l d1,d3 ; to be kept
sbra.rge reg d2/a0/a1
sbra.rgx reg a0/a1
movem.l sbra.rge,-(sp)
moveq #sms.achp,d0 ; allocate new heap
moveq #-1,d2
trap #do.sms2
tst.l d0 ; **** new this - SMSQ does not set cc
bne.l sb_insmem
move.l (sp)+,d2
exg d3,a0 ; d3 is new limit
add.l d3,a0 ; ... a0 is new base
move.w #sb.dnspr,a1 ; spare above base
add.l sb.bofpd(a6,d2.l),a1 ; old base
moveq #$1f,d0
add.l a1,d0
sub.l (a6,d2.l),d0 ; old size
lsr.l #5,d0 ; /32, rounded up
add.l a6,a1
assert sb.alinc&$1f,0 ; ensure allocation is n*32
sbr_mvdn
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
move.l -(a1),-(a0)
subq.l #1,d0
bgt.s sbr_mvdn
move.l a0,d0
sub.l a1,d0 ; amount area has moved
add.l d0,(a6,d2.l) ; adjust pointer
add.l d0,sb.bofpd(a6,d2.l) ; and base
move.l sb.loffp(a6,d2.l),a0 ; old limit is base of memory + a bit
lea -sb.dnspr(a6,a0.l),a0 ; absolute to be released
sub.l a6,d3
add.l #sb.dnspr,d3 ; a bit of spare below
move.l d3,sb.loffp(a6,d2.l) ; new relative limit
bra.s sbr_retb ; and return old memory block
sbr_allup
move.l sb.toffp(a6,d2.l),d0
sub.l sb.bofpu(a6,d2.l),d0
add.l d0,d1 ; total size size required
lsr.l #2,d0 ; 25% spare
add.l d0,d1
sbr_allui
moveq #sb.alinc-1,d0 ; arbitrary round up factor
add.l d0,d1
and.w #-sb.alinc,d1 ; allocation rounded up
move.l d1,d3 ; to be kept
movem.l sbra.rge,-(sp)
moveq #sms.achp,d0 ; allocate new heap
moveq #-1,d2
trap #do.sms2
tst.l d0 ; **** new this - SMSQ does not set cc
bne.l sb_insmem
move.l (sp)+,d2
add.l a0,d3 ; ... new top
sub.l a6,d3
move.l d3,sb.toffp(a6,d2.l) ; new relative top
move.l sb.bofpu(a6,d2.l),a1 ; old base
moveq #31,d0
add.l (a6,d2.l),d0
sub.l a1,d0 ; old size
assert sb.alinc&$1f,0 ; ensure allocation is n*32
lsr.l #5,d0 ; /32, rounded up
add.l a6,a1 ; absolute base
move.l a1,d3 ; ... keep it
sbr_mvup
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
subq.l #1,d0
bgt.s sbr_mvup
move.l a0,d0
sub.l a1,d0 ; amount area has moved
add.l d0,(a6,d2.l) ; adjust pointer
add.l d0,sb.bofpu(a6,d2.l) ; and other pointer
move.l d3,a0
sbr_retb
cmp.l a6,a0 ; allocation in SBASIC?
blo.s sbr_retdo ; ... no
cmp.l sp,a0
blo.s sbr_rtr ; ... yes, do not return it
sbr_retdo
moveq #sms.rchp,d0
trap #do.sms2
sbr_rtr
movem.l (sp)+,sbra.rgx
sbr_rts
rts
sb_rescl
add.l sb_cmdlp(a6),d1 ; command line pointer + required
sub.l sb_cmdlt(a6),d1 ; enough room?
ble.s sbr_rts ; ... yes
sbr_cl
move.l sb_buffb(a6),d0
move.l d0,sb_cmdlb(a6) ; expand buffer+command line
add.l sb_cmdlt(a6),d1
sub.l d0,d1 ; total size
moveq #sb_cmdlp,d2
bsr sbr_allui
move.l sb_cmdlb(a6),d0 ; new buffer base
move.l sb_buffb(a6),d1
move.l d0,sb_buffb(a6)
sub.l d1,d0 ; distance moved
add.l d0,sb_buffp(a6) ; new buffer pointer
add.l d0,sb_bufft(a6) ; new buffer top
move.l sb_bufft(a6),sb_cmdlb(a6) ; is new command line base
rts
sb_resbf
add.l sb_buffp(a6),d1 ; buffer pointer + required
sub.l sb_bufft(a6),d1 ; enough room?
ble.s sbr_rts ; ... yes
move.l sb_cmdlt(a6),d0 ; old command line top
sub.l sb_cmdlb(a6),d0 ; old command line allowance
move.l d0,-(sp)
bsr.s sbr_cl ; reserve buffer and command line
move.l (sp)+,d1 ; the old allocation
movem.l a0/a1,-(sp)
move.l sb_cmdlt(a6),a1 ; this is the new command line top
move.l a1,d0
sub.l d1,d0 ; from the new top, gives the new base
sub.l sb_cmdlb(a6),d0 ; ... the distance to move
add.l d0,sb_cmdlb(a6) ; update the pointers
add.l d0,sb_cmdlp(a6)
add.l d0,sb_bufft(a6)
add.l a6,a1 ; new top absolute
move.l a1,a0 ; from here
sub.l d0,a0
sbr_clup
move.l -(a0),-(a1)
move.l -(a0),-(a1)
subq.l #8,d1
bgt.s sbr_clup
movem.l (sp)+,a0/a1
rts
end
|
alloy4fun_models/trashltl/models/15/S99Ps5QptDBwSvBMg.als | Kaixi26/org.alloytools.alloy | 0 | 3376 | open main
pred idS99Ps5QptDBwSvBMg_prop16 {
all f : (File & Protected) | historically (f in Protected)
}
pred __repair { idS99Ps5QptDBwSvBMg_prop16 }
check __repair { idS99Ps5QptDBwSvBMg_prop16 <=> prop16o } |
src/unison/test/fast/Mips/size/h264ref.memalloc.no_mem_exit.asm | Patstrom/disUnison | 88 | 163761 | <reponame>Patstrom/disUnison
.text
.abicalls
.section .mdebug.abi32,"",@progbits
.nan legacy
.file "h264ref.memalloc.no_mem_exit.ll"
.text
.globl no_mem_exit
.align 2
.type no_mem_exit,@function
.set nomicromips
.set nomips16
.ent no_mem_exit
no_mem_exit: # @no_mem_exit
.frame $sp,32,$ra
.mask 0x80030000,-4
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
# BB#0:
lui $2, %hi(_gp_disp)
addiu $2, $2, %lo(_gp_disp)
addiu $sp, $sp, -32
sw $ra, 28($sp) # 4-byte Folded Spill
sw $17, 24($sp) # 4-byte Folded Spill
sw $16, 20($sp) # 4-byte Folded Spill
addu $16, $2, $25
move $1, $4
lw $17, %got(errortext)($16)
lw $6, %got(.str.20)($16)
lw $25, %call16(snprintf)($16)
move $4, $17
addiu $5, $zero, 300
move $7, $1
jalr $25
move $gp, $16
lw $25, %call16(error)($16)
move $4, $17
addiu $5, $zero, 100
jalr $25
move $gp, $16
lw $16, 20($sp) # 4-byte Folded Reload
lw $17, 24($sp) # 4-byte Folded Reload
lw $ra, 28($sp) # 4-byte Folded Reload
jr $ra
addiu $sp, $sp, 32
.set at
.set macro
.set reorder
.end no_mem_exit
$func_end0:
.size no_mem_exit, ($func_end0)-no_mem_exit
.hidden .str.20
.ident "clang version 3.8.0 (http://llvm.org/git/clang.git 2d49f0a0ae8366964a93e3b7b26e29679bee7160) (http://llvm.org/git/llvm.git 60bc66b44837125843b58ed3e0fd2e6bb948d839)"
.section ".note.GNU-stack","",@progbits
.text
|
programs/oeis/004/A004773.asm | neoneye/loda | 22 | 1370 | <filename>programs/oeis/004/A004773.asm
; A004773: Numbers congruent to {0, 1, 2} mod 4: a(n) = floor(4*n/3).
; 0,1,2,4,5,6,8,9,10,12,13,14,16,17,18,20,21,22,24,25,26,28,29,30,32,33,34,36,37,38,40,41,42,44,45,46,48,49,50,52,53,54,56,57,58,60,61,62,64,65,66,68,69,70,72,73,74,76,77,78,80,81,82,84,85,86,88,89,90,92,93,94,96,97,98,100,101,102,104,105,106,108,109,110,112,113,114,116,117,118,120,121,122,124,125,126,128,129,130,132
mul $0,4
div $0,3
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_6_962.asm | ljhsiun2/medusa | 9 | 15964 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x16872, %r8
nop
nop
nop
nop
nop
lfence
mov (%r8), %r14d
nop
nop
nop
nop
inc %rsi
lea addresses_WC_ht+0xb072, %r8
clflush (%r8)
nop
and $39087, %r13
movb (%r8), %r10b
nop
nop
xor %r8, %r8
lea addresses_A_ht+0x1e472, %rax
nop
cmp %r14, %r14
mov (%rax), %r10
nop
nop
nop
dec %r8
lea addresses_UC_ht+0xeaf4, %rsi
lea addresses_normal_ht+0xbe72, %rdi
clflush (%rsi)
nop
nop
nop
and $64839, %r14
mov $70, %rcx
rep movsw
nop
nop
nop
add %rcx, %rcx
lea addresses_D_ht+0x1ada6, %r13
xor %rcx, %rcx
mov (%r13), %r14
nop
nop
nop
nop
sub $57913, %r14
lea addresses_D_ht+0x17c82, %rax
nop
nop
and %rsi, %rsi
movups (%rax), %xmm7
vpextrq $1, %xmm7, %r8
nop
nop
nop
nop
nop
add $64165, %r13
lea addresses_UC_ht+0x1c3a2, %rsi
lea addresses_A_ht+0x472, %rdi
nop
nop
nop
nop
nop
xor %rax, %rax
mov $19, %rcx
rep movsb
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0x8072, %rax
xor $11936, %r10
mov $0x6162636465666768, %rcx
movq %rcx, %xmm1
vmovups %ymm1, (%rax)
nop
nop
nop
nop
nop
sub $8380, %r10
lea addresses_A_ht+0xb872, %rsi
lea addresses_A_ht+0x6e3a, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %r8, %r8
mov $57, %rcx
rep movsq
nop
nop
nop
and $52431, %rcx
lea addresses_D_ht+0x1d722, %rax
nop
nop
nop
xor %r10, %r10
movb (%rax), %r14b
nop
nop
and %rsi, %rsi
lea addresses_normal_ht+0xad8, %rsi
lea addresses_WC_ht+0x1e072, %rdi
nop
nop
nop
nop
nop
mfence
mov $50, %rcx
rep movsq
nop
nop
nop
nop
xor %r13, %r13
lea addresses_WC_ht+0xebb2, %r13
nop
nop
nop
add $54033, %rcx
movl $0x61626364, (%r13)
nop
nop
nop
cmp %r14, %r14
lea addresses_A_ht+0x2132, %rsi
lea addresses_A_ht+0x75f2, %rdi
nop
nop
nop
nop
nop
add %rax, %rax
mov $3, %rcx
rep movsq
nop
nop
nop
dec %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %r9
push %rbp
// Store
mov $0x574f1e0000000672, %r9
nop
nop
nop
nop
xor $49472, %r11
movb $0x51, (%r9)
nop
nop
sub %r11, %r11
// Store
lea addresses_PSE+0x8472, %r11
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm5
movups %xmm5, (%r11)
nop
nop
cmp %r10, %r10
// Faulty Load
lea addresses_normal+0xa072, %r12
nop
nop
nop
nop
and %rbp, %rbp
movups (%r12), %xmm7
vpextrq $1, %xmm7, %r10
lea oracles, %rbp
and $0xff, %r10
shlq $12, %r10
mov (%rbp,%r10,1), %r10
pop %rbp
pop %r9
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'34': 6}
34 34 34 34 34 34
*/
|
programs/oeis/000/A000120.asm | neoneye/loda | 22 | 11102 | ; A000120: 1's-counting sequence: number of 1's in binary expansion of n (or the binary weight of n).
; 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4
mov $1,$0
lpb $0
div $1,2
sub $0,$1
lpe
|
nasm assembly/library/longest rep sub seq.asm | AI-Factor-y/NASM-library | 0 | 7684 |
long_rep_sseq:
;; longest repeating subsequence
;; string base address in ebx
;; result in long_rep_len
;; string length in string_len
section .bss
dp: resd 10000
row_size: resd 1
col_size: resd 1
sseq_i: resd 1
sseq_j: resd 1
long_rep_len: resd 1
section .text
push rax
push rbx
push rcx
push rdx
mov eax, [string_len]
inc eax
mov [row_size], eax
mov [col_size], eax
push rbx
mov ebx, dp
call set_mat_to_zero
pop rbx
mov dword[sseq_i],1
sseq_loop_1:
mov ax, word[sseq_i]
cmp ax, word[string_len]
ja exit_sseq_loop_1
mov dword[sseq_j],1
sseq_loop_2:
; push rbx
; mov ebx, dp
; call print_matrix
; pop rbx
mov ax, word[sseq_j]
cmp ax, word[string_len]
ja exit_sseq_loop_2
mov eax, [sseq_i]
dec eax
mov cl, byte[ebx+eax]
mov eax, [sseq_j]
dec eax
mov dl, byte[ebx+eax]
cmp cl, dl
jne sseq_else
mov eax, [sseq_i]
mov ecx, [sseq_j]
cmp eax, ecx
je sseq_else
; if case
push rbx
mov ebx, dp
mov eax, [sseq_i]
dec eax
mov ecx, [sseq_j]
dec ecx
call get_elem
mov word[num],cx
inc cx
mov dx,cx
mov eax, [sseq_i]
mov ecx, [sseq_j]
call put_elem
pop rbx
jmp exit_sseq_if_else
sseq_else: ; else case
push rbx
mov ebx, dp
mov eax, [sseq_i]
mov ecx, [sseq_j]
dec ecx
call get_elem
mov word[find_max_1],cx
mov eax, [sseq_i]
dec eax
mov ecx, [sseq_j]
call get_elem
mov word[find_max_2],cx
call find_max
mov dx , word[find_max_max]
mov eax, [sseq_i]
mov ecx, [sseq_j]
call put_elem
pop rbx
exit_sseq_if_else:
inc dword[sseq_j]
jmp sseq_loop_2
exit_sseq_loop_2:
inc dword[sseq_i]
jmp sseq_loop_1
exit_sseq_loop_1:
push rbx
mov ebx, dp
mov eax, [string_len]
mov ecx, [string_len]
call get_elem
mov word[long_rep_len], cx
pop rbx
pop rdx
pop rcx
pop rbx
pop rax
ret
|
examples/examplesPaperJFP/NativeIOSafe.agda | agda/ooAgda | 23 | 1457 | module examplesPaperJFP.NativeIOSafe where
open import Data.Maybe.Base using (Maybe; nothing; just) public
open import Data.String.Base using (String) public
record Unit : Set where
constructor unit
{-# COMPILE GHC Unit = () #-}
postulate
NativeIO : Set → Set
nativeReturn : {A : Set} → A → NativeIO A
_native>>=_ : {A B : Set} → NativeIO A → (A → NativeIO B) → NativeIO B
{-# BUILTIN IO NativeIO #-}
{-# COMPILE GHC NativeIO = IO #-} -- IO.FF-I.AgdaIO
{-# COMPILE GHC _native>>=_ = (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
{-# COMPILE GHC nativeReturn = (\_ -> return :: a -> IO a) #-}
postulate
nativeGetLine : NativeIO (Maybe String)
nativePutStrLn : String → NativeIO Unit
{-# FOREIGN GHC import Data.Text #-}
{-# FOREIGN GHC import System.IO.Error #-}
{-# COMPILE GHC nativePutStrLn = (\ s -> putStrLn (Data.Text.unpack s)) #-}
{-# COMPILE GHC nativeGetLine = (fmap (Just . Data.Text.pack) getLine `System.IO.Error.catchIOError` \ err -> if System.IO.Error.isEOFError err then return Nothing else ioError err) #-}
|
src/main/antlr4/Koord.g4 | cyphyhouse/KoordLanguage | 3 | 7170 |
grammar Koord;
tokens { INDENT, DEDENT }
@lexer::header {
import java.util.*;
}
@lexer::members { //this must be put on the top, and not after the grammar rules
// modified from https://github.com/antlr/grammars-v4/blob/master/python3/Python3.g4
private int prevNumSpaces = 0;
private Queue<Token> tokens = new LinkedList<>();
private Deque<Integer> spaces = new LinkedList<>();
@Override
public void emit(Token t) {
super.setToken(t);
//System.out.println("added token" + t.toString());
tokens.offer(t);
}
private CommonToken commonToken(int type, String text) {
int stop = this.getCharIndex() - 1;
int start = text.isEmpty() ? stop : stop - text.length() + 1;
CommonToken t = new CommonToken(this._tokenFactorySourcePair, type, DEFAULT_TOKEN_CHANNEL, start, stop);
t.setText(text);
return t;
}
@Override
public Token nextToken() {
if (_input.LA(1) == EOF && !spaces.isEmpty()) {
if (spaces.peek() != 0) {
emit(commonToken(KoordParser.NEWLINE, "<newline>"));
while (spaces.peek() != 0) {
spaces.poll();
emit(commonToken(KoordParser.DEDENT, "dedent"));
}
}
}
Token next = super.nextToken();
return tokens.isEmpty() ? next : tokens.poll();
}
}
AGENT: 'agent';
MODULE:'module';
USING : 'using';
DEF: 'def';
TYPE: 'type';
FUN: 'fun';
ADT : 'adt';
FOR : 'for';
ACTUATORS:'actuators';
SENSORS:'sensors';
ALLWRITE:'allwrite';
ALLREAD:'allread';
LOCAL:'local';
LIST:'list';
MAP:'map';
QUEUE:'queue';
INIT:'init';
INT:'int';
FLOAT:'float';
BOOL:'boolean'; //bool or boolean?
STRINGTYPE:'string';
STREAM : 'stream';
POS:'pos';
INPUTMAP : 'inputMap';
IF:'if';
ELSE:'else';
ATOMIC:'atomic';
PRE:'pre';
EFF:'eff';
TRUE:'true';
FALSE:'false';
PID:'pid'; //keyword of getting the id of this agent
NUMAGENTS:'numAgents'; //keyword for getting the number of participants/agents
STOP : 'stop';
COLON : ':';
COMMA : ',';
SEMICOLON : ';';
LPAR : '(';
RPAR : ')';
LBRACE : '[';
RBRACE : ']';
LCURLY : '{';
RCURLY : '}';
LANGLE : '<';
RANGLE : '>';
AND : '&&' | 'and';
OR : '||' | 'or';
NOT : '!';
fragment LID : [a-z][a-zA-Z0-9]*; //difference betwee lid and cid???
fragment CID : [A-Z][a-zA-Z0-9]*;
UPPER : CID;
VARNAME : LID ('.' LID)* | (CID '.' LID);
INUM : [0-9]+;
FNUM : [0-9]+[.][0-9]+;
PLUS : '+';
MINUS : '-';
TIMES : '*';
BY : '/';
EQ : '==';
GEQ : '>=';
LEQ : '<=';
NEQ : '!=';
ASGN : '=';
LSHIFT : '<<';
STRING : '"' (~('"'))*? '"';
NEWLINE
: '\n' WS?
{
// modified from https://github.com/antlr/grammars-v4/blob/master/python3/Python3.g4
if (spaces.isEmpty()) {
spaces.push(0);
}
Integer numSpaces = (int) getText().chars().filter(x -> x == ' ').count();
if (_input.LA(1) != '\n') {
emit(commonToken(NEWLINE, "<newline>"));
if (numSpaces > spaces.peek()) {
emit(commonToken(KoordParser.INDENT, "<indent>"));
spaces.push(numSpaces);
} else if (spaces.peek() > numSpaces ) {
while (spaces.peek() > numSpaces) {
emit(commonToken(KoordParser.DEDENT, "<dedent>"));
spaces.pop();
}
}
} else {
skip();
}
}
;
SKIP_
: ( WS ) -> skip
;
fragment WS : [ \t]+ ; //should be parsed ?
program : NEWLINE? defs module* (allreadvars | allwritevars | localvars)* init? event+ EOF;
defs : funcdef* adtdef*;
funcdef : DEF FUN VARNAME LPAR param* RPAR COLON NEWLINE statementblock;
adtdef : DEF UPPER COLON NEWLINE INDENT decl+ DEDENT;
param : TYPE VARNAME;
event : VARNAME COLON NEWLINE INDENT PRE COLON expr NEWLINE EFF COLON NEWLINE statementblock DEDENT;
statementblock : INDENT stmt+ DEDENT;
stmt : assign NEWLINE
| funccall NEWLINE
| iostream NEWLINE
| conditional
| forloop
| STOP NEWLINE
| ATOMIC COLON NEWLINE statementblock; //add later
forloop : FOR VARNAME ASGN expr COMMA expr COLON NEWLINE statementblock;
conditional : IF expr COLON NEWLINE statementblock elseblock?;
elseblock : ELSE COLON NEWLINE statementblock;
iostream : VARNAME LSHIFT expr
| iostream LSHIFT expr;
funccall : (VARNAME | UPPER) LPAR (arglist)? RPAR;
arglist : expr (COMMA expr)*;
assign : VARNAME (LBRACE aexpr RBRACE)? ASGN expr; //assume these can't be nested
expr : aexpr | bexpr; //more
bexpr :
NOT bexpr
| LPAR bexpr RPAR
| aexpr relop aexpr
| bexpr AND bexpr
| bexpr OR bexpr
| FALSE
| TRUE
| funccall
| VARNAME
| aexpr
;
aexpr :
LPAR aexpr RPAR
| MINUS aexpr
| aexpr (TIMES | BY) aexpr
| aexpr (PLUS | MINUS) aexpr
| funccall
| constant
| VARNAME LBRACE aexpr RBRACE
| STRING
| VARNAME;
constant : FNUM | INUM | PID | NUMAGENTS;
relop : LANGLE | RANGLE | GEQ | LEQ | EQ | NEQ; //more
allwritevars : ALLWRITE COLON NEWLINE INDENT decl+ DEDENT;
allreadvars : ALLREAD COLON NEWLINE INDENT decl+ DEDENT;
localvars : LOCAL COLON NEWLINE INDENT decl+ DEDENT;
decl : (INT | BOOL | FLOAT | POS | QUEUE | STRINGTYPE | STREAM | UPPER) (arraydec)*/* there might be more */ VARNAME (ASGN expr)? NEWLINE;
arraydec : LBRACE RBRACE;
module : USING UPPER COLON NEWLINE INDENT (actuatordecls sensordecls | sensordecls actuatordecls) DEDENT;
actuatordecls : ACTUATORS COLON NEWLINE INDENT decl+ DEDENT;
sensordecls : SENSORS COLON NEWLINE INDENT decl+ DEDENT;
init : INIT COLON NEWLINE statementblock;
|
serial_port_temp.adb | Rahul24-06/ADA-Line-Follower-using-STM32-Nucleo-64 | 0 | 26433 | <reponame>Rahul24-06/ADA-Line-Follower-using-STM32-Nucleo-64
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- A demonstration of a higher-level USART interface, using non-blocking I/O.
-- The file declares the main procedure for the demonstration.
with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler);
-- The "last chance handler" is the user-defined routine that is called when
-- an exception is propagated. We need it in the executable, therefore it
-- must be somewhere in the closure of the context clauses.
with Peripherals_Nonblocking; use Peripherals_Nonblocking;
with Serial_IO.Nonblocking; use Serial_IO.Nonblocking;
with Message_Buffers; use Message_Buffers;
procedure Demo_Serial_Port_Nonblocking is
Incoming : aliased Message (Physical_Size => 1024); -- arbitrary size
procedure Send (This : String);
procedure Send (This : String) is
Outgoing : aliased Message (Physical_Size => 1024); -- arbitrary size
begin
Set (Outgoing, To => This);
Put (COM, Outgoing'Unchecked_Access);
Await_Transmission_Complete (Outgoing);
-- We must await xmit completion because Put does not wait
end Send;
begin
Initialize (COM);
Configure (COM, Baud_Rate => 115_200);
Send ("Enter text, terminated by CR.");
Set_Terminator (Incoming, To => ASCII.CR);
loop
Get (COM, Incoming'Unchecked_Access);
Await_Reception_Complete (Incoming);
-- We must await reception completion because Get does not wait
Send ("Received : " & Content (Incoming));
end loop;
end Demo_Serial_Port_Nonblocking;
|
Plugins/AppleScript/Add to iTunes.applescript | jmcintyre/metaz | 235 | 4006 | <filename>Plugins/AppleScript/Add to iTunes.applescript
using terms from application "MetaZ"
on queue completed document the_document
tell application "MetaZ"
set myid to content of tag "iTunes persistent ID" of the_document
set loc to file of the_document
end tell
-- Only add if not already in iTunes
if myid is missing value then
tell application "iTunes"
add loc
end tell
end if
end queue completed document
end using terms from
|
sources/ada/magics-write_file.adb | reznikmm/jupyter | 4 | 12408 | <filename>sources/ada/magics-write_file.adb
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
with Jupyter.Kernels;
procedure Magics.Write_File
(IO_Pub : not null Jupyter.Kernels.IO_Pub_Access;
Name : League.Strings.Universal_String;
Text : League.Strings.Universal_String;
Silent : Boolean)
is
pragma Unreferenced (Silent, IO_Pub);
Output : Ada.Wide_Wide_Text_IO.File_Type;
begin
Ada.Wide_Wide_Text_IO.Create
(Output, Name => Name.To_UTF_8_String, Form => "WCEM=8");
Ada.Wide_Wide_Text_IO.Put_Line (Output, Text.To_Wide_Wide_String);
Ada.Wide_Wide_Text_IO.Close (Output);
end Magics.Write_File;
|
cards/bn5/ItemCards/136-F007 Dave's Poise.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | 10 | 179485 | <gh_stars>1-10
.include "defaults_item.asm"
table_file_jp equ "exe5-utf8.tbl"
table_file_en equ "bn5-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252424A // BRBJ
game_code_2 equ 0x42524245 // BRBE
game_code_3 equ 0x42524250 // BRBP
card_type equ 0
card_id equ 27
card_no equ "027"
card_sub equ "Item Card 027"
card_sub_x equ 62
card_desc_len equ 1
card_desc_1 equ "<NAME>"
card_desc_2 equ ""
card_desc_3 equ ""
card_name_jp_full equ "ダイスケの身のこなし"
card_name_jp_game equ "ダイスケのみのこなし"
card_name_en_full equ "<NAME>"
card_name_en_game equ "Dave's Poise"
card_game_desc_jp_len equ 2
card_game_desc_jp_1 equ "ダイスケのみのこなし!"
card_game_desc_jp_2 equ "クイックゲージ*を手に入れた!"
card_game_desc_jp_3 equ ""
card_game_desc_en_len equ 2
card_game_desc_en_1 equ "Dave's poise!"
card_game_desc_en_2 equ "Got FstGauge *!"
card_game_desc_en_3 equ "" |
10 greater.asm | jpsxlr8/Microprocessor-Lab | 0 | 167279 | ; find greatest number in array of 8-bit number
LDA 024DH ;fetch value of N
MOV B, A ;save value of N in B
LXI H, 0250H ;fetch first element, set it as largest
MOV A, M ;save first element
DCR B ;decrement, since first element is largest
INX H ;increment to second element
loop: CMP M
JNC iterate
MOV A, M
iterate: INX H
DCR B
JNZ loop
STA 024EH ;save result
hlt |
src/Data/QuadTree/Implementation/QuadrantLenses.agda | JonathanBrouwer/research-project | 1 | 8697 | <gh_stars>1-10
module Data.QuadTree.Implementation.QuadrantLenses where
open import Haskell.Prelude renaming (zero to Z; suc to S)
open import Data.Lens.Lens
open import Data.Logic
open import Data.QuadTree.Implementation.PropDepthRelation
open import Data.QuadTree.Implementation.Definition
open import Data.QuadTree.Implementation.ValidTypes
{-# FOREIGN AGDA2HS
{-# LANGUAGE Safe #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE Rank2Types #-}
import Data.Nat
import Data.Lens.Lens
import Data.Logic
import Data.QuadTree.Implementation.Definition
import Data.QuadTree.Implementation.ValidTypes
#-}
---- Lenses
-- Lenses into a leaf of a depth zero quadrant
lensLeaf : {t : Set} {{eqT : Eq t}}
-> Lens (VQuadrant t {0}) t
lensLeaf f (CVQuadrant (Leaf v)) = fmap (λ x -> CVQuadrant (Leaf x) {IsTrue.itsTrue}) (f v)
{-# COMPILE AGDA2HS lensLeaf #-}
-- A proof of the depth relation of a node and its children
propDepthRelationLte : {t : Set} -> (a b c d : Quadrant t) -> (dep : Nat)
-> ((depth a <= dep && depth b <= dep) && (depth c <= dep && depth d <= dep)) ≡ (depth (Node a b c d) <= (S dep))
propDepthRelationLte a b c d dep =
begin
((depth a <= dep && depth b <= dep) && (depth c <= dep && depth d <= dep))
=⟨ propMaxLte4 (depth a) (depth b) (depth c) (depth d) dep ⟩
(max (max (depth a) (depth b)) (max (depth c) (depth d)) <= dep)
=⟨⟩
(depth (Node a b c d) <= S dep)
end
-- A proof of the compressed relation of a node and its children
propCompressedRelation : {t : Set} {{eqT : Eq t}} -> {a b c d : Quadrant t}
-> IsTrue (isCompressed (Node a b c d))
-> IsTrue (isCompressed a && isCompressed b && isCompressed c && isCompressed d)
propCompressedRelation {_} {Leaf a} {Leaf b} {Leaf c} {Leaf d} p = IsTrue.itsTrue
propCompressedRelation {_} {Node _ _ _ _} {b} {c} {d} p = p
propCompressedRelation {_} {Leaf _} {Node _ _ _ _} {c} {d} p = p
propCompressedRelation {_} {Leaf _} {Leaf _} {Node _ _ _ _} {d} p = p
propCompressedRelation {_} {Leaf _} {Leaf _} {Leaf _} {Node _ _ _ _} p = p
-- Combine 4 valid quadrants to a new valid quadrant
combine : {t : Set} {{eqT : Eq t}}
-> {dep : Nat}
-> (a b c d : VQuadrant t {dep})
-> VQuadrant t {S dep}
combine {t} {dep} (CVQuadrant a@(Leaf va) {pa}) (CVQuadrant b@(Leaf vb) {pb}) (CVQuadrant c@(Leaf vc) {pc}) (CVQuadrant d@(Leaf vd) {pd})
= ifc (va == vb && vb == vc && vc == vd)
then CVQuadrant a {IsTrue.itsTrue}
else (λ {{pn}} -> CVQuadrant (Node a b c d) {andCombine (zeroLteAny dep) (falseToNotTrue $ pn)})
-- The next 4 cases are all identical, but I could not figure out another way to convince agda
combine {t} {dep} (CVQuadrant a@(Node v1 v2 v3 v4) {pa}) (CVQuadrant b {pb}) (CVQuadrant c {pc}) (CVQuadrant d {pd})
= CVQuadrant (Node a b c d) {andCombine
(useEq (propDepthRelationLte a b c d dep) ((propIsTrueCombine4 (andFst {depth a <= dep} pa) (andFst {depth b <= dep} pb) (andFst {depth c <= dep} pc) (andFst {depth d <= dep} pd))))
(propIsTrueCombine4Alt (andSnd {depth a <= dep} pa) (andSnd {depth b <= dep} pb) (andSnd {depth c <= dep} pc) (andSnd {depth d <= dep} pd))
}
combine {t} {dep} (CVQuadrant a@(Leaf va) {pa}) (CVQuadrant b@(Node v1 v2 v3 v4) {pb}) (CVQuadrant c {pc}) (CVQuadrant d {pd})
= CVQuadrant (Node a b c d) {andCombine
(useEq (propDepthRelationLte a b c d dep) ((propIsTrueCombine4 (andFst {depth a <= dep} pa) (andFst {depth b <= dep} pb) (andFst {depth c <= dep} pc) (andFst {depth d <= dep} pd))))
(propIsTrueCombine4Alt (andSnd {depth a <= dep} pa) (andSnd {depth b <= dep} pb) (andSnd {depth c <= dep} pc) (andSnd {depth d <= dep} pd))
}
combine {t} {dep} (CVQuadrant a@(Leaf va) {pa}) (CVQuadrant b@(Leaf vb) {pb}) (CVQuadrant c@(Node v1 v2 v3 v4) {pc}) (CVQuadrant d {pd})
= CVQuadrant (Node a b c d) {andCombine
(useEq (propDepthRelationLte a b c d dep) ((propIsTrueCombine4 (andFst {depth a <= dep} pa) (andFst {depth b <= dep} pb) (andFst {depth c <= dep} pc) (andFst {depth d <= dep} pd))))
(propIsTrueCombine4Alt (andSnd {depth a <= dep} pa) (andSnd {depth b <= dep} pb) (andSnd {depth c <= dep} pc) (andSnd {depth d <= dep} pd))
}
combine {t} {dep} (CVQuadrant a@(Leaf va) {pa}) (CVQuadrant b@(Leaf vb) {pb}) (CVQuadrant c@(Leaf vc) {pc}) (CVQuadrant d@(Node v1 v2 v3 v4) {pd})
= CVQuadrant (Node a b c d) {andCombine
(useEq (propDepthRelationLte a b c d dep) ((propIsTrueCombine4 (andFst {depth a <= dep} pa) (andFst {depth b <= dep} pb) (andFst {depth c <= dep} pc) (andFst {depth d <= dep} pd))))
(propIsTrueCombine4Alt (andSnd {depth a <= dep} pa) (andSnd {depth b <= dep} pb) (andSnd {depth c <= dep} pc) (andSnd {depth d <= dep} pd))
}
{-# COMPILE AGDA2HS combine #-}
-- Goes from a valid quadrant to its a subquadrant
aSub : {t : Set} {{eqT : Eq t}} -> {dep : Nat} -> (a b c d : Quadrant t)
-> IsTrue (isValid (S dep) (Node a b c d)) -> IsTrue (isValid (dep) a)
aSub {_} {dep} a b c d p = andCombine
-- Convert depth proof using propDepthRelationLte
(andFst $ andFst {(depth a <= dep && depth b <= dep)} $ useEq (sym (propDepthRelationLte a b c d dep)) (andFst p))
-- Convert compressed proof using propCompressedRelation
(and1 {isCompressed a} {isCompressed b} {isCompressed c} {isCompressed d} (propCompressedRelation {_} {a} (andSnd p)))
-- Goes from a valid quadrant to its b subquadrant
bSub : {t : Set} {{eqT : Eq t}} -> {dep : Nat} -> (a b c d : Quadrant t)
-> IsTrue (isValid (S dep) (Node a b c d)) -> IsTrue (isValid (dep) b)
bSub {_} {dep} a b c d p = andCombine
-- Convert depth proof using propDepthRelationLte
(andSnd $ andFst {(depth a <= dep && depth b <= dep)} $ useEq (sym (propDepthRelationLte a b c d dep)) (andFst p))
-- Convert compressed proof using propCompressedRelation
(and2 {isCompressed a} {isCompressed b} {isCompressed c} {isCompressed d} (propCompressedRelation {_} {a} (andSnd p)))
-- Goes from a valid quadrant to its c subquadrant
cSub : {t : Set} {{eqT : Eq t}} -> {dep : Nat} -> (a b c d : Quadrant t)
-> IsTrue (isValid (S dep) (Node a b c d)) -> IsTrue (isValid (dep) c)
cSub {_} {dep} a b c d p = andCombine
-- Convert depth proof using propDepthRelationLte
(andFst $ andSnd {(depth a <= dep && depth b <= dep)} $ useEq (sym (propDepthRelationLte a b c d dep)) (andFst p))
-- Convert compressed proof using propCompressedRelation
(and3 {isCompressed a} {isCompressed b} {isCompressed c} {isCompressed d} (propCompressedRelation {_} {a} (andSnd p)))
-- Goes from a valid quadrant to its d subquadrant
dSub : {t : Set} {{eqT : Eq t}} -> {dep : Nat} -> (a b c d : Quadrant t)
-> IsTrue (isValid (S dep) (Node a b c d)) -> IsTrue (isValid (dep) d)
dSub {_} {dep} a b c d p = andCombine
-- Convert depth proof using propDepthRelationLte
(andSnd $ andSnd {(depth a <= dep && depth b <= dep)} $ useEq (sym (propDepthRelationLte a b c d dep)) (andFst p))
-- Convert compressed proof using propCompressedRelation
(and4 {isCompressed a} {isCompressed b} {isCompressed c} {isCompressed d} (propCompressedRelation {_} {a} (andSnd p)))
-- Lens into the a subquadrant
lensA :
{t : Set} {{eqT : Eq t}}
-> {dep : Nat}
-> Lens (VQuadrant t {S dep}) (VQuadrant t {dep})
lensA {_} {dep} f (CVQuadrant (Leaf v) {p}) =
let sub = CVQuadrant (Leaf v) {andCombine (zeroLteAny dep) IsTrue.itsTrue}
in fmap (λ x -> combine x sub sub sub ) (f sub)
lensA {_} {dep} f (CVQuadrant (Node a b c d) {p}) =
let
sA = CVQuadrant a {aSub a b c d p}
sB = CVQuadrant b {bSub a b c d p}
sC = CVQuadrant c {cSub a b c d p}
sD = CVQuadrant d {dSub a b c d p}
in fmap (λ x -> combine x sB sC sD ) (f sA)
{-# COMPILE AGDA2HS lensA #-}
-- Lens into the b subquadrant
lensB :
{t : Set} {{eqT : Eq t}}
-> {dep : Nat}
-> Lens (VQuadrant t {S dep}) (VQuadrant t {dep})
lensB {_} {dep} f (CVQuadrant (Leaf v) {p}) =
let sub = CVQuadrant (Leaf v) {andCombine (zeroLteAny dep) IsTrue.itsTrue}
in fmap (λ x -> combine sub x sub sub ) (f sub)
lensB {_} {dep} f (CVQuadrant (Node a b c d) {p}) =
let
sA = CVQuadrant a {aSub a b c d p}
sB = CVQuadrant b {bSub a b c d p}
sC = CVQuadrant c {cSub a b c d p}
sD = CVQuadrant d {dSub a b c d p}
in fmap (λ x -> combine sA x sC sD ) (f sB)
{-# COMPILE AGDA2HS lensB #-}
-- Lens into the c subquadrant
lensC :
{t : Set} {{eqT : Eq t}}
-> {dep : Nat}
-> Lens (VQuadrant t {S dep}) (VQuadrant t {dep})
lensC {_} {dep} f (CVQuadrant (Leaf v) {p}) =
let sub = CVQuadrant (Leaf v) {andCombine (zeroLteAny dep) IsTrue.itsTrue}
in fmap (λ x -> combine sub sub x sub ) (f sub)
lensC {_} {dep} f (CVQuadrant (Node a b c d) {p}) =
let
sA = CVQuadrant a {aSub a b c d p}
sB = CVQuadrant b {bSub a b c d p}
sC = CVQuadrant c {cSub a b c d p}
sD = CVQuadrant d {dSub a b c d p}
in fmap (λ x -> combine sA sB x sD ) (f sC)
{-# COMPILE AGDA2HS lensC #-}
-- Lens into the d subquadrant
lensD :
{t : Set} {{eqT : Eq t}}
-> {dep : Nat}
-> Lens (VQuadrant t {S dep}) (VQuadrant t {dep})
lensD {_} {dep} f (CVQuadrant (Leaf v) {p}) =
let sub = CVQuadrant (Leaf v) {andCombine (zeroLteAny dep) IsTrue.itsTrue}
in fmap (λ x -> combine sub sub sub x ) (f sub)
lensD {_} {dep} f (CVQuadrant (Node a b c d) {p}) =
let
sA = CVQuadrant a {aSub a b c d p}
sB = CVQuadrant b {bSub a b c d p}
sC = CVQuadrant c {cSub a b c d p}
sD = CVQuadrant d {dSub a b c d p}
in fmap (λ x -> combine sA sB sC x ) (f sD)
{-# COMPILE AGDA2HS lensD #-} |
src/Data/Char/Classifier/Primitive.agda | ilya-fiveisky/agda-system-io | 2 | 3367 | <filename>src/Data/Char/Classifier/Primitive.agda
open import Data.Char using ( Char )
open import Data.Bool using ( Bool )
module Data.Char.Classifier.Primitive where
postulate
isAscii : Char → Bool
isLatin1 : Char → Bool
isControl : Char → Bool
isSpace : Char → Bool
isLower : Char → Bool
isUpper : Char → Bool
isAlpha : Char → Bool
isAlphaNum : Char → Bool
isPrint : Char → Bool
isDigit : Char → Bool
isOctDigit : Char → Bool
isHexDigit : Char → Bool
{-# IMPORT Data.Char #-}
{-# COMPILED isAscii Data.Char.isAscii #-}
{-# COMPILED isLatin1 Data.Char.isLatin1 #-}
{-# COMPILED isControl Data.Char.isControl #-}
{-# COMPILED isSpace Data.Char.isSpace #-}
{-# COMPILED isLower Data.Char.isLower #-}
{-# COMPILED isUpper Data.Char.isUpper #-}
{-# COMPILED isAlpha Data.Char.isAlpha #-}
{-# COMPILED isAlphaNum Data.Char.isAlphaNum #-}
{-# COMPILED isPrint Data.Char.isPrint #-}
{-# COMPILED isDigit Data.Char.isDigit #-}
{-# COMPILED isOctDigit Data.Char.isOctDigit #-}
{-# COMPILED isHexDigit Data.Char.isHexDigit #-}
|
uti/getwlim.asm | olifink/smsqe | 0 | 29760 | <reponame>olifink/smsqe
; get window limits
section utility
include dev8_keys_qdos_io
xdef ut_gwlim
xdef ut_gwlma
xdef ut_gworg
xref gu_iow
;+++
; Get window origin.
;
; Entry Exit
; D2.l x-org.w | y-org.w
; A0 channel ID preserved
;
; Error returns from IOP.FLIM
;---
ut_gworg
gwo.reg reg d1/a1-a2
movem.l gwo.reg,-(sp)
subq.l #8,sp ; get room
move.l sp,a1 ; our workspace
moveq #0,d2
moveq #iop.flim,d0
bsr gu_iow ; get window limits
move.l 4(a1),d2
addq.l #8,sp ; adjust stack
movem.l (sp)+,gwo.reg
tst.l d0
rts
;+++
; Get window limits using supplied channel ID.
;
; Entry Exit
; d1.l x-size.w | y-size.w
; a0 channel ID preserved
;
; Error returns from IOP.FLIM
;---
ut_gwlma
gwl.reg reg d2-d3/a0-a2
movem.l gwl.reg,-(sp)
bra.s gwlm_all
;+++
; Get window limits. It returns the maximum screen size. If no Pointer Interface
; is present, the standard QL values are returned.
;
; Entry Exit
; d1.l x-size.w | y-size.w
;
; Error returns from IOP.FLIM
;---
ut_gwlim
movem.l gwl.reg,-(sp)
sub.l a0,a0 ; channel 0
gwlm_all
subq.l #8,sp ; get room
move.l sp,a1 ; our workspace
move.l #$02000100,(a1) ; assume QL size, in case of error
moveq #0,d2
moveq #iop.flim,d0
bsr gu_iow ; get window limits
move.l (a1),d1
addq.l #8,sp
movem.l (sp)+,gwl.reg
tst.l d0
rts
end
|
programs/oeis/136/A136008.asm | karttu/loda | 1 | 19512 | <reponame>karttu/loda<gh_stars>1-10
; A136008: a(n) = n^6 - n^2.
; 0,0,60,720,4080,15600,46620,117600,262080,531360,999900,1771440,2985840,4826640,7529340,11390400,16776960,24137280,34011900,47045520,63999600,85765680,113379420,148035360,191102400,244140000,308915100,387419760,481889520,594822480,728999100,887502720,1073740800,1291466880,1544803260,1838264400,2176781040,2565725040,3010934940,3518742240,4095998400,4750102560,5489029980,6321361200,7256311920,8303763600,9474294780,10779213120,12230588160,13841284800,15624997500,17596285200,19770606960,22164358320,24794908380,27680637600,30840976320,34296444000,38068689180,42180530160,46655996400,51520370640,56800231740,62523498240,68719472640,75418886400,82653945660,90458377680,98867478000,107918158320,117648995100,128100278880,139314064320,151334220960,164206484700,177978510000,192699922800,208422374160,225199594620,243087449280,262143993600,282429529920,304006664700,326940366480,351298024560,377149508400,404567227740,433626193440,464404079040,496981283040,531440991900,567869243760,606354992880,646990174800,689869772220,735091881600,782757780480,832971995520,885842371260,941480139600,999999990000,1061520140400,1126162408860,1194052285920,1265319007680,1340095629600,1418519101020,1500730340400,1586874311280,1677100098960,1771560987900,1870414539840,1973822672640,2081951739840,2194972610940,2313060752400,2436396309360,2565164188080,2699554139100,2839760841120,2985983985600,3138428362080,3297303944220,3462825976560,3635215062000,3814697250000,4001504125500,4195872898560,4398046494720,4608273646080,4826808983100,5053913127120,5289852783600,5534900836080,5789336440860,6053445122400,6327518869440,6611856231840,6906762418140,7212549393840,7529535980400,7858047954960,8198418150780,8550986558400,8916100427520,9294114369600,9685390461180,10090298347920,10509215349360,10942526564400,11390624977500,11853911565600,12332795405760,12827693783520,13339032301980,13867244991600,14412774420720,14976071806800,15557597128380,16157819237760,16777215974400,17416274279040,18075490308540,18755369551440,19456426944240,20179186988400,20924183868060,21691961568480,22483073995200,23298085093920,24137568971100,25002110015280,25892303019120,26808753302160,27752076834300,28722900360000,29721861523200,30749608992960,31806802589820,32894113412880,34012223967600,35161828294320,36343632097500,37558352875680,38806720052160,40089475106400,41407371706140,42761175840240,44151665952240,45579633074640,47045880963900,48551226236160,50096498503680,51682540512000,53310208277820,54980371227600,56693912336880,58451728270320,60254729522460,62103840559200,63999999960000,65944160560800,67937289597660,69980368851120,72074394791280,74220378723600,76419346935420,78672340843200,80980417140480,83344647946560,85766120955900,88245939588240,90785223139440,93385106933040,96046742472540,98771297594400,101559956621760,104413920518880,107334407046300,110322650916720,113379903951600,116507435238480,119706531289020,122978496197760,126324651801600,129746337840000,133244912115900,136821750657360,140478247879920,144215816749680,148035888947100,151939915031520,155929364606400,160005726485280,164170508858460,168425239460400,172771465737840,177210755018640,181744694681340,186374892325440,191102975942400,195930594087360,200859416051580,205891132035600,211027453323120,216270112455600,221620863407580,227081481762720,232653764890560,238339532124000
pow $0,2
mov $1,$0
pow $1,3
sub $1,$0
|
src/Categories/Pseudofunctor.agda | Trebor-Huang/agda-categories | 279 | 16737 | <filename>src/Categories/Pseudofunctor.agda
{-# OPTIONS --without-K --safe #-}
open import Categories.Bicategory using (Bicategory)
-- A Pseudofunctor is a homomorphism of Bicategories
-- Follow Bénabou's definition, which is basically that of a Functor
-- Note that what is in nLab is an "exploded" version of the simpler version below
module Categories.Pseudofunctor {o ℓ e t o′ ℓ′ e′ t′}
(C : Bicategory o ℓ e t)
(D : Bicategory o′ ℓ′ e′ t′)
where
open import Level
open import Data.Product using (_,_)
import Categories.Bicategory.Extras as BicategoryExtras
open import Categories.Category using (Category; _[_,_]; module Commutation)
open import Categories.Category.Instance.One using (shift)
open import Categories.Category.Product using (_⁂_)
open import Categories.Functor using (Functor; _∘F_) renaming (id to idF)
open import Categories.NaturalTransformation using (NaturalTransformation)
open import Categories.NaturalTransformation.NaturalIsomorphism
using (NaturalIsomorphism; _≃_)
open BicategoryExtras using (module ComHom)
open Category using (Obj)
open NaturalIsomorphism using (F⇒G; F⇐G)
private
module C = BicategoryExtras C
module D = BicategoryExtras D
record Pseudofunctor : Set (o ⊔ ℓ ⊔ e ⊔ t ⊔ o′ ⊔ ℓ′ ⊔ e′ ⊔ t′) where
field
P₀ : C.Obj → D.Obj
P₁ : {x y : C.Obj} → Functor (C.hom x y) (D.hom (P₀ x) (P₀ y))
-- For maximal generality, shift the levels of One. P preserves id
P-identity : {A : C.Obj} → D.id {P₀ A} ∘F shift o′ ℓ′ e′ ≃ P₁ ∘F (C.id {A})
-- P preserves composition
P-homomorphism : {x y z : C.Obj} → D.⊚ ∘F (P₁ ⁂ P₁) ≃ P₁ ∘F C.⊚ {x} {y} {z}
-- P preserves ≃
module P₁ {x} {y} = Functor (P₁ {x} {y})
module unitˡ {A} = NaturalTransformation (F⇒G (P-identity {A}))
module unitʳ {A} = NaturalTransformation (F⇐G (P-identity {A}))
module Hom {x} {y} {z} = NaturalTransformation (F⇒G (P-homomorphism {x} {y} {z}))
-- For notational convenience, shorten some functor applications
private
F₀ = λ {x y} f → Functor.F₀ (P₁ {x} {y}) f
F₁ = λ {x y f g} α → Functor.F₁ (P₁ {x} {y}) {f} {g} α
Pid = λ {A} → NaturalTransformation.η (F⇒G (P-identity {A})) _
Phom = λ {x} {y} {z} f,g →
NaturalTransformation.η (F⇒G (P-homomorphism {x} {y} {z})) f,g
field
unitaryˡ : {x y : C.Obj} →
let open ComHom D in
{f : Obj (C.hom x y)} →
[ D.id₁ D.⊚₀ F₀ f ⇒ F₀ f ]⟨
Pid D.⊚₁ D.id₂ ⇒⟨ F₀ C.id₁ D.⊚₀ F₀ f ⟩
Phom (C.id₁ , f) ⇒⟨ F₀ (C.id₁ C.⊚₀ f) ⟩
F₁ C.unitorˡ.from
≈ D.unitorˡ.from
⟩
unitaryʳ : {x y : C.Obj} →
let open ComHom D in
{f : Obj (C.hom x y)} →
[ F₀ f D.⊚₀ D.id₁ ⇒ F₀ f ]⟨
D.id₂ D.⊚₁ Pid ⇒⟨ F₀ f D.⊚₀ F₀ C.id₁ ⟩
Phom (f , C.id₁) ⇒⟨ F₀ (f C.⊚₀ C.id₁) ⟩
F₁ C.unitorʳ.from
≈ D.unitorʳ.from
⟩
assoc : {x y z w : C.Obj} →
let open ComHom D in
{f : Obj (C.hom x y)} {g : Obj (C.hom y z)} {h : Obj (C.hom z w)} →
[ (F₀ h D.⊚₀ F₀ g) D.⊚₀ F₀ f ⇒ F₀ (h C.⊚₀ (g C.⊚₀ f)) ]⟨
Phom (h , g) D.⊚₁ D.id₂ ⇒⟨ F₀ (h C.⊚₀ g) D.⊚₀ F₀ f ⟩
Phom (_ , f) ⇒⟨ F₀ ((h C.⊚₀ g) C.⊚₀ f) ⟩
F₁ C.associator.from
≈ D.associator.from ⇒⟨ F₀ h D.⊚₀ (F₀ g D.⊚₀ F₀ f) ⟩
D.id₂ D.⊚₁ Phom (g , f) ⇒⟨ F₀ h D.⊚₀ F₀ (g C.⊚₀ f) ⟩
Phom (h , _)
⟩
-- Useful shorthands
₀ = P₀
module ₁ = P₁
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1072.asm | ljhsiun2/medusa | 9 | 5003 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1349e, %rdi
nop
nop
nop
add $14416, %r12
mov $0x6162636465666768, %r11
movq %r11, %xmm0
movups %xmm0, (%rdi)
nop
nop
nop
nop
nop
xor $54500, %r8
lea addresses_WT_ht+0x2356, %rsi
lea addresses_A_ht+0x11b5e, %rdi
nop
and $22228, %r9
mov $98, %rcx
rep movsq
nop
nop
nop
and $22032, %r8
lea addresses_WT_ht+0xcb2, %r12
add %rdi, %rdi
and $0xffffffffffffffc0, %r12
vmovaps (%r12), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r8
nop
nop
and $40384, %r12
lea addresses_WT_ht+0x200a, %rsi
lea addresses_UC_ht+0x13cfe, %rdi
nop
nop
nop
dec %rax
mov $80, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x479e, %rsi
lea addresses_A_ht+0x1f5e, %rdi
nop
nop
nop
inc %r8
mov $114, %rcx
rep movsw
nop
nop
nop
nop
cmp $64665, %r8
lea addresses_WC_ht+0xff7e, %rcx
nop
nop
nop
nop
sub $18060, %r9
movl $0x61626364, (%rcx)
nop
add %rcx, %rcx
lea addresses_A_ht+0x4d5e, %rsi
lea addresses_D_ht+0x163ae, %rdi
nop
nop
nop
inc %r11
mov $23, %rcx
rep movsq
nop
nop
nop
cmp %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r9
push %rax
push %rbp
push %rdx
// Faulty Load
lea addresses_PSE+0xcb5e, %r9
nop
nop
nop
and %r13, %r13
mov (%r9), %ebp
lea oracles, %rdx
and $0xff, %rbp
shlq $12, %rbp
mov (%rdx,%rbp,1), %rbp
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w15.asm | prismotizm/gigaleak | 0 | 21360 | Name: ys_w15.asm
Type: file
Size: 6153
Last-Modified: '2016-05-13T04:51:42Z'
SHA-1: F82A00A10134F37BFA9CAE9AF8EE47D438956679
Description: null
|
projects/Kirbys_Dream_Land_2.windfish/disassembly/bank_06.asm | jverkoey/awaken | 68 | 11514 | <reponame>jverkoey/awaken
SECTION "ROM Bank 06", ROMX[$4000], BANK[$06]
db $FF, $02, $00, $00, $00, $2C, $46, $06
db $00, $00, $00, $2C, $46, $06, $00, $01
db $FF, $02, $02, $FF, $10, $30, $50, $70
db $90, $B0, $D0, $F0, $00, $10, $00, $20
db $00, $30, $00, $40, $00, $50, $00, $60
db $00, $70, $00, $80, $00, $90, $00, $20
db $18, $30, $18, $40, $2E, $20, $50, $80
db $B0, $E0, $00, $20, $00, $30, $00, $40
db $00, $60, $00, $70, $00, $80, $00, $80
db $FD, $0A, $00, $02, $E0, $C0, $FF, $40
db $FF, $40, $FF, $40, $00, $C0, $00, $C0
db $00, $69, $40, $70, $40, $74, $40, $7A
db $40, $7E, $40, $86, $40, $8D, $40, $96
db $40, $08, $06, $07, $00, $01, $04, $FF
db $01, $06, $02, $FF, $08, $06, $80, $05
db $02, $FF, $00, $80, $0A, $0B, $01, $05
db $01, $05, $80, $FF, $00, $FF, $08, $02
db $08, $80, $02, $0C, $FF, $80, $08, $01
db $06, $06, $80, $02, $09, $FF, $01, $02
db $FF, $20, $10, $20, $18, $80, $02, $EC
db $40, $02, $EE, $00, $00, $EE, $20, $18
db $80, $02, $EC, $00, $02, $F0, $00, $00
db $F0, $00, $00, $00, $20, $00, $FE, $30
db $00, $FD, $40, $00, $FC, $60, $00, $FA
db $80, $00, $F8, $A0, $00, $F6, $C0, $00
db $F4, $80, $01, $F4, $30, $40, $02, $A0
db $80, $10, $00, $02, $C0, $00, $00, $FF
db $10, $80, $00, $80, $FF, $10, $80, $00
db $40, $FF, $10, $FF, $02, $00, $00, $00
db $33, $4E, $03, $00, $00, $00, $2A, $4F
db $03, $FF, $02, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $FF
db $02, $9B, $4D, $03, $33, $4E, $03, $00
db $00, $00, $2A, $4F, $03, $FF, $02, $9B
db $4D, $03, $33, $4E, $03, $00, $00, $00
db $2A, $4F, $03, $FF, $02, $9B, $4D, $03
db $33, $4E, $03, $00, $00, $00, $2A, $4F
db $03, $79, $FE, $4E, $FC, $13, $00, $00
db $00, $FC, $13, $33, $01, $30, $FC, $11
db $D4, $02, $2C, $FD, $11, $B2, $03, $79
db $FE, $11, $00, $04, $00, $00, $10, $B2
db $03, $87, $01, $10, $2C, $FD, $2C, $FD
db $12, $E0, $FF, $20, $00, $00, $00, $04
db $40, $FF, $C0, $00, $20, $80, $FE, $FF
db $02, $00, $00, $00, $61, $56, $06, $00
db $00, $00, $61, $56, $06, $00, $01, $02
db $00, $01, $02, $00, $01, $00, $01, $FF
db $10, $80, $01, $10, $80, $01, $08, $00
db $FE, $10, $80, $01, $10, $00, $02, $17
db $F6, $0D, $0F, $44, $FF, $0D, $5F, $22
db $0D, $72, $22, $0D, $E0, $35, $50, $00
db $70, $00, $0D, $0F, $20, $06, $0E, $2D
db $0B, $DA, $41, $0B, $1E, $42, $0D, $0F
db $20, $06, $0E, $2D, $28, $13, $80, $B9
db $41, $0D, $9D, $4E, $11, $40, $06, $BE
db $41, $0D, $9D, $4E, $0E, $40, $0D, $AB
db $4E, $14, $FF, $D0, $42, $1E, $03, $1B
db $42, $4E, $42, $C8, $42, $06, $BE, $41
db $0D, $BE, $4E, $14, $40, $0D, $DB, $4E
db $1D, $40, $24, $38, $19, $1A, $02, $19
db $20, $06, $19, $1A, $02, $19, $19, $06
db $19, $1A, $02, $19, $20, $06, $19, $1A
db $02, $19, $19, $06, $10, $5C, $12, $05
db $42, $19, $1A, $02, $19, $20, $06, $19
db $1A, $02, $19, $19, $06, $27, $19, $1A
db $04, $19, $20, $04, $03, $97, $4B, $46
db $19, $21, $04, $19, $1B, $08, $27, $0D
db $0D, $4F, $0C, $0B, $D0, $41, $1F, $F9
db $4E, $5C, $2F, $40, $28, $14, $80, $36
db $42, $1F, $F9, $4E, $5C, $2F, $40, $28
db $14, $80, $36, $42, $05, $10, $0F, $1F
db $80, $19, $21, $04, $19, $20, $04, $19
db $1A, $04, $19, $19, $08, $01, $FF, $1F
db $F9, $4E, $5C, $31, $40, $0C, $0B, $D0
db $41, $05, $10, $0D, $54, $4F, $12, $5E
db $42, $05, $02, $06, $53, $42, $05, $1F
db $19, $1E, $08, $09, $04, $19, $1D, $02
db $19, $36, $02, $0A, $10, $5C, $12, $7D
db $42, $19, $1D, $02, $19, $36, $02, $19
db $1D, $02, $19, $36, $02, $27, $03, $B8
db $4B, $46, $0F, $27, $00, $0F, $40, $00
db $0F, $26, $00, $29, $00, $18, $19, $1D
db $10, $26, $80, $00, $05, $16, $03, $B8
db $4B, $46, $0F, $27, $02, $0F, $40, $00
db $0F, $26, $00, $19, $1C, $24, $0D, $32
db $10, $FC, $03, $B8, $4B, $46, $0F, $27
db $04, $0F, $40, $00, $0F, $26, $00, $19
db $1B, $20, $29, $00, $05, $0E, $10, $5C
db $12, $36, $42, $05, $12, $06, $36, $42
db $28, $13, $80, $1B, $42, $06, $4E, $42
db $0D, $0F, $20, $07, $07, $2D, $0D, $BE
db $4E, $35, $40, $0D, $DB, $4E, $3B, $40
db $1A, $41, $19, $1A, $02, $19, $20, $06
db $19, $1A, $02, $19, $19, $06, $19, $1A
db $02, $19, $20, $06, $19, $1A, $02, $19
db $19, $06, $10, $5C, $12, $0B, $43, $19
db $1A, $02, $19, $20, $06, $19, $1A, $02
db $19, $19, $06, $27, $24, $38, $19, $1A
db $04, $19, $20, $04, $19, $21, $04, $19
db $22, $08, $0D, $74, $4F, $F0, $0D, $CA
db $20, $47, $40, $0D, $E6, $22, $CB, $07
db $03, $4F, $4C, $46, $07, $00, $00, $27
db $05, $2D, $0D, $BA, $22, $CB, $08, $03
db $A6, $4B, $46, $19, $07, $38, $03, $67
db $4C, $46, $0D, $A6, $4F, $0D, $CA, $20
db $4A, $40, $0D, $C5, $4F, $00, $0D, $29
db $50, $18, $29, $00, $2A, $00, $03, $B0
db $4C, $46, $0D, $40, $50, $0E, $0D, $7C
db $43, $94, $43, $BD, $43, $F7, $43, $29
db $44, $3E, $44, $5B, $44, $C3, $43, $FD
db $43, $7C, $44, $8E, $44, $99, $44, $A7
db $44, $06, $C9, $44, $0D, $94, $50, $0D
db $64, $50, $00, $01, $08, $00, $01, $2A
db $FC, $05, $70, $0D, $82, $50, $E0, $05
db $10, $06, $51, $43, $0D, $94, $50, $0D
db $64, $50, $00, $02, $08, $00, $02, $2A
db $F8, $05, $28, $0D, $82, $50, $F0, $05
db $18, $08, $00, $00, $2A, $00, $05, $08
db $03, $A6, $4B, $46, $1F, $F9, $4E, $5C
db $99, $40, $06, $51, $43, $0B, $CC, $43
db $06, $51, $43, $0B, $CC, $43, $0B, $E1
db $43, $06, $51, $43, $0D, $94, $50, $0D
db $64, $50, $00, $02, $05, $08, $2A, $F8
db $05, $20, $0D, $82, $50, $F0, $05, $20
db $0C, $07, $00, $00, $29, $00, $08, $00
db $FE, $2A, $20, $0D, $B5, $44, $12, $F6
db $43, $05, $01, $06, $EB, $43, $0C, $0B
db $06, $44, $06, $51, $43, $0B, $06, $44
db $0B, $18, $44, $06, $51, $43, $0D, $94
db $50, $0D, $64, $50, $80, $01, $0D, $82
db $50, $F4, $08, $00, $01, $05, $40, $0C
db $08, $00, $00, $2A, $00, $0D, $64, $50
db $80, $FE, $0D, $82, $50, $18, $05, $20
db $0C, $0B, $2F, $44, $06, $51, $43, $08
db $00, $FF, $0D, $B5, $44, $12, $3D, $44
db $05, $01, $06, $32, $44, $0C, $0D, $94
db $50, $0D, $64, $50, $80, $01, $0D, $82
db $50, $F4, $08, $00, $FF, $0D, $B5, $44
db $12, $58, $44, $05, $01, $06, $4D, $44
db $06, $51, $43, $0B, $61, $44, $06, $51
db $43, $0D, $94, $50, $0D, $64, $50, $00
db $02, $05, $28, $0D, $82, $50, $F0, $05
db $20, $03, $A6, $4B, $46, $1F, $F9, $4E
db $5C, $9B, $40, $0C, $0B, $61, $44, $18
db $29, $00, $2A, $00, $03, $B0, $4C, $46
db $0B, $2F, $44, $06, $51, $43, $0B, $06
db $44, $18, $29, $00, $2A, $00, $06, $29
db $44, $0B, $06, $44, $0B, $18, $44, $18
db $29, $00, $2A, $00, $06, $BD, $43, $0B
db $CC, $43, $0B, $E1, $43, $18, $29, $00
db $2A, $00, $06, $7C, $43, $1E, $07, $1A
db $21, $53, $DB, $96, $FE, $19, $38, $03
db $AF, $18, $02, $3E, $01, $1E, $27, $12
db $C9, $0D, $94, $50, $28, $14, $80, $51
db $45, $03, $B0, $4C, $46, $0D, $64, $50
db $C0, $00, $0D, $CA, $20, $9D, $40, $05
db $40, $0D, $64, $50, $C0, $FF, $0D, $CA
db $20, $A0, $40, $05, $20, $0D, $44, $45
db $00, $0D, $B6, $50, $00, $03, $A6, $4B
db $46, $05, $01, $0D, $4A, $45, $11, $F9
db $44, $05, $20, $0D, $31, $45, $24, $36
db $0D, $E6, $22, $CB, $0F, $0D, $E6, $22
db $CB, $10, $0D, $E6, $22, $CB, $11, $0D
db $E6, $22, $CB, $12, $05, $18, $0D, $64
db $50, $40, $00, $0D, $CA, $20, $A3, $40
db $03, $B0, $4C, $46, $05, $20, $06, $91
db $45, $1E, $48, $1A, $67, $2E, $00, $7E
db $FE, $FF, $C8, $C5, $CD, $BA, $0B, $F0
db $9A, $57, $C1, $C9, $0A, $03, $EA, $07
db $DD, $C9, $FA, $07, $DD, $1E, $27, $12
db $C9, $03, $A6, $4B, $46, $1F, $F9, $4E
db $5C, $A6, $40, $0D, $64, $50, $40, $00
db $0D, $CA, $20, $A8, $40, $05, $40, $0D
db $64, $50, $C0, $FF, $0D, $CA, $20, $AB
db $40, $03, $B0, $4C, $46, $05, $20, $03
db $A6, $4B, $46, $0D, $B6, $50, $01, $05
db $08, $0D, $64, $50, $40, $00, $0D, $CA
db $20, $AE, $40, $03, $B0, $4C, $46, $05
db $20, $0D, $94, $50, $0D, $C0, $50, $0D
db $CA, $20, $C9, $40, $29, $00, $03, $B0
db $4C, $46, $05, $40, $08, $80, $FE, $0D
db $5F, $20, $CC, $40, $10, $41, $1A, $11
db $03, $CB, $4C, $46, $05, $10, $29, $00
db $07, $00, $00, $00, $24, $38, $01, $FF
db $0D, $E6, $22, $CB, $13, $1F, $F9, $4E
db $5C, $CF, $40, $06, $A6, $41, $0F, $41
db $01, $03, $1C, $46, $46, $1C, $FA, $7C
db $04, $09, $06, $19, $1D, $02, $19, $36
db $02, $0A, $0F, $41, $00, $00, $0F, $41
db $01, $03, $1C, $46, $46, $1C, $FA, $7C
db $04, $09, $04, $19, $32, $02, $19, $0A
db $01, $19, $33, $02, $19, $0A, $01, $0A
db $19, $09, $03, $19, $08, $03, $19, $07
db $03, $19, $0A, $03, $19, $09, $02, $19
db $08, $02, $19, $07, $02, $19, $0A, $02
db $0F, $41, $00, $00, $CD, $23, $23, $C0
db $1E, $4C, $1A, $FE, $15, $D0, $3E, $01
db $1E, $5C, $12, $C9, $0D, $0F, $20, $07
db $07, $3F, $10, $46, $0D, $E3, $50, $1C
db $8C, $47, $03, $04, $7A, $64, $0D, $1A
db $46, $01, $0A, $22, $3B, $5F, $1D, $08
db $00, $FE, $07, $00, $00, $0D, $5F, $20
db $D1, $40, $0F, $26, $00, $03, $F9, $4C
db $46, $19, $07, $04, $19, $08, $04, $19
db $09, $04, $19, $0A, $04, $06, $59, $46
db $0D, $94, $50, $0D, $FF, $50, $D4, $40
db $0F, $3F, $03, $03, $2B, $4D, $46, $19
db $07, $08, $19, $08, $08, $19, $09, $08
db $19, $0A, $08, $06, $77, $46, $0D, $94
db $50, $01, $0A, $0F, $1C, $80, $07, $00
db $00, $2A, $00, $08, $00, $FE, $03, $98
db $4D, $46, $05, $20, $2A, $10, $05, $20
db $19, $07, $10, $2A, $00, $05, $19, $18
db $0D, $BA, $22, $CB, $19, $05, $22, $19
db $03, $02, $19, $07, $02, $19, $03, $02
db $19, $07, $02, $19, $03, $04, $06, $0B
db $51, $17, $FF, $0D, $0F, $61, $00, $0F
db $4C, $01, $04, $7A, $64, $0D, $0D, $F9
db $1F, $10, $5B, $0E, $29, $28, $47, $28
db $47, $28, $47, $28, $47, $28, $47, $28
db $47, $28, $47, $60, $47, $1C, $48, $5E
db $4A, $6B, $4A, $78, $4A, $85, $4A, $7F
db $47, $F0, $47, $92, $4A, $B0, $4A, $C4
db $4A, $D8, $4A, $F0, $4A, $08, $4B, $66
db $4B, $7F, $4B, $87, $4B, $8F, $4B, $FC
db $49, $DF, $56, $7A, $57, $E2, $57, $E2
db $57, $E2, $57, $E2, $57, $E2, $57, $E2
db $57, $E2, $57, $E2, $57, $E2, $57, $AB
db $58, $58, $59, $61, $59, $FF, $59, $16
db $0D, $D1, $1F, $00, $F8, $0D, $88, $4F
db $03, $A4, $0D, $40, $24, $35, $0D, $0F
db $20, $04, $04, $BF, $05, $02, $03, $A4
db $4D, $46, $09, $02, $0D, $58, $47, $28
db $05, $02, $0D, $58, $47, $D8, $05, $02
db $0A, $0D, $58, $47, $28, $05, $02, $16
db $0A, $03, $62, $2E, $15, $86, $77, $C9
db $0D, $D1, $1F, $01, $10, $19, $23, $04
db $19, $28, $04, $19, $24, $04, $19, $29
db $08, $0D, $E6, $22, $CB, $0D, $0D, $E6
db $22, $CB, $0E, $19, $1A, $08, $16, $0D
db $41, $5A, $0D, $D1, $1F, $EE, $F5, $0F
db $4B, $00, $0F, $4A, $05, $0D, $0F, $20
db $08, $08, $08, $0D, $D9, $4F, $51, $41
db $0D, $CA, $20, $55, $41, $03, $AD, $4D
db $46, $19, $18, $08, $18, $03, $B3, $4D
db $46, $09, $03, $19, $2B, $02, $19, $18
db $02, $0A, $19, $2B, $02, $0D, $D9, $4F
db $58, $41, $08, $40, $FF, $03, $B0, $4D
db $46, $05, $08, $03, $B9, $4D, $46, $27
db $0D, $ED, $4F, $29, $20, $2A, $20, $0F
db $26, $04, $0F, $40, $08, $0F, $60, $00
db $0D, $1D, $20, $11, $E7, $47, $19, $2A
db $08, $19, $2B, $08, $06, $ED, $47, $19
db $2C, $08, $19, $2D, $08, $06, $D8, $47
db $0D, $41, $5A, $0D, $D1, $1F, $12, $F5
db $06, $87, $47, $0D, $5F, $20, $5C, $41
db $03, $1C, $4E, $46, $0D, $1D, $20, $11
db $13, $48, $19, $2A, $08, $19, $2B, $08
db $06, $04, $48, $19, $2C, $08, $19, $2D
db $08, $06, $04, $48, $0D, $0F, $20, $0E
db $10, $BF, $03, $31, $4E, $46, $0F, $47
db $10, $19, $0B, $01, $19, $FF, $01, $19
db $2E, $01, $19, $FF, $01, $19, $0C, $01
db $19, $FF, $01, $19, $2F, $01, $19, $FF
db $01, $19, $0D, $01, $19, $FF, $01, $19
db $30, $01, $19, $FF, $01, $19, $0E, $01
db $19, $FF, $01, $19, $31, $01, $19, $FF
db $01, $22, $EE, $49, $06, $19, $0B, $02
db $19, $2E, $02, $19, $0C, $02, $19, $2F
db $02, $19, $0D, $02, $19, $30, $02, $19
db $0E, $02, $19, $31, $02, $0D, $E6, $22
db $CB, $09, $19, $0B, $03, $19, $2E, $03
db $0D, $E6, $22, $CB, $0A, $19, $0C, $03
db $19, $2F, $03, $0D, $E6, $22, $CB, $0B
db $19, $0D, $03, $19, $30, $03, $0D, $E6
db $22, $CB, $0C, $19, $0E, $03, $19, $31
db $03, $03, $50, $4E, $46, $0F, $27, $FF
db $0D, $E6, $22, $CB, $09, $19, $0B, $02
db $19, $2E, $02, $0D, $E6, $22, $CB, $0A
db $19, $0C, $02, $19, $2F, $02, $0D, $E6
db $22, $CB, $0B, $19, $0D, $02, $19, $30
db $02, $0D, $E6, $22, $CB, $0C, $13, $01
db $DB, $48, $19, $0E, $02, $19, $31, $02
db $06, $A8, $48, $0D, $44, $45, $01, $01
db $0E, $00, $0D, $0F, $20, $10, $10, $00
db $0D, $94, $50, $03, $61, $4E, $46, $05
db $08, $24, $36, $0D, $64, $50, $00, $02
db $08, $00, $02, $0D, $E6, $22, $CB, $09
db $19, $0B, $03, $19, $2E, $03, $0D, $E6
db $22, $CB, $0A, $19, $0C, $03, $19, $2F
db $03, $0D, $E6, $22, $CB, $0B, $19, $0D
db $03, $19, $30, $03, $0D, $E6, $22, $CB
db $0C, $19, $0E, $03, $19, $31, $03, $08
db $00, $00, $0D, $E6, $22, $CB, $09, $19
db $0B, $02, $19, $2E, $02, $0D, $E6, $22
db $CB, $0A, $19, $0C, $02, $19, $2F, $02
db $0D, $E6, $22, $CB, $0B, $19, $0D, $02
db $19, $30, $02, $0D, $E6, $22, $CB, $0C
db $19, $0E, $02, $19, $31, $02, $24, $11
db $0D, $0F, $20, $0C, $0C, $3F, $04, $83
db $77, $0B, $0F, $46, $00, $19, $00, $02
db $0F, $47, $10, $19, $01, $02, $0F, $47
db $00, $19, $02, $02, $0F, $47, $10, $19
db $03, $02, $0F, $47, $00, $19, $04, $02
db $0F, $47, $10, $19, $05, $02, $0F, $47
db $00, $19, $06, $02, $0F, $47, $10, $19
db $07, $02, $18, $19, $00, $02, $0F, $47
db $10, $19, $01, $02, $0F, $47, $00, $19
db $02, $02, $0F, $47, $10, $19, $03, $02
db $0F, $47, $00, $19, $04, $02, $0F, $47
db $10, $19, $05, $02, $0F, $47, $00, $19
db $06, $02, $0F, $47, $10, $19, $07, $02
db $19, $00, $02, $0F, $47, $10, $19, $01
db $02, $0F, $47, $00, $19, $02, $02, $0F
db $47, $10, $19, $03, $02, $0F, $47, $00
db $19, $04, $02, $0F, $47, $10, $19, $05
db $02, $0F, $47, $00, $19, $06, $02, $0F
db $47, $10, $19, $07, $02, $16, $09, $08
db $0F, $47, $10, $05, $01, $0F, $47, $00
db $05, $01, $0A, $00, $0F, $47, $00, $19
db $0B, $02, $19, $2E, $02, $19, $0C, $02
db $19, $2F, $02, $19, $0D, $02, $19, $30
db $02, $19, $0E, $02, $19, $31, $02, $19
db $0B, $01, $19, $2E, $01, $19, $0C, $01
db $19, $2F, $01, $19, $0D, $01, $19, $30
db $01, $19, $0E, $01, $19, $31, $01, $19
db $0B, $01, $19, $0C, $01, $19, $0D, $01
db $19, $0E, $01, $19, $0B, $01, $19, $0C
db $01, $19, $0D, $01, $19, $0E, $01, $05
db $02, $19, $01, $02, $19, $0E, $02, $19
db $02, $02, $19, $0E, $02, $19, $00, $02
db $19, $02, $02, $06, $78, $56, $0F, $47
db $10, $09, $04, $19, $31, $01, $19, $FF
db $01, $0A, $16, $0F, $47, $10, $09, $04
db $19, $30, $01, $19, $FF, $01, $0A, $16
db $0F, $47, $10, $09, $04, $19, $2E, $01
db $19, $FF, $01, $0A, $16, $0F, $47, $10
db $09, $04, $19, $2F, $01, $19, $FF, $01
db $0A, $16, $0D, $D1, $1F, $F7, $F7, $26
db $40, $FE, $0D, $32, $10, $0E, $08, $40
db $FE, $2A, $0E, $0D, $0F, $20, $04, $04
db $00, $01, $37, $03, $6A, $4E, $46, $00
db $0D, $D1, $1F, $F7, $09, $26, $40, $FE
db $0D, $32, $10, $0E, $08, $C0, $01, $2A
db $F2, $06, $A3, $4A, $0D, $D1, $1F, $09
db $F7, $26, $C0, $01, $0D, $32, $10, $F2
db $08, $40, $FE, $2A, $0E, $06, $A3, $4A
db $0D, $D1, $1F, $09, $09, $26, $C0, $01
db $0D, $32, $10, $F2, $08, $C0, $01, $2A
db $F2, $06, $A3, $4A, $1B, $4E, $43, $05
db $19, $20, $04, $19, $21, $04, $19, $22
db $08, $19, $25, $08, $19, $26, $08, $19
db $27, $08, $0D, $E6, $22, $CB, $14, $16
db $0D, $41, $5A, $0F, $4B, $00, $0F, $4A
db $05, $0D, $D1, $1F, $00, $E4, $0D, $0F
db $20, $08, $08, $08, $08, $E0, $FF, $2A
db $04, $03, $AD, $4D, $46, $19, $18, $08
db $18, $03, $B3, $4D, $46, $09, $03, $19
db $2B, $02, $19, $18, $02, $0A, $19, $2B
db $02, $0D, $94, $50, $26, $C0, $00, $2A
db $08, $08, $00, $FF, $0F, $26, $20, $03
db $88, $4E, $46, $0F, $60, $00, $0D, $1D
db $20, $11, $5D, $4B, $19, $2A, $08, $19
db $2B, $08, $06, $63, $4B, $19, $2C, $08
db $19, $2D, $08, $06, $4E, $4B, $0D, $D1
db $1F, $FB, $FA, $04, $52, $6F, $0B, $0F
db $46, $00, $19, $05, $04, $19, $04, $04
db $19, $05, $04, $19, $04, $04, $16, $0D
db $D1, $1F, $FD, $F6, $06, $6B, $4B, $0D
db $D1, $1F, $03, $F8, $06, $6B, $4B, $0D
db $D1, $1F, $05, $FA, $06, $6B, $4B, $01
db $00, $40, $CD, $3C, $23, $D0, $1E, $06
db $01, $CE, $45, $C3, $46, $08, $CD, $17
db $50, $01, $00, $40, $CD, $3C, $23, $D0
db $1E, $06, $01, $E6, $45, $C3, $46, $08
db $CD, $E6, $1E, $CD, $A4, $0D, $1E, $04
db $21, $51, $DB, $1A, $96, $FE, $10, $38
db $04, $FE, $91, $38, $0B, $62, $2E, $1F
db $36, $46, $2C, $36, $4B, $2C, $36, $D8
db $01, $00, $40, $CD, $3C, $23, $30, $08
db $1E, $06, $01, $CE, $45, $C3, $46, $08
db $1E, $26, $1A, $B7, $28, $03, $3D, $12
db $C9, $3E, $06, $12, $1E, $27, $1A, $1E
db $CB, $CD, $19, $23, $1E, $40, $1A, $FE
db $05, $28, $0A, $3C, $12, $FE, $03, $C0
db $62, $2E, $27, $34, $C9, $1E, $27, $1A
db $FE, $05, $20, $0C, $62, $2E, $1F, $36
db $46, $2C, $36, $4C, $2C, $36, $2C, $C9
db $62, $2E, $1F, $36, $46, $2C, $36, $4B
db $2C, $36, $97, $C9, $01, $00, $40, $CD
db $3C, $23, $38, $13, $1E, $26, $1A, $B7
db $28, $03, $3D, $12, $C9, $3E, $06, $12
db $3E, $06, $1E, $CB, $C3, $19, $23, $1E
db $06, $01, $CE, $45, $C3, $46, $08, $CD
db $17, $50, $CD, $D3, $1E, $CD, $A4, $0D
db $01, $00, $40, $CD, $3C, $23, $D0, $1E
db $06, $01, $E6, $45, $C3, $46, $08, $CD
db $17, $50, $CD, $D3, $1E, $CD, $A4, $0D
db $01, $00, $40, $CD, $3C, $23, $38, $30
db $06, $00, $62, $1E, $04, $2E, $40, $1A
db $BE, $20, $07, $04, $1E, $0D, $AF, $12
db $1C, $12, $1E, $07, $21, $53, $DB, $1A
db $96, $FE, $18, $D0, $1E, $0F, $AF, $12
db $1C, $12, $1E, $12, $12, $78, $B7, $C8
db $1E, $06, $01, $4E, $43, $C3, $46, $08
db $1E, $06, $01, $E6, $45, $C3, $46, $08
db $CD, $17, $50, $CD, $D3, $1E, $CD, $E6
db $1E, $CD, $A4, $0D, $01, $00, $40, $CD
db $3C, $23, $D0, $1E, $06, $01, $E6, $45
db $C3, $46, $08, $CD, $17, $50, $CD, $E6
db $1E, $CD, $EB, $21, $CD, $A4, $0D, $01
db $00, $40, $CD, $3C, $23, $38, $12, $1E
db $07, $1A, $21, $53, $DB, $96, $FE, $70
db $D8, $1E, $06, $01, $BC, $45, $C3, $46
db $08, $1E, $06, $01, $E6, $45, $C3, $46
db $08, $CD, $EB, $21, $CD, $A4, $0D, $01
db $00, $40, $CD, $5B, $25, $CD, $25, $1A
db $CB, $7F, $28, $08, $1E, $06, $01, $68
db $46, $C3, $46, $08, $1E, $26, $1A, $B7
db $28, $02, $3D, $12, $3E, $08, $12, $CD
db $47, $06, $E6, $03, $C6, $15, $1E, $CB
db $C3, $19, $23, $CD, $D3, $1E, $CD, $A4
db $0D, $01, $00, $40, $CD, $5B, $25, $CD
db $25, $1A, $CB, $7F, $20, $13, $CD, $14
db $4D, $1E, $04, $1A, $62, $2E, $40, $BE
db $C0, $1E, $06, $01, $86, $46, $C3, $46
db $08, $62, $2E, $3F, $35, $20, $12, $AF
db $1E, $0F, $12, $1C, $12, $62, $2E, $1F
db $36, $46, $2C, $36, $4D, $2C, $36, $7C
db $C9, $7E, $21, $D4, $40, $5F, $07, $07
db $83, $85, $6F, $30, $01, $24, $CD, $F9
db $20, $C3, $BE, $20, $CD, $A4, $0D, $CD
db $14, $4D, $01, $00, $40, $CD, $5B, $25
db $1E, $04, $1A, $62, $2E, $40, $BE, $C0
db $1E, $06, $01, $86, $46, $C3, $46, $08
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $00
db $40, $C3, $5B, $25, $CD, $A4, $0D, $01
db $E3, $40, $C3, $5B, $25, $CD, $D3, $1E
db $CD, $A4, $0D, $01, $FF, $40, $C3, $5B
db $25, $CD, $D8, $21, $CD, $C5, $21, $CD
db $A4, $0D, $01, $FF, $40, $CD, $5B, $25
db $D8, $62, $2E, $26, $35, $C0, $36, $04
db $2E, $40, $35, $20, $08, $1E, $06, $01
db $FB, $47, $C3, $46, $08, $CD, $3D, $20
db $1E, $3C, $1A, $30, $05, $07, $30, $18
db $18, $03, $07, $38, $13, $1E, $3B, $1A
db $2F, $C6, $01, $12, $1C, $1A, $2F, $CE
db $00, $12, $1E, $45, $1A, $2F, $3C, $12
db $CD, $2B, $20, $1E, $3A, $1A, $30, $04
db $07, $D0, $18, $02, $07, $D8, $1E, $39
db $1A, $2F, $C6, $01, $12, $1C, $1A, $2F
db $CE, $00, $12, $C9, $62, $2E, $12, $5E
db $2E, $39, $4E, $2C, $46, $CD, $70, $0D
db $CD, $A4, $0D, $01, $FF, $40, $C3, $5B
db $25, $1E, $48, $1A, $67, $2E, $04, $5D
db $2A, $12, $1C, $2A, $12, $2E, $07, $5D
db $2A, $12, $1C, $2A, $12, $2E, $47, $5D
db $7E, $12, $01, $F1, $40, $C3, $5B, $25
db $CD, $31, $4E, $1E, $27, $1A, $FE, $01
db $C0, $1E, $06, $01, $E2, $48, $C3, $46
db $08, $CD, $A4, $0D, $01, $0D, $41, $C3
db $5B, $25, $CD, $E6, $1E, $CD, $D3, $1E
db $CD, $A4, $0D, $01, $1B, $41, $CD, $5B
db $25, $D8, $62, $2E, $0D, $2A, $B6, $C0
db $1E, $06, $01, $EC, $4A, $C3, $46, $08
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $FF
db $40, $CD, $5B, $25, $D8, $62, $2E, $26
db $35, $C0, $36, $20, $C9, $0A, $6F, $03
db $0A, $67, $03, $1E, $3D, $7D, $12, $1C
db $7C, $12, $C9, $1E, $3D, $1A, $6F, $1C
db $1A, $67, $2A, $1E, $27, $12, $1E, $3D
db $7D, $12, $1C, $7C, $12, $C9, $0A, $6F
db $03, $0A, $67, $03, $C5, $CD, $47, $06
db $0E, $00, $47, $2A, $B7, $28, $06, $B8
db $30, $03, $0C, $18, $F6, $79, $1E, $27
db $12, $C1, $C9, $0A, $6F, $03, $0A, $67
db $03, $1E, $27, $1A, $07, $85, $6F, $30
db $01, $24, $1E, $04, $FA, $51, $DB, $86
db $12, $1C, $23, $FA, $52, $DB, $8E, $12
db $C9, $0A, $5F, $03, $0A, $6F, $03, $0A
db $67, $03, $1A, $85, $6F, $30, $01, $24
db $7E, $1E, $24, $12, $C9, $C5, $26, $A0
db $1E, $04, $6B, $1A, $96, $47, $2C, $1C
db $1A, $9E, $30, $04, $78, $2F, $3C, $47
db $1E, $07, $6B, $1A, $D6, $08, $96, $4F
db $2C, $1C, $1A, $9E, $30, $04, $79, $2F
db $3C, $4F, $78, $CB, $2F, $B9, $38, $04
db $3E, $1B, $18, $13, $78, $B7, $28, $0D
db $79, $CD, $79, $4F, $79, $FE, $05, $30
db $04, $3E, $1C, $18, $02, $3E, $1D, $1E
db $15, $12, $C1, $C9, $1E, $15, $1A, $FE
db $1F, $28, $03, $3C, $12, $AF, $3E, $01
db $1E, $27, $12, $C9, $1E, $04, $0A, $03
db $6F, $17, $9F, $67, $1A, $85, $12, $1C
db $1A, $8C, $12, $C9, $1E, $07, $C3, $66
db $4F, $0E, $00, $90, $38, $03, $0C, $18
db $FA, $80, $CB, $38, $98, $D8, $0C, $C9
db $1E, $5B, $1A, $21, $29, $41, $5F, $07
db $07, $83, $85, $6F, $30, $01, $24, $CD
db $F9, $20, $1E, $0F, $2A, $12, $1C, $2A
db $12, $1E, $15, $7E, $12, $C9, $1E, $04
db $1A, $1E, $40, $21, $51, $DB, $96, $FE
db $50, $38, $08, $3E, $88, $86, $12, $3E
db $40, $18, $06, $3E, $18, $86, $12, $3E
db $C0, $1E, $45, $12, $C9, $21, $4D, $40
db $1E, $41, $1A, $07, $85, $6F, $30, $01
db $24, $1E, $0D, $2A, $12, $7E, $1C, $12
db $C9, $0A, $6F, $03, $0A, $67, $03, $1E
db $5B, $1A, $D6, $0D, $07, $85, $6F, $30
db $01, $24, $C3, $F9, $20, $1E, $45, $1A
db $07, $38, $05, $21, $00, $01, $18, $03
db $21, $00, $FF, $1E, $3B, $7D, $12, $1C
db $7C, $12, $CD, $2B, $20, $30, $05, $21
db $00, $01, $18, $03, $21, $00, $FF, $1E
db $39, $7D, $12, $1C, $7C, $12, $C9, $CD
db $C0, $1E, $CD, $2B, $20, $30, $04, $3E
db $07, $18, $02, $3E, $0A, $1E, $15, $12
db $C9, $CD, $47, $06, $21, $59, $40, $E6
db $07, $07, $85, $6F, $30, $01, $24, $2A
db $66, $1E, $3D, $12, $1C, $7C, $12, $C9
db $1E, $3D, $1A, $6F, $1C, $1A, $67, $2A
db $FE, $80, $20, $0D, $5F, $CD, $47, $06
db $BB, $38, $04, $23, $2A, $18, $02, $2A
db $23, $1E, $27, $12, $1E, $3D, $7D, $12
db $1C, $7C, $12, $C9, $1E, $42, $1A, $07
db $1E, $0D, $38, $08, $0A, $12, $03, $1C
db $0A, $12, $03, $C9, $0A, $2F, $C6, $01
db $12, $03, $1C, $0A, $2F, $CE, $00, $12
db $03, $C9, $1E, $42, $1A, $07, $1E, $11
db $38, $04, $0A, $12, $03, $C9, $0A, $2F
db $3C, $12, $03, $C9, $1E, $04, $1A, $1E
db $40, $21, $51, $DB, $96, $FE, $50, $30
db $08, $3E, $88, $86, $12, $3E, $40, $18
db $06, $3E, $18, $86, $12, $3E, $C0, $1E
db $45, $12, $1E, $42, $12, $C9, $1E, $48
db $1A, $67, $2E, $27, $0A, $03, $77, $C9
db $CD, $47, $06, $E6, $07, $5F, $07, $83
db $21, $B1, $40, $85, $6F, $30, $01, $24
db $CD, $F9, $20, $1E, $45, $1A, $07, $1E
db $41, $38, $03, $7E, $12, $C9, $7E, $2F
db $3C, $12, $C9, $C5, $1E, $48, $1A, $FE
db $A8, $38, $12, $FE, $B2, $30, $0E, $67
db $2E, $00, $7E, $FE, $FF, $28, $06, $CD
db $BA, $0B, $F0, $9A, $57, $C1, $C9, $0A
db $6F, $03, $0A, $67, $03, $CD, $F9, $20
db $C3, $BE, $20, $0F, $4B, $15, $0F, $4A
db $00, $0D, $0F, $20, $0C, $0C, $2D, $0F
db $5C, $00, $0F, $5B, $01, $0F, $4C, $50
db $0D, $5F, $22, $0D, $72, $22, $18, $29
db $00, $2A, $00, $0D, $3C, $51, $6D, $41
db $0D, $48, $51, $0E, $03, $63, $51, $D4
db $51, $2A, $52, $16, $0A, $6F, $03, $0A
db $03, $1E, $3E, $12, $1D, $7D, $12, $C9
db $1E, $3D, $1A, $6F, $1C, $1A, $67, $2A
db $FE, $FF, $20, $04, $21, $6D, $41, $2A
db $1E, $27, $12, $1E, $3D, $7D, $12, $1C
db $7C, $12, $C9, $28, $13, $80, $6E, $51
db $0B, $BB, $52, $06, $71, $51, $0B, $A6
db $52, $0B, $E2, $52, $0B, $0D, $54, $10
db $4C, $13, $29, $89, $51, $14, $3D, $91
db $51, $28, $13, $80, $8E, $51, $06, $91
db $51, $28, $14, $C0, $91, $51, $0B, $37
db $54, $0B, $7C, $54, $10, $4C, $13, $29
db $A3, $51, $14, $3D, $A9, $51, $28, $14
db $80, $A9, $51, $0B, $6D, $53, $06, $AC
db $51, $0B, $E2, $52, $28, $13, $80, $B4
db $51, $0B, $CC, $53, $0B, $B5, $55, $0B
db $6D, $53, $0B, $03, $55, $0B, $7C, $54
db $0B, $6D, $53, $0B, $0D, $54, $0B, $7C
db $54, $28, $13, $80, $30, $51, $0B, $96
db $52, $06, $30, $51, $10, $4C, $14, $33
db $DF, $51, $28, $13, $80, $E2, $51, $0B
db $BB, $52, $0B, $96, $52, $0B, $00, $55
db $28, $13, $C0, $F0, $51, $0B, $B8, $55
db $0B, $7C, $54, $0B, $96, $52, $0B, $00
db $55, $0B, $B8, $55, $0B, $7C, $54, $0B
db $96, $52, $0B, $00, $55, $28, $13, $80
db $0D, $52, $0B, $B8, $55, $0B, $7C, $54
db $0D, $55, $53, $11, $24, $52, $0B, $D3
db $53, $28, $14, $80, $24, $52, $0B, $0D
db $54, $0B, $7C, $54, $0B, $E2, $52, $06
db $30, $51, $0D, $55, $53, $12, $41, $52
db $28, $13, $80, $3B, $52, $0B, $BB, $52
db $06, $3E, $52, $0B, $A6, $52, $06, $44
db $52, $0B, $9E, $52, $0B, $B5, $55, $0B
db $7C, $54, $0B, $6D, $53, $28, $13, $80
db $55, $52, $0B, $03, $55, $0B, $7C, $54
db $0B, $6D, $53, $0B, $B5, $55, $28, $13
db $80, $66, $52, $0B, $03, $55, $0B, $7C
db $54, $0B, $A9, $53, $28, $13, $80, $7F
db $52, $0B, $B5, $55, $28, $13, $80, $87
db $52, $0B, $03, $55, $06, $87, $52, $28
db $13, $80, $8D, $52, $0B, $00, $55, $0B
db $37, $54, $06, $90, $52, $0B, $0D, $54
db $0B, $7C, $54, $06, $30, $51, $28, $13
db $C0, $D3, $53, $06, $CC, $53, $28, $13
db $40, $D3, $53, $06, $CC, $53, $07, $00
db $00, $29, $00, $08, $00, $01, $2A, $E0
db $03, $CA, $52, $46, $05, $10, $2A, $20
db $05, $10, $0C, $22, $C2, $52, $06, $06
db $A6, $52, $05, $08, $0D, $E6, $22, $CB
db $1A, $00, $CD, $D3, $1E, $CD, $A4, $0D
db $CD, $CD, $56, $01, $5F, $41, $CD, $3C
db $23, $D0, $1E, $06, $01, $0C, $56, $C3
db $46, $08, $0D, $55, $53, $12, $0A, $53
db $22, $0B, $53, $06, $03, $22, $53, $46
db $08, $00, $01, $09, $02, $2A, $F0, $05
db $10, $28, $14, $40, $03, $53, $0D, $E6
db $22, $CB, $1A, $05, $10, $2A, $10, $05
db $20, $0A, $0C, $0D, $94, $50, $07, $00
db $00, $0D, $82, $50, $10, $05, $10, $29
db $00, $05, $60, $0D, $82, $50, $F0, $05
db $10, $00, $62, $2E, $0D, $2A, $B6, $28
db $26, $1E, $04, $1A, $21, $51, $DB, $96
db $FE, $18, $38, $0C, $FE, $88, $38, $17
db $1E, $0E, $1A, $07, $38, $11, $18, $06
db $1E, $0E, $1A, $07, $30, $09, $AF, $1E
db $0D, $12, $1C, $12, $1E, $11, $12, $CD
db $E6, $1E, $C3, $CA, $52, $1E, $04, $1A
db $21, $51, $DB, $96, $FE, $48, $38, $08
db $FE, $58, $30, $04, $3E, $01, $18, $01
db $AF, $1E, $27, $12, $C9, $0D, $55, $53
db $12, $A8, $53, $03, $22, $53, $46, $08
db $40, $02, $2A, $F4, $0D, $94, $50, $07
db $00, $00, $0D, $82, $50, $10, $05, $10
db $29, $00, $0D, $64, $50, $80, $01, $05
db $40, $0D, $64, $50, $00, $01, $0D, $82
db $50, $F0, $05, $10, $07, $00, $00, $29
db $00, $08, $80, $FE, $2A, $30, $05, $10
db $0C, $03, $22, $53, $46, $08, $80, $01
db $2A, $F4, $07, $00, $00, $0D, $82, $50
db $10, $05, $10, $29, $00, $05, $30, $07
db $00, $00, $29, $00, $08, $00, $FF, $2A
db $20, $05, $10, $0C, $27, $0D, $DA, $53
db $06, $A9, $53, $27, $0D, $04, $54, $06
db $A9, $53, $1E, $04, $21, $51, $DB, $1A
db $96, $FE, $20, $38, $14, $FE, $80, $38
db $09, $1E, $45, $1A, $07, $38, $03, $2F
db $3C, $12, $1E, $45, $1A, $1E, $42, $12
db $C9, $1E, $45, $1A, $07, $30, $F3, $2F
db $3C, $12, $18, $EE, $1E, $45, $1A, $2F
db $3C, $12, $C3, $DA, $53, $03, $22, $53
db $46, $0D, $55, $53, $12, $20, $54, $0D
db $94, $50, $0B, $A9, $53, $06, $23, $54
db $0D, $D9, $54, $18, $2A, $00, $0D, $82
db $50, $10, $05, $10, $29, $00, $0D, $64
db $50, $80, $01, $2A, $08, $05, $20, $22
db $0B, $53, $06, $03, $AE, $54, $46, $0F
db $26, $10, $0F, $3F, $00, $0D, $93, $23
db $06, $94, $56, $08, $80, $00, $09, $02
db $2A, $F8, $05, $20, $2A, $08, $05, $20
db $0A, $0F, $47, $00, $0D, $93, $23, $06
db $78, $56, $03, $22, $53, $46, $07, $00
db $00, $29, $00, $08, $80, $FF, $2A, $08
db $05, $20, $10, $4C, $14, $29, $7B, $54
db $06, $03, $55, $0C, $03, $CA, $52, $46
db $07, $00, $00, $2A, $F0, $08, $00, $01
db $05, $20, $2A, $00, $0D, $9C, $54, $12
db $97, $54, $05, $01, $06, $8C, $54, $2A
db $10, $05, $20, $0C, $1E, $07, $1A, $21
db $53, $DB, $96, $FE, $2D, $3E, $00, $30
db $01, $3C, $1E, $27, $12, $C9, $1E, $3F
db $1A, $B7, $28, $04, $3D, $12, $18, $09
db $3E, $02, $12, $1E, $47, $1A, $EE, $10
db $12, $1E, $26, $1A, $B7, $28, $05, $3D
db $12, $C3, $22, $53, $3E, $08, $12, $3E
db $1B, $1E, $CB, $CD, $19, $23, $C3, $22
db $53, $1E, $04, $1A, $21, $51, $DB, $96
db $FE, $20, $30, $07, $1E, $45, $3E, $40
db $12, $18, $11, $FE, $80, $38, $07, $1E
db $45, $3E, $C0, $12, $18, $06, $CD, $C0
db $1E, $1E, $45, $1A, $1E, $42, $12, $C9
db $0B, $7E, $55, $18, $2A, $00, $03, $CA
db $52, $46, $0D, $93, $23, $06, $94, $56
db $09, $0C, $0F, $47, $10, $05, $02, $0F
db $47, $00, $05, $02, $0A, $0D, $4C, $55
db $0F, $27, $1C, $09, $07, $0D, $A5, $55
db $05, $04, $0D, $A5, $55, $05, $04, $0D
db $A5, $55, $05, $04, $09, $05, $0F, $47
db $10, $05, $02, $0F, $47, $00, $05, $02
db $0A, $0D, $B0, $55, $0A, $0D, $93, $23
db $06, $78, $56, $0C, $1E, $04, $1A, $21
db $51, $DB, $96, $2E, $01, $FE, $40, $38
db $0A, $FE, $60, $30, $0A, $1E, $45, $1A
db $2D, $18, $06, $3E, $40, $18, $02, $3E
db $C0, $1E, $3A, $12, $1E, $41, $7D, $12
db $CD, $2B, $20, $38, $03, $AF, $18, $02
db $3E, $01, $1E, $43, $12, $C9, $03, $CA
db $52, $46, $07, $00, $00, $29, $00, $08
db $80, $00, $2A, $F8, $05, $20, $08, $00
db $FF, $2A, $10, $05, $20, $2A, $00, $05
db $10, $2A, $F0, $05, $20, $08, $80, $FF
db $2A, $08, $05, $20, $0C, $C5, $1E, $27
db $1A, $1E, $CB, $CD, $19, $23, $C1, $C9
db $62, $2E, $27, $34, $C9, $0B, $7E, $55
db $0D, $55, $53, $03, $D7, $55, $46, $07
db $00, $00, $08, $00, $01, $0F, $26, $08
db $0F, $3F, $00, $09, $04, $2A, $C0, $05
db $08, $2A, $40, $05, $08, $0A, $0C, $62
db $2E, $26, $35, $C2, $CA, $52, $1E, $27
db $1A, $B7, $28, $04, $36, $04, $18, $02
db $36, $0C, $C6, $25, $2E, $3F, $86, $1E
db $CB, $CD, $19, $23, $1E, $3F, $1A, $3C
db $12, $FE, $02, $DA, $CA, $52, $62, $2E
db $1F, $36, $46, $2C, $36, $52, $2C, $36
db $CA, $C3, $CA, $52, $0F, $41, $01, $03
db $48, $56, $46, $1C, $FA, $7C, $04, $0D
db $93, $23, $06, $AA, $56, $09, $04, $19
db $34, $02, $19, $06, $01, $19, $35, $02
db $19, $06, $01, $0A, $19, $05, $04, $19
db $04, $04, $19, $03, $04, $19, $06, $04
db $19, $05, $04, $19, $04, $04, $19, $03
db $04, $19, $06, $04, $0F, $41, $00, $00
db $01, $5F, $41, $CD, $5B, $25, $1E, $41
db $1A, $B7, $C0, $CD, $71, $0C, $62, $2E
db $60, $36, $3F, $2E, $44, $36, $10, $AF
db $C9, $0D, $E3, $50, $0D, $6F, $56, $1C
db $85, $47, $03, $0D, $67, $23, $16, $21
db $E4, $4C, $3E, $03, $CD, $CF, $05, $C9
db $0D, $0F, $20, $0C, $0C, $BF, $0F, $27
db $00, $03, $31, $4E, $46, $19, $00, $08
db $19, $02, $08, $19, $01, $08, $19, $02
db $08, $06, $85, $56, $0F, $27, $01, $03
db $31, $4E, $46, $19, $00, $04, $19, $02
db $04, $19, $01, $04, $19, $02, $04, $06
db $9B, $56, $03, $31, $4E, $46, $09, $08
db $19, $FF, $02, $19, $01, $01, $0A, $09
db $04, $19, $00, $02, $19, $02, $02, $19
db $01, $02, $19, $02, $02, $0A, $0E, $02
db $78, $56, $94, $56, $16, $CD, $C0, $1E
db $CD, $2B, $20, $30, $04, $3E, $03, $18
db $02, $3E, $06, $1E, $15, $12, $C9, $0F
db $4B, $00, $0F, $4A, $05, $24, $1A, $0D
db $0F, $20, $08, $08, $00, $0D, $D1, $1F
db $00, $10, $08, $00, $00, $0D, $5F, $20
db $78, $41, $26, $80, $00, $03, $19, $57
db $46, $0D, $1D, $20, $11, $10, $57, $19
db $2A, $08, $19, $2B, $08, $06, $16, $57
db $19, $2C, $08, $19, $2D, $08, $06, $01
db $57, $CD, $EB, $21, $CD, $A4, $0D, $01
db $FF, $40, $CD, $5B, $25, $D8, $CD, $25
db $1A, $CB, $7F, $C8, $1E, $06, $01, $34
db $57, $C3, $46, $08, $03, $6E, $57, $46
db $18, $29, $00, $0D, $1D, $20, $11, $4A
db $57, $19, $2A, $08, $19, $2B, $08, $06
db $50, $57, $19, $2C, $08, $19, $2D, $08
db $27, $0D, $9F, $21, $7B, $41, $0D, $1D
db $20, $11, $65, $57, $19, $2A, $08, $19
db $2B, $08, $06, $6B, $57, $19, $2C, $08
db $19, $2D, $08, $06, $56, $57, $CD, $C5
db $21, $CD, $A4, $0D, $01, $FF, $40, $C3
db $5B, $25, $24, $35, $0D, $0F, $20, $04
db $04, $BF, $08, $00, $04, $0D, $AD, $57
db $03, $95, $57, $46, $19, $13, $02, $19
db $3B, $02, $06, $8C, $57, $CD, $A4, $0D
db $01, $E3, $40, $CD, $5B, $25, $D8, $CD
db $25, $1A, $CB, $7F, $C8, $1E, $06, $01
db $BA, $57, $C3, $46, $08, $1E, $48, $1A
db $67, $2E, $0D, $5D, $2A, $12, $1C, $7E
db $12, $C9, $18, $03, $DC, $57, $46, $0D
db $E6, $22, $CB, $28, $19, $18, $01, $19
db $14, $01, $19, $16, $02, $0D, $E6, $22
db $CB, $28, $19, $18, $01, $19, $15, $01
db $19, $17, $04, $16, $01, $E3, $40, $C3
db $5B, $25, $0D, $1A, $58, $10, $43, $11
db $F2, $57, $0D, $D1, $1F, $00, $0C, $06
db $F7, $57, $0D, $D1, $1F, $00, $F4, $0D
db $29, $58, $0D, $34, $58, $24, $35, $0D
db $0F, $20, $04, $04, $BF, $03, $7C, $58
db $46, $05, $02, $0D, $58, $47, $28, $05
db $02, $0D, $58, $47, $D8, $05, $02, $06
db $0B, $58, $1E, $48, $1A, $67, $2E, $43
db $5D, $7E, $12, $2E, $41, $5D, $7E, $12
db $C9, $1E, $48, $1A, $67, $2E, $3A, $7E
db $1E, $45, $12, $C9, $1E, $41, $1A, $07
db $21, $6A, $58, $85, $6F, $30, $01, $24
db $2A, $66, $6F, $1E, $5B, $1A, $D6, $1C
db $85, $6F, $30, $01, $24, $7E, $CD, $8B
db $4F, $1E, $43, $1A, $B7, $C8, $1E, $45
db $1A, $2F, $3C, $12, $1E, $0F, $1A, $2F
db $C6, $01, $12, $1C, $1A, $2F, $CE, $00
db $12, $C9, $6E, $58, $75, $58, $00, $07
db $00, $01, $02, $03, $04, $01, $00, $01
db $02, $03, $04, $05, $CD, $A4, $0D, $01
db $E3, $40, $CD, $5B, $25, $D8, $01, $A7
db $58, $CD, $CD, $24, $CB, $7F, $20, $0F
db $CB, $6F, $20, $03, $CB, $77, $C8, $62
db $CD, $BA, $0B, $F0, $9A, $12, $C9, $1E
db $06, $01, $BA, $57, $C3, $46, $08, $FC
db $03, $FC, $03, $0F, $4B, $00, $0F, $4A
db $05, $24, $1A, $0D, $0F, $20, $08, $08
db $00, $0D, $D1, $1F, $00, $10, $08, $00
db $00, $2A, $10, $03, $DF, $58, $46, $0D
db $1D, $20, $11, $D6, $58, $19, $2A, $08
db $19, $2B, $08, $06, $DC, $58, $19, $2C
db $08, $19, $2D, $08, $06, $C7, $58, $CD
db $D3, $1E, $CD, $A4, $0D, $01, $FF, $40
db $CD, $5B, $25, $D8, $CD, $25, $1A, $CB
db $7F, $C8, $1E, $06, $01, $FA, $58, $C3
db $46, $08, $08, $00, $00, $2A, $00, $27
db $26, $80, $01, $03, $43, $59, $46, $0D
db $1D, $20, $11, $16, $59, $19, $2A, $08
db $19, $2B, $08, $06, $1C, $59, $19, $2C
db $08, $19, $2D, $08, $0D, $5F, $20, $7E
db $41, $22, $3B, $5F, $1D, $09, $03, $0D
db $1D, $20, $11, $36, $59, $19, $2A, $08
db $19, $2B, $08, $06, $3C, $59, $19, $2C
db $08, $19, $2D, $08, $0A, $2A, $00, $1B
db $4E, $43, $05, $62, $2E, $12, $5E, $2E
db $39, $4E, $2C, $46, $CD, $70, $0D, $CD
db $A4, $0D, $01, $FF, $40, $C3, $5B, $25
db $24, $1A, $27, $26, $60, $00, $06, $65
db $59, $27, $26, $A0, $FF, $0F, $4B, $00
db $0F, $4A, $05, $0D, $0F, $20, $08, $08
db $00, $0D, $D1, $1F, $00, $F0, $08, $00
db $FE, $0D, $5F, $20, $81, $41, $03, $9F
db $59, $46, $0D, $1D, $20, $1A, $3F, $0D
db $1D, $20, $11, $96, $59, $19, $2A, $08
db $19, $2B, $08, $06, $9C, $59, $19, $2C
db $08, $19, $2D, $08, $06, $87, $59, $CD
db $EB, $21, $CD, $A4, $0D, $01, $FF, $40
db $CD, $5B, $25, $D8, $1E, $3F, $1A, $FE
db $01, $20, $06, $CD, $2B, $20, $D8, $18
db $04, $CD, $2B, $20, $D0, $1E, $06, $01
db $C5, $59, $C3, $46, $08, $18, $29, $00
db $03, $6E, $57, $46, $0D, $1D, $20, $11
db $DB, $59, $19, $2A, $08, $19, $2B, $08
db $06, $E1, $59, $19, $2C, $08, $19, $2D
db $08, $27, $0D, $9F, $21, $84, $41, $0D
db $1D, $20, $11, $F6, $59, $19, $2A, $08
db $19, $2B, $08, $06, $FC, $59, $19, $2C
db $08, $19, $2D, $08, $06, $E7, $59, $0D
db $41, $5A, $04, $52, $6F, $0B, $0F, $46
db $00, $0D, $2B, $5A, $0D, $D1, $1F, $08
db $00, $26, $20, $01, $0D, $32, $10, $F0
db $08, $00, $00, $2A, $D0, $03, $38, $5A
db $46, $19, $04, $02, $19, $05, $03, $19
db $04, $03, $16, $CD, $47, $06, $FE, $80
db $D8, $1E, $45, $1A, $2F, $3C, $12, $C9
db $CD, $E6, $1E, $CD, $D3, $1E, $C3, $A4
db $0D, $1E, $48, $1A, $67, $6B, $7E, $12
db $C9, $FF, $02, $00, $00, $00, $46, $70
db $06, $00, $00, $00, $46, $70, $06, $FF
db $02, $00, $00, $00, $7A, $70, $06, $00
db $00, $00, $7A, $70, $06, $F9, $06, $F9
db $06, $F9, $0B, $F9, $06, $12, $20, $01
db $40, $80, $C0, $00, $80, $C0, $00, $40
db $80, $C0, $00, $80, $C0, $00, $40, $80
db $C0, $20, $A0, $C0, $40, $00, $00, $40
db $80, $C0, $20, $40, $A0, $20, $20, $A0
db $10, $C0, $02, $80, $C0, $10, $80, $00
db $10, $00, $FE, $54, $5C, $54, $24, $50
db $2C, $4C, $24, $4C, $5C, $6B, $5A, $63
db $3A, $50, $42, $3C, $3A, $34, $5A, $20
db $00, $02, $20, $00, $01, $FF, $02, $9B
db $4D, $03, $33, $4E, $03, $00, $00, $00
db $2A, $4F, $03, $00, $02, $9B, $4D, $03
db $33, $4E, $03, $00, $00, $00, $2A, $4F
db $03, $03, $02, $9B, $4D, $03, $33, $4E
db $03, $00, $00, $00, $2A, $4F, $03, $00
db $00, $00, $20, $80, $02, $0C, $F0, $00
db $1D, $44, $02, $16, $B8, $01, $16, $B8
db $01, $10, $00, $02, $FE, $5A, $28, $5B
db $52, $5B, $7C, $5B, $A6, $5B, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $10, $00, $00
db $70, $00, $01, $F0, $00, $07, $F0, $00
db $0F, $F0, $00, $07, $F0, $00, $01, $F0
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $08, $00, $00, $1E, $00
db $00, $0F, $80, $00, $0F, $E0, $00, $07
db $F0, $00, $07, $F0, $00, $03, $F0, $00
db $03, $F0, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $60, $00, $00, $60, $00, $00, $F0, $00
db $00, $F0, $00, $01, $F8, $00, $01, $F8
db $00, $03, $FC, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $01, $00
db $00, $07, $80, $00, $1F, $00, $00, $7F
db $00, $00, $FE, $00, $00, $FE, $00, $00
db $FC, $00, $00, $FC, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $80, $00, $00, $E0, $00
db $00, $F8, $00, $00, $FE, $00, $00, $FF
db $80, $00, $FE, $00, $00, $F8, $00, $00
db $17, $F6, $0D, $0F, $44, $FF, $0D, $E0
db $35, $20, $00, $50, $00, $10, $4C, $0F
db $42, $00, $0D, $0C, $5C, $0D, $0F, $20
db $04, $08, $3F, $0D, $BA, $22, $D2, $00
db $0D, $B8, $5D, $0D, $C8, $5C, $E9, $01
db $00, $27, $03, $74, $5C, $46, $0D, $5F
db $20, $6D, $5A, $19, $08, $08, $19, $09
db $08, $06, $03, $5C, $7A, $EA, $0E, $DD
db $C9, $17, $F6, $0D, $0F, $44, $FF, $0F
db $4C, $28, $0F, $42, $00, $0F, $61, $00
db $0F, $4B, $02, $0F, $4A, $50, $04, $E2
db $6A, $0D, $0D, $F9, $1F, $0D, $E0, $35
db $80, $00, $50, $00, $0D, $0F, $20, $04
db $0B, $3F, $27, $03, $9E, $5C, $46, $0D
db $5F, $20, $6D, $5A, $0F, $27, $00, $19
db $1A, $02, $19, $19, $10, $06, $47, $5C
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $49
db $5A, $CD, $C1, $75, $D0, $1E, $06, $01
db $0F, $70, $C3, $46, $08, $01, $57, $5A
db $CD, $C1, $75, $D0, $1E, $06, $01, $26
db $70, $C3, $46, $08, $CD, $EB, $21, $CD
db $A4, $0D, $01, $49, $5A, $CD, $5B, $25
db $01, $65, $5A, $CD, $CD, $24, $CB, $7F
db $C8, $1E, $0E, $21, $99, $42, $3E, $1E
db $CD, $CF, $05, $F0, $9A, $57, $1E, $06
db $01, $D1, $5C, $C3, $46, $08, $CD, $EB
db $21, $CD, $A4, $0D, $01, $57, $5A, $CD
db $5B, $25, $01, $69, $5A, $CD, $CD, $24
db $CB, $7F, $C8, $1E, $0E, $21, $99, $42
db $3E, $1E, $CD, $CF, $05, $F0, $9A, $57
db $1E, $06, $01, $02, $5D, $C3, $46, $08
db $0A, $03, $EA, $00, $CD, $EA, $78, $DB
db $C9, $0F, $27, $00, $18, $0D, $1D, $5D
db $0D, $5F, $22, $0D, $72, $22, $03, $37
db $5D, $46, $08, $80, $00, $2A, $F0, $19
db $00, $08, $19, $01, $08, $08, $80, $FF
db $2A, $10, $19, $00, $08, $19, $01, $08
db $0D, $26, $5D, $12, $95, $5D, $18, $2A
db $00, $00, $18, $03, $65, $5C, $46, $12
db $0F, $5D, $05, $01, $06, $07, $5D, $0F
db $27, $00, $03, $53, $5D, $46, $19, $19
db $20, $12, $A2, $5D, $00, $1E, $48, $1A
db $67, $2E, $27, $36, $01, $C9, $CD, $47
db $06, $E6, $01, $62, $2E, $48, $66, $2E
db $27, $77, $EE, $01, $5D, $12, $C9, $CD
db $69, $5D, $CD, $D3, $1E, $CD, $A4, $0D
db $01, $49, $5A, $CD, $5B, $25, $1E, $27
db $1A, $B7, $C8, $1E, $06, $01, $C5, $5D
db $C3, $46, $08, $CD, $7F, $5D, $01, $49
db $5A, $CD, $5B, $25, $1E, $27, $1A, $B7
db $C8, $1E, $06, $01, $33, $5E, $C3, $46
db $08, $FA, $E4, $DE, $FE, $0C, $D8, $AF
db $EA, $E4, $DE, $62, $2E, $1F, $36, $46
db $2C, $36, $5D, $2C, $36, $3A, $C9, $FA
db $E4, $DE, $FE, $0C, $D8, $AF, $EA, $E4
db $DE, $62, $2E, $1F, $36, $46, $2C, $36
db $5D, $2C, $36, $56, $C9, $0B, $B2, $67
db $0D, $AF, $5D, $03, $56, $5C, $46, $06
db $DC, $64, $0B, $E4, $67, $0D, $AF, $5D
db $03, $65, $5C, $46, $06, $0F, $65, $1E
db $48, $1A, $67, $2E, $27, $36, $01, $C9
db $AF, $EA, $0A, $DD, $C9, $21, $0A, $DD
db $7E, $E6, $80, $77, $C9, $0F, $42, $01
db $0D, $0F, $20, $04, $08, $2D, $27, $0D
db $72, $22, $18, $03, $50, $5C, $46, $08
db $80, $00, $2A, $F0, $19, $00, $08, $19
db $01, $08, $08, $80, $FF, $2A, $10, $19
db $00, $08, $19, $01, $08, $0F, $40, $00
db $0D, $70, $5E, $70, $5A, $12, $BB, $5E
db $0D, $9D, $5E, $12, $17, $5E, $08, $80
db $00, $2A, $F0, $19, $00, $08, $19, $01
db $08, $08, $80, $FF, $2A, $10, $19, $00
db $08, $19, $01, $08, $06, $F0, $5D, $08
db $80, $00, $2A, $F0, $19, $00, $08, $19
db $11, $08, $08, $80, $FF, $2A, $10, $19
db $12, $08, $0D, $B4, $5E, $19, $01, $08
db $06, $F0, $5D, $0F, $42, $01, $0D, $0F
db $20, $04, $0B, $2D, $27, $0D, $72, $22
db $03, $65, $5C, $46, $19, $19, $20, $0F
db $40, $00, $0D, $70, $5E, $77, $5A, $12
db $F0, $5E, $0D, $9D, $5E, $12, $5E, $5E
db $19, $19, $20, $06, $4A, $5E, $19, $19
db $0C, $19, $1A, $04, $0D, $B4, $5E, $19
db $1A, $04, $19, $19, $0C, $06, $4A, $5E
db $0A, $6F, $03, $0A, $67, $03, $1E, $5C
db $1A, $07, $07, $62, $2E, $40, $86, $34
db $85, $6F, $30, $01, $24, $7E, $B7, $20
db $04, $3E, $01, $18, $0C, $5F, $CD, $47
db $06, $BB, $30, $04, $3E, $01, $18, $01
db $AF, $1E, $27, $12, $C9, $CD, $3D, $20
db $1E, $45, $1A, $38, $07, $07, $38, $07
db $3E, $01, $18, $04, $07, $38, $F9, $AF
db $1E, $27, $12, $C9, $1E, $45, $1A, $2F
db $3C, $12, $C9, $0F, $42, $01, $0D, $0F
db $20, $04, $08, $2D, $0D, $81, $5F, $12
db $3D, $69, $0D, $19, $5F, $0E, $04, $97
db $5F, $A1, $61, $59, $62, $60, $64, $16
db $0D, $0F, $20, $04, $0B, $2D, $0D, $55
db $5F, $11, $C5, $5D, $0D, $68, $5F, $12
db $C5, $5D, $0B, $B2, $67, $06, $DC, $64
db $0F, $42, $01, $0D, $81, $5F, $12, $59
db $69, $0D, $19, $5F, $0E, $04, $A4, $5F
db $E2, $61, $39, $63, $AD, $64, $16, $0D
db $55, $5F, $11, $33, $5E, $0D, $68, $5F
db $12, $33, $5E, $0B, $E4, $67, $06, $0F
db $65, $C5, $1E, $5C, $1A, $5F, $07, $07
db $07, $83, $6F, $1E, $43, $1A, $67, $3C
db $FE, $03, $38, $02, $D6, $03, $12, $7C
db $07, $84, $85, $21, $7E, $5A, $85, $6F
db $30, $01, $24, $CD, $47, $06, $5F, $06
db $00, $0E, $03, $7E, $B7, $28, $08, $BB
db $30, $05, $23, $04, $0D, $20, $F4, $78
db $1E, $27, $12, $C1, $C9, $AF, $21, $0A
db $DD, $CB, $76, $20, $07, $CB, $46, $28
db $03, $CB, $CE, $3C, $1E, $27, $12, $C9
db $21, $0A, $DD, $1E, $4C, $1A, $FE, $15
db $30, $06, $CB, $F6, $3E, $01, $18, $05
db $CB, $7E, $20, $F8, $AF, $1E, $27, $12
db $C9, $21, $0A, $DD, $CB, $76, $20, $03
db $AF, $18, $08, $CB, $46, $28, $F9, $CB
db $8E, $3E, $01, $1E, $27, $12, $C9, $28
db $13, $C0, $B1, $5F, $28, $13, $80, $BD
db $5F, $06, $E6, $60, $28, $13, $C0, $B7
db $5F, $28, $13, $80, $C3, $5F, $06, $09
db $61, $0F, $40, $00, $06, $C9, $5F, $26
db $40, $00, $06, $19, $60, $0F, $40, $01
db $06, $C9, $5F, $26, $C0, $FF, $06, $19
db $60, $24, $0D, $03, $35, $60, $46, $0D
db $BD, $60, $20, $00, $08, $40, $FF, $2A
db $0C, $19, $00, $08, $19, $01, $08, $08
db $C0, $00, $2A, $F4, $19, $02, $08, $19
db $03, $08, $03, $52, $60, $46, $0D, $BD
db $60, $40, $00, $08, $80, $FD, $2A, $0D
db $19, $04, $08, $19, $05, $08, $19, $06
db $08, $19, $07, $08, $19, $08, $08, $19
db $09, $08, $19, $08, $08, $19, $09, $08
db $19, $06, $08, $19, $07, $08, $06, $10
db $60, $24, $0D, $03, $74, $60, $46, $08
db $80, $FD, $2A, $0D, $01, $1B, $00, $18
db $03, $65, $5C, $46, $19, $1A, $02, $19
db $19, $18, $06, $07, $5F, $01, $49, $5A
db $CD, $C1, $75, $38, $0B, $CD, $D3, $1E
db $CD, $A4, $0D, $CD, $AB, $60, $AF, $C9
db $1E, $06, $01, $0F, $70, $C3, $46, $08
db $37, $C9, $CD, $35, $60, $D8, $01, $65
db $5A, $CD, $CD, $24, $CB, $7F, $C8, $1E
db $0E, $21, $99, $42, $3E, $1E, $CD, $CF
db $05, $F0, $9A, $57, $1E, $06, $01, $D8
db $5E, $C3, $46, $08, $01, $57, $5A, $CD
db $C1, $75, $38, $27, $CD, $D3, $1E, $CD
db $A4, $0D, $CD, $AB, $60, $01, $69, $5A
db $CD, $CD, $24, $CB, $7F, $C8, $1E, $0E
db $21, $99, $42, $3E, $1E, $CD, $CF, $05
db $F0, $9A, $57, $1E, $06, $01, $27, $60
db $C3, $46, $08, $1E, $06, $01, $26, $70
db $C3, $46, $08, $CD, $4B, $64, $D0, $1E
db $0D, $1A, $2F, $C6, $01, $12, $1C, $1A
db $2F, $CE, $00, $12, $C9, $1E, $45, $1A
db $07, $1E, $40, $1A, $38, $13, $0F, $38
db $13, $1E, $0D, $0A, $2F, $C6, $01, $12
db $1C, $03, $0A, $2F, $CE, $00, $12, $03
db $C9, $0F, $38, $ED, $1E, $0D, $0A, $12
db $1C, $03, $0A, $12, $03, $C9, $24, $0D
db $03, $28, $61, $46, $26, $C0, $FF, $08
db $80, $FE, $2A, $0C, $19, $04, $08, $19
db $05, $08, $19, $06, $08, $19, $07, $08
db $19, $08, $08, $19, $09, $08, $06, $00
db $61, $24, $0D, $03, $5F, $61, $46, $26
db $C0, $FF, $08, $80, $FE, $2A, $0C, $01
db $1B, $00, $18, $03, $65, $5C, $46, $19
db $1A, $02, $19, $19, $10, $06, $07, $5F
db $01, $49, $5A, $CD, $C1, $75, $38, $27
db $CD, $D3, $1E, $CD, $A4, $0D, $CD, $96
db $61, $01, $65, $5A, $CD, $CD, $24, $CB
db $7F, $C8, $1E, $0E, $21, $99, $42, $3E
db $1E, $CD, $CF, $05, $F0, $9A, $57, $1E
db $06, $01, $D8, $5E, $C3, $46, $08, $1E
db $06, $01, $0F, $70, $C3, $46, $08, $01
db $57, $5A, $CD, $C1, $75, $38, $27, $CD
db $D3, $1E, $CD, $A4, $0D, $CD, $96, $61
db $01, $69, $5A, $CD, $CD, $24, $CB, $7F
db $C8, $1E, $0E, $21, $99, $42, $3E, $1E
db $CD, $CF, $05, $F0, $9A, $57, $1E, $06
db $01, $1A, $61, $C3, $46, $08, $1E, $06
db $01, $26, $70, $C3, $46, $08, $CD, $4B
db $64, $D0, $AF, $1E, $0D, $12, $1C, $12
db $C9, $03, $16, $62, $46, $0B, $BB, $61
db $28, $13, $80, $D8, $5E, $0B, $BB, $61
db $28, $13, $C0, $D8, $5E, $0B, $BB, $61
db $06, $D8, $5E, $09, $02, $27, $26, $80
db $00, $08, $40, $FF, $2A, $10, $19, $06
db $06, $19, $05, $06, $19, $04, $06, $19
db $07, $06, $26, $20, $00, $08, $C0, $00
db $2A, $E0, $19, $00, $06, $19, $01, $06
db $0A, $0C, $08, $00, $00, $0B, $FB, $61
db $28, $13, $80, $07, $5F, $0B, $FB, $61
db $28, $13, $C0, $07, $5F, $0B, $FB, $61
db $06, $07, $5F, $09, $02, $03, $2E, $62
db $46, $27, $26, $C0, $00, $29, $00, $19
db $1A, $08, $26, $80, $00, $0D, $32, $10
db $F8, $19, $19, $18, $0A, $0C, $CD, $D3
db $1E, $CD, $A4, $0D, $CD, $96, $61, $01
db $49, $5A, $CD, $C1, $75, $D0, $1E, $06
db $01, $0F, $70, $C3, $46, $08, $CD, $E6
db $1E, $CD, $A4, $0D, $CD, $96, $61, $01
db $57, $5A, $CD, $C1, $75, $38, $12, $62
db $2E, $0D, $2A, $B6, $C0, $62, $2E, $1F
db $36, $46, $2C, $36, $5C, $2C, $36, $65
db $C9, $1E, $06, $01, $26, $70, $C3, $46
db $08, $0D, $0F, $20, $06, $07, $2D, $03
db $50, $5C, $46, $07, $00, $00, $08, $80
db $01, $2A, $D0, $19, $00, $08, $19, $01
db $08, $08, $00, $00, $2A, $00, $09, $04
db $19, $02, $02, $19, $03, $02, $0A, $24
db $0C, $26, $80, $02, $22, $95, $62, $06
db $03, $E1, $63, $46, $19, $0E, $02, $19
db $0F, $02, $06, $8C, $62, $0D, $E6, $22
db $D3, $0A, $05, $04, $06, $95, $62, $0D
db $77, $0F, $0D, $03, $56, $5C, $46, $07
db $00, $00, $19, $0C, $02, $19, $37, $02
db $19, $0C, $02, $19, $37, $02, $03, $50
db $5C, $46, $26, $80, $FE, $08, $80, $FE
db $2A, $18, $19, $0C, $08, $19, $0D, $08
db $19, $0C, $08, $19, $0D, $08, $26, $80
db $FF, $08, $80, $01, $2A, $D0, $19, $0C
db $08, $19, $0D, $08, $26, $80, $FF, $08
db $00, $FF, $2A, $10, $19, $0C, $08, $19
db $0D, $08, $19, $0C, $08, $19, $0D, $08
db $26, $C0, $FF, $08, $00, $01, $2A, $E0
db $19, $0C, $08, $19, $0D, $08, $0D, $9D
db $5E, $12, $1D, $63, $08, $80, $00, $2A
db $F0, $19, $00, $08, $19, $01, $08, $08
db $80, $FF, $2A, $10, $19, $00, $08, $19
db $01, $08, $06, $D8, $5E, $08, $80, $00
db $2A, $F0, $19, $00, $08, $19, $11, $08
db $08, $80, $FF, $2A, $10, $19, $12, $08
db $0D, $B4, $5E, $19, $01, $08, $06, $D8
db $5E, $03, $00, $64, $46, $07, $00, $00
db $08, $80, $FE, $2A, $18, $19, $1B, $10
db $2A, $00, $19, $20, $02, $19, $21, $02
db $2A, $18, $19, $22, $02, $19, $23, $02
db $19, $24, $02, $19, $25, $02, $19, $26
db $02, $19, $27, $02, $19, $28, $02, $19
db $1F, $02, $08, $00, $00, $2A, $00, $0D
db $9F, $21, $90, $5A, $0D, $0F, $20, $05
db $07, $2D, $22, $95, $62, $06, $03, $29
db $64, $46, $24, $0C, $19, $1F, $01, $19
db $20, $01, $19, $21, $01, $19, $22, $01
db $19, $23, $01, $19, $24, $01, $19, $25
db $01, $19, $26, $01, $19, $27, $01, $19
db $28, $01, $06, $84, $63, $0D, $77, $0F
db $0D, $03, $00, $64, $46, $07, $00, $00
db $19, $1E, $02, $19, $36, $02, $19, $1E
db $02, $19, $36, $02, $26, $00, $FF, $08
db $80, $FE, $2A, $18, $19, $1E, $20, $26
db $80, $FF, $08, $00, $FF, $2A, $10, $05
db $20, $18, $2A, $00, $03, $65, $5C, $46
db $19, $1A, $04, $19, $19, $20, $06, $07
db $5F, $CD, $A4, $0D, $01, $49, $5A, $CD
db $C1, $75, $38, $0C, $CD, $4B, $64, $D0
db $1E, $06, $01, $9F, $62, $C3, $46, $08
db $1E, $06, $01, $0F, $70, $C3, $46, $08
db $01, $57, $5A, $CD, $C1, $75, $38, $19
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $69
db $5A, $CD, $CD, $24, $CB, $7F, $C8, $AF
db $1E, $12, $12, $1E, $0F, $12, $1C, $12
db $C9, $1E, $06, $01, $26, $70, $C3, $46
db $08, $CD, $C5, $21, $CD, $A4, $0D, $01
db $57, $5A, $CD, $C1, $75, $38, $0C, $CD
db $4B, $64, $D0, $1E, $06, $01, $A5, $63
db $C3, $46, $08, $1E, $06, $01, $26, $70
db $C3, $46, $08, $1E, $0E, $1A, $07, $21
db $51, $DB, $1E, $04, $1A, $38, $05, $96
db $FE, $97, $3F, $C9, $96, $FE, $09, $C9
db $18, $03, $56, $5C, $46, $19, $02, $02
db $19, $03, $02, $19, $02, $02, $19, $03
db $02, $19, $0A, $02, $19, $0B, $02, $19
db $0A, $02, $19, $0B, $02, $0D, $E6, $22
db $D3, $00, $19, $0A, $02, $19, $0B, $02
db $19, $0A, $02, $19, $0B, $02, $03, $C7
db $64, $46, $26, $00, $FE, $0D, $32, $10
db $40, $19, $0A, $04, $19, $0B, $04, $26
db $00, $01, $29, $00, $19, $0A, $04, $19
db $0B, $04, $06, $D8, $5E, $0D, $E6, $22
db $D3, $01, $03, $65, $5C, $46, $19, $1A
db $10, $19, $1C, $20, $0D, $E6, $22, $D3
db $02, $19, $1D, $20, $06, $07, $5F, $CD
db $E6, $1E, $CD, $A4, $0D, $01, $49, $5A
db $CD, $C1, $75, $D0, $1E, $06, $01, $0F
db $70, $C3, $46, $08, $0F, $42, $00, $0D
db $0F, $20, $04, $04, $3F, $0D, $3E, $65
db $0D, $C8, $5C, $E4, $18, $29, $08, $2A
db $08, $0F, $40, $00, $0F, $41, $00, $0F
db $26, $F0, $03, $44, $65, $46, $10, $4C
db $11, $0C, $65, $19, $16, $08, $19, $17
db $08, $06, $03, $65, $01, $18, $00, $0F
db $42, $00, $0D, $0F, $20, $04, $04, $3F
db $0D, $3E, $65, $0D, $C8, $5C, $EB, $10
db $4C, $11, $29, $65, $01, $20, $06, $2B
db $65, $01, $29, $18, $29, $08, $2A, $08
db $0F, $40, $00, $0F, $41, $00, $0F, $26
db $F0, $03, $F2, $65, $46, $00, $21, $0A
db $DD, $CB, $86, $C9, $CD, $5F, $65, $01
db $49, $5A, $CD, $5B, $25, $CD, $6D, $65
db $DC, $C0, $1E, $CD, $BC, $65, $D0, $1E
db $06, $01, $0A, $66, $C3, $46, $08, $1E
db $41, $1A, $B7, $C8, $CD, $D8, $21, $CD
db $C5, $21, $C3, $A4, $0D, $1E, $41, $1A
db $B7, $28, $04, $3D, $12, $B7, $C9, $3E
db $08, $12, $26, $A0, $2E, $07, $7E, $21
db $53, $DB, $96, $FE, $20, $38, $0D, $AF
db $62, $2E, $0D, $22, $22, $22, $77, $2E
db $41, $36, $00, $C9, $CD, $2B, $20, $38
db $05, $01, $A0, $FF, $18, $03, $01, $60
db $00, $62, $2E, $39, $71, $2C, $70, $CD
db $3D, $20, $38, $05, $01, $A0, $FF, $18
db $03, $01, $60, $00, $62, $2E, $3B, $71
db $2C, $70, $37, $C9, $1E, $26, $1A, $B7
db $28, $04, $3D, $12, $B7, $C9, $1E, $40
db $1A, $FE, $02, $30, $19, $21, $93, $5A
db $47, $85, $6F, $30, $01, $24, $78, $3C
db $12, $CD, $47, $06, $BE, $38, $07, $3E
db $3C, $1E, $26, $12, $B7, $C9, $AF, $62
db $2E, $0D, $22, $22, $22, $22, $22, $77
db $37, $C9, $CD, $5F, $65, $01, $57, $5A
db $CD, $5B, $25, $CD, $6D, $65, $CD, $BC
db $65, $D0, $1E, $06, $01, $A2, $66, $C3
db $46, $08, $08, $00, $00, $27, $03, $CF
db $66, $46, $26, $80, $00, $10, $4C, $11
db $36, $66, $09, $04, $19, $16, $08, $19
db $17, $08, $0A, $03, $56, $5C, $46, $19
db $16, $08, $19, $17, $08, $19, $16, $08
db $19, $17, $08, $06, $3F, $66, $19, $18
db $40, $03, $56, $5C, $46, $05, $20, $0F
db $40, $00, $22, $3B, $5F, $1D, $0F, $26
db $00, $03, $EE, $66, $46, $0D, $C8, $5C
db $E9, $07, $00, $00, $10, $4C, $11, $68
db $66, $19, $16, $08, $19, $17, $08, $19
db $16, $08, $19, $17, $08, $06, $6B, $66
db $19, $18, $20, $27, $26, $30, $00, $10
db $4C, $11, $8F, $66, $09, $03, $19, $16
db $08, $19, $17, $08, $0A, $07, $00, $00
db $19, $16, $08, $19, $17, $08, $19, $16
db $08, $19, $17, $08, $06, $98, $66, $19
db $18, $30, $07, $00, $00, $19, $18, $20
db $0F, $1C, $80, $0D, $C8, $5C, $E4, $06
db $2A, $67, $0F, $26, $00, $03, $11, $67
db $46, $10, $4C, $11, $B4, $66, $19, $20
db $50, $06, $B7, $66, $19, $29, $50, $28
db $13, $40, $42, $67, $05, $10, $28, $13
db $80, $42, $67, $05, $10, $28, $13, $C0
db $42, $67, $05, $10, $06, $42, $67, $CD
db $A4, $0D, $01, $49, $5A, $CD, $5B, $25
db $CD, $3D, $20, $1E, $45, $1A, $38, $0A
db $07, $D8, $1E, $06, $01, $3F, $66, $C3
db $46, $08, $07, $D0, $18, $F4, $CD, $A4
db $0D, $01, $49, $5A, $CD, $5B, $25, $CD
db $96, $61, $1E, $26, $1A, $B7, $28, $03
db $3D, $12, $C9, $3E, $08, $12, $62, $2E
db $40, $34, $3E, $03, $1E, $D3, $C3, $19
db $23, $01, $57, $5A, $CD, $5B, $25, $1E
db $26, $1A, $B7, $28, $03, $3D, $12, $C9
db $3E, $20, $12, $3E, $06, $1E, $D3, $C3
db $19, $23, $0D, $4A, $67, $03, $50, $67
db $46, $10, $4C, $11, $3F, $67, $19, $16
db $08, $19, $17, $08, $06, $36, $67, $01
db $18, $00, $0D, $4A, $67, $03, $81, $67
db $46, $00, $21, $0A, $DD, $CB, $C6, $C9
db $01, $49, $5A, $CD, $5B, $25, $FA, $0A
db $DD, $CB, $77, $20, $1C, $CB, $4F, $C8
db $CB, $7F, $20, $08, $1E, $06, $01, $91
db $68, $C3, $46, $08, $21, $0A, $DD, $CB
db $8E, $1E, $06, $01, $DC, $64, $C3, $46
db $08, $1E, $06, $01, $6F, $69, $C3, $46
db $08, $01, $57, $5A, $CD, $5B, $25, $FA
db $0A, $DD, $CB, $77, $20, $1C, $CB, $4F
db $C8, $CB, $7F, $20, $08, $1E, $06, $01
db $C1, $68, $C3, $46, $08, $21, $0A, $DD
db $CB, $8E, $1E, $06, $01, $0F, $65, $C3
db $46, $08, $1E, $06, $01, $84, $69, $C3
db $46, $08, $07, $00, $00, $0F, $42, $00
db $0F, $60, $3F, $03, $3F, $68, $46, $08
db $A0, $FC, $2A, $12, $19, $13, $08, $19
db $14, $08, $19, $13, $08, $19, $14, $08
db $19, $13, $08, $19, $15, $04, $0D, $C8
db $5C, $E9, $19, $15, $04, $18, $2A, $00
db $0F, $44, $FF, $0C, $07, $00, $00, $0F
db $42, $00, $0F, $60, $3F, $03, $68, $68
db $46, $08, $A0, $FC, $2A, $12, $10, $4C
db $11, $03, $68, $19, $1B, $10, $05, $10
db $06, $06, $68, $19, $1E, $20, $18, $2A
db $00, $11, $2A, $68, $19, $20, $04, $19
db $21, $02, $19, $22, $01, $19, $23, $01
db $19, $24, $01, $19, $25, $01, $19, $26
db $01, $19, $27, $01, $19, $28, $02, $06
db $2C, $68, $05, $0E, $0D, $C8, $5C, $E9
db $11, $39, $68, $19, $1F, $04, $06, $3B
db $68, $05, $04, $0F, $44, $FF, $0C, $CD
db $D3, $1E, $CD, $A4, $0D, $01, $49, $5A
db $CD, $5B, $25, $1E, $07, $21, $53, $DB
db $1A, $96, $FE, $08, $38, $06, $62, $2E
db $0F, $2A, $B6, $C0, $62, $2E, $1F, $36
db $46, $2C, $36, $5C, $2C, $36, $56, $C9
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $57
db $5A, $CD, $5B, $25, $1E, $07, $21, $53
db $DB, $1A, $96, $FE, $08, $38, $06, $62
db $2E, $0F, $2A, $B6, $C0, $62, $2E, $1F
db $36, $46, $2C, $36, $5C, $2C, $36, $65
db $C9, $07, $00, $00, $0F, $42, $00, $0F
db $60, $3F, $03, $03, $69, $46, $08, $E0
db $FE, $2A, $12, $19, $15, $10, $19, $10
db $08, $19, $11, $08, $19, $12, $08, $19
db $11, $08, $19, $12, $08, $19, $11, $08
db $19, $12, $08, $19, $11, $08, $06, $B8
db $68, $07, $00, $00, $0F, $42, $00, $0F
db $60, $3F, $03, $20, $69, $46, $08, $E0
db $FE, $2A, $12, $19, $1F, $04, $19, $28
db $04, $19, $27, $02, $19, $26, $02, $19
db $25, $02, $19, $24, $02, $19, $23, $01
db $19, $22, $01, $19, $21, $01, $19, $20
db $01, $01, $1B, $00, $0D, $BD, $5D, $06
db $C5, $5D, $19, $1A, $02, $0D, $BD, $5D
db $06, $33, $5E, $CD, $D3, $1E, $CD, $A4
db $0D, $01, $49, $5A, $CD, $5B, $25, $01
db $65, $5A, $CD, $CD, $24, $CB, $7F, $C8
db $1E, $06, $01, $F4, $68, $C3, $46, $08
db $CD, $D3, $1E, $CD, $A4, $0D, $01, $57
db $5A, $CD, $5B, $25, $01, $69, $5A, $CD
db $CD, $24, $CB, $7F, $C8, $1E, $06, $01
db $FA, $68, $C3, $46, $08, $0D, $21, $6A
db $06, $27, $6A, $0D, $01, $6A, $11, $91
db $68, $03, $AB, $69, $46, $0B, $99, $69
db $19, $16, $08, $19, $17, $08, $06, $50
db $69, $0D, $21, $6A, $06, $11, $6D, $0D
db $01, $6A, $11, $C1, $68, $03, $C3, $69
db $46, $0B, $99, $69, $01, $20, $00, $0D
db $11, $6A, $06, $3E, $6E, $10, $4C, $12
db $91, $68, $03, $AB, $69, $46, $0B, $99
db $69, $01, $18, $00, $0D, $11, $6A, $06
db $47, $6F, $10, $4C, $12, $C1, $68, $03
db $C3, $69, $46, $0B, $99, $69, $01, $29
db $00, $27, $07, $00, $00, $0D, $9F, $21
db $95, $5A, $0D, $5F, $20, $98, $5A, $0F
db $26, $08, $0C, $CD, $64, $65, $01, $49
db $5A, $CD, $5B, $25, $1E, $10, $1A, $07
db $DA, $DB, $69, $1E, $06, $01, $DC, $64
db $C3, $46, $08, $CD, $64, $65, $01, $57
db $5A, $CD, $5B, $25, $1E, $10, $1A, $07
db $DA, $DB, $69, $1E, $06, $01, $0F, $65
db $C3, $46, $08, $21, $53, $DB, $1E, $07
db $1A, $96, $FE, $30, $30, $0B, $1E, $12
db $3E, $40, $12, $AF, $1E, $39, $12, $1C
db $12, $62, $2E, $26, $35, $C0, $36, $08
db $CD, $C0, $1E, $21, $95, $5A, $C3, $A5
db $21, $21, $0A, $DD, $CB, $7E, $20, $04
db $3E, $01, $18, $01, $AF, $1E, $27, $12
db $C9, $C5, $CD, $47, $06, $47, $0E, $05
db $CD, $85, $28, $21, $0B, $DD, $70, $C1
db $C9, $21, $0A, $DD, $CB, $CE, $C9, $0D
db $88, $6A, $9B, $5A, $07, $00, $00, $08
db $80, $FD, $2A, $0D, $03, $59, $6A, $46
db $19, $04, $08, $19, $05, $08, $19, $06
db $08, $19, $07, $08, $19, $08, $08, $19
db $09, $08, $19, $08, $08, $19, $09, $08
db $19, $06, $08, $19, $07, $08, $06, $50
db $6A, $CD, $D3, $1E, $CD, $A4, $0D, $01
db $49, $5A, $CD, $C1, $75, $38, $19, $1E
db $10, $1A, $07, $D8, $1E, $07, $21, $53
db $DB, $1A, $96, $2E, $40, $62, $BE, $D8
db $1E, $06, $01, $9F, $6A, $C3, $46, $08
db $1E, $06, $01, $0F, $70, $C3, $46, $08
db $0A, $6F, $03, $0A, $67, $03, $FA, $0B
db $DD, $07, $85, $6F, $30, $01, $24, $1E
db $3F, $2A, $12, $1C, $2A, $12, $C9, $0D
db $6F, $6B, $03, $56, $5C, $46, $18, $19
db $00, $08, $19, $01, $08, $03, $C7, $64
db $46, $26, $00, $FF, $0D, $32, $10, $10
db $19, $08, $08, $19, $09, $08, $0D, $9F
db $21, $AF, $5A, $22, $D4, $6A, $06, $03
db $35, $6B, $46, $19, $0E, $04, $19, $0F
db $04, $06, $CB, $6A, $0D, $05, $6B, $00
db $05, $01, $0D, $05, $6B, $01, $05, $01
db $0D, $05, $6B, $02, $05, $01, $0D, $05
db $6B, $03, $05, $01, $0D, $05, $6B, $04
db $05, $01, $0D, $05, $6B, $05, $05, $01
db $0D, $05, $6B, $06, $05, $01, $0D, $05
db $6B, $07, $05, $01, $00, $0A, $03, $C5
db $21, $51, $DB, $4E, $23, $46, $CB, $37
db $C6, $80, $21, $53, $DB, $86, $5F, $23
db $3E, $00, $8E, $57, $21, $00, $B3, $FA
db $0B, $DD, $3C, $84, $67, $7B, $D6, $80
db $3C, $85, $6F, $3E, $0A, $CD, $97, $15
db $F0, $9A, $57, $C1, $C9, $CD, $C5, $21
db $CD, $A4, $0D, $01, $49, $5A, $CD, $C1
db $75, $38, $24, $1E, $04, $1A, $21, $51
db $DB, $96, $62, $2E, $3F, $BE, $1E, $3C
db $1A, $38, $0A, $07, $D8, $1E, $06, $01
db $86, $6B, $C3, $46, $08, $07, $D0, $1E
db $06, $01, $86, $6B, $C3, $46, $08, $1E
db $06, $01, $0F, $70, $C3, $46, $08, $1E
db $04, $1A, $21, $51, $DB, $96, $62, $2E
db $3F, $BE, $30, $04, $3E, $40, $18, $02
db $3E, $C0, $1E, $45, $12, $C9, $18, $0F
db $42, $00, $0F, $60, $3F, $03, $56, $5C
db $46, $19, $16, $08, $19, $17, $08, $03
db $A4, $6B, $46, $19, $16, $08, $19, $17
db $08, $06, $9B, $6B, $01, $49, $5A, $CD
db $5B, $25, $21, $0A, $DD, $CB, $46, $C8
db $1E, $06, $01, $B8, $6B, $C3, $46, $08
db $22, $08, $6D, $06, $0B, $D0, $6B, $06
db $43, $69, $FA, $0D, $DD, $21, $06, $DA
db $86, $77, $01, $49, $5A, $C3, $5B, $25
db $0D, $C8, $5C, $E4, $03, $C2, $6B, $46
db $24, $40, $0D, $43, $6C, $09, $08, $0D
db $E6, $22, $D3, $09, $0D, $E6, $22, $D3
db $09, $0D, $C5, $6C, $80, $05, $02, $0D
db $C5, $6C, $00, $05, $02, $0A, $09, $08
db $0D, $C5, $6C, $80, $05, $02, $0D, $C5
db $6C, $00, $05, $02, $0A, $0D, $C5, $6C
db $80, $05, $20, $0D, $FD, $71, $0B, $48
db $6C, $03, $54, $6C, $46, $24, $4F, $09
db $05, $0D, $C8, $5C, $E4, $05, $01, $0D
db $C8, $5C, $1B, $05, $01, $0A, $0D, $FD
db $71, $0B, $48, $6C, $09, $03, $0D, $C8
db $5C, $E4, $05, $01, $0D, $C8, $5C, $1B
db $05, $01, $0A, $0D, $00, $6D, $0D, $C5
db $6C, $00, $0C, $AF, $EA, $0F, $DD, $C9
db $0D, $43, $6C, $09, $08, $0D, $E6, $22
db $D3, $08, $0A, $0C, $01, $49, $5A, $CD
db $5B, $25, $FA, $0D, $DD, $21, $06, $DA
db $86, $77, $FA, $0B, $DD, $21, $F4, $5A
db $07, $85, $6F, $30, $01, $24, $2A, $66
db $6F, $E5, $06, $A0, $0E, $04, $0A, $21
db $51, $DB, $96, $E6, $FC, $1F, $1F, $1F
db $30, $01, $3C, $5F, $E6, $07, $21, $BD
db $6C, $85, $6F, $30, $01, $24, $7E, $E0
db $80, $0E, $07, $0A, $21, $53, $DB, $96
db $E6, $FC, $1F, $1F, $1F, $30, $01, $3C
db $4F, $07, $81, $4F, $7B, $E6, $F8, $CB
db $37, $07, $81, $E1, $85, $6F, $30, $01
db $24, $F0, $80, $A6, $C0, $3E, $12, $EA
db $0C, $DD, $C3, $CC, $6C, $80, $40, $20
db $10, $08, $04, $02, $01, $21, $0D, $DD
db $0A, $03, $77, $C9, $CD, $09, $28, $38
db $2E, $FA, $5D, $A0, $FE, $01, $28, $27
db $FE, $04, $28, $23, $FA, $54, $A0, $B7
db $C2, $FF, $6C, $FA, $0C, $DD, $EA, $44
db $A0, $B7, $28, $06, $E6, $0F, $47, $CD
db $8B, $3A, $1E, $01, $01, $C9, $4E, $CD
db $48, $0C, $3E, $01, $EA, $54, $A0, $C9
db $21, $0A, $DD, $7E, $E6, $80, $77, $C9
db $19, $16, $08, $19, $17, $08, $06, $08
db $6D, $0D, $88, $6A, $A5, $5A, $07, $00
db $00, $08, $80, $FD, $2A, $0D, $03, $25
db $6D, $46, $01, $1B, $00, $CD, $D3, $1E
db $CD, $A4, $0D, $01, $57, $5A, $CD, $C1
db $75, $38, $19, $1E, $10, $1A, $07, $D8
db $1E, $07, $21, $53, $DB, $1A, $96, $2E
db $40, $62, $BE, $D8, $1E, $06, $01, $54
db $6D, $C3, $46, $08, $1E, $06, $01, $26
db $70, $C3, $46, $08, $0D, $6F, $6B, $03
db $65, $5C, $46, $18, $19, $1A, $04, $19
db $19, $0C, $03, $9B, $6D, $46, $26, $00
db $FF, $0D, $32, $10, $10, $19, $1B, $10
db $0D, $9F, $21, $AF, $5A, $22, $D4, $6A
db $06, $03, $B0, $6D, $46, $19, $20, $01
db $19, $21, $01, $19, $22, $01, $19, $23
db $01, $19, $24, $01, $19, $25, $01, $19
db $26, $01, $19, $27, $01, $19, $28, $01
db $06, $7D, $6D, $CD, $E6, $1E, $CD, $A4
db $0D, $01, $57, $5A, $CD, $C1, $75, $D0
db $1E, $06, $01, $26, $70, $C3, $46, $08
db $CD, $C5, $21, $CD, $A4, $0D, $01, $57
db $5A, $CD, $C1, $75, $38, $24, $1E, $04
db $1A, $21, $51, $DB, $96, $62, $2E, $3F
db $BE, $1E, $3C, $1A, $38, $0A, $07, $D8
db $1E, $06, $01, $EA, $6D, $C3, $46, $08
db $07, $D0, $1E, $06, $01, $EA, $6D, $C3
db $46, $08, $1E, $06, $01, $26, $70, $C3
db $46, $08, $0D, $0F, $6E, $18, $0F, $42
db $00, $0F, $60, $3F, $03, $FB, $6D, $46
db $01, $20, $00, $01, $57, $5A, $CD, $5B
db $25, $21, $0A, $DD, $CB, $46, $C8, $1E
db $06, $01, $36, $6E, $C3, $46, $08, $1E
db $3F, $21, $51, $DB, $1A, $86, $21, $07
db $DA, $96, $1E, $04, $12, $1E, $40, $21
db $53, $DB, $1A, $86, $21, $06, $DA, $96
db $6F, $1E, $4C, $1A, $B7, $7D, $20, $02
db $C6, $02, $1E, $07, $12, $C9, $01, $20
db $0B, $D0, $6B, $06, $5F, $69, $0D, $88
db $6A, $9B, $5A, $0D, $6F, $6B, $0D, $9F
db $21, $B2, $5A, $03, $60, $6E, $46, $10
db $4C, $11, $5D, $6E, $19, $16, $08, $19
db $17, $08, $06, $54, $6E, $01, $18, $00
db $CD, $C5, $21, $CD, $A4, $0D, $01, $49
db $5A, $CD, $5B, $25, $1E, $04, $21, $51
db $DB, $1A, $96, $62, $2E, $3F, $BE, $1E
db $45, $1A, $38, $0A, $07, $D8, $1E, $06
db $01, $90, $6E, $C3, $46, $08, $07, $D0
db $1E, $06, $01, $90, $6E, $C3, $46, $08
db $03, $EE, $6E, $46, $07, $00, $00, $10
db $4C, $11, $A5, $6E, $19, $16, $08, $19
db $17, $08, $06, $9C, $6E, $01, $18, $00
db $03, $C2, $6E, $46, $08, $80, $FE, $2A
db $10, $10, $4C, $11, $BF, $6E, $19, $16
db $08, $19, $17, $08, $06, $B6, $6E, $01
db $18, $00, $CD, $D3, $1E, $CD, $A4, $0D
db $01, $49, $5A, $CD, $5B, $25, $1E, $10
db $1A, $07, $D8, $1E, $07, $21, $53, $DB
db $1A, $96, $4F, $1C, $23, $1A, $9E, $D8
db $79, $2E, $40, $62, $BE, $D8, $1E, $06
db $01, $12, $6F, $C3, $46, $08, $01, $49
db $5A, $CD, $5B, $25, $21, $0A, $DD, $CB
db $4E, $C8, $1E, $06, $01, $A8, $6E, $C3
db $46, $08, $21, $0A, $DD, $CB, $4E, $20
db $03, $AF, $18, $02, $3E, $01, $1E, $27
db $12, $C9, $18, $03, $2D, $6F, $46, $0D
db $41, $6F, $2A, $10, $10, $4C, $11, $2A
db $6F, $19, $16, $08, $19, $17, $08, $06
db $21, $6F, $01, $18, $00, $01, $49, $5A
db $CD, $5B, $25, $21, $0A, $DD, $CB, $76
db $C0, $1E, $06, $01, $75, $69, $C3, $46
db $08, $21, $0A, $DD, $CB, $C6, $C9, $0D
db $88, $6A, $A5, $5A, $0D, $6F, $6B, $0D
db $9F, $21, $B2, $5A, $03, $63, $6F, $46
db $10, $4C, $11, $60, $6F, $01, $20, $00
db $01, $29, $00, $CD, $C5, $21, $CD, $A4
db $0D, $01, $57, $5A, $CD, $5B, $25, $1E
db $04, $21, $51, $DB, $1A, $96, $62, $2E
db $3F, $BE, $1E, $45, $1A, $38, $0A, $07
db $D8, $1E, $06, $01, $93, $6F, $C3, $46
db $08, $07, $D0, $1E, $06, $01, $93, $6F
db $C3, $46, $08, $03, $65, $5C, $46, $07
db $00, $00, $0D, $02, $6F, $12, $A5, $6F
db $05, $01, $06, $9A, $6F, $03, $B9, $6F
db $46, $08, $80, $FE, $2A, $10, $10, $4C
db $11, $B6, $6F, $01, $20, $00, $01, $29
db $00, $CD, $D3, $1E, $CD, $A4, $0D, $01
db $57, $5A, $CD, $5B, $25, $1E, $10, $1A
db $07, $D8, $1E, $07, $21, $53, $DB, $1A
db $96, $4F, $1C, $23, $1A, $9E, $D8, $79
db $2E, $40, $62, $BE, $D8, $1E, $06, $01
db $E5, $6F, $C3, $46, $08, $0D, $0F, $6E
db $18, $03, $FB, $6F, $46, $0D, $41, $6F
db $10, $4C, $11, $F8, $6F, $01, $20, $00
db $01, $29, $00, $01, $49, $5A, $CD, $5B
db $25, $21, $0A, $DD, $CB, $76, $C0, $1E
db $06, $01, $8A, $69, $C3, $46, $08, $0D
db $3D, $70, $0F, $41, $01, $1C, $F6, $7C
db $04, $09, $06, $19, $0C, $02, $19, $37
db $02, $0A, $0F, $41, $00, $00, $0D, $3D
db $70, $0F, $41, $01, $1C, $F6, $7C, $04
db $09, $06, $19, $1E, $02, $19, $36, $02
db $0A, $0F, $41, $00, $00, $21, $0A, $DD
db $CB, $46, $C8, $CB, $F6, $C9, $0B, $AC
db $70, $0D, $A7, $71, $12, $60, $70, $0D
db $A1, $71, $0D, $93, $23, $06, $C1, $68
db $0B, $B2, $67, $01, $18, $06, $DC, $64
db $0F, $60, $88, $0F, $61, $C0, $0B, $B2
db $67, $01, $18, $0D, $93, $23, $06, $A3
db $70, $18, $0D, $B7, $71, $03, $35, $71
db $46, $00, $0B, $AC, $70, $0D, $A7, $71
db $12, $92, $70, $0D, $A1, $71, $0D, $93
db $23, $06, $91, $68, $0B, $E4, $67, $06
db $0F, $65, $0F, $60, $88, $0F, $61, $C0
db $0B, $E4, $67, $01, $29, $0D, $93, $23
db $06, $71, $70, $18, $0D, $B7, $71, $03
db $35, $71, $46, $00, $0D, $0C, $71, $0D
db $F7, $71, $0D, $A7, $71, $11, $BB, $70
db $0D, $FB, $70, $0F, $4C, $00, $0D, $72
db $22, $24, $11, $0F, $60, $3F, $10, $46
db $04, $83, $77, $0B, $0F, $46, $00, $03
db $29, $71, $46, $0F, $47, $10, $09, $04
db $19, $00, $02, $19, $01, $02, $19, $02
db $02, $19, $03, $02, $19, $04, $02, $19
db $05, $02, $19, $06, $02, $19, $07, $02
db $0A, $0F, $47, $00, $04, $E2, $6A, $0D
db $1A, $46, $0C, $1E, $48, $1A, $67, $2E
db $19, $36, $80, $2E, $1C, $36, $80, $2E
db $1F, $36, $80, $C9, $21, $0A, $DD, $CB
db $7E, $C0, $1E, $48, $1A, $67, $2E, $4A
db $36, $50, $2C, $36, $12, $C9, $0D, $E3
db $50, $1C, $85, $47, $03, $0D, $67, $23
db $16, $21, $0A, $DD, $CB, $7E, $C0, $01
db $49, $5A, $C3, $5B, $25, $CD, $D8, $21
db $CD, $C5, $21, $CD, $A4, $0D, $1E, $48
db $1A, $67, $1E, $04, $6B, $1A, $96, $30
db $02, $2F, $3C, $FE, $20, $30, $15, $1E
db $07, $6B, $1A, $96, $30, $02, $2F, $3C
db $FE, $20, $30, $08, $1E, $06, $01, $1E
db $71, $C3, $46, $08, $21, $51, $DB, $1E
db $04, $1A, $96, $FE, $50, $1E, $3C, $1A
db $38, $0E, $07, $38, $0E, $AF, $1E, $11
db $12, $1E, $0D, $12, $1C, $12, $18, $03
db $07, $38, $F2, $21, $53, $DB, $1E, $07
db $1A, $96, $FE, $20, $1E, $3A, $1A, $38
db $0C, $07, $D8, $AF, $1E, $12, $12, $1E
db $0F, $12, $1C, $12, $C9, $07, $D0, $18
db $F2, $21, $0A, $DD, $CB, $FE, $C9, $21
db $0A, $DD, $CB, $7E, $20, $03, $AF, $18
db $02, $3E, $01, $1E, $27, $12, $C9, $1E
db $04, $21, $51, $DB, $1A, $96, $FE, $50
db $30, $04, $3E, $40, $18, $02, $3E, $C0
db $1E, $45, $12, $21, $F1, $5A, $CD, $A5
db $21, $1E, $07, $21, $53, $DB, $1A, $96
db $FE, $20, $21, $F1, $5A, $1E, $12, $2A
db $12, $1E, $39, $38, $0C, $2A, $2F, $C6
db $01, $12, $1C, $7E, $2F, $CE, $00, $12
db $C9, $2A, $12, $1C, $7E, $12, $C9, $21
db $0A, $DD, $CB, $7E, $C8, $C5, $26, $A8
db $0E, $0A, $2E, $00, $7E, $FE, $FF, $28
db $1F, $7A, $BC, $28, $1B, $1E, $48, $1A
db $47, $BC, $28, $14, $6B, $7E, $BA, $28
db $03, $B8, $20, $0C, $79, $E0, $80, $CD
db $BA, $0B, $F0, $9A, $57, $F0, $80, $4F
db $0D, $28, $03, $24, $18, $D4, $C1, $C9
db $17, $FF, $0D, $0F, $61, $00, $0F, $4C
db $01, $04, $E2, $6A, $0D, $0D, $F9, $1F
db $10, $5B, $0E, $0B, $5B, $72, $A8, $72
db $B7, $72, $E1, $72, $4D, $73, $5D, $73
db $B1, $73, $75, $74, $8B, $74, $EE, $74
db $B8, $75, $16, $0D, $0F, $20, $06, $06
db $BF, $24, $1E, $0D, $D1, $1F, $0C, $03
db $03, $94, $72, $46, $19, $31, $02, $19
db $FF, $02, $19, $31, $02, $19, $FF, $02
db $19, $31, $08, $26, $00, $01, $0D, $32
db $10, $20, $0F, $26, $20, $19, $30, $02
db $19, $2F, $04, $19, $30, $02, $19, $2E
db $04, $06, $85, $72, $1E, $26, $1A, $B7
db $28, $05, $3D, $12, $CD, $E6, $1E, $CD
db $A4, $0D, $01, $B5, $5A, $C3, $5B, $25
db $0D, $D1, $1F, $F6, $F4, $19, $34, $04
db $19, $35, $08, $19, $34, $04, $16, $0D
db $0F, $20, $04, $06, $BF, $24, $3F, $0D
db $D1, $1F, $10, $04, $26, $00, $01, $0D
db $32, $10, $10, $0F, $26, $10, $03, $94
db $72, $46, $19, $2A, $03, $19, $2B, $03
db $19, $2C, $03, $19, $2D, $03, $06, $D2
db $72, $0D, $0F, $20, $07, $08, $BF, $24
db $35, $0D, $D1, $1F, $00, $08, $22, $3B
db $5F, $1D, $03, $17, $73, $46, $08, $00
db $06, $01, $32, $00, $0D, $35, $73, $11
db $0C, $73, $0D, $E6, $22, $D3, $04, $0D
db $E6, $22, $D3, $05, $08, $00, $00, $03
db $2F, $73, $46, $19, $33, $02, $16, $CD
db $A4, $0D, $01, $B5, $5A, $CD, $5B, $25
db $D8, $CD, $25, $1A, $CB, $7F, $C8, $1E
db $06, $01, $FC, $72, $C3, $46, $08, $01
db $B5, $5A, $C3, $5B, $25, $1E, $48, $1A
db $67, $2E, $40, $7E, $FE, $04, $28, $07
db $FE, $0C, $28, $03, $AF, $18, $02, $3E
db $01, $1E, $27, $12, $C9, $0F, $45, $40
db $0D, $D1, $1F, $F6, $00, $07, $00, $FF
db $29, $10, $06, $6A, $73, $0F, $45, $40
db $0D, $D1, $1F, $0A, $00, $07, $00, $01
db $29, $F0, $0D, $9A, $73, $0D, $0F, $20
db $06, $06, $00, $08, $00, $FF, $2A, $10
db $04, $52, $6F, $0B, $0F, $46, $00, $03
db $A2, $73, $46, $09, $02, $19, $08, $02
db $19, $09, $02, $19, $0A, $02, $19, $07
db $02, $0A, $03, $AB, $73, $46, $19, $08
db $26, $16, $1E, $48, $1A, $67, $6B, $7E
db $12, $C9, $CD, $E6, $1E, $CD, $D3, $1E
db $CD, $A4, $0D, $01, $C3, $5A, $C3, $5B
db $25, $24, $47, $0D, $0F, $20, $06, $06
db $00, $0D, $FD, $73, $27, $0D, $E6, $22
db $D3, $07, $0D, $34, $74, $04, $52, $6F
db $0B, $0F, $46, $00, $03, $DF, $73, $46
db $19, $08, $08, $19, $09, $08, $19, $0A
db $08, $19, $07, $08, $06, $D0, $73, $CD
db $EB, $21, $CD, $C5, $21, $CD, $A4, $0D
db $01, $D1, $5A, $CD, $5B, $25, $D8, $CD
db $25, $1A, $CB, $7F, $C8, $1E, $03, $01
db $66, $49, $C3, $46, $08, $C5, $CD, $47
db $06, $47, $0E, $13, $CD, $85, $28, $78
db $CB, $37, $0F, $21, $51, $DB, $1E, $04
db $86, $12, $23, $1C, $7E, $CE, $00, $12
db $CD, $47, $06, $47, $0E, $05, $CD, $85
db $28, $78, $CB, $37, $0F, $21, $53, $DB
db $1E, $07, $86, $12, $23, $1C, $7E, $CE
db $00, $12, $C1, $C9, $C5, $26, $A0, $2E
db $07, $5D, $1A, $96, $30, $02, $2F, $3C
db $4F, $2E, $04, $5D, $1A, $96, $30, $02
db $2F, $3C, $47, $79, $90, $CB, $3F, $CB
db $3F, $B8, $38, $03, $AF, $18, $0A, $79
db $B8, $38, $04, $3E, $01, $18, $02, $3E
db $02, $21, $DF, $5A, $07, $5F, $07, $83
db $85, $6F, $30, $01, $24, $CD, $A5, $21
db $CD, $53, $20, $C1, $C9, $04, $E2, $6A
db $0D, $0D, $7F, $74, $06, $AD, $72, $1E
db $48, $1A, $67, $6B, $66, $2E, $46, $5D
db $7E, $12, $C9, $0D, $9B, $74, $0D, $B0
db $74, $0F, $47, $80, $03, $A4, $0D, $40
db $01, $31, $00, $FA, $0E, $DD, $67, $2E
db $04, $5D, $2A, $12, $1C, $2A, $12, $2E
db $07, $5D, $2A, $12, $1C, $2A, $12, $C9
db $21, $0F, $DD, $7E, $34, $21, $CE, $74
db $07, $07, $85, $6F, $30, $01, $24, $1E
db $0D, $2A, $12, $1C, $2A, $12, $1E, $0F
db $2A, $12, $1C, $2A, $12, $C9, $00, $00
db $00, $F8, $A8, $05, $58, $FA, $00, $08
db $00, $00, $A8, $05, $A8, $05, $00, $00
db $00, $08, $58, $FA, $A8, $05, $00, $F8
db $00, $00, $58, $FA, $58, $FA, $0D, $0F
db $75, $04, $52, $6F, $0B, $0F, $46, $00
db $03, $06, $75, $46, $19, $04, $04, $19
db $05, $0A, $19, $04, $02, $16, $CD, $E6
db $1E, $CD, $D3, $1E, $C3, $A4, $0D, $C5
db $01, $38, $75, $21, $0F, $DD, $7E, $34
db $07, $07, $07, $81, $4F, $30, $01, $04
db $FA, $0E, $DD, $67, $CD, $EC, $24, $60
db $69, $C1, $1E, $0D, $2A, $12, $1C, $2A
db $12, $1E, $11, $2A, $12, $C3, $BE, $20
db $00, $F4, $00, $00, $00, $00, $FE, $20
db $00, $0C, $00, $00, $00, $00, $02, $E0
db $04, $F6, $00, $01, $F0, $60, $FE, $1A
db $FC, $0A, $00, $FF, $10, $A0, $01, $E6
db $08, $F8, $60, $01, $EA, $A0, $FE, $16
db $F8, $08, $A0, $FE, $16, $60, $01, $EA
db $0A, $FC, $A0, $01, $E6, $00, $FF, $10
db $F6, $04, $60, $FE, $1A, $00, $01, $00
db $0C, $00, $00, $02, $E0, $00, $00, $00
db $F4, $00, $00, $FE, $20, $00, $00, $00
db $0A, $04, $A0, $01, $E6, $00, $01, $F0
db $F6, $FC, $60, $FE, $1A, $00, $FF, $10
db $08, $08, $60, $01, $EA, $60, $01, $EA
db $F8, $F8, $A0, $FE, $16, $A0, $FE, $16
db $04, $0A, $00, $01, $F0, $A0, $01, $E6
db $FC, $F6, $00, $FF, $10, $60, $FE, $1A
db $0D, $D1, $1F, $00, $04, $1B, $F5, $72
db $04, $1E, $44, $1A, $CB, $7F, $20, $0A
db $D6, $01, $12, $38, $1D, $2E, $60, $62
db $36, $3F, $CD, $5B, $25, $FA, $2C, $DD
db $CB, $4F, $20, $0B, $CB, $47, $20, $02
db $AF, $C9, $CD, $61, $0C, $37, $C9, $E1
db $37, $C9, $1E, $42, $1A, $B7, $28, $E2
db $2E, $60, $62, $36, $2D, $18, $DB, $FF
db $FF, $FF, $FF, $DF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $02
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FB, $FF, $FF, $FF, $FF
db $00, $00, $1C, $00, $80, $00, $00, $00
db $00, $00, $98, $00, $00, $00, $00, $80
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $DF, $DF, $FF, $FF, $FF, $FF
db $80, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $89, $81, $A0, $80, $00, $00, $00, $20
db $00, $00, $00, $00, $00, $00, $01, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $04, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $40, $80
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $04, $00, $00, $00, $00, $00
db $02, $00, $00, $00, $40, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $80, $00, $00, $00, $00, $00
db $00, $00, $22, $00, $00, $08, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $BF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $40, $00, $08
db $02, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $08, $00, $00, $40, $00, $00
db $00, $01, $00, $20, $01, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $04, $00
db $40, $10, $00, $01, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $7F, $EF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $04, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $04, $08, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $40, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $90, $00, $00, $00, $00, $80, $00
db $40, $00, $00, $00, $00, $00, $00, $20
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $01, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $30, $00, $10, $00, $00, $00, $00, $02
db $00, $00, $00, $00, $01, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $20, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FB, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $10, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $C0, $40, $00, $00, $02, $00
db $02, $00, $00, $00, $00, $20, $01, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $7F, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $81, $00, $00, $00, $00
db $00, $00, $10, $00, $24, $00, $40, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $BF
db $FF, $FF, $FF, $FF, $F7, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $90, $00, $08, $02, $00, $00, $00, $00
db $40, $80, $00, $20, $00, $21, $00, $00
db $FF, $FF, $FF, $FF, $FF, $F7, $FF, $FF
db $FF, $F7, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $20, $00, $04, $00, $08
db $00, $00, $00, $00, $00, $00, $10, $08
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $04, $40, $04, $00, $00
db $00, $22, $80, $04, $00, $00, $00, $80
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $01, $00, $00, $00
db $00, $01, $00, $00, $08, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $DF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $08, $00, $00, $00, $04, $41, $00
db $08, $00, $00, $81, $80, $00, $20, $00
db $FF, $FF, $FF, $FF, $FF, $E7, $FB, $FF
db $FF, $EF, $F7, $FF, $FF, $F7, $F9, $FF
db $FF, $F7, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $20, $40
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $80, $41, $00, $00, $00, $10, $00, $08
db $00, $00, $00, $40, $00, $00, $00, $08
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $80, $00, $00, $04, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $6F, $FF, $FF, $FF, $FF, $FF
db $20, $00, $00, $01, $00, $00, $00, $02
db $02, $00, $80, $05, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $80, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $80, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $7F, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $20, $00, $80, $00, $00, $00, $00, $00
db $00, $00, $20, $00, $00, $00, $00, $01
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $40, $40, $00, $00, $00, $80, $00, $10
db $00, $40, $02, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FB, $FF, $FF, $FF, $FF, $FF
db $FB, $FF, $EF, $FF, $FF, $FF, $FF, $FF
db $00, $0C, $00, $00, $00, $00, $00, $10
db $00, $00, $00, $00, $01, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $01, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $80, $00, $08, $03, $00, $00, $00, $44
db $00, $00, $80, $00, $28, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $80, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FB, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $DF, $FF, $FF, $FF, $FF, $FF
db $04, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $10, $00, $00, $20, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $92, $00, $00, $00, $40, $00, $00, $80
db $40, $00, $00, $00, $00, $00, $44, $10
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $00, $01, $00, $00, $00, $00, $00
db $00, $08, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $BF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $40, $00, $00, $00, $00, $20, $00
db $00, $20, $00, $40, $00, $04, $30, $40
db $00, $80, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $00, $10, $80, $01, $00, $00, $40, $00
db $04, $00, $80, $00, $10, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $26, $00, $A0, $00, $00, $00, $00, $00
db $00, $02, $00, $00, $08, $00, $20, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
db $FF, $F7, $FD, $FE, $FF, $FD, $CF, $FF
db $FF, $F3, $FF, $BF, $FF, $FF, $FF, $FF
|
languages/python-ada/b~unit.ads | octonion/examples | 4 | 9947 | <filename>languages/python-ada/b~unit.ads
pragma Ada_95;
pragma Warnings (Off);
with System;
package ada_main is
procedure adainit;
pragma Export (C, adainit, "adainit");
procedure adafinal;
pragma Export (C, adafinal, "adafinal");
type Version_32 is mod 2 ** 32;
u00001 : constant Version_32 := 16#3faa9122#;
pragma Export (C, u00001, "unitB");
u00002 : constant Version_32 := 16#0c02f564#;
pragma Export (C, u00002, "unitS");
u00003 : constant Version_32 := 16#b6df930e#;
pragma Export (C, u00003, "system__standard_libraryB");
u00004 : constant Version_32 := 16#7ec093d3#;
pragma Export (C, u00004, "system__standard_libraryS");
u00005 : constant Version_32 := 16#5ab55268#;
pragma Export (C, u00005, "interfacesS");
u00006 : constant Version_32 := 16#769e25e6#;
pragma Export (C, u00006, "interfaces__cB");
u00007 : constant Version_32 := 16#70be4e8c#;
pragma Export (C, u00007, "interfaces__cS");
u00008 : constant Version_32 := 16#c2326fda#;
pragma Export (C, u00008, "ada__exceptionsB");
u00009 : constant Version_32 := 16#6e98a13f#;
pragma Export (C, u00009, "ada__exceptionsS");
u00010 : constant Version_32 := 16#76789da1#;
pragma Export (C, u00010, "adaS");
u00011 : constant Version_32 := 16#e947e6a9#;
pragma Export (C, u00011, "ada__exceptions__last_chance_handlerB");
u00012 : constant Version_32 := 16#41e5552e#;
pragma Export (C, u00012, "ada__exceptions__last_chance_handlerS");
u00013 : constant Version_32 := 16#4635ec04#;
pragma Export (C, u00013, "systemS");
u00014 : constant Version_32 := 16#4e7785b8#;
pragma Export (C, u00014, "system__soft_linksB");
u00015 : constant Version_32 := 16#d8b13451#;
pragma Export (C, u00015, "system__soft_linksS");
u00016 : constant Version_32 := 16#b01dad17#;
pragma Export (C, u00016, "system__parametersB");
u00017 : constant Version_32 := 16#381fe17b#;
pragma Export (C, u00017, "system__parametersS");
u00018 : constant Version_32 := 16#30ad09e5#;
pragma Export (C, u00018, "system__secondary_stackB");
u00019 : constant Version_32 := 16#fca7137e#;
pragma Export (C, u00019, "system__secondary_stackS");
u00020 : constant Version_32 := 16#f103f468#;
pragma Export (C, u00020, "system__storage_elementsB");
u00021 : constant Version_32 := 16#6bf6a600#;
pragma Export (C, u00021, "system__storage_elementsS");
u00022 : constant Version_32 := 16#41837d1e#;
pragma Export (C, u00022, "system__stack_checkingB");
u00023 : constant Version_32 := 16#c88a87ec#;
pragma Export (C, u00023, "system__stack_checkingS");
u00024 : constant Version_32 := 16#87a448ff#;
pragma Export (C, u00024, "system__exception_tableB");
u00025 : constant Version_32 := 16#1b9b8546#;
pragma Export (C, u00025, "system__exception_tableS");
u00026 : constant Version_32 := 16#ce4af020#;
pragma Export (C, u00026, "system__exceptionsB");
u00027 : constant Version_32 := 16#2e5681f2#;
pragma Export (C, u00027, "system__exceptionsS");
u00028 : constant Version_32 := 16#843d48dc#;
pragma Export (C, u00028, "system__exceptions__machineS");
u00029 : constant Version_32 := 16#aa0563fc#;
pragma Export (C, u00029, "system__exceptions_debugB");
u00030 : constant Version_32 := 16#38bf15c0#;
pragma Export (C, u00030, "system__exceptions_debugS");
u00031 : constant Version_32 := 16#6c2f8802#;
pragma Export (C, u00031, "system__img_intB");
u00032 : constant Version_32 := 16#44ee0cc6#;
pragma Export (C, u00032, "system__img_intS");
u00033 : constant Version_32 := 16#39df8c17#;
pragma Export (C, u00033, "system__tracebackB");
u00034 : constant Version_32 := 16#181732c0#;
pragma Export (C, u00034, "system__tracebackS");
u00035 : constant Version_32 := 16#9ed49525#;
pragma Export (C, u00035, "system__traceback_entriesB");
u00036 : constant Version_32 := 16#466e1a74#;
pragma Export (C, u00036, "system__traceback_entriesS");
u00037 : constant Version_32 := 16#6fd210f2#;
pragma Export (C, u00037, "system__traceback__symbolicB");
u00038 : constant Version_32 := 16#dd19f67a#;
pragma Export (C, u00038, "system__traceback__symbolicS");
u00039 : constant Version_32 := 16#701f9d88#;
pragma Export (C, u00039, "ada__exceptions__tracebackB");
u00040 : constant Version_32 := 16#20245e75#;
pragma Export (C, u00040, "ada__exceptions__tracebackS");
u00041 : constant Version_32 := 16#9f00b3d3#;
pragma Export (C, u00041, "system__address_imageB");
u00042 : constant Version_32 := 16#e7d9713e#;
pragma Export (C, u00042, "system__address_imageS");
u00043 : constant Version_32 := 16#8c33a517#;
pragma Export (C, u00043, "system__wch_conB");
u00044 : constant Version_32 := 16#5d48ced6#;
pragma Export (C, u00044, "system__wch_conS");
u00045 : constant Version_32 := 16#9721e840#;
pragma Export (C, u00045, "system__wch_stwB");
u00046 : constant Version_32 := 16#7059e2d7#;
pragma Export (C, u00046, "system__wch_stwS");
u00047 : constant Version_32 := 16#a831679c#;
pragma Export (C, u00047, "system__wch_cnvB");
u00048 : constant Version_32 := 16#52ff7425#;
pragma Export (C, u00048, "system__wch_cnvS");
u00049 : constant Version_32 := 16#ece6fdb6#;
pragma Export (C, u00049, "system__wch_jisB");
u00050 : constant Version_32 := 16#d28f6d04#;
pragma Export (C, u00050, "system__wch_jisS");
u00051 : constant Version_32 := 16#a6359005#;
pragma Export (C, u00051, "system__memoryB");
u00052 : constant Version_32 := 16#1f488a30#;
pragma Export (C, u00052, "system__memoryS");
u00053 : constant Version_32 := 16#36a43a0a#;
pragma Export (C, u00053, "system__crtlS");
-- BEGIN ELABORATION ORDER
-- ada%s
-- interfaces%s
-- system%s
-- system.img_int%s
-- system.img_int%b
-- system.parameters%s
-- system.parameters%b
-- system.crtl%s
-- system.storage_elements%s
-- system.storage_elements%b
-- system.stack_checking%s
-- system.stack_checking%b
-- system.traceback_entries%s
-- system.traceback_entries%b
-- system.wch_con%s
-- system.wch_con%b
-- system.wch_jis%s
-- system.wch_jis%b
-- system.wch_cnv%s
-- system.wch_cnv%b
-- system.traceback%s
-- system.traceback%b
-- system.wch_stw%s
-- system.standard_library%s
-- system.exceptions_debug%s
-- system.exceptions_debug%b
-- ada.exceptions%s
-- system.wch_stw%b
-- ada.exceptions.traceback%s
-- system.soft_links%s
-- system.exception_table%s
-- system.exception_table%b
-- system.exceptions%s
-- system.exceptions%b
-- system.secondary_stack%s
-- system.address_image%s
-- system.soft_links%b
-- ada.exceptions.last_chance_handler%s
-- system.memory%s
-- system.memory%b
-- ada.exceptions.traceback%b
-- system.traceback.symbolic%s
-- system.traceback.symbolic%b
-- system.exceptions.machine%s
-- system.secondary_stack%b
-- system.address_image%b
-- ada.exceptions.last_chance_handler%b
-- system.standard_library%b
-- ada.exceptions%b
-- interfaces.c%s
-- interfaces.c%b
-- unit%s
-- unit%b
-- END ELABORATION ORDER
end ada_main;
|
Numbers/ClassicalReals/RealField/AllIsomorphic.agda | Smaug123/agdaproofs | 4 | 15118 | <reponame>Smaug123/agdaproofs
{-# OPTIONS --safe --warning=error --without-K #-}
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import LogicalFormulae
open import Setoids.Subset
open import Setoids.Setoids
open import Setoids.Orders
open import Fields.Fields
open import Rings.Orders.Total.Definition
open import Rings.Orders.Total.Lemmas
open import Rings.Orders.Partial.Definition
open import Rings.Definition
open import Fields.Orders.LeastUpperBounds.Definition
open import Numbers.ClassicalReals.RealField
open import Groups.Definition
open import Groups.Homomorphisms.Definition
open import Rings.Homomorphisms.Definition
open import Sets.EquivalenceRelations
open import Semirings.Definition
open import Numbers.Naturals.Semiring
open import Numbers.Integers.Definition
open import Numbers.Integers.RingStructure.Ring
module Numbers.ClassicalReals.RealField.AllIsomorphic (ℝ : RealField) where
open RealField ℝ
open Ring R
open Group additiveGroup
open Setoid S
open Equivalence eq
open import Rings.Lemmas R
open import Groups.Lemmas additiveGroup
fromN : ℕ → A
fromN zero = 0R
fromN (succ n) = 1R + fromN n
fromNPreserves+ : (a b : ℕ) → fromN (a +N b) ∼ (fromN a) + (fromN b)
fromNPreserves+ zero b = symmetric identLeft
fromNPreserves+ (succ a) b = transitive (+WellDefined reflexive (fromNPreserves+ a b)) +Associative
fromNPreserves* : (a b : ℕ) → fromN (a *N b) ∼ (fromN a) * (fromN b)
fromNPreserves* zero b = symmetric (transitive *Commutative timesZero)
fromNPreserves* (succ a) b = transitive (transitive (fromNPreserves+ b (a *N b)) (+WellDefined (symmetric identIsIdent) (fromNPreserves* a b))) (symmetric *DistributesOver+')
fromNWellDefined : {a b : ℕ} → a ≡ b → fromN a ∼ fromN b
fromNWellDefined refl = reflexive
fromZ : ℤ → A
fromZ (nonneg x) = fromN x
fromZ (negSucc x) = inverse (fromN (succ x))
private
lemma : (a : ℕ) → (b : ℕ) → (1R + fromN (succ a *N b +N a)) ∼ ((1R + fromN a) * (1R + fromN b))
lemma a b = transitive (transitive (transitive (+WellDefined reflexive (transitive (fromNPreserves+ ((succ a) *N b) a) (transitive groupIsAbelian (+WellDefined reflexive (transitive (fromNPreserves+ b (a *N b)) (+WellDefined (symmetric identIsIdent) (fromNPreserves* a b))))))) +Associative) (+WellDefined (transitive (symmetric identIsIdent) *Commutative) (symmetric *DistributesOver+'))) (symmetric *DistributesOver+)
fromZPreserves+ : (a b : ℤ) → fromZ (a +Z b) ∼ (fromZ a) + (fromZ b)
fromZPreserves+ (nonneg zero) (nonneg y) = symmetric identLeft
fromZPreserves+ (nonneg (succ x)) (nonneg y) = transitive (+WellDefined reflexive (fromNPreserves+ x y)) +Associative
fromZPreserves+ (nonneg zero) (negSucc y) = symmetric identLeft
fromZPreserves+ (nonneg (succ x)) (negSucc zero) = transitive (transitive (transitive (transitive (symmetric identLeft) (+WellDefined (symmetric invLeft) reflexive)) (symmetric +Associative)) (+WellDefined (inverseWellDefined (symmetric identRight)) reflexive)) (groupIsAbelian)
fromZPreserves+ (nonneg (succ x)) (negSucc (succ y)) = transitive (fromZPreserves+ (nonneg x) (negSucc y)) (transitive (transitive (transitive (transitive (transitive (transitive (transitive (symmetric identLeft) +Associative) groupIsAbelian) (+WellDefined reflexive (+WellDefined (symmetric invLeft) reflexive))) (+WellDefined reflexive (symmetric +Associative))) +Associative) groupIsAbelian) (+WellDefined reflexive (symmetric invContravariant)))
fromZPreserves+ (negSucc zero) (nonneg zero) = symmetric identRight
fromZPreserves+ (negSucc zero) (nonneg (succ y)) = transitive (transitive (symmetric identLeft) (+WellDefined (symmetric (transitive (+WellDefined reflexive (symmetric identRight)) invLeft)) reflexive)) (symmetric +Associative)
fromZPreserves+ (negSucc (succ x)) (nonneg zero) = symmetric identRight
fromZPreserves+ (negSucc (succ x)) (nonneg (succ y)) = transitive (fromZPreserves+ (negSucc x) (nonneg y)) (transitive (transitive (+WellDefined reflexive (transitive (symmetric identLeft) (transitive (+WellDefined (symmetric invLeft) reflexive) (symmetric +Associative)))) +Associative) (+WellDefined (symmetric invContravariant) reflexive))
fromZPreserves+ (negSucc x) (negSucc y) = transitive (transitive invContravariant (transitive (+WellDefined invContravariant reflexive) (transitive (+WellDefined (transitive (transitive (+WellDefined (transitive (inverseWellDefined (fromNPreserves+ x y)) invContravariant) reflexive) (symmetric +Associative)) groupIsAbelian) reflexive) (symmetric +Associative)))) (+WellDefined (symmetric invContravariant) (symmetric invContravariant))
fromZPreserves* : (a b : ℤ) → fromZ (a *Z b) ∼ (fromZ a) * (fromZ b)
fromZPreserves* (nonneg a) (nonneg b) = fromNPreserves* a b
fromZPreserves* (nonneg zero) (negSucc b) = symmetric (transitive *Commutative timesZero)
fromZPreserves* (nonneg (succ a)) (negSucc b) = transitive (inverseWellDefined (lemma a b)) (symmetric ringMinusExtracts)
fromZPreserves* (negSucc a) (nonneg zero) = symmetric timesZero
fromZPreserves* (negSucc a) (nonneg (succ b)) = transitive (inverseWellDefined (transitive (+WellDefined reflexive (fromNWellDefined {(a +N b *N a) +N b} {(b +N a *N b) +N a} (transitivity (Semiring.commutative ℕSemiring _ b) (transitivity (applyEquality (b +N_) (transitivity (Semiring.commutative ℕSemiring a _) (applyEquality (_+N a) (multiplicationNIsCommutative b a)))) (Semiring.+Associative ℕSemiring b _ a))))) (lemma a b))) (symmetric ringMinusExtracts')
fromZPreserves* (negSucc a) (negSucc b) = transitive (transitive (+WellDefined reflexive (fromNWellDefined {b +N a *N succ b} {(b +N a *N b) +N a} (transitivity (applyEquality (b +N_) (transitivity (multiplicationNIsCommutative a (succ b)) (transitivity (Semiring.commutative ℕSemiring a _) (applyEquality (_+N a) (multiplicationNIsCommutative b a))))) (Semiring.+Associative ℕSemiring b _ a)))) (lemma a b)) (symmetric twoNegativesTimes)
ringHom : RingHom ℤRing R fromZ
RingHom.preserves1 ringHom = identRight
RingHom.ringHom ringHom {r} {s} = fromZPreserves* r s
GroupHom.groupHom (RingHom.groupHom ringHom) {r} {s} = fromZPreserves+ r s
GroupHom.wellDefined (RingHom.groupHom ringHom) refl = reflexive
|
Cubical/Foundations/PathSplitEquiv.agda | cj-xu/cubical | 0 | 16457 | {-
Theory about path split equivalences.
They are convenient to construct localization HITs as in
(the "modalities paper")
https://arxiv.org/abs/1706.07526
- there are construction from and to equivalences ([pathSplitToEquiv] , [equivToPathSplit])
- the structure of a path split equivalence is actually a proposition ([isPropIsPathSplitEquiv])
The module starts with a couple of general facts about equivalences:
- if f is an equivalence then (cong f) is an equivalence ([equivCong])
- if f is an equivalence then pre- and postcomposition with f are equivalences ([preCompEquiv], [postCompEquiv])
(those are not in 'Equiv.agda' because they need Univalence.agda (which imports Equiv.agda))
-}
{-# OPTIONS --cubical --safe #-}
module Cubical.Foundations.PathSplitEquiv where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv.Properties
record isPathSplitEquiv {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} (f : A → B) : Type (ℓ-max ℓ ℓ') where
field
s : B → A
sec : section f s
secCong : (x y : A) → Σ[ s' ∈ (f(x) ≡ f(y) → x ≡ y) ] section (cong f) s'
PathSplitEquiv : ∀ {ℓ ℓ'} (A : Type ℓ) (B : Type ℓ') → Type (ℓ-max ℓ ℓ')
PathSplitEquiv A B = Σ[ f ∈ (A → B) ] isPathSplitEquiv f
open isPathSplitEquiv
idIsPathSplitEquiv : ∀ {ℓ} {A : Type ℓ} → isPathSplitEquiv (λ (x : A) → x)
s idIsPathSplitEquiv x = x
sec idIsPathSplitEquiv x = refl
secCong idIsPathSplitEquiv = λ x y → (λ p → p) , λ p _ → p
module _ {ℓ} {A B : Type ℓ} where
toIsEquiv : (f : A → B) → isPathSplitEquiv f → isEquiv f
toIsEquiv f record { s = s ; sec = sec ; secCong = secCong } =
(isoToEquiv (iso f s sec (λ x → (secCong (s (f x)) x).fst (sec (f x))))) .snd
sectionOfEquiv' : (f : A → B) → isEquiv f → B → A
sectionOfEquiv' f record { equiv-proof = all-fibers-contractible } x =
all-fibers-contractible x .fst .fst
isSec : (f : A → B) → (pf : isEquiv f) → section f (sectionOfEquiv' f pf)
isSec f record { equiv-proof = all-fibers-contractible } x =
all-fibers-contractible x .fst .snd
sectionOfEquiv : (f : A → B) → isEquiv f → Σ (B → A) (section f)
sectionOfEquiv f e = sectionOfEquiv' f e , isSec f e
module _ {ℓ} {A B : Type ℓ} where
abstract
fromIsEquiv : (f : A → B) → isEquiv f → isPathSplitEquiv f
s (fromIsEquiv f pf) = sectionOfEquiv' f pf
sec (fromIsEquiv f pf) = isSec f pf
secCong (fromIsEquiv f pf) x y = sectionOfEquiv cong-f eq-cong
where
cong-f : x ≡ y → f x ≡ f y
cong-f = λ (p : x ≡ y) → cong f p
eq-cong : isEquiv cong-f
eq-cong = isEquivCong (f , pf)
pathSplitToEquiv : PathSplitEquiv A B → A ≃ B
fst (pathSplitToEquiv (f , _)) = f
snd (pathSplitToEquiv (_ , e)) = toIsEquiv _ e
equivToPathSplit : A ≃ B → PathSplitEquiv A B
fst (equivToPathSplit (f , _)) = f
snd (equivToPathSplit (_ , e)) = fromIsEquiv _ e
equivHasUniqueSection : (f : A → B)
→ isEquiv f → isContr (Σ (B → A) (section f))
equivHasUniqueSection f eq = helper'
where
idB = λ (x : B) → x
abstract
helper : isContr (fiber (λ (φ : B → A) → f ∘ φ) idB)
helper = (equiv-proof (snd (postCompEquiv (f , eq)))) idB
helper' : isContr (Σ[ φ ∈ (B → A) ] ((x : B) → f (φ x) ≡ x))
fst helper' = (φ , λ x i → η i x)
where φ = fst (fst helper)
η : f ∘ φ ≡ idB
η = snd (fst helper)
(snd helper') y i = (fst (η i) , λ b j → snd (η i) j b)
where η = (snd helper) (fst y , λ i b → snd y b i)
{-
PathSplitEquiv is a proposition and the type
of path split equivs is equivalent to the type of equivalences
-}
isPropIsPathSplitEquiv : ∀ {ℓ} {A B : Type ℓ} (f : A → B)
→ isProp (isPathSplitEquiv f)
isPropIsPathSplitEquiv {_} {A} {B} f
record { s = φ ; sec = sec-φ ; secCong = secCong-φ }
record { s = ψ ; sec = sec-ψ ; secCong = secCong-ψ } i
=
record {
s = fst (sectionsAreEqual i) ;
sec = snd (sectionsAreEqual i) ;
secCong = λ x y → congSectionsAreEqual x y (secCong-φ x y) (secCong-ψ x y) i
}
where
φ' = record { s = φ ; sec = sec-φ ; secCong = secCong-φ }
ψ' = record { s = ψ ; sec = sec-ψ ; secCong = secCong-ψ }
sectionsAreEqual : (φ , sec-φ) ≡ (ψ , sec-ψ)
sectionsAreEqual = (sym (contraction (φ , sec-φ))) ∙ (contraction (ψ , sec-ψ))
where contraction = snd (equivHasUniqueSection f (toIsEquiv f φ'))
congSectionsAreEqual : (x y : A) (l u : Σ (f(x) ≡ f(y) → x ≡ y) (section (cong f))) → l ≡ u
congSectionsAreEqual x y l u = (sym (contraction l)) ∙ (contraction u)
where contraction = snd (equivHasUniqueSection
(λ (p : x ≡ y) → cong f p)
(isEquivCong (pathSplitToEquiv (f , φ'))))
module _ {ℓ} {A B : Type ℓ} where
isEquivIsPathSplitToIsEquiv : (f : A → B) → isEquiv (fromIsEquiv f)
isEquivIsPathSplitToIsEquiv f =
isoToIsEquiv
(iso (fromIsEquiv f) (toIsEquiv f) (λ b → isPropIsPathSplitEquiv f _ _) (λ a → isPropIsEquiv f _ _ ))
isEquivPathSplitToEquiv : isEquiv (pathSplitToEquiv {A = A} {B = B})
isEquivPathSplitToEquiv =
isoToIsEquiv
(iso pathSplitToEquiv equivToPathSplit
(λ {(f , e) i → (f , isPropIsEquiv f (toIsEquiv f (fromIsEquiv f e)) e i)})
(λ {(f , e) i → (f , isPropIsPathSplitEquiv f (fromIsEquiv f (toIsEquiv f e)) e i)}))
equivPathSplitToEquiv : (PathSplitEquiv A B) ≃ (A ≃ B)
equivPathSplitToEquiv = (pathSplitToEquiv , isEquivPathSplitToEquiv)
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_1135.asm | ljhsiun2/medusa | 9 | 3806 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x17888, %r14
nop
add %r13, %r13
mov (%r14), %si
nop
cmp $63818, %rbx
lea addresses_WT_ht+0x199c8, %rsi
lea addresses_D_ht+0x195c8, %rdi
nop
nop
dec %r10
mov $118, %rcx
rep movsl
nop
add %rcx, %rcx
lea addresses_normal_ht+0x128, %rdi
nop
nop
nop
nop
nop
and %rcx, %rcx
movups (%rdi), %xmm4
vpextrq $0, %xmm4, %r10
nop
nop
cmp %rbx, %rbx
lea addresses_UC_ht+0x175a8, %rsi
lea addresses_A_ht+0x84c8, %rdi
nop
nop
nop
dec %r13
mov $59, %rcx
rep movsq
nop
nop
nop
inc %rdi
lea addresses_normal_ht+0x13b50, %rsi
nop
nop
nop
dec %r13
vmovups (%rsi), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rdi
and %rcx, %rcx
lea addresses_normal_ht+0x6d61, %rsi
lea addresses_WT_ht+0xcf5c, %rdi
nop
nop
xor %r10, %r10
mov $61, %rcx
rep movsl
nop
nop
sub %rbx, %rbx
lea addresses_A_ht+0x15100, %r14
nop
nop
nop
nop
xor %rdi, %rdi
movb $0x61, (%r14)
xor $36365, %r14
lea addresses_WC_ht+0x1abc8, %r10
nop
and $63594, %r14
mov (%r10), %esi
nop
nop
add $47674, %rsi
lea addresses_UC_ht+0x76e0, %rcx
nop
nop
nop
nop
cmp %rbx, %rbx
movw $0x6162, (%rcx)
sub $55944, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rsi
// Faulty Load
lea addresses_normal+0x1bfc8, %r15
nop
nop
nop
nop
dec %rbp
vmovaps (%r15), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r10
lea oracles, %r15
and $0xff, %r10
shlq $12, %r10
mov (%r15,%r10,1), %r10
pop %rsi
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'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
*/
|
Positive_Negative.asm | Abhik-Kumar/8085 | 0 | 29954 | //2K19/EE/009 <NAME>
// Find whether the number is positive or negative
LXI H, 1001H // Load number to memory
MOV A, M // Move content of memory to 'A'
RAL
JC LOOP // Condition
MVI A, 00H // Move Immediate For Positive
STA 1002H // store the accumulator value at address
HLT // Stop for positive number
LOOP: MVI A, 01H // Move Immediate For Negative
STA 1002H // store the accumulator value at address
HLT // Stop for negative number
# ORG 1001H
#DB 03H // Set data in memory 1001 = 03 (positive)
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1518.asm | ljhsiun2/medusa | 9 | 25316 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x106b6, %rsi
lea addresses_normal_ht+0x1e3f, %rdi
nop
nop
nop
nop
nop
and %r11, %r11
mov $58, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r9, %r9
lea addresses_WT_ht+0x1e036, %r8
nop
nop
nop
add %rcx, %rcx
mov (%r8), %esi
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0xc2b6, %rsi
lea addresses_normal_ht+0xba7a, %rdi
nop
nop
nop
nop
nop
sub %r8, %r8
mov $16, %rcx
rep movsq
and $11414, %rdi
lea addresses_normal_ht+0x5ff6, %rcx
nop
nop
dec %rax
mov (%rcx), %r11d
nop
nop
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x16412, %r9
xor %rsi, %rsi
movb (%r9), %r11b
nop
nop
nop
and $22937, %r8
lea addresses_WT_ht+0x2ab6, %r9
nop
xor %rdi, %rdi
mov (%r9), %ax
nop
nop
add $29248, %r11
lea addresses_UC_ht+0x1eeb6, %rsi
lea addresses_WC_ht+0x160b6, %rdi
nop
nop
nop
nop
nop
add %rbp, %rbp
mov $79, %rcx
rep movsq
nop
nop
nop
nop
nop
and $18478, %r8
lea addresses_D_ht+0x126b6, %rsi
lea addresses_WT_ht+0x5736, %rdi
nop
nop
nop
and $64563, %r9
mov $100, %rcx
rep movsq
nop
nop
nop
nop
nop
xor $598, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %r9
push %rax
push %rbp
push %rsi
// Store
lea addresses_D+0x1f6b6, %r9
nop
nop
sub %rbp, %rbp
mov $0x5152535455565758, %r12
movq %r12, %xmm3
vmovups %ymm3, (%r9)
nop
and $61645, %r13
// Store
lea addresses_RW+0x19036, %rax
clflush (%rax)
nop
nop
nop
nop
nop
sub $2781, %r8
movw $0x5152, (%rax)
// Exception!!!
nop
mov (0), %rsi
nop
nop
dec %rax
// Faulty Load
lea addresses_D+0x1f6b6, %rbp
clflush (%rbp)
nop
nop
nop
and $14104, %rax
mov (%rbp), %r8d
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_RW', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_105_1078.asm | ljhsiun2/medusa | 9 | 15077 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x8dbe, %rsi
lea addresses_WT_ht+0x16e0e, %rdi
clflush (%rsi)
nop
nop
nop
and $57848, %r9
mov $93, %rcx
rep movsl
nop
inc %r14
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %r9
push %rax
push %rbp
push %rdi
push %rsi
// Store
lea addresses_UC+0x8552, %rsi
nop
nop
nop
nop
dec %rbp
mov $0x5152535455565758, %rax
movq %rax, (%rsi)
and %rax, %rax
// Store
mov $0x546, %rdi
nop
nop
nop
nop
nop
cmp $5383, %r12
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%rdi)
nop
nop
xor %r12, %r12
// Store
lea addresses_A+0x9b2e, %r8
xor %r12, %r12
mov $0x5152535455565758, %rbp
movq %rbp, (%r8)
nop
nop
xor %rbp, %rbp
// Store
lea addresses_D+0x57be, %rbp
nop
nop
add %rsi, %rsi
movb $0x51, (%rbp)
nop
cmp $5327, %rbp
// Faulty Load
lea addresses_normal+0x13bbe, %rdi
nop
nop
xor %r9, %r9
movaps (%rdi), %xmm5
vpextrq $0, %xmm5, %r12
lea oracles, %rdi
and $0xff, %r12
shlq $12, %r12
mov (%rdi,%r12,1), %r12
pop %rsi
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 9}, 'dst': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'00': 105}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
artwork/esqueleto/esqueleto_cae.asm | fjpena/sword-of-ianna-zx | 67 | 179520 | ; ASM source file created by SevenuP v1.21
; SevenuP (C) Copyright 2002-2007 by <NAME>, aka Metalbrain
;GRAPHIC DATA:
;Pixel Size: ( 24, 32)
;Char Size: ( 3, 4)
;Frames: 2
;Sort Priorities: X char, Char line, Y char, Frame number
;Data Outputted: Gfx
;Interleave: Sprite
;Mask: No
esqueleto_cae:
DEFB 32, 4, 0, 56, 2, 0, 28, 5
DEFB 0, 28, 2, 0, 28, 5, 0, 29
DEFB 242, 0, 13,249, 0, 13,144, 0
DEFB 9,146, 0, 96,233, 0,140,114
DEFB 0,108, 80, 0, 1,136, 0, 8
DEFB 32, 0, 3,168, 0, 0, 32, 0
DEFB 1,168, 0, 0, 2,128, 0, 20
DEFB 64, 1,248, 0, 6,208,128, 2
DEFB 129, 0, 1, 2, 0, 0,132, 0
DEFB 0, 66, 0, 0,161, 0, 0, 64
DEFB 0, 0, 64, 0, 0, 66, 0, 0
DEFB 68, 0, 0, 56, 0, 0, 32, 0
DEFB 128, 0,128,192, 0, 64,224, 0
DEFB 32,240, 0, 80,240, 0, 32,112
DEFB 0, 80, 96, 0, 32, 96, 30, 16
DEFB 0, 63, 32, 96,114, 8, 96, 82
DEFB 20, 14, 13, 8, 32,223, 32, 0
DEFB 202, 64, 0, 0, 0, 0,245, 0
DEFB 0, 4, 0, 0,245, 0, 0, 4
DEFB 0, 0,117, 0, 1, 0, 0, 1
DEFB 191, 0, 0, 18, 0, 0,192,128
DEFB 0, 48, 64, 0, 40,128, 0, 17
DEFB 0, 0, 32, 0, 0, 68, 0, 0
DEFB 138, 0, 1,129, 0, 3,240,128 |
release/src-rt-6.x.4708/router/gmp/mpn/arm/mode1o.asm | afeng11/tomato-arm | 5 | 245945 | dnl ARM mpn_modexact_1c_odd
dnl Contributed to the GNU project by <NAME>.
dnl Copyright 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C StrongARM ?
C XScale ?
C Cortex-A7 ?
C Cortex-A8 ?
C Cortex-A9 10
C Cortex-A15 9
C Architecture requirements:
C v5 -
C v5t -
C v5te -
C v6 -
C v6t2 -
C v7a -
define(`up', `r0')
define(`n', `r1')
define(`d', `r2')
define(`cy', `r3')
.protected binvert_limb_table
ASM_START()
PROLOGUE(mpn_modexact_1c_odd)
stmfd sp!, {r4, r5}
LEA( r4, binvert_limb_table)
ldr r5, [up], #4 C up[0]
and r12, d, #254
ldrb r4, [r4, r12, lsr #1]
mul r12, r4, r4
mul r12, d, r12
rsb r12, r12, r4, asl #1
mul r4, r12, r12
mul r4, d, r4
rsb r4, r4, r12, asl #1 C r4 = inverse
subs n, n, #1 C set carry as side-effect
beq L(end)
L(top): sbcs cy, r5, cy
ldr r5, [up], #4
sub n, n, #1
mul r12, r4, cy
tst n, n
umull r12, cy, d, r12
bne L(top)
L(end): sbcs cy, r5, cy
mul r12, r4, cy
umull r12, r0, d, r12
addcc r0, r0, #1
ldmfd sp!, {r4, r5}
bx r14
EPILOGUE()
|
scripts/.opera-urls.applescript | andrewp-as-is/mac-opera | 0 | 3129 | <filename>scripts/.opera-urls.applescript<gh_stars>0
#!/usr/bin/osascript
try
set _APP_TIMEOUT to 5
if ("OPERA_TIMEOUT" is in system attribute) then
set _APP_TIMEOUT to (system attribute "OPERA_TIMEOUT") as integer
end if
with timeout of _APP_TIMEOUT seconds
tell application "Opera"
repeat with w in every window
repeat with t in every tab in w
log (URL of t as text)
end repeat
end repeat
end tell
end timeout
on error errorMessage number errorNumber
--Connection is invalid. (-609)
if (errorNumber is in {-609}) then return
error errorMessage number errorNumber
end try
|
programs/oeis/290/A290074.asm | neoneye/loda | 22 | 162633 | ; A290074: Decimal representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 641", based on the 5-celled von Neumann neighborhood.
; 1,1,5,3,23,15,95,63,383,255,1535,1023,6143,4095,24575,16383,98303,65535,393215,262143,1572863,1048575,6291455,4194303,25165823,16777215,100663295,67108863,402653183,268435455,1610612735,1073741823,6442450943,4294967295,25769803775,17179869183,103079215103,68719476735,412316860415,274877906943,1649267441663,1099511627775,6597069766655,4398046511103,26388279066623,17592186044415,105553116266495,70368744177663,422212465065983,281474976710655,1688849860263935,1125899906842623,6755399441055743,4503599627370495,27021597764222975,18014398509481983,108086391056891903,72057594037927935,432345564227567615,288230376151711743,1729382256910270463,1152921504606846975,6917529027641081855,4611686018427387903,27670116110564327423,18446744073709551615,110680464442257309695,73786976294838206463,442721857769029238783,295147905179352825855,1770887431076116955135,1180591620717411303423,7083549724304467820543,4722366482869645213695,28334198897217871282175,18889465931478580854783,113336795588871485128703,75557863725914323419135,453347182355485940514815,302231454903657293676543,1813388729421943762059263,1208925819614629174706175,7253554917687775048237055,4835703278458516698824703,29014219670751100192948223,19342813113834066795298815,116056878683004400771792895,77371252455336267181195263,464227514732017603087171583,309485009821345068724781055,1856910058928070412348686335,1237940039285380274899124223,7427640235712281649394745343,4951760157141521099596496895,29710560942849126597578981375,19807040628566084398385987583,118842243771396506390315925503,79228162514264337593543950335,475368975085586025561263702015,316912650057057350374175801343
mov $2,-2
pow $2,$0
gcd $1,$2
add $2,$1
add $1,$2
sub $1,1
div $1,4
mul $1,2
add $1,1
mov $0,$1
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_1367.asm | ljhsiun2/medusa | 9 | 84017 | .global s_prepare_buffers
s_prepare_buffers:
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x17a6a, %rsi
lea addresses_UC_ht+0x1a9b8, %rdi
clflush (%rdi)
nop
nop
cmp $42537, %rbx
mov $17, %rcx
rep movsl
nop
nop
cmp %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %rax
push %rcx
push %rdx
// Faulty Load
lea addresses_A+0x1974a, %r13
and %rdx, %rdx
mov (%r13), %r15w
lea oracles, %r13
and $0xff, %r15
shlq $12, %r15
mov (%r13,%r15,1), %r15
pop %rdx
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
issues/Issue22.agda | asr/apia | 10 | 9618 | module Issue22 where
postulate
D : Set
_≡_ : D → D → Set
d e : D
foo : ∀ x → x ≡ x
foo x = bar
where
postulate
d≡e : d ≡ e
postulate
bar : x ≡ x
{-# ATP prove bar d≡e #-}
-- $ apia Bug.agda
-- An internal error has occurred. Please report this as a bug.
-- Location of the error: src/Apia/Utils/AgdaAPI/Interface.hs:307
-- The error occurs because the dead code analysis removes `d≡e` from
-- the the interfase file.
|
alloy4fun_models/trashltl/models/10/cbrh4nzPGCqLy9n3w.als | Kaixi26/org.alloytools.alloy | 0 | 2900 | <gh_stars>0
open main
pred idcbrh4nzPGCqLy9n3w_prop11 {
after ((File - Protected) in Protected)
}
pred __repair { idcbrh4nzPGCqLy9n3w_prop11 }
check __repair { idcbrh4nzPGCqLy9n3w_prop11 <=> prop11o } |
oeis/065/A065225.asm | neoneye/loda-programs | 11 | 101780 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A065225: Fill a triangular array by rows by writing numbers 1 up to b(0), 1 up to b(1), etc., where b(n) are the 9-gonal (nonagonal) numbers. The final elements of the rows form a(n).
; Submitted by <NAME>(s3)
; 1,2,5,9,5,11,18,2,11,21,32,44,11,25,40,56,73,16,35,55,76,98,10,34,59,85,112,140,15,45,76,108,141,175,6,42,79,117,156,196,237,18,61,105,150,196,243,291,15,65,116,168,221,275,330,386,47,105,164,224,285,347,410
lpb $0
add $2,$0
sub $0,1
add $2,1
lpe
mov $1,1
lpb $2
add $3,$1
add $1,7
sub $2,$3
lpe
mov $0,$2
add $0,1
|
src/FRP/LTL/RSet/Core.agda | agda/agda-frp-ltl | 21 | 10262 | open import FRP.LTL.Time using ( Time ; _≤_ ; _<_ )
module FRP.LTL.RSet.Core where
-- Reactive types
RSet : Set₁
RSet = Time → Set
⟨_⟩ : Set → RSet
⟨ A ⟩ t = A
⟦_⟧ : RSet → Set
⟦ A ⟧ = ∀ {t} → (A t)
-- Reactive sets over an interval
_[_,_] : RSet → Time → Time → Set
A [ s , u ] = ∀ {t} → s ≤ t → t ≤ u → A t
_[_,_⟩ : RSet → Time → Time → Set
A [ s , u ⟩ = ∀ {t} → s ≤ t → t < u → A t
|
testkanji.asm | hwreverse/PC-G850V | 7 | 175579 | 10 ORG 400H
20 ; leaving space for RAMDISK.ASM
30 ; used as a debug tool
40 JP MAIN
50REGOUT EQU 0BD03H
60PUTSTR EQU 0BFF1H
70INKEY EQU 0BE53H
80PUTCHR EQU 0BE62H
90WAITK EQU 0BFCDH
100RPTCHR EQU 0BFEEH
110GPF EQU 0BFD0H
120LDPSTR EQU 0BD00H
130BUFFER: DEFS 144
140EXPLOD: ; HL = BUFFER
150 LD A,(DE) ; DE = DATA
160 AND 0F0H
170 RLCA
180 RLCA
190 RLCA
200 RLCA
210 LD (HL),A
220 INC HL
230 LD A,(DE)
240 AND 0FH
250 LD (HL),A
260 INC HL
270 INC DE
280 DJNZ EXPLOD
290 RET
300MAIN: CALL CLS
310 LD HL,FIRST
320 LD B,144
330 LD DE,00H
340 CALL GPF
350 LD HL,BUFFER
360 LD DE,SECOND
370 LD B,72
380 CALL EXPLOD
390 LD HL,BUFFER
400 LD B,144
410 LD DE,0100H
420 CALL GPF
430 LD HL,THIRD
440 LD B,144
450 LD DE,0200H
460 CALL GPF
470 LD HL,BUFFER
480 LD DE,FOURTH
490 LD B,72
500 CALL EXPLOD
510 LD HL,BUFFER
520 LD B,144
530 LD DE,0300H
540 CALL GPF
550 LD HL,FIFTH
560 LD B,144
570 LD DE,0400H
580 CALL GPF
590 LD HL,BUFFER
600 LD DE,SIXTH
610 LD B,72
620 CALL EXPLOD
630 LD HL,BUFFER
640 LD B,144
650 LD DE,0500H
660 CALL GPF
670 CALL WAITK
680 RET
690CLS: LD B,144
700 LD DE,0
710CLS0: LD A,32
720 CALL RPTCHR
730 RET
740CLLN: LD B,24
750 LD E,0
760 JP CLS0
770FIRST:
780 DB 020H,020H,020H,020H,020H,020H,020H,020H,020H,020H,020H,00H ; 一
790 DB 02H,02H,02H,02H,02H,0FEH,0FEH,02H,02H,02H,02H,00H ; 丁
800 DB 020H,020H,020H,0FFH,0FEH,010H,010H,010H,010H,010H,018H,00H ; 七
810 DB 0CH,0CH,07CH,0CCH,0CH,08CH,0FFH,0EH,0CH,0CH,0CH,00H ; 丈
820 DB 00H,02H,062H,062H,062H,062H,062H,062H,062H,02H,00H,00H ; 三
830 DB 00H,00H,00H,00H,0FEH,0FFH,010H,010H,010H,010H,00H,00H ; 上
840 DB 02H,02H,02H,02H,02H,0FEH,032H,022H,062H,0C2H,02H,00H ; 下
850 DB 082H,0C2H,062H,032H,01AH,0FEH,016H,032H,062H,042H,082H,00H ; 不
860 DB 00H,00H,0FEH,092H,092H,092H,092H,092H,0FEH,00H,00H,00H ; 且
870 DB 08H,018H,0FEH,08H,08H,0FFH,088H,088H,0FFH,018H,08H,00H ; 世
880 DB 00H,00H,0FEH,022H,022H,022H,022H,0E2H,021H,020H,020H,00H ; 丘
890 DB 0F2H,012H,012H,092H,0D2H,07EH,0D2H,092H,012H,012H,0F2H,00H ; 丙
900SECOND:
910 DB 00H,00H,00H,00H,00H,00H ; 一
920 DB 00H,088H,08FH,030H,00H,00H ; 丁
930 DB 00H,07H,07CH,0CCH,0C4H,070H ; 七
940 DB 08CH,046H,033H,064H,0C8H,080H ; 丈
950 DB 044H,044H,044H,044H,044H,040H ; 三
960 DB 044H,044H,077H,044H,044H,040H ; 上
970 DB 00H,00H,0FH,00H,00H,00H ; 下
980 DB 00H,00H,0FH,00H,00H,00H ; 不
990 DB 044H,074H,044H,044H,074H,040H ; 且
1000 DB 00H,0F4H,045H,044H,044H,040H ; 世
1010 DB 044H,074H,044H,047H,044H,040H ; 丘
1020 DB 0F3H,031H,00H,09H,09DH,070H ; 丙
1030THIRD:
1040 DB 0FCH,0CCH,084H,084H,084H,0FFH,084H,084H,084H,0CCH,0FCH,00H ; 中
1050 DB 08H,028H,072H,0E8H,0BFH,08H,08H,08H,0F8H,00H,00H,00H ; 丸
1060 DB 040H,0E0H,07EH,042H,04EH,04AH,052H,042H,0FEH,0FEH,040H,00H ; 丹
1070 DB 00H,072H,072H,072H,0C9H,0FEH,0CEH,072H,072H,072H,00H,00H ; 主
1080 DB 060H,030H,0CH,07H,084H,0C4H,0FCH,08CH,00H,00H,00H,00H ; 久
1090 DB 02H,012H,012H,012H,012H,01EH,092H,0D2H,073H,031H,00H,00H ; 乏
1100 DB 020H,0AAH,0FAH,0AAH,0AAH,0FEH,0AAH,0ABH,0F9H,0A9H,0A8H,00H ; 乗
1110 DB 02H,082H,0C2H,062H,032H,01AH,0EH,06H,06H,00H,00H,00H ; 乙
1120 DB 08H,08H,08H,0FCH,01FH,08H,08H,0F8H,0F0H,00H,00H,00H ; 九
1130 DB 01EH,092H,0DEH,0F1H,0B9H,085H,0FEH,0FFH,00H,00H,00H,00H ; 乳
1140 DB 0FAH,0AAH,0AFH,0AAH,0FAH,018H,02EH,0A7H,0E4H,064H,04H,00H ; 乾
1150 DB 092H,092H,0FEH,0FFH,091H,091H,00H,0FFH,00H,00H,00H,00H ; 乱
1160FOURTH:
1170 DB 00H,00H,0FH,00H,00H,00H ; 中
1180 DB 0C6H,031H,011H,00H,0F8H,0C6H ; 丸
1190 DB 0C3H,00H,00H,088H,0F7H,00H ; 丹
1200 DB 0CCH,0CCH,0CFH,0CCH,0CCH,0C0H ; 主
1210 DB 0C4H,063H,010H,01H,034H,0C0H ; 久
1220 DB 0C3H,036H,079H,088H,088H,080H ; 乏
1230 DB 0C4H,063H,01FH,013H,064H,0C0H ; 乗
1240 DB 075H,044H,044H,044H,044H,070H ; 乙
1250 DB 0C6H,031H,00H,07H,0F8H,0C6H ; 九
1260 DB 019H,0F1H,00H,03FH,088H,0E2H ; 乳
1270 DB 022H,0F2H,020H,0E9H,088H,0C2H ; 乾
1280 DB 0F4H,044H,04FH,0FH,088H,0E2H ; 乱
1290FIFTH:
1300 DB 02H,02H,02H,02H,02H,0F2H,012H,0AH,0EH,06H,00H,00H ; 了
1310 DB 082H,0DAH,0DAH,0D2H,0D6H,0FFH,0D2H,0D2H,0DAH,0DAH,082H,00H ; 事
1320 DB 00H,04H,04H,04H,04H,04H,04H,04H,04H,04H,00H,00H ; 二
1330 DB 02H,02H,0F2H,09EH,092H,092H,092H,092H,0F2H,02H,02H,00H ; 互
1340 DB 00H,022H,022H,0E2H,07EH,026H,022H,022H,0E2H,02H,00H,00H ; 五
1350 DB 088H,088H,0CCH,0FFH,088H,088H,088H,0FFH,0CCH,088H,088H,00H ; 井
1360 DB 02H,0FAH,09AH,0FEH,09AH,09AH,0FEH,09AH,09AH,0FAH,02H,00H ; 亜
1370 DB 08H,0F8H,08H,08H,0CH,0FH,0CH,08H,08H,08H,08H,00H ; 亡
1380 DB 064H,024H,014H,06CH,0C4H,07H,0C4H,06CH,01CH,034H,024H,00H ; 交
1390 DB 02H,05AH,07AH,06AH,06AH,06BH,0EAH,0EAH,0FAH,05AH,02H,00H ; 享
1400 DB 06H,076H,0F6H,096H,096H,097H,096H,096H,0D6H,076H,06H,00H ; 京
1410 DB 00H,00H,00H,0C0H,078H,01FH,070H,080H,00H,00H,00H,00H ; 人
1420SIXTH:
1430 DB 00H,088H,08FH,00H,00H,00H ; 了
1440 DB 02H,02AH,0AFH,022H,027H,00H ; 事
1450 DB 066H,066H,066H,066H,066H,060H ; 二
1460 DB 044H,054H,044H,047H,044H,040H ; 互
1470 DB 044H,047H,044H,044H,074H,040H ; 五
1480 DB 084H,030H,00H,0FH,00H,00H ; 井
1490 DB 045H,047H,054H,075H,045H,040H ; 亜
1500 DB 07H,044H,0CCH,0CCH,0CCH,040H ; 亡
1510 DB 08CH,046H,033H,036H,04CH,080H ; 交
1520 DB 033H,03BH,0BFH,033H,033H,030H ; 享
1530 DB 046H,018H,08FH,00H,016H,040H ; 京
1540 DB 0C6H,031H,00H,01H,036H,0C0H ; 人
|
devices/devices-bus.adb | SMerrony/dgemua | 2 | 24953 | <filename>devices/devices-bus.adb<gh_stars>1-10
-- MIT License
-- Copyright (c) 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.
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO; use Ada.Text_IO;
with DG_Types; use DG_Types;
with Memory;
package body Devices.Bus is
protected body Actions is
procedure Init is
begin
for D in Bus.Devices'Range loop
Bus.Devices(D).Mnemonic := To_Unbounded_String("");
Bus.Devices(D).PMB := 0;
Bus.Devices(D).IO_Device := false;
Bus.Devices(D).Bootable := false;
Bus.Devices(D).Connected := false;
Bus.Devices(D).Reset_Proc := null;
Bus.Devices(D).Data_Out_Proc := null;
Bus.Devices(D).Data_In_Proc := null;
Bus.Devices(D).Sim_Image_Attached := false;
Bus.Devices(D).Sim_Image_Name := To_Unbounded_String("");
end loop;
Bus.Devices(PWRFL) := (To_Unbounded_String("PWRFL"), 0, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(WCS) := (To_Unbounded_String("WCS"), 99, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(MAP) := (To_Unbounded_String("MAP"), 99, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(PSC) := (To_Unbounded_String("PSC"), 13, false, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(BMC) := (To_Unbounded_String("BMC"), 99, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(TTI) := (To_Unbounded_String("TTI"), 14, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(TTO) := (To_Unbounded_String("TTO"), 15, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(RTC) := (To_Unbounded_String("RTC"), 13, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(LPT) := (To_Unbounded_String("LPT"), 12, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(MTB) := (To_Unbounded_String("MTB"), 10, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(MTJ) := (To_Unbounded_String("MTJ"), 10, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(DSKP) := (To_Unbounded_String("DSKP"), 7, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(DPF) := (To_Unbounded_String("DPF"), 7, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(ISC) := (To_Unbounded_String("ISC"), 4, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(PIT) := (To_Unbounded_String("PIT"), 11, false, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(SCP) := (To_Unbounded_String("SCP"), 15, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(IAC1) := (To_Unbounded_String("IAC1"), 11, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(MTB1) := (To_Unbounded_String("MTB1"), 10, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(MTJ1) := (To_Unbounded_String("MTJ1"), 10, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(DSKP1) := (To_Unbounded_String("DSKP1"), 7, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(IAC) := (To_Unbounded_String("IAC"), 11, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(DPF1) := (To_Unbounded_String("DPF1"), 7, true, true, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(FPU) := (To_Unbounded_String("FPU"), 99, true, false, false, null, null, null, false, To_Unbounded_String(""));
Bus.Devices(CPU) := (To_Unbounded_String("CPU"), 0, true, false, false, null, null, null, false, To_Unbounded_String(""));
States.Init;
for D in Dev_Prio_Arr'Range loop
Bus.Devs_By_Priority(D).Clear;
end loop;
for D in Bus.Devices'Range loop
PMBs(D) := Bus.Devices(D).PMB;
end loop;
Put_Line ("INFO: Bus initialised");
end Init;
procedure Connect (Dev : in Dev_Num_T) is
begin
Bus.Devices(Dev).Connected := True;
if Bus.Devices(Dev).PMB < 16 then
Bus.Devs_By_Priority(Bus.Devices(Dev).PMB).Append(Dev);
end if;
Put_Line ("INFO: " & To_String(Bus.Devices(Dev).Mnemonic) & " connected to bus");
end Connect;
procedure Reset_IO_Device(Dev : in Dev_Num_T) is
begin
if Bus.Devices(Dev).Connected and Bus.Devices(Dev).IO_Device and (Bus.Devices(Dev).Reset_Proc /= null) then
Bus.Devices(Dev).Reset_Proc.all;
else
Put_Line ("INFO: Ignoring attempt to reset non-I/O or non-resettable device No. " & Get_Device_Name_Or_Number (Dev));
end if;
end Reset_IO_Device;
procedure Reset_All_IO_Devices is
begin
for D in Dev_Num_T'Range loop
if Bus.Devices(D).Connected and Bus.Devices(D).IO_Device then
Reset_IO_Device (D);
end if;
end loop;
end Reset_All_IO_Devices;
procedure Set_Reset_Proc (Dev : in Dev_Num_T; Reset_Proc : in Reset_Proc_T) is
begin
Bus.Devices(Dev).Reset_Proc := Reset_Proc;
end Set_Reset_Proc;
procedure Set_Data_Out_Proc (Dev : in Dev_Num_T; Data_Out_Proc : in Data_Out_Proc_T) is
begin
Bus.Devices(Dev).Data_Out_Proc := Data_Out_Proc;
end Set_Data_Out_Proc;
procedure Data_Out (Dev : in Dev_Num_T; Datum : in Word_T; ABC : in IO_Reg_T; Flag : in IO_Flag_T) is
begin
Bus.Devices(Dev).Data_Out_Proc (Datum, ABC, Flag);
end Data_Out;
procedure Data_In (Dev : in Dev_Num_T; ABC : in IO_Reg_T; Flag : in IO_Flag_T; Datum : out Word_T) is
begin
Bus.Devices(Dev).Data_In_Proc(ABC, Flag, Datum);
end Data_In;
procedure Set_Data_In_Proc (Dev : in Dev_Num_T; Data_In_Proc : in Data_In_Proc_T) is
begin
Bus.Devices(Dev).Data_In_Proc := Data_In_Proc;
end Set_Data_In_Proc;
function Is_Attached (Dev : in Dev_Num_T) return Boolean is
begin
return Bus.Devices(Dev).Sim_Image_Attached;
end Is_Attached;
function Is_Bootable (Dev : in Dev_Num_T) return Boolean is
begin
return Bus.Devices(Dev).Bootable;
end Is_Bootable;
function Is_Connected (Dev : in Dev_Num_T) return Boolean is
begin
return Bus.Devices(Dev).Connected;
end Is_Connected;
function Is_IO_Dev (Dev : in Dev_Num_T) return Boolean is
begin
return Bus.Devices(Dev).IO_Device;
end Is_IO_Dev;
procedure Set_Image_Attached (Dev : in Dev_Num_T; Image_Name : String) is
begin
Bus.Devices(Dev).Sim_Image_Attached := true;
Bus.Devices(Dev).Sim_Image_Name := To_Unbounded_String (Image_Name);
end Set_Image_Attached;
procedure Set_Image_Detached (Dev : in Dev_Num_T) is
begin
Bus.Devices(Dev).Sim_Image_Attached := false;
Bus.Devices(Dev).Sim_Image_Name := Null_Unbounded_String;
end Set_Image_Detached;
function Get_Printable_Device_List return String is
use Memory;
Lst : Unbounded_String := To_Unbounded_String (" # Mnem PMB I/O Busy Done Status") & Dasher_NL;
begin
for D in Dev_Num_T'Range loop
if Bus.Devices(D).Connected then
Lst := Lst &
Byte_To_String(Byte_T(D), Octal, 3, true) & ASCII.HT &
Bus.Devices(D).Mnemonic & ASCII.HT &
Byte_To_String(Byte_T(Bus.Devices(D).PMB), Decimal, 3) & "." & ASCII.HT &
Boolean_To_YN (Bus.Devices(D).IO_Device) & ASCII.HT &
Boolean_To_YN (States.Get_Busy(D)) & ASCII.HT &
Boolean_To_YN (States.Get_Done(D));
if Bus.Devices(D).Sim_Image_Attached then
Lst := Lst & " Attached to image: " & Bus.Devices(D).Sim_Image_Name;
end if;
Lst := Lst & Dasher_NL;
end if;
end loop;
return To_String (Lst);
end Get_Printable_Device_List;
function Get_Device_Name_Or_Number (Dev : in Dev_Num_T) return String is
begin
if Bus.Devices(Dev).Mnemonic /= "" then
return To_String(Bus.Devices(Dev).Mnemonic);
end if;
return Dev'Image;
end Get_Device_Name_Or_Number;
function Get_PMB (Dev : in Dev_Num_T) return Integer is
begin
return Bus.Devices(Dev).PMB;
end Get_PMB;
end Actions;
protected body States is
procedure Init is
begin
State.IRQ := false;
State.IRQ_Mask := 0;
for D in Int_Dev_Arr'Range loop
State.Interrupting_Dev(D) := false;
end loop;
end Init;
function Get_Busy (Dev : in Dev_Num_T) return Boolean is
begin
return State.Statuses(Dev).Busy;
end Get_Busy;
procedure Set_Busy (Dev : in Dev_Num_T; Busy_State : in Boolean) is
begin
State.Statuses(Dev).Busy := Busy_State;
end Set_Busy;
function Get_Done (Dev : in Dev_Num_T) return Boolean is
begin
return State.Statuses(Dev).Done;
end Get_Done;
procedure Set_Done (Dev : in Dev_Num_T; Done_State : in Boolean) is
begin
State.Statuses(Dev).Done := Done_State;
end Set_Done;
function Get_IRQ return Boolean is
begin
return State.IRQ;
end Get_IRQ;
function Is_Dev_Masked (PMB : in Integer) return Boolean is
begin
return Test_W_Bit (State.IRQ_Mask, PMB);
end Is_Dev_Masked;
procedure Send_Interrupt (Dev : in Dev_Num_T) is
begin
State.Interrupting_Dev(Dev) := true;
State.IRQs_By_Priority(PMBs(Dev)) := true;
State.IRQ := true;
end Send_Interrupt;
procedure Clear_Interrupt (Dev : in Dev_Num_T) is
begin
State.Interrupting_Dev(Dev) := false;
State.IRQs_By_Priority(PMBs(Dev)) := false;
--Bus.IRQ := false;
end Clear_Interrupt;
end States;
end Devices.Bus; |
libsrc/graphics/msx/surface/surface_circle.asm | meesokim/z88dk | 0 | 176288 | ;
; MSX extension for "GFX - a small graphics library" by Jannone
;
;
; Z88 Graphics Functions - Small C+ stubs
;
; Written around the Interlogic Standard Library
;
; MSX buffered display extension
; compatibility layer for "GFX",
; a small graphics library by <NAME>
;
; <NAME> - 18/03/2009
;
;
; $Id: surface_circle.asm,v 1.3 2015/01/19 01:32:49 pauloscustodio Exp $
;
PUBLIC surface_circle
;LIB swapgfxbk
;XREF swapgfxbk1
EXTERN base_graphics
EXTERN draw_circle
EXTERN surface_plotpixel
.surface_circle
ld ix,0
add ix,sp
ld l,(ix+10) ; surface struct
ld h,(ix+11)
ld de,6 ; shift to screen buffer ptr
add hl,de
ld e,(hl)
inc hl
ld d,(hl)
ld (base_graphics),de
ld e,(ix+2) ;skip
ld d,(ix+4) ;radius
ld c,(ix+6) ;y
ld b,(ix+8) ;x
;call swapgfxbk
ld ix,surface_plotpixel
call draw_circle
;jp swapgfxbk1
ret
|
engine/battle/move_effects/spikes.asm | AtmaBuster/pokeplat-gen2 | 6 | 15822 | <reponame>AtmaBuster/pokeplat-gen2
BattleCommand_spikes:
; spikes
ld hl, wEnemyScreens
ldh a, [hBattleTurn]
and a
jr z, .asm_3768e
ld hl, wPlayerScreens
.asm_3768e
; Fails if 3 layers of spikes are already down
ld a, [hl]
and MASK_SPIKES
cp SPIKES_3
jr z, .failed
; Nothing else stops it from working.
inc [hl]
call AnimateCurrentMove2
ld hl, SpikesText
jp StdBattleTextbox
.failed
farjump FailMove
BattleCommand_stealthrock:
; stealthrock
ld hl, wEnemyScreens
ldh a, [hBattleTurn]
and a
jr z, .asm_3768e
ld hl, wPlayerScreens
.asm_3768e
; Fails if already set
bit SCREENS_STEALTH_ROCK, [hl]
jr nz, .failed
; Nothing else stops it from working.
set SCREENS_STEALTH_ROCK, [hl]
call AnimateCurrentMove2
ld hl, StealthRockText
jp StdBattleTextbox
.failed
farjump FailMove
BattleCommand_toxicspikes:
; toxicspikes
ld hl, wEnemyScreens
ldh a, [hBattleTurn]
and a
jr z, .asm_3768e
ld hl, wPlayerScreens
.asm_3768e
; Fails if 2 layers of toxic spikes are already down
ld a, [hl]
and MASK_TOXIC_SPIKES
cp TOXIC_SPIKES_2
jr z, .failed
; Nothing else stops it from working.
ld a, [hl]
add TOXIC_SPIKES_1
ld [hl], a
call AnimateCurrentMove2
ld hl, ToxicSpikesText
jp StdBattleTextbox
.failed
farjump FailMove
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_816_1905.asm | ljhsiun2/medusa | 9 | 168298 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r15
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x19674, %rsi
lea addresses_WT_ht+0xadc2, %rdi
add %r15, %r15
mov $19, %rcx
rep movsw
nop
nop
cmp $52915, %r11
lea addresses_normal_ht+0x1d24, %rsi
lea addresses_A_ht+0x11c2c, %rdi
nop
nop
nop
xor $21921, %r13
mov $42, %rcx
rep movsq
and %r15, %r15
lea addresses_A_ht+0xeaf4, %rsi
lea addresses_UC_ht+0x1e9c0, %rdi
nop
nop
inc %r14
mov $78, %rcx
rep movsl
nop
nop
nop
nop
nop
and $9878, %r11
lea addresses_UC_ht+0x16284, %rcx
nop
nop
nop
cmp %r13, %r13
mov $0x6162636465666768, %r15
movq %r15, %xmm4
vmovups %ymm4, (%rcx)
cmp %r15, %r15
lea addresses_normal_ht+0x7b34, %rsi
lea addresses_WT_ht+0x15f34, %rdi
and %r9, %r9
mov $83, %rcx
rep movsl
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x16976, %rsi
lea addresses_D_ht+0xbb34, %rdi
nop
nop
xor $42214, %r9
mov $42, %rcx
rep movsw
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_UC_ht+0x13334, %r13
nop
nop
nop
nop
cmp $6510, %rsi
movl $0x61626364, (%r13)
nop
nop
nop
xor %r9, %r9
lea addresses_normal_ht+0x1d394, %rsi
lea addresses_D_ht+0x1503c, %rdi
sub %r11, %r11
mov $13, %rcx
rep movsl
nop
nop
nop
nop
cmp $5549, %rsi
lea addresses_WT_ht+0x14334, %r9
nop
nop
nop
xor $9004, %rcx
mov (%r9), %esi
nop
dec %r14
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
// Store
mov $0x9b4ee00000004d8, %r9
nop
nop
nop
nop
add %rsi, %rsi
movb $0x51, (%r9)
nop
nop
nop
nop
dec %r9
// Load
mov $0xb65, %rbx
cmp %r14, %r14
vmovups (%rbx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rsi
sub $39452, %rsi
// Store
lea addresses_RW+0x13a71, %rdi
nop
nop
nop
add $30426, %r10
mov $0x5152535455565758, %r14
movq %r14, %xmm4
vmovaps %ymm4, (%rdi)
nop
nop
add $48690, %r10
// Faulty Load
lea addresses_D+0x7b34, %r14
nop
xor %r10, %r10
mov (%r14), %rdi
lea oracles, %rsi
and $0xff, %rdi
shlq $12, %rdi
mov (%rsi,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 2}}
{'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'36': 816}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
SIM/test standard.asm | abdelazeem201/Design-and-Implement-t-a-RISC-V-processor-with-5-pipeline-stages. | 0 | 164933 | <filename>SIM/test standard.asm
#################
# Basic VERSION
# This program takes an array v and computes
# min {|v[i]|} , the minimum of the absolute value ,
# where v[i] is the i-th element in the array
.data
.align 2
v:
.word 10
.word -47
.word 22
.word -3
.word 15
.word 27
.word -4
m:
.word 0
.text
.align 2
.globl __start
__start:
li x16 ,7 # put 7 in x16
la x4 ,v # put in x4 the address of v
la x5 ,m # put in x5 the address of m
li x13 ,0 x3fffffff # init x13 with max pos
loop:
beq x16 ,x0 , done # check all elements have been tested
lw x8 ,0( x4) # load new element in x8
add x10 ,x10 ,x9 # x10 += x9 ( add the carry in)
addi x4 ,x4 ,0 x4 # point to next element
addi x16 ,x16 ,-1 # decrease x16 by 1
slt x11 ,x10 , x13 # x11 = ( x10 < x13 ) ? 1 : 0
beq x11 ,x0 , loop # next element
add x13 ,x10 ,x0 # update min
jal loop # next element
done:
sw x13 ,0( x5) # store the result
endc:
jal endc # infinite loop
addi x0 ,x0 ,0 |
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1403.asm | ljhsiun2/medusa | 9 | 247472 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0xd5d0, %r13
nop
nop
nop
and $52125, %rax
mov (%r13), %r11
nop
nop
nop
nop
cmp $14562, %r11
lea addresses_WC_ht+0x10f0, %rax
nop
nop
nop
xor %r8, %r8
mov (%rax), %r13w
nop
sub $15488, %rdx
lea addresses_D_ht+0xe1c8, %r9
nop
nop
nop
nop
nop
xor $47769, %r14
mov $0x6162636465666768, %r11
movq %r11, (%r9)
sub %r11, %r11
lea addresses_normal_ht+0x15f60, %rsi
lea addresses_A_ht+0xf860, %rdi
nop
nop
nop
nop
and $56085, %r8
mov $116, %rcx
rep movsb
nop
nop
nop
and $35420, %r11
lea addresses_D_ht+0x13f90, %r9
nop
nop
nop
nop
nop
dec %rax
movb (%r9), %r14b
nop
nop
nop
and $20498, %rsi
lea addresses_WT_ht+0x9110, %rsi
lea addresses_WC_ht+0x1235e, %rdi
clflush (%rsi)
clflush (%rdi)
and $47621, %r9
mov $95, %rcx
rep movsl
inc %r14
lea addresses_WT_ht+0x17470, %rdi
nop
nop
xor %r9, %r9
movb $0x61, (%rdi)
nop
nop
nop
nop
and %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_PSE+0x5b90, %r9
nop
nop
nop
xor $8170, %r15
movw $0x5152, (%r9)
nop
nop
nop
nop
nop
inc %r9
// REPMOV
mov $0xb10, %rsi
mov $0xda8, %rdi
nop
nop
nop
nop
nop
sub %rbp, %rbp
mov $18, %rcx
rep movsq
nop
nop
and %r9, %r9
// Faulty Load
lea addresses_RW+0xe310, %rbp
nop
nop
dec %r11
mov (%rbp), %r15
lea oracles, %rsi
and $0xff, %r15
shlq $12, %r15
mov (%rsi,%r15,1), %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_P', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_P', 'congruent': 3, 'same': False}}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_1118.asm | ljhsiun2/medusa | 9 | 92229 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_1118.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x4a05, %r9
nop
nop
nop
cmp $33906, %r12
mov (%r9), %r11
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_WC_ht+0x11495, %rsi
lea addresses_A_ht+0xdbe5, %rdi
clflush (%rsi)
nop
nop
nop
sub %r13, %r13
mov $92, %rcx
rep movsb
nop
nop
nop
add $29351, %rdx
lea addresses_UC_ht+0x13de5, %rsi
lea addresses_D_ht+0xdde5, %rdi
clflush (%rsi)
and %r12, %r12
mov $42, %rcx
rep movsl
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_WT_ht+0x165e5, %rcx
nop
nop
inc %rsi
vmovups (%rcx), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %r11
and %rdi, %rdi
lea addresses_UC_ht+0x1ade5, %rsi
lea addresses_WT_ht+0xf805, %rdi
nop
nop
nop
nop
dec %rdx
mov $57, %rcx
rep movsb
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0xa5e5, %rcx
xor %r12, %r12
vmovups (%rcx), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r13
nop
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_D_ht+0x1d0b5, %rdi
nop
inc %r9
movb $0x61, (%rdi)
nop
nop
inc %r11
lea addresses_WT_ht+0x73e5, %r9
nop
add %rdx, %rdx
mov (%r9), %r13d
nop
nop
nop
nop
and $12648, %rsi
lea addresses_A_ht+0xcbe5, %rdx
nop
and %rcx, %rcx
vmovups (%rdx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rdi
nop
nop
nop
nop
nop
and $5616, %rcx
lea addresses_WC_ht+0x15e5, %rdx
nop
nop
nop
add $33392, %rcx
movb $0x61, (%rdx)
nop
nop
sub %r11, %r11
lea addresses_WT_ht+0x11885, %rsi
lea addresses_A_ht+0xdfa5, %rdi
nop
nop
dec %r13
mov $88, %rcx
rep movsq
nop
nop
nop
add $15839, %rsi
lea addresses_WC_ht+0x67e5, %rsi
lea addresses_UC_ht+0x1ec7d, %rdi
clflush (%rsi)
nop
sub %r13, %r13
mov $40, %rcx
rep movsl
nop
nop
nop
cmp $17149, %rcx
lea addresses_normal_ht+0xa75f, %rsi
xor %rdi, %rdi
movups (%rsi), %xmm7
vpextrq $1, %xmm7, %rcx
nop
nop
xor %r11, %r11
lea addresses_A_ht+0x65e5, %r11
nop
nop
sub $35863, %rcx
and $0xffffffffffffffc0, %r11
movaps (%r11), %xmm2
vpextrq $0, %xmm2, %rdi
nop
nop
nop
nop
xor $47960, %rdx
lea addresses_normal_ht+0xd5e5, %rdi
nop
nop
nop
nop
xor $63574, %rcx
mov $0x6162636465666768, %r11
movq %r11, (%rdi)
nop
nop
nop
inc %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rax
push %rsi
// Faulty Load
lea addresses_normal+0x3de5, %rax
nop
nop
nop
nop
and %rsi, %rsi
movb (%rax), %r10b
lea oracles, %r13
and $0xff, %r10
shlq $12, %r10
mov (%r13,%r10,1), %r10
pop %rsi
pop %rax
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}}
{'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
*/
|
example-nopsys/nopsys.asm | nopsys/nopsys | 20 | 240142 | <filename>example-nopsys/nopsys.asm
extern putc_debug
global nopsys_vm_main
global semaphore_signal_with_index
global debug_print_call_stack
section .data
clock_str: db "|/-\"
clock_idx: db 0
section .text
nopsys_vm_main:
inc eax
jmp nopsys_vm_main
semaphore_signal_with_index:
;xchg bx, bx
xor eax, eax
mov al, [clock_idx]
mov eax, [clock_str+eax]
inc byte [clock_idx]
cmp byte [clock_idx], 4
jb .not_end
mov byte [clock_idx], 0
.not_end:
push 40
push 40
push eax
call putc_debug
add esp, 12
ret
debug_print_call_stack:
ret
|
app/icfpc2020/src/main/antlr4/Language.g4 | belyaev-mikhail/icfpc2020-sub | 0 | 1322 | <filename>app/icfpc2020/src/main/antlr4/Language.g4
grammar Language;
Colon
: ':'
;
Comma
: ','
;
OpenPar
: '('
;
ClosePar
: ')'
;
Equality
: '='
;
fragment Digit
: [0-9]
;
fragment Sym
: 'a'..'z'
| 'A' .. 'Z'
;
Name:
Sym (Digit | Sym)*;
Numeral
: '0'
| [1-9] Digit*
;
NegNumeral
: '-' Numeral
;
identifier
: Colon Numeral
;
fileContent
: statements EOF
;
statements
: statement*
;
statement
: identifier Equality expression
| Name Equality expression
;
number
: Numeral
| NegNumeral
;
expression
: identifier
| number
| nil
| list_expression
| function
| application
| bools
;
application
: ap expression expression
;
function
: list_rule
| neg_rule
| inc_rule
| dec_rule
| add_rule
| mul_rule
| div_rule
| eq_rule
| lt_rule
| interactions
| combinator
| isnil_rule
| power_of_2_rule
| if0_rule
;
ap : 'ap' ;
cons_rule : 'cons' ;
vec_rule: 'vec';
nil : 'nil' ;
car_rule: 'car';
cdr_rule:'cdr';
isnil_rule: 'isnil';
neg_rule: 'neg' ;
inc_rule: 'inc';
dec_rule: 'dec';
add_rule: 'add';
mul_rule: 'mul';
div_rule: 'div';
eq_rule: 'eq';
lt_rule : 'lt';
power_of_2_rule: 'pwr2';
if0_rule: 'if0';
dem_rule :'dem';
mod_rule : 'mod';
send_rule: 'send';
interact_rule : 'interact';
draw_rule : 'draw';
checkerboard_rule : 'checkerboard';
multipledraw_rule : 'multipledraw';
interactions
: send_rule
| mod_rule
| dem_rule
| interact_rule
| draw_rule
| checkerboard_rule
| multipledraw_rule
;
list_expression
: empty_list
| empty_list_with_comma
| non_empty_list
;
empty_list
: OpenPar ClosePar
;
empty_list_with_comma
: OpenPar Comma ClosePar
;
non_empty_list
: OpenPar expression (Comma expression)* ClosePar
;
list_rule
: cons_rule
| car_rule
| cdr_rule
| vec_rule
;
combinator
: s_comb_rule
| b_comb_rule
| c_comb_rule
| i_comb_rule
;
bools
: true_rule
| false_rule
;
true_rule: 't';
false_rule:'f';
s_comb_rule: 's';
b_comb_rule: 'b';
c_comb_rule: 'c';
i_comb_rule: 'i';
WS : [ \t\r\n]+ -> channel(HIDDEN)
;
|
bookofmudora.asm | compiling/z3randomizer | 26 | 17474 | <reponame>compiling/z3randomizer<gh_stars>10-100
;================================================================================
; Randomize Book of Mudora
;--------------------------------------------------------------------------------
LoadLibraryItemGFX:
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
DrawLibraryItemGFX:
PHA
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
PLA
RTL
;--------------------------------------------------------------------------------
SetLibraryItem:
LDY $0E80, X ; Retrieve stored item type
JSL.l ItemSet_Library ; contains thing we wrote over
RTL
;--------------------------------------------------------------------------------
;0x0087 - Hera Room w/key
;================================================================================
; Randomize Bonk Keys
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over
LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
JSR LoadBonkItem
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
DrawBonkItemGFX:
PHA
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame
.skipInit
JSR LoadBonkItem
JSL.l DrawDynamicTileNoShadow
.done
PLA
RTL
;--------------------------------------------------------------------------------
GiveBonkItem:
JSR LoadBonkItem
CMP #$24 : BNE .notKey
.key
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
LDA $7EF36F : INC A : STA $7EF36F
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
JSL CountBonkItem
RTL
.notKey
PHY : TAY : JSL.l Link_ReceiveItem : PLY
JSL CountBonkItem
RTL
;--------------------------------------------------------------------------------
LoadBonkItem:
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
BRA ++
+
LDA.b #$24 ; default to small key
++
RTS |
source/league/matreshka-internals-unicode-ucd.ads | svn2github/matreshka | 24 | 10823 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2015, <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$
------------------------------------------------------------------------------
package Matreshka.Internals.Unicode.Ucd is
pragma Preelaborate;
type First_Stage_Index is mod 16#1100#;
type Second_Stage_Index is mod 16#100#;
type Sequence_Count is range 0 .. 2 ** 16 - 1;
for Sequence_Count'Size use 16;
subtype Sequence_Index is Sequence_Count range 1 .. Sequence_Count'Last;
type Code_Point_Sequence is array (Sequence_Index range <>) of Code_Point;
type Code_Point_Sequence_Access is access constant Code_Point_Sequence;
---------------------
-- Core properties --
---------------------
type General_Category is
(Control,
Format,
Unassigned,
Private_Use,
Surrogate,
Lowercase_Letter,
Titlecase_Letter,
Uppercase_Letter,
Modifier_Letter,
Other_Letter,
Spacing_Mark,
Enclosing_Mark,
Nonspacing_Mark,
Decimal_Number,
Letter_Number,
Other_Number,
Connector_Punctuation,
Dash_Punctuation,
Close_Punctuation,
Final_Punctuation,
Initial_Punctuation,
Other_Punctuation,
Open_Punctuation,
Currency_Symbol,
Modifier_Symbol,
Math_Symbol,
Other_Symbol,
Line_Separator,
Paragraph_Separator,
Space_Separator);
for General_Category'Size use 8;
type Boolean_Properties is
(Composition_Exclusion, -- XXX
Expands_On_NFC, -- Derived
Expands_On_NFD, -- Derived
Expands_On_NFKC, -- Derived
Expands_On_NFKD, -- Derived
Full_Composition_Exclusion, -- Derived
ASCII_Hex_Digit,
Bidi_Control,
Dash,
Deprecated,
Diacritic,
Extender,
Hex_Digit,
Hyphen,
Ideographic,
IDS_Binary_Operator,
IDS_Trinary_Operator,
Join_Control,
Logical_Order_Exception,
Noncharacter_Code_Point,
Other_Alphabetic,
Other_Default_Ignorable_Code_Point,
Other_Grapheme_Extend,
Other_ID_Continue,
Other_ID_Start,
Other_Lowercase,
Other_Math,
Other_Uppercase,
Pattern_Syntax,
Pattern_White_Space,
Quotation_Mark,
Radical,
Soft_Dotted,
STerm,
Terminal_Punctuation,
Unified_Ideograph,
Variation_Selector,
White_Space,
-- Bidi_Mirrored, -- XXX
-- Derived core properties. This list must include only properties
-- from DerivedCoreProperties.txt file.
Alphabetic, -- Derived
Cased, -- Derived
Case_Ignorable, -- Derived
Changes_When_Lowercased, -- Derived
Changes_When_Uppercased, -- Derived
Changes_When_Titlecased, -- Derived
Changes_When_Casefolded, -- Derived
Changes_When_Casemapped, -- Derived
Default_Ignorable_Code_Point, -- Derived
Grapheme_Base, -- Derived
Grapheme_Extend, -- Derived
Grapheme_Link, -- Deprecated, derived
ID_Continue, -- Derived
ID_Start, -- Derived
Lowercase, -- Derived
Math, -- Derived
Uppercase, -- Derived
XID_Continue, -- Derived
XID_Start, -- Derived
-- Derived normalization properties.
Changes_When_NFKC_Casefolded); -- Derived
subtype Overridable_Boolean_Properties is Boolean_Properties
range ASCII_Hex_Digit .. Changes_When_NFKC_Casefolded;
type Boolean_Values is array (Overridable_Boolean_Properties) of Boolean;
for Boolean_Values'Component_Size use 1;
for Boolean_Values'Size use 64; -- 52 bits used for now
type East_Asian_Width is
(Ambiguous,
Fullwidth,
Halfwidth,
Neutral,
Narrow,
Wide);
for East_Asian_Width'Size use 8;
type Grapheme_Cluster_Break is
(Control,
CR,
Extend,
L,
LF,
LV,
LVT,
Prepend,
Regional_Indicator,
Spacing_Mark,
T,
V,
Other);
for Grapheme_Cluster_Break'Size use 8;
type Word_Break is
(CR,
LF,
Newline,
Extend,
Regional_Indicator,
Format,
Katakana,
Hebrew_Letter,
A_Letter,
Single_Quote,
Double_Quote,
Mid_Num_Let,
Mid_Letter,
Mid_Num,
Numeric,
Extend_Num_Let,
Other);
for Word_Break'Size use 8;
type Sentence_Break is
(Other,
CR,
LF,
Sep,
Sp,
Lower,
Upper,
O_Letter,
Numeric,
A_Term,
S_Term,
Close,
S_Continue,
Format,
Extend);
for Sentence_Break'Size use 8;
type Line_Break is
(Ambiguous,
Alphabetic,
Break_Both,
Break_After,
Break_Before,
Mandatory_Break,
Contingent_Break,
Conditional_Japanese_Starter,
Close_Punctuation,
Combining_Mark,
Close_Parenthesis,
Carriage_Return,
Exclamation,
Glue,
H2,
H3,
Hebrew_Letter,
Hyphen,
Ideographic,
Inseparable,
Infix_Numeric,
JL,
JT,
JV,
Line_Feed,
Next_Line,
Nonstarter,
Numeric,
Open_Punctuation,
Postfix_Numeric,
Prefix_Numeric,
Quotation,
Regional_Indicator,
Complex_Context,
Surrogate,
Space,
Break_Symbols,
Word_Joiner,
Unknown,
ZW_Space);
for Line_Break'Size use 8;
type Core_Values is record
GC : General_Category; -- 8 (5) bits
EA : East_Asian_Width; -- 8 (3) bits
GCB : Grapheme_Cluster_Break; -- 8 (4) bits
WB : Word_Break; -- 8 (4) bits
SB : Sentence_Break; -- 8 (4) bits
LB : Line_Break; -- 8 (6) bits
B : Boolean_Values; -- 64 (52) bits
end record;
for Core_Values'Size use 128;
for Core_Values use record
B at 0 range 0 .. 63;
GC at 0 range 64 .. 71;
GCB at 0 range 72 .. 79;
WB at 0 range 80 .. 87;
SB at 0 range 88 .. 95;
LB at 0 range 96 .. 103;
EA at 0 range 104 .. 111;
end record;
type Core_Second_Stage is array (Second_Stage_Index) of Core_Values;
type Core_Second_Stage_Access is not null access constant Core_Second_Stage;
type Core_First_Stage is
array (First_Stage_Index) of Core_Second_Stage_Access;
type Core_First_Stage_Access is not null access constant Core_First_Stage;
------------
-- Casing --
------------
type Casing_Context is
(Final_Sigma,
After_Soft_Dotted,
More_Above,
Before_Dot,
After_I);
type Case_Mapping_Range is record
First : Sequence_Count;
Last : Sequence_Count;
end record;
type Case_Mapping_Kinds is (Lower, Upper, Title, Folding);
type Case_Mapping_Ranges is
array (Case_Mapping_Kinds) of Case_Mapping_Range;
type Simple_Case_Mappings is
array (Case_Mapping_Kinds) of Code_Point;
type Casing_Context_Mapping_Ranges is
array (Case_Mapping_Kinds range Lower .. Title) of Case_Mapping_Range;
type Case_Mapping is record
Simple : Simple_Case_Mappings;
Ranges : Case_Mapping_Ranges;
Context_First : Sequence_Count;
Context_Last : Sequence_Count;
end record;
type Casing_Context_Mapping is record
Context : Casing_Context;
Negative : Boolean;
Ranges : Casing_Context_Mapping_Ranges;
end record;
type Case_Mapping_Second_Stage is
array (Second_Stage_Index) of Case_Mapping;
type Case_Mapping_Second_Stage_Access is
not null access constant Case_Mapping_Second_Stage;
type Case_Mapping_First_Stage is
array (First_Stage_Index) of Case_Mapping_Second_Stage_Access;
type Case_Mapping_First_Stage_Access is
access constant Case_Mapping_First_Stage;
type Casing_Context_Mapping_Sequence is
array (Sequence_Index range <>) of Casing_Context_Mapping;
type Casing_Context_Mapping_Sequence_Access is
access constant Casing_Context_Mapping_Sequence;
-------------------
-- Normalization --
-------------------
type Canonical_Combining_Class is mod 256;
Not_Reordered : constant Canonical_Combining_Class := 0;
Overlay : constant Canonical_Combining_Class := 1;
Nukta : constant Canonical_Combining_Class := 7;
Kana_Voicing : constant Canonical_Combining_Class := 8;
Virama : constant Canonical_Combining_Class := 9;
Attached_Below_Left : constant Canonical_Combining_Class := 200;
Attached_Below : constant Canonical_Combining_Class := 202;
Attached_Above_Right : constant Canonical_Combining_Class := 216;
Below_Left : constant Canonical_Combining_Class := 218;
Below : constant Canonical_Combining_Class := 220;
Below_Right : constant Canonical_Combining_Class := 222;
Left : constant Canonical_Combining_Class := 224;
Right : constant Canonical_Combining_Class := 226;
Above_Left : constant Canonical_Combining_Class := 228;
Above : constant Canonical_Combining_Class := 230;
Above_Right : constant Canonical_Combining_Class := 232;
Double_Below : constant Canonical_Combining_Class := 233;
Double_Above : constant Canonical_Combining_Class := 234;
Iota_Subscript : constant Canonical_Combining_Class := 240;
type Decomposition_Type is
(None,
Canonical,
Font,
No_Break,
Initial,
Medial,
Final,
Isolated,
Circle,
Super,
Sub,
Vertical,
Wide,
Narrow,
Small,
Square,
Fraction,
Compat);
for Decomposition_Type'Size use 8;
subtype Not_Overridable_Boolean_Properties is Boolean_Properties
range Composition_Exclusion .. Full_Composition_Exclusion;
type Non_Overridable_Boolean_Values is
array (Not_Overridable_Boolean_Properties) of Boolean;
for Non_Overridable_Boolean_Values'Component_Size use 1;
for Non_Overridable_Boolean_Values'Size use 8; -- 6 bits used for now
type Normalization_Quick_Check is (No, Maybe, Yes);
for Normalization_Quick_Check'Size use 2;
type Normalization_Form is (NFC, NFD, NFKC, NFKD);
type Normalization_Quick_Checks is
array (Normalization_Form) of Normalization_Quick_Check;
for Normalization_Quick_Checks'Size use 8;
for Normalization_Quick_Checks'Component_Size
use Normalization_Quick_Check'Size;
type Normalization_Mapping_Range is record
First : Sequence_Count;
Last : Sequence_Count;
end record;
type Decomposition_Kinds is (Canonical, Compatibility);
type Decomposition_Mapping is
array (Decomposition_Kinds) of Normalization_Mapping_Range;
type Normalization_Mapping is record
Decomposition : Decomposition_Mapping;
Composition : Normalization_Mapping_Range;
CCC : Canonical_Combining_Class; -- 8 bits
NQC : Normalization_Quick_Checks; -- 8 bits
DT : Decomposition_Type; -- 8 (5) bits
B : Non_Overridable_Boolean_Values;
end record;
for Normalization_Mapping'Size use 128;
type Normalization_Mapping_Second_Stage is
array (Second_Stage_Index) of Normalization_Mapping;
type Normalization_Mapping_Second_Stage_Access is
not null access constant Normalization_Mapping_Second_Stage;
type Normalization_Mapping_First_Stage is
array (First_Stage_Index) of Normalization_Mapping_Second_Stage_Access;
type Composition_Mapping is
array (Sequence_Index range <>, Sequence_Index range <>) of Code_Point;
---------------
-- Collation --
---------------
type Collation_Weight is mod 2**16;
for Collation_Weight'Size use 16;
pragma Assert (Code_Unit_16'Size = Collation_Weight'Size);
-- Note: collation algoriphm in identical strength level adds copy of the
-- source string in NFD form at the end of produced sorting key, thus it is
-- important that Code_Unit_16 and Collation_Weight types have equal size.
type Collation_Element is record
Primary : Collation_Weight;
Secondary : Collation_Weight;
Trinary : Collation_Weight;
end record;
type Collation_Element_Sequence is
array (Sequence_Index range <>) of Collation_Element;
type Collation_Element_Sequence_Access is
access constant Collation_Element_Sequence;
type Contractor_Record is record
Code : Code_Point;
Contractor_First : Sequence_Count;
Contractor_Last : Sequence_Count;
Expansion_First : Sequence_Count;
Expansion_Last : Sequence_Count;
end record;
type Contractor_Array is
array (Sequence_Index range <>) of Contractor_Record;
type Contractor_Array_Access is access constant Contractor_Array;
type Collation_Record is record
Contractor_First : Sequence_Count;
Contractor_Last : Sequence_Count;
Expansion_First : Sequence_Count;
Expansion_Last : Sequence_Count;
end record;
type Collation_Second_Stage is
array (Second_Stage_Index) of Collation_Record;
type Collation_Second_Stage_Access is
not null access constant Collation_Second_Stage;
type Collation_First_Stage is
array (First_Stage_Index) of Collation_Second_Stage_Access;
type Collation_First_Stage_Access is access constant Collation_First_Stage;
-------------------------------
-- Two stage table utilities --
-------------------------------
generic
type Element_Type is private;
type Second_Stage_Array is
array (Second_Stage_Index) of Element_Type;
type Second_Stage_Array_Access is
not null access constant Second_Stage_Array;
type First_Stage_Array is
array (First_Stage_Index) of Second_Stage_Array_Access;
function Generic_Element (Data : First_Stage_Array; Code : Code_Point)
return Element_Type;
end Matreshka.Internals.Unicode.Ucd;
|
metron-platform/metron-common/src/main/antlr4/org/apache/metron/common/query/generated/Predicate.g4 | jaidrao/ApacheMetron | 0 | 1690 | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
grammar Predicate;
@header {
//CHECKSTYLE:OFF
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
}
/* Lexical rules */
AND : 'and'
| '&&'
| 'AND'
;
OR : 'or'
| '||'
| 'OR';
NOT : 'not'
| 'NOT';
TRUE : 'true'
| 'TRUE' ;
FALSE : 'false'
| 'FALSE';
EQ : '==' ;
NEQ : '!=' ;
LT : '<';
LTE : '<=';
GT : '>';
GTE : '>=';
COMMA : ',';
LBRACKET : '[';
RBRACKET : ']';
LPAREN : '(' ;
RPAREN : ')' ;
IN : 'in'
;
NIN : 'not in'
;
EXISTS : 'exists';
INT_LITERAL : '0'..'9'+ ;
DOUBLE_LITERAL : '0'..'9'+'.''0'..'9'+ ;
IDENTIFIER : [a-zA-Z_][a-zA-Z_\.0-9]* ;
fragment SCHAR: ~['"\\\r\n];
STRING_LITERAL : '"' SCHAR* '"'
| '\'' SCHAR* '\'' ;
SEMI : ';' ;
// COMMENT and WS are stripped from the output token stream by sending
// to a different channel 'skip'
COMMENT : '//' .+? ('\n'|EOF) -> skip ;
WS : [ \r\t\u000C\n]+ -> skip ;
/* Parser rules */
single_rule : logical_expr EOF;
logical_expr
: logical_expr AND logical_expr # LogicalExpressionAnd
| logical_expr OR logical_expr # LogicalExpressionOr
| comparison_expr # ComparisonExpression
| LPAREN logical_expr RPAREN # LogicalExpressionInParen
| NOT LPAREN logical_expr RPAREN #NotFunc
| logical_entity # LogicalEntity
;
comparison_expr : comparison_operand comp_operator comparison_operand # ComparisonExpressionWithOperator
| identifier_operand IN identifier_operand #InExpression
| identifier_operand NIN identifier_operand #NInExpression
| LPAREN comparison_expr RPAREN # ComparisonExpressionParens
;
logical_entity : (TRUE | FALSE) # LogicalConst
| EXISTS LPAREN IDENTIFIER RPAREN #ExistsFunc
| IDENTIFIER LPAREN func_args RPAREN #LogicalFunc
;
list_entity : LBRACKET op_list RBRACKET
;
func_args : op_list
;
op_list : identifier_operand
| op_list COMMA identifier_operand
;
t_func : IDENTIFIER LPAREN func_args RPAREN #TransformationFunc
;
identifier_operand : STRING_LITERAL # StringLiteral
| IDENTIFIER # LogicalVariable
| t_func #id_tfunc
| INT_LITERAL #IntegerLiteral
| DOUBLE_LITERAL #DoubleLiteral
| list_entity #List
;
comparison_operand : identifier_operand #IdentifierOperand
| logical_entity # LogicalConstComparison
;
comp_operator : (EQ | NEQ | LT | LTE | GT | GTE) # ComparisonOp
;
|
src/rkt.agda | xoltar/cedille | 0 | 1149 | import cedille-options
module rkt (options : cedille-options.options) where
open import string
open import char
open import io
open import maybe
open import ctxt
open import list
open import trie
open import general-util
open import monad-instances
open import toplevel-state options {IO}
open import unit
open import bool
open import functions
open import product
open import cedille-types
open import syntax-util
private
rkt-dbg-flag = ff
rkt-dbg : string → rope → rope
rkt-dbg msg out = [[ if rkt-dbg-flag then ("; " ^ msg ^ "\n") else "" ]] ⊹⊹ out
-- constructs the name of a .racket directory for the given original directory
rkt-dirname : string → string
rkt-dirname dir = combineFileNames dir ".racket"
-- constructs the fully-qualified name of a .rkt file for a .ced file at the given ced-path
{-rkt-filename : (ced-path : string) → string
rkt-filename ced-path =
let dir = takeDirectory ced-path in
let unit-name = base-filename (takeFileName ced-path) in
combineFileNames (rkt-dirname dir) (unit-name ^ ".rkt")-}
-- sanitize a Cedille identifier for Racket
-- Racket does not allow "'" as part of a legal identifier,
-- so swamp this out for "."
rkt-iden : var → var
rkt-iden = 𝕃char-to-string
∘ ((map λ c → if c =char '\'' then '.' else c)
∘ string-to-𝕃char)
-- Racket string from erase Cedile term
rkt-from-term : term → rope
rkt-from-term (Lam _ KeptLam _ v _ tm)
= [[ "(lambda (" ]] ⊹⊹ [[ rkt-iden v ]] ⊹⊹ [[ ")" ]] ⊹⊹ rkt-from-term tm ⊹⊹ [[ ")" ]]
-- TODO untested
rkt-from-term (Let _ (DefTerm _ v _ tm-def) tm-body)
= [[ "(let ([" ]] ⊹⊹ [[ rkt-iden v ]] ⊹⊹ [[ " " ]] ⊹⊹ rkt-from-term tm-def ⊹⊹ [[ "]) " ]] ⊹⊹ rkt-from-term tm-body ⊹⊹ [[ ")\n" ]]
rkt-from-term (Var _ v)
= [[ rkt-iden v ]]
rkt-from-term (App tm₁ x tm₂)
= [[ "(" ]] ⊹⊹ rkt-from-term tm₁ ⊹⊹ [[ " " ]] ⊹⊹ rkt-from-term tm₂ ⊹⊹ [[ ")" ]]
rkt-from-term (Hole x)
= [[ "(error 'cedille-hole)" ]]
rkt-from-term (Beta _ _ NoTerm)
= [[ "(lambda (x) x)\n" ]]
rkt-from-term _
= rkt-dbg "unsupported/unknown term" [[]]
-- Racket define form from var, term
rkt-define : var → term → rope
rkt-define v tm = [[ "(define " ]] ⊹⊹ [[ rkt-iden v ]] ⊹⊹ rkt-from-term tm ⊹⊹ [[ ")" ]] ⊹⊹ [[ "\n" ]]
-- Racket require form from file
rkt-require-file : string → rope
rkt-require-file fp = [[ "(require (file \"" ]] ⊹⊹ [[ fp ]] ⊹⊹ [[ "\"))" ]]
-- Racket term from Cedille term sym-info
rkt-from-sym-info : string → sym-info → rope
rkt-from-sym-info n (term-def (just (ParamsCons (Decl _ _ _ v _ _) _)) _ tm ty , _)
-- TODO not tested
= rkt-dbg "term-def: paramsCons:" (rkt-define n tm)
rkt-from-sym-info n (term-def (just ParamsNil) _ tm ty , _)
= rkt-dbg "term-def: paramsNil:" (rkt-define n tm)
rkt-from-sym-info n (term-def nothing _ tm ty , b)
-- TODO not tested
= rkt-dbg "term-def: nothing:" (rkt-define n tm)
rkt-from-sym-info n (term-udef _ _ tm , _)
= rkt-dbg "term-udef:" (rkt-define n tm)
rkt-from-sym-info n (term-decl x , _)
= rkt-dbg "term-decl" [[]]
rkt-from-sym-info n (type-decl x , _)
= rkt-dbg "type-decl:" [[]]
rkt-from-sym-info n (type-def _ _ _ _ , _)
= rkt-dbg "type-def:" [[]]
rkt-from-sym-info n (kind-def _ _ , _)
= rkt-dbg "kind-def:" [[]]
rkt-from-sym-info n (rename-def v , _)
-- TODO Not implemented!
= rkt-dbg ("rename-def: " ^ v) [[]]
rkt-from-sym-info n (var-decl , _)
= rkt-dbg "var-decl:" [[]]
rkt-from-sym-info n (const-def _ , _)
= rkt-dbg "const-def:" [[]]
rkt-from-sym-info n (datatype-def _ _ , _)
= rkt-dbg "datatype-def:" [[]]
to-rkt-file : (ced-path : string) → ctxt → include-elt → ((cede-filename : string) → string) → rope
to-rkt-file ced-path (mk-ctxt _ (syms , _) i sym-occurences _) ie rkt-filename =
rkt-header ⊹⊹ rkt-body
where
cdle-pair = trie-lookup𝕃2 syms ced-path
cdle-mod = fst cdle-pair
cdle-defs = snd cdle-pair
qual-name : string → string
qual-name name = cdle-mod ^ "." ^ name
-- lang pragma, imports, and provides
rkt-header rkt-body : rope
rkt-header =
[[ "#lang racket\n\n" ]] ⊹⊹
foldr (λ fn x → rkt-require-file (rkt-filename fn) ⊹⊹ x)
[[ "\n" ]] (include-elt.deps ie) ⊹⊹
[[ "(provide (all-defined-out))\n\n" ]]
-- in reverse order: lookup symbol defs from file,
-- pair name with info, and convert to racket
rkt-body = foldr (λ {(n , s) x → x ⊹⊹
[[ "\n" ]] ⊹⊹ rkt-from-sym-info (qual-name n) s}) [[]]
(drop-nothing (map
(λ name → maybe-map (λ syminf → name , syminf)
(trie-lookup i (qual-name name)))
cdle-defs))
{-
-- write a Racket file to .racket subdirectory from Cedille file path,
-- context, and include-elt
write-rkt-file : (ced-path : string) → ctxt → include-elt → ((cede-filename : string) → string) → IO ⊤
write-rkt-file ced-path (mk-ctxt _ (syms , _) i sym-occurences) ie rkt-filename =
let dir = takeDirectory ced-path
in createDirectoryIfMissing tt (rkt-dirname dir) >>
writeFile (rkt-filename ced-path)
(rkt-header ^ rkt-body)
where
cdle-mod = fst (trie-lookup𝕃2 syms ced-path)
cdle-defs = snd (trie-lookup𝕃2 syms ced-path)
qual-name : string → string
qual-name name = cdle-mod ^ "." ^ name
-- lang pragma, imports, and provides
rkt-header rkt-body : string
rkt-header = "#lang racket\n\n"
^ (string-concat-sep "\n"
(map (rkt-require-file ∘ rkt-filename)
(include-elt.deps ie))) ^ "\n"
^ "(provide (all-defined-out))\n\n"
-- in reverse order: lookup symbol defs from file,
-- pair name with info, and convert to racket
rkt-body = string-concat-sep "\n"
(map (λ { (n , s) → rkt-from-sym-info (qual-name n) s})
(reverse (drop-nothing
(map (λ name →
maybe-map (λ syminf → name , syminf)
(trie-lookup i (qual-name name)))
cdle-defs))))
-}
|
source/ledLamp.asm | MuellerA/Led-Lamp | 0 | 99865 | <filename>source/ledLamp.asm
;;; ========================================================================
;;; led-lamp.asm
;;; (c) <NAME>
;;; see LICENSE.md
;;; ========================================================================
.include "settings.inc"
;;; ========================================================================
;;; Register
;;; ========================================================================
_Zero = 1
_FnUpdate = 2 ; LedMatrix::Update()
_FnDisplay = 4 ; LedMatrix::Display()
_FnConfig = 6 ; LedMatrix::Configure(Config c)
_Cmd = 8 ; IR command
_LedMatrixAddrLo = 16 ; &ledMatrix
_LedMatrixAddrHi = 17
;;; ========================================================================
;;; Constants
;;; ========================================================================
Cmd0 = 0
Cmd1 = 1
Cmd2 = 2
Cmd3 = 3
Cmd4 = 4
Cmd5 = 5
Cmd6 = 6
Cmd7 = 7
Cmd8 = 8
Cmd9 = 9
CmdProgUp = 10
CmdProgDown = 11
CmdSpeedUp = 12
CmdSpeedDown = 13
CmdBrightUp = 14
CmdBrightDown = 15
CmdSave = 16
CmdLoad = 17
CmdEnd = 18
IRprotocolSamsung = 1
IRprotocolNEC = 2
IRprotocol = IRprotocolNEC
ConfigBrightness = 1
ConfigForceRedraw = 2
;;; ========================================================================
;;; ISR INT0
;;; ========================================================================
;;; State 0: nothing
;;; State 1: start falling edge
;;; State 2: rising edge header after 4.5ms (Samsung)
;;; State 3: falling edge header after 4.5ms
;;; State 4: rising edge bit 0 after 0.56ms
;;; State 5: falling edge bit 0 after 0.56 or 1.69ms
;;; State 6: rising edge bit 1 after 0.56ms
;;; ...
;;; State 68: falling edge bit 31 after 0.56 or 1.69ms
.if IRprotocol == IRprotocolSamsung
IrHdrMark = 4500
IrHdrSpace = 4500
IrBitMark = 500
IrBit1Space = 1700
IrBit0Space = 600
IrByte2 = 0x1f
IrByte3 = 0xe0
ISR_INT0_CodeToCmd:
; 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 14, 0xff, 11, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 00
.byte 4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 10
.byte 1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 20
.byte 7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 30
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 40
.byte 6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 50
.byte 3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 60
.byte 9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 70
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 15, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 80
.byte 5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 90
.byte 2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; a0
.byte 8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; b0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; c0
.byte 13, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; d0
.byte 12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; e0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; f0
.elseif IRprotocol == IRprotocolNEC
IrHdrMark = 9000
IrHdrSpace = 4500
IrBitMark = 560
IrBit1Space = 1650
IrBit0Space = 560
IrByte2 = 0xff
IrByte3 = 0x00
ISR_INT0_CodeToCmd:
; 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
.byte 0xff, 0xff, 14, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 00
.byte 4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 10
.byte 0xff, 0xff, 15, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 20
.byte 1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 30
.byte 0xff, 0xff, 7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 8, 0xff, 0xff, 0xff, 0xff, 0xff ; 40
.byte 0xff, 0xff, 9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 6, 0xff, 0xff, 0xff, 0xff, 0xff ; 50
.byte 0xff, 0xff, 17, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 60
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 3, 0xff, 0xff, 0xff, 0xff, 0xff ; 70
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 80
.byte 16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; 90
.byte 0xff, 0xff, 11, 0xff, 0xff, 0xff, 0xff, 0xff, 12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; a0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; b0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; c0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; d0
.byte 13, 0xff, 10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; e0
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ; f0
.endif
.global ISR_INT0
_SREG = 9
_TickL = 10
_TickH = 11
_INT0 = 16
_State = 17
_DelayMinL = 18
_DelayMinH = 19
_DelayMaxL = 20
_DelayMaxH = 21
ISR_INT0:
push _SREG
push _TickL
push _TickH
push _INT0
push _State
push _DelayMinL
push _DelayMinH
push _DelayMaxL
push _DelayMaxH
push 22
push 23
push 24
push 25
push YL
push YH
push ZL
push ZH
in _SREG, SREG
ldiw YL, maInt0
ldd _State, Y + moInt0State
ISR_INT0_0:
cpi _State, 0x00
brne ISR_INT0_1
sbic INT0Pin, INT0Idx ; check INT0 is low (active)
rjmp ISR_INT0_Error
rcall StartTimer
rjmp ISR_INT0_Success
ISR_INT0_1:
cpi _State, 0x01
brne ISR_INT0_2
ldiw _DelayMinL, IrHdrMark * 7 / 10 / 20
ldiw _DelayMaxL, IrHdrMark * 13 / 10 / 20
rjmp ISR_INT0_Check
ISR_INT0_2:
cpi _State, 0x02
brne ISR_INT0_3
ldiw _DelayMinL, IrHdrSpace * 7 / 10 / 20
ldiw _DelayMaxL, IrHdrSpace * 13 / 10 / 20
rjmp ISR_INT0_Check
ISR_INT0_3:
sbrs _State, 0
rjmp ISR_INT0_GetBit
ldiw _DelayMinL, IrBitMark * 7 / 10 / 20
ldiw _DelayMaxL, IrBitMark * 13 / 10 / 20
ISR_INT0_Check:
rcall GetTickCnt ; r24:25 now, r22:23 prev
sub 24, 22
sbc 25, 23
movw _TickL, 24 ; ticks since last irq
cp _TickL, _DelayMinL
cpc _TickH, _DelayMinH
brcs ISR_INT0_Error ; ticks < minDelay
cp _DelayMaxL, _TickL
cpc _DelayMaxH, _TickH
brcs ISR_INT0_Error ; ticks > maxDelay
rjmp ISR_INT0_Success
ISR_INT0_GetBit:
rcall GetTickCnt ; r24:25 now, r22:23 prev
sub 24, 22
sbc 25, 23
movw _TickL, 24 ; ticks since last irq
ldiw _DelayMinL, IrBit0Space * 7 / 10 / 20
cp _TickL, _DelayMinL
cpc _TickH, _DelayMinH
brcs ISR_INT0_GetBit1
ldiw _DelayMaxL, IrBit0Space * 13 / 10 / 20
cp _DelayMaxL, _TickL
cpc _DelayMaxH, _TickH
brcs ISR_INT0_GetBit1
clc
rjmp ISR_INT0_ShiftBit
ISR_INT0_GetBit1:
ldiw _DelayMinL, IrBit1Space * 7 / 10 / 20
cp _TickL, _DelayMinL
cpc _TickH, _DelayMinH
brcs ISR_INT0_Error
ldiw _DelayMaxL, IrBit1Space * 13 / 10 / 20
cp _DelayMaxL, _TickL
cpc _DelayMaxH, _TickH
brcs ISR_INT0_Error
sec
rjmp ISR_INT0_ShiftBit
ISR_INT0_Error:
rcall StopTimer
ser _State
rjmp ISR_INT0_Success
ISR_INT0_ShiftBit:
ldd 24, Y + moInt0B0
rol 24
std Y + moInt0B0, 24
ldd 24, Y + moInt0B1
rol 24
std Y + moInt0B1, 24
ldd 24, Y + moInt0B2
rol 24
std Y + moInt0B2, 24
ldd 24, Y + moInt0B3
rol 24
std Y + moInt0B3, 24
ISR_INT0_Success:
inc _State
cpi _State, 68
brne ISR_INT0_Success1
ldd 24, Y + moInt0B3
cpi 24, IrByte3
brne ISR_INT0_Error ; unknown command
ldd 24, Y + moInt0B2
cpi 24, IrByte2
brne ISR_INT0_Error ; unknown command
ldd 24, Y + moInt0B1
ldd 25, Y + moInt0B0
eor 25, 24
cpi 25, 0xff
brne ISR_INT0_Error ; unknown command
ldiw ZL, ISR_INT0_CodeToCmd
add ZL, 24
clr 24
adc ZH, 24
lpm 24, Z
cpi 24, 0xff
breq ISR_INT0_Error
mov _Cmd, 24
ldi 17, lo8(RAMEND)
out SPL, 17 ; Stack Pointer Low [0x3d]
ldi 17, hi8(RAMEND)
out SPH, 17 ; Stack Pointer High [0x3e]
ldi 17, 0
out SREG, r17 ; Status Register [0x3f]
rjmp MainInt0
ISR_INT0_Success1:
std Y + moInt0State, _State
out SREG, _SREG
pop ZH
pop ZL
pop YH
pop YL
pop 25
pop 24
pop 23
pop 22
pop _DelayMaxH
pop _DelayMaxL
pop _DelayMinH
pop _DelayMinL
pop _State
pop _INT0
pop _TickH
pop _TickL
pop _SREG
reti
;;; ========================================================================
;;; ISR TIMER0
;;; ========================================================================
;;; called at 50kHz / every 20us
.global ISR_TIMER0
_SREG = 17
ISR_TIMER0:
push _SREG
push 22
push 23
push 24
push 25
push ZL
push ZH
in _SREG, SREG
ldiw ZL, maTickCnt
ldd 24, Z+0 ; cnt now
ldd 25, Z+1
ldd 22, Z+2 ; cnt prev
ldd 23, Z+3
inc 24
std Z+0, 24
brne ISR_TIMER0_1
inc 25
std Z+1, 25
ISR_TIMER0_1:
sub 24, 22
sbc 25, 23
cpi 25, 2 ; timeout ~10ms
brcs ISR_TIMER0_2
out SREG, _SREG
pop ZH
pop ZL
pop 25
pop 24
pop 23
pop 22
pop _SREG
rjmp ISR_INT0
ISR_TIMER0_2:
out SREG, _SREG
pop ZH
pop ZL
pop 25
pop 24
pop 23
pop 22
pop _SREG
reti
;;; ========================================================================
;;; unsigned short GetTickCnt()
;;; ========================================================================
_SREG = 18
GetTickCnt:
push _SREG
in _SREG, SREG
cli
ldiw ZL, maTickCnt
ldd 24, Z+0 ; now
ldd 25, Z+1
ldd 22, Z+2 ; prev
ldd 23, Z+3
std Z+2, 24
std Z+3, 25
out SREG, _SREG
pop _SREG
ret
;;; ========================================================================
;;; StartTimer
;;; ========================================================================
StartTimer:
clr 24
ldiw ZL, maTickCnt
st Z+, 24 ; now
st Z+, 24
st Z+, 24 ; prev
st Z+, 24
out TCNT0, 24
ldi 24, 0x10
out TIFR, 24
out TIMSK, 24
ret
;;; ========================================================================
;;; StopTimer
;;; ========================================================================
StopTimer:
ldi 24, 0x00
out TIMSK, 24
ldi 24, 0x10
out TIFR, 24
ret
;;; ========================================================================
;;; void main()
;;; ========================================================================
.global Main
Main:
sbi LedDdr, LedIdx
sbi DbgDdr, DbgIdx
cbi DbgPrt, DbgIdx
clr _Zero
ldiw YL, maMain
movw 24, YL
rcall ParamLoad
movw 24, YL
rcall ParamFix
ldd 24, Y + moMainFuncSelNo
mov _Cmd, 24
com 24
std Y + moMainFuncSelNoPrev, 24
MainInt0:
ldiw YL, maMain
ldiw _LedMatrixAddrLo, maLedMatrixAddr ; LedMatrix RAM address
clr 24 ; reset Int0 States
ldiw ZL, maInt0
st Z+, 24
st Z+, 24
st Z+, 24
st Z+, 24
st Z+, 24
rcall StopTimer
mov 24, _Cmd
cpi 24, CmdEnd
brcs MainInt01
ldi 24, 0x00 ; red
ldi 22, 0x04 ; square
rcall _ZN9LedMatrix5BlinkEhh ; LedMatrix::Blink(col, mode)
ldiw 24, 0x0100
rcall Delay
rjmp MainCmdEnd
MainInt01:
ldip ZL, MainCmdJmpTab
add ZL, 24
adc ZH, _Zero
ijmp
MainCmdJmpTab:
rjmp MainCmdN ; 0
rjmp MainCmdN ; 1
rjmp MainCmdN ; 2
rjmp MainCmdN ; 3
rjmp MainCmdN ; 4
rjmp MainCmdN ; 5
rjmp MainCmdN ; 6
rjmp MainCmdN ; 7
rjmp MainCmdN ; 8
rjmp MainCmdN ; 9
rjmp MainCmdProgUp ; CH+ 10
rjmp MainCmdProgDown ; CH- 11
rjmp MainCmdSpeedUp ; + 12
rjmp MainCmdSpeedDown ; - 13
rjmp MainCmdBrightUp ; >>| 14
rjmp MainCmdBrightDown ; |<< 15
rjmp MainCmdSave ; EQ 16
rjmp MainCmdLoad ; CH 17
MainCmdN:
std Y + moMainFuncSelNo, _Cmd
MainCmdNewFunc:
ldiw ZL, MainFuncTable
ldd 24, Y + moMainFuncSelNo
ldd 25, Y + moMainFuncSelNoPrev
cp 24, 25
brne MainCmdNewFunc1
ldi 24, 0x01 ; green
ldi 22, 0x04 ; square
rjmp MainCmdBlink
MainCmdNewFunc1:
std Y + moMainFuncSelNoPrev, 24
lsl 24 ; 24 = 2*Idx
lsl 24 ; 24 = 4*Idx
lsl 24 ; 24 = 8*Idx = MainFuncTableEntrySize*Idx
add ZL, 24
adc ZH, _Zero
lpm 24, Z+ ; get constructor
lpm 25, Z+
lpm _FnUpdate, Z+ ; Update()
lpm _FnUpdate+1, Z+
lpm _FnDisplay, Z+ ; Display()
lpm _FnDisplay+1, Z+
lpm _FnConfig, Z+
lpm _FnConfig+1, Z+ ; Config(int type, int value)
movw ZL, 24
movw 24, _LedMatrixAddrLo
icall ; call constructor (with parameters)
movw 24, _LedMatrixAddrLo
ldi 22, ConfigBrightness
ldd 20, Y + moMainBrightness
movw ZL, _FnConfig
icall ; call <class>::Config(ConfigBrightness, brightness)
rjmp MainCmdEnd
MainCmdProgUp:
ldd 24, Y + moMainFuncSelNo
cpi 24, MainFuncTableSize - 1
brne MainCmdProgUp1
ldi 24, 0x00
std Y + moMainFuncSelNo, 24
rjmp MainCmdNewFunc
MainCmdProgUp1:
inc 24
std Y + moMainFuncSelNo, 24
rjmp MainCmdNewFunc
MainCmdProgDown:
ldd 24, Y + moMainFuncSelNo
cpi 24, 0x00
brne MainCmdProgDown1
ldi 24, MainFuncTableSize - 1
std Y + moMainFuncSelNo, 24
rjmp MainCmdNewFunc
MainCmdProgDown1:
dec 24
std Y + moMainFuncSelNo, 24
rjmp MainCmdNewFunc
MainCmdSpeedUp:
ldd 24, Y + moMainDelayLo
ldd 25, Y + moMainDelayHi
cpi 24, 0x40 ; min == 0x0040
brne MainCmdSpeedUp1
ldi 24, 0x00 ; red
ldi 22, 0x01 ; right
rjmp MainCmdBlink
MainCmdSpeedUp1:
lsr 25
ror 24
std Y + moMainDelayLo, 24
std Y + moMainDelayHi, 25
ldi 24, 0x01 ; green
ldi 22, 0x01 ; right
rjmp MainCmdBlink
MainCmdSpeedDown:
ldd 24, Y + moMainDelayLo
ldd 25, Y + moMainDelayHi
cpi 25, 0x80 ; max = 0x8000
brne MainCmdSpeedDown1
ldi 24, 0x00 ; red
ldi 22, 0x00 ; left
rjmp MainCmdBlink
MainCmdSpeedDown1:
lsl 24
rol 25
std Y + moMainDelayLo, 24
std Y + moMainDelayHi, 25
ldi 24, 0x01 ; green
ldi 22, 0x00 ; left
rjmp MainCmdBlink
MainCmdBrightUp:
ldd 24, Y + moMainBrightness
cpi 24, 0xff ; max = 0xff
brne MainCmdBrightUp1
ldi 24, 0x00 ; red
ldi 22, 0x02 ; top
rjmp MainCmdBlink
MainCmdBrightUp1:
subi 24, 0xf0 ; addi 24, 0x10
std Y + moMainBrightness, 24
movw 24, _LedMatrixAddrLo
ldi 22, ConfigBrightness
ldd 20, Y + moMainBrightness
movw ZL, _FnConfig
icall ; call <class>::Config(ConfigBrightness, brightness)
ldi 24, 0x01 ; green
ldi 22, 0x02 ; top
rjmp MainCmdBlink
MainCmdBrightDown:
ldd 24, Y + moMainBrightness
cpi 24, 0x1f ; min = 0x1f
brne MainCmdBrightDown1
ldi 24, 0x00 ; red
ldi 22, 0x03 ; bottom
rjmp MainCmdBlink
MainCmdBrightDown1:
subi 24, 0x10
std Y + moMainBrightness, 24
movw 24, _LedMatrixAddrLo
ldi 22, ConfigBrightness
ldd 20, Y + moMainBrightness
movw ZL, _FnConfig
icall ; call <class>::Config(ConfigBrightness, brightness)
ldi 24, 0x01 ; green
ldi 22, 0x03 ; bottom
rjmp MainCmdBlink
MainCmdSave:
ldi 24, 0x02 ; blue
ldi 22, 0x04 ; square
rcall _ZN9LedMatrix5BlinkEhh ; LedMatrix::Blink(col, mode)
movw 24, YL
rcall ParamSave
ldi 24, 0x02 ; blue
ldi 22, 0x04 ; square
rjmp MainCmdBlink
MainCmdLoad:
movw 24, YL
rcall ParamLoad
movw 24, YL
rcall ParamFix
rjmp MainCmdNewFunc
MainCmdBlink: ; 24: col, 22: mode
rcall _ZN9LedMatrix5BlinkEhh ; LedMatrix::Blink(col, mode)
ldiw 24, 0x0800
rcall Delay
movw 24, _LedMatrixAddrLo
ldi 22, ConfigForceRedraw
ldi 20, 0x00
movw ZL, _FnConfig
icall ; call <class>::Config(ConfigForceRedraw, dummy)
MainCmdEnd:
sei
MainLoop:
lds 24, maInt0 + moInt0State
tst 24
brne MainLoopDelay
movw r24, _LedMatrixAddrLo
movw ZL, _FnUpdate ; Update()
icall
movw r24, _LedMatrixAddrLo
movw ZL, _FnDisplay ; Display()
icall
MainLoopDelay:
; rcall DbgLed
ldd 24, Y + moMainDelayLo
ldd 25, Y + moMainDelayHi
rcall Delay
rjmp MainLoop
MainFuncTableSize = (MainFuncTableEnd - MainFuncTable) / MainFuncTableEntrySize
MainFuncTableEntrySize = 0x08
MainFuncTable:
.word pm(ConstColOff)
.word pm(_ZN8ConstCol6UpdateEv)
.word pm(_ZN8ConstCol7DisplayEv)
.word pm(_ZN8ConstCol6ConfigEhh)
.word pm(_ZN13LedMatrixBallC1Ev)
.word pm(_ZN13LedMatrixBall6UpdateEv)
.word pm(_ZN13LedMatrixBall7DisplayEv)
.word pm(_ZN13LedMatrixBall6ConfigEhh)
.word pm(_ZN4RainC1Ev)
.word pm(_ZN4Rain6UpdateEv)
.word pm(_ZN4Rain7DisplayEv)
.word pm(_ZN4Rain6ConfigEhh)
.word pm(Flow)
.word pm(_ZN4Flow6UpdateEv)
.word pm(_ZN4Flow7DisplayEv)
.word pm(_ZN4Flow6ConfigEhh)
.word pm(MultiCol2)
.word pm(_ZN8MultiCol6UpdateEv)
.word pm(_ZN8MultiCol7DisplayEv)
.word pm(_ZN8MultiCol6ConfigEhh)
.word pm(MultiCol1)
.word pm(_ZN8MultiCol6UpdateEv)
.word pm(_ZN8MultiCol7DisplayEv)
.word pm(_ZN8MultiCol6ConfigEhh)
.word pm(Pump1)
.word pm(_ZN4Pump6UpdateEv)
.word pm(_ZN4Pump7DisplayEv)
.word pm(_ZN4Pump6ConfigEhh)
.word pm(ConstColRed)
.word pm(_ZN8ConstCol6UpdateEv)
.word pm(_ZN8ConstCol7DisplayEv)
.word pm(_ZN8ConstCol6ConfigEhh)
.word pm(ConstColGreen)
.word pm(_ZN8ConstCol6UpdateEv)
.word pm(_ZN8ConstCol7DisplayEv)
.word pm(_ZN8ConstCol6ConfigEhh)
.word pm(ConstColBlue)
.word pm(_ZN8ConstCol6UpdateEv)
.word pm(_ZN8ConstCol7DisplayEv)
.word pm(_ZN8ConstCol6ConfigEhh)
.word pm(ConstColWhite1)
.word pm(_ZN8ConstCol6UpdateEv)
.word pm(_ZN8ConstCol7DisplayEv)
.word pm(_ZN8ConstCol6ConfigEhh)
.word pm(Pump0)
.word pm(_ZN4Pump6UpdateEv)
.word pm(_ZN4Pump7DisplayEv)
.word pm(_ZN4Pump6ConfigEhh)
MainFuncTableEnd:
Pump0:
ldi r22, 0x00
rjmp _ZN4PumpC1Eh ; Pump::Pump(0)
Pump1:
ldi r22, 0x01
rjmp _ZN4PumpC1Eh ; Pump::Pump(1)
Flow:
ldi r22, 0x01
rjmp _ZN4FlowC1Eh ; Flow::Flow()
ConstColRed:
ldi r22, 0xff
ldi r20, 0x00
ldi r18, 0x00
rjmp _ZN8ConstColC1Ehhh ; ConstCol::CosntCol(0xff, 0x00, 0x00)
ConstColGreen:
ldi r22, 0x00
ldi r20, 0xff
ldi r18, 0x00
rjmp _ZN8ConstColC1Ehhh ; ConstCol::CosntCol(0x00, 0xff, 0x00)
ConstColBlue:
ldi r22, 0x00
ldi r20, 0x00
ldi r18, 0xff
rjmp _ZN8ConstColC1Ehhh ; ConstCol::CosntCol(0x00, 0x00, 0xff)
ConstColWhite1:
ldi r22, 0x5f
ldi r20, 0x5f
ldi r18, 0x5f
rjmp _ZN8ConstColC1Ehhh ; ConstCol::CosntCol(0x5f, 0x5f, 0x5f)
ConstColOff:
ldi r22, 0x00
ldi r20, 0x00
ldi r18, 0x00
rjmp _ZN8ConstColC1Ehhh ; ConstCol::CosntCol(0x00, 0x00, 0x00)
MultiCol1:
ldi r22, 0x00
rjmp _ZN8MultiColC1Eh ; ConstCol::CosntCol(0x00, 0x00, 0x00)
MultiCol2:
ldi r22, 0x01
rjmp _ZN8MultiColC1Eh ; ConstCol::CosntCol(0x00, 0x00, 0x00)
;;; ========================================================================
;;; ParamLoad(MemMain*)
;;; ========================================================================
_MemMainLo = 12
_MemMainHi = 13
_EepromLo = 14
_EepromHi = 15
_SREG = 16
ParamLoad:
push _MemMainLo
push _MemMainHi
push _EepromLo
push _EepromHi
push _SREG
in _SREG, SREG
cli ; safe EEPROM access
movw _MemMainLo, 24
clr _EepromHi
clr _EepromLo
movw 24, _EepromLo
rcall EepromRead
movw ZL, _MemMainLo
std Z + moMainFuncSelNo, 24
inc _EepromLo
movw 24, _EepromLo
rcall EepromRead
movw ZL, _MemMainLo
std Z + moMainDelayLo, 24
inc _EepromLo
movw 24, _EepromLo
rcall EepromRead
movw ZL, _MemMainLo
std Z + moMainDelayHi, 24
inc _EepromLo
movw 24, _EepromLo
rcall EepromRead
movw ZL, _MemMainLo
std Z + moMainBrightness, 24
out SREG, _SREG
pop _SREG
pop _EepromHi
pop _EepromLo
pop _MemMainHi
pop _MemMainLo
ret
;;; ========================================================================
;;; ParamSave(MemMain*)
;;; ========================================================================
ParamSave:
push _MemMainLo
push _MemMainHi
push _EepromLo
push _EepromHi
push _SREG
in _SREG, SREG
cli ; safe EEPROM access
movw _MemMainLo, 24
clr _EepromHi
clr _EepromLo
movw 24, _EepromLo
movw ZL, _MemMainLo
ldd 22, Z + moMainFuncSelNo
rcall EepromWrite
inc _EepromLo
movw 24, _EepromLo
movw ZL, _MemMainLo
ldd 22, Z + moMainDelayLo
rcall EepromWrite
inc _EepromLo
movw 24, _EepromLo
movw ZL, _MemMainLo
ldd 22, Z + moMainDelayHi
rcall EepromWrite
inc _EepromLo
movw 24, _EepromLo
movw ZL, _MemMainLo
ldd 22, Z + moMainBrightness
rcall EepromWrite
out SREG, _SREG
pop _SREG
pop _EepromHi
pop _EepromLo
pop _MemMainHi
pop _MemMainLo
ret
;;; ========================================================================
;;; ParamInit(MemMain*)
;;; ========================================================================
ParamInit:
movw ZL, 24
ldi 24, 0x04
std Z + moMainFuncSelNo, 24
ldi 24, 0x00
std Z + moMainDelayLo, 24
ldi 24, 0x02
std Z + moMainDelayHi, 24
ldi 24, 0x7f
std Z + moMainBrightness, 24
ret
;;; ========================================================================
;;; ParamFix(MemMain*)
;;; ========================================================================
ParamFix:
movw ZL, 24
ldd 24, Z + moMainFuncSelNo
cpi 24, MainFuncTableSize
brcc ParamFixErr
ldd 24, Z + moMainDelayLo
ldd 25, Z + moMainDelayHi
clr 22
ldi 23, 8
ParamFix1b:
lsl 24
brcc ParamFix1a
inc 22
ParamFix1a:
dec 23
brne ParamFix1b
ldi 23, 8
ParamFix2b:
lsl 25
brcc ParamFix2a
inc 22
ParamFix2a:
dec 23
brne ParamFix2b
cpi 22, 0x01
brne ParamFixErr
ldd 24, Z + moMainBrightness
mov 23, 24
andi 23, 0x0f
cpi 23, 0x0f
brne ParamFixErr
cpi 24, 0x1f
brcs ParamFixErr
ret
ParamFixErr:
push _MemMainLo
push _MemMainHi
movw _MemMainLo, ZL
movw 24, _MemMainLo
rcall ParamInit
movw 24, _MemMainLo
rcall ParamSave
pop _MemMainHi
pop _MemMainLo
ret
;;; ========================================================================
;;; void SendDataRGB(unsigned char r, unsigned char g, unsigned char b)
;;; ========================================================================
.global SendDataRGB
SendDataRGB:
push 16
push 20
push 24
in 16, SREG
cli
mov 24, 22
rcall SendDataByte
pop 24
rcall SendDataByte
pop 24
rcall SendDataByte
out SREG, 16
pop 16
ret
;;; ========================================================================
;;; void SendDataByte(unsigned char byte)
;;; ========================================================================
.macro nops cnt=2
nop
.if \cnt-1
nops \cnt-1
.endif
.endm
.global SendDataByte
_BitCnt = 22
_Byte = 24
SendDataByte:
ldi _BitCnt, 8
BitLoop:
lsl _Byte ; 1
brcs B1 ; 1 / 2
;;; ========================================================================
;;; WS2812
;;; ========================================================================
.if 1
;;; Bit HIGH LOW 16MHz 20MHz
;;; 0 350ns 800ns 5.6/12.8 7/16
;;; 1 700ns 600ns 11.2/9.6 14/12
B0:
sbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:4
nops 4
.elseif MCUclock == 20000000 ; 20MHz:5
nops 5
.else
.error
.endif
cbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:4
nops 4
.elseif MCUclock == 20000000 ; 20MHZ:7
nops 7
.endif
rjmp BitDec ; 2
B1:
sbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:9
nops 9
.elseif MCUclock == 20000000 ; 20MHz:12
nops 12
.endif
cbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:2
nops 2
.elseif MCUclock == 20000000 ; 20MHZ:5
nops 5
.endif
.endif
;;; WS2812
;;; ========================================================================
;;; ========================================================================
;;; WS2812B
;;; ========================================================================
.if 0
;;; Bit HIGH LOW 16MHz 20MHz
;;; 0 400ns 850ns 6.4/13.6 8/17
;;; 1 800ns 450ns 12.8/7.2 16/9
B0:
sbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:4
nops 4
.elseif MCUclock == 20000000 ; 20MHz:6
nops 6
.endif
cbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:5
nops 5
.elseif MCUclock == 20000000 ; 20MHZ:8
nops 8
.endif
rjmp BitDec ; 2
B1:
sbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:11
nops 11
.elseif MCUclock == 20000000 ; 20MHz:14
nops 14
.endif
cbi LedPrt, LedIdx ; 2
.if MCUclock == 16000000 ; 16MHz:0
;nops 2
.elseif MCUclock == 20000000 ; 20MHZ:2
nops 2
.endif
.endif
;;; WS2812B
;;; ========================================================================
BitDec: dec _BitCnt ; 1
brne BitLoop ; 2|1
ret
;;; ========================================================================
;;; unsigned char EepromRead(addr*)
;;; ========================================================================
.global EepromRead
EepromRead:
sbic EECR, EECR_EEPE
rjmp EepromRead
out EEARH, 25
out EEARL, 24
sbi EECR, EECR_EERE
in 24, EEDR
ret
;;; ========================================================================
;;; void EepromWrite(addr*, byte)
;;; ========================================================================
.global EepromWrite
EepromWrite:
sbic EECR, EECR_EEPE
rjmp EepromWrite
out EEARH, 25
out EEARL, 24
out EEDR, 22
sbi EECR, EECR_EEMPE
sbi EECR, EECR_EEPE
ret
;;; ========================================================================
;;; unsigned char Rnd()
;;; ========================================================================
.global Rnd
LL = 24
LH = 25
HL = 26
HH = 27
FB = 22 ; feed back
Tmp = 23
Cnt = 20
Rnd: ; LFSR 32bit
ldiw ZL, maMain + moMainRndVal
ldd LL, Z+0
ldd LH, Z+1
ldd HL, Z+2
ldd HH, Z+3
ldi Cnt, 8
Rnd1:
mov FB, LL ; tap 32
bst LL, 2 ; tap 30
bld Tmp, 0
eor FB, Tmp
bst LL, 6 ; tap 26
bld Tmp, 0
eor FB, Tmp
bst LL, 7 ; tap 25
bld Tmp, 0
eor FB, Tmp
ror FB
ror HH
ror HL
ror LH
ror LL
dec Cnt
brne Rnd1
std Z+0, LL
std Z+1, LH
std Z+2, HL
std Z+3, HH
;; 24 == LL
ret
;;; ========================================================================
;;; void Delay()
;;; 24:25 delay
;;; ========================================================================
Delay:
clr 22
DelayLoop:
dec 22
brne DelayLoop
sbiw 24, 0x01
brne DelayLoop
ret
;;; ========================================================================
;;; DbgLed
;;; ========================================================================
.if 0
DbgLed:
push 16
push 17
ldiw 24, 0x0040
rcall Delay
in 16, SPH
rcall DbgLedByte
in 16, SPL
rcall DbgLedByte
mov 16, YH
rcall DbgLedByte
mov 16, YL
rcall DbgLedByte
ldd 16, Y + moMainFuncSelNo
rcall DbgLedByte
ldiw 24, 0x0000
rcall EepromRead
mov 16, 24
rcall DbgLedByte
ldd 16, Y + moMainBrightness
rcall DbgLedByte
ldiw 24, 0x0003
rcall EepromRead
mov 16, 24
rcall DbgLedByte
pop 17
pop 16
ret
DbgLedByte:
ldi 17, 0x08
DbgLedByte1:
rcall DbgLedBit
dec 17
brne DbgLedByte1
ret
DbgLedBit:
lsl 16
brcc DbgLedBit0
DbgLedBit1:
ldi 24, 0x0f
ldi 22, 0x00
ldi 20, 0x00
rjmp SendDataRGB
DbgLedBit0:
ldi 24, 0x00
ldi 22, 0x00
ldi 20, 0x0f
rjmp SendDataRGB
.endif
;;; ========================================================================
;;; DbgWord, DbgByte
;;; ========================================================================
.if 0
.global DbgWord
DbgWord:
push 25
push 24
push 24
mov 24, 25
rcall DbgByte
pop 24
rcall DbgByte
pop 24
pop 25
ret
.global DbgByte
DbgByte:
push 24
sbi DbgPin, DbgIdx
sbi DbgPin, DbgIdx
rcall DbgBit
rcall DbgBit
rcall DbgBit
rcall DbgBit
rcall DbgBit
rcall DbgBit
rcall DbgBit
rcall DbgBit
pop 24
ret
DbgBit:
lsl 24
brcc DbgBit1
dbg 2
ret
DbgBit1:
dbg
nop
nop
ret
.endif
;;; ========================================================================
;;; EOF
;;; ========================================================================
|
books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/9_8.asm | gxw1/review_the_national_post-graduate_entrance_examination | 640 | 173823 | <filename>books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/9_8.asm
CODE SEGMENT
ASSUME CS:CODE
START: MOV AH,0
INT 16H
CMP AL,32H
JC START
CMP AL,39H
JNC START
AND AL,0FH
MOV CL,AL
MOV CH,0
A1: MOV DL,0DH
MOV AH,2
INT 21H
MOV DL,0AH
MOV AH,2
INT 21H
INC CH
CMP CL,CH
JNC A2
MOV AH,4CH
INT 21H
A2: XOR CL,CL
A3: MOV DL,'*'
MOV AH,2
INT 21H
INC CL
CMP CL,CH
JNZ A3
JMP A1
CODE ENDS
END START
|
Assignment-3/access-re-egghunter.nasm | xMilkPowderx/SLAE-Code | 1 | 24831 | <gh_stars>1-10
;Filename: access-re-egghunter.nasm
;Author: <NAME>
;Student ID: SLAE-1470
;SLAE-Exercise 3
global _start
section .text
_start:
xor edx,edx
setup:
or dx,0xfff
next_address:
inc edx
lea ebx,[edx+0x4] #Actually an optimization
push byte +0x21
pop eax
int 0x80
cmp al, 0xf2
jz setup
mov eax, 0x746F6F72
mov edi, edx
scasd
jnz next_address
scasd
jnz next_address
jmp edi
|
data/mapHeaders/Route22.asm | AmateurPanda92/pokemon-rby-dx | 9 | 162499 | <reponame>AmateurPanda92/pokemon-rby-dx
Route22_h:
db OVERWORLD ; tileset
db ROUTE_22_HEIGHT, ROUTE_22_WIDTH ; dimensions (y, x)
dw Route22_Blocks ; blocks
dw Route22_TextPointers ; texts
dw Route22_Script ; scripts
db NORTH | EAST ; connections
NORTH_MAP_CONNECTION ROUTE_22, ROUTE_23, 0, 0, Route23_Blocks
EAST_MAP_CONNECTION ROUTE_22, VIRIDIAN_CITY, -3, 1, ViridianCity_Blocks, 1
dw Route22_Object ; objects
|
alloy4fun_models/trashltl/models/9/B4T8ci8nEiikCCCDZ.als | Kaixi26/org.alloytools.alloy | 0 | 3226 | open main
pred idB4T8ci8nEiikCCCDZ_prop10 {
always all f:File | f in Protected implies always f in Protected
}
pred __repair { idB4T8ci8nEiikCCCDZ_prop10 }
check __repair { idB4T8ci8nEiikCCCDZ_prop10 <=> prop10o } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.