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 |
|---|---|---|---|---|
src/tom/library/sl/ada/choiceidstrategy.ads | rewriting/tom | 36 | 5200 | with ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage;
use ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage;
package ChoiceIdStrategy is
FIRST : constant Integer := 0;
SECOND : constant Integer := 1;
type ChoiceId is new AbstractStrategyCombinator and Object with null record;
----------------------------------------------------------------------------
-- Object implementation
----------------------------------------------------------------------------
function toString(c: ChoiceId) return String;
----------------------------------------------------------------------------
-- Strategy implementation
----------------------------------------------------------------------------
function visitLight(str:access ChoiceId; any: ObjectPtr; i: access Introspector'Class) return ObjectPtr;
function visit(str: access ChoiceId; i: access Introspector'Class) return Integer;
----------------------------------------------------------------------------
function make(first, second : StrategyPtr) return StrategyPtr;
function newChoiceId(first, second: StrategyPtr) return StrategyPtr;
end ChoiceIdStrategy;
|
notes/FOT/FOTC/NoPatternMatchingOnRefl.agda | asr/fotc | 11 | 13392 | <reponame>asr/fotc
------------------------------------------------------------------------------
-- Proving properties without using pattern matching on refl
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOT.FOTC.NoPatternMatchingOnRefl where
open import FOTC.Base
open import FOTC.Base.List
open import FOTC.Data.Bool
open import FOTC.Data.Conat
open import FOTC.Data.Conat.Equality.Type
renaming
( _≈_ to _≈N_
; ≈-coind to ≈N-coind
)
open import FOTC.Data.List
open import FOTC.Data.Nat
open import FOTC.Data.Nat.Inequalities
open import FOTC.Data.Stream.Type
open import FOTC.Program.McCarthy91.McCarthy91
open import FOTC.Relation.Binary.Bisimilarity.PropertiesI
open import FOTC.Relation.Binary.Bisimilarity.Type
------------------------------------------------------------------------------
-- From FOTC.Base.PropertiesI
-- Congruence properties
·-leftCong : ∀ {a b c} → a ≡ b → a · c ≡ b · c
·-leftCong {a} {c = c} h = subst (λ t → a · c ≡ t · c) h refl
·-rightCong : ∀ {a b c} → b ≡ c → a · b ≡ a · c
·-rightCong {a} {b} h = subst (λ t → a · b ≡ a · t) h refl
·-cong : ∀ {a b c d} → a ≡ b → c ≡ d → a · c ≡ b · d
·-cong {a} {c = c} h₁ h₂ = subst₂ (λ t₁ t₂ → a · c ≡ t₁ · t₂) h₁ h₂ refl
succCong : ∀ {m n} → m ≡ n → succ₁ m ≡ succ₁ n
succCong {m} h = subst (λ t → succ₁ m ≡ succ₁ t) h refl
predCong : ∀ {m n} → m ≡ n → pred₁ m ≡ pred₁ n
predCong {m} h = subst (λ t → pred₁ m ≡ pred₁ t) h refl
ifCong₁ : ∀ {b b' t t'} → b ≡ b' →
(if b then t else t') ≡ (if b' then t else t')
ifCong₁ {b} {t = t} {t'} h =
subst (λ x → (if b then t else t') ≡ (if x then t else t')) h refl
ifCong₂ : ∀ {b t₁ t₂ t} → t₁ ≡ t₂ →
(if b then t₁ else t) ≡ (if b then t₂ else t)
ifCong₂ {b} {t₁} {t = t} h =
subst (λ x → (if b then t₁ else t) ≡ (if b then x else t)) h refl
ifCong₃ : ∀ {b t t₁ t₂} → t₁ ≡ t₂ →
(if b then t else t₁) ≡ (if b then t else t₂)
ifCong₃ {b} {t} {t₁} h =
subst (λ x → (if b then t else t₁) ≡ (if b then t else x)) h refl
------------------------------------------------------------------------------
-- From FOTC.Base.List.PropertiesI
-- Congruence properties
∷-leftCong : ∀ {x y xs} → x ≡ y → x ∷ xs ≡ y ∷ xs
∷-leftCong {x} {xs = xs} h = subst (λ t → x ∷ xs ≡ t ∷ xs) h refl
∷-rightCong : ∀ {x xs ys} → xs ≡ ys → x ∷ xs ≡ x ∷ ys
∷-rightCong {x}{xs} h = subst (λ t → x ∷ xs ≡ x ∷ t) h refl
∷-Cong : ∀ {x y xs ys} → x ≡ y → xs ≡ ys → x ∷ xs ≡ y ∷ ys
∷-Cong {x} {xs = xs} h₁ h₂ = subst₂ (λ t₁ t₂ → x ∷ xs ≡ t₁ ∷ t₂) h₁ h₂ refl
headCong : ∀ {xs ys} → xs ≡ ys → head₁ xs ≡ head₁ ys
headCong {xs} h = subst (λ t → head₁ xs ≡ head₁ t) h refl
tailCong : ∀ {xs ys} → xs ≡ ys → tail₁ xs ≡ tail₁ ys
tailCong {xs} h = subst (λ t → tail₁ xs ≡ tail₁ t) h refl
------------------------------------------------------------------------------
-- From FOTC.Data.Bool.PropertiesI
-- Congruence properties
&&-leftCong : ∀ {a b c} → a ≡ b → a && c ≡ b && c
&&-leftCong {a} {c = c} h = subst (λ t → a && c ≡ t && c) h refl
&&-rightCong : ∀ {a b c} → b ≡ c → a && b ≡ a && c
&&-rightCong {a} {b} h = subst (λ t → a && b ≡ a && t) h refl
&&-cong : ∀ {a b c d } → a ≡ c → b ≡ d → a && b ≡ c && d
&&-cong {a} {b} h₁ h₂ = subst₂ (λ t₁ t₂ → a && b ≡ t₁ && t₂) h₁ h₂ refl
notCong : ∀ {a b} → a ≡ b → not a ≡ not b
notCong {a} h = subst (λ t → not a ≡ not t) h refl
------------------------------------------------------------------------------
-- FOTC.Data.Conat.Equality.PropertiesI
≈N-refl : ∀ {n} → Conat n → n ≈N n
≈N-refl {n} Cn = ≈N-coind R h₁ h₂
where
R : D → D → Set
R a b = Conat a ∧ Conat b ∧ a ≡ b
h₁ : ∀ {a b} → R a b →
a ≡ zero ∧ b ≡ zero
∨ (∃[ a' ] ∃[ b' ] a ≡ succ₁ a' ∧ b ≡ succ₁ b' ∧ R a' b')
h₁ (Ca , Cb , h) with Conat-out Ca
... | inj₁ prf = inj₁ (prf , trans (sym h) prf)
... | inj₂ (a' , prf , Ca') =
inj₂ (a' , a' , prf , trans (sym h) prf , (Ca' , Ca' , refl))
h₂ : R n n
h₂ = Cn , Cn , refl
≡→≈ : ∀ {m n} → Conat m → Conat n → m ≡ n → m ≈N n
≡→≈ {m} Cm _ h = subst (_≈N_ m) h (≈N-refl Cm)
------------------------------------------------------------------------------
-- FOTC.Data.List.PropertiesI
-- Congruence properties
++-leftCong : ∀ {xs ys zs} → xs ≡ ys → xs ++ zs ≡ ys ++ zs
++-leftCong {xs} {zs = zs} h = subst (λ t → xs ++ zs ≡ t ++ zs) h refl
++-rightCong : ∀ {xs ys zs} → ys ≡ zs → xs ++ ys ≡ xs ++ zs
++-rightCong {xs} {ys} h = subst (λ t → xs ++ ys ≡ xs ++ t) h refl
mapCong₂ : ∀ {f xs ys} → xs ≡ ys → map f xs ≡ map f ys
mapCong₂ {f} {xs} h = subst (λ t → map f xs ≡ map f t) h refl
revCong₁ : ∀ {xs ys zs} → xs ≡ ys → rev xs zs ≡ rev ys zs
revCong₁ {xs} {zs = zs} h = subst (λ t → rev xs zs ≡ rev t zs) h refl
revCong₂ : ∀ {xs ys zs} → ys ≡ zs → rev xs ys ≡ rev xs zs
revCong₂ {xs} {ys} h = subst (λ t → rev xs ys ≡ rev xs t) h refl
reverseCong : ∀ {xs ys} → xs ≡ ys → reverse xs ≡ reverse ys
reverseCong {xs} h = subst (λ t → reverse xs ≡ reverse t) h refl
lengthCong : ∀ {xs ys} → xs ≡ ys → length xs ≡ length ys
lengthCong {xs} h = subst (λ t → length xs ≡ length t) h refl
------------------------------------------------------------------------------
-- From FOTC.Data.Nat.Inequalities.PropertiesI
-- Congruence properties
leLeftCong : ∀ {m n o} → m ≡ n → le m o ≡ le n o
leLeftCong {m} {o = o} h = subst (λ t → le m o ≡ le t o) h refl
ltLeftCong : ∀ {m n o} → m ≡ n → lt m o ≡ lt n o
ltLeftCong {m} {o = o} h = subst (λ t → lt m o ≡ lt t o) h refl
ltRightCong : ∀ {m n o} → n ≡ o → lt m n ≡ lt m o
ltRightCong {m} {n} h = subst (λ t → lt m n ≡ lt m t) h refl
ltCong : ∀ {m₁ n₁ m₂ n₂} → m₁ ≡ m₂ → n₁ ≡ n₂ → lt m₁ n₁ ≡ lt m₂ n₂
ltCong {m₁} {n₁} h₁ h₂ = subst₂ (λ t₁ t₂ → lt m₁ n₁ ≡ lt t₁ t₂) h₁ h₂ refl
------------------------------------------------------------------------------
-- From FOTC.Data.Nat.PropertiesI
-- Congruence properties
+-leftCong : ∀ {m n o} → m ≡ n → m + o ≡ n + o
+-leftCong {m} {o = o} h = subst (λ t → m + o ≡ t + o) h refl
+-rightCong : ∀ {m n o} → n ≡ o → m + n ≡ m + o
+-rightCong {m} {n} h = subst (λ t → m + n ≡ m + t) h refl
∸-leftCong : ∀ {m n o} → m ≡ n → m ∸ o ≡ n ∸ o
∸-leftCong {m} {o = o} h = subst (λ t → m ∸ o ≡ t ∸ o) h refl
∸-rightCong : ∀ {m n o} → n ≡ o → m ∸ n ≡ m ∸ o
∸-rightCong {m} {n} h = subst (λ t → m ∸ n ≡ m ∸ t) h refl
*-leftCong : ∀ {m n o} → m ≡ n → m * o ≡ n * o
*-leftCong {m} {o = o} h = subst (λ t → m * o ≡ t * o) h refl
*-rightCong : ∀ {m n o} → n ≡ o → m * n ≡ m * o
*-rightCong {m} {n} h = subst (λ t → m * n ≡ m * t) h refl
------------------------------------------------------------------------------
-- From FOT.FOTC.Data.Stream.Equality.PropertiesI where
stream-≡→≈ : ∀ {xs ys} → Stream xs → Stream ys → xs ≡ ys → xs ≈ ys
stream-≡→≈ {xs} Sxs _ h = subst (_≈_ xs) h (≈-refl Sxs)
------------------------------------------------------------------------------
-- From FOTC.Program.McCarthy91.AuxiliaryPropertiesATP
f₉₁-x≡y : ∀ {m n o} → f₉₁ m ≡ n → o ≡ m → f₉₁ o ≡ n
f₉₁-x≡y {n = n} h₁ h₂ = subst (λ t → f₉₁ t ≡ n) (sym h₂) h₁
|
stat.asm | adrianna157/CS444-Lab5-Mutexes | 0 | 2038 | <gh_stars>0
_stat: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
return ftype;
}
int
main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 57 push %edi
4: 56 push %esi
5: 53 push %ebx
int i;
int res;
struct stat st;
for (i = 1; i < argc; i++) {
6: bb 01 00 00 00 mov $0x1,%ebx
{
b: 83 e4 f0 and $0xfffffff0,%esp
e: 83 ec 50 sub $0x50,%esp
11: 8b 75 0c mov 0xc(%ebp),%esi
for (i = 1; i < argc; i++) {
14: 83 7d 08 01 cmpl $0x1,0x8(%ebp)
18: 7f 63 jg 7d <main+0x7d>
1a: e9 98 00 00 00 jmp b7 <main+0xb7>
1f: 90 nop
res = stat(argv[i], &st);
if (res < 0) {
printf(2, "stat failed on file: %s\n", argv[i]);
}
else {
printf(1, "name: %s\n type: %s\n links: %d\n inode: %u\n size: %d\n"
20: 0f bf 44 24 3c movswl 0x3c(%esp),%eax
25: 8b 4c 24 4c mov 0x4c(%esp),%ecx
29: 8b 54 24 44 mov 0x44(%esp),%edx
2d: 0f bf 7c 24 48 movswl 0x48(%esp),%edi
32: 89 04 24 mov %eax,(%esp)
35: 89 4c 24 28 mov %ecx,0x28(%esp)
39: 89 54 24 2c mov %edx,0x2c(%esp)
3d: e8 7e 00 00 00 call c0 <filetype>
42: 8b 4c 24 28 mov 0x28(%esp),%ecx
46: 8b 54 24 2c mov 0x2c(%esp),%edx
4a: 89 7c 24 10 mov %edi,0x10(%esp)
4e: 89 4c 24 18 mov %ecx,0x18(%esp)
52: 89 54 24 14 mov %edx,0x14(%esp)
56: 89 44 24 0c mov %eax,0xc(%esp)
5a: 8b 04 9e mov (%esi,%ebx,4),%eax
for (i = 1; i < argc; i++) {
5d: 83 c3 01 add $0x1,%ebx
printf(1, "name: %s\n type: %s\n links: %d\n inode: %u\n size: %d\n"
60: c7 44 24 04 a8 0b 00 movl $0xba8,0x4(%esp)
67: 00
68: c7 04 24 01 00 00 00 movl $0x1,(%esp)
6f: 89 44 24 08 mov %eax,0x8(%esp)
73: e8 d8 04 00 00 call 550 <printf>
for (i = 1; i < argc; i++) {
78: 3b 5d 08 cmp 0x8(%ebp),%ebx
7b: 74 3a je b7 <main+0xb7>
res = stat(argv[i], &st);
7d: 8d 44 24 3c lea 0x3c(%esp),%eax
81: 89 44 24 04 mov %eax,0x4(%esp)
85: 8b 04 9e mov (%esi,%ebx,4),%eax
88: 89 04 24 mov %eax,(%esp)
8b: e8 60 02 00 00 call 2f0 <stat>
if (res < 0) {
90: 85 c0 test %eax,%eax
92: 79 8c jns 20 <main+0x20>
printf(2, "stat failed on file: %s\n", argv[i]);
94: 8b 04 9e mov (%esi,%ebx,4),%eax
for (i = 1; i < argc; i++) {
97: 83 c3 01 add $0x1,%ebx
printf(2, "stat failed on file: %s\n", argv[i]);
9a: c7 44 24 04 8c 0b 00 movl $0xb8c,0x4(%esp)
a1: 00
a2: c7 04 24 02 00 00 00 movl $0x2,(%esp)
a9: 89 44 24 08 mov %eax,0x8(%esp)
ad: e8 9e 04 00 00 call 550 <printf>
for (i = 1; i < argc; i++) {
b2: 3b 5d 08 cmp 0x8(%ebp),%ebx
b5: 75 c6 jne 7d <main+0x7d>
, argv[i], filetype(st.type), st.nlink, st.ino, st.size);
}
}
exit();
b7: e8 e6 02 00 00 call 3a2 <exit>
bc: 66 90 xchg %ax,%ax
be: 66 90 xchg %ax,%ax
000000c0 <filetype>:
{
c0: 55 push %ebp
c1: 89 e5 mov %esp,%ebp
c3: 53 push %ebx
c4: 83 ec 14 sub $0x14,%esp
c7: 8b 5d 08 mov 0x8(%ebp),%ebx
memset(ftype, 0, sizeof(ftype));
ca: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
d1: 00
d2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
d9: 00
da: c7 04 24 b4 10 00 00 movl $0x10b4,(%esp)
e1: e8 4a 01 00 00 call 230 <memset>
switch (sttype) {
e6: 83 fb 02 cmp $0x2,%ebx
e9: 74 6d je 158 <filetype+0x98>
eb: 83 fb 03 cmp $0x3,%ebx
ee: 74 48 je 138 <filetype+0x78>
f0: 83 fb 01 cmp $0x1,%ebx
f3: 74 23 je 118 <filetype+0x58>
strcpy(ftype, "unknown file type");
f5: c7 44 24 04 7a 0b 00 movl $0xb7a,0x4(%esp)
fc: 00
fd: c7 04 24 b4 10 00 00 movl $0x10b4,(%esp)
104: e8 77 00 00 00 call 180 <strcpy>
}
109: 83 c4 14 add $0x14,%esp
10c: b8 b4 10 00 00 mov $0x10b4,%eax
111: 5b pop %ebx
112: 5d pop %ebp
113: c3 ret
114: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
strcpy(ftype, "directory");
118: c7 44 24 04 5c 0b 00 movl $0xb5c,0x4(%esp)
11f: 00
120: c7 04 24 b4 10 00 00 movl $0x10b4,(%esp)
127: e8 54 00 00 00 call 180 <strcpy>
}
12c: 83 c4 14 add $0x14,%esp
12f: b8 b4 10 00 00 mov $0x10b4,%eax
134: 5b pop %ebx
135: 5d pop %ebp
136: c3 ret
137: 90 nop
strcpy(ftype, "device");
138: c7 44 24 04 73 0b 00 movl $0xb73,0x4(%esp)
13f: 00
140: c7 04 24 b4 10 00 00 movl $0x10b4,(%esp)
147: e8 34 00 00 00 call 180 <strcpy>
}
14c: 83 c4 14 add $0x14,%esp
14f: b8 b4 10 00 00 mov $0x10b4,%eax
154: 5b pop %ebx
155: 5d pop %ebp
156: c3 ret
157: 90 nop
strcpy(ftype, "regular file");
158: c7 44 24 04 66 0b 00 movl $0xb66,0x4(%esp)
15f: 00
160: c7 04 24 b4 10 00 00 movl $0x10b4,(%esp)
167: e8 14 00 00 00 call 180 <strcpy>
}
16c: 83 c4 14 add $0x14,%esp
16f: b8 b4 10 00 00 mov $0x10b4,%eax
174: 5b pop %ebx
175: 5d pop %ebp
176: c3 ret
177: 66 90 xchg %ax,%ax
179: 66 90 xchg %ax,%ax
17b: 66 90 xchg %ax,%ax
17d: 66 90 xchg %ax,%ax
17f: 90 nop
00000180 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
180: 55 push %ebp
181: 89 e5 mov %esp,%ebp
183: 8b 45 08 mov 0x8(%ebp),%eax
186: 8b 4d 0c mov 0xc(%ebp),%ecx
189: 53 push %ebx
char *os;
os = s;
while((*s++ = *t++) != 0)
18a: 89 c2 mov %eax,%edx
18c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
190: 83 c1 01 add $0x1,%ecx
193: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
197: 83 c2 01 add $0x1,%edx
19a: 84 db test %bl,%bl
19c: 88 5a ff mov %bl,-0x1(%edx)
19f: 75 ef jne 190 <strcpy+0x10>
;
return os;
}
1a1: 5b pop %ebx
1a2: 5d pop %ebp
1a3: c3 ret
1a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1b0: 55 push %ebp
1b1: 89 e5 mov %esp,%ebp
1b3: 8b 55 08 mov 0x8(%ebp),%edx
1b6: 53 push %ebx
1b7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
1ba: 0f b6 02 movzbl (%edx),%eax
1bd: 84 c0 test %al,%al
1bf: 74 2d je 1ee <strcmp+0x3e>
1c1: 0f b6 19 movzbl (%ecx),%ebx
1c4: 38 d8 cmp %bl,%al
1c6: 74 0e je 1d6 <strcmp+0x26>
1c8: eb 2b jmp 1f5 <strcmp+0x45>
1ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1d0: 38 c8 cmp %cl,%al
1d2: 75 15 jne 1e9 <strcmp+0x39>
p++, q++;
1d4: 89 d9 mov %ebx,%ecx
1d6: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
1d9: 0f b6 02 movzbl (%edx),%eax
p++, q++;
1dc: 8d 59 01 lea 0x1(%ecx),%ebx
while(*p && *p == *q)
1df: 0f b6 49 01 movzbl 0x1(%ecx),%ecx
1e3: 84 c0 test %al,%al
1e5: 75 e9 jne 1d0 <strcmp+0x20>
1e7: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
1e9: 29 c8 sub %ecx,%eax
}
1eb: 5b pop %ebx
1ec: 5d pop %ebp
1ed: c3 ret
1ee: 0f b6 09 movzbl (%ecx),%ecx
while(*p && *p == *q)
1f1: 31 c0 xor %eax,%eax
1f3: eb f4 jmp 1e9 <strcmp+0x39>
1f5: 0f b6 cb movzbl %bl,%ecx
1f8: eb ef jmp 1e9 <strcmp+0x39>
1fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000200 <strlen>:
uint
strlen(const char *s)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
206: 80 39 00 cmpb $0x0,(%ecx)
209: 74 12 je 21d <strlen+0x1d>
20b: 31 d2 xor %edx,%edx
20d: 8d 76 00 lea 0x0(%esi),%esi
210: 83 c2 01 add $0x1,%edx
213: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
217: 89 d0 mov %edx,%eax
219: 75 f5 jne 210 <strlen+0x10>
;
return n;
}
21b: 5d pop %ebp
21c: c3 ret
for(n = 0; s[n]; n++)
21d: 31 c0 xor %eax,%eax
}
21f: 5d pop %ebp
220: c3 ret
221: eb 0d jmp 230 <memset>
223: 90 nop
224: 90 nop
225: 90 nop
226: 90 nop
227: 90 nop
228: 90 nop
229: 90 nop
22a: 90 nop
22b: 90 nop
22c: 90 nop
22d: 90 nop
22e: 90 nop
22f: 90 nop
00000230 <memset>:
void*
memset(void *dst, int c, uint n)
{
230: 55 push %ebp
231: 89 e5 mov %esp,%ebp
233: 8b 55 08 mov 0x8(%ebp),%edx
236: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
237: 8b 4d 10 mov 0x10(%ebp),%ecx
23a: 8b 45 0c mov 0xc(%ebp),%eax
23d: 89 d7 mov %edx,%edi
23f: fc cld
240: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
242: 89 d0 mov %edx,%eax
244: 5f pop %edi
245: 5d pop %ebp
246: c3 ret
247: 89 f6 mov %esi,%esi
249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000250 <strchr>:
char*
strchr(const char *s, char c)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 8b 45 08 mov 0x8(%ebp),%eax
256: 53 push %ebx
257: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
25a: 0f b6 18 movzbl (%eax),%ebx
25d: 84 db test %bl,%bl
25f: 74 1d je 27e <strchr+0x2e>
if(*s == c)
261: 38 d3 cmp %dl,%bl
263: 89 d1 mov %edx,%ecx
265: 75 0d jne 274 <strchr+0x24>
267: eb 17 jmp 280 <strchr+0x30>
269: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
270: 38 ca cmp %cl,%dl
272: 74 0c je 280 <strchr+0x30>
for(; *s; s++)
274: 83 c0 01 add $0x1,%eax
277: 0f b6 10 movzbl (%eax),%edx
27a: 84 d2 test %dl,%dl
27c: 75 f2 jne 270 <strchr+0x20>
return (char*)s;
return 0;
27e: 31 c0 xor %eax,%eax
}
280: 5b pop %ebx
281: 5d pop %ebp
282: c3 ret
283: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000290 <gets>:
char*
gets(char *buf, int max)
{
290: 55 push %ebp
291: 89 e5 mov %esp,%ebp
293: 57 push %edi
294: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
295: 31 f6 xor %esi,%esi
{
297: 53 push %ebx
298: 83 ec 2c sub $0x2c,%esp
cc = read(0, &c, 1);
29b: 8d 7d e7 lea -0x19(%ebp),%edi
for(i=0; i+1 < max; ){
29e: eb 31 jmp 2d1 <gets+0x41>
cc = read(0, &c, 1);
2a0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
2a7: 00
2a8: 89 7c 24 04 mov %edi,0x4(%esp)
2ac: c7 04 24 00 00 00 00 movl $0x0,(%esp)
2b3: e8 02 01 00 00 call 3ba <read>
if(cc < 1)
2b8: 85 c0 test %eax,%eax
2ba: 7e 1d jle 2d9 <gets+0x49>
break;
buf[i++] = c;
2bc: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
for(i=0; i+1 < max; ){
2c0: 89 de mov %ebx,%esi
buf[i++] = c;
2c2: 8b 55 08 mov 0x8(%ebp),%edx
if(c == '\n' || c == '\r')
2c5: 3c 0d cmp $0xd,%al
buf[i++] = c;
2c7: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
2cb: 74 0c je 2d9 <gets+0x49>
2cd: 3c 0a cmp $0xa,%al
2cf: 74 08 je 2d9 <gets+0x49>
for(i=0; i+1 < max; ){
2d1: 8d 5e 01 lea 0x1(%esi),%ebx
2d4: 3b 5d 0c cmp 0xc(%ebp),%ebx
2d7: 7c c7 jl 2a0 <gets+0x10>
break;
}
buf[i] = '\0';
2d9: 8b 45 08 mov 0x8(%ebp),%eax
2dc: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
2e0: 83 c4 2c add $0x2c,%esp
2e3: 5b pop %ebx
2e4: 5e pop %esi
2e5: 5f pop %edi
2e6: 5d pop %ebp
2e7: c3 ret
2e8: 90 nop
2e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000002f0 <stat>:
int
stat(const char *n, struct stat *st)
{
2f0: 55 push %ebp
2f1: 89 e5 mov %esp,%ebp
2f3: 56 push %esi
2f4: 53 push %ebx
2f5: 83 ec 10 sub $0x10,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
2f8: 8b 45 08 mov 0x8(%ebp),%eax
2fb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
302: 00
303: 89 04 24 mov %eax,(%esp)
306: e8 d7 00 00 00 call 3e2 <open>
if(fd < 0)
30b: 85 c0 test %eax,%eax
fd = open(n, O_RDONLY);
30d: 89 c3 mov %eax,%ebx
if(fd < 0)
30f: 78 27 js 338 <stat+0x48>
return -1;
r = fstat(fd, st);
311: 8b 45 0c mov 0xc(%ebp),%eax
314: 89 1c 24 mov %ebx,(%esp)
317: 89 44 24 04 mov %eax,0x4(%esp)
31b: e8 da 00 00 00 call 3fa <fstat>
close(fd);
320: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
323: 89 c6 mov %eax,%esi
close(fd);
325: e8 a0 00 00 00 call 3ca <close>
return r;
32a: 89 f0 mov %esi,%eax
}
32c: 83 c4 10 add $0x10,%esp
32f: 5b pop %ebx
330: 5e pop %esi
331: 5d pop %ebp
332: c3 ret
333: 90 nop
334: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
338: b8 ff ff ff ff mov $0xffffffff,%eax
33d: eb ed jmp 32c <stat+0x3c>
33f: 90 nop
00000340 <atoi>:
int
atoi(const char *s)
{
340: 55 push %ebp
341: 89 e5 mov %esp,%ebp
343: 8b 4d 08 mov 0x8(%ebp),%ecx
346: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
347: 0f be 11 movsbl (%ecx),%edx
34a: 8d 42 d0 lea -0x30(%edx),%eax
34d: 3c 09 cmp $0x9,%al
n = 0;
34f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
354: 77 17 ja 36d <atoi+0x2d>
356: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
358: 83 c1 01 add $0x1,%ecx
35b: 8d 04 80 lea (%eax,%eax,4),%eax
35e: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
362: 0f be 11 movsbl (%ecx),%edx
365: 8d 5a d0 lea -0x30(%edx),%ebx
368: 80 fb 09 cmp $0x9,%bl
36b: 76 eb jbe 358 <atoi+0x18>
return n;
}
36d: 5b pop %ebx
36e: 5d pop %ebp
36f: c3 ret
00000370 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
370: 55 push %ebp
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
371: 31 d2 xor %edx,%edx
{
373: 89 e5 mov %esp,%ebp
375: 56 push %esi
376: 8b 45 08 mov 0x8(%ebp),%eax
379: 53 push %ebx
37a: 8b 5d 10 mov 0x10(%ebp),%ebx
37d: 8b 75 0c mov 0xc(%ebp),%esi
while(n-- > 0)
380: 85 db test %ebx,%ebx
382: 7e 12 jle 396 <memmove+0x26>
384: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
388: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
38c: 88 0c 10 mov %cl,(%eax,%edx,1)
38f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
392: 39 da cmp %ebx,%edx
394: 75 f2 jne 388 <memmove+0x18>
return vdst;
}
396: 5b pop %ebx
397: 5e pop %esi
398: 5d pop %ebp
399: c3 ret
0000039a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
39a: b8 01 00 00 00 mov $0x1,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <exit>:
SYSCALL(exit)
3a2: b8 02 00 00 00 mov $0x2,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <wait>:
SYSCALL(wait)
3aa: b8 03 00 00 00 mov $0x3,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <pipe>:
SYSCALL(pipe)
3b2: b8 04 00 00 00 mov $0x4,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <read>:
SYSCALL(read)
3ba: b8 05 00 00 00 mov $0x5,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <write>:
SYSCALL(write)
3c2: b8 10 00 00 00 mov $0x10,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <close>:
SYSCALL(close)
3ca: b8 15 00 00 00 mov $0x15,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <kill>:
SYSCALL(kill)
3d2: b8 06 00 00 00 mov $0x6,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <exec>:
SYSCALL(exec)
3da: b8 07 00 00 00 mov $0x7,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <open>:
SYSCALL(open)
3e2: b8 0f 00 00 00 mov $0xf,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <mknod>:
SYSCALL(mknod)
3ea: b8 11 00 00 00 mov $0x11,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <unlink>:
SYSCALL(unlink)
3f2: b8 12 00 00 00 mov $0x12,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <fstat>:
SYSCALL(fstat)
3fa: b8 08 00 00 00 mov $0x8,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <link>:
SYSCALL(link)
402: b8 13 00 00 00 mov $0x13,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <mkdir>:
SYSCALL(mkdir)
40a: b8 14 00 00 00 mov $0x14,%eax
40f: cd 40 int $0x40
411: c3 ret
00000412 <chdir>:
SYSCALL(chdir)
412: b8 09 00 00 00 mov $0x9,%eax
417: cd 40 int $0x40
419: c3 ret
0000041a <dup>:
SYSCALL(dup)
41a: b8 0a 00 00 00 mov $0xa,%eax
41f: cd 40 int $0x40
421: c3 ret
00000422 <getpid>:
SYSCALL(getpid)
422: b8 0b 00 00 00 mov $0xb,%eax
427: cd 40 int $0x40
429: c3 ret
0000042a <sbrk>:
SYSCALL(sbrk)
42a: b8 0c 00 00 00 mov $0xc,%eax
42f: cd 40 int $0x40
431: c3 ret
00000432 <sleep>:
SYSCALL(sleep)
432: b8 0d 00 00 00 mov $0xd,%eax
437: cd 40 int $0x40
439: c3 ret
0000043a <uptime>:
SYSCALL(uptime)
43a: b8 0e 00 00 00 mov $0xe,%eax
43f: cd 40 int $0x40
441: c3 ret
00000442 <getppid>:
#ifdef GETPPID
SYSCALL(getppid)
442: b8 16 00 00 00 mov $0x16,%eax
447: cd 40 int $0x40
449: c3 ret
0000044a <cps>:
#endif // GETPPID
#ifdef CPS
SYSCALL(cps)
44a: b8 17 00 00 00 mov $0x17,%eax
44f: cd 40 int $0x40
451: c3 ret
00000452 <halt>:
#endif // CPS
#ifdef HALT
SYSCALL(halt)
452: b8 18 00 00 00 mov $0x18,%eax
457: cd 40 int $0x40
459: c3 ret
0000045a <kdebug>:
#endif // HALT
#ifdef KDEBUG
SYSCALL(kdebug)
45a: b8 19 00 00 00 mov $0x19,%eax
45f: cd 40 int $0x40
461: c3 ret
00000462 <va2pa>:
#endif // KDEBUG
#ifdef VA2PA
SYSCALL(va2pa)
462: b8 1a 00 00 00 mov $0x1a,%eax
467: cd 40 int $0x40
469: c3 ret
0000046a <kthread_create>:
#endif // VA2PA
#ifdef KTHREADS
SYSCALL(kthread_create)
46a: b8 1b 00 00 00 mov $0x1b,%eax
46f: cd 40 int $0x40
471: c3 ret
00000472 <kthread_join>:
SYSCALL(kthread_join)
472: b8 1c 00 00 00 mov $0x1c,%eax
477: cd 40 int $0x40
479: c3 ret
0000047a <kthread_exit>:
SYSCALL(kthread_exit)
47a: b8 1d 00 00 00 mov $0x1d,%eax
47f: cd 40 int $0x40
481: c3 ret
00000482 <kthread_self>:
#endif // KTHREADS
#ifdef BENNY_MOOTEX
SYSCALL(kthread_self)
482: b8 1e 00 00 00 mov $0x1e,%eax
487: cd 40 int $0x40
489: c3 ret
0000048a <kthread_yield>:
SYSCALL(kthread_yield)
48a: b8 1f 00 00 00 mov $0x1f,%eax
48f: cd 40 int $0x40
491: c3 ret
00000492 <kthread_cpu_count>:
SYSCALL(kthread_cpu_count)
492: b8 20 00 00 00 mov $0x20,%eax
497: cd 40 int $0x40
499: c3 ret
0000049a <kthread_thread_count>:
SYSCALL(kthread_thread_count)
49a: b8 21 00 00 00 mov $0x21,%eax
49f: cd 40 int $0x40
4a1: c3 ret
4a2: 66 90 xchg %ax,%ax
4a4: 66 90 xchg %ax,%ax
4a6: 66 90 xchg %ax,%ax
4a8: 66 90 xchg %ax,%ax
4aa: 66 90 xchg %ax,%ax
4ac: 66 90 xchg %ax,%ax
4ae: 66 90 xchg %ax,%ax
000004b0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
4b0: 55 push %ebp
4b1: 89 e5 mov %esp,%ebp
4b3: 57 push %edi
4b4: 56 push %esi
4b5: 89 c6 mov %eax,%esi
4b7: 53 push %ebx
4b8: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4bb: 8b 5d 08 mov 0x8(%ebp),%ebx
4be: 85 db test %ebx,%ebx
4c0: 74 09 je 4cb <printint+0x1b>
4c2: 89 d0 mov %edx,%eax
4c4: c1 e8 1f shr $0x1f,%eax
4c7: 84 c0 test %al,%al
4c9: 75 75 jne 540 <printint+0x90>
neg = 1;
x = -xx;
} else {
x = xx;
4cb: 89 d0 mov %edx,%eax
neg = 0;
4cd: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
4d4: 89 75 c0 mov %esi,-0x40(%ebp)
}
i = 0;
4d7: 31 ff xor %edi,%edi
4d9: 89 ce mov %ecx,%esi
4db: 8d 5d d7 lea -0x29(%ebp),%ebx
4de: eb 02 jmp 4e2 <printint+0x32>
do{
buf[i++] = digits[x % base];
4e0: 89 cf mov %ecx,%edi
4e2: 31 d2 xor %edx,%edx
4e4: f7 f6 div %esi
4e6: 8d 4f 01 lea 0x1(%edi),%ecx
4e9: 0f b6 92 e7 0b 00 00 movzbl 0xbe7(%edx),%edx
}while((x /= base) != 0);
4f0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
4f2: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
4f5: 75 e9 jne 4e0 <printint+0x30>
if(neg)
4f7: 8b 55 c4 mov -0x3c(%ebp),%edx
buf[i++] = digits[x % base];
4fa: 89 c8 mov %ecx,%eax
4fc: 8b 75 c0 mov -0x40(%ebp),%esi
if(neg)
4ff: 85 d2 test %edx,%edx
501: 74 08 je 50b <printint+0x5b>
buf[i++] = '-';
503: 8d 4f 02 lea 0x2(%edi),%ecx
506: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
50b: 8d 79 ff lea -0x1(%ecx),%edi
50e: 66 90 xchg %ax,%ax
510: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
515: 83 ef 01 sub $0x1,%edi
write(fd, &c, 1);
518: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
51f: 00
520: 89 5c 24 04 mov %ebx,0x4(%esp)
524: 89 34 24 mov %esi,(%esp)
527: 88 45 d7 mov %al,-0x29(%ebp)
52a: e8 93 fe ff ff call 3c2 <write>
while(--i >= 0)
52f: 83 ff ff cmp $0xffffffff,%edi
532: 75 dc jne 510 <printint+0x60>
putc(fd, buf[i]);
}
534: 83 c4 4c add $0x4c,%esp
537: 5b pop %ebx
538: 5e pop %esi
539: 5f pop %edi
53a: 5d pop %ebp
53b: c3 ret
53c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = -xx;
540: 89 d0 mov %edx,%eax
542: f7 d8 neg %eax
neg = 1;
544: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
54b: eb 87 jmp 4d4 <printint+0x24>
54d: 8d 76 00 lea 0x0(%esi),%esi
00000550 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
550: 55 push %ebp
551: 89 e5 mov %esp,%ebp
553: 57 push %edi
char *s;
int c, i, state;
uint *ap;
state = 0;
554: 31 ff xor %edi,%edi
{
556: 56 push %esi
557: 53 push %ebx
558: 83 ec 3c sub $0x3c,%esp
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
55b: 8b 5d 0c mov 0xc(%ebp),%ebx
ap = (uint*)(void*)&fmt + 1;
55e: 8d 45 10 lea 0x10(%ebp),%eax
{
561: 8b 75 08 mov 0x8(%ebp),%esi
ap = (uint*)(void*)&fmt + 1;
564: 89 45 d4 mov %eax,-0x2c(%ebp)
for(i = 0; fmt[i]; i++){
567: 0f b6 13 movzbl (%ebx),%edx
56a: 83 c3 01 add $0x1,%ebx
56d: 84 d2 test %dl,%dl
56f: 75 39 jne 5aa <printf+0x5a>
571: e9 ca 00 00 00 jmp 640 <printf+0xf0>
576: 66 90 xchg %ax,%ax
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
578: 83 fa 25 cmp $0x25,%edx
57b: 0f 84 c7 00 00 00 je 648 <printf+0xf8>
write(fd, &c, 1);
581: 8d 45 e0 lea -0x20(%ebp),%eax
584: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
58b: 00
58c: 89 44 24 04 mov %eax,0x4(%esp)
590: 89 34 24 mov %esi,(%esp)
state = '%';
} else {
putc(fd, c);
593: 88 55 e0 mov %dl,-0x20(%ebp)
write(fd, &c, 1);
596: e8 27 fe ff ff call 3c2 <write>
59b: 83 c3 01 add $0x1,%ebx
for(i = 0; fmt[i]; i++){
59e: 0f b6 53 ff movzbl -0x1(%ebx),%edx
5a2: 84 d2 test %dl,%dl
5a4: 0f 84 96 00 00 00 je 640 <printf+0xf0>
if(state == 0){
5aa: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
5ac: 0f be c2 movsbl %dl,%eax
if(state == 0){
5af: 74 c7 je 578 <printf+0x28>
}
} else if(state == '%'){
5b1: 83 ff 25 cmp $0x25,%edi
5b4: 75 e5 jne 59b <printf+0x4b>
if(c == 'd' || c == 'u'){
5b6: 83 fa 75 cmp $0x75,%edx
5b9: 0f 84 99 00 00 00 je 658 <printf+0x108>
5bf: 83 fa 64 cmp $0x64,%edx
5c2: 0f 84 90 00 00 00 je 658 <printf+0x108>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5c8: 25 f7 00 00 00 and $0xf7,%eax
5cd: 83 f8 70 cmp $0x70,%eax
5d0: 0f 84 aa 00 00 00 je 680 <printf+0x130>
putc(fd, '0');
putc(fd, 'x');
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5d6: 83 fa 73 cmp $0x73,%edx
5d9: 0f 84 e9 00 00 00 je 6c8 <printf+0x178>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5df: 83 fa 63 cmp $0x63,%edx
5e2: 0f 84 2b 01 00 00 je 713 <printf+0x1c3>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5e8: 83 fa 25 cmp $0x25,%edx
5eb: 0f 84 4f 01 00 00 je 740 <printf+0x1f0>
write(fd, &c, 1);
5f1: 8d 45 e6 lea -0x1a(%ebp),%eax
5f4: 83 c3 01 add $0x1,%ebx
5f7: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
5fe: 00
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
5ff: 31 ff xor %edi,%edi
write(fd, &c, 1);
601: 89 44 24 04 mov %eax,0x4(%esp)
605: 89 34 24 mov %esi,(%esp)
608: 89 55 d0 mov %edx,-0x30(%ebp)
60b: c6 45 e6 25 movb $0x25,-0x1a(%ebp)
60f: e8 ae fd ff ff call 3c2 <write>
putc(fd, c);
614: 8b 55 d0 mov -0x30(%ebp),%edx
write(fd, &c, 1);
617: 8d 45 e7 lea -0x19(%ebp),%eax
61a: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
621: 00
622: 89 44 24 04 mov %eax,0x4(%esp)
626: 89 34 24 mov %esi,(%esp)
putc(fd, c);
629: 88 55 e7 mov %dl,-0x19(%ebp)
write(fd, &c, 1);
62c: e8 91 fd ff ff call 3c2 <write>
for(i = 0; fmt[i]; i++){
631: 0f b6 53 ff movzbl -0x1(%ebx),%edx
635: 84 d2 test %dl,%dl
637: 0f 85 6d ff ff ff jne 5aa <printf+0x5a>
63d: 8d 76 00 lea 0x0(%esi),%esi
}
}
}
640: 83 c4 3c add $0x3c,%esp
643: 5b pop %ebx
644: 5e pop %esi
645: 5f pop %edi
646: 5d pop %ebp
647: c3 ret
state = '%';
648: bf 25 00 00 00 mov $0x25,%edi
64d: e9 49 ff ff ff jmp 59b <printf+0x4b>
652: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
658: c7 04 24 01 00 00 00 movl $0x1,(%esp)
65f: b9 0a 00 00 00 mov $0xa,%ecx
printint(fd, *ap, 16, 0);
664: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
667: 31 ff xor %edi,%edi
printint(fd, *ap, 16, 0);
669: 8b 10 mov (%eax),%edx
66b: 89 f0 mov %esi,%eax
66d: e8 3e fe ff ff call 4b0 <printint>
ap++;
672: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
676: e9 20 ff ff ff jmp 59b <printf+0x4b>
67b: 90 nop
67c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
680: 8d 45 e1 lea -0x1f(%ebp),%eax
683: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
68a: 00
68b: 89 44 24 04 mov %eax,0x4(%esp)
68f: 89 34 24 mov %esi,(%esp)
692: c6 45 e1 30 movb $0x30,-0x1f(%ebp)
696: e8 27 fd ff ff call 3c2 <write>
69b: 8d 45 e2 lea -0x1e(%ebp),%eax
69e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
6a5: 00
6a6: 89 44 24 04 mov %eax,0x4(%esp)
6aa: 89 34 24 mov %esi,(%esp)
6ad: c6 45 e2 78 movb $0x78,-0x1e(%ebp)
6b1: e8 0c fd ff ff call 3c2 <write>
printint(fd, *ap, 16, 0);
6b6: b9 10 00 00 00 mov $0x10,%ecx
6bb: c7 04 24 00 00 00 00 movl $0x0,(%esp)
6c2: eb a0 jmp 664 <printf+0x114>
6c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
6c8: 8b 45 d4 mov -0x2c(%ebp),%eax
ap++;
6cb: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
s = (char*)*ap;
6cf: 8b 38 mov (%eax),%edi
s = "(null)";
6d1: b8 e0 0b 00 00 mov $0xbe0,%eax
6d6: 85 ff test %edi,%edi
6d8: 0f 44 f8 cmove %eax,%edi
while(*s != 0){
6db: 0f b6 07 movzbl (%edi),%eax
6de: 84 c0 test %al,%al
6e0: 74 2a je 70c <printf+0x1bc>
6e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
6e8: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
6eb: 8d 45 e3 lea -0x1d(%ebp),%eax
s++;
6ee: 83 c7 01 add $0x1,%edi
write(fd, &c, 1);
6f1: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
6f8: 00
6f9: 89 44 24 04 mov %eax,0x4(%esp)
6fd: 89 34 24 mov %esi,(%esp)
700: e8 bd fc ff ff call 3c2 <write>
while(*s != 0){
705: 0f b6 07 movzbl (%edi),%eax
708: 84 c0 test %al,%al
70a: 75 dc jne 6e8 <printf+0x198>
state = 0;
70c: 31 ff xor %edi,%edi
70e: e9 88 fe ff ff jmp 59b <printf+0x4b>
putc(fd, *ap);
713: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
716: 31 ff xor %edi,%edi
putc(fd, *ap);
718: 8b 00 mov (%eax),%eax
write(fd, &c, 1);
71a: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
721: 00
722: 89 34 24 mov %esi,(%esp)
putc(fd, *ap);
725: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
728: 8d 45 e4 lea -0x1c(%ebp),%eax
72b: 89 44 24 04 mov %eax,0x4(%esp)
72f: e8 8e fc ff ff call 3c2 <write>
ap++;
734: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
738: e9 5e fe ff ff jmp 59b <printf+0x4b>
73d: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
740: 8d 45 e5 lea -0x1b(%ebp),%eax
state = 0;
743: 31 ff xor %edi,%edi
write(fd, &c, 1);
745: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
74c: 00
74d: 89 44 24 04 mov %eax,0x4(%esp)
751: 89 34 24 mov %esi,(%esp)
754: c6 45 e5 25 movb $0x25,-0x1b(%ebp)
758: e8 65 fc ff ff call 3c2 <write>
75d: e9 39 fe ff ff jmp 59b <printf+0x4b>
762: 66 90 xchg %ax,%ax
764: 66 90 xchg %ax,%ax
766: 66 90 xchg %ax,%ax
768: 66 90 xchg %ax,%ax
76a: 66 90 xchg %ax,%ax
76c: 66 90 xchg %ax,%ax
76e: 66 90 xchg %ax,%ax
00000770 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
770: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
771: a1 c8 10 00 00 mov 0x10c8,%eax
{
776: 89 e5 mov %esp,%ebp
778: 57 push %edi
779: 56 push %esi
77a: 53 push %ebx
77b: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
77e: 8b 08 mov (%eax),%ecx
bp = (Header*)ap - 1;
780: 8d 53 f8 lea -0x8(%ebx),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
783: 39 d0 cmp %edx,%eax
785: 72 11 jb 798 <free+0x28>
787: 90 nop
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
788: 39 c8 cmp %ecx,%eax
78a: 72 04 jb 790 <free+0x20>
78c: 39 ca cmp %ecx,%edx
78e: 72 10 jb 7a0 <free+0x30>
790: 89 c8 mov %ecx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
792: 39 d0 cmp %edx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
794: 8b 08 mov (%eax),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
796: 73 f0 jae 788 <free+0x18>
798: 39 ca cmp %ecx,%edx
79a: 72 04 jb 7a0 <free+0x30>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
79c: 39 c8 cmp %ecx,%eax
79e: 72 f0 jb 790 <free+0x20>
break;
if(bp + bp->s.size == p->s.ptr){
7a0: 8b 73 fc mov -0x4(%ebx),%esi
7a3: 8d 3c f2 lea (%edx,%esi,8),%edi
7a6: 39 cf cmp %ecx,%edi
7a8: 74 1e je 7c8 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
7aa: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
7ad: 8b 48 04 mov 0x4(%eax),%ecx
7b0: 8d 34 c8 lea (%eax,%ecx,8),%esi
7b3: 39 f2 cmp %esi,%edx
7b5: 74 28 je 7df <free+0x6f>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
7b7: 89 10 mov %edx,(%eax)
freep = p;
7b9: a3 c8 10 00 00 mov %eax,0x10c8
}
7be: 5b pop %ebx
7bf: 5e pop %esi
7c0: 5f pop %edi
7c1: 5d pop %ebp
7c2: c3 ret
7c3: 90 nop
7c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
7c8: 03 71 04 add 0x4(%ecx),%esi
7cb: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
7ce: 8b 08 mov (%eax),%ecx
7d0: 8b 09 mov (%ecx),%ecx
7d2: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
7d5: 8b 48 04 mov 0x4(%eax),%ecx
7d8: 8d 34 c8 lea (%eax,%ecx,8),%esi
7db: 39 f2 cmp %esi,%edx
7dd: 75 d8 jne 7b7 <free+0x47>
p->s.size += bp->s.size;
7df: 03 4b fc add -0x4(%ebx),%ecx
freep = p;
7e2: a3 c8 10 00 00 mov %eax,0x10c8
p->s.size += bp->s.size;
7e7: 89 48 04 mov %ecx,0x4(%eax)
p->s.ptr = bp->s.ptr;
7ea: 8b 53 f8 mov -0x8(%ebx),%edx
7ed: 89 10 mov %edx,(%eax)
}
7ef: 5b pop %ebx
7f0: 5e pop %esi
7f1: 5f pop %edi
7f2: 5d pop %ebp
7f3: c3 ret
7f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
7fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000800 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
800: 55 push %ebp
801: 89 e5 mov %esp,%ebp
803: 57 push %edi
804: 56 push %esi
805: 53 push %ebx
806: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
809: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
80c: 8b 1d c8 10 00 00 mov 0x10c8,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
812: 8d 48 07 lea 0x7(%eax),%ecx
815: c1 e9 03 shr $0x3,%ecx
if((prevp = freep) == 0){
818: 85 db test %ebx,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
81a: 8d 71 01 lea 0x1(%ecx),%esi
if((prevp = freep) == 0){
81d: 0f 84 9b 00 00 00 je 8be <malloc+0xbe>
823: 8b 13 mov (%ebx),%edx
825: 8b 7a 04 mov 0x4(%edx),%edi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
828: 39 fe cmp %edi,%esi
82a: 76 64 jbe 890 <malloc+0x90>
82c: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax
if(nu < 4096)
833: bb 00 80 00 00 mov $0x8000,%ebx
838: 89 45 e4 mov %eax,-0x1c(%ebp)
83b: eb 0e jmp 84b <malloc+0x4b>
83d: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
840: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
842: 8b 78 04 mov 0x4(%eax),%edi
845: 39 fe cmp %edi,%esi
847: 76 4f jbe 898 <malloc+0x98>
849: 89 c2 mov %eax,%edx
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
84b: 3b 15 c8 10 00 00 cmp 0x10c8,%edx
851: 75 ed jne 840 <malloc+0x40>
if(nu < 4096)
853: 8b 45 e4 mov -0x1c(%ebp),%eax
856: 81 fe 00 10 00 00 cmp $0x1000,%esi
85c: bf 00 10 00 00 mov $0x1000,%edi
861: 0f 43 fe cmovae %esi,%edi
864: 0f 42 c3 cmovb %ebx,%eax
p = sbrk(nu * sizeof(Header));
867: 89 04 24 mov %eax,(%esp)
86a: e8 bb fb ff ff call 42a <sbrk>
if(p == (char*)-1)
86f: 83 f8 ff cmp $0xffffffff,%eax
872: 74 18 je 88c <malloc+0x8c>
hp->s.size = nu;
874: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
877: 83 c0 08 add $0x8,%eax
87a: 89 04 24 mov %eax,(%esp)
87d: e8 ee fe ff ff call 770 <free>
return freep;
882: 8b 15 c8 10 00 00 mov 0x10c8,%edx
if((p = morecore(nunits)) == 0)
888: 85 d2 test %edx,%edx
88a: 75 b4 jne 840 <malloc+0x40>
return 0;
88c: 31 c0 xor %eax,%eax
88e: eb 20 jmp 8b0 <malloc+0xb0>
if(p->s.size >= nunits){
890: 89 d0 mov %edx,%eax
892: 89 da mov %ebx,%edx
894: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
898: 39 fe cmp %edi,%esi
89a: 74 1c je 8b8 <malloc+0xb8>
p->s.size -= nunits;
89c: 29 f7 sub %esi,%edi
89e: 89 78 04 mov %edi,0x4(%eax)
p += p->s.size;
8a1: 8d 04 f8 lea (%eax,%edi,8),%eax
p->s.size = nunits;
8a4: 89 70 04 mov %esi,0x4(%eax)
freep = prevp;
8a7: 89 15 c8 10 00 00 mov %edx,0x10c8
return (void*)(p + 1);
8ad: 83 c0 08 add $0x8,%eax
}
}
8b0: 83 c4 1c add $0x1c,%esp
8b3: 5b pop %ebx
8b4: 5e pop %esi
8b5: 5f pop %edi
8b6: 5d pop %ebp
8b7: c3 ret
prevp->s.ptr = p->s.ptr;
8b8: 8b 08 mov (%eax),%ecx
8ba: 89 0a mov %ecx,(%edx)
8bc: eb e9 jmp 8a7 <malloc+0xa7>
base.s.ptr = freep = prevp = &base;
8be: c7 05 c8 10 00 00 cc movl $0x10cc,0x10c8
8c5: 10 00 00
base.s.size = 0;
8c8: ba cc 10 00 00 mov $0x10cc,%edx
base.s.ptr = freep = prevp = &base;
8cd: c7 05 cc 10 00 00 cc movl $0x10cc,0x10cc
8d4: 10 00 00
base.s.size = 0;
8d7: c7 05 d0 10 00 00 00 movl $0x0,0x10d0
8de: 00 00 00
8e1: e9 46 ff ff ff jmp 82c <malloc+0x2c>
8e6: 66 90 xchg %ax,%ax
8e8: 66 90 xchg %ax,%ax
8ea: 66 90 xchg %ax,%ax
8ec: 66 90 xchg %ax,%ax
8ee: 66 90 xchg %ax,%ax
000008f0 <benny_thread_create>:
static struct benny_thread_s *bt_new(void);
int
benny_thread_create(benny_thread_t *abt, void (*func)(void*), void *arg_ptr)
{
8f0: 55 push %ebp
8f1: 89 e5 mov %esp,%ebp
8f3: 56 push %esi
8f4: 53 push %ebx
8f5: 83 ec 10 sub $0x10,%esp
}
static struct benny_thread_s *
bt_new(void)
{
struct benny_thread_s *bt = malloc(sizeof(struct benny_thread_s));
8f8: c7 04 24 0c 00 00 00 movl $0xc,(%esp)
8ff: e8 fc fe ff ff call 800 <malloc>
if (bt == NULL) {
904: 85 c0 test %eax,%eax
struct benny_thread_s *bt = malloc(sizeof(struct benny_thread_s));
906: 89 c6 mov %eax,%esi
if (bt == NULL) {
908: 74 66 je 970 <benny_thread_create+0x80>
// allocate 2 pages worth of memory and then make sure the
// beginning address used for the stack is page alligned.
// we want it page alligned so that we don't generate a
// page fault by accessing the stack for a thread.
bt->bt_stack = bt->mem_stack = malloc(PGSIZE * 2);
90a: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
911: e8 ea fe ff ff call 800 <malloc>
if (bt->bt_stack == NULL) {
916: 85 c0 test %eax,%eax
bt->bt_stack = bt->mem_stack = malloc(PGSIZE * 2);
918: 89 c3 mov %eax,%ebx
91a: 89 46 08 mov %eax,0x8(%esi)
91d: 89 46 04 mov %eax,0x4(%esi)
if (bt->bt_stack == NULL) {
920: 74 5d je 97f <benny_thread_create+0x8f>
free(bt);
return NULL;
}
if (((uint) bt->bt_stack) % PGSIZE != 0) {
922: 25 ff 0f 00 00 and $0xfff,%eax
927: 75 37 jne 960 <benny_thread_create+0x70>
// allign the thread stack to a page boundary
bt->bt_stack += (PGSIZE - ((uint) bt->bt_stack) % PGSIZE);
}
bt->bid = -1;
929: c7 06 ff ff ff ff movl $0xffffffff,(%esi)
bt->bid = kthread_create(func, arg_ptr, bt->bt_stack);
92f: 8b 45 10 mov 0x10(%ebp),%eax
932: 89 5c 24 08 mov %ebx,0x8(%esp)
936: 89 44 24 04 mov %eax,0x4(%esp)
93a: 8b 45 0c mov 0xc(%ebp),%eax
93d: 89 04 24 mov %eax,(%esp)
940: e8 25 fb ff ff call 46a <kthread_create>
if (bt->bid != 0) {
945: 85 c0 test %eax,%eax
bt->bid = kthread_create(func, arg_ptr, bt->bt_stack);
947: 89 06 mov %eax,(%esi)
if (bt->bid != 0) {
949: 74 2d je 978 <benny_thread_create+0x88>
*abt = (benny_thread_t) bt;
94b: 8b 45 08 mov 0x8(%ebp),%eax
94e: 89 30 mov %esi,(%eax)
result = 0;
950: 31 c0 xor %eax,%eax
}
952: 83 c4 10 add $0x10,%esp
955: 5b pop %ebx
956: 5e pop %esi
957: 5d pop %ebp
958: c3 ret
959: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
bt->bt_stack += (PGSIZE - ((uint) bt->bt_stack) % PGSIZE);
960: 29 c3 sub %eax,%ebx
962: 81 c3 00 10 00 00 add $0x1000,%ebx
968: 89 5e 04 mov %ebx,0x4(%esi)
96b: eb bc jmp 929 <benny_thread_create+0x39>
96d: 8d 76 00 lea 0x0(%esi),%esi
970: 8b 1d 04 00 00 00 mov 0x4,%ebx
976: eb b7 jmp 92f <benny_thread_create+0x3f>
int result = -1;
978: b8 ff ff ff ff mov $0xffffffff,%eax
97d: eb d3 jmp 952 <benny_thread_create+0x62>
free(bt);
97f: 89 34 24 mov %esi,(%esp)
return NULL;
982: 31 f6 xor %esi,%esi
free(bt);
984: e8 e7 fd ff ff call 770 <free>
989: 8b 5b 04 mov 0x4(%ebx),%ebx
98c: eb a1 jmp 92f <benny_thread_create+0x3f>
98e: 66 90 xchg %ax,%ax
00000990 <benny_thread_bid>:
{
990: 55 push %ebp
991: 89 e5 mov %esp,%ebp
return bt->bid;
993: 8b 45 08 mov 0x8(%ebp),%eax
}
996: 5d pop %ebp
return bt->bid;
997: 8b 00 mov (%eax),%eax
}
999: c3 ret
99a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000009a0 <benny_thread_join>:
{
9a0: 55 push %ebp
9a1: 89 e5 mov %esp,%ebp
9a3: 53 push %ebx
9a4: 83 ec 14 sub $0x14,%esp
9a7: 8b 5d 08 mov 0x8(%ebp),%ebx
retVal = kthread_join(bt->bid);
9aa: 8b 03 mov (%ebx),%eax
9ac: 89 04 24 mov %eax,(%esp)
9af: e8 be fa ff ff call 472 <kthread_join>
if (retVal == 0) {
9b4: 85 c0 test %eax,%eax
9b6: 75 27 jne 9df <benny_thread_join+0x3f>
free(bt->mem_stack);
9b8: 8b 53 08 mov 0x8(%ebx),%edx
9bb: 89 45 f4 mov %eax,-0xc(%ebp)
9be: 89 14 24 mov %edx,(%esp)
9c1: e8 aa fd ff ff call 770 <free>
bt->bt_stack = bt->mem_stack = NULL;
9c6: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx)
9cd: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx)
free(bt);
9d4: 89 1c 24 mov %ebx,(%esp)
9d7: e8 94 fd ff ff call 770 <free>
9dc: 8b 45 f4 mov -0xc(%ebp),%eax
}
9df: 83 c4 14 add $0x14,%esp
9e2: 5b pop %ebx
9e3: 5d pop %ebp
9e4: c3 ret
9e5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
9e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000009f0 <benny_thread_exit>:
{
9f0: 55 push %ebp
9f1: 89 e5 mov %esp,%ebp
}
9f3: 5d pop %ebp
return kthread_exit(exitValue);
9f4: e9 81 fa ff ff jmp 47a <kthread_exit>
9f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000a00 <benny_mootex_init>:
}
# ifdef BENNY_MOOTEX
int
benny_mootex_init(benny_mootex_t *benny_mootex)
{
a00: 55 push %ebp
a01: 89 e5 mov %esp,%ebp
a03: 8b 45 08 mov 0x8(%ebp),%eax
benny_mootex->locked = 0;
a06: c7 00 00 00 00 00 movl $0x0,(%eax)
benny_mootex->bid = -1;
a0c: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax)
return 0;
}
a13: 31 c0 xor %eax,%eax
a15: 5d pop %ebp
a16: c3 ret
a17: 89 f6 mov %esi,%esi
a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000a20 <benny_mootex_yieldlock>:
int
benny_mootex_yieldlock(benny_mootex_t *benny_mootex)
{
a20: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
a21: b8 01 00 00 00 mov $0x1,%eax
a26: 89 e5 mov %esp,%ebp
a28: 56 push %esi
a29: 53 push %ebx
a2a: 8b 5d 08 mov 0x8(%ebp),%ebx
a2d: f0 87 03 lock xchg %eax,(%ebx)
// #error this is the call to lock the mootex that will yield in a
// #error loop until the lock is acquired.
while(xchg(&benny_mootex->locked, 1) != 0){
a30: 85 c0 test %eax,%eax
a32: be 01 00 00 00 mov $0x1,%esi
a37: 74 15 je a4e <benny_mootex_yieldlock+0x2e>
a39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
benny_yield(void)
{
// # error This just gives up the rest of this scheduled time slice to
// # error another process/thread.
return kthread_yield();
a40: e8 45 fa ff ff call 48a <kthread_yield>
a45: 89 f0 mov %esi,%eax
a47: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&benny_mootex->locked, 1) != 0){
a4a: 85 c0 test %eax,%eax
a4c: 75 f2 jne a40 <benny_mootex_yieldlock+0x20>
return kthread_self();
a4e: e8 2f fa ff ff call 482 <kthread_self>
benny_mootex->bid = benny_self();
a53: 89 43 04 mov %eax,0x4(%ebx)
}
a56: 31 c0 xor %eax,%eax
a58: 5b pop %ebx
a59: 5e pop %esi
a5a: 5d pop %ebp
a5b: c3 ret
a5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000a60 <benny_mootex_spinlock>:
{
a60: 55 push %ebp
a61: ba 01 00 00 00 mov $0x1,%edx
a66: 89 e5 mov %esp,%ebp
a68: 53 push %ebx
a69: 83 ec 04 sub $0x4,%esp
a6c: 8b 5d 08 mov 0x8(%ebp),%ebx
a6f: 90 nop
a70: 89 d0 mov %edx,%eax
a72: f0 87 03 lock xchg %eax,(%ebx)
while(xchg(&benny_mootex->locked, 1) != 0){
a75: 85 c0 test %eax,%eax
a77: 75 f7 jne a70 <benny_mootex_spinlock+0x10>
return kthread_self();
a79: e8 04 fa ff ff call 482 <kthread_self>
benny_mootex->bid = benny_self();
a7e: 89 43 04 mov %eax,0x4(%ebx)
}
a81: 83 c4 04 add $0x4,%esp
a84: 31 c0 xor %eax,%eax
a86: 5b pop %ebx
a87: 5d pop %ebp
a88: c3 ret
a89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000a90 <benny_mootex_unlock>:
{
a90: 55 push %ebp
a91: 89 e5 mov %esp,%ebp
a93: 53 push %ebx
a94: 83 ec 04 sub $0x4,%esp
a97: 8b 5d 08 mov 0x8(%ebp),%ebx
return kthread_self();
a9a: e8 e3 f9 ff ff call 482 <kthread_self>
if(tid == benny_mootex->bid){
a9f: 39 43 04 cmp %eax,0x4(%ebx)
aa2: 75 1c jne ac0 <benny_mootex_unlock+0x30>
__sync_synchronize();
aa4: 0f ae f0 mfence
return 0;
aa7: 31 c0 xor %eax,%eax
benny_mootex->bid = -1;
aa9: c7 43 04 ff ff ff ff movl $0xffffffff,0x4(%ebx)
__sync_lock_release(&benny_mootex->locked);
ab0: c7 03 00 00 00 00 movl $0x0,(%ebx)
}
ab6: 83 c4 04 add $0x4,%esp
ab9: 5b pop %ebx
aba: 5d pop %ebp
abb: c3 ret
abc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ac0: 83 c4 04 add $0x4,%esp
return -1;
ac3: b8 ff ff ff ff mov $0xffffffff,%eax
}
ac8: 5b pop %ebx
ac9: 5d pop %ebp
aca: c3 ret
acb: 90 nop
acc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000ad0 <benny_mootex_trylock>:
{
ad0: 55 push %ebp
ad1: b8 01 00 00 00 mov $0x1,%eax
ad6: 89 e5 mov %esp,%ebp
ad8: 53 push %ebx
ad9: 83 ec 04 sub $0x4,%esp
adc: 8b 5d 08 mov 0x8(%ebp),%ebx
adf: f0 87 03 lock xchg %eax,(%ebx)
if(xchg(&benny_mootex->locked, 1) != 0){
ae2: 85 c0 test %eax,%eax
ae4: 75 08 jne aee <benny_mootex_trylock+0x1e>
int tid = kthread_self();
ae6: e8 97 f9 ff ff call 482 <kthread_self>
benny_mootex->bid = tid;
aeb: 89 43 04 mov %eax,0x4(%ebx)
}
aee: 83 c4 04 add $0x4,%esp
af1: b8 ff ff ff ff mov $0xffffffff,%eax
af6: 5b pop %ebx
af7: 5d pop %ebp
af8: c3 ret
af9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000b00 <benny_mootex_wholock>:
{
b00: 55 push %ebp
b01: 89 e5 mov %esp,%ebp
return benny_mootex->bid;
b03: 8b 45 08 mov 0x8(%ebp),%eax
}
b06: 5d pop %ebp
return benny_mootex->bid;
b07: 8b 40 04 mov 0x4(%eax),%eax
}
b0a: c3 ret
b0b: 90 nop
b0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000b10 <benny_mootex_islocked>:
{
b10: 55 push %ebp
b11: 89 e5 mov %esp,%ebp
return benny_mootex->locked;
b13: 8b 45 08 mov 0x8(%ebp),%eax
}
b16: 5d pop %ebp
return benny_mootex->locked;
b17: 8b 00 mov (%eax),%eax
}
b19: c3 ret
b1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000b20 <benny_self>:
{
b20: 55 push %ebp
b21: 89 e5 mov %esp,%ebp
}
b23: 5d pop %ebp
return kthread_self();
b24: e9 59 f9 ff ff jmp 482 <kthread_self>
b29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000b30 <benny_yield>:
{
b30: 55 push %ebp
b31: 89 e5 mov %esp,%ebp
}
b33: 5d pop %ebp
return kthread_yield();
b34: e9 51 f9 ff ff jmp 48a <kthread_yield>
b39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000b40 <benny_cpu_count>:
int
benny_cpu_count(void)
{
b40: 55 push %ebp
b41: 89 e5 mov %esp,%ebp
// # error call the kthread_cpu_count() function.
// kthread_cpu_count();
return kthread_cpu_count();
}
b43: 5d pop %ebp
return kthread_cpu_count();
b44: e9 49 f9 ff ff jmp 492 <kthread_cpu_count>
b49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000b50 <benny_thread_count>:
int
benny_thread_count(void)
{
b50: 55 push %ebp
b51: 89 e5 mov %esp,%ebp
// # error call the kthread_thread_count() function.
// kthread_thread_count()
return kthread_thread_count();
}
b53: 5d pop %ebp
return kthread_thread_count();
b54: e9 41 f9 ff ff jmp 49a <kthread_thread_count>
|
src/shaders/h264/ildb/AVC_ILDB_Chroma_Core_Mbaff.asm | martin-kokos/intel-vaapi-driver | 192 | 22859 | <filename>src/shaders/h264/ildb/AVC_ILDB_Chroma_Core_Mbaff.asm
/*
* Copyright © <2010>, Intel Corporation.
*
* 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, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*
* This file was originally licensed under the following license
*
* 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.
*
*/
////////// AVC ILDB Chroma Core Mbaff /////////////////////////////////////////////////////////////////////////////////
//
// This core performs AVC U or V ILDB filtering on one horizontal edge (8 pixels) of a MB.
// If data is transposed, it can also de-block a vertical edge.
//
// Bafore calling this subroutine, caller needs to set the following parameters.
//
// - EdgeCntlMap1 // Edge control map A
// - EdgeCntlMap2 // Edge control map B
// - P_AddrReg // Src and dest address register for P pixels
// - Q_AddrReg // Src and dest address register for Q pixels
// - alpha // alpha corresponding to the edge to be filtered
// - beta // beta corresponding to the edge to be filtered
// - tc0 // tc0 corresponding to the edge to be filtered
//
// U or V:
// +----+----+----+----+
// | P1 | p0 | q0 | q1 |
// +----+----+----+----+
//
// p1 = r[P_AddrReg, 0]<16;8,2>
// p0 = r[P_AddrReg, 16]<16;8,2>
// q0 = r[Q_AddrReg, 0]<16;8,2>
// q1 = r[Q_AddrReg, 16]<16;8,2>
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The region is both src and dest
// P0-P3 and Q0-Q3 should be only used if they have not been modified to new values
#undef P1
#undef P0
#undef Q0
#undef Q1
#define P1 r[P_AddrReg, 0]<16;8,2>:ub
#define P0 r[P_AddrReg, 16]<16;8,2>:ub
#define Q0 r[Q_AddrReg, 0]<16;8,2>:ub
#define Q1 r[Q_AddrReg, 16]<16;8,2>:ub
// New region as dest
#undef NewP0
#undef NewQ0
#define NewP0 r[P_AddrReg, 16]<2>:ub
#define NewQ0 r[Q_AddrReg, 0]<2>:ub
// Filter one chroma edge - mbaff
FILTER_UV_MBAFF:
#if defined(_DEBUG)
mov (1) EntrySignatureC:w 0x1112:w
#endif
//---------- Derive filterSampleflag in AVC spec, equition (8-469) ----------
//===== Assume f0.0 contains MaskA when entering this routine
// mov (1) f0.0:uw MaskA:uw
add (8) q0_p0(0)<1> Q0 -P0 // q0-p0
add (8) TempRow0(0)<1> P1 -P0 // p1-p0
add (8) TempRow1(0)<1> Q1 -Q0 // q1-q0
// Build FilterSampleFlag
// abs(q0-p0) < alpha
(f0.0) cmp.l.f0.0 (16) null:w (abs)q0_p0(0) Mbaff_ALPHA(0)
// abs(p1-p0) < Beta
(f0.0) cmp.l.f0.0 (16) null:w (abs)TempRow0(0) Mbaff_BETA(0)
// abs(q1-q0) < Beta
(f0.0) cmp.l.f0.0 (16) null:w (abs)TempRow1(0) Mbaff_BETA(0)
//-----------------------------------------------------------------------------------------
// if
(f0.0) if (8) MBAFF_UV_ENDIF1
// For channels whose edge control map1 = 1 ---> perform de-blocking
// mov (1) f0.1:w MaskB:w {NoMask} // Now check for which algorithm to apply
(f0.1) if (8) MBAFF_UV_ELSE2
// For channels whose edge control map2 = 1 ---> bS = 4 algorithm
// p0' = (2*p1 + P0 + q1 + 2) >> 2
// q0' = (2*q1 + q0 + p1 + 2) >> 2
//------------------------------------------------------------------------------------
// p0' = (2*p1 + p0 + q1 + 2) >> 2
add (8) acc0<1>:w Q1 2:w
mac (8) acc0<1>:w P1 2:w
add (8) acc0<1>:w acc0<8;8,1>:w P0
shr.sat (8) TempRow0B(0)<2> acc0<8;8,1>:w 2:w
// q0' = (2*q1 + q0 + p1 + 2) >> 2
add (8) acc0<1>:w P1 2:w
mac (8) acc0<1>:w Q1 2:w
add (8) acc0<1>:w acc0<8;8,1>:w Q0
shr.sat (8) TempRow1B(0)<2> acc0<8;8,1>:w 2:w
mov (8) NewP0 TempRow0B(0) // p0'
mov (8) NewQ0 TempRow1B(0) // q0'
MBAFF_UV_ELSE2:
else (8) MBAFF_UV_ENDIF2
// For channels whose edge control map2 = 0 ---> bS < 4 algorithm
// tc_exp = tc0_exp + 1
add (8) tc_exp(0)<1> Mbaff_TC0(0) 1:w
// delta = Clip3(-tc, tc, ((((q0 - p0)<<2) + (p1-q1) + 4) >> 3))
// 4 * (q0-p0) + p1 - q1 + 4
add (8) acc0<1>:w P1 4:w
mac (8) acc0<1>:w q0_p0(0) 4:w
add (8) acc0<1>:w acc0<8;8,1>:w -Q1
shr (8) TempRow0(0)<1> acc0<8;8,1>:w 3:w
// tc clip
cmp.g.f0.0 (8) null:w TempRow0(0) tc_exp(0) // Clip if > tc0
cmp.l.f0.1 (8) null:w TempRow0(0) -tc_exp(0) // Clip if < -tc0
(f0.0) mov (8) TempRow0(0)<1> tc_exp(0)
(f0.1) mov (8) TempRow0(0)<1> -tc_exp(0)
// p0' = Clip1(p0 + delta) = Clip3(0, 0xFF, p0 + delta)
add.sat (8) TempRow1B(0)<2> P0 TempRow0(0) // p0+delta
// q0' = Clip1(q0 - delta) = Clip3(0, 0xFF, q0 - delta)
add.sat (8) TempRow0B(0)<2> Q0 -TempRow0(0) // q0-delta
mov (8) NewP0 TempRow1B(0) // p0'
mov (8) NewQ0 TempRow0B(0) // q0'
endif
MBAFF_UV_ENDIF2:
MBAFF_UV_ENDIF1:
endif
RETURN
|
programs/oeis/198/A198308.asm | neoneye/loda | 22 | 172803 | ; A198308: Moore lower bound on the order of an (8,g)-cage.
; 9,16,65,114,457,800,3201,5602,22409,39216,156865,274514,1098057,1921600,7686401,13451202,53804809,94158416,376633665,659108914,2636435657,4613762400,18455049601,32296336802,129185347209,226074357616,904297430465,1582520503314,6330082013257,11077643523200,44310574092801,77543504662402,310174018649609,542804532636816,2171218130547265,3799631728457714,15198526913830857,26597422099204000,106389688396816001,186181954694428002,744727818777712009,1303273682860996016,5213094731443984065,9122915780026972114,36491663120107888457,63860410460188804800,255441641840755219201,447022873221321633602,1788091492885286534409,3129160112549251435216,12516640450197005740865,21904120787844760046514,87616483151379040186057,153328845514913320325600,613315382059653281302401,1073301918604393242279202,4293207674417572969116809,7513113430230752695954416,30052453720923010783817665,52591794011615268871680914,210367176046461075486723657,368142558081306882101766400,1472570232325227528407065601,2576997906569148174712364802,10307991626276592698849459209,18038985345984037222986553616,72155941383936148891946214465,126272897421888260560905875314,505091589687553042243623501257,883910281953217823926341127200,3535641127812871295705364508801,6187371973672524767484387890402,24749487894690099069937551561609,43311603815707673372390715232816,173246415262830693489562860931265,303181226709953713606735006629714,1212724906839814854426940026518857,2122268586969675995247145046408000,8489074347878703980988580185632001,14855880108787731966730015324856002,59423520435150927866920061299424009,103991160761514123767110107273992016,415964643046056495068440429095968065,727938125330598866369770750917944114
mov $1,1
lpb $0
mov $2,$1
trn $2,$0
sub $0,1
add $1,1
mul $2,6
add $1,$2
lpe
sub $1,1
mul $1,7
add $1,9
mov $0,$1
|
source/web/tools/wsdl2ada/wsdl-ast.ads | svn2github/matreshka | 24 | 12342 | <reponame>svn2github/matreshka<filename>source/web/tools/wsdl2ada/wsdl-ast.ads<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Root package for AST of WSDL.
------------------------------------------------------------------------------
with Ada.Containers;
with League.Strings;
limited with WSDL.AST.Bindings;
limited with WSDL.AST.Descriptions;
limited with WSDL.AST.Faults;
limited with WSDL.AST.Interfaces;
limited with WSDL.AST.Messages;
limited with WSDL.AST.Operations;
limited with WSDL.Iterators;
limited with WSDL.Visitors;
package WSDL.AST is
pragma Preelaborate;
type Qualified_Name is record
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
end record;
function Image
(Item : Qualified_Name) return League.Strings.Universal_String;
function Hash (Item : Qualified_Name) return Ada.Containers.Hash_Type;
type Message_Content_Models is (Element, Any, None, Other);
type Message_Directions is (In_Message, Out_Message);
-------------------
-- Abstract Node --
-------------------
type Abstract_Node is abstract tagged record
null;
end record;
type Node_Access is access all Abstract_Node'Class;
not overriding procedure Enter
(Self : not null access Abstract_Node;
Visitor : in out WSDL.Visitors.WSDL_Visitor'Class;
Control : in out WSDL.Iterators.Traverse_Control) is abstract;
not overriding procedure Leave
(Self : not null access Abstract_Node;
Visitor : in out WSDL.Visitors.WSDL_Visitor'Class;
Control : in out WSDL.Iterators.Traverse_Control) is abstract;
not overriding procedure Visit
(Self : not null access Abstract_Node;
Iterator : in out WSDL.Iterators.WSDL_Iterator'Class;
Visitor : in out WSDL.Visitors.WSDL_Visitor'Class;
Control : in out WSDL.Iterators.Traverse_Control) is abstract;
type Binding_Access is access all WSDL.AST.Bindings.Binding_Node'Class;
type Binding_Fault_Access is
access all WSDL.AST.Faults.Binding_Fault_Node'Class;
type Binding_Operation_Access is
access all WSDL.AST.Operations.Binding_Operation_Node'Class;
type Description_Access is
access all WSDL.AST.Descriptions.Description_Node'Class;
type Interface_Access is
access all WSDL.AST.Interfaces.Interface_Node'Class;
type Interface_Fault_Access is
access all WSDL.AST.Faults.Interface_Fault_Node'Class;
type Interface_Message_Access is
access all WSDL.AST.Messages.Interface_Message_Node'Class;
type Interface_Operation_Access is
access all WSDL.AST.Operations.Interface_Operation_Node'Class;
type Interface_Fault_Reference_Access is
access all WSDL.AST.Faults.Interface_Fault_Reference_Node'Class;
end WSDL.AST;
|
tyield.asm | jhsie007/xv6 | 0 | 92540 |
_tyield: file format elf32-i386
Disassembly of section .text:
00001000 <main>:
// Test functions for yielding, prints "beep" and "boop".
void one(void * arg_ptr);
void two(void * arg_ptr);
int main(){
1000: 55 push %ebp
1001: 89 e5 mov %esp,%ebp
1003: 83 e4 f0 and $0xfffffff0,%esp
1006: 83 ec 20 sub $0x20,%esp
int arg = 10;
1009: c7 44 24 14 0a 00 00 movl $0xa,0x14(%esp)
1010: 00
void *tid;
int i;
tid = thread_create(one, (void *) &arg);
1011: 8d 44 24 14 lea 0x14(%esp),%eax
1015: 89 44 24 04 mov %eax,0x4(%esp)
1019: c7 04 24 c2 10 00 00 movl $0x10c2,(%esp)
1020: e8 ca 0a 00 00 call 1aef <thread_create>
1025: 89 44 24 18 mov %eax,0x18(%esp)
if(tid <= 0){
1029: 83 7c 24 18 00 cmpl $0x0,0x18(%esp)
102e: 75 19 jne 1049 <main+0x49>
printf(1, "Thread Creation Failed\n");
1030: c7 44 24 04 fd 1c 00 movl $0x1cfd,0x4(%esp)
1037: 00
1038: c7 04 24 01 00 00 00 movl $0x1,(%esp)
103f: e8 78 06 00 00 call 16bc <printf>
exit();
1044: e8 cb 04 00 00 call 1514 <exit>
}
for(i = 0; i < 2999999; i++);
1049: c7 44 24 1c 00 00 00 movl $0x0,0x1c(%esp)
1050: 00
1051: eb 05 jmp 1058 <main+0x58>
1053: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
1058: 81 7c 24 1c be c6 2d cmpl $0x2dc6be,0x1c(%esp)
105f: 00
1060: 7e f1 jle 1053 <main+0x53>
tid = thread_create(two, (void *) &arg);
1062: 8d 44 24 14 lea 0x14(%esp),%eax
1066: 89 44 24 04 mov %eax,0x4(%esp)
106a: c7 04 24 b8 11 00 00 movl $0x11b8,(%esp)
1071: e8 79 0a 00 00 call 1aef <thread_create>
1076: 89 44 24 18 mov %eax,0x18(%esp)
if(tid <= 0){
107a: 83 7c 24 18 00 cmpl $0x0,0x18(%esp)
107f: 75 19 jne 109a <main+0x9a>
printf(1, "Thread Creation Failed\n");
1081: c7 44 24 04 fd 1c 00 movl $0x1cfd,0x4(%esp)
1088: 00
1089: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1090: e8 27 06 00 00 call 16bc <printf>
exit();
1095: e8 7a 04 00 00 call 1514 <exit>
}
for(i = 0; i < 2999999; i++);
109a: c7 44 24 1c 00 00 00 movl $0x0,0x1c(%esp)
10a1: 00
10a2: eb 05 jmp 10a9 <main+0xa9>
10a4: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
10a9: 81 7c 24 1c be c6 2d cmpl $0x2dc6be,0x1c(%esp)
10b0: 00
10b1: 7e f1 jle 10a4 <main+0xa4>
while(wait()>=0);
10b3: 90 nop
10b4: e8 63 04 00 00 call 151c <wait>
10b9: 85 c0 test %eax,%eax
10bb: 79 f7 jns 10b4 <main+0xb4>
exit();
10bd: e8 52 04 00 00 call 1514 <exit>
000010c2 <one>:
return 0;
}
void one(void *arg_ptr){
10c2: 55 push %ebp
10c3: 89 e5 mov %esp,%ebp
10c5: 83 ec 28 sub $0x28,%esp
int j;
for(j = 0; j < 2999999; j++);
10c8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
10cf: eb 04 jmp 10d5 <one+0x13>
10d1: 83 45 f4 01 addl $0x1,-0xc(%ebp)
10d5: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
10dc: 7e f3 jle 10d1 <one+0xf>
thread_yield();
10de: e8 f1 04 00 00 call 15d4 <thread_yield>
printf(1, "one\n");
10e3: c7 44 24 04 15 1d 00 movl $0x1d15,0x4(%esp)
10ea: 00
10eb: c7 04 24 01 00 00 00 movl $0x1,(%esp)
10f2: e8 c5 05 00 00 call 16bc <printf>
for(j = 0; j < 2999999; j++);
10f7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
10fe: eb 04 jmp 1104 <one+0x42>
1100: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1104: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
110b: 7e f3 jle 1100 <one+0x3e>
thread_yield();
110d: e8 c2 04 00 00 call 15d4 <thread_yield>
printf(1, "one\n");
1112: c7 44 24 04 15 1d 00 movl $0x1d15,0x4(%esp)
1119: 00
111a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1121: e8 96 05 00 00 call 16bc <printf>
for(j = 0; j < 2999999; j++);
1126: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
112d: eb 04 jmp 1133 <one+0x71>
112f: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1133: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
113a: 7e f3 jle 112f <one+0x6d>
thread_yield();
113c: e8 93 04 00 00 call 15d4 <thread_yield>
printf(1, "one\n");
1141: c7 44 24 04 15 1d 00 movl $0x1d15,0x4(%esp)
1148: 00
1149: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1150: e8 67 05 00 00 call 16bc <printf>
for(j = 0; j < 2999999; j++);
1155: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
115c: eb 04 jmp 1162 <one+0xa0>
115e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1162: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
1169: 7e f3 jle 115e <one+0x9c>
thread_yield();
116b: e8 64 04 00 00 call 15d4 <thread_yield>
printf(1, "one\n");
1170: c7 44 24 04 15 1d 00 movl $0x1d15,0x4(%esp)
1177: 00
1178: c7 04 24 01 00 00 00 movl $0x1,(%esp)
117f: e8 38 05 00 00 call 16bc <printf>
for(j = 0; j < 2999999; j++);
1184: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
118b: eb 04 jmp 1191 <one+0xcf>
118d: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1191: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
1198: 7e f3 jle 118d <one+0xcb>
thread_yield();
119a: e8 35 04 00 00 call 15d4 <thread_yield>
printf(1, "one\n");
119f: c7 44 24 04 15 1d 00 movl $0x1d15,0x4(%esp)
11a6: 00
11a7: c7 04 24 01 00 00 00 movl $0x1,(%esp)
11ae: e8 09 05 00 00 call 16bc <printf>
texit();
11b3: e8 04 04 00 00 call 15bc <texit>
000011b8 <two>:
}
void two(void *arg_ptr){
11b8: 55 push %ebp
11b9: 89 e5 mov %esp,%ebp
11bb: 83 ec 28 sub $0x28,%esp
int j;
for(j = 0; j < 2999999; j++);
11be: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
11c5: eb 04 jmp 11cb <two+0x13>
11c7: 83 45 f4 01 addl $0x1,-0xc(%ebp)
11cb: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
11d2: 7e f3 jle 11c7 <two+0xf>
printf(1, "two\n");
11d4: c7 44 24 04 1a 1d 00 movl $0x1d1a,0x4(%esp)
11db: 00
11dc: c7 04 24 01 00 00 00 movl $0x1,(%esp)
11e3: e8 d4 04 00 00 call 16bc <printf>
thread_yield();
11e8: e8 e7 03 00 00 call 15d4 <thread_yield>
for(j = 0; j < 2999999; j++);
11ed: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
11f4: eb 04 jmp 11fa <two+0x42>
11f6: 83 45 f4 01 addl $0x1,-0xc(%ebp)
11fa: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
1201: 7e f3 jle 11f6 <two+0x3e>
printf(1, "two\n");
1203: c7 44 24 04 1a 1d 00 movl $0x1d1a,0x4(%esp)
120a: 00
120b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1212: e8 a5 04 00 00 call 16bc <printf>
thread_yield();
1217: e8 b8 03 00 00 call 15d4 <thread_yield>
for(j = 0; j < 2999999; j++);
121c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1223: eb 04 jmp 1229 <two+0x71>
1225: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1229: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
1230: 7e f3 jle 1225 <two+0x6d>
printf(1, "two\n");
1232: c7 44 24 04 1a 1d 00 movl $0x1d1a,0x4(%esp)
1239: 00
123a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1241: e8 76 04 00 00 call 16bc <printf>
thread_yield();
1246: e8 89 03 00 00 call 15d4 <thread_yield>
for(j = 0; j < 2999999; j++);
124b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1252: eb 04 jmp 1258 <two+0xa0>
1254: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1258: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
125f: 7e f3 jle 1254 <two+0x9c>
printf(1, "two\n");
1261: c7 44 24 04 1a 1d 00 movl $0x1d1a,0x4(%esp)
1268: 00
1269: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1270: e8 47 04 00 00 call 16bc <printf>
thread_yield();
1275: e8 5a 03 00 00 call 15d4 <thread_yield>
for(j = 0; j < 2999999; j++);
127a: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1281: eb 04 jmp 1287 <two+0xcf>
1283: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1287: 81 7d f4 be c6 2d 00 cmpl $0x2dc6be,-0xc(%ebp)
128e: 7e f3 jle 1283 <two+0xcb>
printf(1, "two\n");
1290: c7 44 24 04 1a 1d 00 movl $0x1d1a,0x4(%esp)
1297: 00
1298: c7 04 24 01 00 00 00 movl $0x1,(%esp)
129f: e8 18 04 00 00 call 16bc <printf>
texit();
12a4: e8 13 03 00 00 call 15bc <texit>
12a9: 66 90 xchg %ax,%ax
12ab: 90 nop
000012ac <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
12ac: 55 push %ebp
12ad: 89 e5 mov %esp,%ebp
12af: 57 push %edi
12b0: 53 push %ebx
asm volatile("cld; rep stosb" :
12b1: 8b 4d 08 mov 0x8(%ebp),%ecx
12b4: 8b 55 10 mov 0x10(%ebp),%edx
12b7: 8b 45 0c mov 0xc(%ebp),%eax
12ba: 89 cb mov %ecx,%ebx
12bc: 89 df mov %ebx,%edi
12be: 89 d1 mov %edx,%ecx
12c0: fc cld
12c1: f3 aa rep stos %al,%es:(%edi)
12c3: 89 ca mov %ecx,%edx
12c5: 89 fb mov %edi,%ebx
12c7: 89 5d 08 mov %ebx,0x8(%ebp)
12ca: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
12cd: 5b pop %ebx
12ce: 5f pop %edi
12cf: 5d pop %ebp
12d0: c3 ret
000012d1 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
12d1: 55 push %ebp
12d2: 89 e5 mov %esp,%ebp
12d4: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
12d7: 8b 45 08 mov 0x8(%ebp),%eax
12da: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
12dd: 90 nop
12de: 8b 45 08 mov 0x8(%ebp),%eax
12e1: 8d 50 01 lea 0x1(%eax),%edx
12e4: 89 55 08 mov %edx,0x8(%ebp)
12e7: 8b 55 0c mov 0xc(%ebp),%edx
12ea: 8d 4a 01 lea 0x1(%edx),%ecx
12ed: 89 4d 0c mov %ecx,0xc(%ebp)
12f0: 0f b6 12 movzbl (%edx),%edx
12f3: 88 10 mov %dl,(%eax)
12f5: 0f b6 00 movzbl (%eax),%eax
12f8: 84 c0 test %al,%al
12fa: 75 e2 jne 12de <strcpy+0xd>
;
return os;
12fc: 8b 45 fc mov -0x4(%ebp),%eax
}
12ff: c9 leave
1300: c3 ret
00001301 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1301: 55 push %ebp
1302: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
1304: eb 08 jmp 130e <strcmp+0xd>
p++, q++;
1306: 83 45 08 01 addl $0x1,0x8(%ebp)
130a: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
130e: 8b 45 08 mov 0x8(%ebp),%eax
1311: 0f b6 00 movzbl (%eax),%eax
1314: 84 c0 test %al,%al
1316: 74 10 je 1328 <strcmp+0x27>
1318: 8b 45 08 mov 0x8(%ebp),%eax
131b: 0f b6 10 movzbl (%eax),%edx
131e: 8b 45 0c mov 0xc(%ebp),%eax
1321: 0f b6 00 movzbl (%eax),%eax
1324: 38 c2 cmp %al,%dl
1326: 74 de je 1306 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
1328: 8b 45 08 mov 0x8(%ebp),%eax
132b: 0f b6 00 movzbl (%eax),%eax
132e: 0f b6 d0 movzbl %al,%edx
1331: 8b 45 0c mov 0xc(%ebp),%eax
1334: 0f b6 00 movzbl (%eax),%eax
1337: 0f b6 c0 movzbl %al,%eax
133a: 29 c2 sub %eax,%edx
133c: 89 d0 mov %edx,%eax
}
133e: 5d pop %ebp
133f: c3 ret
00001340 <strlen>:
uint
strlen(char *s)
{
1340: 55 push %ebp
1341: 89 e5 mov %esp,%ebp
1343: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1346: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
134d: eb 04 jmp 1353 <strlen+0x13>
134f: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1353: 8b 55 fc mov -0x4(%ebp),%edx
1356: 8b 45 08 mov 0x8(%ebp),%eax
1359: 01 d0 add %edx,%eax
135b: 0f b6 00 movzbl (%eax),%eax
135e: 84 c0 test %al,%al
1360: 75 ed jne 134f <strlen+0xf>
;
return n;
1362: 8b 45 fc mov -0x4(%ebp),%eax
}
1365: c9 leave
1366: c3 ret
00001367 <memset>:
void*
memset(void *dst, int c, uint n)
{
1367: 55 push %ebp
1368: 89 e5 mov %esp,%ebp
136a: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
136d: 8b 45 10 mov 0x10(%ebp),%eax
1370: 89 44 24 08 mov %eax,0x8(%esp)
1374: 8b 45 0c mov 0xc(%ebp),%eax
1377: 89 44 24 04 mov %eax,0x4(%esp)
137b: 8b 45 08 mov 0x8(%ebp),%eax
137e: 89 04 24 mov %eax,(%esp)
1381: e8 26 ff ff ff call 12ac <stosb>
return dst;
1386: 8b 45 08 mov 0x8(%ebp),%eax
}
1389: c9 leave
138a: c3 ret
0000138b <strchr>:
char*
strchr(const char *s, char c)
{
138b: 55 push %ebp
138c: 89 e5 mov %esp,%ebp
138e: 83 ec 04 sub $0x4,%esp
1391: 8b 45 0c mov 0xc(%ebp),%eax
1394: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
1397: eb 14 jmp 13ad <strchr+0x22>
if(*s == c)
1399: 8b 45 08 mov 0x8(%ebp),%eax
139c: 0f b6 00 movzbl (%eax),%eax
139f: 3a 45 fc cmp -0x4(%ebp),%al
13a2: 75 05 jne 13a9 <strchr+0x1e>
return (char*)s;
13a4: 8b 45 08 mov 0x8(%ebp),%eax
13a7: eb 13 jmp 13bc <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
13a9: 83 45 08 01 addl $0x1,0x8(%ebp)
13ad: 8b 45 08 mov 0x8(%ebp),%eax
13b0: 0f b6 00 movzbl (%eax),%eax
13b3: 84 c0 test %al,%al
13b5: 75 e2 jne 1399 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
13b7: b8 00 00 00 00 mov $0x0,%eax
}
13bc: c9 leave
13bd: c3 ret
000013be <gets>:
char*
gets(char *buf, int max)
{
13be: 55 push %ebp
13bf: 89 e5 mov %esp,%ebp
13c1: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
13c4: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
13cb: eb 4c jmp 1419 <gets+0x5b>
cc = read(0, &c, 1);
13cd: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
13d4: 00
13d5: 8d 45 ef lea -0x11(%ebp),%eax
13d8: 89 44 24 04 mov %eax,0x4(%esp)
13dc: c7 04 24 00 00 00 00 movl $0x0,(%esp)
13e3: e8 44 01 00 00 call 152c <read>
13e8: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
13eb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
13ef: 7f 02 jg 13f3 <gets+0x35>
break;
13f1: eb 31 jmp 1424 <gets+0x66>
buf[i++] = c;
13f3: 8b 45 f4 mov -0xc(%ebp),%eax
13f6: 8d 50 01 lea 0x1(%eax),%edx
13f9: 89 55 f4 mov %edx,-0xc(%ebp)
13fc: 89 c2 mov %eax,%edx
13fe: 8b 45 08 mov 0x8(%ebp),%eax
1401: 01 c2 add %eax,%edx
1403: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1407: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
1409: 0f b6 45 ef movzbl -0x11(%ebp),%eax
140d: 3c 0a cmp $0xa,%al
140f: 74 13 je 1424 <gets+0x66>
1411: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1415: 3c 0d cmp $0xd,%al
1417: 74 0b je 1424 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
1419: 8b 45 f4 mov -0xc(%ebp),%eax
141c: 83 c0 01 add $0x1,%eax
141f: 3b 45 0c cmp 0xc(%ebp),%eax
1422: 7c a9 jl 13cd <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1424: 8b 55 f4 mov -0xc(%ebp),%edx
1427: 8b 45 08 mov 0x8(%ebp),%eax
142a: 01 d0 add %edx,%eax
142c: c6 00 00 movb $0x0,(%eax)
return buf;
142f: 8b 45 08 mov 0x8(%ebp),%eax
}
1432: c9 leave
1433: c3 ret
00001434 <stat>:
int
stat(char *n, struct stat *st)
{
1434: 55 push %ebp
1435: 89 e5 mov %esp,%ebp
1437: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
143a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1441: 00
1442: 8b 45 08 mov 0x8(%ebp),%eax
1445: 89 04 24 mov %eax,(%esp)
1448: e8 07 01 00 00 call 1554 <open>
144d: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
1450: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1454: 79 07 jns 145d <stat+0x29>
return -1;
1456: b8 ff ff ff ff mov $0xffffffff,%eax
145b: eb 23 jmp 1480 <stat+0x4c>
r = fstat(fd, st);
145d: 8b 45 0c mov 0xc(%ebp),%eax
1460: 89 44 24 04 mov %eax,0x4(%esp)
1464: 8b 45 f4 mov -0xc(%ebp),%eax
1467: 89 04 24 mov %eax,(%esp)
146a: e8 fd 00 00 00 call 156c <fstat>
146f: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
1472: 8b 45 f4 mov -0xc(%ebp),%eax
1475: 89 04 24 mov %eax,(%esp)
1478: e8 bf 00 00 00 call 153c <close>
return r;
147d: 8b 45 f0 mov -0x10(%ebp),%eax
}
1480: c9 leave
1481: c3 ret
00001482 <atoi>:
int
atoi(const char *s)
{
1482: 55 push %ebp
1483: 89 e5 mov %esp,%ebp
1485: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
1488: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
148f: eb 25 jmp 14b6 <atoi+0x34>
n = n*10 + *s++ - '0';
1491: 8b 55 fc mov -0x4(%ebp),%edx
1494: 89 d0 mov %edx,%eax
1496: c1 e0 02 shl $0x2,%eax
1499: 01 d0 add %edx,%eax
149b: 01 c0 add %eax,%eax
149d: 89 c1 mov %eax,%ecx
149f: 8b 45 08 mov 0x8(%ebp),%eax
14a2: 8d 50 01 lea 0x1(%eax),%edx
14a5: 89 55 08 mov %edx,0x8(%ebp)
14a8: 0f b6 00 movzbl (%eax),%eax
14ab: 0f be c0 movsbl %al,%eax
14ae: 01 c8 add %ecx,%eax
14b0: 83 e8 30 sub $0x30,%eax
14b3: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
14b6: 8b 45 08 mov 0x8(%ebp),%eax
14b9: 0f b6 00 movzbl (%eax),%eax
14bc: 3c 2f cmp $0x2f,%al
14be: 7e 0a jle 14ca <atoi+0x48>
14c0: 8b 45 08 mov 0x8(%ebp),%eax
14c3: 0f b6 00 movzbl (%eax),%eax
14c6: 3c 39 cmp $0x39,%al
14c8: 7e c7 jle 1491 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
14ca: 8b 45 fc mov -0x4(%ebp),%eax
}
14cd: c9 leave
14ce: c3 ret
000014cf <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
14cf: 55 push %ebp
14d0: 89 e5 mov %esp,%ebp
14d2: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
14d5: 8b 45 08 mov 0x8(%ebp),%eax
14d8: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
14db: 8b 45 0c mov 0xc(%ebp),%eax
14de: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
14e1: eb 17 jmp 14fa <memmove+0x2b>
*dst++ = *src++;
14e3: 8b 45 fc mov -0x4(%ebp),%eax
14e6: 8d 50 01 lea 0x1(%eax),%edx
14e9: 89 55 fc mov %edx,-0x4(%ebp)
14ec: 8b 55 f8 mov -0x8(%ebp),%edx
14ef: 8d 4a 01 lea 0x1(%edx),%ecx
14f2: 89 4d f8 mov %ecx,-0x8(%ebp)
14f5: 0f b6 12 movzbl (%edx),%edx
14f8: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
14fa: 8b 45 10 mov 0x10(%ebp),%eax
14fd: 8d 50 ff lea -0x1(%eax),%edx
1500: 89 55 10 mov %edx,0x10(%ebp)
1503: 85 c0 test %eax,%eax
1505: 7f dc jg 14e3 <memmove+0x14>
*dst++ = *src++;
return vdst;
1507: 8b 45 08 mov 0x8(%ebp),%eax
}
150a: c9 leave
150b: c3 ret
0000150c <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
150c: b8 01 00 00 00 mov $0x1,%eax
1511: cd 40 int $0x40
1513: c3 ret
00001514 <exit>:
SYSCALL(exit)
1514: b8 02 00 00 00 mov $0x2,%eax
1519: cd 40 int $0x40
151b: c3 ret
0000151c <wait>:
SYSCALL(wait)
151c: b8 03 00 00 00 mov $0x3,%eax
1521: cd 40 int $0x40
1523: c3 ret
00001524 <pipe>:
SYSCALL(pipe)
1524: b8 04 00 00 00 mov $0x4,%eax
1529: cd 40 int $0x40
152b: c3 ret
0000152c <read>:
SYSCALL(read)
152c: b8 05 00 00 00 mov $0x5,%eax
1531: cd 40 int $0x40
1533: c3 ret
00001534 <write>:
SYSCALL(write)
1534: b8 10 00 00 00 mov $0x10,%eax
1539: cd 40 int $0x40
153b: c3 ret
0000153c <close>:
SYSCALL(close)
153c: b8 15 00 00 00 mov $0x15,%eax
1541: cd 40 int $0x40
1543: c3 ret
00001544 <kill>:
SYSCALL(kill)
1544: b8 06 00 00 00 mov $0x6,%eax
1549: cd 40 int $0x40
154b: c3 ret
0000154c <exec>:
SYSCALL(exec)
154c: b8 07 00 00 00 mov $0x7,%eax
1551: cd 40 int $0x40
1553: c3 ret
00001554 <open>:
SYSCALL(open)
1554: b8 0f 00 00 00 mov $0xf,%eax
1559: cd 40 int $0x40
155b: c3 ret
0000155c <mknod>:
SYSCALL(mknod)
155c: b8 11 00 00 00 mov $0x11,%eax
1561: cd 40 int $0x40
1563: c3 ret
00001564 <unlink>:
SYSCALL(unlink)
1564: b8 12 00 00 00 mov $0x12,%eax
1569: cd 40 int $0x40
156b: c3 ret
0000156c <fstat>:
SYSCALL(fstat)
156c: b8 08 00 00 00 mov $0x8,%eax
1571: cd 40 int $0x40
1573: c3 ret
00001574 <link>:
SYSCALL(link)
1574: b8 13 00 00 00 mov $0x13,%eax
1579: cd 40 int $0x40
157b: c3 ret
0000157c <mkdir>:
SYSCALL(mkdir)
157c: b8 14 00 00 00 mov $0x14,%eax
1581: cd 40 int $0x40
1583: c3 ret
00001584 <chdir>:
SYSCALL(chdir)
1584: b8 09 00 00 00 mov $0x9,%eax
1589: cd 40 int $0x40
158b: c3 ret
0000158c <dup>:
SYSCALL(dup)
158c: b8 0a 00 00 00 mov $0xa,%eax
1591: cd 40 int $0x40
1593: c3 ret
00001594 <getpid>:
SYSCALL(getpid)
1594: b8 0b 00 00 00 mov $0xb,%eax
1599: cd 40 int $0x40
159b: c3 ret
0000159c <sbrk>:
SYSCALL(sbrk)
159c: b8 0c 00 00 00 mov $0xc,%eax
15a1: cd 40 int $0x40
15a3: c3 ret
000015a4 <sleep>:
SYSCALL(sleep)
15a4: b8 0d 00 00 00 mov $0xd,%eax
15a9: cd 40 int $0x40
15ab: c3 ret
000015ac <uptime>:
SYSCALL(uptime)
15ac: b8 0e 00 00 00 mov $0xe,%eax
15b1: cd 40 int $0x40
15b3: c3 ret
000015b4 <clone>:
SYSCALL(clone)
15b4: b8 16 00 00 00 mov $0x16,%eax
15b9: cd 40 int $0x40
15bb: c3 ret
000015bc <texit>:
SYSCALL(texit)
15bc: b8 17 00 00 00 mov $0x17,%eax
15c1: cd 40 int $0x40
15c3: c3 ret
000015c4 <tsleep>:
SYSCALL(tsleep)
15c4: b8 18 00 00 00 mov $0x18,%eax
15c9: cd 40 int $0x40
15cb: c3 ret
000015cc <twakeup>:
SYSCALL(twakeup)
15cc: b8 19 00 00 00 mov $0x19,%eax
15d1: cd 40 int $0x40
15d3: c3 ret
000015d4 <thread_yield>:
SYSCALL(thread_yield)
15d4: b8 1a 00 00 00 mov $0x1a,%eax
15d9: cd 40 int $0x40
15db: c3 ret
000015dc <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
15dc: 55 push %ebp
15dd: 89 e5 mov %esp,%ebp
15df: 83 ec 18 sub $0x18,%esp
15e2: 8b 45 0c mov 0xc(%ebp),%eax
15e5: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
15e8: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
15ef: 00
15f0: 8d 45 f4 lea -0xc(%ebp),%eax
15f3: 89 44 24 04 mov %eax,0x4(%esp)
15f7: 8b 45 08 mov 0x8(%ebp),%eax
15fa: 89 04 24 mov %eax,(%esp)
15fd: e8 32 ff ff ff call 1534 <write>
}
1602: c9 leave
1603: c3 ret
00001604 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
1604: 55 push %ebp
1605: 89 e5 mov %esp,%ebp
1607: 56 push %esi
1608: 53 push %ebx
1609: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
160c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
1613: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
1617: 74 17 je 1630 <printint+0x2c>
1619: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
161d: 79 11 jns 1630 <printint+0x2c>
neg = 1;
161f: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
1626: 8b 45 0c mov 0xc(%ebp),%eax
1629: f7 d8 neg %eax
162b: 89 45 ec mov %eax,-0x14(%ebp)
162e: eb 06 jmp 1636 <printint+0x32>
} else {
x = xx;
1630: 8b 45 0c mov 0xc(%ebp),%eax
1633: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
1636: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
163d: 8b 4d f4 mov -0xc(%ebp),%ecx
1640: 8d 41 01 lea 0x1(%ecx),%eax
1643: 89 45 f4 mov %eax,-0xc(%ebp)
1646: 8b 5d 10 mov 0x10(%ebp),%ebx
1649: 8b 45 ec mov -0x14(%ebp),%eax
164c: ba 00 00 00 00 mov $0x0,%edx
1651: f7 f3 div %ebx
1653: 89 d0 mov %edx,%eax
1655: 0f b6 80 10 21 00 00 movzbl 0x2110(%eax),%eax
165c: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
1660: 8b 75 10 mov 0x10(%ebp),%esi
1663: 8b 45 ec mov -0x14(%ebp),%eax
1666: ba 00 00 00 00 mov $0x0,%edx
166b: f7 f6 div %esi
166d: 89 45 ec mov %eax,-0x14(%ebp)
1670: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1674: 75 c7 jne 163d <printint+0x39>
if(neg)
1676: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
167a: 74 10 je 168c <printint+0x88>
buf[i++] = '-';
167c: 8b 45 f4 mov -0xc(%ebp),%eax
167f: 8d 50 01 lea 0x1(%eax),%edx
1682: 89 55 f4 mov %edx,-0xc(%ebp)
1685: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
168a: eb 1f jmp 16ab <printint+0xa7>
168c: eb 1d jmp 16ab <printint+0xa7>
putc(fd, buf[i]);
168e: 8d 55 dc lea -0x24(%ebp),%edx
1691: 8b 45 f4 mov -0xc(%ebp),%eax
1694: 01 d0 add %edx,%eax
1696: 0f b6 00 movzbl (%eax),%eax
1699: 0f be c0 movsbl %al,%eax
169c: 89 44 24 04 mov %eax,0x4(%esp)
16a0: 8b 45 08 mov 0x8(%ebp),%eax
16a3: 89 04 24 mov %eax,(%esp)
16a6: e8 31 ff ff ff call 15dc <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
16ab: 83 6d f4 01 subl $0x1,-0xc(%ebp)
16af: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
16b3: 79 d9 jns 168e <printint+0x8a>
putc(fd, buf[i]);
}
16b5: 83 c4 30 add $0x30,%esp
16b8: 5b pop %ebx
16b9: 5e pop %esi
16ba: 5d pop %ebp
16bb: c3 ret
000016bc <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
16bc: 55 push %ebp
16bd: 89 e5 mov %esp,%ebp
16bf: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
16c2: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
16c9: 8d 45 0c lea 0xc(%ebp),%eax
16cc: 83 c0 04 add $0x4,%eax
16cf: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
16d2: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
16d9: e9 7c 01 00 00 jmp 185a <printf+0x19e>
c = fmt[i] & 0xff;
16de: 8b 55 0c mov 0xc(%ebp),%edx
16e1: 8b 45 f0 mov -0x10(%ebp),%eax
16e4: 01 d0 add %edx,%eax
16e6: 0f b6 00 movzbl (%eax),%eax
16e9: 0f be c0 movsbl %al,%eax
16ec: 25 ff 00 00 00 and $0xff,%eax
16f1: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
16f4: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
16f8: 75 2c jne 1726 <printf+0x6a>
if(c == '%'){
16fa: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
16fe: 75 0c jne 170c <printf+0x50>
state = '%';
1700: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
1707: e9 4a 01 00 00 jmp 1856 <printf+0x19a>
} else {
putc(fd, c);
170c: 8b 45 e4 mov -0x1c(%ebp),%eax
170f: 0f be c0 movsbl %al,%eax
1712: 89 44 24 04 mov %eax,0x4(%esp)
1716: 8b 45 08 mov 0x8(%ebp),%eax
1719: 89 04 24 mov %eax,(%esp)
171c: e8 bb fe ff ff call 15dc <putc>
1721: e9 30 01 00 00 jmp 1856 <printf+0x19a>
}
} else if(state == '%'){
1726: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
172a: 0f 85 26 01 00 00 jne 1856 <printf+0x19a>
if(c == 'd'){
1730: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
1734: 75 2d jne 1763 <printf+0xa7>
printint(fd, *ap, 10, 1);
1736: 8b 45 e8 mov -0x18(%ebp),%eax
1739: 8b 00 mov (%eax),%eax
173b: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
1742: 00
1743: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
174a: 00
174b: 89 44 24 04 mov %eax,0x4(%esp)
174f: 8b 45 08 mov 0x8(%ebp),%eax
1752: 89 04 24 mov %eax,(%esp)
1755: e8 aa fe ff ff call 1604 <printint>
ap++;
175a: 83 45 e8 04 addl $0x4,-0x18(%ebp)
175e: e9 ec 00 00 00 jmp 184f <printf+0x193>
} else if(c == 'x' || c == 'p'){
1763: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
1767: 74 06 je 176f <printf+0xb3>
1769: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
176d: 75 2d jne 179c <printf+0xe0>
printint(fd, *ap, 16, 0);
176f: 8b 45 e8 mov -0x18(%ebp),%eax
1772: 8b 00 mov (%eax),%eax
1774: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
177b: 00
177c: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
1783: 00
1784: 89 44 24 04 mov %eax,0x4(%esp)
1788: 8b 45 08 mov 0x8(%ebp),%eax
178b: 89 04 24 mov %eax,(%esp)
178e: e8 71 fe ff ff call 1604 <printint>
ap++;
1793: 83 45 e8 04 addl $0x4,-0x18(%ebp)
1797: e9 b3 00 00 00 jmp 184f <printf+0x193>
} else if(c == 's'){
179c: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
17a0: 75 45 jne 17e7 <printf+0x12b>
s = (char*)*ap;
17a2: 8b 45 e8 mov -0x18(%ebp),%eax
17a5: 8b 00 mov (%eax),%eax
17a7: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
17aa: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
17ae: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
17b2: 75 09 jne 17bd <printf+0x101>
s = "(null)";
17b4: c7 45 f4 1f 1d 00 00 movl $0x1d1f,-0xc(%ebp)
while(*s != 0){
17bb: eb 1e jmp 17db <printf+0x11f>
17bd: eb 1c jmp 17db <printf+0x11f>
putc(fd, *s);
17bf: 8b 45 f4 mov -0xc(%ebp),%eax
17c2: 0f b6 00 movzbl (%eax),%eax
17c5: 0f be c0 movsbl %al,%eax
17c8: 89 44 24 04 mov %eax,0x4(%esp)
17cc: 8b 45 08 mov 0x8(%ebp),%eax
17cf: 89 04 24 mov %eax,(%esp)
17d2: e8 05 fe ff ff call 15dc <putc>
s++;
17d7: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
17db: 8b 45 f4 mov -0xc(%ebp),%eax
17de: 0f b6 00 movzbl (%eax),%eax
17e1: 84 c0 test %al,%al
17e3: 75 da jne 17bf <printf+0x103>
17e5: eb 68 jmp 184f <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
17e7: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
17eb: 75 1d jne 180a <printf+0x14e>
putc(fd, *ap);
17ed: 8b 45 e8 mov -0x18(%ebp),%eax
17f0: 8b 00 mov (%eax),%eax
17f2: 0f be c0 movsbl %al,%eax
17f5: 89 44 24 04 mov %eax,0x4(%esp)
17f9: 8b 45 08 mov 0x8(%ebp),%eax
17fc: 89 04 24 mov %eax,(%esp)
17ff: e8 d8 fd ff ff call 15dc <putc>
ap++;
1804: 83 45 e8 04 addl $0x4,-0x18(%ebp)
1808: eb 45 jmp 184f <printf+0x193>
} else if(c == '%'){
180a: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
180e: 75 17 jne 1827 <printf+0x16b>
putc(fd, c);
1810: 8b 45 e4 mov -0x1c(%ebp),%eax
1813: 0f be c0 movsbl %al,%eax
1816: 89 44 24 04 mov %eax,0x4(%esp)
181a: 8b 45 08 mov 0x8(%ebp),%eax
181d: 89 04 24 mov %eax,(%esp)
1820: e8 b7 fd ff ff call 15dc <putc>
1825: eb 28 jmp 184f <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
1827: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
182e: 00
182f: 8b 45 08 mov 0x8(%ebp),%eax
1832: 89 04 24 mov %eax,(%esp)
1835: e8 a2 fd ff ff call 15dc <putc>
putc(fd, c);
183a: 8b 45 e4 mov -0x1c(%ebp),%eax
183d: 0f be c0 movsbl %al,%eax
1840: 89 44 24 04 mov %eax,0x4(%esp)
1844: 8b 45 08 mov 0x8(%ebp),%eax
1847: 89 04 24 mov %eax,(%esp)
184a: e8 8d fd ff ff call 15dc <putc>
}
state = 0;
184f: 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++){
1856: 83 45 f0 01 addl $0x1,-0x10(%ebp)
185a: 8b 55 0c mov 0xc(%ebp),%edx
185d: 8b 45 f0 mov -0x10(%ebp),%eax
1860: 01 d0 add %edx,%eax
1862: 0f b6 00 movzbl (%eax),%eax
1865: 84 c0 test %al,%al
1867: 0f 85 71 fe ff ff jne 16de <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
186d: c9 leave
186e: c3 ret
186f: 90 nop
00001870 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
1870: 55 push %ebp
1871: 89 e5 mov %esp,%ebp
1873: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
1876: 8b 45 08 mov 0x8(%ebp),%eax
1879: 83 e8 08 sub $0x8,%eax
187c: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
187f: a1 30 21 00 00 mov 0x2130,%eax
1884: 89 45 fc mov %eax,-0x4(%ebp)
1887: eb 24 jmp 18ad <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1889: 8b 45 fc mov -0x4(%ebp),%eax
188c: 8b 00 mov (%eax),%eax
188e: 3b 45 fc cmp -0x4(%ebp),%eax
1891: 77 12 ja 18a5 <free+0x35>
1893: 8b 45 f8 mov -0x8(%ebp),%eax
1896: 3b 45 fc cmp -0x4(%ebp),%eax
1899: 77 24 ja 18bf <free+0x4f>
189b: 8b 45 fc mov -0x4(%ebp),%eax
189e: 8b 00 mov (%eax),%eax
18a0: 3b 45 f8 cmp -0x8(%ebp),%eax
18a3: 77 1a ja 18bf <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)
18a5: 8b 45 fc mov -0x4(%ebp),%eax
18a8: 8b 00 mov (%eax),%eax
18aa: 89 45 fc mov %eax,-0x4(%ebp)
18ad: 8b 45 f8 mov -0x8(%ebp),%eax
18b0: 3b 45 fc cmp -0x4(%ebp),%eax
18b3: 76 d4 jbe 1889 <free+0x19>
18b5: 8b 45 fc mov -0x4(%ebp),%eax
18b8: 8b 00 mov (%eax),%eax
18ba: 3b 45 f8 cmp -0x8(%ebp),%eax
18bd: 76 ca jbe 1889 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
18bf: 8b 45 f8 mov -0x8(%ebp),%eax
18c2: 8b 40 04 mov 0x4(%eax),%eax
18c5: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
18cc: 8b 45 f8 mov -0x8(%ebp),%eax
18cf: 01 c2 add %eax,%edx
18d1: 8b 45 fc mov -0x4(%ebp),%eax
18d4: 8b 00 mov (%eax),%eax
18d6: 39 c2 cmp %eax,%edx
18d8: 75 24 jne 18fe <free+0x8e>
bp->s.size += p->s.ptr->s.size;
18da: 8b 45 f8 mov -0x8(%ebp),%eax
18dd: 8b 50 04 mov 0x4(%eax),%edx
18e0: 8b 45 fc mov -0x4(%ebp),%eax
18e3: 8b 00 mov (%eax),%eax
18e5: 8b 40 04 mov 0x4(%eax),%eax
18e8: 01 c2 add %eax,%edx
18ea: 8b 45 f8 mov -0x8(%ebp),%eax
18ed: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
18f0: 8b 45 fc mov -0x4(%ebp),%eax
18f3: 8b 00 mov (%eax),%eax
18f5: 8b 10 mov (%eax),%edx
18f7: 8b 45 f8 mov -0x8(%ebp),%eax
18fa: 89 10 mov %edx,(%eax)
18fc: eb 0a jmp 1908 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
18fe: 8b 45 fc mov -0x4(%ebp),%eax
1901: 8b 10 mov (%eax),%edx
1903: 8b 45 f8 mov -0x8(%ebp),%eax
1906: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
1908: 8b 45 fc mov -0x4(%ebp),%eax
190b: 8b 40 04 mov 0x4(%eax),%eax
190e: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
1915: 8b 45 fc mov -0x4(%ebp),%eax
1918: 01 d0 add %edx,%eax
191a: 3b 45 f8 cmp -0x8(%ebp),%eax
191d: 75 20 jne 193f <free+0xcf>
p->s.size += bp->s.size;
191f: 8b 45 fc mov -0x4(%ebp),%eax
1922: 8b 50 04 mov 0x4(%eax),%edx
1925: 8b 45 f8 mov -0x8(%ebp),%eax
1928: 8b 40 04 mov 0x4(%eax),%eax
192b: 01 c2 add %eax,%edx
192d: 8b 45 fc mov -0x4(%ebp),%eax
1930: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
1933: 8b 45 f8 mov -0x8(%ebp),%eax
1936: 8b 10 mov (%eax),%edx
1938: 8b 45 fc mov -0x4(%ebp),%eax
193b: 89 10 mov %edx,(%eax)
193d: eb 08 jmp 1947 <free+0xd7>
} else
p->s.ptr = bp;
193f: 8b 45 fc mov -0x4(%ebp),%eax
1942: 8b 55 f8 mov -0x8(%ebp),%edx
1945: 89 10 mov %edx,(%eax)
freep = p;
1947: 8b 45 fc mov -0x4(%ebp),%eax
194a: a3 30 21 00 00 mov %eax,0x2130
}
194f: c9 leave
1950: c3 ret
00001951 <morecore>:
static Header*
morecore(uint nu)
{
1951: 55 push %ebp
1952: 89 e5 mov %esp,%ebp
1954: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
1957: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
195e: 77 07 ja 1967 <morecore+0x16>
nu = 4096;
1960: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
1967: 8b 45 08 mov 0x8(%ebp),%eax
196a: c1 e0 03 shl $0x3,%eax
196d: 89 04 24 mov %eax,(%esp)
1970: e8 27 fc ff ff call 159c <sbrk>
1975: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
1978: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
197c: 75 07 jne 1985 <morecore+0x34>
return 0;
197e: b8 00 00 00 00 mov $0x0,%eax
1983: eb 22 jmp 19a7 <morecore+0x56>
hp = (Header*)p;
1985: 8b 45 f4 mov -0xc(%ebp),%eax
1988: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
198b: 8b 45 f0 mov -0x10(%ebp),%eax
198e: 8b 55 08 mov 0x8(%ebp),%edx
1991: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
1994: 8b 45 f0 mov -0x10(%ebp),%eax
1997: 83 c0 08 add $0x8,%eax
199a: 89 04 24 mov %eax,(%esp)
199d: e8 ce fe ff ff call 1870 <free>
return freep;
19a2: a1 30 21 00 00 mov 0x2130,%eax
}
19a7: c9 leave
19a8: c3 ret
000019a9 <malloc>:
void*
malloc(uint nbytes)
{
19a9: 55 push %ebp
19aa: 89 e5 mov %esp,%ebp
19ac: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
19af: 8b 45 08 mov 0x8(%ebp),%eax
19b2: 83 c0 07 add $0x7,%eax
19b5: c1 e8 03 shr $0x3,%eax
19b8: 83 c0 01 add $0x1,%eax
19bb: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
19be: a1 30 21 00 00 mov 0x2130,%eax
19c3: 89 45 f0 mov %eax,-0x10(%ebp)
19c6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
19ca: 75 23 jne 19ef <malloc+0x46>
base.s.ptr = freep = prevp = &base;
19cc: c7 45 f0 28 21 00 00 movl $0x2128,-0x10(%ebp)
19d3: 8b 45 f0 mov -0x10(%ebp),%eax
19d6: a3 30 21 00 00 mov %eax,0x2130
19db: a1 30 21 00 00 mov 0x2130,%eax
19e0: a3 28 21 00 00 mov %eax,0x2128
base.s.size = 0;
19e5: c7 05 2c 21 00 00 00 movl $0x0,0x212c
19ec: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
19ef: 8b 45 f0 mov -0x10(%ebp),%eax
19f2: 8b 00 mov (%eax),%eax
19f4: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
19f7: 8b 45 f4 mov -0xc(%ebp),%eax
19fa: 8b 40 04 mov 0x4(%eax),%eax
19fd: 3b 45 ec cmp -0x14(%ebp),%eax
1a00: 72 4d jb 1a4f <malloc+0xa6>
if(p->s.size == nunits)
1a02: 8b 45 f4 mov -0xc(%ebp),%eax
1a05: 8b 40 04 mov 0x4(%eax),%eax
1a08: 3b 45 ec cmp -0x14(%ebp),%eax
1a0b: 75 0c jne 1a19 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
1a0d: 8b 45 f4 mov -0xc(%ebp),%eax
1a10: 8b 10 mov (%eax),%edx
1a12: 8b 45 f0 mov -0x10(%ebp),%eax
1a15: 89 10 mov %edx,(%eax)
1a17: eb 26 jmp 1a3f <malloc+0x96>
else {
p->s.size -= nunits;
1a19: 8b 45 f4 mov -0xc(%ebp),%eax
1a1c: 8b 40 04 mov 0x4(%eax),%eax
1a1f: 2b 45 ec sub -0x14(%ebp),%eax
1a22: 89 c2 mov %eax,%edx
1a24: 8b 45 f4 mov -0xc(%ebp),%eax
1a27: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
1a2a: 8b 45 f4 mov -0xc(%ebp),%eax
1a2d: 8b 40 04 mov 0x4(%eax),%eax
1a30: c1 e0 03 shl $0x3,%eax
1a33: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
1a36: 8b 45 f4 mov -0xc(%ebp),%eax
1a39: 8b 55 ec mov -0x14(%ebp),%edx
1a3c: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
1a3f: 8b 45 f0 mov -0x10(%ebp),%eax
1a42: a3 30 21 00 00 mov %eax,0x2130
return (void*)(p + 1);
1a47: 8b 45 f4 mov -0xc(%ebp),%eax
1a4a: 83 c0 08 add $0x8,%eax
1a4d: eb 38 jmp 1a87 <malloc+0xde>
}
if(p == freep)
1a4f: a1 30 21 00 00 mov 0x2130,%eax
1a54: 39 45 f4 cmp %eax,-0xc(%ebp)
1a57: 75 1b jne 1a74 <malloc+0xcb>
if((p = morecore(nunits)) == 0)
1a59: 8b 45 ec mov -0x14(%ebp),%eax
1a5c: 89 04 24 mov %eax,(%esp)
1a5f: e8 ed fe ff ff call 1951 <morecore>
1a64: 89 45 f4 mov %eax,-0xc(%ebp)
1a67: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1a6b: 75 07 jne 1a74 <malloc+0xcb>
return 0;
1a6d: b8 00 00 00 00 mov $0x0,%eax
1a72: eb 13 jmp 1a87 <malloc+0xde>
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){
1a74: 8b 45 f4 mov -0xc(%ebp),%eax
1a77: 89 45 f0 mov %eax,-0x10(%ebp)
1a7a: 8b 45 f4 mov -0xc(%ebp),%eax
1a7d: 8b 00 mov (%eax),%eax
1a7f: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
1a82: e9 70 ff ff ff jmp 19f7 <malloc+0x4e>
}
1a87: c9 leave
1a88: c3 ret
1a89: 66 90 xchg %ax,%ax
1a8b: 90 nop
00001a8c <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
1a8c: 55 push %ebp
1a8d: 89 e5 mov %esp,%ebp
1a8f: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
1a92: 8b 55 08 mov 0x8(%ebp),%edx
1a95: 8b 45 0c mov 0xc(%ebp),%eax
1a98: 8b 4d 08 mov 0x8(%ebp),%ecx
1a9b: f0 87 02 lock xchg %eax,(%edx)
1a9e: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
1aa1: 8b 45 fc mov -0x4(%ebp),%eax
}
1aa4: c9 leave
1aa5: c3 ret
00001aa6 <lock_init>:
#include "x86.h"
#include "proc.h"
unsigned long rands = 1;
void lock_init(lock_t *lock){
1aa6: 55 push %ebp
1aa7: 89 e5 mov %esp,%ebp
lock->locked = 0;
1aa9: 8b 45 08 mov 0x8(%ebp),%eax
1aac: c7 00 00 00 00 00 movl $0x0,(%eax)
}
1ab2: 5d pop %ebp
1ab3: c3 ret
00001ab4 <lock_acquire>:
void lock_acquire(lock_t *lock){
1ab4: 55 push %ebp
1ab5: 89 e5 mov %esp,%ebp
1ab7: 83 ec 08 sub $0x8,%esp
while(xchg(&lock->locked,1) != 0);
1aba: 90 nop
1abb: 8b 45 08 mov 0x8(%ebp),%eax
1abe: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
1ac5: 00
1ac6: 89 04 24 mov %eax,(%esp)
1ac9: e8 be ff ff ff call 1a8c <xchg>
1ace: 85 c0 test %eax,%eax
1ad0: 75 e9 jne 1abb <lock_acquire+0x7>
}
1ad2: c9 leave
1ad3: c3 ret
00001ad4 <lock_release>:
void lock_release(lock_t *lock){
1ad4: 55 push %ebp
1ad5: 89 e5 mov %esp,%ebp
1ad7: 83 ec 08 sub $0x8,%esp
xchg(&lock->locked,0);
1ada: 8b 45 08 mov 0x8(%ebp),%eax
1add: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1ae4: 00
1ae5: 89 04 24 mov %eax,(%esp)
1ae8: e8 9f ff ff ff call 1a8c <xchg>
}
1aed: c9 leave
1aee: c3 ret
00001aef <thread_create>:
void *thread_create(void(*start_routine)(void*), void *arg){
1aef: 55 push %ebp
1af0: 89 e5 mov %esp,%ebp
1af2: 83 ec 28 sub $0x28,%esp
int tid;
void * stack = malloc(2 * 4096);
1af5: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
1afc: e8 a8 fe ff ff call 19a9 <malloc>
1b01: 89 45 f4 mov %eax,-0xc(%ebp)
void *garbage_stack = stack;
1b04: 8b 45 f4 mov -0xc(%ebp),%eax
1b07: 89 45 f0 mov %eax,-0x10(%ebp)
// printf(1,"start routine addr : %d\n",(uint)start_routine);
if((uint)stack % 4096){
1b0a: 8b 45 f4 mov -0xc(%ebp),%eax
1b0d: 25 ff 0f 00 00 and $0xfff,%eax
1b12: 85 c0 test %eax,%eax
1b14: 74 14 je 1b2a <thread_create+0x3b>
stack = stack + (4096 - (uint)stack % 4096);
1b16: 8b 45 f4 mov -0xc(%ebp),%eax
1b19: 25 ff 0f 00 00 and $0xfff,%eax
1b1e: 89 c2 mov %eax,%edx
1b20: b8 00 10 00 00 mov $0x1000,%eax
1b25: 29 d0 sub %edx,%eax
1b27: 01 45 f4 add %eax,-0xc(%ebp)
}
if (stack == 0){
1b2a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1b2e: 75 1b jne 1b4b <thread_create+0x5c>
printf(1,"malloc fail \n");
1b30: c7 44 24 04 26 1d 00 movl $0x1d26,0x4(%esp)
1b37: 00
1b38: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1b3f: e8 78 fb ff ff call 16bc <printf>
return 0;
1b44: b8 00 00 00 00 mov $0x0,%eax
1b49: eb 6f jmp 1bba <thread_create+0xcb>
}
tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg);
1b4b: 8b 4d 0c mov 0xc(%ebp),%ecx
1b4e: 8b 55 08 mov 0x8(%ebp),%edx
1b51: 8b 45 f4 mov -0xc(%ebp),%eax
1b54: 89 4c 24 0c mov %ecx,0xc(%esp)
1b58: 89 54 24 08 mov %edx,0x8(%esp)
1b5c: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp)
1b63: 00
1b64: 89 04 24 mov %eax,(%esp)
1b67: e8 48 fa ff ff call 15b4 <clone>
1b6c: 89 45 ec mov %eax,-0x14(%ebp)
if(tid < 0){
1b6f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1b73: 79 1b jns 1b90 <thread_create+0xa1>
printf(1,"clone fails\n");
1b75: c7 44 24 04 34 1d 00 movl $0x1d34,0x4(%esp)
1b7c: 00
1b7d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1b84: e8 33 fb ff ff call 16bc <printf>
return 0;
1b89: b8 00 00 00 00 mov $0x0,%eax
1b8e: eb 2a jmp 1bba <thread_create+0xcb>
}
if(tid > 0){
1b90: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1b94: 7e 05 jle 1b9b <thread_create+0xac>
//store threads on thread table
return garbage_stack;
1b96: 8b 45 f0 mov -0x10(%ebp),%eax
1b99: eb 1f jmp 1bba <thread_create+0xcb>
}
if(tid == 0){
1b9b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
1b9f: 75 14 jne 1bb5 <thread_create+0xc6>
printf(1,"tid = 0 return \n");
1ba1: c7 44 24 04 41 1d 00 movl $0x1d41,0x4(%esp)
1ba8: 00
1ba9: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1bb0: e8 07 fb ff ff call 16bc <printf>
}
// wait();
// free(garbage_stack);
return 0;
1bb5: b8 00 00 00 00 mov $0x0,%eax
}
1bba: c9 leave
1bbb: c3 ret
00001bbc <random>:
// generate 0 -> max random number exclude max.
int random(int max){
1bbc: 55 push %ebp
1bbd: 89 e5 mov %esp,%ebp
rands = rands * 1664525 + 1013904233;
1bbf: a1 24 21 00 00 mov 0x2124,%eax
1bc4: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
1bca: 05 69 f3 6e 3c add $0x3c6ef369,%eax
1bcf: a3 24 21 00 00 mov %eax,0x2124
return (int)(rands % max);
1bd4: a1 24 21 00 00 mov 0x2124,%eax
1bd9: 8b 4d 08 mov 0x8(%ebp),%ecx
1bdc: ba 00 00 00 00 mov $0x0,%edx
1be1: f7 f1 div %ecx
1be3: 89 d0 mov %edx,%eax
}
1be5: 5d pop %ebp
1be6: c3 ret
1be7: 90 nop
00001be8 <init_q>:
#include "queue.h"
#include "types.h"
#include "user.h"
void init_q(struct queue *q){
1be8: 55 push %ebp
1be9: 89 e5 mov %esp,%ebp
q->size = 0;
1beb: 8b 45 08 mov 0x8(%ebp),%eax
1bee: c7 00 00 00 00 00 movl $0x0,(%eax)
q->head = 0;
1bf4: 8b 45 08 mov 0x8(%ebp),%eax
1bf7: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
1bfe: 8b 45 08 mov 0x8(%ebp),%eax
1c01: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
1c08: 5d pop %ebp
1c09: c3 ret
00001c0a <add_q>:
void add_q(struct queue *q, int v){
1c0a: 55 push %ebp
1c0b: 89 e5 mov %esp,%ebp
1c0d: 83 ec 28 sub $0x28,%esp
struct node * n = malloc(sizeof(struct node));
1c10: c7 04 24 08 00 00 00 movl $0x8,(%esp)
1c17: e8 8d fd ff ff call 19a9 <malloc>
1c1c: 89 45 f4 mov %eax,-0xc(%ebp)
n->next = 0;
1c1f: 8b 45 f4 mov -0xc(%ebp),%eax
1c22: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
n->value = v;
1c29: 8b 45 f4 mov -0xc(%ebp),%eax
1c2c: 8b 55 0c mov 0xc(%ebp),%edx
1c2f: 89 10 mov %edx,(%eax)
if(q->head == 0){
1c31: 8b 45 08 mov 0x8(%ebp),%eax
1c34: 8b 40 04 mov 0x4(%eax),%eax
1c37: 85 c0 test %eax,%eax
1c39: 75 0b jne 1c46 <add_q+0x3c>
q->head = n;
1c3b: 8b 45 08 mov 0x8(%ebp),%eax
1c3e: 8b 55 f4 mov -0xc(%ebp),%edx
1c41: 89 50 04 mov %edx,0x4(%eax)
1c44: eb 0c jmp 1c52 <add_q+0x48>
}else{
q->tail->next = n;
1c46: 8b 45 08 mov 0x8(%ebp),%eax
1c49: 8b 40 08 mov 0x8(%eax),%eax
1c4c: 8b 55 f4 mov -0xc(%ebp),%edx
1c4f: 89 50 04 mov %edx,0x4(%eax)
}
q->tail = n;
1c52: 8b 45 08 mov 0x8(%ebp),%eax
1c55: 8b 55 f4 mov -0xc(%ebp),%edx
1c58: 89 50 08 mov %edx,0x8(%eax)
q->size++;
1c5b: 8b 45 08 mov 0x8(%ebp),%eax
1c5e: 8b 00 mov (%eax),%eax
1c60: 8d 50 01 lea 0x1(%eax),%edx
1c63: 8b 45 08 mov 0x8(%ebp),%eax
1c66: 89 10 mov %edx,(%eax)
}
1c68: c9 leave
1c69: c3 ret
00001c6a <empty_q>:
int empty_q(struct queue *q){
1c6a: 55 push %ebp
1c6b: 89 e5 mov %esp,%ebp
if(q->size == 0)
1c6d: 8b 45 08 mov 0x8(%ebp),%eax
1c70: 8b 00 mov (%eax),%eax
1c72: 85 c0 test %eax,%eax
1c74: 75 07 jne 1c7d <empty_q+0x13>
return 1;
1c76: b8 01 00 00 00 mov $0x1,%eax
1c7b: eb 05 jmp 1c82 <empty_q+0x18>
else
return 0;
1c7d: b8 00 00 00 00 mov $0x0,%eax
}
1c82: 5d pop %ebp
1c83: c3 ret
00001c84 <pop_q>:
int pop_q(struct queue *q){
1c84: 55 push %ebp
1c85: 89 e5 mov %esp,%ebp
1c87: 83 ec 28 sub $0x28,%esp
int val;
struct node *destroy;
if(!empty_q(q)){
1c8a: 8b 45 08 mov 0x8(%ebp),%eax
1c8d: 89 04 24 mov %eax,(%esp)
1c90: e8 d5 ff ff ff call 1c6a <empty_q>
1c95: 85 c0 test %eax,%eax
1c97: 75 5d jne 1cf6 <pop_q+0x72>
val = q->head->value;
1c99: 8b 45 08 mov 0x8(%ebp),%eax
1c9c: 8b 40 04 mov 0x4(%eax),%eax
1c9f: 8b 00 mov (%eax),%eax
1ca1: 89 45 f4 mov %eax,-0xc(%ebp)
destroy = q->head;
1ca4: 8b 45 08 mov 0x8(%ebp),%eax
1ca7: 8b 40 04 mov 0x4(%eax),%eax
1caa: 89 45 f0 mov %eax,-0x10(%ebp)
q->head = q->head->next;
1cad: 8b 45 08 mov 0x8(%ebp),%eax
1cb0: 8b 40 04 mov 0x4(%eax),%eax
1cb3: 8b 50 04 mov 0x4(%eax),%edx
1cb6: 8b 45 08 mov 0x8(%ebp),%eax
1cb9: 89 50 04 mov %edx,0x4(%eax)
free(destroy);
1cbc: 8b 45 f0 mov -0x10(%ebp),%eax
1cbf: 89 04 24 mov %eax,(%esp)
1cc2: e8 a9 fb ff ff call 1870 <free>
q->size--;
1cc7: 8b 45 08 mov 0x8(%ebp),%eax
1cca: 8b 00 mov (%eax),%eax
1ccc: 8d 50 ff lea -0x1(%eax),%edx
1ccf: 8b 45 08 mov 0x8(%ebp),%eax
1cd2: 89 10 mov %edx,(%eax)
if(q->size == 0){
1cd4: 8b 45 08 mov 0x8(%ebp),%eax
1cd7: 8b 00 mov (%eax),%eax
1cd9: 85 c0 test %eax,%eax
1cdb: 75 14 jne 1cf1 <pop_q+0x6d>
q->head = 0;
1cdd: 8b 45 08 mov 0x8(%ebp),%eax
1ce0: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
1ce7: 8b 45 08 mov 0x8(%ebp),%eax
1cea: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
return val;
1cf1: 8b 45 f4 mov -0xc(%ebp),%eax
1cf4: eb 05 jmp 1cfb <pop_q+0x77>
}
return -1;
1cf6: b8 ff ff ff ff mov $0xffffffff,%eax
}
1cfb: c9 leave
1cfc: c3 ret
|
5th Assignment/Ex1.asm | BeenCoding/Microprocessors-NTUA | 0 | 96047 | <filename>5th Assignment/Ex1.asm
include 'macros.inc'
CODE SEGMENT
MAIN PROC FAR
START: CALL HEX_KEYB ; read first digit
ROL AL,4 ; move the digit in the first 4 MSB position (xxxx0000)
MOV BL,AL ; save it to BL
CALL HEX_KEYB ; read second digit
ADD BL,AL ; add the second digit to the saved number (xxxx0000)+(0000xxxx) = (xxxxxxxx)
PUSH BX ; save the completed number in stack
PRINT '='
CALL PRINT_DEC ; convert to decimal and print it
POP BX ; pop the saved number for the next convertion
PUSH BX ; save it again for the next convertion
PRINT '='
CALL PRINT_OCT ; convert to octadecimal and print it
POP BX ; pop the saved number for the next convertion
PRINT '='
CALL PRINT_BIN ; convert hex to binary
NEW_LINE
JMP START ; inf loop
MAIN ENDP
; a function that reads input digit
; accepts only 0...9 and A...F and Q for terminating
HEX_KEYB PROC NEAR
PUSH DX ; saving DX because READ macro uses DL
INVALID: READ
CMP AL, 'Q' ; if Q then terminate
JE CALL QUIT ; jump to QUIT
CMP AL, 46H ; if ASCII > 46 invalid input
JG INVALID ; jump invalid
CMP AL, 40H ; else if ASCII > 40 then
JG FINISH_LETTER ; and jump to FINISH_LETTER
CMP AL, 39H ; if ASCII < 30 invalid input
JG INVALID ; jump invalid
CMP AL, 29H ; if ASCII > 39 invalid input
JG FINISH_NUMB ; jump FINISH_NUMB else
JMP INVALID ; jump invalid
FINISH_LETTER: SUB AL, 37H ; subtract 37H (i.e 41H-37H = 0AH)
POP DX ; bring back DX
RET ; return
FINISH_NUMB: SUB AL, 30H ; subtract 30H (i.e 39H-30H = 09H)
POP DX
RET
HEX_KEYB ENDP
QUIT PROC NEAR
EXIT
QUIT ENDP
; This function converts hex to dec
PRINT_DEC PROC NEAR
MOV AH,0 ; make AH zero so as the number is AX = 00000000xxxxxxxx(only BL)
MOV AL,BL ; moving BL to AL
MOV BL,10 ; use for division with 10
MOV CX,1 ; digits counter
DEC_LOOP: DIV BL ; divide number with 10
PUSH AX ; save remainder
CMP AL,00H ; if AL is zero we converted the number
JE CALL PRINT_DIG ; so we jump to PRINT_DIG to print the number
INC CX ; else increase number of digits
MOV AH,00H ; make AH zero for same reason with line 27
JMP DEC_LOOP
RET
PRINT_DEC ENDP
PRINT_OCT PROC NEAR
MOV AH,0 ; make AH zero so as the number is AX = 00000000xxxxxxxx(only BL)
MOV AL,BL ; moving BL to AL
MOV BL,8 ; use for division with 8
MOV CX,1 ; digits counter
OCT_LOOP: DIV BL ; divide number with 8
PUSH AX ; save remainder
CMP AL,00H ; if AL is zero we converted the number
JE CALL PRINT_DIG ; so we jump to PRINT_DIG to print the number
INC CX ; else increase number of digits
MOV AH,00H ; make AH zero for same reason with line 51
JMP OCT_LOOP
RET
PRINT_OCT ENDP
PRINT_BIN PROC NEAR
MOV AH,0 ; make AH zero so as the number is AX = 00000000xxxxxxxx(only BL)
MOV AL,BL ; moving BL to AL
MOV BL,2 ; use for division with 2
MOV CX,1 ; digits counter
BIN_LOOP: DIV BL ; divide number with 2
PUSH AX ; save remainder
CMP AL,00H ; if AL is zero we converted the number
JE CALL PRINT_DIG ; so we jump to PRINT_DIG to print the number
INC CX ; else increase number of digits
MOV AH,00H ; make AH zero for same reason with line 72
JMP BIN_LOOP
RET
PRINT_BIN ENDP
PRINT_DIG PROC NEAR
PRINT_LOOP: POP DX ; pop digit to be printed
MOV DL,DH ; move DH to DL and
MOV DH,00H ; make DH zero so as DX has the digit
ADD DX,30H ; ASCII convertion
MOV AH,02H ; to print digit on screen
INT 21H ; interupt for print
LOOP PRINT_LOOP ; loop until the whole number is printed
RET
PRINT_DIG ENDP
CODE ENDS |
other.7z/SFC.7z/SFC/ソースデータ/FZERO/FZERO/Game/effect.asm | prismotizm/gigaleak | 46 | 3481 | Name: effect.asm
Type: file
Size: 61229
Last-Modified: '2000-11-08T02:03:12Z'
SHA-1: 269E3A56B08A6A3D7892BE1015827C4AE1E20564
Description: null
|
source/amf/uml/amf-uml-combined_fragments.ads | svn2github/matreshka | 24 | 16837 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A combined fragment defines an expression of interaction fragments. A
-- combined fragment is defined by an interaction operator and corresponding
-- interaction operands. Through the use of combined fragments the user will
-- be able to describe a number of traces in a compact and concise manner.
------------------------------------------------------------------------------
limited with AMF.UML.Gates.Collections;
with AMF.UML.Interaction_Fragments;
limited with AMF.UML.Interaction_Operands.Collections;
package AMF.UML.Combined_Fragments is
pragma Preelaborate;
type UML_Combined_Fragment is limited interface
and AMF.UML.Interaction_Fragments.UML_Interaction_Fragment;
type UML_Combined_Fragment_Access is
access all UML_Combined_Fragment'Class;
for UML_Combined_Fragment_Access'Storage_Size use 0;
not overriding function Get_Cfragment_Gate
(Self : not null access constant UML_Combined_Fragment)
return AMF.UML.Gates.Collections.Set_Of_UML_Gate is abstract;
-- Getter of CombinedFragment::cfragmentGate.
--
-- Specifies the gates that form the interface between this
-- CombinedFragment and its surroundings
not overriding function Get_Interaction_Operator
(Self : not null access constant UML_Combined_Fragment)
return AMF.UML.UML_Interaction_Operator_Kind is abstract;
-- Getter of CombinedFragment::interactionOperator.
--
-- Specifies the operation which defines the semantics of this combination
-- of InteractionFragments.
not overriding procedure Set_Interaction_Operator
(Self : not null access UML_Combined_Fragment;
To : AMF.UML.UML_Interaction_Operator_Kind) is abstract;
-- Setter of CombinedFragment::interactionOperator.
--
-- Specifies the operation which defines the semantics of this combination
-- of InteractionFragments.
not overriding function Get_Operand
(Self : not null access constant UML_Combined_Fragment)
return AMF.UML.Interaction_Operands.Collections.Ordered_Set_Of_UML_Interaction_Operand is abstract;
-- Getter of CombinedFragment::operand.
--
-- The set of operands of the combined fragment.
end AMF.UML.Combined_Fragments;
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_GetTiles_callee.asm | jpoikela/z88dk | 640 | 11403 | <reponame>jpoikela/z88dk<filename>libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_GetTiles_callee.asm
; void sp1_GetTiles(struct sp1_Rect *r, struct sp1_tp *dest)
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _sp1_GetTiles_callee, l0_sp1_GetTiles
EXTERN asm_sp1_GetTiles
_sp1_GetTiles_callee:
pop af
pop hl
pop de
push af
l0_sp1_GetTiles:
push de
ld d,(hl)
inc hl
ld e,(hl)
inc hl
ld b,(hl)
inc hl
ld c,(hl)
pop hl
jp asm_sp1_GetTiles
|
programs/oeis/262/A262882.asm | neoneye/loda | 22 | 13584 | ; A262882: Right diagonal of A262881.
; 0,1,2,3,3,5,6,7,7,7,7,11,11,13,14,15,15,15,15,15,15,15,15,23,23,23,23,27,27,29,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,47,47,47,47,47,47,47,47,55,55,55,55,59,59,61,62,63,63,63,63,63
add $0,1
lpb $0
mov $1,$0
seq $1,342410 ; The binary expansion of a(n) corresponds to that of n where all the 1's have been replaced by 0's except in the last run of 1's.
sub $0,$1
lpe
sub $1,1
mov $0,$1
|
3rdParties/src/nasm/nasm-2.15.02/test/moresecs.asm | blue3k/StormForge | 1 | 87456 | <reponame>blue3k/StormForge
; Less than 65,279 data sections, but more total sections
%assign NSECS 37600
%include "manysecs.asm"
|
rom0/instructions.asm | nagydani/zx-rom-mods | 15 | 98324 | <reponame>nagydani/zx-rom-mods<gh_stars>10-100
DEFB P_LABEL - $ ; @ / LABEL / DEF PROC
DEFB P_ONERROR - $ ; ON ERROR
DEFB P_WRITE - $ ; WRITE #
DEFB P_DELETE - $ ; DELETE
DEFB P_LOCAL - $ ; LOCAL
DEFB P_CLIP - $ ; CLIP
DEFB P_DISPLAY - $ ; DISPLAY
DEFB P_FPOKE - $ ; FPOKE
DEFB P_RENUM - $ ; RENUM
DEFB P_SCALE - $ ; SCALE
DEFB P_ENDWHILE - $ ; END WHILE
DEFB P_UNTIL - $ ; UNTIL
DEFB P_TRACE - $ ; TRACE
DEFB P_ENDIF - $ ; END IF
DEFB P_YIELD - $ ; YIELD
DEFB P_REPEAT - $ ; REPEAT
DEFB P_EXIT - $ ; EXIT
DEFB P_WHILE - $ ; WHILE
DEFB P_ENDPROC - $ ; END PROC
DEFB P_STACK - $ ; STACK
DEFB P_PROC - $ ; PROC
DEFB P_POP - $ ; POP
DEFB P_SPECTRUM - $ ; SPECTRUM
DEFB P_PLAY - $ ; PLAY
DEFB P_PLUG - $ ; RND
DEFB P_PLUG - $ ; INKEY$
DEFB P_PLUG - $ ; PI
DEFB P_PLUG - $ ; FN
DEFB P_ORIG - $ ; POINT
DEFB P_PLUG - $ ; SCREEN$
DEFB P_PALETTE - $ ; ATTR
DEFB P_TURBO - $ ; AT
P_END: EQU $
INST_T1:
DEFB ELSE_T - TAB_T
DEFB P_ELSE - $ ; ELSE (THEN)
DEFB USR_T - TAB_T
DEFB P_USR - $ ; USR
DEFB STEP_T - TAB_T
DEFB P_STEP - $ ; STEP
DEFB AND_T - TAB_T
DEFB P_ASSERT - $ ; ASSERT
DEFB 0
P_ENDIF:DEFB $00
DEFW ENDIF
P_RENUM:DEFB $00 ; TODO: all sorts of arguments for RENUM
DEFW RENUM
P_CLIP: DEFB $08,TO_T,$08,$00
DEFW CLIP
P_EXIT: DEFB $00
DEFW PLUG
P_POP: DEFB $00
DEFW POP
P_ELSE: DEFB $05
DEFW ELSE
P_STACK:DEFB $07,$00
DEFW STACK
P_REPEAT:
DEFB $00
DEFW REPEAT
P_FPOKE:DEFB $05
DEFW FPOKE
P_UNTIL:DEFB $06, $00
DEFW UNTIL
P_ORIG: DEFB $08, $00
DEFW ORIG
P_SCALE:DEFB $08, $00
DEFW SCALE
P_USR: DEFB $06, $00
DEFW USR
P_LABEL:DEFB $09, $05 ; a label followed by stuff
DEFW LABEL
P_PROC: DEFB $05
DEFW PROC
P_ENDPROC:
DEFB $05
DEFW ENDPROC
P_LOCAL:DEFB $05
DEFW LOCAL
P_ASSERT:
DEFB $06, $00
DEFW ASSERT
P_TRACE:DEFB $00
DEFW TRACE
P_DELETE:
DEFB $05
DEFW DELETE
P_WHILE:DEFB $05
DEFW WHILE
P_ENDWHILE:
DEFB $00
DEFW ENDWHILE
P_ONERROR:
DEFB $05
DEFW ONERROR
P_YIELD:DEFB $05
DEFW YIELD
P_TURBO:DEFB $06,$00
DEFW TURBO_X
P_DISPLAY:
DEFB $03
DEFW DISPLAY
P_STEP: DEFB $07,",",$06,$00
DEFW STEP
P_SPECTRUM:
DEFB $00
DEFW SPECTR
P_WRITE:DEFB $06,";",$5
DEFW WRITE
P_PLAY:
DEFB $05
DEFW PLAY
P_PALETTE:
; unimplemented instruction, accepted w/o parameters, but not executed
P_PLUG:
DEFB $00
DEFW PLUG
CHECK_END:
CALL SYNTAX_Z
RET NZ
END05_E:POP BC ; SCAN-LOOP
END05: POP BC ; STMT-RET
STMT_NEXT:
RST $18
CP $0D ; CR
JR Z,LINE_END
CP ":"
JR Z,STMT_LOOP
JR ERROR_C_I
STMT_LOOP:
LD HL,L1B28 ; STMT-LOOP
PUSH HL
RST $10
LINE_END:
BIT 7,(IY+$01)
JR Z,LE_SWAP
LD HL,(NXTLIN)
LD A,$C0
AND (HL)
JR NZ,LE_SWAP ; program finished
PUSH HL
LD HL,L1BBF - 1 ; XOR A, LINE-USE
EX (SP),HL
LE_SWAP:RST $10
CMDCLASS2:
DEFB CLASS2_00 - $ ; parameterless instruction
DEFB CLASS2_01 - $ ; do something to a variable
DEFB CLASS2_02 - $ ; prepare value for assignment
DEFB CLASS2_03 - $ ; one numeric parameter, defaults to zero
DEFB CLASS2_04 - $ ; used by FOR & NEXT -- TODO: may be worth replacing
DEFB CLASS2_05 - $ ; list of items
DEFB CLASS2_06 - $ ; evaluate single numeric expression
DEFB CLASS2_07 - $ ; open #2 or other stream before execution
DEFB CLASS2_08 - $ ; two numeric expressions, separated by comma
DEFB CLASS2_09 - $ ; label
CLASS2_03:
CALL FETCH_NUM
CLASS2_00:
CP A
CLASS2_05:
POP BC
CALL Z,CHECK_END
EX DE,HL
LD HL,(T_ADDR)
LD C,(HL)
INC HL
LD B,(HL)
EX DE,HL
PUSH BC
RET
CLASS2_01:
RST $30
DEFW L1C1F ; CLASS_01
RET
CLASS2_02:
RST $30
DEFW L1C4E ; CLASS_02
RET
CLASS2_04:
RST $30
DEFW L1C6C ; CLASS_04
RET
NEXT_2NUM:
RST $20
CLASS2_08:
CALL CLASS2_06
CP ","
JR NZ,ERROR_C_I
NEXT_1NUM:
RST $20
CLASS2_06:
RST $30
DEFW L24FB ; SCANNING
BIT 6,(IY+$01)
RET NZ
ERROR_C_I:
JP ERROR_C
FETCH_NUM:
CP $0D
JR Z,USE_ZERO
CP ":"
JR NZ,CLASS2_06
USE_ZERO:
RST $30
DEFW L1CE6 ; USE-ZERO
RET
CLASS2_07:
RST $30
DEFW L2070 ; STR-ALTER
RET NC
LD HL,(T_ADDR)
LD A,(HL)
OR A
JR Z,CL7_E
INC HL
LD (T_ADDR),HL
CL7_E: CALL UNSTACK_Z
LD A,2
RST $30
DEFW L1601 ; CHAN-OPEN
RET
DELIM: DEFB $0D
DEFM ":,;)"
DELIM_E:
FROM_1: CALL SYNTAX_Z
JR Z,FROM_1R
RST $30
DEFW L1CE6 + 4 ; USE-ZERO + 4
INC HL
INC HL
LD (HL),$01 ; ONE
JR FROM_1R
CLASS2_0A:
RST $18
CP TO_T
JR Z,FROM_1
CALL CLASS2_06 ; beginning
CP TO_T
JR NZ,TO_SAME
FROM_1R:RST $20
LD HL,DELIM
LD BC,DELIM_E - DELIM
CPIR
JR NZ,CLASS2_06
CALL UNSTACK_Z
RST $28
DEFB $A1 ; stk-one
DEFB $1B ; negate
DEFB $38 ; end
RET
TO_SAME:CALL UNSTACK_Z
RST $28
DEFB $31 ; duplicate
DEFB $38 ; end
CLASS2_09:
CALL SYNTAX_Z
JR NZ,LABEL_R
LD BC,$0006
RST $30
DEFW L2C8D ; ALPHA
JP NC,ERROR_C
INC HL ; insert pointers after first letter of label
RST $30
DEFW L1655 ; MAKE-ROOM
LD DE,(E_LINE)
LABEL_S:LD A,(DE)
INC DE
CP " " + 1
JR C,LABEL_S ; skip indent
LABEL_N:RST $30
DEFW L2D1B ; NUMERIC
JR C,LABEL_C ; if CF then DE = beginning of first statement
INC DE
LD A,(DE)
JR LABEL_N ; skip line number
LABEL_C:LD A,(SUBPPC)
INC HL
LD (HL),$0E ; number marker
INC HL
PUSH HL ; length goes here
INC HL
INC HL ; skip length
LD (HL),A ; statement number
INC HL
EX DE,HL
SCF
SBC HL,DE ; relative pointer to before first statement
EX DE,HL
LD (HL),E
INC HL
LD (HL),D
LD (CH_ADD),HL
LABEL_L:RST $20
RST $30
DEFW L2C88 ; ALPHANUM
JR C,LABEL_L
POP DE ; length pointer
SCF
SBC HL,DE
EX DE,HL
LD (HL),E
INC HL
LD (HL),D
RET
LABEL_R:INC HL
INC HL
LD E,(HL)
INC HL
LD D,(HL)
ADD HL,DE
LD (CH_ADD),HL
RET
NESTING:EQU TSTACK - 2
NEST2: EQU NESTING + 1
; instruction routines
ENDIF: RES 4,(IY+$37) ; signal true outcome
EISW: RST $10
; Skip FOR block if condition unsatisfied
SKIP_FOR_CONT:
POP DE ; discard return address
POP DE ; discard return address
POP DE ; discard variable name
LD DE,T_FOR
CALL LOOK_PROG2
INC BC ; increment end-of-line pointer
LD (NXTLIN),BC
JR NC,EISW
ERROR_I:RST $30
DEFW L1D84 ; I FOR without NEXT
THENLESS:
RES 4,(IY+$37) ; signal true outcome
CALL TEST_ZERO
SWAPNZ: JR NZ,EISW ; Upon true condition, simply continue
; Upon false condition start scanning for END IF, ELSE or end of code
THENLESS0:
SET 4,(IY+$37) ; signal false outcome
LD BC,(NXTLIN)
LD DE,T_IF
CALL LOOK_PROG2
INC BC ; increment end-of-line pointer
LD (NXTLIN),BC
JR C,ERROR_S
POP BC ; discard SCAN-LOOP
SW20: RST $20
RST $10
ELSE: POP BC ; discard STMT-RET
CALL SYNTAX_Z
JR Z,ELSE_S
LD HL,FLAGX
BIT 4,(HL) ; FLAGX, check if last IF was false
RES 4,(HL)
JR NZ,ELSE_1
RST $18
CP $0D
SCF
JR Z,ELSE_3 ; multi-line ELSE block
CP IF_T
JR Z,ELSEIF ; ELSE IF
ELSE_0: LD BC,L1BB3 + 4 ; LINE-END + 4
JR ELSE_2
ELSE_S: BIT 4,(IY+$37) ; after THEN
ERRCNZ4:JP NZ,ERROR_C ; ELSE is an error
ELSE_1: LD BC,L1B29 ; STMT-L-1
ELSE_2: PUSH BC
RST $10
ELSE_3: PUSH BC ; put back STMT-RET
LD BC,(NXTLIN)
LD DE,T_IF
CALL LOOK_PROG2
LD (NXTLIN),BC
JR NC,SW20 ; missing END IF?
ERROR_S:CALL ERROR
DEFB $1B ; S Missing END
ELSEIF: INC HL
PUSH BC
CALL SKIPEX
POP BC
CP THEN_T
JR Z,ELSE_0
DEC HL
ELSE_4: LD (CH_ADD),HL
JR ELSE_3
POKE_S: RST $18
BIT 6,(IY+$01) ; numeric?
LD HL,L1E2C + 3 ; DATA-1 + 3
JR Z,POKE_S1 ; jump, if string
LD HL,L1E2C + 8 ; DATA-1 + 8
CP ","
POKE_S1:JP Z,TR_SW
JP ERROR_C
FPOKE: RST $30
DEFW L1C82 ; CLASS-06 single numeric
CALL SYNTAX_Z
JR Z,FPOKE_S
RST $30
DEFW L1E99 ; FIND-INT2
RST $18
FPOKE_S:PUSH BC ; address (dummy, if checking syntax)
FPOKE_L:RST $30
DEFW L1C7A + 3 ; CLASS-08 + 3 comma, followed by numeric
CALL SYNTAX_Z
JR Z,FPOKE_Z
RST $28
DEFB $02 ; delete
DEFB $38 ; end
EX DE,HL
POP DE
LD BC,5
LDIR
PUSH DE
RST $18
FPOKE_Z:CP ","
JR Z,FPOKE_L
JP END05_E
N_POKE: PUSH HL ; STMT_RET or STEP_HOOK
CALL SYNTAX_Z
JR Z,POKE_S
LD HL,(STKEND)
LD BC,$0005
ADD HL,BC
LD (STKEND),HL
RST $30
DEFW L1E99 ; FIND-INT2
INC BC
POKE_L: RST $20 ; advance
PUSH BC
RST $30
DEFW L24FB ; SCANNING
EX AF,AF'
BIT 6,(IY+$01) ; numeric?
JR Z,SPOKE ; jump, if not
RST $30
DEFW L2DD5 ; FP-TO-A
JP C,ERROR_B
JR Z,POKEP
NEG
POKEP: POP BC
LD (BC),A
INC BC
JR POKE_L2
E_POKE: CALL SYNTAX_Z
JR Z,POKE_S
RST $28 ; CALCULATE
DEFB $01 ; exchange
DEFB $38 ; end
RST $30
DEFW L1E99 ; FIND-INT2
PUSH BC
RST $18
EX AF,AF'
SPOKE: RST $30
DEFW L2BF1 ; STK-FETCH
LD A,B
OR C
EX DE,HL
POP DE
JR Z,EPOKE
LDIR
EPOKE: LD C,E
LD B,D
POKE_L2:EX AF,AF'
CP ","
JR Z,POKE_L
POKE_SWAP:
RST $10
USR: CALL SYNTAX_Z
JR Z,POKE_SWAP
RST $30
DEFW L1E99 ; FIND-INT2
PUSH BC
RST $10
TEST_ZERO:
LD HL,(STKEND)
DEC HL
XOR A
DEC HL
OR (HL)
DEC HL
OR (HL)
DEC HL
DEC HL
OR (HL) ; zero only for small integers
LD (STKEND),HL
RET
ASSERT: CALL TEST_ZERO
JR NZ,POKE_SWAP
ERROR_V:CALL ERROR
DEFB $1E ; V ASSERT failed
ERROR_W:CALL ERROR
DEFB $1F ; W END WHILE without WHILE
ERROR_N:RST $30
DEFW L1BEC ; N Statement lost
ENDWHILE:
CALL SKIP_LL
CP WHILE_M
JR NZ,ERROR_W ; wrong context
DEC HL
DEC HL ; skip outer error address
PUSH HL ; context
LD DE,(CH_ADD) ; execution pointer
PUSH DE ; save it
DEC HL
LD A,(HL) ; A=(SUBPPC)
DEC HL
LD D,(HL)
DEC HL
LD E,(HL) ; DE=(PPC)
PUSH AF
EX DE,HL
RST $30
DEFW LINE_ADDR
JR NZ,ERROR_N
INC HL
INC HL ; skip line number
INC HL
INC HL ; skip line length
POP DE
DEC D
LD E,0
RST $30
DEFW L198B ; EACH-STMT
RST $20 ; skip WHILE token
RST $30
DEFW L24FB ; SCANNING
CALL TEST_ZERO
POP HL ; old execution pointer
JR Z,WEND
POP DE ; discard context
JR CONT_LOOP ; continue with the loop
WEND: LD (CH_ADD),HL
POP HL ; context
LD (ERR_SP),HL
POP BC ; return address
LD SP,HL ; reclaim locals
PUSH BC
JR UNT_SW
UNTIL: CALL TEST_ZERO
EX AF,AF'
POP BC ; return address
POP HL ; error address
POP DE ; marker
LD A,D
CP $3E
JR NZ,ERROR_U ; after GO SUB
LD A,E
CP REPEAT_M
JR Z,UNT_NL ; no local variables
PUSH DE ; put back marker
EXX
CALL SKIP_LL
CP REPEAT_M
EXX
JR NZ,ERROR2U ; wrong context
EX AF,AF'
JR NZ,UNT_R ; reclaim local context
PUSH HL ; error address
PUSH BC ; return address
EXX
AND A
SBC HL,DE
INC HL ; skip marker
JR UNT_C ; continue loop
UNT_R: EXX
LD SP,HL ; reclaim local variables
EXX
EX DE,HL
JR UNT_ER ; continue after UNTIL
UNT_NL: EX AF,AF'
JR NZ,END_REP
PUSH DE ; marker
PUSH HL ; error address
PUSH BC ; return address
CONT_LOOP:
LD HL,$0006
ADD HL,SP
UNT_C: LD E,(HL)
INC HL
LD D,(HL) ; DE = (PPC)
INC HL
LD A,(HL) ; A = (SUBPPC)
EX DE,HL ; HL = (PPC)
LD D,A ; D = (SUBPPC)
GOTO_5: LD BC,L1E73 ; GO-TO-2
PUSH BC
UNT_SW: RST $10
END_REP:EX DE,HL
POP HL
INC SP ; SP = SP + 3
UNT_ER: PUSH DE
UNT_E: LD (ERR_SP),SP
PUSH BC
RST $10
ERROR_U:PUSH DE
ERROR2U:PUSH HL
CALL ERROR
DEFB $1D ; U UNTIL without REPEAT
ERROR_2:RST $30
DEFW L0670 ; 2 Variable not found
; LET with operator update
UPDATE: LD C,A
RST $20
CP "="
JR NZ,ERROR_C_J
CALL SYNTAX_Z
JR Z,UPD_S
BIT 1,(IY+$37) ; Does the variable exist?
JR NZ,ERROR_2 ; Report error, if not
LD HL,(DEST)
INC HL
LD DE,(STKEND)
BIT 6,(IY+$01) ; Numeric variable?
JR NZ,UPD_STK ; Jump, if so
LD L,E
LD H,D ; string parameters already in place
UPD_STK:LD A,C ; save C
LD BC,5
LDIR
LD C,A ; restore C
LD (STKEND),DE ; restore the variable on the VM stack
POP HL ; drop SCAN-LOOP
LD A,(FLAGS)
LD HL,L1BEE ; CHECK-END
PUSH HL
PUSH AF
LD HL,L1C59 + 4 ; VAL-FET-2 continues
JR UPD_X
UPD_S: LD HL,L1BEE ; CHECK-END
UPD_X: PUSH HL
LD H,0 ; starting priority marker 0
LD B,H ; clear B for OPERTR
PUSH HL
LD HL,L2795 ; OPERATORS table in ROM1
RST $30
DEFW L16DC ; INDEXER in ROM1
JR C,OLDOPR
BIT 6,(IY+$01) ; are we expecting a string
JR Z,UPDSTR ; jump, if so
LD A,"%"
CP C
JR NZ,UPDNUM ; not MOD
LD BC,$01C2 ; delete with priority 1
PUSH BC
LD BC,$01F2 ; mod with priority 1
U_NEXT: LD HL,L2790 ; S-NEXT
PUSH HL
REPSW1: JR UNT_SW
UPDNUM: LD HL,UPDTABN
CALL INDEXER
CALL SYNTAX_Z
JR NZ,UPD_DO
JR NC,ERROR_C_J
LD BC,$01CF ; numeric addition with priority 1
JR U_NEXT
ERROR_C_J:
JP ERROR_C
UPDSTR: LD HL,UPDTABS
CALL INDEXER
CALL SYNTAX_Z
JR NZ,UPD_DO
JR NC,ERROR_C_J
LD BC,$0117 ; string addition with priority 1
JR U_NEXT
OLDOPR: RST $30
DEFW X007B ; LD A,(HL) in ROM1
LD C,A ; operator code in C
LD B,1 ; lowest possible priority in B
LD HL,L2734 ; S-LOOP
PUSH HL
JR REPSW1
UPD_DO: POP BC ; discard marker, B=0
LD C,(HL)
;; LD B,0
ADD HL,BC
LD BC,L2D2B + 4 ; STACK-BC
PUSH BC
PUSH HL
RST $20 ; advance
RST $30
DEFW L24FB + 1 ; SCANNING + 1
RET
LABEL: CP "("
JP NZ,END05
RST $20
CP ")"
JR Z,DP_E
DP_L: RST $30
DEFW L2C8D ; ALPHA
JR NC,ERROR_C_J
RST $20
CP "$"
JR NZ,DP_NUM
RST $20
DP_NUM: CP ","
JR NZ,DP_E
RST $20
JR DP_L
DP_E: CP ")"
ERRC_NZ:JR NZ,ERROR_C_J
RST $20
CALL SYNTAX_Z
JP Z,END05
LD DE,T_DP
SKIPEND:CALL LOOK_PROG2
INC BC
LD (NXTLIN),BC
JP C,ERROR_S ; S Missing END (PROC)
INC (IY+$0A) ; advance NSPPC past END PROC
RST $10
LOCAL_R:RST $20 ; advance past the comma
LOCAL_S:RST $30
DEFW L2C8D ; ALPHA
JR NC,ERROR_C_J
RST $20
CP "$"
LD B,$40
JR NZ,LOCAL_N
LD B,$00
RST $20
LOCAL_N:CP "("
JR NZ,LOCAL_I
LD C,$A1
RST $30
DEFW L2996 ; STK-VAR
LOCAL_E:RST $18 ; TODO: ???
CP ","
JR Z,LOCAL_R
LD HL,L1BEE + 5 ; CHECK-END + 5; TODO: array initializer?
PUSH HL
SW_LOC: RST $10
LOCAL_I:CP "="
JR NZ,LOCAL_E
RST $20
PUSH BC
RST $30
DEFW L24FB + 1 ; SCANNING + 1
LD A,(FLAGS)
POP BC
XOR B
AND $40
JR NZ,ERRC_NZ ; type mismatch
JR LOCAL_E
LCL_NX: PUSH BC
PUSH DE
PUSH AF
JR LCL_EX
LOCAL: CALL SYNTAX_Z
JR Z,LOCAL_S
LOCAL_L:AND $1F
OR $60 ; assume simple numeric
LD C,A
RST $20
CP "$"
JR NZ,LCL_N
RES 5,C
RST $20
LCL_N: CP "("
JR Z,LCL_A
CALL LOOK_LC
JR C,LCL_F
LCL_L: RST $18
CP "="
JR NZ,LCL_E
PUSH BC
RST $20
RST $30
DEFW L24FB + 1 ; SCANNING + 1
POP BC
POP DE ; return address
POP HL ; error address
EXX
RST $30
DEFW L2BF1 ; STK-FETCH
BIT 6,(IY+$01) ; type
JR NZ,LCL_NX
CALL LCL_STR
LD BC,(STRLEN)
PUSH BC
INC BC
INC BC
PUSH BC
JR LCL_EXX
LCL_E: POP DE ; return address
POP HL ; error address
BIT 5,C
EXX
LD HL,0
PUSH HL
PUSH HL
JR NZ,LCL_EN
LD H,$03
LCL_EN: PUSH HL
LCL_EX: INC SP
LCL_EXX:EXX
LD B,$3E ; marker
PUSH BC
PUSH HL ; error address
LD (ERR_SP),SP
PUSH DE ; return address
LCL_CM: RST $18
CP ","
JR NZ,SW_LOC
RST $20
JR LOCAL_L
LCL_F: DEC HL
BIT 7,(HL)
JR NZ,LCL_L
RES 1,(IY+FLAGX-ERR_NR) ; signal existing
EX DE,HL
RST $18
CP "="
JR NZ,LCL_CM
EX DE,HL
INC HL
BIT 5,C
JR NZ,LCL_AN
INC HL
INC HL
INC HL ; skip maxlen
LD C,(HL)
INC HL
LD B,(HL) ; BC=length
INC HL
SET 0,(IY+FLAGX-ERR_NR) ; signal complete
LCL_AN: LD (STRLEN),BC
LD (DEST),HL
RST $20
RST $30
DEFW L1C56 ; VAL-FET-1
JR LCL_CM
; Initialize local array
; In: C letter and type
LCL_A: XOR A
LD (MEMBOT),A ; reset dimension counter
PUSH BC ; save variable name and type
LD HL,$0001 ; string element is 1 byte
BIT 5,C
JR Z,LCL_SA ; string array
LD L,$05 ; numeric element is 5 bytes
LCL_SA: PUSH HL ; save size
RST $20 ; advance past separator
RST $30
DEFW L24FB + 1 ; SCANNING + 1, read dimension
PUSH AF ; save separator
RST $28
DEFB $31 ; duplicate
DEFB $38 ; end
RST $30
DEFW L1E99 ; FIND-INT2
LD E,C
LD D,B
POP BC ; restore separator
POP HL ; restore size
RST $30
DEFW L2AF4 + 4 ; HLxDE + 4
INC (IY+MEMBOT-ERR_NR)
LD A,B
CP ","
JR Z,LCL_SA ; loop through all dimensions
EXX
POP BC ; restore variable name and type
POP DE ; return address
POP HL ; error address
EXX
LD (MEMBOT+2),HL
LD C,L ; TODO: add dimensions to memory check
LD B,H
RST $20 ; skip through closing bracket
RST $30
DEFW L1F05 ; TEST-ROOM
AND A
LD HL,$0000
SBC HL,BC ; -size
ADD HL,SP
LD SP,HL
LD E,L
LD D,H
INC DE
DEC BC
XOR A
EXX
BIT 5,C
EXX
JR NZ,LCL_IN
LD A," "
LCL_IN: LD (HL),A
LD A,B
OR C
JR Z,LCL_1S ; 1 element string array
LDIR
LCL_1S: LD A,(MEMBOT)
LD (MEMBOT+1),A
LCL_DM: EXX
PUSH DE
EXX
RST $30
DEFW L1E99 ; FIND-INT2
EXX
POP DE
EXX
PUSH BC ; save dimension
DEC (IY+MEMBOT-ERR_NR)
JR NZ,LCL_DM
LD BC,(MEMBOT)
PUSH BC
INC SP ; save number of dims
LD C,B
LD B,0
LD HL,(MEMBOT+2)
ADD HL,BC
ADD HL,BC
INC HL
PUSH HL ; save total size
EXX
LD A,C
AND $3F
LD C,A
LD B,$3E
PUSH BC ; array name and type
PUSH HL ; error address
LD (ERR_SP),SP
PUSH DE ; return address
RST $10
LCL_STR:LD (STRLEN),BC
PUSH DE
RST $30
DEFW L1F05 ; TEST-ROOM
POP DE
LD HL,$0002
ADD HL,SP
AND A
SBC HL,BC
POP BC
LD SP,HL
PUSH BC
EX DE,HL
LD BC,(STRLEN)
LD A,B
OR C
RET Z
LDIR
RET
STACKQ: POP DE ; discard STACKE
STCK_SW:RST $10
STACK: LD HL,(ERR_SP)
INC HL
INC HL ; skip error address
STACKL: SET 6,(IY+TV_FLAG-ERR_NR) ; LIST in progress
LD DE,STACKE
PUSH DE
CALL NOLEAD ; suppress leading spaces
LD A,$3E
LD C,(HL)
INC HL
LD B,(HL)
CP B
INC HL
JR NZ,ST_GOSUB
LD A,C
OR A
JR Z,STACKQ
ADD A,A
JR NC,ST_NFOR ; not FOR variable
LD A,FOR_T
RST $30
DEFW L0010
CALL ST_NUM
LD A,TO_T
RST $30
DEFW L0010
CALL ST_NUMV
LD A,STEP_T
RST $30
DEFW L0010
CALL ST_NUMV
LD A," "
RST $30
DEFW L0010
JR ST_SMTV
STACKE: LD A,$0D
RST $30
DEFW L0010
RES 6,(IY+TV_FLAG-ERR_NR) ; no LIST in progress
JR STACKL
ST_NFOR:RRA
SUB REPEAT_M
JR C,ST_VAR
JR Z,ST_REP
DEC A
JR Z,ST_WHL
ST_PRC: LD A,PROC_T
INC HL
INC HL
ST_PRCR:CALL ST_CTX
INC HL
INC HL ; skip duplicated error address
RET
ST_WHL: LD A,WHILE_T
JR ST_PRCR
ST_GOSUB:
LD A,GOSUB_T
RST $30
DEFW L0010
JR ST_STMT
ST_REP: LD A,REPEAT_T
ST_CTX: RST $30
DEFW L0010
ST_SMTV:LD C,(HL)
INC HL
LD B,(HL)
INC HL
ST_STMT:LD A,AT_T
RST $30
DEFW L0010
PUSH HL
RST $30
DEFW L1A1B ; OUT-NUM-1
ST_REF: LD A,":"
RST $30
DEFW L0010
POP HL
LD A,(HL)
DEC A
CALL DECBYTE
INC HL
RET
ST_VAR: LD A,LOCAL_T
RST $30
DEFW L0010
LD A,C
AND $20
JR Z,ST_STR
ST_NUM: CALL ST_VARN
LD A,"="
RST $30
DEFW L0010
ST_NUMV:RST $30
DEFW L33B4 ; STACK-NUM
PUSH HL
RST $30
DEFW L2DE3 ; PRINT-FP
POP HL
RET
ST_STR: CALL ST_VARN
ST_SKIP:LD E,(HL)
INC HL
LD D,(HL)
ADD HL,DE
INC HL
RET
ST_VARN:LD A,C
AND $1F ; bottom 5 bits
OR "a"-1
RST $30
DEFW L0010
BIT 5,C
LD A,"$"
CALL Z,PRINT_A
BIT 6,C
RET NZ
LD A,"("
RST $30
DEFW L0010
LD A,")"
RST $30
DEFW L0010
CALL ST_SKIP
POP DE ; discard return address
RET
CLIP:
; unimplemented instruction, reports error, if executed
PLUG: JP ERROR_C
; WHILE structure table
T_WHILE:DEFB ENDWHILE_T
DEFB F_ENDWHILE - $
DEFB WHILE_T
DEFB F_WHILE - $
DEFB 0
; DEF PROC structure table
T_DP: DEFB ENDPROC_T
DEFB F_ENDPROC - $
DEFB DEFPROC_T
DEFB F_DEFPROC - $
DEFB 0
; FOR structure table
T_FOR: DEFB NEXT_T
DEFB F_NEXT - $
DEFB FOR_T
DEFB F_FOR - $
DEFB 0
; IF structure table
T_IF: DEFB ELSE_T
DEFB F_ELSE - $
DEFB ENDIF_T
DEFB F_ENDIF - $
DEFB IF_T
DEFB F_IF - $
DEFB 0
F_ELSE: LD A,(NESTING)
DEC A
JR Z,F_ELSER
RST $20
CP $0D ; end-of-line ELSE, no implicit END IF
JR Z,EACH_COMEBACK
INC (IY+NEST2-ERR_NR) ; implicit END IF
JR EACH_COMEBACK
F_NEXT: RST $20
CP ":"
JR Z,F_ENDIF
CP $0D
JR Z,F_ENDIF
; Consider variable
OR $20 ; lowercase
CP (IY+$38)
JR NZ,EACH_COMEBACK
INC (IY+$0A) ; increment NSPPC to skip update
JR F_ELSER ; for backwards compatibility
F_ENDWHILE:
F_ENDPROC:
F_ENDIF:DEC (IY+NESTING-ERR_NR)
JR NZ,EACH_COMEBACK
F_ELSER:EX DE,HL
POP DE
POP BC
RET
; Very similar to LOOK-PROG (L1D86) but structured, with keyword behavior
; defined by index table in DE
LOOK_PROG2:
LD HL,$0001
LOOK_PROG2_0:
LD (NESTING),HL
LD HL,(PPC)
LD (NEWPPC),HL
LD A,(SUBPPC)
LD (NSPPC),A
RST $18
CP ":"
JR Z,LOOK_P2
LOOK_P1:INC HL
LD A,(HL)
AND $C0
SCF
RET NZ
LD B,(HL)
INC HL
LD C,(HL)
LD (NEWPPC),BC
INC HL
LD C,(HL)
INC HL
LD B,(HL)
PUSH HL
ADD HL,BC
LD B,H
LD C,L
POP HL
XOR A
LD (NSPPC),A
LOOK_P2:PUSH BC
; Inlined EACH-STMT
LD (CH_ADD),HL
LD BC,$0000
EACH_1: INC (IY+NSPPC-ERR_NR)
JP M,ERROR_C ; TODO: too many statements
LD A,C
EX AF,AF'
RST $20
LD C,A
PUSH DE
EX DE,HL
CALL INDEXER
JR NC,EACH_COMEBACK
LD C,(HL)
ADD HL,BC
JP (HL) ; jump to appropriate routine
F_WHILE:
F_DEFPROC:
F_FOR:
F_IF: INC (IY+NESTING-ERR_NR)
EACH_COMEBACK:
EX DE,HL
EACH_COMEBACK2:
EX AF,AF'
LD C,A
POP DE
EACH_2: INC HL
LD A,(HL)
EACH_3: RST $30
DEFW L18B6
LD (CH_ADD),HL
CP "\""
JR NZ,EACH_4
DEC C
EACH_4: CP ":"
JR Z,EACH_5
CP THEN_T ; THEN
JR NZ,EACH_6
EX DE,HL
CP (HL)
EX DE,HL
JR NZ,EACH_5
INC (IY+NEST2-ERR_NR)
EACH_5: BIT 0,C
JR Z,EACH_1
EACH_6: CP $0D
JR NZ,EACH_2
LD A,(NESTING)
SUB A,(IY+NEST2-ERR_NR)
LD (NESTING),A
XOR A
LD (NEST2),A
EACH_7: INC (IY+$0A)
POP BC
JP LOOK_P1
; Long-named string variables
LV_CONT:JR C,LV_NEXT
RST $30
DEFW L28B2 ; LOOK-VARS
PUSH HL
EX AF,AF'
RST $18
CP "$"
JR NZ,LV_NSTR
; long string not found
RST $20 ; skip over "$"
RES 6,(IY+FLAGS-ERR_NR) ; indicate string
CALL SYNTAX_Z
SCF
JR NZ,SW_LV2 ; in runtime, long string not found CF=1,ZF=0
AND A ; in syntax check, long string found CF=0,ZF=0
DEFB $3E ; LD A,skip next byte
LV_NSTR:EX AF,AF'
SW_LV2: POP HL
RST $10
LV_FOR: CP $91 ; interpreting FOR?
JR NZ,LV_DIM ; if not, it's a DIM
LV_SW: LD BC,L28B2 ; LOOK-VARS
JR NEXT_SW
LV_DIM: XOR A
LD (DEFADD+1),A ; look for globals only
RST $30
DEFW L28B2 ; LOOK-VARS
LD (IY+DEFADD+1-ERR_NR),1 ; restore without changing flags
RST $10 ; return to DIM
; Handling DIM and argumentless NEXT
LV_NEXT:LD A,(T_ADDR)
CP $99 ; interpreting NEXT?
JR NZ,LV_FOR ; check FOR, if not
RST $18 ; get the character following NEXT
CP $0D ; CR?
JR Z,NEXT ; if so, it's an argumentless NEXT
CP ":" ; colon?
JR NZ,LV_SW ; return, if not
NEXT: POP BC ; discard CLASS-04 return address
POP BC ; discard SCAN-LOOP
CALL CHECK_END
CALL SKIP_LC
ADD A,A
JR NC,ERROR_1
PUSH HL
INC HL
LD (MEM),HL
RST $28 ; same calculator command as in NEXT
DEFB $E0,$E2,$0F,$C0,$02,$38
RST $30
DEFW L1DDA ; NEXT-LOOP
LD HL,MEMBOT
LD (MEM),HL ; much faster than RST $30:DEFW X16CB, not worth 3 bytes
POP HL
JR NC,NEXT_LP ; execute loop body again
LD BC,$0013 ; jump over loop variable
ADD HL,BC
POP BC ; save return address
POP DE ; save error address
LD SP,HL
PUSH DE ; restore error address
LD (ERR_SP),SP
NEXT_SW:PUSH BC ; restore return address
SW_LV: RST $10
NEXT_LP:LD BC,$0010
ADD HL,BC
JP UNT_C
ERROR_1:RST $30
DEFW REPORT1 + 3 ; 1 NEXT without FOR
ERROR_A:RST $30
DEFW L34E7 ; A Invalid argument
STOP: PUSH BC
DERROR: RST $30
DEFW L24FB ; SCANNING
BIT 6,(IY+$01) ; numeric?
JR NZ,NERROR
CALL SYNTAX_Z
JR Z,SERROR
RST $30
DEFW L2BF1 ; STK-FETCH
LD A,B
OR C
JR Z,ERROR_A
LD HL,(WORKSP)
AND A
SBC HL,DE
ADD HL,DE
JR C,WERROR
PUSH HL
PUSH DE
RST $30
DEFW L0030 ; BC-SPACES
POP HL
PUSH BC
PUSH DE
LDIR
POP DE
POP BC
POP HL
WERROR: EX DE,HL
LDIR
EX DE,HL
DEC HL
SET 7,(HL)
SERROR: RST $18
CP ","
JR NZ,YERROR
CALL NEXT_1NUM
CALL SYNTAX_Z
JR Z,ZERROR
RST $30
DEFW L1E94 ; FIND-INT1
SUB $80
ERRBNC: JP NC,ERROR_B
JR ZERROR
YERROR: LD A,$89 ; custom report
JR ZERROR
NERROR: CALL SYNTAX_Z
JR Z,ZERROR
RST $30
DEFW L1E94 ; FIND-INT1
CP MAX_ERR
JR NC,ERRBNC
ZERROR: DEC A
PUSH AF
RST $18
CP ","
JR NZ,XERROR
RST $20
CP LINE_T
JR Z,STOP_LINE
CALL CLASS2_08
CALL SYNTAX_Z
RERROR: JP Z,END05_E
RST $30
DEFW L1E94 ; FIND-INT1
LD (SUBPPC),A
RST $30
DEFW L1E99 ; FIND-INT2
LD (PPC),BC
XERROR: CALL SYNTAX_Z
JR Z,RERROR
POP AF
LD L,A
RST $30
DEFW L0055 ; ERROR-3
STOP_LINE:
RST $20
CALL SYNTAX_Z
JR Z,RERROR
POP AF
LD (ERR_NR),A
POP HL ; discard ESTOP
LD HL,L0055 + 3 ; ERROR-3 + 3
EX (SP),HL
LD HL,SUBPPC
LD A,1
JR POPCTX
POP: LD HL,OSPCC
XOR A
POPCTX: LD (MEMBOT),HL
LD (MEMBOT+2),A
CALL CALLCTX
CP MM
PUSH HL
JR Z,POP_GS
DEC HL
DEC HL ; skip old error address
POP_GS: DEC HL
LD BC,$0003
LD DE,(MEMBOT)
LDDR ; move return pointer to CONTINUE pointer
DEC (IY+MEMBOT+2-ERR_NR)
JR NZ,POPCNT
DEC (IY+SUBPPC-ERR_NR)
POPCNT: POP HL ; new context
POP BC ; return address
POP DE ; error address
LD SP,HL
PUSH DE ; error address
LD (ERR_SP),SP
PUSH BC ; return address
RST $10
RENUM: POP BC ; return address
POP DE ; error address
LD HL,(RAMTOP)
DEC HL
DEC HL ; skip the end-of-stack marker
LD SP,HL ; clear the stack
PUSH DE ; error address
LD (ERR_SP),SP
PUSH BC ; return address
LD DE,$0000 ; line counter
LD HL,(PROG)
RENUML0:LD A,(HL)
CP $28
JR NC,RENUMC
INC HL
INC HL ; skip line number
LD C,(HL)
INC HL
LD B,(HL) ; get line length in BC
SCF ; faster than INC HL
ADC HL,BC ; move to next line
INC DE
JR RENUML0
RENUMC: LD HL,(RCSTEP)
DEC DE
RST $30
DEFW L30A9 ; HL=HL*DE
JR C,ERROR_G
LD DE,(RCSTART)
ADC HL,DE
JR C,ERROR_G
LD BC,10000
SBC HL,BC
JR NC,ERROR_G ; the last line number must not exceed 9999
LD HL,(PROG)
RENUML: LD A,(HL)
CP $28
JR NC,RENUME
LD B,(HL)
LD (HL),D
INC HL
LD C,(HL)
LD (HL),E
LD (RCLINE),BC
EX DE,HL
LD BC,(RCSTEP)
ADD HL,BC
EX DE,HL
INC HL
LD C,(HL)
INC HL
LD B,(HL)
SCF ; faster than INC HL
ADC HL,BC ; TODO: print all problematic instructions
JR RENUML
RENUME: RST $30
DEFW L1BB0 ; 0 Ok.
ERROR_G:CALL ERROR
DEFB $0F ; G No room for line
; TRACE jump
TRACE_J:SET 7,(HL)
LD HL,STEP_HOOK
PUSH HL
LD (ERR_SP),SP
LD HL,X1B83
JR TR_SW
TR_THENLESS:
CALL TEST_ZERO
JR NZ,TR_IF2
LD HL,STEP_HOOK
PUSH HL
PUSH HL ; placeholder
JP THENLESS0
TR_ELIF:INC HL
CALL SKIPEX
CP THEN_T
JR Z,TR_REM
DEC HL
JP ELSE_4
TRACE: POP HL ; discard return address
TRACE_D:LD HL,NSPPC
BIT 7,(HL) ; jump?
JR Z,TRACE_J ; jump, if so
TR_IF2: RST $18
CP $0D
JR Z,TRACE_L
SET 7,(IY+$0D) ; Signal TRACE for STMT-LOOP
TRACE_R:LD HL,L1B76 ; STMT-RET
TR_SW: PUSH HL
RST $10 ; return
TRACE_EX_TAB:
DEFB IF_T
DEFB TR_IF - $
DEFB ELSE_T
DEFB TR_ELSE - $
DEFB REM_T
DEFB TR_REM - $
DEFB 0
TR_IF1: SET 7,(IY+$0D) ; Signal TRACE for STMT-LOOP
JP STMT_LOOP
TR_IF: RST $20
RES 4,(IY+$37) ; signal true outcome
RST $30
DEFW L24FB + 1 ; SCANNING + 1
CP THEN_T
JR NZ,TR_THENLESS
CALL TEST_ZERO
JR NZ,TR_IF1
SET 4,(IY+$37) ; signal false outcome
TR_ELSE:LD HL,FLAGX
BIT 4,(HL)
JR NZ,TR_REM
RES 4,(HL)
RST $20
CP $0D
SCF
LD BC,STEP_HOOK
JP Z,ELSE_3
CP IF_T
JR Z,TR_ELIF
TR_REM: LD HL,(NXTLIN)
DEC HL
TRACE_L:INC HL
LD A,(HL)
CP $3E ; end-of program?
JR NC,TRACE_R ; jump, if so
TRACE_U:LD A,$81
LD DE,STEP_HOOK
PUSH DE
LD (ERR_SP),SP
LD DE,X1BA9 ; LINE-USE with preliminary check
PUSH DE
TR_SW1: RST $10
STEP_CONT:
LD A,(ERR_NR)
INC A ; Handling an error?
JR NZ,TRACE_E ; jump, if so
LD HL,SUBPPC
BIT 7,(HL) ; Handling STMT-LOOP?
JR Z,TRACE_D ; jump, if not
RES 7,(HL)
RST $30
DEFW L0D6E ; CLS-LOWER
LD HL,(PPC)
BIT 7,H ; executing command line?
JR Z,TRACE_2 ; jump, if not
INC HL
INC HL
TRACE_2:CALL DECWORD
LD A,":"
RST $30
DEFW L0010
LD A,(SUBPPC)
CALL DECBYTE
CALL PR_SPACE
RST $18
LD A,(HL)
RST $30
DEFW L0010 ; TODO: proper line listing
RES 3,(IY+$02) ; no edit line
LD HL,FLAGX
LD C,(HL)
RST $30
DEFW L15DE ; WAIT-KEY1
PUSH AF
LD (HL),C
RST $30
DEFW L0D6E ; CLS-LOWER
POP AF
POP HL
CP " "
JR Z,ERROR_L ; BREAK
CP "c"
JR Z,TRACE_X
CP "C"
TRACE_X:JP Z,ELSE_1
PUSH HL
RST $18
LD C,A
LD HL,TRACE_EX_TAB
CALL INDEXER
JP C,INDEXER_JP
LD A,C
LD HL,STEP_HOOK
JR TR_SW1
TRACE_Q:LD HL,(NEWPPC)
RST $30
DEFW L196E ; LINE-ADDR again, we lost the result
JR TRACE_U
TRACE_E:LD (ERR_SP),SP ; restore ERR_SP
LD (IY+$00),$FF ; restore ERR_NR
RST $18 ; HL=(CH_ADD)
LD A,(SUBPPC)
ADD $81
JR NC,TRACE_Q ; LINE-NEW derailed
CP 2
JR C,TRACE_E1
LD D,A
LD E,0
RST $30
DEFW L198B ; EACH-STMT
JP NZ,ERROR_N
CP $0D
JP Z,TRACE_L
RST $20 ; advance
TRACE_E1:
JP ELSE_1
; Similar to L1F54 in ROM1
BREAK: LD A,$7F
IN A,($FE)
RRA
RET C
LD A,($FE)
IN A,($FE)
RRA
RET C
ERROR_L:RST $30
DEFW L1B7B ; L Break into program
DEL_SK: RST $18 ; TODO: ???
CP "("
JR NZ,DEL_SW
RST $20
CP ")"
EX AF,AF'
RST $20
EX AF,AF'
JR Z,DEL_SW
JP ERROR_C
DEL_E: LD HL,(VARS)
JR DEL_NE
DELETE: RST $30
DEFW L2C8D ; ALPHA
JR NC,DEL_PR
DEL_NX: RST $30
DEFW L28B2 ; LOOK-VARS
JR C,DEL_SK ; return, if not found
RL C
JR C,DEL_SK ; return, if checking syntax
SBC HL,SP
JR NC,DEL_LC ; DELETE local
ADD HL,SP
PUSH HL
RST $18
CP "("
POP HL
JR Z,DEL_AR ; DELETE array
BIT 6,C
JR Z,DEL_ST ; DELETE string
LD BC,$0006 ; DELETE numeric
BIT 7,(HL)
JR Z,DEL_N1 ; DELETE single letter numeric
DEL_NL: INC BC
DEC HL
BIT 7,(HL)
JR Z,DEL_NL
DEL_N1: RST $30
DEFW L19E8 ; RECLAIM-2
DEL_SW: RST $18
CP ","
JP NZ,SWAP
RST $20
JR DEL_NX
DEL_AR: PUSH HL
RST $20 ; skip ")"
RST $20
POP HL
DEL_ST: INC HL
LD C,(HL)
INC HL
LD B,(HL)
DEC HL
DEC HL
INC BC
INC BC
INC BC
JR DEL_N1
DEL_PR: CALL CLASS2_0A
CALL CHECK_END
DEL_DO: RST $30
DEFW L2DA2 ; FP-TO-BC
JR NZ,DEL_E
JR C,DEL_E
LD L,C
LD H,B
RST $30
DEFW L196E ; LINE-ADDR
JR NZ,DEL_NE
INC HL
INC HL
LD E,(HL)
INC HL
LD D,(HL)
SCF ; faster than INC HL
ADC HL,DE ; skip last line
DEL_NE: PUSH HL
RST $30
DEFW L1E99 ; FIND-INT2
LD L,C
LD H,B
RST $30
DEFW L196E ; LINE-ADDR
EX DE,HL
POP HL
RST $30
DEFW L19DD ; DIFFER
RET C
RST $30
DEFW L19E8 ; RECLAIM-2
LD HL,(PPC)
LD A,(SUBPPC)
LD (NEWPPC),HL
INC A
LD (NSPPC),A
CALL RSTLBLS
RST $10
DEL_LC: LD A,$BF
CP C
DEC HL
JR NC,DEL_LH
INC HL
INC HL
DEL_LH: PUSH HL ; save stack length
ADD HL,SP ; add one more for simple numeric
LD A,(HL)
AND $60
CP $60
LD E,L
LD D,H
JR Z,DEL_LF
INC HL
INC HL
LD C,(HL)
INC HL
LD B,(HL)
DEL_LF0:ADD HL,BC
EX DE,HL
POP BC
DEC HL
DEC BC
DEC BC
LDDR
INC DE
EX DE,HL
LD SP,HL
INC HL
INC HL
LD (ERR_SP),HL
RST $18
CP "("
JR NZ,DEL_SW2
RST $20
RST $20
DEL_SW2:JP DEL_SW
DEL_LF: LD BC,$0017
LD A,(HL)
CP $E0
JR NC,DEL_LF0
LD C,$06
JR DEL_LF0
PROC_S: RST $30
DEFW L2C8D ; ALPHA
LD B,1
CALL S_LBLI ; insert label with empty cache
RST $18 ; TODO: ???
CP "("
JR NZ,ERR_PR
RST $20
CP ")"
JR Z,PROC_SE
DEFB $3E ; LD A, skipping next byte
PROC_SL:RST $20
RST $30
DEFW L24FB ; SCANNING
CP ","
JR Z,PROC_SL
CP ")"
ERR_PR: JP NZ,ERROR_C
PROC_SE:RST $20
CP TO_T
JP NZ,END05
READ_3: LD HL,L1DEC ; READ-3
RST $10
PROC: CALL SYNTAX_Z
JR Z,PROC_S
LD BC,$0012
RST $30
DEFW L1F05 ; TEST-ROOM
POP DE ; DE = return address
POP HL ; HL = error address
PUSH HL
PUSH HL ; replicate
LD HL,(SUBPPC - 1)
INC H
EX (SP),HL ; HL = error address
INC SP ; stack SUBPPC (1 byte)
LD BC,(PPC)
PUSH BC ; stack PPC (2 bytes)
PUSH HL
LD HL,(DATADD)
LD BC,(PROG)
AND A
SBC HL,BC
EX (SP),HL ; stack DATADD
LD BC,$3E00 + PROC_M
PUSH BC ; stack marker
PUSH HL ; stack error address
; tail call entry point
T_PROC: PUSH DE ; stack return address
RST $18
LD (MEMBOT+26),HL ; label start
L_PROC: LD A,(HL)
CP $0E
INC HL
JR NZ,L_PROC
LD A,(HL)
INC HL
OR (HL)
INC HL
OR (HL)
INC HL
OR (HL)
CALL Z,F_LBL
LD (DATADD),HL
LD B,(HL)
DEC HL
LD C,(HL)
CALL JP_LBL
LD HL,(DATADD)
PROC_L0:INC HL
LD A,(HL)
CP "("
JR NZ,PROC_L0
LD (DATADD),HL ; opening brace for arguments
PROC_L1:INC HL
LD A,(HL)
CP $21
JR C,PROC_L1
CP ")"
JR NZ,PROC_L ; non-empty PROC
LD (DATADD),HL ; closing brace of PROC
PROC_L: RST $20
CP ")" ; no more default arguments in DEF PROC?
JR Z,PROC_E ; jump, if so
AND $1F
OR $60 ; assume simple numeric
LD C,A
RST $20
CP "$"
JR NZ,PROC_N ; jump if numeric indeed
RES 5,C
RST $20
PROC_N: LD (X_PTR),HL ; save argument pointer
LD HL,(DATADD)
LD (CH_ADD),HL
RST $20 ; skip separator
CP ")" ; empty PROC with non-empty DEF PROC?
JR Z,ERROR_Q1 ; that is an error!
PUSH BC ; save variable name and type
RST $30
DEFW L24FB + 1 ; SCANNING + 1
POP BC ; variable name and type
POP DE ; return address
POP HL ; error address
EXX
RST $30
DEFW L2BF1 ; STK-FETCH
BIT 6,(IY+$01) ; type
JR NZ,PROC_NX ; jump, if numeric
CALL LCL_STR ; stack string
LD BC,(STRLEN)
PUSH BC
INC BC
INC BC
PUSH BC
JR PROC_X
PROC_NX:PUSH BC
PUSH DE
PUSH AF
INC SP
PROC_X: EXX
LD A,(FLAGS)
RRCA
XOR C
AND $20
JR NZ,ERROR_Q1
LD B,$3E
PUSH BC ; marker
PUSH HL ; error address
PUSH DE ; return address
RST $18 ; separator of PROC arguments
LD E,A
LD (DATADD),HL
LD HL,(X_PTR)
LD (CH_ADD),HL
RST $18 ; separator in DEF PROC
CP ","
JR NZ,PROC_E
XOR E
JR Z,PROC_L
ERROR_Q1:
LD HL,(ERR_SP)
DEC HL
DEC (HL)
LD DE,SUBPPC
LDD
LDD
LDD
ERROR_Q:RST $30
DEFW REPORT_Q ; Q Parameter error
PROC_E: POP DE ; return address
LD (ERR_SP),SP
PUSH DE
RST $20 ; skip closing bracket Of DEF PROC
RST $10
REPEAT: POP DE ; DE = return address
LD HL,(SUBPPC - 1)
INC H
EX (SP),HL ; HL = error address
INC SP ; stack SUBPPC (1 byte)
LD BC,(PPC)
PUSH BC ; stack PPC (2 bytes)
LD BC,$3E00 + REPEAT_M
JR LOOPFRAME
WHILE: LD HL,(CH_ADD)
LD (DEST),HL
CALL CLASS2_06 ; single numeric expression
CALL CHECK_END
CALL TEST_ZERO
JR Z,WHILE0
POP DE ; DE = return address
POP HL ; HL = error address
PUSH HL
PUSH HL ; replicate
LD HL,(SUBPPC - 1)
INC H
EX (SP),HL ; HL = error address
INC SP ; stack SUBPPC (1 byte)
LD BC,(PPC)
PUSH BC ; stack PPC (2 bytes)
LD BC,$3E00 + WHILE_M
LOOPFRAME:
PUSH BC ; stack marker
PUSH HL ; stack error address
LD (ERR_SP),SP
PUSH DE ; stack return address
LD BC,$0014 ; why this much? see $1F02 in ROM1
LD HL,L1F05 ; TEST-ROOM
ENDPR_E:PUSH HL
WHILE_E:RST $10
WHILE0: LD DE,T_WHILE
JP SKIPEND
ERROR_X:CALL ERROR
DEFB $20 ; X END PROC without DEF
N_RETURN:
PUSH HL ; return address
RST $18
ENDPROC:CP $0D
JR Z,ENDPR
CP ":"
JR Z,ENDPR
CALL SYNTAX_Z
JR Z,ENDPR_S
RST $18
LD (RETADDR),HL ; return data pointer
JR ENDPR3
WRITE: CALL SYNTAX_Z
JP NZ,WRITE_DO
ENDPR_S:LD HL,L1E2C ; DATA-1
JR ENDPR_E
ENDPR1: CALL SKIPLL
JR ENDPR2
ENDPR: CALL CHECK_END
ENDPR3: CALL SKIP_LL
ENDPR2: CP REPEAT_M
JR Z,ENDPR1
CP WHILE_M
JR Z,ENDPR1
CP PROC_M
JR NZ,ERROR_X
PUSH HL ; new marker address
DEC HL
DEC HL ; skip saved error address
LD (ERR_SP),HL
LD DE,SUBPPC
DEC HL
LDD
LDD
LDD ; copy return reference to PPC/SUBPPC
LD B,(HL)
DEC HL
LD C,(HL) ; positive PROG offset
EX DE,HL
LD HL,(PROG) ; PROG
ADD HL,BC
EX DE,HL
LD HL,(DATADD)
LD (DATADD),DE
LD A,(HL)
CP ")" ; closing bracket of PROC
JR Z,ENDP_C
INC HL
ENDP_L: CALL SKIPEX
JR NC,ENDP_L ; skip unread arguments of PROC
DEC HL
ENDP_C: LD (CH_ADD),HL
RST $20 ; advance
CP TO_T
JR Z,ENDP_3
ENDP_SW:POP HL ; new marker address
POP BC ; return address
POP DE ; error address
LD SP,HL
PUSH DE ; error address
PUSH BC ; return address
LD HL,PPC
JP UNT_C
; Very similar to READ-3 except the following:
; - uses RETADDR instead of DATADD
; - reading past data after END PROC or RETURN is an error (Q)
; - data is evaluated in the local context, assigment is done in outer context
ENDP_3: RST $20 ; advance past TO or comma
RST $30
DEFW L1C1F ; CLASS-01, prepare assignment
LD HL,(ERR_SP) ; save ERR-SP
PUSH HL
LD HL,6
ADD HL,SP
LD (ERR_SP),HL ; temporarily restore ERR-SP to local context
RST $18
LD (X_PTR),HL ; save CH-ADD
LD HL,(RETADDR)
CALL TEMP_PTR2
LD A,(FLAGS)
PUSH AF
RST $30
DEFW L24FB ; SCANNING
LD (MEMBOT),A ; save delimiter
POP AF
POP HL
LD (ERR_SP),HL ; restore ERR-SP to outer context
RST $30
DEFW L1C59 + 5 ; VAL_FET_2 + 5
RST $20
LD (RETADDR),HL
LD HL,(X_PTR)
LD (IY+X_PTR+1-ERR_SP),0
CALL TEMP_PTR2
CP ","
JR NZ,ENDP_SW
XOR (IY+MEMBOT-ERR_NR) ; compare delimiter
JR Z,ENDP_3
JP ERROR_Q ; Q Parameter error
; Discard local variables before RETURN
RETURN_CONT:
EX (SP),HL
PUSH BC
CALL CALLCTX
CP MM
JR Z,RETURN_GS
CP PROC_M
JR NZ,ENDP_SW ; TODO: consider other contexts
; returning from a PROC
RST $18
JP ENDPROC
;; alternative with tailcall
;; PUSH HL
;; RST $18 ; fetch character after RETURN
;; POP HL
;; CP ":"
;; JR NZ,RETPROC ; just return from PROC
;; PUSH HL
;; RST $20 ; fetch instruction token after RETURN :
;; POP HL
;; CP PROC_T
;; JR NZ,RETPROC ; not a tail call
; tail call
;; DEC HL
;; DEC HL
;; LD (ERR_SP),HL
;; PUSH HL
;; CALL DEREF ; dereference
;; POP HL
;; LD DE,-9
;; ADD HL,DE ; HL pointing to PROC frame marker
;; POP DE ; return address
;; POP BC ; error address
;; LD SP,HL ; clear local variables and loops
;; RST $20 ; advance past PROC
;; PUSH BC ; stack error address
;; JP T_PROC
; RETURN from GO SUB
RETURN_GS:
POP BC
POP DE
RET_E: DEC HL
DEC HL
DEC HL
LD SP,HL
EX DE,HL
LD DE,L1F23 + 2 ; RETURN + 2
PUSH DE
RST $10 ; RETURN again
; Find calling context (GO SUB or PROC)
CALLCTX:CALL SKIP_LL
SCF
RET_L: CALL NC,LOC_L
OR A
JR Z,ERROR7
CP REPEAT_M
JR Z,RET_L
CP WHILE_M
JR Z,RET_L
RET
ERROR7: RST $30
DEFW REP7 ; 7 Missing PROC or GO SUB
DISPLAY:CALL STACKSWAP
RST $30
DEFW L1E94 ; FIND_INT1
CP $03
JR NC,ERROR_B_NC
DISP: LD A,(S_MODE)
AND $F8
RRCA
RRCA
RRCA
CP C
RET Z
CCF
SBC A,0
RRA
RL C
LD B,0
LD HL,DISPTAB
ADD HL,BC
LD C,(HL)
ADD HL,BC
LD C,$FF
IN A,(C)
IN B,(C)
OR B
INC A
JR Z,ERROR_J
JP (HL)
ERROR_J:RST $30
DEFW L15C4 ; J Invalid I/O device
YIELD: CALL STACKSWAP
RST $30
DEFW L2070 ; STR-ALTER + 4
CALL CHECK_END
JR C,YIELD_R
LD HL,(CURCHL)
INC HL
INC HL
INC HL
INC HL
LD A,(HL)
CP "X"
INC HL
JR NZ,ERROR_J
YIELD_X:LD A,(BANK_M)
OR A
JR NZ,YIELD_C
INC HL
EX AF,AF'
LD A,(HL)
PUSH BC
CALL SWAPIN
POP BC
RET
YIELD_C:EX AF,AF'
PUSH BC
CALL SWAPOUT
POP BC
RET
TURBO_X:RST $30
DEFW L1E94 ; FIND_INT1
CP $10
ERROR_B_NC:
JP NC,ERROR_B ; B Integer out of range
LD BC,$8E3B ; ZX PRISM control port, also works with the ZX UNO
OUT (C),A
RST $10
YIELD_R:LD HL,(CHANS)
LD BC,$0014
ADD HL,BC ; skip system channels
LD C,$04
YIELD_L:EX DE,HL
LD HL,(PROG)
SCF
SBC HL,DE
RET Z
EX DE,HL
PUSH HL
ADD HL,BC
LD A,(HL)
INC HL
CP "X"
JR Z,YIELDX
ADD HL,BC
LD E,(HL)
INC HL
LD D,(HL)
YIELD_N:POP HL
ADD HL,DE
JR YIELD_L
YIELDX: CALL YIELD_X
LD DE,$000B
JR YIELD_N
DISPTAB:DEFB DISP10 - $
DEFB DISP20 - $
DEFB DISP01 - $
DEFB DISP21 - $
DEFB DISP02 - $
DEFB DISP12 - $
DISP02: CALL DISPALLOC
DISP12: CALL REFRAME
LD HL,SCALEX + 2
INC (HL)
LD HL,K_WIDTH
SLA (HL)
DEC (HL)
LD L,S_WIDTH-$5B00
SLA (HL)
DEC (HL)
LD HL,$6000
LD DE,$6001
LD BC,$17FF
LD (HL),L
LDIR
LD HL,S_MODE
LD A,(HL)
AND $07
OR $10
LD (HL),A
LD HL,S_POSN
SLA (HL)
DEC (HL)
INC HL
INC HL
SLA (HL)
DEC (HL)
LD A,(BORDCR)
CPL
AND $38
OR $06
OUT ($FF),A
RET
DISP01: CALL DISPALLOC
CALL DISP01A
DISPC1: LD A,2
DISPC2: OUT ($FF),A
ADD A,A
ADD A,A
LD HL,S_MODE
XOR (HL)
AND $F8
XOR (HL)
LD (HL),A
RET
DISP10: LD HL,$6000
LD DE,$5800
LD BC,$0100
LDIR
INC B
LD H,$68
LDIR
INC B
LD H,$70
LDIR
CALL DISPFREE
DISPC0: XOR A
JR DISPC2
DISP20: CALL DISPFREE
LD HL,$5800
LD BC,$02FF
CALL DISP2X
JR DISPC0
DISP21: LD HL,$6000
LD BC,$17FF
CALL DISP2X
JR DISPC1
DISP2X: LD D,H
LD A,(BORDCR)
AND $38
LD E,A
RRCA
RRCA
RRCA
OUT ($FE),A
XOR $07
OR E
LD E,1
LD (BORDCR),A
LD (HL),A
LDIR
LD HL,K_WIDTH
SRL (HL)
INC (HL)
LD L,S_WIDTH-$5B00
SRL (HL)
INC (HL)
REFRAME:LD HL,INIT_5B00+ORIGX-$5B00
LD DE,ORIGX
LD BC,4*5
LDIR
LD L,E
LD H,D
INC DE
LD (HL),0
LD BC,2*5-1
LDIR
RET
DISP01A:LD HL,$5800
LD DE,$6000
CALL DISPATT
CALL DISPATT
DISPATT:LD A,8
LD B,L
LD C,L
DISPAL: INC B
LDIR
DEC H
DEC A
JR NZ,DISPAL
INC H
RET
DISPALLOC:
LD DE,(CHANS)
LD HL,$7800
AND A
SBC HL,DE
EX DE,HL
LD C,E
LD B,D
RST $30
DEFW L1655 ; MAKE-ROOM
INC DE
LD (CHANS),DE
RET
DISPFREE:
LD HL,(CHANS)
LD DE,CHINFO
RST $30
DEFW L19E5 ; RECLAIM-1
LD (CHANS),HL
RET
STEP: LD A,$07 ; STEP control
RST $30
DEFW L0010
RST $30
DEFW L1E94 ; FIND-INT1
RST $30
DEFW L0010
LD A,(TV_FLAG)
RRCA
LD B,$01
LD A,(K_STATE)
JR C,K_STEP
LD B,$02
LD A,(S_STATE)
K_STEP: LD HL,KS_PERM
ADD A,A
ADD A,A
SBC A,A
XOR (HL)
AND B
XOR (HL)
LD (HL),A
STP_SW: RST $10
G_ONERR:CP GOTO_T
JR Z,T_ONERR
; ON ERROR GO SUB
LD BC,7*3 + 20 ; 3 numeric locals and a GO SUB
RST $30
DEFW L1F05 ; check available memory
POP DE ; return address
LD A,(SUBPPC)
PUSH AF
INC SP
LD HL,(PPC)
PUSH HL ; stack RETURN pointer
LD BC,0
PUSH BC
INC SP
PUSH HL
PUSH BC ; stack line number
LD HL,$3E00 + "l" ; local numeric variable
PUSH HL
PUSH BC
PUSH AF
INC SP
PUSH BC ; stack statement number
LD L,"s" ; local numeric variable
PUSH HL
PUSH BC
EX AF,AF'
PUSH AF
INC SP
PUSH BC ; stack error code
LD L,"e" ; local numeric variable
PUSH HL
PUSH DE ; return address
LD (ERR_SP),SP
; ON ERROR GO TO
T_ONERR:RST $20 ; advance past GO TO/GO SUB
RST $30
DEFW L24FB + 1 ; SCANNING + 1 (numeric result ensured by syntax checker)
LD HL,L1B7D ; STMT-R-1, TODO: TRACE support
PUSH HL
LD HL,L1E67 ; GO-TO
PUSH HL
STP_SW2:JR STP_SW
ONERROR:CALL SYNTAX_Z
JR Z,ONERR_S
CP STOP_T
POP BC ; save return address
POP HL ; discard error address
LD HL,L1303 ; MAIN-4
JR Z,S_ERRSP ; on stop, simply replace error address
LD HL,(CH_ADD)
LD DE,(PROG)
SBC HL,DE ; CF clear at this point
LD (ERRPTR),HL ; store PROG offset of current position
ONERR_C:LD HL,ONERR ; ON error address
S_ERRSP:PUSH HL ; set error address
PUSH BC
ONERR_S:CP STOP_T
JR Z,ONERR2
CP CONTINUE_T
JR Z,ONERR2
SUB GOTO_T
JR Z,ONERR_G
DEC A
JR NZ,ERRC1
ONERR_G:RST $20 ; skip over GO TO or GO SUB
RST $30
DEFW L1C82 ; CLASS-06, expect numeric
DEFB $3E ; LD A,skip one byte
ONERR2: RST $20 ; skip over STOP or CONTINUE
CALL CHECK_END
JR STP_SW2
ONERR_DO:
N_ONERR:LD HL,L1303 ; MAIN-4
PUSH HL
LD HL,ERR_NR
LD A,(HL)
INC A ; OK ?
JR Z,STP_SW2
CP 9 ; STOP ?
JR Z,STP_SW2
EX AF,AF' ; save error code
LD (HL),$FF ; reset ERR_NR
LD HL,(PROG)
LD DE,(ERRPTR)
ADD HL,DE
LD (CH_ADD),HL
RST $18
CP CONTINUE_T
JP NZ,G_ONERR
; ON ERROR CONTINUE
POP HL ; discard MAIN-4
LD HL,SUBPPC
EX AF,AF'
CP $15 ; L BREAK into program?
JR Z,L_BREAK
INC (HL)
L_BREAK:LD DE,NSPPC
LD BC,3
LDDR
LD BC,L1B7D ; STMT-R-1, TODO: TRACE support
EX AF,AF'
JR ONERR_C
PAL_0: XOR A
PAL_X: LD BC,$BF3B
LD D,$40
OUT (C),D
LD B,$FF
OUT (C),A
RET
ERROR_K:RST $30
DEFW L2244 ; K Invalid colour
WRITE_DO:
RST $30
DEFW X207C ; open stream
WRITE_L:RST $30
DEFW L24FB ; SCANNING
BIT 6,(IY+$01) ; numeric result?
JR Z,WRITE_STR ; jump, if string
RST $28
DEFB $02 ; delete
DEFB $38 ; end
LD BC,$0005
WRITE_O:RST $30
DEFW L203C ; PR-STRING
WRITE_N:RST $18
CP ","
JR NZ,READ05
RST $20
JR WRITE_L
READ_EXT:
POP AF
POP AF ; discard return addresses
EX AF,AF'
RST $30
DEFW L2070 ; STR-ALTER
JR C,ERRC1
RST $18
CP ";"
ERRC1: JP NZ,ERROR_C
READ_L: RST $20 ; advance past delimiter
RST $30
DEFW L1C1F ; CLASS-01
CALL SYNTAX_Z
JR Z,READ_S
BIT 6,(IY+$01) ; numeric result?
JR Z,READ_STR ; jump, if string
RST $28
DEFB $38 ; end
LD BC,5
CALL READ_N
JR NZ,ERROR_8
LD (STKEND),DE
READ_A: RST $30
DEFW L2AFF ; LET
READ_S: RST $18
CP ","
JR Z,READ_L
READ05: JP END05
WRITE_STR:
RST $30
DEFW L2BF1 ; STK-FETCH
JR WRITE_O
ERROR_8:RST $30
DEFW L15E4 ; 8 End of file
READ_STR:
LD A,(FLAGX)
AND 3 ; FLAGX, complete string?
JR NZ,READ_C ; jump, if so
LD BC,(STRLEN)
LD DE,(DEST)
CALL READ_ST
JR Z,READ_S
EX DE,HL
READ_W: LD (HL)," "
INC HL
DEC BC
LD A,B
OR C
JR NZ,READ_W
JR READ_S
READ_C: LD BC,1
RST $30
DEFW $0030 ; BC-SPACES
LD (K_CUR),HL
PUSH HL ; start address
READ_CL:RST $30
DEFW L15E6 ; INPUT AD
JR NC,READ_E
EX AF,AF'
LD HL,(CURCHL)
PUSH HL
LD A,$FF ; system channel "R"
RST $30
DEFW L1601 ; CHAN-OPEN
EX AF,AF'
RST $30
DEFW L0030 ; add to string
POP HL
LD (CURCHL),HL
LD HL,(K_CUR)
POP DE
PUSH DE ; start
AND A
SBC HL,DE
PUSH HL ; length
RST $30
DEFW L1F1A ; FREE-MEM
POP BC ; length
SCF
ADC HL,BC ; CF set if OOM
JR NC,READ_CL
POP DE ; start
READEE: RST $30
DEFW L2AB2 ; STK-STO
JR READ_A
READ_E: LD HL,(K_CUR)
POP DE
AND A
SBC HL,DE
LD B,H
LD C,L
JR READEE
READ_N: RST $30
DEFW L15E6 ; INPUT-AD
JR C,READ_B
RET NZ
RST $30
DEFW L1F54 ; BREAK-KEY
JR READ_N
READ_B: LD (DE),A
INC DE
DEC BC
READ_ST:LD A,B
OR C
JR NZ,READ_N
RET
SPECTR: LD A,(BANK_M)
AND $07
JP NZ,ERROR_J ; not from coroutines
LD C,0
CALL DISP ; set video mode
CALL PAL_0 ; turn off ULAplus
LD HL,L15AF ; initial channel info
LD DE,(CHANS)
LD BC,$0014 ; do not copy the terminator!
RST $30
DEFW LDIRR ; reset channel drivers
RES 4,(IY+FLAGS-ERR_NR) ; signal 48k mode
JP SPECTRUM
SCALE: LD HL,SCALEX
SCF
JR SCALE_C
ORIG: SCF
SETORIG:LD HL,ORIGX
SCALE_C:LD (MEM),HL
RET NC
RST $28
DEFB $C1 ; store M1
DEFB $02 ; delete
DEFB $C0 ; store M0
DEFB $02 ; delete
DEFB $38 ; end
RST $10
LIST_CONT:
BIT 7,A
JR Z,LIST_SW ; not a token
LD C,A
LD A,(T_ADDR)
CP $DD
LD A,C
JR NZ,LIST_SW ; not LLIST
PUSH DE
SUB $7F
BIT 2,(IY+FLAGS-ERR_NR)
CALL TOKEN_L
POP DE
POP HL ; discard return address
LIST_SW:RST $10
INCLUDE "play.asm"
|
Scene.g4 | gagik/ppprocessing | 29 | 5340 | grammar Scene;
// Parser rules
file : (name NEWLINE (TAB elements+=action NEWLINE?)* ) EOF;
name : NAME ':';
action : DRAW size shape IN color AT position
| WRITE size STRING IN color AT position
;
size : SMALL | MEDIUM | BIG ;
shape : CIRCLE | SQUARE;
color : BLACK | BLUE | BROWN | GREEN | RED | ORANGE | PURPLE | YELLOW | WHITE ;
position : x=(LEFT | CENTER | RIGHT) ',' y=(TOP | CENTER | BOTTOM) ;
// Lexer rules
DRAW : 'draw' ;
WRITE : 'write' ;
IN : 'in' ;
AT : 'at';
CIRCLE : 'circle' ;
SQUARE : 'square' ;
SMALL : 'small' ;
MEDIUM : 'medium' ;
BIG : 'big' ;
LEFT : 'left' ;
RIGHT : 'right' ;
CENTER : 'center' ;
TOP : 'top' ;
BOTTOM : 'bottom' ;
STRING : '"' .*? '"' ;
BLACK : 'black' ;
BLUE : 'blue' ;
BROWN : 'brown' ;
GREEN : 'green' ;
RED : 'red' ;
ORANGE : 'orange' ;
PURPLE : 'purple' ;
YELLOW : 'yellow' ;
WHITE : 'white' ;
NAME : [a-zA-Z0-9\-_]+;
NEWLINE : ('\r'? '\n' | '\r')+ ;
TAB : ('\t' | ' ' | ' ' ) ;
WHITESPACE : ' ' -> skip ;
|
libsrc/_DEVELOPMENT/arch/zxn/memory/z80/asm_zxn_mmu_from_addr.asm | jpoikela/z88dk | 640 | 14946 | ; ===============================================================
; 2017
; ===============================================================
;
; unsigned char zxn_mmu_from_addr(unsigned int addr)
;
; ===============================================================
SECTION code_clib
SECTION code_arch
PUBLIC asm_zxn_mmu_from_addr
asm_zxn_mmu_from_addr:
; return mmu slot the address belongs to
;
; enter : hl = unsigned int addr
;
; exit : a = l = mmu slot 0-7
;
; uses : af, hl
ld a,h
rlca
rlca
rlca
and $07
ld l,a
IF __SCCZ80
ld h,0
ENDIF
ret
|
luaparser/parser/Lua.g4 | p3sik/py-lua-parser | 1 | 1770 | <reponame>p3sik/py-lua-parser
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 by <NAME>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Project : lua-parser; a Lua 5.2 grammar/parser
* Developed by : <NAME>, <EMAIL>
* <NAME>, (update to antlr4 + Lua 5.3 grammar)
*/
grammar Lua;
//////////////////////////////// parser rules ////////////////////////////////
chunk
: block EOF
;
block
: stat* ret_stat?
;
stat
: assignment
| var[False]
| do_block
| while_stat
| repeat_stat
| local
| goto_stat
| if_stat
| for_stat
| function
| label
| BREAK
| CONTINUE
| SEMCOL
;
do_block
: DO block END
;
while_stat
: WHILE expr do_block
;
repeat_stat
: REPEAT block UNTIL expr
;
assignment
: var_list ASSIGN expr_list // in every 'var' in 'var_list', the last must be an 'index', not a 'call'
;
local
: LOCAL
( name_list (ASSIGN expr_list)?
| FUNCTION NAME func_body)
;
goto_stat
: GOTO NAME
;
if_stat
: IF expr THEN block elseif_stat* else_stat? END
;
elseif_stat
: ELSEIF expr THEN block
;
else_stat
: ELSE block
;
for_stat
: FOR
( NAME ASSIGN expr COMMA expr (COMMA expr)? do_block
| name_list IN expr_list do_block
)
;
function
: FUNCTION names (COL NAME func_body | func_body)
;
names
: NAME (DOT NAME)*
;
function_literal
: FUNCTION func_body
;
func_body
: OPAR param_list CPAR block END
;
param_list
: name_list (COMMA VARARGS)?
| VARARGS?
;
ret_stat
: RETURN expr_list? SEMCOL?
;
expr
: or_expr
;
or_expr
: and_expr (OR and_expr)*
;
and_expr
: rel_expr (AND rel_expr)*
;
rel_expr
: concat_expr ((LT | GT | LTEQ | GTEQ | NEQ | EQ) concat_expr)?
;
concat_expr
: add_expr (CONCAT add_expr)*
;
add_expr
: mult_expr ((ADD | MINUS) mult_expr)*
;
mult_expr
: bitwise_expr ((MULT | DIV | MOD) bitwise_expr)*
;
bitwise_expr
: unary_expr ((BITAND | BITOR | BITNOT | BITRSHIFT | BITRLEFT) unary_expr)*
;
unary_expr
: MINUS unary_expr
| LENGTH pow_expr
| NOT unary_expr
| BITNOT unary_expr
| pow_expr
;
// right associative
pow_expr
: atom (POW atom)*
;
atom
: var[False]
| function_literal
| table_constructor
| VARARGS
| NUMBER
| STRING
| NIL
| TRUE
| FALSE
;
var[bool assign]
: callee[assign] tail*
;
callee[bool assign]
: OPAR expr CPAR | NAME
;
tail
: DOT NAME # tail_dot_index
| OBRACK expr CBRACK # tail_brack_index
| COL NAME OPAR expr_list? CPAR # tail_invoke
| COL NAME table_constructor # tail_invoke_table
| COL NAME STRING # tail_invoke_str
| OPAR expr_list? CPAR # tail_call
| table_constructor # tail_table
| STRING # tail_string
;
table_constructor
: OBRACE field_list? CBRACE
;
field_list
: field (field_sep field)* field_sep?
;
field
: OBRACK expr CBRACK ASSIGN expr
| NAME ASSIGN expr
| expr
;
field_sep
: COMMA
| SEMCOL
;
label
: COLCOL NAME COLCOL
;
var_list
: var[True] (COMMA var[True])*
;
expr_list
: expr (COMMA expr)*
;
name_list
: NAME (COMMA NAME)*
;
//////////////////////////////// lexer rules ////////////////////////////////
AND : 'and' | '&&';
BREAK : 'break';
CONTINUE : 'continue';
DO : 'do';
ELSE : 'else';
ELSEIF : 'elseif';
END : 'end';
FALSE : 'false';
FOR : 'for';
FUNCTION : 'function';
GOTO : 'goto';
IF : 'if';
IN : 'in';
LOCAL : 'local';
NIL : 'nil';
NOT : 'not' | '!';
OR : 'or' | '||';
REPEAT : 'repeat';
RETURN : 'return';
THEN : 'then';
TRUE : 'true';
UNTIL : 'until';
WHILE : 'while';
ADD : '+';
MINUS : '-';
MULT : '*';
DIV : '/';
MOD : '%';
POW : '^';
LENGTH : '#';
EQ : '==';
NEQ : '~=' | '!=';
LTEQ : '<=';
GTEQ : '>=';
LT : '<';
GT : '>';
ASSIGN : '=';
BITAND : '&';
BITOR : '|';
BITNOT : '~';
BITRSHIFT : '>>';
BITRLEFT : '<<';
OPAR : '(';
CPAR : ')';
OBRACE : '{';
CBRACE : '}';
OBRACK : '[';
CBRACK : ']';
COLCOL : '::';
COL : ':';
COMMA : ',';
VARARGS : '...';
CONCAT : '..';
DOT : '.';
SEMCOL : ';';
NAME
: (Letter | '_') (Letter | '_' | Digit)*
;
NUMBER
: (Digit+ ('.' Digit*)? Exponent? | '.' Digit+ Exponent?)
| '0' ('x' | 'X') HexDigits ('.' HexDigits?)? BinaryExponent?
;
STRING
: '"' (EscapeSequence | ~('\\' | '"' | '\r' | '\n'))* '"'
| '\'' (EscapeSequence | ~('\\' | '\'' | '\r' | '\n'))* '\''
| LongBracket
;
//////////////////////////////// lexer rules to hide ////////////////////////////////
COMMENT
:
(
'--[' NESTED_STR ']'
|
'/*' .*? '*/'
)
-> channel(HIDDEN)
;
LINE_COMMENT
:
(
'--'
( // --
| '[' '='* // --[==
| '[' '='* ~('='|'['|'\r'|'\n') ~('\r'|'\n')* // --[==AA
| ~('['|'\r'|'\n') ~('\r'|'\n')* // --AAA
)
| '//' ~('\r'|'\n')* // //AAA
)
-> channel(HIDDEN)
;
SPACE
: (' ' | '\t')+ -> channel(HIDDEN)
;
NEWLINE
: ('\r\n' | '\r' | '\n' | '\u000C')+ -> channel(HIDDEN)
;
SHEBANG
: '#' '!' ~('\n'|'\r')* -> channel(HIDDEN)
;
//////////////////////////////// fragment lexer rules ////////////////////////////////
fragment Letter
: 'a'..'z'
| 'A'..'Z'
;
fragment Digit
: '0'..'9'
;
fragment HexDigit
: Digit
| 'a'..'f'
| 'A'..'F'
;
fragment HexDigits
: HexDigit+
;
fragment Exponent
: ('e' | 'E') ('-' | '+')? Digit+
;
fragment BinaryExponent
: ('p' | 'P') ('-' | '+')? Digit+
;
fragment EscapeSequence
: '\\'
( ('a' | 'b' | 'f' | 'n' | 'r' | 't' | 'v' | '\\' | '"' | '\'' | 'z' | LineBreak)
| Digit (Digit Digit?)?
| 'x' HexDigit HexDigit
)
;
fragment LineBreak
: '\r'? '\n'
| '\r'
;
fragment NESTED_STR
: '=' NESTED_STR '='
| '[' .*? ']'
;
LongBracket
: '[' NESTED_STR ']'
;
|
oeis/121/A121757.asm | neoneye/loda-programs | 11 | 246634 | ; A121757: Triangle read by rows: multiply Pascal's triangle by 1,2,6,24,120,720,... = A000142.
; Submitted by <NAME>
; 1,1,2,1,4,6,1,6,18,24,1,8,36,96,120,1,10,60,240,600,720,1,12,90,480,1800,4320,5040,1,14,126,840,4200,15120,35280,40320,1,16,168,1344,8400,40320,141120,322560,362880,1,18,216,2016,15120,90720,423360,1451520,3265920,3628800,1,20,270,2880,25200,181440,1058400,4838400,16329600,36288000,39916800,1,22,330,3960,39600,332640,2328480,13305600,59875200,199584000,439084800,479001600,1,24,396,5280,59400,570240,4656960,31933440,179625600,798336000,2634508800,5748019200,6227020800,1,26,468,6864,85800,926640
lpb $0
add $2,1
sub $0,$2
lpe
add $1,1
add $1,$0
lpb $0
sub $0,1
mul $1,$2
sub $2,1
lpe
mov $0,$1
|
electives/pw/lab/lista-3/ada/logger.ads | jerry-sky/academic-notebook | 4 | 21902 | with External; use External;
package Logger is
task type LoggerReceiver is
entry Log(message: String);
entry Stop;
end LoggerReceiver;
type pLoggerReceiver is access LoggerReceiver;
end Logger;
|
out/STLC/Model.agda | k4rtik/agda-soas | 0 | 1426 | <reponame>k4rtik/agda-soas
-- Environment model of the STLC
module STLC.Model where
open import SOAS.Common
open import SOAS.Context
open import SOAS.Variable
open import SOAS.Families.Core
open import SOAS.Families.Build
open import SOAS.ContextMaps.Inductive
open import SOAS.Abstract.Monoid
open import SOAS.Coalgebraic.Lift
open import STLC.Signature
open import STLC.Syntax
open import SOAS.Metatheory.SecondOrder.Metasubstitution Λ:Syn
open import SOAS.Metatheory.SecondOrder.Equality Λ:Syn
open import SOAS.Metatheory.FreeMonoid Λ:Syn
open import SOAS.Syntax.Arguments
open import Data.Nat
private
variable
α β γ τ : ΛT
Γ Δ Π : Ctx
𝔛 : Familyₛ
Λᴳ : Familyₛ
Λᴳ = Λ Ø
-- Interpretation of types and contexts
⟦_⟧ : ΛT → Set
⟦ N ⟧ = ℕ
⟦ α ↣ β ⟧ = ⟦ α ⟧ → ⟦ β ⟧
⟦_⟧ᶜ : Ctx → Set
⟦ Γ ⟧ᶜ = {α : ΛT} → ℐ α Γ → ⟦ α ⟧
_⁺_ : ⟦ α ⟧ → ⟦ Γ ⟧ᶜ → ⟦ α ∙ Γ ⟧ᶜ
_⁺_ x γ new = x
_⁺_ x γ (old v) = γ v
infixr 10 _⁺_
-- Environment model
Env : Familyₛ
Env α Γ = ⟦ Γ ⟧ᶜ → ⟦ α ⟧
ΣEnvᴹ : ΣMon Env
ΣEnvᴹ = record
{ ᵐ = record
{ η = λ v γ → γ v ; μ = λ t σ δ → t (λ v → σ v δ)
; lunit = refl ; runit = refl ; assoc = refl }
; 𝑎𝑙𝑔 = λ{ (appₒ ⋮ f , a) γ → f γ (a γ)
; (lamₒ ⋮ b) γ → λ a → b (a ⁺ γ) }
; μ⟨𝑎𝑙𝑔⟩ = λ{ (appₒ ⋮ _) → refl
; (lamₒ ⋮ b) → ext² λ δ a → cong b (dext
(λ { new → refl ; (old y) → refl })) } }
module Env = FΣM Ø ΣEnvᴹ (λ ())
eval : Λ Ø ⇾̣ Env
eval = Env.𝕖𝕩𝕥
evalᶜ : Λ Ø α ∅ → ⟦ α ⟧
evalᶜ t = eval t (λ ())
_ : evalᶜ {N ↣ N ↣ N} (ƛ ƛ x₁) ≡ λ x y → x
_ = refl
open Theory Ø
-- Operational semantics of the STLC
data Value : Λᴳ α Γ → Set where
lamⱽ : {b : Λᴳ β (α ∙ Γ)} →
Value (ƛ b)
data _⟿_ : Λᴳ α Γ → Λᴳ α Γ → Set where
ζ-$₁ : {f g : Λᴳ (α ↣ β) Γ}{a : Λᴳ α Γ} →
f ⟿ g → f $ a ⟿ g $ a
ζ-$₂ : {f : Λᴳ (α ↣ β) Γ}{a b : Λᴳ α Γ} →
Value f → a ⟿ b → f $ a ⟿ f $ b
β-ƛ : {b : Λᴳ β (α ∙ Γ)}{t : Λᴳ α Γ} →
Value t → ((ƛ b) $ t) ⟿ [ t /] b
infix 2 _⟿_
-- Evaluation preserves the meaning of terms
sound : {t s : Λᴳ α Γ} → t ⟿ s → (γ : ⟦ Γ ⟧ᶜ) → eval t γ ≡ eval s γ
sound (ζ-$₁ r) γ rewrite sound r γ = refl
sound (ζ-$₂ _ r) γ rewrite sound r γ = refl
sound (β-ƛ {b = b}{t} x) γ rewrite Env.𝕖𝕩𝕥ᵐ⇒.sub-lemma t b =
cong (eval b) (dext λ{ new → refl ; (old v) → refl })
|
programs/oeis/024/A024054.asm | karttu/loda | 1 | 177416 | ; A024054: a(n) = 5^n - n^5.
; 1,4,-7,-118,-399,0,7849,61318,357857,1894076,9665625,48667074,243891793,1220331832,6102977801,30516818750,152586842049,762938033268,3814695376057,19073483852026,95367428440625,476837154119024,2384185785861993
mov $1,5
pow $1,$0
pow $0,5
add $0,1
sub $1,$0
add $1,1
|
Modules/nettle/arm/neon/chacha-core-internal.asm | blondfrogs/ravenwallet-ios | 278 | 29493 | C arm/neon/chacha-core-internal.asm
ifelse(<
Copyright (C) 2013, 2015 <NAME>
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
GNU Nettle 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.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
>)
.file "chacha-core-internal.asm"
.fpu neon
define(<DST>, <r0>)
define(<SRC>, <r1>)
define(<ROUNDS>, <r2>)
define(<X0>, <q0>)
define(<X1>, <q1>)
define(<X2>, <q2>)
define(<X3>, <q3>)
define(<T0>, <q8>)
define(<S0>, <q12>)
define(<S1>, <q13>)
define(<S2>, <q14>)
define(<S3>, <q15>)
define(<QROUND>, <
C x0 += x1, x3 ^= x0, x3 lrot 16
C x2 += x3, x1 ^= x2, x1 lrot 12
C x0 += x1, x3 ^= x0, x3 lrot 8
C x2 += x3, x1 ^= x2, x1 lrot 7
vadd.i32 $1, $1, $2
veor $4, $4, $1
vshl.i32 T0, $4, #16
vshr.u32 $4, $4, #16
veor $4, $4, T0
vadd.i32 $3, $3, $4
veor $2, $2, $3
vshl.i32 T0, $2, #12
vshr.u32 $2, $2, #20
veor $2, $2, T0
vadd.i32 $1, $1, $2
veor $4, $4, $1
vshl.i32 T0, $4, #8
vshr.u32 $4, $4, #24
veor $4, $4, T0
vadd.i32 $3, $3, $4
veor $2, $2, $3
vshl.i32 T0, $2, #7
vshr.u32 $2, $2, #25
veor $2, $2, T0
>)
.text
.align 4
C _chacha_core(uint32_t *dst, const uint32_t *src, unsigned rounds)
PROLOGUE(_nettle_chacha_core)
vldm SRC, {X0,X1,X2,X3}
vmov S0, X0
vmov S1, X1
vmov S2, X2
vmov S3, X3
C Input rows:
C 0 1 2 3 X0
C 4 5 6 7 X1
C 8 9 10 11 X2
C 12 13 14 15 X3
.Loop:
QROUND(X0, X1, X2, X3)
C Rotate rows, to get
C 0 1 2 3
C 5 6 7 4 >>> 3
C 10 11 8 9 >>> 2
C 15 12 13 14 >>> 1
vext.32 X1, X1, X1, #1
vext.32 X2, X2, X2, #2
vext.32 X3, X3, X3, #3
QROUND(X0, X1, X2, X3)
subs ROUNDS, ROUNDS, #2
C Inverse rotation
vext.32 X1, X1, X1, #3
vext.32 X2, X2, X2, #2
vext.32 X3, X3, X3, #1
bhi .Loop
vadd.u32 X0, X0, S0
vadd.u32 X1, X1, S1
vadd.u32 X2, X2, S2
vadd.u32 X3, X3, S3
vstm DST, {X0,X1,X2,X3}
bx lr
EPILOGUE(_nettle_chacha_core)
divert(-1)
define chachastate
p/x $q0.u32
p/x $q1.u32
p/x $q2.u32
p/x $q3.u32
end
|
programs/oeis/168/A168419.asm | neoneye/loda | 22 | 83463 | <reponame>neoneye/loda<gh_stars>10-100
; A168419: a(n) = 9*floor(n/2).
; 0,9,9,18,18,27,27,36,36,45,45,54,54,63,63,72,72,81,81,90,90,99,99,108,108,117,117,126,126,135,135,144,144,153,153,162,162,171,171,180,180,189,189,198,198,207,207,216,216,225,225,234,234,243,243,252,252,261,261,270,270,279,279,288,288,297,297,306,306,315,315,324,324,333,333,342,342,351,351,360,360,369,369,378,378,387,387,396,396,405,405,414,414,423,423,432,432,441,441,450
mov $1,1
add $1,$0
div $1,2
mul $1,9
mov $0,$1
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_floor.asm | dikdom/z88dk | 1 | 14591 |
SECTION code_fp_am9511
PUBLIC cam32_sccz80_floor
EXTERN asm_am9511_floor_fastcall
defc cam32_sccz80_floor = asm_am9511_floor_fastcall
|
programs/oeis/128/A128203.asm | neoneye/loda | 22 | 21736 | <gh_stars>10-100
; A128203: Sum of the digits of n*(n+1).
; 0,2,6,3,2,3,6,11,9,9,2,6,12,11,3,6,11,9,9,11,6,12,11,12,6,11,9,18,11,15,12,20,12,6,11,9,9,11,15,12,11,12,15,20,18,9,11,15,12,11,12,15,20,18,18,11,15,12,11,12,15,20,18,9,11,15,12,20,21,15,20,9,18,11,15,12,20,12
mov $2,$0
add $0,1
mul $0,$2
lpb $0
mov $2,$0
div $0,10
mod $2,10
add $1,$2
lpe
mov $0,$1
|
programs/oeis/193/A193349.asm | neoneye/loda | 22 | 27039 | ; A193349: Sum of odd divisors of tau(n).
; 1,1,1,4,1,1,1,1,4,1,1,4,1,1,1,6,1,4,1,4,1,1,1,1,4,1,1,4,1,1,1,4,1,1,1,13,1,1,1,1,1,1,1,4,4,1,1,6,4,4,1,4,1,1,1,1,1,1,1,4,1,1,4,8,1,1,1,4,1,1,1,4,1,1,4,4,1,1,1,6,6,1,1,4,1,1,1,1,1,4,1,4,1,1,1,4,1,4,4,13
seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
seq $0,4011 ; Theta series of D_4 lattice; Fourier coefficients of Eisenstein series E_{gamma,2}.
div $0,24
|
uefi-sct/SctPkg/Library/NetLib/Ia32/NetSetMemSSE2.asm | sunnywang-arm/edk2-test | 47 | 18464 | ;; @file
;
; Copyright 2006 - 2010 Unified EFI, Inc.<BR>
; Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
;
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;;
;
;++ TITLE NetSetMem.asm: Optimized setmemory routine
; PROC:PRIVATE
.686P
.MMX
.XMM
.MODEL SMALL
.CODE
NetCommonLibSetMem PROTO C Buffer:PTR DWORD, Count:DWORD, Value:BYTE
;------------------------------------------------------------------------------
; Procedure: NetCommonLibSetMem
;
; VOID
; NetCommonLibSetMem (
; IN VOID *Buffer,
; IN UINTN Count,
; IN UINT8 Value
; )
;
; Input: VOID *Buffer - Pointer to buffer to write
; UINTN Count - Number of bytes to write
; UINT8 Value - Value to write
;
; Output: None.
;
; Saves:
;
; Modifies:
;
; Description: This function is an optimized zero-memory function.
;
; Notes: This function tries to zero memory 8 bytes at a time. As a result,
; it first picks up any misaligned bytes, then words, before getting
; in the main loop that does the 8-byte clears.
;
;------------------------------------------------------------------------------
NetCommonLibSetMem PROC C Buffer:PTR DWORD, Count:DWORD, Value:BYTE
LOCAL QWordValue:QWORD
LOCAL MmxSave:QWORD
mov edx, Count
test edx, edx
je _SetMemDone
push edi
push ebx
mov eax, Buffer
mov bl, Value
mov edi, eax
mov bh, bl
cmp edx, 256
jb _SetRemindingByte
and al, 0fh
test al, al
je _SetBlock
mov eax, edi
shr eax, 4
inc eax
shl eax, 4
sub eax, edi
cmp eax, edx
jnb _SetRemindingByte
sub edx, eax
mov ecx, eax
mov al, bl
rep stosb
_SetBlock:
mov eax, edx
shr eax, 7
test eax, eax
je _SetRemindingByte
shl eax, 7
sub edx, eax
shr eax, 7
mov WORD PTR QWordValue[0], bx
mov WORD PTR QWordValue[2], bx
mov WORD PTR QWordValue[4], bx
mov WORD PTR QWordValue[6], bx
movq MmxSave, mm0
movq mm0, QWordValue
movq2dq xmm1, mm0
pshufd xmm1, xmm1, 0
@@:
movdqa OWORD PTR ds:[edi], xmm1
movdqa OWORD PTR ds:[edi+16], xmm1
movdqa OWORD PTR ds:[edi+32], xmm1
movdqa OWORD PTR ds:[edi+48], xmm1
movdqa OWORD PTR ds:[edi+64], xmm1
movdqa OWORD PTR ds:[edi+80], xmm1
movdqa OWORD PTR ds:[edi+96], xmm1
movdqa OWORD PTR ds:[edi+112], xmm1
add edi, 128
dec eax
jnz @B
; Restore mm0
movq mm0, MmxSave
emms ; Exit MMX Instruction
_SetRemindingByte:
mov ecx, edx
mov eax, ebx
shl eax, 16
mov ax, bx
shr ecx, 2
rep stosd
mov ecx, edx
and ecx, 3
rep stosb
pop ebx
pop edi
_SetMemDone:
ret 0
NetCommonLibSetMem ENDP
END
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/return4_pkg.adb | best08618/asylo | 7 | 19803 | <gh_stars>1-10
package body Return4_Pkg is
function Get_Value (I : Integer) return Rec is
Value : Rec := (I1 => I, I2 => I, I3 => I);
begin
return Value;
end;
end Return4_Pkg;
|
Irvine/Examples/ch16/Keybd.asm | alieonsido/ASM_TESTING | 0 | 89549 | TITLE Keyboard Display (keybd.asm)
; This program displays keyboard scan codes
; and ASCII codes, using INT 16h.
; Last update: 06/01/2006
Include Irvine16.inc
.code
main PROC
mov ax,@data
mov ds,ax
call ClrScr ; clear screen
L1: mov ah,10h ; keyboard input
int 16h ; using BIOS
call DumpRegs ; look at AH, AL
cmp al,1Bh ; ESC key pressed?
jne L1 ; no: repeat the loop
call ClrScr ; clear screen
exit
main ENDP
END main |
tools/scitools/conf/understand/ada/ada95/a-numran.ads | brucegua/moocos | 1 | 28638 | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . N U M E R I C S . R A N D O M --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved --
-- --
-- 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, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This package provides the basic support used for the Float_Random and
-- Discrete_Random children of Ada.Numerics. In this package, the generator
-- state is exposed for access but this is a private package so no problem.
private package Ada.Numerics.Random is
-- All the arithmetic is done using a base type that is at least
-- 32 bits long (one's complement or two's complement, does not
-- matter). It also must be at least as large as integer.
type Int_Range is range
Long_Integer'Min (Long_Integer (Integer'First), (-2 ** 31) + 1) ..
Long_Integer'Max (Long_Integer (Integer'Last), (+2 ** 31) - 1);
type Int is new Int_Range'Base;
subtype Nat is Int range 0 .. Int'Last;
-- The types that we will actually use
-- The following declarations define the type State, which is used as the
-- underlying type for both Generator and State in the user level packages
Larger_Lag : constant := 25;
Smaller_Lag : constant := 11;
-- Lag values used for modular accessing of the state vector
type Lag_Range is mod Larger_Lag;
-- Range of larger lag is length of state vector
type State_Vector is array (Lag_Range) of Float;
type State is record
Lagged_Outputs : State_Vector;
Borrow : Float;
R, S : Lag_Range;
end record;
subtype Uniformly_Distributed is Float range 0.0 .. 1.0;
-- Range of random numbers
procedure Random (S : in out State; U : out Uniformly_Distributed);
-- Obtain next random number, updating State
function Make_State (Starter : Int := 3E+7) return State;
-- Build a state from the given integer value. The default value for
-- Int is used to build the default starting generator configurations.
procedure Reset (S : out State; Initiator : in Integer);
-- Set state from given integer value
procedure Reset (S : out State);
-- Set state from current time
Max_Image_Width : constant := (24 + 1) * 25 + 24;
-- The 24 + 1 is for one floating point value plus a comma, and there
-- are up to Larger_Lag number of these, followed by one additional value
function Image (S : State) return String;
-- Convert state to canonical string format (see body for format)
function Value (S : String) return State;
-- Convert string returned by previous image call back to State
end Ada.Numerics.Random;
|
stm32f1/stm32gd-spi-peripheral.ads | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 4846 | <filename>stm32f1/stm32gd-spi-peripheral.ads
with STM32_SVD.SPI;
generic
SPI : in out STM32_SVD.SPI.SPI_Peripheral;
Data_Size : STM32GD.SPI.SPI_Data_Size := Data_Size_8b;
package STM32GD.SPI.Peripheral is
pragma Preelaborate;
procedure Init;
procedure Transfer (Data : in out SPI_Data_8b)
with
Pre => Data_Size = Data_Size_8b;
end STM32GD.SPI.Peripheral;
|
demo/tutorial/components-attackers.adb | csb6/libtcod-ada | 0 | 14206 | with Actors, Engines, Components.Destructibles, Libtcod.Color;
package body Components.Attackers is
use Destructibles;
------------
-- attack --
------------
procedure attack(self : in out Attacker; owner : in out Actors.Actor;
target : in out Actors.Actor; engine : in out Engines.Engine) is
use Actors, Libtcod;
real_damage : Health;
target_destructible : access Destructible := target.destructible;
msg_header : constant String := owner.get_name & " attacks " & target.get_name & " ";
msg_color : constant RGB_Color := (if owner = engine.player then Color.red else Color.light_grey);
begin
if target.is_destructible and then not target_destructible.is_dead then
real_damage := target_destructible.take_damage(target, self.power, engine);
if real_damage = 0 then
engine.gui.log(msg_header & "for no damage", msg_color);
else
engine.gui.log(msg_header & "for" & real_damage'Image & " damage", msg_color);
end if;
else
engine.gui.log(msg_header & "in vain", msg_color);
end if;
end attack;
end Components.Attackers;
|
oeis/123/A123358.asm | neoneye/loda-programs | 11 | 95126 | <reponame>neoneye/loda-programs
; A123358: Kekulé numbers for certain benzenoids (see the Cyvin-Gutman book for details).
; Submitted by <NAME>
; 1,10,125,1625,21250,278125,3640625,47656250,623828125,8166015625,106894531250,1399267578125,18316650390625,239768066406250,3138604736328125,41084869384765625,537807922363281250,7039997100830078125,92154758453369140625,1206321449279785156250,15790952777862548828125,206706255435943603515625
mov $2,5
pow $2,$0
lpb $0
sub $0,1
add $1,$2
add $2,$1
lpe
mov $0,$2
|
programs/oeis/030/A030005.asm | neoneye/loda | 22 | 103747 | <gh_stars>10-100
; A030005: (prime(n)-1)(prime(n)-3)/8.
; 0,1,3,10,15,28,36,55,91,105,153,190,210,253,325,406,435,528,595,630,741,820,946,1128,1225,1275,1378,1431,1540,1953,2080,2278,2346,2701,2775,3003,3240,3403,3655,3916,4005,4465,4560,4753,4851,5460,6105,6328,6441,6670,7021,7140,7750,8128,8515,8911,9045,9453,9730,9870,10585,11628,11935,12090,12403,13530,14028,14878,15051,15400,15931,16653,17205,17766,18145,18721,19503,19900,20706,21736,21945,23005,23220,23871,24310,24976,25878,26335,26565,27028,28441,29403,29890,30876,31375,32131,33670,33930,36315,37128
seq $0,98090 ; Numbers k such that 2k-3 is prime.
sub $0,2
bin $0,2
|
mlt_dynamicclassification.als | jpalmeida/mlt-ontology | 2 | 519 | /*
* Multi-Level Theory Model
* Version 2.1 (2015-04-01)
*
* This version of MLT was designed to support dynamic classification
*
*/
module mlt_dynamicclassification
sig Entity{
specializes: set Entity,
properSpecializes: set Entity,
isSubordinateTo: set Entity,
powertypeOf: set Entity,
characterizes: set Entity,
compCharacterizes: set Entity,
disjCharacterizes: set Entity,
partitions: set Entity
}
some sig World{
iof: set Entity -> Entity
}
//---------------------------------------- Basic types declaration - Start --------------------------------------------------------------
/*
* Once model types are unique entities/atoms they must be declared as singletons due Alloy's limitations
*/
//Representing the basic type "Individual"
one sig Individual extends Entity{}
//Representing the basic type "1stOT"
one sig FOT extends Entity{}
//Representing the basic type "2ndOT"
one sig SOT extends Entity{}
//---------------------------------------- Basic types declaration - End --------------------------------------------------------------
//---------------------------------------- MLT Axioms - Start --------------------------------------------------------------
/*
* Axiom A1
*
* An entity x is instance of Individual in a world w iff in any world x has no instances.
*/
pred A1_individualDef{
all x:Entity, w1:World, i:Individual | (x in w1.iof.i) iff (all w2:World | no w2.iof.x)
}
/*
* Axiom A2
*
* An entity t is instance of FOT in a World w iff:
* (i) exists some World w' where t has instances;
* (ii) in any World, every iinstance of t is also instance of Individual.
*/
pred A2_firstOrderTypeDef{
all t:Entity, w1:World, f:FOT| (t in (w1.iof).f) iff
((some w2:World | some w2.iof.t) and
(all w3:World, x:Entity, i:Individual| x in (w3.iof).t implies x in (w3.iof).i))
}
/*
* Axiom A3
*
* An entity t is instance of SOT in a World w iff:
* (i) exists some World w' which t has instances and;
* (ii) in any World, every instance of t is also an instance of FOT.
*/
pred A3_secondOrderTypeDef{
all t:Entity, w1:World, s:SOT | (t in (w1.iof).s) iff
((some w2:World | some w2.iof.t) and
(all w3:World, x:Entity, f:FOT| x in w3.iof.t implies x in w3.iof.f))
}
/*
* Axiom A4
*
* Each entity in our domain of enquiry is necessarily an instance of “Individual”, “1stOT” or “2ndOT”
* (except “2ndOT” whose type is outside the scope of the formalization).
*
*/
pred A4_completenessAxiom{
all s:SOT, f:FOT, i:Individual, x:Entity, w:World|
x in w.iof.i or x in w.iof.f or x in w.iof.s or x=s
}
/*
* Axiom A5
*
* If t1 and t2 are types (which means they have instances), then they are equal iif their instances are
* the same for every possible World.
*/
pred A5_typesEqualityDef{
all t1,t2:Entity|
((some w1:World| some (w1.iof).t1) and (some w2:World|
some (w2.iof).t2)) implies (t1 = t2 iff (all w:World, x:Entity| x in w.iof.t1 iff x in w.iof.t2))
}
/*
* Axioms A6
* Specialization Definition
* A type t specializes another type t’ iff in all possible worlds all instances of t are also instances of t’
*/
pred A6_specializationDef{
all t1,t2:Entity | t2 in t1.specializes iff
(all e:Entity, i:Individual, w:World |
t1 not in w.iof.i and t2 not in w.iof.i and (e in w.iof.t1 implies e in w.iof.t2))
}
/*
* Axiom A7
*
* Proper Specialization Definition
* t proper specializes t’ iff t specializes t’ and t is different from t’
*/
pred A7_properSpecializationDef{
all t1,t2:Entity | t2 in t1.properSpecializes iff (t2 in t1.specializes and t1!=t2)
}
/*
* Axiom A8
*
* Subordination Definition
* t is subordinate to t’ iff every instance of t proper specializes an instance of t’.
*/
pred A8_subordinationDef{
all t1,t2:Entity | t2 in t1.isSubordinateTo iff
(all i:Individual, w:World| t1 not in w.iof.i and
(all t3:Entity | (t3 in w.iof.t1 implies
(some t4:Entity| t4 in w.iof.t2 and t4 in t3.properSpecializes))))
}
/*
* Axioms A9
*
* Powertype Definition
* a type t is power type of a base type t’ iff
* all instances of t specialize t’ and all possible specializations of t’ are instances of t.
*/
pred A9_powertypeOfDef{
all t1,t2:Entity | t2 in t1.powertypeOf iff
(all t3:Entity, i:Individual, w:World | t1 not in w.iof.i and (t3 in w.iof.t1 iff t2 in t3.specializes))
}
/*
* Axioms A10
*
* Characterization Definition
* a type t characterizes a type t’ iff all instances of t are proper specializations of t’
*/
pred A10_characterizationDef{
all t1,t2:Entity | t2 in t1.characterizes iff
(all t3:Entity , i:Individual, w:World | t1 not in w.iof.i and
(t3 in w.iof.t1 implies t2 in t3.properSpecializes))
}
/*
* Axiom A11
*
* CompleteCharacterization Definition
* a type t completelyCharacterizes t’ iff t characterizes t’ and every instance of t’ is instance of, at least, an instance of t.
*/
pred A11_completeCharacterizationDef{
all t1,t2:Entity | t2 in t1.compCharacterizes iff
(t2 in t1.characterizes and (all e:Entity, w:World |
e in w.iof.t2 implies (some t3:Entity | e in w.iof.t3 and t3 in w.iof.t1)))
}
/*
* Axiom A12
*
* Disjoint Characterization Definition
* t disjointlyCharacterizes t’ iff t characterizes t’ and every instance of t’ is instance of, at most, one instance of t.
*/
pred A12_disjointCharacterizationDef{
all t1,t2:Entity | t2 in t1.disjCharacterizes iff
(t2 in t1.characterizes and (all e:Entity, w:World |
e in (w.iof).t2 implies (lone t3:Entity |e in (w.iof).t3 and t3 in (w.iof).t1)))
}
/*
* Axiom A13
*
* Partitions Definition
* t partitions t’ iff each instance of t is instance of exactly one instance of the base type t’
*/
pred A13_partitionsDef{
all t1,t2:Entity | t2 in t1.partitions iff (t2 in t1.disjCharacterizes and t2 in t1.compCharacterizes)
}
fact {
A1_individualDef
A2_firstOrderTypeDef
A3_secondOrderTypeDef
A4_completenessAxiom
A5_typesEqualityDef
A6_specializationDef
A7_properSpecializationDef
A8_subordinationDef
A9_powertypeOfDef
A10_characterizationDef
A11_completeCharacterizationDef
A12_disjointCharacterizationDef
A13_partitionsDef
}
//---------------------------------------- MLT Axioms - End --------------------------------------------------------------
//---------------------------------------- MLT Theorems - Start -----------------------------------------------------------
// Theorem T0
pred theoremT0{
// “Individual”, “1stOT” and “2ndOT” have no instances in common (i.e., their extensions are disjoint).
all s:SOT, f:FOT, i:Individual, w:World| no x:Entity|
(x in (w.iof).i and x in (w.iof).f) or (x in (w.iof).i and x in (w.iof).s)
or (x in (w.iof).f and x in (w.iof).s)
}
// Theorems T1, T2 and T3
pred theoremsT1T2T3{
//T1: “Individual” is an instance of “1stOT”
all i:Individual, f:FOT, w:World| i in w.iof.f
//T2: “1stOT” is an instance of “2ndOT”
all f:FOT, s:SOT, w:World| f in w.iof.s
//T3: “2ndOT” is an instance of “3rdOT”
//all t:TOT, s:SOT , w:World| s in w.iof.t
}
// Theorems T4, T5 and T6
// Any instance of a higher-order type (any instance of “1stOT”, “2ndOT”, and “3rdOT”)
// specializes the basic type at an order immediately lower order.
pred theoremsT4T5T6{
//T4: Every instance of “1stOT” specializes “Individual”
all t:Entity, i:Individual, f:FOT, w:World | t in w.iof.f iff i in t.specializes
//T5: Every instance of “2ndOT” specializes “1stOT”
all t:Entity, f:FOT, s:SOT, w:World | t in w.iof.s iff f in t.specializes
//T6: Every instance of “3rdOT” specializes “2ndOT”
//all t:Entity, s:SOT, th:TOT, w:World | t in w.iof.th iff s in t.specializes
}
// Theorems T7, T8 and T9
pred theoremsT7T8T9{
//T7: “1stOT” is powertype of “Individual”
all i:Individual, f:FOT | i in f.powertypeOf
//T8: “2ndOT” is powertype of “1stOT”
all f:FOT, s:SOT | f in s.powertypeOf
//T9: “3rdOT” is powertype of “2ndOT”
//all s:SOT, t:TOT | s in t.powertypeOf
}
// Theorem T10: each type has at most one power type
pred theoremT10{
all t:Entity| lone powertypeOf.t
}
// Theorem T11: each type is power type of, at most, one other type
pred theoremT11{
all t:Entity| lone t.powertypeOf
}
// Theorem T12: if a type t2 specializes a type t1 then the power type of t2 specializes the power type of t1.
// ∀ t1,t2,t3,t4 (specializes(t2,t1)∧isPowertypeOf(t4,t2)∧isPowertypeOf(t3,t1))→specializes(t4,t3)
pred theoremT12{
all t1,t2,t3,t4:Entity | (t1 in t2.specializes and t2 in t4.powertypeOf and t1 in t3.powertypeOf) implies t3 in t4.specializes
}
// Theorem T13: If a type t2 is power type of a type t1 and a type t3 characterizes the same base type t1
// then all instances of t3 are also instances of the power type t2 and, thus, t3 proper specializes t2.
// ∀t1,t2,t3 (isPowertypeOf(t2,t1)∧characterizes(t3,t1))→properSpecializes(t3,t2)
pred theoremT13{
all t1,t2,t3:Entity | (t1 in t2.powertypeOf and t1 in t3.characterizes) implies t2 in t3.properSpecializes
}
// Theorem T14: if two types t1 and t2 both partitions the same type t3 then it is not possible for t1 to specialize t2
// ∀ t1,t2,t3,t4 (partitions(t1,t3)∧partitions(t2,t3))→¬properSpecializes(t1,t2)
pred theoremT14{
all t1,t2,t3:Entity | (t3 in t1.partitions and t3 in t2.partitions) implies (t2 not in t1.properSpecializes)
}
assert allTheoremsOfSosymPaper{
theoremT0
theoremsT1T2T3
theoremsT4T5T6
theoremsT7T8T9
theoremT10
theoremT11
theoremT12
theoremT13
theoremT14
}
//check allTheoremsOfSosymPaper for 14 but exactly 2 World
//Definition of Rigidity
pred rigid[t:Entity] {
some y:Entity | y in World.iof.t
all w1,w2:World, x:Entity | x in w1.iof.t implies x in w2.iof.t
}
//Proving that the basic types are rigid
pred baseTypesRigidity{all i:Individual, f:FOT, s:SOT| rigid[i] and rigid[f] and rigid[s] }
//Instances of FOT are not necessarily rigid - i.e., this assertion is not true
assert instancesOfFOTRigidityTest{
all f:FOT, x:Entity, w:World| x in (w.iof).f implies rigid[x]}
//check instancesOfFOTRigidityTest for 12 but 3 World
//---------------------------------------- MLT Theorems - End --------------------------------------------------------------
run {} for 10 but exactly 2 World
|
Courses/Low Level Programming - Igor Zhirkov/Chap_2/Lesson 2.4 hello_proper_exit.asm | mccrudd3n/practise | 0 | 100998 | <filename>Courses/Low Level Programming - Igor Zhirkov/Chap_2/Lesson 2.4 hello_proper_exit.asm
section .data
message: db 'hello, world!', 10
section .text
global _start
_start:
mov rax, 1 ;'write' syscall number
mov rdi, 1 ; stdout descriptor
mov rsi, message ; string address
mov rdx, 12 ; string length in bytes
syscall
mov rax, 60 ; 'exit' syscall number
xor rdi, rdi
syscall
|
Application Support/BBEdit/AppleScript/Copy Line Up.applescript | bhdicaire/bbeditSetup | 0 | 1306 | <filename>Application Support/BBEdit/AppleScript/Copy Line Up.applescript<gh_stars>0
# Copies selected line while leaving the selection at the origin line.
tell application "BBEdit"
set start_line to startLine of selection
set end_line to endLine of selection
set line_end to ""
tell window 1
set line_data to contents of lines start_line thru end_line
set line_count to count of lines
try
set testChar to last character of line_data
on error
set testChar to ""
end try
if (linefeed ≠ testChar) then
set line_end to linefeed
end if
if (line_count = 1) then
make new line at line 1
set line_end to ""
end if
select insertion point before line (start_line)
set selection to line_data & line_end
end tell
end tell
|
src/Dodo/Unary/XOpt.agda | sourcedennis/agda-dodo | 0 | 10165 | {-# OPTIONS --without-K --safe #-}
-- | Exclusive option for predicates
module Dodo.Unary.XOpt where
-- Stdlib imports
open import Level using (Level)
open import Relation.Unary using (Pred)
-- Local imports
open import Dodo.Nullary.XOpt
-- # XOpt₂
XOptPred₂ : {a ℓ₁ ℓ₂ : Level} {A : Set a} → Pred A ℓ₁ → Pred A ℓ₂ → Set _
XOptPred₂ {A = A} P Q = ∀ (x : A) → XOpt₂ (P x) (Q x)
-- # XOpt₃
XOptPred₃ : {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a} → Pred A ℓ₁ → Pred A ℓ₂ → Pred A ℓ₃ → Set _
XOptPred₃ {A = A} P Q R = ∀ (x : A) → XOpt₃ (P x) (Q x) (R x)
|
Commands/User Interaction suite/display/display notification/subtitle.applescript | looking-for-a-job/applescript-examples | 1 | 453 | #!/usr/bin/osascript
display notification "text" with title "title" subtitle "subtitle"
delay 5
display notification "text" with title "title" subtitle ""
|
lab07/src/lab1.adb | evgenijaZ/PP-labs | 0 | 29376 | ---------------------------------------
--<NAME>.
--Labwork 1
--MA = MB * MC + a * ( MK + MT)
---------------------------------------
with Ada
.Text_IO, Ada
.Integer_Text_IO, DataOperations, Ada
.Synchronous_Task_Control, System
.Multiprocessors;
use
Ada.Text_IO,
Ada.Integer_Text_IO,
Ada.Synchronous_Task_Control,
System.Multiprocessors;
procedure Lab1 is
--CPU
cpu1 : CPU_Range := 1;
cpu2 : CPU_Range := 1;
N : Integer := 200;
P : Integer := 2;
H : Integer := N / P;
--Semaphors
S1, S2, S3, Scs1, Scs2 : Suspension_Object;
package Operations is new DataOperations (N);
use Operations;
MB, MK, MT : Matrix;
--Common resources
a : Integer;
MC : Matrix;
--Result
MA : Matrix;
--Tasks
procedure Tasks is
task T1 is
pragma Priority (3);
pragma Storage_Size (300_000_000);
pragma CPU (cpu1);
end T1;
task T2 is
pragma Priority (3);
pragma Storage_Size (300_000_000);
pragma CPU (cpu2);
end T2;
task body T1 is
a1 : Integer;
MC1 : Matrix;
begin
Put_Line ("T1 started");
--input a, MK, MC
FillWithOne (a);
FillWithOne (MK);
FillWithOne (MC);
--signal the completion of the input a, MK, MC
Set_True (S1);
--wait for data input in task T2
Suspend_Until_True (S2);
--critical section 1
Suspend_Until_True (Scs1);
a1 := a;
Set_True (Scs1);
--critical section 2
Suspend_Until_True (Scs2);
MC1 := MC;
Set_True (Scs2);
--calculating
MA (1 .. H) :=
Amount
(Multiple (MB, MC1, 1, H),
Multiple (a, Amount (MK, MT, 1, H), 1, H),
1,
H)
(1 .. H);
Set_True (S3);
Put_Line ("T1 finished");
end T1;
task body T2 is
a2 : Integer;
MC2 : Matrix;
begin
Put_Line ("T2 started");
--input MB, MT
FillWithOne (MB);
FillWithOne (MT);
--signal the completion of the input MB, MT
Set_True (S2);
--wait for data input in task T1
Suspend_Until_True (S1);
--critical section 1
Suspend_Until_True (Scs1);
a2 := a;
Set_True (Scs1);
--critical section 2
Suspend_Until_True (Scs2);
MC2 := MC;
Set_True (Scs2);
--calculating
MA (H + 1 .. N) :=
Amount
(Multiple (MB, MC2, H + 1, N),
Multiple (a, Amount (MK, MT, H + 1, N), H + 1, N),
H + 1,
N)
(H + 1 .. N);
Suspend_Until_True (S3);
Output (MA);
Put_Line ("T2 finished");
end T2;
begin
null;
end Tasks;
begin
Put_Line ("Program started");
Set_True (Scs1);
Set_True (Scs2);
Tasks;
Put_Line ("Program finished");
end Lab1;
|
src/FilterExpressionParser/FilterExpressionDsl.g4 | andy-williams/FilterExpressionParser | 0 | 2291 | <reponame>andy-williams/FilterExpressionParser
grammar FilterExpressionDsl;
/*
PARSER RULES
*/
expr: expr booleanOperator expr
| OpenParen expr CloseParen
| operand operator operand;
booleanOperator: (And | Or);
operator: (GreaterThan | GreaterThanEqual | LessThan | LessThanEqual | Equal);
operand: (STRING | NUMBER | VARIABLE);
/*
LEXER RULES
*/
// operators
GreaterThan: '>';
GreaterThanEqual: '>=';
LessThan: '<';
LessThanEqual: '<=';
Equal: '=';
Or: 'or' | 'OR';
And: 'and' | 'AND';
IN: 'in';
OpenParen: '(';
CloseParen: ')';
// operands
VARIABLE: ':'[a-zA-Z]+':' ;
NUMBER: [0-9]+;
STRING: '\''[a-zA-Z]+'\'' ;
WHITESPACE: [ \t\f\r\n]+ -> channel(HIDDEN) ; // skip whitespaces |
4-high/gel/source/gel-events.ads | charlie5/lace | 20 | 24378 | <gh_stars>10-100
with
gel.remote.World,
gel.Mouse,
lace.Event;
package gel.Events with remote_Types
--
-- Provides events for GEL.
--
is
type window_Enter is new lace.Event.item with null record;
type window_Leave is new lace.Event.item with null record;
type window_Focus_In is new lace.Event.item with null record;
type window_Focus_Out is new lace.Event.item with null record;
type window_keymap_Notify is new lace.Event.item with null record;
type window_Expose is new lace.Event.item with null record;
type window_graphics_Exposure is new lace.Event.item with null record;
type window_no_Exposure is new lace.Event.item with null record;
type window_visibility_Notify is new lace.Event.item with null record;
type window_create_Notify is new lace.Event.item with null record;
type window_destroy_Notify is new lace.Event.item with null record;
type window_unmap_Notify is new lace.Event.item with null record;
type window_map_Notify is new lace.Event.item with null record;
type window_map_Request is new lace.Event.item with null record;
type window_reparent_Notify is new lace.Event.item with null record;
type window_configure_Notify is new lace.Event.item with null record;
type window_configure_Request is new lace.Event.item with null record;
type window_gravity_Notify is new lace.Event.item with null record;
type window_circulate_Notify is new lace.Event.item with null record;
type window_circulate_Request is new lace.Event.item with null record;
type window_property_Notify is new lace.Event.item with null record;
type window_selection_Clear is new lace.Event.item with null record;
type window_selection_Request is new lace.Event.item with null record;
type window_selection_Notify is new lace.Event.item with null record;
type window_colormap_Notify is new lace.Event.item with null record;
type window_client_Message is new lace.Event.item with null record;
type window_mapping_Notify is new lace.Event.item with null record;
type window_resize_Request is new lace.Event.item with
record
Width, Height : Positive;
end record;
type new_sprite_Event is new lace.Event.item with
record
Pair : gel.remote.World.sprite_model_Pair;
end record;
type new_sprite_added_to_world_Event is new lace.Event.item with
record
Sprite_Id : gel.sprite_Id;
World_Id : gel. world_Id;
end record;
type my_new_sprite_added_to_world_Event is new lace.Event.item with
record
Pair : gel.remote.World.sprite_model_Pair;
end record;
type sprite_click_down_Event is new lace.Event.item with
record
mouse_Button : gel.Mouse.Button_Id;
world_Site : math.Vector_3;
end record;
type sprite_click_up_Event is new lace.Event.item with
record
mouse_Button : gel.Mouse.Button_Id;
world_Site : math.Vector_3;
end record;
end gel.Events;
|
programs/oeis/001/A001971.asm | neoneye/loda | 22 | 88342 | <filename>programs/oeis/001/A001971.asm
; A001971: Nearest integer to n^2/8.
; 0,0,1,1,2,3,5,6,8,10,13,15,18,21,25,28,32,36,41,45,50,55,61,66,72,78,85,91,98,105,113,120,128,136,145,153,162,171,181,190,200,210,221,231,242,253,265,276,288,300,313,325,338,351,365,378,392,406,421,435,450,465,481,496,512,528,545,561,578,595,613,630,648,666,685,703,722,741,761,780,800,820,841,861,882,903,925,946,968,990,1013,1035,1058,1081,1105,1128,1152,1176,1201,1225
pow $0,2
add $0,4
div $0,8
|
oeis/010/A010515.asm | neoneye/loda-programs | 11 | 25223 | ; A010515: Decimal expansion of square root of 62.
; 7,8,7,4,0,0,7,8,7,4,0,1,1,8,1,1,0,1,9,6,8,5,0,3,4,4,4,8,8,1,2,0,0,7,8,6,3,6,8,1,0,8,6,1,2,2,0,2,0,8,5,3,7,9,4,5,9,8,8,4,2,5,5,0,3,1,3,7,6,0,8,4,6,8,1,7,6,9,8,0,5,6,9,2,6,1,9,1,3,5,1,2,4,8,7,4,6,8,8,9
mov $1,1
mov $2,1
mov $3,$0
add $3,8
mov $4,$0
add $4,3
mul $4,2
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,62
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,2
div $1,$8
div $2,$8
sub $3,1
lpe
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1729.asm | ljhsiun2/medusa | 9 | 20600 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xfbc3, %rsi
lea addresses_WC_ht+0x1e35b, %rdi
nop
dec %rbp
mov $119, %rcx
rep movsw
nop
nop
nop
cmp $21771, %r10
lea addresses_A_ht+0x8885, %r8
nop
nop
nop
xor %rdx, %rdx
movb $0x61, (%r8)
nop
nop
nop
dec %rbp
lea addresses_UC_ht+0xab2b, %rbp
nop
nop
nop
and %r8, %r8
vmovups (%rbp), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rdx
cmp $23253, %r10
lea addresses_A_ht+0xa4e3, %rsi
nop
nop
nop
add %rdx, %rdx
vmovups (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rcx
nop
nop
inc %rbp
lea addresses_UC_ht+0x1c323, %rbp
xor %r10, %r10
movl $0x61626364, (%rbp)
nop
nop
nop
nop
sub $23515, %rsi
lea addresses_normal_ht+0x24c3, %rcx
nop
nop
nop
cmp %r10, %r10
mov (%rcx), %r8w
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_D_ht+0x1021b, %rdx
clflush (%rdx)
nop
nop
xor $24177, %r8
movups (%rdx), %xmm3
vpextrq $0, %xmm3, %r10
nop
add $42971, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rbx
push %rsi
// Faulty Load
lea addresses_normal+0x127a3, %r8
nop
xor %r15, %r15
mov (%r8), %r14w
lea oracles, %r15
and $0xff, %r14
shlq $12, %r14
mov (%r15,%r14,1), %r14
pop %rsi
pop %rbx
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
base/mvdm/wow16/kernel31/diskio.asm | npocmaka/Windows-Server-2003 | 17 | 179801 | TITLE DISKIO
include kernel.inc
externFP Int21Handler
sBegin CODE
ASSUMES CS,CODE
externNP MyAnsiToOem
cProc I_lopen,<PUBLIC,FAR>
; parmD lpFilename
; parmW mode
; localV OemBuffer,128
cBegin nogen
mov ch,3Dh ; Open File
jmps loccommon
cEnd nogen
cProc I_lcreat,<PUBLIC,FAR>
; parmD lpFilename
; parmW attributes
; localV OemBuffer,128
cBegin nogen
mov ch,3Ch ; Create File
cEnd nogen
errn$ loccommon
cProc loccommon,<PUBLIC,FAR>
parmD lpFilename
parmW attributes
localV OemBuffer,128
cBegin
; Common code for open and creat functions. CH = function code
push cx
lea bx, OemBuffer
cCall MyAnsiToOem,<lpFilename,ss,bx>
pop cx
mov cl, byte ptr attributes
mov ax,cx
xor ch,ch
smov ds, ss
lea dx, OemBuffer
DOSCALL
jnc lopen_ok
mov ax,-1
lopen_ok:
cEnd
cProc I_lclose,<PUBLIC,FAR>
; parmW fd
cBegin nogen
mov bx,sp
mov bx,ss:[bx+4]
mov ah,3Eh ; DOS file close function
DOSCALL
mov ax,-1
jc lclose_end
inc ax
lclose_end:
ret 2
cEnd nogen
cProc I_llseek,<PUBLIC,FAR>
; parmW fh
; parmD fileOffset
; parmW mode
cBegin nogen
mov bx,sp
mov dx,ss:[bx+6]
mov cx,ss:[bx+8]
mov ax,ss:[bx+4]
mov bx,ss:[bx+10]
mov ah,42h
DOSCALL
jnc lseek_ok
mov ax,-1
cwd ; must return a long
lseek_ok:
ret 8
cEnd nogen
cProc I_lwrite,<PUBLIC,FAR>
; parmW fh
; parmD lpBuf
; parmW bufsize
cBegin nogen
mov cl,40h
jmp short _lrw
cEnd nogen
cProc I_lread,<PUBLIC,FAR>
; parmW fh
; parmD lpBuf
; parmW bufsize
cBegin nogen
mov cl,3fh
errn$ _lrw
cEnd nogen
; Common code for read and write functions. CL = function code
cProc _lrw,<PUBLIC,FAR>
cBegin nogen
mov bx,sp
push ds
mov ah,cl ; read or write operation
mov cx,ss:[bx+4] ; bufSize
lds dx,DWORD PTR ss:[bx+6] ; lpBuf
mov bx,ss:[bx+10] ; fh
DOSCALL
pop ds
jnc lwrite_ok
mov ax,-1
lwrite_ok:
ret 8
cEnd nogen
sEnd CODE
end
|
src/fltk-event.ads | micahwelf/FLTK-Ada | 1 | 25467 | <reponame>micahwelf/FLTK-Ada
with
FLTK.Widgets.Groups.Windows;
private with
Ada.Containers.Vectors,
System.Address_To_Access_Conversions;
package FLTK.Event is
type Event_Handler is access function
(Event : in Event_Kind)
return Event_Outcome;
-- type Event_Dispatch is access function
-- (Event : in Event_Kind;
-- Win : access FLTK.Widgets.Groups.Windows.Window'Class)
-- return Event_Outcome;
procedure Add_Handler
(Func : in Event_Handler);
procedure Remove_Handler
(Func : in Event_Handler);
-- function Get_Dispatch
-- return Event_Dispatch;
-- procedure Set_Dispatch
-- (Func : in Event_Dispatch);
-- function Default_Dispatch
-- (Event : in Event_Kind;
-- Win : access FLTK.Widgets.Groups.Windows.Window'Class)
-- return Event_Outcome;
function Get_Grab
return access FLTK.Widgets.Groups.Windows.Window'Class;
procedure Set_Grab
(To : in FLTK.Widgets.Groups.Windows.Window'Class);
procedure Release_Grab;
function Get_Pushed
return access FLTK.Widgets.Widget'Class;
procedure Set_Pushed
(To : in FLTK.Widgets.Widget'Class);
function Get_Below_Mouse
return access FLTK.Widgets.Widget'Class;
procedure Set_Below_Mouse
(To : in FLTK.Widgets.Widget'Class);
function Get_Focus
return access FLTK.Widgets.Widget'Class;
procedure Set_Focus
(To : in FLTK.Widgets.Widget'Class);
function Compose
(Del : out Natural)
return Boolean;
procedure Compose_Reset;
function Text
return String;
function Text_Length
return Natural;
function Last
return Event_Kind;
function Last_Modifier
return Modifier;
function Last_Modifier
(Had : in Modifier)
return Boolean;
function Mouse_X
return Integer;
function Mouse_X_Root
return Integer;
function Mouse_Y
return Integer;
function Mouse_Y_Root
return Integer;
function Mouse_DX
return Integer;
function Mouse_DY
return Integer;
procedure Get_Mouse
(X, Y : out Integer);
function Is_Click
return Boolean;
function Is_Multi_Click
return Boolean;
procedure Set_Clicks
(To : in Natural);
function Last_Button
return Mouse_Button;
function Mouse_Left
return Boolean;
function Mouse_Middle
return Boolean;
function Mouse_Right
return Boolean;
function Is_Inside
(X, Y, W, H : in Integer)
return Boolean;
function Last_Key
return Keypress;
function Original_Last_Key
return Keypress;
function Pressed_During
(Key : in Keypress)
return Boolean;
function Key_Now
(Key : in Keypress)
return Boolean;
function Key_Ctrl
return Boolean;
function Key_Alt
return Boolean;
function Key_Command
return Boolean;
function Key_Shift
return Boolean;
private
package Widget_Convert is new System.Address_To_Access_Conversions
(FLTK.Widgets.Widget'Class);
package Window_Convert is new System.Address_To_Access_Conversions
(FLTK.Widgets.Groups.Windows.Window'Class);
package Handler_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive, Element_Type => Event_Handler);
Handlers : Handler_Vectors.Vector := Handler_Vectors.Empty_Vector;
-- Current_Dispatch : Event_Dispatch := null;
function fl_widget_get_user_data
(W : in System.Address)
return System.Address;
pragma Import (C, fl_widget_get_user_data, "fl_widget_get_user_data");
pragma Inline (fl_widget_get_user_data);
pragma Inline (Add_Handler);
pragma Inline (Remove_Handler);
-- pragma Inline (Get_Dispatch);
-- pragma Inline (Set_Dispatch);
-- pragma Inline (Default_Dispatch);
pragma Inline (Get_Grab);
pragma Inline (Set_Grab);
pragma Inline (Release_Grab);
pragma Inline (Get_Pushed);
pragma Inline (Set_Pushed);
pragma Inline (Get_Below_Mouse);
pragma Inline (Set_Below_Mouse);
pragma Inline (Get_Focus);
pragma Inline (Set_Focus);
pragma Inline (Compose);
pragma Inline (Compose_Reset);
pragma Inline (Text);
pragma Inline (Text_Length);
pragma Inline (Last);
pragma Inline (Last_Modifier);
pragma Inline (Mouse_X);
pragma Inline (Mouse_X_Root);
pragma Inline (Mouse_Y);
pragma Inline (Mouse_Y_Root);
pragma Inline (Mouse_DX);
pragma Inline (Mouse_DY);
pragma Inline (Get_Mouse);
pragma Inline (Is_Click);
pragma Inline (Is_Multi_Click);
pragma Inline (Set_Clicks);
pragma Inline (Last_Button);
pragma Inline (Mouse_Left);
pragma Inline (Mouse_Middle);
pragma Inline (Mouse_Right);
pragma Inline (Is_Inside);
pragma Inline (Last_Key);
pragma Inline (Original_Last_Key);
pragma Inline (Pressed_During);
pragma Inline (Key_Now);
pragma Inline (Key_Ctrl);
pragma Inline (Key_Alt);
pragma Inline (Key_Command);
pragma Inline (Key_Shift);
end FLTK.Event;
|
oeis/332/A332157.asm | neoneye/loda-programs | 11 | 23698 | <reponame>neoneye/loda-programs
; A332157: a(n) = 5*(10^(2*n+1)-1)/9 + 2*10^n.
; Submitted by <NAME>(s1)
; 7,575,55755,5557555,555575555,55555755555,5555557555555,555555575555555,55555555755555555,5555555557555555555,555555555575555555555,55555555555755555555555,5555555555557555555555555,555555555555575555555555555,55555555555555755555555555555,5555555555555557555555555555555
add $0,2
mov $1,10
pow $1,$0
div $1,2
add $1,9
pow $1,2
mov $0,$1
sub $0,3481
div $0,450
add $0,7
|
private/ntos/rtl/i386/nlssup.asm | King0987654/windows2000 | 11 | 243928 | TITLE "String support routines"
;++
;
; Copyright (c) 1989 Microsoft Corporation
;
; Module Name:
;
; stringsup.asm
;
; Abstract:
;
; This module implements suplimentary routines for performing string
; operations.
;
; Author:
;
; <NAME> (larryo) 18-Sep-1991
;
; Environment:
;
; Any mode.
;
; Revision History:
;
;--
.386p
include callconv.inc ; calling convention macros
_TEXT SEGMENT DWORD PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
page ,132
subttl "RtlAnsiCharToUnicodeChar"
;++
;
; WCHAR
;RtlAnsiCharToUnicodeChar(
; IN OUT PCHAR *SourceCharacter
; )
;
;
; Routine Description:
;
; This function translates the specified ansi character to unicode and
; returns the unicode value. The purpose for this routine is to allow
; for character by character ansi to unicode translation. The
; translation is done with respect to the current system locale
; information.
;
;
; Arguments:
;
; (TOS+4) = SourceCharacter - Supplies a pointer to an ansi character pointer.
; Through two levels of indirection, this supplies an ansi
; character that is to be translated to unicode. After
; translation, the ansi character pointer is modified to point to
; the next character to be converted. This is done to allow for
; dbcs ansi characters.
;
; Return Value:
;
; Returns the unicode equivalent of the specified ansi character.
;
; Note:
;
; This routine will have to be converted to use the proper unicode mapping
; tables.
;
;--
cPublicProc _RtlAnsiCharToUnicodeChar ,1
cPublicFpo 1,2
push esi
mov esi, [esp+8]
push dword ptr [esi] ; Save the old input string
inc dword ptr [esi] ; Bump the input string
pop esi ; (ESI) = input string
xor eax, eax ; Zero out the EAX register.
lodsb ; Grab the first character from string
pop esi
stdRET _RtlAnsiCharToUnicodeChar
stdENDP _RtlAnsiCharToUnicodeChar
page
subttl "RtlpAnsiPszToUnicodePsz"
;++
;
; VOID
; RtlpAnsiPszToUnicodePsz(
; IN PCHAR AnsiString,
; IN PWCHAR UnicodeString,
; IN USHORT AnsiStringLength
; )
;
;
; Routine Description:
;
; This function translates the specified ansi character to unicode and
; returns the unicode value. The purpose for this routine is to allow
; for character by character ansi to unicode translation. The
; translation is done with respect to the current system locale
; information.
;
;
; Arguments:
;
; (ESP+4) = AnsiString - Supplies a pointer to the ANSI string to convert to unicode.
; (ESP+8) = UnicodeString - Supplies a pointer to a buffer to hold the unicode string
; (ESP+12) = AnsiStringLength - Supplies the length of the ANSI string.
;
; Return Value:
;
; None.
;
;
; Note:
;
; This routine will have to be converted to use the proper unicode mapping
; tables.
;--
cPublicProc _RtlpAnsiPszToUnicodePsz ,3
cPublicFpo 3,2
push esi
push edi
xor ecx, ecx
mov cx, [esp]+12+8
jecxz raptup9
mov esi, [esp]+4+8
mov edi, [esp]+8+8
xor ah, ah
@@: lodsb
stosw
loop @b
xor eax, eax
stosw ; Don't forget to stick the null at end
raptup9:pop edi
pop esi
stdRET _RtlpAnsiPszToUnicodePsz
stdENDP _RtlpAnsiPszToUnicodePsz
_TEXT ends
end
|
programs/oeis/083/A083254.asm | jmorken/loda | 1 | 244407 | <filename>programs/oeis/083/A083254.asm
; A083254: a(n) = 2*phi(n) - n.
; 1,0,1,0,3,-2,5,0,3,-2,9,-4,11,-2,1,0,15,-6,17,-4,3,-2,21,-8,15,-2,9,-4,27,-14,29,0,7,-2,13,-12,35,-2,9,-8,39,-18,41,-4,3,-2,45,-16,35,-10,13,-4,51,-18,25,-8,15,-2,57,-28,59,-2,9,0,31,-26,65,-4,19,-22,69,-24,71,-2,5,-4,43,-30,77,-16,27,-2,81,-36,43,-2,25,-8,87,-42,53,-4,27,-2,49,-32,95,-14,21,-20,99,-38,101,-8,-9,-2,105,-36,107,-30,33,-16,111,-42,61,-4,27,-2,73,-56,99,-2,37,-4,75,-54,125,0,39,-34,129,-52,83,-2,9,-8,135,-50,137,-44,43,-2,97,-48,79,-2,21,-4,147,-70,149,-8,39,-34,85,-60,155,-2,49,-32,103,-54,161,-4,-5,-2,165,-72,143,-42,45,-4,171,-62,65,-16,55,-2,177,-84,179,-38,57,-8,103,-66,133,-4,27,-46,189,-64,191,-2,-3,-28,195,-78,197,-40,63,-2,133,-76,115,-2,57,-16,151,-114,209,-4,67,-2,121,-72,143,-2,69,-60,163,-78,221,-32,15,-2,225,-84,227,-54,9,-8,231,-90,133,-4,75,-46,237,-112,239,-22,81,-4,91,-86,185,-8,79,-50
mov $1,$0
cal $1,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
sub $0,$1
sub $1,$0
sub $1,1
|
out/STLC/Signature.agda | JoeyEremondi/agda-soas | 39 | 6995 | <reponame>JoeyEremondi/agda-soas
{-
This second-order signature was created from the following second-order syntax description:
syntax STLC | Λ
type
N : 0-ary
_↣_ : 2-ary | r30
term
app : α ↣ β α -> β | _$_ l20
lam : α.β -> α ↣ β | ƛ_ r10
theory
(ƛβ) b : α.β a : α |> app (lam(x.b[x]), a) = b[a]
(ƛη) f : α ↣ β |> lam (x. app(f, x)) = f
-}
module STLC.Signature where
open import SOAS.Context
-- Type declaration
data ΛT : Set where
N : ΛT
_↣_ : ΛT → ΛT → ΛT
infixr 30 _↣_
open import SOAS.Syntax.Signature ΛT public
open import SOAS.Syntax.Build ΛT public
-- Operator symbols
data Λₒ : Set where
appₒ lamₒ : {α β : ΛT} → Λₒ
-- Term signature
Λ:Sig : Signature Λₒ
Λ:Sig = sig λ
{ (appₒ {α}{β}) → (⊢₀ α ↣ β) , (⊢₀ α) ⟼₂ β
; (lamₒ {α}{β}) → (α ⊢₁ β) ⟼₁ α ↣ β
}
open Signature Λ:Sig public
|
oeis/269/A269012.asm | neoneye/loda-programs | 11 | 27288 | <gh_stars>10-100
; A269012: Number of 2 X n binary arrays with some element plus some horizontally, diagonally or antidiagonally adjacent neighbor totalling two exactly once.
; Submitted by <NAME>(w2)
; 0,4,8,36,88,272,696,1900,4856,12588,31792,80288,200304,498004,1229672,3024948,7407496,18079664,43980072,106688956,258132824,623113020,1500935776,3608439104,8659683552,20747930788,49635222728,118576046148,282903469240,674144455760,1604632976280,3815383000588,9062932924856,21507682893132,50996035620496,120814441152224,285996566724432,676519979448820,1599171825021992,3777634176571476,8918038501040104,21040537119766256,49612915260106248,116921577523659868,275402162119892504,648369886219550556
lpb $0
mov $1,$0
sub $0,1
mul $2,3
add $4,1
mov $3,$4
bin $3,$1
mul $3,$1
add $2,$3
lpe
mov $0,$2
mul $0,4
|
checkButton.applescript | rcmdnk/AppleScript | 11 | 3009 |
tell application "System Events"
set pList to name of every process whose frontmost is true
set appName to item 1 of pList
tell process appName
--activate
set nButtons to number of buttons
display dialog appName & ", nButtons=" & nButtons
tell window 3
get properties of every button
repeat with p in (get properties of every button)
display dialog description of p
display dialog subrole of p
end repeat
display dialog "end"
close
end tell
end tell
end tell
|
UScript.Parser/UScript.g4 | maddnias/UScript | 3 | 6139 | grammar UScript;
module
: block EOF
;
block
: stat* retstat?
;
stat
: 'func' name=funcname funcbody #FunctionDeclStatement
| varDecl #VarDeclStatement
| functioncall #FuncCallStatement
| retstat #ReturnStatement
;
retstat
: 'return' exp?
;
label
: '::' NAME '::'
;
funcname
: NAME
;
varlist
: var (',' var)*
;
namelist
: NAME (',' NAME)*
;
explist
: exp (',' exp)*
;
exp
: '(' exp ')' #testerexp
| 'nil' #NilExp
| 'false' #FalseExp
| 'true' #TrueExp
| number #NumberExp
| var #VarExp
| string #StringExp
| <assoc=right> exp operatorPower exp #PowerExp
| operatorUnary exp #UnaryExp
| exp operatorMulDivMod exp #MulDivModExp
| exp operatorAddSub exp #AddSubExp
| exp operatorComparison exp #CmpExp
| exp operatorAnd exp #AndExp
| exp operatorOr exp #OrExp
| exp operatorBitwise exp #BitwiseExp
;
prefixexp
: varOrExp nameAndArgs*
;
functioncall
//: varOrExp nameAndArgs+
: target=funcname argList
;
argList
: '(' explist? ')'
;
varOrExp
: var | '(' exp ')'
;
var
: NAME
;
varDecl
: 'def' name=NAME ('=' initData=exp)?
;
varSuffix
: nameAndArgs* ('[' exp ']' | '.' NAME)
;
nameAndArgs
: (':' NAME)? args
;
param
: var (':' paramType=type)?
;
type
: TYPE_BYTE
| TYPE_CHAR
| TYPE_INT
| TYPE_FLOAT
| TYPE_STRING
;
args
: '(' explist? ')' | tableconstructor | string
;
functiondef
: 'function' funcbody
;
funcbody
: '(' params=parlist? ')' block 'end'
;
parlist
: param? (',' param)*
;
tableconstructor
: '{' fieldlist? '}'
;
fieldlist
: field (fieldsep field)* fieldsep?
;
field
: '[' exp ']' '=' exp | NAME '=' exp | exp
;
fieldsep
: ',' | ';'
;
operatorOr
: 'or';
operatorAnd
: 'and';
operatorComparison
: '<' | '>' | '<=' | '>=' | '~=' | '==';
operatorStrcat
: '..';
operatorAddSub
: '+' | '-';
operatorMulDivMod
: '*' | '/' | '%' | '//';
operatorBitwise
: '&' | '|' | '~' | '<<' | '>>';
operatorUnary
: 'not' | '#' | '-' | '~';
operatorPower
: '^';
number
: INT | HEX | FLOAT | HEX_FLOAT
;
string
: strData=NORMALSTRING
| strData=CHARSTRING
| strData=LONGSTRING
;
// LEXER
TYPE_BYTE
: 'Byte'
;
TYPE_INT
: 'Int'
;
TYPE_FLOAT
: 'Float'
;
TYPE_STRING
: 'String'
;
TYPE_CHAR
: 'Char'
;
NAME
: [a-zA-Z_][a-zA-Z_0-9]*
;
NORMALSTRING
: '"' ( EscapeSequence | ~('\\'|'"') )* '"'
;
CHARSTRING
: '\'' ( EscapeSequence | ~('\''|'\\') )* '\''
;
LONGSTRING
: '[' NESTED_STR ']'
;
fragment
NESTED_STR
: '=' NESTED_STR '='
| '[' .*? ']'
;
INT
: Digit+
;
HEX
: '0' [xX] HexDigit+
;
FLOAT
: Digit+ '.' Digit* ExponentPart?
| '.' Digit+ ExponentPart?
| Digit+ ExponentPart
;
HEX_FLOAT
: '0' [xX] HexDigit+ '.' HexDigit* HexExponentPart?
| '0' [xX] '.' HexDigit+ HexExponentPart?
| '0' [xX] HexDigit+ HexExponentPart
;
fragment
ExponentPart
: [eE] [+-]? Digit+
;
fragment
HexExponentPart
: [pP] [+-]? Digit+
;
fragment
EscapeSequence
: '\\' [abfnrtvz"'\\]
| '\\' '\r'? '\n'
| DecimalEscape
| HexEscape
| UtfEscape
;
fragment
DecimalEscape
: '\\' Digit
| '\\' Digit Digit
| '\\' [0-2] Digit Digit
;
fragment
HexEscape
: '\\' 'x' HexDigit HexDigit
;
fragment
UtfEscape
: '\\' 'u{' HexDigit+ '}'
;
fragment
Digit
: [0-9]
;
fragment
HexDigit
: [0-9a-fA-F]
;
COMMENT
: '--[' NESTED_STR ']' -> channel(HIDDEN)
;
LINE_COMMENT
: '--'
( // --
| '[' '='* // --[==
| '[' '='* ~('='|'['|'\r'|'\n') ~('\r'|'\n')* // --[==AA
| ~('['|'\r'|'\n') ~('\r'|'\n')* // --AAA
) ('\r\n'|'\r'|'\n'|EOF)
-> channel(HIDDEN)
;
WS
: [ \t\u000C\r\n]+ -> skip
;
SHEBANG
: '#' '!' ~('\n'|'\r')* -> channel(HIDDEN)
;
/*grammar UScript;
compileUnit
: block* EOF
;
block
: expression
| statement
;
statement
: funcDecl #FuncDeclStatement
| return #ReturnStatement
| varDecl #VarDeclStatement
;
return
: RETURN expression
;
expression
: identifier #IdentifierExpression
| number #NumberExpression
| constant #ConstantExpression
| expression ARITH_ADD expression #AdditionExpression
| expression ARITH_SUB expression #SubtractionExpression
| OPEN_PARENTH expression CLOSE_PARENTH #ParenthExpr
;
funcDecl
: 'func' funcName=NAME argList=argumentList? funcBody
;
funcBody
: block* return? 'end'
;
varDecl
: 'def' varName=NAME
| 'def' varName=NAME varInit
;
varInit
: '=' varConst=constant
;
constant
: number
| identifier
| NORMALSTRING
;
argument
: argName=identifier (':' varType=type)?
;
argumentList
: OPEN_PARENTH argument? (',' argument)? CLOSE_PARENTH
;
identifier
: NAME
;
type
: TYPE_BYTE
| TYPE_INT
| TYPE_DECIMAL
| TYPE_STRING
;
number
: INT | HEX | FLOAT | HEX_FLOAT
;
// LEXER
OPEN_PARENTH
: '('
;
CLOSE_PARENTH
: ')'
;
TYPE_BYTE
: 'Byte'
;
TYPE_INT
: 'Int'
;
TYPE_DECIMAL
: 'Decimal'
;
TYPE_STRING
: 'String'
;
ARITH_ADD
: '+'
;
ARITH_SUB
: '-'
;
NAME
: [a-zA-Z_][a-zA-Z_0-9]*
;
RETURN
: 'return'
;
NORMALSTRING
: '"' ( EscapeSequence | ~('\\'|'"') )* '"'
;
CHARSTRING
: '\'' ( EscapeSequence | ~('\''|'\\') )* '\''
;
LONGSTRING
: '[' NESTED_STR ']'
;
fragment
NESTED_STR
: '=' NESTED_STR '='
| '[' .*? ']'
;
INT
: Digit+
;
HEX
: '0' [xX] HexDigit+
;
FLOAT
: Digit+ '.' Digit* ExponentPart?
| '.' Digit+ ExponentPart?
| Digit+ ExponentPart
;
HEX_FLOAT
: '0' [xX] HexDigit+ '.' HexDigit* HexExponentPart?
| '0' [xX] '.' HexDigit+ HexExponentPart?
| '0' [xX] HexDigit+ HexExponentPart
;
fragment
ExponentPart
: [eE] [+-]? Digit+
;
fragment
HexExponentPart
: [pP] [+-]? Digit+
;
fragment
EscapeSequence
: '\\' [abfnrtvz"'\\]
| '\\' '\r'? '\n'
| DecimalEscape
| HexEscape
| UtfEscape
;
fragment
DecimalEscape
: '\\' Digit
| '\\' Digit Digit
| '\\' [0-2] Digit Digit
;
fragment
HexEscape
: '\\' 'x' HexDigit HexDigit
;
fragment
UtfEscape
: '\\' 'u{' HexDigit+ '}'
;
fragment
Digit
: [0-9]
;
fragment
HexDigit
: [0-9a-fA-F]
;
COMMENT
: '--[' NESTED_STR ']' -> channel(HIDDEN)
;
LINE_COMMENT
: '--'
( // --
| '[' '='* // --[==
| '[' '='* ~('='|'['|'\r'|'\n') ~('\r'|'\n')* // --[==AA
| ~('['|'\r'|'\n') ~('\r'|'\n')* // --AAA
) ('\r\n'|'\r'|'\n'|EOF)
-> channel(HIDDEN)
;
WS
: [ \t\u000C\r\n]+ -> skip
;
SHEBANG
: '#' '!' ~('\n'|'\r')* -> channel(HIDDEN)
;*/ |
out/montagnes.adb | FardaleM/metalang | 22 | 24276 | <gh_stars>10-100
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure montagnes is
type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
procedure SkipSpaces is
C : Character;
Eol : Boolean;
begin
loop
Look_Ahead(C, Eol);
exit when Eol or C /= ' ';
Get(C);
end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function montagnes0(tab : in a_PTR; len : in Integer) return Integer is
x : Integer;
max0 : Integer;
j : Integer;
i : Integer;
begin
max0 := 1;
j := 1;
i := len - 2;
while i >= 0 loop
x := tab(i);
while j >= 0 and then x > tab(len - j) loop
j := j - 1;
end loop;
j := j + 1;
tab(len - j) := x;
if j > max0
then
max0 := j;
end if;
i := i - 1;
end loop;
return max0;
end;
x : Integer;
tab : a_PTR;
len : Integer;
begin
len := 0;
Get(len);
SkipSpaces;
tab := new a (0..len - 1);
for i in integer range 0..len - 1 loop
x := 0;
Get(x);
SkipSpaces;
tab(i) := x;
end loop;
PInt(montagnes0(tab, len));
end;
|
ffight/lcs/boss/52.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 244940 | copyright zengfr site:http://github.com/zengfr/romhack
03DE14 move.w #$5, ($52,A6) [boss+56]
03DE1A move.w #$1aa, ($50,A6) [boss+52]
03DE2A neg.w ($52,A6) [boss+50]
03DE2E bra $3f2f6 [boss+52]
03E176 move.w #$14, ($52,A6) [boss+50]
03E17C tst.b ($2e,A6) [boss+52]
03E186 neg.w ($52,A6) [boss+50]
03E18A jmp $3b02.w [boss+52]
03E6BA move.w #$10, ($52,A6) [boss+50]
03E6C0 tst.b ($2e,A6) [boss+52]
03E6CA neg.w ($52,A6) [boss+50]
03E6CE jmp $3b02.w [boss+52]
03EC2E move.w #$10, ($52,A6) [boss+50]
03EC34 tst.b ($2e,A6) [boss+52]
03EC3E neg.w ($52,A6) [boss+50]
03EC42 jmp $3b02.w [boss+52]
copyright zengfr site:http://github.com/zengfr/romhack
|
examples/ATPConjecture.agda | asr/apia | 10 | 6874 | <reponame>asr/apia
-- The ATP pragma with the role <prove> can be used with postulates.
module ATPConjecture where
postulate
D : Set
_≡_ : D → D → Set
postulate
sym : ∀ {m n} → m ≡ n → n ≡ m
{-# ATP prove sym #-}
|
source/streams/a-snstio.ads | ytomino/drake | 33 | 27586 | pragma License (Unrestricted);
-- implementation unit
with Ada.IO_Exceptions;
with Ada.IO_Modes;
with System.Native_IO;
private with Ada.Tags;
package Ada.Streams.Naked_Stream_IO is
pragma Preelaborate;
-- the parameter Form
Default_Form : constant System.Native_IO.Packed_Form :=
(Shared => IO_Modes.By_Mode, Wait => False, Overwrite => True);
subtype Form_String is String (1 .. 256);
procedure Set (
Form : in out System.Native_IO.Packed_Form;
Keyword : String;
Item : String);
function Pack (Form : String) return System.Native_IO.Packed_Form;
procedure Unpack (
Form : System.Native_IO.Packed_Form;
Result : out Form_String;
Last : out Natural);
-- non-controlled
type Stream_Type (<>) is limited private;
type Non_Controlled_File_Type is access all Stream_Type;
-- Note: Non_Controlled_File_Type is pass-by-value whether in out or not,
-- and it's possible that Reset/Set_Mode may close the file.
-- So these functions have access mode.
procedure Create (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.File_Mode := IO_Modes.Out_File;
Name : String := "";
Form : System.Native_IO.Packed_Form := Default_Form);
procedure Create (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.Inout_File_Mode := IO_Modes.Out_File;
Name : String := "";
Form : System.Native_IO.Packed_Form := Default_Form);
procedure Open (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.File_Mode;
Name : String;
Form : System.Native_IO.Packed_Form := Default_Form);
procedure Open (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.Inout_File_Mode;
Name : String;
Form : System.Native_IO.Packed_Form := Default_Form);
procedure Close (
File : aliased in out Non_Controlled_File_Type;
Raise_On_Error : Boolean := True);
procedure Delete (File : aliased in out Non_Controlled_File_Type);
procedure Reset (
File : aliased in out Non_Controlled_File_Type;
Mode : IO_Modes.File_Mode);
procedure Reset (
File : aliased in out Non_Controlled_File_Type;
Mode : IO_Modes.Inout_File_Mode);
function Mode (File : not null Non_Controlled_File_Type)
return IO_Modes.File_Mode;
function Mode (File : not null Non_Controlled_File_Type)
return IO_Modes.Inout_File_Mode;
function Mode (File : not null Non_Controlled_File_Type)
return System.Native_IO.File_Mode;
function Name (File : not null Non_Controlled_File_Type) return String;
function Form (File : Non_Controlled_File_Type)
return System.Native_IO.Packed_Form;
pragma Inline (Mode);
pragma Inline (Form);
function Is_Open (File : Non_Controlled_File_Type) return Boolean;
function End_Of_File (File : not null Non_Controlled_File_Type)
return Boolean;
pragma Inline (Is_Open);
function Stream (File : not null Non_Controlled_File_Type)
return not null access Root_Stream_Type'Class;
procedure Read (
File : not null Non_Controlled_File_Type;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
procedure Write (
File : not null Non_Controlled_File_Type;
Item : Stream_Element_Array);
procedure Set_Index (
File : not null Non_Controlled_File_Type;
To : Stream_Element_Positive_Count);
function Index (File : not null Non_Controlled_File_Type)
return Stream_Element_Positive_Count;
function Size (File : not null Non_Controlled_File_Type)
return Stream_Element_Count;
procedure Set_Mode (
File : aliased in out Non_Controlled_File_Type;
Mode : IO_Modes.File_Mode);
procedure Flush (File : not null Non_Controlled_File_Type);
-- write the buffer and synchronize with hardware
procedure Flush_Writing_Buffer (
File : not null Non_Controlled_File_Type;
Raise_On_Error : Boolean := True);
-- write the buffer only
-- handle for non-controlled
procedure Open (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.File_Mode;
Handle : System.Native_IO.Handle_Type;
Name : String := "";
Form : System.Native_IO.Packed_Form := Default_Form;
To_Close : Boolean := False);
procedure Open (
File : in out Non_Controlled_File_Type;
Mode : IO_Modes.Inout_File_Mode;
Handle : System.Native_IO.Handle_Type;
Name : String := "";
Form : System.Native_IO.Packed_Form := Default_Form;
To_Close : Boolean := False);
function Handle (File : not null Non_Controlled_File_Type)
return System.Native_IO.Handle_Type;
pragma Inline (Handle);
function Is_Standard (File : not null Non_Controlled_File_Type)
return Boolean;
pragma Inline (Is_Standard);
-- exceptions
Status_Error : exception
renames IO_Exceptions.Status_Error;
Mode_Error : exception
renames IO_Exceptions.Mode_Error;
Use_Error : exception
renames IO_Exceptions.Use_Error;
Device_Error : exception
renames IO_Exceptions.Device_Error;
End_Error : exception
renames IO_Exceptions.End_Error;
private
package Dispatchers is
type Root_Dispatcher is limited new Root_Stream_Type with record
File : Non_Controlled_File_Type;
end record;
pragma Suppress_Initialization (Root_Dispatcher);
for Root_Dispatcher'Size use Standard'Address_Size * 2; -- [gcc-7] ?
for Root_Dispatcher'Alignment use
Standard'Address_Size / Standard'Storage_Unit; -- [gcc-7] ? in x32
overriding procedure Read (
Stream : in out Root_Dispatcher;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
overriding procedure Write (
Stream : in out Root_Dispatcher;
Item : Stream_Element_Array);
type Seekable_Dispatcher is limited new Seekable_Stream_Type with record
File : Non_Controlled_File_Type;
end record;
pragma Suppress_Initialization (Seekable_Dispatcher);
for Seekable_Dispatcher'Size use Standard'Address_Size * 2; -- [gcc-7] ?
for Seekable_Dispatcher'Alignment use
Standard'Address_Size / Standard'Storage_Unit; -- [gcc-7] ? in x32
overriding procedure Read (
Stream : in out Seekable_Dispatcher;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
overriding procedure Write (
Stream : in out Seekable_Dispatcher;
Item : Stream_Element_Array);
overriding procedure Set_Index (
Stream : in out Seekable_Dispatcher;
To : Stream_Element_Positive_Count);
overriding function Index (Stream : Seekable_Dispatcher)
return Stream_Element_Positive_Count;
overriding function Size (Stream : Seekable_Dispatcher)
return Stream_Element_Count;
type Dispatcher is record
Tag : Tags.Tag := Tags.No_Tag;
File : Non_Controlled_File_Type := null;
end record;
pragma Suppress_Initialization (Dispatcher);
for Dispatcher'Size use Standard'Address_Size * 2; -- [gcc-7] ?
for Dispatcher'Alignment use
Standard'Address_Size / Standard'Storage_Unit;
pragma Compile_Time_Error (
Seekable_Dispatcher'Size /= Root_Dispatcher'Size
or else Dispatcher'Size /= Root_Dispatcher'Size,
"size mismatch");
pragma Compile_Time_Error (
Seekable_Dispatcher'Alignment /= Root_Dispatcher'Alignment
or else Dispatcher'Alignment /= Root_Dispatcher'Alignment,
"misaligned");
end Dispatchers;
type Stream_Kind is (
Ordinary,
Temporary,
External,
External_No_Close,
Standard_Handle);
pragma Discard_Names (Stream_Kind);
Uninitialized_Buffer : constant := -1;
type Close_Handler is access procedure (
Handle : System.Native_IO.Handle_Type;
Name : System.Native_IO.Name_Pointer;
Raise_On_Error : Boolean);
pragma Favor_Top_Level (Close_Handler);
type Stream_Type is record -- "limited" prevents No_Elaboration_Code
Handle : aliased System.Native_IO.Handle_Type; -- file descripter
Mode : System.Native_IO.File_Mode;
Name : System.Native_IO.Name_Pointer;
Form : System.Native_IO.Packed_Form;
Kind : Stream_Kind;
Has_Full_Name : Boolean;
Buffer_Inline : aliased Stream_Element;
Buffer : System.Address;
Buffer_Length : Stream_Element_Offset;
Buffer_Index : Stream_Element_Offset; -- Index (File) mod Buffer_Length
Reading_Index : Stream_Element_Offset;
Writing_Index : Stream_Element_Offset;
Closer : Close_Handler;
Dispatcher : aliased Dispatchers.Dispatcher :=
(Tag => Tags.No_Tag, File => null);
end record;
pragma Suppress_Initialization (Stream_Type);
end Ada.Streams.Naked_Stream_IO;
|
libsrc/math/mbf64/c/sccz80/pi.asm | jpoikela/z88dk | 640 | 9960 | SECTION code_fp_mbf64
PUBLIC pi
EXTERN ___mbf64_FA
pi:
ld hl,pi_value
ld de,___mbf64_FA
ld bc,8
ldir
ret
SECTION rodata_fp_mbf64
pi_value:
defb 0xc0,0x68,0x21,0xa2,0xda,0x0f,0x49,0x82
|
src/VMTranslator/fixtures/FunctionCalls/DoubleCall/DoubleCall.raw.asm | tuzmusic/HackManager | 1 | 86994 | @256 // ** 0A: BOOTSTRAP THE SYSTEM ** (set the start of the stack to addr 256)
D=A // store the current address as a value
@SP // write value of D to "SP"
M=D // write value of D to current location -
@Sys.init$ret.2 // ** 0B: CALL Sys.init **
D=A // D=retAddr
@SP // >>> push retAddr onto stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@LCL // >>> saving "LCL"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@ARG // >>> saving "ARG"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@THIS // >>> saving "THIS"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@THAT // >>> saving "THAT"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@SP // >>> reposition: LCL = SP
D=M // store the stack pointer (after pushing the retAddr & segments)
@LCL
M=D // save SP to LCL
@5 // >>> reposition ARG = SP-n-5
D=D-A // subtract (frame + num of args) from the stored SP
@ARG
M=D // save SP-n-5 to ARG
@Sys.init // jump to the function
0;JMP -
@SP // ** 1: function Main.DoubleCall 0 **
D=M // store SP value
@LCL
M=D // store stack address in LCL (no local vars so we're done) -
@ARG // ** 2: push argument 0 ** (move to argument)
D=M // store the "argument" base address
@0 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1 -
@ARG // ** 3: push argument 0 ** (move to argument)
D=M // store the "argument" base address
@0 // move to address representing offset
A=D+A // new addr = base addr + offset
D=M // store current memory value in D
@SP // >>> push memory value to top of stack
A=M // move to top of stack
M=D // write value of D to current location -
@SP // ** 4: add ** (PREPARE Y (pop Y into D) (SP decremented above))
A=M // move to top of stack
D=M // store the top stack value into D
@SP // "pop" X
M=M-1
A=M // PREPARE X (prep X "into" M)
M=M+D // perform binary operation: add
@SP // increment stack pointer
M=M+1 -
@LCL // ** 5: return ** (>>> store LCL as FRAME)
D=M // store current memory value
@FRAME // go to "FRAME"
M=D // save the stored value in "FRAME"
@5 // >>> save RET
A=D-A // move to location of retAddr (RET=FRAME-5)
D=M // store current memory value
@RET // go to "RET"
M=D // save the stored value in "RET"
@SP // >> pop stack to *ARG <<
M=M-1
A=M // move to top of stack
D=M // store the top stack value into D
@ARG
A=M // move to "ARG"
M=D // write value of D to current location
D=A // >>> restore caller's SP. (in prev step, A=ARG)
@SP
M=D+1 // point SP to ARG+1 (one past returned value)
@LCL // >>> restoring saved "THAT"
A=M-1 // move to LCL-1: saved "THAT"
D=M // store saved "THAT"
@THAT
M=D // restore saved "THAT"
@LCL // >>> restoring saved "THIS"
A=M-1 // move to LCL-2: saved "THIS"
A=A-1
D=M // store saved "THIS"
@THIS
M=D // restore saved "THIS"
@LCL // >>> restoring saved "ARG"
A=M-1 // move to LCL-3: saved "ARG"
A=A-1
A=A-1
D=M // store saved "ARG"
@ARG
M=D // restore saved "ARG"
@LCL // >>> restoring saved "LCL"
A=M-1 // move to LCL-4: saved "LCL"
A=A-1
A=A-1
A=A-1
D=M // store saved "LCL"
@LCL
M=D // restore saved "LCL"
@RET // >>> move to the return address, to restore control to caller
A=M // prepare to jump to address stored in RET
0;JMP -
@SP // ** 1: function Sys.init 0 **
D=M // store SP value
@LCL
M=D // store stack address in LCL (no local vars so we're done) -
@3 // ** 2: push constant 3 **
D=A // store the current address as a value
@SP // >> push constant value (3) onto stack <<
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1 -
@Main.DoubleCall$ret.1 // ** 3: call Main.DoubleCall 1 **
D=A // D=retAddr
@SP // >>> push retAddr onto stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@LCL // >>> saving "LCL"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@ARG // >>> saving "ARG"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@THIS // >>> saving "THIS"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@THAT // >>> saving "THAT"
D=M // store current memory value in D
@SP // > push stored value to top of stack
A=M // move to top of stack
M=D // write value of D to current location
@SP // increment stack pointer
M=M+1
@SP // >>> reposition: LCL = SP
D=M // store the stack pointer (after pushing the retAddr & segments)
@LCL
M=D // save SP to LCL
@6 // >>> reposition ARG = SP-n-5
D=D-A // subtract (frame + num of args) from the stored SP
@ARG
M=D // save SP-n-5 to ARG
@Main.DoubleCall // jump to the function
0;JMP - -
@WHILE.VM // ** 5: goto WHILE) ** |
ordinary/orbit_2.adb | jscparker/math_packages | 30 | 7063 |
with Ada.Numerics.Generic_Elementary_Functions;
package body Orbit_2 is
package mth is new Ada.Numerics.Generic_Elementary_Functions(Real);
use mth;
function Norm (Y : Dynamical_Variable)
return Real
is
Sum : Real := +0.0;
begin
for i in Dyn_Index loop
Sum := Sum + Abs Y(i);
--Sum := Sum + Y(i) * Y(i);
end loop;
return Sum;
end Norm;
function "-"
(Left : Dynamical_Variable;
Right : Dynamical_Variable)
return Dynamical_Variable
is
Result : Dynamical_Variable;
begin
for I in Dyn_Index loop
Result(I) := Left(I) - Right(I);
end loop;
return Result;
end "-";
function "*"
(Left : Real;
Right : Dynamical_Variable)
return Dynamical_Variable
is
Result : Dynamical_Variable;
begin
for I in Dyn_Index loop
Result(I) := Left * Right(I);
end loop;
return Result;
end "*";
function "+"
(Left : Dynamical_Variable;
Right : Dynamical_Variable)
return Dynamical_Variable
is
Result : Dynamical_Variable;
begin
for I in Dyn_Index loop
Result(I) := Left(I) + Right(I);
end loop;
return Result;
end "+";
-- The differential equation is dY/dt = F (t, Y)
function F
(Time : Real;
Y : Dynamical_Variable)
return Dynamical_Variable
is
Deriv : Dynamical_Variable;
R2, R3, R6, x, z : Real;
One : constant Real := +1.0;
Four : constant Real := +4.0;
Min_Allowed_Real : constant Real := 2.0**(Real'Machine_Emin / 2);
begin
x := Y(Dyn_Index'First + 0);
z := Y(Dyn_Index'First + 1);
R2 := x*x + z*z;
R6 := R2*R2*R2;
R3 := Sqrt (One / (R6 + Min_Allowed_Real));
Deriv(Dyn_Index'First + 0) := -Four * x * R3;
Deriv(Dyn_Index'First + 1) := -Four * z * R3;
return Deriv;
end F;
function Energy
(Y : in Dynamical_Variable;
Y_dot : in Dynamical_Variable)
return Real
is
x : Real := Y(Dyn_Index'First + 0);
z : Real := Y(Dyn_Index'First + 1);
u : Real := Y_dot(Dyn_Index'First + 0);
v : Real := Y_dot(Dyn_Index'First + 1);
R : Real;
Result : Real;
begin
R := Sqrt (X*X + Z*Z);
Result := 0.25 * (U*U + V*V) - 2.0 / R;
return Result;
end Energy;
end Orbit_2;
|
programs/oeis/126/A126760.asm | neoneye/loda | 22 | 178899 | <reponame>neoneye/loda
; A126760: a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n+5) = 2n + 2.
; 0,1,1,1,1,2,1,3,1,1,2,4,1,5,3,2,1,6,1,7,2,3,4,8,1,9,5,1,3,10,2,11,1,4,6,12,1,13,7,5,2,14,3,15,4,2,8,16,1,17,9,6,5,18,1,19,3,7,10,20,2,21,11,3,1,22,4,23,6,8,12,24,1,25,13,9,7,26,5,27,2,1,14,28,3,29,15,10,4,30,2,31,8,11,16,32,1,33,17,4
mov $1,4
lpb $0
dif $0,3
dif $0,2
lpe
add $1,1
add $1,$0
div $1,3
sub $1,1
mov $0,$1
|
src/move_paddles.asm | tina-hoeflich/pong | 0 | 168215 | # Based on CESP lecture
# Authors: <NAME>, <NAME>, <NAME>
# Moves paddles according to keyboard inputs.
# 'w' and 's' for up/down movement of left paddle
# '8' and '2' (num block) for up/down movement of right paddle
# Inputs:
# a4: highest y coordinate reached by the paddle on the left
# a6: highest y coordinate reached by the paddle on the right
# Using:
# a3: x0 - left boundary of rectangle
# a4: y0 - top boundary of rectangle
# a5: x1 - right boundary of rectangle
# a6: y1 - bottom boundary of rectangle
# a7: fill color of rectangle as RGB value
# Returns:
# a3: highest y coordinate reached by the paddle on the left
# a4: lowest y coordinate reached by the paddle on the left
# a5: highest y coordinate reached by the paddle on the right
# a6: lowest y coordinate reached by the paddle on the right
j move_paddles
.text
move_paddles:
# allocate memory for a4 and a6 input values
addi sp, sp, -12
sw ra, 0 (sp)
sw a4, 4 (sp)
sw a6, 8 (sp)
li s0, KEYBOARD_ADDDRESS
lw a4, 4 (sp)
lw a6, 8 (sp)
lw t0, (s0)
beq t0, zero switch.end_paddles
lw t0, 4(s0)
switch.start_paddles:
# left paddle up
switch.w:
li t1, 'w'
bne t0, t1 switch.s
ble a4, zero, switch.end_paddles # won't move left paddle beyond the top screen boundaries
li a3, 18 # set left boundary
# a4 is already set through input value
li a5, 23 # set right boundary
addi a6, a4, 30 # set bottom boundary
# draw white section on top
add a6, a4, zero
addi a4, a4, -3
li a7, 0xffffff
jal draw_rectangle
# draw black section underneath
addi a4, a4, 30
addi a6, a6, 30
li a7, 0x000000
jal draw_rectangle
# update initial a4 and a6 values
addi a4, a4, -30
lw a6, 8 (sp) # stays the same as it was not moved
beq zero, zero switch.end_paddles
# left paddle down
switch.s:
li t1, 's'
bne t0, t1 switch.num8
li t3, DISPLAY_HEIGHT
addi t2, t3, -30 # subtract paddle length of 30 as only top y coordinate is known for bottom impact collision detection
bge a4, t2, switch.end_paddles # won't move left paddle beyond the bottom screen boundaries
li a3, 18 # set left boundary
# a4 is already set through input value
li a5, 23 # set right boundary
addi a6, a4, 30 # set bottom boundary
# draw white section underneath
addi a4, a4, 30
addi a6, a6, 3
li a7, 0xffffff
jal draw_rectangle
# draw black section on top
addi a4, a4, -30
addi a6, a6, -30
li a7, 0x000000
jal draw_rectangle
# update initial a4 and a6 values
addi a4, a4, 3
lw a6, 8 (sp) # stays the same as it was not moved
beq zero, zero switch.end_paddles
# right paddle up (num block)
switch.num8:
li t1, '8'
bne t0, t1 switch.num2
ble a6, zero, switch.end_paddles # won't move right paddle beyond the top screen boundaries
li a3, 233 # set left boundary
mv a4, a6 # a4 is already set through input value a6
li a5, 238 # set right boundary
addi a6, a4, 30 # set bottom boundary
# draw white section on top
add a6, a4, zero
addi a4, a4, -3
li a7, 0xffffff
jal draw_rectangle
# draw black section underneath
addi a4, a4, 30
addi a6, a6, 30
li a7, 0x000000
jal draw_rectangle
# update initial a4 and a6 values
addi a6, a4, -30
lw a4, 4 (sp) # stays the same as it was not moved
beq zero, zero switch.end_paddles
# right paddle down (num block)
switch.num2:
li t1, '2'
bne t0, t1 switch.end_paddles
li t3, DISPLAY_HEIGHT
addi t2, t3, -30 # subtract paddle length of 30 as only top y coordinate is known for bottom impact collision detection
bge a6, t2, switch.end_paddles # won't move right paddle beyond the bottom screen boundaries
li a3, 233 # set left boundary
mv a4, a6 # a4 is already set through input value a6
li a5, 238 # set right boundary
addi a6, a4, 30 # set bottom boundary
# draw white section underneath
addi a4, a4, 30
addi a6, a6, 3
li a7, 0xffffff
jal draw_rectangle
# draw black section on top
addi a4, a4, -30
addi a6, a6, -30
li a7, 0x000000
jal draw_rectangle
# update initial a4 and a6 values
lw a4, 4 (sp) # stays the same as it was not moved
# a6 is already correct
beq zero, zero switch.end_paddles
switch.end_paddles:
mv a3, a4 # highest y coordinate reached by the paddle on the left
addi a4, a3, 30 # lowest y coordinate reached by the paddle on the left
mv a5, a6 # highest y coordinate reached by the paddle on the right
addi a6, a5, 30 # lowest y coordinate reached by the paddle on the right
lw ra, 0 (sp)
addi sp, sp, 12
ret
|
Task/Visualize-a-tree/Ada/visualize-a-tree.ada | mullikine/RosettaCodeData | 1 | 25000 | with Ada.Text_IO, Ada.Directories;
procedure Directory_Tree is
procedure Print_Tree(Current: String; Indention: Natural := 0) is
function Spaces(N: Natural) return String is
(if N= 0 then "" else " " & Spaces(N-1));
use Ada.Directories;
Search: Search_Type;
Found: Directory_Entry_Type;
begin
Start_Search(Search, Current, "");
while More_Entries(Search) loop
Get_Next_Entry(Search, Found);
declare
Name: String := Simple_Name(Found);
Dir: Boolean := Kind(Found) = Directory;
begin
if Name(Name'First) /= '.' then
-- skip all files who's names start with ".", namely "." and ".."
Ada.Text_IO.Put_Line(Spaces(2*Indention) & Simple_Name(Found)
& (if Dir then " (dir)" else ""));
if Dir then
Print_Tree(Full_Name(Found), Indention + 1);
end if;
end if;
end;
end loop;
end Print_Tree;
begin
Print_Tree(Ada.Directories.Current_Directory);
end Directory_Tree;
|
programs/oeis/023/A023896.asm | jmorken/loda | 1 | 16909 | <reponame>jmorken/loda<gh_stars>1-10
; A023896: Sum of positive integers in smallest positive reduced residue system modulo n. a(1) = 1 by convention.
; 1,1,3,4,10,6,21,16,27,20,55,24,78,42,60,64,136,54,171,80,126,110,253,96,250,156,243,168,406,120,465,256,330,272,420,216,666,342,468,320,820,252,903,440,540,506,1081,384,1029,500,816,624,1378,486,1100,672,1026,812,1711,480,1830,930,1134,1024,1560,660,2211,1088,1518,840,2485,864,2628,1332,1500,1368,2310,936,3081,1280,2187,1640,3403,1008,2720,1806,2436,1760,3916,1080,3276,2024,2790,2162,3420,1536,4656,2058,2970,2000,5050,1632,5253,2496,2520,2756,5671,1944,5886,2200,3996,2688,6328,2052,5060,3248,4212,3422,5712,1920,6655,3660,4920,3720,6250,2268,8001,4096,5418,3120,8515,2640,7182,4422,4860,4352,9316,3036,9591,3360,6486,4970,8580,3456,8120,5256,6174,5328,11026,3000,11325,5472,7344,4620,9300,3744,12246,6162,8268,5120,10626,4374,13203,6560,6600,6806,13861,4032,13182,5440,9234,7224,14878,4872,10500,7040,10266,7832,15931,4320,16290,6552,10980,8096,13320,5580,14960,8648,10206,6840,18145,6144,18528,9312,9360,8232,19306,5940,19701,8000,13266,10100,17052,6528,16400,10506,13662,9984,18810,5040,22155,11024,14910,11342,18060,7776,19530,11772,15768,8800,21216,7992,24753,10752,13500,12656,25651,8208,26106,10120,13860,12992,27028,8424,21620,13688,18486,11424,28441,7680,28920,13310,19683,14640,20580,9840,26676,14880,20418,12500
mov $2,$0
add $0,2
mul $0,$2
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mul $0,2
mov $1,14
add $1,$0
sub $1,16
div $1,4
add $1,1
|
src/plugins/plugin.ads | Okasu/Byron | 1 | 11797 | with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Containers.Vectors;
-- Misc functions for plugins development aid
package Plugin
is
package Vectors is new Ada.Containers.Vectors (Positive, Unbounded_String);
use Vectors;
function Words (Str : Unbounded_String) return Vector;
function Unwords (Words : Vector) return Unbounded_String;
function Bold (Input : String) return String;
function Link (Input : Unbounded_String) return Boolean;
function GSub (Str : Unbounded_String;
From : String;
To : String) return Unbounded_String;
end Plugin;
|
programs/oeis/276/A276234.asm | neoneye/loda | 22 | 174187 | <reponame>neoneye/loda<gh_stars>10-100
; A276234: a(n) = n/gcd(n, 256).
; 1,1,3,1,5,3,7,1,9,5,11,3,13,7,15,1,17,9,19,5,21,11,23,3,25,13,27,7,29,15,31,1,33,17,35,9,37,19,39,5,41,21,43,11,45,23,47,3,49,25,51,13,53,27,55,7,57,29,59,15,61,31,63,1,65,33,67,17,69,35,71,9,73,37,75,19,77,39,79,5,81,41,83,21,85,43,87,11,89,45,91,23,93,47,95,3,97,49,99,25
add $0,1
mov $1,$0
mov $2,8
mov $3,1
lpb $2
sub $2,1
mul $3,2
lpe
gcd $3,$1
div $0,$3
|
07/StackArithmetic/SimpleAdd/SimpleAdd.asm | JurajX/Nand2Tetris | 0 | 168758 | <filename>07/StackArithmetic/SimpleAdd/SimpleAdd.asm
@7
D=A
@SP
AM=M+1
A=A-1
M=D
@8
D=A
@SP
AM=M+1
A=A-1
M=D
@SP
AM=M-1
D=M
A=A-1
M=D+M
|
libsrc/games/bit_click_mwr.asm | grancier/z180 | 0 | 96931 | ; $Id: bit_click_mwr.asm,v 1.4 2016/06/11 20:52:25 dom Exp $
;
; 1 bit sound library - version for "memory write" I/O architectures
;
; void bit_click();
;
; <NAME> - 31/03/2008
;
SECTION code_clib
PUBLIC bit_click
PUBLIC _bit_click
INCLUDE "games/games.inc"
EXTERN __snd_tick
.bit_click
._bit_click
ld a,(__snd_tick)
xor sndbit_mask
ld (sndbit_port),a
ld (__snd_tick),a
ret
|
DeliriOS_64bits/common_code/init_ioapic.asm | Izikiel/intel_multicore | 3 | 243505 | <reponame>Izikiel/intel_multicore<filename>DeliriOS_64bits/common_code/init_ioapic.asm
; =============================================================================
; Pure64 -- a 64-bit OS loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2012 Return Infinity -- see LICENSE.TXT
;
; INIT IO-APIC
; =============================================================================
global init_ioapic
os_IOAPICAddress: dq 0x0
init_ioapic:
push rbp
mov rbp, rsp
mov [os_IOAPICAddress], rdi
mov al, 0x70 ; IMCR access
out 0x22, al
mov al, 0x01 ; set bit 1 for SMP mode
out 0x23, al
xor eax, eax
mov rcx, 1 ; Register 1 - IOAPIC VERSION REGISTER
call ioapic_reg_read
shr eax, 16 ; Extract bytes 16-23 (Maximum Redirection Entry)
and eax, 0xFF ; Clear bits 16-31
add eax, 1
mov rcx, rax
xor rax, rax
mov eax, dword [rsi+0x20] ; Grab the BSP APIC ID; stored in bits 31:24
shr rax, 24 ; AL now holds the BSP CPU's APIC ID
shl rax, 56
bts rax, 16 ; Interrupt Mask Enabled
initentry: ; Initialize all entries 1:1
dec rcx
call ioapic_entry_write
cmp rcx, 0
jne initentry
; Enable the Keyboard
mov rcx, 1 ; IRQ value
mov rax, 0x21 ; Interrupt value
call ioapic_entry_write
; Enable the RTC
mov rcx, 8 ; IRQ value
mov rax, 0x28 ; Interrupt value
call ioapic_entry_write
; Set the periodic flag in the RTC
mov al, 0x0B ; Status Register B
out 0x70, al ; Select the address
in al, 0x71 ; Read the current settings
push rax
mov al, 0x0B ; Status Register B
out 0x70, al ; Select the address
pop rax
bts ax, 6 ; Set Periodic(6)
out 0x71, al ; Write the new settings
sti ; Enable interrupts
; Acknowledge the RTC
mov al, 0x0C ; Status Register C
out 0x70, al ; Select the address
in al, 0x71 ; Read the current settings
pop rbp
ret
; -----------------------------------------------------------------------------
; ioapic_reg_write -- Write to an I/O APIC register
; IN: EAX = Value to write
; ECX = Index of register
; OUT: Nothing. All registers preserved
ioapic_reg_write:
push rsi
mov rsi, [os_IOAPICAddress]
mov dword [rsi], ecx ; Write index to register selector
mov dword [rsi + 0x10], eax ; Write data to window register
pop rsi
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ioapic_reg_read -- Read from an I/O APIC register
; IN: ECX = Index of register
; OUT: EAX = Value of register
; All other registers preserved
ioapic_reg_read:
push rsi
mov rsi, [os_IOAPICAddress]
mov dword [rsi], ecx ; Write index to register selector
mov eax, dword [rsi + 0x10] ; Read data from window register
pop rsi
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ioapic_entry_write -- Write to an I/O APIC entry in the redirection table
; IN: RAX = Data to write to entry
; ECX = Index of the entry
; OUT: Nothing. All registers preserved
ioapic_entry_write:
push rax
push rcx
; Calculate index for lower DWORD
shl rcx, 1 ; Quick multiply by 2
add rcx, 0x10 ; IO Redirection tables start at 0x10
; Write lower DWORD
call ioapic_reg_write
; Write higher DWORD
shr rax, 32
add rcx, 1
call ioapic_reg_write
pop rcx
pop rax
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ioapic_entry_read -- Read an I/O APIC entry from the redirection table
; IN: ECX = Index of the entry
; OUT: RAX = Data that was read
; All other registers preserved
ioapic_entry_read:
push rbx
push rcx
; Calculate index for lower DWORD
shl rcx, 1 ; Quick multiply by 2
add rcx, 0x10 ; IO Redirection tables start at 0x10
; Read lower DWORD
call ioapic_reg_read
mov rbx, rax
; Read higher DWORD
add rcx, 1
call ioapic_reg_read
; Combine
shr rax, 32
or rbx, rax
xchg rbx, rax
pop rcx
pop rbx
ret
; -----------------------------------------------------------------------------
; =============================================================================
; EOF
|
src/LibraBFT/Impl/Consensus/BlockStorage/BlockTree.agda | LaudateCorpus1/bft-consensus-agda | 0 | 2563 | {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Base.Types
import LibraBFT.Impl.Consensus.ConsensusTypes.ExecutedBlock as ExecutedBlock
import LibraBFT.Impl.Consensus.ConsensusTypes.Vote as Vote
open import LibraBFT.Impl.OBM.Logging.Logging
open import LibraBFT.Impl.OBM.Prelude
open import LibraBFT.Impl.OBM.Rust.RustTypes
open import LibraBFT.ImplShared.Base.Types
open import LibraBFT.ImplShared.Consensus.Types
open import LibraBFT.ImplShared.Interface.Output
open import LibraBFT.ImplShared.Util.Crypto
open import LibraBFT.ImplShared.Util.Dijkstra.All
open import Optics.All
open import Util.ByteString
open import Util.Hash
import Util.KVMap as Map
open import Util.PKCS
open import Util.Prelude
------------------------------------------------------------------------------
open import Data.String using (String)
module LibraBFT.Impl.Consensus.BlockStorage.BlockTree where
postulate -- TODO-2: implement linkableBlockNew
linkableBlockNew : ExecutedBlock → LinkableBlock
module addChild (lb : LinkableBlock) (hv : HashValue) where
VariantFor : ∀ {ℓ} EL → EL-func {ℓ} EL
VariantFor EL = EL ErrLog LinkableBlock
postulate -- TODO-2: implement addChild
step₀ : VariantFor EitherD
-- addChild : LinkableBlock → HashValue → Either ErrLog LinkableBlock
-- addChild lb hv =
-- if Set.member hv (lb ^∙ lbChildren)
-- then Left fakeErr
-- else Right (lb & lbChildren %~ Set.insert hv)
E : VariantFor Either
E = toEither step₀
D : VariantFor EitherD
D = fromEither E
addChild = addChild.D
new : ExecutedBlock → QuorumCert → QuorumCert → Usize → Maybe TimeoutCertificate
→ Either ErrLog BlockTree
new root0 rootQuorumCert rootLedgerInfo maxPruned mHighestTimeoutCert = do
lcheck ((root0 ^∙ ebId) == (rootLedgerInfo ^∙ qcCommitInfo ∙ biId))
("BlockTree" ∷ "newBlockTree" ∷ "inconsistent root and ledger info" ∷ [])
let idToBlock = Map.insert (root0 ^∙ ebId) (linkableBlockNew root0) Map.empty
idToQuorumCert = Map.insert (rootQuorumCert ^∙ qcCertifiedBlock ∙ biId) rootQuorumCert Map.empty
prunedBlockIds = vdNew -- TODO
in pure $ mkBlockTree
idToBlock
(root0 ^∙ ebId) -- _btRootId
(root0 ^∙ ebId) -- _btHighestCertifiedBlockId
rootQuorumCert -- _btHighestQuorumCert
mHighestTimeoutCert
rootLedgerInfo -- _btHighestCommitCert
idToQuorumCert
prunedBlockIds
maxPruned
replaceTimeoutCertM : TimeoutCertificate → LBFT Unit
replaceTimeoutCertM tc = do
lBlockStore ∙ bsInner ∙ btHighestTimeoutCert ?= tc
logInfo fakeInfo -- lTO (InfoUpdateHighestTimeoutCert (Just tc))
------------------------------------------------------------------------------
module insertBlockE (block : ExecutedBlock)(bt : BlockTree) where
VariantFor : ∀ {ℓ} EL → EL-func {ℓ} EL
VariantFor EL = EL ErrLog (BlockTree × ExecutedBlock)
-- TODO: break into smaller steps to take advantage of the EitherD-weakestpre machinery to prove
-- the contract.
step₀ = do
let blockId = block ^∙ ebId
caseMD btGetBlock blockId bt of λ where
(just existingBlock) → pure (bt , existingBlock)
nothing → caseMD btGetLinkableBlock (block ^∙ ebParentId) bt of λ where
nothing → LeftD fakeErr
(just parentBlock) → (do
parentBlock' ← addChild parentBlock blockId
let bt' = bt & btIdToBlock ∙~ Map.kvm-insert-Haskell (block ^∙ ebParentId) parentBlock' (bt ^∙ btIdToBlock)
pure ( (bt' & btIdToBlock ∙~ Map.kvm-insert-Haskell blockId (LinkableBlock∙new block) (bt' ^∙ btIdToBlock))
, block))
E : VariantFor Either
E = toEither step₀
D : VariantFor EitherD
D = fromEither E
-- We make the EitherD variant the default, because the only call in code
-- modeled is in EitherD, so it's nice to keep it exactly like the Haskell
-- code being modeled. However, insertBlockESpec.Contract and the proof of
-- executeAndInsertBlockESpec.contract' (which was written before EitherD
-- support was developed) both want an Either variant, so they use
-- insertBlockE.E. This demonstrates the flexibility of the VariantOf
-- approach, providing variants for any EitherLike, and means to convert
-- between them easily.
insertBlockE = insertBlockE.D
------------------------------------------------------------------------------
module insertQuorumCertE (qc : QuorumCert) (bt0 : BlockTree) where
VariantFor : ∀ {ℓ} EL → EL-func {ℓ} EL
VariantFor EL = EL ErrLog (BlockTree × List InfoLog)
step₁ : HashValue → VariantFor EitherD
step₂ : HashValue → ExecutedBlock → VariantFor EitherD
step₃ : HashValue → ExecutedBlock → ExecutedBlock → VariantFor EitherD
continue1 : BlockTree → HashValue → ExecutedBlock → List InfoLog → (BlockTree × List InfoLog)
continue2 : BlockTree → List InfoLog → (BlockTree × List InfoLog)
here' : List String → List String
here' t = "BlockTree" ∷ "insertQuorumCert" ∷ t
blockId = qc ^∙ qcCertifiedBlock ∙ biId
safetyInvariant = forM_ (Map.elems (bt0 ^∙ btIdToQuorumCert)) $ \x →
lcheck ( (x ^∙ qcLedgerInfo ∙ liwsLedgerInfo ∙ liConsensusDataHash
== qc ^∙ qcLedgerInfo ∙ liwsLedgerInfo ∙ liConsensusDataHash)
∨ (x ^∙ qcCertifiedBlock ∙ biRound
/= qc ^∙ qcCertifiedBlock ∙ biRound))
(here' ("failed check" ∷ "existing qc == qc || existing qc.round /= qc.round" ∷ []))
step₀ =
case safetyInvariant of λ where
(Left e) → LeftD e
(Right unit) → step₁ blockId
step₁ blockId =
maybeSD (btGetBlock blockId bt0) (LeftD fakeErr) $ step₂ blockId
step₂ blockId block =
maybeSD (bt0 ^∙ btHighestCertifiedBlock) (LeftD fakeErr) $ step₃ blockId block
step₃ blockId block hcb =
ifD ((block ^∙ ebRound) >? (hcb ^∙ ebRound))
then
(let bt = bt0 & btHighestCertifiedBlockId ∙~ block ^∙ ebId
& btHighestQuorumCert ∙~ qc
info = (fakeInfo ∷ [])
in pure (continue1 bt blockId block info))
else pure (continue1 bt0 blockId block [])
continue1 bt blockId block info =
continue2 ( bt & btIdToQuorumCert ∙~ lookupOrInsert blockId qc (bt ^∙ btIdToQuorumCert))
( (fakeInfo ∷ info) ++ (if ExecutedBlock.isNilBlock block then fakeInfo ∷ [] else [] ))
continue2 bt info =
if-dec (bt ^∙ btHighestCommitCert ∙ qcCommitInfo ∙ biRound) <? (qc ^∙ qcCommitInfo ∙ biRound)
then ((bt & btHighestCommitCert ∙~ qc) , info)
else (bt , info)
E : VariantFor Either
E = toEither step₀
D : VariantFor EitherD
D = fromEither E
insertQuorumCertE = insertQuorumCertE.E
insertQuorumCertM : QuorumCert → LBFT Unit
insertQuorumCertM qc = do
bt ← use lBlockTree
case insertQuorumCertE qc bt of λ where
(Left e) → logErr e
(Right (bt' , info)) → do
forM_ info logInfo
lBlockTree ∙= bt'
------------------------------------------------------------------------------
module pathFromRoot (blockId : HashValue) (blockTree : BlockTree) where
-- TODO-1 PROVE IT TERMINATES
{-# TERMINATING #-}
loop : ExecutedBlock → HashValue → List ExecutedBlock → Maybe (HashValue × List ExecutedBlock)
loop btr curBlockId res = case btGetBlock curBlockId blockTree of λ where
(just block) → if-dec (block ^∙ ebRound) ≤?ℕ (btr ^∙ ebRound)
then just (curBlockId , res)
else loop btr (block ^∙ ebParentId) (block ∷ res)
nothing → nothing
pathFromRoot : HashValue → BlockTree → Either ErrLog (List ExecutedBlock)
pathFromRoot blockId blockTree =
maybeS (blockTree ^∙ btRoot) (Left fakeErr) $ λ btr →
maybeS (loop btr blockId []) (pure []) (pure ∘ continue)
where
open pathFromRoot blockId blockTree
continue : (HashValue × List ExecutedBlock) → List ExecutedBlock
continue (curBlockId , res) =
if not (curBlockId /= (blockTree ^∙ btRootId))
then []
else res
------------------------------------------------------------------------------
getAllBlockIdM : LBFT (List HashValue)
getAllBlockIdM = Map.kvm-keys <$> use (lBlockTree ∙ btIdToBlock)
|
programs/oeis/040/A040475.asm | neoneye/loda | 22 | 175634 | <reponame>neoneye/loda
; A040475: Continued fraction for sqrt(498).
; 22,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6,22,6,3,44,3,6
seq $0,10144 ; Continued fraction for sqrt(59).
seq $0,198265 ; Ceiling(n*sqrt(10)).
sub $0,1
|
src/nso-types-report_objects-observation_report.adb | SSOCsoft/Log_Reporter | 0 | 13666 | <filename>src/nso-types-report_objects-observation_report.adb
With
Ada.Tags,
Ada.Exceptions.Traceback,
Ada.Strings.Fixed,
Ada.Calendar.Formatting,
NSO.Helpers,
------------
INI.Read_INI,
INI.Section_Vector,
INI.Section_to_Vector,
INI.Section_to_Map,
--INI.Parameters,
-------------------------
Ada.Text_IO,
Gnoga.Server.Connection,
Gnoga.Types.Colors,
Gnoga.Gui.View;
with Gnoga.Gui.Element, Ada.Characters.Latin_1;
Package Body NSO.Types.Report_Objects.Observation_Report is
DEBUGGING : Constant Boolean := False;
Package Naming is new Name_Binder("Observation", Observation_Report);
Function Get_Name(Self: Observation_Report) return String
renames Naming.Get_Name;
Report_Name : String renames Naming.Report_Name;
-- Report_Name : Constant String := "Observation";
procedure Add_Self(
Self : in Observation_Report;
Form : in out Gnoga.Gui.Element.Form.Form_Type'Class
) is
Use Gnoga.Gui.Element.Common, Gnoga.Gui.Element.Form;
Package Form_Entry is new Generic_Form_Entry(
Report_Type => Observation_Report,
Report => Self'Access,
Form => Form,
Label => Self.Date.Value & ' ' & Self.Time.Value
);
Function Name is new Form_Entry.Name(
Indices =>
Form_Entry.Index(Self.Date.Value) &
Form_Entry.Index(Self.Time.Value)
);
Instrument_INI : INI.Instance renames INI.Read_INI("Insturments.ini");
Instrument_List : String_Vector.Vector renames
INI.Section_Vector(Instrument_INI);
-- INI.Section_to_Vector(INI.Parameters.Parameters, "Instrument");
Package Items is new Form_Entry.Components(
Selection_Type, Selection_Access, Positive(Instrument_List.Length)
);
Function "="(Left, Right : String) return Boolean
renames Ada.Strings.Equal_Case_Insensitive;
Begin
CREATE_INSTRUMENTS:
For X in Items.Tuple'Range loop
FORM_SUBMITION:
Declare
Device : String renames Instrument_List(X);
Instrument : Selection_Type;
Submition : Selection_Type renames Items.Tuple(X).all;
---- JQUERY WORKAROUND, NO LONGER NEEDED; KEPT FOR REFERENCE.
--Function Element_Count return Natural with Inline is
-- Function Direct_Option_Count return Natural is
-- use Gnoga.Server.Connection;
-- --JQuery count options: "$('#example option').length"
-- Result : String renames Execute_Script(
-- ID => Self.Connection_ID,
-- Script => "#"& Device &" option').length"
-- );
-- Begin
-- Return Integer'Value( Result );
-- End Direct_Option_Count;
--Begin
-- Return Instrument.Length;
--exception
-- when CONSTRAINT_ERROR =>
-- return Direct_Option_Count;
--End Element_Count;
Begin
-- Assiciate 'Instrument' with the proper Instrument from the INI file.
Instrument.Attach_Using_Parent(ID => Device, Parent => Self);
-- Create the form-element that will be submitted.
Submition.Create(
Form => Form,
Multiple_Select => True,
Name => Name(Device)
);
-- Populate the form-element.
SUBMITION_POPULATION:
For Item in 1..Instrument.Length loop
Declare
Option : Option_Type;
Value : String renames Instrument.Value(Index => Item);
Text : String renames Instrument.Text (Index => Item);
Begin
if Instrument.Selected(Item) then
Option.Dynamic;
Option.Create(
Form => Form, Selection => Submition,
Value => Text,
Text => Text
);
Option.Selected;
End if;
End;
End Loop SUBMITION_POPULATION;
End FORM_SUBMITION;
End Loop CREATE_INSTRUMENTS;
Items.Set_Attributes;
Items.Place_Items;
End Add_Self;
Procedure Observation_Div(Object : in out Observation_Report;
Form : in out Gnoga.Gui.Element.Form.Form_Type'Class ) is
Use Gnoga.Gui.Element.Form, NSO.Helpers;
Date : Date_Type renames Object.Date;
Time : Time_Type renames Object.Time;
Instrument_INI : INI.Instance renames INI.Read_INI("Insturments.ini");
Instrument_List : String_Vector.Vector renames
INI.Section_Vector(Instrument_INI);
-- INI.Section_to_Vector(INI.Parameters.Parameters, "Instrument");
Labels : Array(1..2) of Gnoga.Gui.Element.Form.Label_Type;
Procedure Add_Directions is new Add_Discrete( NSO.Types.Direction );
Procedure Add_Conditions is new Add_Discrete( NSO.Types.Sky );
Procedure Add_Label(
Label : in out Gnoga.Gui.Element.Form.Label_Type'Class;
Form : in out Gnoga.Gui.Element.Form.Form_Type'Class;
Item : in out Gnoga.Gui.Element.Element_Type'Class;
Text : String
) is
Begin
Label.Create(Form, Item, Text, Auto_Place => False);
Item.Place_Inside_Bottom_Of(Label);
End Add_Label;
Use Ada.Calendar.Formatting;
Function Time_String return String is
Use Ada.Strings.Fixed, Ada.Strings;
Time_Image : String renames Image( Ada.Calendar.Clock );
Space : Natural renames Index(Time_Image, " ", Time_Image'First);
Colon : Natural renames Index(Time_Image, ":", Time_Image'Last, Going => Backward);
Begin
Return Result : Constant String :=
Time_Image( Positive'Succ(Space)..Positive'Pred(Colon) );
End;
Function Date_String return String is
Use Ada.Strings.Fixed, Ada.Strings;
Time_Image : String renames Image( Ada.Calendar.Clock );
Space : Natural renames Index(Time_Image, " ", Time_Image'First);
Begin
Return Result : Constant String :=
Time_Image( Time_Image'First..Positive'Pred(Space) );
End;
Begin
if DEBUGGING then
Object.Background_Color( Gnoga.Types.Colors.Yellow );
end if;
-----------------------
-- CREATE COMPONENTS --
-----------------------
Date.Create(Form => Form, ID => Report_Name &".Date", Value => Date_String);
Time.Create(Form => Form, ID => Report_Name &".Time", Value => Time_String);
-----------------
-- ADD OPTIONS --
-----------------
-- Ada.Text_IO.Put_Line("-------------EXPANDING-SECTIONS----------------");
Add_Section_Groups(Form, Parent => Object, Fields => Instrument_List,
File => Instrument_INI );--INI.Parameters.Parameters);
--------------------
-- CREATE LABELS --
--------------------
Add_Label( Labels(1), Form, Date, "Date:");
Add_Label( Labels(2), Form, Time, "Time:");
-------------------
-- PLACE OBJECTS --
-------------------
Labels(1).Place_Inside_Top_Of( Object );
For X in Positive'Succ(Labels'First)..Labels'Last loop
Labels(X).Place_After( Labels( Positive'Pred(X) ) );
end loop;
Object.Place_Inside_Bottom_Of( Form );
End Observation_Div;
procedure Make is new Generic_Create(
Name => Report_Name,
UI_Report_Div => Observation_Report,
Populate_Div => Observation_Div
);
procedure Create (Report : in out Observation_Report;
Parent : in out Gnoga.Gui.Base.Base_Type'Class;
Content : in String := "";
ID : in String := "" )
renames Make;
--------------------------------------------------------------------------------
Package Latin_1 renames Ada.Characters.Latin_1;
New_Line : Constant String := (Latin_1.CR, Latin_1.LF);
Function Report(Data : in NSO.JSON.Instance'Class) return Report_Map.Map is
Use NSO.Types, NSO.JSON, Ada.Strings.Fixed;
Package Fixed renames Ada.Strings.Fixed;
Package IMP renames Instrument_Mode_Pkg;
-- The result to return.
Working : Report_Map.Map;
Current : Report_Map.Cursor;
Procedure Process_Instrument(Instrument : String; Value : Instance'Class) is
Map : IMP.Map renames Working( Report_Map.Key(Current) );
Procedure Process_Channel(Channel : String) is
Set : String_Set.Set renames Map(Instrument);
Begin
Set.Include( Channel );
End Process_Channel;
Procedure Process_Channel(Index : Natural; Value : in Instance'Class ) is
Begin
if Value in String_Object then
Process_Channel( Value.To_String );
end if;
End Process_Channel;
Procedure Do_Process is new Apply(
On_String => Process_Channel,
On_Array => Process_Channel
);
Begin
if not Map.Contains(Instrument) then
Map.Include(Instrument, String_Set.Empty_Set);
end if;
Do_Process( Value );
End Process_Instrument;
Function Process_Parameters is new Process_Date_Time(
Result => Working,
Current => Current,
Element => Instrument_Mode_Pkg.Map,
Date_Time_Map => Report_Map,
Default => Instrument_Mode_Pkg.Empty_Map,
Report_Name => Report_Name,
On_Object => Process_Instrument
);
Begin
Return Result : Report_Map.Map := Process_Parameters(Data) do
if DEBUGGING then
Ada.Text_IO.Put_Line( "-------- START DEBUG --------" );
for X of Result loop
for Y in X.iterate loop
Ada.Text_IO.Put_Line( Instrument_Mode_Pkg.key(Y) );
for Z of Instrument_Mode_Pkg.Element(Y) loop
Ada.Text_IO.Put( " " & Z & ", " );
end loop;
Ada.Text_IO.New_Line;
end loop;
end loop;
Ada.Text_IO.Put_Line( "-------- STOP DEBUG --------" );
end if;
End return;
End Report;
-- Generate a single observation-event. (TBODY tag + contents.)
Function Report( Cursor : Report_Map.Cursor ) return String is
Use Report_Map, Ada.Calendar, Ada.Calendar.Formatting;-- , NSO.Helpers;
Row_White : Boolean:= True;
Table_Head : Constant String:= "th";
Table_Data : Constant String:= "td";
Table_Row : Constant String:= "tr";
Header_Row : Boolean:= False;
Function Row_Color return String with Inline is
Begin
Return Result : String := "background-color: " &
(if Row_White then "Beige" else "#AFCECF") & ';' do
Row_White:= Not Row_White;
end return;
End Row_Color;
-- Renames for helper-functions.
Function Trim( Input : String ) return String
renames NSO.Helpers.Trim;
Function HTML_Tag(Name, Text, Attribute, Value : String) return String
renames NSO.Helpers.HTML_Tag;
-- Ugly "patched" HTML_Tag that applies color-stylings to table-rows,
-- oherwise it passes on the parameters to the "real" HTML_Tag function.
Function HTML_Tag(Name, Text : String) return String is
(if Name = Table_Row
then HTML_Tag(Name, Text, "Style", Row_Color)
else NSO.Helpers.HTML_Tag(Name, Text)
) with Inline;
-- Because of how the ROWSPAN attribute alters the general structure of
-- the tags within a table, the TR tag contents are less uniform than
-- would otherwise be. (eg a TR can contain 1, 2, or 3 TD tags.)
Function Row_Start return String;
Function Row_Stop return String;
-- Helper-functions for the output of Row_Start & Row_Stop.
Function Make_Tag( Input : String ) return String is
('<' & Input & " style="""&Row_Color&""">") with Inline;
Function Stop_Tag( Input : String ) return String is
( "</" & Input & '>' ) with Inline;
-- Get the number of rows the data occupies.
Function Rows( Input : String_Set.Set ) return Natural with Inline;
Function Rows( Input : Report_Data ) return Natural with Inline;
Function Report( Cursor : Instrument_Mode_Pkg.Cursor ) return String is
Function Report( Cursor : String_Set.Cursor ) return String is
(if not String_Set.Has_Element(Cursor) then ""
else HTML_Tag(Table_Data, String_Set.Element(Cursor) )
);
-- Collects all the remaining items of the string-set into a string.
-- NOTE, this should be used on the SECOND item.
Function Collect( Cursor : String_Set.Cursor ) return String is
(if not String_Set.Has_Element(Cursor) then ""
else HTML_Tag(Table_Row, Report(Cursor)) & New_Line &
Collect(String_Set.Next(Cursor))
);
Use Instrument_Mode_Pkg;
Begin
if not Has_Element(Cursor) then
Return "";
else
Declare
Set : String_Set.Set renames Element(Cursor);
Name : String renames Key(Cursor);
Size : Constant Natural := Natural(Set.Length);
First : Constant String_Set.Cursor:= Set.First;
Begin
Return HTML_Tag(
Name => Table_Data,
Attribute => "rowspan",
Value => Trim(Natural'Image(Size)),
Text => Name
) & Report(First) & Row_Stop
& Collect(String_Set.Next(First));
End;
end if;
End Report;
-- Collects all the remaining items of the Instrument-map into a string.
-- NOTE, this should be used on the SECOND item.
Function Collect( Cursor : Instrument_Mode_Pkg.Cursor ) return String is
(if not Instrument_Mode_Pkg.Has_Element(Cursor) then ""
else (Row_Start & Report(Cursor)) &
Collect(Instrument_Mode_Pkg.Next(Cursor)) & New_Line
);
Function Rows( Input : String_Set.Set ) return Natural is
( Natural(Input.Length) );
Function Rows( Input : Report_Data ) return Natural is
Begin
Return Result : Natural := 0 do
For Instrument of Input loop
Result:= Result + Rows( Instrument );
End loop;
End return;
End Rows;
Function Row_Start return String is
Begin
Return Result : String:=
(if not Header_Row then Make_Tag(Table_Row) else "") do
Header_Row:= True;
End return;
End Row_Start;
Function Row_Stop return String is
Begin
Return Result : String:=
(if Header_Row then Stop_Tag(Table_Row) else "") do
Header_Row:= False;
End return;
End Row_Stop;
Begin
if not Has_Element(Cursor) then
Return "";
else
Declare
Date : Time renames Key(Cursor);
Instrument : Report_Data renames Element(Cursor);
Count : Constant Natural := Rows(Instrument);
First : Constant Instrument_Mode_Pkg.Cursor:= Instrument.First;
Date_Time : Constant String:= --
"<th rowspan=""" & Trim( Natural'Image(Count) ) &
""" scope=""RowGroup"">" & Image(Date) & "</th>";
Begin
return New_Line & HTML_Tag("TBody",
Row_Start
& Date_Time
& Report(First)
& Collect( Instrument_Mode_Pkg.Next(First) )
) & New_Line;
End;
End if;
End Report;
Function Report( Object : Report_Map.Map ) return String is
Use NSO.Helpers;
Function Report_Header return String is
Function Header(Column : String) return String is
(HTML_Tag(
Name => "th",
Text => Column,
Attribute => "scope",
Value => "col"
)
) with Inline;
use NSO.Helpers;
Date_Time : String renames Header("Time / Date");
INSTRUMENTS : String renames Header("INSTRUMENTS");
Modes : String renames Header("Channels");
Begin
Return New_Line & HTML_Tag(
"thead", HTML_Tag("tr",
Date_Time & INSTRUMENTS & Modes)
) & New_Line;
End Report_Header;
Function Report_Data( Cursor : Report_Map.Cursor:= Object.First ) return String is
Next : Report_Map.Cursor renames Report_Map.Next(Cursor);
Has_Next : Boolean renames Report_Map.Has_Element( Next );
Begin
Return Report(Cursor) &
(if not Has_Next then "" else Report_Data( Next ));
End Report_Data;
Caption : Constant String := HTML_Tag("Caption", Report_Name&" Report");
Begin
return HTML_Tag(
Attribute => "Width",
Value => "100%",
Name => "Table",
Text => Caption & Report_Header & Report_Data
);
End Report;
End NSO.Types.Report_Objects.Observation_Report;
|
predaja/tests/testRelocation2.asm | znjRoLS/ss | 0 | 245940 | .public sth123
.public testInstr
.data
sth123: .long 0x87654321
.text.neki
testInstr:
and r1,r2
ret |
oeis/016/A016223.asm | neoneye/loda-programs | 11 | 85479 | <reponame>neoneye/loda-programs
; A016223: Expansion of 1/((1-x)(1-4x)(1-7x)).
; Submitted by <NAME>(s1)
; 1,12,105,820,6081,43932,312985,2212740,15576561,109385452,767096265,5375266260,37649233441,263634112572,1845796701945,12922008569380,90459786608721,633241412753292,4432781515242025,31029837110570100,217210325789494401,1520478144588475612
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $1,4
mul $2,7
add $2,1
lpe
add $1,$2
mov $0,$1
|
archive/agda-3/src/AgdaFeatureNoInstanceFromHidden.agda | m0davis/oscar | 0 | 9323 | <reponame>m0davis/oscar
{-# OPTIONS --allow-unsolved-metas #-}
module AgdaFeatureNoInstanceFromHidden where
postulate
A : Set
R : A → A → Set
Alrighty : A → Set₁
Alrighty l = ∀ {r} → R l r → Set
record Foo (Q : A → Set₁) : Set₁ where field foo : ∀ {x y} → R x y → Q x → Q y
open Foo {{...}}
postulate
instance theInstance : Foo Alrighty
works1 : ∀ {x y} → R x y → Alrighty x → Alrighty y
works1 r = foo r
works2 : ∀ {x y} → R x y → Alrighty x → Alrighty y
works2 r ax = works1 r ax
works3 : ∀ {x y} → R x y → Alrighty x → Alrighty y
works3 r ax = foo {{theInstance}} r ax
works4 : ∀ {x y} → R x y → Alrighty x → Alrighty y
works4 r ax = foo r (λ {v} → ax {v})
fails : ∀ {x y} → R x y → Alrighty x → Alrighty y
fails r ax = {!foo r ax!}
{-
No instance of type Foo (λ v → R v _r_81 → Set) was found in scope.
when checking that r ax are valid arguments to a function of type
{Q : A → Set₁} {{r = r₁ : Foo Q}} {x y : A} → R x y → Q x → Q y
-}
|
utils/sphere.adb | Lucretia/old_nehe_ada95 | 0 | 2572 | ---------------------------------------------------------------------------------
-- Copyright 2004-2005 © <NAME>
--
-- This code is to be used for tutorial purposes only.
-- You may not redistribute this code in any form without my express permission.
---------------------------------------------------------------------------------
with Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
with Ada.Unchecked_Conversion;
with GL;
package body Sphere is
package Trig is new Ada.Numerics.Generic_Elementary_Functions(Float);
procedure Render(Self : in Object) is
function GLint_To_GLenum is new Ada.Unchecked_Conversion(Source => GL.GLint, Target => GL.GLenum);
type GLintArray is array (0 .. 1) of GL.GLint;
type GLintArray_Ptr is access all GLintArray;
function GLintArray_Ptr_To_GLintPtr is new Ada.Unchecked_Conversion(Source => GLintArray_Ptr, Target => GL.GLintPtr);
TOTAL_SECTIONS : constant := 20;
ANGLE_DELTA : Float := (2.0 * Ada.Numerics.PI) / Float(TOTAL_SECTIONS);
Old_Polygon_Mode : aliased GLintArray;
Old_Polygon_Mode_Ptr : GLintArray_Ptr := Old_Polygon_Mode'Unchecked_Access;
Angle : Float := 0.0;
begin
-- Get the polygon mode.
GL.glGetIntegerv(GL.GL_POLYGON_MODE, GLintArray_Ptr_To_GLintPtr(Old_Polygon_Mode_Ptr));
GL.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);
GL.glDisable(GL.GL_LIGHTING);
GL.glColor3f(1.0, 1.0, 0.0);
-- Draw the circle in the XY plane.
GL.glBegin(GL.GL_LINE_STRIP);
for Section in 1 .. TOTAL_SECTIONS + 1 loop
Angle := Float(Section) * ANGLE_DELTA;
GL.glVertex3f(GL.GLfloat(Self.Radius * Trig.Cos(Angle)), GL.GLfloat(Self.Radius * Trig.Sin(Angle)), 0.0);
end loop;
GL.glEnd;
-- Draw the circle in the XZ plane.
GL.glBegin(GL.GL_LINE_STRIP);
for Section in 1 .. TOTAL_SECTIONS + 1 loop
Angle := Float(Section) * ANGLE_DELTA;
GL.glVertex3f(GL.GLfloat(Self.Radius * Trig.Cos(Angle)), 0.0, GL.GLfloat(Self.Radius * Trig.Sin(Angle)));
end loop;
GL.glEnd;
-- Draw the circle in the YZ plane.
GL.glBegin(GL.GL_LINE_STRIP);
for Section in 1 .. TOTAL_SECTIONS + 1 loop
Angle := Float(Section) * ANGLE_DELTA;
GL.glVertex3f(0.0, GL.GLfloat(Self.Radius * Trig.Cos(Angle)), GL.GLfloat(Self.Radius * Trig.Sin(Angle)));
end loop;
GL.glEnd;
-- Restore the polygon mode.
GL.glPolygonMode(GL.GL_FRONT, GLint_To_GLenum(Old_Polygon_Mode(0)));
GL.glPolygonMode(GL.GL_BACK, GLint_To_GLenum(Old_Polygon_Mode(1)));
GL.glEnable(GL.GL_LIGHTING);
end Render;
end Sphere;
|
iod/con2/q68/blob_drop.asm | olifink/smsqe | 0 | 88164 | <reponame>olifink/smsqe<gh_stars>0
; Blob dropping code V2.00 1992 <NAME>
;
; d0 c s byte offset / composite colour
; d1 c s row offset
; d2 c s horizontal pattern repeat / horizontal offset
; d3 c s vertical pattern repeat / vertical offset
; d4 s blob mask
; d5 c s sprite word counter / horizontal mask (high word)
; d6 c s row counter
; d7 c p right shift (low word) / 16-shift (high word)
;
; a0 s
; a1 s running pointer to pattern
; a2 c s pointer to pattern definition / pointer to blob
; a3 c s new pointer to screen
; a4 s pointer to colour pattern
; a5 c s pointer to blob pointers / pointer to pattern mask
; a6 c p address increment of screen
section driver
xdef bl_drop
xref.s pt.spxlw
bl_drop
exg a2,a5 get blob and pattern in logical order
addq.l #4,a2 skip null pointer to colour pattern
add.l (a2),a2 set blob address
add.w d0,a2
move.l d5,-(sp) save pointers
addq.l #4,a5 skip pattern form
moveq #0,d4
move.w (a5)+,d4 horizontal repeat
moveq #pt.spxlw,d0
lsr.w d0,d4 in long words
ext.l d2
divu d4,d2 horizontal offset
move.l d2,d5 save offset in msw d5
move.w d4,d2
lsl.l #2,d4 length of line
move.w (a5)+,d0 vertical repeat
addq.l #4,a5 skip zeros
move.l a5,a4
add.l (a5)+,a4 set colour pattern pointer
tst.l (a5) is there a mask?
add.l (a5),a5 (set pattern mask pointer)
beq.l solid no, do solid colour code
ext.l d3 what is here?
add.l d3,d1
divu d0,d1 vertical offset
swap d1 ... is remainder
move.w d1,d5 save offset in lsw d5
mulu d4,d1 offset to first line in pattern
move.w d0,d3
swap d3
move.w d4,d3 d3 Ny (msw) Dy (lsw)
swap d2
moveq #4,d4 ; 4 bytes per long word
mulu d2,d4
move.w d4,d2 d2 Nx (msw) Dx (lsw)
movem.l d2/d3/a4/a5,-(sp) save counters and pattern pointer
add.w d1,a4 offset pointers
add.w d1,a5
move.l a4,a0
move.l a5,a1
swap d2
swap d3
sub.w d5,d3 adjust y counter by offset
swap d5
sub.w d5,d2 and x counter
move.w d2,-(sp)
stk_ox equ 0
stk_nx equ 2
stk_dx equ 4
stk_ny equ 6
stk_dy equ 8
stk_cp equ $a
stk_pm equ $e
stk_d5 equ $12
frame equ $16
bl_line
add.w stk_dx(sp),a0 set start of pattern
add.w stk_dx(sp),a1
move.l stk_d5(sp),d5 set counter
moveq #0,d4 preset mask
long_word
; movep.w 0(a2),d4 set mask - blob
move.b (a2),d4
lsl.w #8,d4
move.b 2(a2),d4
addq.l #4,a2 move pointer on
last_word
ror.l d7,d4
; movep.w 0(a1),d0 and set the composite mask
move.b (a1),d0
lsl.w #8,d0
move.b 2(a1),d0
and.w d0,d4
swap d5 check if this word to be dropped in
lsl.w #1,d5
bcs.s next_word
; movep.w 1(a0),d1 red pattern
move.b 1(a0),d1
lsl.w #8,d1
move.b 3(a0),d1
and.w d4,d1 mask pattern (red first)
; movep.w 1(a3),d0 get current background from screen
move.b 1(a3),d0
lsl.w #8,d0
move.b 3(a3),d0
not.w d4
and.w d4,d0
not.w d4
eor.w d1,d0
; movep.w 0(a0),d1 now green
move.b (a0),d1
lsl.w #8,d1
move.b 2(a0),d1
and.w d4,d1
not.w d4
; movep.w d0,1(a3) replace red
move.b d0,3(a3)
lsr.w #8,d0
move.b d0,1(a3)
; movep.w 0(a3),d0 and get green
move.b (a3),d0
lsl.w #8,d0
move.b 2(a3),d0
and.w d4,d0
eor.w d1,d0
; movep.w d0,0(a3) replace green
move.b d0,2(a3)
lsr.w #8,d0
move.b d0,(a3)
not.w d4
addq.l #4,a3 move screen address on
next_word
addq.l #4,a0 and colour pattern
addq.l #4,a1 and pattern mask
swap d7
lsr.l d7,d4 restore mask for next go
swap d7
subq.w #1,d2 decrement pointer to pattern
bgt.s next_d5
move.w stk_nx(sp),d2 reset horizontal pattern count
move.l a4,a0 and pointers
move.l a5,a1
next_d5
swap d5
subq.w #1,d5 next long word
bgt long_word ... there is another one
blt.s next_line ... all gone
clr.w d4 no more blob definition
bra last_word
next_line
move.w stk_ox(sp),d2 reset x counter
add.w a6,a3 move address to next line
add.w stk_dy(sp),a4 and pattern pointer
add.w stk_dy(sp),a5
subq.w #1,d3
bgt.s next_a1
move.w stk_ny(sp),d3 reset vertical pattern count
move.l stk_cp(sp),a4 and pointers
move.l stk_pm(sp),a5
next_a1
move.l a4,a0
move.l a5,a1
dbra d6,bl_line next line
add.w #frame,sp remove counters
rts
; Come here if there's no mask: the pattern is solid
solid
ext.l d3 what is here?
add.l d3,d1
divu d0,d1 vertical offset
swap d1 ... is remainder
move.w d1,d5 save offset in lsw d5
mulu d4,d1 offset to first line in pattern
move.w d0,d3
swap d3
move.w d4,d3 d3 Ny (msw) Dy (lsw)
swap d2
moveq #4,d4
mulu d2,d4
move.w d4,d2 d2 Nx (msw) Dx (lsw)
movem.l d2/d3/a4/a5,-(sp) save counters and pattern pointer
add.w d1,a4 offset pointers
move.l a4,a0
swap d2
swap d3
sub.w d5,d3 adjust y counter by offset
swap d5
sub.w d5,d2 and x counter
move.w d2,-(sp)
sbl_line
add.w stk_dx(sp),a0 set start of pattern
move.l stk_d5(sp),d5 set counter
moveq #0,d4 preset mask
slong_word
; movep.w 0(a2),d4 set mask - blob
move.b (a2),d4
lsl.w #8,d4
move.b 2(a2),d4
addq.l #4,a2 move pointer on
slast_word
ror.l d7,d4
swap d5 check if this word to be dropped in
lsl.w #1,d5
bcs.s snext_word
; movep.w 1(a0),d1 red pattern
move.b 1(a0),d1
lsl.w #8,d1
move.b 3(a0),d1
and.w d4,d1 mask pattern (red first)
; movep.w 1(a3),d0 get current background from screen
move.b 1(a3),d0
lsl.w #8,d0
move.b 3(a3),d0
not.w d4
and.w d4,d0
not.w d4
eor.w d1,d0
; movep.w 0(a0),d1 now green
move.b (a0),d1
lsl.w #8,d1
move.b 2(a0),d1
and.w d4,d1
not.w d4
; movep.w d0,1(a3) replace red
move.b d0,3(a3)
lsr.w #8,d0
move.b d0,1(a3)
; movep.w 0(a3),d0 and get green
move.b (a3),d0
lsl.w #8,d0
move.b 2(a3),d0
and.w d4,d0
eor.w d1,d0
; movep.w d0,0(a3) replace green
move.b d0,2(a3)
lsr.w #8,d0
move.b d0,(a3)
not.w d4
addq.l #4,a3 move screen address on
snext_word
addq.l #4,a0 and colour pattern
swap d7
lsr.l d7,d4 restore mask for next go
swap d7
subq.w #1,d2 decrement pointer to pattern
bgt.s snext_d5
move.w stk_nx(sp),d2 reset horizontal pattern count
move.l a4,a0 and pointers
snext_d5
swap d5
subq.w #1,d5 next long word
bgt.s slong_word ... there is another one
blt.s snext_line ... all gone
clr.w d4 no more blob definition
bra.s slast_word
snext_line
move.w stk_ox(sp),d2 reset x counter
add.w a6,a3 move address to next line
add.w stk_dy(sp),a4 and pattern pointer
subq.w #1,d3
bgt.s snext_a1
move.w stk_ny(sp),d3 reset vertical pattern count
move.l stk_cp(sp),a4 and pointers
snext_a1
move.l a4,a0
dbra d6,sbl_line next line
add.w #frame,sp remove counters
rts
end
|
product-thms.agda | heades/AUGL | 0 | 9230 | <gh_stars>0
module product-thms where
open import eq
open import level
open import product
open import unit
open import functions
-- this is called the inspect idiom, in the Agda stdlib
keep : ∀{ℓ}{A : Set ℓ} → (x : A) → Σ A (λ y → x ≡ y)
keep x = ( x , refl )
,inj : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'}{a a' : A}{b b' : B} →
(a , b) ≡ (a' , b') → (a ≡ a') ∧ (b ≡ b')
,inj refl = refl , refl
eta-× : ∀{ℓ₁ ℓ₂ ℓ₃}{A : Set ℓ₁}{B : Set ℓ₂}{C : Set ℓ₃}{h : A × B → C}
→ (extensionality {ℓ₁ ⊔ ℓ₂}{ℓ₃})
→ (λ c → h (fst c , snd c)) ≡ h
eta-× {A = A}{B}{C}{h} ext = ext eta-×-aux
where
eta-×-aux : ∀{a : Σ A (λ x → B)} → h (fst a , snd a) ≡ h a
eta-×-aux {(a , b)} = refl
eq-× : ∀{ℓ₁ ℓ₂}{A : Set ℓ₁}{B : Set ℓ₂}{a a' : A}{b b' : B}
→ a ≡ a'
→ b ≡ b'
→ (a , b) ≡ (a' , b')
eq-× refl refl = refl
twist-×-iso : ∀{ℓ : level}{U V : Set ℓ}{a : U × V} → (twist-× ∘ twist-×) a ≡ id a
twist-×-iso {a = u , v} = refl
-- This module proves typical isomorphisms about ∧.
module ∧-Isos where
postulate ext-set : ∀{l1 l2 : level} → extensionality {l1} {l2}
∧-unit-l : ∀{ℓ}{A : Set ℓ} → A → A ∧ (⊤ {ℓ})
∧-unit-l x = x , triv
∧-unit-r : ∀{ℓ}{A : Set ℓ} → A → ⊤ ∧ A
∧-unit-r x = twist-× (∧-unit-l x)
∧-unit-l-iso : ∀{ℓ}{A : Set ℓ} → Iso A (A ∧ ⊤)
∧-unit-l-iso {_}{A} = isIso ∧-unit-l fst refl (ext-set aux)
where
aux : {a : A ∧ ⊤} → (fst a , triv) ≡ a
aux {x , triv} = refl
∧-unit-r-iso : ∀{ℓ}{A : Set ℓ} → Iso A (⊤ ∧ A)
∧-unit-r-iso {_}{A} = isIso ∧-unit-r snd refl (ext-set aux)
where
aux : {a : ⊤ ∧ A} → (triv , snd a) ≡ a
aux {triv , x} = refl
∧-assoc₁ : ∀{ℓ}{A B C : Set ℓ} → (A ∧ (B ∧ C)) → ((A ∧ B) ∧ C)
∧-assoc₁ (a , b , c) = ((a , b) , c)
∧-assoc₂ : ∀{ℓ}{A B C : Set ℓ} → ((A ∧ B) ∧ C) → (A ∧ (B ∧ C))
∧-assoc₂ ((a , b) , c) = (a , b , c)
∧-assoc-iso : ∀{ℓ}{A B C : Set ℓ} → Iso (A ∧ (B ∧ C)) ((A ∧ B) ∧ C)
∧-assoc-iso {_}{A}{B}{C} = isIso ∧-assoc₁ ∧-assoc₂ (ext-set aux₁) (ext-set aux₂)
where
aux₁ : {a : A ∧ (B ∧ C)} → ∧-assoc₂ (∧-assoc₁ a) ≡ a
aux₁ {a , (b , c)} = refl
aux₂ : {a : (A ∧ B) ∧ C} → ∧-assoc₁ (∧-assoc₂ a) ≡ a
aux₂ {(a , b) , c} = refl
|
macOS/FileExtVisible/fileExtensionShow.scpt | shidel/JunkDrawer | 0 | 1537 | #!/usr/bin/osascript
on run argv
tell application "Finder" to set extension hidden of (POSIX file (first item of argv) as alias) to false
end run |
zlib-1.2.8/contrib/vstudio/vc11/x86/TestZlibDebug/Tmp/inflate.asm | evildevil1990/arduinoCameraStream | 4 | 88519 | <reponame>evildevil1990/arduinoCameraStream
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.21005.1
TITLE D:\Development\electronic\project\zlib-1.2.8\inflate.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
CONST SEGMENT
?lenfix@?1??fixedtables@@9@9 DB 060H ; `fixedtables'::`2'::lenfix
DB 07H
DW 00H
DB 00H
DB 08H
DW 050H
DB 00H
DB 08H
DW 010H
DB 014H
DB 08H
DW 073H
DB 012H
DB 07H
DW 01fH
DB 00H
DB 08H
DW 070H
DB 00H
DB 08H
DW 030H
DB 00H
DB 09H
DW 0c0H
DB 010H
DB 07H
DW 0aH
DB 00H
DB 08H
DW 060H
DB 00H
DB 08H
DW 020H
DB 00H
DB 09H
DW 0a0H
DB 00H
DB 08H
DW 00H
DB 00H
DB 08H
DW 080H
DB 00H
DB 08H
DW 040H
DB 00H
DB 09H
DW 0e0H
DB 010H
DB 07H
DW 06H
DB 00H
DB 08H
DW 058H
DB 00H
DB 08H
DW 018H
DB 00H
DB 09H
DW 090H
DB 013H
DB 07H
DW 03bH
DB 00H
DB 08H
DW 078H
DB 00H
DB 08H
DW 038H
DB 00H
DB 09H
DW 0d0H
DB 011H
DB 07H
DW 011H
DB 00H
DB 08H
DW 068H
DB 00H
DB 08H
DW 028H
DB 00H
DB 09H
DW 0b0H
DB 00H
DB 08H
DW 08H
DB 00H
DB 08H
DW 088H
DB 00H
DB 08H
DW 048H
DB 00H
DB 09H
DW 0f0H
DB 010H
DB 07H
DW 04H
DB 00H
DB 08H
DW 054H
DB 00H
DB 08H
DW 014H
DB 015H
DB 08H
DW 0e3H
DB 013H
DB 07H
DW 02bH
DB 00H
DB 08H
DW 074H
DB 00H
DB 08H
DW 034H
DB 00H
DB 09H
DW 0c8H
DB 011H
DB 07H
DW 0dH
DB 00H
DB 08H
DW 064H
DB 00H
DB 08H
DW 024H
DB 00H
DB 09H
DW 0a8H
DB 00H
DB 08H
DW 04H
DB 00H
DB 08H
DW 084H
DB 00H
DB 08H
DW 044H
DB 00H
DB 09H
DW 0e8H
DB 010H
DB 07H
DW 08H
DB 00H
DB 08H
DW 05cH
DB 00H
DB 08H
DW 01cH
DB 00H
DB 09H
DW 098H
DB 014H
DB 07H
DW 053H
DB 00H
DB 08H
DW 07cH
DB 00H
DB 08H
DW 03cH
DB 00H
DB 09H
DW 0d8H
DB 012H
DB 07H
DW 017H
DB 00H
DB 08H
DW 06cH
DB 00H
DB 08H
DW 02cH
DB 00H
DB 09H
DW 0b8H
DB 00H
DB 08H
DW 0cH
DB 00H
DB 08H
DW 08cH
DB 00H
DB 08H
DW 04cH
DB 00H
DB 09H
DW 0f8H
DB 010H
DB 07H
DW 03H
DB 00H
DB 08H
DW 052H
DB 00H
DB 08H
DW 012H
DB 015H
DB 08H
DW 0a3H
DB 013H
DB 07H
DW 023H
DB 00H
DB 08H
DW 072H
DB 00H
DB 08H
DW 032H
DB 00H
DB 09H
DW 0c4H
DB 011H
DB 07H
DW 0bH
DB 00H
DB 08H
DW 062H
DB 00H
DB 08H
DW 022H
DB 00H
DB 09H
DW 0a4H
DB 00H
DB 08H
DW 02H
DB 00H
DB 08H
DW 082H
DB 00H
DB 08H
DW 042H
DB 00H
DB 09H
DW 0e4H
DB 010H
DB 07H
DW 07H
DB 00H
DB 08H
DW 05aH
DB 00H
DB 08H
DW 01aH
DB 00H
DB 09H
DW 094H
DB 014H
DB 07H
DW 043H
DB 00H
DB 08H
DW 07aH
DB 00H
DB 08H
DW 03aH
DB 00H
DB 09H
DW 0d4H
DB 012H
DB 07H
DW 013H
DB 00H
DB 08H
DW 06aH
DB 00H
DB 08H
DW 02aH
DB 00H
DB 09H
DW 0b4H
DB 00H
DB 08H
DW 0aH
DB 00H
DB 08H
DW 08aH
DB 00H
DB 08H
DW 04aH
DB 00H
DB 09H
DW 0f4H
DB 010H
DB 07H
DW 05H
DB 00H
DB 08H
DW 056H
DB 00H
DB 08H
DW 016H
DB 040H
DB 08H
DW 00H
DB 013H
DB 07H
DW 033H
DB 00H
DB 08H
DW 076H
DB 00H
DB 08H
DW 036H
DB 00H
DB 09H
DW 0ccH
DB 011H
DB 07H
DW 0fH
DB 00H
DB 08H
DW 066H
DB 00H
DB 08H
DW 026H
DB 00H
DB 09H
DW 0acH
DB 00H
DB 08H
DW 06H
DB 00H
DB 08H
DW 086H
DB 00H
DB 08H
DW 046H
DB 00H
DB 09H
DW 0ecH
DB 010H
DB 07H
DW 09H
DB 00H
DB 08H
DW 05eH
DB 00H
DB 08H
DW 01eH
DB 00H
DB 09H
DW 09cH
DB 014H
DB 07H
DW 063H
DB 00H
DB 08H
DW 07eH
DB 00H
DB 08H
DW 03eH
DB 00H
DB 09H
DW 0dcH
DB 012H
DB 07H
DW 01bH
DB 00H
DB 08H
DW 06eH
DB 00H
DB 08H
DW 02eH
DB 00H
DB 09H
DW 0bcH
DB 00H
DB 08H
DW 0eH
DB 00H
DB 08H
DW 08eH
DB 00H
DB 08H
DW 04eH
DB 00H
DB 09H
DW 0fcH
DB 060H
DB 07H
DW 00H
DB 00H
DB 08H
DW 051H
DB 00H
DB 08H
DW 011H
DB 015H
DB 08H
DW 083H
DB 012H
DB 07H
DW 01fH
DB 00H
DB 08H
DW 071H
DB 00H
DB 08H
DW 031H
DB 00H
DB 09H
DW 0c2H
DB 010H
DB 07H
DW 0aH
DB 00H
DB 08H
DW 061H
DB 00H
DB 08H
DW 021H
DB 00H
DB 09H
DW 0a2H
DB 00H
DB 08H
DW 01H
DB 00H
DB 08H
DW 081H
DB 00H
DB 08H
DW 041H
DB 00H
DB 09H
DW 0e2H
DB 010H
DB 07H
DW 06H
DB 00H
DB 08H
DW 059H
DB 00H
DB 08H
DW 019H
DB 00H
DB 09H
DW 092H
DB 013H
DB 07H
DW 03bH
DB 00H
DB 08H
DW 079H
DB 00H
DB 08H
DW 039H
DB 00H
DB 09H
DW 0d2H
DB 011H
DB 07H
DW 011H
DB 00H
DB 08H
DW 069H
DB 00H
DB 08H
DW 029H
DB 00H
DB 09H
DW 0b2H
DB 00H
DB 08H
DW 09H
DB 00H
DB 08H
DW 089H
DB 00H
DB 08H
DW 049H
DB 00H
DB 09H
DW 0f2H
DB 010H
DB 07H
DW 04H
DB 00H
DB 08H
DW 055H
DB 00H
DB 08H
DW 015H
DB 010H
DB 08H
DW 0102H
DB 013H
DB 07H
DW 02bH
DB 00H
DB 08H
DW 075H
DB 00H
DB 08H
DW 035H
DB 00H
DB 09H
DW 0caH
DB 011H
DB 07H
DW 0dH
DB 00H
DB 08H
DW 065H
DB 00H
DB 08H
DW 025H
DB 00H
DB 09H
DW 0aaH
DB 00H
DB 08H
DW 05H
DB 00H
DB 08H
DW 085H
DB 00H
DB 08H
DW 045H
DB 00H
DB 09H
DW 0eaH
DB 010H
DB 07H
DW 08H
DB 00H
DB 08H
DW 05dH
DB 00H
DB 08H
DW 01dH
DB 00H
DB 09H
DW 09aH
DB 014H
DB 07H
DW 053H
DB 00H
DB 08H
DW 07dH
DB 00H
DB 08H
DW 03dH
DB 00H
DB 09H
DW 0daH
DB 012H
DB 07H
DW 017H
DB 00H
DB 08H
DW 06dH
DB 00H
DB 08H
DW 02dH
DB 00H
DB 09H
DW 0baH
DB 00H
DB 08H
DW 0dH
DB 00H
DB 08H
DW 08dH
DB 00H
DB 08H
DW 04dH
DB 00H
DB 09H
DW 0faH
DB 010H
DB 07H
DW 03H
DB 00H
DB 08H
DW 053H
DB 00H
DB 08H
DW 013H
DB 015H
DB 08H
DW 0c3H
DB 013H
DB 07H
DW 023H
DB 00H
DB 08H
DW 073H
DB 00H
DB 08H
DW 033H
DB 00H
DB 09H
DW 0c6H
DB 011H
DB 07H
DW 0bH
DB 00H
DB 08H
DW 063H
DB 00H
DB 08H
DW 023H
DB 00H
DB 09H
DW 0a6H
DB 00H
DB 08H
DW 03H
DB 00H
DB 08H
DW 083H
DB 00H
DB 08H
DW 043H
DB 00H
DB 09H
DW 0e6H
DB 010H
DB 07H
DW 07H
DB 00H
DB 08H
DW 05bH
DB 00H
DB 08H
DW 01bH
DB 00H
DB 09H
DW 096H
DB 014H
DB 07H
DW 043H
DB 00H
DB 08H
DW 07bH
DB 00H
DB 08H
DW 03bH
DB 00H
DB 09H
DW 0d6H
DB 012H
DB 07H
DW 013H
DB 00H
DB 08H
DW 06bH
DB 00H
DB 08H
DW 02bH
DB 00H
DB 09H
DW 0b6H
DB 00H
DB 08H
DW 0bH
DB 00H
DB 08H
DW 08bH
DB 00H
DB 08H
DW 04bH
DB 00H
DB 09H
DW 0f6H
DB 010H
DB 07H
DW 05H
DB 00H
DB 08H
DW 057H
DB 00H
DB 08H
DW 017H
DB 040H
DB 08H
DW 00H
DB 013H
DB 07H
DW 033H
DB 00H
DB 08H
DW 077H
DB 00H
DB 08H
DW 037H
DB 00H
DB 09H
DW 0ceH
DB 011H
DB 07H
DW 0fH
DB 00H
DB 08H
DW 067H
DB 00H
DB 08H
DW 027H
DB 00H
DB 09H
DW 0aeH
DB 00H
DB 08H
DW 07H
DB 00H
DB 08H
DW 087H
DB 00H
DB 08H
DW 047H
DB 00H
DB 09H
DW 0eeH
DB 010H
DB 07H
DW 09H
DB 00H
DB 08H
DW 05fH
DB 00H
DB 08H
DW 01fH
DB 00H
DB 09H
DW 09eH
DB 014H
DB 07H
DW 063H
DB 00H
DB 08H
DW 07fH
DB 00H
DB 08H
DW 03fH
DB 00H
DB 09H
DW 0deH
DB 012H
DB 07H
DW 01bH
DB 00H
DB 08H
DW 06fH
DB 00H
DB 08H
DW 02fH
DB 00H
DB 09H
DW 0beH
DB 00H
DB 08H
DW 0fH
DB 00H
DB 08H
DW 08fH
DB 00H
DB 08H
DW 04fH
DB 00H
DB 09H
DW 0feH
DB 060H
DB 07H
DW 00H
DB 00H
DB 08H
DW 050H
DB 00H
DB 08H
DW 010H
DB 014H
DB 08H
DW 073H
DB 012H
DB 07H
DW 01fH
DB 00H
DB 08H
DW 070H
DB 00H
DB 08H
DW 030H
DB 00H
DB 09H
DW 0c1H
DB 010H
DB 07H
DW 0aH
DB 00H
DB 08H
DW 060H
DB 00H
DB 08H
DW 020H
DB 00H
DB 09H
DW 0a1H
DB 00H
DB 08H
DW 00H
DB 00H
DB 08H
DW 080H
DB 00H
DB 08H
DW 040H
DB 00H
DB 09H
DW 0e1H
DB 010H
DB 07H
DW 06H
DB 00H
DB 08H
DW 058H
DB 00H
DB 08H
DW 018H
DB 00H
DB 09H
DW 091H
DB 013H
DB 07H
DW 03bH
DB 00H
DB 08H
DW 078H
DB 00H
DB 08H
DW 038H
DB 00H
DB 09H
DW 0d1H
DB 011H
DB 07H
DW 011H
DB 00H
DB 08H
DW 068H
DB 00H
DB 08H
DW 028H
DB 00H
DB 09H
DW 0b1H
DB 00H
DB 08H
DW 08H
DB 00H
DB 08H
DW 088H
DB 00H
DB 08H
DW 048H
DB 00H
DB 09H
DW 0f1H
DB 010H
DB 07H
DW 04H
DB 00H
DB 08H
DW 054H
DB 00H
DB 08H
DW 014H
DB 015H
DB 08H
DW 0e3H
DB 013H
DB 07H
DW 02bH
DB 00H
DB 08H
DW 074H
DB 00H
DB 08H
DW 034H
DB 00H
DB 09H
DW 0c9H
DB 011H
DB 07H
DW 0dH
DB 00H
DB 08H
DW 064H
DB 00H
DB 08H
DW 024H
DB 00H
DB 09H
DW 0a9H
DB 00H
DB 08H
DW 04H
DB 00H
DB 08H
DW 084H
DB 00H
DB 08H
DW 044H
DB 00H
DB 09H
DW 0e9H
DB 010H
DB 07H
DW 08H
DB 00H
DB 08H
DW 05cH
DB 00H
DB 08H
DW 01cH
DB 00H
DB 09H
DW 099H
DB 014H
DB 07H
DW 053H
DB 00H
DB 08H
DW 07cH
DB 00H
DB 08H
DW 03cH
DB 00H
DB 09H
DW 0d9H
DB 012H
DB 07H
DW 017H
DB 00H
DB 08H
DW 06cH
DB 00H
DB 08H
DW 02cH
DB 00H
DB 09H
DW 0b9H
DB 00H
DB 08H
DW 0cH
DB 00H
DB 08H
DW 08cH
DB 00H
DB 08H
DW 04cH
DB 00H
DB 09H
DW 0f9H
DB 010H
DB 07H
DW 03H
DB 00H
DB 08H
DW 052H
DB 00H
DB 08H
DW 012H
DB 015H
DB 08H
DW 0a3H
DB 013H
DB 07H
DW 023H
DB 00H
DB 08H
DW 072H
DB 00H
DB 08H
DW 032H
DB 00H
DB 09H
DW 0c5H
DB 011H
DB 07H
DW 0bH
DB 00H
DB 08H
DW 062H
DB 00H
DB 08H
DW 022H
DB 00H
DB 09H
DW 0a5H
DB 00H
DB 08H
DW 02H
DB 00H
DB 08H
DW 082H
DB 00H
DB 08H
DW 042H
DB 00H
DB 09H
DW 0e5H
DB 010H
DB 07H
DW 07H
DB 00H
DB 08H
DW 05aH
DB 00H
DB 08H
DW 01aH
DB 00H
DB 09H
DW 095H
DB 014H
DB 07H
DW 043H
DB 00H
DB 08H
DW 07aH
DB 00H
DB 08H
DW 03aH
DB 00H
DB 09H
DW 0d5H
DB 012H
DB 07H
DW 013H
DB 00H
DB 08H
DW 06aH
DB 00H
DB 08H
DW 02aH
DB 00H
DB 09H
DW 0b5H
DB 00H
DB 08H
DW 0aH
DB 00H
DB 08H
DW 08aH
DB 00H
DB 08H
DW 04aH
DB 00H
DB 09H
DW 0f5H
DB 010H
DB 07H
DW 05H
DB 00H
DB 08H
DW 056H
DB 00H
DB 08H
DW 016H
DB 040H
DB 08H
DW 00H
DB 013H
DB 07H
DW 033H
DB 00H
DB 08H
DW 076H
DB 00H
DB 08H
DW 036H
DB 00H
DB 09H
DW 0cdH
DB 011H
DB 07H
DW 0fH
DB 00H
DB 08H
DW 066H
DB 00H
DB 08H
DW 026H
DB 00H
DB 09H
DW 0adH
DB 00H
DB 08H
DW 06H
DB 00H
DB 08H
DW 086H
DB 00H
DB 08H
DW 046H
DB 00H
DB 09H
DW 0edH
DB 010H
DB 07H
DW 09H
DB 00H
DB 08H
DW 05eH
DB 00H
DB 08H
DW 01eH
DB 00H
DB 09H
DW 09dH
DB 014H
DB 07H
DW 063H
DB 00H
DB 08H
DW 07eH
DB 00H
DB 08H
DW 03eH
DB 00H
DB 09H
DW 0ddH
DB 012H
DB 07H
DW 01bH
DB 00H
DB 08H
DW 06eH
DB 00H
DB 08H
DW 02eH
DB 00H
DB 09H
DW 0bdH
DB 00H
DB 08H
DW 0eH
DB 00H
DB 08H
DW 08eH
DB 00H
DB 08H
DW 04eH
DB 00H
DB 09H
DW 0fdH
DB 060H
DB 07H
DW 00H
DB 00H
DB 08H
DW 051H
DB 00H
DB 08H
DW 011H
DB 015H
DB 08H
DW 083H
DB 012H
DB 07H
DW 01fH
DB 00H
DB 08H
DW 071H
DB 00H
DB 08H
DW 031H
DB 00H
DB 09H
DW 0c3H
DB 010H
DB 07H
DW 0aH
DB 00H
DB 08H
DW 061H
DB 00H
DB 08H
DW 021H
DB 00H
DB 09H
DW 0a3H
DB 00H
DB 08H
DW 01H
DB 00H
DB 08H
DW 081H
DB 00H
DB 08H
DW 041H
DB 00H
DB 09H
DW 0e3H
DB 010H
DB 07H
DW 06H
DB 00H
DB 08H
DW 059H
DB 00H
DB 08H
DW 019H
DB 00H
DB 09H
DW 093H
DB 013H
DB 07H
DW 03bH
DB 00H
DB 08H
DW 079H
DB 00H
DB 08H
DW 039H
DB 00H
DB 09H
DW 0d3H
DB 011H
DB 07H
DW 011H
DB 00H
DB 08H
DW 069H
DB 00H
DB 08H
DW 029H
DB 00H
DB 09H
DW 0b3H
DB 00H
DB 08H
DW 09H
DB 00H
DB 08H
DW 089H
DB 00H
DB 08H
DW 049H
DB 00H
DB 09H
DW 0f3H
DB 010H
DB 07H
DW 04H
DB 00H
DB 08H
DW 055H
DB 00H
DB 08H
DW 015H
DB 010H
DB 08H
DW 0102H
DB 013H
DB 07H
DW 02bH
DB 00H
DB 08H
DW 075H
DB 00H
DB 08H
DW 035H
DB 00H
DB 09H
DW 0cbH
DB 011H
DB 07H
DW 0dH
DB 00H
DB 08H
DW 065H
DB 00H
DB 08H
DW 025H
DB 00H
DB 09H
DW 0abH
DB 00H
DB 08H
DW 05H
DB 00H
DB 08H
DW 085H
DB 00H
DB 08H
DW 045H
DB 00H
DB 09H
DW 0ebH
DB 010H
DB 07H
DW 08H
DB 00H
DB 08H
DW 05dH
DB 00H
DB 08H
DW 01dH
DB 00H
DB 09H
DW 09bH
DB 014H
DB 07H
DW 053H
DB 00H
DB 08H
DW 07dH
DB 00H
DB 08H
DW 03dH
DB 00H
DB 09H
DW 0dbH
DB 012H
DB 07H
DW 017H
DB 00H
DB 08H
DW 06dH
DB 00H
DB 08H
DW 02dH
DB 00H
DB 09H
DW 0bbH
DB 00H
DB 08H
DW 0dH
DB 00H
DB 08H
DW 08dH
DB 00H
DB 08H
DW 04dH
DB 00H
DB 09H
DW 0fbH
DB 010H
DB 07H
DW 03H
DB 00H
DB 08H
DW 053H
DB 00H
DB 08H
DW 013H
DB 015H
DB 08H
DW 0c3H
DB 013H
DB 07H
DW 023H
DB 00H
DB 08H
DW 073H
DB 00H
DB 08H
DW 033H
DB 00H
DB 09H
DW 0c7H
DB 011H
DB 07H
DW 0bH
DB 00H
DB 08H
DW 063H
DB 00H
DB 08H
DW 023H
DB 00H
DB 09H
DW 0a7H
DB 00H
DB 08H
DW 03H
DB 00H
DB 08H
DW 083H
DB 00H
DB 08H
DW 043H
DB 00H
DB 09H
DW 0e7H
DB 010H
DB 07H
DW 07H
DB 00H
DB 08H
DW 05bH
DB 00H
DB 08H
DW 01bH
DB 00H
DB 09H
DW 097H
DB 014H
DB 07H
DW 043H
DB 00H
DB 08H
DW 07bH
DB 00H
DB 08H
DW 03bH
DB 00H
DB 09H
DW 0d7H
DB 012H
DB 07H
DW 013H
DB 00H
DB 08H
DW 06bH
DB 00H
DB 08H
DW 02bH
DB 00H
DB 09H
DW 0b7H
DB 00H
DB 08H
DW 0bH
DB 00H
DB 08H
DW 08bH
DB 00H
DB 08H
DW 04bH
DB 00H
DB 09H
DW 0f7H
DB 010H
DB 07H
DW 05H
DB 00H
DB 08H
DW 057H
DB 00H
DB 08H
DW 017H
DB 040H
DB 08H
DW 00H
DB 013H
DB 07H
DW 033H
DB 00H
DB 08H
DW 077H
DB 00H
DB 08H
DW 037H
DB 00H
DB 09H
DW 0cfH
DB 011H
DB 07H
DW 0fH
DB 00H
DB 08H
DW 067H
DB 00H
DB 08H
DW 027H
DB 00H
DB 09H
DW 0afH
DB 00H
DB 08H
DW 07H
DB 00H
DB 08H
DW 087H
DB 00H
DB 08H
DW 047H
DB 00H
DB 09H
DW 0efH
DB 010H
DB 07H
DW 09H
DB 00H
DB 08H
DW 05fH
DB 00H
DB 08H
DW 01fH
DB 00H
DB 09H
DW 09fH
DB 014H
DB 07H
DW 063H
DB 00H
DB 08H
DW 07fH
DB 00H
DB 08H
DW 03fH
DB 00H
DB 09H
DW 0dfH
DB 012H
DB 07H
DW 01bH
DB 00H
DB 08H
DW 06fH
DB 00H
DB 08H
DW 02fH
DB 00H
DB 09H
DW 0bfH
DB 00H
DB 08H
DW 0fH
DB 00H
DB 08H
DW 08fH
DB 00H
DB 08H
DW 04fH
DB 00H
DB 09H
DW 0ffH
?distfix@?1??fixedtables@@9@9 DB 010H ; `fixedtables'::`2'::distfix
DB 05H
DW 01H
DB 017H
DB 05H
DW 0101H
DB 013H
DB 05H
DW 011H
DB 01bH
DB 05H
DW 01001H
DB 011H
DB 05H
DW 05H
DB 019H
DB 05H
DW 0401H
DB 015H
DB 05H
DW 041H
DB 01dH
DB 05H
DW 04001H
DB 010H
DB 05H
DW 03H
DB 018H
DB 05H
DW 0201H
DB 014H
DB 05H
DW 021H
DB 01cH
DB 05H
DW 02001H
DB 012H
DB 05H
DW 09H
DB 01aH
DB 05H
DW 0801H
DB 016H
DB 05H
DW 081H
DB 040H
DB 05H
DW 00H
DB 010H
DB 05H
DW 02H
DB 017H
DB 05H
DW 0181H
DB 013H
DB 05H
DW 019H
DB 01bH
DB 05H
DW 01801H
DB 011H
DB 05H
DW 07H
DB 019H
DB 05H
DW 0601H
DB 015H
DB 05H
DW 061H
DB 01dH
DB 05H
DW 06001H
DB 010H
DB 05H
DW 04H
DB 018H
DB 05H
DW 0301H
DB 014H
DB 05H
DW 031H
DB 01cH
DB 05H
DW 03001H
DB 012H
DB 05H
DW 0dH
DB 01aH
DB 05H
DW 0c01H
DB 016H
DB 05H
DW 0c1H
DB 040H
DB 05H
DW 00H
?order@?1??inflate@@9@9 DW 010H ; `inflate'::`2'::order
DW 011H
DW 012H
DW 00H
DW 08H
DW 07H
DW 09H
DW 06H
DW 0aH
DW 05H
DW 0bH
DW 04H
DW 0cH
DW 03H
DW 0dH
DW 02H
DW 0eH
DW 01H
DW 0fH
CONST ENDS
_DATA SEGMENT
$SG86033 DB 'invalid bit length repeat', 00H
ORG $+2
$SG86086 DB 'invalid bit length repeat', 00H
ORG $+2
$SG86094 DB 'invalid code -- missing end-of-block', 00H
ORG $+3
$SG86098 DB 'invalid literal/lengths set', 00H
$SG86102 DB 'invalid distances set', 00H
ORG $+2
$SG86151 DB 'invalid literal/length code', 00H
$SG86206 DB 'invalid distance code', 00H
ORG $+2
$SG86234 DB 'invalid distance too far back', 00H
ORG $+2
$SG86264 DB 'incorrect data check', 00H
ORG $+3
$SG86284 DB 'incorrect length check', 00H
ORG $+1
$SG85531 DB '1.2.8', 00H
ORG $+2
$SG85654 DB 'incorrect header check', 00H
ORG $+1
$SG85658 DB 'unknown compression method', 00H
ORG $+1
$SG85668 DB 'invalid window size', 00H
$SG85688 DB 'unknown compression method', 00H
ORG $+1
$SG85691 DB 'unknown header flags set', 00H
ORG $+3
$SG85830 DB 'header crc mismatch', 00H
$SG85897 DB 'invalid block type', 00H
ORG $+1
$SG85920 DB 'invalid stored block lengths', 00H
ORG $+3
$SG85963 DB 'too many length or distance symbols', 00H
$SG85992 DB 'invalid code lengths set', 00H
_DATA ENDS
PUBLIC _inflate@8
PUBLIC _inflateEnd@4
PUBLIC _inflateSetDictionary@12
PUBLIC _inflateGetDictionary@12
PUBLIC _inflateSync@4
PUBLIC _inflateCopy@8
PUBLIC _inflateReset@4
PUBLIC _inflateReset2@8
PUBLIC _inflatePrime@12
PUBLIC _inflateMark@4
PUBLIC _inflateGetHeader@8
PUBLIC _inflateInit_@12
PUBLIC _inflateInit2_@16
PUBLIC _inflateSyncPoint@4
PUBLIC _inflateUndermine@8
PUBLIC _inflateResetKeep@4
EXTRN _memcpy:PROC
EXTRN _adler32@12:PROC
EXTRN _crc32@12:PROC
EXTRN _zcalloc:PROC
EXTRN _zcfree:PROC
EXTRN _inflate_table:PROC
EXTRN _inflate_fast:PROC
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
tv70 = -12 ; size = 4
_next$ = -8 ; size = 4
_got$ = -4 ; size = 4
_have$ = 8 ; size = 4
_buf$ = 12 ; size = 4
_len$ = 16 ; size = 4
_syncsearch PROC
; 1358 : {
push ebp
mov ebp, esp
sub esp, 12 ; 0000000cH
; 1359 : unsigned got;
; 1360 : unsigned next;
; 1361 :
; 1362 : got = *have;
mov eax, DWORD PTR _have$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR _got$[ebp], ecx
; 1363 : next = 0;
mov DWORD PTR _next$[ebp], 0
$LN6@syncsearch:
; 1364 : while (next < len && got < 4) {
mov edx, DWORD PTR _next$[ebp]
cmp edx, DWORD PTR _len$[ebp]
jae SHORT $LN5@syncsearch
cmp DWORD PTR _got$[ebp], 4
jae SHORT $LN5@syncsearch
; 1365 : if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
cmp DWORD PTR _got$[ebp], 2
jae SHORT $LN9@syncsearch
mov DWORD PTR tv70[ebp], 0
jmp SHORT $LN10@syncsearch
$LN9@syncsearch:
mov DWORD PTR tv70[ebp], 255 ; 000000ffH
$LN10@syncsearch:
mov eax, DWORD PTR _buf$[ebp]
add eax, DWORD PTR _next$[ebp]
movzx ecx, BYTE PTR [eax]
cmp ecx, DWORD PTR tv70[ebp]
jne SHORT $LN4@syncsearch
; 1366 : got++;
mov edx, DWORD PTR _got$[ebp]
add edx, 1
mov DWORD PTR _got$[ebp], edx
jmp SHORT $LN3@syncsearch
$LN4@syncsearch:
; 1367 : else if (buf[next])
mov eax, DWORD PTR _buf$[ebp]
add eax, DWORD PTR _next$[ebp]
movzx ecx, BYTE PTR [eax]
test ecx, ecx
je SHORT $LN2@syncsearch
; 1368 : got = 0;
mov DWORD PTR _got$[ebp], 0
; 1369 : else
jmp SHORT $LN3@syncsearch
$LN2@syncsearch:
; 1370 : got = 4 - got;
mov edx, 4
sub edx, DWORD PTR _got$[ebp]
mov DWORD PTR _got$[ebp], edx
$LN3@syncsearch:
; 1371 : next++;
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
; 1372 : }
jmp SHORT $LN6@syncsearch
$LN5@syncsearch:
; 1373 : *have = got;
mov ecx, DWORD PTR _have$[ebp]
mov edx, DWORD PTR _got$[ebp]
mov DWORD PTR [ecx], edx
; 1374 : return next;
mov eax, DWORD PTR _next$[ebp]
; 1375 : }
mov esp, ebp
pop ebp
ret 0
_syncsearch ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_dist$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_end$ = 12 ; size = 4
_copy$ = 16 ; size = 4
_updatewindow PROC
; 383 : {
push ebp
mov ebp, esp
sub esp, 8
; 384 : struct inflate_state FAR *state;
; 385 : unsigned dist;
; 386 :
; 387 : state = (struct inflate_state FAR *)strm->state;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+28]
mov DWORD PTR _state$[ebp], ecx
; 388 :
; 389 : /* if it hasn't been done already, allocate space for the window */
; 390 : if (state->window == Z_NULL) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+52], 0
jne SHORT $LN10@updatewind
; 391 : state->window = (unsigned char FAR *)
; 392 : ZALLOC(strm, 1U << state->wbits,
; 393 : sizeof(unsigned char));
push 1
mov eax, DWORD PTR _state$[ebp]
mov edx, 1
mov ecx, DWORD PTR [eax+36]
shl edx, cl
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+40]
push ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+32]
call eax
add esp, 12 ; 0000000cH
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+52], eax
; 394 : if (state->window == Z_NULL) return 1;
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+52], 0
jne SHORT $LN10@updatewind
mov eax, 1
jmp $LN11@updatewind
$LN10@updatewind:
; 395 : }
; 396 :
; 397 : /* if window not in use yet, initialize */
; 398 : if (state->wsize == 0) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+40], 0
jne SHORT $LN8@updatewind
; 399 : state->wsize = 1U << state->wbits;
mov ecx, DWORD PTR _state$[ebp]
mov edx, 1
mov ecx, DWORD PTR [ecx+36]
shl edx, cl
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+40], edx
; 400 : state->wnext = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+48], 0
; 401 : state->whave = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+44], 0
$LN8@updatewind:
; 402 : }
; 403 :
; 404 : /* copy state->wsize or less output bytes into the circular window */
; 405 : if (copy >= state->wsize) {
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _copy$[ebp]
cmp ecx, DWORD PTR [eax+40]
jb SHORT $LN7@updatewind
; 406 : zmemcpy(state->window, end - state->wsize, state->wsize);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+40]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _end$[ebp]
sub edx, DWORD PTR [ecx+40]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+52]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
; 407 : state->wnext = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+48], 0
; 408 : state->whave = state->wsize;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+40]
mov DWORD PTR [eax+44], edx
; 409 : }
; 410 : else {
jmp $LN6@updatewind
$LN7@updatewind:
; 411 : dist = state->wsize - state->wnext;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [eax+40]
sub edx, DWORD PTR [ecx+48]
mov DWORD PTR _dist$[ebp], edx
; 412 : if (dist > copy) dist = copy;
mov eax, DWORD PTR _dist$[ebp]
cmp eax, DWORD PTR _copy$[ebp]
jbe SHORT $LN5@updatewind
mov ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR _dist$[ebp], ecx
$LN5@updatewind:
; 413 : zmemcpy(state->window + state->wnext, end - copy, dist);
mov edx, DWORD PTR _dist$[ebp]
push edx
mov eax, DWORD PTR _end$[ebp]
sub eax, DWORD PTR _copy$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+52]
mov eax, DWORD PTR _state$[ebp]
add edx, DWORD PTR [eax+48]
push edx
call _memcpy
add esp, 12 ; 0000000cH
; 414 : copy -= dist;
mov ecx, DWORD PTR _copy$[ebp]
sub ecx, DWORD PTR _dist$[ebp]
mov DWORD PTR _copy$[ebp], ecx
; 415 : if (copy) {
je SHORT $LN4@updatewind
; 416 : zmemcpy(state->window, end - copy, copy);
mov edx, DWORD PTR _copy$[ebp]
push edx
mov eax, DWORD PTR _end$[ebp]
sub eax, DWORD PTR _copy$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+52]
push edx
call _memcpy
add esp, 12 ; 0000000cH
; 417 : state->wnext = copy;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR [eax+48], ecx
; 418 : state->whave = state->wsize;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+40]
mov DWORD PTR [edx+44], ecx
; 419 : }
; 420 : else {
jmp SHORT $LN6@updatewind
$LN4@updatewind:
; 421 : state->wnext += dist;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+48]
add eax, DWORD PTR _dist$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+48], eax
; 422 : if (state->wnext == state->wsize) state->wnext = 0;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [edx+48]
cmp ecx, DWORD PTR [eax+40]
jne SHORT $LN2@updatewind
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+48], 0
$LN2@updatewind:
; 423 : if (state->whave < state->wsize) state->whave += dist;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [eax+44]
cmp edx, DWORD PTR [ecx+40]
jae SHORT $LN6@updatewind
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+44]
add ecx, DWORD PTR _dist$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+44], ecx
$LN6@updatewind:
; 424 : }
; 425 : }
; 426 : return 0;
xor eax, eax
$LN11@updatewind:
; 427 : }
mov esp, ebp
pop ebp
ret 0
_updatewindow ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = 8 ; size = 4
_fixedtables PROC
; 263 : {
push ebp
mov ebp, esp
; 264 : #ifdef BUILDFIXED
; 265 : static int virgin = 1;
; 266 : static code *lenfix, *distfix;
; 267 : static code fixed[544];
; 268 :
; 269 : /* build fixed huffman tables if first call (may not be thread safe) */
; 270 : if (virgin) {
; 271 : unsigned sym, bits;
; 272 : static code *next;
; 273 :
; 274 : /* literal/length table */
; 275 : sym = 0;
; 276 : while (sym < 144) state->lens[sym++] = 8;
; 277 : while (sym < 256) state->lens[sym++] = 9;
; 278 : while (sym < 280) state->lens[sym++] = 7;
; 279 : while (sym < 288) state->lens[sym++] = 8;
; 280 : next = fixed;
; 281 : lenfix = next;
; 282 : bits = 9;
; 283 : inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
; 284 :
; 285 : /* distance table */
; 286 : sym = 0;
; 287 : while (sym < 32) state->lens[sym++] = 5;
; 288 : distfix = next;
; 289 : bits = 5;
; 290 : inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
; 291 :
; 292 : /* do this just once */
; 293 : virgin = 0;
; 294 : }
; 295 : #else /* !BUILDFIXED */
; 296 : # include "inffixed.h"
; 297 : #endif /* BUILDFIXED */
; 298 : state->lencode = lenfix;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+76], OFFSET ?lenfix@?1??fixedtables@@9@9
; 299 : state->lenbits = 9;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+84], 9
; 300 : state->distcode = distfix;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+80], OFFSET ?distfix@?1??fixedtables@@9@9
; 301 : state->distbits = 5;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+88], 5
; 302 : }
pop ebp
ret 0
_fixedtables ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
tv87 = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateResetKeep@4 PROC
; 106 : {
push ebp
mov ebp, esp
sub esp, 8
; 107 : struct inflate_state FAR *state;
; 108 :
; 109 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN2@inflateRes
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN3@inflateRes
$LN2@inflateRes:
mov eax, -2 ; fffffffeH
jmp $LN4@inflateRes
$LN3@inflateRes:
; 110 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 111 : strm->total_in = strm->total_out = state->total = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+28], 0
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+20], 0
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+8], 0
; 112 : strm->msg = Z_NULL;
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], 0
; 113 : if (state->wrap) /* to support ill-conceived Java test suite */
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+8], 0
je SHORT $LN1@inflateRes
; 114 : strm->adler = state->wrap & 1;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+8]
and eax, 1
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+48], eax
$LN1@inflateRes:
; 115 : state->mode = HEAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 0
; 116 : state->last = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+4], 0
; 117 : state->havedict = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+12], 0
; 118 : state->dmax = 32768U;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+20], 32768 ; 00008000H
; 119 : state->head = Z_NULL;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+32], 0
; 120 : state->hold = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+56], 0
; 121 : state->bits = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+60], 0
; 122 : state->lencode = state->distcode = state->next = state->codes;
mov eax, DWORD PTR _state$[ebp]
add eax, 1328 ; 00000530H
mov DWORD PTR tv87[ebp], eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR tv87[ebp]
mov DWORD PTR [ecx+108], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR tv87[ebp]
mov DWORD PTR [eax+80], ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR tv87[ebp]
mov DWORD PTR [edx+76], eax
; 123 : state->sane = 1;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+7104], 1
; 124 : state->back = -1;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+7108], -1
; 125 : Tracev((stderr, "inflate: reset\n"));
; 126 : return Z_OK;
xor eax, eax
$LN4@inflateRes:
; 127 : }
mov esp, ebp
pop ebp
ret 4
_inflateResetKeep@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -8 ; size = 4
tv70 = -4 ; size = 4
_strm$ = 8 ; size = 4
_subvert$ = 12 ; size = 4
_inflateUndermine@8 PROC
; 1488 : {
push ebp
mov ebp, esp
sub esp, 8
; 1489 : struct inflate_state FAR *state;
; 1490 :
; 1491 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN1@inflateUnd
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN2@inflateUnd
$LN1@inflateUnd:
mov eax, -2 ; fffffffeH
jmp SHORT $LN3@inflateUnd
$LN2@inflateUnd:
; 1492 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1493 : state->sane = !subvert;
cmp DWORD PTR _subvert$[ebp], 0
jne SHORT $LN5@inflateUnd
mov DWORD PTR tv70[ebp], 1
jmp SHORT $LN6@inflateUnd
$LN5@inflateUnd:
mov DWORD PTR tv70[ebp], 0
$LN6@inflateUnd:
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR tv70[ebp]
mov DWORD PTR [eax+7104], ecx
; 1494 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
; 1495 : return Z_OK;
; 1496 : #else
; 1497 : state->sane = 1;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+7104], 1
; 1498 : return Z_DATA_ERROR;
mov eax, -3 ; fffffffdH
$LN3@inflateUnd:
; 1499 : #endif
; 1500 : }
mov esp, ebp
pop ebp
ret 8
_inflateUndermine@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
tv72 = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateSyncPoint@4 PROC
; 1430 : {
push ebp
mov ebp, esp
sub esp, 8
; 1431 : struct inflate_state FAR *state;
; 1432 :
; 1433 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN1@inflateSyn
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN2@inflateSyn
$LN1@inflateSyn:
mov eax, -2 ; fffffffeH
jmp SHORT $LN3@inflateSyn
$LN2@inflateSyn:
; 1434 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1435 : return state->mode == STORED && state->bits == 0;
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 13 ; 0000000dH
jne SHORT $LN5@inflateSyn
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+60], 0
jne SHORT $LN5@inflateSyn
mov DWORD PTR tv72[ebp], 1
jmp SHORT $LN6@inflateSyn
$LN5@inflateSyn:
mov DWORD PTR tv72[ebp], 0
$LN6@inflateSyn:
mov eax, DWORD PTR tv72[ebp]
$LN3@inflateSyn:
; 1436 : }
mov esp, ebp
pop ebp
ret 4
_inflateSyncPoint@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_ret$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_windowBits$ = 12 ; size = 4
_version$ = 16 ; size = 4
_stream_size$ = 20 ; size = 4
_inflateInit2_@16 PROC
; 185 : {
push ebp
mov ebp, esp
sub esp, 8
; 186 : int ret;
; 187 : struct inflate_state FAR *state;
; 188 :
; 189 : if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
; 190 : stream_size != (int)(sizeof(z_stream)))
cmp DWORD PTR _version$[ebp], 0
je SHORT $LN6@inflateIni
mov eax, 1
imul ecx, eax, 0
mov edx, DWORD PTR _version$[ebp]
movsx eax, BYTE PTR [edx+ecx]
mov ecx, 1
imul edx, ecx, 0
movsx ecx, BYTE PTR $SG85531[edx]
cmp eax, ecx
jne SHORT $LN6@inflateIni
cmp DWORD PTR _stream_size$[ebp], 56 ; 00000038H
je SHORT $LN7@inflateIni
$LN6@inflateIni:
; 191 : return Z_VERSION_ERROR;
mov eax, -6 ; fffffffaH
jmp $LN8@inflateIni
$LN7@inflateIni:
; 192 : if (strm == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
jne SHORT $LN5@inflateIni
mov eax, -2 ; fffffffeH
jmp $LN8@inflateIni
$LN5@inflateIni:
; 193 : strm->msg = Z_NULL; /* in case we return an error */
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], 0
; 194 : if (strm->zalloc == (alloc_func)0) {
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+32], 0
jne SHORT $LN4@inflateIni
; 195 : #ifdef Z_SOLO
; 196 : return Z_STREAM_ERROR;
; 197 : #else
; 198 : strm->zalloc = zcalloc;
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+32], OFFSET _zcalloc
; 199 : strm->opaque = (voidpf)0;
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+40], 0
$LN4@inflateIni:
; 200 : #endif
; 201 : }
; 202 : if (strm->zfree == (free_func)0)
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+36], 0
jne SHORT $LN3@inflateIni
; 203 : #ifdef Z_SOLO
; 204 : return Z_STREAM_ERROR;
; 205 : #else
; 206 : strm->zfree = zcfree;
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+36], OFFSET _zcfree
$LN3@inflateIni:
; 207 : #endif
; 208 : state = (struct inflate_state FAR *)
; 209 : ZALLOC(strm, 1, sizeof(struct inflate_state));
push 7116 ; 00001bccH
push 1
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+40]
push eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+32]
call edx
add esp, 12 ; 0000000cH
mov DWORD PTR _state$[ebp], eax
; 210 : if (state == Z_NULL) return Z_MEM_ERROR;
cmp DWORD PTR _state$[ebp], 0
jne SHORT $LN2@inflateIni
mov eax, -4 ; fffffffcH
jmp SHORT $LN8@inflateIni
$LN2@inflateIni:
; 211 : Tracev((stderr, "inflate: allocated\n"));
; 212 : strm->state = (struct internal_state FAR *)state;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+28], ecx
; 213 : state->window = Z_NULL;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+52], 0
; 214 : ret = inflateReset2(strm, windowBits);
mov eax, DWORD PTR _windowBits$[ebp]
push eax
mov ecx, DWORD PTR _strm$[ebp]
push ecx
call _inflateReset2@8
mov DWORD PTR _ret$[ebp], eax
; 215 : if (ret != Z_OK) {
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN1@inflateIni
; 216 : ZFREE(strm, state);
mov edx, DWORD PTR _state$[ebp]
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+40]
push ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+36]
call eax
add esp, 8
; 217 : strm->state = Z_NULL;
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+28], 0
$LN1@inflateIni:
; 218 : }
; 219 : return ret;
mov eax, DWORD PTR _ret$[ebp]
$LN8@inflateIni:
; 220 : }
mov esp, ebp
pop ebp
ret 16 ; 00000010H
_inflateInit2_@16 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_strm$ = 8 ; size = 4
_version$ = 12 ; size = 4
_stream_size$ = 16 ; size = 4
_inflateInit_@12 PROC
; 226 : {
push ebp
mov ebp, esp
; 227 : return inflateInit2_(strm, DEF_WBITS, version, stream_size);
mov eax, DWORD PTR _stream_size$[ebp]
push eax
mov ecx, DWORD PTR _version$[ebp]
push ecx
push 15 ; 0000000fH
mov edx, DWORD PTR _strm$[ebp]
push edx
call _inflateInit2_@16
; 228 : }
pop ebp
ret 12 ; 0000000cH
_inflateInit_@12 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_head$ = 12 ; size = 4
_inflateGetHeader@8 PROC
; 1329 : {
push ebp
mov ebp, esp
push ecx
; 1330 : struct inflate_state FAR *state;
; 1331 :
; 1332 : /* check state */
; 1333 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN2@inflateGet
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN3@inflateGet
$LN2@inflateGet:
mov eax, -2 ; fffffffeH
jmp SHORT $LN4@inflateGet
$LN3@inflateGet:
; 1334 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1335 : if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+8]
and ecx, 2
jne SHORT $LN1@inflateGet
mov eax, -2 ; fffffffeH
jmp SHORT $LN4@inflateGet
$LN1@inflateGet:
; 1336 :
; 1337 : /* save header structure */
; 1338 : state->head = head;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _head$[ebp]
mov DWORD PTR [edx+32], eax
; 1339 : head->done = 0;
mov ecx, DWORD PTR _head$[ebp]
mov DWORD PTR [ecx+48], 0
; 1340 : return Z_OK;
xor eax, eax
$LN4@inflateGet:
; 1341 : }
mov esp, ebp
pop ebp
ret 8
_inflateGetHeader@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
tv79 = -12 ; size = 4
tv78 = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateMark@4 PROC
; 1504 : {
push ebp
mov ebp, esp
sub esp, 12 ; 0000000cH
; 1505 : struct inflate_state FAR *state;
; 1506 :
; 1507 : if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN1@inflateMar
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN2@inflateMar
$LN1@inflateMar:
mov eax, -65536 ; ffff0000H
jmp SHORT $LN3@inflateMar
$LN2@inflateMar:
; 1508 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1509 : return ((long)(state->back) << 16) +
; 1510 : (state->mode == COPY ? state->length :
; 1511 : (state->mode == MATCH ? state->was - state->length : 0));
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 15 ; 0000000fH
jne SHORT $LN7@inflateMar
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
mov DWORD PTR tv79[ebp], edx
jmp SHORT $LN8@inflateMar
$LN7@inflateMar:
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 24 ; 00000018H
jne SHORT $LN5@inflateMar
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [ecx+7112]
sub eax, DWORD PTR [edx+64]
mov DWORD PTR tv78[ebp], eax
jmp SHORT $LN6@inflateMar
$LN5@inflateMar:
mov DWORD PTR tv78[ebp], 0
$LN6@inflateMar:
mov ecx, DWORD PTR tv78[ebp]
mov DWORD PTR tv79[ebp], ecx
$LN8@inflateMar:
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+7108]
shl eax, 16 ; 00000010H
add eax, DWORD PTR tv79[ebp]
$LN3@inflateMar:
; 1512 : }
mov esp, ebp
pop ebp
ret 4
_inflateMark@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_bits$ = 12 ; size = 4
_value$ = 16 ; size = 4
_inflatePrime@12 PROC
; 234 : {
push ebp
mov ebp, esp
push ecx
; 235 : struct inflate_state FAR *state;
; 236 :
; 237 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN4@inflatePri
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN5@inflatePri
$LN4@inflatePri:
mov eax, -2 ; fffffffeH
jmp SHORT $LN6@inflatePri
$LN5@inflatePri:
; 238 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 239 : if (bits < 0) {
cmp DWORD PTR _bits$[ebp], 0
jge SHORT $LN3@inflatePri
; 240 : state->hold = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+56], 0
; 241 : state->bits = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+60], 0
; 242 : return Z_OK;
xor eax, eax
jmp SHORT $LN6@inflatePri
$LN3@inflatePri:
; 243 : }
; 244 : if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jg SHORT $LN1@inflatePri
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+60]
add eax, DWORD PTR _bits$[ebp]
cmp eax, 32 ; 00000020H
jbe SHORT $LN2@inflatePri
$LN1@inflatePri:
mov eax, -2 ; fffffffeH
jmp SHORT $LN6@inflatePri
$LN2@inflatePri:
; 245 : value &= (1L << bits) - 1;
mov edx, 1
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
sub edx, 1
and edx, DWORD PTR _value$[ebp]
mov DWORD PTR _value$[ebp], edx
; 246 : state->hold += value << state->bits;
mov eax, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _value$[ebp]
mov ecx, DWORD PTR [eax+60]
shl edx, cl
mov eax, DWORD PTR _state$[ebp]
add edx, DWORD PTR [eax+56]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+56], edx
; 247 : state->bits += bits;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+60]
add eax, DWORD PTR _bits$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+60], eax
; 248 : return Z_OK;
xor eax, eax
$LN6@inflatePri:
; 249 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
_inflatePrime@12 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_wrap$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_windowBits$ = 12 ; size = 4
_inflateReset2@8 PROC
; 145 : {
push ebp
mov ebp, esp
sub esp, 8
; 146 : int wrap;
; 147 : struct inflate_state FAR *state;
; 148 :
; 149 : /* get the state */
; 150 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN7@inflateRes
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN8@inflateRes
$LN7@inflateRes:
mov eax, -2 ; fffffffeH
jmp $LN9@inflateRes
$LN8@inflateRes:
; 151 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 152 :
; 153 : /* extract wrap request from windowBits parameter */
; 154 : if (windowBits < 0) {
cmp DWORD PTR _windowBits$[ebp], 0
jge SHORT $LN6@inflateRes
; 155 : wrap = 0;
mov DWORD PTR _wrap$[ebp], 0
; 156 : windowBits = -windowBits;
mov eax, DWORD PTR _windowBits$[ebp]
neg eax
mov DWORD PTR _windowBits$[ebp], eax
; 157 : }
; 158 : else {
jmp SHORT $LN5@inflateRes
$LN6@inflateRes:
; 159 : wrap = (windowBits >> 4) + 1;
mov ecx, DWORD PTR _windowBits$[ebp]
sar ecx, 4
add ecx, 1
mov DWORD PTR _wrap$[ebp], ecx
; 160 : #ifdef GUNZIP
; 161 : if (windowBits < 48)
cmp DWORD PTR _windowBits$[ebp], 48 ; 00000030H
jge SHORT $LN5@inflateRes
; 162 : windowBits &= 15;
mov edx, DWORD PTR _windowBits$[ebp]
and edx, 15 ; 0000000fH
mov DWORD PTR _windowBits$[ebp], edx
$LN5@inflateRes:
; 163 : #endif
; 164 : }
; 165 :
; 166 : /* set number of window bits, free window if different */
; 167 : if (windowBits && (windowBits < 8 || windowBits > 15))
cmp DWORD PTR _windowBits$[ebp], 0
je SHORT $LN3@inflateRes
cmp DWORD PTR _windowBits$[ebp], 8
jl SHORT $LN2@inflateRes
cmp DWORD PTR _windowBits$[ebp], 15 ; 0000000fH
jle SHORT $LN3@inflateRes
$LN2@inflateRes:
; 168 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp SHORT $LN9@inflateRes
$LN3@inflateRes:
; 169 : if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+52], 0
je SHORT $LN1@inflateRes
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+36]
cmp edx, DWORD PTR _windowBits$[ebp]
je SHORT $LN1@inflateRes
; 170 : ZFREE(strm, state->window);
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+52]
push ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+40]
push eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+36]
call edx
add esp, 8
; 171 : state->window = Z_NULL;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+52], 0
$LN1@inflateRes:
; 172 : }
; 173 :
; 174 : /* update state and reset the rest of it */
; 175 : state->wrap = wrap;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _wrap$[ebp]
mov DWORD PTR [ecx+8], edx
; 176 : state->wbits = (unsigned)windowBits;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _windowBits$[ebp]
mov DWORD PTR [eax+36], ecx
; 177 : return inflateReset(strm);
mov edx, DWORD PTR _strm$[ebp]
push edx
call _inflateReset@4
$LN9@inflateRes:
; 178 : }
mov esp, ebp
pop ebp
ret 8
_inflateReset2@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateReset@4 PROC
; 131 : {
push ebp
mov ebp, esp
push ecx
; 132 : struct inflate_state FAR *state;
; 133 :
; 134 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN1@inflateRes
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN2@inflateRes
$LN1@inflateRes:
mov eax, -2 ; fffffffeH
jmp SHORT $LN3@inflateRes
$LN2@inflateRes:
; 135 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 136 : state->wsize = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+40], 0
; 137 : state->whave = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+44], 0
; 138 : state->wnext = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+48], 0
; 139 : return inflateResetKeep(strm);
mov eax, DWORD PTR _strm$[ebp]
push eax
call _inflateResetKeep@4
$LN3@inflateRes:
; 140 : }
mov esp, ebp
pop ebp
ret 4
_inflateReset@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_wsize$ = -16 ; size = 4
_window$ = -12 ; size = 4
_copy$ = -8 ; size = 4
_state$ = -4 ; size = 4
_dest$ = 8 ; size = 4
_source$ = 12 ; size = 4
_inflateCopy@8 PROC
; 1441 : {
push ebp
mov ebp, esp
sub esp, 16 ; 00000010H
; 1442 : struct inflate_state FAR *state;
; 1443 : struct inflate_state FAR *copy;
; 1444 : unsigned char FAR *window;
; 1445 : unsigned wsize;
; 1446 :
; 1447 : /* check input */
; 1448 : if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
; 1449 : source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
cmp DWORD PTR _dest$[ebp], 0
je SHORT $LN6@inflateCop
cmp DWORD PTR _source$[ebp], 0
je SHORT $LN6@inflateCop
mov eax, DWORD PTR _source$[ebp]
cmp DWORD PTR [eax+28], 0
je SHORT $LN6@inflateCop
mov ecx, DWORD PTR _source$[ebp]
cmp DWORD PTR [ecx+32], 0
je SHORT $LN6@inflateCop
mov edx, DWORD PTR _source$[ebp]
cmp DWORD PTR [edx+36], 0
jne SHORT $LN7@inflateCop
$LN6@inflateCop:
; 1450 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp $LN8@inflateCop
$LN7@inflateCop:
; 1451 : state = (struct inflate_state FAR *)source->state;
mov eax, DWORD PTR _source$[ebp]
mov ecx, DWORD PTR [eax+28]
mov DWORD PTR _state$[ebp], ecx
; 1452 :
; 1453 : /* allocate space */
; 1454 : copy = (struct inflate_state FAR *)
; 1455 : ZALLOC(source, 1, sizeof(struct inflate_state));
push 7116 ; 00001bccH
push 1
mov edx, DWORD PTR _source$[ebp]
mov eax, DWORD PTR [edx+40]
push eax
mov ecx, DWORD PTR _source$[ebp]
mov edx, DWORD PTR [ecx+32]
call edx
add esp, 12 ; 0000000cH
mov DWORD PTR _copy$[ebp], eax
; 1456 : if (copy == Z_NULL) return Z_MEM_ERROR;
cmp DWORD PTR _copy$[ebp], 0
jne SHORT $LN5@inflateCop
mov eax, -4 ; fffffffcH
jmp $LN8@inflateCop
$LN5@inflateCop:
; 1457 : window = Z_NULL;
mov DWORD PTR _window$[ebp], 0
; 1458 : if (state->window != Z_NULL) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+52], 0
je SHORT $LN4@inflateCop
; 1459 : window = (unsigned char FAR *)
; 1460 : ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
push 1
mov ecx, DWORD PTR _state$[ebp]
mov edx, 1
mov ecx, DWORD PTR [ecx+36]
shl edx, cl
push edx
mov eax, DWORD PTR _source$[ebp]
mov ecx, DWORD PTR [eax+40]
push ecx
mov edx, DWORD PTR _source$[ebp]
mov eax, DWORD PTR [edx+32]
call eax
add esp, 12 ; 0000000cH
mov DWORD PTR _window$[ebp], eax
; 1461 : if (window == Z_NULL) {
cmp DWORD PTR _window$[ebp], 0
jne SHORT $LN4@inflateCop
; 1462 : ZFREE(source, copy);
mov ecx, DWORD PTR _copy$[ebp]
push ecx
mov edx, DWORD PTR _source$[ebp]
mov eax, DWORD PTR [edx+40]
push eax
mov ecx, DWORD PTR _source$[ebp]
mov edx, DWORD PTR [ecx+36]
call edx
add esp, 8
; 1463 : return Z_MEM_ERROR;
mov eax, -4 ; fffffffcH
jmp $LN8@inflateCop
$LN4@inflateCop:
; 1464 : }
; 1465 : }
; 1466 :
; 1467 : /* copy state */
; 1468 : zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
push 56 ; 00000038H
mov eax, DWORD PTR _source$[ebp]
push eax
mov ecx, DWORD PTR _dest$[ebp]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
; 1469 : zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
push 7116 ; 00001bccH
mov edx, DWORD PTR _state$[ebp]
push edx
mov eax, DWORD PTR _copy$[ebp]
push eax
call _memcpy
add esp, 12 ; 0000000cH
; 1470 : if (state->lencode >= state->codes &&
; 1471 : state->lencode <= state->codes + ENOUGH - 1) {
mov ecx, DWORD PTR _state$[ebp]
add ecx, 1328 ; 00000530H
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+76], ecx
jb SHORT $LN2@inflateCop
mov eax, DWORD PTR _state$[ebp]
add eax, 7100 ; 00001bbcH
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+76], eax
ja SHORT $LN2@inflateCop
; 1472 : copy->lencode = copy->codes + (state->lencode - state->codes);
mov edx, DWORD PTR _state$[ebp]
add edx, 1328 ; 00000530H
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+76]
sub ecx, edx
sar ecx, 2
mov edx, DWORD PTR _copy$[ebp]
lea eax, DWORD PTR [edx+ecx*4+1328]
mov ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR [ecx+76], eax
; 1473 : copy->distcode = copy->codes + (state->distcode - state->codes);
mov edx, DWORD PTR _state$[ebp]
add edx, 1328 ; 00000530H
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+80]
sub ecx, edx
sar ecx, 2
mov edx, DWORD PTR _copy$[ebp]
lea eax, DWORD PTR [edx+ecx*4+1328]
mov ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR [ecx+80], eax
$LN2@inflateCop:
; 1474 : }
; 1475 : copy->next = copy->codes + (state->next - state->codes);
mov edx, DWORD PTR _state$[ebp]
add edx, 1328 ; 00000530H
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+108]
sub ecx, edx
sar ecx, 2
mov edx, DWORD PTR _copy$[ebp]
lea eax, DWORD PTR [edx+ecx*4+1328]
mov ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR [ecx+108], eax
; 1476 : if (window != Z_NULL) {
cmp DWORD PTR _window$[ebp], 0
je SHORT $LN1@inflateCop
; 1477 : wsize = 1U << state->wbits;
mov edx, DWORD PTR _state$[ebp]
mov eax, 1
mov ecx, DWORD PTR [edx+36]
shl eax, cl
mov DWORD PTR _wsize$[ebp], eax
; 1478 : zmemcpy(window, state->window, wsize);
mov ecx, DWORD PTR _wsize$[ebp]
push ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+52]
push eax
mov ecx, DWORD PTR _window$[ebp]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
$LN1@inflateCop:
; 1479 : }
; 1480 : copy->window = window;
mov edx, DWORD PTR _copy$[ebp]
mov eax, DWORD PTR _window$[ebp]
mov DWORD PTR [edx+52], eax
; 1481 : dest->state = (struct internal_state FAR *)copy;
mov ecx, DWORD PTR _dest$[ebp]
mov edx, DWORD PTR _copy$[ebp]
mov DWORD PTR [ecx+28], edx
; 1482 : return Z_OK;
xor eax, eax
$LN8@inflateCop:
; 1483 : }
mov esp, ebp
pop ebp
ret 8
_inflateCopy@8 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_out$ = -20 ; size = 4
_in$ = -16 ; size = 4
_buf$ = -12 ; size = 4
_len$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateSync@4 PROC
; 1379 : {
push ebp
mov ebp, esp
sub esp, 20 ; 00000014H
; 1380 : unsigned len; /* number of bytes to look at or looked at */
; 1381 : unsigned long in, out; /* temporary to save total_in and total_out */
; 1382 : unsigned char buf[4]; /* to restore bit buffer to byte string */
; 1383 : struct inflate_state FAR *state;
; 1384 :
; 1385 : /* check parameters */
; 1386 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN6@inflateSyn
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN7@inflateSyn
$LN6@inflateSyn:
mov eax, -2 ; fffffffeH
jmp $LN8@inflateSyn
$LN7@inflateSyn:
; 1387 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1388 : if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+4], 0
jne SHORT $LN5@inflateSyn
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+60], 8
jae SHORT $LN5@inflateSyn
mov eax, -5 ; fffffffbH
jmp $LN8@inflateSyn
$LN5@inflateSyn:
; 1389 :
; 1390 : /* if first time, start search in bit buffer */
; 1391 : if (state->mode != SYNC) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx], 31 ; 0000001fH
je $LN4@inflateSyn
; 1392 : state->mode = SYNC;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 31 ; 0000001fH
; 1393 : state->hold <<= state->bits & 7;
mov ecx, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [ecx+60]
and ecx, 7
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+56]
shl eax, cl
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+56], eax
; 1394 : state->bits -= state->bits & 7;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+60]
and eax, 7
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+60]
sub edx, eax
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+60], edx
; 1395 : len = 0;
mov DWORD PTR _len$[ebp], 0
$LN3@inflateSyn:
; 1396 : while (state->bits >= 8) {
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+60], 8
jb SHORT $LN2@inflateSyn
; 1397 : buf[len++] = (unsigned char)(state->hold);
mov edx, DWORD PTR _len$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov cl, BYTE PTR [eax+56]
mov BYTE PTR _buf$[ebp+edx], cl
mov edx, DWORD PTR _len$[ebp]
add edx, 1
mov DWORD PTR _len$[ebp], edx
; 1398 : state->hold >>= 8;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+56]
shr ecx, 8
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+56], ecx
; 1399 : state->bits -= 8;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+60]
sub ecx, 8
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+60], ecx
; 1400 : }
jmp SHORT $LN3@inflateSyn
$LN2@inflateSyn:
; 1401 : state->have = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+104], 0
; 1402 : syncsearch(&(state->have), buf, len);
mov ecx, DWORD PTR _len$[ebp]
push ecx
lea edx, DWORD PTR _buf$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
add eax, 104 ; 00000068H
push eax
call _syncsearch
add esp, 12 ; 0000000cH
$LN4@inflateSyn:
; 1403 : }
; 1404 :
; 1405 : /* search available input */
; 1406 : len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+4]
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax]
push ecx
mov edx, DWORD PTR _state$[ebp]
add edx, 104 ; 00000068H
push edx
call _syncsearch
add esp, 12 ; 0000000cH
mov DWORD PTR _len$[ebp], eax
; 1407 : strm->avail_in -= len;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+4]
sub ecx, DWORD PTR _len$[ebp]
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+4], ecx
; 1408 : strm->next_in += len;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax]
add ecx, DWORD PTR _len$[ebp]
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx], ecx
; 1409 : strm->total_in += len;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+8]
add ecx, DWORD PTR _len$[ebp]
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+8], ecx
; 1410 :
; 1411 : /* return no joy or set up to restart inflate() on a new block */
; 1412 : if (state->have != 4) return Z_DATA_ERROR;
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+104], 4
je SHORT $LN1@inflateSyn
mov eax, -3 ; fffffffdH
jmp SHORT $LN8@inflateSyn
$LN1@inflateSyn:
; 1413 : in = strm->total_in; out = strm->total_out;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+8]
mov DWORD PTR _in$[ebp], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+20]
mov DWORD PTR _out$[ebp], ecx
; 1414 : inflateReset(strm);
mov edx, DWORD PTR _strm$[ebp]
push edx
call _inflateReset@4
; 1415 : strm->total_in = in; strm->total_out = out;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _in$[ebp]
mov DWORD PTR [eax+8], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR _out$[ebp]
mov DWORD PTR [edx+20], eax
; 1416 : state->mode = TYPE;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 11 ; 0000000bH
; 1417 : return Z_OK;
xor eax, eax
$LN8@inflateSyn:
; 1418 : }
mov esp, ebp
pop ebp
ret 4
_inflateSync@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_dictionary$ = 12 ; size = 4
_dictLength$ = 16 ; size = 4
_inflateGetDictionary@12 PROC
; 1272 : {
push ebp
mov ebp, esp
push ecx
; 1273 : struct inflate_state FAR *state;
; 1274 :
; 1275 : /* check state */
; 1276 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN3@inflateGet
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN4@inflateGet
$LN3@inflateGet:
mov eax, -2 ; fffffffeH
jmp SHORT $LN5@inflateGet
$LN4@inflateGet:
; 1277 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1278 :
; 1279 : /* copy dictionary */
; 1280 : if (state->whave && dictionary != Z_NULL) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+44], 0
je SHORT $LN2@inflateGet
cmp DWORD PTR _dictionary$[ebp], 0
je SHORT $LN2@inflateGet
; 1281 : zmemcpy(dictionary, state->window + state->wnext,
; 1282 : state->whave - state->wnext);
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [ecx+44]
sub eax, DWORD PTR [edx+48]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+52]
mov eax, DWORD PTR _state$[ebp]
add edx, DWORD PTR [eax+48]
push edx
mov ecx, DWORD PTR _dictionary$[ebp]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
; 1283 : zmemcpy(dictionary + state->whave - state->wnext,
; 1284 : state->window, state->wnext);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+48]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+52]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _dictionary$[ebp]
add ecx, DWORD PTR [eax+44]
mov edx, DWORD PTR _state$[ebp]
sub ecx, DWORD PTR [edx+48]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
$LN2@inflateGet:
; 1285 : }
; 1286 : if (dictLength != Z_NULL)
cmp DWORD PTR _dictLength$[ebp], 0
je SHORT $LN1@inflateGet
; 1287 : *dictLength = state->whave;
mov eax, DWORD PTR _dictLength$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+44]
mov DWORD PTR [eax], edx
$LN1@inflateGet:
; 1288 : return Z_OK;
xor eax, eax
$LN5@inflateGet:
; 1289 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
_inflateGetDictionary@12 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_ret$ = -12 ; size = 4
_dictid$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_dictionary$ = 12 ; size = 4
_dictLength$ = 16 ; size = 4
_inflateSetDictionary@12 PROC
; 1295 : {
push ebp
mov ebp, esp
sub esp, 12 ; 0000000cH
; 1296 : struct inflate_state FAR *state;
; 1297 : unsigned long dictid;
; 1298 : int ret;
; 1299 :
; 1300 : /* check state */
; 1301 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN5@inflateSet
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
jne SHORT $LN6@inflateSet
$LN5@inflateSet:
mov eax, -2 ; fffffffeH
jmp $LN7@inflateSet
$LN6@inflateSet:
; 1302 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 1303 : if (state->wrap != 0 && state->mode != DICT)
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+8], 0
je SHORT $LN4@inflateSet
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx], 10 ; 0000000aH
je SHORT $LN4@inflateSet
; 1304 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp SHORT $LN7@inflateSet
$LN4@inflateSet:
; 1305 :
; 1306 : /* check for correct dictionary identifier */
; 1307 : if (state->mode == DICT) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx], 10 ; 0000000aH
jne SHORT $LN3@inflateSet
; 1308 : dictid = adler32(0L, Z_NULL, 0);
push 0
push 0
push 0
call _adler32@12
mov DWORD PTR _dictid$[ebp], eax
; 1309 : dictid = adler32(dictid, dictionary, dictLength);
mov eax, DWORD PTR _dictLength$[ebp]
push eax
mov ecx, DWORD PTR _dictionary$[ebp]
push ecx
mov edx, DWORD PTR _dictid$[ebp]
push edx
call _adler32@12
mov DWORD PTR _dictid$[ebp], eax
; 1310 : if (dictid != state->check)
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _dictid$[ebp]
cmp ecx, DWORD PTR [eax+24]
je SHORT $LN3@inflateSet
; 1311 : return Z_DATA_ERROR;
mov eax, -3 ; fffffffdH
jmp SHORT $LN7@inflateSet
$LN3@inflateSet:
; 1312 : }
; 1313 :
; 1314 : /* copy dictionary to window using updatewindow(), which will amend the
; 1315 : existing dictionary if appropriate */
; 1316 : ret = updatewindow(strm, dictionary + dictLength, dictLength);
mov edx, DWORD PTR _dictLength$[ebp]
push edx
mov eax, DWORD PTR _dictionary$[ebp]
add eax, DWORD PTR _dictLength$[ebp]
push eax
mov ecx, DWORD PTR _strm$[ebp]
push ecx
call _updatewindow
add esp, 12 ; 0000000cH
mov DWORD PTR _ret$[ebp], eax
; 1317 : if (ret) {
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN1@inflateSet
; 1318 : state->mode = MEM;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 30 ; 0000001eH
; 1319 : return Z_MEM_ERROR;
mov eax, -4 ; fffffffcH
jmp SHORT $LN7@inflateSet
$LN1@inflateSet:
; 1320 : }
; 1321 : state->havedict = 1;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+12], 1
; 1322 : Tracev((stderr, "inflate: dictionary set\n"));
; 1323 : return Z_OK;
xor eax, eax
$LN7@inflateSet:
; 1324 : }
mov esp, ebp
pop ebp
ret 12 ; 0000000cH
_inflateSetDictionary@12 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_inflateEnd@4 PROC
; 1256 : {
push ebp
mov ebp, esp
push ecx
; 1257 : struct inflate_state FAR *state;
; 1258 : if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN2@inflateEnd
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
je SHORT $LN2@inflateEnd
mov ecx, DWORD PTR _strm$[ebp]
cmp DWORD PTR [ecx+36], 0
jne SHORT $LN3@inflateEnd
$LN2@inflateEnd:
; 1259 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp SHORT $LN4@inflateEnd
$LN3@inflateEnd:
; 1260 : state = (struct inflate_state FAR *)strm->state;
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+28]
mov DWORD PTR _state$[ebp], eax
; 1261 : if (state->window != Z_NULL) ZFREE(strm, state->window);
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+52], 0
je SHORT $LN1@inflateEnd
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+52]
push eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+40]
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+36]
call ecx
add esp, 8
$LN1@inflateEnd:
; 1262 : ZFREE(strm, strm->state);
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+28]
push eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+40]
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+36]
call ecx
add esp, 8
; 1263 : strm->state = Z_NULL;
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+28], 0
; 1264 : Tracev((stderr, "inflate: end\n"));
; 1265 : return Z_OK;
xor eax, eax
$LN4@inflateEnd:
; 1266 : }
mov esp, ebp
pop ebp
ret 4
_inflateEnd@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File d:\development\electronic\project\zlib-1.2.8\inflate.c
_TEXT SEGMENT
tv881 = -124 ; size = 4
tv1387 = -120 ; size = 4
tv1381 = -116 ; size = 4
tv1377 = -112 ; size = 4
tv1285 = -108 ; size = 4
tv599 = -104 ; size = 4
tv568 = -100 ; size = 4
tv554 = -96 ; size = 4
tv527 = -92 ; size = 4
tv384 = -88 ; size = 4
tv198 = -84 ; size = 4
tv191 = -80 ; size = 4
tv85 = -76 ; size = 4
tv1372 = -72 ; size = 4
tv1271 = -68 ; size = 4
_in$ = -64 ; size = 4
_from$ = -60 ; size = 4
_ret$ = -56 ; size = 4
_put$ = -52 ; size = 4
_hbuf$ = -48 ; size = 4
_last$ = -44 ; size = 4
_len$ = -40 ; size = 4
_left$ = -36 ; size = 4
_out$ = -32 ; size = 4
_here$ = -28 ; size = 4
_copy$ = -24 ; size = 4
_next$ = -20 ; size = 4
_have$ = -16 ; size = 4
_bits$ = -12 ; size = 4
_hold$ = -8 ; size = 4
_state$ = -4 ; size = 4
_strm$ = 8 ; size = 4
_flush$ = 12 ; size = 4
_inflate@8 PROC
; 608 : {
push ebp
mov ebp, esp
sub esp, 124 ; 0000007cH
; 609 : struct inflate_state FAR *state;
; 610 : z_const unsigned char FAR *next; /* next input */
; 611 : unsigned char FAR *put; /* next output */
; 612 : unsigned have, left; /* available input and output */
; 613 : unsigned long hold; /* bit buffer */
; 614 : unsigned bits; /* bits in bit buffer */
; 615 : unsigned in, out; /* save starting available input and output */
; 616 : unsigned copy; /* number of stored or match bytes to copy */
; 617 : unsigned char FAR *from; /* where to copy match bytes from */
; 618 : code here; /* current decoding table entry */
; 619 : code last; /* parent table entry */
; 620 : unsigned len; /* length to copy for repeats, bits to drop */
; 621 : int ret; /* return code */
; 622 : #ifdef GUNZIP
; 623 : unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
; 624 : #endif
; 625 : static const unsigned short order[19] = /* permutation of code lengths */
; 626 : {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
; 627 :
; 628 : if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
; 629 : (strm->next_in == Z_NULL && strm->avail_in != 0))
cmp DWORD PTR _strm$[ebp], 0
je SHORT $LN498@inflate
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+28], 0
je SHORT $LN498@inflate
mov ecx, DWORD PTR _strm$[ebp]
cmp DWORD PTR [ecx+12], 0
je SHORT $LN498@inflate
mov edx, DWORD PTR _strm$[ebp]
cmp DWORD PTR [edx], 0
jne SHORT $LN499@inflate
mov eax, DWORD PTR _strm$[ebp]
cmp DWORD PTR [eax+4], 0
je SHORT $LN499@inflate
$LN498@inflate:
; 630 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp $LN500@inflate
$LN499@inflate:
; 631 :
; 632 : state = (struct inflate_state FAR *)strm->state;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+28]
mov DWORD PTR _state$[ebp], edx
; 633 : if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 11 ; 0000000bH
jne SHORT $LN496@inflate
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 12 ; 0000000cH
$LN496@inflate:
; 634 : LOAD();
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+12]
mov DWORD PTR _put$[ebp], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+16]
mov DWORD PTR _left$[ebp], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+4]
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+56]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+60]
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN496@inflate
; 635 : in = have;
mov eax, DWORD PTR _have$[ebp]
mov DWORD PTR _in$[ebp], eax
; 636 : out = left;
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR _out$[ebp], ecx
; 637 : ret = Z_OK;
mov DWORD PTR _ret$[ebp], 0
$LN493@inflate:
; 638 : for (;;)
; 639 : switch (state->mode) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR tv85[ebp], eax
cmp DWORD PTR tv85[ebp], 30 ; 0000001eH
ja $LN12@inflate
mov ecx, DWORD PTR tv85[ebp]
jmp DWORD PTR $LN518@inflate[ecx*4]
$LN489@inflate:
; 640 : case HEAD:
; 641 : if (state->wrap == 0) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+8], 0
jne SHORT $LN484@inflate
; 642 : state->mode = TYPEDO;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 12 ; 0000000cH
; 643 : break;
jmp $LN490@inflate
$LN484@inflate:
; 644 : }
; 645 : NEEDBITS(16);
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jae SHORT $LN486@inflate
$LN482@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN479@inflate
jmp $inf_leave$520
$LN479@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN482@inflate
jmp SHORT $LN484@inflate
$LN486@inflate:
xor ecx, ecx
jne SHORT $LN484@inflate
; 646 : #ifdef GUNZIP
; 647 : if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+8]
and eax, 2
je SHORT $LN478@inflate
cmp DWORD PTR _hold$[ebp], 35615 ; 00008b1fH
jne SHORT $LN478@inflate
; 648 : state->check = crc32(0L, Z_NULL, 0);
push 0
push 0
push 0
call _crc32@12
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+24], eax
$LN477@inflate:
; 649 : CRC2(state->check, hold);
mov edx, 1
imul eax, edx, 0
mov cl, BYTE PTR _hold$[ebp]
mov BYTE PTR _hbuf$[ebp+eax], cl
mov edx, DWORD PTR _hold$[ebp]
shr edx, 8
mov eax, 1
shl eax, 0
mov BYTE PTR _hbuf$[ebp+eax], dl
push 2
lea ecx, DWORD PTR _hbuf$[ebp]
push ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+24]
push eax
call _crc32@12
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+24], eax
xor edx, edx
jne SHORT $LN477@inflate
$LN474@inflate:
; 650 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor eax, eax
jne SHORT $LN474@inflate
; 651 : state->mode = FLAGS;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 1
; 652 : break;
jmp $LN490@inflate
$LN478@inflate:
; 653 : }
; 654 : state->flags = 0; /* expect zlib header */
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+16], 0
; 655 : if (state->head != Z_NULL)
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN471@inflate
; 656 : state->head->done = -1;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
mov DWORD PTR [edx+48], -1
$LN471@inflate:
; 657 : if (!(state->wrap & 1) || /* check if zlib header allowed */
; 658 : #else
; 659 : if (
; 660 : #endif
; 661 : ((BITS(8) << 8) + (hold >> 8)) % 31) {
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+8]
and ecx, 1
je SHORT $LN469@inflate
mov eax, DWORD PTR _hold$[ebp]
and eax, 255 ; 000000ffH
shl eax, 8
mov edx, DWORD PTR _hold$[ebp]
shr edx, 8
add eax, edx
xor edx, edx
mov ecx, 31 ; 0000001fH
div ecx
test edx, edx
je SHORT $LN470@inflate
$LN469@inflate:
; 662 : strm->msg = (char *)"incorrect header check";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG85654
; 663 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 664 : break;
jmp $LN490@inflate
$LN470@inflate:
; 665 : }
; 666 : if (BITS(4) != Z_DEFLATED) {
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 15 ; 0000000fH
cmp ecx, 8
je SHORT $LN467@inflate
; 667 : strm->msg = (char *)"unknown compression method";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG85658
; 668 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 669 : break;
jmp $LN490@inflate
$LN467@inflate:
; 670 : }
; 671 : DROPBITS(4);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 4
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 4
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN467@inflate
; 672 : len = BITS(4) + 8;
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 15 ; 0000000fH
add ecx, 8
mov DWORD PTR _len$[ebp], ecx
; 673 : if (state->wbits == 0)
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+36], 0
jne SHORT $LN464@inflate
; 674 : state->wbits = len;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _len$[ebp]
mov DWORD PTR [eax+36], ecx
jmp SHORT $LN463@inflate
$LN464@inflate:
; 675 : else if (len > state->wbits) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _len$[ebp]
cmp eax, DWORD PTR [edx+36]
jbe SHORT $LN463@inflate
; 676 : strm->msg = (char *)"invalid window size";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG85668
; 677 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 678 : break;
jmp $LN490@inflate
$LN463@inflate:
; 679 : }
; 680 : state->dmax = 1U << len;
mov eax, 1
mov ecx, DWORD PTR _len$[ebp]
shl eax, cl
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+20], eax
; 681 : Tracev((stderr, "inflate: zlib header ok\n"));
; 682 : strm->adler = state->check = adler32(0L, Z_NULL, 0);
push 0
push 0
push 0
call _adler32@12
mov DWORD PTR tv191[ebp], eax
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR tv191[ebp]
mov DWORD PTR [edx+24], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR tv191[ebp]
mov DWORD PTR [ecx+48], edx
; 683 : state->mode = hold & 0x200 ? DICTID : TYPE;
mov eax, DWORD PTR _hold$[ebp]
and eax, 512 ; 00000200H
je SHORT $LN502@inflate
mov DWORD PTR tv198[ebp], 9
jmp SHORT $LN503@inflate
$LN502@inflate:
mov DWORD PTR tv198[ebp], 11 ; 0000000bH
$LN503@inflate:
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR tv198[ebp]
mov DWORD PTR [ecx], edx
$LN461@inflate:
; 684 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor eax, eax
jne SHORT $LN461@inflate
; 685 : break;
jmp $LN490@inflate
$LN454@inflate:
; 686 : #ifdef GUNZIP
; 687 : case FLAGS:
; 688 : NEEDBITS(16);
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jae SHORT $LN456@inflate
$LN452@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN449@inflate
jmp $inf_leave$520
$LN449@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN452@inflate
jmp SHORT $LN454@inflate
$LN456@inflate:
xor ecx, ecx
jne SHORT $LN454@inflate
; 689 : state->flags = (int)(hold);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _hold$[ebp]
mov DWORD PTR [edx+16], eax
; 690 : if ((state->flags & 0xff) != Z_DEFLATED) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 255 ; 000000ffH
cmp edx, 8
je SHORT $LN448@inflate
; 691 : strm->msg = (char *)"unknown compression method";
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], OFFSET $SG85688
; 692 : state->mode = BAD;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 29 ; 0000001dH
; 693 : break;
jmp $LN490@inflate
$LN448@inflate:
; 694 : }
; 695 : if (state->flags & 0xe000) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 57344 ; 0000e000H
je SHORT $LN447@inflate
; 696 : strm->msg = (char *)"unknown header flags set";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG85691
; 697 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 698 : break;
jmp $LN490@inflate
$LN447@inflate:
; 699 : }
; 700 : if (state->head != Z_NULL)
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN446@inflate
; 701 : state->head->text = (int)((hold >> 8) & 1);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 8
and ecx, 1
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov DWORD PTR [eax], ecx
$LN446@inflate:
; 702 : if (state->flags & 0x0200) CRC2(state->check, hold);
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 512 ; 00000200H
je SHORT $LN441@inflate
$LN444@inflate:
mov eax, 1
imul ecx, eax, 0
mov dl, BYTE PTR _hold$[ebp]
mov BYTE PTR _hbuf$[ebp+ecx], dl
mov eax, DWORD PTR _hold$[ebp]
shr eax, 8
mov ecx, 1
shl ecx, 0
mov BYTE PTR _hbuf$[ebp+ecx], al
push 2
lea edx, DWORD PTR _hbuf$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _crc32@12
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+24], eax
xor eax, eax
jne SHORT $LN444@inflate
$LN441@inflate:
; 703 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor ecx, ecx
jne SHORT $LN441@inflate
; 704 : state->mode = TIME;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 2
$LN434@inflate:
; 705 : case TIME:
; 706 : NEEDBITS(32);
cmp DWORD PTR _bits$[ebp], 32 ; 00000020H
jae SHORT $LN436@inflate
$LN432@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN429@inflate
jmp $inf_leave$520
$LN429@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN432@inflate
jmp SHORT $LN434@inflate
$LN436@inflate:
xor eax, eax
jne SHORT $LN434@inflate
; 707 : if (state->head != Z_NULL)
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+32], 0
je SHORT $LN428@inflate
; 708 : state->head->time = hold;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov ecx, DWORD PTR _hold$[ebp]
mov DWORD PTR [eax+4], ecx
$LN428@inflate:
; 709 : if (state->flags & 0x0200) CRC4(state->check, hold);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN423@inflate
$LN426@inflate:
mov ecx, 1
imul edx, ecx, 0
mov al, BYTE PTR _hold$[ebp]
mov BYTE PTR _hbuf$[ebp+edx], al
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 8
mov edx, 1
shl edx, 0
mov BYTE PTR _hbuf$[ebp+edx], cl
mov eax, DWORD PTR _hold$[ebp]
shr eax, 16 ; 00000010H
mov ecx, 1
shl ecx, 1
mov BYTE PTR _hbuf$[ebp+ecx], al
mov edx, DWORD PTR _hold$[ebp]
shr edx, 24 ; 00000018H
mov eax, 1
imul ecx, eax, 3
mov BYTE PTR _hbuf$[ebp+ecx], dl
push 4
lea edx, DWORD PTR _hbuf$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _crc32@12
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+24], eax
xor eax, eax
jne SHORT $LN426@inflate
$LN423@inflate:
; 710 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor ecx, ecx
jne SHORT $LN423@inflate
; 711 : state->mode = OS;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 3
$LN416@inflate:
; 712 : case OS:
; 713 : NEEDBITS(16);
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jae SHORT $LN418@inflate
$LN414@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN411@inflate
jmp $inf_leave$520
$LN411@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN414@inflate
jmp SHORT $LN416@inflate
$LN418@inflate:
xor eax, eax
jne SHORT $LN416@inflate
; 714 : if (state->head != Z_NULL) {
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+32], 0
je SHORT $LN410@inflate
; 715 : state->head->xflags = (int)(hold & 0xff);
mov edx, DWORD PTR _hold$[ebp]
and edx, 255 ; 000000ffH
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov DWORD PTR [ecx+8], edx
; 716 : state->head->os = (int)(hold >> 8);
mov edx, DWORD PTR _hold$[ebp]
shr edx, 8
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov DWORD PTR [ecx+12], edx
$LN410@inflate:
; 717 : }
; 718 : if (state->flags & 0x0200) CRC2(state->check, hold);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN405@inflate
$LN408@inflate:
mov ecx, 1
imul edx, ecx, 0
mov al, BYTE PTR _hold$[ebp]
mov BYTE PTR _hbuf$[ebp+edx], al
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 8
mov edx, 1
shl edx, 0
mov BYTE PTR _hbuf$[ebp+edx], cl
push 2
lea eax, DWORD PTR _hbuf$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
push edx
call _crc32@12
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+24], eax
xor edx, edx
jne SHORT $LN408@inflate
$LN405@inflate:
; 719 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor eax, eax
jne SHORT $LN405@inflate
; 720 : state->mode = EXLEN;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 4
$LN402@inflate:
; 721 : case EXLEN:
; 722 : if (state->flags & 0x0400) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 1024 ; 00000400H
je $LN401@inflate
$LN397@inflate:
; 723 : NEEDBITS(16);
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jae SHORT $LN399@inflate
$LN395@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN392@inflate
jmp $inf_leave$520
$LN392@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN395@inflate
jmp SHORT $LN397@inflate
$LN399@inflate:
xor ecx, ecx
jne SHORT $LN397@inflate
; 724 : state->length = (unsigned)(hold);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _hold$[ebp]
mov DWORD PTR [edx+64], eax
; 725 : if (state->head != Z_NULL)
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+32], 0
je SHORT $LN391@inflate
; 726 : state->head->extra_len = (unsigned)hold;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov ecx, DWORD PTR _hold$[ebp]
mov DWORD PTR [eax+20], ecx
$LN391@inflate:
; 727 : if (state->flags & 0x0200) CRC2(state->check, hold);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN386@inflate
$LN389@inflate:
mov ecx, 1
imul edx, ecx, 0
mov al, BYTE PTR _hold$[ebp]
mov BYTE PTR _hbuf$[ebp+edx], al
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 8
mov edx, 1
shl edx, 0
mov BYTE PTR _hbuf$[ebp+edx], cl
push 2
lea eax, DWORD PTR _hbuf$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
push edx
call _crc32@12
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+24], eax
xor edx, edx
jne SHORT $LN389@inflate
$LN386@inflate:
; 728 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor eax, eax
jne SHORT $LN386@inflate
; 729 : }
; 730 : else if (state->head != Z_NULL)
jmp SHORT $LN383@inflate
$LN401@inflate:
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+32], 0
je SHORT $LN383@inflate
; 731 : state->head->extra = Z_NULL;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov DWORD PTR [eax+16], 0
$LN383@inflate:
; 732 : state->mode = EXTRA;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 5
$LN381@inflate:
; 733 : case EXTRA:
; 734 : if (state->flags & 0x0400) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 1024 ; 00000400H
je $LN380@inflate
; 735 : copy = state->length;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
mov DWORD PTR _copy$[ebp], edx
; 736 : if (copy > have) copy = have;
mov eax, DWORD PTR _copy$[ebp]
cmp eax, DWORD PTR _have$[ebp]
jbe SHORT $LN379@inflate
mov ecx, DWORD PTR _have$[ebp]
mov DWORD PTR _copy$[ebp], ecx
$LN379@inflate:
; 737 : if (copy) {
cmp DWORD PTR _copy$[ebp], 0
je $LN378@inflate
; 738 : if (state->head != Z_NULL &&
; 739 : state->head->extra != Z_NULL) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+32], 0
je SHORT $LN377@inflate
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
cmp DWORD PTR [ecx+16], 0
je SHORT $LN377@inflate
; 740 : len = state->head->extra_len - state->length;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [eax+20]
sub edx, DWORD PTR [ecx+64]
mov DWORD PTR _len$[ebp], edx
; 741 : zmemcpy(state->head->extra + len, next,
; 742 : len + copy > state->head->extra_max ?
; 743 : state->head->extra_max - len : copy);
mov eax, DWORD PTR _len$[ebp]
add eax, DWORD PTR _copy$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
cmp eax, DWORD PTR [edx+24]
jbe SHORT $LN504@inflate
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov edx, DWORD PTR [ecx+24]
sub edx, DWORD PTR _len$[ebp]
mov DWORD PTR tv384[ebp], edx
jmp SHORT $LN505@inflate
$LN504@inflate:
mov eax, DWORD PTR _copy$[ebp]
mov DWORD PTR tv384[ebp], eax
$LN505@inflate:
mov ecx, DWORD PTR tv384[ebp]
push ecx
mov edx, DWORD PTR _next$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov edx, DWORD PTR [ecx+16]
add edx, DWORD PTR _len$[ebp]
push edx
call _memcpy
add esp, 12 ; 0000000cH
$LN377@inflate:
; 744 : }
; 745 : if (state->flags & 0x0200)
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 512 ; 00000200H
je SHORT $LN376@inflate
; 746 : state->check = crc32(state->check, next, copy);
mov edx, DWORD PTR _copy$[ebp]
push edx
mov eax, DWORD PTR _next$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
push edx
call _crc32@12
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+24], eax
$LN376@inflate:
; 747 : have -= copy;
mov edx, DWORD PTR _have$[ebp]
sub edx, DWORD PTR _copy$[ebp]
mov DWORD PTR _have$[ebp], edx
; 748 : next += copy;
mov eax, DWORD PTR _next$[ebp]
add eax, DWORD PTR _copy$[ebp]
mov DWORD PTR _next$[ebp], eax
; 749 : state->length -= copy;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
sub edx, DWORD PTR _copy$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+64], edx
$LN378@inflate:
; 750 : }
; 751 : if (state->length) goto inf_leave;
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+64], 0
je SHORT $LN380@inflate
jmp $inf_leave$520
$LN380@inflate:
; 752 : }
; 753 : state->length = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+64], 0
; 754 : state->mode = NAME;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 6
$LN374@inflate:
; 755 : case NAME:
; 756 : if (state->flags & 0x0800) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 2048 ; 00000800H
je $LN373@inflate
; 757 : if (have == 0) goto inf_leave;
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN372@inflate
jmp $inf_leave$520
$LN372@inflate:
; 758 : copy = 0;
mov DWORD PTR _copy$[ebp], 0
$LN371@inflate:
; 759 : do {
; 760 : len = (unsigned)(next[copy++]);
mov eax, DWORD PTR _next$[ebp]
add eax, DWORD PTR _copy$[ebp]
movzx ecx, BYTE PTR [eax]
mov DWORD PTR _len$[ebp], ecx
mov edx, DWORD PTR _copy$[ebp]
add edx, 1
mov DWORD PTR _copy$[ebp], edx
; 761 : if (state->head != Z_NULL &&
; 762 : state->head->name != Z_NULL &&
; 763 : state->length < state->head->name_max)
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN370@inflate
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
cmp DWORD PTR [edx+28], 0
je SHORT $LN370@inflate
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+64]
cmp eax, DWORD PTR [ecx+32]
jae SHORT $LN370@inflate
; 764 : state->head->name[state->length++] = len;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+64]
mov edx, DWORD PTR [edx+28]
mov al, BYTE PTR _len$[ebp]
mov BYTE PTR [edx+ecx], al
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
add edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+64], edx
$LN370@inflate:
; 765 : } while (len && copy < have);
cmp DWORD PTR _len$[ebp], 0
je SHORT $LN369@inflate
mov ecx, DWORD PTR _copy$[ebp]
cmp ecx, DWORD PTR _have$[ebp]
jb SHORT $LN371@inflate
$LN369@inflate:
; 766 : if (state->flags & 0x0200)
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN366@inflate
; 767 : state->check = crc32(state->check, next, copy);
mov ecx, DWORD PTR _copy$[ebp]
push ecx
mov edx, DWORD PTR _next$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _crc32@12
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+24], eax
$LN366@inflate:
; 768 : have -= copy;
mov eax, DWORD PTR _have$[ebp]
sub eax, DWORD PTR _copy$[ebp]
mov DWORD PTR _have$[ebp], eax
; 769 : next += copy;
mov ecx, DWORD PTR _next$[ebp]
add ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR _next$[ebp], ecx
; 770 : if (len) goto inf_leave;
cmp DWORD PTR _len$[ebp], 0
je SHORT $LN365@inflate
jmp $inf_leave$520
$LN365@inflate:
; 771 : }
; 772 : else if (state->head != Z_NULL)
jmp SHORT $LN364@inflate
$LN373@inflate:
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+32], 0
je SHORT $LN364@inflate
; 773 : state->head->name = Z_NULL;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov DWORD PTR [ecx+28], 0
$LN364@inflate:
; 774 : state->length = 0;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+64], 0
; 775 : state->mode = COMMENT;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 7
$LN362@inflate:
; 776 : case COMMENT:
; 777 : if (state->flags & 0x1000) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+16]
and edx, 4096 ; 00001000H
je $LN361@inflate
; 778 : if (have == 0) goto inf_leave;
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN360@inflate
jmp $inf_leave$520
$LN360@inflate:
; 779 : copy = 0;
mov DWORD PTR _copy$[ebp], 0
$LN359@inflate:
; 780 : do {
; 781 : len = (unsigned)(next[copy++]);
mov eax, DWORD PTR _next$[ebp]
add eax, DWORD PTR _copy$[ebp]
movzx ecx, BYTE PTR [eax]
mov DWORD PTR _len$[ebp], ecx
mov edx, DWORD PTR _copy$[ebp]
add edx, 1
mov DWORD PTR _copy$[ebp], edx
; 782 : if (state->head != Z_NULL &&
; 783 : state->head->comment != Z_NULL &&
; 784 : state->length < state->head->comm_max)
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN358@inflate
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
cmp DWORD PTR [edx+36], 0
je SHORT $LN358@inflate
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+64]
cmp eax, DWORD PTR [ecx+40]
jae SHORT $LN358@inflate
; 785 : state->head->comment[state->length++] = len;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+32]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+64]
mov edx, DWORD PTR [edx+36]
mov al, BYTE PTR _len$[ebp]
mov BYTE PTR [edx+ecx], al
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
add edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+64], edx
$LN358@inflate:
; 786 : } while (len && copy < have);
cmp DWORD PTR _len$[ebp], 0
je SHORT $LN357@inflate
mov ecx, DWORD PTR _copy$[ebp]
cmp ecx, DWORD PTR _have$[ebp]
jb SHORT $LN359@inflate
$LN357@inflate:
; 787 : if (state->flags & 0x0200)
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+16]
and eax, 512 ; 00000200H
je SHORT $LN354@inflate
; 788 : state->check = crc32(state->check, next, copy);
mov ecx, DWORD PTR _copy$[ebp]
push ecx
mov edx, DWORD PTR _next$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _crc32@12
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+24], eax
$LN354@inflate:
; 789 : have -= copy;
mov eax, DWORD PTR _have$[ebp]
sub eax, DWORD PTR _copy$[ebp]
mov DWORD PTR _have$[ebp], eax
; 790 : next += copy;
mov ecx, DWORD PTR _next$[ebp]
add ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR _next$[ebp], ecx
; 791 : if (len) goto inf_leave;
cmp DWORD PTR _len$[ebp], 0
je SHORT $LN353@inflate
jmp $inf_leave$520
$LN353@inflate:
; 792 : }
; 793 : else if (state->head != Z_NULL)
jmp SHORT $LN352@inflate
$LN361@inflate:
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+32], 0
je SHORT $LN352@inflate
; 794 : state->head->comment = Z_NULL;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov DWORD PTR [ecx+36], 0
$LN352@inflate:
; 795 : state->mode = HCRC;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 8
$LN350@inflate:
; 796 : case HCRC:
; 797 : if (state->flags & 0x0200) {
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+16]
and ecx, 512 ; 00000200H
je $LN349@inflate
$LN345@inflate:
; 798 : NEEDBITS(16);
cmp DWORD PTR _bits$[ebp], 16 ; 00000010H
jae SHORT $LN347@inflate
$LN343@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN340@inflate
jmp $inf_leave$520
$LN340@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN343@inflate
jmp SHORT $LN345@inflate
$LN347@inflate:
xor eax, eax
jne SHORT $LN345@inflate
; 799 : if (hold != (state->check & 0xffff)) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
and edx, 65535 ; 0000ffffH
cmp DWORD PTR _hold$[ebp], edx
je SHORT $LN338@inflate
; 800 : strm->msg = (char *)"header crc mismatch";
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], OFFSET $SG85830
; 801 : state->mode = BAD;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 29 ; 0000001dH
; 802 : break;
jmp $LN490@inflate
$LN338@inflate:
; 803 : }
; 804 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor edx, edx
jne SHORT $LN338@inflate
$LN349@inflate:
; 805 : }
; 806 : if (state->head != Z_NULL) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+32], 0
je SHORT $LN335@inflate
; 807 : state->head->hcrc = (int)((state->flags >> 9) & 1);
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+16]
sar edx, 9
and edx, 1
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+32]
mov DWORD PTR [ecx+44], edx
; 808 : state->head->done = 1;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+32]
mov DWORD PTR [eax+48], 1
$LN335@inflate:
; 809 : }
; 810 : strm->adler = state->check = crc32(0L, Z_NULL, 0);
push 0
push 0
push 0
call _crc32@12
mov DWORD PTR tv527[ebp], eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR tv527[ebp]
mov DWORD PTR [ecx+24], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR tv527[ebp]
mov DWORD PTR [eax+48], ecx
; 811 : state->mode = TYPE;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 11 ; 0000000bH
; 812 : break;
jmp $LN490@inflate
$LN330@inflate:
; 813 : #endif
; 814 : case DICTID:
; 815 : NEEDBITS(32);
cmp DWORD PTR _bits$[ebp], 32 ; 00000020H
jae SHORT $LN332@inflate
$LN328@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN325@inflate
jmp $inf_leave$520
$LN325@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN328@inflate
jmp SHORT $LN330@inflate
$LN332@inflate:
xor eax, eax
jne SHORT $LN330@inflate
; 816 : strm->adler = state->check = ZSWAP32(hold);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 24 ; 00000018H
and ecx, 255 ; 000000ffH
mov edx, DWORD PTR _hold$[ebp]
shr edx, 8
and edx, 65280 ; 0000ff00H
add ecx, edx
mov eax, DWORD PTR _hold$[ebp]
and eax, 65280 ; 0000ff00H
shl eax, 8
add ecx, eax
mov edx, DWORD PTR _hold$[ebp]
and edx, 255 ; 000000ffH
shl edx, 24 ; 00000018H
add ecx, edx
mov DWORD PTR tv554[ebp], ecx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR tv554[ebp]
mov DWORD PTR [eax+24], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR tv554[ebp]
mov DWORD PTR [edx+48], eax
$LN324@inflate:
; 817 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor ecx, ecx
jne SHORT $LN324@inflate
; 818 : state->mode = DICT;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 10 ; 0000000aH
$LN321@inflate:
; 819 : case DICT:
; 820 : if (state->havedict == 0) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+12], 0
jne SHORT $LN320@inflate
$LN319@inflate:
; 821 : RESTORE();
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _put$[ebp]
mov DWORD PTR [ecx+12], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR [eax+16], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR _next$[ebp]
mov DWORD PTR [edx], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _have$[ebp]
mov DWORD PTR [ecx+4], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _hold$[ebp]
mov DWORD PTR [eax+56], ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _bits$[ebp]
mov DWORD PTR [edx+60], eax
xor ecx, ecx
jne SHORT $LN319@inflate
; 822 : return Z_NEED_DICT;
mov eax, 2
jmp $LN500@inflate
$LN320@inflate:
; 823 : }
; 824 : strm->adler = state->check = adler32(0L, Z_NULL, 0);
push 0
push 0
push 0
call _adler32@12
mov DWORD PTR tv568[ebp], eax
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR tv568[ebp]
mov DWORD PTR [edx+24], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR tv568[ebp]
mov DWORD PTR [ecx+48], edx
; 825 : state->mode = TYPE;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 11 ; 0000000bH
$LN316@inflate:
; 826 : case TYPE:
; 827 : if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
cmp DWORD PTR _flush$[ebp], 5
je SHORT $LN314@inflate
cmp DWORD PTR _flush$[ebp], 6
jne SHORT $LN313@inflate
$LN314@inflate:
jmp $inf_leave$520
$LN313@inflate:
; 828 : case TYPEDO:
; 829 : if (state->last) {
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+4], 0
je SHORT $LN305@inflate
$LN311@inflate:
; 830 : BYTEBITS();
mov ecx, DWORD PTR _bits$[ebp]
and ecx, 7
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _bits$[ebp]
and eax, 7
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN311@inflate
; 831 : state->mode = CHECK;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 26 ; 0000001aH
; 832 : break;
jmp $LN490@inflate
$LN305@inflate:
; 833 : }
; 834 : NEEDBITS(3);
cmp DWORD PTR _bits$[ebp], 3
jae SHORT $LN307@inflate
$LN303@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN300@inflate
jmp $inf_leave$520
$LN300@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN303@inflate
jmp SHORT $LN305@inflate
$LN307@inflate:
xor ecx, ecx
jne SHORT $LN305@inflate
; 835 : state->last = BITS(1);
mov edx, DWORD PTR _hold$[ebp]
and edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+4], edx
$LN299@inflate:
; 836 : DROPBITS(1);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 1
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 1
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN299@inflate
; 837 : switch (BITS(2)) {
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 3
mov DWORD PTR tv599[ebp], ecx
cmp DWORD PTR tv599[ebp], 3
ja SHORT $LN286@inflate
mov edx, DWORD PTR tv599[ebp]
jmp DWORD PTR $LN519@inflate[edx*4]
$LN294@inflate:
; 838 : case 0: /* stored block */
; 839 : Tracev((stderr, "inflate: stored block%s\n",
; 840 : state->last ? " (last)" : ""));
; 841 : state->mode = STORED;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 13 ; 0000000dH
; 842 : break;
jmp SHORT $LN286@inflate
$LN293@inflate:
; 843 : case 1: /* fixed block */
; 844 : fixedtables(state);
mov ecx, DWORD PTR _state$[ebp]
push ecx
call _fixedtables
add esp, 4
; 845 : Tracev((stderr, "inflate: fixed codes block%s\n",
; 846 : state->last ? " (last)" : ""));
; 847 : state->mode = LEN_; /* decode codes */
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 19 ; 00000013H
; 848 : if (flush == Z_TREES) {
cmp DWORD PTR _flush$[ebp], 6
jne SHORT $LN292@inflate
$LN291@inflate:
; 849 : DROPBITS(2);
mov eax, DWORD PTR _hold$[ebp]
shr eax, 2
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, 2
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN291@inflate
; 850 : goto inf_leave;
jmp $inf_leave$520
$LN292@inflate:
; 851 : }
; 852 : break;
jmp SHORT $LN286@inflate
$LN288@inflate:
; 853 : case 2: /* dynamic block */
; 854 : Tracev((stderr, "inflate: dynamic codes block%s\n",
; 855 : state->last ? " (last)" : ""));
; 856 : state->mode = TABLE;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 16 ; 00000010H
; 857 : break;
jmp SHORT $LN286@inflate
$LN287@inflate:
; 858 : case 3:
; 859 : strm->msg = (char *)"invalid block type";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG85897
; 860 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
$LN286@inflate:
; 861 : }
; 862 : DROPBITS(2);
mov eax, DWORD PTR _hold$[ebp]
shr eax, 2
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, 2
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN286@inflate
; 863 : break;
jmp $LN490@inflate
$LN282@inflate:
; 864 : case STORED:
; 865 : BYTEBITS(); /* go to byte boundary */
mov ecx, DWORD PTR _bits$[ebp]
and ecx, 7
mov eax, DWORD PTR _hold$[ebp]
shr eax, cl
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
and ecx, 7
mov edx, DWORD PTR _bits$[ebp]
sub edx, ecx
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN282@inflate
$LN276@inflate:
; 866 : NEEDBITS(32);
cmp DWORD PTR _bits$[ebp], 32 ; 00000020H
jae SHORT $LN278@inflate
$LN274@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN271@inflate
jmp $inf_leave$520
$LN271@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN274@inflate
jmp SHORT $LN276@inflate
$LN278@inflate:
xor ecx, ecx
jne SHORT $LN276@inflate
; 867 : if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
mov edx, DWORD PTR _hold$[ebp]
and edx, 65535 ; 0000ffffH
mov eax, DWORD PTR _hold$[ebp]
shr eax, 16 ; 00000010H
xor eax, 65535 ; 0000ffffH
cmp edx, eax
je SHORT $LN270@inflate
; 868 : strm->msg = (char *)"invalid stored block lengths";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG85920
; 869 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 870 : break;
jmp $LN490@inflate
$LN270@inflate:
; 871 : }
; 872 : state->length = (unsigned)hold & 0xffff;
mov eax, DWORD PTR _hold$[ebp]
and eax, 65535 ; 0000ffffH
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+64], eax
$LN269@inflate:
; 873 : Tracev((stderr, "inflate: stored length %u\n",
; 874 : state->length));
; 875 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor edx, edx
jne SHORT $LN269@inflate
; 876 : state->mode = COPY_;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 14 ; 0000000eH
; 877 : if (flush == Z_TREES) goto inf_leave;
cmp DWORD PTR _flush$[ebp], 6
jne SHORT $LN265@inflate
jmp $inf_leave$520
$LN265@inflate:
; 878 : case COPY_:
; 879 : state->mode = COPY;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 15 ; 0000000fH
$LN264@inflate:
; 880 : case COPY:
; 881 : copy = state->length;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+64]
mov DWORD PTR _copy$[ebp], eax
; 882 : if (copy) {
cmp DWORD PTR _copy$[ebp], 0
je SHORT $LN263@inflate
; 883 : if (copy > have) copy = have;
mov ecx, DWORD PTR _copy$[ebp]
cmp ecx, DWORD PTR _have$[ebp]
jbe SHORT $LN262@inflate
mov edx, DWORD PTR _have$[ebp]
mov DWORD PTR _copy$[ebp], edx
$LN262@inflate:
; 884 : if (copy > left) copy = left;
mov eax, DWORD PTR _copy$[ebp]
cmp eax, DWORD PTR _left$[ebp]
jbe SHORT $LN261@inflate
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR _copy$[ebp], ecx
$LN261@inflate:
; 885 : if (copy == 0) goto inf_leave;
cmp DWORD PTR _copy$[ebp], 0
jne SHORT $LN260@inflate
jmp $inf_leave$520
$LN260@inflate:
; 886 : zmemcpy(put, next, copy);
mov edx, DWORD PTR _copy$[ebp]
push edx
mov eax, DWORD PTR _next$[ebp]
push eax
mov ecx, DWORD PTR _put$[ebp]
push ecx
call _memcpy
add esp, 12 ; 0000000cH
; 887 : have -= copy;
mov edx, DWORD PTR _have$[ebp]
sub edx, DWORD PTR _copy$[ebp]
mov DWORD PTR _have$[ebp], edx
; 888 : next += copy;
mov eax, DWORD PTR _next$[ebp]
add eax, DWORD PTR _copy$[ebp]
mov DWORD PTR _next$[ebp], eax
; 889 : left -= copy;
mov ecx, DWORD PTR _left$[ebp]
sub ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR _left$[ebp], ecx
; 890 : put += copy;
mov edx, DWORD PTR _put$[ebp]
add edx, DWORD PTR _copy$[ebp]
mov DWORD PTR _put$[ebp], edx
; 891 : state->length -= copy;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+64]
sub ecx, DWORD PTR _copy$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+64], ecx
; 892 : break;
jmp $LN490@inflate
$LN263@inflate:
; 893 : }
; 894 : Tracev((stderr, "inflate: stored end\n"));
; 895 : state->mode = TYPE;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 11 ; 0000000bH
; 896 : break;
jmp $LN490@inflate
$LN255@inflate:
; 897 : case TABLE:
; 898 : NEEDBITS(14);
cmp DWORD PTR _bits$[ebp], 14 ; 0000000eH
jae SHORT $LN257@inflate
$LN253@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN250@inflate
jmp $inf_leave$520
$LN250@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN253@inflate
jmp SHORT $LN255@inflate
$LN257@inflate:
xor ecx, ecx
jne SHORT $LN255@inflate
; 899 : state->nlen = BITS(5) + 257;
mov edx, DWORD PTR _hold$[ebp]
and edx, 31 ; 0000001fH
add edx, 257 ; 00000101H
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+96], edx
$LN249@inflate:
; 900 : DROPBITS(5);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 5
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 5
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN249@inflate
; 901 : state->ndist = BITS(5) + 1;
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 31 ; 0000001fH
add ecx, 1
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+100], ecx
$LN246@inflate:
; 902 : DROPBITS(5);
mov eax, DWORD PTR _hold$[ebp]
shr eax, 5
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, 5
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN246@inflate
; 903 : state->ncode = BITS(4) + 4;
mov eax, DWORD PTR _hold$[ebp]
and eax, 15 ; 0000000fH
add eax, 4
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+92], eax
$LN243@inflate:
; 904 : DROPBITS(4);
mov edx, DWORD PTR _hold$[ebp]
shr edx, 4
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _bits$[ebp]
sub eax, 4
mov DWORD PTR _bits$[ebp], eax
xor ecx, ecx
jne SHORT $LN243@inflate
; 905 : #ifndef PKZIP_BUG_WORKAROUND
; 906 : if (state->nlen > 286 || state->ndist > 30) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+96], 286 ; 0000011eH
ja SHORT $LN239@inflate
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+100], 30 ; 0000001eH
jbe SHORT $LN240@inflate
$LN239@inflate:
; 907 : strm->msg = (char *)"too many length or distance symbols";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG85963
; 908 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 909 : break;
jmp $LN490@inflate
$LN240@inflate:
; 910 : }
; 911 : #endif
; 912 : Tracev((stderr, "inflate: table sizes ok\n"));
; 913 : state->have = 0;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+104], 0
; 914 : state->mode = LENLENS;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 17 ; 00000011H
$LN237@inflate:
; 915 : case LENLENS:
; 916 : while (state->have < state->ncode) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [edx+104]
cmp ecx, DWORD PTR [eax+92]
jae $LN223@inflate
$LN232@inflate:
; 917 : NEEDBITS(3);
cmp DWORD PTR _bits$[ebp], 3
jae SHORT $LN234@inflate
$LN230@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN227@inflate
jmp $inf_leave$520
$LN227@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN230@inflate
jmp SHORT $LN232@inflate
$LN234@inflate:
xor eax, eax
jne SHORT $LN232@inflate
; 918 : state->lens[order[state->have++]] = (unsigned short)BITS(3);
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 7
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+104]
movzx edx, WORD PTR ?order@?1??inflate@@9@9[eax*2]
mov eax, DWORD PTR _state$[ebp]
mov WORD PTR [eax+edx*2+112], cx
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+104]
add edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+104], edx
$LN226@inflate:
; 919 : DROPBITS(3);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 3
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 3
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN226@inflate
; 920 : }
jmp $LN237@inflate
$LN223@inflate:
; 921 : while (state->have < 19)
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+104], 19 ; 00000013H
jae SHORT $LN222@inflate
; 922 : state->lens[order[state->have++]] = 0;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+104]
movzx ecx, WORD PTR ?order@?1??inflate@@9@9[eax*2]
xor edx, edx
mov eax, DWORD PTR _state$[ebp]
mov WORD PTR [eax+ecx*2+112], dx
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+104]
add edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+104], edx
jmp SHORT $LN223@inflate
$LN222@inflate:
; 923 : state->next = state->codes;
mov ecx, DWORD PTR _state$[ebp]
add ecx, 1328 ; 00000530H
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+108], ecx
; 924 : state->lencode = (const code FAR *)(state->next);
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+108]
mov DWORD PTR [eax+76], edx
; 925 : state->lenbits = 7;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+84], 7
; 926 : ret = inflate_table(CODES, state->lens, 19, &(state->next),
; 927 : &(state->lenbits), state->work);
mov ecx, DWORD PTR _state$[ebp]
add ecx, 752 ; 000002f0H
push ecx
mov edx, DWORD PTR _state$[ebp]
add edx, 84 ; 00000054H
push edx
mov eax, DWORD PTR _state$[ebp]
add eax, 108 ; 0000006cH
push eax
push 19 ; 00000013H
mov ecx, DWORD PTR _state$[ebp]
add ecx, 112 ; 00000070H
push ecx
push 0
call _inflate_table
add esp, 24 ; 00000018H
mov DWORD PTR _ret$[ebp], eax
; 928 : if (ret) {
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN221@inflate
; 929 : strm->msg = (char *)"invalid code lengths set";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG85992
; 930 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 931 : break;
jmp $LN490@inflate
$LN221@inflate:
; 932 : }
; 933 : Tracev((stderr, "inflate: code lengths ok\n"));
; 934 : state->have = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+104], 0
; 935 : state->mode = CODELENS;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 18 ; 00000012H
$LN219@inflate:
; 936 : case CODELENS:
; 937 : while (state->have < state->nlen + state->ndist) {
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+96]
mov edx, DWORD PTR _state$[ebp]
add ecx, DWORD PTR [edx+100]
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+104], ecx
jae $LN218@inflate
$LN217@inflate:
; 938 : for (;;) {
; 939 : here = state->lencode[BITS(state->lenbits)];
mov ecx, DWORD PTR _state$[ebp]
mov edx, 1
mov ecx, DWORD PTR [ecx+84]
shl edx, cl
sub edx, 1
and edx, DWORD PTR _hold$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+76]
mov edx, DWORD PTR [ecx+edx*4]
mov DWORD PTR _here$[ebp], edx
; 940 : if ((unsigned)(here.bits) <= bits) break;
movzx eax, BYTE PTR _here$[ebp+1]
cmp eax, DWORD PTR _bits$[ebp]
ja SHORT $LN214@inflate
jmp SHORT $LN216@inflate
$LN214@inflate:
; 941 : PULLBYTE();
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN211@inflate
jmp $inf_leave$520
$LN211@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN214@inflate
; 942 : }
jmp SHORT $LN217@inflate
$LN216@inflate:
; 943 : if (here.val < 16) {
movzx ecx, WORD PTR _here$[ebp+2]
cmp ecx, 16 ; 00000010H
jge SHORT $LN210@inflate
$LN209@inflate:
; 944 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN209@inflate
; 945 : state->lens[state->have++] = here.val;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+104]
mov edx, DWORD PTR _state$[ebp]
mov ax, WORD PTR _here$[ebp+2]
mov WORD PTR [edx+ecx*2+112], ax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+104]
add edx, 1
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+104], edx
; 946 : }
; 947 : else {
jmp $LN206@inflate
$LN210@inflate:
; 948 : if (here.val == 16) {
movzx ecx, WORD PTR _here$[ebp+2]
cmp ecx, 16 ; 00000010H
jne $LN205@inflate
$LN201@inflate:
; 949 : NEEDBITS(here.bits + 2);
movzx edx, BYTE PTR _here$[ebp+1]
add edx, 2
cmp DWORD PTR _bits$[ebp], edx
jae SHORT $LN203@inflate
$LN199@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN196@inflate
jmp $inf_leave$520
$LN196@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN199@inflate
jmp SHORT $LN201@inflate
$LN203@inflate:
xor eax, eax
jne SHORT $LN201@inflate
$LN195@inflate:
; 950 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN195@inflate
; 951 : if (state->have == 0) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+104], 0
jne SHORT $LN192@inflate
; 952 : strm->msg = (char *)"invalid bit length repeat";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG86033
; 953 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 954 : break;
jmp $LN218@inflate
$LN192@inflate:
; 955 : }
; 956 : len = state->lens[state->have - 1];
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+104]
mov edx, DWORD PTR _state$[ebp]
movzx eax, WORD PTR [edx+ecx*2+110]
mov DWORD PTR _len$[ebp], eax
; 957 : copy = 3 + BITS(2);
mov ecx, DWORD PTR _hold$[ebp]
and ecx, 3
add ecx, 3
mov DWORD PTR _copy$[ebp], ecx
$LN191@inflate:
; 958 : DROPBITS(2);
mov edx, DWORD PTR _hold$[ebp]
shr edx, 2
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _bits$[ebp]
sub eax, 2
mov DWORD PTR _bits$[ebp], eax
xor ecx, ecx
jne SHORT $LN191@inflate
; 959 : }
; 960 : else if (here.val == 17) {
jmp $LN188@inflate
$LN205@inflate:
movzx edx, WORD PTR _here$[ebp+2]
cmp edx, 17 ; 00000011H
jne $LN167@inflate
$LN183@inflate:
; 961 : NEEDBITS(here.bits + 3);
movzx eax, BYTE PTR _here$[ebp+1]
add eax, 3
cmp DWORD PTR _bits$[ebp], eax
jae SHORT $LN185@inflate
$LN181@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN178@inflate
jmp $inf_leave$520
$LN178@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN181@inflate
jmp SHORT $LN183@inflate
$LN185@inflate:
xor ecx, ecx
jne SHORT $LN183@inflate
$LN177@inflate:
; 962 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN177@inflate
; 963 : len = 0;
mov DWORD PTR _len$[ebp], 0
; 964 : copy = 3 + BITS(3);
mov eax, DWORD PTR _hold$[ebp]
and eax, 7
add eax, 3
mov DWORD PTR _copy$[ebp], eax
$LN174@inflate:
; 965 : DROPBITS(3);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 3
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 3
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN174@inflate
; 966 : }
; 967 : else {
jmp $LN188@inflate
$LN167@inflate:
; 968 : NEEDBITS(here.bits + 7);
movzx ecx, BYTE PTR _here$[ebp+1]
add ecx, 7
cmp DWORD PTR _bits$[ebp], ecx
jae SHORT $LN169@inflate
$LN165@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN162@inflate
jmp $inf_leave$520
$LN162@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN165@inflate
jmp SHORT $LN167@inflate
$LN169@inflate:
xor eax, eax
jne SHORT $LN167@inflate
$LN161@inflate:
; 969 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN161@inflate
; 970 : len = 0;
mov DWORD PTR _len$[ebp], 0
; 971 : copy = 11 + BITS(7);
mov eax, DWORD PTR _hold$[ebp]
and eax, 127 ; 0000007fH
add eax, 11 ; 0000000bH
mov DWORD PTR _copy$[ebp], eax
$LN158@inflate:
; 972 : DROPBITS(7);
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 7
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
sub edx, 7
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN158@inflate
$LN188@inflate:
; 973 : }
; 974 : if (state->have + copy > state->nlen + state->ndist) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+104]
add edx, DWORD PTR _copy$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+96]
mov eax, DWORD PTR _state$[ebp]
add ecx, DWORD PTR [eax+100]
cmp edx, ecx
jbe SHORT $LN154@inflate
; 975 : strm->msg = (char *)"invalid bit length repeat";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG86086
; 976 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 977 : break;
jmp SHORT $LN218@inflate
$LN154@inflate:
; 978 : }
; 979 : while (copy--)
mov eax, DWORD PTR _copy$[ebp]
mov DWORD PTR tv881[ebp], eax
mov ecx, DWORD PTR _copy$[ebp]
sub ecx, 1
mov DWORD PTR _copy$[ebp], ecx
cmp DWORD PTR tv881[ebp], 0
je SHORT $LN206@inflate
; 980 : state->lens[state->have++] = (unsigned short)len;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+104]
mov ecx, DWORD PTR _state$[ebp]
mov dx, WORD PTR _len$[ebp]
mov WORD PTR [ecx+eax*2+112], dx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+104]
add ecx, 1
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+104], ecx
jmp SHORT $LN154@inflate
$LN206@inflate:
; 981 : }
; 982 : }
jmp $LN219@inflate
$LN218@inflate:
; 983 :
; 984 : /* handle error breaks in while */
; 985 : if (state->mode == BAD) break;
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 29 ; 0000001dH
jne SHORT $LN152@inflate
jmp $LN490@inflate
$LN152@inflate:
; 986 :
; 987 : /* check for end-of-block code (better have one) */
; 988 : if (state->lens[256] == 0) {
mov ecx, 2
shl ecx, 8
mov edx, DWORD PTR _state$[ebp]
movzx eax, WORD PTR [edx+ecx+112]
test eax, eax
jne SHORT $LN151@inflate
; 989 : strm->msg = (char *)"invalid code -- missing end-of-block";
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+24], OFFSET $SG86094
; 990 : state->mode = BAD;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 29 ; 0000001dH
; 991 : break;
jmp $LN490@inflate
$LN151@inflate:
; 992 : }
; 993 :
; 994 : /* build code tables -- note: do not change the lenbits or distbits
; 995 : values here (9 and 6) without reading the comments in inftrees.h
; 996 : concerning the ENOUGH constants, which depend on those values */
; 997 : state->next = state->codes;
mov eax, DWORD PTR _state$[ebp]
add eax, 1328 ; 00000530H
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+108], eax
; 998 : state->lencode = (const code FAR *)(state->next);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+108]
mov DWORD PTR [edx+76], ecx
; 999 : state->lenbits = 9;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+84], 9
; 1000 : ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
; 1001 : &(state->lenbits), state->work);
mov eax, DWORD PTR _state$[ebp]
add eax, 752 ; 000002f0H
push eax
mov ecx, DWORD PTR _state$[ebp]
add ecx, 84 ; 00000054H
push ecx
mov edx, DWORD PTR _state$[ebp]
add edx, 108 ; 0000006cH
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+96]
push ecx
mov edx, DWORD PTR _state$[ebp]
add edx, 112 ; 00000070H
push edx
push 1
call _inflate_table
add esp, 24 ; 00000018H
mov DWORD PTR _ret$[ebp], eax
; 1002 : if (ret) {
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN150@inflate
; 1003 : strm->msg = (char *)"invalid literal/lengths set";
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], OFFSET $SG86098
; 1004 : state->mode = BAD;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 29 ; 0000001dH
; 1005 : break;
jmp $LN490@inflate
$LN150@inflate:
; 1006 : }
; 1007 : state->distcode = (const code FAR *)(state->next);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+108]
mov DWORD PTR [edx+80], ecx
; 1008 : state->distbits = 6;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+88], 6
; 1009 : ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
; 1010 : &(state->next), &(state->distbits), state->work);
mov eax, DWORD PTR _state$[ebp]
add eax, 752 ; 000002f0H
push eax
mov ecx, DWORD PTR _state$[ebp]
add ecx, 88 ; 00000058H
push ecx
mov edx, DWORD PTR _state$[ebp]
add edx, 108 ; 0000006cH
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+100]
push ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+96]
mov ecx, DWORD PTR _state$[ebp]
lea edx, DWORD PTR [ecx+eax*2+112]
push edx
push 2
call _inflate_table
add esp, 24 ; 00000018H
mov DWORD PTR _ret$[ebp], eax
; 1011 : if (ret) {
cmp DWORD PTR _ret$[ebp], 0
je SHORT $LN149@inflate
; 1012 : strm->msg = (char *)"invalid distances set";
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], OFFSET $SG86102
; 1013 : state->mode = BAD;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 29 ; 0000001dH
; 1014 : break;
jmp $LN490@inflate
$LN149@inflate:
; 1015 : }
; 1016 : Tracev((stderr, "inflate: codes ok\n"));
; 1017 : state->mode = LEN_;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 19 ; 00000013H
; 1018 : if (flush == Z_TREES) goto inf_leave;
cmp DWORD PTR _flush$[ebp], 6
jne SHORT $LN147@inflate
jmp $inf_leave$520
$LN147@inflate:
; 1019 : case LEN_:
; 1020 : state->mode = LEN;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 20 ; 00000014H
$LN146@inflate:
; 1021 : case LEN:
; 1022 : if (have >= 6 && left >= 258) {
cmp DWORD PTR _have$[ebp], 6
jb $LN145@inflate
cmp DWORD PTR _left$[ebp], 258 ; 00000102H
jb $LN145@inflate
$LN144@inflate:
; 1023 : RESTORE();
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _put$[ebp]
mov DWORD PTR [ecx+12], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR [eax+16], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR _next$[ebp]
mov DWORD PTR [edx], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _have$[ebp]
mov DWORD PTR [ecx+4], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _hold$[ebp]
mov DWORD PTR [eax+56], ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _bits$[ebp]
mov DWORD PTR [edx+60], eax
xor ecx, ecx
jne SHORT $LN144@inflate
; 1024 : inflate_fast(strm, out);
mov edx, DWORD PTR _out$[ebp]
push edx
mov eax, DWORD PTR _strm$[ebp]
push eax
call _inflate_fast
add esp, 8
$LN141@inflate:
; 1025 : LOAD();
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+12]
mov DWORD PTR _put$[ebp], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+16]
mov DWORD PTR _left$[ebp], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx]
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+4]
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+56]
mov DWORD PTR _hold$[ebp], ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+60]
mov DWORD PTR _bits$[ebp], eax
xor ecx, ecx
jne SHORT $LN141@inflate
; 1026 : if (state->mode == TYPE)
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx], 11 ; 0000000bH
jne SHORT $LN138@inflate
; 1027 : state->back = -1;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+7108], -1
$LN138@inflate:
; 1028 : break;
jmp $LN490@inflate
$LN145@inflate:
; 1029 : }
; 1030 : state->back = 0;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+7108], 0
$LN137@inflate:
; 1031 : for (;;) {
; 1032 : here = state->lencode[BITS(state->lenbits)];
mov edx, DWORD PTR _state$[ebp]
mov eax, 1
mov ecx, DWORD PTR [edx+84]
shl eax, cl
sub eax, 1
and eax, DWORD PTR _hold$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+76]
mov eax, DWORD PTR [edx+eax*4]
mov DWORD PTR _here$[ebp], eax
; 1033 : if ((unsigned)(here.bits) <= bits) break;
movzx ecx, BYTE PTR _here$[ebp+1]
cmp ecx, DWORD PTR _bits$[ebp]
ja SHORT $LN134@inflate
jmp SHORT $LN136@inflate
$LN134@inflate:
; 1034 : PULLBYTE();
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN131@inflate
jmp $inf_leave$520
$LN131@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN134@inflate
; 1035 : }
jmp SHORT $LN137@inflate
$LN136@inflate:
; 1036 : if (here.op && (here.op & 0xf0) == 0) {
movzx eax, BYTE PTR _here$[ebp]
test eax, eax
je $LN119@inflate
movzx ecx, BYTE PTR _here$[ebp]
and ecx, 240 ; 000000f0H
jne $LN119@inflate
; 1037 : last = here;
mov edx, DWORD PTR _here$[ebp]
mov DWORD PTR _last$[ebp], edx
$LN129@inflate:
; 1038 : for (;;) {
; 1039 : here = state->lencode[last.val +
; 1040 : (BITS(last.bits + last.op) >> last.bits)];
movzx eax, WORD PTR _last$[ebp+2]
movzx ecx, BYTE PTR _last$[ebp+1]
movzx edx, BYTE PTR _last$[ebp]
add ecx, edx
mov edx, 1
shl edx, cl
sub edx, 1
and edx, DWORD PTR _hold$[ebp]
movzx ecx, BYTE PTR _last$[ebp+1]
shr edx, cl
add eax, edx
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+76]
mov eax, DWORD PTR [edx+eax*4]
mov DWORD PTR _here$[ebp], eax
; 1041 : if ((unsigned)(last.bits + here.bits) <= bits) break;
movzx ecx, BYTE PTR _last$[ebp+1]
movzx edx, BYTE PTR _here$[ebp+1]
add ecx, edx
cmp ecx, DWORD PTR _bits$[ebp]
ja SHORT $LN126@inflate
jmp SHORT $LN122@inflate
$LN126@inflate:
; 1042 : PULLBYTE();
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN123@inflate
jmp $inf_leave$520
$LN123@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN126@inflate
; 1043 : }
jmp SHORT $LN129@inflate
$LN122@inflate:
; 1044 : DROPBITS(last.bits);
movzx ecx, BYTE PTR _last$[ebp+1]
mov eax, DWORD PTR _hold$[ebp]
shr eax, cl
mov DWORD PTR _hold$[ebp], eax
movzx ecx, BYTE PTR _last$[ebp+1]
mov edx, DWORD PTR _bits$[ebp]
sub edx, ecx
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN122@inflate
; 1045 : state->back += last.bits;
movzx ecx, BYTE PTR _last$[ebp+1]
mov edx, DWORD PTR _state$[ebp]
add ecx, DWORD PTR [edx+7108]
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+7108], ecx
$LN119@inflate:
; 1046 : }
; 1047 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN119@inflate
; 1048 : state->back += here.bits;
movzx eax, BYTE PTR _here$[ebp+1]
mov ecx, DWORD PTR _state$[ebp]
add eax, DWORD PTR [ecx+7108]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+7108], eax
; 1049 : state->length = (unsigned)here.val;
movzx eax, WORD PTR _here$[ebp+2]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+64], eax
; 1050 : if ((int)(here.op) == 0) {
movzx edx, BYTE PTR _here$[ebp]
test edx, edx
jne SHORT $LN116@inflate
; 1051 : Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
; 1052 : "inflate: literal '%c'\n" :
; 1053 : "inflate: literal 0x%02x\n", here.val));
; 1054 : state->mode = LIT;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 25 ; 00000019H
; 1055 : break;
jmp $LN490@inflate
$LN116@inflate:
; 1056 : }
; 1057 : if (here.op & 32) {
movzx ecx, BYTE PTR _here$[ebp]
and ecx, 32 ; 00000020H
je SHORT $LN115@inflate
; 1058 : Tracevv((stderr, "inflate: end of block\n"));
; 1059 : state->back = -1;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+7108], -1
; 1060 : state->mode = TYPE;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 11 ; 0000000bH
; 1061 : break;
jmp $LN490@inflate
$LN115@inflate:
; 1062 : }
; 1063 : if (here.op & 64) {
movzx ecx, BYTE PTR _here$[ebp]
and ecx, 64 ; 00000040H
je SHORT $LN114@inflate
; 1064 : strm->msg = (char *)"invalid literal/length code";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG86151
; 1065 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 1066 : break;
jmp $LN490@inflate
$LN114@inflate:
; 1067 : }
; 1068 : state->extra = (unsigned)(here.op) & 15;
movzx ecx, BYTE PTR _here$[ebp]
and ecx, 15 ; 0000000fH
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+72], ecx
; 1069 : state->mode = LENEXT;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 21 ; 00000015H
$LN113@inflate:
; 1070 : case LENEXT:
; 1071 : if (state->extra) {
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+72], 0
je $LN112@inflate
$LN108@inflate:
; 1072 : NEEDBITS(state->extra);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _bits$[ebp]
cmp eax, DWORD PTR [edx+72]
jae SHORT $LN110@inflate
$LN106@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN103@inflate
jmp $inf_leave$520
$LN103@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN106@inflate
jmp SHORT $LN108@inflate
$LN110@inflate:
xor ecx, ecx
jne SHORT $LN108@inflate
; 1073 : state->length += BITS(state->extra);
mov edx, DWORD PTR _state$[ebp]
mov eax, 1
mov ecx, DWORD PTR [edx+72]
shl eax, cl
sub eax, 1
and eax, DWORD PTR _hold$[ebp]
mov ecx, DWORD PTR _state$[ebp]
add eax, DWORD PTR [ecx+64]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+64], eax
$LN102@inflate:
; 1074 : DROPBITS(state->extra);
mov eax, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _hold$[ebp]
mov ecx, DWORD PTR [eax+72]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, DWORD PTR [eax+72]
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN102@inflate
; 1075 : state->back += state->extra;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+7108]
mov edx, DWORD PTR _state$[ebp]
add ecx, DWORD PTR [edx+72]
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+7108], ecx
$LN112@inflate:
; 1076 : }
; 1077 : Tracevv((stderr, "inflate: length %u\n", state->length));
; 1078 : state->was = state->length;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+64]
mov DWORD PTR [ecx+7112], eax
; 1079 : state->mode = DIST;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 22 ; 00000016H
$LN98@inflate:
; 1080 : case DIST:
; 1081 : for (;;) {
; 1082 : here = state->distcode[BITS(state->distbits)];
mov edx, DWORD PTR _state$[ebp]
mov eax, 1
mov ecx, DWORD PTR [edx+88]
shl eax, cl
sub eax, 1
and eax, DWORD PTR _hold$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+80]
mov eax, DWORD PTR [edx+eax*4]
mov DWORD PTR _here$[ebp], eax
; 1083 : if ((unsigned)(here.bits) <= bits) break;
movzx ecx, BYTE PTR _here$[ebp+1]
cmp ecx, DWORD PTR _bits$[ebp]
ja SHORT $LN95@inflate
jmp SHORT $LN97@inflate
$LN95@inflate:
; 1084 : PULLBYTE();
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN92@inflate
jmp $inf_leave$520
$LN92@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN95@inflate
; 1085 : }
jmp SHORT $LN98@inflate
$LN97@inflate:
; 1086 : if ((here.op & 0xf0) == 0) {
movzx eax, BYTE PTR _here$[ebp]
and eax, 240 ; 000000f0H
jne $LN80@inflate
; 1087 : last = here;
mov ecx, DWORD PTR _here$[ebp]
mov DWORD PTR _last$[ebp], ecx
$LN90@inflate:
; 1088 : for (;;) {
; 1089 : here = state->distcode[last.val +
; 1090 : (BITS(last.bits + last.op) >> last.bits)];
movzx edx, WORD PTR _last$[ebp+2]
movzx ecx, BYTE PTR _last$[ebp+1]
movzx eax, BYTE PTR _last$[ebp]
add ecx, eax
mov eax, 1
shl eax, cl
sub eax, 1
and eax, DWORD PTR _hold$[ebp]
movzx ecx, BYTE PTR _last$[ebp+1]
shr eax, cl
add edx, eax
mov ecx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [ecx+80]
mov ecx, DWORD PTR [eax+edx*4]
mov DWORD PTR _here$[ebp], ecx
; 1091 : if ((unsigned)(last.bits + here.bits) <= bits) break;
movzx edx, BYTE PTR _last$[ebp+1]
movzx eax, BYTE PTR _here$[ebp+1]
add edx, eax
cmp edx, DWORD PTR _bits$[ebp]
ja SHORT $LN87@inflate
jmp SHORT $LN83@inflate
$LN87@inflate:
; 1092 : PULLBYTE();
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN84@inflate
jmp $inf_leave$520
$LN84@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN87@inflate
; 1093 : }
jmp SHORT $LN90@inflate
$LN83@inflate:
; 1094 : DROPBITS(last.bits);
movzx ecx, BYTE PTR _last$[ebp+1]
mov edx, DWORD PTR _hold$[ebp]
shr edx, cl
mov DWORD PTR _hold$[ebp], edx
movzx eax, BYTE PTR _last$[ebp+1]
mov ecx, DWORD PTR _bits$[ebp]
sub ecx, eax
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN83@inflate
; 1095 : state->back += last.bits;
movzx eax, BYTE PTR _last$[ebp+1]
mov ecx, DWORD PTR _state$[ebp]
add eax, DWORD PTR [ecx+7108]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+7108], eax
$LN80@inflate:
; 1096 : }
; 1097 : DROPBITS(here.bits);
movzx ecx, BYTE PTR _here$[ebp+1]
mov eax, DWORD PTR _hold$[ebp]
shr eax, cl
mov DWORD PTR _hold$[ebp], eax
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _bits$[ebp]
sub edx, ecx
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN80@inflate
; 1098 : state->back += here.bits;
movzx ecx, BYTE PTR _here$[ebp+1]
mov edx, DWORD PTR _state$[ebp]
add ecx, DWORD PTR [edx+7108]
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+7108], ecx
; 1099 : if (here.op & 64) {
movzx ecx, BYTE PTR _here$[ebp]
and ecx, 64 ; 00000040H
je SHORT $LN77@inflate
; 1100 : strm->msg = (char *)"invalid distance code";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG86206
; 1101 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 1102 : break;
jmp $LN490@inflate
$LN77@inflate:
; 1103 : }
; 1104 : state->offset = (unsigned)here.val;
movzx ecx, WORD PTR _here$[ebp+2]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+68], ecx
; 1105 : state->extra = (unsigned)(here.op) & 15;
movzx eax, BYTE PTR _here$[ebp]
and eax, 15 ; 0000000fH
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+72], eax
; 1106 : state->mode = DISTEXT;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 23 ; 00000017H
$LN76@inflate:
; 1107 : case DISTEXT:
; 1108 : if (state->extra) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+72], 0
je $LN75@inflate
$LN71@inflate:
; 1109 : NEEDBITS(state->extra);
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _bits$[ebp]
cmp edx, DWORD PTR [ecx+72]
jae SHORT $LN73@inflate
$LN69@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN66@inflate
jmp $inf_leave$520
$LN66@inflate:
mov eax, DWORD PTR _have$[ebp]
sub eax, 1
mov DWORD PTR _have$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [ecx]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN69@inflate
jmp SHORT $LN71@inflate
$LN73@inflate:
xor eax, eax
jne SHORT $LN71@inflate
; 1110 : state->offset += BITS(state->extra);
mov ecx, DWORD PTR _state$[ebp]
mov edx, 1
mov ecx, DWORD PTR [ecx+72]
shl edx, cl
sub edx, 1
and edx, DWORD PTR _hold$[ebp]
mov eax, DWORD PTR _state$[ebp]
add edx, DWORD PTR [eax+68]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+68], edx
$LN65@inflate:
; 1111 : DROPBITS(state->extra);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _hold$[ebp]
mov ecx, DWORD PTR [edx+72]
shr eax, cl
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _bits$[ebp]
sub edx, DWORD PTR [ecx+72]
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN65@inflate
; 1112 : state->back += state->extra;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+7108]
mov eax, DWORD PTR _state$[ebp]
add edx, DWORD PTR [eax+72]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+7108], edx
$LN75@inflate:
; 1113 : }
; 1114 : #ifdef INFLATE_STRICT
; 1115 : if (state->offset > state->dmax) {
; 1116 : strm->msg = (char *)"invalid distance too far back";
; 1117 : state->mode = BAD;
; 1118 : break;
; 1119 : }
; 1120 : #endif
; 1121 : Tracevv((stderr, "inflate: distance %u\n", state->offset));
; 1122 : state->mode = MATCH;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 24 ; 00000018H
$LN62@inflate:
; 1123 : case MATCH:
; 1124 : if (left == 0) goto inf_leave;
cmp DWORD PTR _left$[ebp], 0
jne SHORT $LN61@inflate
jmp $inf_leave$520
$LN61@inflate:
; 1125 : copy = out - left;
mov eax, DWORD PTR _out$[ebp]
sub eax, DWORD PTR _left$[ebp]
mov DWORD PTR _copy$[ebp], eax
; 1126 : if (state->offset > copy) { /* copy from window */
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+68]
cmp edx, DWORD PTR _copy$[ebp]
jbe $LN60@inflate
; 1127 : copy = state->offset - copy;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+68]
sub ecx, DWORD PTR _copy$[ebp]
mov DWORD PTR _copy$[ebp], ecx
; 1128 : if (copy > state->whave) {
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _copy$[ebp]
cmp eax, DWORD PTR [edx+44]
jbe SHORT $LN59@inflate
; 1129 : if (state->sane) {
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+7104], 0
je SHORT $LN59@inflate
; 1130 : strm->msg = (char *)"invalid distance too far back";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG86234
; 1131 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 1132 : break;
jmp $LN490@inflate
$LN59@inflate:
; 1133 : }
; 1134 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
; 1135 : Trace((stderr, "inflate.c too far\n"));
; 1136 : copy -= state->whave;
; 1137 : if (copy > state->length) copy = state->length;
; 1138 : if (copy > left) copy = left;
; 1139 : left -= copy;
; 1140 : state->length -= copy;
; 1141 : do {
; 1142 : *put++ = 0;
; 1143 : } while (--copy);
; 1144 : if (state->length == 0) state->mode = LEN;
; 1145 : break;
; 1146 : #endif
; 1147 : }
; 1148 : if (copy > state->wnext) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _copy$[ebp]
cmp edx, DWORD PTR [ecx+48]
jbe SHORT $LN57@inflate
; 1149 : copy -= state->wnext;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _copy$[ebp]
sub ecx, DWORD PTR [eax+48]
mov DWORD PTR _copy$[ebp], ecx
; 1150 : from = state->window + (state->wsize - copy);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+40]
sub eax, DWORD PTR _copy$[ebp]
mov ecx, DWORD PTR _state$[ebp]
add eax, DWORD PTR [ecx+52]
mov DWORD PTR _from$[ebp], eax
; 1151 : }
; 1152 : else
jmp SHORT $LN56@inflate
$LN57@inflate:
; 1153 : from = state->window + (state->wnext - copy);
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+48]
sub eax, DWORD PTR _copy$[ebp]
mov ecx, DWORD PTR _state$[ebp]
add eax, DWORD PTR [ecx+52]
mov DWORD PTR _from$[ebp], eax
$LN56@inflate:
; 1154 : if (copy > state->length) copy = state->length;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _copy$[ebp]
cmp eax, DWORD PTR [edx+64]
jbe SHORT $LN55@inflate
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
mov DWORD PTR _copy$[ebp], edx
$LN55@inflate:
; 1155 : }
; 1156 : else { /* copy from output */
jmp SHORT $LN54@inflate
$LN60@inflate:
; 1157 : from = put - state->offset;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _put$[ebp]
sub ecx, DWORD PTR [eax+68]
mov DWORD PTR _from$[ebp], ecx
; 1158 : copy = state->length;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+64]
mov DWORD PTR _copy$[ebp], eax
$LN54@inflate:
; 1159 : }
; 1160 : if (copy > left) copy = left;
mov ecx, DWORD PTR _copy$[ebp]
cmp ecx, DWORD PTR _left$[ebp]
jbe SHORT $LN53@inflate
mov edx, DWORD PTR _left$[ebp]
mov DWORD PTR _copy$[ebp], edx
$LN53@inflate:
; 1161 : left -= copy;
mov eax, DWORD PTR _left$[ebp]
sub eax, DWORD PTR _copy$[ebp]
mov DWORD PTR _left$[ebp], eax
; 1162 : state->length -= copy;
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+64]
sub edx, DWORD PTR _copy$[ebp]
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax+64], edx
$LN52@inflate:
; 1163 : do {
; 1164 : *put++ = *from++;
mov ecx, DWORD PTR _put$[ebp]
mov edx, DWORD PTR _from$[ebp]
mov al, BYTE PTR [edx]
mov BYTE PTR [ecx], al
mov ecx, DWORD PTR _put$[ebp]
add ecx, 1
mov DWORD PTR _put$[ebp], ecx
mov edx, DWORD PTR _from$[ebp]
add edx, 1
mov DWORD PTR _from$[ebp], edx
; 1165 : } while (--copy);
mov eax, DWORD PTR _copy$[ebp]
sub eax, 1
mov DWORD PTR _copy$[ebp], eax
jne SHORT $LN52@inflate
; 1166 : if (state->length == 0) state->mode = LEN;
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+64], 0
jne SHORT $LN49@inflate
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 20 ; 00000014H
$LN49@inflate:
; 1167 : break;
jmp $LN490@inflate
$LN48@inflate:
; 1168 : case LIT:
; 1169 : if (left == 0) goto inf_leave;
cmp DWORD PTR _left$[ebp], 0
jne SHORT $LN47@inflate
jmp $inf_leave$520
$LN47@inflate:
; 1170 : *put++ = (unsigned char)(state->length);
mov eax, DWORD PTR _put$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov dl, BYTE PTR [ecx+64]
mov BYTE PTR [eax], dl
mov eax, DWORD PTR _put$[ebp]
add eax, 1
mov DWORD PTR _put$[ebp], eax
; 1171 : left--;
mov ecx, DWORD PTR _left$[ebp]
sub ecx, 1
mov DWORD PTR _left$[ebp], ecx
; 1172 : state->mode = LEN;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 20 ; 00000014H
; 1173 : break;
jmp $LN490@inflate
$LN46@inflate:
; 1174 : case CHECK:
; 1175 : if (state->wrap) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+8], 0
je $LN45@inflate
$LN41@inflate:
; 1176 : NEEDBITS(32);
cmp DWORD PTR _bits$[ebp], 32 ; 00000020H
jae SHORT $LN43@inflate
$LN39@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN36@inflate
jmp $inf_leave$520
$LN36@inflate:
mov ecx, DWORD PTR _have$[ebp]
sub ecx, 1
mov DWORD PTR _have$[ebp], ecx
mov edx, DWORD PTR _next$[ebp]
movzx eax, BYTE PTR [edx]
mov ecx, DWORD PTR _bits$[ebp]
shl eax, cl
add eax, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], eax
mov ecx, DWORD PTR _next$[ebp]
add ecx, 1
mov DWORD PTR _next$[ebp], ecx
mov edx, DWORD PTR _bits$[ebp]
add edx, 8
mov DWORD PTR _bits$[ebp], edx
xor eax, eax
jne SHORT $LN39@inflate
jmp SHORT $LN41@inflate
$LN43@inflate:
xor ecx, ecx
jne SHORT $LN41@inflate
; 1177 : out -= left;
mov edx, DWORD PTR _out$[ebp]
sub edx, DWORD PTR _left$[ebp]
mov DWORD PTR _out$[ebp], edx
; 1178 : strm->total_out += out;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+20]
add ecx, DWORD PTR _out$[ebp]
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+20], ecx
; 1179 : state->total += out;
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+28]
add ecx, DWORD PTR _out$[ebp]
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx+28], ecx
; 1180 : if (out)
cmp DWORD PTR _out$[ebp], 0
je SHORT $LN35@inflate
; 1181 : strm->adler = state->check =
; 1182 : UPDATE(state->check, put - out, out);
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+16], 0
je SHORT $LN506@inflate
mov ecx, DWORD PTR _out$[ebp]
push ecx
mov edx, DWORD PTR _put$[ebp]
sub edx, DWORD PTR _out$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _crc32@12
mov DWORD PTR tv1271[ebp], eax
jmp SHORT $LN507@inflate
$LN506@inflate:
mov edx, DWORD PTR _out$[ebp]
push edx
mov eax, DWORD PTR _put$[ebp]
sub eax, DWORD PTR _out$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
push edx
call _adler32@12
mov DWORD PTR tv1271[ebp], eax
$LN507@inflate:
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR tv1271[ebp]
mov DWORD PTR [eax+24], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR tv1271[ebp]
mov DWORD PTR [edx+48], eax
$LN35@inflate:
; 1183 : out = left;
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR _out$[ebp], ecx
; 1184 : if ((
; 1185 : #ifdef GUNZIP
; 1186 : state->flags ? hold :
; 1187 : #endif
; 1188 : ZSWAP32(hold)) != state->check) {
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+16], 0
je SHORT $LN508@inflate
mov eax, DWORD PTR _hold$[ebp]
mov DWORD PTR tv1285[ebp], eax
jmp SHORT $LN509@inflate
$LN508@inflate:
mov ecx, DWORD PTR _hold$[ebp]
shr ecx, 24 ; 00000018H
and ecx, 255 ; 000000ffH
mov edx, DWORD PTR _hold$[ebp]
shr edx, 8
and edx, 65280 ; 0000ff00H
add ecx, edx
mov eax, DWORD PTR _hold$[ebp]
and eax, 65280 ; 0000ff00H
shl eax, 8
add ecx, eax
mov edx, DWORD PTR _hold$[ebp]
and edx, 255 ; 000000ffH
shl edx, 24 ; 00000018H
add ecx, edx
mov DWORD PTR tv1285[ebp], ecx
$LN509@inflate:
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR tv1285[ebp]
cmp ecx, DWORD PTR [eax+24]
je SHORT $LN33@inflate
; 1189 : strm->msg = (char *)"incorrect data check";
mov edx, DWORD PTR _strm$[ebp]
mov DWORD PTR [edx+24], OFFSET $SG86264
; 1190 : state->mode = BAD;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 29 ; 0000001dH
; 1191 : break;
jmp $LN490@inflate
$LN33@inflate:
; 1192 : }
; 1193 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor ecx, ecx
jne SHORT $LN33@inflate
$LN45@inflate:
; 1194 : Tracev((stderr, "inflate: check matches trailer\n"));
; 1195 : }
; 1196 : #ifdef GUNZIP
; 1197 : state->mode = LENGTH;
mov edx, DWORD PTR _state$[ebp]
mov DWORD PTR [edx], 27 ; 0000001bH
$LN30@inflate:
; 1198 : case LENGTH:
; 1199 : if (state->wrap && state->flags) {
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+8], 0
je $LN29@inflate
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx+16], 0
je SHORT $LN29@inflate
$LN25@inflate:
; 1200 : NEEDBITS(32);
cmp DWORD PTR _bits$[ebp], 32 ; 00000020H
jae SHORT $LN27@inflate
$LN23@inflate:
cmp DWORD PTR _have$[ebp], 0
jne SHORT $LN20@inflate
jmp $inf_leave$520
$LN20@inflate:
mov edx, DWORD PTR _have$[ebp]
sub edx, 1
mov DWORD PTR _have$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
movzx edx, BYTE PTR [eax]
mov ecx, DWORD PTR _bits$[ebp]
shl edx, cl
add edx, DWORD PTR _hold$[ebp]
mov DWORD PTR _hold$[ebp], edx
mov eax, DWORD PTR _next$[ebp]
add eax, 1
mov DWORD PTR _next$[ebp], eax
mov ecx, DWORD PTR _bits$[ebp]
add ecx, 8
mov DWORD PTR _bits$[ebp], ecx
xor edx, edx
jne SHORT $LN23@inflate
jmp SHORT $LN25@inflate
$LN27@inflate:
xor eax, eax
jne SHORT $LN25@inflate
; 1201 : if (hold != (state->total & 0xffffffffUL)) {
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR _hold$[ebp]
cmp edx, DWORD PTR [ecx+28]
je SHORT $LN18@inflate
; 1202 : strm->msg = (char *)"incorrect length check";
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+24], OFFSET $SG86284
; 1203 : state->mode = BAD;
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx], 29 ; 0000001dH
; 1204 : break;
jmp SHORT $LN490@inflate
$LN18@inflate:
; 1205 : }
; 1206 : INITBITS();
mov DWORD PTR _hold$[ebp], 0
mov DWORD PTR _bits$[ebp], 0
xor edx, edx
jne SHORT $LN18@inflate
$LN29@inflate:
; 1207 : Tracev((stderr, "inflate: length matches trailer\n"));
; 1208 : }
; 1209 : #endif
; 1210 : state->mode = DONE;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 28 ; 0000001cH
$LN15@inflate:
; 1211 : case DONE:
; 1212 : ret = Z_STREAM_END;
mov DWORD PTR _ret$[ebp], 1
; 1213 : goto inf_leave;
jmp SHORT $inf_leave$520
$LN14@inflate:
; 1214 : case BAD:
; 1215 : ret = Z_DATA_ERROR;
mov DWORD PTR _ret$[ebp], -3 ; fffffffdH
; 1216 : goto inf_leave;
jmp SHORT $inf_leave$520
$LN13@inflate:
; 1217 : case MEM:
; 1218 : return Z_MEM_ERROR;
mov eax, -4 ; fffffffcH
jmp $LN500@inflate
$LN12@inflate:
; 1219 : case SYNC:
; 1220 : default:
; 1221 : return Z_STREAM_ERROR;
mov eax, -2 ; fffffffeH
jmp $LN500@inflate
$LN490@inflate:
; 1222 : }
jmp $LN493@inflate
$inf_leave$520:
; 1223 :
; 1224 : /*
; 1225 : Return from inflate(), updating the total counts and the check value.
; 1226 : If there was no progress during the inflate() call, return a buffer
; 1227 : error. Call updatewindow() to create and/or update the window state.
; 1228 : Note: a memory error from inflate() is non-recoverable.
; 1229 : */
; 1230 : inf_leave:
; 1231 : RESTORE();
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _put$[ebp]
mov DWORD PTR [ecx+12], edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _left$[ebp]
mov DWORD PTR [eax+16], ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR _next$[ebp]
mov DWORD PTR [edx], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _have$[ebp]
mov DWORD PTR [ecx+4], edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR _hold$[ebp]
mov DWORD PTR [eax+56], ecx
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR _bits$[ebp]
mov DWORD PTR [edx+60], eax
xor ecx, ecx
jne SHORT $inf_leave$520
; 1232 : if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
; 1233 : (state->mode < CHECK || flush != Z_FINISH)))
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+40], 0
jne SHORT $LN7@inflate
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _out$[ebp]
cmp ecx, DWORD PTR [eax+16]
je SHORT $LN8@inflate
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx], 29 ; 0000001dH
jge SHORT $LN8@inflate
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 26 ; 0000001aH
jl SHORT $LN7@inflate
cmp DWORD PTR _flush$[ebp], 4
je SHORT $LN8@inflate
$LN7@inflate:
; 1234 : if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _out$[ebp]
sub edx, DWORD PTR [ecx+16]
push edx
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR [eax+12]
push ecx
mov edx, DWORD PTR _strm$[ebp]
push edx
call _updatewindow
add esp, 12 ; 0000000cH
test eax, eax
je SHORT $LN8@inflate
; 1235 : state->mode = MEM;
mov eax, DWORD PTR _state$[ebp]
mov DWORD PTR [eax], 30 ; 0000001eH
; 1236 : return Z_MEM_ERROR;
mov eax, -4 ; fffffffcH
jmp $LN500@inflate
$LN8@inflate:
; 1237 : }
; 1238 : in -= strm->avail_in;
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR _in$[ebp]
sub edx, DWORD PTR [ecx+4]
mov DWORD PTR _in$[ebp], edx
; 1239 : out -= strm->avail_out;
mov eax, DWORD PTR _strm$[ebp]
mov ecx, DWORD PTR _out$[ebp]
sub ecx, DWORD PTR [eax+16]
mov DWORD PTR _out$[ebp], ecx
; 1240 : strm->total_in += in;
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+8]
add eax, DWORD PTR _in$[ebp]
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+8], eax
; 1241 : strm->total_out += out;
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+20]
add eax, DWORD PTR _out$[ebp]
mov ecx, DWORD PTR _strm$[ebp]
mov DWORD PTR [ecx+20], eax
; 1242 : state->total += out;
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR [edx+28]
add eax, DWORD PTR _out$[ebp]
mov ecx, DWORD PTR _state$[ebp]
mov DWORD PTR [ecx+28], eax
; 1243 : if (state->wrap && out)
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx+8], 0
je SHORT $LN4@inflate
cmp DWORD PTR _out$[ebp], 0
je SHORT $LN4@inflate
; 1244 : strm->adler = state->check =
; 1245 : UPDATE(state->check, strm->next_out - out, out);
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+16], 0
je SHORT $LN510@inflate
mov ecx, DWORD PTR _out$[ebp]
push ecx
mov edx, DWORD PTR _strm$[ebp]
mov eax, DWORD PTR [edx+12]
sub eax, DWORD PTR _out$[ebp]
push eax
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+24]
push edx
call _crc32@12
mov DWORD PTR tv1372[ebp], eax
jmp SHORT $LN511@inflate
$LN510@inflate:
mov eax, DWORD PTR _out$[ebp]
push eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR [ecx+12]
sub edx, DWORD PTR _out$[ebp]
push edx
mov eax, DWORD PTR _state$[ebp]
mov ecx, DWORD PTR [eax+24]
push ecx
call _adler32@12
mov DWORD PTR tv1372[ebp], eax
$LN511@inflate:
mov edx, DWORD PTR _state$[ebp]
mov eax, DWORD PTR tv1372[ebp]
mov DWORD PTR [edx+24], eax
mov ecx, DWORD PTR _strm$[ebp]
mov edx, DWORD PTR tv1372[ebp]
mov DWORD PTR [ecx+48], edx
$LN4@inflate:
; 1246 : strm->data_type = state->bits + (state->last ? 64 : 0) +
; 1247 : (state->mode == TYPE ? 128 : 0) +
; 1248 : (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax+4], 0
je SHORT $LN512@inflate
mov DWORD PTR tv1377[ebp], 64 ; 00000040H
jmp SHORT $LN513@inflate
$LN512@inflate:
mov DWORD PTR tv1377[ebp], 0
$LN513@inflate:
mov ecx, DWORD PTR _state$[ebp]
cmp DWORD PTR [ecx], 11 ; 0000000bH
jne SHORT $LN514@inflate
mov DWORD PTR tv1381[ebp], 128 ; 00000080H
jmp SHORT $LN515@inflate
$LN514@inflate:
mov DWORD PTR tv1381[ebp], 0
$LN515@inflate:
mov edx, DWORD PTR _state$[ebp]
cmp DWORD PTR [edx], 19 ; 00000013H
je SHORT $LN516@inflate
mov eax, DWORD PTR _state$[ebp]
cmp DWORD PTR [eax], 14 ; 0000000eH
je SHORT $LN516@inflate
mov DWORD PTR tv1387[ebp], 0
jmp SHORT $LN517@inflate
$LN516@inflate:
mov DWORD PTR tv1387[ebp], 256 ; 00000100H
$LN517@inflate:
mov ecx, DWORD PTR _state$[ebp]
mov edx, DWORD PTR [ecx+60]
add edx, DWORD PTR tv1377[ebp]
add edx, DWORD PTR tv1381[ebp]
add edx, DWORD PTR tv1387[ebp]
mov eax, DWORD PTR _strm$[ebp]
mov DWORD PTR [eax+44], edx
; 1249 : if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
cmp DWORD PTR _in$[ebp], 0
jne SHORT $LN1@inflate
cmp DWORD PTR _out$[ebp], 0
je SHORT $LN2@inflate
$LN1@inflate:
cmp DWORD PTR _flush$[ebp], 4
jne SHORT $LN3@inflate
$LN2@inflate:
cmp DWORD PTR _ret$[ebp], 0
jne SHORT $LN3@inflate
; 1250 : ret = Z_BUF_ERROR;
mov DWORD PTR _ret$[ebp], -5 ; fffffffbH
$LN3@inflate:
; 1251 : return ret;
mov eax, DWORD PTR _ret$[ebp]
$LN500@inflate:
; 1252 : }
mov esp, ebp
pop ebp
ret 8
$LN518@inflate:
DD $LN489@inflate
DD $LN454@inflate
DD $LN434@inflate
DD $LN416@inflate
DD $LN402@inflate
DD $LN381@inflate
DD $LN374@inflate
DD $LN362@inflate
DD $LN350@inflate
DD $LN330@inflate
DD $LN321@inflate
DD $LN316@inflate
DD $LN313@inflate
DD $LN282@inflate
DD $LN265@inflate
DD $LN264@inflate
DD $LN255@inflate
DD $LN237@inflate
DD $LN219@inflate
DD $LN147@inflate
DD $LN146@inflate
DD $LN113@inflate
DD $LN98@inflate
DD $LN76@inflate
DD $LN62@inflate
DD $LN48@inflate
DD $LN46@inflate
DD $LN30@inflate
DD $LN15@inflate
DD $LN14@inflate
DD $LN13@inflate
$LN519@inflate:
DD $LN294@inflate
DD $LN293@inflate
DD $LN288@inflate
DD $LN287@inflate
_inflate@8 ENDP
_TEXT ENDS
END
|
programs/oeis/108/A108211.asm | neoneye/loda | 22 | 240628 | ; A108211: a(n) = 16*n^2 + 1.
; 17,65,145,257,401,577,785,1025,1297,1601,1937,2305,2705,3137,3601,4097,4625,5185,5777,6401,7057,7745,8465,9217,10001,10817,11665,12545,13457,14401,15377,16385,17425,18497,19601,20737,21905,23105,24337,25601,26897,28225,29585,30977,32401,33857,35345,36865,38417,40001,41617,43265,44945,46657,48401,50177,51985,53825,55697,57601,59537,61505,63505,65537,67601,69697,71825,73985,76177,78401,80657,82945,85265,87617,90001,92417,94865,97345,99857,102401,104977,107585,110225,112897,115601,118337,121105,123905,126737,129601,132497,135425,138385,141377,144401,147457,150545,153665,156817,160001
add $0,1
mul $0,4
pow $0,2
add $0,1
|
programs/oeis/001/A001045.asm | neoneye/loda | 22 | 244437 | ; A001045: Jacobsthal sequence (or Jacobsthal numbers): a(n) = a(n-1) + 2*a(n-2), with a(0) = 0, a(1) = 1; also a(n) = nearest integer to 2^n/3.
; 0,1,1,3,5,11,21,43,85,171,341,683,1365,2731,5461,10923,21845,43691,87381,174763,349525,699051,1398101,2796203,5592405,11184811,22369621,44739243,89478485,178956971,357913941,715827883,1431655765,2863311531,5726623061,11453246123,22906492245,45812984491,91625968981,183251937963,366503875925,733007751851,1466015503701,2932031007403,5864062014805,11728124029611,23456248059221,46912496118443,93824992236885,187649984473771,375299968947541,750599937895083,1501199875790165,3002399751580331,6004799503160661,12009599006321323,24019198012642645,48038396025285291,96076792050570581,192153584101141163,384307168202282325,768614336404564651,1537228672809129301,3074457345618258603,6148914691236517205,12297829382473034411,24595658764946068821,49191317529892137643,98382635059784275285,196765270119568550571,393530540239137101141,787061080478274202283,1574122160956548404565,3148244321913096809131,6296488643826193618261,12592977287652387236523,25185954575304774473045,50371909150609548946091,100743818301219097892181,201487636602438195784363,402975273204876391568725,805950546409752783137451,1611901092819505566274901,3223802185639011132549803,6447604371278022265099605,12895208742556044530199211,25790417485112089060398421,51580834970224178120796843,103161669940448356241593685,206323339880896712483187371,412646679761793424966374741,825293359523586849932749483,1650586719047173699865498965,3301173438094347399730997931,6602346876188694799461995861,13204693752377389598923991723,26409387504754779197847983445,52818775009509558395695966891,105637550019019116791391933781,211275100038038233582783867563
mov $1,2
pow $1,$0
add $1,1
div $1,3
mov $0,$1
|
tests/items-test_data-tests-inventory_container.ads | thindil/steamsky | 80 | 3085 | <reponame>thindil/steamsky<filename>tests/items-test_data-tests-inventory_container.ads
package Items.Test_Data.Tests.Inventory_Container is
end Items.Test_Data.Tests.Inventory_Container;
|
oeis/052/A052623.asm | neoneye/loda-programs | 11 | 99950 | ; A052623: E.g.f. x(1-x)^2/(1-3x+x^2).
; Submitted by <NAME>(s1)
; 0,1,2,18,192,2520,39600,725760,15200640,358162560,9376819200,270037152000,8483597337600,288734500454400,10582834303641600,415593298568448000,17408598098411520000,774797125808369664000
mov $1,-1
mov $2,1
mov $3,$0
lpb $3
mul $1,$3
mul $2,$3
add $1,$2
add $2,$1
sub $3,1
lpe
max $0,$1
|
_maps/Buzz Bomber Missile.asm | kodishmediacenter/msu-md-sonic | 9 | 97646 | ; ---------------------------------------------------------------------------
; Sprite mappings - missile that Buzz Bomber throws
; ---------------------------------------------------------------------------
Map_Missile_internal:
dc.w @Flare1-Map_Missile_internal
dc.w @Flare2-Map_Missile_internal
dc.w @Ball1-Map_Missile_internal
dc.w @Ball2-Map_Missile_internal
@Flare1: dc.b 1
dc.b $F8, 5, 0, $24, $F8 ; buzz bomber firing flare
@Flare2: dc.b 1
dc.b $F8, 5, 0, $28, $F8
@Ball1: dc.b 1
dc.b $F8, 5, 0, $2C, $F8 ; missile itself
@Ball2: dc.b 1
dc.b $F8, 5, 0, $33, $F8
even |
alloy4fun_models/trashltl/models/7/toDv6FRfGb4hYgQrh.als | Kaixi26/org.alloytools.alloy | 0 | 3397 | open main
pred idtoDv6FRfGb4hYgQrh_prop8 {
eventually all f:File | one f.link implies eventually f in Trash
}
pred __repair { idtoDv6FRfGb4hYgQrh_prop8 }
check __repair { idtoDv6FRfGb4hYgQrh_prop8 <=> prop8o } |
source/nodes/program-nodes-entry_declarations.ads | reznikmm/gela | 0 | 24281 | <gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Discrete_Ranges;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Entry_Declarations;
with Program.Element_Visitors;
package Program.Nodes.Entry_Declarations is
pragma Preelaborate;
type Entry_Declaration is
new Program.Nodes.Node
and Program.Elements.Entry_Declarations.Entry_Declaration
and Program.Elements.Entry_Declarations.Entry_Declaration_Text
with private;
function Create
(Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Entry_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Entry_Family_Definition : Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Entry_Declaration;
type Implicit_Entry_Declaration is
new Program.Nodes.Node
and Program.Elements.Entry_Declarations.Entry_Declaration
with private;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Entry_Family_Definition : Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Has_Not : Boolean := False;
Has_Overriding : Boolean := False)
return Implicit_Entry_Declaration
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Entry_Declaration is
abstract new Program.Nodes.Node
and Program.Elements.Entry_Declarations.Entry_Declaration
with record
Name : not null Program.Elements
.Defining_Identifiers.Defining_Identifier_Access;
Entry_Family_Definition : Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
end record;
procedure Initialize (Self : in out Base_Entry_Declaration'Class);
overriding procedure Visit
(Self : not null access Base_Entry_Declaration;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Name
(Self : Base_Entry_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
overriding function Entry_Family_Definition
(Self : Base_Entry_Declaration)
return Program.Elements.Discrete_Ranges.Discrete_Range_Access;
overriding function Parameters
(Self : Base_Entry_Declaration)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
overriding function Aspects
(Self : Base_Entry_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
overriding function Is_Entry_Declaration
(Self : Base_Entry_Declaration)
return Boolean;
overriding function Is_Declaration
(Self : Base_Entry_Declaration)
return Boolean;
type Entry_Declaration is
new Base_Entry_Declaration
and Program.Elements.Entry_Declarations.Entry_Declaration_Text
with record
Not_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Right_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Entry_Declaration_Text
(Self : in out Entry_Declaration)
return Program.Elements.Entry_Declarations.Entry_Declaration_Text_Access;
overriding function Not_Token
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Overriding_Token
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Entry_Token
(Self : Entry_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Left_Bracket_Token
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Right_Bracket_Token
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Left_Bracket_Token_2
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Right_Bracket_Token_2
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function With_Token
(Self : Entry_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Entry_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Has_Not (Self : Entry_Declaration) return Boolean;
overriding function Has_Overriding
(Self : Entry_Declaration)
return Boolean;
type Implicit_Entry_Declaration is
new Base_Entry_Declaration
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
Has_Not : Boolean;
Has_Overriding : Boolean;
end record;
overriding function To_Entry_Declaration_Text
(Self : in out Implicit_Entry_Declaration)
return Program.Elements.Entry_Declarations.Entry_Declaration_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Entry_Declaration)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Entry_Declaration)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Entry_Declaration)
return Boolean;
overriding function Has_Not
(Self : Implicit_Entry_Declaration)
return Boolean;
overriding function Has_Overriding
(Self : Implicit_Entry_Declaration)
return Boolean;
end Program.Nodes.Entry_Declarations;
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0_notsx.log_8_1657.asm | ljhsiun2/medusa | 9 | 94312 | <filename>Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0_notsx.log_8_1657.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x19024, %rsi
lea addresses_normal_ht+0x18394, %rdi
nop
nop
add $50105, %r9
mov $110, %rcx
rep movsq
nop
dec %rcx
lea addresses_normal_ht+0x15304, %rbp
nop
nop
nop
nop
nop
xor %rsi, %rsi
mov (%rbp), %rax
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r8
push %rbp
push %rbx
push %rcx
// Store
lea addresses_UC+0x112d8, %rbx
nop
nop
xor %r10, %r10
mov $0x5152535455565758, %rbp
movq %rbp, (%rbx)
nop
nop
sub %r10, %r10
// Store
lea addresses_PSE+0xf9bc, %r10
sub %r13, %r13
movb $0x51, (%r10)
nop
nop
nop
add %r13, %r13
// Load
lea addresses_A+0x1ef04, %rcx
nop
nop
sub $51001, %rbp
mov (%rcx), %r8
inc %rbp
// Store
mov $0x9c4, %rbx
sub $51040, %rbp
mov $0x5152535455565758, %r13
movq %r13, %xmm7
vmovaps %ymm7, (%rbx)
nop
nop
nop
nop
xor %rcx, %rcx
// Store
lea addresses_WC+0xa1c4, %rbx
nop
nop
nop
and %rcx, %rcx
movw $0x5152, (%rbx)
nop
nop
nop
nop
nop
sub $48871, %r10
// Store
lea addresses_normal+0x940a, %r8
nop
nop
xor %rbp, %rbp
mov $0x5152535455565758, %r10
movq %r10, %xmm6
vmovaps %ymm6, (%r8)
add %rbp, %rbp
// Load
lea addresses_PSE+0x1cc86, %r8
nop
nop
nop
add $36646, %rbp
movb (%r8), %r15b
add %r13, %r13
// Faulty Load
lea addresses_A+0x59c4, %r15
nop
and $61358, %r13
movups (%r15), %xmm4
vpextrq $0, %xmm4, %rbx
lea oracles, %r15
and $0xff, %rbx
shlq $12, %rbx
mov (%r15,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'size': 32, 'NT': True, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'58': 8}
58 58 58 58 58 58 58 58
*/
|
Basic/Compiler/CorrectTo.agda | AndrasKovacs/SemanticsWithApplications | 8 | 13201 |
module Basic.Compiler.CorrectTo where
open import Data.List
open import Relation.Binary.PropositionalEquality
open import Basic.Compiler.Code
open import Basic.AST
open import Basic.BigStep
open import Utils.Decidable
{-
Lemma 3.21
One half of the correctness proof for the compiler.
The proof here is a bit neater than the one in the book. The book uses exercises 3.19 and 3.4
to concatenate instruction lists, while I use my _▷*<>_, which does the same in one step.
Otherwise the proofs are the same, and there's not much space for variations.
-}
𝓒-correct-to :
∀ {n}{S : St n}{s s'}
→ ⟨ S , s ⟩⟱ s' → ⟨ 𝓒⟦ S ⟧ˢ , [] , s ⟩▷*⟨ [] , [] , s' ⟩
𝓒-correct-to (ass {_}{x}{a}) = 𝓒-Exp-nat a ▷*<> STORE x ∷ done
𝓒-correct-to skip = NOOP ∷ done
𝓒-correct-to (a , b) = 𝓒-correct-to a ▷*<> 𝓒-correct-to b
𝓒-correct-to (if-true {s = s}{b = b} x p) with 𝓒-Exp-bool {e = []}{s = s} b
... | condition rewrite T→≡true x =
condition ▷*<> BRANCH-[] ∷ 𝓒-correct-to p
𝓒-correct-to (if-false {s = s}{b = b} x p) with 𝓒-Exp-bool {e = []}{s = s} b
... | condition rewrite F→≡false x =
condition ▷*<> BRANCH-[] ∷ 𝓒-correct-to p
𝓒-correct-to (while-true {s}{b = b} x p k) with 𝓒-Exp-bool {e = []}{s = s} b
... | condition rewrite T→≡true x =
LOOP ∷ condition ▷*<> BRANCH-[] ∷ 𝓒-correct-to p ▷*<> 𝓒-correct-to k
𝓒-correct-to (while-false {s}{S}{b} x) with 𝓒-Exp-bool {e = []}{s = s} b
... | condition rewrite F→≡false x =
LOOP ∷ condition ▷*<> BRANCH-[] ∷ NOOP ∷ done
|
media_driver/agnostic/gen11_icllp/vp/kernel_free/Source/Save_444Scale16_Dither_NV12.asm | ashakhno/media-driver | 660 | 167333 | <gh_stars>100-1000
/*
* Copyright (c) 2017, Intel Corporation
*
* 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.
*/
L0:
add (4|M0) a0.0<1>:w r22.0<4;4,1>:w 0x0:uw
mov (8|M0) r28.0<1>:ud r27.0<8;8,1>:ud
mov (8|M0) r37.0<1>:ud r27.0<8;8,1>:ud
mov (2|M0) r28.0<1>:d r7.0<2;2,1>:w
mov (1|M0) r37.0<1>:d r7.0<0;1,0>:w
shr (1|M0) r37.1<1>:d r7.1<0;1,0>:w 1:w
mov (1|M0) r28.2<1>:ud 0xF000F:ud
mov (1|M0) r37.2<1>:ud 0x7000F:ud
add (4|M0) a0.4<1>:w a0.0<4;4,1>:w r22.8<0;2,1>:w
mov (4|M0) r11.0<1>:ud 0x800000:ud
mov (4|M0) r11.4<1>:ud 0x4000C0:ud
and (1|M0) r17.0<1>:uw r2.5<0;1,0>:uw 0x700:uw
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x0:uw
(W&f1.0) jmpi L384
L224:
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x100:uw
(W&f1.0) jmpi L1616
L256:
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x200:uw
(W&f1.0) jmpi L2976
L288:
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x300:uw
(W&f1.0) jmpi L4208
L320:
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x400:uw
(W&f1.0) jmpi L5312
L352:
cmp (1|M0) (eq)f1.0 null.0<1>:uw r17.0<0;1,0>:uw 0x500:uw
(W&f1.0) jmpi L6544
L384:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r38.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r38.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r39.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r39.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r40.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r40.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r41.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,2]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,2]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r41.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
(W) jmpi L7632
L1616:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r38.0<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r38.16<2>:ub r46.9<16;4,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r38.1<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r38.17<2>:ub r46.9<16;4,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r39.0<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r39.16<2>:ub r46.9<16;4,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r39.1<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r39.17<2>:ub r46.9<16;4,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r40.0<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r40.16<2>:ub r46.9<16;4,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r40.1<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r40.17<2>:ub r46.9<16;4,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r41.0<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r41.16<2>:ub r46.9<16;4,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
avg (16|M0) r46.0<1>:uw r48.0<16;8,2>:uw r48.1<16;8,2>:uw
add (16|M0) (sat)r46.0<1>:uw r46.0<16;16,1>:uw 0x80:uw
mov (8|M0) r41.1<2>:ub r46.1<16;4,2>:ub
mov (8|M0) r41.17<2>:ub r46.9<16;4,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
(W) jmpi L7632
L2976:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.2,16]<16;4,2>:uw r[a0.2,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.6,16]<16;4,2>:uw r[a0.6,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r38.0<2>:ub r48.1<32;16,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.0,16]<16;4,2>:uw r[a0.0,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.4,16]<16;4,2>:uw r[a0.4,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r38.1<2>:ub r48.1<32;16,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.2,16]<16;4,2>:uw r[a0.2,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.6,16]<16;4,2>:uw r[a0.6,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r39.0<2>:ub r48.1<32;16,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.0,16]<16;4,2>:uw r[a0.0,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.4,16]<16;4,2>:uw r[a0.4,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r39.1<2>:ub r48.1<32;16,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.2,16]<16;4,2>:uw r[a0.2,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.6,16]<16;4,2>:uw r[a0.6,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r40.0<2>:ub r48.1<32;16,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.0,16]<16;4,2>:uw r[a0.0,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.4,16]<16;4,2>:uw r[a0.4,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r40.1<2>:ub r48.1<32;16,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.2,16]<16;4,2>:uw r[a0.2,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.6,16]<16;4,2>:uw r[a0.6,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r41.0<2>:ub r48.1<32;16,2>:ub
avg (8|M0) r46.0<1>:uw r[a0.0,16]<16;4,2>:uw r[a0.0,18]<16;4,2>:uw
avg (8|M0) r47.0<1>:uw r[a0.4,16]<16;4,2>:uw r[a0.4,18]<16;4,2>:uw
add (8|M0) (sat)r48.0<1>:uw r46.0<16;4,1>:uw 0x80:uw
add (8|M0) (sat)r48.8<1>:uw r46.4<16;4,1>:uw 0x80:uw
mov (16|M0) r41.1<2>:ub r48.1<32;16,2>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
(W) jmpi L7632
L4208:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6]<16;8,1>:uw 0x80:uw
mov (8|M0) r38.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r38.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4]<16;8,1>:uw 0x80:uw
mov (8|M0) r38.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r38.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6]<16;8,1>:uw 0x80:uw
mov (8|M0) r39.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r39.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4]<16;8,1>:uw 0x80:uw
mov (8|M0) r39.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r39.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6]<16;8,1>:uw 0x80:uw
mov (8|M0) r40.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r40.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4]<16;8,1>:uw 0x80:uw
mov (8|M0) r40.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r40.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6]<16;8,1>:uw 0x80:uw
mov (8|M0) r41.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r41.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4]<16;8,1>:uw 0x80:uw
mov (8|M0) r41.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r41.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
(W) jmpi L7632
L5312:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r38.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r38.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r39.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r39.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r40.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r40.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
avg (16|M0) r48.0<1>:uw r[a0.2]<16;8,1>:uw r[a0.2,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.6]<16;8,1>:uw r[a0.6,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r41.0<2>:ub r46.1<32;8,4>:ub
avg (16|M0) r48.0<1>:uw r[a0.0]<16;8,1>:uw r[a0.0,16]<16;8,1>:uw
avg (16|M0) r49.0<1>:uw r[a0.4]<16;8,1>:uw r[a0.4,16]<16;8,1>:uw
add (16|M0) (sat)r46.0<1>:uw r48.0<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r48.8<16;8,1>:uw 0x80:uw
mov (16|M0) r41.1<2>:ub r46.1<32;8,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
(W) jmpi L7632
L6544:
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r29.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r29.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r30.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r30.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r38.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r38.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r38.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r38.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r31.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r31.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r32.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r32.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r39.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r39.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r39.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r39.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r33.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r33.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r34.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r34.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r40.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r40.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r40.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r40.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
add (16|M0) (sat)r46.0<1>:uw r[a0.1]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r48.0<1>:uw r[a0.1,32]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.5]<16;16,1>:uw r11.0<16;16,1>:uw
add (16|M0) (sat)r49.0<1>:uw r[a0.5,32]<16;16,1>:uw r11.0<16;16,1>:uw
mov (16|M0) r35.0<1>:ub r46.1<32;8,2>:ub
mov (16|M0) r35.16<1>:ub r46.17<32;8,2>:ub
mov (16|M0) r36.0<1>:ub r48.1<32;8,2>:ub
mov (16|M0) r36.16<1>:ub r48.17<32;8,2>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.2,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.6,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r41.0<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r41.16<2>:ub r46.17<32;4,4>:ub
add (16|M0) (sat)r46.0<1>:uw r[a0.0,16]<16;8,1>:uw 0x80:uw
add (16|M0) (sat)r47.0<1>:uw r[a0.4,16]<16;8,1>:uw 0x80:uw
mov (8|M0) r41.1<2>:ub r46.1<32;4,4>:ub
mov (8|M0) r41.17<2>:ub r46.17<32;4,4>:ub
add (8|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
L7632:
add (1|M0) a0.0<1>:ud r2.3<0;1,0>:ub 0x120A8000:ud
send (1|M0) null:d r28:ub 0xC a0.0
add (1|M0) a0.0<1>:ud r2.3<0;1,0>:ub 0xA0A8001:ud
send (1|M0) null:d r37:ub 0xC a0.0
nop
|
programs/oeis/130/A130815.asm | neoneye/loda | 22 | 94290 | ; A130815: Period 6: repeat [1, 5, 4, -1, -5, -4].
; 1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4,1,5,4,-1,-5,-4
mov $1,1
mov $2,4
lpb $0
sub $0,1
add $1,$2
sub $2,$1
lpe
mov $0,$1
|
source/ll_release.asm | mateuszstompor/Linked-List-x86-64-ASM | 5 | 246959 | ;
; Created by <NAME> on 20/06/2019.
;
%include "source/list.asm"
%include "source/sizes.asm"
%include "source/offsets.asm"
%include "source/constants.asm"
%include "source/memory_management.asm"
global LL_RELEASE
section .text
LL_RELEASE:
; address sits in rdi register
push rbx
; deallocate list
mov rbx, [rdi]
mov rsi, LL_LIST_SIZE
call ll_mem_release
; deallocate nodes in the list if exist
deallocate_nodes:
cmp rbx, NULL_PTR
je finish
mov rdi, rbx
mov rbx, [rbx + 8]
mov rsi, LL_NODE_SIZE
call ll_mem_release
jmp deallocate_nodes
finish:
pop rbx
ret
|
ee/hot/rtfp.asm | olifink/smsqe | 0 | 24207 | ; Procedure return floating point V2.00 1988 <NAME> QJUMP
section hotkey
xdef hot_rtfp
xdef hot_rter
xref ut_chkri
xref ut_lfloat
xref ut_retfp
;+++
; Return floating point value of d1
;
; d1 c error return
; status returns 0
;---
hot_rtfp
move.l d1,d0
;+++
; Return error from function
;
; d0 c error return
; status returns 0
;---
hot_rter
move.l d0,-(sp)
moveq #6,d1
jsr ut_chkri ; check for room on stack
move.l (sp)+,d1
jsr ut_lfloat ; float error
jmp ut_retfp ; and return it
end
|
src/inidisp-glitch/inidisp_d7_glitch_test.asm | undisbeliever/snes-test-roms | 7 | 240967 | <filename>src/inidisp-glitch/inidisp_d7_glitch_test.asm
// Tests if writing to INIDISP when the previous value on the data bus
// has bit 7 set would cause a sprite glitch.
//
// This is an interactive test:
// * if A/B/X/Y button is not pressed then the test will write
// 0x80 to $20ff and `0x0f` to INIDISP.
//
// * if A/B/X/Y button is pressed then the test will write
// 0x00 to $20ff and `0x0f` to INIDISP.
//
// Copyright (c) 2021, <NAME> <<EMAIL>>.
// Distributed under The MIT License: https://opensource.org/licenses/MIT
define ROM_NAME = "INIDISP D7 GLITCH TEST"
define VERSION = 1
include "_inidisp_d7_common.inc"
au()
iu()
code()
function Main {
rep #$30
sep #$20
a8()
i16()
sei
SetupPpu()
lda.b #0x0f
sta.w INIDISP
lda.b #NMITIMEN.autoJoy
sta.w NMITIMEN
MainLoop:
// Check if a button is pressed
// There is not need to check `HVBJOY`, bad `JOY1` reads affect non-visible scanlines.
lda.b #JOYH.b | JOYH.y
bit.w JOY1H
bne ButtonPressed
lda.b #JOYL.a | JOYL.x
bit.w JOY1L
bne ButtonPressed
// No button pressed, write to 2100 with data bus b7 set
ldx.w #0x0f80
bra EndIf
ButtonPressed:
// No button pressed, write to 2100 with data bus b7 clear
ldx.w #0x0f00
EndIf:
// Wait until hBlank
-
assert(HVBJOY.hBlank == 0x40)
bit.w HVBJOY
bvc -
stx.w INIDISP - 1
// Wait until the end of hBlank
-
assert(HVBJOY.hBlank == 0x40)
bit.w HVBJOY
bvs -
bra MainLoop
}
|
programs/oeis/127/A127934.asm | karttu/loda | 0 | 2117 | <reponame>karttu/loda<filename>programs/oeis/127/A127934.asm
; A127934: a(8n)=8n+1, a(8n+1)=a(8n+2)=a(8n+3)=8n+5, a(8n+4)=8n+6, a(8n+5)=a(8n+6)=a(8n+7)=8n+8.
; 1,5,5,5,6,8,8,8,9,13,13,13,14,16,16,16,17,21,21,21,22,24,24,24,25,29,29,29,30,32,32,32,33,37,37,37,38,40,40,40,41,45,45,45,46,48,48,48,49,53,53,53,54,56,56,56,57,61,61,61,62,64,64,64,65,69,69,69,70,72,72,72,73,77,77,77,78,80,80,80,81,85,85,85,86,88,88,88,89,93,93,93,94,96,96,96,97,101,101,101,102,104,104,104,105,109,109,109,110,112,112,112,113,117,117,117,118,120,120,120,121,125,125,125,126,128,128,128,129,133,133,133,134,136,136,136,137,141,141,141,142,144,144,144,145,149,149,149,150,152,152,152,153,157,157,157,158,160,160,160,161,165,165,165,166,168,168,168,169,173,173,173,174,176,176,176,177,181,181,181,182,184,184,184,185,189,189,189,190,192,192,192,193,197,197,197,198,200,200,200,201,205,205,205,206,208,208,208,209,213,213,213,214,216,216,216,217,221,221,221,222,224,224,224,225,229,229,229,230,232,232,232,233,237,237,237,238,240,240,240,241,245,245,245,246,248,248,248,249,253
mov $3,$0
add $0,8
mov $2,1
lpb $0,1
add $0,2
mov $1,$2
add $4,4
add $1,$4
sub $1,1
mov $2,$4
trn $4,$0
sub $0,1
trn $0,5
add $1,$4
sub $2,$1
mov $4,1
lpe
lpb $3,1
add $1,1
sub $3,1
lpe
sub $1,3
|
antlr4/MySqlLexer.g4 | stella-go/stella | 0 | 1439 | /*
MySQL (Positive Technologies) grammar
The MIT License (MIT).
Copyright (c) 2015-2017, <NAME> (<EMAIL>), Positive Technologies.
Copyright (c) 2017, <NAME> (<EMAIL>)
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.
*/
lexer grammar MySqlLexer;
channels { MYSQLCOMMENT, ERRORCHANNEL }
// SKIP
SPACE: [ \t\r\n]+ -> channel(HIDDEN);
SPEC_MYSQL_COMMENT: '/*!' .+? '*/' -> channel(MYSQLCOMMENT);
COMMENT_INPUT: '/*' .*? '*/' -> channel(HIDDEN);
LINE_COMMENT: (
('-- ' | '#') ~[\r\n]* ('\r'? '\n' | EOF)
| '--' ('\r'? '\n' | EOF)
) -> channel(HIDDEN);
// Keywords
// Common Keywords
ADD: 'ADD';
ALL: 'ALL';
ALTER: 'ALTER';
ALWAYS: 'ALWAYS';
ANALYZE: 'ANALYZE';
AND: 'AND';
AS: 'AS';
ASC: 'ASC';
BEFORE: 'BEFORE';
BETWEEN: 'BETWEEN';
BOTH: 'BOTH';
BY: 'BY';
CALL: 'CALL';
CASCADE: 'CASCADE';
CASE: 'CASE';
CAST: 'CAST';
CHANGE: 'CHANGE';
CHARACTER: 'CHARACTER';
CHECK: 'CHECK';
COLLATE: 'COLLATE';
COLUMN: 'COLUMN';
CONDITION: 'CONDITION';
CONSTRAINT: 'CONSTRAINT';
CONTINUE: 'CONTINUE';
CONVERT: 'CONVERT';
CREATE: 'CREATE';
CROSS: 'CROSS';
CURRENT: 'CURRENT';
CURRENT_USER: 'CURRENT_USER';
CURSOR: 'CURSOR';
DATABASE: 'DATABASE';
DATABASES: 'DATABASES';
DECLARE: 'DECLARE';
DEFAULT: 'DEFAULT';
DELAYED: 'DELAYED';
DELETE: 'DELETE';
DESC: 'DESC';
DESCRIBE: 'DESCRIBE';
DETERMINISTIC: 'DETERMINISTIC';
DIAGNOSTICS: 'DIAGNOSTICS';
DISTINCT: 'DISTINCT';
DISTINCTROW: 'DISTINCTROW';
DROP: 'DROP';
EACH: 'EACH';
ELSE: 'ELSE';
ELSEIF: 'ELSEIF';
ENCLOSED: 'ENCLOSED';
ESCAPED: 'ESCAPED';
EXISTS: 'EXISTS';
EXIT: 'EXIT';
EXPLAIN: 'EXPLAIN';
FALSE: 'FALSE';
FETCH: 'FETCH';
FOR: 'FOR';
FORCE: 'FORCE';
FOREIGN: 'FOREIGN';
FROM: 'FROM';
FULLTEXT: 'FULLTEXT';
GENERATED: 'GENERATED';
GET: 'GET';
GRANT: 'GRANT';
GROUP: 'GROUP';
HAVING: 'HAVING';
HIGH_PRIORITY: 'HIGH_PRIORITY';
IF: 'IF';
IGNORE: 'IGNORE';
IN: 'IN';
INDEX: 'INDEX';
INFILE: 'INFILE';
INNER: 'INNER';
INOUT: 'INOUT';
INSERT: 'INSERT';
INTERVAL: 'INTERVAL';
INTO: 'INTO';
IS: 'IS';
ITERATE: 'ITERATE';
JOIN: 'JOIN';
KEY: 'KEY';
KEYS: 'KEYS';
KILL: 'KILL';
LEADING: 'LEADING';
LEAVE: 'LEAVE';
LEFT: 'LEFT';
LIKE: 'LIKE';
LIMIT: 'LIMIT';
LINEAR: 'LINEAR';
LINES: 'LINES';
LOAD: 'LOAD';
LOCK: 'LOCK';
LOOP: 'LOOP';
LOW_PRIORITY: 'LOW_PRIORITY';
MASTER_BIND: 'MASTER_BIND';
MASTER_SSL_VERIFY_SERVER_CERT: 'MASTER_SSL_VERIFY_SERVER_CERT';
MATCH: 'MATCH';
MAXVALUE: 'MAXVALUE';
MODIFIES: 'MODIFIES';
NATURAL: 'NATURAL';
NOT: 'NOT';
NO_WRITE_TO_BINLOG: 'NO_WRITE_TO_BINLOG';
NULL_LITERAL: 'NULL';
NUMBER: 'NUMBER';
ON: 'ON';
OPTIMIZE: 'OPTIMIZE';
OPTION: 'OPTION';
OPTIONALLY: 'OPTIONALLY';
OR: 'OR';
ORDER: 'ORDER';
OUT: 'OUT';
OUTER: 'OUTER';
OUTFILE: 'OUTFILE';
PARTITION: 'PARTITION';
PRIMARY: 'PRIMARY';
PROCEDURE: 'PROCEDURE';
PURGE: 'PURGE';
RANGE: 'RANGE';
READ: 'READ';
READS: 'READS';
REFERENCES: 'REFERENCES';
REGEXP: 'REGEXP';
RELEASE: 'RELEASE';
RENAME: 'RENAME';
REPEAT: 'REPEAT';
REPLACE: 'REPLACE';
REQUIRE: 'REQUIRE';
RESIGNAL: 'RESIGNAL';
RESTRICT: 'RESTRICT';
RETURN: 'RETURN';
REVOKE: 'REVOKE';
RIGHT: 'RIGHT';
RLIKE: 'RLIKE';
SCHEMA: 'SCHEMA';
SCHEMAS: 'SCHEMAS';
SELECT: 'SELECT';
SET: 'SET';
SEPARATOR: 'SEPARATOR';
SHOW: 'SHOW';
SIGNAL: 'SIGNAL';
SPATIAL: 'SPATIAL';
SQL: 'SQL';
SQLEXCEPTION: 'SQLEXCEPTION';
SQLSTATE: 'SQLSTATE';
SQLWARNING: 'SQLWARNING';
SQL_BIG_RESULT: 'SQL_BIG_RESULT';
SQL_CALC_FOUND_ROWS: 'SQL_CALC_FOUND_ROWS';
SQL_SMALL_RESULT: 'SQL_SMALL_RESULT';
SSL: 'SSL';
STACKED: 'STACKED';
STARTING: 'STARTING';
STRAIGHT_JOIN: 'STRAIGHT_JOIN';
TABLE: 'TABLE';
TERMINATED: 'TERMINATED';
THEN: 'THEN';
TO: 'TO';
TRAILING: 'TRAILING';
TRIGGER: 'TRIGGER';
TRUE: 'TRUE';
UNDO: 'UNDO';
UNION: 'UNION';
UNIQUE: 'UNIQUE';
UNLOCK: 'UNLOCK';
UNSIGNED: 'UNSIGNED';
UPDATE: 'UPDATE';
USAGE: 'USAGE';
USE: 'USE';
USING: 'USING';
VALUES: 'VALUES';
WHEN: 'WHEN';
WHERE: 'WHERE';
WHILE: 'WHILE';
WITH: 'WITH';
WRITE: 'WRITE';
XOR: 'XOR';
ZEROFILL: 'ZEROFILL';
// DATA TYPE Keywords
TINYINT: 'TINYINT';
SMALLINT: 'SMALLINT';
MEDIUMINT: 'MEDIUMINT';
MIDDLEINT: 'MIDDLEINT';
INT: 'INT';
INT1: 'INT1';
INT2: 'INT2';
INT3: 'INT3';
INT4: 'INT4';
INT8: 'INT8';
INTEGER: 'INTEGER';
BIGINT: 'BIGINT';
REAL: 'REAL';
DOUBLE: 'DOUBLE';
PRECISION: 'PRECISION';
FLOAT: 'FLOAT';
FLOAT4: 'FLOAT4';
FLOAT8: 'FLOAT8';
DECIMAL: 'DECIMAL';
DEC: 'DEC';
NUMERIC: 'NUMERIC';
DATE: 'DATE';
TIME: 'TIME';
TIMESTAMP: 'TIMESTAMP';
DATETIME: 'DATETIME';
YEAR: 'YEAR';
CHAR: 'CHAR';
VARCHAR: 'VARCHAR';
NVARCHAR: 'NVARCHAR';
NATIONAL: 'NATIONAL';
BINARY: 'BINARY';
VARBINARY: 'VARBINARY';
TINYBLOB: 'TINYBLOB';
BLOB: 'BLOB';
MEDIUMBLOB: 'MEDIUMBLOB';
LONG: 'LONG';
LONGBLOB: 'LONGBLOB';
TINYTEXT: 'TINYTEXT';
TEXT: 'TEXT';
MEDIUMTEXT: 'MEDIUMTEXT';
LONGTEXT: 'LONGTEXT';
ENUM: 'ENUM';
VARYING: 'VARYING';
SERIAL: 'SERIAL';
// Interval type Keywords
YEAR_MONTH: 'YEAR_MONTH';
DAY_HOUR: 'DAY_HOUR';
DAY_MINUTE: 'DAY_MINUTE';
DAY_SECOND: 'DAY_SECOND';
HOUR_MINUTE: 'HOUR_MINUTE';
HOUR_SECOND: 'HOUR_SECOND';
MINUTE_SECOND: 'MINUTE_SECOND';
SECOND_MICROSECOND: 'SECOND_MICROSECOND';
MINUTE_MICROSECOND: 'MINUTE_MICROSECOND';
HOUR_MICROSECOND: 'HOUR_MICROSECOND';
DAY_MICROSECOND: 'DAY_MICROSECOND';
// JSON keywords
JSON_VALID: 'JSON_VALID';
JSON_SCHEMA_VALID: 'JSON_SCHEMA_VALID';
// Group function Keywords
AVG: 'AVG';
BIT_AND: 'BIT_AND';
BIT_OR: 'BIT_OR';
BIT_XOR: 'BIT_XOR';
COUNT: 'COUNT';
GROUP_CONCAT: 'GROUP_CONCAT';
MAX: 'MAX';
MIN: 'MIN';
STD: 'STD';
STDDEV: 'STDDEV';
STDDEV_POP: 'STDDEV_POP';
STDDEV_SAMP: 'STDDEV_SAMP';
SUM: 'SUM';
VAR_POP: 'VAR_POP';
VAR_SAMP: 'VAR_SAMP';
VARIANCE: 'VARIANCE';
// Common function Keywords
CURRENT_DATE: 'CURRENT_DATE';
CURRENT_TIME: 'CURRENT_TIME';
CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP';
LOCALTIME: 'LOCALTIME';
CURDATE: 'CURDATE';
CURTIME: 'CURTIME';
DATE_ADD: 'DATE_ADD';
DATE_SUB: 'DATE_SUB';
EXTRACT: 'EXTRACT';
LOCALTIMESTAMP: 'LOCALTIMESTAMP';
NOW: 'NOW';
POSITION: 'POSITION';
SUBSTR: 'SUBSTR';
SUBSTRING: 'SUBSTRING';
SYSDATE: 'SYSDATE';
TRIM: 'TRIM';
UTC_DATE: 'UTC_DATE';
UTC_TIME: 'UTC_TIME';
UTC_TIMESTAMP: 'UTC_TIMESTAMP';
// Keywords, but can be ID
// Common Keywords, but can be ID
ACCOUNT: 'ACCOUNT';
ACTION: 'ACTION';
AFTER: 'AFTER';
AGGREGATE: 'AGGREGATE';
ALGORITHM: 'ALGORITHM';
ANY: 'ANY';
AT: 'AT';
AUTHORS: 'AUTHORS';
AUTOCOMMIT: 'AUTOCOMMIT';
AUTOEXTEND_SIZE: 'AUTOEXTEND_SIZE';
AUTO_INCREMENT: 'AUTO_INCREMENT';
AVG_ROW_LENGTH: 'AVG_ROW_LENGTH';
BEGIN: 'BEGIN';
BINLOG: 'BINLOG';
BIT: 'BIT';
BLOCK: 'BLOCK';
BOOL: 'BOOL';
BOOLEAN: 'BOOLEAN';
BTREE: 'BTREE';
CACHE: 'CACHE';
CASCADED: 'CASCADED';
CHAIN: 'CHAIN';
CHANGED: 'CHANGED';
CHANNEL: 'CHANNEL';
CHECKSUM: 'CHECKSUM';
PAGE_CHECKSUM: 'PAGE_CHECKSUM';
CIPHER: 'CIPHER';
CLASS_ORIGIN: 'CLASS_ORIGIN';
CLIENT: 'CLIENT';
CLOSE: 'CLOSE';
COALESCE: 'COALESCE';
CODE: 'CODE';
COLUMNS: 'COLUMNS';
COLUMN_FORMAT: 'COLUMN_FORMAT';
COLUMN_NAME: 'COLUMN_NAME';
COMMENT: 'COMMENT';
COMMIT: 'COMMIT';
COMPACT: 'COMPACT';
COMPLETION: 'COMPLETION';
COMPRESSED: 'COMPRESSED';
COMPRESSION: 'COMPRESSION';
CONCURRENT: 'CONCURRENT';
CONNECTION: 'CONNECTION';
CONSISTENT: 'CONSISTENT';
CONSTRAINT_CATALOG: 'CONSTRAINT_CATALOG';
CONSTRAINT_SCHEMA: 'CONSTRAINT_SCHEMA';
CONSTRAINT_NAME: 'CONSTRAINT_NAME';
CONTAINS: 'CONTAINS';
CONTEXT: 'CONTEXT';
CONTRIBUTORS: 'CONTRIBUTORS';
COPY: 'COPY';
CPU: 'CPU';
CURSOR_NAME: 'CURSOR_NAME';
DATA: 'DATA';
DATAFILE: 'DATAFILE';
DEALLOCATE: 'DEALLOCATE';
DEFAULT_AUTH: 'DEFAULT_AUTH';
DEFINER: 'DEFINER';
DELAY_KEY_WRITE: 'DELAY_KEY_WRITE';
DES_KEY_FILE: 'DES_KEY_FILE';
DIRECTORY: 'DIRECTORY';
DISABLE: 'DISABLE';
DISCARD: 'DISCARD';
DISK: 'DISK';
DO: 'DO';
DUMPFILE: 'DUMPFILE';
DUPLICATE: 'DUPLICATE';
DYNAMIC: 'DYNAMIC';
ENABLE: 'ENABLE';
ENCRYPTION: 'ENCRYPTION';
END: 'END';
ENDS: 'ENDS';
ENGINE: 'ENGINE';
ENGINES: 'ENGINES';
ERROR: 'ERROR';
ERRORS: 'ERRORS';
ESCAPE: 'ESCAPE';
EVEN: 'EVEN';
EVENT: 'EVENT';
EVENTS: 'EVENTS';
EVERY: 'EVERY';
EXCHANGE: 'EXCHANGE';
EXCLUSIVE: 'EXCLUSIVE';
EXPIRE: 'EXPIRE';
EXPORT: 'EXPORT';
EXTENDED: 'EXTENDED';
EXTENT_SIZE: 'EXTENT_SIZE';
FAST: 'FAST';
FAULTS: 'FAULTS';
FIELDS: 'FIELDS';
FILE_BLOCK_SIZE: 'FILE_BLOCK_SIZE';
FILTER: 'FILTER';
FIRST: 'FIRST';
FIXED: 'FIXED';
FLUSH: 'FLUSH';
FOLLOWS: 'FOLLOWS';
FOUND: 'FOUND';
FULL: 'FULL';
FUNCTION: 'FUNCTION';
GENERAL: 'GENERAL';
GLOBAL: 'GLOBAL';
GRANTS: 'GRANTS';
GROUP_REPLICATION: 'GROUP_REPLICATION';
HANDLER: 'HANDLER';
HASH: 'HASH';
HELP: 'HELP';
HOST: 'HOST';
HOSTS: 'HOSTS';
IDENTIFIED: 'IDENTIFIED';
IGNORE_SERVER_IDS: 'IGNORE_SERVER_IDS';
IMPORT: 'IMPORT';
INDEXES: 'INDEXES';
INITIAL_SIZE: 'INITIAL_SIZE';
INPLACE: 'INPLACE';
INSERT_METHOD: 'INSERT_METHOD';
INSTALL: 'INSTALL';
INSTANCE: 'INSTANCE';
INVISIBLE: 'INVISIBLE';
INVOKER: 'INVOKER';
IO: 'IO';
IO_THREAD: 'IO_THREAD';
IPC: 'IPC';
ISOLATION: 'ISOLATION';
ISSUER: 'ISSUER';
JSON: 'JSON';
KEY_BLOCK_SIZE: 'KEY_BLOCK_SIZE';
LANGUAGE: 'LANGUAGE';
LAST: 'LAST';
LEAVES: 'LEAVES';
LESS: 'LESS';
LEVEL: 'LEVEL';
LIST: 'LIST';
LOCAL: 'LOCAL';
LOGFILE: 'LOGFILE';
LOGS: 'LOGS';
MASTER: 'MASTER';
MASTER_AUTO_POSITION: 'MASTER_AUTO_POSITION';
MASTER_CONNECT_RETRY: 'MASTER_CONNECT_RETRY';
MASTER_DELAY: 'MASTER_DELAY';
MASTER_HEARTBEAT_PERIOD: 'MASTER_HEARTBEAT_PERIOD';
MASTER_HOST: 'MASTER_HOST';
MASTER_LOG_FILE: 'MASTER_LOG_FILE';
MASTER_LOG_POS: 'MASTER_LOG_POS';
MASTER_PASSWORD: 'MASTER_PASSWORD';
MASTER_PORT: 'MASTER_PORT';
MASTER_RETRY_COUNT: 'MASTER_RETRY_COUNT';
MASTER_SSL: 'MASTER_SSL';
MASTER_SSL_CA: 'MASTER_SSL_CA';
MASTER_SSL_CAPATH: 'MASTER_SSL_CAPATH';
MASTER_SSL_CERT: 'MASTER_SSL_CERT';
MASTER_SSL_CIPHER: 'MASTER_SSL_CIPHER';
MASTER_SSL_CRL: 'MASTER_SSL_CRL';
MASTER_SSL_CRLPATH: 'MASTER_SSL_CRLPATH';
MASTER_SSL_KEY: 'MASTER_SSL_KEY';
MASTER_TLS_VERSION: 'MASTER_TLS_VERSION';
MASTER_USER: 'MASTER_USER';
MAX_CONNECTIONS_PER_HOUR: 'MAX_CONNECTIONS_PER_HOUR';
MAX_QUERIES_PER_HOUR: 'MAX_QUERIES_PER_HOUR';
MAX_ROWS: 'MAX_ROWS';
MAX_SIZE: 'MAX_SIZE';
MAX_UPDATES_PER_HOUR: 'MAX_UPDATES_PER_HOUR';
MAX_USER_CONNECTIONS: 'MAX_USER_CONNECTIONS';
MEDIUM: 'MEDIUM';
MEMBER: 'MEMBER';
MERGE: 'MERGE';
MESSAGE_TEXT: 'MESSAGE_TEXT';
MID: 'MID';
MIGRATE: 'MIGRATE';
MIN_ROWS: 'MIN_ROWS';
MODE: 'MODE';
MODIFY: 'MODIFY';
MUTEX: 'MUTEX';
MYSQL: 'MYSQL';
MYSQL_ERRNO: 'MYSQL_ERRNO';
NAME: 'NAME';
NAMES: 'NAMES';
NCHAR: 'NCHAR';
NEVER: 'NEVER';
NEXT: 'NEXT';
NO: 'NO';
NODEGROUP: 'NODEGROUP';
NONE: 'NONE';
OFFLINE: 'OFFLINE';
OFFSET: 'OFFSET';
OF: 'OF';
OJ: 'OJ';
OLD_PASSWORD: '<PASSWORD>';
ONE: 'ONE';
ONLINE: 'ONLINE';
ONLY: 'ONLY';
OPEN: 'OPEN';
OPTIMIZER_COSTS: 'OPTIMIZER_COSTS';
OPTIONS: 'OPTIONS';
OWNER: 'OWNER';
PACK_KEYS: 'PACK_KEYS';
PAGE: 'PAGE';
PARSER: 'PARSER';
PARTIAL: 'PARTIAL';
PARTITIONING: 'PARTITIONING';
PARTITIONS: 'PARTITIONS';
PASSWORD: 'PASSWORD';
PHASE: 'PHASE';
PLUGIN: 'PLUGIN';
PLUGIN_DIR: 'PLUGIN_DIR';
PLUGINS: 'PLUGINS';
PORT: 'PORT';
PRECEDES: 'PRECEDES';
PREPARE: 'PREPARE';
PRESERVE: 'PRESERVE';
PREV: 'PREV';
PROCESSLIST: 'PROCESSLIST';
PROFILE: 'PROFILE';
PROFILES: 'PROFILES';
PROXY: 'PROXY';
QUERY: 'QUERY';
QUICK: 'QUICK';
REBUILD: 'REBUILD';
RECOVER: 'RECOVER';
REDO_BUFFER_SIZE: 'REDO_BUFFER_SIZE';
REDUNDANT: 'REDUNDANT';
RELAY: 'RELAY';
RELAY_LOG_FILE: 'RELAY_LOG_FILE';
RELAY_LOG_POS: 'RELAY_LOG_POS';
RELAYLOG: 'RELAYLOG';
REMOVE: 'REMOVE';
REORGANIZE: 'REORGANIZE';
REPAIR: 'REPAIR';
REPLICATE_DO_DB: 'REPLICATE_DO_DB';
REPLICATE_DO_TABLE: 'REPLICATE_DO_TABLE';
REPLICATE_IGNORE_DB: 'REPLICATE_IGNORE_DB';
REPLICATE_IGNORE_TABLE: 'REPLICATE_IGNORE_TABLE';
REPLICATE_REWRITE_DB: 'REPLICATE_REWRITE_DB';
REPLICATE_WILD_DO_TABLE: 'REPLICATE_WILD_DO_TABLE';
REPLICATE_WILD_IGNORE_TABLE: 'REPLICATE_WILD_IGNORE_TABLE';
REPLICATION: 'REPLICATION';
RESET: 'RESET';
RESUME: 'RESUME';
RETURNED_SQLSTATE: 'RETURNED_SQLSTATE';
RETURNS: 'RETURNS';
ROLE: 'ROLE';
ROLLBACK: 'ROLLBACK';
ROLLUP: 'ROLLUP';
ROTATE: 'ROTATE';
ROW: 'ROW';
ROWS: 'ROWS';
ROW_FORMAT: 'ROW_FORMAT';
SAVEPOINT: 'SAVEPOINT';
SCHEDULE: 'SCHEDULE';
SECURITY: 'SECURITY';
SERVER: 'SERVER';
SESSION: 'SESSION';
SHARE: 'SHARE';
SHARED: 'SHARED';
SIGNED: 'SIGNED';
SIMPLE: 'SIMPLE';
SLAVE: 'SLAVE';
SLOW: 'SLOW';
SNAPSHOT: 'SNAPSHOT';
SOCKET: 'SOCKET';
SOME: 'SOME';
SONAME: 'SONAME';
SOUNDS: 'SOUNDS';
SOURCE: 'SOURCE';
SQL_AFTER_GTIDS: 'SQL_AFTER_GTIDS';
SQL_AFTER_MTS_GAPS: 'SQL_AFTER_MTS_GAPS';
SQL_BEFORE_GTIDS: 'SQL_BEFORE_GTIDS';
SQL_BUFFER_RESULT: 'SQL_BUFFER_RESULT';
SQL_CACHE: 'SQL_CACHE';
SQL_NO_CACHE: 'SQL_NO_CACHE';
SQL_THREAD: 'SQL_THREAD';
START: 'START';
STARTS: 'STARTS';
STATS_AUTO_RECALC: 'STATS_AUTO_RECALC';
STATS_PERSISTENT: 'STATS_PERSISTENT';
STATS_SAMPLE_PAGES: 'STATS_SAMPLE_PAGES';
STATUS: 'STATUS';
STOP: 'STOP';
STORAGE: 'STORAGE';
STORED: 'STORED';
STRING: 'STRING';
SUBCLASS_ORIGIN: 'SUBCLASS_ORIGIN';
SUBJECT: 'SUBJECT';
SUBPARTITION: 'SUBPARTITION';
SUBPARTITIONS: 'SUBPARTITIONS';
SUSPEND: 'SUSPEND';
SWAPS: 'SWAPS';
SWITCHES: 'SWITCHES';
TABLE_NAME: 'TABLE_NAME';
TABLESPACE: 'TABLESPACE';
TEMPORARY: 'TEMPORARY';
TEMPTABLE: 'TEMPTABLE';
THAN: 'THAN';
TRADITIONAL: 'TRADITIONAL';
TRANSACTION: 'TRANSACTION';
TRANSACTIONAL: 'TRANSACTIONAL';
TRIGGERS: 'TRIGGERS';
TRUNCATE: 'TRUNCATE';
UNDEFINED: 'UNDEFINED';
UNDOFILE: 'UNDOFILE';
UNDO_BUFFER_SIZE: 'UNDO_BUFFER_SIZE';
UNINSTALL: 'UNINSTALL';
UNKNOWN: 'UNKNOWN';
UNTIL: 'UNTIL';
UPGRADE: 'UPGRADE';
USER: 'USER';
USE_FRM: 'USE_FRM';
USER_RESOURCES: 'USER_RESOURCES';
VALIDATION: 'VALIDATION';
VALUE: 'VALUE';
VARIABLES: 'VARIABLES';
VIEW: 'VIEW';
VIRTUAL: 'VIRTUAL';
VISIBLE: 'VISIBLE';
WAIT: 'WAIT';
WARNINGS: 'WARNINGS';
WITHOUT: 'WITHOUT';
WORK: 'WORK';
WRAPPER: 'WRAPPER';
X509: 'X509';
XA: 'XA';
XML: 'XML';
// Date format Keywords
EUR: 'EUR';
USA: 'USA';
JIS: 'JIS';
ISO: 'ISO';
INTERNAL: 'INTERNAL';
// Interval type Keywords
QUARTER: 'QUARTER';
MONTH: 'MONTH';
DAY: 'DAY';
HOUR: 'HOUR';
MINUTE: 'MINUTE';
WEEK: 'WEEK';
SECOND: 'SECOND';
MICROSECOND: 'MICROSECOND';
// PRIVILEGES
TABLES: 'TABLES';
ROUTINE: 'ROUTINE';
EXECUTE: 'EXECUTE';
FILE: 'FILE';
PROCESS: 'PROCESS';
RELOAD: 'RELOAD';
SHUTDOWN: 'SHUTDOWN';
SUPER: 'SUPER';
PRIVILEGES: 'PRIVILEGES';
APPLICATION_PASSWORD_ADMIN: 'APPLICATION_PASSWORD_ADMIN';
AUDIT_ADMIN: 'AUDIT_ADMIN';
BACKUP_ADMIN: 'BACKUP_ADMIN';
BINLOG_ADMIN: 'BINLOG_ADMIN';
BINLOG_ENCRYPTION_ADMIN: 'BINLOG_ENCRYPTION_ADMIN';
CLONE_ADMIN: 'CLONE_ADMIN';
CONNECTION_ADMIN: 'CONNECTION_ADMIN';
ENCRYPTION_KEY_ADMIN: 'ENCRYPTION_KEY_ADMIN';
FIREWALL_ADMIN: 'FIREWALL_ADMIN';
FIREWALL_USER: 'FIREWALL_USER';
GROUP_REPLICATION_ADMIN: 'GROUP_REPLICATION_ADMIN';
INNODB_REDO_LOG_ARCHIVE: 'INNODB_REDO_LOG_ARCHIVE';
NDB_STORED_USER: 'NDB_STORED_USER';
PERSIST_RO_VARIABLES_ADMIN: 'PERSIST_RO_VARIABLES_ADMIN';
REPLICATION_APPLIER: 'REPLICATION_APPLIER';
REPLICATION_SLAVE_ADMIN: 'REPLICATION_SLAVE_ADMIN';
RESOURCE_GROUP_ADMIN: 'RESOURCE_GROUP_ADMIN';
RESOURCE_GROUP_USER: 'RESOURCE_GROUP_USER';
ROLE_ADMIN: 'ROLE_ADMIN';
SESSION_VARIABLES_ADMIN: QUOTE_SYMB? 'SESSION_VARIABLES_ADMIN' QUOTE_SYMB?;
SET_USER_ID: 'SET_USER_ID';
SHOW_ROUTINE: 'SHOW_ROUTINE';
SYSTEM_VARIABLES_ADMIN: 'SYSTEM_VARIABLES_ADMIN';
TABLE_ENCRYPTION_ADMIN: 'TABLE_ENCRYPTION_ADMIN';
VERSION_TOKEN_ADMIN: 'VERSION_TOKEN_ADMIN';
XA_RECOVER_ADMIN: 'XA_RECOVER_ADMIN';
// Charsets
ARMSCII8: 'ARMSCII8';
ASCII: 'ASCII';
BIG5: 'BIG5';
CP1250: 'CP1250';
CP1251: 'CP1251';
CP1256: 'CP1256';
CP1257: 'CP1257';
CP850: 'CP850';
CP852: 'CP852';
CP866: 'CP866';
CP932: 'CP932';
DEC8: 'DEC8';
EUCJPMS: 'EUCJPMS';
EUCKR: 'EUCKR';
GB2312: 'GB2312';
GBK: 'GBK';
GEOSTD8: 'GEOSTD8';
GREEK: 'GREEK';
HEBREW: 'HEBREW';
HP8: 'HP8';
KEYBCS2: 'KEYBCS2';
KOI8R: 'KOI8R';
KOI8U: 'KOI8U';
LATIN1: 'LATIN1';
LATIN2: 'LATIN2';
LATIN5: 'LATIN5';
LATIN7: 'LATIN7';
MACCE: 'MACCE';
MACROMAN: 'MACROMAN';
SJIS: 'SJIS';
SWE7: 'SWE7';
TIS620: 'TIS620';
UCS2: 'UCS2';
UJIS: 'UJIS';
UTF16: 'UTF16';
UTF16LE: 'UTF16LE';
UTF32: 'UTF32';
UTF8: 'UTF8';
UTF8MB3: 'UTF8MB3';
UTF8MB4: 'UTF8MB4';
// DB Engines
ARCHIVE: 'ARCHIVE';
BLACKHOLE: 'BLACKHOLE';
CSV: 'CSV';
FEDERATED: 'FEDERATED';
INNODB: 'INNODB';
MEMORY: 'MEMORY';
MRG_MYISAM: 'MRG_MYISAM';
MYISAM: 'MYISAM';
NDB: 'NDB';
NDBCLUSTER: 'NDBCLUSTER';
PERFORMANCE_SCHEMA: 'PERFORMANCE_SCHEMA';
TOKUDB: 'TOKUDB';
// Transaction Levels
REPEATABLE: 'REPEATABLE';
COMMITTED: 'COMMITTED';
UNCOMMITTED: 'UNCOMMITTED';
SERIALIZABLE: 'SERIALIZABLE';
// Spatial data types
GEOMETRYCOLLECTION: 'GEOMETRYCOLLECTION';
GEOMCOLLECTION: 'GEOMCOLLECTION';
GEOMETRY: 'GEOMETRY';
LINESTRING: 'LINESTRING';
MULTILINESTRING: 'MULTILINESTRING';
MULTIPOINT: 'MULTIPOINT';
MULTIPOLYGON: 'MULTIPOLYGON';
POINT: 'POINT';
POLYGON: 'POLYGON';
// Common function names
ABS: 'ABS';
ACOS: 'ACOS';
ADDDATE: 'ADDDATE';
ADDTIME: 'ADDTIME';
AES_DECRYPT: 'AES_DECRYPT';
AES_ENCRYPT: 'AES_ENCRYPT';
AREA: 'AREA';
ASBINARY: 'ASBINARY';
ASIN: 'ASIN';
ASTEXT: 'ASTEXT';
ASWKB: 'ASWKB';
ASWKT: 'ASWKT';
ASYMMETRIC_DECRYPT: 'ASYMMETRIC_DECRYPT';
ASYMMETRIC_DERIVE: 'ASYMMETRIC_DERIVE';
ASYMMETRIC_ENCRYPT: 'ASYMMETRIC_ENCRYPT';
ASYMMETRIC_SIGN: 'ASYMMETRIC_SIGN';
ASYMMETRIC_VERIFY: 'ASYMMETRIC_VERIFY';
ATAN: 'ATAN';
ATAN2: 'ATAN2';
BENCHMARK: 'BENCHMARK';
BIN: 'BIN';
BIT_COUNT: 'BIT_COUNT';
BIT_LENGTH: 'BIT_LENGTH';
BUFFER: 'BUFFER';
CATALOG_NAME: 'CATALOG_NAME';
CEIL: 'CEIL';
CEILING: 'CEILING';
CENTROID: 'CENTROID';
CHARACTER_LENGTH: 'CHARACTER_LENGTH';
CHARSET: 'CHARSET';
CHAR_LENGTH: 'CHAR_LENGTH';
COERCIBILITY: 'COERCIBILITY';
COLLATION: 'COLLATION';
COMPRESS: 'COMPRESS';
CONCAT: 'CONCAT';
CONCAT_WS: 'CONCAT_WS';
CONNECTION_ID: 'CONNECTION_ID';
CONV: 'CONV';
CONVERT_TZ: 'CONVERT_TZ';
COS: 'COS';
COT: 'COT';
CRC32: 'CRC32';
CREATE_ASYMMETRIC_PRIV_KEY: 'CREATE_ASYMMETRIC_PRIV_KEY';
CREATE_ASYMMETRIC_PUB_KEY: 'CREATE_ASYMMETRIC_PUB_KEY';
CREATE_DH_PARAMETERS: 'CREATE_DH_PARAMETERS';
CREATE_DIGEST: 'CREATE_DIGEST';
CROSSES: 'CROSSES';
DATEDIFF: 'DATEDIFF';
DATE_FORMAT: 'DATE_FORMAT';
DAYNAME: 'DAYNAME';
DAYOFMONTH: 'DAYOFMONTH';
DAYOFWEEK: 'DAYOFWEEK';
DAYOFYEAR: 'DAYOFYEAR';
DECODE: 'DECODE';
DEGREES: 'DEGREES';
DES_DECRYPT: 'DES_DECRYPT';
DES_ENCRYPT: 'DES_ENCRYPT';
DIMENSION: 'DIMENSION';
DISJOINT: 'DISJOINT';
ELT: 'ELT';
ENCODE: 'ENCODE';
ENCRYPT: 'ENCRYPT';
ENDPOINT: 'ENDPOINT';
ENVELOPE: 'ENVELOPE';
EQUALS: 'EQUALS';
EXP: 'EXP';
EXPORT_SET: 'EXPORT_SET';
EXTERIORRING: 'EXTERIORRING';
EXTRACTVALUE: 'EXTRACTVALUE';
FIELD: 'FIELD';
FIND_IN_SET: 'FIND_IN_SET';
FLOOR: 'FLOOR';
FORMAT: 'FORMAT';
FOUND_ROWS: 'FOUND_ROWS';
FROM_BASE64: 'FROM_BASE64';
FROM_DAYS: 'FROM_DAYS';
FROM_UNIXTIME: 'FROM_UNIXTIME';
GEOMCOLLFROMTEXT: 'GEOMCOLLFROMTEXT';
GEOMCOLLFROMWKB: 'GEOMCOLLFROMWKB';
GEOMETRYCOLLECTIONFROMTEXT: 'GEOMETRYCOLLECTIONFROMTEXT';
GEOMETRYCOLLECTIONFROMWKB: 'GEOMETRYCOLLECTIONFROMWKB';
GEOMETRYFROMTEXT: 'GEOMETRYFROMTEXT';
GEOMETRYFROMWKB: 'GEOMETRYFROMWKB';
GEOMETRYN: 'GEOMETRYN';
GEOMETRYTYPE: 'GEOMETRYTYPE';
GEOMFROMTEXT: 'GEOMFROMTEXT';
GEOMFROMWKB: 'GEOMFROMWKB';
GET_FORMAT: 'GET_FORMAT';
GET_LOCK: 'GET_LOCK';
GLENGTH: 'GLENGTH';
GREATEST: 'GREATEST';
GTID_SUBSET: 'GTID_SUBSET';
GTID_SUBTRACT: 'GTID_SUBTRACT';
HEX: 'HEX';
IFNULL: 'IFNULL';
INET6_ATON: 'INET6_ATON';
INET6_NTOA: 'INET6_NTOA';
INET_ATON: 'INET_ATON';
INET_NTOA: 'INET_NTOA';
INSTR: 'INSTR';
INTERIORRINGN: 'INTERIORRINGN';
INTERSECTS: 'INTERSECTS';
ISCLOSED: 'ISCLOSED';
ISEMPTY: 'ISEMPTY';
ISNULL: 'ISNULL';
ISSIMPLE: 'ISSIMPLE';
IS_FREE_LOCK: 'IS_FREE_LOCK';
IS_IPV4: 'IS_IPV4';
IS_IPV4_COMPAT: 'IS_IPV4_COMPAT';
IS_IPV4_MAPPED: 'IS_IPV4_MAPPED';
IS_IPV6: 'IS_IPV6';
IS_USED_LOCK: 'IS_USED_LOCK';
LAST_INSERT_ID: 'LAST_INSERT_ID';
LCASE: 'LCASE';
LEAST: 'LEAST';
LENGTH: 'LENGTH';
LINEFROMTEXT: 'LINEFROMTEXT';
LINEFROMWKB: 'LINEFROMWKB';
LINESTRINGFROMTEXT: 'LINESTRINGFROMTEXT';
LINESTRINGFROMWKB: 'LINESTRINGFROMWKB';
LN: 'LN';
LOAD_FILE: 'LOAD_FILE';
LOCATE: 'LOCATE';
LOG: 'LOG';
LOG10: 'LOG10';
LOG2: 'LOG2';
LOWER: 'LOWER';
LPAD: 'LPAD';
LTRIM: 'LTRIM';
MAKEDATE: 'MAKEDATE';
MAKETIME: 'MAKETIME';
MAKE_SET: 'MAKE_SET';
MASTER_POS_WAIT: 'MASTER_POS_WAIT';
MBRCONTAINS: 'MBRCONTAINS';
MBRDISJOINT: 'MBRDISJOINT';
MBREQUAL: 'MBREQUAL';
MBRINTERSECTS: 'MBRINTERSECTS';
MBROVERLAPS: 'MBROVERLAPS';
MBRTOUCHES: 'MBRTOUCHES';
MBRWITHIN: 'MBRWITHIN';
MD5: 'MD5';
MLINEFROMTEXT: 'MLINEFROMTEXT';
MLINEFROMWKB: 'MLINEFROMWKB';
MONTHNAME: 'MONTHNAME';
MPOINTFROMTEXT: 'MPOINTFROMTEXT';
MPOINTFROMWKB: 'MPOINTFROMWKB';
MPOLYFROMTEXT: 'MPOLYFROMTEXT';
MPOLYFROMWKB: 'MPOLYFROMWKB';
MULTILINESTRINGFROMTEXT: 'MULTILINESTRINGFROMTEXT';
MULTILINESTRINGFROMWKB: 'MULTILINESTRINGFROMWKB';
MULTIPOINTFROMTEXT: 'MULTIPOINTFROMTEXT';
MULTIPOINTFROMWKB: 'MULTIPOINTFROMWKB';
MULTIPOLYGONFROMTEXT: 'MULTIPOLYGONFROMTEXT';
MULTIPOLYGONFROMWKB: 'MULTIPOLYGONFROMWKB';
NAME_CONST: 'NAME_CONST';
NULLIF: 'NULLIF';
NUMGEOMETRIES: 'NUMGEOMETRIES';
NUMINTERIORRINGS: 'NUMINTERIORRINGS';
NUMPOINTS: 'NUMPOINTS';
OCT: 'OCT';
OCTET_LENGTH: 'OCTET_LENGTH';
ORD: 'ORD';
OVERLAPS: 'OVERLAPS';
PERIOD_ADD: 'PERIOD_ADD';
PERIOD_DIFF: 'PERIOD_DIFF';
PI: 'PI';
POINTFROMTEXT: 'POINTFROMTEXT';
POINTFROMWKB: 'POINTFROMWKB';
POINTN: 'POINTN';
POLYFROMTEXT: 'POLYFROMTEXT';
POLYFROMWKB: 'POLYFROMWKB';
POLYGONFROMTEXT: 'POLYGONFROMTEXT';
POLYGONFROMWKB: 'POLYGONFROMWKB';
POW: 'POW';
POWER: 'POWER';
QUOTE: 'QUOTE';
RADIANS: 'RADIANS';
RAND: 'RAND';
RANDOM_BYTES: 'RANDOM_BYTES';
RELEASE_LOCK: 'RELEASE_LOCK';
REVERSE: 'REVERSE';
ROUND: 'ROUND';
ROW_COUNT: 'ROW_COUNT';
RPAD: 'RPAD';
RTRIM: 'RTRIM';
SEC_TO_TIME: 'SEC_TO_TIME';
SESSION_USER: 'SESSION_USER';
SHA: 'SHA';
SHA1: 'SHA1';
SHA2: 'SHA2';
SCHEMA_NAME: 'SCHEMA_NAME';
SIGN: 'SIGN';
SIN: 'SIN';
SLEEP: 'SLEEP';
SOUNDEX: 'SOUNDEX';
SQL_THREAD_WAIT_AFTER_GTIDS: 'SQL_THREAD_WAIT_AFTER_GTIDS';
SQRT: 'SQRT';
SRID: 'SRID';
STARTPOINT: 'STARTPOINT';
STRCMP: 'STRCMP';
STR_TO_DATE: 'STR_TO_DATE';
ST_AREA: 'ST_AREA';
ST_ASBINARY: 'ST_ASBINARY';
ST_ASTEXT: 'ST_ASTEXT';
ST_ASWKB: 'ST_ASWKB';
ST_ASWKT: 'ST_ASWKT';
ST_BUFFER: 'ST_BUFFER';
ST_CENTROID: 'ST_CENTROID';
ST_CONTAINS: 'ST_CONTAINS';
ST_CROSSES: 'ST_CROSSES';
ST_DIFFERENCE: 'ST_DIFFERENCE';
ST_DIMENSION: 'ST_DIMENSION';
ST_DISJOINT: 'ST_DISJOINT';
ST_DISTANCE: 'ST_DISTANCE';
ST_ENDPOINT: 'ST_ENDPOINT';
ST_ENVELOPE: 'ST_ENVELOPE';
ST_EQUALS: 'ST_EQUALS';
ST_EXTERIORRING: 'ST_EXTERIORRING';
ST_GEOMCOLLFROMTEXT: 'ST_GEOMCOLLFROMTEXT';
ST_GEOMCOLLFROMTXT: 'ST_GEOMCOLLFROMTXT';
ST_GEOMCOLLFROMWKB: 'ST_GEOMCOLLFROMWKB';
ST_GEOMETRYCOLLECTIONFROMTEXT: 'ST_GEOMETRYCOLLECTIONFROMTEXT';
ST_GEOMETRYCOLLECTIONFROMWKB: 'ST_GEOMETRYCOLLECTIONFROMWKB';
ST_GEOMETRYFROMTEXT: 'ST_GEOMETRYFROMTEXT';
ST_GEOMETRYFROMWKB: 'ST_GEOMETRYFROMWKB';
ST_GEOMETRYN: 'ST_GEOMETRYN';
ST_GEOMETRYTYPE: 'ST_GEOMETRYTYPE';
ST_GEOMFROMTEXT: 'ST_GEOMFROMTEXT';
ST_GEOMFROMWKB: 'ST_GEOMFROMWKB';
ST_INTERIORRINGN: 'ST_INTERIORRINGN';
ST_INTERSECTION: 'ST_INTERSECTION';
ST_INTERSECTS: 'ST_INTERSECTS';
ST_ISCLOSED: 'ST_ISCLOSED';
ST_ISEMPTY: 'ST_ISEMPTY';
ST_ISSIMPLE: 'ST_ISSIMPLE';
ST_LINEFROMTEXT: 'ST_LINEFROMTEXT';
ST_LINEFROMWKB: 'ST_LINEFROMWKB';
ST_LINESTRINGFROMTEXT: 'ST_LINESTRINGFROMTEXT';
ST_LINESTRINGFROMWKB: 'ST_LINESTRINGFROMWKB';
ST_NUMGEOMETRIES: 'ST_NUMGEOMETRIES';
ST_NUMINTERIORRING: 'ST_NUMINTERIORRING';
ST_NUMINTERIORRINGS: 'ST_NUMINTERIORRINGS';
ST_NUMPOINTS: 'ST_NUMPOINTS';
ST_OVERLAPS: 'ST_OVERLAPS';
ST_POINTFROMTEXT: 'ST_POINTFROMTEXT';
ST_POINTFROMWKB: 'ST_POINTFROMWKB';
ST_POINTN: 'ST_POINTN';
ST_POLYFROMTEXT: 'ST_POLYFROMTEXT';
ST_POLYFROMWKB: 'ST_POLYFROMWKB';
ST_POLYGONFROMTEXT: 'ST_POLYGONFROMTEXT';
ST_POLYGONFROMWKB: 'ST_POLYGONFROMWKB';
ST_SRID: 'ST_SRID';
ST_STARTPOINT: 'ST_STARTPOINT';
ST_SYMDIFFERENCE: 'ST_SYMDIFFERENCE';
ST_TOUCHES: 'ST_TOUCHES';
ST_UNION: 'ST_UNION';
ST_WITHIN: 'ST_WITHIN';
ST_X: 'ST_X';
ST_Y: 'ST_Y';
SUBDATE: 'SUBDATE';
SUBSTRING_INDEX: 'SUBSTRING_INDEX';
SUBTIME: 'SUBTIME';
SYSTEM_USER: 'SYSTEM_USER';
TAN: 'TAN';
TIMEDIFF: 'TIMEDIFF';
TIMESTAMPADD: 'TIMESTAMPADD';
TIMESTAMPDIFF: 'TIMESTAMPDIFF';
TIME_FORMAT: 'TIME_FORMAT';
TIME_TO_SEC: 'TIME_TO_SEC';
TOUCHES: 'TOUCHES';
TO_BASE64: 'TO_BASE64';
TO_DAYS: 'TO_DAYS';
TO_SECONDS: 'TO_SECONDS';
UCASE: 'UCASE';
UNCOMPRESS: 'UNCOMPRESS';
UNCOMPRESSED_LENGTH: 'UNCOMPRESSED_LENGTH';
UNHEX: 'UNHEX';
UNIX_TIMESTAMP: 'UNIX_TIMESTAMP';
UPDATEXML: 'UPDATEXML';
UPPER: 'UPPER';
UUID: 'UUID';
UUID_SHORT: 'UUID_SHORT';
VALIDATE_PASSWORD_STRENGTH: 'VALIDATE_PASSWORD_STRENGTH';
VERSION: 'VERSION';
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS: 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS';
WEEKDAY: 'WEEKDAY';
WEEKOFYEAR: 'WEEKOFYEAR';
WEIGHT_STRING: 'WEIGHT_STRING';
WITHIN: 'WITHIN';
YEARWEEK: 'YEARWEEK';
Y_FUNCTION: 'Y';
X_FUNCTION: 'X';
// Operators
// Operators. Assigns
VAR_ASSIGN: ':=';
PLUS_ASSIGN: '+=';
MINUS_ASSIGN: '-=';
MULT_ASSIGN: '*=';
DIV_ASSIGN: '/=';
MOD_ASSIGN: '%=';
AND_ASSIGN: '&=';
XOR_ASSIGN: '^=';
OR_ASSIGN: '|=';
// Operators. Arithmetics
STAR: '*';
DIVIDE: '/';
MODULE: '%';
PLUS: '+';
MINUSMINUS: '--';
MINUS: '-';
DIV: 'DIV';
MOD: 'MOD';
// Operators. Comparation
EQUAL_SYMBOL: '=';
GREATER_SYMBOL: '>';
LESS_SYMBOL: '<';
EXCLAMATION_SYMBOL: '!';
// Operators. Bit
BIT_NOT_OP: '~';
BIT_OR_OP: '|';
BIT_AND_OP: '&';
BIT_XOR_OP: '^';
// Constructors symbols
DOT: '.';
LR_BRACKET: '(';
RR_BRACKET: ')';
COMMA: ',';
SEMI: ';';
AT_SIGN: '@';
ZERO_DECIMAL: '0';
ONE_DECIMAL: '1';
TWO_DECIMAL: '2';
SINGLE_QUOTE_SYMB: '\'';
DOUBLE_QUOTE_SYMB: '"';
REVERSE_QUOTE_SYMB: '`';
COLON_SYMB: ':';
fragment QUOTE_SYMB
: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB
;
// Charsets
CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`';
// File's sizes
FILESIZE_LITERAL: DEC_DIGIT+ ('K'|'M'|'G'|'T');
// Literal Primitives
START_NATIONAL_STRING_LITERAL: 'N' SQUOTA_STRING;
STRING_LITERAL: DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING;
DECIMAL_LITERAL: DEC_DIGIT+;
HEXADECIMAL_LITERAL: 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\''
| '0X' HEX_DIGIT+;
REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+
| DEC_DIGIT+ '.' EXPONENT_NUM_PART
| (DEC_DIGIT+)? '.' (DEC_DIGIT+ EXPONENT_NUM_PART)
| DEC_DIGIT+ EXPONENT_NUM_PART;
NULL_SPEC_LITERAL: '\\' 'N';
BIT_STRING: BIT_STRING_L;
STRING_CHARSET_NAME: '_' CHARSET_NAME;
// Hack for dotID
// Prevent recognize string: .123somelatin AS ((.123), FLOAT_LITERAL), ((somelatin), ID)
// it must recoginze: .123somelatin AS ((.), DOT), (123somelatin, ID)
DOT_ID: '.' ID_LITERAL;
// Identifiers
ID: ID_LITERAL;
// DOUBLE_QUOTE_ID: '"' ~'"'+ '"';
REVERSE_QUOTE_ID: '`' ~'`'+ '`';
STRING_USER_NAME: (
SQUOTA_STRING | DQUOTA_STRING
| BQUOTA_STRING | ID_LITERAL
) '@'
(
SQUOTA_STRING | DQUOTA_STRING
| BQUOTA_STRING | ID_LITERAL
);
LOCAL_ID: '@'
(
[A-Z0-9._$]+
| SQUOTA_STRING
| DQUOTA_STRING
| BQUOTA_STRING
);
GLOBAL_ID: '@' '@'
(
[A-Z0-9._$]+
| BQUOTA_STRING
);
// Fragments for Literal primitives
fragment CHARSET_NAME: ARMSCII8 | ASCII | BIG5 | BINARY | CP1250
| CP1251 | CP1256 | CP1257 | CP850
| CP852 | CP866 | CP932 | DEC8 | EUCJPMS
| EUCKR | GB2312 | GBK | GEOSTD8 | GREEK
| HEBREW | HP8 | KEYBCS2 | KOI8R | KOI8U
| LATIN1 | LATIN2 | LATIN5 | LATIN7
| MACCE | MACROMAN | SJIS | SWE7 | TIS620
| UCS2 | UJIS | UTF16 | UTF16LE | UTF32
| UTF8 | UTF8MB3 | UTF8MB4;
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
fragment ID_LITERAL: [A-Z_$0-9]*?[A-Z_$]+?[A-Z_$0-9]*;
fragment DQUOTA_STRING: '"' ( '\\'. | '""' | ~('"'| '\\') )* '"';
fragment SQUOTA_STRING: '\'' ('\\'. | '\'\'' | ~('\'' | '\\'))* '\'';
fragment BQUOTA_STRING: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`';
fragment HEX_DIGIT: [0-9A-F];
fragment DEC_DIGIT: [0-9];
fragment BIT_STRING_L: 'B' '\'' [01]+ '\'';
// Last tokens must generate Errors
ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL);
|
objc/two-step-processing/ObjectiveCPreprocessorLexer.g4 | ChristianWulf/grammars-v4 | 0 | 1317 | /*
Objective-C Preprocessor grammar.
The MIT License (MIT).
Copyright (c) 2016, <NAME> (<EMAIL>).
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.
*/
lexer grammar ObjectiveCPreprocessorLexer;
channels { COMMENTS_CHANNEL }
SHARP: '#' -> mode(DIRECTIVE_MODE);
COMMENT: '/*' .*? '*/' -> type(CODE);
LINE_COMMENT: '//' ~[\r\n]* -> type(CODE);
SLASH: '/' -> type(CODE);
CHARACTER_LITERAL: '\'' (EscapeSequence | ~('\''|'\\')) '\'' -> type(CODE);
QUOTE_STRING: '\'' (EscapeSequence | ~('\''|'\\'))* '\'' -> type(CODE);
STRING: StringFragment -> type(CODE);
CODE: ~[#'"/]+;
mode DIRECTIVE_MODE;
IMPORT: 'import' [ \t]+ -> mode(DIRECTIVE_TEXT);
INCLUDE: 'include' [ \t]+ -> mode(DIRECTIVE_TEXT);
PRAGMA: 'pragma' -> mode(DIRECTIVE_TEXT);
DEFINE: 'define' [ \t]+ -> mode(DIRECTIVE_DEFINE);
DEFINED: 'defined';
IF: 'if';
ELIF: 'elif';
ELSE: 'else';
UNDEF: 'undef';
IFDEF: 'ifdef';
IFNDEF: 'ifndef';
ENDIF: 'endif';
TRUE: T R U E;
FALSE: F A L S E;
ERROR: 'error' -> mode(DIRECTIVE_TEXT);
BANG: '!' ;
LPAREN: '(' ;
RPAREN: ')' ;
EQUAL: '==';
NOTEQUAL: '!=';
AND: '&&';
OR: '||';
LT: '<' ;
GT: '>' ;
LE: '<=';
GE: '>=';
DIRECTIVE_WHITESPACES: [ \t]+ -> channel(HIDDEN);
DIRECTIVE_STRING: StringFragment;
CONDITIONAL_SYMBOL: LETTER (LETTER | [0-9])*;
DECIMAL_LITERAL: [0-9]+;
FLOAT: ([0-9]+ '.' [0-9]* | '.' [0-9]+);
NEW_LINE: '\r'? '\n' -> mode(DEFAULT_MODE);
DIRECITVE_COMMENT: '/*' .*? '*/' -> channel(COMMENTS_CHANNEL);
DIRECITVE_LINE_COMMENT: '//' ~[\r\n]* -> channel(COMMENTS_CHANNEL);
DIRECITVE_NEW_LINE: '\\' '\r'? '\n' -> channel(HIDDEN);
mode DIRECTIVE_DEFINE;
DIRECTIVE_DEFINE_CONDITIONAL_SYMBOL: LETTER (LETTER | [0-9])* ('(' (LETTER | [0-9,. \t])* ')')? -> type(CONDITIONAL_SYMBOL), mode(DIRECTIVE_TEXT);
mode DIRECTIVE_TEXT;
DIRECITVE_TEXT_NEW_LINE: '\\' '\r'? '\n' -> channel(HIDDEN);
BACK_SLASH_ESCAPE: '\\' . -> type(TEXT);
TEXT_NEW_LINE: '\r'? '\n' -> type(NEW_LINE), mode(DEFAULT_MODE);
DIRECTIVE_COMMENT: '/*' .*? '*/' -> channel(COMMENTS_CHANNEL), type(DIRECITVE_COMMENT);
DIRECTIVE_LINE_COMMENT: '//' ~[\r\n]* -> channel(COMMENTS_CHANNEL), type(DIRECITVE_LINE_COMMENT);
DIRECTIVE_SLASH: '/' -> type(TEXT);
TEXT: ~[\r\n\\/]+;
fragment
EscapeSequence
: '\\' ('b'|'t'|'n'|'f'|'r'|'"'|'\''|'\\')
| OctalEscape
| UnicodeEscape
;
fragment
OctalEscape
: '\\' [0-3] [0-7] [0-7]
| '\\' [0-7] [0-7]
| '\\' [0-7]
;
fragment
UnicodeEscape
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;
fragment HexDigit: [0-9a-fA-F];
fragment
StringFragment: '"' (~('\\' | '"') | '\\' .)* '"';
fragment LETTER
: [$A-Za-z_]
| ~[\u0000-\u00FF\uD800-\uDBFF]
| [\uD800-\uDBFF] [\uDC00-\uDFFF]
| [\u00E9]
;
fragment A: [aA];
fragment B: [bB];
fragment C: [cC];
fragment D: [dD];
fragment E: [eE];
fragment F: [fF];
fragment G: [gG];
fragment H: [hH];
fragment I: [iI];
fragment J: [jJ];
fragment K: [kK];
fragment L: [lL];
fragment M: [mM];
fragment N: [nN];
fragment O: [oO];
fragment P: [pP];
fragment Q: [qQ];
fragment R: [rR];
fragment S: [sS];
fragment T: [tT];
fragment U: [uU];
fragment V: [vV];
fragment W: [wW];
fragment X: [xX];
fragment Y: [yY];
fragment Z: [zZ]; |
tests/glfw2/glfw_test-display.adb | Roldak/OpenGLAda | 0 | 7947 | <filename>tests/glfw2/glfw_test-display.adb
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with Glfw.Display;
with Glfw.Display.Modes;
with Glfw.Events;
with Glfw.Events.Keys;
with Ada.Text_IO;
procedure Glfw_Test.Display is
procedure Write_Mode (Subject : Glfw.Display.Modes.Mode) is
begin
Ada.Text_IO.Put (Subject.Width'Img & " x" & Subject.Height'Img);
Ada.Text_IO.Put ("; RGB:" & Subject.Red_Bits'Img & " +"
& Subject.Green_Bits'Img & " +"
& Subject.Blue_Bits'Img);
Ada.Text_IO.New_Line;
end Write_Mode;
begin
Glfw.Init;
Glfw.Display.Open (Mode => Glfw.Display.Window);
Glfw.Events.Keys.Set_Key_Callback (Glfw_Test.Key_To_Title'Access);
declare
Mode_List : Glfw.Display.Modes.Mode_List := Glfw.Display.Modes.Available_Modes;
Desktop_Mode : Glfw.Display.Modes.Mode := Glfw.Display.Modes.Desktop_Mode;
begin
Ada.Text_IO.Put_Line ("---- Video Modes ----");
for Index in Mode_List'Range loop
Write_Mode (Mode_List (Index));
end loop;
Ada.Text_IO.Put ("Current: ");
Write_Mode (Desktop_Mode);
end;
while Glfw.Display.Opened loop
Glfw.Events.Wait_For_Events;
end loop;
Glfw.Terminate_Glfw;
end Glfw_Test.Display;
|
software/hal/boards/stm32_common/sdcard/media_reader-sdcard.ads | TUM-EI-RCS/StratoX | 12 | 23364 | <gh_stars>10-100
with STM32.SDMMC;
package Media_Reader.SDCard with SPARK_Mode => Off is
type SDCard_Controller is limited new Media_Controller with private;
Device_Error : exception;
procedure Initialize
(Controller : in out SDCard_Controller);
function Card_Present
(Controller : in out SDCard_Controller) return Boolean;
function Get_Card_Information
(Controller : in out SDCard_Controller)
return STM32.SDMMC.Card_Information
with Pre => Controller.Card_Present;
overriding function Block_Size
(Controller : in out SDCard_Controller)
return Unsigned_32;
overriding function Read_Block
(Controller : in out SDCard_Controller;
Block_Number : Unsigned_32;
Data : out Block) return Boolean;
overriding function Write_Block
(Controller : in out SDCard_Controller;
Block_Number : Unsigned_32;
Data : Block) return Boolean;
procedure Set_DMA (on : Boolean);
private
type SDCard_Controller is limited new Media_Controller with record
Device : STM32.SDMMC.SDMMC_Controller;
Info : STM32.SDMMC.Card_Information;
Has_Info : Boolean := False;
Card_Detected : Boolean := False;
end record;
end Media_Reader.SDCard;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.