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 |
|---|---|---|---|---|
demos/pi.ada | daveshields/AdaEd | 3 | 1603 | generic
type real is digits <>;
function sqrt(y : real) return real;
function sqrt(y : real) return real is
x, t : real := y;
begin
if y < 0.0 then
raise NUMERIC_ERROR;
else
loop
t := (x + y / x)/ 2.0;
exit when abs(x - t) <= real'epsilon;
x := t;
end loop;
return x;
end if;
end sqrt;
with sqrt;
with text_io; use text_io;
procedure main is
package real_io is new FLOAT_IO(float);
use real_io;
package int_io is new INTEGER_IO(integer);
use int_io;
epsilon : constant := float'epsilon;
function sqrt is new sqrt(float);
procedure pi_comp is
pi : float := 1.0;
n : integer := 1;
temp : float;
sum : float := 1.0;
begin
loop
n := n + 2;
temp := 1.0 / float(n) ** 4;
put("Term number ");
put((n + 1)/2);
put(" is: ");
put(temp);
new_line;
exit when temp <= epsilon;
sum := sum + temp;
end loop;
put("The sum is: ");
put(sum);
new_line;
pi := sqrt(sqrt(96.0 * sum));
put("The value of PI is ");
put(pi);
new_line;
end pi_comp;
begin
pi_comp;
end main;
|
MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm | kokweich/slimbootloader | 9 | 160356 | <reponame>kokweich/slimbootloader<filename>MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; ARShiftU64.nasm
;
; Abstract:
;
; 64-bit arithmetic right shift function for IA-32
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; InternalMathARShiftU64 (
; IN UINT64 Operand,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
global ASM_PFX(InternalMathARShiftU64)
ASM_PFX(InternalMathARShiftU64):
mov cl, [esp + 12]
mov eax, [esp + 8]
cdq
test cl, 32
jnz .0
mov edx, eax
mov eax, [esp + 4]
.0:
shrd eax, edx, cl
sar edx, cl
ret
|
oeis/002/A002241.asm | neoneye/loda-programs | 11 | 170302 | <reponame>neoneye/loda-programs
; A002241: 10th powers written backwards.
; 0,1,4201,94095,6758401,5265679,67166406,942574282,4281473701,1044876843,1,10642473952,42246371916,948194858731,679456452982,526093056675,6777261159901,9440093995102,4266227640753,1087526601316,4201,10287908897661,42419722995562,94631211562414,67356908330436,52604613476359,673356590761141,946490231198502,424596667691692,102003332707024,94095,108089682826918,4262486099985211,9444625898751351,6779504577734602,5265153537458572,6792600448516563,9487142734858084,4228897481128726,1061915806040418
pow $0,10
lpb $0
mul $1,10
mov $2,$0
div $0,10
mod $2,10
add $1,$2
lpe
mov $0,$1
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_21829_1824.asm | ljhsiun2/medusa | 9 | 241179 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_21829_1824.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x36d2, %rbp
nop
nop
nop
nop
sub %r13, %r13
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_A_ht+0x9570, %rsi
lea addresses_WC_ht+0x1dd30, %rdi
nop
nop
cmp %rax, %rax
mov $13, %rcx
rep movsw
nop
nop
nop
inc %rbp
lea addresses_normal_ht+0xb470, %rcx
cmp $34622, %rax
movb $0x61, (%rcx)
sub $48142, %r9
lea addresses_A_ht+0xbb70, %rax
nop
nop
nop
sub $45337, %r13
mov (%rax), %si
nop
nop
nop
nop
nop
xor $38429, %r9
lea addresses_UC_ht+0x3db0, %rsi
nop
lfence
mov (%rsi), %ecx
nop
nop
nop
nop
inc %rcx
lea addresses_WC_ht+0x15170, %rdi
nop
nop
dec %r9
movb (%rdi), %cl
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0x16102, %r13
nop
nop
nop
nop
cmp %rcx, %rcx
and $0xffffffffffffffc0, %r13
vmovntdqa (%r13), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x12750, %r13
nop
nop
nop
dec %rsi
and $0xffffffffffffffc0, %r13
vmovaps (%r13), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rbp
nop
nop
nop
nop
dec %rcx
lea addresses_normal_ht+0x7d90, %r13
nop
sub %rax, %rax
mov $0x6162636465666768, %rcx
movq %rcx, (%r13)
nop
add $45457, %rdi
lea addresses_UC_ht+0x5b70, %rax
dec %rsi
mov (%rax), %r13
nop
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x3a55, %rdi
nop
nop
nop
nop
nop
xor $29340, %rax
mov (%rdi), %cx
xor $16431, %rsi
lea addresses_A_ht+0xc5aa, %rax
clflush (%rax)
sub %rbp, %rbp
vmovups (%rax), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x15070, %rcx
nop
nop
nop
xor %rsi, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
cmp %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r9
push %rbx
push %rcx
push %rdx
// Store
lea addresses_US+0x6370, %r9
nop
cmp $51347, %r13
movb $0x51, (%r9)
sub %r10, %r10
// Store
mov $0xb70, %r9
cmp $55985, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, (%r9)
nop
nop
nop
nop
nop
add %r10, %r10
// Store
lea addresses_D+0x9b70, %r9
nop
nop
nop
sub %r12, %r12
movl $0x51525354, (%r9)
sub %r10, %r10
// Faulty Load
lea addresses_WT+0x1370, %rdx
nop
nop
nop
nop
nop
xor %r13, %r13
mov (%rdx), %rbx
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': True, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': True, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': True, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 8}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
test/interaction/Issue1996.agda | shlevy/agda | 1,989 | 14639 | open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
test : (x : Nat) (f : {n : Nat} → Nat) → f {0} ≡ x → Nat
test x f p = {!p!}
|
src/is-free.agda | xoltar/cedille | 0 | 8227 | module is-free where
open import lib
open import cedille-types
open import ctxt-types
open import syntax-util
open import general-util
are-free-e = 𝔹
check-erased = tt
skip-erased = ff
are-free-in-t : Set → Set₁
are-free-in-t T = ∀{A} → are-free-e → trie A → T → 𝔹
are-free-in-term : are-free-in-t term
are-free-in-type : are-free-in-t type
are-free-in-kind : are-free-in-t kind
are-free-in-optClass : are-free-in-t optClass
-- are-free-in-optType : are-free-in-t optType
are-free-in-optTerm : are-free-in-t optTerm
are-free-in-optGuide : are-free-in-t optGuide
are-free-in-tk : are-free-in-t tk
are-free-in-liftingType : are-free-in-t liftingType
are-free-in-optType : are-free-in-t optType
are-free-in-args : are-free-in-t args
are-free-in-cases : are-free-in-t cases
are-free-in-varargs : are-free-in-t varargs
are-free-in-term ce x (App t Erased t') = are-free-in-term ce x t || (ce && are-free-in-term ce x t')
are-free-in-term ce x (App t NotErased t') = are-free-in-term ce x t || are-free-in-term ce x t'
are-free-in-term ce x (AppTp t tp) = are-free-in-term ce x t || (ce && are-free-in-type ce x tp)
are-free-in-term ce x (Hole x₁) = ff
are-free-in-term ce x (Lam _ b _ x' oc t) =
(ce && are-free-in-optClass ce x oc)
|| are-free-in-term ce (trie-remove x x') t
are-free-in-term ce x (Let _ (DefTerm _ x' m t) t') =
(ce && are-free-in-optType ce x m)
|| (are-free-in-term ce x t)
|| are-free-in-term ce (trie-remove x x') t'
are-free-in-term ce x (Let _ (DefType _ x' k t) t') =
(ce && (are-free-in-kind ce x k || are-free-in-type ce x t))
|| are-free-in-term ce (trie-remove x x') t'
are-free-in-term ce x (Open _ _ t) = are-free-in-term ce x t -- return the same answer as the erasure of (Open ...)
are-free-in-term ce x (Parens x₁ t x₂) = are-free-in-term ce x t
are-free-in-term ce x (Var _ "_") = ff
are-free-in-term ce x (Var _ x') = trie-contains x x'
are-free-in-term ce x (Beta _ ot ot') = are-free-in-optTerm ce x ot' || (ce && are-free-in-optTerm ce x ot)
are-free-in-term ce x (IotaPair _ t1 t2 ot _) = are-free-in-term ce x t1 || (ce && (are-free-in-term ce x t2 || are-free-in-optGuide ce x ot))
are-free-in-term ce x (IotaProj t n _) = are-free-in-term ce x t
are-free-in-term ce x (Epsilon _ _ _ t) = are-free-in-term ce x t
are-free-in-term ce x (Sigma _ t) = are-free-in-term ce x t
are-free-in-term ce x (Phi _ t t₁ t₂ _) = (ce && are-free-in-term ce x t) || (ce && are-free-in-term ce x t₁) || are-free-in-term ce x t₂
are-free-in-term ce x (Rho _ _ _ t ot t') = (ce && (are-free-in-term ce x t || are-free-in-optGuide ce x ot)) || are-free-in-term ce x t'
are-free-in-term ce x (Chi _ T t') = (ce && are-free-in-optType ce x T) || are-free-in-term ce x t'
are-free-in-term ce x (Delta _ T t') = ce && (are-free-in-optType ce x T || are-free-in-term ce x t')
are-free-in-term ce x (Theta _ _ t ls) = are-free-in-term ce x t || are-free-in-lterms ce x ls
where are-free-in-lterms : ∀{A} → are-free-e → trie A → lterms → 𝔹
are-free-in-lterms ce x (LtermsNil _) = ff
are-free-in-lterms ce x (LtermsCons Erased t ls) = (ce && are-free-in-term ce x t) || are-free-in-lterms ce x ls
are-free-in-lterms ce x (LtermsCons NotErased t ls) = are-free-in-term ce x t || are-free-in-lterms ce x ls
are-free-in-term ce x (Mu _ x' t ot _ cs _) = (ce && are-free-in-optType ce x ot) || are-free-in-term ce (trie-remove x x') t || are-free-in-cases ce x cs
are-free-in-term ce x (Mu' _ t ot _ cs _) = (ce && are-free-in-optType ce x ot) || are-free-in-term ce x t || are-free-in-cases ce x cs
are-free-in-cases _ _ NoCase = ff
are-free-in-cases ce x (SomeCase _ c varargs t cs) = are-free-in-varargs ce x varargs || are-free-in-term ce x t || are-free-in-cases ce x cs
are-free-in-varargs ce x NoVarargs = ff
are-free-in-varargs ce x (NormalVararg x' args) = trie-contains x x' || are-free-in-varargs ce x args
are-free-in-varargs ce x (ErasedVararg x' args) = (ce && trie-contains x x') || are-free-in-varargs ce x args
are-free-in-varargs ce x (TypeVararg x' args) = (ce && trie-contains x x') || are-free-in-varargs ce x args
{-# TERMINATING #-}
are-free-in-type ce x (Abs _ _ _ x' atk t) = are-free-in-tk ce x atk || are-free-in-type ce (trie-remove x x') t
are-free-in-type ce x (TpLambda _ _ x' atk t) = are-free-in-tk ce x atk || are-free-in-type ce (trie-remove x x') t
are-free-in-type ce x (Iota _ _ x' m t) = are-free-in-type ce x m || are-free-in-type ce (trie-remove x x') t
are-free-in-type ce x (Lft _ _ X t l) = are-free-in-liftingType ce x l || are-free-in-term ce (trie-remove x X) t
are-free-in-type ce x (TpApp t t') = are-free-in-type ce x t || are-free-in-type ce x t'
are-free-in-type ce x (TpAppt t t') = are-free-in-type ce x t || are-free-in-term ce x t'
are-free-in-type ce x (TpArrow t _ t') = are-free-in-type ce x t || are-free-in-type ce x t'
are-free-in-type ce x (TpEq _ t t' _) = are-free-in-term ce x t || are-free-in-term ce x t'
are-free-in-type ce x (TpParens x₁ t x₂) = are-free-in-type ce x t
are-free-in-type ce x (TpVar _ "_") = ff
are-free-in-type ce x (TpVar _ x') = trie-contains x x'
are-free-in-type ce x (NoSpans t _) = are-free-in-type ce x t
are-free-in-type ce x (TpHole _) = ff
are-free-in-type ce x (TpLet _ (DefTerm _ x' m t) T) =
(ce && are-free-in-optType ce x m)
|| (are-free-in-term ce x t)
|| are-free-in-type ce (trie-remove x x') T
are-free-in-type ce x (TpLet _ (DefType _ x' k T) T') =
(ce && (are-free-in-kind ce x k || are-free-in-type ce x T))
|| are-free-in-type ce (trie-remove x x') T'
are-free-in-kind ce x (KndArrow k k') = are-free-in-kind ce x k || are-free-in-kind ce x k'
are-free-in-kind ce x (KndParens x₁ k x₂) = are-free-in-kind ce x k
are-free-in-kind ce x (KndPi _ _ x' atk k) = are-free-in-tk ce x atk || are-free-in-kind ce (trie-remove x x') k
are-free-in-kind ce x (KndTpArrow t k) = are-free-in-type ce x t || are-free-in-kind ce x k
are-free-in-kind ce x (KndVar _ x' ys) = trie-contains x x' || are-free-in-args ce x ys
are-free-in-kind ce x (Star x₁) = ff
are-free-in-args ce x (ArgsCons (TermArg _ y) ys) = are-free-in-term ce x y || are-free-in-args ce x ys
are-free-in-args ce x (ArgsCons (TypeArg y) ys) = are-free-in-type ce x y || are-free-in-args ce x ys
are-free-in-args ce x ArgsNil = ff
are-free-in-optClass ce x NoClass = ff
are-free-in-optClass ce x (SomeClass atk) = are-free-in-tk ce x atk
are-free-in-optType ce x NoType = ff
are-free-in-optType ce x (SomeType t) = are-free-in-type ce x t
are-free-in-optTerm ce x NoTerm = ff
are-free-in-optTerm ce x (SomeTerm t _) = are-free-in-term ce x t
are-free-in-optGuide ce x NoGuide = ff
are-free-in-optGuide ce x (Guide _ v tp) = are-free-in-type ce (trie-remove x v) tp
are-free-in-tk ce x (Tkt t) = are-free-in-type ce x t
are-free-in-tk ce x (Tkk k) = are-free-in-kind ce x k
are-free-in-liftingType ce x (LiftArrow l l') = are-free-in-liftingType ce x l || are-free-in-liftingType ce x l'
are-free-in-liftingType ce x (LiftParens x₁ l x₂) = are-free-in-liftingType ce x l
are-free-in-liftingType ce x (LiftPi _ x' t l) =
are-free-in-type ce x t || are-free-in-liftingType ce (trie-remove x x') l
are-free-in-liftingType ce x (LiftStar x₁) = ff
are-free-in-liftingType ce x (LiftTpArrow t l) = are-free-in-type ce x t || are-free-in-liftingType ce x l
are-free-in : {ed : exprd} → are-free-e → stringset → ⟦ ed ⟧ → 𝔹
are-free-in{TERM} e x t = are-free-in-term e x t
are-free-in{ARG} e x (TermArg _ t) = are-free-in-term e x t
are-free-in{TYPE} e x t = are-free-in-type e x t
are-free-in{ARG} e x (TypeArg t) = are-free-in-type e x t
are-free-in{KIND} e x t = are-free-in-kind e x t
are-free-in{TK} e x t = are-free-in-tk e x t
are-free-in{LIFTINGTYPE} e x t = are-free-in-liftingType e x t
are-free-in{QUALIF} e x (x' , as) = trie-contains x x' || are-free-in-args e x as
is-free-in : {ed : exprd} → are-free-e → var → ⟦ ed ⟧ → 𝔹
is-free-in{TERM} e x t = are-free-in-term e (stringset-singleton x) t
is-free-in{ARG} e x (TermArg _ t) = are-free-in-term e (stringset-singleton x) t
is-free-in{TYPE} e x t = are-free-in-type e (stringset-singleton x) t
is-free-in{ARG} e x (TypeArg t) = are-free-in-type e (stringset-singleton x) t
is-free-in{KIND} e x t = are-free-in-kind e (stringset-singleton x) t
is-free-in{LIFTINGTYPE} e x t = are-free-in-liftingType e (stringset-singleton x) t
is-free-in{QUALIF} e x (x' , as) = x =string x' || are-free-in-args e (stringset-singleton x) as
is-free-in{TK} e x t = are-free-in-tk e (stringset-singleton x) t
abs-tk : maybeErased → var → tk → type → type
abs-tk me x (Tkk k) tp = Abs posinfo-gen Erased posinfo-gen x (Tkk k) tp
abs-tk me x (Tkt tp') tp with are-free-in check-erased (stringset-singleton x) tp
abs-tk me x (Tkt tp') tp | tt = Abs posinfo-gen me posinfo-gen x (Tkt tp') tp
abs-tk me x (Tkt tp') tp | ff = TpArrow tp' me tp
absk-tk : var → tk → kind → kind
absk-tk x atk k with are-free-in check-erased (stringset-singleton x) k
absk-tk x atk k | tt = KndPi posinfo-gen posinfo-gen x atk k
absk-tk x (Tkt tp) k | ff = KndTpArrow tp k
absk-tk x (Tkk k') k | ff = KndArrow k' k
data abs : Set where
mk-abs : maybeErased → var → tk → (var-free-in-body : 𝔹) → type → abs
to-abs : type → maybe abs
to-abs (Abs _ me _ x atk tp) = just (mk-abs me x atk (are-free-in check-erased (stringset-singleton x) tp) tp)
to-abs (TpArrow tp1 me tp2) = just (mk-abs me dummy-var (Tkt tp1) ff tp2)
to-abs _ = nothing
record is-tpabs : Set where
constructor mk-tpabs
field
is-tpabs-e? : maybeErased
is-tpabs-var : var
is-tpabs-kind : kind
is-tpabs-body : type
open is-tpabs public
is-tpabs? = type ∨ is-tpabs
pattern yes-tpabs e? x k tp = inj₂ (mk-tpabs e? x k tp)
pattern not-tpabs tp = inj₁ tp
to-is-tpabs : type → is-tpabs?
to-is-tpabs tp with to-abs tp
... | nothing =
not-tpabs tp
... | just (mk-abs _ _ (Tkt _) _ _)
= not-tpabs tp
... | just (mk-abs e? x (Tkk k) var-free-in-body tp') =
yes-tpabs e? x k tp'
data absk : Set where
mk-absk : var → tk → (var-free-in-body : 𝔹) → kind → absk
to-absk : kind → maybe absk
to-absk (KndPi _ _ x atk k) = just (mk-absk x atk (are-free-in check-erased (stringset-singleton x) k) k)
to-absk (KndArrow k1 k2) = just (mk-absk dummy-var (Tkk k1) ff k2)
to-absk (KndTpArrow tp k) = just (mk-absk dummy-var (Tkt tp) ff k)
to-absk _ = nothing
record is-tmabs : Set where
constructor mk-tmabs
field
is-tmabs-binder : maybeErased
is-tmabs-var : var
is-tmabs-dom : type
is-tmabs-var-in-body : 𝔹
is-tmabs-cod : type
open is-tmabs public
is-tmabs? = type ∨ is-tmabs
pattern yes-tmabs e? x dom occurs cod = inj₂ (mk-tmabs e? x dom occurs cod)
pattern not-tmabs tp = inj₁ tp
to-is-tmabs : type → is-tmabs?
to-is-tmabs (Abs _ e? _ x (Tkt dom) cod) =
yes-tmabs e? x dom (is-free-in check-erased x cod) cod
to-is-tmabs (TpArrow dom e? cod) =
yes-tmabs e? "_" dom ff cod
to-is-tmabs tp = not-tmabs tp
from-is-tmabs : is-tmabs → type
from-is-tmabs (mk-tmabs b x dom occ cod) =
Abs posinfo-gen b posinfo-gen x (Tkt dom) cod
|
datatypes-safe.agda | rfindler/ial | 29 | 8369 | <filename>datatypes-safe.agda
module datatypes-safe where
open import bool public
open import integer public
open import list public
open import level public
open import maybe public
open import nat public
open import nat-division public
open import product public
open import sum public
open import tree public
open import trie public
open import unit public
open import vector public
|
alloy4fun_models/trashltl/models/15/K4oqwpxkYQzRjKi5E.als | Kaixi26/org.alloytools.alloy | 0 | 389 | <filename>alloy4fun_models/trashltl/models/15/K4oqwpxkYQzRjKi5E.als
open main
pred idK4oqwpxkYQzRjKi5E_prop16 {
all f: File | eventually f in Protected implies historically f in Protected
}
pred __repair { idK4oqwpxkYQzRjKi5E_prop16 }
check __repair { idK4oqwpxkYQzRjKi5E_prop16 <=> prop16o } |
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_next_free_fastcall.asm | meesokim/z88dk | 0 | 174311 |
; void *obstack_next_free_fastcall(struct obstack *ob)
SECTION code_alloc_obstack
PUBLIC _obstack_next_free_fastcall
_obstack_next_free_fastcall:
INCLUDE "alloc/obstack/z80/asm_obstack_next_free.asm"
|
stm32f4/stm32f411xx/svd/stm32_svd-interrupts.ads | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 9397 | <filename>stm32f4/stm32f411xx/svd/stm32_svd-interrupts.ads
-- This spec has been automatically generated from STM32F411xx.svd
-- Definition of the device's interrupts
package STM32_SVD.Interrupts is
----------------
-- Interrupts --
----------------
-- PVD through EXTI line detection interrupt
PVD : constant := 1;
-- Tamper and TimeStamp interrupts through the EXTI line
TAMP_STAMP : constant := 2;
-- RTC Wakeup interrupt through the EXTI line
RTC_WKUP : constant := 3;
-- FLASH global interrupt
FLASH : constant := 4;
-- RCC global interrupt
RCC : constant := 5;
-- EXTI Line0 interrupt
EXTI0 : constant := 6;
-- EXTI Line1 interrupt
EXTI1 : constant := 7;
-- EXTI Line2 interrupt
EXTI2 : constant := 8;
-- EXTI Line3 interrupt
EXTI3 : constant := 9;
-- EXTI Line4 interrupt
EXTI4 : constant := 10;
-- ADC1 global interrupt
ADC : constant := 18;
-- EXTI Line[9:5] interrupts
EXTI9_5 : constant := 23;
-- TIM1 Break interrupt and TIM9 global interrupt
TIM1_BRK_TIM9 : constant := 24;
-- TIM1 Update interrupt and TIM10 global interrupt
TIM1_UP_TIM10 : constant := 25;
-- TIM1 Trigger and Commutation interrupts and TIM11 global interrupt
TIM1_TRG_COM_TIM11 : constant := 26;
-- TIM1 Capture Compare interrupt
TIM1_CC : constant := 27;
-- TIM2 global interrupt
TIM2 : constant := 28;
-- TIM3 global interrupt
TIM3 : constant := 29;
-- I2C1 event interrupt
I2C1_EV : constant := 31;
-- I2C1 error interrupt
I2C1_ER : constant := 32;
-- I2C2 event interrupt
I2C2_EV : constant := 33;
-- I2C2 error interrupt
I2C2_ER : constant := 34;
-- SPI1 global interrupt
SPI1 : constant := 35;
-- SPI2 global interrupt
SPI2 : constant := 36;
-- EXTI Line[15:10] interrupts
EXTI15_10 : constant := 40;
-- RTC Alarms (A and B) through EXTI line interrupt
RTC_Alarm : constant := 41;
-- USB On-The-Go FS Wakeup through EXTI line interrupt
OTG_FS_WKUP : constant := 42;
-- SDIO global interrupt
SDIO : constant := 49;
-- SPI3 global interrupt
SPI3 : constant := 51;
-- USB On The Go FS global interrupt
OTG_FS : constant := 67;
-- I2C3 event interrupt
I2C3_EV : constant := 72;
-- I2C3 error interrupt
I2C3_ER : constant := 73;
-- SPI4 global interrupt
SPI4 : constant := 84;
end STM32_SVD.Interrupts;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_62.asm | ljhsiun2/medusa | 9 | 26176 | <filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_62.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xe4cb, %r14
nop
nop
nop
nop
cmp %rbx, %rbx
movw $0x6162, (%r14)
nop
nop
nop
nop
add $5044, %r12
lea addresses_WC_ht+0x164bb, %r13
nop
add $49225, %rbp
movb (%r13), %r8b
sub %r8, %r8
lea addresses_A_ht+0x74bb, %rsi
lea addresses_UC_ht+0x184e7, %rdi
xor %r14, %r14
mov $95, %rcx
rep movsb
nop
inc %r13
lea addresses_UC_ht+0xdebb, %rdx
nop
nop
cmp $44109, %rsi
movb (%rdx), %r12b
nop
sub $40998, %rsi
lea addresses_A_ht+0xbdbb, %rsi
lea addresses_D_ht+0x150bb, %rdi
nop
nop
nop
nop
dec %rbx
mov $50, %rcx
rep movsq
nop
nop
dec %rbp
lea addresses_normal_ht+0x33cb, %rsi
lea addresses_UC_ht+0x77a2, %rdi
nop
nop
nop
nop
xor %rdx, %rdx
mov $33, %rcx
rep movsb
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x19301, %rbx
nop
nop
add $35346, %rbp
movw $0x6162, (%rbx)
nop
nop
nop
nop
sub %r12, %r12
lea addresses_WC_ht+0xf33b, %rsi
lea addresses_WC_ht+0xbb, %rdi
nop
nop
nop
nop
sub $13829, %r12
mov $123, %rcx
rep movsw
nop
nop
nop
nop
nop
inc %rsi
lea addresses_WC_ht+0x7fb7, %rsi
lea addresses_A_ht+0x1440b, %rdi
nop
xor $34125, %r13
mov $90, %rcx
rep movsl
nop
inc %rcx
lea addresses_A_ht+0x26bb, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
cmp %r8, %r8
movups (%rbx), %xmm1
vpextrq $1, %xmm1, %rcx
nop
sub $6492, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %rbx
push %rcx
push %rdx
// Store
lea addresses_PSE+0x8ebb, %rdx
and %r11, %r11
movl $0x51525354, (%rdx)
nop
nop
nop
nop
add %r12, %r12
// Store
lea addresses_D+0xf53b, %rbx
nop
nop
nop
nop
nop
cmp $40145, %rcx
mov $0x5152535455565758, %r11
movq %r11, %xmm4
movups %xmm4, (%rbx)
nop
add %rcx, %rcx
// Store
lea addresses_D+0x3abb, %rdx
cmp %r13, %r13
movl $0x51525354, (%rdx)
cmp %r11, %r11
// Faulty Load
lea addresses_PSE+0x8ebb, %r11
nop
nop
nop
nop
and $64682, %rcx
vmovups (%r11), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r13
lea oracles, %rdx
and $0xff, %r13
shlq $12, %r13
mov (%rdx,%r13,1), %r13
pop %rdx
pop %rcx
pop %rbx
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'src': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'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
*/
|
Laburi/Lab5/4-5-print-structure/print_structure.asm | DanBrezeanu/IOCLA | 2 | 27706 | %include "io.inc"
struc stud_struct
name: resb 32
surname: resb 32
age: resb 1
group: resb 8
gender: resb 1
birth_year: resw 1
endstruc
section .data
sample_student:
istruc stud_struct
at name, db 'Andrei', 0
at surname, db 'Voinea', 0
at age, db 21
at group, db '321CA', 0
at gender, db 1
at birth_year, dw 1994
iend
string_name db "Name: ", 0
string_surname db "Surname: ", 0
string_age db "Age: ", 0
string_group db "Group: ", 0
string_gender db "Gender: ", 0
string_year db "Birth year: ", 0
section .text
global CMAIN
CMAIN:
push ebp
mov ebp, esp
; TODO: Update name, surname, birth_year, gender and age such that:
; birth_year is 1993
; age is 22
; group is '323CA'
mov byte [sample_student + age], 22
mov word [sample_student + birth_year], 1994
mov byte [sample_student + group + 2], '3'
lea eax, [sample_student + name]
PRINT_STRING string_name
PRINT_STRING [eax]
NEWLINE
lea eax, [sample_student + surname]
PRINT_STRING string_surname
PRINT_STRING [eax]
NEWLINE
mov al, byte [sample_student + age]
PRINT_STRING string_age
PRINT_UDEC 1, al
NEWLINE
lea eax, [sample_student + group]
PRINT_STRING string_group
PRINT_STRING [eax]
NEWLINE
mov al, byte [sample_student + gender]
PRINT_STRING string_gender
PRINT_UDEC 1, al
NEWLINE
mov ax, [sample_student + birth_year]
PRINT_STRING string_year
PRINT_UDEC 2, ax
NEWLINE
leave
ret
|
electrum/src/main/resources/models/book/chapter2/addressBook3a.als | haslab/Electrum | 29 | 3313 | <gh_stars>10-100
module tour/addressBook3a ----- Page 25
open util/ordering [Book] as BookOrder
abstract sig Target { }
sig Addr extends Target { }
abstract sig Name extends Target { }
sig Alias, Group extends Name { }
sig Book {
names: set Name,
addr: names->some Target
} {
no n: Name | n in n.^addr
all a: Alias | lone a.addr
}
pred add [b, b1: Book, n: Name, t: Target] { b1.addr = b.addr + n->t }
pred del [b, b1: Book, n: Name, t: Target] { b1.addr = b.addr - n->t }
fun lookup [b: Book, n: Name] : set Addr { n.^(b.addr) & Addr }
pred init [b: Book] { no b.addr }
fact traces {
init [first]
all b: Book-last |
let b1 = b.next |
some n: Name, t: Target |
add [b, b1, n, t] or del [b, b1, n, t]
}
------------------------------------------------------
pred show { }
// This command generates an instance similar to Fig 2.15
run show for 4
|
Cubical/Experiments/CountingFiniteStructure.agda | thomas-lamiaux/cubical | 1 | 4261 | {-
Counting how many structured finite sets with a given cardinal
https://github.com/EgbertRijke/OEIS-A000001
-}
{-# OPTIONS --safe #-}
module Cubical.Experiments.CountingFiniteStructure where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Data.Nat
open import Cubical.Data.Bool
open import Cubical.Data.Sigma
open import Cubical.Data.FinSet
open import Cubical.Data.FinSet.Induction
open import Cubical.Data.FinSet.Constructors
open import Cubical.Data.FinType
open import Cubical.Data.FinType.FiniteStructure
private
variable
ℓ : Level
-- convenient abbreviation
isFinStrCard : (S : FinSet ℓ-zero → FinSet ℓ) (n : ℕ) → isFinType 0 (FinSetWithStrOfCard S n)
isFinStrCard S n = isFinTypeFinSetWithStrOfCard S n
-- structure that there is no structure
TrivialStr : FinSet ℓ → FinSet ℓ
TrivialStr _ = 𝟙
-- structure that "picking an element in that set"
IdentityStr : FinSet ℓ → FinSet ℓ
IdentityStr X = X
-- finite semi-groups
FinSemiGroupStr : FinSet ℓ → FinSet ℓ
FinSemiGroupStr X .fst =
Σ[ p ∈ (X .fst → X .fst → X .fst) ] ((x y z : X .fst) → p (p x y) z ≡ p x (p y z))
FinSemiGroupStr X .snd =
isFinSetΣ (_ , isFinSetΠ2 X (λ _ → X) (λ _ _ → X))
(λ p → _ , isFinSetΠ3 X (λ _ → X) (λ _ _ → X) (λ _ _ _ → _ , isFinSet≡ X _ _))
-- finite groups
FinGroupStr : FinSet ℓ → FinSet ℓ
FinGroupStr X .fst =
Σ[ e ∈ X .fst ]
Σ[ inv ∈ (X .fst → X .fst) ]
Σ[ p ∈ (X .fst → X .fst → X .fst) ]
((x y z : X .fst) → p (p x y) z ≡ p x (p y z))
× ((x : X .fst)
→ (p x e ≡ x) × (p e x ≡ x) × (p (inv x) x ≡ e) × (p x (inv x) ≡ e))
FinGroupStr X .snd =
isFinSetΣ X (λ _ → _ ,
isFinSetΣ (_ , isFinSetΠ X (λ _ → X)) (λ _ → _ ,
isFinSetΣ (_ , isFinSetΠ2 X (λ _ → X) (λ _ _ → X)) (λ _ → _ ,
isFinSet× (_ , isFinSetΠ3 X (λ _ → X) (λ _ _ → X) (λ _ _ _ → _ , isFinSet≡ X _ _)) (_ ,
isFinSetΠ X (λ _ → _ ,
isFinSet× (_ , isFinSet≡ X _ _) (_ ,
isFinSet× (_ , isFinSet≡ X _ _) (_ ,
isFinSet× (_ , isFinSet≡ X _ _) (_ , isFinSet≡ X _ _))))))))
-- two rather trivial numbers
-- but the computation is essentially not that trivial
-- Time: 5 ms
a2 : ℕ
a2 = card (_ , isFinStrCard TrivialStr 2)
-- this is already hard to compute
-- Time: 443 ms
b2 : ℕ
b2 = card (_ , isFinStrCard IdentityStr 2)
-- the number of finite semi-groups
numberOfFinSemiGroups : ℕ → ℕ
numberOfFinSemiGroups n = card (_ , isFinStrCard FinSemiGroupStr n)
-- two trivial cases of semi-groups
-- Time: 29 ms
n0 : ℕ
n0 = numberOfFinSemiGroups 0
-- Time: 2,787ms
n1 : ℕ
n1 = numberOfFinSemiGroups 1
-- the number of finite semi-groups with cardinal 2
-- it should be 5
-- would you like to try?
n2 : ℕ
n2 = numberOfFinSemiGroups 2
-- OEIS-A000001
-- I think you'd better not evaluate this function with n > 1
numberOfFinGroups : ℕ → ℕ
numberOfFinGroups n = card (_ , isFinStrCard FinGroupStr n)
-- group with one element
-- Time: 26,925ms
g1 : ℕ
g1 = numberOfFinGroups 1
-- Rijke's challenge
-- seemed to big to do an exhaustive search
g4 : ℕ
g4 = numberOfFinGroups 4
|
oeis/131/A131779.asm | neoneye/loda-programs | 11 | 96693 | <filename>oeis/131/A131779.asm
; A131779: Triangle read by rows: T(n,k) = 2*A065941(n-1,k-1) - (-1)^(n+k).
; Submitted by <NAME>iga
; 1,3,1,1,3,1,3,1,5,1,1,3,5,5,1,3,1,9,5,7,1,1,3,9,9,11,7,1,3,1,13,9,21,11,9,1,1,3,13,13,29,21,19,9,1,3,1,17,13,43,29,41,19,11,1,1,3,17,17,55,43,69,41,29,11,1,3,1,21,17,73,55,113,69,71,29,13,1,1,3,21,21,89,73,167,113,139,71,41,13,1,3,1,25,21,111,89,241,167,253
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
div $0,2
add $0,$2
bin $0,$2
mod $2,2
add $2,$0
mul $2,2
mov $0,$2
sub $0,1
|
oeis/287/A287275.asm | neoneye/loda-programs | 11 | 176904 | <reponame>neoneye/loda-programs
; A287275: Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= three.
; Submitted by <NAME>(w3)
; 1,1,2,5,15,47,150,481,1545,4965,15958,51293,164871,529947,1703418,5475329,17599457,56570281,181834970,584475733,1878691887,6038716423,19410365422,62391120801,200545011401,644615789581,2072001259342,6660074556205,21407609138375,68810900711987,221180236718130,710944001728001,2285201341190145,7345367788580305,23610360705203058,75891248562999333,243938738605620751,784097103674658527,2520338801066596998,8101174768268828769,26039766002198424777,83700133973797506101,269038993155322114310
sub $0,1
mov $1,2
lpb $0
sub $0,1
add $3,$1
add $1,$3
mov $2,$4
add $2,2
mov $4,$1
add $1,$2
lpe
mov $0,$3
div $0,2
add $0,1
|
src/ada/src/uxas_ada.adb | pat-rogers/OpenUxAS | 0 | 12307 | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
with DOM.Core; use DOM.Core;
with DOM.Core.Nodes; use DOM.Core.Nodes;
with GNAT.Strings; use GNAT.Strings;
with DOM.Core.Elements;
with GNAT.Command_Line;
with Ctrl_C_Handler;
with UxAS.Common.Configuration_Manager; use UxAS.Common;
with UxAS.Comms.LMCP_Net_Client.Service; use UxAS.Comms.LMCP_Net_Client.Service;
with UxAS.Comms.LMCP_Net_Client.Service.Automation_Request_Validation;
pragma Unreferenced (UxAS.Comms.LMCP_Net_Client.Service.Automation_Request_Validation);
-- need package in closure for sake of package executable part
with UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation;
pragma Unreferenced (UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation);
-- need package in closure for sake of package executable part
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with UxAS.Common.String_Constant.Lmcp_Network_Socket_Address;
procedure UxAS_Ada is
Successful : Boolean;
New_Service : Any_Service;
XML_Cfg_File_Name : aliased GNAT.Strings.String_Access;
All_Enabled_Services : DOM.Core.Element;
All_Enabled_Bridges : DOM.Core.Element;
From_Msg_Hub, To_Msg_Hub : Unbounded_String;
-- These are the TCP address we use for this separate Ada process
-- to communicate with the UxAS process in C++, taken from the
-- LmcpObjectNetworkPublishPullBridge arguments in the XML file.
procedure Launch_Services (Services : DOM.Core.Element; Successful : out Boolean);
-- Instantiate, configure, initialize, and start each service specified in
-- the configuration XML file. This is what ServiceManager::createService()
-- would do, if implemented.
procedure Get_LMCP_Socket_Addresses
(Bridges : DOM.Core.Element;
Pub_Address : out Unbounded_String;
Pull_Address : out Unbounded_String);
-- Find the LmcpObjectNetworkPublishPullBridge specification in the
-- configuration XML file and get the corresponding TCP addresses to
-- use in package UxAS.Common.String_Constant.Lmcp_Network_Socket_Address.
procedure Get_Config_File_Name with
Global => XML_Cfg_File_Name;
-- Parse the command line for the name of the XML configuration file
-- specifying the names of the services to launch and the TCP addresses
-- to use when communicating with the rest of UxAS
--------------------------
-- Get_Config_File_Name --
--------------------------
procedure Get_Config_File_Name is
use GNAT.Command_Line;
Config : Command_Line_Configuration;
begin
Define_Switch (Config,
XML_Cfg_File_Name'Access,
"-cfgPath:",
Help => "XML configuration file");
Getopt (Config);
if XML_Cfg_File_Name.all = "" then
Display_Help (Config);
end if;
end Get_Config_File_Name;
---------------------
-- Launch_Services --
---------------------
procedure Launch_Services (Services : DOM.Core.Element; Successful : out Boolean) is
Next : DOM.Core.Node;
begin
Next := First_Child (Services);
while Next /= null loop
declare
Service_Type_Name : constant String := DOM.Core.Elements.Get_Attribute (Next, Name => "Type");
begin
New_Service := Instantiate_Service (Service_Type_Name);
if New_Service = null then
Put_Line ("Could not Instantiate_Service for " & Service_Type_Name);
Successful := False;
return;
end if;
New_Service.Configure_Service
(Parent_Of_Work_Directory => Configuration_Manager.Root_Data_Work_Directory,
Service_XML_Node => Next,
Result => Successful);
if not Successful then
Put_Line ("Could not Configure_Service for " & Service_Type_Name);
return;
end if;
New_Service.Initialize_And_Start (Successful);
if not Successful then
Put_Line ("Could not Initialize_And_Start " & Service_Type_Name);
return;
end if;
Put_Line ("Successfully launched " & Service_Type_Name);
Next := Next_Sibling (Next);
end;
end loop;
end Launch_Services;
-------------------------------
-- Get_LMCP_Socket_Addresses --
-------------------------------
procedure Get_LMCP_Socket_Addresses
(Bridges : DOM.Core.Element;
Pub_Address : out Unbounded_String;
Pull_Address : out Unbounded_String)
is
Next : DOM.Core.Node;
begin
Pub_Address := Null_Unbounded_String;
Pull_Address := Null_Unbounded_String;
-- <Bridge Type="LmcpObjectNetworkPublishPullBridge" AddressPUB="tcp://127.0.0.1:5560" AddressPULL="tcp://127.0.0.1:5561">
Next := First_Child (Bridges);
while Next /= null loop
declare
Service_Type_Name : constant String := DOM.Core.Elements.Get_Attribute (Next, Name => "Type");
begin
if Service_Type_Name = "LmcpObjectNetworkPublishPullBridge" then
Pub_Address := To_Unbounded_String (DOM.Core.Elements.Get_Attribute (Next, Name => "AddressPUB"));
Pull_Address := To_Unbounded_String (DOM.Core.Elements.Get_Attribute (Next, Name => "AddressPULL"));
Put_Line ("Found bridge addressPUB: """ & To_String (Pub_Address) & """");
Put_Line ("Found bridge addressPULL: """ & To_String (Pull_Address) & """");
return;
end if;
Next := Next_Sibling (Next);
end;
end loop;
end Get_LMCP_Socket_Addresses;
begin
Ctrl_C_Handler;
Get_Config_File_Name;
if XML_Cfg_File_Name.all = "" then
return; -- we already displayed the help info in the procedure
end if;
Configuration_Manager.Instance.Load_Base_XML_File (XML_Cfg_File_Name.all, Successful);
if not Successful then
Put_Line ("Could not load base XML file '" & XML_Cfg_File_Name.all & "'");
return;
end if;
-- First, search All_Enabled_Bridges for the TCP addresses to use, rather than hard-coding them in
-- package UxAS.Common.String_Constant.Lmcp_Network_Socket_Address
--
-- NOTE: We MUST do this before we launch the services since they will use the addresses in that package...
Configuration_Manager.Instance.Get_Enabled_Bridges (All_Enabled_Bridges, Successful);
if not Successful then
Put_Line ("Could not Get_Enabled_Bridges via config manager");
return;
end if;
Get_LMCP_Socket_Addresses (All_Enabled_Bridges, Pub_Address => From_Msg_Hub, Pull_Address => To_Msg_Hub);
if From_Msg_Hub = Null_Unbounded_String or To_Msg_Hub = Null_Unbounded_String then
Put_Line ("Could not get bridge's two TCP addresses from XML file");
return;
end if;
UxAS.Common.String_Constant.Lmcp_Network_Socket_Address.InProc_From_MessageHub := From_Msg_Hub;
UxAS.Common.String_Constant.Lmcp_Network_Socket_Address.InProc_To_MessageHub := To_Msg_Hub;
-- Now launch the services specified in the config XML file
Configuration_Manager.Instance.Get_Enabled_Services (All_Enabled_Services, Successful);
if not Successful then
Put_Line ("Could not Get_Enabled_Services via config manager");
return;
end if;
Launch_Services (All_Enabled_Services, Successful);
if not Successful then
return;
end if;
Put_Line ("Initialization complete");
exception
when Error : others =>
Put_Line (Exception_Information (Error));
end UxAS_Ada;
|
notes/ep_new.asm | drvink/epanos | 39 | 172296 | <filename>notes/ep_new.asm
# bgez 2
# jal 1
# c.le.d 2
# move 2
# bc1f 1
# lbu 2
# sw 2
# add.d 2
# bc1t 1
# jalr 1
# sub.s 2, 3
# bnez 2
# lwc1 2
# slti 3
# sra 3
# dmtc1 2
# beq 3
# cvt.s.d 2
# c.lt.d 2
# c.eq.s 2
# ldc1 2
# c.le.s 2
# dmfc1 2
# mov.s 2
# sdc1 2
# addiu 2, 3
# trunc.w.d 2
# mul.d 2, 3
# b 1
# sll 2, 3
# li 2
# lw 2
# jr 1
# sd 2
# nop 0
# beqz 2
# div.d 2, 3
# bne 3
# sltiu 3
# subu 2, 3
# cvt.d.s 2
# mul.s 2, 3
# bnezl 2
# mtc1 2
# la 2
# c.lt.s 2
# blez 2
# addu 2, 3
# slt 2, 3
# sb 2
# div.s 2
# add.s 2, 3
# xor 2, 3
# lui 2
# ld 2
# cvt.s.w 2
# mov.d 2
# swc1 2
# andi 2
li $v0, 0xD980
addu $at, $t9, $v0
lwc1 $f7, (flt_10009290 - 0x10010F9C)($at)
c.lt.s $f7, $f14
ldc1 $f3, (dbl_100092D0 - 0x10010F9C)($at)
bc1f loc_10003640
lwc1 $f0, (flt_10009294 - 0x10010F9C)($at)
add.s $f14, $f0
mtc1 $zero, $f1
nop
c.lt.s $f14, $f1
lwc1 $f0, (flt_1000929C - 0x10010F9C)($at)
lwc1 $f5, (flt_100092A4 - 0x10010F9C)($at)
bc1f loc_10003660
lwc1 $f6, (flt_100092A0 - 0x10010F9C)($at)
add.s $f14, $f7
c.lt.s $f14, $f0
nop
bc1t loc_100036C0
mov.s $f0, $f13
c.lt.s $f14, $f6
nop
bc1t locret_100036E8
nop
c.lt.s $f14, $f5
nop
bc1f locret_100036B8
mov.s $f0, $f12
sub.s $f2, $f5, $f14
cvt.d.s $f2, $f2
div.d $f2, $f3
sub.s $f1, $f13, $f12
cvt.d.s $f1, $f1
cvt.d.s $f0, $f12
mul.d $f1, $f2
add.d $f0, $f1
jr $ra
cvt.s.d $f0, $f0
jr $ra
nop
ldc1 $f3, (dbl_100092D0 - 0x10010F9C)($at)
cvt.d.s $f2, $f14
div.d $f2, $f3
sub.s $f1, $f13, $f12
cvt.d.s $f1, $f1
cvt.d.s $f0, $f12
mul.d $f1, $f2
add.d $f0, $f1
jr $ra
cvt.s.d $f0, $f0
jr $ra
nop
lui $at, 1
addiu $sp, -0x50
li $at, 0xD8AC
sd $gp, 0x50+var_20($sp)
addu $gp, $t9, $at
ldc1 $f1, dbl_100092D8
cvt.d.s $f0, $f13
sdc1 $f20, 0x50+var_18($sp)
sd $s2, 0x50+var_28($sp)
c.le.d $f0, $f1
mov.s $f4, $f13
sd $s1, 0x50+var_30($sp)
mov.s $f5, $f12
move $s1, $a5
sd $s0, 0x50+var_38($sp)
move $s0, $a4
move $s2, $a3
bc1f loc_10003748
lwc1 $f6, flt_100092A8
add.s $f20, $f14, $f6
b loc_10003754
mul.s $f20, $f13, $f20
mul.s $f21, $f13, $f14
add.s $f20, $f13, $f14
sub.s $f20, $f21
mtc1 $zero, $f23
nop
c.eq.s $f14, $f23
nop
bc1f loc_10003794
sd $ra, 0x50+var_10($sp)
swc1 $f4, 0($s1)
swc1 $f4, 0($s0)
swc1 $f4, 0($s2)
ld $s0, 0x50+var_38($sp)
ld $s1, 0x50+var_30($sp)
ld $s2, 0x50+var_28($sp)
ldc1 $f20, 0x50+var_18($sp)
ld $gp, 0x50+var_20($sp)
jr $ra
addiu $sp, 0x50
ldc1 $f15, dbl_100092E0
cvt.d.s $f14, $f5
mul.d $f14, $f15
lwc1 $f12, flt_100092AC
cvt.s.d $f14, $f14
ldc1 $f15, dbl_100092E8
sdc1 $f14, 0x50+var_50($sp)
cvt.d.s $f14, $f14
la $t9, value__GfN21
mul.s $f12, $f4, $f12
sdc1 $f14, 0x50+var_48($sp)
add.d $f14, $f15
sub.s $f12, $f20
mov.s $f13, $f20
sdc1 $f12, 0x50+var_40($sp)
jal value__GfN21
cvt.s.d $f14, $f14
la $t9, value__GfN21
swc1 $f0, 0($s2)
ldc1 $f12, 0x50+var_40($sp)
mov.s $f13, $f20
jal value__GfN21
ldc1 $f14, 0x50+var_50($sp)
ldc1 $f15, dbl_100092F0
ldc1 $f14, 0x50+var_48($sp)
la $t9, value__GfN21
add.d $f14, $f15
ldc1 $f12, 0x50+var_40($sp)
swc1 $f0, 0($s0)
mov.s $f13, $f20
jal value__GfN21
cvt.s.d $f14, $f14
ld $ra, 0x50+var_10($sp)
b loc_10003778
swc1 $f0, 0($s1)
dmtc1 $zero, $f0
addiu $sp, -0x20
sdc1 $f30, 0x20+var_20($sp)
cvt.d.s $f30, $f12
c.lt.d $f0, $f30
lui $at, 1
sd $ra, 0x20+var_10($sp)
li $at, 0xD77C
sd $gp, 0x20+var_18($sp)
bc1f loc_10003890
addu $gp, $t9, $at
la $t9, drand48
jalr $t9
nop
la $t9, expm1
jalr $t9
mul.d $f12, $f0, $f30
la $t9, expm1
mov.d $f30, $f0
jalr $t9
ldc1 $f12, dbl_10009300
div.d $f0, $f30, $f0
ld $ra, 0x20+var_10($sp)
ld $gp, 0x20+var_18($sp)
ldc1 $f30, 0x20+var_20($sp)
addiu $sp, 0x20
jr $ra
cvt.s.d $f0, $f0
la $t9, __assert
li $a2, 0x108
la $a1, aEp_c
jalr $t9
la $a0, aM0_0
b loc_10003850
la $t9, drand48
lui $v0, 1
addiu $sp, -0x10
li $v0, 0xD6F0
sd $gp, 0x10+var_8($sp)
addu $gp, $t9, $v0
ldc1 $f1, dbl_10009300
cvt.d.s $f0, $f12
la $at, 0x10010000
sd $ra, 0x10+var_10($sp)
la $t9, glMultMatrixf
addiu $at, (aflag - 0x10010000)
add.d $f0, $f1
swc1 $f13, (flt_10008EAC - 0x10008E48)($at)
swc1 $f14, (flt_10008EC0 - 0x10008E48)($at)
cvt.s.d $f0, $f0
addiu $a0, $at, (flt_10008EA8 - 0x10008E48)
jalr $t9
swc1 $f0, (flt_10008EA8 - 0x10008E48)($at)
ld $ra, 0x10+var_10($sp)
ld $gp, 0x10+var_8($sp)
jr $ra
addiu $sp, 0x10
sw $a0, 0x10($a1)
lw $a4, 0x18($a0)
beqz $a4, loc_10003994
lwc1 $f4, 8($a1)
lwc1 $f0, 8($a4)
c.lt.s $f4, $f0
nop
bc1t loc_10003988
lw $a3, 0x14($a4)
beqz $a3, loc_100039A0
nop
lwc1 $f1, 8($a3)
c.lt.s $f4, $f1
nop
bc1t loc_1000395C
nop
move $a4, $a3
lw $a3, 0x14($a3)
bnez $a3, loc_10003930
nop
b loc_10003968
lw $at, 0x14($a1)
sw $a3, 0x14($a1)
sw $a1, 0x14($a4)
lw $at, 0x14($a1)
bnez $at, locret_10003980
nop
lw $v0, 0x20($a0)
sw $a1, 0x14($v0)
jr $ra
sw $a1, 0x20($a0)
jr $ra
nop
sw $a4, 0x14($a1)
jr $ra
sw $a1, 0x18($a0)
sw $a1, 0x20($a0)
jr $ra
sw $a1, 0x18($a0)
sw $a1, 0x14($a4)
jr $ra
sw $a1, 0x20($a0)
addiu $sp, -0x2E0
sd $s3, 0x2E0+var_C0($sp)
li $s3, 0xD5F0
sd $gp, 0x2E0+var_D0($sp)
addu $gp, $t9, $s3
la $s3, oflag
sd $s0, 0x2E0+var_C8($sp)
lbu $a0, (oflag - 0x1000A3B8)($s3)
la $s0, defaultScript
sd $ra, 0x2E0+var_18($sp)
beqz $a0, loc_100039F4
lw $s0, (defaultScript - 0x10008F2C)($s0)
la $t9, printf
la $a0, 0x10010000
jalr $t9
addiu $a0, (aReadingAnimati - 0x10010000)
lbu $a0, (oflag - 0x1000A3B8)($s3)
sdc1 $f20, 0x2E0+var_50($sp)
sd $s5, 0x2E0+var_8($sp)
sd $s1, 0x2E0+var_10($sp)
beqz $a0, loc_10003A14
sd $s6, 0x2E0+var_20($sp)
la $t9, printf
jalr $t9
la $a0, asc_10009338
la $s5, sscanf
la $s1, strcmp
la $s6, strcspn
sd $s7, 0x2E0+var_30($sp)
sd $s4, 0x2E0+var_38($sp)
sd $fp, 0x2E0+var_40($sp)
sd $s2, 0x2E0+var_48($sp)
mtc1 $zero, $f20
lw $a1, 0x2E0+var_2E0($sp)
b loc_10003B54
sd $a1, 0x2E0+var_A8($sp)
la $a0, asc_10009388
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
li $a2, 1
beqz $v0, loc_100047C0
lbu $a0, 0($s3)
beqz $a0, loc_10003A78
la $t9, free
la $t9, printf
la $a0, 0x10010000
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aBadCommandS - 0x10010000)
la $t9, free
jalr $t9
move $a0, $s2
li $a1, 1
sd $a1, 0x2E0+var_58($sp)
ld $a2, 0x2E0+var_58($sp)
sd $a2, 0x2E0+var_60($sp)
ld $a3, 0x2E0+var_60($sp)
sd $a3, 0x2E0+var_68($sp)
ld $a4, 0x2E0+var_68($sp)
sd $a4, 0x2E0+var_70($sp)
ld $a5, 0x2E0+var_70($sp)
sd $a5, 0x2E0+var_78($sp)
ld $a6, 0x2E0+var_78($sp)
sd $a6, 0x2E0+var_80($sp)
ld $a7, 0x2E0+var_80($sp)
sd $a7, 0x2E0+var_88($sp)
ld $fp, 0x2E0+var_88($sp)
move $s7, $fp
move $s4, $s7
move $fp, $s4
move $s7, $fp
move $s4, $s7
move $s7, $s4
move $fp, $s7
move $s7, $fp
move $s4, $s7
beqz $s4, loc_10003DA4
move $t9, $s5
move $a0, $s0
addiu $a2, $sp, 0x2E0+var_1D8
jalr $t9
la $a1, asc_10009390
lbu $t4, 0($s3)
beqz $t4, loc_10003B18
la $t5, bflag
la $t9, printf
addiu $a1, $sp, 0x2E0+var_1D8
jalr $t9
la $a0, aS_0
la $t5, bflag
lbu $t5, (bflag - 0x10008E49)($t5)
la $s2, strlen
beqz $t5, loc_10003DD8
sb $zero, 0x2E0+var_1D8($sp)
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009338
move $t9, $s2
addu $s0, $v0, $s0
addiu $s0, 1
jalr $t9
move $a0, $s0
beqz $v0, loc_100041A4
la $a1, seqList
sd $zero, 0x2E0+var_58($sp)
sd $zero, 0x2E0+var_60($sp)
sd $zero, 0x2E0+var_68($sp)
sd $zero, 0x2E0+var_70($sp)
sd $zero, 0x2E0+var_78($sp)
sd $zero, 0x2E0+var_80($sp)
sd $zero, 0x2E0+var_88($sp)
sd $zero, 0x2E0+var_90($sp)
sd $zero, 0x2E0+var_98($sp)
move $s2, $zero
sd $zero, 0x2E0+var_A0($sp)
move $fp, $zero
move $s7, $zero
sd $zero, 0x2E0+var_B0($sp)
move $s4, $zero
move $t9, $s5
sd $zero, 0x2E0+var_B8($sp)
move $a0, $s0
addiu $a2, $sp, 0x2E0+var_2D8
sd $zero, 0x2E0+var_D8($sp)
jalr $t9
la $a1, aS
move $t9, $s6
move $a0, $s0
la $a1, asc_10009340
jalr $t9
sd $s2, 0x2E0+var_28($sp)
la $t9, malloc
li $a0, 0x18
jalr $t9
addu $s0, $v0, $s0
la $t8, absFrame
move $t9, $s1
lwc1 $f0, (absFrame - 0x1000A3C8)($t8)
move $s2, $v0
addiu $a1, $sp, 0x2E0+var_2D8
la $a0, aFrame
jalr $t9
swc1 $f0, 8($v0)
beqz $v0, loc_10003D30
move $t9, $s5
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aRelframe - 0x10010000)
beqz $v0, loc_10003E58
move $t9, $s5
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $s4, 0x2E0+var_D8($sp)
jalr $t9
addiu $a0, (aAbsframe - 0x10010000)
beqz $v0, loc_10003ED0
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $s7, 0x2E0+var_B8($sp)
jalr $t9
addiu $a0, (aRanddelay - 0x10010000)
beqz $v0, loc_10003F48
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $fp, 0x2E0+var_B0($sp)
jalr $t9
addiu $a0, (aDuration - 0x10010000)
beqz $v0, loc_10004014
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aVariance - 0x10010000)
beqz $v0, loc_10004074
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $s4, 0x2E0+var_A0($sp)
jalr $t9
addiu $a0, (aActlim1 - 0x10010000)
beqz $v0, loc_100040D0
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $s7, 0x2E0+var_98($sp)
jalr $t9
addiu $a0, (aActlim2 - 0x10010000)
beqz $v0, loc_10004138
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
ld $fp, 0x2E0+var_90($sp)
jalr $t9
la $a0, aActset
beqz $v0, loc_100042C0
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aActreset - 0x10010000)
beqz $v0, loc_100043B4
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aActresetall - 0x10010000)
bnez $v0, loc_10003DFC
la $a0, 0x10010000
li $a2, 6
sw $a2, 0($s2)
lbu $a1, 0($s3)
beqz $a1, loc_10003AC0
move $s7, $fp
la $t9, printf
la $a0, aS
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003AC0
move $s7, $fp
addiu $a2, $s2, 0xC
la $a1, aF
move $a0, $s0
jalr $t9
sw $zero, 0($s2)
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a3, 0($s3)
beqz $a3, loc_10003D7C
addu $s0, $v0, $s0
lwc1 $f1, 0xC($s2)
la $t9, printf
cvt.d.s $f1, $f1
addiu $a1, $sp, 0x2E0+var_2D8
dmfc1 $a2, $f1
jalr $t9
la $a0, aSF
lwc1 $f4, 0xC($s2)
la $a5, relFrame
la $a6, baseFrame
lwc1 $f3, (relFrame - 0x1000A3C0)($a5)
lwc1 $f2, (baseFrame - 0x1000A3C4)($a6)
add.s $f3, $f4
la $a4, absFrame
swc1 $f3, (relFrame - 0x1000A3C0)($a5)
add.s $f2, $f3
swc1 $f2, (absFrame - 0x1000A3C8)($a4)
la $a0, editSeq
lw $a0, (editSeq - 0x1000BF7C)($a0)
beqz $a0, loc_1000445C
la $s4, addToSeq__GP7animSeqP11animCommand
move $t9, $s4
jal addToSeq__GP7animSeqP11animCommand
move $a1, $s2
la $a1, editSeq
la $a2, relFrame
lw $a1, (editSeq - 0x1000BF7C)($a1)
lwc1 $f5, (relFrame - 0x1000A3C0)($a2)
b loc_10003AE4
swc1 $f5, 0xC($a1)
la $t9, scanf
li $s0, 0xFFFFFFFF
la $a0, asc_10009390
jalr $t9
ld $a1, 0x2E0+var_A8($sp)
beq $v0, $s0, loc_100041A4
la $a1, seqList
b loc_10003B54
ld $s0, 0x2E0+var_A8($sp)
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aActstop - 0x10010000)
beqz $v0, loc_10004408
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aActstopall - 0x10010000)
bnez $v0, loc_10003FA4
la $a0, 0x10010000
li $a2, 8
sw $a2, 0($s2)
lbu $a1, 0($s3)
beqz $a1, loc_10003AB4
ld $a7, 0x2E0+var_80($sp)
la $t9, printf
la $a0, aS
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003AB4
ld $a7, 0x2E0+var_80($sp)
addiu $a2, $s2, 0xC
la $a1, aF
move $a0, $s0
jalr $t9
sw $zero, 0($s2)
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a3, 0($s3)
beqz $a3, loc_10003EA4
addu $s0, $v0, $s0
lwc1 $f6, 0xC($s2)
la $t9, printf
cvt.d.s $f6, $f6
addiu $a1, $sp, 0x2E0+var_2D8
dmfc1 $a2, $f6
jalr $t9
la $a0, aSF
lwc1 $f9, 0xC($s2)
la $a5, relFrame
la $a6, baseFrame
lwc1 $f8, (relFrame - 0x1000A3C0)($a5)
lwc1 $f7, (baseFrame - 0x1000A3C4)($a6)
add.s $f8, $f9
la $a4, absFrame
swc1 $f8, (relFrame - 0x1000A3C0)($a5)
add.s $f7, $f8
b loc_10003AE0
swc1 $f7, (absFrame - 0x1000A3C8)($a4)
addiu $a2, $s2, 0xC
move $t9, $s5
la $a1, aF
move $a0, $s0
li $s4, 1
jalr $t9
sw $s4, 0($s2)
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a7, 0($s3)
beqz $a7, loc_10003F24
addu $s0, $v0, $s0
lwc1 $f10, 0xC($s2)
la $t9, printf
cvt.d.s $f10, $f10
addiu $a1, $sp, 0x2E0+var_2D8
dmfc1 $a2, $f10
jalr $t9
la $a0, aSF
la $t6, relFrame
la $t5, baseFrame
swc1 $f20, (relFrame - 0x1000A3C0)($t6)
lwc1 $f12, 0xC($s2)
la $t4, absFrame
swc1 $f12, (baseFrame - 0x1000A3C4)($t5)
lwc1 $f11, 0xC($s2)
b loc_10003ADC
swc1 $f11, (absFrame - 0x1000A3C8)($t4)
addiu $a2, $s2, 0xC
move $t9, $s5
la $a1, aF
move $a0, $s0
li $s4, 0x67
jalr $t9
sw $s4, 0($s2)
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $t7, 0($s3)
beqz $t7, loc_10003AD8
addu $s0, $v0, $s0
lwc1 $f13, 0xC($s2)
la $t9, printf
cvt.d.s $f13, $f13
addiu $a1, $sp, 0x2E0+var_2D8
dmfc1 $a2, $f13
jalr $t9
la $a0, aSF
b loc_10003ADC
move $s7, $fp
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqname - 0x10010000)
beqz $v0, loc_100044F8
move $t9, $s1
la $a0, aSeqdo
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
beqz $v0, loc_10004630
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqloop - 0x10010000)
bnez $v0, loc_10004328
la $a0, 0x10010000
li $a2, 0xC
sw $a2, 0($s2)
lbu $a1, 0($s3)
beqz $a1, loc_10003AA4
ld $a5, 0x2E0+var_70($sp)
la $t9, printf
la $a0, aS
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003AA4
ld $a5, 0x2E0+var_70($sp)
move $a0, $s0
move $t9, $s5
ld $s7, 0x2E0+var_28($sp)
la $a1, aF
li $s4, 0x65
sw $s4, 0($s2)
jalr $t9
addiu $a2, $s2, 0xC
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a3, 0($s3)
beqz $a3, loc_10003AD4
addu $s0, $v0, $s0
lwc1 $f14, 0xC($s2)
la $t9, printf
cvt.d.s $f14, $f14
la $a0, aSF
dmfc1 $a2, $f14
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003AD8
move $fp, $s7
move $a0, $s0
move $t9, $s5
la $a1, aF
li $s7, 0x66
sw $s7, 0($s2)
jalr $t9
addiu $a2, $s2, 0xC
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a4, 0($s3)
beqz $a4, loc_10003AD0
addu $s0, $v0, $s0
lwc1 $f15, 0xC($s2)
la $t9, printf
cvt.d.s $f15, $f15
la $a0, aSF
dmfc1 $a2, $f15
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003AD4
move $s7, $s4
move $a0, $s0
la $a1, aDF
move $t9, $s5
addiu $a2, $s2, 4
li $s4, 2
sw $s4, 0($s2)
jalr $t9
addiu $a3, $s2, 0xC
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a5, 0($s3)
beqz $a5, loc_10003ACC
addu $s0, $v0, $s0
lwc1 $f16, 0xC($s2)
la $t9, printf
la $a0, 0x10010000
cvt.d.s $f16, $f16
addiu $a1, $sp, 0x2E0+var_2D8
lw $a2, 4($s2)
dmfc1 $a3, $f16
jalr $t9
addiu $a0, (aSDF - 0x10010000)
b loc_10003AD0
move $s4, $s7
move $a0, $s0
la $a1, aDF
move $t9, $s5
addiu $a2, $s2, 4
li $s4, 3
sw $s4, 0($s2)
jalr $t9
addiu $a3, $s2, 0xC
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a1, 0($s3)
beqz $a1, loc_10003AC8
addu $s0, $v0, $s0
lwc1 $f17, 0xC($s2)
la $t9, printf
la $a0, 0x10010000
cvt.d.s $f17, $f17
addiu $a1, $sp, 0x2E0+var_2D8
lw $a2, 4($s2)
dmfc1 $a3, $f17
jalr $t9
addiu $a0, (aSDF - 0x10010000)
b loc_10003ACC
move $s7, $fp
la $a1, seqList
lw $a1, (seqList - 0x1000BF78)($a1)
beqz $a1, loc_100041C4
move $s4, $a1
lw $a2, 0($s4)
beqz $a2, loc_10004624
nop
lw $s4, 0x24($s4)
bnez $s4, loc_100041B0
lbu $a3, 0($s3)
beqz $a3, loc_100041E4
la $a1, seqList
la $t9, printf
la $a0, 0x10010000
jalr $t9
addiu $a0, (aDoneReadingAni - 0x10010000)
la $a1, seqList
lw $a1, (seqList - 0x1000BF78)($a1)
la $s1, printf
beqz $a1, loc_10004288
move $s4, $a1
b loc_1000424C
lbu $a1, 0($s3)
lw $s0, 0x14($s0)
beqz $s0, loc_10004240
nop
beqz $a0, loc_100041FC
nop
lwc1 $f18, 0xC($s0)
la $a0, 0x10010000
move $t9, $s1
cvt.d.s $f18, $f18
lw $a1, 0($s0)
lw $a2, 4($s0)
dmfc1 $a3, $f18
jalr $t9
addiu $a0, (aCmdDDF - 0x10010000)
lw $s0, 0x14($s0)
bnez $s0, loc_10004280
nop
lw $s4, 0x24($s4)
beqz $s4, loc_10004288
lbu $a1, 0($s3)
beqz $a1, loc_10004274
nop
lwc1 $f19, 8($s4)
la $a0, 0x10010000
move $t9, $s1
cvt.d.s $f19, $f19
lw $a1, 0($s4)
dmfc1 $a2, $f19
jalr $t9
addiu $a0, (aSeqDAt_2f - 0x10010000)
lw $s0, 0x18($s4)
beqz $s0, loc_10004240
la $s1, printf
b loc_10004208
lbu $a0, 0($s3)
ld $s5, 0x2E0+var_8($sp)
ld $s1, 0x2E0+var_10($sp)
ld $s6, 0x2E0+var_20($sp)
ld $s7, 0x2E0+var_30($sp)
ld $s4, 0x2E0+var_38($sp)
ld $fp, 0x2E0+var_40($sp)
ld $s2, 0x2E0+var_48($sp)
ldc1 $f20, 0x2E0+var_50($sp)
ld $ra, 0x2E0+var_18($sp)
ld $gp, 0x2E0+var_D0($sp)
ld $s0, 0x2E0+var_C8($sp)
ld $s3, 0x2E0+var_C0($sp)
jr $ra
addiu $sp, 0x2E0
move $a0, $s0
la $a1, aDF
move $t9, $s5
addiu $a2, $s2, 4
li $s7, 4
sw $s7, 0($s2)
jalr $t9
addiu $a3, $s2, 0xC
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a1, 0($s3)
beqz $a1, loc_10003AC4
addu $s0, $v0, $s0
lwc1 $f21, 0xC($s2)
la $t9, printf
la $a0, 0x10010000
cvt.d.s $f21, $f21
addiu $a1, $sp, 0x2E0+var_2D8
lw $a2, 4($s2)
dmfc1 $a3, $f21
jalr $t9
addiu $a0, (aSDF - 0x10010000)
b loc_10003AC8
move $fp, $s4
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqstop - 0x10010000)
beqz $v0, loc_1000469C
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqrepeat - 0x10010000)
beqz $v0, loc_100046F0
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqkill - 0x10010000)
beqz $v0, loc_1000476C
la $a0, 0x10010000
move $t9, $s1
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aSeqkillall - 0x10010000)
bnez $v0, loc_10003A40
la $t9, strncmp
li $a2, 0xF
sw $a2, 0($s2)
lbu $a1, 0($s3)
beqz $a1, loc_10003A8C
ld $a2, 0x2E0+var_58($sp)
la $t9, printf
la $a0, aS
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
b loc_10003A8C
ld $a2, 0x2E0+var_58($sp)
move $a0, $s0
move $t9, $s5
la $a1, aD
li $a3, 5
sw $a3, 0($s2)
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a4, 0($s3)
beqz $a4, loc_10003AC0
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
b loc_10003AC4
move $s4, $s7
move $a0, $s0
move $t9, $s5
la $a1, aD
li $a5, 7
sw $a5, 0($s2)
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a6, 0($s3)
beqz $a6, loc_10003AB8
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
b loc_10003ABC
ld $fp, 0x2E0+var_88($sp)
la $t9, malloc
jalr $t9
li $a0, 0x28
la $a4, editSeq
sw $v0, (editSeq - 0x1000BF7C)($a4)
li $t8, 1
sb $t8, 4($v0)
lw $t7, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0($t7)
lw $t6, (editSeq - 0x1000BF7C)($a4)
lwc1 $f25, flt_100092B0
swc1 $f20, 8($t6)
lw $t5, (editSeq - 0x1000BF7C)($a4)
lwc1 $f23, flt_100092A8
swc1 $f25, 0x10($t5)
lw $t4, (editSeq - 0x1000BF7C)($a4)
swc1 $f23, 0x14($t4)
lw $a7, (editSeq - 0x1000BF7C)($a4)
swc1 $f25, 0x10($a7)
lw $a6, (editSeq - 0x1000BF7C)($a4)
swc1 $f23, 0x14($a6)
lw $a5, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x20($a5)
lw $a3, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x1C($a3)
lw $a2, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x18($a2)
lw $a1, (editSeq - 0x1000BF7C)($a4)
la $a0, seqList
sw $zero, 0x24($a1)
lw $a0, (seqList - 0x1000BF78)($a0)
la $t9, seqList
beqz $a0, loc_100044E8
lw $a4, (editSeq - 0x1000BF7C)($a4)
sw $a0, 0x24($a4)
la $a0, editSeq
lw $a0, (editSeq - 0x1000BF7C)($a0)
b loc_10003DB0
sw $a0, (seqList - 0x1000BF78)($t9)
move $a0, $s0
move $t9, $s5
li $a1, 9
sw $a1, 0($s2)
la $a1, aD
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a2, 0($s3)
beqz $a2, loc_10004544
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
la $a4, relFrame
la $a5, absFrame
la $a3, seqList
la $a6, baseFrame
lw $a3, (seqList - 0x1000BF78)($a3)
swc1 $f20, (baseFrame - 0x1000A3C4)($a6)
swc1 $f20, (absFrame - 0x1000A3C8)($a5)
swc1 $f20, (relFrame - 0x1000A3C0)($a4)
beqz $a3, loc_1000468C
move $s4, $a3
lw $v0, 4($s2)
lw $a7, 0($s4)
beq $a7, $v0, loc_10004684
nop
lw $s4, 0x24($s4)
bnez $s4, loc_10004570
la $t9, malloc
jalr $t9
li $a0, 0x28
la $a4, editSeq
sw $v0, (editSeq - 0x1000BF7C)($a4)
lw $t7, 4($s2)
sw $t7, 0($v0)
lw $t6, (editSeq - 0x1000BF7C)($a4)
li $t5, 1
sb $t5, 4($t6)
lw $t4, (editSeq - 0x1000BF7C)($a4)
lwc1 $f29, flt_100092B0
swc1 $f20, 8($t4)
lw $a7, (editSeq - 0x1000BF7C)($a4)
lwc1 $f27, flt_100092A8
swc1 $f29, 0x10($a7)
lw $a6, (editSeq - 0x1000BF7C)($a4)
swc1 $f27, 0x14($a6)
lw $a5, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x18($a5)
lw $a3, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x1C($a3)
lw $a2, (editSeq - 0x1000BF7C)($a4)
sw $zero, 0x20($a2)
lw $a1, (editSeq - 0x1000BF7C)($a4)
la $a0, seqList
sw $zero, 0x24($a1)
lw $a0, (seqList - 0x1000BF78)($a0)
la $t8, editSeq
la $t9, seqList
beqz $a0, loc_10004608
lw $a4, (editSeq - 0x1000BF7C)($a4)
sw $a0, 0x24($a4)
lw $t8, (editSeq - 0x1000BF7C)($t8)
sw $t8, (seqList - 0x1000BF78)($t9)
la $t9, free
jalr $t9
move $a0, $s2
b loc_10003AE8
move $t9, $s5
lw $t9, 0x18($s4)
b loc_100041C4
sw $t9, 0x1C($s4)
move $a0, $s0
move $t9, $s5
la $a1, aD
li $ra, 0xA
sw $ra, 0($s2)
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $at, 0($s3)
beqz $at, loc_10003AA8
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
b loc_10003AAC
ld $a6, 0x2E0+var_78($sp)
la $v0, editSeq
sw $s4, (editSeq - 0x1000BF7C)($v0)
bnez $s4, loc_10004614
la $t9, free
b loc_10004588
la $t9, malloc
move $a0, $s0
move $t9, $s5
la $a1, aD
li $v1, 0xB
sw $v1, 0($s2)
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a0, 0($s3)
beqz $a0, loc_10003A98
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
b loc_10003A9C
ld $a4, 0x2E0+var_68($sp)
move $a0, $s0
move $t9, $s5
li $a1, 0xD
sw $a1, 0($s2)
la $a1, aD
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a2, 0($s3)
beqz $a2, loc_10004758
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
lbu $a3, 0($s3)
beqz $a3, loc_10004758
la $t9, printf
la $a0, 0x10010000
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
addiu $a0, (aWarningSNotImp - 0x10010000)
la $t9, free
jalr $t9
move $a0, $s2
b loc_10003AE8
move $t9, $s5
move $a0, $s0
move $t9, $s5
li $a1, 0xE
sw $a1, 0($s2)
la $a1, aD
jalr $t9
addiu $a2, $s2, 4
move $t9, $s6
move $a0, $s0
jalr $t9
la $a1, asc_10009340
lbu $a2, 0($s3)
beqz $a2, loc_10003A90
addu $s0, $v0, $s0
la $t9, printf
la $a0, aSD
addiu $a1, $sp, 0x2E0+var_2D8
jalr $t9
lw $a2, 4($s2)
b loc_10003A94
ld $a3, 0x2E0+var_60($sp)
beqz $a0, loc_100047DC
la $t9, free
la $t9, printf
la $a0, aS
jalr $t9
addiu $a1, $sp, 0x2E0+var_2D8
la $t9, free
jalr $t9
move $a0, $s2
b loc_10003AE8
move $t9, $s5
li $v0, 0xC7B0
addu $at, $t9, $v0
move $a3, $zero
lw $a2, (acttable_ptr - 0x10010F9C)($at)
lw $a5, 0($a2)
addiu $a2, 4
addiu $a3, 1
beqz $a5, loc_10004818
slti $a4, $a3, 0x400
sb $zero, 0($a5)
bnezl $a4, loc_10004804
lw $a5, 0($a2)
jr $ra
nop
addiu $sp, -0x30
sd $s1, 0x30+var_20($sp)
sd $ra, 0x30+var_18($sp)
sd $s0, 0x30+var_30($sp)
lui $at, 1
move $s0, $a0
sd $s2, 0x30+var_10($sp)
li $at, 0xC774
sd $gp, 0x30+var_28($sp)
beqz $a0, loc_10004904
addu $gp, $t9, $at
la $s1, seqList
sb $zero, 4($a0)
lw $a3, (seqList - 0x1000BF78)($s1)
bne $a0, $a3, loc_100048A4
la $s2, free
lw $a0, 0x24($a3)
sw $a0, (seqList - 0x1000BF78)($s1)
lw $a0, 0x18($a0)
beqz $a0, loc_10004894
move $t9, $s2
move $t9, $s2
jalr $t9
lw $s1, 0x14($a0)
bnez $s1, loc_1000487C
move $a0, $s1
move $t9, $s2
la $s1, seqList
jalr $t9
move $a0, $s0
lw $a3, (seqList - 0x1000BF78)($s1)
lw $a2, 0x24($a3)
beqz $a2, loc_10004904
la $s2, free
beq $a2, $s0, loc_100048D0
nop
move $a3, $a2
lw $a2, 0x24($a2)
bnez $a2, loc_100048B0
nop
b loc_10004908
ld $s2, 0x30+var_10($sp)
lw $a2, 0x24($s0)
sw $a2, 0x24($a3)
lw $a1, 0x18($s0)
beqz $a1, loc_100048F8
move $a0, $a1
move $t9, $s2
jalr $t9
lw $s1, 0x14($a0)
bnez $s1, loc_100048E4
move $a0, $s1
move $t9, $s2
jalr $t9
move $a0, $s0
ld $s2, 0x30+var_10($sp)
ld $ra, 0x30+var_18($sp)
ld $s0, 0x30+var_30($sp)
ld $s1, 0x30+var_20($sp)
ld $gp, 0x30+var_28($sp)
jr $ra
addiu $sp, 0x30
lui $v0, 1
addiu $sp, -0x20
li $v0, 0xC67C
sd $gp, 0x20+var_18($sp)
addu $gp, $t9, $v0
la $at, oflag
lbu $at, (oflag - 0x1000A3B8)($at)
sd $s0, 0x20+var_20($sp)
move $s0, $a0
beqz $at, loc_10004990
sd $ra, 0x20+var_10($sp)
lwc1 $f2, 8($a0)
lw $a2, 0x10($a0)
la $a3, currentFrame
lwc1 $f1, 8($a2)
lwc1 $f0, (currentFrame - 0x1000A3BC)($a3)
lw $a4, 0($a0)
cvt.d.s $f2, $f2
la $t9, printf
cvt.d.s $f1, $f1
la $a0, 0x10010000
dmfc1 $a5, $f2
cvt.d.s $f0, $f0
dmfc1 $a3, $f1
lw $a2, 0($a2)
dmfc1 $a1, $f0
jalr $t9
addiu $a0, (aProcCurrentfra - 0x10010000)
lw $a1, 0($s0)
la $a0, 0x10010000
sltiu $a5, $a1, 0x68
sll $a2, $a1, 2
addiu $a0, (jpt_100049B4 - 0x10010000)
la $a4, currentFrame
beqz $a5, loc_100049C8
addu $a0, $a2
lw $a2, 0($a0)
jr $a2
la $t9, exprand__Gf
jal killSeq__GP7animSeq
nop
lw $a1, 0($s0)
la $t9, printf
la $a0, 0x10010000
lw $a2, 0x10($s0)
jalr $t9
addiu $a0, (aWarningBadComm - 0x10010000)
lw $a2, 0x10($s0)
lw $a1, 0x1C($a2)
lw $a1, 0x14($a1)
sw $a1, 0x1C($a2)
ld $ra, 0x20+var_10($sp)
ld $s0, 0x20+var_20($sp)
ld $gp, 0x20+var_18($sp)
jr $ra
addiu $sp, 0x20
lw $a3, 0x10($s0)
lw $a2, 0x1C($a3)
lw $a2, 0x14($a2)
b loc_100049EC
sw $a2, 0x1C($a3)
jal exprand__Gf
lwc1 $f12, flt_100092A8
lwc1 $f8, flt_100092A8
lwc1 $f4, 0xC($s0)
lw $a4, 0x10($s0)
ldc1 $f9, dbl_10009308
cvt.d.s $f7, $f0
lwc1 $f5, 0x14($a4)
mul.d $f7, $f9
cvt.d.s $f6, $f4
sub.s $f8, $f5
mul.d $f6, $f7
lwc1 $f3, 8($a4)
cvt.d.s $f5, $f5
mul.s $f4, $f8
mul.d $f5, $f6
cvt.d.s $f4, $f4
cvt.d.s $f3, $f3
add.d $f4, $f5
add.d $f3, $f4
cvt.s.d $f3, $f3
swc1 $f3, 8($a4)
lw $a4, 0x10($s0)
lw $a3, 0x1C($a4)
lw $a3, 0x14($a3)
b loc_100049EC
sw $a3, 0x1C($a4)
lwc1 $f4, 0xC($s0)
dmtc1 $zero, $f6
cvt.d.s $f4, $f4
c.lt.d $f4, $f6
nop
bc1f loc_10004E0C
ldc1 $f5, dbl_10009300
b loc_10004E20
mov.d $f4, $f6
lwc1 $f4, 0xC($s0)
ldc1 $f5, dbl_10009300
cvt.d.s $f4, $f4
c.lt.d $f4, $f5
nop
bc1f loc_10004DEC
nop
b loc_10004DEC
mov.d $f4, $f5
la $a5, seqList
lw $a5, (seqList - 0x1000BF78)($a5)
beqz $a5, loc_100049C8
move $a0, $a5
lw $a1, 0x10($s0)
bne $a1, $a0, loc_100049BC
la $t9, killSeq__GP7animSeq
lw $a6, 0x1C($a1)
lw $a6, 0x14($a6)
sw $a6, 0x1C($a1)
lw $a0, 0x24($a0)
bnez $a0, loc_10004AD8
nop
b loc_100049C8
lw $a1, 0($s0)
la $a7, seqList
lw $a7, (seqList - 0x1000BF78)($a7)
beqz $a7, loc_10004D24
move $a0, $a7
b loc_10004D18
lw $a1, 4($s0)
lw $t5, 0x10($s0)
lw $t4, 0x1C($t5)
lw $t4, 0x14($t4)
b loc_100049EC
sw $t4, 0x1C($t5)
lw $t7, 0x10($s0)
lw $t6, 0x18($t7)
sw $t6, 0x1C($t7)
lw $t5, 0x10($s0)
lwc1 $f6, 0xC($t5)
lwc1 $f5, 8($t5)
add.s $f5, $f6
b loc_100049EC
swc1 $f5, 8($t5)
la $t8, seqList
lw $t8, (seqList - 0x1000BF78)($t8)
beqz $t8, loc_10004D60
move $a0, $t8
b loc_10004D54
lw $a1, 4($s0)
la $t9, seqList
lw $t9, (seqList - 0x1000BF78)($t9)
beqz $t9, loc_10004DA0
move $a0, $t9
b loc_10004D94
lw $a1, 4($s0)
lw $at, 0x10($s0)
lw $ra, 0x1C($at)
lw $ra, 0x14($ra)
b loc_100049EC
sw $ra, 0x1C($at)
la $t9, stopAnimation__Gv
jal stopAnimation__Gv
nop
lw $v0, 0x10($s0)
lw $at, 0x1C($v0)
lw $at, 0x14($at)
b loc_100049EC
sw $at, 0x1C($v0)
lw $a1, 4($s0)
la $a0, acttable
sll $a1, 2
addu $a0, $a1
lw $a0, 0($a0)
beqz $a0, loc_10004BD8
nop
sb $zero, 0($a0)
lw $a3, 0x10($s0)
lw $a2, 0x1C($a3)
lw $a2, 0x14($a2)
b loc_100049EC
sw $a2, 0x1C($a3)
lw $a4, 0x10($s0)
lw $a3, 0x1C($a4)
lw $a3, 0x14($a3)
b loc_100049EC
sw $a3, 0x1C($a4)
lw $a1, 4($s0)
la $a0, acttable
sll $a1, 2
addu $a0, $a1
lw $a0, 0($a0)
beqz $a0, loc_10004C24
nop
lwc1 $f7, 0x24($a0)
swc1 $f7, 0x18($a0)
lw $a3, 0x10($s0)
lw $a2, 0x1C($a3)
lw $a2, 0x14($a2)
b loc_100049EC
sw $a2, 0x1C($a3)
lw $a1, 4($s0)
la $a0, acttable
sll $a1, 2
addu $a0, $a1
lw $a0, 0($a0)
beqz $a0, loc_10004C5C
nop
lwc1 $f8, 0xC($s0)
swc1 $f8, 0x18($a0)
lw $a3, 0x10($s0)
lw $a2, 0x1C($a3)
lw $a2, 0x14($a2)
b loc_100049EC
sw $a2, 0x1C($a3)
lw $a1, 4($s0)
la $a0, acttable
sll $a1, 2
addu $a0, $a1
lw $a0, 0($a0)
beqz $a0, loc_10004E6C
nop
lwc1 $f5, 0xC($s0)
lwc1 $f4, 0x10($a0)
c.lt.s $f4, $f5
nop
bc1f loc_10004E80
lwc1 $f6, 0xC($a0)
c.lt.s $f5, $f6
nop
bc1f loc_10004E40
nop
b loc_10004E40
mov.s $f5, $f6
lw $a1, 4($s0)
la $a0, acttable
sll $a1, 2
addu $a0, $a1
lw $a0, 0($a0)
beqz $a0, loc_10004DD8
nop
lwc1 $f5, 0xC($s0)
lwc1 $f4, 0x10($a0)
c.lt.s $f4, $f5
nop
bc1f loc_10004DD4
nop
b loc_10004DD4
mov.s $f5, $f4
lw $a3, 0x10($s0)
lw $a2, 0x1C($a3)
lw $a2, 0x14($a2)
b loc_100049EC
sw $a2, 0x1C($a3)
lw $a0, 0x24($a0)
beqz $a0, loc_10004D24
nop
lw $a3, 0($a0)
bne $a3, $a1, loc_10004D0C
nop
lw $a1, 0x10($s0)
bne $a1, $a0, loc_100049F0
ld $ra, 0x20+var_10($sp)
beqz $a0, loc_10004EB4
la $t9, killSeq__GP7animSeq
jal killSeq__GP7animSeq
nop
b loc_100049F0
ld $ra, 0x20+var_10($sp)
lw $a0, 0x24($a0)
beqz $a0, loc_10004D6C
nop
lw $a4, 0($a0)
bne $a4, $a1, loc_10004D48
nop
beqz $a0, loc_10004D6C
nop
sw $zero, 0x1C($a0)
lw $a1, 0x10($s0)
beq $a1, $a0, loc_100049F0
ld $ra, 0x20+var_10($sp)
lw $a5, 0x1C($a1)
lw $a5, 0x14($a5)
b loc_100049EC
sw $a5, 0x1C($a1)
lw $a0, 0x24($a0)
beqz $a0, loc_10004DB8
nop
lw $a6, 0($a0)
bne $a6, $a1, loc_10004D88
nop
beqz $a0, loc_10004DB8
nop
lw $a7, 0x18($a0)
sw $a7, 0x1C($a0)
lwc1 $f9, 0($a4)
swc1 $f9, 8($a0)
lw $a1, 0x10($s0)
beq $a1, $a0, loc_100049F0
ld $ra, 0x20+var_10($sp)
lw $t4, 0x1C($a1)
lw $t4, 0x14($t4)
b loc_100049EC
sw $t4, 0x1C($a1)
swc1 $f5, 0x10($a0)
lw $t6, 0x10($s0)
lw $t5, 0x1C($t6)
lw $t5, 0x14($t5)
b loc_100049EC
sw $t5, 0x1C($t6)
lw $t7, 0x10($s0)
cvt.s.d $f10, $f4
swc1 $f10, 0x10($t7)
lw $t7, 0x10($s0)
lw $t6, 0x1C($t7)
lw $t6, 0x14($t6)
b loc_100049EC
sw $t6, 0x1C($t7)
c.lt.d $f5, $f4
nop
bc1f loc_10004E20
nop
mov.d $f4, $f5
lw $t9, 0x10($s0)
cvt.s.d $f11, $f4
swc1 $f11, 0x14($t9)
lw $t9, 0x10($s0)
lw $t8, 0x1C($t9)
lw $t8, 0x14($t8)
b loc_100049EC
sw $t8, 0x1C($t9)
b loc_10004E4C
swc1 $f5, 0xC($a0)
swc1 $f5, 0x10($a0)
lw $v0, 0x10($s0)
lwc1 $f13, 0x10($v0)
swc1 $f13, 0x1C($a0)
lw $at, 0x10($s0)
lwc1 $f12, 0x14($at)
li $ra, 1
sb $ra, 0($a0)
swc1 $f12, 0x20($a0)
lw $a0, 0x10($s0)
lw $v1, 0x1C($a0)
lw $v1, 0x14($v1)
b loc_100049EC
sw $v1, 0x1C($a0)
c.lt.s $f4, $f6
nop
bc1f loc_10004E94
mov.s $f5, $f4
mov.s $f5, $f6
swc1 $f5, 0xC($a0)
lwc1 $f6, 0xC($s0)
c.lt.s $f4, $f6
nop
bc1f loc_10004E48
mov.s $f5, $f6
b loc_10004E48
mov.s $f5, $f4
lw $a0, 0x1C($a1)
lw $a0, 0x14($a0)
b loc_100049EC
sw $a0, 0x1C($a1)
addiu $sp, -0x30
sd $ra, 0x30+var_8($sp)
sd $s0, 0x30+var_18($sp)
sdc1 $f20, 0x30+var_30($sp)
sd $s2, 0x30+var_10($sp)
lui $v0, 1
sd $s1, 0x30+var_20($sp)
li $v0, 0xC0D8
sd $gp, 0x30+var_28($sp)
addu $gp, $t9, $v0
lwc1 $f1, flt_100092A8
la $s1, currentFrame
la $at, seqList
lwc1 $f0, (currentFrame - 0x1000A3BC)($s1)
lw $at, (seqList - 0x1000BF78)($at)
la $s2, processCommand__GP11animCommand
ldc1 $f20, dbl_100092D8
add.s $f0, $f1
move $s0, $at
beqz $at, loc_10004FCC
swc1 $f0, (currentFrame - 0x1000A3BC)($s1)
b loc_10004F2C
lwc1 $f4, (currentFrame - 0x1000A3BC)($s1)
lw $s0, 0x24($s0)
beqz $s0, loc_10004FCC
lwc1 $f4, 0($s1)
lwc1 $f5, 8($s0)
cvt.d.s $f4, $f4
cvt.d.s $f2, $f5
add.d $f4, $f20
c.lt.d $f2, $f4
lw $a0, 0x1C($s0)
bc1f loc_10004F20
lbu $a2, 4($s0)
beqz $a2, loc_10004F20
nop
beqz $a0, loc_10004F20
nop
lwc1 $f6, 8($a0)
add.s $f6, $f5
cvt.d.s $f6, $f6
c.lt.d $f6, $f4
nop
bc1f loc_10004F20
nop
move $t9, $s2
jal processCommand__GP11animCommand
nop
lbu $v1, 4($s0)
lwc1 $f9, 8($s0)
lwc1 $f8, 0($s1)
beqz $v1, loc_10004FC4
lw $a0, 0x1C($s0)
beqz $a0, loc_10004FC4
nop
lwc1 $f7, 8($a0)
cvt.d.s $f8, $f8
add.s $f7, $f9
add.d $f8, $f20
cvt.d.s $f7, $f7
c.lt.d $f7, $f8
nop
bc1t loc_10004F7C
move $t9, $s2
b loc_10004F24
lw $s0, 0x24($s0)
ld $gp, 0x30+var_28($sp)
ld $s0, 0x30+var_18($sp)
ld $ra, 0x30+var_8($sp)
ld $s1, 0x30+var_20($sp)
ld $s2, 0x30+var_10($sp)
ldc1 $f20, 0x30+var_30($sp)
jr $ra
addiu $sp, 0x30
addiu $sp, -0x30
sd $s2, 0x30+var_28($sp)
sd $ra, 0x30+var_18($sp)
sdc1 $f20, 0x30+var_30($sp)
sd $s1, 0x30+var_20($sp)
lui $at, 1
sd $s0, 0x30+var_10($sp)
li $at, 0xBFB0
sd $gp, 0x30+var_8($sp)
addu $gp, $t9, $at
la $s0, acttable
move $s1, $zero
b loc_10005034
lwc1 $f20, flt_100092A8
addiu $s1, 1
slti $v0, $s1, 0x400
beqz $v0, loc_10005108
addiu $s0, 4
lw $s2, 0($s0)
beqz $s2, loc_10005024
nop
lbu $v1, 0($s2)
beqz $v1, loc_10005024
lbu $a1, 1($s2)
bnez $a1, loc_10005024
la $t9, drand48
li $a0, 1
jalr $t9
sb $a0, 1($s2)
lwc1 $f3, 0xC($s2)
cvt.s.d $f0, $f0
lwc1 $f1, 0x10($s2)
sub.s $f2, $f20, $f0
mul.s $f0, $f3, $f0
la $t9, exprand__Gf
mul.s $f1, $f2
add.s $f0, $f1
mov.s $f12, $f20
jal exprand__Gf
swc1 $f0, 8($s2)
lwc1 $f6, flt_100092AC
lwc1 $f2, 0x20($s2)
lwc1 $f1, 0x1C($s2)
mul.s $f3, $f0, $f6
sub.s $f4, $f20, $f2
mul.s $f3, $f1, $f3
mul.s $f1, $f4
mul.s $f2, $f3
add.s $f1, $f2
c.lt.s $f1, $f20
nop
bc1f loc_10005128
mov.s $f5, $f20
lwc1 $f7, 0x14($s2)
lwc1 $f4, 8($s2)
sub.s $f4, $f7
div.s $f4, $f5
mtc1 $zero, $f7
nop
c.lt.s $f7, $f4
addiu $s0, 4
addiu $a2, $s1, 1
slti $a1, $s1, 0x3FF
move $s1, $a2
bc1f loc_100050FC
swc1 $f4, 0x14($s2)
b loc_10005100
mov.s $f4, $f20
lwc1 $f4, flt_100092B4
bnez $a1, loc_10005034
swc1 $f4, 4($s2)
ld $gp, 0x30+var_8($sp)
ld $s0, 0x30+var_10($sp)
ld $ra, 0x30+var_18($sp)
ld $s1, 0x30+var_20($sp)
ld $s2, 0x30+var_28($sp)
ldc1 $f20, 0x30+var_30($sp)
jr $ra
addiu $sp, 0x30
la $t9, exprand__Gf
jal exprand__Gf
mov.s $f12, $f20
lwc1 $f6, flt_100092AC
lwc1 $f7, 0x20($s2)
lwc1 $f5, 0x1C($s2)
mul.s $f8, $f0, $f6
sub.s $f9, $f20, $f7
mul.s $f8, $f5, $f8
mul.s $f5, $f9
mul.s $f7, $f8
b loc_100050C0
add.s $f5, $f7
addiu $a4, $a0, -1
sll $a6, $a0, 2
lui $v0, 1
addu $a5, $a1, $a6
li $v0, 0xBE40
blez $a0, loc_100051A0
addu $at, $t9, $v0
lwc1 $f2, (flt_100092A8 - 0x10010F9C)($at)
sll $v1, $a4, 2
lwc1 $f0, 0($a5)
addu $v1, $a1, $v1
lwc1 $f1, 0($v1)
sub.s $f2, $f14
mul.s $f0, $f14
mul.s $f1, $f2
jr $ra
add.s $f0, $f1
b loc_10005178
addiu $a4, 0x80
addiu $a4, $a0, -1
lui $v0, 1
sll $a5, $a0, 2
li $v0, 0xBDF4
blez $a0, loc_10005238
addu $at, $t9, $v0
addu $a2, $a5, $a1
lwc1 $f5, 0($a2)
sll $v1, $a4, 2
lwc1 $f8, (flt_100092B8 - 0x10010F9C)($at)
addu $v1, $a1
lwc1 $f6, 0($v1)
mul.s $f8, $f15, $f8
sub.s $f4, $f5, $f6
lwc1 $f7, (flt_100092A8 - 0x10010F9C)($at)
c.lt.s $f8, $f4
lwc1 $f9, (flt_100092BC - 0x10010F9C)($at)
bc1t loc_10005224
sub.s $f7, $f14
mul.s $f10, $f15, $f9
c.lt.s $f4, $f10
nop
bc1f loc_10005218
mul.s $f8, $f7, $f6
add.s $f0, $f5, $f15
mul.s $f0, $f14, $f0
jr $ra
add.s $f0, $f8, $f0
mul.s $f0, $f5, $f14
jr $ra
add.s $f0, $f8, $f0
add.s $f0, $f6, $f15
mul.s $f1, $f5, $f14
mul.s $f0, $f7, $f0
jr $ra
add.s $f0, $f1
b loc_100051C0
addiu $a4, 0x80
addiu $sp, -0x20
sd $s0, 0x20+var_18($sp)
sd $s1, 0x20+var_10($sp)
lui $at, 1
sd $ra, 0x20+var_8($sp)
li $at, 0xBD5C
sd $gp, 0x20+var_20($sp)
beqz $a1, loc_100052DC
addu $gp, $t9, $at
la $t9, glBegin
jalr $t9
li $a0, 9
la $s0, glVertex2f
la $s1, square
move $t9, $s0
lwc1 $f12, (square - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+4 - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+8 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0xC - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x10 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x14 - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x18 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x1C - 0x10008E50)($s1)
la $t9, glEnd
jalr $t9
nop
ld $ra, 0x20+var_8($sp)
ld $s0, 0x20+var_18($sp)
ld $s1, 0x20+var_10($sp)
ld $gp, 0x20+var_20($sp)
jr $ra
addiu $sp, 0x20
la $t9, glBegin
jalr $t9
li $a0, 1
la $s0, glVertex2f
la $s1, square
move $t9, $s0
lwc1 $f12, (square - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+4 - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+8 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0xC - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+8 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0xC - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x10 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x14 - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x10 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x14 - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x18 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x1C - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square+0x18 - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+0x1C - 0x10008E50)($s1)
move $t9, $s0
lwc1 $f12, (square - 0x10008E50)($s1)
jalr $t9
lwc1 $f13, (square+4 - 0x10008E50)($s1)
la $t9, glEnd
jalr $t9
nop
b loc_100052C8
ld $ra, 0x20+var_8($sp)
addiu $sp, -0x110
sdc1 $f22, 0x110+var_F8($sp)
lui $at, 1
sd $s0, 0x110+var_C0($sp)
li $at, 0xBC18
sd $gp, 0x110+var_B0($sp)
addu $gp, $t9, $at
lwc1 $f22, flt_100092A8
la $s0, glColor3f
mov.s $f12, $f22
move $t9, $s0
sd $s1, 0x110+var_10($sp)
mov.s $f13, $f22
sd $ra, 0x110+var_B8($sp)
jalr $t9
mov.s $f14, $f22
la $s1, glPushMatrix
move $t9, $s1
sdc1 $f20, 0x110+var_70($sp)
jalr $t9
sd $fp, 0x110+var_30($sp)
mtc1 $zero, $f20
la $fp, glRotatef
sdc1 $f24, 0x110+var_58($sp)
mov.s $f13, $f22
la $v0, wheel
move $t9, $fp
sd $s3, 0x110+var_40($sp)
mov.s $f14, $f20
lwc1 $f12, (wheel - 0x1000A3CC)($v0)
jalr $t9
mov.s $f15, $f20
lwc1 $f24, flt_100092BC
sdc1 $f26, 0x110+var_68($sp)
sdc1 $f30, 0x110+var_60($sp)
sdc1 $f28, 0x110+var_50($sp)
sd $s6, 0x110+var_38($sp)
sd $s7, 0x110+var_18($sp)
sd $s5, 0x110+var_20($sp)
la $a3, nlimit
la $a1, n
lw $v1, (nlimit - 0x1000BF70)($a3)
sd $s4, 0x110+var_28($sp)
lw $a4, (n - 0x1000BF6C)($a1)
slt $v1, $zero, $v1
sd $s2, 0x110+var_48($sp)
sd $v1, 0x110+var_A8($sp)
beqz $v1, loc_100054E4
move $s3, $a4
la $s2, twixt__GiPff
la $s4, glTranslatef
la $s5, dzoom
b loc_100054B8
la $s1, t
slti $a0, $s0, 0x80
bnez $a0, loc_10005470
move $t9, $s2
addiu $s0, -0x80
move $t9, $s2
move $a0, $s0
move $a1, $s5
jal twixt__GiPff
lwc1 $f14, 0($s1)
mov.s $f12, $f20
move $t9, $s4
mov.s $f13, $f20
jalr $t9
mul.s $f14, $f0, $f24
la $a3, nlimit
la $a1, n
lw $a0, (nlimit - 0x1000BF70)($a3)
lw $a4, (n - 0x1000BF6C)($a1)
addiu $s3, -1
subu $a0, $a4, $a0
slt $a2, $a0, $s3
beqz $a2, loc_100054E0
slt $a2, $a0, $a4
sra $a2, $s3, 31
xor $a0, $s3, $a2
subu $a0, $a2
andi $a0, 0x7F
xor $a0, $a2
subu $a0, $a2
bgez $a0, loc_1000545C
move $s0, $a0
b loc_1000545C
addiu $s0, $a0, 0x80
sd $a2, 0x110+var_A8($sp)
la $s5, foldtwixt__GiPffT3
la $s1, t
la $s4, glTranslatef
ld $at, 0x110+var_A8($sp)
la $s2, twixt__GiPff
la $s7, colRGBA
la $s6, outlinecolRGBA
beqz $at, loc_10005858
move $s3, $a4
addiu $a4, $s7, (colRGBA+8 - 0x10008E98)
sd $a4, 0x110+var_98($sp)
addiu $a2, $s7, (colRGBA+4 - 0x10008E98)
sd $a2, 0x110+var_80($sp)
addiu $v1, $s6, (outlinecolRGBA+8 - 0x10008E88)
sd $v1, 0x110+var_88($sp)
addiu $v0, $s6, (outlinecolRGBA+4 - 0x10008E88)
b loc_10005C10
sd $v0, 0x110+var_90($sp)
slti $a5, $s0, 0x80
bnez $a5, loc_10005540
move $t9, $s2
addiu $s0, -0x80
move $t9, $s2
la $a1, x
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
move $t9, $s2
la $a1, y
mov.s $f30, $f0
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
sdc1 $f0, 0x110+var_D0($sp)
move $t9, $s2
la $a1, dzoom
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
move $t9, $s2
la $a1, arm
mov.s $f24, $f0
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
sdc1 $f0, 0x110+var_C8($sp)
la $a1, wrist
move $t9, $s2
lwc1 $f14, 0($s1)
move $a0, $s0
jal twixt__GiPff
sdc1 $f24, 0x110+var_100($sp)
move $t9, $s2
la $a1, size
mov.s $f28, $f0
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
lwc1 $f24, flt_10009290
move $t9, $s5
mov.s $f26, $f0
la $a1, spin
move $a0, $s0
lwc1 $f14, 0($s1)
jal foldtwixt__GiPffT3
mov.s $f15, $f24
sdc1 $f0, 0x110+var_E0($sp)
la $a1, flip
move $t9, $s5
lwc1 $f14, 0($s1)
move $a0, $s0
mov.s $f15, $f24
jal foldtwixt__GiPffT3
sdc1 $f26, 0x110+var_108($sp)
sdc1 $f0, 0x110+var_D8($sp)
move $t9, $s2
la $a1, dtwist
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
move $t9, $s5
mov.s $f24, $f0
la $a1, hue
move $a0, $s0
lwc1 $f14, 0($s1)
jal foldtwixt__GiPffT3
mov.s $f15, $f22
la $a1, alpha
move $t9, $s2
lwc1 $f14, 0($s1)
mov.s $f26, $f0
move $a0, $s0
jal twixt__GiPff
sdc1 $f24, 0x110+var_110($sp)
sdc1 $f0, 0x110+var_E8($sp)
move $t9, $s5
la $a1, light
move $a0, $s0
lwc1 $f14, 0($s1)
jal foldtwixt__GiPffT3
mov.s $f15, $f22
move $t9, $s2
la $a1, alphaout
mov.s $f24, $f0
move $a0, $s0
jal twixt__GiPff
lwc1 $f14, 0($s1)
la $t9, hls_to_rgb__GfN21PfN24
sdc1 $f0, 0x110+var_F0($sp)
mov.s $f12, $f26
mov.s $f13, $f24
ld $a4, 0x110+var_80($sp)
mov.s $f14, $f22
move $a3, $s7
jal hls_to_rgb__GfN21PfN24
ld $a5, 0x110+var_98($sp)
lwc1 $f7, flt_100092B8
add.s $f5, $f26, $f7
ldc1 $f6, dbl_10009300
cvt.d.s $f2, $f5
ldc1 $f1, 0x110+var_F0($sp)
c.lt.d $f6, $f2
ldc1 $f0, 0x110+var_E8($sp)
swc1 $f1, 0xC($s6)
swc1 $f0, 0xC($s7)
bc1f loc_100056E8
mov.s $f12, $f5
lwc1 $f12, flt_100092B4
add.s $f12, $f5, $f12
la $t9, hls_to_rgb__GfN21PfN24
sub.s $f13, $f22, $f24
ld $a4, 0x110+var_90($sp)
mov.s $f14, $f22
move $a3, $s6
jal hls_to_rgb__GfN21PfN24
ld $a5, 0x110+var_88($sp)
la $t9, glPushMatrix
jalr $t9
nop
move $t9, $s4
mov.s $f12, $f30
ldc1 $f13, 0x110+var_D0($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
ldc1 $f12, 0x110+var_E0($sp)
jalr $t9
mov.s $f15, $f22
move $t9, $s4
mov.s $f12, $f20
ldc1 $f13, 0x110+var_C8($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f22
ldc1 $f12, 0x110+var_D8($sp)
jalr $t9
mov.s $f15, $f20
mov.s $f12, $f28
move $t9, $s4
mov.s $f13, $f20
jalr $t9
mov.s $f14, $f20
la $a6, fill
addu $a6, $s0, $a6
sd $a6, 0x110+var_78($sp)
lbu $a6, 0($a6)
beqz $a6, loc_100057BC
la $a7, outline
la $t9, glColor3f
lwc1 $f12, 0($s7)
lwc1 $f13, 4($s7)
jalr $t9
lwc1 $f14, 8($s7)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
li $a1, 1
la $a7, outline
addu $a7, $s0, $a7
sd $a7, 0x110+var_A0($sp)
lbu $a7, 0($a7)
beqz $a7, loc_100057F8
la $t9, glPopMatrix
la $t9, glColor3f
lwc1 $f12, 0($s6)
lwc1 $f13, 4($s6)
jalr $t9
lwc1 $f14, 8($s6)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
move $a1, $zero
la $t9, glPopMatrix
jalr $t9
nop
la $a1, n
la $a3, nlimit
la $t4, sflag
lbu $t4, (sflag - 0x1000A3B9)($t4)
beqz $t4, loc_100058AC
la $t9, glScalef
lw $t6, (nlimit - 0x1000BF70)($a3)
addiu $s3, -1
lw $t5, (n - 0x1000BF6C)($a1)
sra $a2, $s3, 31
xor $a0, $s3, $a2
subu $t5, $t6
subu $a0, $a2
slt $t5, $s3
andi $a0, 0x7F
xor $a0, $a2
beqz $t5, loc_10005858
subu $a0, $a2
bgez $a0, loc_1000552C
move $s0, $a0
b loc_1000552C
addiu $s0, $a0, 0x80
ld $s2, 0x110+var_48($sp)
ld $s3, 0x110+var_40($sp)
ld $s6, 0x110+var_38($sp)
ld $fp, 0x110+var_30($sp)
ld $s4, 0x110+var_28($sp)
ld $s0, 0x110+var_C0($sp)
ld $s5, 0x110+var_20($sp)
ld $s7, 0x110+var_18($sp)
ld $s1, 0x110+var_10($sp)
ldc1 $f20, 0x110+var_70($sp)
ldc1 $f26, 0x110+var_68($sp)
ldc1 $f30, 0x110+var_60($sp)
la $t9, glPopMatrix
ldc1 $f22, 0x110+var_F8($sp)
ldc1 $f24, 0x110+var_58($sp)
jalr $t9
ldc1 $f28, 0x110+var_50($sp)
ld $ra, 0x110+var_B8($sp)
ld $gp, 0x110+var_B0($sp)
jr $ra
addiu $sp, 0x110
mov.s $f12, $f22
lwc1 $f13, flt_100092B4
jalr $t9
mov.s $f14, $f22
la $t9, glPushMatrix
jalr $t9
nop
move $t9, $s4
mov.s $f12, $f30
ldc1 $f13, 0x110+var_D0($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
ldc1 $f12, 0x110+var_E0($sp)
jalr $t9
mov.s $f15, $f22
move $t9, $s4
mov.s $f12, $f20
ldc1 $f13, 0x110+var_C8($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f22
ldc1 $f12, 0x110+var_D8($sp)
jalr $t9
mov.s $f15, $f20
mov.s $f12, $f28
move $t9, $s4
mov.s $f13, $f20
jalr $t9
mov.s $f14, $f20
ldc1 $f13, 0x110+var_108($sp)
la $t9, glScalef
mov.s $f14, $f22
jalr $t9
mov.s $f12, $f13
ld $a1, 0x110+var_78($sp)
lbu $a1, 0($a1)
beqz $a1, loc_10005980
ld $a2, 0x110+var_A0($sp)
la $t9, glColor3f
lwc1 $f12, 0($s7)
lwc1 $f13, 4($s7)
jalr $t9
lwc1 $f14, 8($s7)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
li $a1, 1
ld $a2, 0x110+var_A0($sp)
lbu $a2, 0($a2)
beqz $a2, loc_100059B4
la $t9, glPopMatrix
la $t9, glColor3f
lwc1 $f12, 0($s6)
lwc1 $f13, 4($s6)
jalr $t9
lwc1 $f14, 8($s6)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
move $a1, $zero
la $t9, glPopMatrix
jalr $t9
nop
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
lwc1 $f12, flt_100092A0
jalr $t9
mov.s $f15, $f22
la $t9, glPushMatrix
jalr $t9
nop
move $t9, $s4
mov.s $f12, $f30
ldc1 $f13, 0x110+var_D0($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
ldc1 $f12, 0x110+var_E0($sp)
jalr $t9
mov.s $f15, $f22
move $t9, $s4
mov.s $f12, $f20
ldc1 $f13, 0x110+var_C8($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f22
ldc1 $f12, 0x110+var_D8($sp)
jalr $t9
mov.s $f15, $f20
mov.s $f12, $f28
move $t9, $s4
mov.s $f13, $f20
jalr $t9
mov.s $f14, $f20
ldc1 $f13, 0x110+var_108($sp)
la $t9, glScalef
mov.s $f14, $f22
jalr $t9
mov.s $f12, $f13
ld $a3, 0x110+var_78($sp)
lbu $a3, 0($a3)
beqz $a3, loc_10005A90
la $t9, glColor3f
lwc1 $f12, 0($s7)
lwc1 $f13, 4($s7)
jalr $t9
lwc1 $f14, 8($s7)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
li $a1, 1
ld $a4, 0x110+var_A0($sp)
lbu $a4, 0($a4)
beqz $a4, loc_10005AC0
la $t9, glColor3f
lwc1 $f12, 0($s6)
lwc1 $f13, 4($s6)
jalr $t9
lwc1 $f14, 8($s6)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
move $a1, $zero
la $t9, glPopMatrix
jalr $t9
nop
la $t9, glScalef
mov.s $f12, $f22
lwc1 $f13, flt_100092B4
jalr $t9
mov.s $f14, $f22
la $t9, glPushMatrix
jalr $t9
nop
move $t9, $s4
mov.s $f12, $f30
ldc1 $f13, 0x110+var_D0($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
ldc1 $f12, 0x110+var_E0($sp)
jalr $t9
mov.s $f15, $f22
move $t9, $s4
mov.s $f12, $f20
ldc1 $f13, 0x110+var_C8($sp)
jalr $t9
mov.s $f14, $f20
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f22
ldc1 $f12, 0x110+var_D8($sp)
jalr $t9
mov.s $f15, $f20
mov.s $f12, $f28
move $t9, $s4
mov.s $f13, $f20
jalr $t9
mov.s $f14, $f20
ldc1 $f13, 0x110+var_108($sp)
la $t9, glScalef
mov.s $f14, $f22
jalr $t9
mov.s $f12, $f13
ld $a5, 0x110+var_78($sp)
lbu $a5, 0($a5)
beqz $a5, loc_10005B9C
la $t9, glColor3f
lwc1 $f12, 0($s7)
lwc1 $f13, 4($s7)
jalr $t9
lwc1 $f14, 8($s7)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
li $a1, 1
ld $a6, 0x110+var_A0($sp)
lbu $a6, 0($a6)
beqz $a6, loc_10005BCC
la $t9, glColor3f
lwc1 $f12, 0($s6)
lwc1 $f13, 4($s6)
jalr $t9
lwc1 $f14, 8($s6)
la $t9, drawshape__GiT1
move $a0, $s0
jal drawshape__GiT1
move $a1, $zero
la $t9, glPopMatrix
jalr $t9
nop
mov.s $f13, $f20
move $t9, $fp
mov.s $f14, $f20
ldc1 $f12, 0x110+var_110($sp)
jalr $t9
mov.s $f15, $f22
move $t9, $s4
mov.s $f12, $f20
mov.s $f13, $f20
jalr $t9
ldc1 $f14, 0x110+var_100($sp)
la $a1, n
b loc_10005818
la $a3, nlimit
sra $a2, $s3, 31
xor $a0, $s3, $a2
subu $a0, $a2
andi $a0, 0x7F
xor $a0, $a2
subu $a0, $a2
b loc_10005848
nop
li $v0, 0xB36C
dmtc1 $zero, $f9
addu $at, $t9, $v0
move $a3, $zero
b loc_10005C54
lw $a4, (acttable_ptr - 0x10010F9C)($at)
swc1 $f5, 0x18($a2)
beqz $a5, locret_10005CB8
addiu $a3, 1
lw $a2, 0($a4)
addiu $a4, 4
beqz $a2, loc_10005C50
slti $a5, $a3, 0x400
lwc1 $f8, 0x18($a2)
lwc1 $f7, 4($a2)
lbu $v1, 0($a2)
lwc1 $f4, 8($a2)
lbu $a6, 1($a2)
beqz $v1, loc_10005C50
lwc1 $f6, 0x14($a2)
beqz $a6, loc_10005C50
nop
add.s $f5, $f6, $f8
sub.s $f0, $f4, $f5
mul.s $f0, $f7, $f0
cvt.d.s $f0, $f0
c.lt.d $f0, $f9
nop
bc1f loc_10005C4C
nop
mov.s $f5, $f4
b loc_10005C4C
sb $zero, 1($a2)
jr $ra
nop
lui $at, 1
addiu $sp, -0x10
li $at, 0xB2DC
sd $gp, 0x10+var_8($sp)
addu $gp, $t9, $at
la $t9, malloc
sd $ra, 0x10+var_10($sp)
jalr $t9
li $a0, 0x28
lwc1 $f2, flt_100092A8
lwc1 $f1, flt_100092C0
ld $gp, 0x10+var_8($sp)
mtc1 $zero, $f0
swc1 $f2, 4($v0)
swc1 $f0, 8($v0)
swc1 $f0, 0xC($v0)
swc1 $f0, 0x10($v0)
swc1 $f0, 0x14($v0)
swc1 $f0, 0x18($v0)
ld $ra, 0x10+var_10($sp)
swc1 $f0, 0x1C($v0)
swc1 $f1, 0x20($v0)
addiu $sp, 0x10
jr $ra
swc1 $f0, 0x24($v0)
addiu $sp, -0x20
lui $at, 1
sd $s1, 0x20+var_20($sp)
li $at, 0xB278
sd $gp, 0x20+var_10($sp)
addu $gp, $t9, $at
la $s1, createBlankActAnim__Gv
move $t9, $s1
sd $ra, 0x20+var_18($sp)
jal createBlankActAnim__Gv
sd $s0, 0x20+var_8($sp)
la $s0, acttable
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x48 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x124 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x7C - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x98 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x140 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x1B0 - 0x100093B8)($s0)
lwc1 $f0, flt_100092C4
move $t9, $s1
swc1 $f0, 0x18($v0)
jal createBlankActAnim__Gv
sw $v0, (acttable+0xD0 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x194 - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x1FC - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x1EC - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x15C - 0x100093B8)($s0)
move $t9, $s1
jal createBlankActAnim__Gv
sw $v0, (acttable+0x178 - 0x100093B8)($s0)
lwc1 $f1, flt_100092A8
move $t9, $s1
swc1 $f1, 0x18($v0)
jal createBlankActAnim__Gv
sw $v0, (acttable+0xB4 - 0x100093B8)($s0)
ld $s1, 0x20+var_20($sp)
ld $ra, 0x20+var_18($sp)
ld $gp, 0x20+var_10($sp)
sw $v0, (acttable+0x208 - 0x100093B8)($s0)
ld $s0, 0x20+var_8($sp)
jr $ra
addiu $sp, 0x20
lui $at, 1
addiu $sp, -0x20
li $at, 0xB180
sd $gp, 0x20+var_10($sp)
addu $gp, $t9, $at
la $t9, glViewport
move $a3, $a1
sd $s3, 0x20+var_20($sp)
move $s3, $a0
move $a0, $zero
sd $a1, 0x20+var_8($sp)
move $a1, $zero
sd $ra, 0x20+var_18($sp)
jalr $t9
move $a2, $s3
la $t9, glMatrixMode
jalr $t9
li $a0, 0x1701
la $t9, glLoadIdentity
jalr $t9
nop
ld $v0, 0x20+var_8($sp)
mtc1 $s3, $f13
mtc1 $v0, $f14
cvt.s.w $f13, $f13
cvt.s.w $f14, $f14
div.s $f13, $f14
la $t9, gluPerspective
ldc1 $f15, dbl_10009320
ldc1 $f12, dbl_10009310
ldc1 $f14, dbl_10009318
jalr $t9
cvt.d.s $f13, $f13
mtc1 $zero, $f12
la $t9, glTranslatef
ld $s3, 0x20+var_20($sp)
lwc1 $f14, flt_100092C8
jalr $t9
mov.s $f13, $f12
la $t9, glMatrixMode
jalr $t9
li $a0, 0x1700
ld $ra, 0x20+var_18($sp)
ld $gp, 0x20+var_10($sp)
jr $ra
addiu $sp, 0x20
lui $at, 1
addiu $sp, -0x50
li $at, 0xB0C8
sd $gp, 0x50+var_30($sp)
addu $gp, $t9, $at
la $t9, glClear
sd $ra, 0x50+var_38($sp)
li $a0, 0x4000
jalr $t9
sdc1 $f20, 0x50+var_28($sp)
lwc1 $f20, flt_100092A8
la $t9, glColor3f
mov.s $f14, $f20
mov.s $f13, $f20
sd $s0, 0x50+var_8($sp)
jalr $t9
mov.s $f12, $f20
la $s0, acttable
la $v1, t
lw $v0, (acttable+0xB4 - 0x100093B8)($s0)
lwc1 $f1, (t - 0x1000BF74)($v1)
lwc1 $f2, 0x18($v0)
sd $s1, 0x50+var_20($sp)
la $s1, n
ldc1 $f0, dbl_10009300
add.s $f1, $f2
lw $a0, (n - 0x1000BF6C)($s1)
cvt.d.s $f1, $f1
addiu $a0, 1
sd $s2, 0x50+var_18($sp)
sra $a3, $a0, 31
c.le.d $f0, $f1
la $a2, aflag
xor $a0, $a3
sd $s3, 0x50+var_10($sp)
li $s3, 1
subu $a0, $a3
lbu $a1, (aflag - 0x10008E48)($a2)
mtc1 $zero, $f0
bc1f loc_10005F8C
andi $a0, 0x7F
swc1 $f0, (t - 0x1000BF74)($v1)
xor $a0, $a3
subu $a0, $a3
b loc_10005F90
sw $a0, (n - 0x1000BF6C)($s1)
move $s3, $zero
beqz $a1, loc_10005FB8
la $t9, tasteQueue__Gv
jal tasteQueue__Gv
nop
la $t9, setacttargets__Gv
jal setacttargets__Gv
nop
la $t9, animateacts__Gv
jal animateacts__Gv
nop
la $t9, floor
la $a2, dtwist
la $a4, dwheel
la $a6, wrist
la $t4, arm
la $s2, n
la $t6, dzoom
lw $s2, (n - 0x1000BF6C)($s2)
mtc1 $zero, $f18
la $t8, y
la $ra, x
sll $s1, $s2, 2
lw $t7, (acttable+0x7C - 0x100093B8)($s0)
addu $t8, $s1, $t8
addu $ra, $s1, $ra
swc1 $f18, 0($t8)
swc1 $f18, 0($ra)
lwc1 $f17, 0x18($t7)
lw $t5, (acttable+0x178 - 0x100093B8)($s0)
addu $t6, $s1, $t6
swc1 $f17, 0($t6)
lwc1 $f16, 0x18($t5)
lw $a7, (acttable+0x194 - 0x100093B8)($s0)
addu $t4, $s1, $t4
swc1 $f16, 0($t4)
lwc1 $f15, 0x18($a7)
lw $a5, (acttable+0x124 - 0x100093B8)($s0)
addu $a6, $s1, $a6
swc1 $f15, 0($a6)
lwc1 $f14, 0x18($a5)
lw $a3, (acttable+0x98 - 0x100093B8)($s0)
swc1 $f14, (dwheel - 0x1000A3D0)($a4)
lwc1 $f13, 0x18($a3)
lw $a1, (acttable+0xD0 - 0x100093B8)($s0)
addu $a2, $s1, $a2
swc1 $f13, 0($a2)
lwc1 $f12, 0x18($a1)
sdc1 $f14, 0x50+var_50($sp)
jalr $t9
cvt.d.s $f12, $f12
la $a6, nlimit
trunc.w.d $f23, $f0
swc1 $f23, (nlimit - 0x1000BF70)($a6)
lw $a5, (acttable+0x48 - 0x100093B8)($s0)
lwc1 $f21, 0x18($a5)
dmtc1 $zero, $f19
cvt.d.s $f21, $f21
la $a4, outline
c.lt.d $f19, $f21
li $a3, 1
addu $a4, $s2, $a4
lw $a2, (acttable+0x1EC - 0x100093B8)($s0)
bc1t loc_10006094
nop
move $a3, $zero
sb $a3, 0($a4)
lwc1 $f5, 0x18($a2)
lwc1 $f6, flt_100092B4
la $a1, hue
c.le.s $f20, $f5
la $a3, light
addu $a1, $s1, $a1
lw $a2, (acttable+0x208 - 0x100093B8)($s0)
addu $a7, $s1, $a3
bc1f loc_100060C8
swc1 $f5, 0($a1)
add.s $f5, $f6
swc1 $f5, 0($a1)
c.le.s $f5, $f20
nop
bc1f loc_100060E0
nop
add.s $f25, $f5, $f20
swc1 $f25, 0($a1)
lwc1 $f27, 0x18($a2)
lwc1 $f20, flt_10009290
beqz $s3, loc_10006194
swc1 $f27, 0($a7)
lw $t5, 0x140($s0)
la $t6, dflip
lw $t7, 0x15C($s0)
la $s3, gflip
lwc1 $f13, 0x18($t7)
lwc1 $f12, (gflip - 0x1000BF58)($s3)
la $s3, fmodf
swc1 $f13, (dflip - 0x1000BF5C)($t6)
lwc1 $f29, 0x18($t5)
la $t4, dspin
move $t9, $s3
sdc1 $f29, 0x50+var_48($sp)
add.s $f12, $f13
mov.s $f13, $f20
jalr $t9
swc1 $f29, (dspin - 0x1000BF64)($t4)
la $s1, gspin
ldc1 $f13, 0x50+var_48($sp)
lwc1 $f12, (gspin - 0x1000BF60)($s1)
move $t9, $s3
la $t8, gflip
sdc1 $f0, 0x50+var_40($sp)
swc1 $f0, (gflip - 0x1000BF58)($t8)
add.s $f12, $f13
jalr $t9
mov.s $f13, $f20
sra $ra, $s2, 31
xor $t9, $s2, $ra
subu $t9, $ra
andi $t9, 0x7F
ldc1 $f15, 0x50+var_40($sp)
xor $t9, $ra
la $at, flip
subu $t9, $ra
la $ra, spin
sll $t9, 2
swc1 $f0, (gspin - 0x1000BF60)($s1)
addu $at, $t9, $at
addu $t9, $ra
swc1 $f15, 0($at)
swc1 $f0, 0($t9)
la $t9, fmodf
la $ra, wheel
ldc1 $f13, 0x50+var_50($sp)
lwc1 $f12, (wheel - 0x1000A3CC)($ra)
ld $s1, 0x50+var_20($sp)
ld $s2, 0x50+var_18($sp)
ld $s3, 0x50+var_10($sp)
sub.s $f12, $f13
jalr $t9
mov.s $f13, $f20
la $t9, drawit__Gv
la $at, wheel
ldc1 $f20, 0x50+var_28($sp)
jal drawit__Gv
swc1 $f0, (wheel - 0x1000A3CC)($at)
lw $v1, 0xB4($s0)
la $v0, t
lwc1 $f15, 0x18($v1)
lwc1 $f14, (t - 0x1000BF74)($v0)
la $t9, glFinish
add.s $f14, $f15
jalr $t9
swc1 $f14, (t - 0x1000BF74)($v0)
la $t9, swapBuffers__Q2_10GLXWrapper6windowGv
la $a0, theWindow
ld $s0, 0x50+var_8($sp)
jal swapBuffers__Q2_10GLXWrapper6windowGv
lw $a0, (theWindow - 0x1000BF80)($a0)
la $t9, sginap
jalr $t9
move $a0, $zero
ld $ra, 0x50+var_38($sp)
ld $gp, 0x50+var_30($sp)
jr $ra
addiu $sp, 0x50
li $v1, 0xFF1B
li $v0, 0xAD7C
beq $a0, $v1, loc_1000623C
addu $at, $t9, $v0
jr $ra
nop
lw $a0, (theWindow_ptr - 0x10010F9C)($at)
lw $a0, 0($a0)
li $v1, 1
jr $ra
sb $v1, 0x28($a0)
addiu $sp, -0x20
lui $at, 1
sd $ra, 0x20+var_8($sp)
li $at, 0xAD4C
sd $gp, 0x20+var_18($sp)
addu $gp, $t9, $at
move $a0, $zero
la $v0, acttable
addiu $a0, 1
slti $v1, $a0, 0x400
addiu $v0, 4
bnez $v1, loc_10006270
sw $zero, -4($v0)
la $t9, createActTable__Gv
jal createActTable__Gv
sd $s0, 0x20+var_10($sp)
la $a0, outline
la $a4, aflag
move $v0, $zero
li $s0, 1
la $a1, fill
addiu $v0, 1
slti $a2, $v0, 0x80
addiu $a1, 1
sb $s0, 0($a0)
addiu $a0, 1
bnez $a2, loc_100062A4
sb $s0, -1($a1)
lbu $a3, 0($a4)
beqz $a3, loc_100062DC
la $t9, srand48
la $t9, readAnimation__Gv
jal readAnimation__Gv
nop
la $t9, srand48
jalr $t9
move $a0, $zero
la $t9, time
jalr $t9
move $a0, $zero
la $t9, srand48
jalr $t9
move $a0, $v0
sw $zero, 0x20+var_20($sp)
la $a6, nlimit
la $t9, __nw__GUi
la $a4, wheel
mtc1 $zero, $f0
li $a5, 0x34
sw $a5, (nlimit - 0x1000BF70)($a6)
li $a0, 0x4C
jalr $t9
swc1 $f0, (wheel - 0x1000A3CC)($a4)
beqz $v0, loc_10006364
sw $v0, 0x20+var_1C($sp)
sw $s0, 0x20+var_20($sp)
move $a0, $v0
la $t9, __ct__Q2_10GLXWrapper6windowGPciN32
move $a2, $zero
move $a3, $zero
la $a1, 0x10010000
li $a4, 0x280
li $a5, 0x1E0
jal __ct__Q2_10GLXWrapper6windowGPciN32
addiu $a1, (aElectropaint - 0x10010000)
lw $v0, 0x20+var_1C($sp)
sw $zero, 0x20+var_20($sp)
b loc_10006368
nop
move $v0, $zero
mtc1 $zero, $f12
la $t9, glClearColor
la $s0, theWindow
lwc1 $f15, flt_100092A8
mov.s $f14, $f12
sw $v0, (theWindow - 0x1000BF80)($s0)
jalr $t9
mov.s $f13, $f12
la $t9, glShadeModel
jalr $t9
li $a0, 0x1D00
la $t9, glClear
jalr $t9
li $a0, 0x4000
la $t9, setRedraw__Q2_10GLXWrapper6windowGPGv_v
la $a1, display__Gv
jal setRedraw__Q2_10GLXWrapper6windowGPGv_v
lw $a0, (theWindow - 0x1000BF80)($s0)
la $t9, setReshape__Q2_10GLXWrapper6windowGPGiT1_v
la $a1, reshape__GiT1
jal setReshape__Q2_10GLXWrapper6windowGPGiT1_v
lw $a0, (theWindow - 0x1000BF80)($s0)
la $t9, setIdle__Q2_10GLXWrapper6windowGPGv_v
la $a1, display__Gv
jal setIdle__Q2_10GLXWrapper6windowGPGv_v
lw $a0, (theWindow - 0x1000BF80)($s0)
la $t9, setKeyboard__Q2_10GLXWrapper6windowGPGi_v
la $a1, keyboard__Gi
jal setKeyboard__Q2_10GLXWrapper6windowGPGi_v
lw $a0, (theWindow - 0x1000BF80)($s0)
la $t9, mainLoop__Q2_10GLXWrapper6windowGv
jal mainLoop__Q2_10GLXWrapper6windowGv
lw $a0, (theWindow - 0x1000BF80)($s0)
lw $v0, (theWindow - 0x1000BF80)($s0)
beqz $v0, loc_10006414
ld $ra, 0x20+var_8($sp)
lw $a0, 0x48($v0)
lw $t9, 0x14($a0)
lw $a0, 0xC($a0)
li $a1, 3
jalr $t9
addu $a0, $v0
ld $ra, 0x20+var_8($sp)
move $v0, $zero
ld $s0, 0x20+var_10($sp)
ld $gp, 0x20+var_18($sp)
jr $ra
addiu $sp, 0x20
lw $at, 0($a1)
li $v0, 0x13
bne $at, $v0, locret_10006448
lw $v1, 0x14($a1)
bne $v1, $a2, locret_10006448
li $v0, 1
jr $ra
nop
jr $ra
move $v0, $zero
jr $ra
li $v0, 1
jr $ra
nop
|
src/sub/r2_lcd.asm | Iambian/VANISH | 1 | 165177 | .ASSUME ADL=1
ClrLCDFull:
clearScreen:
LD HL,screen_buffer
CALL clearBuffer
JR updateScreen
clearBuffer:
LD BC,767
clearMem:
PUSH HL \ POP DE \ INC DE
LD BC,767
LD (HL),$00
LDIR
RET
GrBufClr:
LD HL,plotsscreen
JR clearBuffer
GrBufCpy: ;TODO: (winBtm) should be =8, use split screen settings
LD HL,plotsscreen
LD DE,screen_buffer
LD BC,768
LDIR
RET
ClrScrnFull:
CALL clearScreen
BIT.S appTextSave,(IY+appFlags)
RET Z
ClrTxtShd:
LD HL,textShadow
LD BC,127
JR clearMem
updateScreen:
PUSH AF
PUSH BC \ PUSH DE \ PUSH HL \ PUSH IX \ PUSH IY
LD IY,screen_buffer
LD IX,display_buffer+(24*40)+2
LD DE,display_lut
LD C,64
_: LD B,12
_: LD L,(IY+0)
LD H,3
MLT HL
ADD HL,DE
LD HL,(HL)
LD (IX+00),HL
LD (IX-40),HL
LD (IX+40),HL
INC IY
LEA IX,IX+3
DJNZ -_
LEA IX,IX+84
DEC C
JR NZ,--_
POP IY \ POP IX \ POP HL \ POP DE \ POP BC
POP AF
RET
|
oeis/163/A163609.asm | neoneye/loda-programs | 11 | 10558 | ; A163609: a(n) = ((5 + 2*sqrt(2))*(3 + sqrt(2))^n + (5 - 2*sqrt(2))*(3 - sqrt(2))^n)/2.
; Submitted by <NAME>(s4)
; 5,19,79,341,1493,6571,28975,127853,564293,2490787,10994671,48532517,214232405,945666811,4174374031,18426576509,81338840837,359047009459,1584910170895,6996131959157,30882420558677,136321599637963,601752653917039,2656264726036493,11725319778799685,51758065590542659,228471155091658159,1008520471416150341,4451824742855294933,19651305157218717211,86745057743325238735,382911210359420411933,1690251857953245800453,7461132675203531919187,32935033045548470911951,145382269546866102037397
lpb $0
sub $0,1
add $1,1
add $1,$2
add $2,$1
add $2,1
add $3,4
add $3,$1
sub $3,3
add $1,$3
add $1,4
sub $1,$2
add $3,$1
mov $1,$3
lpe
mov $0,$1
mul $0,2
add $0,5
|
programs/oeis/027/A027850.asm | karttu/loda | 0 | 9304 | ; A027850: (n+1)*(14*n^3+13*n^2+6*n+1).
; 1,68,531,2056,5645,12636,24703,43856,72441,113140,168971,243288,339781,462476,615735,804256,1033073,1307556,1633411,2016680,2463741,2981308,3576431,4256496,5029225,5902676,6885243,7985656,9212981,10576620,12086311,13752128,15584481,17594116,19792115,22189896,24799213,27632156,30701151,34018960,37598681,41453748,45597931,50045336,54810405,59907916,65352983,71161056,77347921,83929700,90922851,98344168,106210781,114540156,123350095,132658736,142484553,152846356,163763291,175254840,187340821,200041388,213377031,227368576,242037185,257404356,273491923,290322056,307917261,326300380,345494591,365523408,386410681,408180596,430857675,454466776,479033093,504582156,531139831,558732320,587386161,617128228,647985731,679986216,713157565,747527996,783126063,819980656,858121001,897576660,938377531,980553848,1024136181,1069155436,1115642855,1163630016,1213148833,1264231556,1316910771,1371219400,1427190701,1484858268,1544256031,1605418256,1668379545,1733174836,1799839403,1868408856,1938919141,2011406540,2085907671,2162459488,2241099281,2321864676,2404793635,2489924456,2577295773,2666946556,2758916111,2853244080,2949970441,3049135508,3150779931,3254944696,3361671125,3471000876,3582975943,3697638656,3815031681,3935198020,4058181011,4184024328,4312771981,4444468316,4579158015,4716886096,4857697913,5001639156,5148755851,5299094360,5452701381,5609623948,5769909431,5933605536,6100760305,6271422116,6445639683,6623462056,6804938621,6990119100,7179053551,7371792368,7568386281,7768886356,7973343995,8181810936,8394339253,8610981356,8831789991,9056818240,9286119521,9519747588,9757756531,10000200776,10247135085,10498614556,10754694623,11015431056,11280879961,11551097780,11826141291,12106067608,12390934181,12680798796,12975719575,13275754976,13580963793,13891405156,14207138531,14528223720,14854720861,15186690428,15524193231,15867290416,16216043465,16570514196,16930764763,17296857656,17668855701,18046822060,18430820231,18820914048,19217167681,19619645636,20028412755,20443534216,20865075533,21293102556,21727681471,22168878800,22616761401,23071396468,23532851531,24001194456,24476493445,24958817036,25448234103,25944813856,26448625841,26959739940,27478226371,28004155688,28537598781,29078626876,29627311535,30183724656,30747938473,31320025556,31900058811,32488111480,33084257141,33688569708,34301123431,34921992896,35551253025,36188979076,36835246643,37490131656,38153710381,38826059420,39507255711,40197376528,40896499481,41604702516,42322063915,43048662296,43784576613,44529886156,45284670551,46049009760,46822984081,47606674148,48400160931,49203525736,50016850205,50840216316,51673706383,52517403056,53371389321,54235748500
mov $1,1
mov $2,7
mov $5,$0
mov $6,$0
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,19
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,27
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3,1
sub $3,1
add $4,$5
lpe
mov $2,14
mov $5,$4
lpb $2,1
add $1,$5
sub $2,1
lpe
|
test/standard_application.adb | Jellix/open_weather_map_api | 1 | 14553 | --------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.Strings.Fixed;
with GNATCOLL.Traces;
with Signal_Handlers;
with SI_Units.Binary;
package body Standard_Application is
My_Debug : constant not null GNATCOLL.Traces.Trace_Handle :=
GNATCOLL.Traces.Create (Unit_Name => "STDAPP");
LF : Character renames Ada.Characters.Latin_1.LF;
Underline : constant String := Ada.Strings.Fixed."*" (79, '=') & LF;
-----------------------------------------------------------------------------
-- Binary_Image
-----------------------------------------------------------------------------
function Binary_Image is
new SI_Units.Binary.Image (Item => GNATCOLL.Memory.Byte_Count,
Default_Aft => 3,
Unit => "B");
-----------------------------------------------------------------------------
-- Epoch
-----------------------------------------------------------------------------
function Epoch (Self : in T) return Ada.Real_Time.Time is
(Self.Start_Time);
-----------------------------------------------------------------------------
-- Initialize
-----------------------------------------------------------------------------
procedure Initialize (Self : in out T;
Cycle_Time : in Ada.Real_Time.Time_Span;
Application_Directory : in String;
Log_Name : in String)
is
Log_File_Name : constant String :=
Ada.Directories.Compose
(Containing_Directory => Application_Directory,
Name => Log_Name,
Extension => "log");
begin
Self.Interval := Cycle_Time;
Self.Start_Time := Ada.Real_Time.Clock;
Self.Previous_Memory := GNATCOLL.Memory.Watermark_Info'(High => 0,
Current => 0);
GNATCOLL.Traces.Parse_Config
(Config =>
"+" & LF & -- Activate all logging by default.
">>" & Log_File_Name & LF & -- Redirect to "owm.log"
"DEBUG.ABSOLUTE_TIME" & LF); -- Show timestamps.
GNATCOLL.Traces.Parse_Config_File; -- User overrides via config file.
My_Debug.all.Trace (Message => "Initialize");
My_Debug.all.Trace
(Message => Underline & "Application started." & LF & Underline);
Self.Report_Memory_Usage;
end Initialize;
-----------------------------------------------------------------------------
-- Report_Memory_Usage
-----------------------------------------------------------------------------
procedure Report_Memory_Usage (Self : in out T)
is
subtype Byte_Count is GNATCOLL.Memory.Byte_Count;
use type Byte_Count;
--------------------------------------------------------------------------
-- Trim
--------------------------------------------------------------------------
function Trim
(Source : in String;
Side : in Ada.Strings.Trim_End := Ada.Strings.Left) return String
renames Ada.Strings.Fixed.Trim;
--------------------------------------------------------------------------
-- Full_Image
--------------------------------------------------------------------------
function Full_Image (Value : in Byte_Count) return String;
--------------------------------------------------------------------------
-- Full_Image
--------------------------------------------------------------------------
function Full_Image (Value : in Byte_Count) return String is
(Trim (Value'Image) & " [" & Binary_Image (Value) & "]");
Mem_Info : constant GNATCOLL.Memory.Watermark_Info :=
GNATCOLL.Memory.Get_Allocations;
use type GNATCOLL.Memory.Watermark_Info;
begin
My_Debug.all.Trace (Message => "Report_Memory_Usage");
if Mem_Info /= Self.Previous_Memory then
Report_Changes :
declare
Diff_Current : constant Byte_Count :=
Mem_Info.Current - Self.Previous_Memory.Current;
Diff_Peak : constant Byte_Count :=
Mem_Info.High - Self.Previous_Memory.High;
begin
Self.Previous_Memory := Mem_Info;
My_Debug.all.Trace
(Message =>
"Memory usage: Current: " & Full_Image (Mem_Info.Current) &
" (diff: " & Full_Image (Diff_Current) &
"), Peak: " & Full_Image (Mem_Info.High) &
" (diff: " & Full_Image (Diff_Peak) &
").");
end Report_Changes;
end if;
end Report_Memory_Usage;
-----------------------------------------------------------------------------
-- Run
-----------------------------------------------------------------------------
procedure Run (Self : in out T)
is
use type Ada.Real_Time.Time;
Next_Update : Ada.Real_Time.Time := Self.Epoch;
begin
My_Debug.all.Trace (Message => "Run");
Main_Loop :
loop
T'Class (Self).Work; -- Do the actual work.
Next_Update := Next_Update + Self.Interval;
select
Signal_Handlers.Sigint.Wait;
exit Main_Loop;
or
delay until Next_Update;
end select;
end loop Main_Loop;
end Run;
-----------------------------------------------------------------------------
-- Shutdown
-----------------------------------------------------------------------------
procedure Shutdown (Self : in out T) is
begin
My_Debug.all.Trace (Message => "Shutdown");
Self.Report_Memory_Usage;
My_Debug.all.Trace
(Message => Underline & "Application stopped." & LF & Underline);
end Shutdown;
end Standard_Application;
|
second.asm | tobidot/assembler | 0 | 164157 | <filename>second.asm
; 15.02.2020
;
; Have an animation with a moving X from left to right
;
org 0x0100
jmp start
x_pos: equ 0x0800
string: db "Hello, world", 0
string_welcome: db "Welcome: ", 0
start:
call clear_screen
mov dx, 0x0618
call set_cursor
mov bx, string_welcome
call print_string
mov byte [x_pos], 0
main_loop:
mov cx, 12
main_loop_1:
call draw
add byte [x_pos], 1
nop
call wait_for_tick
call is_key_pressed
jnz end
loop main_loop_1
mov cx, 12
main_loop_2:
sub byte [x_pos], 1
call draw
nop
call wait_for_tick
call is_key_pressed
jnz end
loop main_loop_2
jmp main_loop
end:
mov al, '?'
call print_char
mov ah, 0x0
int 0x16
int 0x20
draw:
mov dx, 0x0818
call set_cursor
mov ax, string
call draw_string
call print_newline
ret
draw_string:
push ax
push bx
push cx
mov bx, ax
mov cx, 0
draw_string_repeat:
push bx ; get current char of string
add bx, cx
mov al, [bx]
pop bx
cmp al, 0 ; is string finished
je draw_string_end
cmp cl, byte [x_pos] ; am i at current pos
jne draw_string_repeat_1 ; replace char with an 'X'
mov al, 'X'
draw_string_repeat_1:
call print_char
inc cx
jmp draw_string_repeat
draw_string_end:
pop cx
pop bx
pop ax
ret
int 0x20
; ---- library functions -----
; --- printing
print_char:
push ax
push bx
mov ah, 0x0e
mov bx, 0x000f
int 0x10
pop bx
pop ax
ret
print_newline:
push ax
mov ax, 0x0a
call print_char
mov ax, 0x0d
call print_char
pop ax
ret
print_string: ; prints characters at [bx] until a '\0' is found
push ax
push bx
print_string_repeat:
mov al, byte [bx]
cmp al, 0 ; is string finished
je print_string_end
call print_char
inc bx
jmp print_string_repeat
print_string_end:
pop bx
pop ax
ret
; --- screen control
set_cursor:
push ax
mov ah, 0x02
mov bh, 0x0
int 0x10
pop ax
ret
clear_screen:
push ax
mov ah, 0x00
mov al, 0x03
int 0x10
pop ax
ret
; --- flow controls
wait_for_tick: ; ticks are in cx, dx
push ax
push cx
push dx
call get_time
mov ax, dx
wait_for_tick_1:
call get_time
cmp ax, dx
je wait_for_tick_1
pop dx
pop cx
pop ax
ret
; --- interrupt shorthands
get_time: ; ticks are in (high) cx, (low) dx
push ax
mov ah, 0x00
int 0x1A
pop ax
ret
is_key_pressed: ; set the Z-Flag (jz label) to 1 if a key is pressed
push ax
mov ah, 0x01
int 0x16
pop ax
ret
; --- others
int 0x20
|
oeis/005/A005593.asm | neoneye/loda-programs | 11 | 5372 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A005593: a(n) = (F(2n+1) + F(2n-1) + F(n+3) - 2)/2, where F() = Fibonacci numbers A000045.
; Submitted by <NAME>
; 2,5,12,29,71,177,448,1147,2960,7679,19989,52145,136214,356121,931540,2437513,6379403,16698113,43710756,114427391,299560472,784236315,2053119817,5375076769,14072035466,36840908237,96450492828,252510252437
mov $2,$0
mov $3,2
lpb $3
mov $0,$2
sub $3,1
add $0,$3
max $0,0
seq $0,5207 ; a(n) = (F(2*n-1) + F(n+1))/2 where F(n) is a Fibonacci number.
add $1,$0
lpe
mov $0,$1
sub $0,1
|
oeis/019/A019674.asm | neoneye/loda-programs | 11 | 22238 | <reponame>neoneye/loda-programs<filename>oeis/019/A019674.asm
; A019674: Decimal expansion of Pi/7.
; Submitted by <NAME>
; 4,4,8,7,9,8,9,5,0,5,1,2,8,2,7,6,0,5,4,9,4,6,6,3,3,4,0,4,6,8,5,0,0,4,1,2,0,2,8,1,6,7,0,5,7,0,5,3,5,8,6,5,4,5,8,5,3,5,6,3,5,1,3,1,8,6,8,3,0,9,1,5,1,8,3,7,4,4,1,4,2,6,6,1,1,4,7,8,3,2,1,9,1,7,3,1,0,0,9,7
add $0,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
mul $1,4
div $1,14
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
|
Cubical/Algebra/Group/Base.agda | thomas-lamiaux/cubical | 0 | 8240 | <gh_stars>0
{-# OPTIONS --safe #-}
module Cubical.Algebra.Group.Base where
{-
Defines groups and adds the smart constructors [makeGroup-right] and [makeGroup-left]
for constructing groups from less data than the standard [makeGroup] constructor.
-}
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Data.Sigma
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.Semigroup
open import Cubical.Reflection.RecordEquiv
private
variable
ℓ : Level
record IsGroup {G : Type ℓ}
(1g : G) (_·_ : G → G → G) (inv : G → G) : Type ℓ where
constructor isgroup
field
isMonoid : IsMonoid 1g _·_
·InvR : (x : G) → x · inv x ≡ 1g
·InvL : (x : G) → inv x · x ≡ 1g
open IsMonoid isMonoid public
unquoteDecl IsGroupIsoΣ = declareRecordIsoΣ IsGroupIsoΣ (quote IsGroup)
record GroupStr (G : Type ℓ) : Type ℓ where
constructor groupstr
field
1g : G
_·_ : G → G → G
inv : G → G
isGroup : IsGroup 1g _·_ inv
infixr 7 _·_
open IsGroup isGroup public
Group : ∀ ℓ → Type (ℓ-suc ℓ)
Group ℓ = TypeWithStr ℓ GroupStr
Group₀ : Type₁
Group₀ = Group ℓ-zero
group : (G : Type ℓ) (1g : G) (_·_ : G → G → G) (inv : G → G) (h : IsGroup 1g _·_ inv) → Group ℓ
group G 1g _·_ inv h = G , groupstr 1g _·_ inv h
isSetGroup : (G : Group ℓ) → isSet ⟨ G ⟩
isSetGroup G = GroupStr.isGroup (snd G) .IsGroup.isMonoid .IsMonoid.isSemigroup .IsSemigroup.is-set
makeIsGroup : {G : Type ℓ} {e : G} {_·_ : G → G → G} { inv : G → G}
(is-setG : isSet G)
(·Assoc : (x y z : G) → x · (y · z) ≡ (x · y) · z)
(·IdR : (x : G) → x · e ≡ x)
(·IdL : (x : G) → e · x ≡ x)
(·InvR : (x : G) → x · inv x ≡ e)
(·InvL : (x : G) → inv x · x ≡ e)
→ IsGroup e _·_ inv
IsGroup.isMonoid (makeIsGroup is-setG ·Assoc ·IdR ·IdL ·InvR ·InvL) = makeIsMonoid is-setG ·Assoc ·IdR ·IdL
IsGroup.·InvR (makeIsGroup is-setG ·Assoc ·IdR ·IdL ·InvR ·InvL) = ·InvR
IsGroup.·InvL (makeIsGroup is-setG ·Assoc ·IdR ·IdL ·InvR ·InvL) = ·InvL
makeGroup : {G : Type ℓ} (1g : G) (_·_ : G → G → G) (inv : G → G)
(is-setG : isSet G)
(·Assoc : (x y z : G) → x · (y · z) ≡ (x · y) · z)
(·IdR : (x : G) → x · 1g ≡ x)
(·IdL : (x : G) → 1g · x ≡ x)
(·InvR : (x : G) → x · inv x ≡ 1g)
(·InvL : (x : G) → inv x · x ≡ 1g)
→ Group ℓ
makeGroup 1g _·_ inv is-setG ·Assoc ·IdR ·IdL ·InvR ·InvL = _ , helper
where
helper : GroupStr _
GroupStr.1g helper = 1g
GroupStr._·_ helper = _·_
GroupStr.inv helper = inv
GroupStr.isGroup helper = makeIsGroup is-setG ·Assoc ·IdR ·IdL ·InvR ·InvL
Group→Monoid : Group ℓ → Monoid ℓ
Group→Monoid (A , groupstr _ _ _ G) = A , monoidstr _ _ (IsGroup.isMonoid G)
makeGroup-right : {A : Type ℓ}
→ (1g : A)
→ (_·_ : A → A → A)
→ (inv : A → A)
→ (set : isSet A)
→ (·Assoc : ∀ a b c → a · (b · c) ≡ (a · b) · c)
→ (·IdR : ∀ a → a · 1g ≡ a)
→ (·InvR : ∀ a → a · inv a ≡ 1g)
→ Group ℓ
makeGroup-right 1g _·_ inv set ·Assoc ·IdR ·InvR =
makeGroup 1g _·_ inv set ·Assoc ·IdR ·IdL ·InvR ·InvL
where
abstract
·InvL : ∀ a → inv a · a ≡ 1g
·InvL a =
inv a · a
≡⟨ sym (·IdR _) ⟩
(inv a · a) · 1g
≡⟨ cong (_·_ _) (sym (·InvR (inv a))) ⟩
(inv a · a) · (inv a · (inv (inv a)))
≡⟨ ·Assoc _ _ _ ⟩
((inv a · a) · (inv a)) · (inv (inv a))
≡⟨ cong (λ □ → □ · _) (sym (·Assoc _ _ _)) ⟩
(inv a · (a · inv a)) · (inv (inv a))
≡⟨ cong (λ □ → (inv a · □) · (inv (inv a))) (·InvR a) ⟩
(inv a · 1g) · (inv (inv a))
≡⟨ cong (λ □ → □ · (inv (inv a))) (·IdR (inv a)) ⟩
inv a · (inv (inv a))
≡⟨ ·InvR (inv a) ⟩
1g
∎
·IdL : ∀ a → 1g · a ≡ a
·IdL a =
1g · a
≡⟨ cong (λ b → b · a) (sym (·InvR a)) ⟩
(a · inv a) · a
≡⟨ sym (·Assoc _ _ _) ⟩
a · (inv a · a)
≡⟨ cong (a ·_) (·InvL a) ⟩
a · 1g
≡⟨ ·IdR a ⟩
a
∎
makeGroup-left : {A : Type ℓ}
→ (1g : A)
→ (_·_ : A → A → A)
→ (inv : A → A)
→ (set : isSet A)
→ (·Assoc : ∀ a b c → a · (b · c) ≡ (a · b) · c)
→ (·IdL : ∀ a → 1g · a ≡ a)
→ (·InvL : ∀ a → (inv a) · a ≡ 1g)
→ Group ℓ
makeGroup-left 1g _·_ inv set ·Assoc ·IdL ·InvL =
makeGroup 1g _·_ inv set ·Assoc ·IdR ·IdL ·InvR ·InvL
where
abstract
·InvR : ∀ a → a · inv a ≡ 1g
·InvR a =
a · inv a
≡⟨ sym (·IdL _) ⟩
1g · (a · inv a)
≡⟨ cong (λ b → b · (a · inv a)) (sym (·InvL (inv a))) ⟩
(inv (inv a) · inv a) · (a · inv a)
≡⟨ sym (·Assoc (inv (inv a)) (inv a) _) ⟩
inv (inv a) · (inv a · (a · inv a))
≡⟨ cong (inv (inv a) ·_) (·Assoc (inv a) a (inv a)) ⟩
(inv (inv a)) · ((inv a · a) · (inv a))
≡⟨ cong (λ b → (inv (inv a)) · (b · (inv a))) (·InvL a) ⟩
inv (inv a) · (1g · inv a)
≡⟨ cong (inv (inv a) ·_) (·IdL (inv a)) ⟩
inv (inv a) · inv a
≡⟨ ·InvL (inv a) ⟩
1g
∎
·IdR : ∀ a → a · 1g ≡ a
·IdR a =
a · 1g
≡⟨ cong (a ·_) (sym (·InvL a)) ⟩
a · (inv a · a)
≡⟨ ·Assoc a (inv a) a ⟩
(a · inv a) · a
≡⟨ cong (λ b → b · a) (·InvR a) ⟩
1g · a
≡⟨ ·IdL a ⟩
a
∎
|
src/Sigma.agda | johnyob/agda-sigma | 0 | 703 |
data Term (V : Set) : Set where
App : Term V -> Term V -> Term V
Abs : (V -> Term V) -> Term V -- ouch, posititity. |
programs/oeis/011/A011919.asm | karttu/loda | 1 | 5801 | ; A011919: a(n) = floor(n*(n-1)*(n-2)*(n-3)/9).
; 0,0,0,0,2,13,40,93,186,336,560,880,1320,1906,2669,3640,4853,6346,8160,10336,12920,15960,19506,23613,28336,33733,39866,46800,54600,63336,73080,83906,95893,109120,123669,139626,157080,176120,196840,219336,243706,270053,298480
bin $0,4
mul $0,8
div $0,3
mov $1,$0
|
oeis/144/A144652.asm | neoneye/loda-programs | 11 | 81981 | <filename>oeis/144/A144652.asm
; A144652: Triangle, read by rows, where T(m,n) = floor((2mn+m+n)/2) with m >= n >= 1.
; Submitted by <NAME>
; 2,3,6,5,8,12,6,11,15,20,8,13,19,24,30,9,16,22,29,35,42,11,18,26,33,41,48,56,12,21,29,38,46,55,63,72,14,23,33,42,52,61,71,80,90,15,26,36,47,57,68,78,89,99,110,17,28,40,51,63,74,86,97,109,120,132,18,31,43,56,68,81,93,106,118,131,143,156,20,33,47,60,74,87,101,114,128,141,155,168,182,21,36,50,65,79,94,108,123,137
mul $0,2
add $0,1
lpb $0
mov $2,$0
sub $0,2
trn $0,$1
add $1,2
add $2,2
lpe
add $1,1
mul $1,$2
mov $0,$1
div $0,4
|
src/nl/tvandijk/aoc/year2021/day2/Input.g4 | trolando/aoc2020 | 1 | 3165 | grammar Input;
root : command+;
command : COMMAND NUMBER;
fragment LETTER : [a-zA-Z];
fragment DIGIT : [0-9] ;
COMMAND : LETTER+;
NUMBER : DIGIT+;
WS : [ \t\r\n]+ -> skip ;
|
src/Internals/protypo-match_data_wrappers.adb | fintatarta/protypo | 0 | 13133 | <reponame>fintatarta/protypo<filename>src/Internals/protypo-match_data_wrappers.adb<gh_stars>0
pragma Ada_2012;
with Ada.Containers;
with Protypo.Api.Engine_Values.Constant_Wrappers;
package body Protypo.Match_Data_Wrappers is
Matched_Field_Name : constant Id := "matched?";
function Wrap (Match_Data : Gnat.Regpat.Match_Array;
Source : String)
return Handlers.Ambivalent_Interface_Access
is
use Gnat.Regpat;
Wrapper : constant Match_Data_Wrapper_Access :=
new Match_Data_Wrapper (Match_Data'Last);
begin
if Match_Data (0) = No_Match then
Wrapper.Matched := False;
Wrapper.Submatches := (others => Null_Unbounded_String);
else
Wrapper.Matched := True;
for Idx in Match_Data'Range loop
Wrapper.Submatches (Idx) :=
To_Unbounded_String
(Source (Match_Data (Idx).First .. Match_Data (Idx).Last));
end loop;
end if;
return Handlers.Ambivalent_Interface_Access (Wrapper);
end Wrap;
function Wrap (Match_Data : Gnat.Regpat.Match_Array;
Source : String)
return Engine_Value
is (Handlers.Create (Wrap (Match_Data, Source)));
--------------
-- Is_Field --
--------------
function Is_Field (X : Match_Data_Wrapper; Field : Id) return Boolean
is (Field = Matched_Field_Name);
---------
-- Get --
---------
function Get (X : Match_Data_Wrapper; Field : Id) return Handler_Value is
begin
if Field = Matched_Field_Name then
return Constant_Wrappers.To_Handler_Value (X.Matched);
else
raise Run_Time_Error
with "Unknown field for match data: '" & String (Field) & "'";
end if;
end Get;
---------
-- Get --
---------
function Get
(X : Match_Data_Wrapper; Index : Engine_Value_Vectors.Vector)
return Handler_Value
is
use type Ada.Containers.Count_Type;
begin
if Index.Length /= 1 then
raise Run_Time_Error with "Match data requires 1 index only";
end if;
if Index.First_Element.Class /= Int then
raise Run_Time_Error with "Match data requires one integer index";
end if;
declare
use Constant_Wrappers;
Idx : constant Integer := Get_Integer (Index.First_Element);
begin
if not (Idx in X.Submatches'Range) then
raise Run_Time_Error
with "Match data index "
& Idx'Image
& " outside of valid range "
& X.Submatches'First'Image & ".." & X.Submatches'Last'Image;
end if;
return To_Handler_Value (X.Submatches (Idx));
end;
end Get;
end Protypo.Match_Data_Wrappers;
|
8/01.asm | Changlon/x86Assembly | 0 | 172944 | <reponame>Changlon/x86Assembly
; x86- 80386 新增段寄存器 fs,gs 16位
; 32位地址线 可以用 一个32位寄存器来访问地址空间 ffff ffff
mov eax , 0xf0000000 ; 机器指令 66b8
mov ax , 0x1111 ; b8
add eax , 0xcccc
; GTDR 全局描述符表寄存器
; 32 位 (基地址)+ 16 位 (边界)
; 全局描述符表线性基地址 + 全局描述符表边界
;lgdt m48 -> gdt界限值地址(描述表界限总字节数 - 1 ) gdt线性地址 该指令设置GTDR; 加载6个字节
; 描述符 G位 23
; 0
; 1 实际使用的段界限 = 描述符中的段界限 * 0x1000 * 0xfff
; 举例 描述符中的界限值是0 ,G位是1 则实际使用的界限 = 0 * 0x1000 + 0xfff = 0xfff
; 段向上扩展,段内偏移范围是 0 ~ 0xfff
; 段向下扩展,段内偏移量是 0xffff/0xffffffff ~ 0xfff 此时段访问小于0xfff 则出现异常中断
; D/B 位22
;相对于代码段 默认操作尺寸大小 0 16位操作尺寸 1 32位操作尺寸
;位相对于数据段 0 代表16位偏移量 1 代表32位偏移量
; 0 -> 段按照16位操作
; 1 -> 按照32位进行操作
; X位 11 表示是否可以执行, x= 0代表数据段不可执行,x= 1表示可执行
; S位 12 指定描述符类型, 0 为系统段, 1 表示代码段或者数据段
; P位 15 表示段是否存在位, 1 存在 0 不存在
; DPL 位 13-14 表示特权级 0-3
; E 位 10 当 X位 = 0 时, 指示段的扩展方向, 0 向上扩展, 1 向下扩展
; C 位 10 当X位 = 1 时 指示段是否位特权级依从的 0 表示 非依从的代码,代码段可以从与它特权级相同的代码段调用
; 1 表示允许从特权级低的程序转移到该段执行
mov al , 0000_0000b ; 二进制写入方式
; 寄存器cr0 位0 pe ->开启保护模式 1->保护模式
;段选择子 ds ,fs,ss ...
; 3-15 位是描述符索引 2^13 = 8192
; 2 位 TI 0表示选中全局gdt表索引 1表示 使用 idt表索引
; 0-1位 RPL 寄存器特权级
; !!!! 保护模式下的段寄存器(访问内存)工作方式
; 1. 当修改了段选择子(段寄存器), 会去描述符表找对应的描述符,将内容存入处理器中的描述符高速缓存器
; 2. 以缓存器中的 线性基地址 + 段内偏移来访问内存
|
src/lv_conf.ads | Fabien-Chouteau/lvgl-ada-examples | 1 | 19373 | <reponame>Fabien-Chouteau/lvgl-ada-examples
package LV_Conf is
LV_DPI : constant := 100;
LV_HOR_RES : constant := 800;
LV_VER_RES : constant := 480;
end LV_Conf;
|
tools/scitools/conf/understand/ada/ada95/s-strops.ads | brucegua/moocos | 1 | 28068 | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . S T R I N G _ O P S --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved --
-- --
-- The GNAT library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU Library General Public License as published by --
-- the Free Software Foundation; either version 2, or (at your option) any --
-- later version. The GNAT library is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- Library General Public License for more details. You should have --
-- received a copy of the GNU Library General Public License along with --
-- the GNAT library; see the file COPYING.LIB. If not, write to the Free --
-- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This package contains functions for runtime operations on strings
package System.String_Ops is
pragma Pure (System.String_Ops);
function Str_Concat (X, Y : String) return String;
-- Concatenate two strings and return resulting string
function Str_Equal (A, B : String) return Boolean;
-- Compare two strings for equality
end System.String_Ops;
|
programs/oeis/177/A177885.asm | neoneye/loda | 22 | 178713 | ; A177885: a(n) = (1-n)^(n-1).
; 1,1,-1,4,-27,256,-3125,46656,-823543,16777216,-387420489,10000000000,-285311670611,8916100448256,-302875106592253,11112006825558016,-437893890380859375,18446744073709551616,-827240261886336764177,39346408075296537575424,-1978419655660313589123979,104857600000000000000000000,-5842587018385982521381124421,341427877364219557396646723584,-20880467999847912034355032910567,1333735776850284124449081472843776,-88817841970012523233890533447265625
sub $0,1
sub $1,$0
pow $1,$0
mov $0,$1
|
stressfs.asm | gangwareGremlins/PA3 | 0 | 241461 |
_stressfs: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "fs.h"
#include "fcntl.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: 81 ec 28 02 00 00 sub $0x228,%esp
int fd, i;
char path[] = "stressfs0";
17: 8d 55 d6 lea -0x2a(%ebp),%edx
1a: bb e0 08 00 00 mov $0x8e0,%ebx
1f: b8 0a 00 00 00 mov $0xa,%eax
24: 89 d7 mov %edx,%edi
26: 89 de mov %ebx,%esi
28: 89 c1 mov %eax,%ecx
2a: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
char data[512];
printf(1, "stressfs starting\n");
2c: 83 ec 08 sub $0x8,%esp
2f: 68 bd 08 00 00 push $0x8bd
34: 6a 01 push $0x1
36: e8 d6 04 00 00 call 511 <printf>
3b: 83 c4 10 add $0x10,%esp
memset(data, 'a', sizeof(data));
3e: 83 ec 04 sub $0x4,%esp
41: 68 00 02 00 00 push $0x200
46: 6a 61 push $0x61
48: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax
4e: 50 push %eax
4f: e8 ad 01 00 00 call 201 <memset>
54: 83 c4 10 add $0x10,%esp
for(i = 0; i < 4; i++)
57: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
5e: eb 0e jmp 6e <main+0x6e>
if(fork() > 0)
60: e8 22 03 00 00 call 387 <fork>
65: 85 c0 test %eax,%eax
67: 7e 02 jle 6b <main+0x6b>
break;
69: eb 09 jmp 74 <main+0x74>
char data[512];
printf(1, "stressfs starting\n");
memset(data, 'a', sizeof(data));
for(i = 0; i < 4; i++)
6b: ff 45 e4 incl -0x1c(%ebp)
6e: 83 7d e4 03 cmpl $0x3,-0x1c(%ebp)
72: 7e ec jle 60 <main+0x60>
if(fork() > 0)
break;
printf(1, "write %d\n", i);
74: 83 ec 04 sub $0x4,%esp
77: ff 75 e4 pushl -0x1c(%ebp)
7a: 68 d0 08 00 00 push $0x8d0
7f: 6a 01 push $0x1
81: e8 8b 04 00 00 call 511 <printf>
86: 83 c4 10 add $0x10,%esp
path[8] += i;
89: 8a 45 de mov -0x22(%ebp),%al
8c: 88 c2 mov %al,%dl
8e: 8b 45 e4 mov -0x1c(%ebp),%eax
91: 01 d0 add %edx,%eax
93: 88 45 de mov %al,-0x22(%ebp)
fd = open(path, O_CREATE | O_RDWR);
96: 83 ec 08 sub $0x8,%esp
99: 68 02 02 00 00 push $0x202
9e: 8d 45 d6 lea -0x2a(%ebp),%eax
a1: 50 push %eax
a2: e8 28 03 00 00 call 3cf <open>
a7: 83 c4 10 add $0x10,%esp
aa: 89 45 e0 mov %eax,-0x20(%ebp)
for(i = 0; i < 20; i++)
ad: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
b4: eb 1d jmp d3 <main+0xd3>
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
b6: 83 ec 04 sub $0x4,%esp
b9: 68 00 02 00 00 push $0x200
be: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax
c4: 50 push %eax
c5: ff 75 e0 pushl -0x20(%ebp)
c8: e8 e2 02 00 00 call 3af <write>
cd: 83 c4 10 add $0x10,%esp
printf(1, "write %d\n", i);
path[8] += i;
fd = open(path, O_CREATE | O_RDWR);
for(i = 0; i < 20; i++)
d0: ff 45 e4 incl -0x1c(%ebp)
d3: 83 7d e4 13 cmpl $0x13,-0x1c(%ebp)
d7: 7e dd jle b6 <main+0xb6>
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
close(fd);
d9: 83 ec 0c sub $0xc,%esp
dc: ff 75 e0 pushl -0x20(%ebp)
df: e8 d3 02 00 00 call 3b7 <close>
e4: 83 c4 10 add $0x10,%esp
printf(1, "read\n");
e7: 83 ec 08 sub $0x8,%esp
ea: 68 da 08 00 00 push $0x8da
ef: 6a 01 push $0x1
f1: e8 1b 04 00 00 call 511 <printf>
f6: 83 c4 10 add $0x10,%esp
fd = open(path, O_RDONLY);
f9: 83 ec 08 sub $0x8,%esp
fc: 6a 00 push $0x0
fe: 8d 45 d6 lea -0x2a(%ebp),%eax
101: 50 push %eax
102: e8 c8 02 00 00 call 3cf <open>
107: 83 c4 10 add $0x10,%esp
10a: 89 45 e0 mov %eax,-0x20(%ebp)
for (i = 0; i < 20; i++)
10d: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
114: eb 1d jmp 133 <main+0x133>
read(fd, data, sizeof(data));
116: 83 ec 04 sub $0x4,%esp
119: 68 00 02 00 00 push $0x200
11e: 8d 85 d6 fd ff ff lea -0x22a(%ebp),%eax
124: 50 push %eax
125: ff 75 e0 pushl -0x20(%ebp)
128: e8 7a 02 00 00 call 3a7 <read>
12d: 83 c4 10 add $0x10,%esp
close(fd);
printf(1, "read\n");
fd = open(path, O_RDONLY);
for (i = 0; i < 20; i++)
130: ff 45 e4 incl -0x1c(%ebp)
133: 83 7d e4 13 cmpl $0x13,-0x1c(%ebp)
137: 7e dd jle 116 <main+0x116>
read(fd, data, sizeof(data));
close(fd);
139: 83 ec 0c sub $0xc,%esp
13c: ff 75 e0 pushl -0x20(%ebp)
13f: e8 73 02 00 00 call 3b7 <close>
144: 83 c4 10 add $0x10,%esp
wait();
147: e8 4b 02 00 00 call 397 <wait>
exit();
14c: e8 3e 02 00 00 call 38f <exit>
00000151 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
151: 55 push %ebp
152: 89 e5 mov %esp,%ebp
154: 57 push %edi
155: 53 push %ebx
asm volatile("cld; rep stosb" :
156: 8b 4d 08 mov 0x8(%ebp),%ecx
159: 8b 55 10 mov 0x10(%ebp),%edx
15c: 8b 45 0c mov 0xc(%ebp),%eax
15f: 89 cb mov %ecx,%ebx
161: 89 df mov %ebx,%edi
163: 89 d1 mov %edx,%ecx
165: fc cld
166: f3 aa rep stos %al,%es:(%edi)
168: 89 ca mov %ecx,%edx
16a: 89 fb mov %edi,%ebx
16c: 89 5d 08 mov %ebx,0x8(%ebp)
16f: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
172: 5b pop %ebx
173: 5f pop %edi
174: 5d pop %ebp
175: c3 ret
00000176 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
176: 55 push %ebp
177: 89 e5 mov %esp,%ebp
179: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
17c: 8b 45 08 mov 0x8(%ebp),%eax
17f: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
182: 90 nop
183: 8b 45 08 mov 0x8(%ebp),%eax
186: 8d 50 01 lea 0x1(%eax),%edx
189: 89 55 08 mov %edx,0x8(%ebp)
18c: 8b 55 0c mov 0xc(%ebp),%edx
18f: 8d 4a 01 lea 0x1(%edx),%ecx
192: 89 4d 0c mov %ecx,0xc(%ebp)
195: 8a 12 mov (%edx),%dl
197: 88 10 mov %dl,(%eax)
199: 8a 00 mov (%eax),%al
19b: 84 c0 test %al,%al
19d: 75 e4 jne 183 <strcpy+0xd>
;
return os;
19f: 8b 45 fc mov -0x4(%ebp),%eax
}
1a2: c9 leave
1a3: c3 ret
000001a4 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1a4: 55 push %ebp
1a5: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
1a7: eb 06 jmp 1af <strcmp+0xb>
p++, q++;
1a9: ff 45 08 incl 0x8(%ebp)
1ac: ff 45 0c incl 0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1af: 8b 45 08 mov 0x8(%ebp),%eax
1b2: 8a 00 mov (%eax),%al
1b4: 84 c0 test %al,%al
1b6: 74 0e je 1c6 <strcmp+0x22>
1b8: 8b 45 08 mov 0x8(%ebp),%eax
1bb: 8a 10 mov (%eax),%dl
1bd: 8b 45 0c mov 0xc(%ebp),%eax
1c0: 8a 00 mov (%eax),%al
1c2: 38 c2 cmp %al,%dl
1c4: 74 e3 je 1a9 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
1c6: 8b 45 08 mov 0x8(%ebp),%eax
1c9: 8a 00 mov (%eax),%al
1cb: 0f b6 d0 movzbl %al,%edx
1ce: 8b 45 0c mov 0xc(%ebp),%eax
1d1: 8a 00 mov (%eax),%al
1d3: 0f b6 c0 movzbl %al,%eax
1d6: 29 c2 sub %eax,%edx
1d8: 89 d0 mov %edx,%eax
}
1da: 5d pop %ebp
1db: c3 ret
000001dc <strlen>:
uint
strlen(char *s)
{
1dc: 55 push %ebp
1dd: 89 e5 mov %esp,%ebp
1df: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1e2: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1e9: eb 03 jmp 1ee <strlen+0x12>
1eb: ff 45 fc incl -0x4(%ebp)
1ee: 8b 55 fc mov -0x4(%ebp),%edx
1f1: 8b 45 08 mov 0x8(%ebp),%eax
1f4: 01 d0 add %edx,%eax
1f6: 8a 00 mov (%eax),%al
1f8: 84 c0 test %al,%al
1fa: 75 ef jne 1eb <strlen+0xf>
;
return n;
1fc: 8b 45 fc mov -0x4(%ebp),%eax
}
1ff: c9 leave
200: c3 ret
00000201 <memset>:
void*
memset(void *dst, int c, uint n)
{
201: 55 push %ebp
202: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
204: 8b 45 10 mov 0x10(%ebp),%eax
207: 50 push %eax
208: ff 75 0c pushl 0xc(%ebp)
20b: ff 75 08 pushl 0x8(%ebp)
20e: e8 3e ff ff ff call 151 <stosb>
213: 83 c4 0c add $0xc,%esp
return dst;
216: 8b 45 08 mov 0x8(%ebp),%eax
}
219: c9 leave
21a: c3 ret
0000021b <strchr>:
char*
strchr(const char *s, char c)
{
21b: 55 push %ebp
21c: 89 e5 mov %esp,%ebp
21e: 83 ec 04 sub $0x4,%esp
221: 8b 45 0c mov 0xc(%ebp),%eax
224: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
227: eb 12 jmp 23b <strchr+0x20>
if(*s == c)
229: 8b 45 08 mov 0x8(%ebp),%eax
22c: 8a 00 mov (%eax),%al
22e: 3a 45 fc cmp -0x4(%ebp),%al
231: 75 05 jne 238 <strchr+0x1d>
return (char*)s;
233: 8b 45 08 mov 0x8(%ebp),%eax
236: eb 11 jmp 249 <strchr+0x2e>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
238: ff 45 08 incl 0x8(%ebp)
23b: 8b 45 08 mov 0x8(%ebp),%eax
23e: 8a 00 mov (%eax),%al
240: 84 c0 test %al,%al
242: 75 e5 jne 229 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
244: b8 00 00 00 00 mov $0x0,%eax
}
249: c9 leave
24a: c3 ret
0000024b <gets>:
char*
gets(char *buf, int max)
{
24b: 55 push %ebp
24c: 89 e5 mov %esp,%ebp
24e: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
251: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
258: eb 41 jmp 29b <gets+0x50>
cc = read(0, &c, 1);
25a: 83 ec 04 sub $0x4,%esp
25d: 6a 01 push $0x1
25f: 8d 45 ef lea -0x11(%ebp),%eax
262: 50 push %eax
263: 6a 00 push $0x0
265: e8 3d 01 00 00 call 3a7 <read>
26a: 83 c4 10 add $0x10,%esp
26d: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
270: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
274: 7f 02 jg 278 <gets+0x2d>
break;
276: eb 2c jmp 2a4 <gets+0x59>
buf[i++] = c;
278: 8b 45 f4 mov -0xc(%ebp),%eax
27b: 8d 50 01 lea 0x1(%eax),%edx
27e: 89 55 f4 mov %edx,-0xc(%ebp)
281: 89 c2 mov %eax,%edx
283: 8b 45 08 mov 0x8(%ebp),%eax
286: 01 c2 add %eax,%edx
288: 8a 45 ef mov -0x11(%ebp),%al
28b: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
28d: 8a 45 ef mov -0x11(%ebp),%al
290: 3c 0a cmp $0xa,%al
292: 74 10 je 2a4 <gets+0x59>
294: 8a 45 ef mov -0x11(%ebp),%al
297: 3c 0d cmp $0xd,%al
299: 74 09 je 2a4 <gets+0x59>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
29b: 8b 45 f4 mov -0xc(%ebp),%eax
29e: 40 inc %eax
29f: 3b 45 0c cmp 0xc(%ebp),%eax
2a2: 7c b6 jl 25a <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
2a4: 8b 55 f4 mov -0xc(%ebp),%edx
2a7: 8b 45 08 mov 0x8(%ebp),%eax
2aa: 01 d0 add %edx,%eax
2ac: c6 00 00 movb $0x0,(%eax)
return buf;
2af: 8b 45 08 mov 0x8(%ebp),%eax
}
2b2: c9 leave
2b3: c3 ret
000002b4 <stat>:
int
stat(char *n, struct stat *st)
{
2b4: 55 push %ebp
2b5: 89 e5 mov %esp,%ebp
2b7: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
2ba: 83 ec 08 sub $0x8,%esp
2bd: 6a 00 push $0x0
2bf: ff 75 08 pushl 0x8(%ebp)
2c2: e8 08 01 00 00 call 3cf <open>
2c7: 83 c4 10 add $0x10,%esp
2ca: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2cd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d1: 79 07 jns 2da <stat+0x26>
return -1;
2d3: b8 ff ff ff ff mov $0xffffffff,%eax
2d8: eb 25 jmp 2ff <stat+0x4b>
r = fstat(fd, st);
2da: 83 ec 08 sub $0x8,%esp
2dd: ff 75 0c pushl 0xc(%ebp)
2e0: ff 75 f4 pushl -0xc(%ebp)
2e3: e8 ff 00 00 00 call 3e7 <fstat>
2e8: 83 c4 10 add $0x10,%esp
2eb: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2ee: 83 ec 0c sub $0xc,%esp
2f1: ff 75 f4 pushl -0xc(%ebp)
2f4: e8 be 00 00 00 call 3b7 <close>
2f9: 83 c4 10 add $0x10,%esp
return r;
2fc: 8b 45 f0 mov -0x10(%ebp),%eax
}
2ff: c9 leave
300: c3 ret
00000301 <atoi>:
int
atoi(const char *s)
{
301: 55 push %ebp
302: 89 e5 mov %esp,%ebp
304: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
307: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
30e: eb 24 jmp 334 <atoi+0x33>
n = n*10 + *s++ - '0';
310: 8b 55 fc mov -0x4(%ebp),%edx
313: 89 d0 mov %edx,%eax
315: c1 e0 02 shl $0x2,%eax
318: 01 d0 add %edx,%eax
31a: 01 c0 add %eax,%eax
31c: 89 c1 mov %eax,%ecx
31e: 8b 45 08 mov 0x8(%ebp),%eax
321: 8d 50 01 lea 0x1(%eax),%edx
324: 89 55 08 mov %edx,0x8(%ebp)
327: 8a 00 mov (%eax),%al
329: 0f be c0 movsbl %al,%eax
32c: 01 c8 add %ecx,%eax
32e: 83 e8 30 sub $0x30,%eax
331: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
334: 8b 45 08 mov 0x8(%ebp),%eax
337: 8a 00 mov (%eax),%al
339: 3c 2f cmp $0x2f,%al
33b: 7e 09 jle 346 <atoi+0x45>
33d: 8b 45 08 mov 0x8(%ebp),%eax
340: 8a 00 mov (%eax),%al
342: 3c 39 cmp $0x39,%al
344: 7e ca jle 310 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
346: 8b 45 fc mov -0x4(%ebp),%eax
}
349: c9 leave
34a: c3 ret
0000034b <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
34b: 55 push %ebp
34c: 89 e5 mov %esp,%ebp
34e: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
351: 8b 45 08 mov 0x8(%ebp),%eax
354: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
357: 8b 45 0c mov 0xc(%ebp),%eax
35a: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
35d: eb 16 jmp 375 <memmove+0x2a>
*dst++ = *src++;
35f: 8b 45 fc mov -0x4(%ebp),%eax
362: 8d 50 01 lea 0x1(%eax),%edx
365: 89 55 fc mov %edx,-0x4(%ebp)
368: 8b 55 f8 mov -0x8(%ebp),%edx
36b: 8d 4a 01 lea 0x1(%edx),%ecx
36e: 89 4d f8 mov %ecx,-0x8(%ebp)
371: 8a 12 mov (%edx),%dl
373: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
375: 8b 45 10 mov 0x10(%ebp),%eax
378: 8d 50 ff lea -0x1(%eax),%edx
37b: 89 55 10 mov %edx,0x10(%ebp)
37e: 85 c0 test %eax,%eax
380: 7f dd jg 35f <memmove+0x14>
*dst++ = *src++;
return vdst;
382: 8b 45 08 mov 0x8(%ebp),%eax
}
385: c9 leave
386: c3 ret
00000387 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
387: b8 01 00 00 00 mov $0x1,%eax
38c: cd 40 int $0x40
38e: c3 ret
0000038f <exit>:
SYSCALL(exit)
38f: b8 02 00 00 00 mov $0x2,%eax
394: cd 40 int $0x40
396: c3 ret
00000397 <wait>:
SYSCALL(wait)
397: b8 03 00 00 00 mov $0x3,%eax
39c: cd 40 int $0x40
39e: c3 ret
0000039f <pipe>:
SYSCALL(pipe)
39f: b8 04 00 00 00 mov $0x4,%eax
3a4: cd 40 int $0x40
3a6: c3 ret
000003a7 <read>:
SYSCALL(read)
3a7: b8 05 00 00 00 mov $0x5,%eax
3ac: cd 40 int $0x40
3ae: c3 ret
000003af <write>:
SYSCALL(write)
3af: b8 10 00 00 00 mov $0x10,%eax
3b4: cd 40 int $0x40
3b6: c3 ret
000003b7 <close>:
SYSCALL(close)
3b7: b8 15 00 00 00 mov $0x15,%eax
3bc: cd 40 int $0x40
3be: c3 ret
000003bf <kill>:
SYSCALL(kill)
3bf: b8 06 00 00 00 mov $0x6,%eax
3c4: cd 40 int $0x40
3c6: c3 ret
000003c7 <exec>:
SYSCALL(exec)
3c7: b8 07 00 00 00 mov $0x7,%eax
3cc: cd 40 int $0x40
3ce: c3 ret
000003cf <open>:
SYSCALL(open)
3cf: b8 0f 00 00 00 mov $0xf,%eax
3d4: cd 40 int $0x40
3d6: c3 ret
000003d7 <mknod>:
SYSCALL(mknod)
3d7: b8 11 00 00 00 mov $0x11,%eax
3dc: cd 40 int $0x40
3de: c3 ret
000003df <unlink>:
SYSCALL(unlink)
3df: b8 12 00 00 00 mov $0x12,%eax
3e4: cd 40 int $0x40
3e6: c3 ret
000003e7 <fstat>:
SYSCALL(fstat)
3e7: b8 08 00 00 00 mov $0x8,%eax
3ec: cd 40 int $0x40
3ee: c3 ret
000003ef <link>:
SYSCALL(link)
3ef: b8 13 00 00 00 mov $0x13,%eax
3f4: cd 40 int $0x40
3f6: c3 ret
000003f7 <mkdir>:
SYSCALL(mkdir)
3f7: b8 14 00 00 00 mov $0x14,%eax
3fc: cd 40 int $0x40
3fe: c3 ret
000003ff <chdir>:
SYSCALL(chdir)
3ff: b8 09 00 00 00 mov $0x9,%eax
404: cd 40 int $0x40
406: c3 ret
00000407 <dup>:
SYSCALL(dup)
407: b8 0a 00 00 00 mov $0xa,%eax
40c: cd 40 int $0x40
40e: c3 ret
0000040f <getpid>:
SYSCALL(getpid)
40f: b8 0b 00 00 00 mov $0xb,%eax
414: cd 40 int $0x40
416: c3 ret
00000417 <sbrk>:
SYSCALL(sbrk)
417: b8 0c 00 00 00 mov $0xc,%eax
41c: cd 40 int $0x40
41e: c3 ret
0000041f <sleep>:
SYSCALL(sleep)
41f: b8 0d 00 00 00 mov $0xd,%eax
424: cd 40 int $0x40
426: c3 ret
00000427 <uptime>:
SYSCALL(uptime)
427: b8 0e 00 00 00 mov $0xe,%eax
42c: cd 40 int $0x40
42e: c3 ret
0000042f <getCallCount>:
SYSCALL(getCallCount)
42f: b8 16 00 00 00 mov $0x16,%eax
434: cd 40 int $0x40
436: c3 ret
00000437 <myMemory>:
SYSCALL(myMemory)
437: b8 17 00 00 00 mov $0x17,%eax
43c: cd 40 int $0x40
43e: c3 ret
0000043f <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
43f: 55 push %ebp
440: 89 e5 mov %esp,%ebp
442: 83 ec 18 sub $0x18,%esp
445: 8b 45 0c mov 0xc(%ebp),%eax
448: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
44b: 83 ec 04 sub $0x4,%esp
44e: 6a 01 push $0x1
450: 8d 45 f4 lea -0xc(%ebp),%eax
453: 50 push %eax
454: ff 75 08 pushl 0x8(%ebp)
457: e8 53 ff ff ff call 3af <write>
45c: 83 c4 10 add $0x10,%esp
}
45f: c9 leave
460: c3 ret
00000461 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
461: 55 push %ebp
462: 89 e5 mov %esp,%ebp
464: 53 push %ebx
465: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
468: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
46f: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
473: 74 17 je 48c <printint+0x2b>
475: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
479: 79 11 jns 48c <printint+0x2b>
neg = 1;
47b: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
482: 8b 45 0c mov 0xc(%ebp),%eax
485: f7 d8 neg %eax
487: 89 45 ec mov %eax,-0x14(%ebp)
48a: eb 06 jmp 492 <printint+0x31>
} else {
x = xx;
48c: 8b 45 0c mov 0xc(%ebp),%eax
48f: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
492: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
499: 8b 4d f4 mov -0xc(%ebp),%ecx
49c: 8d 41 01 lea 0x1(%ecx),%eax
49f: 89 45 f4 mov %eax,-0xc(%ebp)
4a2: 8b 5d 10 mov 0x10(%ebp),%ebx
4a5: 8b 45 ec mov -0x14(%ebp),%eax
4a8: ba 00 00 00 00 mov $0x0,%edx
4ad: f7 f3 div %ebx
4af: 89 d0 mov %edx,%eax
4b1: 8a 80 48 0b 00 00 mov 0xb48(%eax),%al
4b7: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
4bb: 8b 5d 10 mov 0x10(%ebp),%ebx
4be: 8b 45 ec mov -0x14(%ebp),%eax
4c1: ba 00 00 00 00 mov $0x0,%edx
4c6: f7 f3 div %ebx
4c8: 89 45 ec mov %eax,-0x14(%ebp)
4cb: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4cf: 75 c8 jne 499 <printint+0x38>
if(neg)
4d1: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4d5: 74 0e je 4e5 <printint+0x84>
buf[i++] = '-';
4d7: 8b 45 f4 mov -0xc(%ebp),%eax
4da: 8d 50 01 lea 0x1(%eax),%edx
4dd: 89 55 f4 mov %edx,-0xc(%ebp)
4e0: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4e5: eb 1c jmp 503 <printint+0xa2>
putc(fd, buf[i]);
4e7: 8d 55 dc lea -0x24(%ebp),%edx
4ea: 8b 45 f4 mov -0xc(%ebp),%eax
4ed: 01 d0 add %edx,%eax
4ef: 8a 00 mov (%eax),%al
4f1: 0f be c0 movsbl %al,%eax
4f4: 83 ec 08 sub $0x8,%esp
4f7: 50 push %eax
4f8: ff 75 08 pushl 0x8(%ebp)
4fb: e8 3f ff ff ff call 43f <putc>
500: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
503: ff 4d f4 decl -0xc(%ebp)
506: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
50a: 79 db jns 4e7 <printint+0x86>
putc(fd, buf[i]);
}
50c: 8b 5d fc mov -0x4(%ebp),%ebx
50f: c9 leave
510: c3 ret
00000511 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
511: 55 push %ebp
512: 89 e5 mov %esp,%ebp
514: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
517: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
51e: 8d 45 0c lea 0xc(%ebp),%eax
521: 83 c0 04 add $0x4,%eax
524: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
527: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
52e: e9 54 01 00 00 jmp 687 <printf+0x176>
c = fmt[i] & 0xff;
533: 8b 55 0c mov 0xc(%ebp),%edx
536: 8b 45 f0 mov -0x10(%ebp),%eax
539: 01 d0 add %edx,%eax
53b: 8a 00 mov (%eax),%al
53d: 0f be c0 movsbl %al,%eax
540: 25 ff 00 00 00 and $0xff,%eax
545: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
548: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
54c: 75 2c jne 57a <printf+0x69>
if(c == '%'){
54e: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
552: 75 0c jne 560 <printf+0x4f>
state = '%';
554: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
55b: e9 24 01 00 00 jmp 684 <printf+0x173>
} else {
putc(fd, c);
560: 8b 45 e4 mov -0x1c(%ebp),%eax
563: 0f be c0 movsbl %al,%eax
566: 83 ec 08 sub $0x8,%esp
569: 50 push %eax
56a: ff 75 08 pushl 0x8(%ebp)
56d: e8 cd fe ff ff call 43f <putc>
572: 83 c4 10 add $0x10,%esp
575: e9 0a 01 00 00 jmp 684 <printf+0x173>
}
} else if(state == '%'){
57a: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
57e: 0f 85 00 01 00 00 jne 684 <printf+0x173>
if(c == 'd'){
584: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
588: 75 1e jne 5a8 <printf+0x97>
printint(fd, *ap, 10, 1);
58a: 8b 45 e8 mov -0x18(%ebp),%eax
58d: 8b 00 mov (%eax),%eax
58f: 6a 01 push $0x1
591: 6a 0a push $0xa
593: 50 push %eax
594: ff 75 08 pushl 0x8(%ebp)
597: e8 c5 fe ff ff call 461 <printint>
59c: 83 c4 10 add $0x10,%esp
ap++;
59f: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5a3: e9 d5 00 00 00 jmp 67d <printf+0x16c>
} else if(c == 'x' || c == 'p'){
5a8: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
5ac: 74 06 je 5b4 <printf+0xa3>
5ae: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
5b2: 75 1e jne 5d2 <printf+0xc1>
printint(fd, *ap, 16, 0);
5b4: 8b 45 e8 mov -0x18(%ebp),%eax
5b7: 8b 00 mov (%eax),%eax
5b9: 6a 00 push $0x0
5bb: 6a 10 push $0x10
5bd: 50 push %eax
5be: ff 75 08 pushl 0x8(%ebp)
5c1: e8 9b fe ff ff call 461 <printint>
5c6: 83 c4 10 add $0x10,%esp
ap++;
5c9: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5cd: e9 ab 00 00 00 jmp 67d <printf+0x16c>
} else if(c == 's'){
5d2: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
5d6: 75 40 jne 618 <printf+0x107>
s = (char*)*ap;
5d8: 8b 45 e8 mov -0x18(%ebp),%eax
5db: 8b 00 mov (%eax),%eax
5dd: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
5e0: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
5e4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
5e8: 75 07 jne 5f1 <printf+0xe0>
s = "(null)";
5ea: c7 45 f4 ea 08 00 00 movl $0x8ea,-0xc(%ebp)
while(*s != 0){
5f1: eb 1a jmp 60d <printf+0xfc>
putc(fd, *s);
5f3: 8b 45 f4 mov -0xc(%ebp),%eax
5f6: 8a 00 mov (%eax),%al
5f8: 0f be c0 movsbl %al,%eax
5fb: 83 ec 08 sub $0x8,%esp
5fe: 50 push %eax
5ff: ff 75 08 pushl 0x8(%ebp)
602: e8 38 fe ff ff call 43f <putc>
607: 83 c4 10 add $0x10,%esp
s++;
60a: ff 45 f4 incl -0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
60d: 8b 45 f4 mov -0xc(%ebp),%eax
610: 8a 00 mov (%eax),%al
612: 84 c0 test %al,%al
614: 75 dd jne 5f3 <printf+0xe2>
616: eb 65 jmp 67d <printf+0x16c>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
618: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
61c: 75 1d jne 63b <printf+0x12a>
putc(fd, *ap);
61e: 8b 45 e8 mov -0x18(%ebp),%eax
621: 8b 00 mov (%eax),%eax
623: 0f be c0 movsbl %al,%eax
626: 83 ec 08 sub $0x8,%esp
629: 50 push %eax
62a: ff 75 08 pushl 0x8(%ebp)
62d: e8 0d fe ff ff call 43f <putc>
632: 83 c4 10 add $0x10,%esp
ap++;
635: 83 45 e8 04 addl $0x4,-0x18(%ebp)
639: eb 42 jmp 67d <printf+0x16c>
} else if(c == '%'){
63b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
63f: 75 17 jne 658 <printf+0x147>
putc(fd, c);
641: 8b 45 e4 mov -0x1c(%ebp),%eax
644: 0f be c0 movsbl %al,%eax
647: 83 ec 08 sub $0x8,%esp
64a: 50 push %eax
64b: ff 75 08 pushl 0x8(%ebp)
64e: e8 ec fd ff ff call 43f <putc>
653: 83 c4 10 add $0x10,%esp
656: eb 25 jmp 67d <printf+0x16c>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
658: 83 ec 08 sub $0x8,%esp
65b: 6a 25 push $0x25
65d: ff 75 08 pushl 0x8(%ebp)
660: e8 da fd ff ff call 43f <putc>
665: 83 c4 10 add $0x10,%esp
putc(fd, c);
668: 8b 45 e4 mov -0x1c(%ebp),%eax
66b: 0f be c0 movsbl %al,%eax
66e: 83 ec 08 sub $0x8,%esp
671: 50 push %eax
672: ff 75 08 pushl 0x8(%ebp)
675: e8 c5 fd ff ff call 43f <putc>
67a: 83 c4 10 add $0x10,%esp
}
state = 0;
67d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
684: ff 45 f0 incl -0x10(%ebp)
687: 8b 55 0c mov 0xc(%ebp),%edx
68a: 8b 45 f0 mov -0x10(%ebp),%eax
68d: 01 d0 add %edx,%eax
68f: 8a 00 mov (%eax),%al
691: 84 c0 test %al,%al
693: 0f 85 9a fe ff ff jne 533 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
699: c9 leave
69a: c3 ret
0000069b <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
69b: 55 push %ebp
69c: 89 e5 mov %esp,%ebp
69e: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
6a1: 8b 45 08 mov 0x8(%ebp),%eax
6a4: 83 e8 08 sub $0x8,%eax
6a7: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6aa: a1 64 0b 00 00 mov 0xb64,%eax
6af: 89 45 fc mov %eax,-0x4(%ebp)
6b2: eb 24 jmp 6d8 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6b4: 8b 45 fc mov -0x4(%ebp),%eax
6b7: 8b 00 mov (%eax),%eax
6b9: 3b 45 fc cmp -0x4(%ebp),%eax
6bc: 77 12 ja 6d0 <free+0x35>
6be: 8b 45 f8 mov -0x8(%ebp),%eax
6c1: 3b 45 fc cmp -0x4(%ebp),%eax
6c4: 77 24 ja 6ea <free+0x4f>
6c6: 8b 45 fc mov -0x4(%ebp),%eax
6c9: 8b 00 mov (%eax),%eax
6cb: 3b 45 f8 cmp -0x8(%ebp),%eax
6ce: 77 1a ja 6ea <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6d0: 8b 45 fc mov -0x4(%ebp),%eax
6d3: 8b 00 mov (%eax),%eax
6d5: 89 45 fc mov %eax,-0x4(%ebp)
6d8: 8b 45 f8 mov -0x8(%ebp),%eax
6db: 3b 45 fc cmp -0x4(%ebp),%eax
6de: 76 d4 jbe 6b4 <free+0x19>
6e0: 8b 45 fc mov -0x4(%ebp),%eax
6e3: 8b 00 mov (%eax),%eax
6e5: 3b 45 f8 cmp -0x8(%ebp),%eax
6e8: 76 ca jbe 6b4 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6ea: 8b 45 f8 mov -0x8(%ebp),%eax
6ed: 8b 40 04 mov 0x4(%eax),%eax
6f0: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6f7: 8b 45 f8 mov -0x8(%ebp),%eax
6fa: 01 c2 add %eax,%edx
6fc: 8b 45 fc mov -0x4(%ebp),%eax
6ff: 8b 00 mov (%eax),%eax
701: 39 c2 cmp %eax,%edx
703: 75 24 jne 729 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
705: 8b 45 f8 mov -0x8(%ebp),%eax
708: 8b 50 04 mov 0x4(%eax),%edx
70b: 8b 45 fc mov -0x4(%ebp),%eax
70e: 8b 00 mov (%eax),%eax
710: 8b 40 04 mov 0x4(%eax),%eax
713: 01 c2 add %eax,%edx
715: 8b 45 f8 mov -0x8(%ebp),%eax
718: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
71b: 8b 45 fc mov -0x4(%ebp),%eax
71e: 8b 00 mov (%eax),%eax
720: 8b 10 mov (%eax),%edx
722: 8b 45 f8 mov -0x8(%ebp),%eax
725: 89 10 mov %edx,(%eax)
727: eb 0a jmp 733 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
729: 8b 45 fc mov -0x4(%ebp),%eax
72c: 8b 10 mov (%eax),%edx
72e: 8b 45 f8 mov -0x8(%ebp),%eax
731: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
733: 8b 45 fc mov -0x4(%ebp),%eax
736: 8b 40 04 mov 0x4(%eax),%eax
739: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
740: 8b 45 fc mov -0x4(%ebp),%eax
743: 01 d0 add %edx,%eax
745: 3b 45 f8 cmp -0x8(%ebp),%eax
748: 75 20 jne 76a <free+0xcf>
p->s.size += bp->s.size;
74a: 8b 45 fc mov -0x4(%ebp),%eax
74d: 8b 50 04 mov 0x4(%eax),%edx
750: 8b 45 f8 mov -0x8(%ebp),%eax
753: 8b 40 04 mov 0x4(%eax),%eax
756: 01 c2 add %eax,%edx
758: 8b 45 fc mov -0x4(%ebp),%eax
75b: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
75e: 8b 45 f8 mov -0x8(%ebp),%eax
761: 8b 10 mov (%eax),%edx
763: 8b 45 fc mov -0x4(%ebp),%eax
766: 89 10 mov %edx,(%eax)
768: eb 08 jmp 772 <free+0xd7>
} else
p->s.ptr = bp;
76a: 8b 45 fc mov -0x4(%ebp),%eax
76d: 8b 55 f8 mov -0x8(%ebp),%edx
770: 89 10 mov %edx,(%eax)
freep = p;
772: 8b 45 fc mov -0x4(%ebp),%eax
775: a3 64 0b 00 00 mov %eax,0xb64
}
77a: c9 leave
77b: c3 ret
0000077c <morecore>:
static Header*
morecore(uint nu)
{
77c: 55 push %ebp
77d: 89 e5 mov %esp,%ebp
77f: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
782: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
789: 77 07 ja 792 <morecore+0x16>
nu = 4096;
78b: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
792: 8b 45 08 mov 0x8(%ebp),%eax
795: c1 e0 03 shl $0x3,%eax
798: 83 ec 0c sub $0xc,%esp
79b: 50 push %eax
79c: e8 76 fc ff ff call 417 <sbrk>
7a1: 83 c4 10 add $0x10,%esp
7a4: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
7a7: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
7ab: 75 07 jne 7b4 <morecore+0x38>
return 0;
7ad: b8 00 00 00 00 mov $0x0,%eax
7b2: eb 26 jmp 7da <morecore+0x5e>
hp = (Header*)p;
7b4: 8b 45 f4 mov -0xc(%ebp),%eax
7b7: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
7ba: 8b 45 f0 mov -0x10(%ebp),%eax
7bd: 8b 55 08 mov 0x8(%ebp),%edx
7c0: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
7c3: 8b 45 f0 mov -0x10(%ebp),%eax
7c6: 83 c0 08 add $0x8,%eax
7c9: 83 ec 0c sub $0xc,%esp
7cc: 50 push %eax
7cd: e8 c9 fe ff ff call 69b <free>
7d2: 83 c4 10 add $0x10,%esp
return freep;
7d5: a1 64 0b 00 00 mov 0xb64,%eax
}
7da: c9 leave
7db: c3 ret
000007dc <malloc>:
void*
malloc(uint nbytes)
{
7dc: 55 push %ebp
7dd: 89 e5 mov %esp,%ebp
7df: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
7e2: 8b 45 08 mov 0x8(%ebp),%eax
7e5: 83 c0 07 add $0x7,%eax
7e8: c1 e8 03 shr $0x3,%eax
7eb: 40 inc %eax
7ec: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
7ef: a1 64 0b 00 00 mov 0xb64,%eax
7f4: 89 45 f0 mov %eax,-0x10(%ebp)
7f7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7fb: 75 23 jne 820 <malloc+0x44>
base.s.ptr = freep = prevp = &base;
7fd: c7 45 f0 5c 0b 00 00 movl $0xb5c,-0x10(%ebp)
804: 8b 45 f0 mov -0x10(%ebp),%eax
807: a3 64 0b 00 00 mov %eax,0xb64
80c: a1 64 0b 00 00 mov 0xb64,%eax
811: a3 5c 0b 00 00 mov %eax,0xb5c
base.s.size = 0;
816: c7 05 60 0b 00 00 00 movl $0x0,0xb60
81d: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
820: 8b 45 f0 mov -0x10(%ebp),%eax
823: 8b 00 mov (%eax),%eax
825: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
828: 8b 45 f4 mov -0xc(%ebp),%eax
82b: 8b 40 04 mov 0x4(%eax),%eax
82e: 3b 45 ec cmp -0x14(%ebp),%eax
831: 72 4d jb 880 <malloc+0xa4>
if(p->s.size == nunits)
833: 8b 45 f4 mov -0xc(%ebp),%eax
836: 8b 40 04 mov 0x4(%eax),%eax
839: 3b 45 ec cmp -0x14(%ebp),%eax
83c: 75 0c jne 84a <malloc+0x6e>
prevp->s.ptr = p->s.ptr;
83e: 8b 45 f4 mov -0xc(%ebp),%eax
841: 8b 10 mov (%eax),%edx
843: 8b 45 f0 mov -0x10(%ebp),%eax
846: 89 10 mov %edx,(%eax)
848: eb 26 jmp 870 <malloc+0x94>
else {
p->s.size -= nunits;
84a: 8b 45 f4 mov -0xc(%ebp),%eax
84d: 8b 40 04 mov 0x4(%eax),%eax
850: 2b 45 ec sub -0x14(%ebp),%eax
853: 89 c2 mov %eax,%edx
855: 8b 45 f4 mov -0xc(%ebp),%eax
858: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
85b: 8b 45 f4 mov -0xc(%ebp),%eax
85e: 8b 40 04 mov 0x4(%eax),%eax
861: c1 e0 03 shl $0x3,%eax
864: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
867: 8b 45 f4 mov -0xc(%ebp),%eax
86a: 8b 55 ec mov -0x14(%ebp),%edx
86d: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
870: 8b 45 f0 mov -0x10(%ebp),%eax
873: a3 64 0b 00 00 mov %eax,0xb64
return (void*)(p + 1);
878: 8b 45 f4 mov -0xc(%ebp),%eax
87b: 83 c0 08 add $0x8,%eax
87e: eb 3b jmp 8bb <malloc+0xdf>
}
if(p == freep)
880: a1 64 0b 00 00 mov 0xb64,%eax
885: 39 45 f4 cmp %eax,-0xc(%ebp)
888: 75 1e jne 8a8 <malloc+0xcc>
if((p = morecore(nunits)) == 0)
88a: 83 ec 0c sub $0xc,%esp
88d: ff 75 ec pushl -0x14(%ebp)
890: e8 e7 fe ff ff call 77c <morecore>
895: 83 c4 10 add $0x10,%esp
898: 89 45 f4 mov %eax,-0xc(%ebp)
89b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
89f: 75 07 jne 8a8 <malloc+0xcc>
return 0;
8a1: b8 00 00 00 00 mov $0x0,%eax
8a6: eb 13 jmp 8bb <malloc+0xdf>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
8a8: 8b 45 f4 mov -0xc(%ebp),%eax
8ab: 89 45 f0 mov %eax,-0x10(%ebp)
8ae: 8b 45 f4 mov -0xc(%ebp),%eax
8b1: 8b 00 mov (%eax),%eax
8b3: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
8b6: e9 6d ff ff ff jmp 828 <malloc+0x4c>
}
8bb: c9 leave
8bc: c3 ret
|
script.applescript | invious/alfred-imgur-tor | 0 | 1018 | on run
-- Function to check if JSON Helper is installed
set jsonHelperExists to false
try
do shell script "osascript -e 'exists application \"JSON Helper\"'"
set jsonHelperExists to true
end try
try
do shell script "test -f /usr/local/bin/torsocks"
on error
return "Please make sure both torsocks is installed!"
end try
-- Abort if not installed
if jsonHelperExists is false then
return "Couldn't find JSON Helper. Install via http://www.appstore.com/mac/jsonhelperforapplescript"
end if
-- Abort if not installed
if jsonHelperExists is false then
return "Couldn't find JSON Helper. Install via http://www.appstore.com/mac/jsonhelperforapplescript"
end if
-- Check if API key file exists
try
do shell script "/bin/ls ~/.alfred-imgur-tor.conf"
on error errMsg number errNum
return "Couldn't find Imgur API key (~/.alfred-imgur-tor.conf)."
end try
-- Find selected file
tell application "Finder"
set someSource to selection as alias list
if someSource = {} then
return "Select a file in Finder first"
end if
set theFile to item 1 of someSource as alias
set theFileInfo to info for theFile
set theName to name of theFileInfo
set theExt to name extension of theFileInfo
end tell
-- List of allowed file types
set ImgTypes to {"JPEG", "JPG", "PNG", "GIF", "APNG", "TIFF", "BMP", "PDF", "XCF"}
-- Abort if not listed
if theExt is not in ImgTypes then
return "A file with an extention " & theExt & " can't be uploaded"
end if
-- Call upload function and return the link
set sUpload to imgur(theFile, false)
set the clipboard to sUpload
return sUpload
end run
-- Imgur upload function using OAuth (API v3)
on imgur(_Image, _isOpen)
set sImg to (POSIX path of _Image)
set apikey to do shell script "/bin/cat ~/.alfred-imgur-tor.conf"
set curlCommand to "torsocks curl -H \"Authorization: Client-ID " & apikey & "\" -F \"image=@" & sImg & "\" https://api.imgur.com/3/upload"
set answer to do shell script curlCommand
tell application "JSON Helper"
set jsonAPI to read JSON from answer
set link to link of |data| of jsonAPI
end tell
if _isOpen = true then
tell application "Finder" to open location link
end if
return link
end imgur |
programs/oeis/072/A072491.asm | neoneye/loda | 22 | 92783 | ; A072491: Define f(1) = 0. For n>=2, let f(n) = n - p where p is the largest prime <= n. a(n) = number of iterations of f to reach 0, starting from n.
; 0,1,1,1,2,1,2,1,2,2,2,1,2,1,2,2,2,1,2,1,2,2,2,1,2,2,2,3,2,1,2,1,2,2,2,3,2,1,2,2,2,1,2,1,2,2,2,1,2,2,2,3,2,1,2,2,2,3,2,1,2,1,2,2,2,3,2,1,2,2,2,1,2,1,2,2,2,3,2,1,2,2,2,1,2,2,2,3,2,1,2,2,2,3,2,3,2,1,2,2
lpb $0
trn $0,1
seq $0,64722 ; a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n).
add $1,1
lpe
mov $0,$1
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca.log_21829_1142.asm | ljhsiun2/medusa | 9 | 8611 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1d57a, %rsi
lea addresses_D_ht+0xb155, %rdi
nop
nop
nop
nop
sub %r8, %r8
mov $108, %rcx
rep movsb
nop
nop
nop
nop
and %r14, %r14
lea addresses_A_ht+0x173b4, %rcx
nop
nop
nop
nop
nop
xor %r8, %r8
vmovups (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rsi
cmp %rcx, %rcx
lea addresses_WC_ht+0x1227e, %rdx
nop
nop
cmp %rsi, %rsi
movb $0x61, (%rdx)
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_UC_ht+0x16f34, %rdi
nop
nop
dec %r14
mov (%rdi), %rdx
nop
nop
nop
nop
nop
and $64046, %rsi
lea addresses_normal_ht+0x15c34, %rsi
lea addresses_WT_ht+0x1c734, %rdi
nop
nop
nop
nop
inc %r15
mov $75, %rcx
rep movsq
and %rdi, %rdi
lea addresses_A_ht+0xeddc, %rsi
lea addresses_A_ht+0x33f4, %rdi
nop
nop
nop
nop
dec %r9
mov $45, %rcx
rep movsq
nop
nop
nop
nop
sub $31399, %rcx
lea addresses_A_ht+0x1e5c4, %rsi
lea addresses_WC_ht+0x14534, %rdi
clflush (%rdi)
cmp $32980, %r8
mov $96, %rcx
rep movsl
nop
nop
nop
nop
inc %r9
lea addresses_UC_ht+0x16a34, %r14
nop
nop
nop
nop
nop
dec %r9
movw $0x6162, (%r14)
nop
nop
inc %rdx
lea addresses_D_ht+0x514, %r9
nop
nop
nop
nop
nop
and $14919, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
movups %xmm3, (%r9)
nop
nop
nop
sub $32564, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rbx
push %rdi
// Store
lea addresses_D+0x1e434, %r14
nop
nop
nop
nop
nop
dec %r9
mov $0x5152535455565758, %r11
movq %r11, %xmm3
movups %xmm3, (%r14)
nop
nop
xor %r9, %r9
// Store
lea addresses_normal+0x177dc, %r8
clflush (%r8)
nop
nop
nop
nop
inc %r10
movb $0x51, (%r8)
nop
nop
nop
inc %r9
// Faulty Load
lea addresses_WT+0x3434, %r10
nop
xor %r11, %r11
mov (%r10), %r14d
lea oracles, %r11
and $0xff, %r14
shlq $12, %r14
mov (%r11,%r14,1), %r14
pop %rdi
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D_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/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_674.asm | ljhsiun2/medusa | 9 | 20557 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x2abf, %rsi
lea addresses_normal_ht+0x19053, %rdi
nop
inc %r14
mov $114, %rcx
rep movsl
dec %rax
lea addresses_WT_ht+0x7fbf, %rsi
nop
nop
nop
and $41708, %rax
movb (%rsi), %r10b
nop
nop
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x10f5f, %rsi
lea addresses_WT_ht+0x417f, %rdi
nop
add $24320, %r9
mov $61, %rcx
rep movsq
sub $2597, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rax
push %rbp
push %rsi
// Faulty Load
lea addresses_PSE+0x16bf, %rbp
nop
nop
cmp $44541, %rsi
mov (%rbp), %r10
lea oracles, %rax
and $0xff, %r10
shlq $12, %r10
mov (%rax,%r10,1), %r10
pop %rsi
pop %rbp
pop %rax
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': True, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'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
*/
|
libsrc/_DEVELOPMENT/adt/wv_priority_queue/z80/asm_wv_priority_queue_push.asm | meesokim/z88dk | 0 | 91968 |
; ===============================================================
; Mar 2014
; ===============================================================
;
; int wv_priority_queue_push(wv_priority_queue_t *q, void *item)
;
; Push item into the priority queue.
;
; ===============================================================
SECTION code_adt_wv_priority_queue
PUBLIC asm_wv_priority_queue_push
EXTERN asm_w_vector_append, asm0_wa_priority_queue_push, error_mc
asm_wv_priority_queue_push:
; enter : hl = priority_queue *
; bc = item
;
; exit : success
;
; hl = 0
; carry reset
;
; fail if queue full
;
; hl = -1
; carry set
;
; uses : af, bc, de, hl, ix
push hl ; save queue *
call asm_w_vector_append ; append item
jp nc, asm0_wa_priority_queue_push
jp error_mc - 1 ; if append failed
|
libsrc/genmath/int2.asm | dex4er/deb-z88dk | 1 | 25440 | ;
; Z88dk Generic Floating Point Math Library
;
; ???
;
; $Id: int2.asm,v 1.1 2002/01/21 20:35:22 dom Exp $:
XLIB int2
LIB rshift
LIB incr
LIB ldbcfa
LIB minusbc
LIB unpack
.INT2 LD B,A ;if a==0, return with bc ix de = 0...
LD C,A
LD D,A
LD E,A
DEFB $DD
LD H,A
DEFB $DD
LD L,A
OR A
RET Z
PUSH HL
CALL LDBCFA ;copy FA into bc ix de,
CALL UNPACK ; restore hidden bits
XOR (HL)
LD H,A ;put sign in msb of h
JP P,INT4 ;p => positive number
DEC DE ;decrement c ix de...
LD A,D
AND E
INC A
JR NZ,INT4
DEC IX
DEFB $DD
LD A,H
DEFB $DD
AND L
INC A
JR NZ,INT4
DEC C ;...end of c ix de decrementing
;
.INT4 LD A,$A8 ;shift c ix de right so bits to
SUB B ; the right of the binary point
CALL RSHIFT ; are discarded
LD A,H
RLA
CALL C,INCR ;c => negative, increment c ix de
LD B,0
CALL C,MINUSBC ;negate the fraction c ix de
POP HL
RET
|
source/types/adam-a_type-enumeration_literal.adb | charlie5/aIDE | 3 | 27201 | with
AdaM.Factory;
package body AdaM.a_Type.enumeration_literal
is
-- Storage Pool
--
record_Version : constant := 1;
pool_Size : constant := 5_000;
package Pool is new AdaM.Factory.Pools (storage_Folder => ".adam-store",
pool_Name => "enumeration_literals",
max_Items => pool_Size,
record_Version => record_Version,
Item => enumeration_Literal.item,
View => enumeration_Literal.view);
-- Forge
--
procedure define (Self : in out Item; Name : in String)
is
begin
Self.Name_is (Name);
end define;
overriding
procedure destruct (Self : in out Item)
is
begin
null;
end destruct;
function new_Literal (Value : in String := "") return enumeration_Literal.View
is
new_View : constant enumeration_Literal.view := Pool.new_Item;
begin
define (enumeration_Literal.item (new_View.all), Value);
return new_View;
end new_Literal;
procedure free (Self : in out enumeration_Literal.view)
is
begin
destruct (enumeration_Literal.item (Self.all));
Pool.free (Self);
end free;
-- Attributes
--
overriding
function Id (Self : access Item) return AdaM.Id
is
begin
return Pool.to_Id (Self);
end Id;
overriding
function to_Source (Self : in Item) return text_Vectors.Vector
is
pragma Unreferenced (Self);
the_Source : text_Vectors.Vector;
begin
raise Program_Error with "TODO";
return the_Source;
end to_Source;
-- Streams
--
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View)
renames Pool.View_write;
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View)
renames Pool.View_read;
end AdaM.a_Type.enumeration_literal;
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_22_372.asm | ljhsiun2/medusa | 9 | 14153 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %rax
push %rbx
push %rdi
push %rsi
// Store
lea addresses_US+0x16980, %rdi
nop
and $5451, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm3
vmovaps %ymm3, (%rdi)
nop
nop
nop
nop
nop
xor $59817, %r11
// Faulty Load
lea addresses_WC+0x13400, %r10
clflush (%r10)
nop
and %rax, %rax
mov (%r10), %r11
lea oracles, %rsi
and $0xff, %r11
shlq $12, %r11
mov (%rsi,%r11,1), %r11
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': True, 'congruent': 4}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'00': 22}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
oeis/037/A037916.asm | neoneye/loda-programs | 11 | 2591 | <filename>oeis/037/A037916.asm
; A037916: Concatenate exponents in prime factorization of n.
; Submitted by <NAME>
; 0,1,1,2,1,11,1,3,2,11,1,21,1,11,11,4,1,12,1,21,11,11,1,31,2,11,3,21,1,111,1,5,11,11,11,22,1,11,11,31,1,111,1,21,21,11,1,41,2,12,11,21,1,13,11,31,11,11,1,211,1,11,21,6,11,111,1,21,11,111,1,32,1,11,12,21,11,111,1,41,4,11,1,211,11,11,11,31,1,121,11,21,11,11,11,51,1,12,21,22
add $0,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $6,$2
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
lpb $0
dif $0,$2
add $7,2
lpe
mul $7,10
lpe
mov $0,$7
div $0,20
|
Ada/inc/Problem_53.ads | Tim-Tom/project-euler | 0 | 22034 | <gh_stars>0
-- There are exactly ten ways of selecting three from five, 12345:
--
-- 123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
--
-- In combinatorics, we use the notation, 5C3 = 10.
--
-- In general,nCr = n!/(r!(n-r)!) ,where r < n
--
-- It is not until n = 23, that a value exceeds one-million: 23C10 = 1,144,066.
--
-- How many, not necessarily distinct, values of nCr, for 1 <= n <= 100, are greater than one-million?
package Problem_53 is
procedure Solve;
end Problem_53;
|
firmware/coreboot/3rdparty/libgfxinit/common/ironlake/hw-gfx-gma-power_and_clocks_ironlake.adb | fabiojna02/OpenCellular | 1 | 4024 | --
-- Copyright (C) 2016 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with HW.Time;
with HW.GFX.GMA.Config;
with HW.GFX.GMA.Registers;
package body HW.GFX.GMA.Power_And_Clocks_Ironlake is
PCH_DREF_CONTROL_120MHZ_CPU_OUTPUT_MASK : constant := 3 * 2 ** 13;
PCH_DREF_CONTROL_120MHZ_CPU_OUTPUT_SSC : constant := 2 * 2 ** 13;
PCH_DREF_CONTROL_120MHZ_CPU_OUTPUT_NONSSC : constant := 3 * 2 ** 13;
PCH_DREF_CONTROL_120MHZ_SSC_EN_MASK : constant := 3 * 2 ** 11;
PCH_DREF_CONTROL_120MHZ_SSC_EN : constant := 2 * 2 ** 11;
PCH_DREF_CONTROL_120MHZ_NONSSC_EN_MASK : constant := 3 * 2 ** 9;
PCH_DREF_CONTROL_120MHZ_NONSSC_EN : constant := 2 * 2 ** 9;
PCH_DREF_CONTROL_120MHZ_SSC4_EN_MASK : constant := 3 * 2 ** 7;
PCH_DREF_CONTROL_120MHZ_SSC4_EN : constant := 2 * 2 ** 7;
PCH_DREF_CONTROL_120MHZ_SSC4_DOWNSPREAD : constant := 0 * 2 ** 6;
PCH_DREF_CONTROL_120MHZ_SSC4_CENTERSPREAD : constant := 1 * 2 ** 6;
PCH_DREF_CONTROL_120MHZ_SSC_MODULATION_EN : constant := 1 * 2 ** 1;
PCH_DREF_CONTROL_120MHZ_SSC4_MODULATION_EN : constant := 1 * 2 ** 0;
procedure Initialize is
begin
-- ILK: enable non-spread spectrum clock, enable spread spectrum clock
Registers.Write
(Register => Registers.PCH_DREF_CONTROL,
Value => PCH_DREF_CONTROL_120MHZ_SSC_EN or
PCH_DREF_CONTROL_120MHZ_NONSSC_EN or
PCH_DREF_CONTROL_120MHZ_SSC_MODULATION_EN);
Registers.Posting_Read (Registers.PCH_DREF_CONTROL);
Time.U_Delay (1);
if Config.Internal_Is_EDP then -- TODO: check for presence
-- always use spread spectrum clock for CPU output
Registers.Set_Mask
(Register => Registers.PCH_DREF_CONTROL,
Mask => PCH_DREF_CONTROL_120MHZ_CPU_OUTPUT_SSC);
Registers.Posting_Read (Registers.PCH_DREF_CONTROL);
Time.U_Delay (20); -- DMI latency
end if;
Config.Raw_Clock := Config.Default_RawClk_Freq;
end Initialize;
end HW.GFX.GMA.Power_And_Clocks_Ironlake;
|
oeis/243/A243130.asm | neoneye/loda-programs | 11 | 97598 | ; A243130: 1024*n^10 - 2304*n^8 + 1792*n^6 - 560*n^4 + 60*n^2 - 1.
; Submitted by <NAME>
; -1,11,564719,46611179,929944511,9127651499,58130412911,276182038859,1061324394239,3472236254411,10011386405999,26069206375211,62418042417599,139296285729899,292810020137711,584605483663499,1116034330278911,2048348816684939,3630829342034159,6239165952002411,10426892198423999,16993207837716011,27071129971424879,42240584096323019,64671790855456511,97305124781287499,144074521713478511,210182495572821419,302435896495212479,429652704691308011,603151411514453999,837335894807558411,1150390153374658559
mov $3,$0
mov $0,11
lpb $0
sub $0,1
mov $2,$3
sub $2,1
mul $2,2
mul $2,$1
add $4,2
add $4,$2
add $1,$4
lpe
mov $0,$4
div $0,2
|
extern/gnat_sdl/gnat_sdl/src/sdl_sdl_stdinc_h.adb | AdaCore/training_material | 15 | 5714 | ------------------------------------------------------------------------------
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- In particular, you can freely distribute your programs built with the --
-- GNAT Pro compiler, including any required library run-time units, using --
-- any licensing terms of your choosing. See the AdaCore Software License --
-- for full details. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (Off);
pragma Warnings (Off);
with System.OS_Constants; use System.OS_Constants;
package body SDL_SDL_stdinc_h is
function SDL_putenv (variable : Interfaces.C.Strings.chars_ptr) return int is
begin
if Target_OS = Windows then
declare
function Internal (variable : Interfaces.C.Strings.chars_ptr) return int;
pragma Import (C, Internal, "SDL_putenv");
begin
return Internal(variable);
end;
else
declare
function Internal (variable : Interfaces.C.Strings.chars_ptr) return int;
pragma Import (C, Internal, "putenv");
begin
return Internal(variable);
end;
end if;
end SDL_putenv;
end;
|
Source/CountProc.asm | AAKMakes/ASM-projects | 0 | 81651 | ;
; Comment
;
; === STACK SEGMENT ===
MyStack segment stack
DB 64 dup('12345678')
MyStack endS
; === DATA SEGMENT ===
MyData segment
; --- Declare your variables here ---
counter DW 0
MyData endS
MyCode segment
Assume CS:Mycode,DS:MyData
;Includes go here
include CONIO.INC
PrintNumbers PROC
MOV counter,1
countTenLoop:
CMP counter,AX
JG endTenCount
MOV DX,counter
CALL PrintDecWord
Call PrintNewLine
INC counter
JMP countTenLoop
endTenCount:
RET
PrintNumbers EndP
;End of includes
Main PROC
Start:
MOV AX, MYDATA
MOV DS, AX
;Start of your code
MOV AX,10
CALL PrintNumbers
;End of your code.
XOR AX,AX
XOR BX,BX
XOR CX,CX
XOR DX,DX
MOV AH, 4Ch
XOR AL, AL
INT 21h
Main ENDP
MyCode endS
End Start |
oeis/331/A331334.asm | neoneye/loda-programs | 11 | 29810 | ; A331334: a(n) = n! * [x^n] exp(1 - 1/(2*x + 1))/(2*x + 1).
; Submitted by <NAME>
; 1,0,-4,32,-240,1792,-11840,26112,1589504,-57548800,1556757504,-39250780160,973563695104,-24122607992832,596246557736960,-14477682566889472,332039052050104320,-6425352382711857152,53086817854485692416,4505005802471597015040,-419037805969718712991744
mov $1,1
mov $3,$0
mov $4,1
lpb $3
mul $1,$3
mul $1,$3
mul $1,2
add $2,1
sub $4,2
add $5,$4
div $1,$5
add $2,$1
mul $2,2
sub $3,1
add $4,2
lpe
mov $0,$2
div $0,2
add $0,1
|
sw/552tests/rand_simple/t_1_rori.asm | JPShen-UWM/ThreadKraken | 1 | 28568 | <filename>sw/552tests/rand_simple/t_1_rori.asm
// seed 1
lbi r0, 112 // icount 0
slbi r0, 167 // icount 1
lbi r1, 196 // icount 2
slbi r1, 135 // icount 3
lbi r2, 80 // icount 4
slbi r2, 152 // icount 5
lbi r3, 86 // icount 6
slbi r3, 23 // icount 7
lbi r4, 178 // icount 8
slbi r4, 119 // icount 9
lbi r5, 198 // icount 10
slbi r5, 175 // icount 11
lbi r6, 186 // icount 12
slbi r6, 18 // icount 13
lbi r7, 83 // icount 14
slbi r7, 193 // icount 15
rori r0, r2, 8 // icount 16
rori r4, r3, 0 // icount 17
rori r3, r4, 14 // icount 18
rori r0, r3, 0 // icount 19
rori r3, r2, 7 // icount 20
rori r5, r5, 0 // icount 21
rori r7, r3, 8 // icount 22
rori r1, r4, 1 // icount 23
rori r2, r5, 13 // icount 24
rori r2, r5, 11 // icount 25
rori r1, r6, 2 // icount 26
rori r3, r4, 3 // icount 27
rori r0, r3, 15 // icount 28
rori r0, r2, 0 // icount 29
rori r6, r4, 13 // icount 30
rori r1, r1, 13 // icount 31
halt // icount 32
|
alloy4fun_models/trashltl/models/19/obo5tYk7qxZS2DczM.als | Kaixi26/org.alloytools.alloy | 0 | 2415 | open main
pred idobo5tYk7qxZS2DczM_prop20 {
always (all f:File | f in Trash since f not in Protected)
}
pred __repair { idobo5tYk7qxZS2DczM_prop20 }
check __repair { idobo5tYk7qxZS2DczM_prop20 <=> prop20o } |
oeis/004/A004546.asm | neoneye/loda-programs | 11 | 3404 | <reponame>neoneye/loda-programs<filename>oeis/004/A004546.asm
; A004546: Expansion of sqrt(2) in base 9.
; Submitted by <NAME>
; 1,3,6,4,8,5,8,0,5,5,7,8,6,1,5,3,0,3,6,0,8,1,7,4,6,6,8,1,6,7,3,8,3,3,0,8,4,7,1,5,7,2,2,5,3,2,2,0,7,6,5,1,1,8,5,5,5,5,5,6,6,7,8,2,2,3,1,5,4,7,7,0,3,7,5,0,5,3,7,6,3,8,2,8,5,5,4,2,0,0,3,2,5,2,8,7,2,4,8,2
mov $1,1
mov $2,1
mov $3,$0
add $3,2
mov $4,$0
add $4,2
mul $4,2
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,2
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,1
div $1,$8
div $2,$8
sub $3,1
lpe
sub $9,1
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
|
source/tabula-users-user_info_io.adb | ytomino/vampire | 1 | 6904 | -- The Village of Vampire by YT, このソースコードはNYSLです
with Tabula.Calendar.Time_IO;
package body Tabula.Users.User_Info_IO is
procedure IO (
Serializer : not null access Serialization.Serializer;
Value : in out User_Info)
is
use Serialization;
use Tabula.Calendar.Time_IO;
use Password_Digest_IO;
begin
for P in IO (Serializer) loop
IO (Serializer, "password", Value.Password);
IO (Serializer, "remote-addr", Value.Creation_Remote_Addr);
IO (Serializer, "remote-host", Value.Creation_Remote_Host);
IO (Serializer, "creation-time", Value.Creation_Time);
IO (Serializer, "last-remote-addr", Value.Last_Remote_Addr);
IO (Serializer, "last-remote-host", Value.Last_Remote_Host);
IO (Serializer, "last-time", Value.Last_Time);
IO (Serializer, "ignore-request", Value.Ignore_Request, Default => False);
IO (Serializer, "disallow-new-village", Value.Disallow_New_Village,
Default => False);
IO (Serializer, "no-log", Value.No_Log, Default => False);
IO (Serializer, "renamed", Value.Renamed,
Default => Ada.Strings.Unbounded.Null_Unbounded_String);
end loop;
end IO;
end Tabula.Users.User_Info_IO;
|
Library/SpecUI/CommonUI/CWin/cwinUtils.asm | steakknife/pcgeos | 504 | 163200 | <reponame>steakknife/pcgeos
COMMENT @-----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: OpenLook/CWin (common code for several specific ui's)
FILE: cwinUtils.asm (utility routines for windowed UI objects)
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 6/89 Initial version
DESCRIPTION:
$Id: cwinUtils.asm,v 1.2 98/03/11 06:08:26 joon Exp $
-------------------------------------------------------------------------------@
Resident segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCallParentWithSelf
DESCRIPTION: Does a VisCallParent, passing this object's OD in cx:dx
CALLED BY: INTERNAL
PASS: *ds:si - this object
ax - method
bp - any extra data to pass, if any
RETURN: ax, cx, dx, bp - returned from handler
DESTROYED: di
------------------------------------------------------------------------------@
VisCallParentWithSelf proc far
mov cx, ds:[LMBH_handle] ; Get handle of current object's block
mov dx, si
GOTO VisCallParent
VisCallParentWithSelf endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GenCallParentWithSelf
DESCRIPTION: Does a GenCallParent, passing this object's OD in cx:dx
CALLED BY: INTERNAL
PASS: *ds:si - this object
ax - method
bp - any extra data to pass, if any
RETURN: ax, cx, dx, bp - returned from handler
DESTROYED: di
------------------------------------------------------------------------------@
GenCallParentWithSelf proc far
mov cx, ds:[LMBH_handle] ; Get handle of current object's block
mov dx, si
GOTO GenCallParent
GenCallParentWithSelf endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ObjMessageCallPreserveCXDXWithSelf
DESCRIPTION: Performs an ObjMessage to the OD in cx:dx, passing the
current object's OD in cx:dx. Preserves bx, si, cx & dx.
CALLED BY: INTERNAL
PASS: *ds:si - object doing the call (to be passed in cx:dx)
cx:dx - OD to call
ax - method
bp - any extra data to pass, if any
RETURN: ax, bp - returned from handler
DESTROYED: di
------------------------------------------------------------------------------@
ObjMessageCallPreserveCXDXWithSelf proc far uses bx, si, cx, dx
.enter
mov bx, ds:[LMBH_handle] ; Get handle of current object's block
xchg bx, cx
xchg si, dx
call ObjMessageCallFixupDS
.leave
ret
ObjMessageCallPreserveCXDXWithSelf endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ObjMessageCallFixupDS
DESCRIPTION: Perform an ObjMessage, doing a MF_CALL & MF_FIXUP_DS
CALLED BY: INTERNAL
PASS: Same as ObjMessage, minus di params
RETURN: Same as ObjMessage
DESTROYED: di
------------------------------------------------------------------------------@
ObjMessageCallFixupDS proc far
mov di, mask MF_CALL or mask MF_FIXUP_DS
GOTO ObjMessage
ObjMessageCallFixupDS endp
COMMENT @----------------------------------------------------------------------
FUNCTION: OLCallSpecObject
DESCRIPTION: This is a byte-saving routine used by the specific UI to send
a method to a related object in the same ObjectBlock.
*NOTE* - this routine is only called from one place in the
entire CommonUI (SendToObjectAndItsChildren). It doesn't
save bytes at all. -stevey 4/29/95
PASS: *ds:si = instance data for object
di = offset into specific instance data to field which
holds chunk handle of related object.
cx, dx, bp = data to pass
RETURN: *ds:si = same
cx, dx, bp, carry = data returned from method call
DESTROYED: ?
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 3/90 initial version
------------------------------------------------------------------------------@
if _MENUS_PINNABLE and _CUA_STYLE
OLCallSpecObject proc far
push si
;set ds:di = pointer to field which has chunk handle
push bp
mov bp, ds:[si]
add bp, ds:[bp].Vis_offset ;set ds:bp = specific instance data
add di, bp ;set ds:di = field which holds chunk
pop bp
mov si, ds:[di] ;set *ds:si = object
;(must be in same ObjectBlock)
tst si
jz 30$ ;skip if no pin trigger object...
call ObjCallInstanceNoLock
30$:
pop si
ret
OLCallSpecObject endp
endif ; _MENUS_PINNABLE and _CUA_STYLE
COMMENT @----------------------------------------------------------------------
FUNCTION: OpenWinSetObjVisOptFlags
DESCRIPTION: This routine is used to set/reset specific flags in the
Visible part of an object. This routine is only called
in situations where VisMarkInvalid cannot be used.
DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
PASS: carry set if ^lbx:si = OD of object to mark flags for
carry clear if *ds:si = OD of object to mark flags for
RETURN: ds, si, bx = same
DESTROYED: ax
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 1/90 initial version
------------------------------------------------------------------------------@
OpenWinSetObjVisOptFlags proc far
class OLCtrlClass
push ds
pushf
jnc updateFlags
call ObjLockObjBlock
mov ds, ax
updateFlags:
mov di, ds:[si]
add di, ds:[di].Vis_offset
ORNF ds:[di].VI_optFlags, cl
not ch
ANDNF ds:[di].VI_optFlags, ch
EC < call VisCheckOptFlags ;let's make policeman doug happy >
popf
jnc done
call MemUnlock
done:
pop ds
ret
OpenWinSetObjVisOptFlags endp
COMMENT @----------------------------------------------------------------------
FUNCTION: FindOLWin
DESCRIPTION: Searches up visible tree for first OLWinClass object, &
returns it. Will return NULL if a thread boundary encountered.
CALLED BY: INTERNAL
PASS: *ds:si - visible object
RETURN: ^lbx:si - OLWinClass object (or NULL, if not found)
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 4/92 Initial version
------------------------------------------------------------------------------@
FindOLWin proc far
push di
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_typeFlags, mask VTF_IS_WIN_GROUP
pop di
jz goUp
push di, es
mov di, segment OLWinClass
mov es, di
mov di, offset OLWinClass
call ObjIsObjectInClass
pop di, es
jnc goUp
; Found it!
mov bx, ds:[LMBH_handle]
ret
goUp:
call VisFindParent
tst bx
jz noParent
cmp bx, ds:[LMBH_handle] ; quick test -- if parent in same block,
je sameThread ; then run by same thread.
call ObjTestIfObjBlockRunByCurThread
jne noParent ; if parent run by different thread,
; bail.
sameThread:
call ObjSwapLock
push ax
push bx
call FindOLWin
mov ax, bx
pop bx
call ObjSwapUnlock
mov bx, ax
pop ax
ret
noParent:
clr bx ; OLWinClass object not found.
clr si
ret
FindOLWin endp
COMMENT @----------------------------------------------------------------------
FUNCTION: SwapLockOLWin
DESCRIPTION: Locks OLWin object up visible tree for access
CALLED BY: INTERNAL
PASS: *ds:si - visible object
RETURN: carry - set if successful (clear if no parent)
*ds:si - OLWinClass object, if found, else ds unchanged.
bx - ds:[0], suitable for passing to ObjSwapUnlock
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 4/92 Initial version
------------------------------------------------------------------------------@
SwapLockOLWin proc far
call FindOLWin
tst bx
jz notFound
stc ; return carry set, to indicate found
GOTO ObjSwapLock
notFound:
mov bx, ds:[LMBH_handle]
clr si
clc
ret
SwapLockOLWin endp
COMMENT @----------------------------------------------------------------------
FUNCTION: CallOLWin
DESCRIPTION: Calls first OLWin object up visible tree w/message & data passed
CALLED BY: INTERNAL
PASS: *ds:si - visible object
ax - message to call on OLWinClass object
cx, dx, bp - data to pass
RETURN: ax, cx, dx, bp - per message
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 4/92 Initial version
------------------------------------------------------------------------------@
CallOLWin proc far
push bx, si
call SwapLockOLWin
jnc done
call ObjCallInstanceNoLock
call ObjSwapUnlock
done:
pop bx, si
ret
CallOLWin endp
Resident ends
;
;-------------------------
;
Build segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OpenWinDuplicateBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: This procedure duplicates an entire UI template block of the
specific UI. A one-way link is set up from the head object
of that block passed in, to the OLWinClass object passed in.
The "ObjBlock output" of the new block will be set to
the OLWinClass object itself, allowing gadgets in the template
to send messages directly to the window using
"TO_OBJ_BLOCK_OUTPUT". Since the new objects ARE created
w/one-way link only, they will need to be directly vis built,
or set USABLE, so that they become visible.
This routine is being used to create all the CUA title
bar stuff, such as system-menu items, minimize, maximize,
popup-menus for primary & command windows, & even
EXIT & HELP icons for GCM.
PASS: *ds:si = OLWinClass object
ax = offset to field in OLWinInstance structure, where the
handle of the new UI block will be stored.
^lbx:dx = OD of head object of branch in UI resource to be
copied
RETURN: *ds:si = same
^lcx:dx = new object
DESTROYED: di
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
OpenWinDuplicateBlock proc far uses ax, bx, bp
.enter
push ax ; save offset into instance data
push bx
mov bx, ds:[LMBH_handle]
call MemOwner
mov ax, bx ; have owned by same as owner of OLWin
clr cx ; have current thread run block
pop bx
call ObjDuplicateResource ; bx = handle of new block
; Set ObjBlock output to be OLWinClass object
;
call ObjSwapLock
call ObjBlockSetOutput
call ObjSwapUnlock
mov cx, bx ; ^lcx:dx is now new block, object
pop ax ; get offset into instance data
mov di, ds:[si]
add di, ds:[di].Vis_offset
add di, ax ;point to field
mov ds:[di], cx ;save handle of new object
; Now set generic parent link for child to be OLWinClass obj.
; We don't want this to be a legitimate generic child of the OLWinClass
; object, because that might confuse applications.
; *ds:si = OLWinClass (parent)
; cx:dx = new child
;
call GenAddChildUpwardLinkOnly
.leave
ret
OpenWinDuplicateBlock endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GetVisParentForDialog
DESCRIPTION: Returns visible parent to use for the WIN_GROUP part of
a dialog box (independently displayable interaction or
GenSummons)
CALLED BY: GLOBAL
Window spec build routines, Gen -> spec mapping routines
PASS:
*ds:si - GenInteraction or GenSummons object
RETURN:
cx:dx - Visible parent to use.
DESTROYED:
ax, bx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/90 Initial version
------------------------------------------------------------------------------@
GetVisParentForDialog proc far uses di, bp
class OLWinClass
.enter
EC < ; MAKE sure that this is an interaction >
EC < push es >
EC < mov di, segment GenInteractionClass >
EC < mov es, di >
EC < mov di, offset GenInteractionClass >
EC < call ObjIsObjectInClass >
EC < ERROR_NC OL_ERROR >
EC < pop es >
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov cx, SQT_VIS_PARENT_FOR_POPUP
test ds:[di].GII_attrs, mask GIA_SYS_MODAL
jz afterModalityTest
mov cx, SQT_VIS_PARENT_FOR_SYS_MODAL
afterModalityTest:
mov ax, MSG_SPEC_GUP_QUERY_VIS_PARENT
call GenCallParent
EC < ERROR_NC OL_WINDOWED_GEN_OBJECT_NOT_IN_GEN_TREE >
.leave
ret
GetVisParentForDialog endp
Build ends
;-------------------------
WinCommon segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: EnsureWindowInParentWin
DESCRIPTION: This procedure ensures that this windowed object is
still visible within the parent window.
CALLED BY: OLWinGlyphDisplayMove
OpenWinMoveResizeWin
PASS: ds:*si - instance data for windowed object
cx, dx - minimum width and height of window to keep visible
(pass width and height of window to keep it
entirely visible on the screen.)
RETURN: nothing
DESTROYED: ax, bx, cx, dx, di, bp
PSEUDO CODE/STRATEGY:
query to find parentWidth and parentHeight
TEST FOR TOO FAR TO THE RIGHT:
newX = parentWidth - MARGIN
if currentLeft > newX then currentLeft = newX
TEST FOR TOO FAR TO THE LEFT:
newX = MARGIN - currentRight
if currentLeft < newX then currentLeft = newX
TEST FOR TOO FAR TO THE BOTTOM:
newY = parentHeight - MARGIN
if currentTop > newY then currentTop = newY
TEST FOR TOO FAR TO THE TOP:
newY = MARGIN - currentBottom
if currentTop < newY then currentTop = newY
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 10/89 initial version (adapted from C.H. 3/89 version)
Doug 11/89 Is now called from subclass of _MOVE_RESIZE_WIN,
instead of MSG_VIS_MOVE.
Eric 11/89 Adapted to new window positioning/resizing
scheme, and to use VisSetPosition instead of just
stuffing bounds.
(nuked OpenWinKeepInParentWin procedure)
Chris 4/91 Updated for new graphics, bounds conventions
------------------------------------------------------------------------------@
EnsureWindowInParentWin proc far
class VisClass
push cx, dx ;save minimum width and height
;to keep visible
call OpenGetParentWinSize
pop bp, bx ;bp = min width, bx = min height
jnc EWIPW_90 ;If no response, don't care...
if TOOL_AREA_IS_TASK_BAR
; If taskbar is at the bottom of the screen, subtract off the
; height of the tool area (taskbar) from parent window size so
; maximized windows don't extend below the taskbar.
call GetTaskBarSizeAdjustment
sub dx, di ; subtract off taskbar adjustment
endif ; TOOL_AREA_IS_TASK_BAR
;FIRST CHECK X POSITION
push bx ;save min height to keep visible
call WinCommon_DerefVisSpec_DI
;TEST FOR TOO FAR TO THE RIGHT:
; newX = parentWidth - MARGIN
; if currentLeft > newX then currentLeft = newX
mov ax, ds:[di].VI_bounds.R_left ;get current left
tst ax ;to left of parent?
js EWIPW_10 ;skip if so...
sub cx, bp ;subtract MARGIN-1
inc cx
cmp ax, cx ;compare current left to MAX
jg EWIPW_50 ;skip if to the right of MAX...
;(cx = new position)
EWIPW_10:
;TEST FOR TOO FAR TO THE LEFT:
; newX = MARGIN - currentRight
; if currentLeft < newX the currentLeft = newX
;ax = current left
; tst ax ;to right of parent?
; jns EWIPW_20 ;skip if so...
mov cx, bp ;get MARGIN
sub cx, ds:[di].VI_bounds.R_right ;subtract WIDTH
add cx, ds:[di].VI_bounds.R_left
cmp ax, cx
jle EWIPW_50 ;skip if left of MIN...
;(cx = new position)
;EWIPW_20: ;X position is OK
mov cx, ax ;set new pos = current pos
EWIPW_50: ;NOW CHECK Y POSITION (dx = parentHeight)
pop bp ;bp = min height to keep visible
;TEST FOR TOO FAR TO THE BOTTOM:
; newY = parentHeight - MARGIN
; if currentTop < 0 then (is higher than parent), skip ahead...
; if new < 0 then (window is larger than parent) currentTop = 0
; else if currentTop > newY the currentTop = newY
mov bx, ds:[di].VI_bounds.R_top ;get current top
tst bx ;above parent?
js EWIPW_60 ;skip if so...
sub dx, bp ;subtract MARGIN-1
inc dx
tst dx ;above top of window?
jns EWIPW_55 ;skip if is not big window...
;hack for big windows: align top with top of screen
clr dx
jmp EWIPW_80
EWIPW_55:
cmp bx, dx
jg EWIPW_80 ;skip if below MAX...
;(dx = new position)
EWIPW_60:
;TEST FOR TOO FAR TO THE TOP:
; newY = MARGIN - currentBottom
; if currentTop < newY the currentTop = newY
; tst bx ;below parent?
; jns EWIPW_70 ;skip if so...
mov dx, bp ;get MARGIN
sub dx, ds:[di].VI_bounds.R_bottom ;subtract height
add dx, ds:[di].VI_bounds.R_top
cmp bx, dx
jle EWIPW_80 ;skip if above MIN...
;(dx = new position)
;EWIPW_70: ;Y position is OK
mov dx, bx ;set new pos = current pos
EWIPW_80:
;now move window to new position (in cx, dx)
call VisSetPosition
EWIPW_90: ;all done. Return with new bounds for window
ret
EnsureWindowInParentWin endp
COMMENT @----------------------------------------------------------------------
FUNCTION: EnsureTitleBarInParentWin
DESCRIPTION: This procedure ensures that this OLWinClass object's title bar
is still visible within the parent window.
CALLED BY: OpenWinMoveResizeWin
PASS: ds:*si - instance data for windowed object
RETURN:
DESTROYED: di, bp, ax, bx, cx, dx
PSEUDO CODE/STRATEGY:
query to find parentWidth and Height
TEST FOR TOO FAR TO THE RIGHT:
newX = parentWidth - titleLeftX - MARGIN
if currentLeft > newX then currentLeft = newX
TEST FOR TOO FAR TO THE LEFT:
newX = MARGIN - titleRight
if currentLeft < newX then currentLeft = newX
TEST FOR TOO FAR TO THE BOTTOM:
newY = parentHeight - titleTop - MARGIN
if currentTop > newY then currentTop = newY
TEST FOR TOO FAR TO THE TOP:
newY = MARGIN - titleBottom
if currentTop < newY then currentTop = newY
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 10/89 initial version
------------------------------------------------------------------------------@
if _CUA_STYLE ;START of CUA/MOTIF specific code -----
;Minimum amount of window (or title bar in window) that we want on the screen
MIN_WIN_TITLE_BAR_ONSCREEN_DIST = 10 ;just enough to grab
EnsureTitleBarInParentWin proc near
class OLWinClass
;does this OLWinClass object have a title bar?
call WinCommon_DerefVisSpec_DI
test ds:[di].OLWI_attrs, mask OWA_TITLED
jz ETBIPW_90 ;skip adjustment if not...
call OpenGetParentWinSize ;get size of window we're on
jnc ETBIPW_90 ;If no response, don't care...
if TOOL_AREA_IS_TASK_BAR
; If taskbar is at the bottom of the screen, subtract off the
; height of the tool area (taskbar) from parent window size so
; maximized windows don't extend below the taskbar.
call GetTaskBarSizeAdjustment
sub dx, di ; subtract off taskbar adjustment
endif ; TOOL_AREA_IS_TASK_BAR
;FIRST CHECK X POSITION
push dx ;save parent height - 1
call WinCommon_DerefVisSpec_DI
;TEST FOR TOO FAR TO THE RIGHT:
; newX = parentWidth - titleLeftX - MARGIN
; if currentLeft > newX then currentLeft = newX
mov ax, ds:[di].VI_bounds.R_left ;get current left
tst ax ;to left of parent?
js ETBIPW_10 ;skip if so...
sub cx, ds:[di].OLWI_titleBarBounds.R_left
sub cx, MIN_WIN_TITLE_BAR_ONSCREEN_DIST-1
;ax = current left
cmp ax, cx
jg ETBIPW_50 ;skip if to the right of MAX...
;(cx = new position)
ETBIPW_10:
;TEST FOR TOO FAR TO THE LEFT:
; newX = MARGIN - titleRight
; if currentLeft < newX the currentLeft = newX
;ax = current left
; tst ax ;to right of parent?
; jns ETBIPW_20 ;skip if so...
mov cx, MIN_WIN_TITLE_BAR_ONSCREEN_DIST
sub cx, ds:[di].OLWI_titleBarBounds.R_right
cmp ax, cx
jle ETBIPW_50 ;skip if to the left of MIN...
;(cx = new position)
;ETBIPW_20: ;X position is OK
mov cx, ax ;set new pos = current pos
ETBIPW_50: ;NOW CHECK Y POSITION
pop dx ;get parent height - 1
;TEST FOR TOO FAR TO THE BOTTOM:
; newY = parentHeight - titleTop - MARGIN
; if currentTop > newY the currentTop = newY
mov bx, ds:[di].VI_bounds.R_top ;get current top
tst bx ;above parent?
js ETBIPW_60 ;skip if so...
sub dx, ds:[di].OLWI_titleBarBounds.R_top
sub dx, MIN_WIN_TITLE_BAR_ONSCREEN_DIST-1
cmp bx, dx
jg ETBIPW_80 ;skip if to the below MAX...
;(dx = new position)
ETBIPW_60:
;TEST FOR TOO FAR TO THE TOP:
; newY = MARGIN - titleBottom
; if currentTop < newY the currentTop = newY
; tst bx ;below parent?
; jns ETBIPW_70 ;skip if so...
mov dx, MIN_WIN_TITLE_BAR_ONSCREEN_DIST
sub dx, ds:[di].OLWI_titleBarBounds.R_bottom
cmp bx, dx
jle ETBIPW_80 ;skip if above MIN...
;(dx = new position)
;ETBIPW_70: ;Y position is OK
mov dx, bx ;set new pos = current pos
ETBIPW_80:
;now move window to new position (in cx, dx)
call VisSetPosition
ETBIPW_90: ;all done. Return with new bounds for window
ret
EnsureTitleBarInParentWin endp
endif ;END of CUA/MOTIF specific code ---------------
WinCommon ends
;==============================================================================
; OPTIMIZATION ROUTINES
;==============================================================================
WinMethods segment resource
WinMethods_ObjCallSuperNoLock_OLWinClass_Far proc far
mov di, offset OLWinClass
GOTO ObjCallSuperNoLock
WinMethods_ObjCallSuperNoLock_OLWinClass_Far endp
WinMethods ends
WinCommon segment resource
WinCommon_DerefGen_DI proc near
class GenClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Gen_offset
ret
WinCommon_DerefGen_DI endp
;---
WinCommon_DerefVisSpec_DI proc near
class VisClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
ret
WinCommon_DerefVisSpec_DI endp
WinCommon_Deref_Load_FocusExcl_CXDX proc near
class OLWinClass
mov di, offset OLWI_focusExcl.FTVMC_OD
FALL_THRU WinCommon_Deref_Load_OD_CXDX
WinCommon_Deref_Load_FocusExcl_CXDX endp
WinCommon_Deref_Load_OD_CXDX proc near
push bx
mov bx, di
call WinCommon_DerefVisSpec_DI
mov cx, ds:[di][bx].handle
mov dx, ds:[di][bx].chunk
pop bx
ret
WinCommon_Deref_Load_OD_CXDX endp
;---
WinCommon_Deref_Load_FocusExcl_BXSI proc near
class OLWinClass
mov bx, offset OLWI_focusExcl.FTVMC_OD
FALL_THRU WinCommon_Deref_Load_OD_BXSI
WinCommon_Deref_Load_FocusExcl_BXSI endp
WinCommon_Deref_Load_OD_BXSI proc near
call WinCommon_DerefVisSpec_DI
mov si, ds:[di][bx].chunk
mov bx, ds:[di][bx].handle
ret
WinCommon_Deref_Load_OD_BXSI endp
;---
if 0
WinCommon_GenCallParent_PassSelf proc near
call WinCommon_Mov_CXDX_Self
FALL_THRU WinCommon_GenCallParent
WinCommon_GenCallParent_PassSelf endp
WinCommon_GenCallParent proc near
call GenCallParent
ret
WinCommon_GenCallParent endp
endif
;---
WinCommon_ObjMessageForceQueue proc near
mov di, mask MF_FORCE_QUEUE or mask MF_INSERT_AT_FRONT
GOTO WinCommon_ObjMessage
WinCommon_ObjMessageForceQueue endp
if 0
WinCommon_ObjMessageSendFixupDS proc near
mov di, mask MF_FIXUP_DS
GOTO WinCommon_ObjMessage
WinCommon_ObjMessageSendFixupDS endp
endif
WinCommon_ObjMessageCallFixupDS proc near
mov di, mask MF_CALL or mask MF_FIXUP_DS
FALL_THRU WinCommon_ObjMessage
WinCommon_ObjMessageCallFixupDS endp
WinCommon_ObjMessage proc near
call ObjMessage
ret
WinCommon_ObjMessage endp
;---
WinCommon_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW proc near
mov dl, VUM_NOW
FALL_THRU WinCommon_CallSelf_SET_VIS_SPEC_ATTR
WinCommon_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW endp
WinCommon_CallSelf_SET_VIS_SPEC_ATTR proc near
mov ax, MSG_SPEC_SET_ATTRS
FALL_THRU WinCommon_ObjCallInstanceNoLock
WinCommon_CallSelf_SET_VIS_SPEC_ATTR endp
WinCommon_ObjCallInstanceNoLock proc near
call ObjCallInstanceNoLock
ret
WinCommon_ObjCallInstanceNoLock endp
;---
WinCommon_ObjCallSuperNoLock_OLWinClass proc near
mov di, offset OLWinClass
FALL_THRU WinCommon_ObjCallSuperNoLock
WinCommon_ObjCallSuperNoLock_OLWinClass endp
WinCommon_ObjCallSuperNoLock proc near
call ObjCallSuperNoLock
ret
WinCommon_ObjCallSuperNoLock endp
;---
WinCommon_Mov_CXDX_Self proc near
EC < call ECCheckLMemObject >
mov cx, ds:[LMBH_handle] ;set ^lcx:dx = this root object
mov dx, si
ret
WinCommon_Mov_CXDX_Self endp
;---
WinCommon_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL proc near
mov cl, mask VOF_WINDOW_INVALID
FALL_THRU WinCommon_VisMarkInvalid_MANUAL
WinCommon_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL endp
WinCommon_VisMarkInvalid_MANUAL proc near
mov dl, VUM_MANUAL
FALL_THRU WinCommon_VisMarkInvalid
WinCommon_VisMarkInvalid_MANUAL endp
WinCommon_VisMarkInvalid proc near
call VisMarkInvalid
ret
WinCommon_VisMarkInvalid endp
;---
WinCommon_VisCallParent_VUP_QUERY proc near
mov ax, MSG_VIS_VUP_QUERY
FALL_THRU WinCommon_VisCallParent
WinCommon_VisCallParent_VUP_QUERY endp
WinCommon_VisCallParent proc near
call VisCallParent
ret
WinCommon_VisCallParent endp
WinCommon_ClrAXandOLWIFocusExcl proc near
clr ax
mov ds:[di].OLWI_focusExcl.FTVMC_OD.handle, ax
mov ds:[di].OLWI_focusExcl.FTVMC_OD.chunk, ax
ret
WinCommon_ClrAXandOLWIFocusExcl endp
;---
WinCommon ends
;------------------------------------------------------------------------------
WinOther segment resource
if 0
WinOther_DerefGen_DI proc near
class GenClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Gen_offset
ret
WinOther_DerefGen_DI endp
endif
;---
WinOther_DerefVisSpec_DI proc near
class VisClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
ret
WinOther_DerefVisSpec_DI endp
if 0
WinOther_Deref_Load_FocusExcl_CXDX proc near
class OLWinClass
mov di, offset OLWI_focusExcl.FTVMC_OD
FALL_THRU WinOther_Deref_Load_OD_CXDX
WinOther_Deref_Load_FocusExcl_CXDX endp
endif
if 0
WinOther_Deref_Load_OD_CXDX proc near
push bx
mov bx, di
call WinOther_DerefVisSpec_DI
mov cx, ds:[di][bx].handle
mov dx, ds:[di][bx].chunk
pop bx
ret
WinOther_Deref_Load_OD_CXDX endp
endif
;---
if 0
WinOther_Deref_Load_FocusExcl_BXSI proc near
class OLWinClass
mov bx, offset OLWI_focusExcl.FTVMC_OD
FALL_THRU WinOther_Deref_Load_OD_BXSI
Deref_Load_FocusExcl_BXSI endp
endif
if 0
WinOther_Deref_Load_OD_BXSI proc near
call WinOther_DerefVisSpec_DI
mov si, ds:[di][bx].chunk
mov bx, ds:[di][bx].handle
ret
WinOther_Deref_Load_OD_BXSI endp
endif
;---
if 0
WinOther_GenCallParent_PassSelf proc near
call WinOther_Mov_CXDX_Self
FALL_THRU WinOther_GenCallParent
WinOther_GenCallParent_PassSelf endp
endif
if 0
WinOther_GenCallParent proc near
call GenCallParent
ret
WinOther_GenCallParent endp
endif
;---
if 0
WinOther_ObjMessageForceQueue proc near
mov di, mask MF_FORCE_QUEUE or mask MF_INSERT_AT_FRONT
GOTO WinOther_ObjMessage
WinOther_ObjMessageForceQueue endp
WinOther_ObjMessageSendFixupDS proc near
mov di, mask MF_FIXUP_DS
GOTO WinOther_ObjMessage
WinOther_ObjMessageSendFixupDS endp
WinOther_ObjMessageCallFixupDS proc near
mov di, mask MF_CALL or mask MF_FIXUP_DS
FALL_THRU WinOther_ObjMessage
WinOther_ObjMessageCallFixupDS endp
WinOther_ObjMessage proc near
call ObjMessage
ret
WinOther_ObjMessage endp
endif
;---
if 0
WinOther_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW proc near
mov dl, VUM_NOW
FALL_THRU WinOther_CallSelf_SET_VIS_SPEC_ATTR
WinOther_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW endp
WinOther_CallSelf_SET_VIS_SPEC_ATTR proc near
mov ax, MSG_SPEC_SET_ATTRS
FALL_THRU WinOther_ObjCallInstanceNoLock
WinOther_CallSelf_SET_VIS_SPEC_ATTR endp
endif
WinOther_ObjCallInstanceNoLock proc near
call ObjCallInstanceNoLock
ret
WinOther_ObjCallInstanceNoLock endp
;---
WinOther_ObjCallSuperNoLock_OLWinClass_Far proc far
mov di, offset OLWinClass
call WinOther_ObjCallSuperNoLock_OLWinClass
ret
WinOther_ObjCallSuperNoLock_OLWinClass_Far endp
WinOther_ObjCallSuperNoLock_OLWinClass proc near
mov di, offset OLWinClass
FALL_THRU WinOther_ObjCallSuperNoLock
WinOther_ObjCallSuperNoLock_OLWinClass endp
WinOther_ObjCallSuperNoLock proc near
call ObjCallSuperNoLock
ret
WinOther_ObjCallSuperNoLock endp
;---
if 0
WinOther_Mov_CXDX_Self proc near
EC < call ECCheckLMemObject >
mov cx, ds:[LMBH_handle] ;set ^lcx:dx = this root object
mov dx, si
ret
WinOther_Mov_CXDX_Self endp
endif
;---
if 0
WinOther_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL proc near
mov cl, mask VOF_WINDOW_INVALID
FALL_THRU WinOther_VisMarkInvalid_MANUAL
WinOther_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL endp
WinOther_VisMarkInvalid_MANUAL proc near
mov dl, VUM_MANUAL
FALL_THRU WinOther_VisMarkInvalid
WinOther_VisMarkInvalid_MANUAL endp
WinOther_VisMarkInvalid proc near
call VisMarkInvalid
ret
WinOther_VisMarkInvalid endp
endif
;---
WinOther_VisCallParent_VUP_QUERY proc near
mov ax, MSG_VIS_VUP_QUERY
FALL_THRU WinOther_VisCallParent
WinOther_VisCallParent_VUP_QUERY endp
WinOther_VisCallParent proc near
call VisCallParent
ret
WinOther_VisCallParent endp
;---
WinOther_ClrAXandOLWIFocusExcl proc near
clr ax
mov ds:[di].OLWI_focusExcl.FTVMC_OD.handle, ax
mov ds:[di].OLWI_focusExcl.FTVMC_OD.chunk, ax
ret
WinOther_ClrAXandOLWIFocusExcl endp
WinOther ends
;------------------------------------------------------------------------------
WinClasses segment resource
WinClasses_DerefGen_DI proc near
class GenClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Gen_offset
ret
WinClasses_DerefGen_DI endp
;---
WinClasses_DerefVisSpec_DI proc near
class VisClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
ret
WinClasses_DerefVisSpec_DI endp
;---
WinClasses_ObjMessageCallFixupDS proc near
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
ret
WinClasses_ObjMessageCallFixupDS endp
;---
WinClasses_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW proc near
mov dl, VUM_NOW
mov ax, MSG_SPEC_SET_ATTRS
FALL_THRU WinClasses_ObjCallInstanceNoLock
WinClasses_CallSelf_SET_VIS_SPEC_ATTR_VUM_NOW endp
WinClasses_ObjCallInstanceNoLock proc near
call ObjCallInstanceNoLock
ret
WinClasses_ObjCallInstanceNoLock endp
WinClasses_ObjCallInstanceNoLock_Far proc far
call WinClasses_ObjCallInstanceNoLock
ret
WinClasses_ObjCallInstanceNoLock_Far endp
;---
WinClasses_ObjCallSuperNoLock_OLBaseWinClass proc near
mov di, offset OLBaseWinClass
GOTO WinClasses_ObjCallSuperNoLock
WinClasses_ObjCallSuperNoLock_OLBaseWinClass endp
WinClasses_ObjCallSuperNoLock_OLMenuedWinClass proc near
mov di, offset OLMenuedWinClass
GOTO WinClasses_ObjCallSuperNoLock
WinClasses_ObjCallSuperNoLock_OLMenuedWinClass endp
WinClasses_ObjCallSuperNoLock_OLDialogWinClass proc near
mov di, offset OLDialogWinClass
GOTO WinClasses_ObjCallSuperNoLock
WinClasses_ObjCallSuperNoLock_OLDialogWinClass endp
WinClasses_ObjCallSuperNoLock_OLMenuWinClass proc near
mov di, offset OLMenuWinClass
GOTO WinClasses_ObjCallSuperNoLock
WinClasses_ObjCallSuperNoLock_OLMenuWinClass endp
WinClasses_ObjCallSuperNoLock_OLPopupWinClass proc near
mov di, offset OLPopupWinClass
GOTO WinClasses_ObjCallSuperNoLock
WinClasses_ObjCallSuperNoLock_OLPopupWinClass endp
WinClasses_ObjCallSuperNoLock proc near
call ObjCallSuperNoLock
ret
WinClasses_ObjCallSuperNoLock endp
;---
WinClasses_Mov_CXDX_Self proc near
EC < call ECCheckLMemObject >
mov cx, ds:[LMBH_handle] ;set ^lcx:dx = this root object
mov dx, si
ret
WinClasses_Mov_CXDX_Self endp
;---
if _MENUS_PINNABLE
WinClasses_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL proc near
mov cl, mask VOF_WINDOW_INVALID
FALL_THRU WinClasses_VisMarkInvalid_MANUAL
WinClasses_VisMarkInvalid_VOF_WINDOW_INVALID_MANUAL endp
WinClasses_VisMarkInvalid_MANUAL proc near
mov dl, VUM_MANUAL
FALL_THRU WinClasses_VisMarkInvalid
WinClasses_VisMarkInvalid_MANUAL endp
endif
WinClasses_VisMarkInvalid proc near
call VisMarkInvalid
ret
WinClasses_VisMarkInvalid endp
WinClasses ends
;------------------------------------------------------------------------------
KbdNavigation segment resource
KN_DerefVisSpec_DI proc near
class VisClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
ret
KN_DerefVisSpec_DI endp
KbdNavigation ends
ActionObscure segment resource
AO_DerefVisSpec_DI proc near
class VisClass
EC < call ECCheckLMemObject >
mov di, ds:[si]
add di, ds:[di].Vis_offset
ret
AO_DerefVisSpec_DI endp
ActionObscure ends
;---
WinCommon segment resource
if (0) ; written, but not tested.
COMMENT @----------------------------------------------------------------------
FUNCTION: WinOpenFromStruct
DESCRIPTION: Call WinOpen with passed parameters
CALLED BY: INTERNAL
Utility routine, makes it easier to calculate parameters for
call.
PASS: ss:bp - WinOpenParams
RETURN: bx - handle to allocated & opened window
di - handle to allocated & opened graphic state (if any)
DESTROYED: ax, cx, dx, si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/92 Initial version
------------------------------------------------------------------------------@
WinOpenParams struct
; group passed in registers
WOP_red byte ; al
WOP_colorFlags WinColorFlags ; ah
WOP_green byte ; bl
WOP_blue byte ; bh
WOP_inputOD optr ; cx:dx
WOP_exposureOD optr ; di:bp
WOP_flags WinPassFlags ; si
; Start of group passed on stack
WOP_rectangle Rectangle
WOP_region fptr
WOP_parent hptr
WOP_owner hptr
WOP_layerID hptr
WinOpenParams ends
WinOpenFromStruct proc far uses ds, es
.enter
mov ax, ss ; get ptr in ds:si
mov ds, ax
mov si, bp
; create space for WinOpen "on stac" params
mov cx, size WinOpenParams - offset WOP_rectangle
sub sp, cx
mov di, sp
mov ax, ss
mov es, ax
push si
add si, offset WOP_rectangle
rep movsb ; copy onto stack
pop si
lodsw ; now get params passed in registers
push ax
lodsw
mov bx, ax
lodsw
mov dx, ax
lodsw
mov cx, ax
lodsw
mov bp, ax
lodsw
mov di, ax
lodsw
mov si, ax
call WinOpen
.leave
ret
WinOpenFromStruct endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OpenWinCheckIfMinMaxRestoreControls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns flag indicating whether or not the user should be
allowed to min/max/restore the current OLWinClass object
at all.
CALLED BY: INTERNAL
PASS: *ds:si - OLWinClass object
RETURN: carry - set if min/max/restore capability is being offered
in general for this type of window
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 8/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
OpenWinCheckIfMinMaxRestoreControls proc near uses ax, di, es
.enter
mov ax, segment olWindowOptions
mov es, ax
call WinCommon_DerefVisSpec_DI
CUAS < cmp ds:[di].OLWI_type, MOWT_DISPLAY_WINDOW >
OLS < cmp ds:[di].OLWI_type, OLWT_DISPLAY_WINDOW >
je exitYes
CUAS < cmp ds:[di].OLWI_type, MOWT_PRIMARY_WINDOW >
OLS < cmp ds:[di].OLWI_type, OLWT_BASE_WINDOW >
je primaryCheck
ISU < cmp ds:[di].OLWI_type, MOWT_COMMAND_WINDOW >
ISU < je exitYes >
clc ; if not display or primary, then NO,
; no min/max restore capability
jmp exit
primaryCheck:
test es:[olWindowOptions], mask UIWO_PRIMARY_MIN_MAX_RESTORE_CONTROLS
jz exit ; no, exit with carry clear
exitYes:
stc
exit:
.leave
ret
OpenWinCheckIfMinMaxRestoreControls endp
WinCommon ends
;-------------------------------------------------------------------------
|
Cubical/Algebra/Group/EilenbergMacLane/GroupStructure.agda | thomas-lamiaux/cubical | 0 | 12808 | <reponame>thomas-lamiaux/cubical<gh_stars>0
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Algebra.Group.EilenbergMacLane.GroupStructure where
open import Cubical.Algebra.Group.EilenbergMacLane.Base
open import Cubical.Algebra.Group.EilenbergMacLane.WedgeConnectivity
open import Cubical.Algebra.Group.Base
open import Cubical.Algebra.Group.Properties
open import Cubical.Algebra.AbGroup.Base
open import Cubical.Data.Nat
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.GroupoidLaws renaming (assoc to ∙assoc)
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Pointed
open import Cubical.Foundations.Path
open import Cubical.Homotopy.Loopspace
open import Cubical.HITs.EilenbergMacLane1
open import Cubical.HITs.Truncation
renaming (elim to trElim ; rec to trRec ; rec2 to trRec2)
open import Cubical.HITs.Susp
open import Cubical.Functions.Morphism
private
variable ℓ : Level
module _ {G : AbGroup ℓ} where
infixr 34 _+ₖ_
infixr 34 _-ₖ_
open AbGroupStr (snd G) renaming (_+_ to _+G_ ; -_ to -G_ ; +Assoc to +AssocG)
private
help : (n : ℕ) → n + (4 + n) ≡ (2 + n) + (2 + n)
help n = +-suc n (3 + n) ∙ cong suc (+-suc n (suc (suc n)))
hLevHelp : (n : ℕ) → isOfHLevel ((2 + n) + (2 + n)) (EM G (2 + n))
hLevHelp n =
transport (λ i → isOfHLevel (help n i) (EM G (2 + n)))
(isOfHLevelPlus {n = 4 + n} n (isOfHLevelTrunc (4 + n)))
helper : (g h : fst G)
→ PathP (λ i → Path (EM₁ (AbGroup→Group G))
(emloop h i) (emloop h i)) (emloop g) (emloop g)
helper g h =
comm→PathP
((sym (emloop-comp _ h g)
∙∙ cong emloop (+Comm h g)
∙∙ emloop-comp _ g h))
_+ₖ_ : {n : ℕ} → EM G n → EM G n → EM G n
_+ₖ_ {n = zero} = _+G_
_+ₖ_ {n = suc zero} =
rec _ (isGroupoidΠ (λ _ → emsquash))
(λ x → x)
(λ x → funExt (looper x))
λ g h i j x → el g h x i j
where
looper : fst G → (x : _) → x ≡ x
looper g = (elimSet _ (λ _ → emsquash _ _)
(emloop g)
(helper g))
el : (g h : fst G) (x : EM₁ (AbGroup→Group G))
→ Square (looper g x)
(looper (g +G h) x)
refl (looper h x)
el g h =
elimProp _ (λ _ → isOfHLevelPathP' 1 (emsquash _ _) _ _)
(emcomp g h)
_+ₖ_ {n = suc (suc n)} =
trRec2 (isOfHLevelTrunc (4 + n))
(wedgeConEM.fun G G (suc n) (suc n)
(λ _ _ → hLevHelp n)
∣_∣ ∣_∣ refl)
σ-EM : (n : ℕ) → EM-raw G (suc n) → Path (EM-raw G (2 + n)) ptEM-raw ptEM-raw
σ-EM n x = merid x ∙ sym (merid ptEM-raw)
-ₖ_ : {n : ℕ} → EM G n → EM G n
-ₖ_ {n = zero} x = -G x
-ₖ_ {n = suc zero} =
rec _ emsquash
embase
(λ g → sym (emloop g))
λ g h → sym (emloop-sym _ g)
◁ (flipSquare
(flipSquare (emcomp (-G g) (-G h))
▷ emloop-sym _ h)
▷ (cong emloop (+Comm (-G g) (-G h)
∙ sym (GroupTheory.invDistr (AbGroup→Group G) g h))
∙ emloop-sym _ (g +G h)))
-ₖ_ {n = suc (suc n)} =
map λ { north → north
; south → north
; (merid a i) → σ-EM n a (~ i)}
_-ₖ_ : {n : ℕ} → EM G n → EM G n → EM G n
_-ₖ_ {n = n} x y = _+ₖ_ {n = n} x (-ₖ_ {n = n} y)
+ₖ-syntax : (n : ℕ) → EM G n → EM G n → EM G n
+ₖ-syntax n = _+ₖ_ {n = n}
-ₖ-syntax : (n : ℕ) → EM G n → EM G n
-ₖ-syntax n = -ₖ_ {n = n}
-'ₖ-syntax : (n : ℕ) → EM G n → EM G n → EM G n
-'ₖ-syntax n = _-ₖ_ {n = n}
syntax +ₖ-syntax n x y = x +[ n ]ₖ y
syntax -ₖ-syntax n x = -[ n ]ₖ x
syntax -'ₖ-syntax n x y = x -[ n ]ₖ y
lUnitₖ : (n : ℕ) (x : EM G n) → 0ₖ n +[ n ]ₖ x ≡ x
lUnitₖ zero x = +IdL x
lUnitₖ (suc zero) _ = refl
lUnitₖ (suc (suc n)) =
trElim (λ _ → isOfHLevelTruncPath {n = 4 + n})
λ _ → refl
rUnitₖ : (n : ℕ) (x : EM G n) → x +[ n ]ₖ 0ₖ n ≡ x
rUnitₖ zero x = +IdR x
rUnitₖ (suc zero) =
elimSet _ (λ _ → emsquash _ _)
refl
λ _ _ → refl
rUnitₖ (suc (suc n)) =
trElim (λ _ → isOfHLevelTruncPath {n = 4 + n})
(wedgeConEM.right G G (suc n) (suc n)
(λ _ _ → hLevHelp n)
∣_∣ ∣_∣ refl)
commₖ : (n : ℕ) (x y : EM G n) → x +[ n ]ₖ y ≡ y +[ n ]ₖ x
commₖ zero = +Comm
commₖ (suc zero) =
wedgeConEM.fun G G 0 0 (λ _ _ → emsquash _ _)
(λ x → sym (rUnitₖ 1 x))
(rUnitₖ 1)
refl
commₖ (suc (suc n)) =
elim2 (λ _ _ → isOfHLevelTruncPath {n = 4 + n})
(wedgeConEM.fun G G _ _ (λ _ _ → isOfHLevelPath ((2 + n) + (2 + n)) (hLevHelp n) _ _)
(λ x → sym (rUnitₖ (2 + n) ∣ x ∣))
(λ x → rUnitₖ (2 + n) ∣ x ∣)
refl)
cong₂+₁ : (p q : typ (Ω (EM∙ G 1)))
→ cong₂ (λ x y → x +[ 1 ]ₖ y) p q ≡ p ∙ q
cong₂+₁ p q =
(cong₂Funct (λ x y → x +[ 1 ]ₖ y) p q)
∙ (λ i → (cong (λ x → rUnitₖ 1 x i) p) ∙ (cong (λ x → lUnitₖ 1 x i) q))
cong₂+₂ : (n : ℕ) (p q : typ (Ω (EM∙ G (suc (suc n)))))
→ cong₂ (λ x y → x +[ (2 + n) ]ₖ y) p q ≡ p ∙ q
cong₂+₂ n p q =
(cong₂Funct (λ x y → x +[ (2 + n) ]ₖ y) p q)
∙ (λ i → (cong (λ x → rUnitₖ (2 + n) x i) p) ∙ (cong (λ x → lUnitₖ (2 + n) x i) q))
isCommΩEM : (n : ℕ) (p q : typ (Ω (EM∙ G (suc n)))) → p ∙ q ≡ q ∙ p
isCommΩEM zero p q =
sym (cong₂+₁ p q)
∙∙ (λ i j → commₖ 1 (p j) (q j) i)
∙∙ cong₂+₁ q p
isCommΩEM (suc n) p q =
(sym (cong₂+₂ n p q)
∙∙ (λ i j → commₖ (suc (suc n)) (p j) (q j) i)
∙∙ cong₂+₂ n q p)
cong-₁ : (p : typ (Ω (EM∙ G 1))) → cong (λ x → -[ 1 ]ₖ x) p ≡ sym p
cong-₁ p = main embase p
where
decoder : (x : EM G 1) → embase ≡ x → x ≡ embase
decoder =
elimSet _
(λ _ → isSetΠ λ _ → emsquash _ _)
(λ p i → -[ 1 ]ₖ (p i))
λ g → toPathP
(funExt λ x →
(λ i → transport (λ i → Path (EM G 1) (emloop g i) embase)
(cong (-ₖ_ {n = 1})
(transp (λ j → Path (EM G 1) embase (emloop g (~ j ∧ ~ i))) i
(compPath-filler x (sym (emloop g)) i) )))
∙∙ (λ i → transp (λ j → Path (EM G 1) (emloop g (i ∨ j)) embase) i
(compPath-filler'
(sym (emloop g))
(cong-∙ (-ₖ_ {n = 1})
x (sym (emloop g)) i) i))
∙∙ (cong (sym (emloop g) ∙_) (isCommΩEM 0 (cong (-ₖ_ {n = 1}) x) (emloop g)))
∙∙ ∙assoc _ _ _
∙∙ cong (_∙ (cong (-ₖ_ {n = 1}) x)) (lCancel (emloop g))
∙ sym (lUnit _))
main : (x : EM G 1) (p : embase ≡ x) → decoder x p ≡ sym p
main x = J (λ x p → decoder x p ≡ sym p) refl
cong-₂ : (n : ℕ) (p : typ (Ω (EM∙ G (2 + n))))
→ cong (λ x → -[ 2 + n ]ₖ x) p ≡ sym p
cong-₂ n p = main _ p
where
pp : (a : _)
→ PathP (λ i → 0ₖ (suc (suc n)) ≡ ∣ merid a i ∣ₕ → ∣ merid a i ∣ₕ ≡ 0ₖ (2 + n))
(cong (λ x → -[ 2 + n ]ₖ x))
λ p → cong ∣_∣ₕ (sym (merid ptEM-raw)) ∙ cong (λ x → -[ 2 + n ]ₖ x) p
pp a =
toPathP
(funExt λ x →
(λ k → transp (λ i → Path (EM G (2 + n)) ∣ merid a (i ∨ k) ∣ ∣ ptEM-raw ∣) k
(compPath-filler' (cong ∣_∣ₕ (sym (merid a)))
(cong (-ₖ-syntax (suc (suc n)))
(transp (λ j → Path (EM G (2 + n)) ∣ ptEM-raw ∣ ∣ merid a (~ j ∧ ~ k) ∣) k
(compPath-filler x (sym (cong ∣_∣ₕ (merid a))) k))) k))
∙∙ cong (cong ∣_∣ₕ (sym (merid a)) ∙_)
(cong-∙ (λ x → -[ 2 + n ]ₖ x) x (sym (cong ∣_∣ₕ (merid a)))
∙ isCommΩEM (suc n) (cong (λ x → -[ 2 + n ]ₖ x) x) (cong ∣_∣ₕ (σ-EM n a)))
∙∙ (λ k → (λ i → ∣ merid a (~ i ∨ k) ∣)
∙ (λ i → ∣ compPath-filler' (merid a) (sym (merid ptEM-raw)) (~ k) i ∣)
∙ cong (λ x → -ₖ-syntax (suc (suc n)) x) x)
∙ sym (lUnit _))
decoder : (x : EM G (2 + n))
→ 0ₖ (2 + n) ≡ x → x ≡ 0ₖ (2 + n)
decoder =
trElim (λ _ → isOfHLevelΠ (4 + n) λ _ → isOfHLevelTruncPath {n = 4 + n})
λ { north → pp ptEM-raw i0
; south → pp ptEM-raw i1
; (merid a i) → pp a i}
main : (x : EM G (2 + n)) (p : 0ₖ (2 + n) ≡ x) → decoder x p ≡ sym p
main x = J (λ x p → decoder x p ≡ sym p) refl
rCancelₖ : (n : ℕ) (x : EM G n) → x +[ n ]ₖ (-[ n ]ₖ x) ≡ 0ₖ n
rCancelₖ zero x = +InvR x
rCancelₖ (suc zero) =
elimSet _ (λ _ → emsquash _ _)
refl
λ g → flipSquare (cong₂+₁ (emloop g) (λ i → -ₖ-syntax 1 (emloop g i))
∙ rCancel (emloop g))
rCancelₖ (suc (suc n)) =
trElim (λ _ → isOfHLevelTruncPath {n = 4 + n})
λ { north → refl
; south i → +ₖ-syntax (suc (suc n)) ∣ merid ptEM-raw (~ i) ∣
(-ₖ-syntax (suc (suc n)) ∣ merid ptEM-raw (~ i) ∣)
; (merid a i) j
→ hcomp (λ r → λ { (i = i0) → 0ₖ (2 + n)
; (i = i1) → ∣ merid ptEM-raw (~ j ∧ r) ∣ₕ -[ 2 + n ]ₖ ∣ merid ptEM-raw (~ j ∧ r) ∣
; (j = i0) → ∣ compPath-filler (merid a) (sym (merid ptEM-raw)) (~ r) i ∣
-[ 2 + n ]ₖ ∣ compPath-filler (merid a) (sym (merid ptEM-raw)) (~ r) i ∣
; (j = i1) → 0ₖ (2 + n)})
(help' a j i) }
where
help' : (a : _)
→ cong₂ (λ x y → ∣ x ∣ -[ suc (suc n) ]ₖ ∣ y ∣) (σ-EM n a) (σ-EM n a) ≡ refl
help' a =
cong₂+₂ n (cong ∣_∣ₕ (σ-EM n a)) (cong (λ x → -[ 2 + n ]ₖ ∣ x ∣) (σ-EM n a))
∙∙ cong (cong ∣_∣ₕ (σ-EM n a) ∙_) (cong-₂ n (cong ∣_∣ₕ (σ-EM n a)))
∙∙ rCancel _
lCancelₖ : (n : ℕ) (x : EM G n) → (-[ n ]ₖ x) +[ n ]ₖ x ≡ 0ₖ n
lCancelₖ n x = commₖ n (-[ n ]ₖ x) x ∙ rCancelₖ n x
assocₖ : (n : ℕ) (x y z : EM G n)
→ (x +[ n ]ₖ (y +[ n ]ₖ z) ≡ (x +[ n ]ₖ y) +[ n ]ₖ z)
assocₖ zero = +AssocG
assocₖ (suc zero) =
elimSet _ (λ _ → isSetΠ2 λ _ _ → emsquash _ _)
(λ _ _ → refl)
λ g i y z k → lem g y z k i
where
lem : (g : fst G) (y z : _)
→ cong (λ x → x +[ suc zero ]ₖ (y +[ suc zero ]ₖ z)) (emloop g)
≡ cong (λ x → (x +[ suc zero ]ₖ y) +[ suc zero ]ₖ z) (emloop g)
lem g =
elimProp _ (λ _ → isPropΠ λ _ → emsquash _ _ _ _)
(elimProp _ (λ _ → emsquash _ _ _ _)
refl)
assocₖ (suc (suc n)) =
elim2 (λ _ _ → isOfHLevelΠ (4 + n) λ _ → isOfHLevelTruncPath {n = 4 + n})
λ a b → trElim (λ _ → isOfHLevelTruncPath {n = 4 + n})
(λ c → main c a b)
where
lem : (c : _) (a b : _)
→ PathP (λ i → (∣ a ∣ₕ +[ suc (suc n) ]ₖ (∣ b ∣ₕ +[ suc (suc n) ]ₖ ∣ merid c i ∣ₕ)
≡ (∣ a ∣ₕ +[ suc (suc n) ]ₖ ∣ b ∣ₕ) +[ suc (suc n) ]ₖ ∣ merid c i ∣ₕ))
(cong (λ x → ∣ a ∣ₕ +[ suc (suc n) ]ₖ x) (rUnitₖ (suc (suc n)) ∣ b ∣)
∙ sym (rUnitₖ (suc (suc n)) (∣ a ∣ₕ +[ suc (suc n) ]ₖ ∣ b ∣ₕ)))
((λ i → ∣ a ∣ₕ +[ suc (suc n) ]ₖ (∣ b ∣ₕ +[ suc (suc n) ]ₖ ∣ merid ptEM-raw (~ i) ∣ₕ))
∙∙ cong (λ x → ∣ a ∣ₕ +[ suc (suc n) ]ₖ x) (rUnitₖ (suc (suc n)) ∣ b ∣)
∙ sym (rUnitₖ (suc (suc n)) (∣ a ∣ₕ +[ suc (suc n) ]ₖ ∣ b ∣ₕ))
∙∙ λ i → (∣ a ∣ₕ +[ suc (suc n) ]ₖ ∣ b ∣ₕ) +[ suc (suc n) ]ₖ ∣ merid ptEM-raw i ∣ₕ)
lem c =
raw-elim G (suc n)
(λ _ → isOfHLevelΠ (2 + n)
(λ _ → isOfHLevelPathP' (2 + n) (isOfHLevelTrunc (4 + n) _ _) _ _))
(raw-elim G (suc n)
(λ _ → isOfHLevelPathP' (2 + n) (isOfHLevelTrunc (4 + n) _ _) _ _)
((sym (rUnit refl)
◁ λ _ → refl)
▷ (sym (lCancel (cong ∣_∣ₕ (merid ptEM-raw)))
∙ λ i → (λ j → ∣ merid ptEM-raw (~ j ∨ ~ i) ∣ₕ)
∙∙ lUnit (λ j → ∣ merid ptEM-raw (~ j ∧ ~ i) ∣ₕ) i
∙∙ cong ∣_∣ₕ (merid ptEM-raw))))
main : (c a b : _)
→ (∣ a ∣ₕ +[ suc (suc n) ]ₖ (∣ b ∣ₕ +[ suc (suc n) ]ₖ ∣ c ∣ₕ)
≡ (∣ a ∣ₕ +[ suc (suc n) ]ₖ ∣ b ∣ₕ) +[ suc (suc n) ]ₖ ∣ c ∣ₕ)
main north a b = lem ptEM-raw a b i0
main south a b = lem ptEM-raw a b i1
main (merid c i) a b = lem c a b i
σ-EM' : (n : ℕ) (x : EM G (suc n))
→ Path (EM G (suc (suc n)))
(0ₖ (suc (suc n)))
(0ₖ (suc (suc n)))
σ-EM' zero x = cong ∣_∣ₕ (σ-EM zero x)
σ-EM' (suc n) =
trElim (λ _ → isOfHLevelTrunc (5 + n) _ _)
λ x → cong ∣_∣ₕ (σ-EM (suc n) x)
σ-EM'-0ₖ : (n : ℕ) → σ-EM' n (0ₖ (suc n)) ≡ refl
σ-EM'-0ₖ zero = cong (cong ∣_∣ₕ) (rCancel (merid ptEM-raw))
σ-EM'-0ₖ (suc n) = cong (cong ∣_∣ₕ) (rCancel (merid ptEM-raw))
private
lUnit-rUnit-coh : ∀ {ℓ} {A : Type ℓ} {x : A} (p : x ≡ x) (r : refl ≡ p)
→ lUnit p ∙ cong (_∙ p) r
≡ rUnit p ∙ cong (p ∙_) r
lUnit-rUnit-coh p =
J (λ p r → lUnit p ∙ cong (_∙ p) r ≡ rUnit p ∙ cong (p ∙_) r) refl
σ-EM'-hom : (n : ℕ) → (a b : _) → σ-EM' n (a +ₖ b) ≡ σ-EM' n a ∙ σ-EM' n b
σ-EM'-hom zero =
wedgeConEM.fun G G 0 0 (λ _ _ → isOfHLevelTrunc 4 _ _ _ _) l r p
where
l : _
l x = cong (σ-EM' zero) (lUnitₖ 1 x)
∙∙ lUnit (σ-EM' zero x)
∙∙ cong (_∙ σ-EM' zero x) (sym (σ-EM'-0ₖ zero))
r : _
r x =
cong (σ-EM' zero) (rUnitₖ 1 x)
∙∙ rUnit (σ-EM' zero x)
∙∙ cong (σ-EM' zero x ∙_) (sym (σ-EM'-0ₖ zero))
p : _
p = lUnit-rUnit-coh (σ-EM' zero embase) (sym (σ-EM'-0ₖ zero))
σ-EM'-hom (suc n) =
elim2 (λ _ _ → isOfHLevelPath (4 + n) (isOfHLevelTrunc (5 + n) _ _) _ _)
(wedgeConEM.fun G G _ _
(λ x y → transport (λ i → isOfHLevel (help n i)
((σ-EM' (suc n) (∣ x ∣ₕ +ₖ ∣ y ∣ₕ)
≡ σ-EM' (suc n) ∣ x ∣ₕ ∙ σ-EM' (suc n) ∣ y ∣ₕ)))
(isOfHLevelPlus {n = 4 + n} n
(isOfHLevelPath (4 + n)
(isOfHLevelTrunc (5 + n) _ _) _ _)))
(λ x → cong (σ-EM' (suc n)) (lUnitₖ (suc (suc n)) ∣ x ∣)
∙∙ lUnit (σ-EM' (suc n) ∣ x ∣)
∙∙ cong (_∙ σ-EM' (suc n) ∣ x ∣) (sym (σ-EM'-0ₖ (suc n))))
(λ x → cong (σ-EM' (suc n)) (rUnitₖ (2 + n) ∣ x ∣)
∙∙ rUnit (σ-EM' (suc n) ∣ x ∣)
∙∙ cong (σ-EM' (suc n) ∣ x ∣ ∙_) (sym (σ-EM'-0ₖ (suc n))))
(lUnit-rUnit-coh (σ-EM' (suc n) (0ₖ (2 + n))) (sym (σ-EM'-0ₖ (suc n)))))
σ-EM'-ₖ : (n : ℕ) → (a : _) → σ-EM' n (-ₖ a) ≡ sym (σ-EM' n a)
σ-EM'-ₖ n =
morphLemmas.distrMinus
(λ x y → x +[ suc n ]ₖ y) (_∙_)
(σ-EM' n) (σ-EM'-hom n)
(0ₖ (suc n)) refl
(λ x → -ₖ x) sym
(λ x → sym (lUnit x)) (λ x → sym (rUnit x))
(lCancelₖ (suc n)) rCancel
∙assoc (σ-EM'-0ₖ n)
-Dist : (n : ℕ) (x y : EM G n) → -[ n ]ₖ (x +[ n ]ₖ y) ≡ (-[ n ]ₖ x) +[ n ]ₖ (-[ n ]ₖ y)
-Dist zero x y = (GroupTheory.invDistr (AbGroup→Group G) x y) ∙ commₖ zero _ _
-Dist (suc zero) = k
where -- useless where clause. Needed for fast type checking for some reason.
l : _
l x = refl
r : _
r x = cong (λ z → -[ 1 ]ₖ z) (rUnitₖ 1 x) ∙ sym (rUnitₖ 1 (-[ 1 ]ₖ x))
p : r ptEM-raw ≡ l ptEM-raw
p = sym (rUnit refl)
k = wedgeConEM.fun G G 0 0 (λ _ _ → emsquash _ _) l r (sym p)
-Dist (suc (suc n)) =
elim2 (λ _ _ → isOfHLevelTruncPath {n = 4 + n})
(wedgeConEM.fun G G (suc n) (suc n)
(λ _ _ → isOfHLevelPath ((2 + n) + (2 + n)) (hLevHelp n) _ _)
(λ x → refl)
(λ x → cong (λ z → -[ (suc (suc n)) ]ₖ z)
(rUnitₖ (suc (suc n)) ∣ x ∣ₕ)
∙ sym (rUnitₖ (suc (suc n)) (-[ (suc (suc n)) ]ₖ ∣ x ∣ₕ)))
(rUnit refl))
addIso : (n : ℕ) (x : EM G n) → Iso (EM G n) (EM G n)
Iso.fun (addIso n x) y = y +[ n ]ₖ x
Iso.inv (addIso n x) y = y -[ n ]ₖ x
Iso.rightInv (addIso n x) y =
sym (assocₖ n y (-[ n ]ₖ x) x)
∙∙ cong (λ x → y +[ n ]ₖ x) (lCancelₖ n x)
∙∙ rUnitₖ n y
Iso.leftInv (addIso n x) y =
sym (assocₖ n y x (-[ n ]ₖ x))
∙∙ cong (λ x → y +[ n ]ₖ x) (rCancelₖ n x)
∙∙ rUnitₖ n y
|
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_CopyTableForAllPrivSets.applescript | NYHTC/applescript-fm-helper | 1 | 2063 | <reponame>NYHTC/applescript-fm-helper<filename>library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_CopyTableForAllPrivSets.applescript<gh_stars>1-10
-- fmGUI_ManageSecurity_CopyTableForAllPrivSets({sourceTable:null, effectTable:null})
-- <NAME>, NYHTC
-- copy setting for from one table to another in each privSet.
(*
HISTORY:
1.0.1 - 2017-12-21 ( eshagdar ): allow override for field-acccess privileges.
1.0 - 2017-11-07 ( eshagdar ):created
REQUIRES:
fmGUI_ManageSecurity_AccessRecord_CopyTable
fmGUI_ManageSecurity_PrivSet_GetInfo
fmGUI_ManageSecurity_PrivSet_Names
fmGUI_ManageSecurity_PrivSet_OpenForEdit
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open
fmGUI_ManageSecurity_Save
fmGUI_ObjectClick_OkButton
*)
on run
fmGUI_ManageSecurity_CopyTableForAllPrivSets({sourceTable:"SomeSourceTableName", effectTable:"NameOfTableToUpdate", fullAccessAccountName:"admin", fullAccessPassword:""})
end run
--------------------
-- START OF CODE
--------------------
on fmGUI_ManageSecurity_CopyTableForAllPrivSets(prefs)
-- version 1.0.1
try
set defaultPrefs to {sourceTable:null, effectTable:null, fullAccessAccountName:null, fullAccessPassword:null}
set prefs to prefs & defaultPrefs
set credentials to {fullAccessAccountName:fullAccessAccountName of prefs, fullAccessPassword:fullAccessPassword of prefs}
set customPrivileges to "Custom privileges"
-- iterate through privSets, updating the table in each
set listPrivSetNames to fmGUI_ManageSecurity_PrivSet_Names(credentials)
repeat with onePrivSetName in listPrivSetNames
set onePrivSetName to contents of onePrivSetName
if onePrivSetName begins with "[" then
-- this is a stardard privSet, so skip it
else
--update
fmGUI_ManageSecurity_PrivSet_OpenForEdit({privSetName:onePrivSetName} & credentials)
if accessRecord of fmGUI_ManageSecurity_PrivSet_GetInfo({getAccessInfo:false}) contains customPrivileges then
-- update custom privileges
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open({accessRecord:customPrivileges})
fmGUI_ManageSecurity_AccessRecord_CopyTable({sourceTable:sourceTable of prefs, effectTable:effectTable of prefs, allowFieldAccessOverride:true})
fmGUI_ObjectClick_OkButton({})
end if
fmGUI_ObjectClick_OkButton({})
end if
end repeat
return fmGUI_ManageSecurity_Save(credentials)
on error errMsg number errNum
error "unable to fmGUI_ManageSecurity_CopyTableForAllPrivSets - " & errMsg number errNum
end try
end fmGUI_ManageSecurity_CopyTableForAllPrivSets
--------------------
-- END OF CODE
--------------------
on fmGUI_ManageSecurity_AccessRecord_CopyTable(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_AccessRecord_CopyTable(prefs)
end fmGUI_ManageSecurity_AccessRecord_CopyTable
on fmGUI_ManageSecurity_PrivSet_GetInfo(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_GetInfo(prefs)
end fmGUI_ManageSecurity_PrivSet_GetInfo
on fmGUI_ManageSecurity_PrivSet_Names(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Names(prefs)
end fmGUI_ManageSecurity_PrivSet_Names
on fmGUI_ManageSecurity_PrivSet_OpenForEdit(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_OpenForEdit(prefs)
end fmGUI_ManageSecurity_PrivSet_OpenForEdit
on fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open(prefs)
end fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open
on fmGUI_ManageSecurity_Save(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_Save(prefs)
end fmGUI_ManageSecurity_Save
on fmGUI_ObjectClick_OkButton(prefs)
tell application "htcLib" to fmGUI_ObjectClick_OkButton(prefs)
end fmGUI_ObjectClick_OkButton
|
alloy4fun_models/trashltl/models/8/hZM6MGkKmKpeGwA5e.als | Kaixi26/org.alloytools.alloy | 0 | 3477 | open main
pred idhZM6MGkKmKpeGwA5e_prop9 {
all f: File | always f not in Trash implies always f in Protected
}
pred __repair { idhZM6MGkKmKpeGwA5e_prop9 }
check __repair { idhZM6MGkKmKpeGwA5e_prop9 <=> prop9o } |
Scripts Pack Source Items/Scripts Pack/Core Components/Force Eject CD Drive.applescript | Phorofor/ScriptsPack.macOS | 1 | 2595 | <reponame>Phorofor/ScriptsPack.macOS
# Scripts Pack - Tweak various preference variables in macOS
# <Phorofor, https://github.com/Phorofor/>
(* Used for force ejecting the CD drive even if the CD doesn't appear in the Finder or is having problems mounting. Works whether there isn't a CD inserted into the CD drive of the computer. *)
-- No settings are changed when running this script
(* tell application "Finder"
set defaultHD to (get name of startup disk) as string
end tell
set odsIcon to defaultHD & ":" *)
display alert "Force Eject CD Drive?" message "Check that a CD isn't burning or being written. This forces the CD Drive to eject after clicking 'Eject CD Drive'" buttons {"Cancel", "Eject CD Drive"} default button 2 cancel button 1
display dialog "Are you sure you want to force eject the CD drive now?" buttons {"Cancel", "Eject"} default button 1 cancel button 1 with title "Confirm Action - Eject Drive" with icon stop
-- Force eject CD drive
try
do shell script "drutil eject"
on error
display alert "An Expected Error Occured: Drive Eject Failed" message "The task did not complete successfully. Was there a a disc drive attached to the computer drive you wanted to eject? Or is an extension in the system to let the drive run was disabled?"
end try
display alert "The task was completed successfully." message "If the disc did not eject, there may be a problem with your CD drive, or there was no disc drive enabled or detected by the system."
end |
libsrc/_DEVELOPMENT/adt/p_queue/c/sdcc_iy/p_queue_empty.asm | meesokim/z88dk | 0 | 23697 | <reponame>meesokim/z88dk
; int p_queue_empty(p_queue_t *q)
SECTION code_adt_p_queue
PUBLIC _p_queue_empty
EXTERN _p_forward_list_empty
defc _p_queue_empty = _p_forward_list_empty
|
Task/Sorting-algorithms-Bogosort/Ada/sorting-algorithms-bogosort.ada | LaudateCorpus1/RosettaCodeData | 1 | 29902 | <gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Discrete_Random;
procedure Test_Bogosort is
generic
type Ordered is private;
type List is array (Positive range <>) of Ordered;
with function "<" (L, R : Ordered) return Boolean is <>;
procedure Bogosort (Data : in out List);
procedure Bogosort (Data : in out List) is
function Sorted return Boolean is
begin
for I in Data'First..Data'Last - 1 loop
if not (Data (I) < Data (I + 1)) then
return False;
end if;
end loop;
return True;
end Sorted;
subtype Index is Integer range Data'Range;
package Dices is new Ada.Numerics.Discrete_Random (Index);
use Dices;
Dice : Generator;
procedure Shuffle is
J : Index;
Temp : Ordered;
begin
for I in Data'Range loop
J := Random (Dice);
Temp := Data (I);
Data (I) := Data (J);
Data (J) := Temp;
end loop;
end Shuffle;
begin
while not Sorted loop
Shuffle;
end loop;
end Bogosort;
type List is array (Positive range <>) of Integer;
procedure Integer_Bogosort is new Bogosort (Integer, List);
Sequence : List := (7,6,3,9);
begin
Integer_Bogosort (Sequence);
for I in Sequence'Range loop
Put (Integer'Image (Sequence (I)));
end loop;
end Test_Bogosort;
|
programs/test_JSR.asm | tofu13/pyc64 | 0 | 1947 | <reponame>tofu13/pyc64<gh_stars>0
*=0x801
JSR .label1
JSR .label2
BRK
.label1 RTS
.label2 INX
INY
RTS |
install/lib/disk/drv_acc.asm | minblock/msdos | 0 | 163493 | <gh_stars>0
;========================================================
COMMENT #
DRV_ACC.ASM
Copyright (c) 1991 - Microsoft Corp.
All rights reserved.
Microsoft Confidential
=================================================
void EnableDiskAccess( unsigned char Drive )
Sets the drive access bit using undocumented
function SET_ACCESS_FLAG (47h) of IOCtrl function
44h.
ARGUMENTS: Drive - DOS drive letter (A=0, B=1, C=2, ...)
RETURNS: VOID
=================================================
johnhe - 06/04/90
END COMMENT #
;========================================================
INCLUDE disk_io.inc
INCLUDE model.inc
;========================================================
.CODE
; =======================================================
IF @DataSize
EnableDiskAccess PROC USES DS, Drive:BYTE
ELSE
EnableDiskAccess PROC Drive:BYTE
ENDIF
LOCAL AccessPacket:WORD
mov Accesspacket,0100h ; Setup the packet
lea DX,AccessPacket
IF @DataSize
push SS
pop DS
ENDIF
mov AX,4411h ; Generic ioctl support chk
xor BX,BX ; Clear BX
mov BL,Drive ; Get Drive letter
inc BL ; Make it 1 based
mov CX,847h ; Allow access to disk
int 21h
jc SetAccessExit ; If function not supported
; we know access is allowed
mov AX,440dh
int 21h
SetAccessExit:
ret
EnableDiskAccess ENDP
;========================================================
END
;========================================================
|
programs/oeis/102/A102394.asm | karttu/loda | 0 | 93705 | <reponame>karttu/loda
; A102394: A wicked odious sequence.
; 0,2,3,0,5,0,0,8,9,0,0,12,0,14,15,0,17,0,0,20,0,22,23,0,0,26,27,0,29,0,0,32,33,0,0,36,0,38,39,0,0,42,43,0,45,0,0,48,0,50,51,0,53,0,0,56,57,0,0,60,0,62,63,0,65,0,0,68,0,70,71,0,0,74,75,0,77,0,0,80,0,82,83,0,85,0
mov $1,$0
add $1,1
mov $3,$0
mov $4,$0
lpb $0,1
sub $0,1
div $4,2
sub $3,$4
lpe
mov $2,$3
mod $2,2
mul $1,$2
|
Setoids/Functions/Extension.agda | Smaug123/agdaproofs | 4 | 13225 | {-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Setoids.Setoids
open import Setoids.Functions.Definition
open import Sets.EquivalenceRelations
module Setoids.Functions.Extension where
ExtensionallyEqual : {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {f g : A → B} (fWd : WellDefined S T f) (gWd : WellDefined S T g) → Set (a ⊔ d)
ExtensionallyEqual {A = A} {T = T} {f = f} {g = g} fWD gWD = (∀ {x : A} → Setoid._∼_ T (f x) (g x))
extensionallyEqualReflexive : {a b c d : _} {A : Set a} {B : Set b} (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f : A → B) (fWD1 fWD2 : WellDefined S T f) → ExtensionallyEqual {S = S} {T} fWD1 fWD2
extensionallyEqualReflexive S T f fWD1 _ = Equivalence.reflexive (Setoid.eq T)
extensionallyEqualSymmetric : {a b c d : _} {A : Set a} {B : Set b} (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f g : A → B) (fWD : WellDefined S T f) (gWD : WellDefined S T g) → ExtensionallyEqual {S = S} {T = T} fWD gWD → ExtensionallyEqual {S = S} {T} gWD fWD
extensionallyEqualSymmetric S T f g fWD gWD pr = Equivalence.symmetric (Setoid.eq T) pr
extensionallyEqualTransitive : {a b c d : _} {A : Set a} {B : Set b} (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f g h : A → B) (fWD : WellDefined S T f) (gWD : WellDefined S T g) (hWD : WellDefined S T h) → ExtensionallyEqual {S = S} {T} fWD gWD → ExtensionallyEqual {S = S} {T} gWD hWD → ExtensionallyEqual {S = S} {T} fWD hWD
extensionallyEqualTransitive S T f g h fWD gWD hWD pr1 pr2 = Equivalence.transitive (Setoid.eq T) pr1 pr2
|
assembler/tests/t_3203x/t_3203x.asm | paulscottrobson/RCA-Cosmac-VIP-III | 1 | 23841 | cpu 320C30
relaxed on
page 0
org $123456
targ: br targ
brd targ
call targ
bu r0
bud r0
bu targ
bud targ
blo ar1
blsd targ
bhi ir0
bhs targ
beqd ar4
bne targ
blt targ
ble r10
bgtd targ
bge r6
bzd targ
bnz ar5
bpd targ
bn targ
bnnd ar3
bnv targ
bv ar7
bnufd ir1
buf targ
bnc ar2
bcd iof
bnlv targ
blv targ
bnluf targ
bluf targ
bzuf targ
b targ
callne r4
callnluf targ
dbne ar1,r5
dbn ar5,targ
dbud ar2,ar7
dbzufd ar6,targ
db ar7,targ
retine
retsnc
retsu
rets
trapu 7
trapuf 2
swi
sigi
idle
rol r4
rolc ar2
ror sp
rorc r20
rptb targ
nop ar2
nop *+ar3(2)
nop *-ar4(200)
nop *++ar5(30)
nop *--ar6
nop *ar5++(20)
nop *ar1--(12h)
nop *ar7++($56)%
nop *ar0--(0x10)%
nop *+ar6(ir0)
nop *-ar4(ir0)
nop *++ar2(ir0)
nop *--ar2(ir0)
nop *ar2++(ir0)
nop *ar2--(ir0)
nop *ar2++(ir0)%
nop *ar2--(ir0)%
nop *+ar6(ir1)
nop *-ar4(ir1)
nop *++ar2(ir1)
nop *--ar2(ir1)
nop *ar2++(ir1)
nop *ar2--(ir1)
nop *ar2++(ir1)%
nop *ar2--(ir1)%
nop *ar4
nop *ar3(100-$64)
nop *ar1++(ir0)B
iack *ar5
rpts ar5
absf r4
absf ar2,r5
absf @$1300,r7
absf *ar4++,r3
absf 200,r5
absi r4
absi ar2,r5
absi @$1300,r7
absi *ar4++,r3
absi 200,r5
;
addc ar2,r5
addc @$1300,r7
addc *ar4++,r3
addc 200,r5
addc3 *ar1++(1),*ar2,r5
addc3 *-ar3,r5,r2
addc3 r6,*ar4++,r3
addc3 r1,r2,r3
stf r4,@2000h
stf r6,*ar5
tstb3 r5,*ar3++
absf *ar4++,r6
|| stf r6,*ar5++
sti r5,*ar3
|| absi *ar4++%,r1
addf3 *ar4++,r5,r7
|| stf r3,*ar5++
sti r3,*ar5++
|| addi3 *ar4++,r5,r7
mpyi3 *ar4,*ar5,r1
|| subi3 r6,r7,r3
subi3 *ar4,r6,r3
|| mpyi3 *ar5,r7,r1
mpyi3 r7,*ar5,r1
|| subi3 *ar4,r6,r3
mpyi3 *ar5,r7,r1
|| subi3 r6,*ar4,r3
mpyi3 r7,*ar5,r1
|| subi3 r6,*ar4,r3
mpyi3 r6,r7,r1
|| subi3 *ar5,*ar4,r3
absf *++ar3(ir1) ,r4
|| stf r4,*-ar7(1)
absi *-ar5(1),r5
|| sti r1,*ar2--(ir1)
addf3 *+ar3(ir1),r2,r5
|| stf r4,*ar2
addi3 *ar0--(ir0),r5,r0
|| sti r3,*ar7
and3 *+ar1(ir0),r4,r7
|| sti r3,*ar2
ash3 r1,*ar6++(ir1),r0
|| sti r5,*ar2
fix *++ar4(1),r1
|| sti r0,*ar2
float *+ar2(ir0),r6
|| stf r7,*ar1
ldf *--ar1(ir0),r7
|| ldf *ar7++(1),r3
ldf *ar2--(1),r1
|| stf r3,*ar4++(ir1)
ldi *-ar1(1),r7
|| ldi *ar7++(ir0),r1
ldi *-ar1(1),r2
|| sti r7,*ar5++(ir0)
lsh3 r7,*ar2--(1),r2
|| sti r0,*+ar0(1)
mpyf3 *ar5++(1),*--ar1(ir0),r0
|| addf3 r5,r7,r3
mpyf3 *-ar2(1),r7,r0
|| stf r3,*ar0--(ir0)
mpyf3 r5,*++ar7(ir1),r0
|| subf3 r7,*ar3--(1),r2
mpyi3 r7,r4,r0
|| addi3 *-ar3,*ar5--(1),r3
mpyi3 *++ar0(1),r5,r7
|| sti r2,*-ar3(1)
mpyi3 r2,*++ar0(1),r0
|| subi3 *ar5--(ir1),r4,r2
negf *ar4--(1),r7
|| stf r2,*++ar5(1)
negi *-ar3,r2
|| sti r2,*ar1++
not *+ar2,r3
|| sti r7,*--ar4(ir1)
or3 *++ar2,r5,r2
|| sti r6,*ar1--
stf r4,*ar3--
|| stf r3,*++ar5
sti r0,*++ar2(ir0)
|| sti r5,*ar0
subf3 r1,*-ar4(ir1),r0
|| stf r7,*+ar5(ir0)
subi3 r7,*+ar2(ir0),r1
|| sti r3,*++ar7
xor3 *ar1++,r3,r3
|| sti r6,*-ar2(ir0)
xor3 *ar1++,r3,r3
||sti r6,*-ar2(ir0)
ldfz r3,r5
ldfzuf 20h,r6
ldiz r4,r6
ldp @123456h,dp
pop r3
popf r4
push r6
pushf r2
ldfz 1.27578125e+01,r4
ldi *ar5,r6
||ldi *ar5++,r6
addf3 *ar5++,*ar5++,r3
single 1.79750e+02
single -6.281250e+01
single -9.90337307e+27
single 9.90337307e+27
single -6.118750e+01, 1.79750e+02
extended 9.90337307e+27
bss 20h
word 20,55,'ABCD'
data 12345h,-1.2345e6,"Hello world"
|
include/test/misc.asm | eyalabraham/dragon | 0 | 3453 | <gh_stars>0
;
; misc.asm
;
; MC6809E emulator test code for compare and value move.
; All tests will use direct or immediate addressing for simplicity,
; other addressing modes will be tested separately.
;
jmp start
;
setcf: equ $01
clrcf: equ $fe
;
varstart equ *
;
var0: fcb $ff
var1: fcb $55
var2: fcb $aa
var3: fcb $01
var4: fcb $80
var5: fcb $00
;
varend: equ *
varlen: equ varend-varstart
;
temp: fcb 0
;
start: andcc #0 ; zero CC bits
;
; TST
;
lda var1
ldb var2
orcc #$0f ; flags NZVC
tsta ; flags nzvC
tstb ; flags NzvC
tst temp ; flags nZvC
;
; EXG
;
lda var0
ldb var1
exg a,b
ldx var2
exg d,x
;
; TFR
;
tfr x,y
tfr y,d
tfr d,u
;
; SEX
;
ldb var1
sex
ldb var2
sex
;
; BIT
;
lda #$55
bita var3
bita var4
ldb #$aa
bitb var4
bitb var3
;
nop
;
; End of test
|
src/templates/create/example.applescript | SamueleBarbiera/Venmjs | 1 | 1379 | <reponame>SamueleBarbiera/Venmjs
tell application "Terminal" to do script "vue create client" in selected tab of the front window |
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0_notsx.log_21829_882.asm | ljhsiun2/medusa | 9 | 9788 | <filename>Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0_notsx.log_21829_882.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x5078, %r15
nop
nop
sub %rcx, %rcx
movl $0x61626364, (%r15)
nop
nop
xor %rbx, %rbx
lea addresses_WT_ht+0x19d78, %rbx
nop
nop
xor $56500, %r11
movw $0x6162, (%rbx)
and %rcx, %rcx
lea addresses_WC_ht+0x14378, %rdi
nop
sub %rcx, %rcx
mov (%rdi), %rbx
nop
nop
nop
nop
nop
dec %rdi
lea addresses_UC_ht+0x1974, %r15
clflush (%r15)
nop
nop
nop
nop
nop
and $36252, %r12
mov (%r15), %rdi
nop
nop
nop
nop
nop
cmp $5128, %rcx
lea addresses_D_ht+0x1a478, %r12
nop
nop
nop
sub $14667, %rcx
movl $0x61626364, (%r12)
cmp %r12, %r12
lea addresses_UC_ht+0x159f8, %rsi
lea addresses_WC_ht+0xf178, %rdi
inc %r14
mov $1, %rcx
rep movsl
inc %r12
lea addresses_UC_ht+0x8278, %rsi
lea addresses_normal_ht+0xaff0, %rdi
nop
nop
xor %r12, %r12
mov $19, %rcx
rep movsl
nop
nop
nop
nop
dec %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r8
push %rbp
push %rdi
push %rsi
// Store
lea addresses_PSE+0xa078, %rbp
nop
nop
nop
nop
dec %r10
mov $0x5152535455565758, %rsi
movq %rsi, %xmm1
movntdq %xmm1, (%rbp)
nop
nop
nop
and %rbp, %rbp
// Faulty Load
lea addresses_US+0x18d78, %r10
nop
nop
nop
dec %r8
mov (%r10), %bp
lea oracles, %r10
and $0xff, %rbp
shlq $12, %rbp
mov (%r10,%rbp,1), %rbp
pop %rsi
pop %rdi
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 6}}
[Faulty Load]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 8}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/245/A245839.asm | jmorken/loda | 1 | 168145 | ; A245839: Arithmetic derivative of (3*n + 2).
; 1,12,1,9,1,24,1,15,1,80,12,21,1,48,1,45,1,92,1,33,18,72,1,39,18,176,1,45,1,96,24,77,1,164,1,87,1,120,24,63,75,448,1,69,1,188,24,75,1,236,36,81,30,168,1,129,1,368,1,131,42,192,1,99,1,380,36,105,30,216,48,111,30,592,1,171,1,240,1,165,119,380,1,129,1,332,1,185,1,560,135,141,1,288,48,213,1,452,36,153,66,380,1,159,1,1024,36,165,54,336,72,221,42,524,1,365,1,360,1,183,78,752,60,243,42,476,1,195,1,700,84,201,1,408,48,297,66,1072,1,213,195,432,1,293,42,788,1,225,1,456,191,231,1,944,1,339,54,572,1,243,102,740,1,311,78,800,1,321,1,2304,108,347,1,528,48,381,54,812,203,273,114,552,48,279,1,1312,1,285,1,668,255,357,90,884,1,423,1,600,1,401,231,1552,60,309,1,764,96,315,54,956,132,399,1,764,1,635,1,1328,1,333,263,672,72,339,1,1196,1,637,66,696,144,351,1,2176,108,507,54,720,1,437,315,1252,60,369,78,908,1,375,114,1520
mov $2,$0
mul $0,2
add $0,1
add $2,2
add $0,$2
add $0,2
cal $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
mov $1,$0
|
bb-runtimes/arm/stm32l/stm32l5x2/s-stm32.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 23782 | <reponame>JCGobbi/Nucleo-STM32G474RE
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- Copyright (C) 2012-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.BB.Parameters;
with Interfaces.STM32; use Interfaces.STM32;
with Interfaces.STM32.RCC; use Interfaces.STM32.RCC;
package body System.STM32 is
package Params renames System.BB.Parameters;
subtype Divisor is UInt32;
HPRE_Prescaler_Divisors : constant array (AHB_Prescalers) of Divisor :=
(1, 2, 4, 8, 16, 64, 128, 256, 512);
-- per RM0438 Rev 6 pg 353/2194
PPRE_Prescaler_Divisors : constant array (APB_Prescalers) of Divisor :=
(1, 2, 4, 8, 16);
MSI_Range_Table : constant array (UInt4) of UInt32 :=
(0 => 100_000,
1 => 200_000,
2 => 400_000,
3 => 800_000,
4 => 1_000_000,
5 => 2_000_000,
6 => 4_000_000,
7 => 8_000_000,
8 => 16_000_000,
9 => 24_000_000,
10 => 32_000_000,
11 => 48_000_000,
others => 0);
procedure Get_All_But_SYSCLK (This : in out RCC_System_Clocks);
-------------------
-- System_Clocks --
-------------------
function System_Clocks return RCC_System_Clocks is
Result : RCC_System_Clocks;
begin
case SYSCLK_Source'Enum_Val (RCC_Periph.CFGR.SWS) is
when SYSCLK_SRC_MSI =>
Result.SYSCLK := Params.MSI_Clock;
when SYSCLK_SRC_HSI =>
Result.SYSCLK := HSICLK;
when SYSCLK_SRC_HSE =>
Result.SYSCLK := Params.HSE_Clock; -- note: HSE is optional
when SYSCLK_SRC_PLL =>
Result.SYSCLK := Computed_SYSCLK_From_PLL;
end case;
Get_All_But_SYSCLK (Result);
return Result;
end System_Clocks;
------------------------------
-- Computed_SYSCLK_From_PLL --
------------------------------
function Computed_SYSCLK_From_PLL return Frequency is
PLLM : constant UInt32 := UInt32 (RCC_Periph.PLLCFGR.PLLM) + 1;
PLLN : constant UInt32 := UInt32 (RCC_Periph.PLLCFGR.PLLN);
PLLR : constant UInt32 := (case RCC_Periph.PLLCFGR.PLLR is
when 2#00# => 2,
when 2#01# => 4,
when 2#10# => 6,
when 2#11# => 8);
MSI_Value : UInt32;
MSI_Index : UInt4;
PLL_VCO : UInt32;
Result : Frequency;
begin
if PLL_Source'Enum_Val (RCC_Periph.PLLCFGR.PLLSRC) = PLL_SRC_MSI then
if not RCC_Periph.CR.MSIRGSEL then
-- MSISRANGE from RCC_CSR applies
MSI_Index := RCC_Periph.CSR.MSISRANGE;
else
-- MSIRANGE from RCC_CR applies
MSI_Index := RCC_Periph.CR.MSIRANGE;
end if;
MSI_Value := MSI_Range_Table (MSI_Index);
end if;
-- See RM0438 Rev 6, pg 354/2194, section 9.8.4 RCC PLL configuration
case PLL_Source'Enum_Val (RCC_Periph.PLLCFGR.PLLSRC) is
when PLL_SRC_None =>
PLL_VCO := 0;
when PLL_SRC_HSE =>
PLL_VCO := Params.HSE_Clock;
when PLL_SRC_HSI =>
PLL_VCO := HSICLK;
when PLL_SRC_MSI =>
PLL_VCO := MSI_Value;
end case;
if PLL_VCO = 0 then
-- the PLL is not really selected as the SYSCLK source
Result := 0;
else
Result := ((PLL_VCO / PLLM) * PLLN) / PLLR;
end if;
return Result;
end Computed_SYSCLK_From_PLL;
------------------------
-- Get_All_But_SYSCLK --
------------------------
procedure Get_All_But_SYSCLK (This : in out RCC_System_Clocks) is
HPRE : constant AHB_Prescalers :=
AHB_Prescalers'Enum_Val (RCC_Periph.CFGR.HPRE);
HPRE_Div : constant Divisor := HPRE_Prescaler_Divisors (HPRE);
PPRE1 : constant APB_Prescalers :=
APB_Prescalers'Enum_Val (RCC_Periph.CFGR.PPRE.Arr (1));
PPRE1_Div : constant Divisor := PPRE_Prescaler_Divisors (PPRE1);
PPRE2 : constant APB_Prescalers :=
APB_Prescalers'Enum_Val (RCC_Periph.CFGR.PPRE.Arr (2));
PPRE2_Div : constant Divisor := PPRE_Prescaler_Divisors (PPRE2);
begin
This.HCLK := This.SYSCLK / HPRE_Div;
This.PCLK1 := This.HCLK / PPRE1_Div;
This.PCLK2 := This.HCLK / PPRE2_Div;
if PPRE1 = RCC_HCLK_DIV1 then
This.TIMCLK1 := This.PCLK1;
else
This.TIMCLK1 := This.PCLK1 * 2;
end if;
if PPRE2 = RCC_HCLK_DIV1 then
This.TIMCLK2 := This.PCLK2;
else
This.TIMCLK2 := This.PCLK2 * 2;
end if;
end Get_All_But_SYSCLK;
end System.STM32;
|
programs/oeis/116/A116948.asm | karttu/loda | 0 | 102236 | <gh_stars>0
; A116948: Riordan array ((1+2x^2)/(1-x^3),x).
; 1,0,1,2,0,1,1,2,0,1,0,1,2,0,1,2,0,1,2,0,1,1,2,0,1,2,0,1,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,1,2,0,1,2,0,1,2,0,1,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,1,2,0,1,2,0,1,2,0,1,2,0,1
cal $0,99375 ; Sequence matrix for odd numbers.
mod $0,3
mov $1,$0
|
oeis/053/A053150.asm | neoneye/loda-programs | 11 | 26447 | <filename>oeis/053/A053150.asm
; A053150: Cube root of largest cube dividing n.
; Submitted by <NAME>(w2)
; 1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,3,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,3,1,2,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1
add $0,1
mov $1,$0
lpb $1
mov $2,$0
mov $3,$1
pow $3,3
mov $4,$1
lpb $2
mov $1,1
dif $2,$3
lpe
sub $1,1
lpe
mov $0,$4
|
oeis/083/A083882.asm | neoneye/loda-programs | 11 | 92976 | <gh_stars>10-100
; A083882: a(0)=1, a(1)=4, a(n)=8a(n-1)-13a(n-2), n>=2.
; Submitted by <NAME>
; 1,4,19,100,553,3124,17803,101812,583057,3340900,19147459,109747972,629066809,3605810836,20668618171,118473404500,679095199777,3892607339716,22312621120627,127897073548708,733112513821513
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $2,3
mul $3,4
add $3,$1
mul $1,4
add $1,$2
lpe
mov $0,$3
|
tests/tk-toplevel-toplevel_create_options_test_data-toplevel_create_options_tests.ads | thindil/tashy2 | 2 | 11588 | -- This package has been generated automatically by GNATtest.
-- Do not edit any part of it, see GNATtest documentation for more details.
-- begin read only
with GNATtest_Generated;
package Tk.TopLevel.Toplevel_Create_Options_Test_Data
.Toplevel_Create_Options_Tests
is
type Test_Toplevel_Create_Options is new GNATtest_Generated
.GNATtest_Standard
.Tk
.TopLevel
.Toplevel_Create_Options_Test_Data
.Test_Toplevel_Create_Options with
null record;
procedure Test_Create_32e405_9db90c
(Gnattest_T: in out Test_Toplevel_Create_Options);
-- tk-toplevel.ads:135:4:Create:Test_Create_TopLevel1
procedure Test_Create_ebbdc1_055047
(Gnattest_T: in out Test_Toplevel_Create_Options);
-- tk-toplevel.ads:168:4:Create:Test_Create_TopLevel2
procedure Test_Get_Options_ded36e_2e13ca
(Gnattest_T: in out Test_Toplevel_Create_Options);
-- tk-toplevel.ads:192:4:Get_Options:Test_Get_Options_TopLevel
end Tk.TopLevel.Toplevel_Create_Options_Test_Data
.Toplevel_Create_Options_Tests;
-- end read only
|
hdes-dialect/hdes-ast/src/main/antlr4/HdesParser.g4 | the-wrench-io/hdes-parent | 1 | 645 | parser grammar HdesParser;
options { tokenVocab = HdesLexer; }
import DecisionTableParser, ExpressionParser, ServiceTaskParser, FlowParser;
hdesContent: hdesBody* EOF;
hdesBody: (
FLOW flowUnit
| DECISION_TABLE decisionTableUnit
| SERVICE_TASK serviceTaskUnit
| EXPRESSION '{' expressionUnit '}'); |
programs/oeis/050/A050622.asm | karttu/loda | 0 | 176261 | ; A050622: Numbers m that are divisible by 2^k, where k is the digit length of m.
; 2,4,6,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,256,264,272,280,288,296,304,312,320,328,336,344,352,360
mov $3,$0
mov $4,$0
mov $0,4
mov $2,$4
trn $2,3
mov $4,$2
sub $2,16
mul $4,2
mov $1,$4
trn $2,6
lpb $0,1
sub $0,1
add $1,$2
lpe
lpb $3,1
add $1,2
sub $3,1
lpe
add $1,2
|
src/main/java/com/lanshiqin/lsq/rule/LsqScript.g4 | lanshiqin/Lsq | 0 | 4482 | /*
BSD 3-Clause License
Copyright (c) 2020, 蓝士钦
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of 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.
*/
// 语法规则文件
grammar LsqScript;
// 导入词法定义
import BaseLexer;
// 定义语法规则生成的源代码文件头部
@header {
package com.lanshiqin.lsq.rule;
}
// 字面量定义
literal
: IntegerLiteral
| FloatingPointLiteral
| BooleanLiteral
| CharacterLiteral
| StringLiteral
| NullLiteral
;
// 基本数据类型定义
primitiveType
: 'Number'
| 'String'
| 'var'
| 'val'
;
// 表达式
statement
: expressionStatement
| compoundStatement
;
// 表达式语句定义
expressionStatement
: expression? ';'
;
// 表达式定义
expression
: assignmentExpression
| expression ',' assignmentExpression
;
// 复合表达式定义
compoundStatement
: '{' blockItemList? '}'
;
// 语句块集合定义
blockItemList
: blockItem
| blockItemList blockItem
;
// 语句块
blockItem
: statement
| declaration
;
// 变量声明定义
declaration
: primitiveType Identifier
| primitiveType Identifier initializer
;
// 初始化赋值定义
initializer
: assignmentOperator assignmentExpression
;
// 赋值操作
assignmentOperator
: '='
| '*='
| '/='
| '%='
| '+='
| '-='
| '<<='
| '>>='
| '>>>='
| '&='
| '^='
| '|='
;
// 赋值表达式
assignmentExpression
: additiveExpression
| Identifier assignmentOperator additiveExpression
;
// 加法表达式,Antlr能够支持左递归
additiveExpression
: multiplicativeExpression
| additiveExpression '+' multiplicativeExpression
| additiveExpression '-' multiplicativeExpression
;
// 乘法表达式,Antlr能够支持左递归
multiplicativeExpression
: primaryExpression
| multiplicativeExpression '*' primaryExpression
| multiplicativeExpression '/' primaryExpression
| multiplicativeExpression '%' primaryExpression
;
// 初级表达式定义
primaryExpression
: Identifier
| literal
| Identifier '(' argumentExpressionList? ')'
| '(' expression ')'
;
// 参数表达式列表定义
argumentExpressionList
: assignmentExpression
| argumentExpressionList ',' assignmentExpression
;
|
test/asset/agda-stdlib-1.0/Relation/Binary/Indexed/Homogeneous/Core.agda | omega12345/agda-mode | 0 | 11670 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Homogeneously-indexed binary relations
------------------------------------------------------------------------
-- This file contains some core definitions which are reexported by
-- Relation.Binary.Indexed.Homogeneous
{-# OPTIONS --without-K --safe #-}
module Relation.Binary.Indexed.Homogeneous.Core where
open import Level using (Level; _⊔_)
open import Data.Product using (_×_)
open import Relation.Binary as B using (REL; Rel)
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
import Relation.Binary.Indexed.Heterogeneous as I
open import Relation.Unary.Indexed using (IPred)
------------------------------------------------------------------------
-- Homegeneously indexed binary relations
-- Heterogeneous types
IREL : ∀ {i a b} {I : Set i} → (I → Set a) → (I → Set b) → (ℓ : Level) → Set _
IREL A B ℓ = ∀ {i} → REL (A i) (B i) ℓ
-- Homogeneous types
IRel : ∀ {i a} {I : Set i} → (I → Set a) → (ℓ : Level) → Set _
IRel A = IREL A A
------------------------------------------------------------------------
-- Simple properties
module _ {i a} {I : Set i} (A : I → Set a) where
syntax Implies A _∼₁_ _∼₂_ = _∼₁_ ⇒[ A ] _∼₂_
Implies : ∀ {ℓ₁ ℓ₂} → IRel A ℓ₁ → IRel A ℓ₂ → Set _
Implies _∼₁_ _∼₂_ = ∀ {i} → _∼₁_ B.⇒ (_∼₂_ {i})
Reflexive : ∀ {ℓ} → IRel A ℓ → Set _
Reflexive _∼_ = ∀ {i} → B.Reflexive (_∼_ {i})
Symmetric : ∀ {ℓ} → IRel A ℓ → Set _
Symmetric _∼_ = ∀ {i} → B.Symmetric (_∼_ {i})
Transitive : ∀ {ℓ} → IRel A ℓ → Set _
Transitive _∼_ = ∀ {i} → B.Transitive (_∼_ {i})
Antisymmetric : ∀ {ℓ₁ ℓ₂} → IRel A ℓ₁ → IRel A ℓ₂ → Set _
Antisymmetric _≈_ _∼_ = ∀ {i} → B.Antisymmetric _≈_ (_∼_ {i})
Decidable : ∀ {ℓ} → IRel A ℓ → Set _
Decidable _∼_ = ∀ {i} → B.Decidable (_∼_ {i})
Respects : ∀ {ℓ₁ ℓ₂} → IPred A ℓ₁ → IRel A ℓ₂ → Set _
Respects P _∼_ = ∀ {i} {x y : A i} → x ∼ y → P x → P y
Respectsˡ : ∀ {ℓ₁ ℓ₂} → IRel A ℓ₁ → IRel A ℓ₂ → Set _
Respectsˡ P _∼_ = ∀ {i} {x y z : A i} → x ∼ y → P x z → P y z
Respectsʳ : ∀ {ℓ₁ ℓ₂} → IRel A ℓ₁ → IRel A ℓ₂ → Set _
Respectsʳ P _∼_ = ∀ {i} {x y z : A i} → x ∼ y → P z x → P z y
Respects₂ : ∀ {ℓ₁ ℓ₂} → IRel A ℓ₁ → IRel A ℓ₂ → Set _
Respects₂ P _∼_ = (Respectsʳ P _∼_) × (Respectsˡ P _∼_)
------------------------------------------------------------------------
-- Conversion between homogeneous and heterogeneously indexed relations
module _ {i a b} {I : Set i} {A : I → Set a} {B : I → Set b} where
OverPath : ∀ {ℓ} → IREL A B ℓ → ∀ {i j} → i ≡ j → REL (A i) (B j) ℓ
OverPath _∼_ refl = _∼_
toHetIndexed : ∀ {ℓ} → IREL A B ℓ → I.IREL A B (i ⊔ ℓ)
toHetIndexed _∼_ {i} {j} x y = (p : i ≡ j) → OverPath _∼_ p x y
fromHetIndexed : ∀ {ℓ} → I.IREL A B ℓ → IREL A B ℓ
fromHetIndexed _∼_ = _∼_
------------------------------------------------------------------------
-- Lifting to non-indexed binary relations
module _ {i a} {I : Set i} (A : I → Set a) where
Lift : ∀ {ℓ} → IRel A ℓ → Rel (∀ i → A i) _
Lift _∼_ x y = ∀ i → x i ∼ y i
|
test/Fail/Issue2301.agda | cruhland/agda | 1,989 | 8899 | <filename>test/Fail/Issue2301.agda
-- Andreas, 2016-11-11 issue #2301,
-- reported by stedolan and fredrikNorvallForsberg:
-- compareTelescope ignored relevance.
-- Faulty behavior probably existed since 2011.
module Issue2301 where
data Box (A : Set) : Set where
wrap : A → Box A
weird : ∀ A → .A → Box A
weird A = wrap
-- SHOULD FAIL with error:
-- A → Box A !=< .A → Box A
-- when checking that the expression wrap has type .A → Box A
-- WAS: checked.
-- Since the first argument to wrap is not actually irrelevant,
-- this lets us write a function that discards irrelevance annotations:
make-relevant : ∀ {A} → .A → A
make-relevant a = unwrap (weird a)
where
unwrap : ∀ {A} → Box A → A
unwrap (wrap a) = a
-- or proves things we shouldn't:
data _≡_ {A : Set} (x : A) : A → Set where
refl : x ≡ x
data Bool : Set where
tt ff : Bool
absurd : {X : Set} → X
absurd {X} = different same
where
different : weird tt ≡ weird ff → X
different ()
irr-eq : ∀ {A B : Set} {x y : A} (f : .A → B) → f x ≡ f y
irr-eq f = refl
same : weird tt ≡ weird ff
same = irr-eq weird
|
flash_driver/src/lib/cpu/1967VN0x4/lib/dma_utils.asm | mcjtag/eval-kits | 0 | 241109 |
#include <defts201.h>
.section/charany/doubleany program;
.align 4;
//-------------------------------------------------------//
// DMA pause bits position decode table
// Value returned should be used ORed/AND NOTed with DCNT
//-------------------------------------------------------//
.var _DCNT_BITS_TABLE [] =
{
DCNT_DMA0, // ch #0
DCNT_DMA1, // ch #1
DCNT_DMA2, // ch #2
DCNT_DMA3, // ch #3
DCNT_DMA4, // ch #4
DCNT_DMA5, // ch #5
DCNT_DMA6, // ch #6
DCNT_DMA7, // ch #7
DCNT_DMA8, // ch #8
DCNT_DMA9, // ch #9
DCNT_DMA10, // ch #10
DCNT_DMA11, // ch #11
DCNT_DMA12, // ch #12
DCNT_DMA13 // ch #13
};
//-------------------------------------------------------//
// DMA status decode table
// Value returned should be used with "fext" instruction
//-------------------------------------------------------//
.align 4;
.var _DSTAT_CODE_TABLE [] =
{
// LOW group
DSTATL0, // ch #0
DSTATL1, // ch #1
DSTATL2, // ch #2
DSTATL3, // ch #3
DSTATL4, // ch #4
DSTATL5, // ch #5
DSTATL6, // ch #6
DSTATL7, // ch #7
// High group
DSTATH8, // ch #8
DSTATH9, // ch #9
DSTATH10, // ch #10
DSTATH11, // ch #11
DSTATH12, // ch #12
DSTATH13 // ch #13
};
.align 4;
.var _zero_qw [] =
{
0, 0, 0, 0
};
//-------------------------------------------------------//
// Reading of a DMA channel TCB by index
// Used by DMA chain insertion routine
//-------------------------------------------------------//
.section/charany program;
.align_code 4;
_get_indexed_tcb:
cjmp(abs); j3:0 = DCS0; nop; nop;; // + 0
cjmp(abs); j3:0 = DCS1; nop; nop;; // + 4
cjmp(abs); j3:0 = DCS2; nop; nop;; // + 8
cjmp(abs); j3:0 = DCS3; nop; nop;;
cjmp(abs); j3:0 = DC4; nop; nop;;
cjmp(abs); j3:0 = DC5; nop; nop;;
cjmp(abs); j3:0 = DC6; nop; nop;;
cjmp(abs); j3:0 = DC7; nop; nop;;
cjmp(abs); j3:0 = DC8; nop; nop;;
cjmp(abs); j3:0 = DC9; nop; nop;;
cjmp(abs); j3:0 = DC10; nop; nop;;
cjmp(abs); j3:0 = DC11; nop; nop;;
cjmp(abs); j3:0 = DC12; nop; nop;;
cjmp(abs); j3:0 = DC13; nop; nop;; // + 52
nop; nop; nop; nop;;
nop; nop; nop; nop;;
cjmp(abs); j3:0 = DCD0; nop; nop;; // + 64 (0x40)
cjmp(abs); j3:0 = DCD1; nop; nop;; // + 68
cjmp(abs); j3:0 = DCD2; nop; nop;; // + 72
cjmp(abs); j3:0 = DCD3; nop; nop;; // + 76
//-------------------------------------------------------//
// Writing of a DMA channel TCB by index
// Used by DMA chain insertion routine
//-------------------------------------------------------//
.section/charany program;
.align_code 4;
_set_indexed_tcb:
cjmp(abs); DCS0 = j3:0; nop; nop;; // + 0
cjmp(abs); DCS1 = j3:0; nop; nop;; // + 4
cjmp(abs); DCS2 = j3:0; nop; nop;; // + 8
cjmp(abs); DCS3 = j3:0; nop; nop;;
cjmp(abs); DC4 = j3:0; nop; nop;;
cjmp(abs); DC5 = j3:0; nop; nop;;
cjmp(abs); DC6 = j3:0; nop; nop;;
cjmp(abs); DC7 = j3:0; nop; nop;;
cjmp(abs); DC8 = j3:0; nop; nop;;
cjmp(abs); DC9 = j3:0; nop; nop;;
cjmp(abs); DC10 = j3:0; nop; nop;;
cjmp(abs); DC11 = j3:0; nop; nop;;
cjmp(abs); DC12 = j3:0; nop; nop;;
cjmp(abs); DC13 = j3:0; nop; nop;; // + 52
nop; nop; nop; nop;;
nop; nop; nop; nop;;
cjmp(abs); DCD0 = j3:0; nop; nop;; // + 64 (0x40)
cjmp(abs); DCD1 = j3:0; nop; nop;; // + 68
cjmp(abs); DCD2 = j3:0; nop; nop;;
cjmp(abs); DCD3 = j3:0; nop; nop;;
//-------------------------------------------------------//
// Reading DMA channel status
//
// Arguments:
// j4 - channel number
// Outputs:
// j8 <- value
// Scratch:
// xr3:0, jstat
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_GetChannelStatus;
.align_code 4;
_DMA_GetChannelStatus:
comp(j4, 7)(U); xr1:0 = DSTAT;;
if njle; do, xr0 = xr1; xr2 = [j4 + _DSTAT_CODE_TABLE];;
xr3 = fext r0 by r2 (nf);;
cjmp (abs); j8 = xr3;;
_DMA_GetChannelStatus.end:
//-------------------------------------------------------//
// Reading DMA channel status with clear
//
// Arguments:
// j4 - channel number
// Outputs:
// j8 <- value
// Scratch:
// xr3:0, jstat
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_GetChannelStatusClear;
.align_code 4;
_DMA_GetChannelStatusClear:
comp(j4, 7)(U); xr1:0 = DSTATC;;
if njle; do, xr0 = xr1; xr2 = [j4 + _DSTAT_CODE_TABLE];;
xr3 = fext r0 by r2 (nf);;
cjmp (abs); j8 = xr3;;
_DMA_GetChannelStatusClear.end:
//-------------------------------------------------------//
// Check DMA channel status
//
// Arguments:
// j4 - channel number
// j5 - value to compare with
// Outputs:
// j8 <- 0 if channel status is equal to j5
// 1 if not equal
// Scratch:
// xr3:0, xr4, jstat
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_CheckChannelStatus;
.align_code 4;
_DMA_CheckChannelStatus:
call _DMA_GetChannelStatus; xr4 = cjmp;;
comp(j8, j5); j8 = 0x00;;
if njeq; do, j8 = 0x01; cjmp = xr4;;
cjmp(abs)(np); nop; nop; nop;;
_DMA_CheckChannelStatus.end:
//-------------------------------------------------------//
// Wait for the channel to complete -
// status is different from ACTIVE
//
// Arguments:
// j4 - channel number
//
// Outputs:
// j8 <- channel status
// Scratch:
// xr3:0, xr4, jstat
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_WaitForChannel;
.align_code 4;
_DMA_WaitForChannel:
xr4 = cjmp;;
_DMA_WaitForChannel_loop:
call _DMA_GetChannelStatus;;
comp(j8, DSTAT_ACT);;
nop;;
nop;;
if jeq, jump _DMA_WaitForChannel_loop; else, cjmp = xr4;;
cjmp(abs)(np);;
_DMA_WaitForChannel.end:
//-------------------------------------------------------//
// Wait for the channel to complete with allowed timeout -
// status is different from ACTIVE
//
// Arguments:
// j4 - channel number
// j5 - timeout (core cycles)
// Outputs:
// j8 <- channel status
// Scratch:
// xr3:0, yr3:0, xr4, jstat,
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_WaitForChannelTimed;
.align_code 4;
_DMA_WaitForChannelTimed:
yr0 = CCNT0; yr2 = j5;;
yr1 = CCNT1; yr3 = 0;;
ylr3:2 = r1:0 + r3:2; xr4 = cjmp;;
_DMA_WaitForChannelTimed_loop:
call _DMA_GetChannelStatus;;
comp(j8, DSTAT_ACT); cjmp = xr4;;
yr0 = CCNT0;;
yr1 = CCNT1;;
if njeq, cjmp(abs)(np);; // channel is done
// Check timeout
ylr1:0 = r1:0 - r3:2;;
if yalt, jump _DMA_WaitForChannelTimed_loop;;
cjmp(abs)(np);; // timeout
_DMA_WaitForChannelTimed.end:
//-------------------------------------------------------//
// Write quadword from memory to DMA control regs
//
// Arguments:
// j4 - channel number (4 to 13)
// j5 - pointer to qw (must be 4-aligned!)
// Outputs:
// none
// Scratch:
// xr3:0, jstat, j7:6
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_WriteDC;
.align_code 4;
_DMA_WriteDC:
xr3:0 = Q[j5 + 0x00];;
comp(j4, 3)(U);;
if jle, cjmp(abs)(np); comp(j4, 13)(U);;
if njle, cjmp(abs)(np); j6 = rotl j4(nf);;
j6 = rotl j6; j7 = cjmp;;
j6 = j6 + _DMA_WriteDC_Tbl - (4*4)(cjmp)(nf);;
cjmp(abs); cjmp = j7;;
.align_code 4;
_DMA_WriteDC_Tbl:
cjmp(abs); DC4 = xr3:0; nop; nop;;
cjmp(abs); DC5 = xr3:0; nop; nop;;
cjmp(abs); DC6 = xr3:0; nop; nop;;
cjmp(abs); DC7 = xr3:0; nop; nop;;
cjmp(abs); DC8 = xr3:0; nop; nop;;
cjmp(abs); DC9 = xr3:0; nop; nop;;
cjmp(abs); DC10 = xr3:0; nop; nop;;
cjmp(abs); DC11 = xr3:0; nop; nop;;
cjmp(abs); DC12 = xr3:0; nop; nop;;
cjmp(abs); DC13 = xr3:0; nop; nop;;
_DMA_WriteDC.end:
//-------------------------------------------------------//
// Write quadword from memory to DMA control regs (DCS)
//
// Arguments:
// j4 - channel number (0 to 3)
// j5 - pointer to qw (must be 4-aligned!)
// Outputs:
// none
// Scratch:
// xr3:0, jstat, j7:6
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_WriteDCS;
.align_code 4;
_DMA_WriteDCS:
xr3:0 = Q[j5 + 0x00];;
comp(j4, 3)(U);;
if njle, cjmp(abs)(np); j6 = rotl j4(nf);;
j6 = rotl j6; j7 = cjmp;;
j6 = j6 + _DMA_WriteDCS_Tbl(cjmp)(nf);;
cjmp(abs); cjmp = j7;;
.align_code 4;
_DMA_WriteDCS_Tbl:
cjmp(abs); DCS0 = xr3:0; nop; nop;;
cjmp(abs); DCS1 = xr3:0; nop; nop;;
cjmp(abs); DCS2 = xr3:0; nop; nop;;
cjmp(abs); DCS3 = xr3:0; nop; nop;;
_DMA_WriteDCS.end:
//-------------------------------------------------------//
// Write quadword from memory to DMA control regs (DCD)
//
// Arguments:
// j4 - channel number (0 to 3)
// j5 - pointer to qw (must be 4-aligned!)
// Outputs:
// none
// Scratch:
// xr3:0, jstat, j7:6
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_WriteDCD;
.align_code 4;
_DMA_WriteDCD:
xr3:0 = Q[j5 + 0x00];;
comp(j4, 3)(U);;
if njle, cjmp(abs)(np); j6 = rotl j4(nf);;
j6 = rotl j6; j7 = cjmp;;
j31 = j6 + _DMA_WriteDCD_Tbl(cjmp)(nf);;
cjmp(abs); cjmp = j7;;
.align_code 4;
_DMA_WriteDCD_Tbl:
cjmp(abs); DCD0 = xr3:0; nop; nop;;
cjmp(abs); DCD1 = xr3:0; nop; nop;;
cjmp(abs); DCD2 = xr3:0; nop; nop;;
cjmp(abs); DCD3 = xr3:0; nop; nop;;
_DMA_WriteDCD.end:
//-------------------------------------------------------//
// Stop DMA channel
//
// Arguments:
// j4 - channel number
// Outputs:
// none
// Scratch:
// xr3:0, jstat, j7:6, j8
//-------------------------------------------------------//
.section/charany/doubleany program;
.global _DMA_Stop;
.align_code 4;
_DMA_Stop:
comp(j4, 3)(U); j8 = cjmp;;
if njle, jump _DMA_Stop_SingleDC(np); j5 = _zero_qw;;
call _DMA_WriteDCS; nop; nop; nop;;
call _DMA_WriteDCD; nop; nop; nop;;
cjmp = j8;;
cjmp(abs); nop; nop; nop;;
_DMA_Stop_SingleDC:
call _DMA_WriteDC; nop; nop; nop;;
cjmp = j8;;
cjmp(abs); nop; nop; nop;;
_DMA_Stop.end:
//-------------------------------------------------------//
// Pause single DMA channel
// Not interrupt-safe!
//
// Arguments:
// j4 - selected DMA channel, 0 to 13
// Outputs:
// j8: <- 0 if channel was not paused
// <- 1 if channel was paused already
// Scratch:
// xr1:0, yr1:0, xstat, ystat
//-------------------------------------------------------//
.section/charany program;
.global _DMA_PauseChannel;
.align_code 4;
_DMA_PauseChannel:
r0 = DCNT; r1 = [j4 + address(_DCNT_BITS_TABLE)];;
xr0 = r0 or r1; yr0 = r0 and r1; j8 = 0x00;;
if nyaeq; do, j8 = j8 + 0x01 (nf); DCNT = xr0;;
cjmp(abs); nop; nop; nop;;
_DMA_PauseChannel.end:
//-------------------------------------------------------//
// Unpause single DMA channel
// Not interrupt-safe!
//
// Arguments:
// j4 - selected DMA channel, 0 to 13
// Outputs:
// j8: <- 0 if channel was paused
// <- 1 if channel was not paused
// Scratch:
// xr1:0, yr1:0, xstat, ystat
//-------------------------------------------------------//
.section/charany program;
.global _DMA_UnpauseChannel;
.align_code 4;
_DMA_UnpauseChannel:
r0 = DCNT; r1 = [j4 + address(_DCNT_BITS_TABLE)];;
xr0 = r0 and not r1; yr0 = r0 and r1; j8 = 0x00;;
if yaeq; do, j8 = j8 + 0x01 (nf); DCNT = xr0;;
cjmp(abs); nop; nop; nop;;
_DMA_UnpauseChannel.end:
//-------------------------------------------------------//
// Pause multiple DMA channels
// Not interrupt-safe!
//
// Arguments:
// j4 - selected DMA channels, ORed DCNT_DMA0 to DCNT_DMA13 (see defts201.h)
// Outputs:
// none
// Scratch:
// j5
//-------------------------------------------------------//
.section/charany program;
.global _DMA_PauseMultipleChannels;
.align_code 4;
_DMA_PauseMultipleChannels:
j5 = DCNT;;
j5 = j5 or j4;;
cjmp(abs); DCNT = j5; nop; nop;;
_DMA_PauseMultipleChannels.end:
//-------------------------------------------------------//
// Unpause multiple DMA channels
// Not interrupt-safe!
//
// Arguments:
// j4 - selected DMA channels, ORed DCNT_DMA0 to DCNT_DMA13 (see defts201.h)
// Outputs:
// none
// Scratch:
// j5
//-------------------------------------------------------//
.section/charany program;
.global _DMA_UnpauseMultipleChannels;
.align_code 4;
_DMA_UnpauseMultipleChannels:
j5 = DCNT;;
j5 = j5 and not j4;;
cjmp(abs); DCNT = j5; nop; nop;;
_DMA_UnpauseMultipleChannels.end:
//-------------------------------------------------------//
// Optimized chain insertion routine
// Parameters:
// j4 - Channel number, 0 to 13 (bits 3:0),
// bit 4 selects whether DCS (0) or DCD (1) will be updated
// in case of channels 0-3 modifying
// j5 - Address of the first TCB in the chain being inserted
// j6 - Address of the last TCB in the chain being inserted
// j7 - Chaining destination channel (for LINK TX 0-3 or RX 0-3)
// as defined in <defts201.h>
// Outputs:
// j8: 0 <- arguments correct, operation was performed
// 1 <- TY field of the modified channel TCB is equal to 0
// 2 <- arguments are not correct
// Algorithm:
// 1. Check TY field. If TY = 0, chain insertion may not be performed. Exit with error code 1.
// 2. Replace CHTG field of current TCB with input argument value,
// CHPT field - with address of first TCB in the inserted chain
// and enable chaining.
// 3. If current DMA channel TCB has chaining enabled, set CHTG and CHPT fileds of the
// last TCB in the inserted chain to those from current DMA channel TCB and
// enable chaining. Disable chaining in this TCB otherwise.
// 4. Write back last TCB in the inserted chain and the modified TCB into DMA channel
// Scratch:
// j3:2,j10,j9:8,k7:0, kstat, jstat
//-------------------------------------------------------//
.section/charany program;
.global _DMA_ChainInsert;
.align_code 4;
_DMA_ChainInsert:
comp(j4,0x13)(U); k4 = j4;;
if njle, cjmp(abs)(np); j8 = 0x02; k4 = rotl k4;;
j9 = cjmp; k4 = rotl k4;;
j10 = j5; k5 = k4 + address(_get_indexed_tcb);;
j10 = lshiftr j10; cjmp = k5;;
cjmp_call(abs); j10 = lshiftr j10; k7:6 = j1:0;;
//--------- Check TY field ---------//
j31 = j3 and 0xE0000000; k5 = j6;;
if jeq, jump _dcio_ret(np); j8 = 0x01; j10 = j10 or j7;;
//------- Modify current TCB --------//
j8 = j3 and 0x00380000 | 0x0007FFFF | 0x00400000; k3:0 = Q[k5+0x00];; // load last TCB
j10 = j10 or 0x00400000; k5 = j8;; // enable chaining
j3 = j3 and not 0x00380000 | 0x0007FFFF | 0x00400000; j8 = k4;;
j3 = j3 or j10; k3 = k3 and not 0x00380000 | 0x0007FFFF | 0x00400000;;
//--- Modify last TCB in the chain ---//
j8 = j8 + address(_set_indexed_tcb); k3 = k3 or k5;;
// Save modified last chain TCB
cjmp = j8; Q[j6+0x00] = k3:0;;
// Write modified TCB back into the DMA channel and return
cjmp_call(abs); j8 = j8 xor j8; nop;;
_dcio_ret:
cjmp = j9;;
cjmp(abs); j1:0 = k7:6; nop; nop;;
_DMA_ChainInsert.end:
|
uti/mkl2st.asm | olifink/smsqe | 0 | 18741 | <gh_stars>0
; Make a list out of a string array
section utility
xdef ut_mkl2st
include dev8_keys_err
include dev8_keys_bv
xref gu_mklis
;+++
; Make a list out of a string array passed in the standard parameter form.
; This routine checks for the -ve SuperBASIC flag. The array has to be in
; a 2-dimensional form.
;
; Entry Exit
; D1.w number of entries
; A1 ptr to parameter entry ptr to list or 0
;
; Error returns: ipar not 2-dimensional
;---
ut_mkl2st
movem.l d2-d3/a0/a2-a3/a5,-(sp)
moveq #err.ipar,d0 ; maybe wrong nr of dimensions
move.l 4(a1),a2 ; pointer to array descriptor
move.w 2(a1),d1 ; -ve if SuperBASIC
bge.s mk2s_nobas
move.l bv_vvbas(a6),a3 ; variable table
add.l a2,a3
cmp.w #2,4(a6,a3.l) ; two dimensions?
bne.s mk2s_ret
moveq #7,d0
add.w 10(a6,a3.l),d0 ; item length
bclr #0,d0 ; make even
lea mk_2dsbas,a0 ; entry generating code
move.l (a6,a3.l),a2 ; pointer to array contents
add.l bv_vvbas(a6),a2 ; now relative
bsr gu_mklis ; create list
bra.s mk2s_ret
mk2s_nobas
cmp.w #2,4(a2) ; two dimensions?
bne.s mk2s_ret
moveq #7,d0
add.w 10(a2),d0 ; item length
bclr #0,d0 ; make even
lea mk_2dsjob,a0 ; create list
move.l (a2),a3 ; pointer to entry table
tst.w d1 ; absolute pointer?
beq.s nobas_abs
nobas_rel
add.l a2,a3 ; make relative pointer absolute
nobas_abs
bsr gu_mklis
mk2s_ret
movem.l (sp)+,d2-d3/a0/a2-a3/a5
rts
;+++
; Entry Exit
; d3 entry number preserved
; a1 entry preserved
; a2 contents (a6)
; a3 descriptor (a6)
;---
mk_2dsbas
movem.l a1-a3,-(sp)
cmp.w 6(a6,a3.l),d3 ; out of range?
bhi.s bas_eof
moveq #0,d0
move.w d3,d1
mulu 8(a6,a3.l),d1 ; index right item
lea 4(a1),a1 ; base of item in table
add.l d1,a2 ; point to item
move.w (a6,a2.l),d1 ; string length
addq.l #2,a2
move.w d1,(a1)+ ; set length
bas_loop
beq.s bas_ret ; string set complete
move.b (a6,a2.l),(a1)+
addq.l #1,a2 ; copy whole string
subq.w #1,d1 ; count down
bra.s bas_loop
bas_eof
moveq #err.eof,d0
bas_ret
movem.l (sp)+,a1-a3
rts
;+++
; Entry Exit
; d3 entry number preserved
; a1 entry preserved
; a2 descriptor
; a3 contents
;---
mk_2dsjob
movem.l a1-a3,-(sp)
cmp.w 6(a2),d3 ; out of range?
bhi.s bas_eof
moveq #0,d0
move.w d3,d1
mulu 8(a2),d1 ; index right item
lea 4(a1),a1 ; base of item in entry
add.l d1,a3 ; item in array
move.w (a3)+,d1 ; string length
move.w d1,(a1)+ ; set length
job_loop
beq.s bas_ret ; all set
move.b (a3)+,(a1)+ ; copy character
subq.w #1,d1 ; count down
bra.s job_loop
end
|
oeis/067/A067626.asm | neoneye/loda-programs | 11 | 172391 | ; A067626: a(n) = 2^(2n+1)*(2n+1)!.
; 2,48,3840,645120,185794560,81749606400,51011754393600,42849873690624000,46620662575398912000,63777066403145711616000,107145471557284795514880000,216862434431944426122117120000,520469842636666622693081088000000,1461479318123759876522171695104000000,4746884825265972078944013665697792000000,17658411549989416133671730836395786240000000,74589130387155293748629391052935801077760000000,355044260642859198243475901411974413130137600000000,1891675820705153808241239602722999673157373132800000000
mul $0,2
mov $1,2
mov $2,2
lpb $0
sub $0,1
add $2,2
mul $1,$2
lpe
mov $0,$1
|
scripts/SSAnne3F.asm | AmateurPanda92/pokemon-rby-dx | 9 | 172195 | <reponame>AmateurPanda92/pokemon-rby-dx
SSAnne3F_Script:
jp EnableAutoTextBoxDrawing
SSAnne3F_TextPointers:
dw SSAnne3Text1
SSAnne3Text1:
TX_FAR _SSAnne3Text1
db "@"
|
programs/oeis/277/A277822.asm | karttu/loda | 0 | 83890 | <reponame>karttu/loda<gh_stars>0
; A277822: a(n) = index of the column where n is located in array A277880.
; 0,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,6,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,6,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,7,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,6,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,7,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,8,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,1,2,3,1,4,1,1,2,5,1,1,2,1,2,3,1,6,1,1,2,1,2,3,1,1,2
lpb $0,1
add $1,7
cal $0,102391 ; Evil numbers in evil places.
div $0,2
sub $1,1
lpe
div $1,6
|
tools-src/gnu/gcc/gcc/ada/prj-strt.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 8420 | <filename>tools-src/gnu/gcc/gcc/ada/prj-strt.ads
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . S T R T --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
--
-- This package implements parsing of string expressions in project files.
with Prj.Tree; use Prj.Tree;
private package Prj.Strt is
procedure Parse_String_Type_List (First_String : out Project_Node_Id);
-- Get the list of literal strings that are allowed for a typed string.
-- On entry, the current token is the first literal string following
-- a left parenthesis in a string type declaration such as:
-- type Toto is ("string_1", "string_2", "string_3");
-- On exit, the current token is the right parenthesis.
-- The parameter First_String is a node that contained the first
-- literal string of the string type, linked with the following
-- literal strings.
--
-- Report an error if
-- - a literal string is not found at the beginning of the list
-- or after a comma
-- - two literal strings in the list are equal
procedure Start_New_Case_Construction (String_Type : Project_Node_Id);
-- This procedure is called at the beginning of a case construction
-- The parameter String_Type is the node for the string type
-- of the case label variable.
-- The different literal strings of the string type are stored
-- into a table to be checked against the case labels of the
-- case construction.
procedure End_Case_Construction;
-- This procedure is called at the end of a case construction
-- to remove the case labels and to restore the previous state.
-- In particular, in the case of nested case constructions,
-- the case labels of the enclosing case construction are restored.
procedure Parse_Choice_List
(First_Choice : out Project_Node_Id);
-- Get the label for a choice list.
-- Report an error if
-- - a case label is not a literal string
-- - a case label is not in the typed string list
-- - the same case label is repeated in the same case construction
procedure Parse_Expression
(Expression : out Project_Node_Id;
Current_Project : Project_Node_Id;
Current_Package : Project_Node_Id);
-- Parse a simple string expression or a string list expression.
-- Current_Project is the node of the project file being parsed.
-- Current_Package is the node of the package being parsed,
-- or Empty_Node when we are at the project level (not in a package).
-- On exit, Expression is the node of the expression that has
-- been parsed.
procedure Parse_Variable_Reference
(Variable : out Project_Node_Id;
Current_Project : Project_Node_Id;
Current_Package : Project_Node_Id);
-- Parse a variable or attribute reference.
-- Used internally (in expressions) and for case variables (in Prj.Dect).
-- Current_Package is the node of the package being parsed,
-- or Empty_Node when we are at the project level (not in a package).
-- On exit, Variable is the node of the variable or attribute reference.
-- A variable reference is made of one to three simple names.
-- An attribute reference is made of one or two simple names,
-- followed by an apostroph, followed by the attribute simple name.
end Prj.Strt;
|
eBindings/dl/tests/dl-test_basics.ads | persan/zeromq-Ada | 33 | 5238 | <reponame>persan/zeromq-Ada<gh_stars>10-100
with AUnit;
with AUnit.Test_Cases;
package Dl.Test_Basics is
type Test_Case is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Test_Case);
-- Register routines to be run
function Name (T : Test_Case)
return Aunit.Message_String;
-- Returns name identifying the test case
end Dl.Test_Basics; |
oeis/337/A337729.asm | neoneye/loda-programs | 11 | 172965 | <reponame>neoneye/loda-programs<filename>oeis/337/A337729.asm
; A337729: a(n) = (4*n+2)! * Sum_{k=0..n} 1 / (4*k+2)!.
; Submitted by <NAME>
; 1,361,1819441,43710250585,3210080802962401,563561785768079119561,202205968733586788098486801,132994909755454702268136738753721,148026526435655214537290625514621562305,262237873172349351865682580536682974917045801,704454843460345510903820429747302209179158476142321
mul $0,4
add $0,2
seq $0,330045 ; Expansion of e.g.f. exp(x) / (1 - x^4).
|
oeis/071/A071649.asm | neoneye/loda-programs | 11 | 102328 | ; A071649: Sum of odd decimal digits of n.
; Submitted by <NAME>(s4)
; 1,0,3,0,5,0,7,0,9,1,2,1,4,1,6,1,8,1,10,0,1,0,3,0,5,0,7,0,9,3,4,3,6,3,8,3,10,3,12,0,1,0,3,0,5,0,7,0,9,5,6,5,8,5,10,5,12,5,14,0,1,0,3,0,5,0,7,0,9,7,8,7,10,7,12,7,14,7,16,0,1,0,3,0,5,0,7,0,9,9,10,9
add $0,1
lpb $0
mov $2,$0
div $0,10
mod $2,10
mov $3,$2
mod $3,2
mul $2,$3
add $1,$2
lpe
mov $0,$1
|
alloy4fun_models/trashltl/models/17/rpKs8EuHfzHiQXae5.als | Kaixi26/org.alloytools.alloy | 0 | 129 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idrpKs8EuHfzHiQXae5_prop18 {
always ( all f : File |
(once f in Protected) and f not in Protected implies (
once f in Trash
)
)
}
pred __repair { idrpKs8EuHfzHiQXae5_prop18 }
check __repair { idrpKs8EuHfzHiQXae5_prop18 <=> prop18o } |
samples/nes/tilemap_render/bidir_scroll_MMC1_vert_mirr/data/tilemap.asm | 0x8BitDev/MAPeD-SPReD | 23 | 27464 | <gh_stars>10-100
;#######################################################
;
; Generated by MAPeD-NES Copyright 2017-2020 0x8BitDev
;
;#######################################################
; export options:
; - tiles 4x4/(columns)
; - attributes per block
; - properties per block
; - mode: bidirectional scrolling
; - layout: adjacent screens (no marks)
; - no entities
MAP_DATA_MAGIC = $2884A
; data flags:
MAP_FLAG_TILES2X2 = $01
MAP_FLAG_TILES4X4 = $02
MAP_FLAG_RLE = $04
MAP_FLAG_DIR_COLUMNS = $08
MAP_FLAG_DIR_ROWS = $10
MAP_FLAG_MODE_MULTIDIR_SCROLL = $20
MAP_FLAG_MODE_BIDIR_SCROLL = $40
MAP_FLAG_MODE_STATIC_SCREENS = $80
MAP_FLAG_ENTITIES = $100
MAP_FLAG_ENTITY_SCREEN_COORDS = $200
MAP_FLAG_ENTITY_MAP_COORS = $400
MAP_FLAG_LAYOUT_ADJACENT_SCREENS = $800
MAP_FLAG_LAYOUT_ADJACENT_SCR_INDS = $1000
MAP_FLAG_LAYOUT_MATRIX = $2000
MAP_FLAG_MARKS = $4000
MAP_FLAG_ATTRS_PER_BLOCK = $8000
MAP_FLAG_ATTRS_PER_CHR = $10000
MAP_FLAG_PROP_ID_PER_BLOCK = $20000
MAP_FLAG_PROP_ID_PER_CHR = $40000
; *** GLOBAL DATA ***
; chr0: .incbin "tilemap_chr0.bin" ; (4048)
tilemap_Blocks: .incbin "tilemap_Blocks.bin" ; (484) blocks array of all exported data banks ( 4 bytes per block )
tilemap_Props: .incbin "tilemap_Props.bin" ; (121) block properties array of all exported data banks ( 1 byte per block; data offset = props offset / 4 )
tilemap_BlocksPropsOffs:
.word 0 ; (chr0)
tilemap_Tiles: .incbin "tilemap_Tiles.bin" ; (940) tiles (4x4) array of all exported data banks ( 4 bytes per tile )
tilemap_TilesOffs:
.word 0 ; (chr0)
tilemap_Attrs: .incbin "tilemap_Attrs.bin" ; (235) attributes array of all exported data banks ( 1 byte per attribute ), data offset = tiles offset / 4
tilemap_TilesScr: .incbin "tilemap_TilesScr.bin" ; (1472) tiles (4x4) array for each screen ( 64 bytes per screen \ 1 byte per tile )
tilemap_Plts: .incbin "tilemap_Plts.bin" ; (16) palettes array of all exported data banks ( data offset = chr_id * 16 )
; *** Lev0 ***
Lev0_StartScr: .word Lev0Scr48
Lev0Scr12:
.byte 0 ; chr_id
.byte 0 ; screen index
.word 0 ; left adjacent screen
.word 0 ; up adjacent screen
.word Lev0Scr13 ; right adjacent screen
.word Lev0Scr28 ; down adjacent screen
Lev0Scr13:
.byte 0
.byte 1
.word Lev0Scr12
.word 0
.word Lev0Scr14
.word 0
Lev0Scr14:
.byte 0
.byte 2
.word Lev0Scr13
.word 0
.word Lev0Scr15
.word 0
Lev0Scr15:
.byte 0
.byte 3
.word Lev0Scr14
.word 0
.word 0
.word 0
Lev0Scr21:
.byte 0
.byte 4
.word 0
.word 0
.word Lev0Scr22
.word Lev0Scr37
Lev0Scr22:
.byte 0
.byte 5
.word Lev0Scr21
.word 0
.word Lev0Scr23
.word 0
Lev0Scr23:
.byte 0
.byte 6
.word Lev0Scr22
.word 0
.word Lev0Scr24
.word 0
Lev0Scr24:
.byte 0
.byte 7
.word Lev0Scr23
.word 0
.word Lev0Scr25
.word 0
Lev0Scr25:
.byte 0
.byte 8
.word Lev0Scr24
.word 0
.word Lev0Scr26
.word 0
Lev0Scr26:
.byte 0
.byte 9
.word Lev0Scr25
.word 0
.word 0
.word Lev0Scr42
Lev0Scr28:
.byte 0
.byte 10
.word 0
.word Lev0Scr12
.word 0
.word Lev0Scr44
Lev0Scr37:
.byte 0
.byte 11
.word 0
.word Lev0Scr21
.word 0
.word Lev0Scr53
Lev0Scr42:
.byte 0
.byte 12
.word 0
.word Lev0Scr26
.word 0
.word Lev0Scr58
Lev0Scr44:
.byte 0
.byte 13
.word 0
.word Lev0Scr28
.word 0
.word Lev0Scr60
Lev0Scr48:
.byte 0
.byte 14
.word 0
.word 0
.word Lev0Scr49
.word 0
Lev0Scr49:
.byte 0
.byte 15
.word Lev0Scr48
.word 0
.word Lev0Scr50
.word 0
Lev0Scr50:
.byte 0
.byte 16
.word Lev0Scr49
.word 0
.word Lev0Scr51
.word 0
Lev0Scr51:
.byte 0
.byte 17
.word Lev0Scr50
.word 0
.word Lev0Scr52
.word 0
Lev0Scr52:
.byte 0
.byte 18
.word Lev0Scr51
.word 0
.word Lev0Scr53
.word 0
Lev0Scr53:
.byte 0
.byte 19
.word Lev0Scr52
.word Lev0Scr37
.word 0
.word 0
Lev0Scr58:
.byte 0
.byte 20
.word 0
.word Lev0Scr42
.word Lev0Scr59
.word 0
Lev0Scr59:
.byte 0
.byte 21
.word Lev0Scr58
.word 0
.word Lev0Scr60
.word 0
Lev0Scr60:
.byte 0
.byte 22
.word Lev0Scr59
.word Lev0Scr44
.word 0
.word 0
|
Util/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads | ianloic/unladen-swallow | 5 | 19031 | -- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_execution_Engine.Binding is
procedure LLVMLinkInJIT;
procedure LLVMLinkInInterpreter;
function LLVMCreateGenericValueOfInt
(Ty : in llvm.LLVMTypeRef;
N : in Interfaces.C.Extensions.unsigned_long_long;
IsSigned : in Interfaces.C.int)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMCreateGenericValueOfPointer
(P : access Interfaces.C.Extensions.void)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMCreateGenericValueOfFloat
(Ty : in llvm.LLVMTypeRef;
N : in Interfaces.C.double)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMGenericValueIntWidth
(GenValRef : in LLVM_execution_Engine.LLVMGenericValueRef)
return Interfaces.C.unsigned;
function LLVMGenericValueToInt
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef;
IsSigned : in Interfaces.C.int)
return Interfaces.C.Extensions.unsigned_long_long;
function LLVMGenericValueToPointer
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef)
return access Interfaces.C.Extensions.void;
function LLVMGenericValueToFloat
(TyRef : in llvm.LLVMTypeRef;
GenVal : in LLVM_execution_Engine.LLVMGenericValueRef)
return Interfaces.C.double;
procedure LLVMDisposeGenericValue
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef);
function LLVMCreateExecutionEngine
(OutEE : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMCreateInterpreter
(OutInterp : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMCreateJITCompiler
(OutJIT : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OptLevel : in Interfaces.C.unsigned;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
procedure LLVMDisposeExecutionEngine
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
procedure LLVMRunStaticConstructors
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
procedure LLVMRunStaticDestructors
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
function LLVMRunFunctionAsMain
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef;
ArgC : in Interfaces.C.unsigned;
ArgV : access Interfaces.C.Strings.chars_ptr;
EnvP : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMRunFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef;
NumArgs : in Interfaces.C.unsigned;
Args : access LLVM_execution_Engine.LLVMGenericValueRef)
return LLVM_execution_Engine.LLVMGenericValueRef;
procedure LLVMFreeMachineCodeForFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef);
procedure LLVMAddModuleProvider
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef);
function LLVMRemoveModuleProvider
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutMod : access llvm.LLVMModuleRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMFindFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Name : in Interfaces.C.Strings.chars_ptr;
OutFn : access llvm.LLVMValueRef)
return Interfaces.C.int;
function LLVMGetExecutionEngineTargetData
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef)
return LLVM_execution_Engine.LLVMTargetDataRef;
procedure LLVMAddGlobalMapping
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Global : in llvm.LLVMValueRef;
Addr : access Interfaces.C.Extensions.void);
function LLVMGetPointerToGlobal
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Global : in llvm.LLVMValueRef)
return access Interfaces.C.Extensions.void;
private
pragma Import (C, LLVMLinkInJIT, "Ada_LLVMLinkInJIT");
pragma Import (C, LLVMLinkInInterpreter, "Ada_LLVMLinkInInterpreter");
pragma Import
(C,
LLVMCreateGenericValueOfInt,
"Ada_LLVMCreateGenericValueOfInt");
pragma Import
(C,
LLVMCreateGenericValueOfPointer,
"Ada_LLVMCreateGenericValueOfPointer");
pragma Import
(C,
LLVMCreateGenericValueOfFloat,
"Ada_LLVMCreateGenericValueOfFloat");
pragma Import
(C,
LLVMGenericValueIntWidth,
"Ada_LLVMGenericValueIntWidth");
pragma Import (C, LLVMGenericValueToInt, "Ada_LLVMGenericValueToInt");
pragma Import
(C,
LLVMGenericValueToPointer,
"Ada_LLVMGenericValueToPointer");
pragma Import (C, LLVMGenericValueToFloat, "Ada_LLVMGenericValueToFloat");
pragma Import (C, LLVMDisposeGenericValue, "Ada_LLVMDisposeGenericValue");
pragma Import
(C,
LLVMCreateExecutionEngine,
"Ada_LLVMCreateExecutionEngine");
pragma Import (C, LLVMCreateInterpreter, "Ada_LLVMCreateInterpreter");
pragma Import (C, LLVMCreateJITCompiler, "Ada_LLVMCreateJITCompiler");
pragma Import
(C,
LLVMDisposeExecutionEngine,
"Ada_LLVMDisposeExecutionEngine");
pragma Import
(C,
LLVMRunStaticConstructors,
"Ada_LLVMRunStaticConstructors");
pragma Import
(C,
LLVMRunStaticDestructors,
"Ada_LLVMRunStaticDestructors");
pragma Import (C, LLVMRunFunctionAsMain, "Ada_LLVMRunFunctionAsMain");
pragma Import (C, LLVMRunFunction, "Ada_LLVMRunFunction");
pragma Import
(C,
LLVMFreeMachineCodeForFunction,
"Ada_LLVMFreeMachineCodeForFunction");
pragma Import (C, LLVMAddModuleProvider, "Ada_LLVMAddModuleProvider");
pragma Import
(C,
LLVMRemoveModuleProvider,
"Ada_LLVMRemoveModuleProvider");
pragma Import (C, LLVMFindFunction, "Ada_LLVMFindFunction");
pragma Import
(C,
LLVMGetExecutionEngineTargetData,
"Ada_LLVMGetExecutionEngineTargetData");
pragma Import (C, LLVMAddGlobalMapping, "Ada_LLVMAddGlobalMapping");
pragma Import (C, LLVMGetPointerToGlobal, "Ada_LLVMGetPointerToGlobal");
end LLVM_execution_Engine.Binding;
|
ugbc/src/hw/zx/put_image.asm | Samuel-DEVULDER/ugbasic | 0 | 95314 | ; /*****************************************************************************
; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
; *****************************************************************************
; * Copyright 2021 <NAME> (<EMAIL>)
; *
; * Licensed under the Apache License, Version 2.0 (the "License");
; * you may not use this file except in compliance with the License.
; * You may obtain a copy of the License at
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS,
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; * See the License for the specific language governing permissions and
; * limitations under the License.
; *----------------------------------------------------------------------------
; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
; * (la "Licenza"); è proibito usare questo file se non in conformità alla
; * Licenza. Una copia della Licenza è disponibile all'indirizzo:
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Se non richiesto dalla legislazione vigente o concordato per iscritto,
; * il software distribuito nei termini della Licenza è distribuito
; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
; * implicite. Consultare la Licenza per il testo specifico che regola le
; * autorizzazioni e le limitazioni previste dalla medesima.
; ****************************************************************************/
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* IMAGES ROUTINE FOR ZX SPECTRUM *
;* *
;* by <NAME> *
;* *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMAGEX: DB 0
IMAGEY: DB 0
IMAGEW: DB 0
IMAGEH: DB 0
IMAGEH2: DB 0
; ----------------------------------------------------------------------------
; - Put image on bitmap
; ----------------------------------------------------------------------------
PUTIMAGE:
LD A, (CURRENTMODE)
; BITMAP_MODE_STANDARD
CP 0
JR NZ, PUTIMAGE0X
JMP PUTIMAGE0
PUTIMAGE0X:
; TILEMAP_MODE_STANDARD
CP 1
JR NZ, PUTIMAGE1X
JMP PUTIMAGE1
PUTIMAGE1X:
RET
PUTIMAGE1:
RET
PUTIMAGE0:
LD A, (HL)
LD (IMAGEW), A
ADD HL, 1
LD A, (HL)
SRL A
SRL A
SRL A
LD (IMAGEH), A
LD (IMAGEH2), A
ADD HL, 1
PUSH HL
LD A, (IMAGEX)
AND $7
LD B, A
LD A, $8
SUB B
LD B, A
LD E, 1
PUTIMAGE0A:
DEC B
JR Z,PUTIMAGE0B
SLA E
JMP PUTIMAGE0A
PUTIMAGE0B:
LD A,(IMAGEY)
LD B, A
LD A,(IMAGEX)
LD C, A
LD A,B
AND %00000111
OR %01000000
LD H,A
LD A,B
RRA
RRA
RRA
AND %00011000
OR H
LD H,A
LD A,B
RLA
RLA
AND %11100000
LD L,A
LD A,C
RRA
RRA
RRA
AND %00011111
OR L
LD L,A
PUSH HL
POP DE
POP HL
LD A, (IMAGEH)
LD C, A
SLA C
SLA C
SLA C
LD A, (IMAGEW)
LD B, A
PUTIMAGE0CP:
LD A, (HL)
LD (DE), A
INC HL
INC DE
DEC B
JR NZ, PUTIMAGE0CP
LD A, (IMAGEW)
LD B, A
PUSH HL
LD A,(IMAGEY)
ADD A, 1
LD (IMAGEY), A
LD B, A
LD A,(IMAGEX)
LD C, A
LD A,B
AND %00000111
OR %01000000
LD H,A
LD A,B
RRA
RRA
RRA
AND %00011000
OR H
LD H,A
LD A,B
RLA
RLA
AND %11100000
LD L,A
LD A,C
RRA
RRA
RRA
AND %00011111
OR L
LD L,A
PUSH HL
POP DE
POP HL
DEC C
JR NZ, PUTIMAGE0CP
;;;;
PUSH HL
LD HL,(IMAGEX)
SRA H
RR L
SRA H
RR L
SRA H
RR L
LD DE,HL
LD HL,(IMAGEY)
SLA L
RL H
SLA L
RL H
ADD HL,DE
LD DE,(COLORMAPADDRESS)
ADD HL,DE
PUSH HL
POP DE
POP HL
LD A, (IMAGEH)
LD C, A
LD A, (IMAGEW)
LD B, A
PUTIMAGE00CP:
LD A, (HL)
LD (DE), A
INC HL
INC DE
DEC B
JR NZ, PUTIMAGE00CP
LD A, (IMAGEW)
LD B, A
PUSH HL
LD A, (IMAGEW)
LD C, A
LD A, 0
LD B, A
ADD HL, 64
SUB HL, BC
DEC C
JR NZ, PUTIMAGE00CP
RET
|
src/gli.h.asm | LessNick/CLi-for-WildCommander | 8 | 100127 | <filename>src/gli.h.asm
;---------------------------------------
; GLi (Graphics Library interface) Header
;---------------------------------------
;loadResource jp _loadResource ; Загрузка ресурсов из файла
; ; i: HL - адрес загрузки
createSprite jp _createSprite ;
updateSprite jp _updateSprite ;
showSprites jp _showSprites ;
hideSprites jp _hideSprites ;
enableSprites jp _enableSprites ;
disableSprites jp _disableSprites ;
setSpriteX jp _setSpriteX ;
setSpriteY jp _setSpriteY ;
|
script/tystrings.scpt | luckytianyiyan/TyStrings | 15 | 2581 | <reponame>luckytianyiyan/TyStrings<filename>script/tystrings.scpt
-- tystrings.scpt
--
-- The MIT License (MIT)
--
-- Copyright (c) 2017 luckytianyiyan
--
-- 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.
--
set currentPath to getCurrentPath() as alias
activateiTerms()
setWindowTitle("TyStrings Demo")
# cd to repo root path
runCommand("cd " & (quoted form of POSIX path of currentPath) & "../")
runCommand("source venv/bin/activate")
runCommand("cd tests/example/")
clear()
runCommand("ttyrec ../../resource/recording")
delay 0.5
runTyStringsSubCommand("generate", {"$(find . -name \\*.m)", "-o", "en.lproj zh-Hans.lproj"})
delay 2
clear()
runTyStringsSubCommand("translate", {"strings/base_translator.strings", "zh-Hans.lproj/base_translator.strings", "--dst-lang", "zh", "--src-lang", "en", "--appid", "20160709000024959", "--secret", "<KEY>"})
delay 2
clear()
runTyStringsSubCommand("diff", {"strings/diff1.strings", "strings/diff2.strings"})
delay 2
clear()
runTyStringsSubCommand("lint", {"strings/lint.strings"})
delay 2
runCommand("exit")
delay 0.5
runCommand("cd " & (quoted form of POSIX path of currentPath) & "../")
runCommand("deactivate")
runCommand("ttygif resource/recording -f")
runCommand("mv tty.gif resource/tystrings.gif")
# clean
runCommand("rm -rf tests/example/en.lproj")
runCommand("rm -rf tests/example/zh-Hans.lproj")
# ------- TyStrings Helper -------
on runTyStringsSubCommand(subcommand, args)
typingString("tys")
typingStringWithDelay("trings ", 0)
typingString(subcommand & " ")
repeat with i from 1 to count of args
typingStringWithDelay(item i of args & " ", 0.02)
end repeat
# typing '\n'
typingString("
")
end runTyStringsSubCommand
# ------- Core -------
on typingString(content)
typingStringWithDelay(content, 0.1)
end typingString
on typingStringWithDelay(content, dy)
tell application "iTerm"
tell current session of current window
set charList to (characters 1 thru (length of content) of content)
repeat with char in charList
write text char newline no
delay dy
end repeat
end tell
end tell
end typingStringWithDelay
on runCommand(command)
tell application "iTerm"
tell current session of current window
write text command
end tell
end tell
end runCommand
on clear()
runCommand("clear")
delay 0.1
end clear
on isAppRunning(appName)
tell application "System Events" to (name of processes) contains appName
end isAppRunning
on setWindowTitle(title)
runCommand("echo -e \"\\033];" & title & "\\007\"")
end setWindowTitle
on activateiTerms()
if isAppRunning("iTerm") then
tell application "iTerm"
activate
end tell
else
activate application "iTerm"
end if
end activateiTerms
on getCurrentPath()
tell application "Finder"
return container of (path to me)
end tell
end getCurrentPath
|
src/test/ref/switch-1.asm | jbrandwood/kickc | 2 | 91254 | // Tests simple switch()-statement - including a continue statement for the enclosing loop
// Expected output 'a1aa1a' (numbers should be inverted)
// Commodore 64 PRG executable file
.file [name="switch-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.segment Code
main: {
.label SCREEN = $400
ldx #0
__b1:
// case 1:
cpx #1
beq __b2
// case 4:
// SCREEN[i] = '1';
// break;
cpx #4
beq __b2
// SCREEN[i] = 'a'
// No case for 0 & 5
lda #'a'
sta SCREEN,x
__b5:
// for(char i:0..5)
inx
cpx #6
bne __b1
// }
rts
__b2:
// SCREEN[i] = '1'
lda #'1'
sta SCREEN,x
// SCREEN[i] |= 0x80
// Invert the screen character
lda #$80
ora SCREEN,x
sta SCREEN,x
jmp __b5
}
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr32_pkg.ads | best08618/asylo | 7 | 1061 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr32_pkg.ads
package Discr32_Pkg is
type Enum is (One, Two, Three);
type R (D : Enum) is record
case D is
when One => B : Boolean;
when Two => I : Integer;
when Three => F : Float;
end case;
end record;
for R use record
D at 0 range 0 .. 1;
B at 1 range 0 .. 0;
I at 4 range 0 .. 31 + 128;
-- F at 4 range 0 .. 31;
end record;
subtype R1 is R (One);
subtype R2 is R (Two);
subtype R3 is R (Three);
end Discr32_Pkg;
|
test/Succeed/Issue4994.agda | cruhland/agda | 1,989 | 9080 | <filename>test/Succeed/Issue4994.agda
{-# OPTIONS --rewriting #-}
module _ where
open import Agda.Builtin.Equality
open import Agda.Builtin.Equality.Rewrite
open import Agda.Builtin.Bool
data D (A : Set) : Set where
con : (a : A) → D A
pr : ∀ {A} → D A → A
pr (con a) = a
postulate
f : D Bool → Bool
prf : pr ≡ f
{-# REWRITE prf #-}
|
agda/Cardinality/Finite/Cardinal/Category.agda | oisdk/combinatorics-paper | 0 | 2373 | {-# OPTIONS --cubical --safe --postfix-projections #-}
open import Prelude
module Cardinality.Finite.Cardinal.Category {ℓ : Level} where
open import Cardinality.Finite.Cardinal
open import HITs.PropositionalTruncation
open import Data.Sigma.Properties
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Categories
open import Cubical.Foundations.Univalence
open import Categories.Product
open import Categories.Exponential
open import Data.Fin
open import Cardinality.Finite.ManifestBishop
𝒞⇒isSet : 𝒞 A → isSet A
𝒞⇒isSet = Discrete→isSet ∘ 𝒞⇒Discrete
finSetPreCategory : PreCategory (ℓsuc ℓ) ℓ
finSetPreCategory .PreCategory.Ob = Σ (Type ℓ) 𝒞
finSetPreCategory .PreCategory.Hom (X , _) (Y , _) = X → Y
finSetPreCategory .PreCategory.Id = id
finSetPreCategory .PreCategory.Comp f g = f ∘ g
finSetPreCategory .PreCategory.assoc-Comp _ _ _ = refl
finSetPreCategory .PreCategory.Comp-Id _ = refl
finSetPreCategory .PreCategory.Id-Comp _ = refl
finSetPreCategory .PreCategory.Hom-Set {X} {Y} = hLevelPi 2 λ _ → Discrete→isSet (𝒞⇒Discrete (Y .snd))
open PreCategory finSetPreCategory
iso-iso : (X ≅ Y) ⇔ (fst X ⇔ fst Y)
iso-iso .fun (f , g , f∘g , g∘f) = iso f g (λ x i → g∘f i x) (λ x i → f∘g i x)
iso-iso .inv (iso f g g∘f f∘g) = f , g , (λ i x → f∘g x i) , (λ i x → g∘f x i)
iso-iso .rightInv _ = refl
iso-iso .leftInv _ = refl
finSetCategory : Category (ℓsuc ℓ) ℓ
finSetCategory .Category.preCategory = finSetPreCategory
finSetCategory .Category.univalent {X} {Y} =
≃ΣProp≡ (λ _ → squash) ⟨ trans-≃ ⟩
univalence ⟨ trans-≃ ⟩
isoToEquiv (
sym-⇔ (iso⇔equiv (Discrete→isSet (𝒞⇒Discrete (X .snd)))) ⟨ trans-⇔ ⟩
sym-⇔ (iso-iso {X} {Y}))
finSetHasProducts : HasProducts finSetCategory
finSetHasProducts .HasProducts.product X Y .Product.obj = X .fst × Y .fst , X .snd ∥×∥ Y .snd
finSetHasProducts .HasProducts.product X Y .Product.proj₁ = fst
finSetHasProducts .HasProducts.product X Y .Product.proj₂ = snd
finSetHasProducts .HasProducts.product X Y .Product.ump f g .fst z = f z , g z
finSetHasProducts .HasProducts.product X Y .Product.ump f g .snd .fst .fst = refl
finSetHasProducts .HasProducts.product X Y .Product.ump f g .snd .fst .snd = refl
finSetHasProducts .HasProducts.product X Y .Product.ump f g .snd .snd (f≡ , g≡) i x = f≡ (~ i) x , g≡ (~ i) x
finSetHasExp : HasExponentials finSetCategory finSetHasProducts
finSetHasExp X Y .Exponential.obj = (X .fst → Y .fst) , (X .snd ∥→∥ Y .snd)
finSetHasExp X Y .Exponential.eval (f , x) = f x
finSetHasExp X Y .Exponential.uniq X₁ f .fst = curry f
finSetHasExp X Y .Exponential.uniq X₁ f .snd .fst = refl
finSetHasExp X Y .Exponential.uniq X₁ f .snd .snd x = cong curry (sym x)
open import Categories.Pullback
open import Cardinality.Finite.SplitEnumerable using (ℰ!⟨Lift⟩; ℰ!⟨⊤⟩; ℰ!⟨⊥⟩)
finSetHasPullbacks : HasPullbacks finSetCategory
finSetHasPullbacks {X = X} {Y = Y} {Z = Z} f g .Pullback.P = ∃[ ab ] (f (fst ab) ≡ g (snd ab)) , ((X .snd ∥×∥ Y .snd) ∥Σ∥ λ _ → 𝒞⟨≡⟩ _ _ (Z .snd))
finSetHasPullbacks f g .Pullback.p₁ ((x , _) , _) = x
finSetHasPullbacks f g .Pullback.p₂ ((_ , y) , _) = y
finSetHasPullbacks f g .Pullback.commute = funExt snd
finSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .fst x = (h₁ x , h₂ x) , λ i → p i x
finSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .snd .fst .fst = refl
finSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .snd .fst .snd = refl
finSetHasPullbacks {Z = Z} f g .Pullback.ump {A = A} h₁ h₂ p .snd .snd {i} (p₁e , p₂e) = funExt (λ x → ΣProp≡ (λ _ → 𝒞⇒isSet (Z .snd) _ _) λ j → p₁e (~ j) x , p₂e (~ j) x)
finSetTerminal : Terminal
finSetTerminal .fst = Lift _ ⊤ , ∣ ℰ!⇒ℬ (ℰ!⟨Lift⟩ ℰ!⟨⊤⟩) ∣
finSetTerminal .snd .fst x .lower = tt
finSetTerminal .snd .snd y = funExt λ _ → refl
finSetInitial : Initial
finSetInitial .fst = Lift _ ⊥ , ∣ ℰ!⇒ℬ (ℰ!⟨Lift⟩ ℰ!⟨⊥⟩) ∣
finSetInitial .snd .fst ()
finSetInitial .snd .snd y i ()
open import HITs.PropositionalTruncation
open import Categories.Coequalizer
∃!′ : (A : Type a) → (A → Type b) → Type (a ℓ⊔ b)
∃!′ A P = ∥ Σ A P ∥ Prelude.× AtMostOne P
lemma23 : ∀ {p} {P : A → hProp p} → ∃!′ A (fst ∘ P) → Σ A (fst ∘ P)
lemma23 {P = P} (x , y) = rec (λ xs ys → ΣProp≡ (snd ∘ P) (y (xs .fst) (ys .fst) (xs .snd) (ys .snd))) id x
module _ {A : Type a} {P : A → Type b} (R : ∀ x → P x → hProp c) where
uniqueChoice : (Π[ x ⦂ A ] (∃!′ (P x) (λ u → R x u .fst))) →
Σ[ f ⦂ Π[ x ⦂ A ] P x ] Π[ x ⦂ A ] (R x (f x) .fst)
uniqueChoice H = fst ∘ mid , snd ∘ mid
where
mid : Π[ x ⦂ A ] Σ[ u ⦂ P x ] (R x u .fst)
mid x = lemma23 {P = R x} (H x)
open import HITs.PropositionalTruncation.Sugar
open import Data.List using (_∷_; [])
open import Cardinality.Finite.SplitEnumerable.Search using (ℰ!⟨fib⟩)
module CoeqProofs {X Y : Ob} (f : X ⟶ Y) where
KernelPair : Pullback finSetCategory {X = X} {Z = Y} {Y = X} f f
KernelPair = finSetHasPullbacks f f
Im : Ob
Im = ∃[ b ] ∥ fiber f b ∥ , (Y .snd ∥Σ∥ λ x → do cx ← X .snd ; cy ← Y .snd ; ∣ ℰ!⇒ℬ (ℰ!⟨fib⟩ f _ (ℬ⇒ℰ! cx) (ℬ⇒ℰ! cy)) ∣)
im : X ⟶ Im
im x = f x , ∣ x , refl ∣
open Pullback KernelPair
lem : ∀ {H : Ob} (h : X ⟶ H) → h ∘ p₁ ≡ h ∘ p₂ → Σ[ f ⦂ (Im ⟶ H) ] Π[ x ⦂ Im .fst ] (∀ y → im y ≡ x → h y ≡ f x)
lem {H = H} h eq = uniqueChoice R prf
where
R : Im .fst → H .fst → hProp _
R w x .fst = ∀ y → im y ≡ w → h y ≡ x
R w x .snd = hLevelPi 1 λ _ → hLevelPi 1 λ _ → 𝒞⇒isSet (H .snd) _ _
prf : Π[ x ⦂ Im .fst ] ∃!′ (H .fst) (λ u → ∀ y → im y ≡ x → h y ≡ u)
prf (xy , p) .fst = (λ { (z , r) → h z , λ y imy≡xyp → cong (_$ ((y , z) , cong fst imy≡xyp ; sym r)) eq }) ∥$∥ p
prf (xy , p) .snd x₁ x₂ Px₁ Px₂ = rec (𝒞⇒isSet (H .snd) x₁ x₂) (λ { (z , zs) → sym (Px₁ z (ΣProp≡ (λ _ → squash) zs)) ; Px₂ z (ΣProp≡ (λ _ → squash) zs) } ) p
lem₂ : ∀ (H : Ob) (h : X ⟶ H) (i : Im ⟶ H) (x : Im .fst) (hi : h ≡ i ∘ im) (eq : h ∘ p₁ ≡ h ∘ p₂) → i x ≡ lem {H = H} h eq .fst x
lem₂ H h i x hi eq = rec (𝒞⇒isSet (H .snd) _ _) (λ { (y , ys) → (cong i (ΣProp≡ (λ _ → squash) (sym ys)) ; sym (cong (_$ y) hi)) ; lem {H = H} h eq .snd x y (ΣProp≡ (λ _ → squash) ys) }) (x .snd)
finSetCoeq : Coequalizer finSetCategory {X = P} {Y = X} p₁ p₂
finSetCoeq .Coequalizer.obj = Im
finSetCoeq .Coequalizer.arr = im
finSetCoeq .Coequalizer.equality = funExt λ x → ΣProp≡ (λ _ → squash) λ i → commute i x
finSetCoeq .Coequalizer.coequalize {H = H} {h = h} eq = lem {H = H} h eq .fst
finSetCoeq .Coequalizer.universal {H = H} {h = h} {eq = eq} = funExt λ x → lem {H = H} h eq .snd (im x) x refl
finSetCoeq .Coequalizer.unique {H = H} {h = h} {i = i} {eq = eq} prf = funExt λ x → lem₂ H h i x prf eq
open CoeqProofs public using (finSetCoeq)
module PullbackSurjProofs {X Y : Ob} (f : X ⟶ Y) (fSurj : Surjective f) where
KernelPair : Pullback finSetCategory {X = X} {Z = Y} {Y = X} f f
KernelPair = finSetHasPullbacks f f
open Pullback KernelPair
p₁surj : Surjective p₁
p₁surj y = ∣ ((y , y) , refl) , refl ∣
p₂surj : Surjective p₂
p₂surj y = ∣ ((y , y) , refl) , refl ∣
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.