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
|
---|---|---|---|---|
agda-stdlib/src/Data/List/Relation/Binary/Sublist/Propositional.agda | DreamLinuxer/popl21-artifact | 5 | 7756 | <reponame>DreamLinuxer/popl21-artifact
------------------------------------------------------------------------
-- The Agda standard library
--
-- An inductive definition of the sublist relation. This is commonly
-- known as Order Preserving Embeddings (OPE).
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Sublist.Propositional
{a} {A : Set a} where
open import Data.List.Base using (List)
open import Data.List.Relation.Binary.Equality.Propositional using (≋⇒≡)
import Data.List.Relation.Binary.Sublist.Setoid as SetoidSublist
open import Data.List.Relation.Unary.Any using (Any)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Relation.Unary using (Pred)
------------------------------------------------------------------------
-- Re-export definition and operations from setoid sublists
open SetoidSublist (setoid A) public
hiding
(lookup; ⊆-reflexive; ⊆-antisym
; ⊆-isPreorder; ⊆-isPartialOrder
; ⊆-preorder; ⊆-poset
)
------------------------------------------------------------------------
-- Additional operations
module _ {p} {P : Pred A p} where
lookup : ∀ {xs ys} → xs ⊆ ys → Any P xs → Any P ys
lookup = SetoidSublist.lookup (setoid A) (subst _)
------------------------------------------------------------------------
-- Relational properties
⊆-reflexive : _≡_ ⇒ _⊆_
⊆-reflexive refl = ⊆-refl
⊆-antisym : Antisymmetric _≡_ _⊆_
⊆-antisym xs⊆ys ys⊆xs = ≋⇒≡ (SetoidSublist.⊆-antisym (setoid A) xs⊆ys ys⊆xs)
⊆-isPreorder : IsPreorder _≡_ _⊆_
⊆-isPreorder = record
{ isEquivalence = isEquivalence
; reflexive = ⊆-reflexive
; trans = ⊆-trans
}
⊆-isPartialOrder : IsPartialOrder _≡_ _⊆_
⊆-isPartialOrder = record
{ isPreorder = ⊆-isPreorder
; antisym = ⊆-antisym
}
⊆-preorder : Preorder a a a
⊆-preorder = record
{ isPreorder = ⊆-isPreorder
}
⊆-poset : Poset a a a
⊆-poset = record
{ isPartialOrder = ⊆-isPartialOrder
}
------------------------------------------------------------------------
-- Separating two sublists
--
-- Two possibly overlapping sublists τ : xs ⊆ zs and σ : ys ⊆ zs
-- can be turned into disjoint lists τρ : xs ⊆ zs and τρ : ys ⊆ zs′
-- by duplicating all entries of zs that occur both in xs and ys,
-- resulting in an extension ρ : zs ⊆ zs′ of zs.
record Separation {xs ys zs} (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs) : Set a where
field
{inflation} : List A
separator₁ : zs ⊆ inflation
separator₂ : zs ⊆ inflation
separated₁ = ⊆-trans τ₁ separator₁
separated₂ = ⊆-trans τ₂ separator₂
field
disjoint : Disjoint separated₁ separated₂
infixr 5 _∷ₙ-Sep_ _∷ₗ-Sep_ _∷ᵣ-Sep_
-- Empty separation
[]-Sep : Separation [] []
[]-Sep = record { separator₁ = [] ; separator₂ = [] ; disjoint = [] }
-- Weaken a separation
_∷ₙ-Sep_ : ∀ {xs ys zs} {τ₁ : xs ⊆ zs} {τ₂ : ys ⊆ zs} →
∀ z → Separation τ₁ τ₂ → Separation (z ∷ʳ τ₁) (z ∷ʳ τ₂)
z ∷ₙ-Sep record{ separator₁ = ρ₁; separator₂ = ρ₂; disjoint = d } = record
{ separator₁ = refl ∷ ρ₁
; separator₂ = refl ∷ ρ₂
; disjoint = z ∷ₙ d
}
-- Extend a separation by an element of the first sublist.
--
-- Note: this requires a category law from the underlying equality,
-- trans x=z refl = x=z, thus, separation is not available for Sublist.Setoid.
_∷ₗ-Sep_ : ∀ {xs ys zs} {τ₁ : xs ⊆ zs} {τ₂ : ys ⊆ zs} →
∀ {x z} (x≡z : x ≡ z) → Separation τ₁ τ₂ → Separation (x≡z ∷ τ₁) (z ∷ʳ τ₂)
refl ∷ₗ-Sep record{ separator₁ = ρ₁; separator₂ = ρ₂; disjoint = d } = record
{ separator₁ = refl ∷ ρ₁
; separator₂ = refl ∷ ρ₂
; disjoint = refl ∷ₗ d
}
-- Extend a separation by an element of the second sublist.
_∷ᵣ-Sep_ : ∀ {xs ys zs} {τ₁ : xs ⊆ zs} {τ₂ : ys ⊆ zs} →
∀ {y z} (y≡z : y ≡ z) → Separation τ₁ τ₂ → Separation (z ∷ʳ τ₁) (y≡z ∷ τ₂)
refl ∷ᵣ-Sep record{ separator₁ = ρ₁; separator₂ = ρ₂; disjoint = d } = record
{ separator₁ = refl ∷ ρ₁
; separator₂ = refl ∷ ρ₂
; disjoint = refl ∷ᵣ d
}
-- Extend a separation by a common element of both sublists.
--
-- Left-biased: the left separator gets the first copy
-- of the common element.
∷-Sepˡ : ∀ {xs ys zs} {τ₁ : xs ⊆ zs} {τ₂ : ys ⊆ zs} →
∀ {x y z} (x≡z : x ≡ z) (y≡z : y ≡ z) →
Separation τ₁ τ₂ → Separation (x≡z ∷ τ₁) (y≡z ∷ τ₂)
∷-Sepˡ refl refl record{ separator₁ = ρ₁; separator₂ = ρ₂; disjoint = d } = record
{ separator₁ = _ ∷ʳ refl ∷ ρ₁
; separator₂ = refl ∷ _ ∷ʳ ρ₂
; disjoint = refl ∷ᵣ (refl ∷ₗ d)
}
-- Left-biased separation of two sublists. Of common elements,
-- the first sublist receives the first copy.
separateˡ : ∀ {xs ys zs} (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs) → Separation τ₁ τ₂
separateˡ [] [] = []-Sep
separateˡ (z ∷ʳ τ₁) (z ∷ʳ τ₂) = z ∷ₙ-Sep separateˡ τ₁ τ₂
separateˡ (z ∷ʳ τ₁) (y≡z ∷ τ₂) = y≡z ∷ᵣ-Sep separateˡ τ₁ τ₂
separateˡ (x≡z ∷ τ₁) (z ∷ʳ τ₂) = x≡z ∷ₗ-Sep separateˡ τ₁ τ₂
separateˡ (x≡z ∷ τ₁) (y≡z ∷ τ₂) = ∷-Sepˡ x≡z y≡z (separateˡ τ₁ τ₂)
|
programs/oeis/027/A027788.asm | neoneye/loda | 22 | 13945 | <gh_stars>10-100
; A027788: a(n) = 15*(n+1)*C(n+2,15)/2.
; 105,1800,16320,104040,523260,2209320,8139600,26860680,80901810,225544440,588376800,1448655000,3389852700,7582037400,16287339600,33738060600,67621543875,131530532400,248917996800,459351961200,828225505800,1461574422000,2528333935200,4293282020400,7165139588100,11765913428880,19029682468800,30341771491920,47732786859240,74146496500560,113806250442720,172711831683600,259307625069405,385374177968760,567209052930240,827179868856600,1195753211782500,1714128387917400,2437635622858800,3440095242910200,4819378712944950,6704465418189000,9264352214224800,12719247682818600,17354571599124900,23538384467778600,31742994529134000,42571633088363400,56791256435501175,75372727435135200,99539855914337280,130829038563880800,171161540985053520,222930812100601440,289107620336103360,373366258348497120,480235585919262600,615279276997310880,785310315662424960,998645556781643040,1265407041127424400,1597877743559220000,2010920549528721600,2522470513882519200,3154111872269497425,3931752866418781800,4886413228690776000,6055141168836592200,7482078938834757900,9219698543929998600,11330231945552528400,13887323192821761000,16977933354361505850,20704532934213394200,25187620680453448800,30568612371277594680,37013148332460600300,44714874147093816120,53899755311712410640,64830993524351939160,77814619915653604395,93205848913942851600,111416285633714484480,132922089763314494160,158273209975905402840,188103814977366565200,223144060520484180000,264233346147359542800,312335231168334761100,368554196549372324400,434154458071105262400,510581056459361958000,599483472294211524600,702742037515916857200,822497441403596464800,961183657156834465200,1121564645822338381125,1306775227447358083800,1520366545189719057600,1766356586862730961400
mov $1,$0
add $0,15
bin $0,$1
add $1,14
mul $0,$1
div $0,2
mul $0,15
|
src/oberon-parser.ads | Lucretia/so | 8 | 7161 | ------------------------------------------------------------------------------------------------------------------------
-- See COPYING for licence information.
------------------------------------------------------------------------------------------------------------------------
-- Oberon.Parser
-- This is the root package for the Oberon compiler parser.
with Oberon.Scanner;
package Oberon.Parser is
pragma Pure;
end Oberon.Parser;
|
notes/FOT/FOTC/Program/Mirror/Tree/Induction/Instances/TotalityATP.agda | asr/fotc | 11 | 3995 | <reponame>asr/fotc
------------------------------------------------------------------------------
-- Totality properties for Tree using induction instance
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOT.FOTC.Program.Mirror.Tree.Induction.Instances.TotalityATP where
open import FOTC.Base
open import FOTC.Base.List
open import FOTC.Data.List
open import FOTC.Program.Mirror.Forest.TotalityATP
open import FOTC.Program.Mirror.Mirror
open import FOTC.Program.Mirror.Type
------------------------------------------------------------------------------
mirror-Tree-ind-instance :
(∀ d {ts} → Forest ts → Forest (map mirror ts) → Tree (mirror · node d ts)) →
Forest (map mirror []) →
(∀ {t ts} → Tree t → Tree (mirror · t) → Forest ts →
Forest (map mirror ts) → Forest (map mirror (t ∷ ts))) →
∀ {t} → Tree t → Tree (mirror · t)
mirror-Tree-ind-instance = Tree-mutual-ind
postulate mirror-Tree : ∀ {t} → Tree t → Tree (mirror · t)
{-# ATP prove mirror-Tree mirror-Tree-ind-instance reverse-Forest #-}
|
generated/natools-static_maps-s_expressions-templates-dates-zones.ads | faelys/natools | 0 | 28298 | <reponame>faelys/natools
package Natools.Static_Maps.S_Expressions.Templates.Dates.Zones is
pragma Pure;
function Hash (S : String) return Natural;
end Natools.Static_Maps.S_Expressions.Templates.Dates.Zones;
|
zombie.asm | Samyak005/Enhanced-MIT-xv6-OS | 0 | 178912 |
_zombie: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(void)
{
0: f3 0f 1e fb endbr32
4: 8d 4c 24 04 lea 0x4(%esp),%ecx
8: 83 e4 f0 and $0xfffffff0,%esp
b: ff 71 fc pushl -0x4(%ecx)
e: 55 push %ebp
f: 89 e5 mov %esp,%ebp
11: 51 push %ecx
12: 83 ec 04 sub $0x4,%esp
if(fork() > 0)
15: e8 71 02 00 00 call 28b <fork>
1a: 85 c0 test %eax,%eax
1c: 7e 0d jle 2b <main+0x2b>
sleep(5); // Let child exit before parent.
1e: 83 ec 0c sub $0xc,%esp
21: 6a 05 push $0x5
23: e8 fb 02 00 00 call 323 <sleep>
28: 83 c4 10 add $0x10,%esp
exit();
2b: e8 63 02 00 00 call 293 <exit>
00000030 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
30: f3 0f 1e fb endbr32
34: 55 push %ebp
char *os;
os = s;
while((*s++ = *t++) != 0)
35: 31 c0 xor %eax,%eax
{
37: 89 e5 mov %esp,%ebp
39: 53 push %ebx
3a: 8b 4d 08 mov 0x8(%ebp),%ecx
3d: 8b 5d 0c mov 0xc(%ebp),%ebx
while((*s++ = *t++) != 0)
40: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx
44: 88 14 01 mov %dl,(%ecx,%eax,1)
47: 83 c0 01 add $0x1,%eax
4a: 84 d2 test %dl,%dl
4c: 75 f2 jne 40 <strcpy+0x10>
;
return os;
}
4e: 89 c8 mov %ecx,%eax
50: 5b pop %ebx
51: 5d pop %ebp
52: c3 ret
53: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
5a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000060 <strcmp>:
int
strcmp(const char *p, const char *q)
{
60: f3 0f 1e fb endbr32
64: 55 push %ebp
65: 89 e5 mov %esp,%ebp
67: 53 push %ebx
68: 8b 4d 08 mov 0x8(%ebp),%ecx
6b: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
6e: 0f b6 01 movzbl (%ecx),%eax
71: 0f b6 1a movzbl (%edx),%ebx
74: 84 c0 test %al,%al
76: 75 19 jne 91 <strcmp+0x31>
78: eb 26 jmp a0 <strcmp+0x40>
7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80: 0f b6 41 01 movzbl 0x1(%ecx),%eax
p++, q++;
84: 83 c1 01 add $0x1,%ecx
87: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
8a: 0f b6 1a movzbl (%edx),%ebx
8d: 84 c0 test %al,%al
8f: 74 0f je a0 <strcmp+0x40>
91: 38 d8 cmp %bl,%al
93: 74 eb je 80 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
95: 29 d8 sub %ebx,%eax
}
97: 5b pop %ebx
98: 5d pop %ebp
99: c3 ret
9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
a0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
a2: 29 d8 sub %ebx,%eax
}
a4: 5b pop %ebx
a5: 5d pop %ebp
a6: c3 ret
a7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ae: 66 90 xchg %ax,%ax
000000b0 <strlen>:
uint
strlen(const char *s)
{
b0: f3 0f 1e fb endbr32
b4: 55 push %ebp
b5: 89 e5 mov %esp,%ebp
b7: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for(n = 0; s[n]; n++)
ba: 80 3a 00 cmpb $0x0,(%edx)
bd: 74 21 je e0 <strlen+0x30>
bf: 31 c0 xor %eax,%eax
c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
c8: 83 c0 01 add $0x1,%eax
cb: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
cf: 89 c1 mov %eax,%ecx
d1: 75 f5 jne c8 <strlen+0x18>
;
return n;
}
d3: 89 c8 mov %ecx,%eax
d5: 5d pop %ebp
d6: c3 ret
d7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
de: 66 90 xchg %ax,%ax
for(n = 0; s[n]; n++)
e0: 31 c9 xor %ecx,%ecx
}
e2: 5d pop %ebp
e3: 89 c8 mov %ecx,%eax
e5: c3 ret
e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ed: 8d 76 00 lea 0x0(%esi),%esi
000000f0 <memset>:
void*
memset(void *dst, int c, uint n)
{
f0: f3 0f 1e fb endbr32
f4: 55 push %ebp
f5: 89 e5 mov %esp,%ebp
f7: 57 push %edi
f8: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
fb: 8b 4d 10 mov 0x10(%ebp),%ecx
fe: 8b 45 0c mov 0xc(%ebp),%eax
101: 89 d7 mov %edx,%edi
103: fc cld
104: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
106: 89 d0 mov %edx,%eax
108: 5f pop %edi
109: 5d pop %ebp
10a: c3 ret
10b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
10f: 90 nop
00000110 <strchr>:
char*
strchr(const char *s, char c)
{
110: f3 0f 1e fb endbr32
114: 55 push %ebp
115: 89 e5 mov %esp,%ebp
117: 8b 45 08 mov 0x8(%ebp),%eax
11a: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
11e: 0f b6 10 movzbl (%eax),%edx
121: 84 d2 test %dl,%dl
123: 75 16 jne 13b <strchr+0x2b>
125: eb 21 jmp 148 <strchr+0x38>
127: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
12e: 66 90 xchg %ax,%ax
130: 0f b6 50 01 movzbl 0x1(%eax),%edx
134: 83 c0 01 add $0x1,%eax
137: 84 d2 test %dl,%dl
139: 74 0d je 148 <strchr+0x38>
if(*s == c)
13b: 38 d1 cmp %dl,%cl
13d: 75 f1 jne 130 <strchr+0x20>
return (char*)s;
return 0;
}
13f: 5d pop %ebp
140: c3 ret
141: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
148: 31 c0 xor %eax,%eax
}
14a: 5d pop %ebp
14b: c3 ret
14c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000150 <gets>:
char*
gets(char *buf, int max)
{
150: f3 0f 1e fb endbr32
154: 55 push %ebp
155: 89 e5 mov %esp,%ebp
157: 57 push %edi
158: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
159: 31 f6 xor %esi,%esi
{
15b: 53 push %ebx
15c: 89 f3 mov %esi,%ebx
15e: 83 ec 1c sub $0x1c,%esp
161: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
164: eb 33 jmp 199 <gets+0x49>
166: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
16d: 8d 76 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
170: 83 ec 04 sub $0x4,%esp
173: 8d 45 e7 lea -0x19(%ebp),%eax
176: 6a 01 push $0x1
178: 50 push %eax
179: 6a 00 push $0x0
17b: e8 2b 01 00 00 call 2ab <read>
if(cc < 1)
180: 83 c4 10 add $0x10,%esp
183: 85 c0 test %eax,%eax
185: 7e 1c jle 1a3 <gets+0x53>
break;
buf[i++] = c;
187: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
18b: 83 c7 01 add $0x1,%edi
18e: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
191: 3c 0a cmp $0xa,%al
193: 74 23 je 1b8 <gets+0x68>
195: 3c 0d cmp $0xd,%al
197: 74 1f je 1b8 <gets+0x68>
for(i=0; i+1 < max; ){
199: 83 c3 01 add $0x1,%ebx
19c: 89 fe mov %edi,%esi
19e: 3b 5d 0c cmp 0xc(%ebp),%ebx
1a1: 7c cd jl 170 <gets+0x20>
1a3: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
1a5: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
1a8: c6 03 00 movb $0x0,(%ebx)
}
1ab: 8d 65 f4 lea -0xc(%ebp),%esp
1ae: 5b pop %ebx
1af: 5e pop %esi
1b0: 5f pop %edi
1b1: 5d pop %ebp
1b2: c3 ret
1b3: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1b7: 90 nop
1b8: 8b 75 08 mov 0x8(%ebp),%esi
1bb: 8b 45 08 mov 0x8(%ebp),%eax
1be: 01 de add %ebx,%esi
1c0: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1c2: c6 03 00 movb $0x0,(%ebx)
}
1c5: 8d 65 f4 lea -0xc(%ebp),%esp
1c8: 5b pop %ebx
1c9: 5e pop %esi
1ca: 5f pop %edi
1cb: 5d pop %ebp
1cc: c3 ret
1cd: 8d 76 00 lea 0x0(%esi),%esi
000001d0 <stat>:
int
stat(const char *n, struct stat *st)
{
1d0: f3 0f 1e fb endbr32
1d4: 55 push %ebp
1d5: 89 e5 mov %esp,%ebp
1d7: 56 push %esi
1d8: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1d9: 83 ec 08 sub $0x8,%esp
1dc: 6a 00 push $0x0
1de: ff 75 08 pushl 0x8(%ebp)
1e1: e8 ed 00 00 00 call 2d3 <open>
if(fd < 0)
1e6: 83 c4 10 add $0x10,%esp
1e9: 85 c0 test %eax,%eax
1eb: 78 2b js 218 <stat+0x48>
return -1;
r = fstat(fd, st);
1ed: 83 ec 08 sub $0x8,%esp
1f0: ff 75 0c pushl 0xc(%ebp)
1f3: 89 c3 mov %eax,%ebx
1f5: 50 push %eax
1f6: e8 f0 00 00 00 call 2eb <fstat>
close(fd);
1fb: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
1fe: 89 c6 mov %eax,%esi
close(fd);
200: e8 b6 00 00 00 call 2bb <close>
return r;
205: 83 c4 10 add $0x10,%esp
}
208: 8d 65 f8 lea -0x8(%ebp),%esp
20b: 89 f0 mov %esi,%eax
20d: 5b pop %ebx
20e: 5e pop %esi
20f: 5d pop %ebp
210: c3 ret
211: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
218: be ff ff ff ff mov $0xffffffff,%esi
21d: eb e9 jmp 208 <stat+0x38>
21f: 90 nop
00000220 <atoi>:
int
atoi(const char *s)
{
220: f3 0f 1e fb endbr32
224: 55 push %ebp
225: 89 e5 mov %esp,%ebp
227: 53 push %ebx
228: 8b 55 08 mov 0x8(%ebp),%edx
int n;
n = 0;
while('0' <= *s && *s <= '9')
22b: 0f be 02 movsbl (%edx),%eax
22e: 8d 48 d0 lea -0x30(%eax),%ecx
231: 80 f9 09 cmp $0x9,%cl
n = 0;
234: b9 00 00 00 00 mov $0x0,%ecx
while('0' <= *s && *s <= '9')
239: 77 1a ja 255 <atoi+0x35>
23b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
23f: 90 nop
n = n*10 + *s++ - '0';
240: 83 c2 01 add $0x1,%edx
243: 8d 0c 89 lea (%ecx,%ecx,4),%ecx
246: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx
while('0' <= *s && *s <= '9')
24a: 0f be 02 movsbl (%edx),%eax
24d: 8d 58 d0 lea -0x30(%eax),%ebx
250: 80 fb 09 cmp $0x9,%bl
253: 76 eb jbe 240 <atoi+0x20>
return n;
}
255: 89 c8 mov %ecx,%eax
257: 5b pop %ebx
258: 5d pop %ebp
259: c3 ret
25a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000260 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
260: f3 0f 1e fb endbr32
264: 55 push %ebp
265: 89 e5 mov %esp,%ebp
267: 57 push %edi
268: 8b 45 10 mov 0x10(%ebp),%eax
26b: 8b 55 08 mov 0x8(%ebp),%edx
26e: 56 push %esi
26f: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
272: 85 c0 test %eax,%eax
274: 7e 0f jle 285 <memmove+0x25>
276: 01 d0 add %edx,%eax
dst = vdst;
278: 89 d7 mov %edx,%edi
27a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
*dst++ = *src++;
280: a4 movsb %ds:(%esi),%es:(%edi)
while(n-- > 0)
281: 39 f8 cmp %edi,%eax
283: 75 fb jne 280 <memmove+0x20>
return vdst;
}
285: 5e pop %esi
286: 89 d0 mov %edx,%eax
288: 5f pop %edi
289: 5d pop %ebp
28a: c3 ret
0000028b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
28b: b8 01 00 00 00 mov $0x1,%eax
290: cd 40 int $0x40
292: c3 ret
00000293 <exit>:
SYSCALL(exit)
293: b8 02 00 00 00 mov $0x2,%eax
298: cd 40 int $0x40
29a: c3 ret
0000029b <wait>:
SYSCALL(wait)
29b: b8 03 00 00 00 mov $0x3,%eax
2a0: cd 40 int $0x40
2a2: c3 ret
000002a3 <pipe>:
SYSCALL(pipe)
2a3: b8 04 00 00 00 mov $0x4,%eax
2a8: cd 40 int $0x40
2aa: c3 ret
000002ab <read>:
SYSCALL(read)
2ab: b8 05 00 00 00 mov $0x5,%eax
2b0: cd 40 int $0x40
2b2: c3 ret
000002b3 <write>:
SYSCALL(write)
2b3: b8 10 00 00 00 mov $0x10,%eax
2b8: cd 40 int $0x40
2ba: c3 ret
000002bb <close>:
SYSCALL(close)
2bb: b8 15 00 00 00 mov $0x15,%eax
2c0: cd 40 int $0x40
2c2: c3 ret
000002c3 <kill>:
SYSCALL(kill)
2c3: b8 06 00 00 00 mov $0x6,%eax
2c8: cd 40 int $0x40
2ca: c3 ret
000002cb <exec>:
SYSCALL(exec)
2cb: b8 07 00 00 00 mov $0x7,%eax
2d0: cd 40 int $0x40
2d2: c3 ret
000002d3 <open>:
SYSCALL(open)
2d3: b8 0f 00 00 00 mov $0xf,%eax
2d8: cd 40 int $0x40
2da: c3 ret
000002db <mknod>:
SYSCALL(mknod)
2db: b8 11 00 00 00 mov $0x11,%eax
2e0: cd 40 int $0x40
2e2: c3 ret
000002e3 <unlink>:
SYSCALL(unlink)
2e3: b8 12 00 00 00 mov $0x12,%eax
2e8: cd 40 int $0x40
2ea: c3 ret
000002eb <fstat>:
SYSCALL(fstat)
2eb: b8 08 00 00 00 mov $0x8,%eax
2f0: cd 40 int $0x40
2f2: c3 ret
000002f3 <link>:
SYSCALL(link)
2f3: b8 13 00 00 00 mov $0x13,%eax
2f8: cd 40 int $0x40
2fa: c3 ret
000002fb <mkdir>:
SYSCALL(mkdir)
2fb: b8 14 00 00 00 mov $0x14,%eax
300: cd 40 int $0x40
302: c3 ret
00000303 <chdir>:
SYSCALL(chdir)
303: b8 09 00 00 00 mov $0x9,%eax
308: cd 40 int $0x40
30a: c3 ret
0000030b <dup>:
SYSCALL(dup)
30b: b8 0a 00 00 00 mov $0xa,%eax
310: cd 40 int $0x40
312: c3 ret
00000313 <getpid>:
SYSCALL(getpid)
313: b8 0b 00 00 00 mov $0xb,%eax
318: cd 40 int $0x40
31a: c3 ret
0000031b <sbrk>:
SYSCALL(sbrk)
31b: b8 0c 00 00 00 mov $0xc,%eax
320: cd 40 int $0x40
322: c3 ret
00000323 <sleep>:
SYSCALL(sleep)
323: b8 0d 00 00 00 mov $0xd,%eax
328: cd 40 int $0x40
32a: c3 ret
0000032b <uptime>:
SYSCALL(uptime)
32b: b8 0e 00 00 00 mov $0xe,%eax
330: cd 40 int $0x40
332: c3 ret
00000333 <waitx>:
//my insert begins
SYSCALL(waitx)
333: b8 16 00 00 00 mov $0x16,%eax
338: cd 40 int $0x40
33a: c3 ret
0000033b <psinfo>:
SYSCALL(psinfo)
33b: b8 17 00 00 00 mov $0x17,%eax
340: cd 40 int $0x40
342: c3 ret
00000343 <set_priority>:
SYSCALL(set_priority)
343: b8 18 00 00 00 mov $0x18,%eax
348: cd 40 int $0x40
34a: c3 ret
34b: 66 90 xchg %ax,%ax
34d: 66 90 xchg %ax,%ax
34f: 90 nop
00000350 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
350: 55 push %ebp
351: 89 e5 mov %esp,%ebp
353: 57 push %edi
354: 56 push %esi
355: 53 push %ebx
356: 83 ec 3c sub $0x3c,%esp
359: 89 4d c4 mov %ecx,-0x3c(%ebp)
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
35c: 89 d1 mov %edx,%ecx
{
35e: 89 45 b8 mov %eax,-0x48(%ebp)
if(sgn && xx < 0){
361: 85 d2 test %edx,%edx
363: 0f 89 7f 00 00 00 jns 3e8 <printint+0x98>
369: f6 45 08 01 testb $0x1,0x8(%ebp)
36d: 74 79 je 3e8 <printint+0x98>
neg = 1;
36f: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp)
x = -xx;
376: f7 d9 neg %ecx
} else {
x = xx;
}
i = 0;
378: 31 db xor %ebx,%ebx
37a: 8d 75 d7 lea -0x29(%ebp),%esi
37d: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
380: 89 c8 mov %ecx,%eax
382: 31 d2 xor %edx,%edx
384: 89 cf mov %ecx,%edi
386: f7 75 c4 divl -0x3c(%ebp)
389: 0f b6 92 70 07 00 00 movzbl 0x770(%edx),%edx
390: 89 45 c0 mov %eax,-0x40(%ebp)
393: 89 d8 mov %ebx,%eax
395: 8d 5b 01 lea 0x1(%ebx),%ebx
}while((x /= base) != 0);
398: 8b 4d c0 mov -0x40(%ebp),%ecx
buf[i++] = digits[x % base];
39b: 88 14 1e mov %dl,(%esi,%ebx,1)
}while((x /= base) != 0);
39e: 39 7d c4 cmp %edi,-0x3c(%ebp)
3a1: 76 dd jbe 380 <printint+0x30>
if(neg)
3a3: 8b 4d bc mov -0x44(%ebp),%ecx
3a6: 85 c9 test %ecx,%ecx
3a8: 74 0c je 3b6 <printint+0x66>
buf[i++] = '-';
3aa: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
buf[i++] = digits[x % base];
3af: 89 d8 mov %ebx,%eax
buf[i++] = '-';
3b1: ba 2d 00 00 00 mov $0x2d,%edx
while(--i >= 0)
3b6: 8b 7d b8 mov -0x48(%ebp),%edi
3b9: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx
3bd: eb 07 jmp 3c6 <printint+0x76>
3bf: 90 nop
3c0: 0f b6 13 movzbl (%ebx),%edx
3c3: 83 eb 01 sub $0x1,%ebx
write(fd, &c, 1);
3c6: 83 ec 04 sub $0x4,%esp
3c9: 88 55 d7 mov %dl,-0x29(%ebp)
3cc: 6a 01 push $0x1
3ce: 56 push %esi
3cf: 57 push %edi
3d0: e8 de fe ff ff call 2b3 <write>
while(--i >= 0)
3d5: 83 c4 10 add $0x10,%esp
3d8: 39 de cmp %ebx,%esi
3da: 75 e4 jne 3c0 <printint+0x70>
putc(fd, buf[i]);
}
3dc: 8d 65 f4 lea -0xc(%ebp),%esp
3df: 5b pop %ebx
3e0: 5e pop %esi
3e1: 5f pop %edi
3e2: 5d pop %ebp
3e3: c3 ret
3e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
3e8: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp)
3ef: eb 87 jmp 378 <printint+0x28>
3f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
3f8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
3ff: 90 nop
00000400 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
400: f3 0f 1e fb endbr32
404: 55 push %ebp
405: 89 e5 mov %esp,%ebp
407: 57 push %edi
408: 56 push %esi
409: 53 push %ebx
40a: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
40d: 8b 75 0c mov 0xc(%ebp),%esi
410: 0f b6 1e movzbl (%esi),%ebx
413: 84 db test %bl,%bl
415: 0f 84 b4 00 00 00 je 4cf <printf+0xcf>
ap = (uint*)(void*)&fmt + 1;
41b: 8d 45 10 lea 0x10(%ebp),%eax
41e: 83 c6 01 add $0x1,%esi
write(fd, &c, 1);
421: 8d 7d e7 lea -0x19(%ebp),%edi
state = 0;
424: 31 d2 xor %edx,%edx
ap = (uint*)(void*)&fmt + 1;
426: 89 45 d0 mov %eax,-0x30(%ebp)
429: eb 33 jmp 45e <printf+0x5e>
42b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
42f: 90 nop
430: 89 55 d4 mov %edx,-0x2c(%ebp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
433: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
438: 83 f8 25 cmp $0x25,%eax
43b: 74 17 je 454 <printf+0x54>
write(fd, &c, 1);
43d: 83 ec 04 sub $0x4,%esp
440: 88 5d e7 mov %bl,-0x19(%ebp)
443: 6a 01 push $0x1
445: 57 push %edi
446: ff 75 08 pushl 0x8(%ebp)
449: e8 65 fe ff ff call 2b3 <write>
44e: 8b 55 d4 mov -0x2c(%ebp),%edx
} else {
putc(fd, c);
451: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
454: 0f b6 1e movzbl (%esi),%ebx
457: 83 c6 01 add $0x1,%esi
45a: 84 db test %bl,%bl
45c: 74 71 je 4cf <printf+0xcf>
c = fmt[i] & 0xff;
45e: 0f be cb movsbl %bl,%ecx
461: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
464: 85 d2 test %edx,%edx
466: 74 c8 je 430 <printf+0x30>
}
} else if(state == '%'){
468: 83 fa 25 cmp $0x25,%edx
46b: 75 e7 jne 454 <printf+0x54>
if(c == 'd'){
46d: 83 f8 64 cmp $0x64,%eax
470: 0f 84 9a 00 00 00 je 510 <printf+0x110>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
476: 81 e1 f7 00 00 00 and $0xf7,%ecx
47c: 83 f9 70 cmp $0x70,%ecx
47f: 74 5f je 4e0 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
481: 83 f8 73 cmp $0x73,%eax
484: 0f 84 d6 00 00 00 je 560 <printf+0x160>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
48a: 83 f8 63 cmp $0x63,%eax
48d: 0f 84 8d 00 00 00 je 520 <printf+0x120>
putc(fd, *ap);
ap++;
} else if(c == '%'){
493: 83 f8 25 cmp $0x25,%eax
496: 0f 84 b4 00 00 00 je 550 <printf+0x150>
write(fd, &c, 1);
49c: 83 ec 04 sub $0x4,%esp
49f: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4a3: 6a 01 push $0x1
4a5: 57 push %edi
4a6: ff 75 08 pushl 0x8(%ebp)
4a9: e8 05 fe ff ff call 2b3 <write>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
4ae: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
4b1: 83 c4 0c add $0xc,%esp
4b4: 6a 01 push $0x1
4b6: 83 c6 01 add $0x1,%esi
4b9: 57 push %edi
4ba: ff 75 08 pushl 0x8(%ebp)
4bd: e8 f1 fd ff ff call 2b3 <write>
for(i = 0; fmt[i]; i++){
4c2: 0f b6 5e ff movzbl -0x1(%esi),%ebx
putc(fd, c);
4c6: 83 c4 10 add $0x10,%esp
}
state = 0;
4c9: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
4cb: 84 db test %bl,%bl
4cd: 75 8f jne 45e <printf+0x5e>
}
}
}
4cf: 8d 65 f4 lea -0xc(%ebp),%esp
4d2: 5b pop %ebx
4d3: 5e pop %esi
4d4: 5f pop %edi
4d5: 5d pop %ebp
4d6: c3 ret
4d7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
4de: 66 90 xchg %ax,%ax
printint(fd, *ap, 16, 0);
4e0: 83 ec 0c sub $0xc,%esp
4e3: b9 10 00 00 00 mov $0x10,%ecx
4e8: 6a 00 push $0x0
4ea: 8b 5d d0 mov -0x30(%ebp),%ebx
4ed: 8b 45 08 mov 0x8(%ebp),%eax
4f0: 8b 13 mov (%ebx),%edx
4f2: e8 59 fe ff ff call 350 <printint>
ap++;
4f7: 89 d8 mov %ebx,%eax
4f9: 83 c4 10 add $0x10,%esp
state = 0;
4fc: 31 d2 xor %edx,%edx
ap++;
4fe: 83 c0 04 add $0x4,%eax
501: 89 45 d0 mov %eax,-0x30(%ebp)
504: e9 4b ff ff ff jmp 454 <printf+0x54>
509: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 10, 1);
510: 83 ec 0c sub $0xc,%esp
513: b9 0a 00 00 00 mov $0xa,%ecx
518: 6a 01 push $0x1
51a: eb ce jmp 4ea <printf+0xea>
51c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, *ap);
520: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
523: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
526: 8b 03 mov (%ebx),%eax
write(fd, &c, 1);
528: 6a 01 push $0x1
ap++;
52a: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
52d: 57 push %edi
52e: ff 75 08 pushl 0x8(%ebp)
putc(fd, *ap);
531: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
534: e8 7a fd ff ff call 2b3 <write>
ap++;
539: 89 5d d0 mov %ebx,-0x30(%ebp)
53c: 83 c4 10 add $0x10,%esp
state = 0;
53f: 31 d2 xor %edx,%edx
541: e9 0e ff ff ff jmp 454 <printf+0x54>
546: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
54d: 8d 76 00 lea 0x0(%esi),%esi
putc(fd, c);
550: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
553: 83 ec 04 sub $0x4,%esp
556: e9 59 ff ff ff jmp 4b4 <printf+0xb4>
55b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
55f: 90 nop
s = (char*)*ap;
560: 8b 45 d0 mov -0x30(%ebp),%eax
563: 8b 18 mov (%eax),%ebx
ap++;
565: 83 c0 04 add $0x4,%eax
568: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
56b: 85 db test %ebx,%ebx
56d: 74 17 je 586 <printf+0x186>
while(*s != 0){
56f: 0f b6 03 movzbl (%ebx),%eax
state = 0;
572: 31 d2 xor %edx,%edx
while(*s != 0){
574: 84 c0 test %al,%al
576: 0f 84 d8 fe ff ff je 454 <printf+0x54>
57c: 89 75 d4 mov %esi,-0x2c(%ebp)
57f: 89 de mov %ebx,%esi
581: 8b 5d 08 mov 0x8(%ebp),%ebx
584: eb 1a jmp 5a0 <printf+0x1a0>
s = "(null)";
586: bb 68 07 00 00 mov $0x768,%ebx
while(*s != 0){
58b: 89 75 d4 mov %esi,-0x2c(%ebp)
58e: b8 28 00 00 00 mov $0x28,%eax
593: 89 de mov %ebx,%esi
595: 8b 5d 08 mov 0x8(%ebp),%ebx
598: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
59f: 90 nop
write(fd, &c, 1);
5a0: 83 ec 04 sub $0x4,%esp
s++;
5a3: 83 c6 01 add $0x1,%esi
5a6: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
5a9: 6a 01 push $0x1
5ab: 57 push %edi
5ac: 53 push %ebx
5ad: e8 01 fd ff ff call 2b3 <write>
while(*s != 0){
5b2: 0f b6 06 movzbl (%esi),%eax
5b5: 83 c4 10 add $0x10,%esp
5b8: 84 c0 test %al,%al
5ba: 75 e4 jne 5a0 <printf+0x1a0>
5bc: 8b 75 d4 mov -0x2c(%ebp),%esi
state = 0;
5bf: 31 d2 xor %edx,%edx
5c1: e9 8e fe ff ff jmp 454 <printf+0x54>
5c6: 66 90 xchg %ax,%ax
5c8: 66 90 xchg %ax,%ax
5ca: 66 90 xchg %ax,%ax
5cc: 66 90 xchg %ax,%ax
5ce: 66 90 xchg %ax,%ax
000005d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5d0: f3 0f 1e fb endbr32
5d4: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5d5: a1 18 0a 00 00 mov 0xa18,%eax
{
5da: 89 e5 mov %esp,%ebp
5dc: 57 push %edi
5dd: 56 push %esi
5de: 53 push %ebx
5df: 8b 5d 08 mov 0x8(%ebp),%ebx
5e2: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
5e4: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5e7: 39 c8 cmp %ecx,%eax
5e9: 73 15 jae 600 <free+0x30>
5eb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
5ef: 90 nop
5f0: 39 d1 cmp %edx,%ecx
5f2: 72 14 jb 608 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5f4: 39 d0 cmp %edx,%eax
5f6: 73 10 jae 608 <free+0x38>
{
5f8: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5fa: 8b 10 mov (%eax),%edx
5fc: 39 c8 cmp %ecx,%eax
5fe: 72 f0 jb 5f0 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
600: 39 d0 cmp %edx,%eax
602: 72 f4 jb 5f8 <free+0x28>
604: 39 d1 cmp %edx,%ecx
606: 73 f0 jae 5f8 <free+0x28>
break;
if(bp + bp->s.size == p->s.ptr){
608: 8b 73 fc mov -0x4(%ebx),%esi
60b: 8d 3c f1 lea (%ecx,%esi,8),%edi
60e: 39 fa cmp %edi,%edx
610: 74 1e je 630 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
612: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
615: 8b 50 04 mov 0x4(%eax),%edx
618: 8d 34 d0 lea (%eax,%edx,8),%esi
61b: 39 f1 cmp %esi,%ecx
61d: 74 28 je 647 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
61f: 89 08 mov %ecx,(%eax)
freep = p;
}
621: 5b pop %ebx
freep = p;
622: a3 18 0a 00 00 mov %eax,0xa18
}
627: 5e pop %esi
628: 5f pop %edi
629: 5d pop %ebp
62a: c3 ret
62b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
62f: 90 nop
bp->s.size += p->s.ptr->s.size;
630: 03 72 04 add 0x4(%edx),%esi
633: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
636: 8b 10 mov (%eax),%edx
638: 8b 12 mov (%edx),%edx
63a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
63d: 8b 50 04 mov 0x4(%eax),%edx
640: 8d 34 d0 lea (%eax,%edx,8),%esi
643: 39 f1 cmp %esi,%ecx
645: 75 d8 jne 61f <free+0x4f>
p->s.size += bp->s.size;
647: 03 53 fc add -0x4(%ebx),%edx
freep = p;
64a: a3 18 0a 00 00 mov %eax,0xa18
p->s.size += bp->s.size;
64f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
652: 8b 53 f8 mov -0x8(%ebx),%edx
655: 89 10 mov %edx,(%eax)
}
657: 5b pop %ebx
658: 5e pop %esi
659: 5f pop %edi
65a: 5d pop %ebp
65b: c3 ret
65c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000660 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
660: f3 0f 1e fb endbr32
664: 55 push %ebp
665: 89 e5 mov %esp,%ebp
667: 57 push %edi
668: 56 push %esi
669: 53 push %ebx
66a: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
66d: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
670: 8b 3d 18 0a 00 00 mov 0xa18,%edi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
676: 8d 70 07 lea 0x7(%eax),%esi
679: c1 ee 03 shr $0x3,%esi
67c: 83 c6 01 add $0x1,%esi
if((prevp = freep) == 0){
67f: 85 ff test %edi,%edi
681: 0f 84 a9 00 00 00 je 730 <malloc+0xd0>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
687: 8b 07 mov (%edi),%eax
if(p->s.size >= nunits){
689: 8b 48 04 mov 0x4(%eax),%ecx
68c: 39 f1 cmp %esi,%ecx
68e: 73 6d jae 6fd <malloc+0x9d>
690: 81 fe 00 10 00 00 cmp $0x1000,%esi
696: bb 00 10 00 00 mov $0x1000,%ebx
69b: 0f 43 de cmovae %esi,%ebx
p = sbrk(nu * sizeof(Header));
69e: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx
6a5: 89 4d e4 mov %ecx,-0x1c(%ebp)
6a8: eb 17 jmp 6c1 <malloc+0x61>
6aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
6b0: 8b 10 mov (%eax),%edx
if(p->s.size >= nunits){
6b2: 8b 4a 04 mov 0x4(%edx),%ecx
6b5: 39 f1 cmp %esi,%ecx
6b7: 73 4f jae 708 <malloc+0xa8>
6b9: 8b 3d 18 0a 00 00 mov 0xa18,%edi
6bf: 89 d0 mov %edx,%eax
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6c1: 39 c7 cmp %eax,%edi
6c3: 75 eb jne 6b0 <malloc+0x50>
p = sbrk(nu * sizeof(Header));
6c5: 83 ec 0c sub $0xc,%esp
6c8: ff 75 e4 pushl -0x1c(%ebp)
6cb: e8 4b fc ff ff call 31b <sbrk>
if(p == (char*)-1)
6d0: 83 c4 10 add $0x10,%esp
6d3: 83 f8 ff cmp $0xffffffff,%eax
6d6: 74 1b je 6f3 <malloc+0x93>
hp->s.size = nu;
6d8: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
6db: 83 ec 0c sub $0xc,%esp
6de: 83 c0 08 add $0x8,%eax
6e1: 50 push %eax
6e2: e8 e9 fe ff ff call 5d0 <free>
return freep;
6e7: a1 18 0a 00 00 mov 0xa18,%eax
if((p = morecore(nunits)) == 0)
6ec: 83 c4 10 add $0x10,%esp
6ef: 85 c0 test %eax,%eax
6f1: 75 bd jne 6b0 <malloc+0x50>
return 0;
}
}
6f3: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
6f6: 31 c0 xor %eax,%eax
}
6f8: 5b pop %ebx
6f9: 5e pop %esi
6fa: 5f pop %edi
6fb: 5d pop %ebp
6fc: c3 ret
if(p->s.size >= nunits){
6fd: 89 c2 mov %eax,%edx
6ff: 89 f8 mov %edi,%eax
701: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
708: 39 ce cmp %ecx,%esi
70a: 74 54 je 760 <malloc+0x100>
p->s.size -= nunits;
70c: 29 f1 sub %esi,%ecx
70e: 89 4a 04 mov %ecx,0x4(%edx)
p += p->s.size;
711: 8d 14 ca lea (%edx,%ecx,8),%edx
p->s.size = nunits;
714: 89 72 04 mov %esi,0x4(%edx)
freep = prevp;
717: a3 18 0a 00 00 mov %eax,0xa18
}
71c: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
71f: 8d 42 08 lea 0x8(%edx),%eax
}
722: 5b pop %ebx
723: 5e pop %esi
724: 5f pop %edi
725: 5d pop %ebp
726: c3 ret
727: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
72e: 66 90 xchg %ax,%ax
base.s.ptr = freep = prevp = &base;
730: c7 05 18 0a 00 00 1c movl $0xa1c,0xa18
737: 0a 00 00
base.s.size = 0;
73a: bf 1c 0a 00 00 mov $0xa1c,%edi
base.s.ptr = freep = prevp = &base;
73f: c7 05 1c 0a 00 00 1c movl $0xa1c,0xa1c
746: 0a 00 00
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
749: 89 f8 mov %edi,%eax
base.s.size = 0;
74b: c7 05 20 0a 00 00 00 movl $0x0,0xa20
752: 00 00 00
if(p->s.size >= nunits){
755: e9 36 ff ff ff jmp 690 <malloc+0x30>
75a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
prevp->s.ptr = p->s.ptr;
760: 8b 0a mov (%edx),%ecx
762: 89 08 mov %ecx,(%eax)
764: eb b1 jmp 717 <malloc+0xb7>
|
Everything.agda | guilhermehas/typing-linear-pi | 26 | 6376 | import PiCalculus.Utils
import PiCalculus.Syntax
import PiCalculus.Syntax.Properties
import PiCalculus.Semantics
import PiCalculus.Semantics.Properties
import PiCalculus.LinearTypeSystem
import PiCalculus.LinearTypeSystem.Algebras
import PiCalculus.LinearTypeSystem.Algebras.Graded
import PiCalculus.LinearTypeSystem.Algebras.Shared
import PiCalculus.LinearTypeSystem.Algebras.Linear
import PiCalculus.LinearTypeSystem.ContextLemmas
import PiCalculus.LinearTypeSystem.Framing
import PiCalculus.LinearTypeSystem.Weakening
import PiCalculus.LinearTypeSystem.Exchange
import PiCalculus.LinearTypeSystem.Strengthening
import PiCalculus.LinearTypeSystem.Substitution
import PiCalculus.LinearTypeSystem.SubjectCongruence
import PiCalculus.LinearTypeSystem.SubjectReduction
import PiCalculus.Examples
|
oeis/110/A110208.asm | neoneye/loda-programs | 11 | 175216 | ; A110208: 1 + sum of first n semiprimes.
; Submitted by <NAME>
; 1,5,11,20,30,44,59,80,102,127,153,186,220,255,293,332,378,427,478,533,590,648,710,775,844,918,995,1077,1162,1248,1335,1426,1519,1613,1708,1814,1925,2040,2158,2277,2398,2520,2643,2772,2905,3039,3180,3322,3465
lpb $0
mov $2,$0
sub $2,1
mov $0,$2
max $2,0
seq $2,1358 ; Semiprimes (or biprimes): products of two primes.
add $1,$2
lpe
mov $0,$1
add $0,1
|
programs/oeis/040/A040329.asm | neoneye/loda | 22 | 247616 | <reponame>neoneye/loda
; A040329: Continued fraction for sqrt(348).
; 18,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1,36,1,1,1,8,1,1,1
mov $1,$0
gcd $0,8
mov $3,10
lpb $1
add $0,6
mov $1,0
mov $3,$2
add $3,7
lpe
mul $0,$3
trn $0,63
add $0,1
|
FactorioScript.g4 | un0btanium/FactorioScript | 13 | 6297 | <reponame>un0btanium/FactorioScript<gh_stars>10-100
grammar FactorioScript;
statementList : s=statement sl=statementList #multipleStatementList
| s=statement #singleStatementList
;
statement : statementCompiler
| statementAssign
| statementIf
;
statementCompiler : COMPILERSIGN STANDARD ALIASASSIGN varLeft=VAR varRight=VAR #CompilerStandard
| COMPILERSIGN ALIAS varOld=VAR ALIASASSIGN varAlias=VAR #CompilerAlias
| COMPILERSIGN POWERPOLE pole=(SMALL|MEDIUM|SUBSTATION) #CompilerPowerpole
;
statementAssign : var=VAR ASSIGN expr=expression #overwriteStatementAssign
| var=VAR PLUS ASSIGN expr=expression #addStatementAssign
| var=VAR MINUS ASSIGN expr=expression #subStatementAssign
;
statementIf : IF BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE ELSEIF BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE ELSE BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE #ifElseIfElseStatement
| IF BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE ELSE BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE #ifElseStatement
| IF BRACKET_OPEN condition BRACKET_CLOSE BRACE_OPEN statementList BRACE_CLOSE #ifStatement
;
expression : BRACKET_OPEN expr=expression BRACKET_CLOSE #priorityExp
| left=expression operand=(ASTERISK|SLASH|MODULO) right=expression #mulDivModExp
| left=expression operand=(PLUS|MINUS) right=expression #addSubExp
| left=expression operand=(BIT_LEFT|BIT_RIGHT|BIT_AND|BIT_OR|BIT_XOR) right=expression #bitExp
| <assoc=right> left=expression POWER right=expression #powExp
| variable=VAR #varExp
| number=NUMBER #numExp
;
condition : expression (EQUAL|NOTEQUAL|GREATER|LOWER|GREATEREQUAL|LOWEREQUAL) expression;
COMPILERSIGN : '#' ;
STANDARD : ('standard'|'STANDARD') ;
ALIAS : ('alias'|'ALIAS') ;
ALIASASSIGN : '=>' ;
POWERPOLE : ('powerpole'|'POWERPOLE') ;
SMALL : ('small'|'SMALL') ;
MEDIUM : ('medium'|'MEDIUM') ;
SUBSTATION : ('substation'|'SUBSTATION') ;
IF : ('if'|'IF') ;
ELSEIF : ('elseif'|'ELSEIF') ;
ELSE : ('else'|'ELSE') ;
BRACKET_OPEN : '(' ;
BRACKET_CLOSE : ')' ;
BRACE_OPEN : '{' ;
BRACE_CLOSE : '}' ;
ASTERISK : '*' ;
SLASH : '/' ;
MODULO : '%' ;
PLUS : '+' ;
MINUS : '-' ;
BIT_LEFT : '<<' ;
BIT_RIGHT : '>>' ;
BIT_AND : 'AND' ;
BIT_OR : 'OR' ;
BIT_XOR : 'XOR' ;
POWER : '^' ;
EQUAL : '==' ;
NOTEQUAL : '!=' ;
GREATER : '>' ;
LOWER : '<' ;
GREATEREQUAL : '>=' ;
LOWEREQUAL : '<=' ;
ASSIGN : '=' ;
NUMBER : [0-9]+ ;
VAR : [a-z][a-zA-Z0-9\-]* ;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
|
src/lang/antlr/JSONLexer.g4 | fossabot/confort | 1 | 6447 | lexer grammar JSONLexer;
fragment ESC
: '\\' (["\\/bfnrt] | UNICODE)
;
fragment UNICODE
: 'u' HEX HEX HEX HEX
;
fragment HEX
: [0-9a-fA-F]
;
fragment SAFECODEPOINT
: ~ ["\\\u0000-\u001F]
;
NUMBER
: '-'? INT ('.' [0-9] +)? EXP?
;
fragment INT
: '0' | [1-9] [0-9]*
;
// no leading zeros
fragment EXP
: [Ee] [+\-]? INT
;
// \- since - means "range" inside [...]
WS
: [ \t\n\r] + -> skip
;
EXTRA_NOT_A_NUMBER
: '"__NaN' ('_d'|'_f') '"'
;
EXTRA_POSITIVE_INFINITY
: '"__Infinity' ('_d'|'_f') '"'
;
EXTRA_NEGATIVE_INFINITY
: '"__-Infinity' ('_d'|'_f') '"'
;
STRING
: '"' (ESC | SAFECODEPOINT)* '"'
;
CURLY_OPEN
: '{'
;
CURLY_CLOSE
: '}'
;
SQUARE_OPEN
: '['
;
SQUARE_CLOSE
: ']'
;
COMMA
: ','
;
COLON
: ':'
;
LIT_TRUE
: 'true'
;
LIT_FALSE
: 'false'
;
LIT_NULL
: 'null'
; |
src/test/resources/data/searchtests/opt-test4.asm | cpcitor/mdlz80optimizer | 0 | 96161 | <reponame>cpcitor/mdlz80optimizer
org #4000
ld d,#0c
ld hl, #c004
ld e, 4
ld (#d001),a ; two instructions in the middle, just so that "ld a, 4" and "ld e, 4"
ld (#d002),a ; are not together in a single optimization block.
ld a, 4
ld (#d003), a
inc de
ld a, 4
ld (#d004), a
ldir
ld bc,0
ld (#d005),a
loop:
jr loop
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1981.asm | ljhsiun2/medusa | 9 | 12602 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xbc55, %r13
nop
add $5725, %rbx
movb (%r13), %dl
nop
nop
nop
nop
nop
add %r11, %r11
lea addresses_UC_ht+0x3147, %rdi
and $37800, %rsi
movb $0x61, (%rdi)
sub $46794, %r13
lea addresses_WT_ht+0x238f, %rbx
dec %rdx
movb $0x61, (%rbx)
nop
nop
nop
nop
dec %r11
lea addresses_UC_ht+0x12c7, %rdi
nop
nop
nop
nop
cmp $48750, %r11
mov (%rdi), %rbx
nop
nop
cmp $19977, %r8
lea addresses_A_ht+0x161f7, %rdx
nop
nop
nop
nop
add %r13, %r13
movw $0x6162, (%rdx)
nop
nop
nop
add $44396, %rdi
lea addresses_A_ht+0x31a7, %rsi
lea addresses_normal_ht+0x6ec7, %rdi
nop
nop
nop
nop
nop
inc %rdx
mov $94, %rcx
rep movsb
nop
cmp %rdi, %rdi
lea addresses_A_ht+0xb4c7, %rsi
lea addresses_A_ht+0x18ec7, %rdi
dec %rdx
mov $78, %rcx
rep movsw
nop
add %r8, %r8
lea addresses_normal_ht+0xdd8f, %rdi
cmp $56948, %rdx
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x126c7, %rsi
lea addresses_WT_ht+0xe2c7, %rdi
clflush (%rdi)
nop
nop
dec %r13
mov $55, %rcx
rep movsw
nop
nop
nop
sub $2284, %rdi
lea addresses_A_ht+0x2273, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%rbx), %rdx
nop
cmp %rbx, %rbx
lea addresses_A_ht+0x97c7, %r11
nop
nop
nop
nop
nop
sub %r13, %r13
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%r11)
xor %r11, %r11
lea addresses_UC_ht+0x170c7, %rsi
nop
nop
sub %rcx, %rcx
movw $0x6162, (%rsi)
xor %rdx, %rdx
lea addresses_UC_ht+0x11827, %r11
nop
nop
nop
nop
nop
inc %r8
movw $0x6162, (%r11)
nop
nop
nop
sub $25501, %r8
lea addresses_WT_ht+0x1a39f, %r11
nop
inc %rdx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm1
vmovups %ymm1, (%r11)
nop
nop
nop
inc %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rbp
push %rdi
push %rdx
push %rsi
// Faulty Load
lea addresses_WC+0x13ac7, %rsi
dec %rbp
vmovups (%rsi), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rdx
lea oracles, %r8
and $0xff, %rdx
shlq $12, %rdx
mov (%r8,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rbp
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 1, 'NT': True, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True}}
{'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
regtests/asf-models-selects-tests.adb | jquorning/ada-asf | 12 | 14235 | <filename>regtests/asf-models-selects-tests.adb
-----------------------------------------------------------------------
-- asf-models-selects-tests - Unit tests for UI select model
-- Copyright (C) 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
package body ASF.Models.Selects.Tests is
package Caller is new Util.Test_Caller (Test, "Models.Selects");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test ASF.Models.Selects.Create_Select_Item",
Test_Select_Item'Access);
Caller.Add_Test (Suite, "Test ASF.Models.Selects.Create_Select_Item_Wide",
Test_Select_Item'Access);
Caller.Add_Test (Suite, "Test ASF.Models.Selects.Get_Label,Get_Value",
Test_Select_Item'Access);
Caller.Add_Test (Suite, "Test ASF.Models.Selects.To_Object",
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test ASF.Models.Selects.To_Select_Item",
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test ASF.Models.Selects.Append,Length,Get_Select_Item",
Test_Select_Item_List'Access);
end Add_Tests;
-- ------------------------------
-- Test creation of Select_Item
-- ------------------------------
procedure Test_Select_Item (T : in out Test) is
Val : Select_Item := Create_Select_Item ("red", "1");
begin
for I in 1 .. 2 loop
T.Assert ("red" = Val.Get_Label, "Invalid label");
T.Assert ("1" = Val.Get_Value, "Invalid value");
T.Assert (not Val.Is_Disabled, "Not disabled");
T.Assert (Val.Is_Escaped, "Invalid escape flag");
Val := Create_Select_Item_Wide ("red", "1");
end loop;
Val := Create_Select_Item ("blue", "2", "Blue color");
for I in 1 .. 2 loop
T.Assert ("blue" = Val.Get_Label, "Invalid label");
T.Assert ("2" = Val.Get_Value, "Invalid value");
T.Assert ("Blue color" = Val.Get_Description, "Invalid description");
T.Assert (not Val.Is_Disabled, "Not disabled");
T.Assert (Val.Is_Escaped, "Invalid escape flag");
Val := Create_Select_Item_Wide ("blue", "2", "Blue color");
end loop;
end Test_Select_Item;
-- ------------------------------
-- Test To_Object and To_Select_Item
-- ------------------------------
procedure Test_To_Object (T : in out Test) is
Val : Select_Item := Create_Select_Item ("red", "1");
Res : Select_Item;
Obj : Util.Beans.Objects.Object := To_Object (Res);
begin
T.Assert (Util.Beans.Objects.Is_Null (Obj), "Object should be null");
Obj := To_Object (Val);
T.Assert (not Util.Beans.Objects.Is_Empty (Obj), "Object should not be empty");
T.Assert (not Util.Beans.Objects.Is_Null (Obj), "Object should not be empty");
Val := Create_Select_Item ("blue", "2");
T.Assert ("blue" = Val.Get_Label, "Invalid label");
Res := To_Select_Item (Obj);
T.Assert ("red" = Res.Get_Label, "Invalid label");
T.Assert ("1" = Res.Get_Value, "Invalid value");
T.Assert (not Res.Is_Disabled, "Not disabled");
T.Assert (Res.Is_Escaped, "Invalid escape flag");
end Test_To_Object;
-- ------------------------------
-- Test creation of Select_Item_List
-- ------------------------------
procedure Test_Select_Item_List (T : in out Test) is
List : Select_Item_List;
Val : Select_Item := Create_Select_Item ("red", "1");
begin
for I in 1 .. 10 loop
Val := Create_Select_Item_Wide ("red", Integer'Wide_Wide_Image (I));
List.Append (Val);
end loop;
Util.Tests.Assert_Equals (T, 10, List.Length, "Invalid select item list size");
for I in 1 .. 10 loop
Val := List.Get_Select_Item (I);
T.Assert ("red" = Val.Get_Label, "Invalid label");
T.Assert (Integer'Wide_Wide_Image (I) = Val.Get_Value, "Invalid value");
end loop;
end Test_Select_Item_List;
end ASF.Models.Selects.Tests;
|
gdb/testsuite/gdb.ada/arr_acc_idx_w_gap/enum_with_gap.ads | greyblue9/binutils-gdb | 1 | 11125 | <filename>gdb/testsuite/gdb.ada/arr_acc_idx_w_gap/enum_with_gap.ads<gh_stars>1-10
-- Copyright 2018-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Enum_With_Gap is
type Enum_With_Gaps is
(
LIT0,
LIT1,
LIT2,
LIT3,
LIT4
);
for Enum_With_Gaps use
(
LIT0 => 3,
LIT1 => 5,
LIT2 => 8,
LIT3 => 13,
LIT4 => 21
);
for Enum_With_Gaps'size use 16;
type Enum_Subrange is new Enum_With_Gaps range Lit1 .. Lit3;
type MyWord is range 0 .. 16#FFFF# ;
for MyWord'Size use 16;
type AR is array (Enum_With_Gaps range <>) of MyWord;
type AR_Access is access AR;
type String_Access is access String;
procedure Do_Nothing (E : AR_Access);
procedure Do_Nothing (E : String_Access);
end Enum_With_Gap;
|
src/Lambda/Interpreter/Stack-sizes/Example.agda | nad/definitional-interpreters | 0 | 1261 | ------------------------------------------------------------------------
-- An example: A non-terminating program that runs in bounded stack
-- space
------------------------------------------------------------------------
module Lambda.Interpreter.Stack-sizes.Example where
open import Equality.Propositional as E using (refl)
open import Prelude
open import Prelude.Size
open import Colist E.equality-with-J as C
open import Conat E.equality-with-J as Conat hiding (pred)
open import Function-universe E.equality-with-J hiding (id; _∘_)
open import Monad E.equality-with-J
open import Nat E.equality-with-J
open import Vec.Data E.equality-with-J
open import Delay-monad
open import Delay-monad.Bisimilarity as D using (later; force)
open import Upper-bounds
import Lambda.Delay-crash-trace as DCT
import Lambda.Interpreter
import Lambda.Interpreter.Stack-sizes
open DCT.Delay-crash-trace
-- This module uses a name type with a single inhabitant, allowing
-- (and requiring) the definition and use of one named definition.
open import Lambda.Syntax ⊤
open Closure Tm
-- A definition that calls itself repeatedly using a tail call.
def : ⊤ → Tm 1
def tt = call tt (con true)
-- The two interpreters are instantiated with this definition.
open Lambda.Interpreter def
module I = Lambda.Interpreter.Stack-sizes def
-- A top-level term to get things going.
go : Tm 0
go = call tt (con true)
-- The semantics of go is the non-terminating computation never.
go-loops : ∀ {i} → D.[ i ] ⟦ go ⟧ [] ∼ never
go-loops = later λ { .force → go-loops }
-- Colists used to analyse the stack space usage of go.
loop-sizes : ∀ {i} → Colist ℕ i
loop-sizes = 1 ∷′ 2 ∷ λ { .force → loop-sizes }
go-sizes : Colist ℕ ∞
go-sizes = 0 ∷′ 1 ∷′ loop-sizes
-- When go is interpreted (starting with an empty stack) the stack
-- sizes that are encountered match the sizes in go-sizes.
stack-sizes-go∼go-sizes : ∀ {i} → C.[ i ] I.stack-sizes go ∼ go-sizes
stack-sizes-go∼go-sizes =
I.numbers (I.⟦ go ⟧ [] false) 0 C.∼⟨ ∷∼∷′ ⟩
0 ∷′ I.numbers (I.[ id , pred ] lam (def tt) [] ∙ con true) 1 C.∼⟨ (refl ∷ λ { .force → ∷∼∷′ }) ⟩
0 ∷′ 1 ∷′ I.numbers (I.⟦ def tt ⟧ ρ true >>= tell pred ∘ return) 1 C.∼⟨ (refl ∷ λ { .force → refl ∷ λ { .force → numbers-loop∼loop-sizes _ }}) ⟩
0 ∷′ 1 ∷′ loop-sizes C.∼⟨⟩
go-sizes C.∎
where
ρ = con true ∷ []
numbers-loop∼loop-sizes :
∀ {i} k → C.[ i ] I.numbers (I.⟦ def tt ⟧ ρ true >>= k) 1 ∼ loop-sizes
numbers-loop∼loop-sizes k =
I.numbers (I.⟦ def tt ⟧ ρ true >>= k) 1 C.∼⟨ ∷∼∷′ ⟩
1 ∷′ I.numbers (I.[ pred , id ] lam (def tt) [] ∙ con true >>= k) 2 C.∼⟨ (refl ∷ λ { .force → ∷∼∷′ }) ⟩
1 ∷′ 2 ∷′ I.numbers (I.⟦ def tt ⟧ ρ true >>= tell id ∘ return >>= k) 1 C.∼⟨ (refl ∷ λ { .force → refl ∷ λ { .force → I.numbers-cong (
DCT.symmetric (DCT.associativity (I.⟦ def tt ⟧ ρ true) _ _)) }}) ⟩
1 ∷′ 2 ∷′ I.numbers (I.⟦ def tt ⟧ ρ true >>= tell id ∘ k) 1 C.∼⟨ (refl ∷ λ { .force → refl ∷ λ { .force →
numbers-loop∼loop-sizes _ }}) ⟩
1 ∷′ 2 ∷′ loop-sizes C.∼⟨ (refl ∷ λ { .force → C.symmetric-∼ ∷∼∷′ }) ⟩
loop-sizes C.∎
-- The least upper bound of go-sizes is 2.
lub-go-sizes-2 : LUB go-sizes ⌜ 2 ⌝
lub-go-sizes-2 =
lub-∷ʳ zero (lub-∷ʳ 1≤2 lub-loop-sizes-2)
where
1≤2 = suc λ { .force → zero }
2∷[] = λ { .force → 2 ∷′ [] }
cycle-1-2∷[]∼loop-sizes :
∀ {i} → C.[ i ] cycle 1 2∷[] ∼ loop-sizes
cycle-1-2∷[]∼loop-sizes =
refl ∷ λ { .force → refl ∷ λ { .force → cycle-1-2∷[]∼loop-sizes }}
lub-loop-sizes-2 : LUB loop-sizes ⌜ 2 ⌝
lub-loop-sizes-2 = $⟨ lub-∷ʳ 1≤2 (lub-∷ˡ zero lub-[]) ⟩
LUB (1 ∷ 2∷[]) ⌜ 2 ⌝ ↝⟨ lub-cycle ⟩
LUB (cycle 1 2∷[]) ⌜ 2 ⌝ ↝⟨ LUB-∼ cycle-1-2∷[]∼loop-sizes (Conat.reflexive-∼ _) ⟩□
LUB loop-sizes ⌜ 2 ⌝ □
-- The maximum stack size encountered when running go (starting with
-- an empty stack) is 2.
go-bounded-stack : LUB (I.stack-sizes go) ⌜ 2 ⌝
go-bounded-stack =
LUB-∼ (C.symmetric-∼ stack-sizes-go∼go-sizes)
(Conat.reflexive-∼ _)
lub-go-sizes-2
|
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i9-9900K_12_0xca_notsx.log_21829_1018.asm | ljhsiun2/medusa | 9 | 95561 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_UC+0x8d85, %rdx
nop
nop
nop
nop
nop
cmp %rbx, %rbx
movw $0x5152, (%rdx)
nop
and $10849, %r11
// Load
lea addresses_PSE+0x12285, %rcx
nop
inc %rax
mov (%rcx), %r11d
nop
nop
nop
nop
nop
dec %rcx
// Load
lea addresses_A+0xf285, %r10
nop
nop
dec %r15
mov (%r10), %r11
nop
nop
nop
nop
nop
sub $40131, %r11
// Store
lea addresses_A+0xf285, %r11
nop
nop
nop
nop
nop
and $21410, %r15
movw $0x5152, (%r11)
add %rax, %rax
// Load
lea addresses_PSE+0x17285, %r15
nop
nop
add $39249, %r10
movb (%r15), %bl
nop
nop
nop
sub $7575, %rbx
// REPMOV
lea addresses_WC+0xea65, %rsi
lea addresses_WT+0x19385, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
dec %r10
mov $53, %rcx
rep movsb
nop
nop
nop
nop
add %r15, %r15
// Store
lea addresses_WT+0x1da85, %rdi
nop
nop
add %rcx, %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm1
movups %xmm1, (%rdi)
nop
nop
add %rax, %rax
// Faulty Load
lea addresses_A+0xf285, %rdx
nop
nop
nop
nop
inc %r15
vmovaps (%rdx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbx
lea oracles, %rax
and $0xff, %rbx
shlq $12, %rbx
mov (%rax,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'00': 21823, '52': 6}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
libsrc/zx81/basic/zx_basemem.asm | meesokim/z88dk | 0 | 7607 | <reponame>meesokim/z88dk
;
; ZX 81 specific routines
; by <NAME>, 25/07/2008
;
; int zx_basemem;
;
; This function returns the base memory size in kbytes
; Measures only up to the RAMPTOP limit
;
; $Id: zx_basemem.asm,v 1.2 2015/01/19 01:33:26 pauloscustodio Exp $
;
PUBLIC zx_basemem
zx_basemem:
ld a,(16389)
srl a
inc a
srl a
sub 16 ; subtract the ROM size
ld l,a
ld h,0
ret
|
SOAS/Syntax/Build.agda | JoeyEremondi/agda-soas | 0 | 17043 | <filename>SOAS/Syntax/Build.agda
-- Helper operations to construct and build signatures
module SOAS.Syntax.Build (T : Set) where
open import SOAS.Common
open import SOAS.Families.Build {T}
open import SOAS.Context {T}
open import Data.List.Base
open import SOAS.Syntax.Signature T
-- Syntactic sugar to construct arity - sort mappings
⟼₀_ : T → List (Ctx × T) × T
⟼₀_ τ = [] , τ
_⟼₁_ : (Ctx × T) → T → List (Ctx × T) × T
a ⟼₁ τ = [ a ] , τ
_,_⟼₂_ : (a₁ a₂ : Ctx × T) → T → List (Ctx × T) × T
a₁ , a₂ ⟼₂ τ = (a₁ ∷ [ a₂ ]) , τ
_,_,_⟼₃_ : (a₁ a₂ a₃ : Ctx × T) → T → List (Ctx × T) × T
a₁ , a₂ , a₃ ⟼₃ τ = (a₁ ∷ a₂ ∷ [ a₃ ]) , τ
_,_,_,_⟼₄_ : (a₁ a₂ a₃ a₄ : Ctx × T) → T → List (Ctx × T) × T
a₁ , a₂ , a₃ , a₄ ⟼₄ τ = (a₁ ∷ a₂ ∷ a₃ ∷ [ a₄ ]) , τ
_⟼ₙ_ : List (Ctx × T) → T → List (Ctx × T) × T
_⟼ₙ_ = _,_
-- Syntactic sugar to costruct arguments
⊢₀_ : T → Ctx × T
⊢₀ α = ∅ , α
_⊢₁_ : T → T → Ctx × T
τ ⊢₁ α = ⌊ τ ⌋ , α
_,_⊢₂_ : (τ₁ τ₂ : T) → T → Ctx × T
τ₁ , τ₂ ⊢₂ α = ⌊ τ₁ ∙ τ₂ ⌋ , α
_,_,_⊢₃_ : (τ₁ τ₂ τ₃ : T) → T → Ctx × T
τ₁ , τ₂ , τ₃ ⊢₃ α = ⌊ τ₁ ∙ τ₂ ∙ τ₃ ⌋ , α
_⊢ₙ_ : Ctx → T → Ctx × T
Π ⊢ₙ τ = Π , τ
infix 2 ⟼₀_
infix 2 _⟼₁_
infix 2 _,_⟼₂_
infix 2 _,_,_⟼₃_
infix 2 _⟼ₙ_
infix 10 ⊢₀_
infix 10 _⊢₁_
infix 10 _,_⊢₂_
infix 10 _⊢ₙ_
-- Sum of two signatures
_+ˢ_ : {O₁ O₂ : Set} → Signature O₁ → Signature O₂ → Signature (+₂ O₁ O₂)
S1 +ˢ S2 = sig (₂| ∣ S1 ∣ ∣ S2 ∣)
where open Signature
-- Sums of signatures
Σ₂ : {O₁ O₂ : Set} → Signature O₁ → Signature O₂ → Signature (+₂ O₁ O₂)
Σ₂ S₁ S₂ = sig (₂| (∣ S₁ ∣) (∣ S₂ ∣))
where open Signature
Σ₃ : {O₁ O₂ O₃ : Set} → Signature O₁ → Signature O₂ → Signature O₃ → Signature (+₃ O₁ O₂ O₃)
Σ₃ S₁ S₂ S₃ = sig (₃| (∣ S₁ ∣) (∣ S₂ ∣) (∣ S₃ ∣))
where open Signature
Σ₄ : {O₁ O₂ O₃ O₄ : Set} → Signature O₁ → Signature O₂ → Signature O₃ → Signature O₄ → Signature (+₄ O₁ O₂ O₃ O₄)
Σ₄ S₁ S₂ S₃ S₄ = sig (₄| (∣ S₁ ∣) (∣ S₂ ∣) (∣ S₃ ∣) (∣ S₄ ∣))
where open Signature
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1849.asm | ljhsiun2/medusa | 9 | 174375 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r14
push %r15
push %rbp
push %rsi
lea addresses_WC_ht+0x71d5, %r14
nop
nop
nop
nop
nop
add $6252, %r11
movl $0x61626364, (%r14)
nop
nop
nop
nop
nop
sub %r15, %r15
lea addresses_normal_ht+0xae75, %rsi
nop
nop
nop
xor $21466, %rbp
movups (%rsi), %xmm5
vpextrq $0, %xmm5, %r14
nop
nop
nop
nop
and $7512, %rsi
lea addresses_WC_ht+0x53d5, %rbp
nop
nop
nop
cmp $55673, %r15
movl $0x61626364, (%rbp)
nop
nop
nop
sub $64104, %r14
lea addresses_A_ht+0x5dd5, %r11
nop
nop
nop
nop
sub %r12, %r12
mov $0x6162636465666768, %r14
movq %r14, (%r11)
nop
nop
nop
lfence
lea addresses_A_ht+0x106f5, %r11
nop
xor %r13, %r13
mov (%r11), %esi
nop
and %rbp, %rbp
lea addresses_D_ht+0x10dd5, %r14
clflush (%r14)
nop
nop
nop
nop
xor %r12, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm2
vmovups %ymm2, (%r14)
nop
sub $60543, %r14
pop %rsi
pop %rbp
pop %r15
pop %r14
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_RW+0x1e159, %rcx
nop
nop
nop
add $34406, %rdi
movl $0x51525354, (%rcx)
nop
nop
nop
nop
nop
dec %rcx
// Store
lea addresses_WT+0xcd95, %rcx
nop
add $49180, %rsi
mov $0x5152535455565758, %rdx
movq %rdx, (%rcx)
nop
nop
nop
nop
cmp %r10, %r10
// Load
lea addresses_A+0x1bf75, %rdx
nop
nop
nop
nop
nop
dec %r9
vmovups (%rdx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rsi
nop
nop
nop
nop
nop
dec %rcx
// Store
mov $0x42265d0000000e2f, %rdx
nop
nop
inc %r9
movl $0x51525354, (%rdx)
// Exception!!!
nop
nop
nop
mov (0), %r9
nop
xor %r10, %r10
// Faulty Load
lea addresses_RW+0x49d5, %rsi
nop
dec %rdx
mov (%rsi), %r10w
lea oracles, %rsi
and $0xff, %r10
shlq $12, %r10
mov (%rsi,%r10,1), %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': True, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
libsrc/video/tms9918/graphics/plotpixl.asm | jpoikela/z88dk | 640 | 21525 | <filename>libsrc/video/tms9918/graphics/plotpixl.asm
MODULE __tms9918_plotpixel
SECTION code_clib
PUBLIC __tms9918_plotpixel
EXTERN __tms9918_pixeladdress
EXTERN __gfx_coords
EXTERN __tms9918_pix_return
INCLUDE "graphics/grafix.inc"
INCLUDE "video/tms9918/vdp.inc"
IF VDP_EXPORT_GFX_DIRECT = 1
PUBLIC plotpixel
defc plotpixel = __tms9918_plotpixel
ENDIF
; ******************************************************************
;
; Plot pixel at (x,y) coordinate.
;
; in: hl = (x,y) coordinate of pixel (h,l)
.__tms9918_plotpixel
ld a,l
cp 192
ret nc ; y0 out of range
ld (__gfx_coords),hl
push bc
call __tms9918_pixeladdress
ld b,a
ld a,1
jr z, or_pixel ; pixel is at bit 0...
.plot_position
rlca
djnz plot_position
.or_pixel
;ex de,hl
or (hl)
jp __tms9918_pix_return
|
scripts/oldstims/rand_stim_1588482132_v0.3_s1024_test.asm | grantsimmons/GameBuddy-Verilog | 1 | 87730 | <filename>scripts/oldstims/rand_stim_1588482132_v0.3_s1024_test.asm
RRA
ADDAC
RES0D
SET4mHL
LDDmHL
BIT3L
LDED
ADCAD
RES2D
ORH
LDEC
XORA
INCL
RES7C
LDmHLH
INCL
RLCmHL
LDEL
LDEC
BIT0L
SET0mHL
LDCA
LDBC
RES4L
RLL
RES1H
SCF
LDEmHL
SRAL
RES4mHL
LDHD
RES4A
SRAmHL
RRCC
SET4mHL
BIT5D
LDmHLL
BIT2C
RES7H
XORE
DECA
LDLL
ANDL
ORn
LDDE
ADDAn
ADCAL
ADCAA
DECH
SET6H
SLAB
LDmHLH
LDAH
LDLE
LDHA
LDEn
ANDA
LDAC
INCD
SET2B
ORL
LDDE
SWAPL
LDAmHL
BIT1C
INCD
SET2H
XORE
XORA
RLD
BIT5H
BIT5L
INCE
LDDmHL
ORA
LDHL
LDAA
LDCD
SET6E
RES2E
ANDmHL
LDmHLB
DECH
BIT1H
RRCE
LDAE
RES3B
ADCAH
ORmHL
SWAPL
LDAC
SET1B
XORE
RES3L
LDEmHL
BIT2E
BIT7L
ANDD
SRLB
LDCB
RES4H
XORE
BIT0A
LDCB
BIT4D
ADDAH
BIT0mHL
SET3L
BIT4L
SLAL
SET4mHL
RES5H
LDmHLC
ORB
LDCD
LDLL
LDEA
ADCAB
LDmDEA
RES4mHL
SLAA
BIT0H
ORC
BIT2H
LDBL
RES7D
SWAPD
LDLB
LDAmBC
ADDAn
XORn
ORH
LDCn
ANDD
BIT6D
SRAC
BIT2H
BIT5B
SET2H
BIT0B
DECD
SET6A
LDmBCA
LDHB
LDCD
SLAH
BIT1D
RES2E
LDHmHL
RES3mHL
ORmHL
ADCAC
LDAmBC
LDDE
ORL
RES5B
LDHH
LDAmDE
RES1mHL
ADDAB
XORB
SET6C
INCB
RRA
LDLL
BIT2E
CCF
SET0mHL
ORE
RES6B
LDLL
LDEL
LDHL
BIT7H
LDAmDE
RRD
XORC
SET7mHL
ADDAH
RES6mHL
LDDA
SET4E
ORD
ANDB
LDHC
LDLmHL
SET5A
SET5B
ADDAmHL
BIT6A
RES7L
SET0mHL
SET6A
SET5mHL
RES3A
ADDAD
DECA
SET6B
LDAL
XORC
BIT5A
BIT4D
SRLmHL
BIT2B
BIT4mHL
RES7L
LDBL
LDDEnn
ADDAn
XORn
INCE
SET1E
SET2L
ANDL
BIT4B
ORn
LDDD
BIT1H
LDDEnn
ANDD
BIT4H
LDCn
LDCH
ADCAL
RES3A
LDAmDE
LDHD
RES3E
LDCB
ORB
RES0mHL
LDBL
INCD
SRLC
RES2A
SET5B
SET3D
LDCH
CCF
RRH
SRLH
ADCAn
ADDAH
RES5C
RES1D
RES3C
SET1E
LDDH
SLAC
RES7H
RES1B
BIT3C
LDmHLE
RES4D
SRLmHL
ORC
SET4A
LDEmHL
SET3L
BIT4A
LDmHLE
SET0D
XORmHL
BIT2B
LDAL
SRAA
BIT4D
ADDAmHL
ORE
SRAC
BIT5C
ANDmHL
BIT5H
RES4D
ADDAB
ORH
ANDB
LDEH
BIT4A
ADDAH
ORE
ANDn
LDEC
LDBD
RRA
SET4C
LDDC
ADDAD
SET5L
LDDE
SET1mHL
ADDAL
LDAL
LDBB
SWAPE
SRAB
ORC
LDBA
LDAL
SRAA
SET7L
LDmHLD
SET0H
BIT1L
RRD
RRCA
LDmHLA
BIT0H
RES5A
LDBE
RES0A
NOT
LDEH
SET6mHL
RES0mHL
LDmHLE
LDDL
RES1E
BIT6H
ADCAC
ADDAH
BIT6mHL
RES6A
INCH
SRAA
RES2C
RRCD
RES1L
BIT1E
LDHC
XORE
DECL
RES5C
NOT
LDBE
LDCA
LDAH
RES1D
LDEmHL
LDCD
RES2A
RES0D
RES2H
ORmHL
BIT7C
RRCB
RLCL
SET4C
RES2B
XORE
DECH
BIT6D
SET7D
RRE
LDDn
LDEE
RES2C
LDBn
LDAE
SET3D
LDBH
RRL
SET5mHL
BIT2H
LDLB
LDLC
BIT7B
LDLA
RLCA
BIT0H
RES5L
ADDAE
ADCAB
NOP
INCB
LDDH
ADDAC
ADDAmHL
BIT5A
XORB
LDLmHL
SET6L
ANDn
LDED
LDDB
LDmHLD
LDDH
LDHB
LDLA
LDDn
INCA
RES2mHL
SRLH
SET0C
BIT0mHL
RES1A
RES0mHL
LDBmHL
SET0H
DECC
BIT0D
RES0mHL
RES5A
BIT6A
ANDH
RES4L
LDLH
SET2B
ORmHL
INCA
BIT6E
LDBL
RES1H
ADCAE
RES4E
RRCB
LDBH
DECA
ANDC
BIT5mHL
BIT4mHL
BIT2C
LDBA
ADCAmHL
RES3H
BIT5C
LDED
SET7H
SET2E
SET6A
RES4D
ORA
RES5B
ADCAC
LDBB
RLmHL
LDDH
LDEmHL
SRAA
SET7H
RES1B
RLCmHL
XORB
SRLC
LDBL
LDmHLD
RES6A
LDLn
LDAmBC
ANDE
RRA
ORE
BIT3D
LDED
SWAPmHL
INCH
ADCAE
INCH
LDBmHL
NOT
RLA
LDDA
LDAC
RES1mHL
RES7C
ANDL
RES3L
ADCAmHL
BIT1C
RES7H
SRAA
LDDB
BIT1B
RRA
SLAC
BIT2B
ADDAC
ADCAD
SRAH
DECC
LDEn
ADCAC
RLCB
ANDL
SCF
LDAD
LDmHLB
RLCH
SET6C
RES1A
LDLn
LDED
BIT1C
BIT4mHL
BIT4L
SET5C
INCL
LDBE
DECA
ADCAA
SET5C
SET1E
BIT5L
RLCD
ADDAmHL
LDAC
RES4D
SWAPB
BIT5mHL
LDCH
ADDAmHL
INCH
BIT1E
INCB
LDHA
SLAL
RES7E
SLAB
RES5mHL
SET3D
LDLH
RRA
SET0D
BIT3mHL
BIT2H
NOT
BIT7C
LDBD
DECA
RLL
LDCD
RRA
XORn
ANDH
ADCAmHL
SET6mHL
SET7L
RLCE
SLAB
CCF
SET1mHL
RRCD
BIT0L
BIT5L
ADCAB
RES1D
INCH
SET3E
LDDL
BIT5L
RES0L
SET0D
RES3A
ADDAH
DECB
RES3mHL
SRAmHL
LDCn
ORD
SET6H
RES0L
RES6mHL
ADCAn
LDDA
RES6H
RES1B
RES0D
BIT6C
LDAmBC
SWAPE
SRLmHL
SET5H
BIT2E
SRAmHL
RES1A
BIT3H
RRA
XORn
LDBD
RES0L
LDEC
SET1E
SRLH
SET2L
SET4E
RLC
SRAmHL
LDAL
BIT5H
RES6C
RES2H
RLmHL
LDBC
RES4mHL
LDDmHL
BIT6L
BIT0H
LDCC
SET0H
RES7D
RRL
SLAH
BIT3L
ADCAL
SET4A
RES0A
LDmHLD
LDLB
ADDAL
ANDL
XORC
BIT4L
ADDAn
ORL
BIT6H
LDBmHL
RRCC
SET7H
BIT4L
LDAE
LDEH
SET2mHL
SRAC
ANDE
LDDH
SET1L
DECA
BIT5B
ORD
RES5B
SRLL
LDBH
LDDE
BIT6D
BIT5A
LDHD
LDHE
RES1D
ORB
RRD
ADCAL
RES4L
BIT7H
RES1H
SET5A
BIT5L
LDBmHL
RES5B
SET2E
BIT5A
LDBA
NOT
SET1L
SET2L
XORmHL
RES7L
LDED
RES3C
SLAC
SRAH
ORH
SET6L
LDmDEA
RRCL
XORn
RLCA
SET0L
RES7L
RES7L
LDLmHL
LDLE
ANDn
LDLn
LDLB
SET3D
LDAE
ADCAL
INCL
RES4C
BIT7B
LDLn
LDDB
SET3B
LDDD
RES2E
DECH
ORn
ADDAD
LDBmHL
SET1E
ADDAA
ORB
SET2B
RES0L
LDDA
BIT4A
RES0A
SET5L
SWAPC
SET0E
ANDA
LDLmHL
DECE
ORn
XORA
LDDEnn
ORD
LDAmBC
RES5L
SET1H
LDHn
LDLB
ORE
RRCmHL
SET0C
BIT0D
BIT6mHL
XORE
BIT2A
BIT0C
ORA
RLCH
SET5A
ORH
LDDn
XORH
RRL
XORA
RES7D
LDLH
LDAA
BIT1L
LDEH
ADDAA
LDDD
LDED
BIT0E
LDEB
ADDAn
ORmHL
LDEC
RES2L
BIT6A
ANDC
SET4A
RES6C
SET6C
SET5E
SWAPH
DECC
LDmHLA
RRC
LDAE
LDBB
DECL
LDHn
ADCAD
ADDAmHL
LDAL
SLAmHL
SLAH
LDDEnn
LDEB
RES5mHL
LDHmHL
BIT5A
RES6L
BIT1H
LDAL
SET2E
SRAH
ADDAD
LDCA
BIT1E
BIT2D
LDCD
NOP
LDmHLA
LDmHLC
LDLE
SET7mHL
ADCAE
LDLn
LDAC
RES3A
SET4A
SRAD
RES6mHL
BIT2B
RLCL
BIT1D
SET3A
LDDmHL
SET6D
BIT0A
BIT6C
SET0D
LDDC
RES0H
SET7mHL
RES1L
RLC
LDBC
SET4L
ADCAD
LDBmHL
LDDE
ORH
BIT3mHL
SET4L
BIT1D
SET2B
ANDD
LDHmHL
LDAD
LDEL
SET4L
RRCC
SET1B
LDmHLL
RES6D
LDBmHL
LDEC
RES5mHL
ORB
SET2D
LDHmHL
DECA
LDAE
INCC
LDmHLC
LDBH
SLAH
DECE
RES2E
LDEB
RES1B
ANDB
SET2A
RLCB
RES2B
ANDA
SET6D
ADCAE
SWAPD
SET2D
SRLL
ADDAD
RES4mHL
RES2A
SRLD
LDmBCA
BIT0mHL
RES6C
SET3L
BIT1D
RES0mHL
LDAC
BIT2A
ADCAH
ORL
LDLB
ADCAL
LDLB
BIT0C
SET2H
ADCAB
BIT3B
RRA
SRAL
LDHmHL
LDAn
LDLH
ANDE
BIT6H
LDmHLE
LDAD
LDEL
BIT5L
ADDAB
XORH
SET7H
LDCA
LDmHLB
BIT2L
SRLE
BIT7D
SLAC
BIT2D
LDCD
ORA
BIT1L
ORL
BIT5C
RES7mHL
LDEE
RES4L
RRCC
LDAH
BIT6A
SLAH
RES3B
ORH
INCA
RES3E
RES3L
RES4B
SET3D
BIT5L
LDDC
SET0D
SLAB
ADDAE
DECA
LDDA
LDLB
LDEn
LDBB
LDmHLB
LDDEnn
XORmHL
DECL
BIT7C
XORA
LDHmHL
LDDD
RLA
SET5A
SET4L
SET0E
SLAL
RRCD
ADDAH
SET3A
SRLL
RLCB
LDAH
LDCL
BIT0D
LDDL
XORC
RRCA
RES1D
ANDH
LDDC
BIT1E
SLAH
LDDEnn
LDBL
RLA
RRCC
SET1C
DECL
LDAH
RES1mHL
LDLC
LDEB
RRCD
RES3B
LDCL
NOT
DECB
LDAB
LDCH
LDDH
RLA
BIT4C
ADCAC
SET2mHL
RES1D
BIT3mHL
SET4B
ADCAmHL
DECL
LDHD
ANDA
BIT4D
ADCAB
RRCD
RES4D
SLAH
ORmHL
RES3D
DECB
LDAE
BIT0D
BIT2C
ORmHL
NOT
LDLB
XORn
LDmHLA
STOP |
programs/oeis/228/A228219.asm | karttu/loda | 0 | 14008 | <filename>programs/oeis/228/A228219.asm
; A228219: Number of second differences of arrays of length 4 of numbers in 0..n.
; 15,49,103,177,271,385,519,673,847,1041,1255,1489,1743,2017,2311,2625,2959,3313,3687,4081,4495,4929,5383,5857,6351,6865,7399,7953,8527,9121,9735,10369,11023,11697,12391,13105,13839,14593,15367,16161,16975,17809,18663,19537,20431,21345,22279,23233,24207,25201,26215,27249,28303,29377,30471,31585,32719,33873,35047,36241,37455,38689,39943,41217,42511,43825,45159,46513,47887,49281,50695,52129,53583,55057,56551,58065,59599,61153,62727,64321,65935,67569,69223,70897,72591,74305,76039,77793,79567,81361,83175,85009,86863,88737,90631,92545,94479,96433,98407,100401,102415,104449,106503,108577,110671,112785,114919,117073,119247,121441,123655,125889,128143,130417,132711,135025,137359,139713,142087,144481,146895,149329,151783,154257,156751,159265,161799,164353,166927,169521,172135,174769,177423,180097,182791,185505,188239,190993,193767,196561,199375,202209,205063,207937,210831,213745,216679,219633,222607,225601,228615,231649,234703,237777,240871,243985,247119,250273,253447,256641,259855,263089,266343,269617,272911,276225,279559,282913,286287,289681,293095,296529,299983,303457,306951,310465,313999,317553,321127,324721,328335,331969,335623,339297,342991,346705,350439,354193,357967,361761,365575,369409,373263,377137,381031,384945,388879,392833,396807,400801,404815,408849,412903,416977,421071,425185,429319,433473,437647,441841
mov $1,5
mul $1,$0
add $1,12
mul $1,$0
mul $1,2
add $1,15
|
src/main/java/org/naivedb/Statement/grammar/sql.g4 | ycdfwzy/NaiveDB | 0 | 7457 | grammar sql;
parse
: ( sql_stmt_list | error )* EOF
;
error
: UNEXPECTED_CHAR
{
throw new RuntimeException("UNEXPECTED_CHAR=" + $UNEXPECTED_CHAR.text );
}
;
sql_stmt_list
: sql_stmt ( ';'+ sql_stmt )* ';'
;
sql_stmt
: create_db_stmt
| create_table_stmt
| drop_stmt
| insert_stmt
| delete_stmt
| update_stmt
| select_stmt
| use_stmt
| show_stmt
;
create_db_stmt
: K_CREATE K_DATABASE db_name
;
create_table_stmt
: K_CREATE K_TABLE
table_name
( '(' attr_name type_name (K_NOT K_NULL)? ( ',' attr_name type_name (K_NOT K_NULL)? )* ( ',' K_PRIMARY K_KEY '(' attr_name ')' )? ')'
)
;
drop_stmt
: K_DROP ( K_TABLE | K_DATABASE ) ( table_name | db_name )
;
insert_stmt
: K_INSERT K_INTO table_name ( '(' attr_name ( ',' attr_name )* ')' )?
( K_VALUES '(' expr ( ',' expr )* ')' ( ',' '(' expr ( ',' expr )* ')' )*
)
;
delete_stmt
: K_DELETE K_FROM table_name ( K_WHERE pred_expr )?
;
update_stmt
: K_UPDATE table_name K_SET asign_clause ( K_WHERE pred_expr )?
;
select_stmt
: K_SELECT select_elements K_FROM join_range ( K_WHERE pred_expr )?
;
use_stmt
: K_USE db_name
;
show_stmt
: K_SHOW K_DATABASES
| K_SHOW K_DATABASE db_name
| K_SHOW K_TABLE table_name
;
select_elements
: '*'
| expr_column ( ',' expr_column )*
;
asign_clause
: expr_column '=' expr (',' expr_column '=' expr)*
;
join_range // rangeVariable
: table_name
| join_ranges // rangeVariable[]
| '(' join_range ')'
;
join_ranges // rangeVariable[]
: single_range ( product_range )+
| single_range ( natural_join | join_on )+
;
product_range
: ',' (single_range | join_range)
;
natural_join // rangeVariable
: K_NATURAL ( outer_join | inner_join )
;
join_on
: ( outer_join | inner_join ) K_ON pred_expr
;
outer_join
: ( K_LEFT | K_RIGHT | K_FULL ) K_OUTER K_JOIN (single_range | join_range)
;
inner_join
: ( K_INNER )? K_JOIN (single_range | join_range)
;
single_range
: table_name | '(' join_range ')'
;
db_name
: IDENTIFIER;
table_name
: IDENTIFIER;
attr_name
: IDENTIFIER;
type_name
: K_INT
| K_LONG
| K_FLOAT
| K_DOUBLE
| K_STRING '(' INTEGER_LITERAL ')'
;
expr
: numeric_expr
| TEXT_STRING
;
numeric_expr
: numeric_value
| expr_column
| unary_operator numeric_expr
| numeric_expr ( '*' | '/' | '%' ) numeric_expr
| numeric_expr ( '+' | '-' ) numeric_expr
| '(' numeric_expr ')'
;
expr_column
: ( table_name '.' )? attr_name
;
unary_operator
: '-'
| '+'
| '~'
| K_NOT
;
pred_expr
: expr ( '<' | '<=' | '>' | '>=' | '<>' | '==' | '=' | '!=' ) expr
| pred_expr ( K_AND | K_OR ) pred_expr
| '(' pred_expr ')'
;
numeric_value
: INTEGER_LITERAL
| FLOAT_LITERAL
;
SPACES
: [ \u000B\t\r\n] -> channel(HIDDEN)
;
TEXT_STRING
: '"' ( ~'"' | '\\"' )* '"'
| '\'' ( ~'\'' | '\\\'' )* '\''
;
K_CREATE : C R E A T E;
K_DATABASE : D A T A B A S E;
K_DATABASES : D A T A B A S E S;
K_TABLE : T A B L E;
K_TABLES : T A B L E S;
K_NOT : N O T;
K_NULL : N U L L;
K_PRIMARY : P R I M A R Y;
K_KEY : K E Y;
K_DROP : D R O P;
K_INSERT : I N S E R T;
K_INTO : I N T O;
K_VALUES : V A L U E S;
K_DELETE : D E L E T E;
K_FROM : F R O M;
K_WHERE : W H E R E;
K_UPDATE : U P D A T E;
K_SET : S E T;
K_SELECT : S E L E C T;
K_NATURAL : N A T U R A L;
K_LEFT : L E F T;
K_RIGHT : R I G H T;
K_FULL : F U L L;
K_OUTER : O U T E R;
K_INNER : I N N E R;
K_JOIN : J O I N;
K_ON : O N;
K_USE : U S E;
K_SHOW : S H O W;
K_AND : A N D;
K_OR : O R;
K_INT : I N T;
K_LONG : L O N G;
K_FLOAT : F L O A T;
K_DOUBLE : D O U B L E;
K_STRING : S T R I N G;
IDENTIFIER
: [a-zA-Z_] ([a-zA-Z_0-9])*
;
INTEGER_LITERAL
: DIGIT+
;
FLOAT_LITERAL
: DIGIT+ ( '.' DIGIT* )? ( E [-+]? DIGIT+ )?
| '.' DIGIT+ ( E [-+]? DIGIT+ )?
;
UNEXPECTED_CHAR
: .
;
fragment DIGIT : [0-9];
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];
|
workflow/type-clipboard.scpt | ramiroaraujo/alfred-type-clipboard-workflow | 7 | 3905 | set chars to count (get the clipboard)
if chars > 500 then
do shell script "afplay /System/Library/Sounds/Funk.aiff"
else
tell application "System Events"
delay 0.05
keystroke (get the clipboard)
end tell
end if |
Modul 1/latih2.asm | hyuwah/fu-praktikum-smd | 0 | 103728 | ;-------------------------------------------------------------------------------
; Praktikum SMD 2015
; M.Wahyudin (140310120031)
;
; Name : LATIH2.ASM
; Desc : Baca DIPSWITCH di P1, tampilkan ke P2 dan P3
; Input : DIPSWITCH di P1
; Output: LED P2 dan P3
;-------------------------------------------------------------------------------
mov P1, #255 ; Menyiapkan P1 sebagai input (1111 1111)
mulai:
mov a, P1 ; Menyalin data input P1 ke a (?)
mov P2, a ; Menampilkan data a di P2
inc a ; Manipulasi data a + 1
cpl a ; Manipulasi data a dikomplemen
mov P3, a ; Menampilkan data a manipulasi ke P3
sjmp mulai ; Ulang dari mulai
end |
alloy4fun_models/trashltl/models/3/djDkYfZvCttpjvtWg.als | Kaixi26/org.alloytools.alloy | 0 | 2166 | open main
pred iddjDkYfZvCttpjvtWg_prop4 {
some f: File | always f not in Protected implies eventually (always f in Trash) and eventually (always f.link in Trash)
}
pred __repair { iddjDkYfZvCttpjvtWg_prop4 }
check __repair { iddjDkYfZvCttpjvtWg_prop4 <=> prop4o } |
MarkO/BIN2HEX.asm | MarkO-555/CoCoIO-NIC-Base-Code | 1 | 25061 | <gh_stars>1-10
; BIN2HEX
```
start: lda #220
cmp #200
blt under2
```
BIN2HEX: ; Read $40 and Output HEX in ASCII to $41
LDA $40 ; GET DATA
CMPA #9 ; IS DATA 9 OR LESS?
BLS ASCZ
ADDA #'A-'9-1 ; NO, ADD OFFSET FOR LETTERS
ASCZ: ADDA #'O ; CONVERT DATA TO ASCII
STA $41 ; STORE ASCII DATA
BIN2HEX: ; W5100 Read DATA and Output HEX in ASCII
LDA CIO0DATA ; GET DATA from W5100, ( or BINVAL )
PSHS A ; SAVE for Lower Nyble
RORA ; Move Upper Nyble to Lower Nyble
RORA
RORA
RORA
ANDA %00001111 ; MASK top Nyble
CMPA #9 ; IS DATA 9 OR LESS?
BLS ASCZ1
ADDA #'A-'9-1 ; NO, ADD OFFSET FOR LETTERS
ASCZ1: ADDA #'0 ; CONVERT DATA TO ASCII
STA HEX1VAL ; STORE ASCII DATA
PULS A ; PULL saved Nyble
ANDA %00001111 ; MASK top Nyble
CMPA #9 ; IS DATA 9 OR LESS?
BLS ASCZ2
ADDA #'A-'9-1 ; NO, ADD OFFSET FOR LETTERS
ASCZ2: ADDA #'0 ; CONVERT DATA TO ASCII
STA HEX2VAL ; STORE ASCII DATA
RTS
BINVAL: fcb $00
HEX1VAL: fcb $00
HEX2VAL: fcb $00
|
src/Categories/NaturalTransformation/Equivalence.agda | Trebor-Huang/agda-categories | 279 | 9147 | <reponame>Trebor-Huang/agda-categories<filename>src/Categories/NaturalTransformation/Equivalence.agda
{-# OPTIONS --without-K --safe #-}
-- define a less-than-great equivalence on natural transformations
module Categories.NaturalTransformation.Equivalence where
open import Level
open import Relation.Binary using (Rel; IsEquivalence; Setoid)
open import Categories.Category
open import Categories.Functor
open import Categories.NaturalTransformation.Core
private
variable
o ℓ e o′ ℓ′ e′ : Level
C D E : Category o ℓ e
-- This ad hoc equivalence for NaturalTransformation should really be 'modification'
-- (yep, tricategories!). What is below is only part of the definition of a 'modification'. TODO
infix 4 _≃_
_≃_ : ∀ {F G : Functor C D} → Rel (NaturalTransformation F G) _
_≃_ {D = D} X Y = ∀ {x} → D [ NaturalTransformation.η X x ≈ NaturalTransformation.η Y x ]
≃-isEquivalence : ∀ {F G : Functor C D} → IsEquivalence (_≃_ {F = F} {G})
≃-isEquivalence {D = D} {F} {G} = record
{ refl = refl
; sym = λ f → sym f -- need to eta-expand to get things to line up properly
; trans = λ f g → trans f g
}
where open Category.Equiv D
≃-setoid : ∀ (F G : Functor C D) → Setoid _ _
≃-setoid F G = record
{ Carrier = NaturalTransformation F G
; _≈_ = _≃_
; isEquivalence = ≃-isEquivalence
}
|
unittests/ASM/TwoByte/0F_F7.asm | cobalt2727/FEX | 628 | 82714 | <gh_stars>100-1000
%ifdef CONFIG
{
"RegData": {
"RAX": "0x4142434445464748",
"RBX": "0x41424344FFFFFFFF",
"RCX": "0xFFFFFFFFFFFFFFFF"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0x4142434445464748
mov [rdx + 8 * 0], rax
mov rax, 0x8080808080808080
mov [rdx + 8 * 1], rax
mov rax, 0x8080808000000000
mov [rdx + 8 * 2], rax
mov rax, 0
mov [rdx + 8 * 3], rax
mov rax, -1
mov [rdx + 8 * 4], rax
mov [rdx + 8 * 5], rax
mov [rdx + 8 * 6], rax
movq mm0, [rdx + 8 * 0]
movq mm1, [rdx + 8 * 1]
movq mm2, [rdx + 8 * 2]
movq mm3, [rdx + 8 * 3]
lea rdi, [rdx + 8 * 4]
maskmovq mm0, mm1
lea rdi, [rdx + 8 * 5]
maskmovq mm0, mm2
lea rdi, [rdx + 8 * 6]
maskmovq mm0, mm3
mov rax, qword [rdx + 8 * 4]
mov rbx, qword [rdx + 8 * 5]
mov rcx, qword [rdx + 8 * 6]
hlt
|
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_21829_1585.asm | ljhsiun2/medusa | 9 | 28393 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x4e34, %rsi
lea addresses_normal_ht+0xdb34, %rdi
nop
nop
inc %r15
mov $37, %rcx
rep movsq
nop
nop
nop
cmp %r10, %r10
lea addresses_A_ht+0x30b4, %rdi
nop
cmp %r11, %r11
vmovups (%rdi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r10
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0x1baec, %r15
nop
nop
nop
nop
nop
cmp %rax, %rax
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
movups %xmm0, (%r15)
nop
nop
nop
nop
nop
xor $45135, %r11
lea addresses_D_ht+0xe074, %rdi
nop
nop
nop
nop
sub $38087, %rcx
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
dec %rdi
lea addresses_A_ht+0x13fb4, %r11
clflush (%r11)
dec %rsi
mov $0x6162636465666768, %r10
movq %r10, %xmm5
vmovups %ymm5, (%r11)
nop
cmp $37381, %r15
lea addresses_WC_ht+0x8bb4, %rcx
nop
xor %r11, %r11
movl $0x61626364, (%rcx)
dec %rcx
lea addresses_WT_ht+0x9424, %rdi
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %r10
movq %r10, %xmm7
movups %xmm7, (%rdi)
nop
nop
nop
nop
nop
add $7923, %r11
lea addresses_A_ht+0x3fb4, %rsi
nop
add $52286, %r10
movw $0x6162, (%rsi)
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x7fb4, %r15
nop
nop
xor $20352, %rax
mov (%r15), %r10d
nop
nop
sub %rax, %rax
lea addresses_WC_ht+0x13b94, %r10
nop
nop
dec %r15
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
movups %xmm2, (%r10)
nop
nop
nop
nop
xor $30173, %rcx
lea addresses_D_ht+0x2b30, %rcx
clflush (%rcx)
nop
nop
nop
nop
cmp %rsi, %rsi
movb $0x61, (%rcx)
nop
nop
cmp %r10, %r10
lea addresses_normal_ht+0x984, %rsi
lea addresses_normal_ht+0x1fb4, %rdi
nop
nop
and %r13, %r13
mov $89, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_normal_ht+0xed14, %rcx
nop
nop
and $57615, %r15
vmovups (%rcx), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
nop
nop
cmp $9999, %rsi
lea addresses_UC_ht+0xeb74, %r15
nop
nop
add %rax, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
movups %xmm0, (%r15)
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x1db4, %rsi
nop
nop
nop
nop
nop
sub $49298, %r11
mov (%rsi), %ecx
nop
nop
and %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r8
push %rax
push %rbp
push %rdi
// Store
lea addresses_WT+0x1fd74, %rax
nop
nop
nop
nop
sub %rdi, %rdi
mov $0x5152535455565758, %r15
movq %r15, %xmm5
vmovups %ymm5, (%rax)
nop
nop
nop
nop
nop
and $12667, %r11
// Store
lea addresses_UC+0x16da1, %r8
add %r14, %r14
movb $0x51, (%r8)
nop
nop
nop
nop
nop
cmp %r11, %r11
// Store
lea addresses_normal+0x12fb4, %r8
nop
nop
nop
nop
nop
sub %rbp, %rbp
movw $0x5152, (%r8)
nop
nop
nop
sub %r8, %r8
// Store
lea addresses_D+0xf3b4, %rax
nop
nop
nop
nop
nop
cmp %r8, %r8
movb $0x51, (%rax)
nop
nop
dec %r15
// Store
mov $0xdf4, %r8
nop
nop
nop
nop
nop
sub $62573, %r11
mov $0x5152535455565758, %rax
movq %rax, %xmm1
movups %xmm1, (%r8)
nop
cmp %r11, %r11
// Store
lea addresses_WC+0x1fbb4, %r11
nop
nop
nop
and %r15, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm4
vmovups %ymm4, (%r11)
nop
nop
nop
inc %rax
// Faulty Load
lea addresses_A+0x107b4, %r8
nop
nop
nop
nop
nop
cmp %r15, %r15
mov (%r8), %rax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdi
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
PascalAnalizaitorLexico/PascalLang.g4 | GusRigor/Compilador-Mini-Pascal | 0 | 5850 | <gh_stars>0
grammar PascalLang;
//Programa e Bloco
programa : PROGRAM identificador PV bloco
;
bloco : part_decl_var? part_decl_sub_rotinas? comando_composto
;
//Declarações
part_decl_var : decl_vars (PV decl_vars)* PV
;
decl_vars : tipo lista_identificadores
;
lista_identificadores : identificador (VG identificador)*
;
part_decl_sub_rotinas : ( decl_procedimento PV)*
;
decl_procedimento : PROCEDURE identificador parametr_formais? PV bloco
;
parametr_formais : AP selec_parametr_formais (PV selec_parametr_formais)* FP
;
selec_parametr_formais : VAR? lista_identificadores DP identificador
;
//Comandos
comando_composto : BEGIN comando (PV comando)* END
;
comando : atribuicao | chamada_procedimento | comando_composto | comando_condicional | comando_repetitivo
;
atribuicao : variavel ATB expressao
;
chamada_procedimento : identificador (AP list_expressoes FP)?
;
comando_condicional : IF expressao THEN comando (ELSE comando)?
;
comando_repetitivo : WHILE expressao DO comando
;
//Expressões
expressao : expressao_simples (Relacao expressao_simples)?
;
expressao_simples : (PLUS | MINUS)? termo ((PLUS | MINUS | OR) termo)*
;
termo : fator ((TIMES | DIV | AND) fator)*
;
fator : variavel | numero | AP expressao FP | NOT fator
;
variavel : identificador | identificador (expressao)?
;
list_expressoes : expressao (VG expressao)*
;
//Números e idetificadores
numero :Digito (Digito)*
;
identificador : Letra (Letra | Digito)*
;
//TIPOS
tipo : Integer | Real | Boolean | Char | String
;
//TOKENS
Digito : [0-9]
;
Letra : '_' | [a-z] | [A-Z]
;
Relacao : '=' | '<>' | '<' | '<=' | '>=' | '>'
;
PROGRAM : 'program'
;
PROCEDURE : 'procedure'
;
VAR : 'var'
;
BEGIN : 'begin'
;
END : 'end.'
;
THEN: 'then'
;
ELSE: 'else'
;
WHILE : 'while'
;
DO : 'do'
;
OR : 'or'
;
DIV : 'div'
;
AND : 'and'
;
NOT : 'not'
;
Integer : 'integer'
;
Real : 'real'
;
Boolean : 'boolean'
;
Char : 'char'
;
String : 'string'
;
TRUE : 'TRUE'
;
FALSE : 'FALSE'
;
PLUS : '+'
;
MINUS : '-'
;
TIMES : '*'
;
AP : '('
;
FP : ')'
;
PV : ';'
;
VG : ','
;
DP : ':'
;
ATB : ':='
;
IF : 'if'
;
WS : (' ' | '\n' | '\t' | '\r') -> skip; |
_maps/Springs.asm | kodishmediacenter/msu-md-sonic | 9 | 240224 | <gh_stars>1-10
; ---------------------------------------------------------------------------
; Sprite mappings - springs
; ---------------------------------------------------------------------------
Map_Spring_internal:
dc.w M_Spg_Up-Map_Spring_internal
dc.w M_Spg_UpFlat-Map_Spring_internal
dc.w M_Spg_UpExt-Map_Spring_internal
dc.w M_Spg_Left-Map_Spring_internal
dc.w M_Spg_LeftFlat-Map_Spring_internal
dc.w M_Spg_LeftExt-Map_Spring_internal
M_Spg_Up: dc.b 2 ; facing up
dc.b $F8, $C, 0, 0, $F0
dc.b 0, $C, 0, 4, $F0
M_Spg_UpFlat: dc.b 1 ; facing up, flattened
dc.b 0, $C, 0, 0, $F0
M_Spg_UpExt: dc.b 3 ; facing up, extended
dc.b $E8, $C, 0, 0, $F0
dc.b $F0, 5, 0, 8, $F8
dc.b 0, $C, 0, $C, $F0
M_Spg_Left: dc.b 1 ; facing left
dc.b $F0, 7, 0, 0, $F8
M_Spg_LeftFlat: dc.b 1 ; facing left, flattened
dc.b $F0, 3, 0, 4, $F8
M_Spg_LeftExt: dc.b 4 ; facing left, extended
dc.b $F0, 3, 0, 4, $10
dc.b $F8, 9, 0, 8, $F8
dc.b $F0, 0, 0, 0, $F8
dc.b 8, 0, 0, 3, $F8
even |
programs/oeis/240/A240134.asm | karttu/loda | 0 | 12400 | ; A240134: Numerator of (n-1) * ceiling(n/2) / n.
; 0,1,4,3,12,5,24,7,40,9,60,11,84,13,112,15,144,17,180,19,220,21,264,23,312,25,364,27,420,29,480,31,544,33,612,35,684,37,760,39,840,41,924,43,1012,45,1104,47,1200,49,1300,51,1404,53,1512,55,1624,57,1740,59,1860,61,1984,63,2112,65
mov $1,$0
mov $2,$0
lpb $2,1
sub $2,1
lpb $1,1
add $1,$2
sub $1,1
lpe
add $1,$0
trn $2,1
lpe
|
Univalence/Obsolete/FiniteTypeEquiv.agda | JacquesCarette/pi-dual | 14 | 6712 | <gh_stars>10-100
{-# OPTIONS --without-K #-}
module FiniteTypeEquiv where
open import Level
open import Data.Nat using (ℕ)
open import Data.Fin using (Fin)
open import Data.Product
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Function.Equality using (_∘_; _⟶_; _⟨$⟩_)
open ≡-Reasoning
open import Function renaming (_∘_ to _○_)
open import FinVec
------------------------------------------------------------------------------
-- Permutations
record CPerm {ℓ : Level} (values : ℕ) (size : ℕ) : Set ℓ where
constructor cp
field
π : FinVec values size
πᵒ : FinVec size values
αp : π ∘̂ πᵒ ≡ 1C
βp : πᵒ ∘̂ π ≡ 1C
-- Permutations are compared by ≡
-- The setoid of permutations under ≡
SCPerm : ∀ {ℓ} → ℕ → ℕ → Setoid ℓ ℓ
SCPerm m n = setoid (CPerm m n)
------------------------------------------------------------------------------
-- Equivalences
_∼_ : ∀ {ℓ ℓ'} → {A : Set ℓ} {P : A → Set ℓ'} →
(f g : (x : A) → P x) → Set (ℓ ⊔ ℓ')
_∼_ {ℓ} {ℓ'} {A} {P} f g = (x : A) → f x ≡ g x
record qinv {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} (f : A → B) :
Set (ℓ ⊔ ℓ') where
constructor mkqinv
field
g : B → A
α : (f ○ g) ∼ id
β : (g ○ f) ∼ id
_≃_ : ∀ {ℓ ℓ'} (A : Set ℓ) (B : Set ℓ') → Set (ℓ ⊔ ℓ')
A ≃ B = Σ (A → B) qinv
sym≃ : ∀ {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} → (A ≃ B) → (B ≃ A)
sym≃ (A→B , equiv) = e.g , mkqinv A→B e.β e.α
where module e = qinv equiv
-- Equivalences are compared by ≋ which reduces to extensional
-- equality of the underlying back and forth functions
_⋆_ : ∀ {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} → (A ≃ B) → (x : A) → B
(f , _) ⋆ x = f x
record _≋_ {ℓ ℓ' : Level} {A : Set ℓ} {B : Set ℓ'} (eq₁ eq₂ : A ≃ B) :
Set (ℓ ⊔ ℓ') where
constructor eq
field
f≡ : ∀ x → eq₁ ⋆ x ≡ eq₂ ⋆ x
g≡ : ∀ x → (sym≃ eq₁) ⋆ x ≡ (sym≃ eq₂) ⋆ x
id≋ : ∀ {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} {x : A ≃ B} → x ≋ x
id≋ = record { f≡ = λ x → refl ; g≡ = λ x → refl }
sym≋ : ∀ {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} {x y : A ≃ B} → x ≋ y → y ≋ x
sym≋ (eq f≡ g≡) = eq (λ a → sym (f≡ a)) (λ b → sym (g≡ b))
trans≋ : ∀ {ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} {x y z : A ≃ B} → x ≋ y → y ≋ z → x ≋ z
trans≋ (eq f≡ g≡) (eq h≡ i≡) =
eq (λ a → trans (f≡ a) (h≡ a)) (λ b → trans (g≡ b) (i≡ b))
-- The setoid of equivalences under ≋
_S≃_ : ∀ {ℓ ℓ'} (A : Set ℓ) (B : Set ℓ') → Setoid (ℓ ⊔ ℓ') (ℓ ⊔ ℓ')
_S≃_ A B = record
{ Carrier = A ≃ B
; _≈_ = _≋_
; isEquivalence = record
{ refl = id≋
; sym = sym≋
; trans = trans≋
}
}
------------------------------------------------------------------------------
-- Univalence...
-- On one side we have permutations under ≡
-- On the other we have equivalences under ≋
--
-- The equivalence of these two sides uses a version of ≃ (called ≃S)
-- that relates setoids each with its own equivalence relation
infix 4 _≃S_
record _≃S_ {ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Level} (A : Setoid ℓ₁ ℓ₂) (B : Setoid ℓ₃ ℓ₄) :
Set (ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄) where
constructor equiv
field
f : A ⟶ B
g : B ⟶ A
α : ∀ {x y} → Setoid._≈_ B x y → Setoid._≈_ B ((f ∘ g) ⟨$⟩ x) y
β : ∀ {x y} → Setoid._≈_ A x y → Setoid._≈_ A ((g ∘ f) ⟨$⟩ x) y
univalence : {m n : ℕ} →
_≃S_ {zero} {zero} {zero} {zero} (SCPerm m n) (Fin m S≃ Fin n)
univalence {m} {n} = equiv {!!} {!!} {!!} {!!}
------------------------------------------------------------------------------
|
osascripts/darwin/active_app.applescript | liangjingyang/voice_kit | 0 | 3912 |
on run avgs
if (count of avgs) >= 1 then
set appName to item 1 of avgs
tell application appName to activate
end if
end run |
programs/oeis/029/A029836.asm | neoneye/loda | 22 | 3417 | ; A029836: log( n-th prime) rounded to nearest integer.
; 1,1,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
pow $0,2
mul $0,2
div $0,7
mov $1,1
lpb $0
sub $0,1
div $0,5
add $2,$1
lpe
add $1,$2
mov $0,$1
|
ejercicios5/prueba_quitar_repetidos_primero.adb | iyan22/AprendeAda | 0 | 26384 | with Ada.Text_IO, Lab10_03;
use Ada.Text_IO, Lab10_03;
procedure Prueba_quitar_repetidos_primero is
L1: T_Lista_Estatica;
begin
Put_Line(" QUITAR REPETIDOS PRIMERO - PRUEBAS");
Put_Line("--------------------------------------");
Put_Line("Caso 01: ()");
Put_Line("--> ()");
L1.Cont := 0;
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_lista(L1);
New_Line;
Put_Line("Caso 02: (8)");
Put_Line("--> (8)");
L1.Cont := 1;
L1.Elem(1) := 8;
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_lista(L1);
New_Line;
Put_Line("Caso 03: (3 3 3 3 3 3 3 3 3 3)");
Put_Line("--> (3)");
L1 := ((OTHERS=>3),10);
L1.Cont := 10;
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_Lista(L1);
New_Line;
Put_Line("Caso 04: (8 8 2 8 6 0 5 6 8)");
Put_Line("--> (8 2 6 0 5 6)");
L1.Cont := 9;
L1.Elem(1..9) := (8,8,2,8,6,0,5,6,8);
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_lista(L1);
New_Line;
Put_Line("Caso 05: (1 2 3 4 5 6 7 8 9)");
Put_Line("--> (1 2 3 4 5 6 7 8 9)");
L1.Cont := 9;
L1.Elem(1..9) := (1,2,3,4,5,6,7,8,9);
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_lista(L1);
New_Line;
Put_Line("Caso 06: (1 1 1 2 2 2 1 1 1)");
Put_Line("--> (1 2 2 2)");
L1.Cont := 9;
L1.Elem(1..9) := (1,1,1,2,2,2,1,1,1);
Quitar_repetidos_primero(L1);
Put("==>");
Escribir_lista(L1);
New_Line;
end Prueba_quitar_repetidos_primero;
|
src/main/fragment/mos6502-common/vwum1=vwuc1_plus__word1_vdum2.asm | jbrandwood/kickc | 2 | 165236 | lda #<{c1}
clc
adc {m2}+2
sta {m1}
lda #>{c1}
adc {m2}+3
sta {m1}+1
|
versions/05-welcome_effect/bootloader.asm | EliasJuk/GhostSystem | 0 | 170924 | <gh_stars>0
[BITS 16]
[ORG 7C00h]
call LoadSystem
jmp 0800h:0000h
LoadSystem:
mov ah, 02h
mov al, 1
mov ch, 0
mov cl, 2
mov dh, 0
mov dl, 80h
mov bx, 0800h
mov es, bx
mov bx, 0000h
int 13h
ret
times 510 - ($-$$) db 0
dw 0xAA55
|
Opus/asm/disp1n.asm | Computer-history-Museum/MS-Word-for-Windows-v1.1 | 2 | 95007 | include w2.inc
include noxport.inc
include consts.inc
include structs.inc
include windows.inc
createSeg disp1_PCODE,disp1,byte,public,CODE
; DEBUGGING DECLARATIONS
ifdef DEBUG
midDisp1n equ 10 ; module ID, for native asserts
NatPause equ 1
endif
ifdef NatPause
PAUSE MACRO
int 3
ENDM
else
PAUSE MACRO
ENDM
endif
; EXTERNAL FUNCTIONS
externFP <N_PwwdWw>
externFP <EndUL>
externFP <DrawTlc>
externFP <NMultDiv>
externFP <N_LoadFcidFull>
ifdef HYBRID
externFP <MoveToPR>
externFP <LineToPR>
else ;!HYBRID
externFP <MoveTo>
externFP <LineTo>
endif ;HYBRID
externFP <ShowSpec>
externFP <DrawDottedLineBox>
externFP <DisplayField>
externFP <SetBkMode>
ifdef DEBUG
externFP <IntersectClipRectFP>
externFP <SaveDCFP>
externFP <PatBltFP>
externFP <RestoreDCFP>
externFP <SelectObjectFP>
externFP <ExtTextOutFP>
else ;!DEBUG
externFP <IntersectClipRect>
ifdef HYBRID
externFP <SaveDCPR>
externFP <PatBltPR>
externFP <RestoreDCPR>
externFP <SelectObjectPR>
externFP <ExtTextOutPR>
else ;!HYBRID
externFP <SaveDC>
externFP <PatBlt>
externFP <RestoreDC>
externFP <SelectObject>
externFP <ExtTextOut>
endif ;HYBRID
endif ;!DEBUG
externFP <ExtTextOutKludge>
externFP <PstFromSttb>
externFP <DrawPatternLine>
externFP <PatBltRc>
externFP <ForeColor>
externFP <N_PtOrigin>
externFP <ClipRectFromDr>
externFP <DrawBorders>
externFP <DrcpToRcw>
externFP <CacheSectProc>
externFP <FInCa>
externFP <CachePage>
externFP <FrameDrLine>
externFP <DxpOutlineSplats>
externFP <DrawStyNameFromWwDl>
externFP <N_PdodMother>
externFP <PutPlc>
externFP <GetPlc>
externFP <DrclToRcw>
externFP <PutCpPlc>
externFP <N_AddVisiSpaces>
externFP <MarkSel>
externFP <DrawChPubs>
externFP <N_PdrFetch>
externFP <N_FreePdrf>
externFP <N_FormatLineDxa>
externFP <DrawPrvwLine>
externFP <CpFirstTap1>
externFP <N_WidthHeightFromBrc>
externFP <YwFromYl>
externFP <AdjustOpaqueRect>
externFP <DrawFormulaLine>
externFP <FFacingPages>
externFP <DocMother>
externFP <PrintUlLine>
ifdef DEBUG
externFP <AssertProcForNative>
externFP <S_LoadFcidFull>
externFP <ScribbleProc>
externFP <S_DisplayFliCore>
externFP <S_AddVisiSpaces>
externFP <S_PdrFetch>
externFP <S_FreePdrf>
externFP <S_PtOrigin>
externFP <S_FormatLineDxa>
externFP <S_WidthHeightFromBrc>
externFP <LockHeap, UnlockHeap>
endif ;DEBUG
; EXPORTED LABELS
ifdef DEBUG
PUBLIC LN_EndULPast
PUBLIC DFC265
endif ;DEBUG
sBegin data
;
; /* E X T E R N A L S */
;
externW vhgrpchr ; extern struct CHR **vhgrpchr;
externW selCur ; extern struct SEL selCur;
externW vsci ; extern struct SCI vsci;
externW vfli ; extern struct FLI vfli;
externW vfti ; extern struct FTI vfti;
externW vpri ; extern struct PRI vpri;
externW vfmtss ; extern struct FMTSS vfmtss;
externW vpdcibDisplayFli; extern struct DCIB vpdcibDisplayFli;
externW selDotted ; extern struct SEL selDotted;
externW vhwwdOrigin ; extern struct WWD **vhwwdOrigin;
externW vpref ; extern struct PREF vpref;
externW vhwndApp ; extern HWND vhwndApp;
externW wwCur ; extern int wwCur;
externW caPage ; extern struct CA caPage;
externW caSect ; extern struct CA caSect;
externW vdrdlDisplayFli ; extern struct DRDL vdrdlDisplayFli;
externW mpdochdod ; extern struct DOD **mpdochdod[];
externW vfFliMunged ; extern BOOL vfFliMunged;
externW vlm ; extern int vlm;
externW vfPrvwDisp ; extern int vfPrvwDisp;
externW caTap ; extern struct CA caTap;
externW vtapFetch ; extern struct TAP vtapFetch;
externW vrf ; extern struct RF vrf;
externW vwWinVersion ; extern int vwWinVersion;
externW vhsttbFont ; extern struct STTB ** vhsttbFont;
; #ifdef DEBUG
ifdef DEBUG
externW cHpFreeze ; extern int cHpFreeze;
externW vdbs ; extern struct DBS vdbs;
; #endif /* DEBUG */
endif
sEnd data
; CODE SEGMENT _DISP1
sBegin disp1
assumes cs,disp1
assumes ds,dgroup
assumes ss,dgroup
;-------------------------------------------------------------------------
; DisplayFli( ww, hpldr/* or hscc or hwwd */, idr, dl, ypLine )
;-------------------------------------------------------------------------
;/* D I S P L A Y F L I */
;/* Display formatted line in window pwwd at line dl. ypLine is bottom of
;the line */
;
;NATIVE DisplayFli(ww, hpldr/* or hscc or hwwd */, idr, dl, ypLine)
;struct PLDR **hpldr;
;int ww, idr, dl, ypLine;
;{
; struct PLCEDL **hplcedl;
; int dypToYw;
; int dxpToXw, xw;
; struct DR *pdr;
; struct PT ptOrigin;
; struct WWD *pwwd, **hwwd;
; BOOL fInTable;
; BOOL fFat;
; int fSoftPageBreak = fFalse;
; HDC hdc;
; BOOL fRMark;
; GRPFVISI grpfvisi;
; struct EDL edl;
; struct RC rcw, rcwErase, rcwClip;
; struct DRC drcp;
; int irmBar;
; struct DRF drfFetch;
; BOOL fFrameLines;
maskfNotSplatBreakLocal equ 001h
maskfNotPageViewLocal equ 002h
maskfFatLocal equ 004h
maskfFrameLinesLocal equ 008h
maskfInTableLocal equ 020h
maskfSoftPageBreakLocal equ 040h
Ltemp011:
jmp DF485
; %%Function:N_DisplayFli %%Owner:BRADV
cProc N_DisplayFli,<PUBLIC,FAR>,<si,di>
ParmW ww
ParmW hpldr
ParmW idr
ParmW dlArg
ParmW ypLine
LocalW hplcedl
LocalW hdc
LocalW dxpToXw
LocalW dypToYw
LocalW hwwd
LocalW pdr
LocalW fInTable
LocalW xwSelBar
LocalW grpfvisiVar
LocalV drcp,cbDrcMin
LocalV edl,cbEdlMin
LocalV rcw,cbRcMin
LocalV rcwT,cbRcMin
LocalV rcwErase,cbRcMin
LocalV rcwClip,cbRcMin
LocalV uls,cbUlsMin
LocalV rcT,cbRcMin
LocalV drfFetch,cbDrfMin
cBegin
; vrf.fInDisplayFli = !vrf.fInDisplayFli;
; Assert (vrf.fInDisplayFli);
; if (!vrf.fInDisplayFli)
; return;
xor [vrf.fInDisplayFliRf],maskFInDisplayFliRf
errnz <maskFInDisplayFliRf - 080h>
ifdef DEBUG
js DF005
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1040 ; label # for native assert
cCall AssertProcForNative, <ax, bx>
pop dx
pop cx
pop bx
pop ax
jmp Ltemp011
DF005:
else ;!DEBUG
jns Ltemp011
endif ;!DEBUG
; Assert(hpldr != NULL );
ifdef DEBUG
cmp [hpldr],NULL
jne DF01
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1050
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DF01:
endif ;/* DEBUG */
; FreezeHp();
ifdef DEBUG
call LN_FreezeHp
endif ;DEBUG
; pdr = PdrFetch(hpldr, idr, &drfFetch);
lea ax,[drfFetch]
ifdef DEBUG
cCall S_PdrFetch,<[hpldr],[idr],ax>
else ;not DEBUG
cCall N_PdrFetch,<[hpldr],[idr],ax>
endif ;DEBUG
mov [pdr],ax
xchg ax,si
; hplcedl = pdr->hplcedl;
mov bx,[si.hplcedlDr]
mov [hplcedl],bx
; Assert((!vfli.fPrint || ww == wwNil) && (*hplcedl)->dlMax > dl);
ifdef DEBUG
push ax
push bx
push cx
push dx
cmp [vfli.fPrintFli],fFalse
je DF02
cmp [ww],0
jne DF025
DF02:
mov bx,[bx]
mov ax,[dlArg]
cmp [bx.dlMaxPlcedl],ax
jg DF03
DF025:
mov ax,midDisp1n
mov bx,1051
cCall AssertProcForNative,<ax,bx>
DF03:
pop dx
pop cx
pop bx
pop ax
endif ;/* DEBUG */
;/* Fill up EDL */
; PutCpPlc(hplcedl, dl, vfli.cpMin);
cCall PutCpPlc,<bx, [dlArg], [vfli.HI_cpMinFli], [vfli.LO_cpMinFli]>
; Assembler note: this code has been moved up from below to reduce code.
; ***Begin moved code
push ds
pop es
lea di,[edl]
; /* set flags below; wipes out dcpDepend and other flags that
; are set later */
; Assert (!dlkNil);
errnz <dlkNil>
; edl.grpfEdl = 0;
;#ifdef INEFFICIENT
; /* Native Note: zero this whole byte, give or take fHasBitmap */
; edl.fDirty = edl.fTableDirty = fFalse;
; edl.dlk = dlkNil;
; edl.fNeedsEnhance = fFalse;
;#endif /* INEFFICIENT */
; fRMark = vfli.fRMark;
; if ((fInTable = pdr->fInTable) != 0)
; edl.fRMark = fRMark;
; edl.dcpDepend = vfli.dcpDepend;
; /* to keep color metafiles out of scc cache */
; edl.fColorMFP = vfli.fMetafile && !vsci.fMonochrome;
; PAUSE
errnz <(grpfEdl) - 0>
mov al,bptr ([vfli.dcpDependFli])
errnz <(dcpDependEdl) - 0>
stosb
mov al,[vfli.fMetafileFli]
cmp [vsci.fMonochromeSci],fFalse
je DF035
mov al,0
DF035:
and al,maskFMetafileFli
errnz <(maskFMetafileFli) - 004h>
errnz <(maskFColorMFPEdl) - 040h>
errnz <(maskFRMarkEdl) - 010h>
errnz <(fColorMFPEdl) - (fRMarkEdl)>
test [si.fInTableDr],maskFInTableDr
je DF0351
test [vfli.fRMarkFli],maskFRMarkFli
je DF0351
errnz <(maskFRMarkEdl) - 010h>
inc ax ;Really cute Tom!
DF0351:
mov cl,4
shl al,cl
errnz <(fColorMFPEdl) - 1>
errnz <(fRMarkEdl) - 1>
stosb
; edl.hpldr = hNil;
errnz <hNil>
xor ax,ax
errnz <(hpldrEdl) - 2>
stosw
; ***End moved code
;/* Include margin area, to support xwLimScroll optimization */
;/* Include margin area, to support xwLimScroll optimization */
; edl.dxp = ((vfli.fRight || vfli.fTop || vfli.fBottom)
; ?
; max( vfli.xpMarginRight + dxpLeftRightSpace +
; DxFromBrc(vfli.brcRight,fFalse/*fFrameLines*/),
; vfli.xpRight)
; :
; vfli.xpRight) - (edl.xpLeft = vfli.xpLeft);
; edl.dcp = vfli.cpMac - vfli.cpMin;
; edl.ypTop = ypLine - (edl.dyp = vfli.dypLine);
;#define DxFromBrc(brc, fFrameLines) DxyFromBrc(brc, fFrameLines, fTrue)
;#define DxyFromBrc(brc, fFrameLines, fWidth) \
; WidthHeightFromBrc(brc, fFrameLines | (fWidth << 1))
errnz <(xpLeftEdl) - 00004h>
errnz <(ypTopEdl) - 00006h>
errnz <(dxpEdl) - 00008h>
errnz <(dypEdl) - 0000Ah>
errnz <(LO_dcpEdl) - 0000Ch>
errnz <(HI_dcpEdl) - 0000Eh>
mov ax,[vfli.xpLeftFli]
stosw
xchg ax,bx
mov ax,[ypLine]
sub ax,[vfli.dypLineFli]
stosw
errnz <(fRightFli)-(fTopFli)>
errnz <(fRightFli)-(fBottomFli)>
mov ax,[vfli.xpRightFli]
test [vfli.fRightFli],maskFBottomFli OR maskFTopFli OR maskFRightFli
jz DF0355
push bx ;save vfli.xpLeft
push ax ;save vfli.xpRight
push [vfli.brcRightFli]
mov ax,2
push ax
ifdef DEBUG
cCall S_WidthHeightFromBrc,<>
else ;not DEBUG
cCall N_WidthHeightFromBrc,<>
endif ;DEBUG
add ax,[vfli.xpMarginRightFli]
add ax,[vfti.dxpBorderFti]
add ax,[vfti.dxpBorderFti]
pop bx ; restore vfli.xpRight
cmp ax,bx
jge DF0355A
xchg ax,bx
DF0355A:
pop bx ;restore vfli.xpLeft
DF0355:
sub ax,bx
stosw
mov ax,[vfli.dypLineFli]
stosw
mov ax,[vfli.LO_cpMacFli]
sub ax,[vfli.LO_cpMinFli]
stosw
mov ax,[vfli.HI_cpMacFli]
sbb ax,[vfli.HI_cpMinFli]
stosw
; if (ww == wwNil)
; {
mov bx,[ww]
errnz <wwNil>
or bx,bx
jne DF06
DF04:
; edl.fDirty = fTrue;
or [edl.fDirtyEdl],maskfDirtyEdl
; PutPlc(hplcedl, dl, &edl);
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
call DF49
DF05:
; MeltHp();
ifdef DEBUG
call LN_MeltHp
endif ;DEBUG
; goto LRet0;
jmp LRet0
; }
DF06:
;Assembler note: intialize ww based variables here, so that we
;only call PwwdWw once.
cCall N_PwwdWw,<bx>
xchg ax,bx
mov ax,[bx.xwSelBarWwd]
mov [xwSelBar],ax
mov ax,[bx.grpfvisiWwd]
mov [grpfvisiVar],ax
; PutPlc(hplcedl, dl, &edl);
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
call DF49
; if (vfli.fPicture)
; {
cmp [vfli.fPictureFli],fFalse
je DF07
; vdrdlDisplayFli.hpldr = hpldr;
; vdrdlDisplayFli.idr = idr;
; vdrdlDisplayFli.dl = dl;
errnz <(idrDrdl) - 00000h>
errnz <(hpldrDrdl) - 00002h>
errnz <(dlDrdl) - 00004h>
push ds
pop es
mov di,dataoffset vdrdlDisplayFli
mov ax,[idr]
stosw
mov ax,[hpldr]
stosw
mov ax,[dlArg]
stosw
; }
DF07:
; Debug(grpfvisi = PwwdWw(ww)->grpfvisi);
; Assert((int) vfli.grpfvisi == (int) grpfvisi);
ifdef DEBUG
;Do this DEBUG stuff with a call so as not to mess up short jumps.
call DF50
endif ;/* DEBUG */
; /* fake x coordinates in edl for erase and clip rectangle */
; /* then transform into w's. Intersect with rcwDisp */
; ptOrigin = PtOrigin(hpldr, idr);
ifdef DEBUG
cCall S_PtOrigin,<[hpldr], [idr]>
else ;not DEBUG
cCall N_PtOrigin,<[hpldr], [idr]>
endif ;DEBUG
; hwwd = vhwwdOrigin;
; pwwd = *hwwd;
mov bx,[vhwwdOrigin]
mov [hwwd],bx
mov bx,[bx]
; dxpToXw = ptOrigin.xl + pwwd->rcePage.xeLeft + pwwd->xwMin;
add ax,[bx.rcePageWwd.xeLeftRc]
add ax,[bx.xwMinWwd]
mov [dxpToXw],ax
; rcwErase.xwLeft = (drcp.xp = -pdr->dxpOutLeft) + dxpToXw;
mov cx,[si.dxpOutLeftDr]
neg cx
mov [drcp.xpDrc],cx
add ax,cx
errnz <(xwLeftRc) - 00000h>
mov [rcwErase.xwLeftRc],ax
; if (pwwd->fPageView)
; rcwErase.xwRight = rcwErase.xwLeft +
; (drcp.dxp = pdr->dxl + pdr->dxpOutRight + pdr->dxpOutLeft);
; else
; {
; rcwErase.xpRight = pwwd->xwMac;
; drcp.dxp = rcwErase.xwRight - rcwErase.xwLeft;
; }
errnz <(xwRightRc) - (xpRightRc)>
mov di,[bx.xwMacWwd]
test [bx.fPageViewWwd],maskfPageViewWwd
je DF08
mov di,[si.dxlDr]
add di,[si.dxpOutRightDr]
sub di,cx
add di,ax
DF08:
mov [rcwErase.xpRightRc],di
sub di,ax
mov [drcp.dxpDrc],di
; dypToYw = ptOrigin.yl + pwwd->rcePage.yeTop + pwwd->ywMin;
add dx,[bx.rcePageWwd.yeTopRc]
add dx,[bx.ywMinWwd]
mov [dypToYw],dx
; rcwErase.ywTop = (drcp.yp = edl.drcp.yp) + dypToYw;
mov ax,[edl.drcpEdl.ypDrc]
mov [drcp.ypDrc],ax
add ax,dx
mov [rcwErase.ywTopRc],ax
; rcwErase.ywBottom = rcwErase.ywTop + (drcp.dyp = edl.drcp.dyp);
mov dx,[edl.drcpEdl.dypDrc]
mov [drcp.dypDrc],dx
add ax,dx
mov [rcwErase.ywBottomRc],ax
;/* if displaying to screen cache bitmap:
; use scratchpad memory DC
; do not validate dl if bitmap cannot fit the line
;*/
; hdc = pwwd->hdc;
mov ax,[bx.hdcWwd]
mov [hdc],ax
lea ax,[drcp]
lea dx,[rcw]
; ClipRectFromDr(hwwd, hpldr, idr, &drcp, &rcw);
cCall ClipRectFromDr,<[hwwd], [hpldr], [idr], ax, dx>
; rcwClip = rcw;
push ds
pop es
push si ;save pdr
lea si,[rcw]
lea di,[rcwClip]
errnz <cbRcMin - 8>
movsw
movsw
movsw
movsw
pop si ;restore pdr
; Assert( hdc != NULL );
ifdef DEBUG
;Assert( hdc != NULL ) with a call so as not to mess up short jumps.
call DF56
endif ;/* DEBUG */
; /* Check for quick return if the line is not visible at all. */
; if (rcw.ywTop >= rcw.ywBottom || rcw.xwLeft >= rcw.xwRight)
; {
; MeltHp();
; goto LRet;
; }
mov ax,[rcw.ywTopRc]
cmp ax,[rcw.ywBottomRc]
jge Ltemp020
mov ax,[rcw.xwLeftRc]
cmp ax,[rcw.xwRightRc]
jge Ltemp020
; Assembler note: fFat is now computed below LBeginLine
; /* This tells if there is a dr overflow. */
; Assert(!fInTable || FInCa(pdr->doc, pdr->cpFirst, &caTap));
; fFat = pdr->doc > 0
; && (fInTable ? pdr->fCantGrow : vfli.fPageView)
; && ((ypLine == pdr->dyl && pdr->idrFlow == idrNil
; && (fInTable ? !vfli.fSplatBreak || vfli.chBreak != chTable
; : vfli.cpMac < pdr->cpLim))
; || ypLine > pdr->dyl);
; Scribble(ispDisplayFli,'D');
ifdef DEBUG
call DF54
endif ;DEBUG
;LBeginLine:
; Assembler note: this has been moved from the start of DisplayFli
; fInTable = pdr->fInTable;
; fSoftPageBreak = fFalse;
mov al,[si.fInTableDr]
mov ah,[vfli.fSplatBreakFli]
errnz <maskfInTableLocal - maskFInTableDr>
and ax,maskFInTableDr + (maskFSplatBreakFli SHL 8)
mov bptr ([fInTable]),al
errnz <maskFSplatBreakFli - 1>
errnz <maskFInTableDr AND maskfNotSplatBreakLocal>
inc ax
xor al,ah
errnz <maskfNotSplatBreakLocal - maskFSplatBreakFli>
cmp [vfli.fPageViewFli],fFalse
jne DF13
errnz <maskFInTableDr AND maskfNotPageViewLocal>
errnz <maskFSplatBreakFli AND maskfNotPageViewLocal>
errnz <maskfNotPageViewLocal - 2>
inc ax
inc ax
DF13:
;now have register fInTable, fNotPageView and fNotSplatBreak
; Assembler note: Computing fFat has been moved from above.
; /* This tells if there is a dr overflow. */
; fFat = pdr->doc > 0
; && (fInTable ? pdr->fCantGrow : vfli.fPageView)
; && ((ypLine == pdr->dyl && pdr->idrFlow == idrNil
; && (fInTable ? !vfli.fSplatBreak || vfli.chBreak != chTable
; : vfli.cpMac < pdr->cpLim))
; || ypLine > pdr->dyl);
;PAUSE
cmp [si.docDr],0
jle DF15
test al,maskFInTableDr
je DF14
test [si.fCantGrowDr],maskfCantGrowDr
je DF15
jmp short DF141
DF14:
cmp [vfli.fPageViewFli],0
je DF15
DF141:
mov cx,[ypLine]
cmp cx,[si.dylDr]
jg DF145
jne DF15
cmp [si.idrFlowDr],idrNil
jne DF15
test al,maskFInTableDr
je DF143
test al,maskfNotSplatBreakLocal
jne DF145
cmp bptr ([vfli.chBreakFli]),chTable
jne DF145
jmp short DF15
Ltemp020:
ifdef DEBUG
call LN_MeltHp
endif ;DEBUG
jmp LRet
DF143:
mov cx,[vfli.LO_cpMacFli]
sub cx,[si.LO_cpLimDr]
mov cx,[vfli.HI_cpMacFli]
sbb cx,[si.HI_cpLimDr]
jge DF15
DF145:
errnz <maskFInTableDr AND maskfFatLocal>
errnz <maskFSplatBreakFli AND maskfFatLocal>
or al,maskfFatLocal
DF15:
; MeltHp();
ifdef DEBUG
call LN_MeltHp
endif ;DEBUG
; if (!vfli.fPageView)
; {
test al,maskfNotPageViewLocal
jne LTemp021
jmp DF27
Ltemp021:
; if (vfli.fSplatBreak && !fInTable)
; {
test al,maskfNotSplatBreakLocal + maskfInTableLocal
jne Ltemp022
; int ipat;
;
; xw = rcw.xwLeft;
mov si,[rcw.xwLeftRc]
; edl.dxp = rcw.xwRight - dxpToXw - edl.xpLeft;
mov bx,[rcw.xwRightRc]
sub bx,[dxpToXw]
sub bx,[edl.xpLeftEdl]
mov [edl.dxpEdl],bx
db 03Dh ;turns next "jae LSplat2" into "cmp ax,immediate"
;LSplat:
LSplat:
jae LSplat2 ;Jump only if we have jumped to here
;and vfli.ichMac > 1.
;/* Must erase the line and sel bar background, since we won't be calling
; DisplayFliCore. */
; Assert(vfli.doc != docNil);
ifdef DEBUG
;Assert(vfli.doc != docNil) with a call so as not to
;mess up short jumps.
call DF65
endif ;/* DEBUG */
; PatBltRc(hdc, &rcw, vsci.ropErase);
push [hdc]
lea ax,[rcw]
push ax
push [vsci.HI_ropEraseSci]
push [vsci.LO_ropEraseSci]
cCall PatBltRc,<>
;LSplat2:
; ipat = vfli.fSplatColumn ? ipatHorzLtGray :
; ipatHorzGray;
LSplat2:
errnz <ipatHorzGray - 0>
errnz <ipatHorzLtGray - 1>
xor di,di
test [vfli.fSplatColumnFli],maskFSplatColumnFli
je DF16
inc di
DF16:
; CacheSect(vfli.doc, vfli.cpMin);
;#define CacheSect(doc,cp) (FInCa((doc),(cp),(&caSect))?0:CacheSectProc((doc),(cp)))
stc
DF163:
push [vfli.docFli]
push [vfli.HI_cpMinFli]
push [vfli.LO_cpMinFli]
jnc DF167
mov ax,dataoffset [caSect]
push ax
cCall FInCa,<>
or ax,ax
jne DF17
jmp short DF163
Ltemp022:
jmp short DF22
DF167:
cCall CacheSectProc,<>
DF17:
; /* Draw the break/section splat. */
; ywMid = rcwErase.ywBottom - vfli.dypBase;
; if (ywMid < rcw.ywBottom && ywMid >= rcw.ywTop)
; DrawPatternLine(hdc, xw, ywMid, rcw.xwRight - xw, ipat, pltHorz);
mov ax,[rcwErase.ywBottomRc]
sub ax,[vfli.dypBaseFli]
;DF575 performs
;if (ax < rcw.ywBottom && ax >= rcw.ywTop)
; DrawPatternLine(hdc, si, ax, rcw.xwRight-si, di, pltHorz);
;ax, bx, cx, dx are altered.
call DF575
; PutPlc(hplcedl, dl, &edl);
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
call DF49
; if (vfli.cpMac == caSect.cpLim)
; {
mov ax,[vfli.LO_cpMacFli]
mov dx,[vfli.HI_cpMacFli]
sub ax,[caSect.LO_cpLimCa]
sbb dx,[caSect.HI_cpLimCa]
or ax,dx
jne DF20
; ywMid = rcwErase.ywBottom - vfli.dypBase -
; min((edl.dyp - vfli.dypBase),
; (vsci.dypBorder << 1));
mov cx,[vfli.dypBaseFli]
mov ax,[rcwErase.ywBottomRc]
sub ax,cx
mov dx,[edl.dypEdl]
sub dx,cx
mov cx,[vsci.dypBorderSci]
shl cx,1
cmp cx,dx
jle DF18
mov cx,dx
DF18:
sub ax,cx
; Assert(!vfli.fSplatColumn);
ifdef DEBUG
;Assert(!vfli.fSplatColumn) with a call so as not to
;mess up short jumps.
call DF63
endif ;/* DEBUG */
; if (ywMid < rcw.ywBottom && ywMid >= rcw.ywTop)
; DrawPatternLine(hdc, xw, ywMid, rcw.xwRight - xw, ipat,pltHorz );
;DF575 performs
;if (ax < rcw.ywBottom && ax >= rcw.ywTop)
; DrawPatternLine(hdc, si, ax, rcw.xwRight-si, di, pltHorz);
;ax, bx, cx, dx are altered.
call DF575
; }
DF20:
; /* Paint the outline bullets because LHighlight
; is located after we call AddVisiSpaces(). */
; if (vfli.grpfvisi.w || (vfli.omk != omkNil && vfli.fOutline))
; {
; AddVisiSpaces(hdc, dxpToXw, ypLine+dypToYw, &rcwClip );
; }
;DF60 performs
;if (vfli.grpfvisi.w || (vfli.omk != omkNil && vfli.fOutline))
; {
; AddVisiSpaces(hdc, dxpToXw, ypLine+dypToYw, &rcwClip );
; }
;ax, bx, cx, dx are altered.
call DF60
; goto LHighlight;
jmp LHighlight
; }
; else
;/* check for soft page breaks */
; {
DF22:
; struct DOD *pdod;
;
; pdod = PdodDoc(vfli.doc);
; if (!pdod->fShort && pdod->hplcpgd && !(*hwwd)->fOutline)
; {
mov si,[vfli.docFli]
shl si,1
mov si,[si.mpdochdod]
mov bx,[si]
cmp [bx.fShortDod],fFalse
jne Ltemp008
cmp [bx.hplcpgdDod],fFalse
je Ltemp008
mov bx,[hwwd]
mov bx,[bx]
test [bx.fOutlineWwd],maskFOutlineWwd
je Ltemp007
Ltemp008:
jmp DF27
Ltemp007:
push ax ;save flags
push si ;save hdod
; if (!FInCa(vfli.doc, vfli.cpMac - 1, &caPage))
; {
mov si,[vfli.LO_cpMacFli]
mov di,[vfli.HI_cpMacFli]
sub si,1
sbb di,0
mov ax,dataoffset [caPage]
cCall FInCa,<[vfli.docFli], di, si, ax>
or ax,ax
jne DF23
; CP cpFli;
; int wwFli, docFli, dxaFli;
; wwFli = vfli.ww;
; docFli = vfli.doc;
; cpFli = vfli.cpMin;
; dxaFli = vfli.dxa;
; CachePage(vfli.doc, vfli.cpMac - 1);
; if (vfFliMunged && wwFli != wwNil && docFli != docNil)
; FormatLineDxa(wwFli, docFli, cpFli, dxaFli);
; }
mov bx,[vfli.wwFli]
push bx ;argument for FormatLineDxa
mov ax,[vfli.docFli]
push ax ;argument for FormatLineDxa
push [vfli.HI_cpMinFli] ;argument for FormatLineDxa
push [vfli.LO_cpMinFli] ;argument for FormatLineDxa
push [vfli.dxaFli] ;argument for FormatLineDxa
push bx ;save wwFli
push ax ;save docFli
cCall CachePage,<ax, di, si>
pop ax ;restore docFli
pop bx ;restore wwFli
mov cx,[vfFliMunged]
jcxz DF225
errnz <wwNil>
or bx,bx
je DF225
errnz <docNil>
or ax,ax
je DF225
ifdef DEBUG
cCall S_FormatLineDxa,<>
else ;not DEBUG
cCall N_FormatLineDxa,<>
endif ;DEBUG
jmp short DF23
DF225:
add sp,10 ;remove FormatLineDxa arguments from stack
DF23:
pop bx ;restore hdod
mov bx,[bx]
pop ax ;restore flags
;/* we are now guaranteed that cpMac-1 is within the cached page */
; if (!fInTable && vfli.cpMac == caPage.cpLim
; && vfli.cpMac < CpMacDocEdit(vfli.doc))
; {
test al,maskfInTableLocal
jne DF26
mov cx,si
sub cx,[caPage.LO_cpLimCa]
mov dx,di
sbb dx,[caPage.HI_cpLimCa]
and dx,cx
inc dx
jne DF26
;***Begin in line CpMacDocEdit(vfli.doc)
sub si,[bx.LO_cpMacDod]
sbb di,[bx.HI_cpMacDod]
add si,3*ccpEop+1
adc di,0
;***End in line CpMacDocEdit(vfli.doc)
jge DF26
;/* last line of page. Show page break */
; fSoftPageBreak = fTrue;
or al,maskfSoftPageBreakLocal
; }
DF26:
; }
; }
; }
DF27:
; fFrameLines = ((vfli.fPageView && FDrawPageDrsWw(ww) && !fInTable)
; || (fInTable && FDrawTableDrsWw(ww)));
;#define FDrawPageDrsWw(ww) (PwwdWw(ww)->grpfvisi.fDrawPageDrs || PwwdWw(ww)->grpfvisi.fvisiShowAll)
mov cx,ax
and cx,maskfInTableLocal
test al,maskfNotPageViewLocal+maskfInTableLocal
jne DF271
errnz <maskfDrawPageDrsGrpfvisi - 04000h>
errnz <maskfvisiShowAllGrpfvisi - 00020h>
test [grpfvisiVar],maskfDrawPageDrsGrpfvisi+maskfvisiShowAllGrpfvisi
jne DF272
DF271:
jcxz DF277
;#define FDrawTableDrsWw(ww) (PwwdWw(ww)->grpfvisi.fDrawTableDrs || PwwdWw(ww)->grpfvisi.fvisiShowAll)
errnz <maskfDrawTableDrsGrpfvisi - 02000h>
errnz <maskfvisiShowAllGrpfvisi - 00020h>
test [grpfvisiVar],maskfDrawTableDrsGrpfvisi+maskfvisiShowAllGrpfvisi
je DF277
DF272:
or al,maskfFrameLinesLocal
; /* don't blow away the frame lines if they're just going to get
; drawn back again; otherwise they'll flicker */
; if (fFrameLines)
; {
;Assembler note: the test for fFrameLines has already been done
; if (dl == 0 && pdr->yl == 0)
; rcw.ywTop = min(rcw.ywBottom, rcw.ywTop + dyFrameLine);
;#define dyFrameLine dypBorderFti
;#define dypBorderFti vfti.dypBorder
mov bx,[pdr]
mov cx,[dlArg]
or cx,[bx.ylDr]
jne DF274
mov cx,[rcw.ywTopRc]
add cx,[vfti.dypBorderFti]
cmp cx,[rcw.ywBottomRc]
jle DF273
mov cx,[rcw.ywBottomRc]
DF273:
mov [rcw.ywTopRc],cx
DF274:
; if (rcwErase.ywBottom >= YwFromYl(hpldr, (*hpldr)->dyl) &&
; pdr->fBottomTableFrame && !fFat)
test [bx.fBottomTableFrameDr],maskFBottomTableFrameDr
je DF277
test al,maskfFatLocal
jne DF277
push ax ;save flags
mov bx,[hpldr]
push bx
mov bx,[bx]
push [bx.dylPldr]
cCall YwFromYl,<>
xchg ax,cx
pop ax ;restore flags
mov bx,[rcw.ywBottomRc]
cmp bx,cx
jl DF277
; rcw.ywBottom = max(rcw.ywTop, rcw.ywBottom - dyFrameLine);
;#define dyFrameLine dypBorderFti
;#define dypBorderFti vfti.dypBorder
sub bx,[vsci.dypBorderSci]
cmp bx,[rcw.ywTopRc]
jge DF276
mov bx,[rcw.ywTopRc]
DF276:
mov [rcw.ywBottomRc],bx
; }
DF277:
; DisplayFliCore(ww, rcw, dxpToXw, rcwErase.ywBottom);
push ax ;save flags
push [ww]
push [rcw.ypBottomRc]
push [rcw.xpRightRc]
push [rcw.ypTopRc]
push [rcw.xpLeftRc]
push [dxpToXw]
push [rcwErase.ywBottomRc]
ifdef DEBUG
cCall S_DisplayFliCore,<>
else ;not DEBUG
call far ptr N_DisplayFliCore
endif ;DEBUG
; GetPlc(hplcedl, dl, &edl);
lea ax,[edl]
cCall GetPlc,<[hplcedl], [dlArg], ax>
; if (fSoftPageBreak)
; {
; DrawPatternLine(hdc, rcw.xwLeft,
; rcwErase.ywBottom - vsci.dypBorder,
; rcw.xwRight - rcw.xwLeft,
; ipatHorzLtGray, pltHorz);
;/* last line of page. Show page break */
pop ax ;restore flags
push ax ;save flags
test al,maskfSoftPageBreakLocal
jz DF278
mov si,[rcw.xwLeftRc]
mov ax,[rcwErase.ywBottomRc]
sub ax,[vsci.dypBorderSci]
mov di,ipatHorzLtGray
;DF58 performs DrawPatternLine(hdc, si, ax, rcw.xwRight-si, di, pltHorz);
;ax, bx, cx, dx are altered.
call DF58
; edl.dxp = rcw.xwRight - dxpToXw - edl.xpLeft;
mov ax,[rcw.xwRightRc]
sub ax,[dxpToXw]
sub ax,[edl.xpLeftEdl]
mov [edl.dxpEdl],ax
; PutPlc(hplcedl, dl, &edl);
; }
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
call DF49
DF278:
pop ax ;restore flags
push ax ;save flags
; if (!vfli.fPrint && vlm != lmPreview)
; {
cmp [vfli.fPrintFli],fFalse
jne DF33
cmp [vlm],lmPreview
je DF33
; if (fFrameLines)
test al,maskfFrameLinesLocal
je DF32
; FrameDrLine(ww, hpldr, idr, rcwErase.ywTop, rcwErase.ywBottom,
; fFat, fInTable/*fForceLine*/, fInTable/*fInnerDr*/);
push [ww]
push [hpldr]
push [idr]
push [rcwErase.ywTopRc]
push [rcwErase.ywBottomRc]
mov cx,ax
and ax,maskfFatLocal
push ax
and cx,maskfInTableLocal
push cx
push cx
cCall FrameDrLine,<>
DF32:
; }
DF33:
; if (vfli.fOutline)
; {
cmp [vfli.fOutlineFli],fFalse
je DF34
; struct PT ptT;
; /* Know: what x position is after trailing space, so ellipses
; can be drawn ... */
; ptT.xp = vfli.xpRight + dxpToXw;
; ptT.yp = ypLine;
; edl.dxp += DxpOutlineSplats(hdc, dxpToXw, ptT, &rcwErase);
; PutPlc(hplcedl, dl, &edl);
;PAUSE
push [hdc]
mov ax,[dxpToXw]
push ax
push [ypLine]
add ax,[vfli.xpRightFli]
push ax
lea ax,[rcwErase]
push ax
cCall DxpOutlineSplats,<>
add [edl.dxpEdl],ax
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
call DF49
; }
DF34:
;/* after the line has been painted, retrofit visible spaces, draw selection
;and return bitmaps to their original state */
; if (vfli.grpfvisi.w || (vfli.omk != omkNil && vfli.fOutline))
; {
; AddVisiSpaces(hdc, dxpToXw, ypLine+dypToYw, &rcwClip );
; }
;DF60 performs
;if (vfli.grpfvisi.w || (vfli.omk != omkNil && vfli.fOutline))
; {
; AddVisiSpaces(hdc, dxpToXw, ypLine+dypToYw, &rcwClip );
; }
;ax, bx, cx, dx are altered.
call DF60
pop ax ;restore flags
;/* splats in page view */
; if (vfli.fPageView && vfli.fSplatBreak && !fInTable && vfli.grpfvisi.fvisiShowAll)
; {
test al,maskfNotPageViewLocal+maskfNotSplatBreakLocal+maskfInTableLocal
jne DF40
errnz <maskfvisiShowAllGrpfvisi - 00020h>
test bptr ([vfli.grpfvisiFli]),maskfvisiShowAllGrpfvisi
je DF40
; struct RC rcwT;
;
; xw = dxpToXw + vfli.xpRight - vfli.rgdxp[vfli.ichMac - 1];
; rcw.xwLeft = xw;
; DrclToRcw(hpldr, &pdr->drcl, &rcwT);
mov si,[dxpToXw]
add si,[vfli.xpRightFli]
mov bl,[vfli.ichMacFli]
xor bh,bh
dec bx
shl bx,1
sub si,[bx.vfli.rgdxpFli]
;DF59 performs DrclToRcw(hpldr, &pdr->drcl, &rcwT)
;ax, bx, cx, dx are altered.
call DF59
mov cx,si
; rcw.xwRight = rcwT.xwRight;
mov dx,[rcwT.xwRightRc]
; if (FDrawPageDrsWw(ww))
; {
;#define FDrawPageDrsWw(ww) (PwwdWw(ww)->grpfvisi.fDrawPageDrs || PwwdWw(ww)->grpfvisi.fvisiShowAll)
errnz <maskfDrawPageDrsGrpfvisi - 04000h>
errnz <maskfvisiShowAllGrpfvisi - 00020h>
test [grpfvisiVar],maskfDrawPageDrsGrpfvisi+maskfvisiShowAllGrpfvisi
je DF38
;/* adjust if FDrawPageDrsWw because PatBltRc would erase the boundary line */
; rcw.xwLeft += vsci.dxpBorder;
; rcw.xwRight -= vsci.dxpBorder;
; if (rcw.ywTop <= rcwT.ywTop)
; rcw.ywTop += vsci.dypBorder;
; }
add cx,[vsci.dxpBorderSci]
sub dx,[vsci.dxpBorderSci]
mov ax,[rcw.ywTopRc]
cmp ax,[rcwT.ywTopRc]
jg DF38
mov ax,[vsci.dypBorderSci]
add [rcw.ywTopRc],ax
DF38:
mov [rcw.xwLeftRc],cx
mov [rcw.xwRightRc],dx
; if (vfli.ichMac > 1)
; goto LSplat2; /* not the only thing on the line, background already erased */
; goto LSplat;
cmp [vfli.ichMacFli],1
jmp LSplat
; }
DF40:
;/* show highlight */
;LHighlight:
LHighlight:
mov si,[ww]
; if (PwwdWw(ww)->xwSelBar > 0)
; {
cmp [xwSelBar],fFalse
jle DF42
; Assert(!PwwdWw(ww)->fPageView);
ifdef DEBUG
push ax
push bx
push cx
push dx
cCall N_PwwdWw,<[ww]>
xchg ax,bx
test [bx.fPageViewWwd],maskfPageViewWwd
je DF41
mov ax,midDisp1n
mov bx,1053
cCall AssertProcForNative,<ax,bx>
DF41:
pop dx
pop cx
pop bx
pop ax
endif ;DEBUG
; if (!fInTable)
cmp bptr ([fInTable]),fFalse
jne DF42
; DrawStyNameFromWwDl(ww, hpldr, idr, dl);
cCall DrawStyNameFromWwDl,<si, [hpldr], [idr], [dlArg]>
; }
DF42:
; MarkSel(ww, hpldr, idr, &selCur, &edl, vfli.cpMin, vfli.cpMac );
; MarkSel(ww, hpldr, idr, &selDotted, &edl, vfli.cpMin, vfli.cpMac );
mov di,dataoffset [selCur]
DF43:
push si
push [hpldr]
push [idr]
push di
lea ax,[edl]
push ax
push [vfli.HI_cpMinFli]
push [vfli.LO_cpMinFli]
push [vfli.HI_cpMacFli]
push [vfli.LO_cpMacFli]
cCall MarkSel,<>
cmp di,dataoffset [selCur]
mov di,dataoffset [selDotted]
je DF43
;/* iff fRMark text was on line, draw revision bar in selection bar */
; if (fRMark && ((irmBar = PdodMother(vfli.doc)->dop.irmBar) != irmBarNone))
; {
; int xwRevBar;
test [vfli.fRMarkFli],maskFRMarkFli
je Ltemp002
cCall N_PdodMother,<[vfli.docFli]>
xchg ax,bx
mov al,[bx.dopDod.irmBarDop]
errnz <irmBarNone - 0>
or al,al
Ltemp002:
je DF47
; if (!(*hwwd)->fPageView)
; xwRevBar = (*hwwd)->xwSelBar + dxwSelBarSci / 2;
;#define dxwSelBarSci vsci.dxwSelBar
mov di,[hwwd]
mov di,[di]
mov cx,[di.xwSelBarWwd]
mov si,[vsci.dxwSelBarSci]
shr si,1
test [di.fPageViewWwd],maskfPageViewWwd
je DF46
; else
; {
; DrclToRcw(hpldr, &pdr->drcl, &rcw);
push ax ;save irmBar
;DF59 performs DrclToRcw(hpldr, &pdr->drcl, &rcwT)
;ax, bx, cx, dx are altered.
call DF59
pop ax ;restore irmBar
; switch (irmBar)
; {
; default:
; Assert(fFalse);
; /* fall through */
ifdef DEBUG
;This assert is done with a call so as not to mess up short jumps
call DF67
endif ;DEBUG
; case irmBarOutside:
; if (vfmtss.pgn & 1 && FFacingPages(DocMother(vfli.doc)))
; goto LRight;
; /* fall through */
; case irmBarLeft:
; xwRevBar = rcw.xwLeft - (dxwSelBarSci / 2);
; break;
; case irmBarRight:
; LRight:
; xwRevBar = rcw.xwRight + (dxwSelBarSci / 2);
; break;
;Assembler note: use rcwT here for convenience.
mov cx,[rcwT.xwRightRc]
cmp al,irmBarRight
je DF46
cmp al,irmBarOutside
jne DF455
test bptr ([vfmtss.pgnFmtss]),1
je DF455
push cx ;save register rcwT.xwRight
cCall DocMother,<[vfli.docFli]>
cCall FFacingPages,<ax>
pop cx ;restore register rcwT.xwRight
or ax,ax
jne DF46
DF455:
mov cx,[rcwT.xwLeftRc]
neg si
DF46:
add cx,si
; }
; if (!fInTable)
; DrawRevBar( (*hwwd)->hdc, xwRevBar,
; ypLine - edl.dyp + dypToYw, edl.dyp, &rcwClip);
; PAUSE
cmp bptr ([fInTable]),0
jne DF47
; PAUSE
push [di.hdcWwd]
push cx
mov ax,[ypLine]
sub ax,[edl.dypEdl]
add ax,[dypToYw]
push ax
push [edl.dypEdl]
lea ax,[rcwClip]
push ax
call far ptr DrawRevBar
; }
; }
DF47:
;LRet:
; pdr->xwLimScroll = max( pdr->xwLimScroll,
; edl.xpLeft + edl.dxp + dxpToXw );
;LRet0:
; Scribble(ispDisplayFli,' ');
LRet:
mov si,[pdr]
mov ax,[dxpToXw]
add ax,[edl.dxpEdl]
add ax,[edl.xpLeftEdl]
cmp ax,[si.xwLimScrollDr]
jl LRet0
mov [si.xwLimScrollDr],ax
LRet0:
ifdef DEBUG
push ax
push bx
push cx
push dx
mov ax,ispDisplayFli
mov bx,020h
cmp [vdbs.grpfScribbleDbs],0
jz DF48
cCall ScribbleProc,<ax,bx>
DF48:
pop dx
pop cx
pop bx
pop ax
endif ;DEBUG
; FreePdrf(&drfFetch);
lea ax,[drfFetch]
ifdef DEBUG
cCall S_FreePdrf,<ax>
else ;not DEBUG
cCall N_FreePdrf,<ax>
endif ;DEBUG
DF485:
xor [vrf.fInDisplayFliRf],maskFInDisplayFliRf
;}
cEnd
;End of DisplayFli
; DF49 performs
; PutPlc(hplcedl, dlArg, &edl).
; ax, bx, cx, dx are altered.
DF49:
lea ax,[edl]
cCall PutPlc,<[hplcedl], [dlArg], ax>
ret
; Debug(grpfvisi = PwwdWw(ww)->grpfvisi);
; Assert((int) vfli.grpfvisi == (int) grpfvisi);
ifdef DEBUG
DF50:
push ax
push bx
push cx
push dx
cCall N_PwwdWw,<[ww]>
xchg ax,bx
mov ax,[bx.grpfvisiWwd]
cmp ax,[vfli.grpfvisiFli]
je DF51
mov ax,midDisp1n
mov bx,1055
cCall AssertProcForNative,<ax,bx>
DF51:
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DEBUG */
; Assert(edl.dyp >= ((struct SCC *)pwwd)->ywMac);
ifdef DEBUG
DF52:
push ax
push bx
push cx
push dx
mov ax,[bx.ywMacWwd]
cmp [edl.dypEdl],ax
jge DF53
mov ax,midDisp1n
mov bx,1056
cCall AssertProcForNative,<ax,bx>
DF53:
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DEBUG */
; Scribble(ispDisplayFli,'D');
ifdef DEBUG
DF54:
push ax
push bx
push cx
push dx
mov ax,ispDisplayFli
mov bx,044h
cmp [vdbs.grpfScribbleDbs],0
jz DF55
cCall ScribbleProc,<ax,bx>
DF55:
pop dx
pop cx
pop bx
pop ax
ret
endif ;DEBUG
; Assert( hdc != NULL );
ifdef DEBUG
DF56:
cmp [hdc],NULL
jne DF57
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1057
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DF57:
ret
endif ;/* DEBUG */
;DF575 performs
;if (ax < rcw.ywBottom && ax >= rcw.ywTop)
; DrawPatternLine(hdc, si, ax, rcw.xwRight-si, di, pltHorz);
;ax, bx, cx, dx are altered.
DF575:
cmp ax,[rcw.ywBottomRc]
jge DF585
cmp ax,[rcw.ywTopRc]
jl DF585
;DF58 performs DrawPatternLine(hdc, si, ax, rcw.xwRight-si, di, pltHorz);
;ax, bx, cx, dx are altered.
DF58:
push [hdc]
push si
push ax
mov ax,[rcw.xwRightRc]
sub ax,si
push ax
push di
errnz <pltHorz - 0>
xor ax,ax
push ax
cCall DrawPatternLine,<>
DF585:
ret
;DF59 performs DrclToRcw(hpldr, &pdr->drcl, &rcwT)
;ax, bx, cx, dx are altered.
DF59:
mov bx,[pdr]
add bx,(drclDr)
lea ax,[rcwT]
cCall DrclToRcw,<[hpldr], bx, ax>
ret
;DF60 performs
;if (vfli.grpfvisi.w || (vfli.omk != omkNil && vfli.fOutline))
; {
; AddVisiSpaces(hdc, dxpToXw, ypLine+dypToYw, &rcwClip );
; }
;ax, bx, cx, dx are altered.
DF60:
cmp [vfli.grpfvisiFli],fFalse
jne DF61
errnz <omkNil>
test [vfli.omkFli],maskOmkFli
je DF62
cmp [vfli.fOutlineFli],fFalse
je DF62
DF61:
push [hdc]
push [dxpToXw]
mov ax,[dypToYw]
add ax,[ypLine]
push ax
lea ax,[rcwClip]
push ax
ifdef DEBUG
cCall S_AddVisiSpaces,<>
else ;not DEBUG
cCall N_AddVisiSpaces,<>
endif ;DEBUG
DF62:
ret
; Assert(!vfli.fSplatColumn);
ifdef DEBUG
DF63:
test [vfli.fSplatColumnFli],maskfSplatColumnFli
je DF64
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1058
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DF64:
ret
endif ;/* DEBUG */
; Assert(vfli.doc != docNil);
ifdef DEBUG
DF65:
cmp [vfli.docFli],docNil
jne DF66
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1059
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DF66:
ret
endif ;DEBUG
ifdef DEBUG
DF67:
cmp al,irmBarOutside
je DF68
cmp al,irmBarLeft
je DF68
cmp al,irmBarRight
je DF68
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1054
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DF68:
ret
endif ;DEBUG
;-------------------------------------------------------------------------
; DrawRevBar( hdc, xp, yp, dyp )
;-------------------------------------------------------------------------
;/*
;* DrawRevBar draws a revision bar at (xw,yw). The height of the bar is
;* determined by the size of vfli.dypLine or vfli.dypFont. If not NULL,
;* drawing is clipped to *prcwClip.
;*/
;DrawRevBar(hdc, xw, yw, dyw, prcwClip)
;HDC hdc;
;int xw,yw,dxw;
;struct RC *prcwClip;
;{
; int dxp = vsci.dxpBorder;
; HBRUSH hbrOld;
; %%Function:DrawRevBar %%Owner:BRADV
cProc DrawRevBar,<PUBLIC,FAR>,<si,di>
ParmW hdc
ParmW xw
ParmW yw
ParmW dyw
ParmW prcwClip
cBegin
;PAUSE
; if (prcwClip != NULL)
; {
mov dx,[xw] ; handy register variable
mov cx,[dyw] ; another handy register variable
mov bx,[prcwClip]
or bx,bx
jz DRB50
; if (xw < prcwClip->xwLeft || xw + vfti.dxpBorder > prcwClip->xwRight)
; return;
;PAUSE
cmp dx,[bx.xwLeftRc]
jl DRBTemp
mov ax,[vfti.dxpBorderFti]
add ax,dx
cmp ax,[bx.xwRightRc]
jg DRBTemp
; if (yw < prcwClip->ywTop)
; {
;PAUSE
mov ax,[bx.ywTopRc]
sub ax,[yw]
jle DRB10
; dyw -= prcwClip->ywTop - yw;
sub [dyw],ax
; yw = prcwClip->ywTop;
add [yw],ax ; trickey, eh?
; }
DRB10:
; if ((dyw = min(dyw, prcwClip->ywBottom - yw)) <= 0)
; return;
mov cx,[bx.ywBottomRc]
sub cx,[yw]
cmp cx,[dyw]
jle DRB20
;PAUSE
mov cx,[dyw]
DRB20:
or cx,cx
jle LDRBExit
;PAUSE
; Assert(yw >= prcwClip.ywTop && dyw > 0 && yw + dyw <= prcw.ywBottom);
ifdef DEBUG
push ax
push bx
push cx
push dx
mov ax,[yw]
cmp ax,[bx.ywTopRc]
jl DRB30
cmp cx,0
jle DRB30
add ax,cx
cmp ax,[bx.ywBottomRc]
jle DRB40
DRB30:
mov ax,midDisp1n
mov bx,1060
cCall AssertProcForNative,<ax,bx>
DRB40:
pop dx
pop cx
pop bx
pop ax
endif ;DEBUG
; }
DRB50:
;PAUSE
mov di,[hdc]
push di
push dx
push [yw]
push [vfti.dxpBorderFti]
push cx ;push arguments used in either case
; if (vlm == lmPreview)
; DrawPrvwLine(hdc, xw, yw, vfti.dxpBorderFti, dyw, colAuto);
cmp [vlm],lmPreview
jne DRB60
mov ax,1
push ax
cCall DrawPrvwLine,<>
DRBTemp:
jmp short LDRBExit
; else
; {
; hbrOld = SelectObject(hdc, vfli.fPrint ? vpri.hbrText:vsci.hbrText);
DRB60:
push di
mov ax,[vpri.hbrTextPri]
cmp [vfli.fPrintFli],0
jne DRB70
mov ax,[vsci.hbrTextSci]
DRB70:
push ax
ifdef DEBUG
cCall SelectObjectFP,<>
else ;!DEBUG
ifdef HYBRID
cCall SelectObjectPR,<>
else ;!HYBRID
cCall SelectObject,<>
endif ;!HYBRID
endif ;!DEBUG
xchg ax,si
; PatBlt(hdc, xp, yp, vfti.dxpBorderFti, dyp, PATCOPY);
mov dx,HI_PATCOPY
mov ax,LO_PATCOPY
push dx
push ax
ifdef DEBUG
cCall PatBltFP,<>
else ;!DEBUG
ifdef HYBRID
cCall PatBltPR,<>
else ;!HYBRID
cCall PatBlt,<>
endif ;!HYBRID
endif ;!DEBUG
; SelectObject(hdc, hbrOld);
; }
ifdef DEBUG
cCall SelectObjectFP,<di, si>
else ;!DEBUG
ifdef HYBRID
cCall SelectObjectPR,<di, si>
else ;!HYBRID
cCall SelectObject,<di, si>
endif ;!HYBRID
endif ;!DEBUG
LDRBExit:
;}
cEnd
;End of DrawRevBar
;-------------------------------------------------------------------------
; DisplayFliCore( ww, rcwClip, dxpToXw, ywLine )
;-------------------------------------------------------------------------
;/* D I S P L A Y F L I C O R E */
;/* paint line described by vfli onto DC hdc, at coordinates described
; by *pptPen. There is no need to paint beyond rcwClip.
;
; Returns fTrue if line contains text with the revision mark property
;*/
;native DisplayFliCore( ww, rcwClip, dxpToXw, ywLine )
;int ww;
;struct RC rcwClip;
;int dxpToXw, ywLine;
;{
; int dypPen;
; int ich;
; int ichNext;
; CP dcpVanish;
; struct CHR *pchr;
; int hpsPosPrev;
; int tlc;
; HDC hdc = PwwdWw(ww)->hdc;
; int eto = ETO_OPAQUE;
; BOOL fErased = fFalse;
; struct ULS uls;
; struct PT ptPen;
; struct RC rcOpaque, rcErase, rcAdjusted;
; BOOL fRcAdjusted;
; BOOL fNoSkip = fFalse;
; int dxp;
; int ilevel;
; struct CHP *pchp;
; struct PT ptPenT; /* A copy of ptPen to be used by DrawBrcl */
maskfPrvwPrintLocal equ 001h
maskfOverLocal equ 004h
maskfErasedLocal equ 008h
maskfUseRcEraseLocal equ 010h
maskfRcAdjustedLocal equ 020h
maskfNoSkipLocal equ 040h
; %%Function:N_DisplayFliCore %%Owner:BRADV
cProc N_DisplayFliCore,<PUBLIC,FAR>,<si,di>
ParmW ww
errnz <(xpLeftRc)-0>
errnz <(ypTopRc)-2>
errnz <(xpRightRc)-4>
errnz <(ypBottomRc)-6>
ParmW rcwClipYpBottomRc
ParmW rcwClipXpRightRc
ParmW rcwClipYpTopRc
ParmW rcwClipXpLeftRc
ParmW dxpToXw
ParmW ywLine
LocalW eto
LocalW hdc
LocalW ich
LocalD dcpVanish
LocalW hpsPosPrev
LocalW dypPen
LocalW xpVar
LocalW ypVar
LocalW pchr
LocalW cchChop
ifdef DEBUG
LocalW fPchpInitialized
endif ;/* DEBUG */
LocalV ptPen,cbPtMin
LocalV ptPenT,cbPtMin
LocalV rcOpaque,cbRcMin
LocalV rcErase,cbRcMin
LocalV rcT,cbRcMin
LocalV uls,cbUlsMin
LocalV rcAdjusted,cbRcMin
ifdef SHOWFLD
LocalV szFrame,40
endif ;/* SHOWFLD */
cBegin
mov si,[ww]
cCall N_PwwdWw,<si>
xchg ax,bx
mov cx,[bx.hdcWwd]
mov [hdc],cx
; ptPenT.xw = ptPen.xw = vfli.xpLeft + dxpToXw;
; ptPenT.yw = ptPen.yw = ywLine - vfli.dypBase;
mov ax,[vfli.xpLeftFli]
add ax,[dxpToXw]
mov [ptPen.xwPt],ax
mov [ptPenT.xwPt],ax
mov ax,[ywLine]
sub ax,[vfli.dypBaseFli]
mov [ptPen.ywPt],ax
mov [ptPenT.ywPt],ax
; Assert( ww != wwNil );
ifdef DEBUG
cmp [ww],wwNil
jne DFC01
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1001
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC01:
endif ;/* DEBUG */
; Assert( hdc !=NULL );
ifdef DEBUG
cmp [hdc],NULL
jne DFC02
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1002
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC02:
endif ;/* DEBUG */
; uls.ww = ww;
mov [uls.wwUls],si
; uls.hdc = hdc;
mov [uls.hdcUls],cx
; uls.grpfUL = 0;
xor cx,cx
mov [uls.grpfULUls],cx
ifdef DEBUG
mov [fPchpInitialized],fFalse
endif ;/* DEBUG */
; ich = 0;
; dcpVanish = cp0;
; hpsPosPrev = 0;
; dypPen = 0;
mov [ich],cx
mov [OFF_dcpVanish],cx
mov [SEG_dcpVanish],cx
mov bptr ([hpsPosPrev]),cl
mov [dypPen],cx
push ds
pop es
; blt(&rcwClip,&rcOpaque,cwRC);
errnz <cbRcMin - 8>
lea si,[rcwClipXpLeftRc]
lea di,[rcOpaque]
movsw
movsw
movsw
movsw
; blt(&rcwClip,&rcErase,cwRC);
errnz <cbRcMin - 8>
lea si,[rcwClipXpLeftRc]
lea di,[rcErase]
movsw
movsw
movsw
movsw
; pchr = &(**vhgrpchr)[0];
mov si,[vhgrpchr]
mov si,[si]
; simultaneously put (vfli.fPrint || vfPrvwDisp) in a register and clear
; fDacChr, fIichSpaceMac, fErased, fNoSkip.
mov ax,[vfPrvwDisp]
or al,[vfli.fPrintFli]
ifdef DEBUG
test ax,0FFFEh
je DFC03
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1003
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC03:
endif ;/* DEBUG */
; eto = ETO_CLIPPED;
; if (!fPrvwPrint)
; eto |= ETO_OPAQUE
errnz <ETO_CLIPPED - 4>
mov dx,ETO_CLIPPED
test al,maskfPrvwPrintLocal
jne DFC04
or dl,ETO_OPAQUE
DFC04:
mov eto,dx
;/* main loop, goes around for every chr */
;/* pen position must be at the baseline in front of the next character. */
; At this point we know dac == dacNop and dac is only set to
; dacNop above this point so we can jump straight to the case
; dacNop code from here.
jmp DFC28
; The beginning of the for loop has been moved down in the assembler
; version (at DFC265)
; for (;;)
; {
; {
; int chrm;
;/* if is used instead of switch for better space/speed */
; switch is smaller and probably faster in assembler
DFCJumpTable:
errnz <chrmEnd - 02h>
dw offset DFC26
errnz <chrmTab - 04h>
dw offset DFC05
errnz <chrmVanish - 06h>
dw offset DFC17
errnz <chrmFormula - 08h>
dw offset DFC22
dw 0 ; no chrm of length 0Ah
errnz <chrmFormatGroup - 0Ch>
dw offset DFC24
dw 0 ; no chrm of length 0Eh
dw 0 ; no chrm of length 10h
errnz <chrmChp - 12h>
dw offset DFC12
errnz <chrmDisplayField - 14h>
dw offset DFC18
Ltemp019:
db 0C3h ;near ret (ret generates far ret opcode here)
; if ((chrm = pchr->chrm) == chrmTab)
; {
DFC05:
;/* special chrmTab for visible characters: special draw for pub chars, ignore all others. */
; bchrCur = (char *) pchr - (char *)*vhgrpchr;
; bchpCur = (char *) pchp - (char *)*vhgrpchr;
; if (((struct CHRT *)pchr)->ch == 0)
; {
;Assembler note: convert pchr & pchp to and from offsets around
;calls to DrawTlc and DrawChPubs, not here.
xor bx,bx
mov bl,[si.chChrt-cbCHRT]
or bx,bx
jnz DFC103
; dxp = vfli.rgdxp[ich];
mov bx,[ich]
shl bx,1
mov cx,[bx.vfli.rgdxpFli]
; if ((tlc = ((struct CHRT *)pchr)->tlc) || pchp->kul)
; {
mov dl,[si.tlcChrt-cbCHRT]
or dl,dl
jne DFC055
test [di.kulChp],maskKulChp
jz DFC10
DFC055:
;/* draw tab leader or underlining. Blank first. */
; int xpNew; struct RC rcT;
; int fOver=fFalse;
and al,NOT maskfOverLocal
; xpNew = ptPen.xp + dxp;
mov bx,[ptPen.xpPt]
add bx,cx
; if (!fErased && !fPrvwPrint)
; {
test al,maskfErasedLocal+maskfPrvwPrintLocal
jne DFC07
; blt( &rcErase, &rcT, cwRC );
; rcT.xpRight = xpNew;
or al,maskfUseRcEraseLocal
; DFC54 performs:
; blt(fUseRcErase ? &rcErase : &rcOpaque, &rcT, cwRC );
; rcT.xpRight = bx;
; no registers are altered
call DFC54
; PatBltRc( hdc, &rcT, vsci.ropErase );
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
and al,NOT maskfUseRcEraseLocal
call DFC56
; rcOpaque.xpLeft = rcErase.xpLeft
; = xpNew;
mov [rcErase.xpLeftRc],bx
mov [rcOpaque.xpLeftRc],bx
; }
DFC07:
; if (!tlc)
; {
or dl,dl
jne DFC09
;/* 4th param means round up. Do not round up iff next char is not ul'd */
; struct CHR *pchrT =
; ((struct CHRT *)pchr) + 1;
; fOver = !(pchrT->chrm == chrmChp &&
; pchrT->ich == ich + 1 &&
; pchrT->chp.kul != kulSingle);
or al,maskfOverLocal
cmp [si.chrmChr],chrmChp
jne DFC08
mov bl,bptr [ich]
inc bx
cmp [si.ichChr],bl
jne DFC08
mov bl,[si.chpChr.kulChp]
and bl,maskKulChp
cmp bl,kulSingle SHL ibitKulChp
je DFC08
and al,NOT maskfOverLocal
DFC08:
; }
DFC09:
;/* note: underlined tabs must be drawn as underlined space "leaders" */
; DrawTlc( hdc, ptPen, tlc,
; dxp, pchp, fOver, &rcwClip );
push ax ;save flags
push cx ;save dxp
push [hdc]
errnz <(ypPt) - (xpPt) - 2>
push [ptPen.ypPt]
push [ptPen.xpPt]
xor dh,dh
push dx
push cx
push di
; NOTE: we know that ah is zero here because it has no flags.
and al,maskfOverLocal
push ax
lea ax,[rcwClipXpLeftRc]
push ax
;DFC82 converts di and [pchr] from pointers to offsets into
;*vhgrpchr. Upon return bx is -pchr. Only bx is altered.
call DFC82
add si,bx
cCall DrawTlc,<>
;DFC83 converts di and [pchr] to pointers from offsets into
;*vhgrpchr. Upon return bx is pchr. Only bx is altered.
call DFC83
add si,bx
pop cx ;restore dxp
pop ax ;restore flags
; }
DFC10:
; ptPen.xp += dxp;
; ich++;
; }
add [ptPen.xpPt],cx
jmp short DFC107
; else if ((uns)(ch - chPubMin) < (chPubMax-chPubMin))
; {
; DrawChPubs( hdc, &ptPen, ch, &rcOpaque,
; &rcErase, fErased, eto);
; ich++;
; }
DFC103: ; bx = pchr->ch
cmp bl,chPubMin
jb DFC11
cmp bl,chPubMax
jae DFC11
push ax ;save flags
push cx ;save dxp
and ax,maskfErasedLocal
push [hdc]
lea dx,[ptPen]
push dx
push bx ; ch
lea dx,[rcOpaque]
push dx
lea dx,[rcErase]
push dx
push ax ; fErased
push [eto]
;DFC82 converts di and [pchr] from pointers to offsets into
;*vhgrpchr. Upon return bx is -pchr. Only bx is altered.
call DFC82
add si,bx
cCall DrawChPubs,<>
;DFC83 converts di and [pchr] to pointers from offsets into
;*vhgrpchr. Upon return bx is pchr. Only bx is altered.
call DFC83
add si,bx
pop cx ;restore dxp
pop ax ;restore flags
DFC107:
inc bptr ([ich])
DFC11:
; (char *) pchr = (char *)*vhgrpchr + bchrCur;
; (char *) pchp = (char *)*vhgrpchr + bchpCur;
; ((struct CHRT *)pchr)++;
; }
;Assembler note: convert pchr & pchp to and from offsets around
;calls to DrawTlc and DrawChPubs, not here.
db 0C3h ;near ret (ret generates far ret opcode here)
; else if (chrm == chrmChp)
; {
DFC12:
; int bchrCur = (char *) pchr - (char *)*vhgrpchr;
mov bx,[vhgrpchr]
sub si,[bx]
push si
push ax ;save flags
;/* these show if any underline at level 1 or level 2 are set in current looks */
; if (uls.grpfUL)
; EndULPast(&uls,ptPen.xp,ich,&rcwClip);
; LN_EndULPast performs:
; if (uls.grpfUL) EndULPast(&uls,ptPen.xp,ich,&rcwClip);
; ax, bx, cx and dx are altered
call LN_EndULPast
; native note: si = bchrCur, use this to set pchp correctly
; pchp = &pchr->chp;
;PAUSE
lea di,[si.chpChr-cbCHR]
mov bx,[vhgrpchr]
add di,[bx]
ifdef DEBUG
mov [fPchpInitialized],fTrue
endif ;/* DEBUG */
; if (ich < vfli.ichSpace3)
; uls.kul = pchr->fcid.kul;
mov al,[vfli.ichSpace3Fli]
cmp bptr ([ich]),al
jae DFC13
mov al,[di.fcidChr.kulFcid-(chpChr)]
and al,maskKulFcid
mov cl,ibitKulFcid
shr al,cl
mov [uls.kulUls],al
DFC13:
; if (hpsPosPrev != pchp->hpsPos)
; {
mov al,[di.hpsPosChp]
cmp al,bptr ([hpsPosPrev])
je DFC15
; int dypOffset, dypPenMotion;
; hpsPosPrev = pchp->hpsPos;
mov bptr ([hpsPosPrev]),al
; /* 2 * 72 converts half points to inches */
; dypOffset = NMultDiv(
; (hpsPosPrev >= 128) ?
; (hpsPosPrev - 256) : hpsPosPrev,
; vfti.dypInch, 2 * 72);
cbw
push ax
push [vfti.dypInchFti]
mov ax,2*72
push ax
cCall NMultDiv,<>
; dypPenMotion = dypOffset - dypPen;
sub ax,[dypPen]
; ptPen.yp -= dypPenMotion;
sub [ptPen.ypPt],ax
; dypPen += dypPenMotion;
add [dypPen],ax
; }
DFC15:
; LoadFcidFull(pchr->fcid);
errnz <cbFcid - 4>
push [di.fcidChr.HI_lFcid-(chpChr)]
push [di.fcidChr.LO_lFcid-(chpChr)]
ifdef DEBUG
cCall S_LoadFcidFull,<>
else ;not DEBUG
cCall N_LoadFcidFull,<>
endif ;DEBUG
;/* treat begin underline */
; if (uls.grpfUL)
; {
; uls.pt = ptPen;
; uls.dypPen = dypPen;
; }
cmp [uls.grpfULUls],fFalse
je DFC16
push ds
pop es
lea si,[ptPen]
lea di,[uls.ptUls]
errnz <cbPtMin - 4>
movsw
movsw
mov ax,[dypPen]
mov [uls.dypPenUls],ax
DFC16:
pop ax ;restore flags
; /* reset pointers into heap */
; pchr = (char *)*vhgrpchr + bchrCur;
pop si
mov bx,[vhgrpchr]
add si,[bx]
; pchp = &pchr->chp;
lea di,[si.chpChr - cbCHR]
; ForeColor(hdc, pchp->ico);
push ax ;save flags
mov al,[di.icoChp]
errnz <maskIcoChp - 00Fh>
and ax,maskIcoChp
cCall ForeColor,<[hdc],ax>
pop ax ;restore flags
; /* advance pchr to next CHR */
; pchr = (char *)pchr + sizeof(struct CHR);
; }
db 0C3h ;near ret (ret generates far ret opcode here)
; else if (chrm == chrmVanish)
; {
DFC17:
;/* real cp can be calculated as vfli.cpMin + ich + dcpVanish */
; dcpVanish += ((struct CHRV *)pchr)->dcp;
mov bx,[si.LO_dcpChrv-cbCHRV]
add [OFF_dcpVanish],bx
mov bx,[si.HI_dcpChrv-cbCHRV]
adc [SEG_dcpVanish],bx
; (char *)pchr += cbCHRV;
; }
db 0C3h ;near ret (ret generates far ret opcode here)
; else if (chrm == chrmDisplayField)
; {
DFC18:
; if (uls.grpfUL)
; {
; uls.xpLim = ptPen.xp;
; EndUL(&uls, &rcwClip);
; }
; DFC57 performs:
; if (uls.grpfUL) { bchrCur = ..., bchpCur = ...;
; uls.xpLim = ptPen.xp; EndUL(&uls, &rcwClip);
; pchr = ..., pchp = ...}
; si = pchr, di = pchp, -> these get properly updated
; bx, cx and dx are altered
;PAUSE
call DFC57
; int xpNew = ptPen.xp +
; ((struct CHRDF *)pchr)->dxp;
mov bx,[ptPen.xpPt]
add bx,[si.dxpChrdf-cbCHRDF]
; int bchrCur = (char *)pchr - (char *)*vhgrpchr;
; int bchpCur = (char *)pchp - (char *)*vhgrpchr;
; struct PT ptT;
; struct RC rcT;
; do this stuff later in the assembler version
; ptT.xp = ptPen.xp;
; ptT.yp = ptPen.yp + vfli.dypBase -
; vfli.dypLine + dypPen;
; /* chDisplayField is a placeholder
; character in rgch for the CHRDF. Skip
; over it.
; */
; Assert (vfli.rgch [ich] == chDisplayField);
; Assert (vfli.rgdxp [ich] ==
; ((struct CHRDF *)pchr)->dxp);
; Assert (ich == pchr->ich);
ifdef DEBUG
; /* Do this debug code with a call so as not to mess up
; short jumps */
call DFC59
endif ;/* DEBUG */
; ich++;
inc bptr ([ich])
;#ifdef SHOWFLD
; CommSzNum ("Displaying CHRDF: ",
; (int)vfli.cpMin + dcpVanish + pchr->ich);
;#endif /* SHOWFLD */
ifdef SHOWFLD
; /* Do this showfld code with a call so as not to mess up
; short jumps */
call DFC63
endif ;/* SHOWFLD */
; blt( &rcOpaque, &rcT, cwRC );
; rcT.xpRight = xpNew;
and al,NOT maskfUseRcEraseLocal
; DFC54 performs:
; blt(fUseRcErase ? &rcErase : &rcOpaque, &rcT, cwRC );
; rcT.xpRight = bx;
; no registers are altered
call DFC54
; if (!fErased && !fPrvwPrint)
; {
test al,maskfErasedLocal+maskfPrvwPrintLocal
jne DFC20
; PatBltRc( hdc, &rcT, vsci.ropErase );
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
and al,NOT maskfUseRcEraseLocal
call DFC56
; rcErase.xpLeft = rcOpaque.xpLeft = xpNew;
mov [rcErase.xpLeftRc],bx
mov [rcOpaque.xpLeftRc],bx
; }
DFC20:
push ax ;save flags
push bx ;save xpNew
; DisplayField (vfli.doc,
; vfli.cpMin + dcpVanish + pchr->ich,
; bchrCur, ((struct CHRDF *)pchr)->flt,
; hdc, ptT, ptPen.yp+dypPen,
; ptPen.yp, (ich < vfli.ichSpace3 ? &uls
; : NULL), &rcT);
push [vfli.docFli]
; NOTE: We know ah is zero at this point because there are no flags
; in ah
mov al,[si.ichChr-cbCHRDF]
cwd
add ax,[OFF_dcpVanish]
adc dx,[SEG_dcpVanish]
add ax,[vfli.LO_cpMinFli]
adc dx,[vfli.HI_cpMinFli]
push dx
push ax
mov ax,[si.fltChrdf-cbCHRDF]
; The following two C source lines are performed above in the C version,
; and performed here in the assembler version for convenience.
; int bchrCur = (char *)pchr - (char *)*vhgrpchr;
; int bchpCur = (char *)pchp - (char *)*vhgrpchr;
mov bx,[vhgrpchr]
sub si,[bx]
sub di,[bx]
lea bx,[si-cbCHRDF]
push bx
push ax
push [hdc]
; create ptT and push it now
; ptT.xp = ptPen.xp;
; ptT.yp = ptPen.yp + vfli.dypBase -
; vfli.dypLine + dypPen;
errnz <(xpPt) - 0>
errnz <(ypPt) - 2>
mov ax,[ptPen.ypPt]
mov dx,ax
add ax,[vfli.dypBaseFli]
sub ax,[vfli.dypLineFli]
add ax,[dypPen]
push ax
push [ptPen.xpPt]
mov ax,dx
add ax,[dypPen]
push ax
push dx
errnz <NULL>
xor cx,cx
mov al,[vfli.ichSpace3Fli]
cmp bptr ([ich]),al
jae DFC21
lea cx,[uls]
DFC21:
push cx
lea ax,[rcT]
push ax
cCall DisplayField,<>
; pchr = (char *)*vhgrpchr + bchrCur;
; pchp = (char *)*vhgrpchr + bchpCur;
mov bx,[vhgrpchr]
add si,[bx]
add di,[bx]
; dcpVanish += ((struct CHRDF *)pchr)->dcp -1;
mov ax,-1
cwd
add ax,[si.LO_dcpChrdf-cbCHRDF]
adc dx,[si.HI_dcpChrdf-cbCHRDF]
add [OFF_dcpVanish],ax
adc [SEG_dcpVanish],dx
; ptPen.xp = xpNew;
pop ax ;restore xpNew
mov [ptPen.xpPt],ax
pop ax ;restore flags
; (char *) pchr += cbCHRDF;
; }
db 0C3h ;near ret (ret generates far ret opcode here)
; else if (chrm == chrmFormula)
; {
DFC22:
push si ;save pchr
push di ;save pchp
push ax ;save flags
; if (uls.grpfUL)
; {
; uls.xpLim = ptPen.xp;
; EndUL(&uls, &rcwClip);
; }
; DFC57 performs:
; if (uls.grpfUL) { bchrCur = ..., bchpCur = ...;
; uls.xpLim = ptPen.xp; EndUL(&uls, &rcwClip);
; pchr = ..., pchp = ...}
; si = pchr, di = pchp, -> these get properly updated
; bx, cx and dx are altered
;PAUSE
call DFC57
mov ax,[si.fLineChrf-cbCHRF]
; int xpNew, ypNew;
; xpNew = ptPen.xp +
; ((struct CHRF *) pchr)->dxp;
mov di,[si.dxpChrf-cbCHRF]
add di,[ptPen.xpPt]
; ypNew = ptPen.yp +
; ((struct CHRF *) pchr)->dyp;
mov si,[si.dypChrf-cbCHRF]
add si,[ptPen.ypPt]
ifdef NOTUSED
; dxp = ((struct CHRF *) pchr)->dxp;
mov bx,[si.dxpChrf-cbCHRF]
mov [dxp],bx
endif ;NOTUSED
; if (((struct CHRF *) pchr)->fLine)
; {
or ax,ax
je Ltemp001
push di ;save xpNew
push si ;save ypNew
; iLevel = SaveDC(hdc);
mov dx,[hdc]
push dx ;save hdc
ifdef DEBUG
cCall SaveDCFP,<dx>
else ;!DEBUG
ifdef HYBRID
cCall SaveDCPR,<dx>
else ;!HYBRID
cCall SaveDC,<dx>
endif ;!HYBRID
endif ;!DEBUG
pop dx ;restore hdc
; if (vfPrvwDisp)
; {
mov cx,[vfPrvwDisp]
jcxz DFC222
; InflateRect((LPRECT)&rcOpaque,5,5);
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
lea si,[rcOpaque]
mov bx,10
call DFC81
; IntersectClipRect(hdc,
; rcOpaque.xpLeft,
; rcOpaque.ypTop,
; rcOpaque.xpRight,
; rcOpaque.ypBottom);
; DFC69 performs
; IntersectClipRect(hdc, si.xpLeft, si.ypTop, si.xpRight, si.ypBottom);
; bx, cx, dx and si are altered.
push dx ;save hdc
push si ;save &rcOpaque
call DFC69
pop si ;restore &rcOpaque
pop dx ;restore hdc
; InflateRect((LPRECT)&rcOpaque,-5,-5);
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
mov bx,-10
call DFC81
; DrawPrvwLine(hdc, ptPen.xp,
; ptPen.yp, xpNew - ptPen.xp,
; ypNew - ptPen.yp, colText);
pop si ;restore ypNew
push si ;save ypNew
push dx ; hdc argument for RestoreDC
push ax ; iLevel argument for RestoreDC
mov bx,[ptPen.xpPt]
mov cx,[ptPen.ypPt]
push dx
push bx
push cx
sub di,bx
push di
sub si,cx
push si
mov ax,2
push ax
cCall DrawPrvwLine,<>
; }
jmp short DFC228
Ltemp001:
jmp short DFC23
; else
; {
DFC222:
; Assert( vsci.hpen && ilevel );
ifdef DEBUG
; /* Assert( vsci.hpen && iLevel) with a call so as not to mess up
; short jumps */
call DFC66
endif ;/* DEBUG */
push dx ;hdc argument for RestoreDC
push ax ;iLevel argument for RestoreDC
push dx ;hdc argument for DrawFormulaLine
push di ;xpNew argument for DrawFormulaLine
push si ;ypNew argument for DrawFormulaLine
push [ptPen.xpPt] ;xp argument for DrawFormulaLine
push [ptPen.ypPt] ;yp argument for DrawFormulaLine
mov al,[vfli.fPrintFli]
ifdef DEBUG
; /* Assert( vfli.fPrint & 0xFE == 0 ) with a call so as not to mess up
; short jumps */
call DFC85
endif ;/* DEBUG */
or al,8+4+2
push ax ;grpf argument for DrawFormulaLine
;
; IntersectClipRect(hdc, rcOpaque.xpLeft,
; rcOpaque.ypTop, rcOpaque.xpRight,
; rcOpaque.ypBottom);
; DFC69 performs
; IntersectClipRect(hdc, si.xpLeft, si.ypTop, si.xpRight, si.ypBottom);
; bx, cx, dx and si are altered.
lea si,[rcOpaque]
call DFC69
; Assert(!(vfli.fPrint & 0xFE));
; DrawFormulaLine(hdc, xpNew, ypNew,
; ptPen.xp, ptPen.yp,
; vfli.fPrint /* fPrint */
; + 8 /* fCreate */
; + 4 /* fMove */
; + 2 /* fDestroy */);
cCall DrawFormulaLine,<>
; }
DFC228:
; RestoreDC (hdc, iLevel);
ifdef DEBUG
cCall RestoreDCFP,<>
else ;!DEBUG
ifdef HYBRID
cCall RestoreDCPR,<>
else ;!HYBRID
cCall RestoreDC,<>
endif ;!HYBRID
endif ;!DEBUG
; }
pop si ;restore ypNew
pop di ;restore xpNew
DFC23:
; ptPen.xp = xpNew;
; ptPen.yp = ypNew;
; fNoSkip = vfli.fPrint;
mov [ptPen.xpPt],di
mov [ptPen.ypPt],si
pop ax ;restore flags
and al,NOT maskFNoSkipLocal
cmp [vfli.fPrintFli],fFalse
je DFC235
or al,maskFNoSkipLocal
DFC235:
pop di ;restore pchp
pop si ;restore pchr
; (char *) pchr += chrmFormula;
; }
db 0C3h ;near ret (ret generates far ret opcode here)
; else if (chrm == chrmFormatGroup)
; {
DFC24:
; fErased = fTrue;
or al,maskfErasedLocal
; rcOpaque.xpRight = rcwClip.xpRight;
mov bx,[rcwClipXpRightRc]
mov [rcOpaque.xpRightRc],bx
; if (eto & ETO_OPAQUE)
; /* erase the rest of the line */
; {
errnz <ETO_OPAQUE - 2>
test bptr ([eto]),ETO_OPAQUE
je DFC25
; PatBltRc (hdc, &rcErase, vsci.ropErase);
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
or al,maskfUseRcEraseLocal
call DFC56
; SetBkMode (hdc, TRANSPARENT);
; eto &= ~ETO_OPAQUE;
; DFC71 performs:
; SetBkMode(hdc, TRANSPARENT);
; eto &= ~ETO_OPAQUE;
; bx, cx, and dx are altered
call DFC71
; }
DFC25:
; /* note that rcOpaque and rcErase will no
; longer change (rcErase not used) */
; (char *) pchr += chrmFormatGroup;
; }
db 0C3h ;near ret (ret generates far ret opcode here)
; else /*if (chrm == chrmEnd)*/
; {
DFC26:
; goto LEnd;
pop bx ;remove return address to DFC28
jmp LEnd
; This code has been moved from above in the assembler version to
; reduce jumps
; for (;;)
; {
DFC265:
; {
; int chrm;
;/* if is used instead of switch for better space/speed */
; switch is used in the assembler version because it is smaller
; and probably faster
mov cl,[si.chrmChr]
xor ch,ch
add si,cx ;advance pchr now to save code
ifdef DEBUG
; Assert we have one of chrmEnd, chrmTab, chrmVanish, chrmVanish
; chrmFormula, chrmDisplayField, chrmFormatGroup, chrmChp with a
; call so as not to mess up short jumps.
call DFC79
endif ;DEBUG
; Push offset DFC28 because all chrm routines except chrmEnd ret
; to there after they complete
mov bx,offset DFC28
push bx
mov bx,cx
jmp cs:[bx.(offset DFCJumpTable)-2] ;no "zero" chrm so subtract 2
DFC28:
;LDacNop:
;/* calculate the next action and the ich it should take place at or perform
; the action immediately */
;/* see comments at the beginning of the module */
LDacNop:
; ichNext = pchr->ich;
mov cl,[si.ichChr]
; if (ichNext > ich)
; {
mov bx,[ich]
cmp cl,bl
jbe DFC265
mov [pchr],si ;save pchr
push cx ;save ichNext
; int *pdxp;
; int cch;
; int yp = ptPen.yp - vfti.dypAscent;
mov si,[ptPen.ypPt]
sub si,[vfti.dypAscentFti]
mov [ypVar],si
; /* if we got here via LDacNop, pchp is unitialized */
ifdef DEBUG
; /* Assert(fPchpInitialized) with a call so as not to mess up
; short jumps */
call DFC72
endif ;/* DEBUG */
;/* now show the text & update the pen position */
;/* min and max avoid printing chars beyond ichSpace3, like underlined spaces
; however, for display, may need to display visi spaces, para marks, etc */
;
; if (fPrvwPrint && ichNext > vfli.ichSpace3)
; {
; cch = vfli.ichSpace3;
; cchChop = ichNext - vfli.ichSpace3;
; }
; else
; {
; cch = ichNext;
; cchChop = 0;
; }
; cch = max( cch - ich, 0 );
test al,maskfPrvwPrintLocal
jz DFC29
mov dl,cl
sub dl,[vfli.ichSpace3Fli]
sbb dh,dh
jb DFC29
mov cl,[vfli.ichSpace3Fli]
db 03Dh ;turns next "xor dx,dx" into "cmp ax,immediate"
DFC29:
xor dx,dx
mov [cchChop],dx
xor ch,ch ;cch must be a word for the loop instruction below.
sub cx,bx
jge DFC295
xor cx,cx
DFC295:
; pdxp = &vfli.rgdxp [ich];
mov si,bx
lea si,[bx+si.vfli.rgdxpFli]
;/* Optimizations: Skip stuff that is clipped off anyway */
;/* Yes, but italic characters are a real bummer! */
; while ((ptPen.xp + *pdxp + vfti.dxpOverhang <= rcwClip.xpLeft) && cch)
; {
mov dx,[ptPen.xpPt]
push ax ;save flags
push si ;save pdxpFirst = pdxp;
jcxz DFC31
;PAUSE
mov bx,[rcwClipXpLeftRc]
mov ax,[vfti.dxpOverhangFti]
sub bx, ax
DFC30:
; cch--;
; ptPen.xp += *(pdxp++);
; ich++;
; }
lodsw
add dx,ax
cmp dx,bx
jg DFC305
loop DFC30
jmp short DFC31
DFC305:
sub dx,ax
dec si
dec si
DFC31:
pop ax ;restore pdxpFirst
sub ax,si
neg ax
shr ax,1
add [ich],ax ;ich += (pdxp - pdxpFirst) >> 1;
pop ax ;restore flags
mov [ptPen.xpPt],dx
; if (!cch)
; continue;
or cx,cx
jnz Ltemp018
;PAUSE
pop cx ;remove ichNext
mov si,[pchr] ;restore pchr
jmp DFC265
Ltemp018:
; if (!fNoSkip && ptPen.xp >= rcwClip.xpRight)
; /* Already past clip region; save some work */
; goto LEnd;
test al,maskFNoSkipLocal
jne DFC32
cmp dx,[rcwClipXpRightRc]
jl DFC32
pop cx ;restore ichNext
jmp LEnd
DFC32:
; /* Deal with special chars */
; if (pchp->fSpec)
; {
test [di.fSpecChp],maskFSpecChp
jne Ltemp010
jmp DFC37
Ltemp010:
; int xpNew = ptPen.xp + *pdxp;
; struct RC rcT;
; int nSaveDC = 0;
; int bchrCur;
; int bchpCur;
; Assembler note: we do this chSpec assignment when we use it.
; CHAR chSpec = vfli.rgch [ich];
; if (chSpec == chPic)
; if (uls.grpfUL)
; {
; uls.xpLim = ptPen.xp;
; EndUL(&uls, &rcwClip);
; }
mov bx,[ich]
cmp bptr ([bx.vfli.rgchFli]),chPicture
push dx ;save ptPen.xp
jnz DFC325
; DFC57 performs:
; if (uls.grpfUL) { bchrCur = ..., bchpCur = ...;
; uls.xpLim = ptPen.xp; EndUL(&uls, &rcwClip);
; pchr = ..., pchp = ...}
; si = pchr, di = pchp, -> these get properly updated
; bx, cx and dx are altered
;PAUSE
; native note: put pchr in si, so it gets updated
; AND save pdxp in [pchr]
xchg si,[pchr]
call DFC57
; native note: put things back where they belong...
xchg si,[pchr]
DFC325:
pop bx ;restore ptPen.xp
add bx,[si] ;xpNew = ptPen.xp + *pdxp
; Assert(vfli.rgch [ich] != chDisplayField);
ifdef DEBUG
; /* Assert(vfli.rgch [ich] != chDisplayField) with a call so
; as not to mess up short jumps */
call DFC74
endif ;/* DEBUG */
; if (!fErased && !fPrvwPrint)
; { /* because ShowSpec is using TextOut,
; we have to erase the background */
test al,maskfErasedLocal+maskfPrvwPrintLocal
jne DFC33
; blt( &rcErase, &rcT, cwRC );
; rcT.xpRight = min(xpNew, rcwClip.xpRight);
or al,maskfUseRcEraseLocal
push bx ;save xpNew
cmp bx,[rcwClipXpRightRc]
jl DFC327
mov bx,[rcwClipXpRightRc]
DFC327:
; DFC54 performs:
; blt(fUseRcErase ? &rcErase : &rcOpaque, &rcT, cwRC );
; rcT.xpRight = bx;
; no registers are altered
call DFC54
pop bx ;restore xpNew
; if (!fPrvwPrint)
; PatBltRc( hdc, &rcT, vsci.ropErase );
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
test al,maskfPrvwPrintLocal
jne DFC328
and al,NOT maskfUseRcEraseLocal
call DFC56
DFC328:
; rcErase.xpLeft = rcOpaque.xpLeft = xpNew;
mov [rcErase.xpLeftRc],bx
mov [rcOpaque.xpLeftRc],bx
; }
DFC33:
push ax ;save flags
xchg ax,cx
; vfmtss.cpRef = vfli.cpMin + dcpVanish + ich;
mov ax,[ich]
cwd
add ax,[OFF_dcpVanish]
adc dx,[SEG_dcpVanish]
add ax,[vfli.LO_cpMinFli]
adc dx,[vfli.HI_cpMinFli]
mov [vfmtss.LO_cpRefFmtss],ax
mov [vfmtss.HI_cpRefFmtss],dx
push bx ;save xpNew
; int nSaveDC = 0;
xor ax,ax
; if (ww != wwNil)
; {
cmp [ww],wwNil
je DFC34
; nSaveDC = SaveDCN(hdc);
ifdef DEBUG
cCall SaveDCFP,<[hdc]>
else ;!DEBUG
ifdef HYBRID
cCall SaveDCPR,<[hdc]>
else ;!HYBRID
cCall SaveDC,<[hdc]>
endif ;!HYBRID
endif ;DEBUG
; if (vfPrvwDisp)
; InflateRect((LPRECT)&rcwClip,5);
; IntersectClipRect(hdc, rcwClip.xpLeft,
; rcwClip.ypTop, rcwClip.xpRight,
; rcwClip.ypBottom);
; if (vfPrvwDisp)
; InflateRect((LPRECT)&rcwClip,-5);
lea si,[rcwClipXpLeftRc]
mov cx,[vfPrvwDisp]
jcxz DFC333
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
mov bx,10
call DFC81
DFC333:
; DFC69 performs
; IntersectClipRect(hdc, si.xpLeft, si.ypTop, si.xpRight, si.ypBottom);
; bx, cx, dx and si are altered.
push si ;save prc
push cx ;save vfPrvwDisp
call DFC69
pop cx ;restore vfPrvwDisp
pop si ;restore prc
jcxz DFC337
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
mov bx,-10
call DFC81
DFC337:
; }
DFC34:
xchg ax,si ;save nSaveDC
; bchrCur = (char *) pchr - (char *)*vhgrpchr;
; bchpCur = (char *) pchp - (char *)*vhgrpchr;
; ShowSpec(ww, ich, &ptPen, yp, pchp, &uls);
; (char *) pchr = (char *)*vhgrpchr + bchrCur;
; (char *) pchp = (char *)*vhgrpchr + bchpCur;
push [ww]
push [ich]
lea ax,[ptPen]
push ax
push [ypVar]
push di
lea ax,[uls]
push ax
;DFC82 converts di and [pchr] from pointers to offsets into
;*vhgrpchr. Upon return bx is -pchr. Only bx is altered.
call DFC82
cCall ShowSpec,<>
;DFC83 converts di and [pchr] to pointers from offsets into
;*vhgrpchr. Upon return bx is pchr. Only bx is altered.
call DFC83
pop cx ;restore xpNew
push cx ;save xpNew
; if (vfli.grpfvisi.fvisiShowAll &&
; (chSpec == chFootnote || chSpec == chTFtn || chSpec == chTFtnCont))
; {
errnz <maskfvisiShowAllGrpfvisi - 00020h>
test bptr ([vfli.grpfvisiFli]),maskfvisiShowAllGrpfvisi
je DFC35
mov bx,[ich]
mov al,bptr ([bx.vfli.rgchFli])
cmp al,chFootNote
je DFC345
cmp al,chTFtn
je DFC345
cmp al,chTFtnCont
jne DFC35
DFC345:
; struct RC rcBox;
; rcBox.xpLeft = ptPen.xp;
; rcBox.xpRight = xpNew - 1;
; rcBox.ypTop = yp + 1;
; rcBox.ypBottom = ptPenT.yp;
; /*yp = rcBox.ypTop - vfti.dypAscent */
; DrawDottedLineBox(hdc, rcBox);
push [hdc]
errnz <(xpLeftRc)-0>
errnz <(ypTopRc)-2>
errnz <(xpRightRc)-4>
errnz <(ypBottomRc)-6>
push [ptPenT.ypPt]
dec cx
push cx
mov bx,[ypVar]
inc bx
push bx
push [ptPen.xpPt]
cCall DrawDottedLineBox,<>
; }
DFC35:
; if (nSaveDC != 0)
; {
or si,si
je DFC36
; RestoreDC(hdc, nSaveDC);
; nSaveDC = 0;
push [hdc]
push si
ifdef DEBUG
cCall RestoreDCFP,<>
else ;!DEBUG
ifdef HYBRID
cCall RestoreDCPR,<>
else ;!HYBRID
cCall RestoreDC,<>
endif ;!HYBRID
endif ;DEBUG
; }
DFC36:
; ich++;
inc [ich]
; ptPen.xp = xpNew;
pop ax ;restore xpNew
mov [ptPen.xpPt],ax
pop ax ;restore flags
; continue;
Ltemp009:
jmp DFC48
; }
DFC37:
; NOTE: we already know at this point that cch > 0.
; if (cch > 0)
; {
; int xp = ptPen.xp;
; int cchT = cch + cchChop;
; while (cchT--)
; ptPen.xp += *pdxp++;
mov [xpVar],dx
push ax ;save flags
push cx ;save cch
add cx,[cchChop]
DFC38:
lodsw
add dx,ax
loop DFC38
mov [ptPen.xpPt],dx
pop cx ;restore cch
pop ax ;restore flags
;#ifdef DFONT
; if (vfDbgRTFlag)
; {
; HFONT hfontT;
; SelectObject (hdc, (hfontT =
; SelectObject (hdc, GetStockObject
; (SYSTEM_FONT))));
; CommSzNum ("Font = ", hfontT);
; }
;#endif /* DFONT */
ifdef DFONT
; Do this DFONT stuff with a call so
; as not to mess up short jumps */
call DFC76
endif ;/* DFONT */
;/* following test prevents inefficient extra call to put out trailing
; space at end of line */
; if (ich < vfli.ichMac-1 || vfli.rgch [ich] != chSpace)
; {
mov dl,[vfli.ichMacFli]
dec dx
mov bx,[ich]
cmp bl,dl
jb DFC39
cmp [bx.vfli.rgchFli],chSpace
je Ltemp009
DFC39:
; int far *lpdxp;
;/* use array-of-widths if:
; (1) user-defined character spacing is in effect (pchp->qpsSpace)
; OR (2) justification is on
; OR (3) visi spaces and space width != visi space char width
; OR (4) displaying for preview */
; if (pchp->qpsSpace
; || vfli.ichSpace2 != ichNil
; || vfli.fAdjustForVisi
; || vfPrvwDisp)
; lpdxp = (int far *)&vfli.rgdxp [ich];
; else
; lpdxp = (int far *)(DWORD) NULL;
shl bx,1
lea si,[bx.vfli.rgdxpFli]
mov dx,ds
test bptr ([di.qpsSpaceChp]),maskQpsSpaceChp
jne DFC40
cmp [vfli.ichSpace2Fli],ichNil
jne DFC40
cmp [vfli.fAdjustForVisiFli],fFalse
jne DFC40
cmp [vfPrvwDisp],fFalse
jne DFC40
errnz <NULL>
xor si,si
mov dx,si
DFC40:
push di ;save pchp
; if (!fErased && !fPrvwPrint)
; {
test al,maskfErasedLocal+maskfPrvwPrintLocal
jne DFC42
;/* blank to the end of rcwClip if this is the last run of visible chars, for
; efficiency, to avoid an extra PatBlt */
; rcErase.xpLeft =
; rcOpaque.xpRight =
; (ptPen.xp >= vfli.xpRight ||
; ptPen.xp >= rcwClip.xpRight) ?
; rcwClip.xpRight : ptPen.xp;
mov di,[ptPen.xpPt]
mov bx,[rcwClipXpRightRc]
cmp di,bx
jge DFC41
cmp di,[vfli.xpRightFli]
jge DFC41
mov bx,di
DFC41:
mov [rcOpaque.xpRightRc],bx
mov [rcErase.xpLeftRc],bx
; }
DFC42:
; /* if there are any borders, don't opaque them,
; to avoid flashing; instead we need to wipe
; out any space outside the borders that's
; in the EDL */
; fRcAdjusted = fFalse;
; if (!fPrvwPrint &&
; (vfli.fTop || vfli.fLeft || vfli.fBottom || vfli.fRight))
; {
; fRcAdjusted = fTrue;
; AdjustOpaqueRect(&rcOpaque, &rcAdjusted, hdc, dxpToXw);
; }
and al,NOT maskfRcAdjustedLocal
test al,maskfPrvwPrintLocal
jne DFC43
errnz <(fLeftFli) - (fTopFli)>
errnz <(fBottomFli) - (fTopFli)>
errnz <(fRIghtFli) - (fTopFli)>
test [vfli.fTopFli],maskFTopFli+maskFLeftFli+maskFBottomFli+maskFRightFli
je DFC43
or al,maskfRcAdjustedLocal
push ax ;save flags
push cx ;save cch
push dx ;save hi lpdxp
lea ax,[rcOpaque]
push ax
lea ax,[rcAdjusted]
push ax
push [hdc]
push [dxpToXw]
push [ywLine]
cCall AdjustOpaqueRect,<>
pop dx ;restore hi lpdxp
pop cx ;restore cch
pop ax ;restore flags
DFC43:
; /* FUTURE - The only reason for protecting pchr and pchp from heap
; movement here is that the "Cannot print" dialog may be brought
; up under ExtTextOut. If that dialog becomes system modal
; and does not move the heap, we can remove this junk.
; <NAME> (4-13-89).
; */
; bchrCur = (char *) pchr - (char *)*vhgrpchr;
; bchpCur = (char *) pchp - (char *)*vhgrpchr;
; /* protection around the ExtTextOut calls */
; vrf.fInExternalCall = fTrue;
or [vrf.fInExternalCallRf],maskFInExternalCallRf
pop di ;restore pchp
;DFC82 converts di and [pchr] from pointers to offsets into
;*vhgrpchr. Upon return bx is -pchr. Only bx is altered.
call DFC82
push ax ;save flags
; native note: push some arguments for ExtTextOut or ExtTextOutKludge
; or PrintUlLine here, while things are handy in the registers.
;PAUSE
test al,maskfRcAdjustedLocal
stc
DFC46:
push [hdc]
push [xpVar]
push [ypVar]
push [eto]
lea bx,[rcOpaque]
je DFC465
lea bx,[rcAdjusted]
DFC465:
push ds
push bx ; lprc
jnc DFC467
mov bx,[ich]
add bx,dataoffset [vfli.rgchFli]
push ds
push bx ; lprgch
push cx ; cch
push dx
push si ; lpdxp
; /* Now we have underlining fun for printing */
; if (vfli.fPrint && lpdxp &&
; (vfti.fcid.kul || vfti.fcid.fStrike))
; {
;PAUSE
cmp [vfli.fPrintFli],0
je DFC47
mov bx,si
or bx,dx
je DFC47
;PAUSE
errnz <kulFcid-fStrikeFcid>
mov bl,[vfti.fcidFti.kulFcid]
and bl,maskKulFcid+maskFStrikeFcid
je DFC47
;PAUSE
; PrintUlLine(hdc, xp, yp,
; eto, /* action bits */
; fRcAdjusted ? (LPRECT) &rcAdjusted :
; (LPRECT) &rcOpaque, /* opaque rect */
; lpdxp,
; cch);
test al,maskfRcAdjustedLocal
jmp short DFC46 ; pushes hdc through lprc
DFC467:
push dx
push si ; lpdxp
push cx ; cch
cCall PrintUlLine,<>
; }
DFC47:
; if (vwWinVersion < 0x300 && !vfli.fPrint && lpdxp && pchp->fItalic)
; {
;PAUSE
cmp [vwWinVersion],0300h
jge LRealExtTextOut
cmp [vfli.fPrintFli],0
jnz LRealExtTextOut
mov ax,si
or ax,dx
jz LRealExtTextOut
mov bx,[vhgrpchr]
mov bx,[bx]
test [bx.di.fItalicChp],maskFItalicChp
jz LRealExtTextOut
; struct FFN *pffn;
;
; pffn = PstFromSttb(vhsttbFont, vfti.fcid.ibstFont);
; if (pffn->fRaster)
; goto LRealExtTextOut;
;PAUSE
push [vhsttbFont]
xor ax,ax
mov al,[vfti.fcidFti.ibstFontFcid]
push ax
cCall PstFromSttb,<>
xchg ax,bx
test [bx.fRasterFfn],maskFRasterFfn
jnz LRealExtTextOut
; ExtTextOutKludge(hdc, xp, yp,
; eto, /* action bits */
; fRcAdjusted ? (LPRECT)&rcAdjusted :
; (LPRECT)&rcOpaque, /* opaque rect */
; (LPCH)&vfli.rgch [ich], /* string */
; cch, /* length */
; lpdxp ); /* lpdx */
;PAUSE
; native note: arguments pushed above
cCall ExtTextOutKludge,<>
jmp short DFC475
; }
; else
; {
LRealExtTextOut:
; ExtTextOut(hdc, xp, yp,
; eto, /* action bits */
; fRcAdjusted ? (LPRECT)&rcAdjusted :
; (LPRECT)&rcOpaque, /* opaque rect */
; (LPCH)&vfli.rgch [ich], /* string */
; cch, /* length */
; lpdxp ); /* lpdx */
; }
; native note: arguments pushed above
ifdef DEBUG
cCall ExtTextOutFP,<>
else ;!DEBUG
ifdef HYBRID
cCall ExtTextOutPR,<>
else ;!HYBRID
cCall ExtTextOut,<>
endif ;!HYBRID
endif ;DEBUG
DFC475:
pop ax ;restore flags
; vrf.fInExternalCall = fFalse;
; (char *) pchr = (char *)*vhgrpchr + bchrCur;
; (char *) pchp = (char *)*vhgrpchr + bchpCur;
and [vrf.fInExternalCallRf], NOT maskFInExternalCallRf
;DFC83 converts di and [pchr] to pointers from offsets into
;*vhgrpchr. Upon return bx is pchr. Only bx is altered.
call DFC83
; if (!fErased && !fPrvwPrint)
test al,maskfErasedLocal+maskfPrvwPrintLocal
jne DFC48
; rcOpaque.xpLeft = ptPen.xp;
mov bx,[ptPen.xpPt]
mov [rcOpaque.xpLeftRc],bx
; }
; }
;
; ich = ichNext;
; }
DFC48:
pop cx ;restore ichNext
mov si,[pchr] ;restore pchr
mov bptr ([ich]),cl
; }
jmp DFC265
;LEnd:
; if (uls.grpfUL)
; EndULPast( &uls, ptPen.xp, ich ,&rcwClip);
LEnd:
push ax ;save flags
; LN_EndULPast performs:
; if (uls.grpfUL) EndULPast(&uls,ptPen.xp,ich,&rcwClip);
; ax, bx, cx and dx are altered
call LN_EndULPast
;/* erase portion of the line not erased within ExtTextOut blanking box */
; if (!fPrvwPrint)
; SetBkMode( hdc, OPAQUE ); /* restore output mode */
pop ax
push ax
test al,maskfPrvwPrintLocal
jne DFC50
mov ax,OPAQUE
cCall SetBkMode,<[hdc],ax>
DFC50:
pop ax ;restore flags
; if (!fPrvwPrint && !fErased && rcErase.xpLeft < rcErase.xpRight)
; PatBltRc( hdc, &rcErase, vsci.ropErase );
test al,maskfPrvwPrintLocal+maskfErasedLocal
jne DFC51
mov bx,[rcErase.xpLeftRc]
cmp bx,[rcErase.xpRIghtRc]
jge DFC51
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
or al,maskfUseRcEraseLocal
call DFC56
DFC51:
; ForeColor(hdc, icoAuto);
errnz <icoAuto - 0>
xor ax,ax
cCall ForeColor,<[hdc],ax>
; /* return if no para border OR
; printing and not the pass for drawing borders...
; */
; if (vfli.grpfBrc == 0)
; return;
DFC52:
cmp [vfli.grpfBrcFli],0
je DFC53
; if (vfli.fPrint)
; {
cmp [vfli.fPrintFli],fFalse
je DFC525
; if (vpri.fDPR) /* can only use DRAWPATTERNRECT in fText pass */
; {
; if (!vpri.fText)
; return;
; }
; else
; {
; if (!vpri.fGraphics)
; return;
; }
; }
mov al,maskfTextPri
cmp [vpri.fDPRPri],fFalse
jne DFC523
mov al,maskfGraphicsPri
DFC523:
errnz <(fTextPri) - (fGraphicsPri)>
test [vpri.fTextPri],al
je DFC53
DFC525:
;/* handle drawing of borders */
; if (
; /* Borders */
; (vfli.fTop || vfli.fLeft || vfli.fBottom || vfli.fRight)
; &&
; (ilevel = SaveDC( hdc )))
; {
errnz <(fLeftFli) - (fTopFli)>
errnz <(fBottomFli) - (fTopFli)>
errnz <(fRIghtFli) - (fTopFli)>
test [vfli.fTopFli],maskFTopFli+maskFLeftFli+maskFBottomFli+maskFRightFli
je DFC53
ifdef DEBUG
cCall SaveDCFP,<[hdc]>
else ;!DEBUG
ifdef HYBRID
cCall SaveDCPR,<[hdc]>
else ;!HYBRID
cCall SaveDC,<[hdc]>
endif ;!HYBRID
endif ;DEBUG
or ax,ax
je DFC53
push [hdc] ;hdc argument for RestoreDC
push ax ;ilevel argument for RestoreDC
; if (vfPrvwDisp)
; InflateRect((LPRECT) rcwClip, 4, 4);
; Assemble Note: coded inline because we're gods
lea si, [rcwClipXpLeftRc]
cmp [vfPrvwDisp],fFalse
je DFC527
mov bx,10
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
call DFC81
DFC527:
; IntersectClipRect( hdc, rcwClip.xpLeft, rcwClip.ypTop,
; rcwClip.xpRight, rcwClip.ypBottom );
; DFC69 performs
; IntersectClipRect(hdc, si.xpLeft, si.ypTop, si.xpRight, si.ypBottom);
; bx, cx, dx and si are altered.
call DFC69
; DrawBorders(dxpToXw, ywLine);
cCall DrawBorders,<[dxpToXw],[ywLine]>
; RestoreDC( hdc, ilevel );
ifdef DEBUG
cCall RestoreDCFP,<>
else ;!DEBUG
ifdef HYBRID
cCall RestoreDCPR,<>
else ;!HYBRID
cCall RestoreDC,<>
endif ;!HYBRID
endif ;DEBUG
; }
DFC53:
; return;
;}
cEnd
; DFC54 performs:
; blt(fUseRcErase ? &rcErase : &rcOpaque, &rcT, cwRC );
; rcT.xpRight = bx;
; no registers are altered
DFC54:
push ds
pop es
push si
push di
lea si,[rcErase]
test al,maskfUseRcEraseLocal
jne DFC55
lea si,[rcOpaque]
DFC55:
lea di,[rcT]
movsw
movsw
movsw
movsw
mov [di.xpRightRc-cbRcMin],bx
pop di
pop si
ret
; DFC56 performs:
; PatBltRc( hdc, fUseRcErase ? &rcErase : &rcT,
; vsci.ropErase );
; no registers are altered
DFC56:
push ax
push bx
push cx
push dx
push [hdc]
lea bx,[rcT]
test al,maskfUseRcEraseLocal
je DFC565
lea bx,[rcErase]
DFC565:
push bx
mov bx,[vpdcibDisplayFli]
push [vsci.HI_ropEraseSci]
push [vsci.LO_ropEraseSci]
cCall PatBltRc,<>
pop dx
pop cx
pop bx
pop ax
ret
; DFC57 performs:
; if (uls.grpfUL)
; {
; bchrCur = (char*)pchr - (char*)*vhgrpchr;
; bchpCur = (char*)pchp - (char*)*vhgrpchr;
; uls.xpLim = ptPen.xp;
; EndUL(&uls, &rcwClip);
; pchr = (char*)*vhgrpchr + bchrCur;
; pchp = (char*)*vhgrpchr + bchpCur;
; }
; bx, cx and dx are altered
DFC57:
cmp [uls.grpfULUls],fFalse
je DFC58
;PAUSE
push ax
mov bx,[vhgrpchr]
sub si,[bx]
sub di,[bx]
mov ax,[ptPen.xpPt]
mov [uls.xpLimUls],ax
lea ax,[uls]
lea bx,[rcwClipXpLeftRc]
cCall EndUL,<ax,bx>
mov bx,[vhgrpchr]
add si,[bx]
add di,[bx]
pop ax
DFC58:
ret
; Assert (vfli.rgch [ich] == chDisplayField);
; Assert (vfli.rgdxp [ich] ==
; ((struct CHRDF *)pchr)->dxp);
; Assert (ich == pchr->ich);
ifdef DEBUG
DFC59:
push ax
push bx
push cx
push dx
mov bx,[ich]
cmp [bx.vfli.rgchFli],chDisplayField
je DFC60
mov ax,midDisp1n
mov bx,1004
cCall AssertProcForNative,<ax,bx>
DFC60:
mov bx,[ich]
shl bx,1
mov ax,[bx.vfli.rgdxpFli]
cmp ax,[si.dxpChrdf-cbCHRDF]
je DFC61
mov ax,midDisp1n
mov bx,1005
cCall AssertProcForNative,<ax,bx>
DFC61:
mov al,bptr ([ich])
cmp al,[si.ichChrdf-cbCHRDF]
je DFC62
mov ax,midDisp1n
mov bx,1006
cCall AssertProcForNative,<ax,bx>
DFC62:
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DEBUG */
;#ifdef SHOWFLD
; CommSzLong ("Displaying CHRDF: ",
; vfli.cpMin + dcpVanish + pchr->ich);
;#endif /* SHOWFLD */
ifdef SHOWFLD
DFC63:
push ax
push bx
push cx
push dx
push si
push di
xor ax,ax
mov al,[si.ichChr]
cwd
add ax,[vfli.LO_cpMinFli]
adc dx,[vfli.HI_cpMinFli]
add ax,[OFF_dcpVanish]
adc dx,[SEG_dcpVanish]
jmp short DFC65
DFC64:
db 'Displaying CHRDF: '
db 0
DFC65:
push ds
push cs
pop ds
mov si,DFC64
push ss
pop es
mov di,[szFrame]
mov cx,(DFC65) - (DFC64)
rep movsb
pop ds
lea bx,[szFrame]
cCall CommSzLong,<bx, dx, ax>
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* SHOWFLD */
; Assert( vsci.hpen && iLevel);
ifdef DEBUG
DFC66:
cmp [vsci.hpenSci],fFalse
je DFC67
cmp ax,fFalse
jne DFC68
DFC67:
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1007
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC68:
ret
endif ;/* DEBUG */
; DFC69 performs
; IntersectClipRect(hdc, si.xpLeft, si.ypTop, si.xpRight, si.ypBottom);
; bx, cx, dx and si are altered.
DFC69:
push ax
push [hdc]
errnz <(xpLeftRc)-0>
errnz <(ypTopRc)-2>
errnz <(xpRightRc)-4>
errnz <(ypBottomRc)-6>
mov cx,4
DFC70:
lodsw
push ax ;rc argument for IntersectClipRect
loop DFC70
ifdef DEBUG
cCall IntersectClipRectFP,<>
else
cCall IntersectClipRect,<>
endif ;/* DEBUG */
pop ax
ret
; DFC71 performs:
; SetBkMode(hdc, TRANSPARENT);
; eto &= ~ETO_OPAQUE;
; bx, cx, and dx are altered
DFC71:
push ax ;save flags
mov ax,TRANSPARENT
cCall SetBkMode,<[hdc],ax>
errnz <ETO_OPAQUE - 2>
and bptr ([eto]),NOT ETO_OPAQUE
pop ax ;restore flags
ret
; Assert(fPchpInitialized);
ifdef DEBUG
DFC72:
cmp [fPchpInitialized],fFalse
jne DFC73
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1008
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC73:
ret
endif ;/* DEBUG */
; Assert(vfli.rgch [ich] != chDisplayField);
ifdef DEBUG
DFC74:
push ax
push bx
push cx
push dx
mov bx,[ich]
cmp [bx.vfli.rgchFli],chDisplayField
jne DFC75
mov ax,midDisp1n
mov bx,1009
cCall AssertProcForNative,<ax,bx>
DFC75:
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DEBUG */
;#ifdef DFONT
; if (vfDbgRTFlag)
; {
; HFONT hfontT;
; SelectObject (hdc, (hfontT =
; SelectObject (hdc, GetStockObject
; (SYSTEM_FONT))));
; CommSzNum ("Font = ", hfontT);
; }
;#endif /* DFONT */
ifdef DFONT
DFC76:
push ax
push bx
push cx
push dx
push si
push di
mov ax,SYSTEM_FONT
cCall GetStockObject,<ax>
ifdef DEBUG
cCall SelectObjectFP,<hdc,ax>
else ;!DEBUG
ifdef HYBRID
cCall SelectObjectPR,<hdc,ax>
else ;!HYBRID
cCall SelectObject,<hdc,ax>
endif ;!HYBRID
endif ;DEBUG
push ax ;save hfontT
ifdef DEBUG
cCall SelectObjectFP,<hdc,ax>
else ;!DEBUG
ifdef HYBRID
cCall SelectObjectPR,<hdc,ax>
else ;!HYBRID
cCall SelectObject,<hdc,ax>
endif ;!HYBRID
endif ;DEBUG
pop ax ;restore hfontT
jmp short DFC78
DFC77:
db 'Font = '
db 0
DFC78:
push ds
push cs
pop ds
mov si,DFC77
push ss
pop es
mov di,[szFrame]
mov cx,(DFC78) - (DFC77)
rep movsb
pop ds
lea bx,[szFrame]
cCall CommSzNum,<bx, ax>
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DFONT */
; Assert we have one of chrmEnd, chrmTab, chrmVanish, chrmVanish
; chrmFormula, chrmDisplayField, chrmFormatGroup, chrmChp.
ifdef DEBUG
DFC79:
cmp cl,chrmEnd
je DFC80
cmp cl,chrmTab
je DFC80
cmp cl,chrmVanish
je DFC80
cmp cl,chrmFormula
je DFC80
cmp cl,chrmDisplayField
je DFC80
cmp cl,chrmFormatGroup
je DFC80
cmp cl,chrmChp
je DFC80
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1017
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC80:
ret
endif ;/* DEBUG */
; DFC81 performs
; InflateRect(si,bx)
; assumes prc in si, offset in bx, no registers are altered.
DFC81:
add [si.xpRightRc],bx
add [si.ypBottomRc],bx
sub [si.xpLeftRc],bx
sub [si.ypTopRc],bx
ret
;DFC82 converts di and [pchr] from pointers to offsets into
;*vhgrpchr. Upon return bx is -pchr. Only bx is altered.
DFC82:
db 0A8h ;turns next "stc" into "test al,immediate"
;also clears the carry flag
;DFC83 converts di and [pchr] to pointers from offsets into
;*vhgrpchr. Upon return bx is pchr. Only bx is altered.
DFC83:
stc
mov bx,[vhgrpchr]
mov bx,[bx]
jc DFC84
neg bx
DFC84:
add di,bx
add [pchr],bx
ret
ifdef DEBUG
; Assert( vfli.fPrint & 0xFE == 0 );
DFC85:
test al,0FEh
je DFC86
push ax
push bx
push cx
push dx
mov ax,midDisp1n
mov bx,1030
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
DFC86:
ret
endif ;/* DEBUG */
; LN_EndULPast performs:
; if (uls.grpfUL) EndULPast(&uls,ptPen.xp,ich,&rcwClip);
; ax, bx, cx and dx are altered
LN_EndULPast:
cmp [uls.grpfULUls],fFalse
je EULP04
;/* E n d U L P a s t */
;/* Terminate underline; limit underline to not past vfli.ichSpace3
; given current ich and corresponding xp */
;
;NATIVE EndULPast(puls, xpLim, ichLim, prcwClip)
;struct ULS *puls;
;int xpLim, ichLim;
;struct RC *prcwClip;
;{
; while (--ichLim >= (int)vfli.ichSpace3)
; xpLim -= vfli.rgdxp [ichLim];
push si
mov cx,[ich]
mov si,cx
mov al,[vfli.ichSpace3Fli]
xor ah,ah
mov dx,[ptPen.xpPt]
sub cx,ax
jle EULP02
shl si,1
add si,dataoffset [vfli.rgdxpFli - 2]
std
EULP01:
lodsw
sub dx,ax
loop EULP01
cld
EULP02:
; if ((puls->xpLim = xpLim) > puls->pt.xp)
; EndUL(puls, prcwClip);
;}
mov [uls.xpLimUls],dx
cmp dx,[uls.ptUls.xpPt]
jle EULP03
lea ax,[uls]
lea bx,[rcwClipXpLeftRc]
cCall EndUL,<ax,bx>
EULP03:
pop si
EULP04:
ret
ifdef DEBUG
LN_FreezeHp:
;#define FreezeHp() (cHpFreeze++?0:LockHeap(sbDds))
cmp [cHpFreeze],0
jne LN_FH01
push ax
push bx
push cx
push dx
mov ax,sbDds
cCall LockHeap,<ax>
pop dx
pop cx
pop bx
pop ax
LN_FH01:
inc [cHpFreeze]
ret
endif ;DEBUG
ifdef DEBUG
LN_MeltHp:
;#define MeltHp() (--cHpFreeze?0:UnlockHeap(sbDds))
dec [cHpFreeze]
jne LN_MH01
push ax
push bx
push cx
push dx
mov ax,sbDds
cCall UnlockHeap,<ax>
pop dx
pop cx
pop bx
pop ax
LN_MH01:
ret
endif ;DEBUG
sEnd disp1_PCODE
end
|
programs/oeis/234/A234253.asm | neoneye/loda | 22 | 167498 | <reponame>neoneye/loda<gh_stars>10-100
; A234253: a(n) = sum_{i=1..n} C(7+i,8)^2.
; 1,82,2107,29332,274357,1930726,10948735,52357960,217994860,808970960,2723733524,8436372248,24304813148,65712993248,167965846148,408373664744,949291256585,2119095737210,4559798912835,9488531918460,19148848609485,37571357310510,71828088366135,134060070491760,244694705381760,437464493214096,767112236903712,1321047059976112,2236735236891712,3727314445212112,6118865975006176,9904037542973680,15818368117922905,24947835240502930,38878959811637155,59906428654108324,91317832727429453,137781012602137478,205866946545961703,304750462707636728,447142725980448764,650523941993549120,938762626819371620,1344229808664674120,1910543475870096620,2696111422131840720,3778680482292164820,5261148298944487320,7278951716054592945,10009415398766268570,13683527330223099291,18600706735606116492,25147247364074630517,33819257929589525742,45251085300590642767,60250398634641364576,79841338499523940000,105317399111751973600,138306019809393268000,180847220128758901600,235489028538966315424,305402936047968599008,394523161540713445408,507714155924418855008,650971508191296014033,831662260908500364434,1058811609365665429355,1343444063157501804980,1698988408551456585605,2141757243636681936230,2691513487036378065455,3372138108154708464680,4212415418177338587180,5246954624606026189680,6517269019059367212180,8073037172550756777336,9973573891912814390172,12289542486514073667072,15104944150825532183172,18519425034846270768072,22650946904511364455801,27638873246474054152570,33647529309813998611795,40870301970652738641820,49534353529799435866045,59906032690361343726574,72297076100681113582663,87071705084448575988688,104654734618849522984288,125540825376225928776688,150305024837194200533504,179614760245592948449040,214243464650600920939040,255086037622677036949040,303176364603378701839040,359707143433103240655440,426052293587432734127465,503792253248553221483090,594742501765041121933715,700985680549376391014340
lpb $0
mov $2,$0
sub $0,1
seq $2,581 ; a(n) = binomial coefficient C(n,8).
pow $2,2
add $1,$2
lpe
add $1,1
mov $0,$1
|
Transynther/x86/_processed/AVXALIGN/_ht_/i3-7100_9_0x84_notsx.log_16615_2425.asm | ljhsiun2/medusa | 9 | 16604 | <filename>Transynther/x86/_processed/AVXALIGN/_ht_/i3-7100_9_0x84_notsx.log_16615_2425.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xfe95, %rsi
lea addresses_WC_ht+0xed95, %rdi
nop
cmp %r15, %r15
mov $13, %rcx
rep movsw
nop
nop
nop
nop
add $18482, %rax
lea addresses_UC_ht+0x7f5f, %r11
nop
nop
sub %rsi, %rsi
mov (%r11), %r15
nop
nop
inc %r11
lea addresses_WT_ht+0xf51f, %rsi
lea addresses_normal_ht+0x4295, %rdi
nop
nop
nop
nop
inc %r12
mov $97, %rcx
rep movsl
nop
nop
add $16298, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %rax
push %rbp
push %rcx
push %rdx
// Faulty Load
mov $0xa95, %rax
nop
cmp %rdx, %rdx
vmovntdqa (%rax), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbp
lea oracles, %r15
and $0xff, %rbp
shlq $12, %rbp
mov (%r15,%rbp,1), %rbp
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_P', 'same': True, 'size': 32, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'49': 16615}
49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49
*/
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_lsub_callee.asm | ahjelm/z88dk | 640 | 5396 |
; long __lsub_callee (long left, long right)
SECTION code_clib
SECTION code_fp_am9511
PUBLIC _am9511_lsub_callee
PUBLIC cam32_sdcc_lsub_callee
EXTERN cam32_sdcc_readr_callee, asm_am9511_lsub_callee
DEFC _am9511_lsub_callee = cam32_sdcc_lsub_callee
.cam32_sdcc_lsub_callee
; subtract sdcc long from sdcc long
;
; enter : stack = sdcc_long right, sdcc_long left, ret
;
; exit : DEHL = sdcc_long(left-right)
;
; uses : af, bc, de, hl, af', bc', de', hl'
call cam32_sdcc_readr_callee
jp asm_am9511_lsub_callee ; enter stack = sdcc_long left, ret
; DEHL = sdcc_long right
; return DEHL = sdcc_long
|
Assembly/Project/Spc700/pl1-3.asm | Myself086/Project-Nested | 338 | 241301 | <reponame>Myself086/Project-Nested<gh_stars>100-1000
// Old
//.db 0xB0,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44
//.db 0xB3,0x44,0x44,0x44,0x44,0xBB,0xBB,0xBB,0xBB
// New
// [b0] 5444444444444444
// [b3] 44444444abbbbbbb
.db 0xb0, 0x54, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
.db 0xb3, 0x44, 0x44, 0x44, 0x44, 0xab, 0xbb, 0xbb, 0xbb |
oeis/320/A320059.asm | neoneye/loda-programs | 11 | 15513 | ; A320059: Sum of divisors of n^2 that do not divide n.
; Submitted by <NAME>(s2)
; 0,4,9,24,25,79,49,112,108,199,121,375,169,375,379,480,289,808,361,919,709,895,529,1591,750,1239,1053,1711,841,2749,961,1984,1681,2095,1719,3660,1369,2607,2323,3847,1681,5091,1849,4039,3673,3799,2209,6519,2744,5374,3919,5575,2809,7531,4051,7119,4873,6007,3481,12325,3721,6855,6793,8064,5589,11959,4489,9391,7093,12225,5041,15172,5329,9735,10029,11671,7485,16485,6241,15655,9720,11935,6889,22747,9409,13119,11203,16711,7921,26023,10319,16975,12781,15655,11691,26359,9409,19436,15937,23994
add $0,1
pow $0,2
mov $2,$0
lpb $0
mov $4,$0
max $0,4
mov $3,$2
dif $3,$0
dif $3,$0
mul $3,$4
cmp $3,$2
mul $3,$0
sub $0,1
add $1,$3
lpe
mov $0,$1
|
test/autogen/gen_mc68hc05.asm | tgtakaoka/libasm | 15 | 2293 | <gh_stars>10-100
;;; AUTO GENERATED FILE
;;; generated by: gen_mc6805 -u -C 68hc05 -o gen_mc68hc05.asm -l gen_mc68hc05.lst
CPU 68hc05
ORG $0100
BRSET 0, $01, *+5
BRSET 0, $01, *-125
BRSET 0, $01, *
BRCLR 0, $02, *+6
BRCLR 0, $02, *-125
BRCLR 0, $02, *
BSET 0, $11
BCLR 0, $12
BRA *+35
BRA *-126
BRA *
BRN *+36
BRN *-126
BRN *
BHI *+37
BHI *-126
BHI *
BLS *+38
BLS *-126
BLS *
BHS *+39
BHS *-126
BHS *
BLO *+40
BLO *-126
BLO *
BNE *+41
BNE *-126
BNE *
BEQ *+42
BEQ *-126
BEQ *
BHCC *+43
BHCC *-126
BHCC *
BHCS *+44
BHCS *-126
BHCS *
BPL *+45
BPL *-126
BPL *
BMI *+46
BMI *-126
BMI *
BMC *+47
BMC *-126
BMC *
BMS *+48
BMS *-126
BMS *
BIL *+49
BIL *-126
BIL *
BIH *+50
BIH *-126
BIH *
NEG $31
COM $34
LSR $35
ROR $37
ASR $38
ASL $39
ROL $3A
DEC $3B
INC $3D
TST $3E
CLR $40
NEGA
MUL
COMA
LSRA
RORA
ASRA
ASLA
ROLA
DECA
INCA
TSTA
CLRA
NEGX
COMX
LSRX
RORX
ASRX
ASLX
ROLX
DECX
INCX
TSTX
CLRX
NEG 97,X
NEG <0,X
COM 100,X
COM <0,X
LSR 101,X
LSR <0,X
ROR 103,X
ROR <0,X
ASR 104,X
ASR <0,X
ASL 105,X
ASL <0,X
ROL 106,X
ROL <0,X
DEC 107,X
DEC <0,X
INC 109,X
INC <0,X
TST 110,X
TST <0,X
CLR 112,X
CLR <0,X
NEG ,X
COM ,X
LSR ,X
ROR ,X
ASR ,X
ASL ,X
ROL ,X
DEC ,X
INC ,X
TST ,X
CLR ,X
RTI
RTS
SWI
STOP
WAIT
TAX
CLC
SEC
CLI
SEI
RSP
NOP
TXA
SUB #$A1
CMP #$A2
SBC #$A3
CPX #$A4
AND #$A5
BIT #$A6
LDA #$A7
EOR #$A9
ADC #$AA
ORA #$AB
ADD #$AC
BSR *-80
BSR *
BSR *+1
LDX #$AF
SUB $B1
CMP $B2
SBC $B3
CPX $B4
AND $B5
BIT $B6
LDA $B7
STA $B8
EOR $B9
ADC $BA
ORA $BB
ADD $BC
JMP $BD
JSR $BE
LDX $BF
STX $C0
SUB >$0001
SUB $0102
CMP >$0001
CMP $0102
SBC >$0001
SBC $0102
CPX >$0001
CPX $0102
AND >$0001
AND $0102
BIT >$0001
BIT $0102
LDA >$0001
LDA $0102
STA >$0001
STA $0102
EOR >$0001
EOR $0102
ADC >$0001
ADC $0102
ORA >$0001
ORA $0102
ADD >$0001
ADD $0102
JMP >$0001
JMP $0102
JSR >$0001
JSR $0102
LDX >$0001
LDX $0102
STX >$0001
STX $0102
SUB 53714,X
CMP 53971,X
SBC 54228,X
CPX 54485,X
AND 54742,X
BIT 54999,X
LDA 55256,X
STA 55513,X
EOR 55770,X
ADC 56027,X
ORA 56284,X
ADD 56541,X
JMP 56798,X
JSR 57055,X
LDX 57312,X
STX 57569,X
SUB 225,X
SUB <0,X
CMP 226,X
CMP <0,X
SBC 227,X
SBC <0,X
CPX 228,X
CPX <0,X
AND 229,X
AND <0,X
BIT 230,X
BIT <0,X
LDA 231,X
LDA <0,X
STA 232,X
STA <0,X
EOR 233,X
EOR <0,X
ADC 234,X
ADC <0,X
ORA 235,X
ORA <0,X
ADD 236,X
ADD <0,X
JMP 237,X
JMP <0,X
JSR 238,X
JSR <0,X
LDX 239,X
LDX <0,X
STX 240,X
STX <0,X
SUB ,X
CMP ,X
SBC ,X
CPX ,X
AND ,X
BIT ,X
LDA ,X
STA ,X
EOR ,X
ADC ,X
ORA ,X
ADD ,X
JMP ,X
JSR ,X
LDX ,X
STX ,X
|
agda/PLRTree/Equality.agda | bgbianchi/sorting | 6 | 11712 | module PLRTree.Equality {A : Set} where
open import PLRTree {A}
data _≃_ : PLRTree → PLRTree → Set where
≃lf : leaf ≃ leaf
≃nd : {l r l' r' : PLRTree}
(x x' : A)
→ l ≃ r
→ l' ≃ r'
→ l ≃ l'
→ node perfect x l r ≃ node perfect x' l' r'
|
asm/factorial.asm | 64/riscv-sim | 1 | 18737 | ; Compile with -mabi=ilp32 -march=rv32im
;
;
; uint64_t factorial(int x) {
; if (x == 0) {
; return 1;
; } else {
; return x * factorial(x - 1);
; }
; }
wrap:
call factorial
j .end
factorial:
addi sp, sp, -32
sw ra, 28(sp)
sw s0, 24(sp)
addi s0, sp, 32
sw a0, -16(s0)
lw a0, -16(s0)
li a1, 0
bne a0, a1, .LBB0_2
j .LBB0_1
.LBB0_1:
li a0, 1
sw a0, -12(s0)
j .LBB0_3
.LBB0_2:
lw a0, -16(s0)
sw a0, -20(s0)
addi a0, a0, -1
call factorial
mv a1, a0
lw a0, -20(s0)
mul a0, a0, a1
sw a0, -12(s0)
j .LBB0_3
.LBB0_3:
lw a0, -12(s0)
lw ra, 28(sp)
lw s0, 24(sp)
addi sp, sp, 32
ret
.end:
nop
|
oeis/098/A098316.asm | neoneye/loda-programs | 11 | 12497 | <filename>oeis/098/A098316.asm<gh_stars>10-100
; A098316: Decimal expansion of [3, 3, ...] = (3 + sqrt(13))/2.
; Submitted by <NAME>
; 3,3,0,2,7,7,5,6,3,7,7,3,1,9,9,4,6,4,6,5,5,9,6,1,0,6,3,3,7,3,5,2,4,7,9,7,3,1,2,5,6,4,8,2,8,6,9,2,2,6,2,3,1,0,6,3,5,5,2,2,6,5,2,8,1,1,3,5,8,3,4,7,4,1,4,6,5,0,5,2,2,2,6,0,2,3,0,9,5,4,1,0,0,9,2,4,5,3,5,8
mov $1,3
mov $2,1
mov $3,$0
mul $3,4
lpb $3
add $1,$2
add $2,$1
mul $1,3
sub $3,1
lpe
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
|
old/Integers.agda | timjb/HoTT-Agda | 294 | 2618 | <filename>old/Integers.agda
{-# OPTIONS --without-K #-}
open import Base
module Integers where
succ : ℤ → ℤ
succ O = pos O
succ (pos n) = pos (S n)
succ (neg O) = O
succ (neg (S n)) = neg n
pred : ℤ → ℤ
pred O = neg O
pred (pos O) = O
pred (pos (S n)) = pos n
pred (neg n) = neg (S n)
abstract
succ-pred : (n : ℤ) → succ (pred n) ≡ n
succ-pred O = refl
succ-pred (pos O) = refl
succ-pred (pos (S n)) = refl
succ-pred (neg n) = refl
pred-succ : (n : ℤ) → pred (succ n) ≡ n
pred-succ O = refl
pred-succ (pos n) = refl
pred-succ (neg O) = refl
pred-succ (neg (S n)) = refl
succ-is-equiv : is-equiv succ
succ-is-equiv = iso-is-eq succ pred succ-pred pred-succ
succ-equiv : ℤ ≃ ℤ
succ-equiv = (succ , succ-is-equiv)
-- Equality on ℕ and ℤ is decidable and both are sets
private
ℕ-get-S : ℕ → ℕ
ℕ-get-S 0 = 42
ℕ-get-S (S n) = n
S-injective : (n m : ℕ) (p : S n ≡ S m) → n ≡ m
S-injective n m p = ap ℕ-get-S p
ℕ-S≢O-type : ℕ → Set
ℕ-S≢O-type O = ⊥
ℕ-S≢O-type (S n) = unit
-- Technical note: You need to write "0" and not "O" in the following types
-- because S and O are both overloaded so Agda is confused by [S n ≢ O]
abstract
ℕ-S≢O : (n : ℕ) → S n ≢ 0
ℕ-S≢O n p = transport ℕ-S≢O-type p tt
ℕ-S≢O#instance : {n : ℕ} → (S n ≢ 0)
ℕ-S≢O#instance {n} = ℕ-S≢O n
ℕ-O≢S : (n : ℕ) → (0 ≢ S n)
ℕ-O≢S n p = ℕ-S≢O n (! p)
ℕ-has-dec-eq : has-dec-eq ℕ
ℕ-has-dec-eq O O = inl refl
ℕ-has-dec-eq O (S n) = inr (ℕ-O≢S n)
ℕ-has-dec-eq (S n) O = inr (ℕ-S≢O n)
ℕ-has-dec-eq (S n) (S m) with ℕ-has-dec-eq n m
ℕ-has-dec-eq (S n) (S m) | inl p = inl (ap S p)
ℕ-has-dec-eq (S n) (S m) | inr p⊥ = inr (λ p → p⊥ (S-injective n m p))
ℕ-is-set : is-set ℕ
ℕ-is-set = dec-eq-is-set ℕ-has-dec-eq
data _<_ : ℕ → ℕ → Set where
<n : {n : ℕ} → n < S n
<S : {n m : ℕ} → (n < m) → (n < S m)
_+_ : ℕ → ℕ → ℕ
0 + m = m
S n + m = S (n + m)
+S-is-S+ : (n m : ℕ) → n + S m ≡ S n + m
+S-is-S+ O m = refl
+S-is-S+ (S n) m = ap S (+S-is-S+ n m)
+0-is-id : (n : ℕ) → n + 0 ≡ n
+0-is-id O = refl
+0-is-id (S n) = ap S (+0-is-id n)
private
ℤ-get-pos : ℤ → ℕ
ℤ-get-pos O = 0
ℤ-get-pos (pos n) = n
ℤ-get-pos (neg n) = 0
pos-injective : (n m : ℕ) (p : pos n ≡ pos m) → n ≡ m
pos-injective n m p = ap ℤ-get-pos p
ℤ-get-neg : ℤ → ℕ
ℤ-get-neg O = 0
ℤ-get-neg (pos n) = 0
ℤ-get-neg (neg n) = n
neg-injective : (n m : ℕ) (p : neg n ≡ neg m) → n ≡ m
neg-injective n m p = ap ℤ-get-neg p
ℤ-neg≢O≢pos-type : ℤ → Set
ℤ-neg≢O≢pos-type O = unit
ℤ-neg≢O≢pos-type (pos n) = ⊥
ℤ-neg≢O≢pos-type (neg n) = ⊥
ℤ-neg≢pos-type : ℤ → Set
ℤ-neg≢pos-type O = unit
ℤ-neg≢pos-type (pos n) = ⊥
ℤ-neg≢pos-type (neg n) = unit
abstract
ℤ-O≢pos : (n : ℕ) → O ≢ pos n
ℤ-O≢pos n p = transport ℤ-neg≢O≢pos-type p tt
ℤ-pos≢O : (n : ℕ) → pos n ≢ O
ℤ-pos≢O n p = transport ℤ-neg≢O≢pos-type (! p) tt
ℤ-O≢neg : (n : ℕ) → O ≢ neg n
ℤ-O≢neg n p = transport ℤ-neg≢O≢pos-type p tt
ℤ-neg≢O : (n : ℕ) → neg n ≢ O
ℤ-neg≢O n p = transport ℤ-neg≢O≢pos-type (! p) tt
ℤ-neg≢pos : (n m : ℕ) → neg n ≢ pos m
ℤ-neg≢pos n m p = transport ℤ-neg≢pos-type p tt
ℤ-pos≢neg : (n m : ℕ) → pos n ≢ neg m
ℤ-pos≢neg n m p = transport ℤ-neg≢pos-type (! p) tt
ℤ-has-dec-eq : has-dec-eq ℤ
ℤ-has-dec-eq O O = inl refl
ℤ-has-dec-eq O (pos n) = inr (ℤ-O≢pos n)
ℤ-has-dec-eq O (neg n) = inr (ℤ-O≢neg n)
ℤ-has-dec-eq (pos n) O = inr (ℤ-pos≢O n)
ℤ-has-dec-eq (pos n) (pos m) with ℕ-has-dec-eq n m
ℤ-has-dec-eq (pos n) (pos m) | inl p = inl (ap pos p)
ℤ-has-dec-eq (pos n) (pos m) | inr p⊥ = inr (λ p → p⊥ (pos-injective n m p))
ℤ-has-dec-eq (pos n) (neg m) = inr (ℤ-pos≢neg n m)
ℤ-has-dec-eq (neg n) O = inr (ℤ-neg≢O n)
ℤ-has-dec-eq (neg n) (pos m) = inr (ℤ-neg≢pos n m)
ℤ-has-dec-eq (neg n) (neg m) with ℕ-has-dec-eq n m
ℤ-has-dec-eq (neg n) (neg m) | inl p = inl (ap neg p)
ℤ-has-dec-eq (neg n) (neg m) | inr p⊥ = inr (λ p → p⊥ (neg-injective n m p))
ℤ-is-set : is-set ℤ
ℤ-is-set = dec-eq-is-set ℤ-has-dec-eq
|
1A/S5/PIM/projet/src/display_shell.ads | MOUDDENEHamza/ENSEEIHT | 4 | 17293 | -------------------------------------------------------------------------------
-- Fichier : display_shell.adb
-- Auteur : <NAME> & <NAME>
-- Objectif : Spécification du package Display_Shell
-- Crée : Dimanche Nov 25 2019
--------------------------------------------------------------------------------
with Arbre_Genealogique; use Arbre_Genealogique;
with Registre; use Registre;
package Display_Shell is
-- Nom : Init_Bar.
-- Sémantique : Afficher la barre d'initialisation.
procedure Init_Bar;
-- Nom : Display_Menu.
-- Sémantique : Afficher le menu principal.
procedure Display_Menu;
-- Nom : Display_TREE_IN_FOREST.
-- Sémantique : Afficher une erreur quand l'arbre existe déja dans la foret.
procedure Display_TREE_IN_FOREST;
-- Nom : Display_EXCEPTION.
-- Sémantique : Afficher un message quand une fonction ou procedure lève une exception.
-- Paramètres :
-- Message -- Le message qui sera afficher.
-- Restart -- 1 si on redémarre le programme, 0 si on redémarre l'option.
procedure Display_Exception (Message : in String; Restart : in Integer);
-- Nom : Display_Menu.
-- Sémantique : Afficher un message quand l'exéctuion d'une procédure ou fonction réussit.
-- Paramètres :
-- Message -- Le message qui sera afficher.
procedure Display_Success (Message : in String);
-- Nom : Display_Success_Minimal_Tree_Ceation.
-- Sémantique : Afficher un message quand la création de l'arbre minimal réussit.
procedure Display_Success_Minimal_Tree_Ceation;
-- Nom : Display_ARBRE_NON_VIDE_EXCEPTION.
-- Sémantique : Afficher un message quand creer arbre minimal lève l'exception ARBRE_NON_VIDE_EXCEPTION.
procedure Display_ARBRE_NON_VIDE_EXCEPTION;
-- Nom : Display_Success_Add_Parent.
-- Sémantique : Afficher un message quand ajouter parent réussit.
procedure Display_Success_Add_Parent;
-- Nom : Display_ARBRE_VIDE_EXCEPTION.
-- Sémantique : Afficher un message quand ajouter parent lève l'exception ARBRE_VIDE_EXCEPTION.
-- Paramètres :
-- Message -- Le message qui sera afficher.
-- Restart -- 1 si on redémarre le programme, 0 si on redémarre l'option.
procedure Display_ARBRE_VIDE_EXCEPTION (Message : in String; Restart : in Integer);
-- Nom : Display_DEUX_PARENTS_PRESENTS_EXCEPTION.
-- Sémantique : Afficher un message quand ajouter parent lève l'exception DEUX_PARENTS_PRESENTS_EXCEPTION.
procedure Display_DEUX_PARENTS_PRESENTS_EXCEPTION;
-- Nom : Display_ID_ABSENT_EXCEPTION.
-- Sémantique : Afficher un message quand une fonction ou procedure lève l'exception ID_ABSENT_EXCEPTION.
-- Paramètres :
-- Message -- Le message qui sera afficher.
-- Restart -- 1 si on redémarre le programme, 0 si on redémarre l'option.
procedure Display_ID_ABSENT_EXCEPTION (Message : in String; Restart : in Integer);
-- Nom : Display_Number_Ancestors.
-- Sémantique : Afficher le nombre d'ancetres d'un individu donné.
-- Paramètres :
-- Ab -- L'Ab qui contient l'ID qu'on va afficher le nombre des ses ancetres.
-- ID -- l'ID qu'on va afficher le nombre des ses ancetres.
procedure Display_Number_Ancestors (Ab : in T_ABG; ID : in Integer);
-- Nom : Display_Title_Set.
-- Semantique : Afficher un message descriptif de l'ensemble affiché sur le terminal.
-- Paramètres :
-- Generation -- La Génération des ancestres.
procedure Display_Title_Set (Message : in String; Generation : in Integer);
-- Nom : Display_Is_Homonym.
-- Semantique : Afficher Vrai si deux individus n et m ont un ou plusieurs
-- ancêtres homonymes, sinon faux.
-- Paramètres :
-- Is_Homonym -- L'existence des homonymes.
procedure Display_Is_Homonym (Is_Homonym : in Boolean);
-- Nom : Afficher_Donnee
-- Sémantique : Afficher la donnée associée à un identifiant dans le registre
-- Paramètres :
-- Registre -- L'état civil.
-- ID -- l'ID de l'individu qu'on cherche à afficher son registre.
procedure Afficher_Donnee(Registre : in T_Registre; ID : in Integer);
-- Nom : Display_ABSENT_TREE_EXCEPTION.
-- Sémantique : Afficher un message quand une fonction ou procedure lève l'exception ABSENT_TREE_EXCEPTION.
-- Paramètres :
-- Message -- Le message qui sera afficher.
procedure Display_ABSENT_TREE_EXCEPTION (Message : in String);
-- Nom : End_Bar.
-- Semantique : Afficher la barre de fin d'exécution.
procedure End_Bar;
end Display_Shell;
|
test/fail/CantOpenConstructorsFromRecordModule.agda | asr/agda-kanso | 1 | 6424 | <reponame>asr/agda-kanso
module CantOpenConstructorsFromRecordModule where
module Datatypes where
record Foo : Set where
constructor foo
ok : Datatypes.Foo
ok = Datatypes.foo
open Datatypes.Foo
bad : Datatypes.Foo
bad = foo |
code/hu.bme.mit.plcspec.testsuitegenerator.examples/src/stopwatch/statecoverage.als | thesnapdragon/msc-thesis | 0 | 1784 | module statecoverage
open util/integer
open util/boolean
abstract sig System {}
abstract sig State {system: one System}
abstract sig Transition {from, to: one State}
sig Coverage { paths: some Path }
sig Path { firstStep: one Step }
sig Step {
from, to: one State,
via: one Transition,
nextStep: lone Step
} {
via.from = from
via.to = to
}
fun steps (p:Path): set Step {
p.firstStep.*nextStep
}
fun transitions (p:Path): set Transition {
p.firstStep.via + p.firstStep.*nextStep.via
}
fact {
// test generation properties
all p:Path | one c:Coverage | p in c.paths // all path belongs to a coverage
all s:Step | one p:Path | s in p.firstStep.*nextStep // all steps belongs to a path
// model consistency
all p:Path | p.firstStep.from = Initial // all path starts with an Initial state
all p:Path | one s:Step | s in steps[p] && s.to = End // all path end with End state
// state machine properties
all curr:Step, next:curr.nextStep | next.from = curr.to // all steps are contionueos
all sys:System | some s:State | sys = s.system // all system belongs to a state
}
pred inheritSystem(s1, s2: System) {
s1 = s2
}
/*** GENERATED CODE START ***/
one sig READY, PAUSED, RUNNING, Initial, STOPPED, End extends State {}
some sig S extends System {
output: Int
}
lone sig on extends Transition {}{
from = Initial
to = READY
initSystem[from.system]
inheritSystem[from.system, to.system]
}
lone sig start extends Transition {}{
from = READY
to = RUNNING
inheritSystem[from.system, to.system]
}
lone sig stop extends Transition {}{
from = RUNNING
to = STOPPED
inheritSystem[from.system, to.system]
}
lone sig split extends Transition {}{
from = RUNNING
to = PAUSED
inheritSystem[from.system, to.system]
}
lone sig off extends Transition {}{
from = STOPPED
to = End
inheritSystem[from.system, to.system]
}
lone sig reset extends Transition {}{
from = STOPPED
to = READY
inheritSystem[from.system, to.system]
}
lone sig unsplit extends Transition {}{
from = PAUSED
to = RUNNING
inheritSystem[from.system, to.system]
}
lone sig stop2 extends Transition {}{
from = PAUSED
to = STOPPED
inheritSystem[from.system, to.system]
}
pred initSystem(s:System) {
s.output = 0
}
/*** GENERATED CODE END ***/
pred state_coverage() {
all s:State | some p:Path | s in steps[p].from + steps[p].to
}
run state_coverage for 10 but exactly 1 Coverage, 4 System
|
FormalAnalyzer/models/meta/cap_washerMode.als | Mohannadcse/IoTCOM_BehavioralRuleExtractor | 0 | 3928 |
// filename: cap_washerMode.als
module cap_washerMode
open IoTBottomUp
one sig cap_washerMode extends Capability {}
{
attributes = cap_washerMode_attr
}
abstract sig cap_washerMode_attr extends Attribute {}
one sig cap_washerMode_attr_washerMode extends cap_washerMode_attr {}
{
values = cap_washerMode_attr_washerMode_val
}
abstract sig cap_washerMode_attr_washerMode_val extends AttrValue {}
one sig cap_washerMode_attr_washerMode_val_regular extends cap_washerMode_attr_washerMode_val {}
one sig cap_washerMode_attr_washerMode_val_heavy extends cap_washerMode_attr_washerMode_val {}
one sig cap_washerMode_attr_washerMode_val_rinse extends cap_washerMode_attr_washerMode_val {}
one sig cap_washerMode_attr_washerMode_val_spinDry extends cap_washerMode_attr_washerMode_val {}
|
programs/oeis/017/A017768.asm | jmorken/loda | 1 | 161238 | <reponame>jmorken/loda<filename>programs/oeis/017/A017768.asm
; A017768: Binomial coefficients C(52,n).
; 1,52,1326,22100,270725,2598960,20358520,133784560,752538150,3679075400,15820024220,60403728840,206379406870,635013559600,1768966344600,4481381406320,10363194502115,21945588357420,42671977361650,76360380541900,125994627894135
mov $1,52
bin $1,$0
|
source/strings/a-seaswi.ads | ytomino/drake | 33 | 29009 | <reponame>ytomino/drake
pragma License (Unrestricted);
-- extended unit
package Ada.Strings.East_Asian_Width is
-- Unicode property "east asian width".
pragma Pure;
type Width_Kind is (
Neutral,
Narrow,
Half_Width,
Ambiguous,
Wide,
Full_Width);
function Kind (C : Wide_Wide_Character) return Width_Kind;
function Is_Full_Width (W : Width_Kind; East_Asian : Boolean)
return Boolean;
pragma Inline (Is_Full_Width);
end Ada.Strings.East_Asian_Width;
|
src/asis/asis-iterator.adb | My-Colaborations/dynamo | 15 | 12789 | <reponame>My-Colaborations/dynamo<filename>src/asis/asis-iterator.adb<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A S I S . I T E R A T O R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2010, Free Software Foundation, Inc. --
-- --
-- ASIS-for-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 --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY 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 ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adac<EMAIL>.com). --
-- --
------------------------------------------------------------------------------
with Asis.Elements;
with Asis.Exceptions; use Asis.Exceptions;
with A4G.Vcheck; use A4G.Vcheck;
with A4G.Queries; use A4G.Queries;
-----------------------------------------------------------------
-- --
-- Process_Children is the function that gets all the children --
-- and calls Recursive_Traversal on them. To get the children --
-- it uses a function that takes an element and returns all --
-- the queries that can obtain children from this element. --
-- (see asis_elements-queries.ads) --
-- --
-- This way, the generic body to instanciate doesn't contain --
-- the procedures that obtain the children, the code is not --
-- duplicated, and so we have a gain in performance (time & --
-- memory). --
-- --
-- Concerning the Control, all Pre and Post-conditions have --
-- been put at the begining and end of the procedures and --
-- blocks that deal with them. --
-- --
-- The (Control = Terminate_Immediatly) has been handled by --
-- returning from all the recursive calls ... --
-- --
-----------------------------------------------------------------
package body Asis.Iterator is
procedure Traverse_Element
(Element : Asis.Element;
Control : in out Traverse_Control;
State : in out State_Information)
is
procedure Recursive_Traversal
(Element : Asis.Element;
Control : in out Traverse_Control);
-- This procedure does the main job
procedure Traverse_Children
(Element : Asis.Element;
Control : in out Traverse_Control);
-- Traverses children of a given construct
------------------------------------------------------
-- Pre-condition: any value of Control is possible --
------------------------------------------------------
procedure Traverse_Children
(Element : Asis.Element;
Control : in out Traverse_Control)
is
-- The value of Control has been set by Pre_Operation
-- Child access is an array containing access to the functions
-- needed to access element's children
Child_Access : constant Query_Array := Appropriate_Queries (Element);
function Do_Return return Boolean;
-- Check and reset the Control value on return from the traverse.
-- the boolean returned says wether or not the program should
-- return
function Do_Return return Boolean is
begin
--------------------------------------------------------
-- Post-condition: Control = Continue --
-- or Control = Abandon_Siblings --
-- or Control = Terminate_Immediately --
--------------------------------------------------------
case Control is
when Terminate_Immediately =>
return True;
when Continue =>
return False;
when Abandon_Siblings =>
Control := Continue;
-- to continue the traversal of the parent
-- of the Each_Child (that is, Element) with
-- its Post_Operation
return True; -- to prevent traversal of Each_Child siblings
when Abandon_Children =>
-- this choice could never been chosen!!!
return False;
end case;
---------------------------------------------------------------
-- Post-Condition : Control = Continue (True or False) --
-- or Control = Terminate_Immediately (True) --
---------------------------------------------------------------
end Do_Return;
begin -- Traverse_Children
-- Validity Check has already been done
------------------------------------------
-- Pre-condition: Control = Continue --
------------------------------------------
-- Classify the Element using the various kinds queries.
-- Query for all children of the Element in left-to-right order.
-- Perform a depth-first traversal on each child.
-- The only possibility for Control is to be equal to Continue here!
-- If the current Element has no children, Control remains to be
-- equal to Continue
for Each_Query in Child_Access'Range loop
case Child_Access (Each_Query).Query_Kind is
when Bug =>
raise Internal_Implementation_Error;
when Single_Element_Query =>
declare
Child : constant Asis.Element :=
Child_Access (Each_Query).Func_Simple (Element);
begin
if Asis.Elements.Element_Kind (Child) /=
Not_An_Element
then
Recursive_Traversal (Child, Control);
if Do_Return then
return;
end if;
end if;
end;
when Element_List_Query =>
declare
Child_List : constant Asis.Element_List :=
Child_Access (Each_Query).Func_List (Element);
begin
-- If the list is empty, it's ok ... nothing is processed
for Each_Element in Child_List'Range loop
Recursive_Traversal
(Child_List (Each_Element), Control);
if Do_Return then
return;
end if;
end loop;
end;
when Element_List_Query_With_Boolean =>
declare
Child_List : constant Asis.Element_List :=
Child_Access (Each_Query).Func_List_Boolean
(Element, Child_Access (Each_Query).Bool);
begin
-- If the list is empty, it's ok ... nothing is processed
for Each_Element in Child_List'Range loop
Recursive_Traversal
(Child_List (Each_Element), Control);
if Do_Return then
return;
end if;
end loop;
end;
end case;
end loop;
-------------------------------------------
-- Post-condition: Control = Continue --
-------------------------------------------
-- if Terminate_Immediately was set, we --
-- just do not entry this procedure ... --
-------------------------------------------
end Traverse_Children;
--------------------------------------------------------
-- Post-condition: any value of Control is possible, --
--------------------------------------------------------
-------------------------
-- Recursive_Traversal --
-------------------------
----------------------------------------
-- Pre-condition: Control = Continue --
----------------------------------------
procedure Recursive_Traversal
(Element : Asis.Element;
Control : in out Traverse_Control) is
begin
----------------------------------------
-- Pre-condition: Control = Continue --
----------------------------------------
begin
Pre_Operation (Element, Control, State); -- Visit the Element.
exception
when ASIS_Inappropriate_Context |
ASIS_Inappropriate_Container |
ASIS_Inappropriate_Compilation_Unit |
ASIS_Inappropriate_Element |
ASIS_Inappropriate_Line |
ASIS_Inappropriate_Line_Number |
ASIS_Failed =>
Add_Call_Information (
Argument => Element,
Outer_Call => "Actual procedure for Pre_Operation");
raise;
end;
--------------------------------------------------------
-- Post-condition: any value of Control is possible --
--------------------------------------------------------
if Control = Continue then
Traverse_Children (Element, Control);
end if;
--------------------------------------------------------
-- Pre-condition: any value of Control is possible, --
--------------------------------------------------------
case Control is
when Terminate_Immediately =>
return;
when Continue =>
begin
-- Revisit the Element
Post_Operation (Element, Control, State);
exception
when ASIS_Inappropriate_Context |
ASIS_Inappropriate_Container |
ASIS_Inappropriate_Compilation_Unit |
ASIS_Inappropriate_Element |
ASIS_Inappropriate_Line |
ASIS_Inappropriate_Line_Number |
ASIS_Failed =>
Add_Call_Information (
Argument => Element,
Outer_Call => "Actual procedure for Post_Operation");
raise;
end;
-- reset the Control set by Post_Operation:
case Control is
when Terminate_Immediately =>
return;
when Continue =>
null;
when Abandon_Children =>
Control := Continue;
-- the current Element has no children to traverse
-- anymore!
when Abandon_Siblings =>
null;
end case;
when Abandon_Children =>
-- OK, we abandonned the children, now we go up and continue
Control := Continue;
when Abandon_Siblings =>
null;
end case;
---------------------------------------------------------
-- Post-condition: Control = Continue --
-- or Control = Abandon_Siblings --
-- or Control = Terminate_Immediately --
---------------------------------------------------------
end Recursive_Traversal;
---------------------------------------------------------
-- Post-condition: Control = Continue --
-- or Control = Abandon_Siblings --
-- or Control = Terminate_Immediately --
---------------------------------------------------------
---------------------------------
-- Traversal_Element Main body --
---------------------------------
begin
Check_Validity (Element, "Asis.Elements.Traverse_Element");
if Asis.Elements.Is_Nil (Element) then
Raise_ASIS_Inappropriate_Element
("Asis.Iterator.Traverse_Element",
Wrong_Kind => Not_An_Element);
elsif Control /= Continue then
return;
end if;
----------------------------------------
-- Pre-condition: Control = Continue --
----------------------------------------
Recursive_Traversal (Element => Element,
Control => Control);
exception
when ASIS_Inappropriate_Element |
ASIS_Inappropriate_Context |
ASIS_Inappropriate_Container |
ASIS_Inappropriate_Compilation_Unit |
ASIS_Inappropriate_Line |
ASIS_Inappropriate_Line_Number |
ASIS_Failed =>
Add_Call_Information
(Argument => Element,
Outer_Call => "Asis.Iterator.Traverse_Element");
raise;
-- when others =>
-- Actual Pre- and Postoperations can raise whatever they want, and
-- at the level of Traverse_Element we can (and should) do nothing
-- with this. So we just let this exception go ahead
-- raise;
end Traverse_Element;
end Asis.Iterator;
|
src/ltl2lustre/parsing/ltl.g4 | mwwhalen/ltl2lustre | 0 | 1824 | grammar ltl;
@header {
package ltl2lustre.parsing;
}
program: (ltl_spec*) EOF;
ltl_spec :
'LTLSPEC' expr=ltl_expr ';' # anonymousLtlExpr
| 'LTLSPEC' 'NAME' name=ID ':=' expr=ltl_expr ';' # namedLtlExpr
;
ltl_expr :
op=('!' | 'X' | 'G' | 'Y' | 'Z' | 'H' | 'O') sub=ltl_expr # unyLtlExpr
| lhs=ltl_expr op=('U' | 'V' | 'S' | 'T') rhs=ltl_expr # binaryLtlExpr
| lhs=ltl_expr op='&' rhs=ltl_expr # binaryLtlExpr
| lhs=ltl_expr op=('|' | 'xor' | 'xnor') rhs=ltl_expr # binaryLtlExpr
| <assoc=right> lhs=ltl_expr op='->' rhs=ltl_expr # binaryLtlExpr
| lhs=ltl_expr op='<->' rhs=ltl_expr # binaryLtlExpr
| basicexpr # basicLtlExpr
| '(' ltl_expr ')' # nestedLtlExpr
;
basicexpr :
constant # constantExpr
| variable_identifier # idExpr
| op='!' sub=basicexpr # unyExpr
| op='-' sub=basicexpr # unyExpr
| lhs=basicexpr op=('*' | '/' | 'mod') rhs=basicexpr # binaryExpr
| lhs=basicexpr op=('+' | '-' ) rhs=basicexpr # binaryExpr
| lhs=basicexpr op=('<<' | '>>' ) rhs=basicexpr # binaryExpr
| lhs=basicexpr op=('=' | '!=' | '<' | '>' | '<=' | '>=') rhs=basicexpr # binaryExpr
| lhs=basicexpr op='&' rhs=basicexpr # binaryExpr
| lhs=basicexpr op=('|' | 'xor' | 'xnor') rhs=basicexpr # binaryExpr
| cond=basicexpr '?' thene=basicexpr ':' elsee=basicexpr # ifThenElseExpr
| lhs=basicexpr op='<->' rhs=basicexpr # binaryExpr
| lhs=basicexpr op='->' rhs=basicexpr # binaryExpr
| op='next' '(' sub=basicexpr ')' # unyExpr
| '(' basicexpr ')' # nestedExpr
| 'count' '(' el+=basicexpr (',' el+=basicexpr)* ')' # countExpr
;
// CURRENTLY UNSUPPORTED EXPRESSIONS!
// | define_identifier
// | function_call // a call to a function
// | basicexpr '[' index ']' // index subscript
// | basicexpr '[' basicexpr ':' basicexpr ']'
// | basicexpr '::' basicexpr // word concatenation
// | abs '(' basicexpr ')' // absolute value
// | max '(' basicexpr ',' basicexpr ')' // max
// | min '(' basicexpr ',' basicexpr ')' // min
// word bits selection
// | 'word1' '(' basicexpr ')' // boolean to unsigned word[1] conversion
// | 'bool' '(' basicexpr ')' // unsigned word[1] and int to boolean conversion
// | 'toint' '(' basicexpr ')' // word and boolean to integer constant conversion
// | 'swconst' '(' basicexpr ',' basicexpr ')'
// integer to signed word constant conversion
// | 'uwconst' '(' basicexpr ',' basicexpr ')'
// integer to unsigned word constant conversion
// | 'signed' '(' basicexpr ')' // unsigned word to signed word conversion
// | 'unsigned' '(' basicexpr ')' // signed word to unsigned word conversion
// | 'sizeof' '(' basicexpr ')' // word size as an integer
// | 'floor' '(' basicexpr ')' // from a real to an integer
// | 'extend' '(' basicexpr ',' basicexpr')'
// word width extension
// | resize '(' basicexpr ',' basicexpr')'
// word width resize
// | 'signed word' '[' size ']' '(' basicexpr ')' // integer to signed word conversion
// | 'unsigned word' '[' size ']' '(' basicexpr ')' // integer to unsigned word conversion
// | basicexpr 'union' basicexpr // union of set expressions
// | '{' set_body_expr '}' // set expression
// | basicexpr 'in' basicexpr // inclusion in a set expression
// if-then-else expression
// | case_expr // case expression
// set_body_expr : ;
constant :
intconstant
| realconstant
| boolconstant;
intconstant: INT;
realconstant: REAL;
boolconstant: BOOL;
variable_identifier : ID ;
REAL: INT '.' INT;
BOOL: 'TRUE' | 'FALSE';
INT: [0-9]+;
// ~ is used internally. Users should not use it.
ID: [a-zA-Z_~][a-zA-Z_0-9~]*;
WS: [ \t\n\r\f]+ -> skip;
SL_COMMENT: '--' (~[%\n\r] ~[\n\r]* | /* empty */) ('\r'? '\n')? -> skip;
ML_COMMENT: '(*' .*? '*)' -> skip;
ERROR: .;
|
oeis/026/A026674.asm | neoneye/loda-programs | 11 | 22223 | ; A026674: a(n) = T(2n-1,n-1) = T(2n,n+1), T given by A026725.
; Submitted by <NAME>
; 1,4,16,65,267,1105,4597,19196,80380,337284,1417582,5965622,25130844,105954110,447015744,1886996681,7969339643,33670068133,142301618265,601586916703,2543852427847,10759094481491,45513214057191,192560373660245,814807864164497,3448219788064105,14594181609750217,61773780029221121,261495087325800345,1107015635067521493,4686744883310445381,19843265518772168412,84018817529561297740,355761733571482164460,1506465143903752467926,6379318967733734465666,27014897501947737178360,114404917969585921890234
mov $3,$0
lpb $0
mov $2,$3
add $2,$0
add $2,1
bin $2,$0
sub $0,1
add $1,$2
cmp $2,$1
add $3,2
sub $3,$2
lpe
mov $0,$1
add $0,1
|
src/tools/Dependency_Graph_Extractor/src/extraction.adb | selroc/Renaissance-Ada | 1 | 16732 | with Ada.Exceptions;
with Ada.Strings.Equal_Case_Insensitive;
with Ada.Text_IO;
with Extraction.Bodies_For_Decls;
with Extraction.Bodies_For_Entries;
with Extraction.Decls;
with Extraction.Deferred_Constants;
with Extraction.Derived_Type_Defs;
with Extraction.Direct_Calls;
with Extraction.File_System;
with Extraction.Generic_Instantiations;
with Extraction.Graph_Operations;
with Extraction.Node_Edge_Types;
with Extraction.Primitive_Subps;
with Extraction.Project_Files;
with Extraction.References_Of_Decls;
with Extraction.Renamings;
with Extraction.Source_Files_From_Projects;
with Extraction.Subp_Overrides;
with Extraction.Decl_Types;
with Extraction.Utilities;
with Extraction.With_Clauses;
package body Extraction is
-- TODO: Improve node naming such that line numbers are not needed
-- TODO: Relate arguments in generic instantiations with formal parameters of generics
use type VFS.Filesystem_String;
use type VFS.Virtual_File;
function Node_Attributes return GW.Attribute_Definition_Sets.Map renames Node_Edge_Types.Node_Attributes;
function Edge_Attributes return GW.Attribute_Definition_Sets.Map renames Node_Edge_Types.Edge_Attributes;
procedure Extract_Dependency_Graph
(Project_Filename : String;
Recurse_Projects : Boolean;
Directory_Prefix : VFS.Virtual_File;
Graph_File : in out GW.GraphML_File)
is
Context : constant Utilities.Project_Context := Utilities.Open_Project(Project_Filename);
Projects : constant Utilities.Project_Vectors.Vector := Utilities.Get_Projects(Context, Recurse_Projects);
Units : constant Utilities.Analysis_Unit_Vectors.Vector := Utilities.Open_Analysis_Units(Context, Recurse_Projects);
Graph : constant Graph_Operations.Graph_Context := Graph_Operations.Create_Graph_Context(Graph_File'Unchecked_Access, Directory_Prefix, Context);
procedure Handle_Exception(E : Ada.Exceptions.Exception_Occurrence; Node : LAL.Ada_Node'Class) is
Message : constant String := Ada.Exceptions.Exception_Message(E);
begin
if not Ada.Strings.Equal_Case_Insensitive(Message, "memoized error") then
Ada.Text_IO.Put_Line("Encountered Libadalang problem: " & Message);
Node.Print;
end if;
end Handle_Exception;
function Node_Visitor(Node : LAL.Ada_Node'Class) return LALCO.Visit_Status is
begin
-- TODO: Remove exception block once all libadalang problems have been fixed.
begin
Decls.Extract_Nodes(Node, Graph);
Subp_Overrides.Extract_Nodes(Node, Graph);
Primitive_Subps.Extract_Nodes(Node, Graph);
References_Of_Decls.Extract_Nodes(Node, Graph);
exception
when E : LALCO.Property_Error =>
Handle_Exception(E, Node);
end;
return LALCO.Into;
end Node_Visitor;
function Edge_Visitor(Node : LAL.Ada_Node'Class) return LALCO.Visit_Status is
begin
-- TODO: Remove exception block once all libadalang problems have been fixed.
begin
Decls.Extract_Edges(Node, Graph);
Subp_Overrides.Extract_Edges(Node, Graph);
Primitive_Subps.Extract_Edges(Node, Graph);
Generic_Instantiations.Extract_Edges(Node, Graph);
References_Of_Decls.Extract_Edges(Node, Graph);
Bodies_For_Decls.Extract_Edges(Node, Graph);
Bodies_For_Entries.Extract_Edges(Node, Graph);
Renamings.Extract_Edges(Node, Graph);
Direct_Calls.Extract_Edges(Node, Graph);
With_Clauses.Extract_Edges(Node, Graph);
Derived_Type_Defs.Extract_Edges(Node, Graph);
Decl_Types.Extract_Edges(Node, Graph);
Deferred_Constants.Extract_Edges(Node, Graph);
exception
when E : LALCO.Property_Error =>
Handle_Exception(E, Node);
end;
return LALCO.Into;
end Edge_Visitor;
begin
-- Node extraction
-- File_System.Extract_Nodes should occur before the extraction of any
-- other kind of node (see also the implementation of Get_Node_Attributes
-- in Extraction.Node_Edge_Types).
if Directory_Prefix /= VFS.No_File then
File_System.Extract_Nodes (Directory_Prefix, Graph);
end if;
for Project of Projects loop
Ada.Text_IO.Put_Line("-- " & (+Project.Project_Path.Full_Name) & " --");
Project_Files.Extract_Nodes(Project, Graph);
Source_Files_From_Projects.Extract_Nodes(Project, Graph);
end loop;
for Unit of Units loop
Ada.Text_IO.Put_Line("-- " & Unit.Get_Filename & " --");
Unit.Root.Traverse(Node_Visitor'Access);
end loop;
-- Edge extraction.
if Directory_Prefix /= VFS.No_File then
File_System.Extract_Edges(Directory_Prefix, Graph);
end if;
for Project of Projects loop
Ada.Text_IO.Put_Line("== " & (+Project.Project_Path.Full_Name) & " ==");
Project_Files.Extract_Edges(Project, Recurse_Projects, Graph);
Source_Files_From_Projects.Extract_Edges(Project, Context, Recurse_Projects, Graph);
end loop;
for Unit of Units loop
Ada.Text_IO.Put_Line("== " & Unit.Get_Filename & " ==");
Unit.Root.Traverse(Edge_Visitor'Access);
end loop;
end Extract_Dependency_Graph;
end Extraction;
|
programs/oeis/339/A339276.asm | karttu/loda | 0 | 241211 | <filename>programs/oeis/339/A339276.asm
; A339276: Nearest integer to the fourth root of n.
; 1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
lpb $0,1
add $1,24
add $0,$1
div $0,7
lpe
div $1,24
add $1,1
|
bin/Alloy/models/cloudnet/tosca_simple_yaml_1_0.als | JLCoulin/Cloudnet-TOSCA-toolbox | 1 | 2642 | <reponame>JLCoulin/Cloudnet-TOSCA-toolbox<gh_stars>1-10
/******************************************************************************
*
* Software Name : Cloudnet TOSCA toolbox
* Version: 1.0
* SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange
* SPDX-License-Identifier: Apache-2.0
*
* This software is distributed under the Apache License 2.0
* the text of which is available at http://www.apache.org/licenses/LICENSE-2.0
* or see the "LICENSE-2.0.txt" file for more details.
*
* Author: <NAME> (INRIA) <<EMAIL>>
*
* A formal specification of TOSCA in Alloy with Location Graphs.
*
*******************************************************************************/
module tosca_simple_yaml_1_0
open LocationGraphs
open TOSCA
// --------------------------------------------------
// TOSCA Topology Metadata
// --------------------------------------------------
// tosca_definitions_version: tosca_simple_yaml_1_0
// description: OASIS TOSCA 1.0 os01 normative types
// --------------------------------------------------
// Data Types
// --------------------------------------------------
//
// The TOSCA root Data Type all other TOSCA base Data Types derive from
//
sig tosca_datatypes_Root extends TOSCA/Data
{
} {
}
/** There exists some tosca.datatypes.Root */
run Show_tosca_datatypes_Root {
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_datatypes_Root
expect 1
//
// The TOSCA data Type used when describing authorization credentials used to access network accessible resources
//
sig tosca_datatypes_Credential extends tosca_datatypes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML protocol: {'description': 'The optional protocol name', 'type': 'string', 'required': False}
//
// The optional protocol name
//
protocol: lone string,
// YAML token_type: {'description': 'The required token type', 'type': 'string', 'default': 'password'}
//
// The required token type
//
token_type: one string,
// YAML token: {'description': 'The required token used as a credential for authorization or access to a networked resource', 'type': 'string'}
//
// The required token used as a credential for authorization or access to a networked resource
//
token: one string,
// YAML keys: {'description': 'The optional list of protocol-specific keys or assertions', 'type': 'map', 'required': False, 'entry_schema': {'type': 'string'}}
//
// The optional list of protocol-specific keys or assertions
//
keys: lone TOSCA/map_string/Map,
// YAML user: {'description': 'The optional user (name or ID) used for non-token based credentials', 'type': 'string', 'required': False}
//
// The optional user (name or ID) used for non-token based credentials
//
user: lone string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.datatypes.Credential */
run Show_tosca_datatypes_Credential {
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_datatypes_Credential
expect 1
sig tosca_datatypes_network_NetworkInfo extends tosca_datatypes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML network_name: {'type': 'string'}
network_name: one string,
// YAML network_id: {'type': 'string'}
network_id: one string,
// YAML addresses: {'type': 'list', 'entry_schema': {'type': 'string'}}
addresses: seq string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.datatypes.network.NetworkInfo */
run Show_tosca_datatypes_network_NetworkInfo {
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_datatypes_network_NetworkInfo
expect 1
sig tosca_datatypes_network_PortInfo extends tosca_datatypes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML port_name: {'type': 'string'}
port_name: one string,
// YAML port_id: {'type': 'string'}
port_id: one string,
// YAML network_id: {'type': 'string'}
network_id: one string,
// YAML mac_address: {'type': 'string'}
mac_address: one string,
// YAML addresses: {'type': 'list', 'entry_schema': {'type': 'string'}}
addresses: seq string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.datatypes.network.PortInfo */
run Show_tosca_datatypes_network_PortInfo {
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_datatypes_network_PortInfo
expect 1
let tosca_datatypes_network_PortDef = integer
sig tosca_datatypes_network_PortSpec extends tosca_datatypes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML protocol: {'type': 'string', 'required': True, 'default': 'tcp', 'constraints': [{'valid_values': ['udp', 'tcp', 'igmp']}]}
protocol: one string,
// YAML target: {'type': 'PortDef', 'required': False}
target: lone tosca_datatypes_network_PortDef,
// YAML target_range: {'type': 'range', 'required': False, 'constraints': [{'in_range': [1, 65535]}]}
target_range: lone range,
// YAML source: {'type': 'PortDef', 'required': False}
source: lone tosca_datatypes_network_PortDef,
// YAML source_range: {'type': 'range', 'required': False, 'constraints': [{'in_range': [1, 65535]}]}
source_range: lone range,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
protocol.valid_values["udp" + "tcp" + "igmp"]
some target_range implies target_range.in_range[1, 65535]
some source_range implies source_range.in_range[1, 65535]
}
/** There exists some tosca.datatypes.network.PortSpec */
run Show_tosca_datatypes_network_PortSpec {
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_datatypes_network_PortSpec
expect 1
// --------------------------------------------------
// Artifact Types
// --------------------------------------------------
//
// The TOSCA Artifact Type all other TOSCA Artifact Types derive from
//
sig tosca_artifacts_Root extends TOSCA/Artifact
{
} {
}
/** There exists some tosca.artifacts.Root */
run Show_tosca_artifacts_Root {
tosca_artifacts_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Root
expect 1
sig tosca_artifacts_File extends tosca_artifacts_Root
{
} {
}
/** There exists some tosca.artifacts.File */
run Show_tosca_artifacts_File {
tosca_artifacts_File.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_File
expect 1
//
// TOSCA base type for deployment artifacts
//
sig tosca_artifacts_Deployment extends tosca_artifacts_Root
{
} {
}
/** There exists some tosca.artifacts.Deployment */
run Show_tosca_artifacts_Deployment {
tosca_artifacts_Deployment.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Deployment
expect 1
sig tosca_artifacts_Deployment_Image extends tosca_artifacts_Deployment
{
} {
}
/** There exists some tosca.artifacts.Deployment.Image */
run Show_tosca_artifacts_Deployment_Image {
tosca_artifacts_Deployment_Image.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Deployment_Image
expect 1
//
// Virtual Machine (VM) Image
//
sig tosca_artifacts_Deployment_Image_VM extends tosca_artifacts_Deployment_Image
{
} {
}
/** There exists some tosca.artifacts.Deployment.Image.VM */
run Show_tosca_artifacts_Deployment_Image_VM {
tosca_artifacts_Deployment_Image_VM.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Deployment_Image_VM
expect 1
//
// TOSCA base type for implementation artifacts
//
sig tosca_artifacts_Implementation extends tosca_artifacts_Root
{
} {
}
/** There exists some tosca.artifacts.Implementation */
run Show_tosca_artifacts_Implementation {
tosca_artifacts_Implementation.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Implementation
expect 1
//
// Script artifact for the Unix Bash shell
//
sig tosca_artifacts_Implementation_Bash extends tosca_artifacts_Implementation
{
} {
// YAML mime_type: application/x-sh
mime_type["application/x-sh"]
// YAML file_ext: ['sh']
file_ext["sh"]
}
/** There exists some tosca.artifacts.Implementation.Bash */
run Show_tosca_artifacts_Implementation_Bash {
tosca_artifacts_Implementation_Bash.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Implementation_Bash
expect 1
//
// Artifact for the interpreted Python language
//
sig tosca_artifacts_Implementation_Python extends tosca_artifacts_Implementation
{
} {
// YAML mime_type: application/x-python
mime_type["application/x-python"]
// YAML file_ext: ['py']
file_ext["py"]
}
/** There exists some tosca.artifacts.Implementation.Python */
run Show_tosca_artifacts_Implementation_Python {
tosca_artifacts_Implementation_Python.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Operation,
exactly 1 tosca_artifacts_Implementation_Python
expect 1
// --------------------------------------------------
// Capability Types
// --------------------------------------------------
//
// The TOSCA root Capability Type all other TOSCA base Capability Types derive from
//
sig tosca_capabilities_Root extends TOSCA/Capability
{
} {
}
/** There exists some tosca.capabilities.Root */
run Show_tosca_capabilities_Root {
tosca_capabilities_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Root
expect 1
sig tosca_capabilities_Node extends tosca_capabilities_Root
{
} {
}
/** There exists some tosca.capabilities.Node */
run Show_tosca_capabilities_Node {
tosca_capabilities_Node.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Node
expect 1
sig tosca_capabilities_Network extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML name: {'type': 'string', 'required': False}
property_name: lone string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.capabilities.Network */
run Show_tosca_capabilities_Network {
tosca_capabilities_Network.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Network
expect 1
sig tosca_capabilities_Storage extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML name: {'type': 'string', 'required': False}
property_name: lone string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.capabilities.Storage */
run Show_tosca_capabilities_Storage {
tosca_capabilities_Storage.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Storage
expect 1
sig tosca_capabilities_Container extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML num_cpus: {'type': 'integer', 'required': False, 'constraints': [{'greater_or_equal': 1}]}
property_num_cpus: lone integer,
// YAML cpu_frequency: {'type': 'scalar-unit.frequency', 'required': False, 'constraints': [{'greater_or_equal': '0.1 GHz'}]}
property_cpu_frequency: lone scalar_unit_frequency,
// YAML disk_size: {'type': 'scalar-unit.size', 'required': False, 'constraints': [{'greater_or_equal': '0 MB'}]}
property_disk_size: lone scalar_unit_size,
// YAML mem_size: {'type': 'scalar-unit.size', 'required': False, 'constraints': [{'greater_or_equal': '0 MB'}]}
property_mem_size: lone scalar_unit_size,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
some property_num_cpus implies property_num_cpus.greater_or_equal[1]
some property_cpu_frequency implies property_cpu_frequency.greater_or_equal[1, Hz]
some property_disk_size implies property_disk_size.greater_or_equal[0, MB]
some property_mem_size implies property_mem_size.greater_or_equal[0, MB]
}
/** There exists some tosca.capabilities.Container */
run Show_tosca_capabilities_Container {
tosca_capabilities_Container.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Container
expect 1
sig tosca_capabilities_Endpoint extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML protocol: {'type': 'string', 'required': True, 'default': 'tcp'}
property_protocol: one string,
// YAML port: {'type': 'PortDef', 'required': False}
property_port: lone tosca_datatypes_network_PortDef,
// YAML secure: {'type': 'boolean', 'required': False, 'default': False}
property_secure: lone boolean,
// YAML url_path: {'type': 'string', 'required': False}
property_url_path: lone string,
// YAML port_name: {'type': 'string', 'required': False}
property_port_name: lone string,
// YAML network_name: {'type': 'string', 'required': False, 'default': 'PRIVATE'}
property_network_name: lone string,
// YAML initiator: {'type': 'string', 'required': False, 'default': 'source', 'constraints': [{'valid_values': ['source', 'target', 'peer']}]}
property_initiator: lone string,
// YAML ports: {'type': 'map', 'required': False, 'constraints': [{'min_length': 1}], 'entry_schema': {'type': 'PortSpec'}}
property_ports: lone TOSCA/map_data/Map,
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// YAML ip_address: {'type': 'string'}
attribute_ip_address: one string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_initiator.valid_values["source" + "target" + "peer"]
some property_ports implies property_ports.min_length[1]
// --------------------------------------------------
// Attributes
// --------------------------------------------------
}
/** There exists some tosca.capabilities.Endpoint */
run Show_tosca_capabilities_Endpoint {
tosca_capabilities_Endpoint.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Endpoint
expect 1
sig tosca_capabilities_Endpoint_Public extends tosca_capabilities_Endpoint
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML network_name: {'type': 'string', 'default': 'PUBLIC', 'constraints': [{'equal': 'PUBLIC'}]}
// NOTE: network_name overloaded
// YAML floating: {'description': 'Indicates that the public address should be allocated from a pool of floating IPs that are associated with the network.', 'type': 'boolean', 'default': False, 'status': 'experimental'}
//
// Indicates that the public address should be allocated from a pool of floating IPs that are associated with the network.
//
property_floating: one boolean,
// YAML dns_name: {'description': 'The optional name to register with DNS', 'type': 'string', 'required': False, 'status': 'experimental'}
//
// The optional name to register with DNS
//
property_dns_name: lone string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_network_name.equal["PUBLIC"]
}
/** There exists some tosca.capabilities.Endpoint.Public */
run Show_tosca_capabilities_Endpoint_Public {
tosca_capabilities_Endpoint_Public.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Endpoint_Public
expect 1
sig tosca_capabilities_Endpoint_Admin extends tosca_capabilities_Endpoint
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML secure: {'type': 'boolean', 'default': True, 'constraints': [{'equal': True}]}
// NOTE: secure overloaded
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_secure.equal[true]
}
/** There exists some tosca.capabilities.Endpoint.Admin */
run Show_tosca_capabilities_Endpoint_Admin {
tosca_capabilities_Endpoint_Admin.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Endpoint_Admin
expect 1
sig tosca_capabilities_Endpoint_Database extends tosca_capabilities_Endpoint
{
} {
}
/** There exists some tosca.capabilities.Endpoint.Database */
run Show_tosca_capabilities_Endpoint_Database {
tosca_capabilities_Endpoint_Database.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Endpoint_Database
expect 1
sig tosca_capabilities_Attachment extends tosca_capabilities_Root
{
} {
}
/** There exists some tosca.capabilities.Attachment */
run Show_tosca_capabilities_Attachment {
tosca_capabilities_Attachment.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Attachment
expect 1
sig tosca_capabilities_OperatingSystem extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML architecture: {'type': 'string', 'required': False}
property_architecture: lone string,
// YAML type: {'type': 'string', 'required': False}
property_type: lone string,
// YAML distribution: {'type': 'string', 'required': False}
property_distribution: lone string,
// YAML version: {'type': 'version', 'required': False}
property_version: lone version,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
}
/** There exists some tosca.capabilities.OperatingSystem */
run Show_tosca_capabilities_OperatingSystem {
tosca_capabilities_OperatingSystem.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_OperatingSystem
expect 1
sig tosca_capabilities_Scalable extends tosca_capabilities_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML min_instances: {'type': 'integer', 'default': 1, 'constraints': [{'greater_or_equal': 1}]}
property_min_instances: one integer,
// YAML max_instances: {'type': 'integer', 'default': 1, 'constraints': [{'greater_or_equal': 1}]}
property_max_instances: one integer,
// YAML default_instances: {'required': False, 'type': 'integer', 'constraints': [{'greater_or_equal': 1}]}
property_default_instances: lone integer,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_min_instances.greater_or_equal[1]
property_max_instances.greater_or_equal[1]
some property_default_instances implies property_default_instances.greater_or_equal[1]
}
/** There exists some tosca.capabilities.Scalable */
run Show_tosca_capabilities_Scalable {
tosca_capabilities_Scalable.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_Scalable
expect 1
sig tosca_capabilities_network_Bindable extends tosca_capabilities_Node
{
} {
}
/** There exists some tosca.capabilities.network.Bindable */
run Show_tosca_capabilities_network_Bindable {
tosca_capabilities_network_Bindable.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_network_Bindable
expect 1
sig tosca_capabilities_network_Linkable extends tosca_capabilities_Node
{
} {
}
/** There exists some tosca.capabilities.network.Linkable */
run Show_tosca_capabilities_network_Linkable {
tosca_capabilities_network_Linkable.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 1 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Interface,
exactly 0 TOSCA/Requirement,
exactly 0 TOSCA/Operation,
exactly 1 tosca_capabilities_network_Linkable
expect 1
// --------------------------------------------------
// Relationship Types
// --------------------------------------------------
//
// The TOSCA root Relationship Type all other TOSCA base Relationship Types derive from
//
sig tosca_relationships_Root extends TOSCA/Relationship
{
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// YAML tosca_id: {'type': 'string'}
attribute_tosca_id: one string,
// YAML tosca_name: {'type': 'string'}
attribute_tosca_name: one string,
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Configure: {'type': 'tosca.interfaces.relationship.Configure'}
interface_Configure: one tosca_interfaces_relationship_Configure,
} {
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Configure: {'type': 'tosca.interfaces.relationship.Configure'}
interface[interface_Configure]
interface_Configure.name["Configure"]
}
/** There exists some tosca.relationships.Root */
run Show_tosca_relationships_Root {
tosca_relationships_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_Root
expect 1
sig tosca_relationships_DependsOn extends tosca_relationships_Root
{
} {
valid_target_types[tosca_capabilities_Node]
}
/** There exists some tosca.relationships.DependsOn */
run Show_tosca_relationships_DependsOn {
tosca_relationships_DependsOn.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_DependsOn
expect 1
sig tosca_relationships_HostedOn extends tosca_relationships_Root
{
} {
valid_target_types[tosca_capabilities_Container]
}
/** There exists some tosca.relationships.HostedOn */
run Show_tosca_relationships_HostedOn {
tosca_relationships_HostedOn.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_HostedOn
expect 1
sig tosca_relationships_ConnectsTo extends tosca_relationships_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML credential: {'type': 'tosca.datatypes.Credential', 'required': False}
property_credential: lone tosca_datatypes_Credential,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
valid_target_types[tosca_capabilities_Endpoint]
}
/** There exists some tosca.relationships.ConnectsTo */
run Show_tosca_relationships_ConnectsTo {
tosca_relationships_ConnectsTo.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_ConnectsTo
expect 1
sig tosca_relationships_AttachesTo extends tosca_relationships_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML location: {'type': 'string', 'constraints': [{'min_length': 1}]}
property_location: one string,
// YAML device: {'type': 'string', 'required': False}
property_device: lone string,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_location.min_length[1]
valid_target_types[tosca_capabilities_Attachment]
}
/** There exists some tosca.relationships.AttachesTo */
run Show_tosca_relationships_AttachesTo {
tosca_relationships_AttachesTo.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_AttachesTo
expect 1
sig tosca_relationships_RoutesTo extends tosca_relationships_ConnectsTo
{
} {
valid_target_types[tosca_capabilities_Endpoint]
}
/** There exists some tosca.relationships.RoutesTo */
run Show_tosca_relationships_RoutesTo {
tosca_relationships_RoutesTo.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_RoutesTo
expect 1
sig tosca_relationships_network_LinksTo extends tosca_relationships_DependsOn
{
} {
valid_target_types[tosca_capabilities_network_Linkable]
}
/** There exists some tosca.relationships.network.LinksTo */
run Show_tosca_relationships_network_LinksTo {
tosca_relationships_network_LinksTo.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_network_LinksTo
expect 1
sig tosca_relationships_network_BindsTo extends tosca_relationships_DependsOn
{
} {
valid_target_types[tosca_capabilities_network_Bindable]
}
/** There exists some tosca.relationships.network.BindsTo */
run Show_tosca_relationships_network_BindsTo {
tosca_relationships_network_BindsTo.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_relationships_network_BindsTo
expect 1
// --------------------------------------------------
// Interface Types
// --------------------------------------------------
//
// The TOSCA root Interface Type all other TOSCA base Interface Types derive from
//
sig tosca_interfaces_Root extends TOSCA/Interface
{
// --------------------------------------------------
// Operations
// --------------------------------------------------
} {
// --------------------------------------------------
// Operations
// --------------------------------------------------
}
/** There exists some tosca.interfaces.Root */
run Show_tosca_interfaces_Root {
tosca_interfaces_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 0 TOSCA/Operation,
exactly 8 TOSCA/Parameter,
exactly 1 tosca_interfaces_Root
expect 1
sig tosca_interfaces_node_lifecycle_Standard extends tosca_interfaces_Root
{
// --------------------------------------------------
// Operations
// --------------------------------------------------
// YAML create: {'description': 'Standard lifecycle create operation.'}
//
// Standard lifecycle create operation.
//
operation_create: one TOSCA/Operation,
// YAML configure: {'description': 'Standard lifecycle configure operation.'}
//
// Standard lifecycle configure operation.
//
operation_configure: one TOSCA/Operation,
// YAML start: {'description': 'Standard lifecycle start operation.'}
//
// Standard lifecycle start operation.
//
operation_start: one TOSCA/Operation,
// YAML stop: {'description': 'Standard lifecycle stop operation.'}
//
// Standard lifecycle stop operation.
//
operation_stop: one TOSCA/Operation,
// YAML delete: {'description': 'Standard lifecycle delete operation.'}
//
// Standard lifecycle delete operation.
//
operation_delete: one TOSCA/Operation,
} {
// --------------------------------------------------
// Operations
// --------------------------------------------------
// YAML create: {'description': 'Standard lifecycle create operation.'}
//
// Standard lifecycle create operation.
//
operation_create.name["create"]
operation[operation_create]
// YAML configure: {'description': 'Standard lifecycle configure operation.'}
//
// Standard lifecycle configure operation.
//
operation_configure.name["configure"]
operation[operation_configure]
// YAML start: {'description': 'Standard lifecycle start operation.'}
//
// Standard lifecycle start operation.
//
operation_start.name["start"]
operation[operation_start]
// YAML stop: {'description': 'Standard lifecycle stop operation.'}
//
// Standard lifecycle stop operation.
//
operation_stop.name["stop"]
operation[operation_stop]
// YAML delete: {'description': 'Standard lifecycle delete operation.'}
//
// Standard lifecycle delete operation.
//
operation_delete.name["delete"]
operation[operation_delete]
}
/** There exists some tosca.interfaces.node.lifecycle.Standard */
run Show_tosca_interfaces_node_lifecycle_Standard {
tosca_interfaces_node_lifecycle_Standard.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 5 TOSCA/Operation,
exactly 8 TOSCA/Parameter,
exactly 1 tosca_interfaces_node_lifecycle_Standard
expect 1
sig tosca_interfaces_relationship_Configure extends tosca_interfaces_Root
{
// --------------------------------------------------
// Operations
// --------------------------------------------------
// YAML pre_configure_source: {'description': 'Operation to pre-configure the source endpoint.'}
//
// Operation to pre-configure the source endpoint.
//
operation_pre_configure_source: one TOSCA/Operation,
// YAML pre_configure_target: {'description': 'Operation to pre-configure the target endpoint.'}
//
// Operation to pre-configure the target endpoint.
//
operation_pre_configure_target: one TOSCA/Operation,
// YAML post_configure_source: {'description': 'Operation to post-configure the source endpoint.'}
//
// Operation to post-configure the source endpoint.
//
operation_post_configure_source: one TOSCA/Operation,
// YAML post_configure_target: {'description': 'Operation to post-configure the target endpoint.'}
//
// Operation to post-configure the target endpoint.
//
operation_post_configure_target: one TOSCA/Operation,
// YAML add_target: {'description': 'Operation to notify the source node of a target node being added via a relationship.'}
//
// Operation to notify the source node of a target node being added via a relationship.
//
operation_add_target: one TOSCA/Operation,
// YAML add_source: {'description': 'Operation to notify the target node of a source node which is now available via a relationship.'}
//
// Operation to notify the target node of a source node which is now available via a relationship.
//
operation_add_source: one TOSCA/Operation,
// YAML target_changed: {'description': 'Operation to notify source some property or attribute of the target changed'}
//
// Operation to notify source some property or attribute of the target changed
//
operation_target_changed: one TOSCA/Operation,
// YAML remove_target: {'description': 'Operation to remove a target node.'}
//
// Operation to remove a target node.
//
operation_remove_target: one TOSCA/Operation,
} {
// --------------------------------------------------
// Operations
// --------------------------------------------------
// YAML pre_configure_source: {'description': 'Operation to pre-configure the source endpoint.'}
//
// Operation to pre-configure the source endpoint.
//
operation_pre_configure_source.name["pre_configure_source"]
operation[operation_pre_configure_source]
// YAML pre_configure_target: {'description': 'Operation to pre-configure the target endpoint.'}
//
// Operation to pre-configure the target endpoint.
//
operation_pre_configure_target.name["pre_configure_target"]
operation[operation_pre_configure_target]
// YAML post_configure_source: {'description': 'Operation to post-configure the source endpoint.'}
//
// Operation to post-configure the source endpoint.
//
operation_post_configure_source.name["post_configure_source"]
operation[operation_post_configure_source]
// YAML post_configure_target: {'description': 'Operation to post-configure the target endpoint.'}
//
// Operation to post-configure the target endpoint.
//
operation_post_configure_target.name["post_configure_target"]
operation[operation_post_configure_target]
// YAML add_target: {'description': 'Operation to notify the source node of a target node being added via a relationship.'}
//
// Operation to notify the source node of a target node being added via a relationship.
//
operation_add_target.name["add_target"]
operation[operation_add_target]
// YAML add_source: {'description': 'Operation to notify the target node of a source node which is now available via a relationship.'}
//
// Operation to notify the target node of a source node which is now available via a relationship.
//
operation_add_source.name["add_source"]
operation[operation_add_source]
// YAML target_changed: {'description': 'Operation to notify source some property or attribute of the target changed'}
//
// Operation to notify source some property or attribute of the target changed
//
operation_target_changed.name["target_changed"]
operation[operation_target_changed]
// YAML remove_target: {'description': 'Operation to remove a target node.'}
//
// Operation to remove a target node.
//
operation_remove_target.name["remove_target"]
operation[operation_remove_target]
}
/** There exists some tosca.interfaces.relationship.Configure */
run Show_tosca_interfaces_relationship_Configure {
tosca_interfaces_relationship_Configure.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 0 LocationGraphs/Location,
exactly 0 LocationGraphs/Name,
exactly 0 LocationGraphs/Role,
exactly 0 LocationGraphs/Process,
exactly 0 LocationGraphs/Sort,
exactly 0 TOSCA/Artifact,
exactly 0 TOSCA/Attribute,
exactly 8 TOSCA/Operation,
exactly 8 TOSCA/Parameter,
exactly 1 tosca_interfaces_relationship_Configure
expect 1
// --------------------------------------------------
// Node Types
// --------------------------------------------------
//
// The TOSCA Node Type all other TOSCA base Node Types derive from
//
sig tosca_nodes_Root extends TOSCA/Node
{
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// YAML tosca_id: {'type': 'string'}
attribute_tosca_id: one string,
// YAML tosca_name: {'type': 'string'}
attribute_tosca_name: one string,
// YAML state: {'type': 'string'}
attribute_state: one string,
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Standard: {'type': 'tosca.interfaces.node.lifecycle.Standard'}
interface_Standard: one tosca_interfaces_node_lifecycle_Standard,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML feature: {'type': 'tosca.capabilities.Node'}
capability_feature: some tosca_capabilities_Node,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML dependency: {'capability': 'tosca.capabilities.Node', 'node': 'tosca.nodes.Root', 'relationship': 'tosca.relationships.DependsOn', 'occurrences': [0, 'UNBOUNDED']}
requirement_dependency: set TOSCA/Requirement,
} {
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Standard: {'type': 'tosca.interfaces.node.lifecycle.Standard'}
interface[interface_Standard]
interface_Standard.name["Standard"]
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML feature: {'type': 'tosca.capabilities.Node'}
capability_feature.name["feature"]
capability[capability_feature]
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML dependency: {'capability': 'tosca.capabilities.Node', 'node': 'tosca.nodes.Root', 'relationship': 'tosca.relationships.DependsOn', 'occurrences': [0, 'UNBOUNDED']}
requirement["dependency", requirement_dependency]
requirement_dependency.capability[tosca_capabilities_Node]
requirement_dependency.relationship[tosca_relationships_DependsOn]
requirement_dependency.node[tosca_nodes_Root]
// YAML occurrences: [0, 'UNBOUNDED']
}
/** There exists some tosca.nodes.Root */
run Show_tosca_nodes_Root {
tosca_nodes_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_Root
expect 1
sig tosca_nodes_Compute extends tosca_nodes_Root
{
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// YAML private_address: {'type': 'string'}
attribute_private_address: one string,
// YAML public_address: {'type': 'string'}
attribute_public_address: one string,
// YAML networks: {'type': 'map', 'entry_schema': {'type': 'tosca.datatypes.network.NetworkInfo'}}
attribute_networks: one TOSCA/map_data/Map,
// YAML ports: {'type': 'map', 'entry_schema': {'type': 'tosca.datatypes.network.PortInfo'}}
attribute_ports: one TOSCA/map_data/Map,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.SoftwareComponent']}
capability_host: some tosca_capabilities_Container,
// YAML endpoint: {'type': 'tosca.capabilities.Endpoint.Admin'}
capability_endpoint: some tosca_capabilities_Endpoint_Admin,
// YAML os: {'type': 'tosca.capabilities.OperatingSystem'}
capability_os: some tosca_capabilities_OperatingSystem,
// YAML scalable: {'type': 'tosca.capabilities.Scalable'}
capability_scalable: some tosca_capabilities_Scalable,
// YAML binding: {'type': 'tosca.capabilities.network.Bindable'}
capability_binding: some tosca_capabilities_network_Bindable,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML local_storage: {'capability': 'tosca.capabilities.Attachment', 'node': 'tosca.nodes.BlockStorage', 'relationship': 'tosca.relationships.AttachesTo', 'occurrences': [0, 'UNBOUNDED']}
requirement_local_storage: set TOSCA/Requirement,
} {
// --------------------------------------------------
// Attributes
// --------------------------------------------------
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.SoftwareComponent']}
capability_host.name["host"]
capability[capability_host]
capability_host.valid_source_types[tosca_nodes_SoftwareComponent]
// YAML endpoint: {'type': 'tosca.capabilities.Endpoint.Admin'}
capability_endpoint.name["endpoint"]
capability[capability_endpoint]
// YAML os: {'type': 'tosca.capabilities.OperatingSystem'}
capability_os.name["os"]
capability[capability_os]
// YAML scalable: {'type': 'tosca.capabilities.Scalable'}
capability_scalable.name["scalable"]
capability[capability_scalable]
// YAML binding: {'type': 'tosca.capabilities.network.Bindable'}
capability_binding.name["binding"]
capability[capability_binding]
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML local_storage: {'capability': 'tosca.capabilities.Attachment', 'node': 'tosca.nodes.BlockStorage', 'relationship': 'tosca.relationships.AttachesTo', 'occurrences': [0, 'UNBOUNDED']}
requirement["local_storage", requirement_local_storage]
requirement_local_storage.capability[tosca_capabilities_Attachment]
requirement_local_storage.relationship[tosca_relationships_AttachesTo]
requirement_local_storage.node[tosca_nodes_BlockStorage]
// YAML occurrences: [0, 'UNBOUNDED']
}
/** There exists some tosca.nodes.Compute */
run Show_tosca_nodes_Compute {
tosca_nodes_Compute.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_Compute
expect 1
sig tosca_nodes_SoftwareComponent extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML component_version: {'type': 'version', 'required': False}
property_component_version: lone version,
// YAML admin_credential: {'type': 'tosca.datatypes.Credential', 'required': False}
property_admin_credential: lone tosca_datatypes_Credential,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.Compute', 'relationship': 'tosca.relationships.HostedOn'}
requirement_host: one TOSCA/Requirement,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.Compute', 'relationship': 'tosca.relationships.HostedOn'}
requirement["host", requirement_host]
requirement_host.capability[tosca_capabilities_Container]
requirement_host.relationship[tosca_relationships_HostedOn]
requirement_host.node[tosca_nodes_Compute]
}
/** There exists some tosca.nodes.SoftwareComponent */
run Show_tosca_nodes_SoftwareComponent {
tosca_nodes_SoftwareComponent.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 3 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_SoftwareComponent
expect 1
sig tosca_nodes_WebServer extends tosca_nodes_SoftwareComponent
{
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML data_endpoint: tosca.capabilities.Endpoint
capability_data_endpoint: some tosca_capabilities_Endpoint,
// YAML admin_endpoint: tosca.capabilities.Endpoint.Admin
capability_admin_endpoint: some tosca_capabilities_Endpoint_Admin,
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.WebApplication']}
capability_host: some tosca_capabilities_Container,
} {
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML data_endpoint: tosca.capabilities.Endpoint
capability_data_endpoint.name["data_endpoint"]
capability[capability_data_endpoint]
// YAML admin_endpoint: tosca.capabilities.Endpoint.Admin
capability_admin_endpoint.name["admin_endpoint"]
capability[capability_admin_endpoint]
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.WebApplication']}
capability_host.name["host"]
capability[capability_host]
capability_host.valid_source_types[tosca_nodes_WebApplication]
}
/** There exists some tosca.nodes.WebServer */
run Show_tosca_nodes_WebServer {
tosca_nodes_WebServer.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 3 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_WebServer
expect 1
sig tosca_nodes_WebApplication extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML context_root: {'type': 'string', 'required': False}
property_context_root: lone string,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML app_endpoint: {'type': 'tosca.capabilities.Endpoint'}
capability_app_endpoint: some tosca_capabilities_Endpoint,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.WebServer', 'relationship': 'tosca.relationships.HostedOn'}
requirement_host: one TOSCA/Requirement,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML app_endpoint: {'type': 'tosca.capabilities.Endpoint'}
capability_app_endpoint.name["app_endpoint"]
capability[capability_app_endpoint]
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.WebServer', 'relationship': 'tosca.relationships.HostedOn'}
requirement["host", requirement_host]
requirement_host.capability[tosca_capabilities_Container]
requirement_host.relationship[tosca_relationships_HostedOn]
requirement_host.node[tosca_nodes_WebServer]
}
/** There exists some tosca.nodes.WebApplication */
run Show_tosca_nodes_WebApplication {
tosca_nodes_WebApplication.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 5 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 5 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_WebApplication
expect 1
sig tosca_nodes_DBMS extends tosca_nodes_SoftwareComponent
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML root_password: {'type': 'string', 'required': False, 'description': 'the optional root password for the DBMS service'}
//
// the optional root password for the DBMS service
//
property_root_password: lone string,
// YAML port: {'type': 'integer', 'required': False, 'description': 'the port the DBMS service will listen to for data and requests'}
//
// the port the DBMS service will listen to for data and requests
//
property_port: lone integer,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.Database']}
capability_host: some tosca_capabilities_Container,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.Database']}
capability_host.name["host"]
capability[capability_host]
capability_host.valid_source_types[tosca_nodes_Database]
}
/** There exists some tosca.nodes.DBMS */
run Show_tosca_nodes_DBMS {
tosca_nodes_DBMS.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 3 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_DBMS
expect 1
sig tosca_nodes_Database extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML name: {'type': 'string', 'description': 'the logical name of the database'}
//
// the logical name of the database
//
property_name: one string,
// YAML port: {'type': 'integer', 'description': 'the port the underlying database service will listen to for data', 'required': False}
//
// the port the underlying database service will listen to for data
//
property_port: lone integer,
// YAML user: {'type': 'string', 'description': 'the optional user account name for DB administration', 'required': False}
//
// the optional user account name for DB administration
//
property_user: lone string,
// YAML password: {'type': 'string', 'description': 'the optional password for the DB user account', 'required': False}
//
// the optional password for the DB user account
//
property_password: lone string,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML database_endpoint: {'type': 'tosca.capabilities.Endpoint.Database'}
capability_database_endpoint: some tosca_capabilities_Endpoint_Database,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.DBMS', 'relationship': 'tosca.relationships.HostedOn'}
requirement_host: one TOSCA/Requirement,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML database_endpoint: {'type': 'tosca.capabilities.Endpoint.Database'}
capability_database_endpoint.name["database_endpoint"]
capability[capability_database_endpoint]
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.DBMS', 'relationship': 'tosca.relationships.HostedOn'}
requirement["host", requirement_host]
requirement_host.capability[tosca_capabilities_Container]
requirement_host.relationship[tosca_relationships_HostedOn]
requirement_host.node[tosca_nodes_DBMS]
}
/** There exists some tosca.nodes.Database */
run Show_tosca_nodes_Database {
tosca_nodes_Database.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 5 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 5 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_Database
expect 1
sig tosca_nodes_ObjectStorage extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML name: {'type': 'string'}
property_name: one string,
// YAML size: {'type': 'scalar-unit.size', 'constraints': [{'greater_or_equal': '0 GB'}], 'required': False}
property_size: lone scalar_unit_size,
// YAML maxsize: {'type': 'scalar-unit.size', 'constraints': [{'greater_or_equal': '0 GB'}], 'required': False}
property_maxsize: lone scalar_unit_size,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML storage_endpoint: {'type': 'tosca.capabilities.Endpoint'}
capability_storage_endpoint: some tosca_capabilities_Endpoint,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
some property_size implies property_size.greater_or_equal[0, GB]
some property_maxsize implies property_maxsize.greater_or_equal[0, GB]
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML storage_endpoint: {'type': 'tosca.capabilities.Endpoint'}
capability_storage_endpoint.name["storage_endpoint"]
capability[capability_storage_endpoint]
}
/** There exists some tosca.nodes.ObjectStorage */
run Show_tosca_nodes_ObjectStorage {
tosca_nodes_ObjectStorage.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_ObjectStorage
expect 1
sig tosca_nodes_BlockStorage extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML size: {'type': 'scalar-unit.size', 'constraints': [{'greater_or_equal': '1 MB'}]}
property_size: one scalar_unit_size,
// YAML volume_id: {'type': 'string', 'required': False}
property_volume_id: lone string,
// YAML snapshot_id: {'type': 'string', 'required': False}
property_snapshot_id: lone string,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML attachment: {'type': 'tosca.capabilities.Attachment'}
capability_attachment: some tosca_capabilities_Attachment,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_size.greater_or_equal[1, MB]
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML attachment: {'type': 'tosca.capabilities.Attachment'}
capability_attachment.name["attachment"]
capability[capability_attachment]
}
/** There exists some tosca.nodes.BlockStorage */
run Show_tosca_nodes_BlockStorage {
tosca_nodes_BlockStorage.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_BlockStorage
expect 1
sig tosca_nodes_Container_Runtime extends tosca_nodes_SoftwareComponent
{
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.Container.Application']}
capability_host: some tosca_capabilities_Container,
// YAML scalable: {'type': 'tosca.capabilities.Scalable'}
capability_scalable: some tosca_capabilities_Scalable,
} {
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML host: {'type': 'tosca.capabilities.Container', 'valid_source_types': ['tosca.nodes.Container.Application']}
capability_host.name["host"]
capability[capability_host]
capability_host.valid_source_types[tosca_nodes_Container_Application]
// YAML scalable: {'type': 'tosca.capabilities.Scalable'}
capability_scalable.name["scalable"]
capability[capability_scalable]
}
/** There exists some tosca.nodes.Container.Runtime */
run Show_tosca_nodes_Container_Runtime {
tosca_nodes_Container_Runtime.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 3 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_Container_Runtime
expect 1
sig tosca_nodes_Container_Application extends tosca_nodes_Root
{
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.Container.Runtime', 'relationship': 'tosca.relationships.HostedOn'}
requirement_host: one TOSCA/Requirement,
} {
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML host: {'capability': 'tosca.capabilities.Container', 'node': 'tosca.nodes.Container.Runtime', 'relationship': 'tosca.relationships.HostedOn'}
requirement["host", requirement_host]
requirement_host.capability[tosca_capabilities_Container]
requirement_host.relationship[tosca_relationships_HostedOn]
requirement_host.node[tosca_nodes_Container_Runtime]
}
/** There exists some tosca.nodes.Container.Application */
run Show_tosca_nodes_Container_Application {
tosca_nodes_Container_Application.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 5 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 5 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_Container_Application
expect 1
sig tosca_nodes_LoadBalancer extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML algorithm: {'type': 'string', 'required': False, 'status': 'experimental'}
property_algorithm: lone string,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML client: {'type': 'tosca.capabilities.Endpoint.Public', 'occurrences': [0, 'UNBOUNDED'], 'description': 'The Floating (IP) client’s on the public network can connect to'}
//
// The Floating (IP) client’s on the public network can connect to
//
capability_client: set tosca_capabilities_Endpoint_Public,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML application: {'capability': 'tosca.capabilities.Endpoint', 'relationship': 'tosca.relationships.RoutesTo', 'occurrences': [0, 'UNBOUNDED'], 'description': 'Connection to one or more load balanced applications'}
//
// Connection to one or more load balanced applications
//
requirement_application: set TOSCA/Requirement,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
//
// The Floating (IP) client’s on the public network can connect to
//
// YAML client: {'type': 'tosca.capabilities.Endpoint.Public', 'occurrences': [0, 'UNBOUNDED'], 'description': 'The Floating (IP) client’s on the public network can connect to'}
capability_client.name["client"]
capability[capability_client]
// YAML occurrences: [0, 'UNBOUNDED']
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML application: {'capability': 'tosca.capabilities.Endpoint', 'relationship': 'tosca.relationships.RoutesTo', 'occurrences': [0, 'UNBOUNDED'], 'description': 'Connection to one or more load balanced applications'}
//
// Connection to one or more load balanced applications
//
requirement["application", requirement_application]
requirement_application.capability[tosca_capabilities_Endpoint]
requirement_application.relationship[tosca_relationships_RoutesTo]
// YAML occurrences: [0, 'UNBOUNDED']
}
/** There exists some tosca.nodes.LoadBalancer */
run Show_tosca_nodes_LoadBalancer {
tosca_nodes_LoadBalancer.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_LoadBalancer
expect 1
sig tosca_nodes_network_Network extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML ip_version: {'type': 'integer', 'required': False, 'default': 4, 'constraints': [{'valid_values': [4, 6]}]}
property_ip_version: lone integer,
// YAML cidr: {'type': 'string', 'required': False}
property_cidr: lone string,
// YAML start_ip: {'type': 'string', 'required': False}
property_start_ip: lone string,
// YAML end_ip: {'type': 'string', 'required': False}
property_end_ip: lone string,
// YAML gateway_ip: {'type': 'string', 'required': False}
property_gateway_ip: lone string,
// YAML network_name: {'type': 'string', 'required': False}
property_network_name: lone string,
// YAML network_id: {'type': 'string', 'required': False}
property_network_id: lone string,
// YAML segmentation_id: {'type': 'string', 'required': False}
property_segmentation_id: lone string,
// YAML network_type: {'type': 'string', 'required': False}
property_network_type: lone string,
// YAML physical_network: {'type': 'string', 'required': False}
property_physical_network: lone string,
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML link: {'type': 'tosca.capabilities.network.Linkable'}
capability_link: some tosca_capabilities_network_Linkable,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_ip_version.valid_values[4 + 6]
// --------------------------------------------------
// Capabilities
// --------------------------------------------------
// YAML link: {'type': 'tosca.capabilities.network.Linkable'}
capability_link.name["link"]
capability[capability_link]
}
/** There exists some tosca.nodes.network.Network */
run Show_tosca_nodes_network_Network {
tosca_nodes_network_Network.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_network_Network
expect 1
sig tosca_nodes_network_Port extends tosca_nodes_Root
{
// --------------------------------------------------
// Properties
// --------------------------------------------------
// YAML ip_address: {'type': 'string', 'required': False}
property_ip_address: lone string,
// YAML order: {'type': 'integer', 'required': True, 'default': 0, 'constraints': [{'greater_or_equal': 0}]}
property_order: one integer,
// YAML is_default: {'type': 'boolean', 'required': False, 'default': False}
property_is_default: lone boolean,
// YAML ip_range_start: {'type': 'string', 'required': False}
property_ip_range_start: lone string,
// YAML ip_range_end: {'type': 'string', 'required': False}
property_ip_range_end: lone string,
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML link: {'capability': 'tosca.capabilities.network.Linkable', 'relationship': 'tosca.relationships.network.LinksTo'}
requirement_link: one TOSCA/Requirement,
// YAML binding: {'capability': 'tosca.capabilities.network.Bindable', 'relationship': 'tosca.relationships.network.BindsTo'}
requirement_binding: one TOSCA/Requirement,
} {
// --------------------------------------------------
// Properties
// --------------------------------------------------
property_order.greater_or_equal[0]
// --------------------------------------------------
// Requirements
// --------------------------------------------------
// YAML link: {'capability': 'tosca.capabilities.network.Linkable', 'relationship': 'tosca.relationships.network.LinksTo'}
requirement["link", requirement_link]
requirement_link.capability[tosca_capabilities_network_Linkable]
requirement_link.relationship[tosca_relationships_network_LinksTo]
// YAML binding: {'capability': 'tosca.capabilities.network.Bindable', 'relationship': 'tosca.relationships.network.BindsTo'}
requirement["binding", requirement_binding]
requirement_binding.capability[tosca_capabilities_network_Bindable]
requirement_binding.relationship[tosca_relationships_network_BindsTo]
}
/** There exists some tosca.nodes.network.Port */
run Show_tosca_nodes_network_Port {
tosca_nodes_network_Port.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 3 LocationGraphs/Location,
exactly 35 LocationGraphs/Value,
exactly 3 LocationGraphs/Name,
exactly 1 LocationGraphs/Sort,
exactly 1 LocationGraphs/Process,
exactly 0 TOSCA/Group,
exactly 0 TOSCA/Policy,
exactly 1 tosca_nodes_network_Port
expect 1
// --------------------------------------------------
// Group Types
// --------------------------------------------------
//
// The TOSCA Group Type all other TOSCA Group Types derive from
//
sig tosca_groups_Root extends TOSCA/Group
{
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Standard: {'type': 'tosca.interfaces.node.lifecycle.Standard'}
interface_Standard: one tosca_interfaces_node_lifecycle_Standard,
} {
// --------------------------------------------------
// Interfaces
// --------------------------------------------------
// YAML Standard: {'type': 'tosca.interfaces.node.lifecycle.Standard'}
interface[interface_Standard]
interface_Standard.name["Standard"]
}
/** There exists some tosca.groups.Root */
run Show_tosca_groups_Root {
tosca_groups_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_groups_Root
expect 1
// --------------------------------------------------
// Policy Types
// --------------------------------------------------
//
// The TOSCA Policy Type all other TOSCA Policy Types derive from
//
sig tosca_policies_Root extends TOSCA/Policy
{
} {
}
/** There exists some tosca.policies.Root */
run Show_tosca_policies_Root {
tosca_policies_Root.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_policies_Root
expect 1
//
// The TOSCA Policy Type definition that is used to govern placement of TOSCA nodes or groups of nodes.
//
sig tosca_policies_Placement extends tosca_policies_Root
{
} {
}
/** There exists some tosca.policies.Placement */
run Show_tosca_policies_Placement {
tosca_policies_Placement.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_policies_Placement
expect 1
//
// The TOSCA Policy Type definition that is used to govern scaling of TOSCA nodes or groups of nodes.
//
sig tosca_policies_Scaling extends tosca_policies_Root
{
} {
}
/** There exists some tosca.policies.Scaling */
run Show_tosca_policies_Scaling {
tosca_policies_Scaling.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_policies_Scaling
expect 1
//
// The TOSCA Policy Type definition that is used to govern update of TOSCA nodes or groups of nodes.
//
sig tosca_policies_Update extends tosca_policies_Root
{
} {
}
/** There exists some tosca.policies.Update */
run Show_tosca_policies_Update {
tosca_policies_Update.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_policies_Update
expect 1
//
// The TOSCA Policy Type definition that is used to declare performance requirements for TOSCA nodes or groups of nodes.
//
sig tosca_policies_Performance extends tosca_policies_Root
{
} {
}
/** There exists some tosca.policies.Performance */
run Show_tosca_policies_Performance {
tosca_policies_Performance.no_name[]
} for 5 but
8 Int,
5 seq,
// NOTE: Setting following scopes strongly reduces the research space.
exactly 0 LocationGraphs/LocationGraph,
exactly 1 LocationGraphs/Location,
exactly 1 LocationGraphs/Name,
exactly 1 LocationGraphs/Process,
exactly 1 LocationGraphs/Sort,
exactly 1 tosca_policies_Performance
expect 1
|
src/apsepp-output_class-standard.adb | thierr26/ada-apsepp | 0 | 2884 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Ada.Text_IO;
package body Apsepp.Output_Class.Standard is
----------------------------------------------------------------------------
protected body Output_Standard is
-----------------------------------------------------
procedure Put_Line (S : String) is
begin
Ada.Text_IO.Put_Line (S);
end Put_Line;
-----------------------------------------------------
end Output_Standard;
----------------------------------------------------------------------------
end Apsepp.Output_Class.Standard;
|
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_1084.asm | ljhsiun2/medusa | 9 | 245052 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x4968, %r9
nop
nop
nop
nop
and %rbp, %rbp
mov (%r9), %r15d
nop
nop
nop
xor $14469, %r13
lea addresses_WT_ht+0xf288, %r15
nop
nop
nop
sub $16062, %rax
movb (%r15), %r11b
nop
add %r15, %r15
lea addresses_D_ht+0x86c, %rax
nop
inc %r12
movl $0x61626364, (%rax)
sub $11671, %r11
lea addresses_WT_ht+0xcc78, %rsi
lea addresses_WC_ht+0xf0e8, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
sub %r13, %r13
mov $116, %rcx
rep movsb
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0x1a68, %r12
clflush (%r12)
nop
nop
nop
nop
xor $61517, %r9
mov $0x6162636465666768, %r15
movq %r15, (%r12)
nop
sub %r15, %r15
lea addresses_A_ht+0x94e8, %rsi
lea addresses_WT_ht+0x1a528, %rdi
nop
nop
xor %r9, %r9
mov $110, %rcx
rep movsq
sub %r9, %r9
lea addresses_D_ht+0x14f92, %r12
nop
add $60084, %rcx
mov (%r12), %rax
nop
nop
nop
add %rdi, %rdi
lea addresses_UC_ht+0x109d0, %r9
nop
add $41540, %rsi
mov (%r9), %r11d
nop
nop
nop
and $56108, %rcx
lea addresses_UC_ht+0x162e8, %rsi
lea addresses_WT_ht+0x1b0e8, %rdi
and $9447, %r13
mov $121, %rcx
rep movsb
nop
nop
xor $39722, %r15
lea addresses_D_ht+0x45e8, %rdi
nop
xor %rcx, %rcx
movb (%rdi), %r9b
nop
dec %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbx
push %rdx
// Faulty Load
mov $0x2e163600000004e8, %rax
nop
dec %rbx
mov (%rax), %edx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
applet/aide/source/aide-gui.adb | charlie5/aIDE | 3 | 16899 | <filename>applet/aide/source/aide-gui.adb
with
aIDE.Editor.of_subprogram,
aIDE.Editor.of_block,
aIDE.Editor.of_package,
aIDE.Editor.of_pragma,
aIDE.Palette.of_source_Entities,
aIDE.Palette.of_pragmas,
aIDE.Palette.of_exceptions,
aIDE.Palette.of_types,
adaM.a_Pragma,
Common_Gtk,
Glib,
Glib.Error,
Gtk.Main,
Gtk.Builder,
Gtk.Text_View,
Gtk.Tree_View,
Gtk.Tree_Model,
Gtk.Widget,
Gtk.Window,
Gtk.Alignment,
Gtk.Notebook,
Gtk.Tree_Store,
Gtk.Tree_Selection,
Gtk.Text_Iter,
Gtk.Handlers,
Pango.Font,
ada.Characters.latin_1,
ada.Text_IO;
with Ada.Text_IO;
with Ada.Tags;
package body aIDE.GUI
is
use Glib,
Glib.Error,
gtk.Button,
gtk.Builder,
gtk.Text_View,
gtk.Tree_View,
gtk.Window,
gtk.Alignment,
gtk.Notebook,
gtk.Tree_Store,
Pango.Font;
-- Editors
--
the_app_Editor : aIDE.Editor.of_subprogram.view;
the_package_Editor : aIDE.Editor.of_Package.view;
-- Palettes
--
the_source_entities_Palette : aIDE.Palette.of_source_entities.view;
the_pragma_Palette : aIDE.Palette.of_pragmas.view;
the_exceptions_Palette : aIDE.Palette.of_exceptions.view;
the_types_Palette : aIDE.Palette.of_types.view;
-- Main Widgets
--
top_Window : Gtk_Window;
the_top_Notebook : Gtk_Notebook;
-- 'App' Notebook Page Widgets
--
new_app_Button : Gtk_Button;
rid_app_Button : Gtk_Button;
the_app_tree_Store : gtk_tree_Store;
the_app_tree_View : gtk_tree_View;
the_app_tree_Selection : Gtk.Tree_Selection.gtk_Tree_Selection;
the_app_Alignment : Gtk_Alignment;
-- Builder Widgets
--
build_project_Button : Gtk_Button;
the_build_log_Textview : Gtk_Text_View;
-- Package Tab Widgets
--
choose_package_Button : Gtk_Button;
new_package_Button : Gtk_Button;
rid_package_Button : Gtk_Button;
the_package_tree_Store : gtk_tree_Store;
the_package_tree_View : gtk_tree_View;
the_package_tree_Selection : Gtk.Tree_Selection.gtk_Tree_Selection;
the_package_Alignment : Gtk_Alignment;
-- Gui Callbacks
--
package tree_selection_Handlers
is new Gtk.Handlers.Callback (Widget_Type => Gtk.Tree_Selection.Gtk_Tree_Selection_Record);
-- Gui Events
--
procedure on_build_project_Button_clicked (Button : access Gtk_Button_Record'Class)
is
pragma Unreferenced (Button);
begin
aIDE.build_Project;
end on_build_project_Button_clicked;
procedure destroy (Widget : access gtk.Widget.Gtk_Widget_Record'Class)
is
pragma Unreferenced (Widget);
begin
Gtk.Main.Main_Quit;
end Destroy;
procedure on_new_app_Button_clicked (Button : access Gtk_Button_Record'Class)
is
pragma Unreferenced (Button);
the_new_App : constant adam.Subprogram.view := adam.Subprogram.new_Subprogram (Name => anonymous_Procedure);
begin
all_Apps.append (the_new_App);
the_app_Editor.Target_is (the_new_App);
declare
use AdaM,
Gtk,
Gtk.Tree_Model;
Iter : gtk_tree_Iter;
Parent : constant gtk_tree_Iter := Null_Iter;
begin
the_app_tree_Store.append (Iter, Parent);
the_app_tree_Store.set (Iter, 0, +the_new_App.Name);
the_app_tree_Selection.select_Iter (Iter);
end;
end on_new_app_Button_clicked;
procedure on_rid_app_Button_clicked (Button : access Gtk_Button_Record'Class)
is
pragma Unreferenced (Button);
use Gtk,
Gtk.Tree_Model;
use type adam.Subprogram.view;
the_App : constant adam.Subprogram.view := the_app_Editor.Target;
Iter : gtk_tree_Iter;
the_Model : Gtk_Tree_Model;
begin
if the_App = the_selected_App then
return;
end if;
the_app_tree_Selection.get_Selected (the_Model, Iter);
the_app_tree_Store.remove (Iter);
the_app_tree_Selection.select_Iter (the_app_tree_Store.get_Iter_first);
all_Apps.delete (all_Apps.find_Index (the_App));
end on_rid_app_Button_clicked;
procedure on_app_Selection_changed (Selection : access Gtk.Tree_Selection.Gtk_Tree_Selection_Record'Class)
is
use AdaM,
gtk.Tree_Model,
ada.Text_IO;
Iter : Gtk_Tree_Iter;
the_model : Gtk_Tree_Model;
begin
Selection.Get_Selected (the_model, Iter);
if Iter /= null_Iter
then
declare
app_Name : constant String := gtk.Tree_Model.Get_String (the_model, Iter, 0);
begin
the_app_Editor.Target_is (fetch_App (+app_Name));
end;
end if;
end on_app_Selection_changed;
procedure on_choose_package_Button_clicked (Button : access Gtk_Button_Record'Class)
is
pragma Unreferenced (Button);
begin
Ada.Text_IO.put_Line ("YAY");
show_packages_Palette (Invoked_by => Button.all'Access,
Target => the_applet_Package);
end on_choose_package_Button_clicked;
procedure open
is
use Common_Gtk,
ada.Text_IO;
glade_Builder : Gtk_Builder;
Result : Guint; pragma Unreferenced (Result);
begin
-- put_Line ("************************************************");
-- put_Line ("'" & Duration'Image (Duration'Delta) & "'");
Gtk.Main.Init;
Gtk_New (glade_Builder);
-- Read in our Glade XML files.
--
declare
use ada.Text_IO;
Error : aliased GError;
begin
Result := glade_Builder.Add_From_File ("glade/adam.glade",
Error'Access);
if Error /= null
then
put_Line ( "Error adding 'adam.glade' to Glade builder: "
& Get_Message (Error));
Error_Free (Error);
end if;
end;
-- Set our references to each important widget.
--
top_Window := Gtk_Window (glade_Builder.Get_Object ("top_Window"));
the_top_Notebook := Gtk_Notebook (glade_Builder.Get_Object ("top_Notebook"));
the_app_Alignment := gtk_Alignment (glade_Builder.Get_Object ("app_editor_Alignment"));
new_app_Button := gtk_Button (glade_Builder.Get_Object ("new_app_Button"));
rid_app_Button := gtk_Button (glade_Builder.Get_Object ("rid_app_Button"));
the_app_tree_Store := gtk_tree_Store (glade_Builder.Get_Object ("app_tree_Store"));
the_app_tree_View := gtk_tree_View (glade_Builder.Get_Object ("app_tree_View"));
the_app_tree_Selection := the_app_tree_View.Get_Selection;
build_project_Button := gtk_Button (glade_Builder.Get_Object ("build_project_Button"));
the_build_log_Textview := gtk_Text_view (glade_Builder.Get_Object ("builder_log_Textview"));
top_Window.Modify_Font (Font_Desc => From_String ("Courier 10"));
-- Hide unused pages in the top notebook.
--
the_top_Notebook.get_Nth_Page (0).hide;
-- the_top_Notebook.get_Nth_Page (2).hide;
the_top_Notebook.get_Nth_Page (3).hide;
the_top_Notebook.get_Nth_Page (4).hide;
log ("Welcome... ");
Widget_Handler.connect (top_Window,
"destroy",
Widget_Handler.To_Marshaller (Destroy'Access));
Button_Handler.connect (build_project_Button,
"clicked",
on_build_project_Button_clicked'Access);
Button_Handler.Connect (new_app_Button,
"clicked",
on_new_app_Button_clicked'Access);
Button_Handler.Connect (rid_app_Button,
"clicked",
on_rid_app_Button_clicked'Access);
the_app_Editor := aIDE.Editor.of_subprogram.Forge.to_subprogram_Editor (the_selected_App);
the_app_Editor.top_Widget.Reparent (New_Parent => the_app_Alignment);
for Each of all_Apps
loop
declare
use AdaM,
Gtk.Tree_Model;
use type AdaM.Subprogram.view;
Iter : gtk_tree_Iter;
Parent : constant gtk_tree_Iter := Null_Iter;
begin
the_app_tree_Store.append (Iter, Parent);
the_app_tree_Store.set (Iter, 0, +Each.Name);
if Each = all_Apps.first_Element
then
the_app_tree_Selection.Select_Iter (Iter);
end if;
end;
end loop;
the_app_tree_View.show_All;
tree_selection_Handlers.connect (the_app_tree_Selection,
"changed",
on_app_Selection_changed'Access);
top_Window.show; -- Display our main window and all of its children.
enable_bold_Tabs_for (the_top_Notebook);
-- The Package Editor
--
the_package_Alignment := Gtk_Alignment (glade_Builder.Get_Object ("package_editor_Alignment"));
choose_package_Button := Gtk_Button (glade_Builder.Get_Object ("choose_package_Button"));
new_package_Button := Gtk_Button (glade_Builder.Get_Object ("new_package_Button"));
rid_package_Button := Gtk_Button (glade_Builder.Get_Object ("rid_package_Button"));
the_package_tree_Store := gtk_tree_Store (glade_Builder.Get_Object ("package_tree_Store"));
the_package_tree_View := gtk_tree_View (glade_Builder.Get_Object ("package_tree_View"));
the_package_tree_Selection := the_package_tree_View.Get_Selection;
Button_Handler.connect (choose_package_Button,
"clicked",
on_choose_package_Button_clicked'Access);
-- The Palettes
--
the_packages_Palette := aIDE.Palette.of_packages.to_packages_Palette;
the_source_entities_Palette := aIDE.Palette.of_source_entities.to_source_entities_Palette;
the_pragma_Palette := aIDE.Palette.of_pragmas.to_source_entities_Palette;
the_exceptions_Palette := aIDE.Palette.of_exceptions.to_exceptions_Palette;
the_types_Palette := aIDE.Palette.of_types.to_Palette;
the_package_Editor := aIDE.Editor.of_package.Forge.to_package_Editor (the_applet_Package);
the_package_Editor.top_Widget.Reparent (New_Parent => the_package_Alignment);
gtk.Main.main; -- Enter main GtkAda event loop.
end open;
-- Palettes
--
procedure show_packages_Palette (Invoked_by : in Gtk.Button.gtk_Button;
Target : in AdaM.context_Line.view)
is
begin
the_packages_Palette.show (Invoked_by, Target);
end show_packages_Palette;
procedure show_packages_Palette (Invoked_by : in Gtk.Button.gtk_Button;
Target : in AdaM.a_Package.view)
is
begin
the_packages_Palette.show (Invoked_by, Target);
end show_packages_Palette;
procedure show_types_Palette (Invoked_by : in Gtk.Button.gtk_Button;
Target : access AdaM.a_Type.view)
is
begin
the_types_Palette.show (Invoked_by, Target);
end show_types_Palette;
procedure show_source_entities_Palette (Invoked_by : in aIDE.Editor.view;
Target : in AdaM.Entity.Entities_view)
-- Target : in AdaM.Source.Entities_view)
is
use Palette.of_source_entities;
-- use type adam.Source.Entities_View;
use type adam.Entity.Entities_view,
Ada.Tags.Tag;
-- the_Editor : constant AIDE.Editor.of_block.view := AIDE.Editor.of_block.view (Invoked_by);
the_Editor : aIDE.Editor.of_block.view;
the_Filter : Palette.of_source_entities.Filter;
begin
Ada.Text_IO.put_Line ("EDITOR TAG " & ada.tags.External_Tag (Invoked_by.all'Tag));
Ada.Text_IO.put_Line ("EDITOR TAG " & ada.tags.External_Tag (aide.Editor.of_block.item'Tag));
if Invoked_by.all in aide.Editor.of_block.item'Class
then
the_Editor := AIDE.Editor.of_block.view (Invoked_by);
if the_Editor.Target.my_Declarations = Target
then
the_Filter := declare_Region;
elsif the_Editor.Target.my_Statements = Target
then
the_Filter := begin_Region;
else
raise Program_Error;
end if;
elsif Invoked_by.all in aide.Editor.of_package.item'Class
then
-- the_Editor := AIDE.Editor.of_package.view (Invoked_by);
the_Filter := declare_Region;
else
raise Program_Error with ada.tags.External_Tag (Invoked_by.all'Tag) & " not yet supported.";
end if;
the_source_entities_Palette.show (Invoked_by, Target, the_Filter);
end show_source_entities_Palette;
procedure show_pragma_Palette (Invoked_by : in aIDE.Editor.view;
Target : in AdaM.a_Pragma.view)
is
begin
the_pragma_Palette.show (Invoked_by, Target, aIDE.Palette.of_pragmas.declare_Region);
end show_pragma_Palette;
-- Logging
--
procedure clear_Log
is
First,
Last : gtk.text_Iter.gtk_text_Iter;
begin
the_build_log_Textview.get_Buffer.get_start_Iter (First);
the_build_log_Textview.get_Buffer.get_end_Iter (Last);
the_build_log_Textview.get_Buffer.delete (First, Last);
end clear_Log;
procedure log (the_Message : in String := "";
Count : in Positive := 1)
is
use Ada.Characters;
Status : Boolean; pragma Unreferenced (Status);
Iter : Gtk.Text_Iter.gtk_text_Iter;
use type glib.Gint;
begin
for i in 1 .. Count
loop
the_build_log_Textview.get_Buffer.insert_at_Cursor (the_Message & Latin_1.LF);
end loop;
while gtk.Main.Events_Pending
loop
Status := gtk.Main.Main_Iteration;
end loop;
the_build_log_Textview.Get_Buffer.Get_Iter_At_Offset (Iter, -1);
Status := the_build_log_Textview.Scroll_To_Iter (Iter => Iter,
Within_Margin => 0.1,
Use_Align => True,
Xalign => 0.2,
Yalign => 0.3);
end log;
procedure show_exceptions_Palette (Invoked_by : in gtk_Button;
Target : in adam.exception_Handler.view;
Slot : in Positive)
is
begin
the_exceptions_Palette.show (Invoked_by, Target, Slot);
end show_exceptions_Palette;
procedure update_selected_package_Name (new_Name : in String)
is
begin
choose_package_Button.set_Label (new_Name);
end update_selected_package_Name;
-- procedure update_selected_package_Name (new_Name : in String)
-- is
-- use gtk.Tree_Model, ada.Text_IO;
--
-- the_Selection : Gtk_Tree_Iter;
-- the_Model : Gtk_Tree_Model;
-- begin
-- the_package_tree_Selection.get_Selected (the_Model, the_Selection);
--
-- if the_Selection /= null_Iter
-- then
-- declare
-- -- use ada.Characters.handling,
-- -- ada.Directories;
--
-- old_Name : constant String := gtk.Tree_Model.get_String (the_Model, the_Selection, 0);
-- begin
-- if new_Name /= old_Name
-- then
-- the_package_tree_Store.set (the_Selection, 0, new_Name);
-- -- build_Package;
-- end if;
-- end;
-- else
-- put_Line ("update_selected_package_Name : *** Null Iter ***");
-- end if;
-- end update_selected_package_Name;
procedure set_selected_Package (To : in AdaM.a_Package.view)
is
begin
the_package_Editor.Package_is (To);
end set_selected_Package;
end aIDE.GUI;
|
asm/link.asm | RockmanEXEZone/MMBN45-English-Translation | 6 | 168607 | @LINK_ID equ (VAR_LINK_EU ? 0x42345750 : 0x42345745)
// Change Link ID from B4WJ (EXE4) to B4WE/B4WP (BN4).
// Note that this also breaks compatibility with unpatched EXE4.5.
.org 0x0803C814
.dw @LINK_ID
.org 0x0803C890
.dw @LINK_ID
.org 0x08044C00
.dw @LINK_ID
.org 0x08044D44
.dw @LINK_ID
.org 0x08044D84
.dw @LINK_ID
.org 0x08044DE8
.dw @LINK_ID
.org 0x08044E2C
.dw @LINK_ID
.org 0x08044E6C
.dw @LINK_ID
.org 0x08044EC8
.dw @LINK_ID
.org 0x08044EFC
.dw @LINK_ID
.org 0x08044F84
.dw @LINK_ID |
library/fmGUI_Database/databaseNamesOfVisibleWindows.applescript | NYHTC/applescript-fm-helper | 1 | 934 | <filename>library/fmGUI_Database/databaseNamesOfVisibleWindows.applescript
-- databaseNamesOfVisibleWindows({fmAppType:"Pro"})
-- <NAME>, NYHTC
-- return a list of db names for the specified window names
(*
HISTORY:
1.7 - 2018-10-16 ( eshagdar ): FM17 has only FMP ( no more FMA)
1.6 - 2018-09-20 ( eshagdar ): FileMaker 17 has only version so talk to it by name.
1.5 - added a time-out loop for dealing with delay in being able to get list of databases.
1.4 - added error-handling
1.3 -
1.2 -
1.1 -
1.0 - created
REQUIRES:
dbNameOfWindowName
*)
on run
databaseNamesOfVisibleWindows({})
end run
--------------------
-- START OF CODE
--------------------
on databaseNamesOfVisibleWindows(prefs)
-- version 1.7
set defaultPrefs to {}
set prefs to prefs & defaultPrefs
using terms from application "FileMaker Pro Advanced"
tell application ID "com.filemaker.client.pro12"
set visibleWindowNames to name of every window whose visible is true
end tell
set visibleDatabases to {}
repeat with oneWindowName in visibleWindowNames
set oneDBName to dbNameOfWindowName(oneWindowName)
if visibleDatabases does not contain oneDBName then
copy oneDBName to end of visibleDatabases
end if
end repeat
return visibleDatabases
end using terms from
end databaseNamesOfVisibleWindows
--------------------
-- END OF CODE
--------------------
on dbNameOfWindowName(someWindowName)
tell application "htcLib" to dbNameOfWindowName(someWindowName)
end dbNameOfWindowName
|
packages/external/libmpg123-1.22.x/src/asm_nasm/dct36_sse.asm | sezero/SDL2-OS2 | 2 | 80082 | <filename>packages/external/libmpg123-1.22.x/src/asm_nasm/dct36_sse.asm
; 1 "dct36_sse.S"
; 1 "<built-in>"
; 1 "<command line>"
; 1 "dct36_sse.S"
; 9 "dct36_sse.S"
; 1 "mangle.h" 1
; 13 "mangle.h"
; 1 "config.h" 1
; 14 "mangle.h" 2
; 1 "intsym.h" 1
; 15 "mangle.h" 2
; 10 "dct36_sse.S" 2
; 23 "dct36_sse.S"
%include "asm_nasm.inc"
_sym_mangle dct36_sse
SECTION .data
ALIGN 16
dct36_sse_COS9:
dd 03f5db3d7h
dd 03f5db3d7h
dd 03f000000h
dd 03f000000h
dd 03f7c1c5ch
dd 03f7c1c5ch
dd 03f708fb2h
dd 03f708fb2h
dd 03f248dbbh
dd 03f248dbbh
dd 03e31d0d4h
dd 03e31d0d4h
dd 03eaf1d44h
dd 03eaf1d44h
dd 03f441b7dh
dd 03f441b7dh
ALIGN 16
dct36_sse_tfcos36:
dd 03f007d2bh
dd 03f0483eeh
dd 03f0d3b7dh
dd 03f1c4257h
dd 040b79454h
dd 03ff746eah
dd 03f976fd9h
dd 03f5f2944h
dd 03f3504f3h
;filler:
dd 000000000h
dd 000000000h
dd 000000000h
ALIGN 16
dct36_sse_mask:
dd 0,0ffffffffh,0,0ffffffffh
ALIGN 16
dct36_sse_sign:
dd 080000000h,080000000h,080000000h,080000000h
SECTION .text
ALIGN 16
GLOBAL dct36_sse
dct36_sse:
push ebp
mov ebp,esp
and esp,-16
sub esp,80
push ebx
push esi
push edi
lea esi, [esp+12]
mov edi, [ebp+8]
lea eax, [dct36_sse_COS9]
lea edx, [dct36_sse_tfcos36]
xorps xmm0, xmm0
xorps xmm5, xmm5
movlps xmm5, [edi+64]
movups xmm4, [edi+48]
movups xmm3, [edi+32]
movups xmm2, [edi+16]
movups xmm1, [edi]
movaps xmm6, xmm5
shufps xmm6, xmm6, 0xe1
movaps xmm7, xmm4
shufps xmm7, xmm7, 0x93
movss xmm6, xmm7
addps xmm5, xmm6
movaps xmm6, xmm3
shufps xmm6, xmm6, 0x93
movss xmm7, xmm6
addps xmm4, xmm7
movaps xmm7, xmm2
shufps xmm7, xmm7, 0x93
movss xmm6, xmm7
addps xmm3, xmm6
movaps xmm6, xmm1
shufps xmm6, xmm6, 0x93
movss xmm7, xmm6
addps xmm2, xmm7
movss xmm6, xmm0
addps xmm1, xmm6
movaps xmm0, [dct36_sse_mask]
movaps xmm6, xmm4
shufps xmm4, xmm5, 0x4e
movaps xmm7, xmm3
shufps xmm3, xmm6, 0x4e
andps xmm6, xmm0
addps xmm4, xmm6
movaps xmm6, xmm2
shufps xmm2, xmm7, 0x4e
andps xmm7, xmm0
addps xmm3, xmm7
movaps xmm7, xmm1
shufps xmm1, xmm6, 0x4e
andps xmm6, xmm0
addps xmm2, xmm6
movaps xmm6, xmm7
andps xmm7, xmm0
xorps xmm0, xmm0
addps xmm1, xmm7
movlhps xmm0, xmm6
; 138 "dct36_sse.S"
movaps xmm5, xmm2
shufps xmm5, xmm3, 0xe4
shufps xmm3, xmm4, 0xe4
shufps xmm4, xmm2, 0xe4
movaps xmm2, xmm5
mulps xmm5, [eax]
addps xmm5, xmm0
movaps [esi], xmm0
movaps [esi+16], xmm2
movaps xmm6, xmm1
subps xmm6, xmm3
subps xmm6, xmm4
xorps xmm7, xmm7
shufps xmm7, xmm2, 0xe0
mulps xmm6, [eax]
subps xmm0, xmm7
addps xmm6, xmm0
movaps [esi+48], xmm6
movaps xmm2, [eax+16]
movaps xmm0, xmm1
movaps xmm6, xmm3
movaps xmm7, xmm4
mulps xmm0, xmm2
mulps xmm6, [eax+32]
mulps xmm7, [eax+48]
addps xmm0, xmm5
addps xmm6, xmm7
addps xmm0, xmm6
movaps [esi+32], xmm0
movaps xmm0, xmm1
movaps xmm6, xmm3
movaps xmm7, xmm4
mulps xmm0, [eax+32]
mulps xmm6, [eax+48]
mulps xmm7, xmm2
subps xmm0, xmm5
subps xmm7, xmm6
addps xmm0, xmm7
movaps [esi+64], xmm0
movaps xmm6, xmm1
movaps xmm7, xmm4
mulps xmm6, [eax+48]
mulps xmm2, xmm3
mulps xmm7, [eax+32]
subps xmm6, xmm5
subps xmm2, xmm7
addps xmm6, xmm2
movaps xmm0, [esi]
movss xmm5, [edx+32]
subps xmm0, xmm1
subps xmm4, [esi+16]
addps xmm0, xmm3
addps xmm0, xmm4
shufps xmm0, xmm0, 0xaf
mulss xmm0, xmm5
movaps [esi], xmm0
movaps xmm0, [esi+32]
movaps xmm1, [esi+48]
movaps xmm2, [esi+64]
; 225 "dct36_sse.S"
movaps xmm3, xmm0
unpcklps xmm0, xmm1
unpckhps xmm3, xmm1
movaps xmm5, xmm2
unpcklps xmm2, xmm6
unpckhps xmm5, xmm6
xorps xmm5, [dct36_sse_sign]
; 240 "dct36_sse.S"
movaps xmm1, xmm0
movlhps xmm0, xmm2
movhlps xmm2, xmm1
movaps xmm4, xmm3
movlhps xmm3, xmm5
movhlps xmm5, xmm4
; 254 "dct36_sse.S"
movaps xmm6, [edx]
movaps xmm7, [edx+16]
movaps xmm1, xmm5
addps xmm5, xmm2
subps xmm1, xmm2
movaps xmm2, xmm3
addps xmm3, xmm0
subps xmm2, xmm0
mulps xmm5, xmm6
mulps xmm7, xmm1
movaps [esi+16], xmm2
; 275 "dct36_sse.S"
mov edi, [ebp+12]
mov edx, [ebp+16]
mov ecx, [ebp+20]
mov eax, [ebp+24]
movaps xmm0, xmm3
movaps xmm1, xmm5
movups xmm2, [ecx+108]
movups xmm3, [ecx+92]
shufps xmm3, xmm3, 0x1b
movups xmm4, [ecx+36]
movups xmm5, [ecx+20]
shufps xmm5, xmm5, 0x1b
movaps xmm6, xmm0
addps xmm0, xmm1
subps xmm6, xmm1
mulps xmm2, xmm0
mulps xmm0, xmm3
mulps xmm4, xmm6
mulps xmm6, xmm5
movups xmm1, [edi+36]
movups xmm3, [edi+20]
shufps xmm6, xmm6, 0x1b
addps xmm1, xmm4
addps xmm3, xmm6
shufps xmm0, xmm0, 0x1b
movups [edx+36], xmm2
movups [edx+20], xmm0
movss [eax+32*36], xmm1
movss [eax+32*20], xmm3
movhlps xmm2, xmm1
movhlps xmm4, xmm3
movss [eax+32*44], xmm2
movss [eax+32*28], xmm4
shufps xmm1, xmm1, 0xb1
shufps xmm3, xmm3, 0xb1
movss [eax+32*40], xmm1
movss [eax+32*24], xmm3
movhlps xmm2, xmm1
movhlps xmm4, xmm3
movss [eax+32*48], xmm2
movss [eax+32*32], xmm4
movss xmm0, [esi+8]
movss xmm1, [esi]
movss xmm2, [ecx+124]
movss xmm3, [ecx+88]
movss xmm4, [ecx+52]
movss xmm5, [ecx+16]
movss xmm6, xmm0
addss xmm0, xmm1
subss xmm6, xmm1
mulss xmm2, xmm0
mulss xmm0, xmm3
mulss xmm4, xmm6
mulss xmm6, xmm5
addss xmm4, [edi+52]
addss xmm6, [edi+16]
movss [edx+52], xmm2
movss [edx+16], xmm0
movss [eax+32*52], xmm4
movss [eax+32*16], xmm6
movaps xmm0, [esi+16]
movaps xmm1, xmm7
MOVUAPS xmm2, [ecx+128]
movups xmm3, [ecx+72]
shufps xmm2, xmm2, 0x1b
movlps xmm4, [ecx+56]
movhps xmm4, [ecx+64]
MOVUAPS xmm5, [ecx]
shufps xmm4, xmm4, 0x1b
movaps xmm6, xmm0
addps xmm0, xmm1
subps xmm6, xmm1
mulps xmm2, xmm0
mulps xmm0, xmm3
mulps xmm4, xmm6
mulps xmm6, xmm5
movlps xmm1, [edi+56]
movhps xmm1, [edi+64]
movups xmm3, [edi]
shufps xmm4, xmm4, 0x1b
addps xmm3, xmm6
addps xmm1, xmm4
shufps xmm2, xmm2, 0x1b
movups [edx], xmm0
movlps [edx+56], xmm2
movhps [edx+64], xmm2
movss [eax+32*56], xmm1
movss [eax], xmm3
movhlps xmm2, xmm1
movhlps xmm4, xmm3
movss [eax+32*64], xmm2
movss [eax+32*8], xmm4
shufps xmm1, xmm1, 0xb1
shufps xmm3, xmm3, 0xb1
movss [eax+32*60], xmm1
movss [eax+32*4], xmm3
movhlps xmm2, xmm1
movhlps xmm4, xmm3
movss [eax+32*68], xmm2
movss [eax+32*12], xmm4
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
|
same-origin-policy/src/model/example.als | cfbolz/500lines | 2 | 2445 | /**
* example.als
* A model of an Email application
*/
module example
open analysis
/**
* Components
* Instantiations of servers, browser, and script
*/
// Email application
one sig EmailServer extends Server {}
// Document loaded from the email server
one sig InboxPage extends Document {}{
domain.init = EmailDomain
content.init = MyInboxInfo
}
one sig InboxScript extends Script {} { context = InboxPage }
// Calender application
one sig CalendarServer extends Server {}
one sig CalendarPage extends Document {}{
domain.init = CalendarDomain
content.init = MySchedule
}
// Trusted scripts
one sig CalendarScript extends Script {}{ context = CalendarPage }
// Blog application
one sig BlogServer extends Server {}
one sig BlogPage extends Document {}{ domain.init = BlogDomain }
// Concrete instances of domain names
// Conceptually, "email.example.com", "calendar.example.com", "blog.example.com"
one sig EmailDomain, CalendarDomain, BlogDomain extends Domain {}
one sig ExampleDomain extends Domain {} {
// "example.com", which subsumes other subdomains (including itself)
subsumes = EmailDomain + CalendarDomain + BlogDomain + this
}
// A malicious server providing an ad service
one sig EvilServer extends Server {}
// Document loaded from the evil ad server
one sig AdBanner extends Document {}{
domain.init = EvilDomain
no CriticalData & content.init
}
// An evil script running inside the ad
one sig EvilScript extends Script {}
// ""www.evil.com"
one sig EvilDomain extends Domain {}
// The victim user's browser
one sig MyBrowser extends Browser {}
// Resource representing the information in the user's inbox (list of emails, etc)
one sig MyInboxInfo in Resource {}
// Resource representing my schedule on the calendar
one sig MySchedule in Resource {}
// Cookie used to authenticate the user by the email and calendar apps
one sig MyCookie in Cookie {}{ domains = EmailDomain + CalendarDomain }
one sig HTTP extends Protocol {}
/**
* Requests
*/
// Request for getting the inbox of the user
sig GetInboxInfo in HttpRequest {}{
to in EmailServer
-- cookie must be provided for the request to succeed
MyCookie in sentCookies
}
// Get the user's schedule
sig GetSchedule in HttpRequest {}{
to in CalendarServer
MyCookie in sentCookies
}
fact SecurityAssumptions {
-- designate trusted modules
EmailServer + MyBrowser + CalendarServer +
InboxScript + CalendarScript + BlogServer in TrustedModule
EvilScript + EvilServer in MaliciousModule
CriticalData = MyInboxInfo + MyCookie + MySchedule
-- assume malicious modules initially don't have access to critical data
no initData[MaliciousModule] & CriticalData
-- and trusted modules don't already contain malicious data
no initData[TrustedModule] & MaliciousData
-- to disallow EmailDomain or CalenderDomain being mapped to EvilServer,
-- in reality, this attack is possible, but will be ruled out here
Dns.map = EmailDomain -> EmailServer + CalendarDomain -> CalendarServer
+ BlogDomain -> BlogServer + EvilDomain -> EvilServer
MyInboxInfo != MySchedule
}
run {} for 3
/* Restrictions */
-- you can comment out any of these facts if you prefer
// Restrict calls to be only of one kind
-- leave uncommented the kind of call you want to see only
pred asm1 {
#Call = 2
one XmlHttpRequest
one ReadDom
no CorsRequest
MyInboxInfo in EvilServer.accesses.last
EvilScript.context = AdBanner
}
run asm1 for 3 but 2 Call
pred asm2 {
Call in XmlHttpRequest
Call.from = EvilScript
Call.to = EmailServer
GetInboxInfo = Call
some sentCookies
one Cookie
MyInboxInfo in EvilScript.accesses.last
EvilScript.context = AdBanner
}
run asm2 for 2 but 1 Call
one sig Leak extends Callback {}
pred jsonpAttack {
one GetSchedule
one ExecCallback
ExecCallback.to in EvilScript
MySchedule in EvilScript.accesses.last
GetSchedule in JsonpRequest
one Cookie
no MyInboxInfo & MySchedule
EvilScript.context = AdBanner
}
run jsonpAttack for 3 but 2 Call, 3 Resource
pred postmessageAttack {
one PostMessage
one ReceiveMessage
PostMessage.from in EvilScript
ReceiveMessage.to in InboxScript
some MaliciousData & InboxScript.accesses.last
no MyInboxInfo & MySchedule
no Port
EvilScript.context = AdBanner
}
run postmessageAttack for 3 but 3 Time, 2 Call//, 2 Resource
pred corsAttack {
GetSchedule in CorsRequest
GetSchedule.from = EvilScript
MySchedule in EvilScript.accesses.last
no MyInboxInfo & MySchedule
no Port
no body
one resources
EvilScript.context = AdBanner
}
run corsAttack for 3 but 2 Time, 1 Call
pred CRASH {
subsumes =
ExampleDomain -> EmailDomain + ExampleDomain -> CalendarDomain +
ExampleDomain -> BlogDomain + (Domain <: iden)
some o : SetDomain | o.start = init and o.from = InboxScript and o.newDomain = ExampleDomain
some o : SetDomain | o.start = init.next and o.from = CalendarScript and o.newDomain = ExampleDomain
some o : ReadDom {
// o.from = CalendarScript
o.doc = InboxPage
// o.from = CalendarPage
}
}
run CRASH for 7 but 5 Domain, 4 Time, 3 Call
pred setdomainNormal {
subsumes =
ExampleDomain -> EmailDomain + ExampleDomain -> CalendarDomain +
ExampleDomain -> BlogDomain + (Domain <: iden)
some o : SetDomain | o.start = init and o.from = InboxScript and o.newDomain = ExampleDomain
some o : SetDomain | o.start = init.next and o.from = CalendarScript and o.newDomain = ExampleDomain
some o : ReadDom {
o.from = CalendarScript
// o.doc = InboxPage
// o.from = CalendarPage
}
}
run setdomainNormal for 7 but 5 Domain, 4 Time, 3 Call
pred setdomainAttack {
subsumes =
ExampleDomain -> EmailDomain + ExampleDomain -> CalendarDomain +
ExampleDomain -> BlogDomain + (Domain <: iden)
EvilScript.context = BlogPage
some o : SetDomain | o.start = init and o.from = InboxScript and o.newDomain = ExampleDomain
some o : SetDomain | o.start = init.next and o.from = CalendarScript and o.newDomain = ExampleDomain
some o : ReadDom {
o.start = init.next.next
o.from = CalendarScript
o.doc = InboxPage
}
some o : SetDomain | o.start = init.next.next.next and o.from = EvilScript and o.newDomain = ExampleDomain
some o : ReadDom {
o.start = init.next.next.next.next
o.from = EvilScript
o.doc = InboxPage
}
}
run setdomainAttack for 7 but 5 Domain, 6 Time, 5 Call
/* Helper functions for visualization */
fun currentCall: Call -> Time {
{c: Call, t: Time | c.start = t }
}
fun relevantModules : DataflowModule -> Time {
{m: DataflowModule, t: Time | m in currentCall.t.(from + to) }
}
|
out/Lens/Equality.agda | JoeyEremondi/agda-soas | 39 | 937 | <filename>out/Lens/Equality.agda
{-
This second-order equational theory was created from the following second-order syntax description:
syntax Lens | L
type
S : 0-ary
A : 0-ary
term
get : S -> A
put : S A -> S
theory
(PG) s : S a : A |> get (put (s, a)) = a
(GP) s : S |> put (s, get(s)) = s
(PP) s : S a b : A |> put (put(s, a), b) = put (s, a)
-}
module Lens.Equality 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 Lens.Signature
open import Lens.Syntax
open import SOAS.Metatheory.SecondOrder.Metasubstitution L:Syn
open import SOAS.Metatheory.SecondOrder.Equality L:Syn
private
variable
α β γ τ : LT
Γ Δ Π : Ctx
infix 1 _▹_⊢_≋ₐ_
-- Axioms of equality
data _▹_⊢_≋ₐ_ : ∀ 𝔐 Γ {α} → (𝔐 ▷ L) α Γ → (𝔐 ▷ L) α Γ → Set where
PG : ⁅ S ⁆ ⁅ A ⁆̣ ▹ ∅ ⊢ get (put 𝔞 𝔟) ≋ₐ 𝔟
GP : ⁅ S ⁆̣ ▹ ∅ ⊢ put 𝔞 (get 𝔞) ≋ₐ 𝔞
PP : ⁅ S ⁆ ⁅ A ⁆ ⁅ A ⁆̣ ▹ ∅ ⊢ put (put 𝔞 𝔟) 𝔠 ≋ₐ put 𝔞 𝔟
open EqLogic _▹_⊢_≋ₐ_
open ≋-Reasoning
|
programs/oeis/031/A031381.asm | neoneye/loda | 22 | 18909 | <gh_stars>10-100
; A031381: a(n) = prime(7*n - 2).
; 11,37,67,101,137,173,211,251,283,337,379,421,461,503,563,601,643,683,739,787,829,881,937,983,1031,1069,1117,1181,1229,1283,1319,1399,1447,1487,1543,1583,1621,1693,1741,1789,1867,1907,1979,2017,2081,2129,2179,2243,2293,2347,2389,2441,2521,2579,2647,2687,2719,2777,2833,2887,2953,3011,3067,3137,3203,3257,3319,3361,3433,3491,3539,3583,3637,3697,3761,3821,3877,3923,4001,4049,4099,4157,4229,4271,4339,4409,4463,4519,4591,4649,4703,4783,4817,4909,4957,5003,5059,5113,5189,5261
mul $0,7
add $0,3
seq $0,98090 ; Numbers k such that 2k-3 is prime.
sub $0,5
mul $0,2
add $0,7
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i3-7100_9_0x84_notsx.log_21829_2238.asm | ljhsiun2/medusa | 9 | 94611 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x38ca, %rdi
nop
nop
nop
add $25827, %r15
and $0xffffffffffffffc0, %rdi
vmovntdqa (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %rdx
nop
nop
nop
nop
nop
and %r13, %r13
lea addresses_WT_ht+0x1054a, %rdx
nop
nop
nop
nop
sub %r12, %r12
mov $0x6162636465666768, %rax
movq %rax, (%rdx)
nop
cmp %r13, %r13
lea addresses_normal_ht+0x22ee, %rsi
lea addresses_WT_ht+0xd2ca, %rdi
clflush (%rsi)
xor %rax, %rax
mov $113, %rcx
rep movsw
nop
nop
xor $61443, %rdx
lea addresses_A_ht+0x14eca, %rax
nop
nop
nop
add $52498, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, (%rax)
nop
xor $6142, %rsi
lea addresses_D_ht+0x15fe4, %rcx
nop
cmp %rdi, %rdi
mov (%rcx), %r13
nop
nop
nop
dec %r13
lea addresses_UC_ht+0x6f6a, %rax
nop
and %r13, %r13
mov (%rax), %edi
nop
nop
nop
xor %rcx, %rcx
lea addresses_WC_ht+0x3eba, %r12
and %r13, %r13
movb (%r12), %cl
nop
nop
nop
cmp $28322, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r8
push %rbx
push %rdx
push %rsi
// Store
lea addresses_US+0x1c17a, %rsi
clflush (%rsi)
nop
nop
nop
add $21766, %r14
mov $0x5152535455565758, %r10
movq %r10, %xmm5
movups %xmm5, (%rsi)
nop
inc %rbx
// Load
lea addresses_WC+0x4eca, %rbx
and %rdx, %rdx
mov (%rbx), %r10w
nop
nop
nop
nop
nop
sub %r8, %r8
// Faulty Load
lea addresses_A+0x166ca, %rbx
nop
cmp %r14, %r14
movaps (%rbx), %xmm7
vpextrq $1, %xmm7, %r8
lea oracles, %rdx
and $0xff, %r8
shlq $12, %r8
mov (%rdx,%r8,1), %r8
pop %rsi
pop %rdx
pop %rbx
pop %r8
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 11, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': True, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'4c': 7, '47': 12, '44': 20122, '49': 1677, '00': 8, 'ff': 2, '1f': 1}
44 44 44 44 44 44 44 49 44 49 44 44 49 44 44 44 44 49 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 49 44 44 44 44 49 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 49 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 49 44 44 49 44 49 44 44 49 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 49 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 49 44 49 44 44 44 44 49 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 49 44 49 49 44 44 44 44 44 44 44 47 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 49 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 49 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 49 44 49 ff 00 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44 44 49 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 49 44 44
*/
|
src/map.asm | santiontanon/triton | 41 | 170495 | <filename>src/map.asm
;-----------------------------------------------
draw_map:
ld a,(starfield_scroll_speed)
cp 4
jp z,draw_map_no_scroll
ld hl,NAMTBL2
call SETWRT
ld a,(VDP.DW)
ld c,a
ld de,tileTypeBuffers
ld a,(scroll_x_half_pixel)
srl a
srl a ; scroll is 2 by 2 pixels
add a,d
ld d,a
ld b,e ; we set this for later (e == 0 as tileTypeBuffers is 256 aligned)
ld hl,mapBuffer
ld a,(scroll_x_tile)
ADD_HL_A
; ld iyh,MAP_HEIGHT
; ld iyl,MAP_BUFFER_WIDTH-31 ; since we skip the last inc hl
ld iy,((MAP_BUFFER_WIDTH - 31) & #ff) + (MAP_HEIGHT << 8)
draw_map_column_loop:
; this loop is unrolled to make it faster:
REPT 31
ld e,(hl)
ld a,(de)
out (c),a
inc l ; no need to increment "hl" on the first 31 iterations, as map is 32-aligned
ENDM
ld e,(hl)
ld a,(de)
out (c),a
ld a,iyl
ADD_HL_A
ld a,iyh
cp (MAP_HEIGHT-8)+1
jr z,draw_map_switch_to_bank2
dec iyh
jp nz,draw_map_column_loop
ret
draw_map_switch_to_bank2:
ld d,(tileTypeBuffers+4*256) >> 8
; ld de,tileTypeBuffers+4*256
ld a,(scroll_x_half_pixel)
srl a
srl a ; scroll is 2 by 2 pixels
add a,d
ld d,a
dec iyh
jp draw_map_column_loop
;-----------------------------------------------
draw_map_no_scroll:
ld hl,NAMTBL2
call SETWRT
ld hl,mapBuffer
ld a,(scroll_x_tile)
ADD_HL_A
ld iyh,MAP_HEIGHT
ld de,MAP_BUFFER_WIDTH-32
ld a,(VDP.DW)
ld c,a
draw_map_no_scroll_column_loop:
ld b,32
draw_map_no_scroll_column_loop2:
outi
jp nz,draw_map_no_scroll_column_loop2
add hl,de
dec iyh
jr nz,draw_map_no_scroll_column_loop
ret
|
specification_scanner-scan_subprogram.adb | annexi-strayline/AURA | 13 | 5468 | ------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
separate (Specification_Scanner)
procedure Scan_Subprogram
(Buffer : in out Ada_Lexical_Parser.Source_Buffer;
Unit_Tree : in out Declaration_Trees.Tree;
Subprogram_Node: in Declaration_Trees.Cursor)
is
use Ada_Lexical_Parser;
use Declaration_Trees;
package Toolkit is new Parse_Toolkit (Buffer); use Toolkit;
use type WWU.Unbounded_Wide_Wide_String;
This_Ent: Declared_Entity renames Unit_Tree(Subprogram_Node);
procedure Add_Parameter is
Parameter_Ent: Declared_Entity;
begin
Parameter_Ent.Kind := Object_Declaration;
Parameter_Ent.Name := Current_Element.Content;
Next_Element;
Assert_Syntax (Category = Delimiter and then Content = ":");
Next_Element;
while Category = Reserved_Word loop
Assert_Syntax (Content in
"in" | "out"
| "not" | "null" | "access"
| "aliased");
Next_Element;
end loop;
Assert_Syntax (Category = Identifier);
Load_Identifier (This_Ent.Subtype_Mark);
end Add_Parameter;
begin
This_Ent.Kind := Subprogram_Declaration;
Load_Identifier (This_Ent.Name);
Assert_Syntax (Category in Delimiter | Reserved_Word
and then Content in
";" | "(" | "return"
| "is" | "with" | "renames");
if Category = Delimiter and then Content = "(" then
-- Process parameters
loop
Add_Parameter;
Assert_Syntax (Category = Delimiter);
exit when Content = ")";
Assert_Syntax (Content = ";");
end loop;
Next_Element;
end if;
if Category = Delimiter and then Content = ";" then
return;
end if;
Assert_Syntax (Category in Reserved_Word
and then Content in "return" | "is" | "with" | "renames");
if Content = "return" then
-- Record the subtype mark
Next_Element;
Assert_Syntax (Category = Identifier);
Load_Identifier (This_Ent.Subtype_Mark);
end if;
if Category = Identifier and then Content = ";" then
return;
end if;
Assert_Syntax (Category = Reserved_Word
and then Content in "is" | "with" | "renames");
if Content = "is" then
-- Either a function expression or a null procedure. We allow either
-- without checking if it really is a function or a procedure because
-- this is just a scanner. We care about an "is" only because we want
-- to extract the expression
Next_Element;
Assert_Syntax
((Category = Delimiter and then Content = "(")
or else (Category = Reserved_Word and then Content = "null"));
if Content = "(" then
-- For ease of parsing, we will pull in the expression including
-- the surrouding parenthesis. This allivates us from needing to
-- track depth. We simply go until we hit "with" or ";".
This_Ent.Expression := Current_Element.Content;
loop
Next_Element;
exit when Category = Delimiter and then Content = ";";
exit when Category = Reserved_Word and then Content = "with";
This_Ent.Expression
:= This_Ent.Expression & Current_Element.Content;
end loop;
elsif Content = "null" then
Next_Element;
Assert_Syntax (Category = Delimiter and then Content = ";");
return;
end if;
end if;
if Category = Identifier and then Content = ";" then
return;
end if;
Assert_Syntax (Category = Reserved_Word
and then Content in "with" | "renames");
-- For renames, rename must come before "with"
-- Also, expression functions obviously cannot also be a rename
if Content = "renames" then
Assert_Syntax (WWU.Length (This_Ent.Expression) = 0);
This_Ent.Is_Renaming := True;
Next_Element;
Assert_Syntax (Category = Identifier);
Load_Identifier (This_Ent.Renamed_Entity_Name);
end if;
Assert_Syntax (Category = Reserved_Word and then Content = "with");
-- We're not interested in the aspect_specification part
Skip_To_Semicolon;
end Scan_Subprogram;
|
tier-1/xcb/source/thin/xcb-xcb_change_pointer_control_request_t.ads | charlie5/cBound | 2 | 12902 | <reponame>charlie5/cBound<gh_stars>1-10
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_change_pointer_control_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
acceleration_numerator : aliased Interfaces.Integer_16;
acceleration_denominator : aliased Interfaces.Integer_16;
threshold : aliased Interfaces.Integer_16;
do_acceleration : aliased Interfaces.Unsigned_8;
do_threshold : aliased Interfaces.Unsigned_8;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_change_pointer_control_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_change_pointer_control_request_t.Item,
Element_Array => xcb.xcb_change_pointer_control_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_change_pointer_control_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_change_pointer_control_request_t.Pointer,
Element_Array => xcb.xcb_change_pointer_control_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_change_pointer_control_request_t;
|
source/contexts/plain/program-library_environments.ads | reznikmm/gela | 0 | 14900 | -- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Program.Visibility;
with Program.Symbol_Lists;
package Program.Library_Environments is
pragma Preelaborate;
type Library_Environment is tagged limited private;
function Public_View
(Self : Library_Environment'Class;
Name : Program.Symbol_Lists.Symbol_List)
return Program.Visibility.Snapshot_Access;
-- Return a library level view of a unit with given Name as it's visible
-- from a public child unit.
procedure Put_Public_View
(Self : in out Library_Environment'Class;
Name : Program.Symbol_Lists.Symbol_List;
Value : Program.Visibility.Snapshot_Access);
-- Remember a library level view of a unit with given Name as it's visible
-- from a public child unit.
private
package Snapshot_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Program.Symbol_Lists.Symbol_List,
Element_Type => Program.Visibility.Snapshot_Access,
Hash => Program.Symbol_Lists.Hash,
Equivalent_Keys => Program.Symbol_Lists."=",
"=" => Program.Visibility."=");
type Library_Environment is tagged limited record
Public_Views : Snapshot_Maps.Map;
end record;
end Program.Library_Environments;
|
source/oasis/program-elements-generic_package_declarations.ads | reznikmm/gela | 0 | 6899 | <gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Element_Vectors;
with Program.Elements.Defining_Names;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Expressions;
package Program.Elements.Generic_Package_Declarations is
pragma Pure (Program.Elements.Generic_Package_Declarations);
type Generic_Package_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Generic_Package_Declaration_Access is
access all Generic_Package_Declaration'Class with Storage_Size => 0;
not overriding function Formal_Parameters
(Self : Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access is abstract;
not overriding function Name
(Self : Generic_Package_Declaration)
return not null Program.Elements.Defining_Names.Defining_Name_Access
is abstract;
not overriding function Aspects
(Self : Generic_Package_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Visible_Declarations
(Self : Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access is abstract;
not overriding function Private_Declarations
(Self : Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access is abstract;
not overriding function End_Name
(Self : Generic_Package_Declaration)
return Program.Elements.Expressions.Expression_Access is abstract;
type Generic_Package_Declaration_Text is limited interface;
type Generic_Package_Declaration_Text_Access is
access all Generic_Package_Declaration_Text'Class with Storage_Size => 0;
not overriding function To_Generic_Package_Declaration_Text
(Self : in out Generic_Package_Declaration)
return Generic_Package_Declaration_Text_Access is abstract;
not overriding function Generic_Token
(Self : Generic_Package_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Package_Token
(Self : Generic_Package_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function With_Token
(Self : Generic_Package_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Is_Token
(Self : Generic_Package_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Private_Token
(Self : Generic_Package_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function End_Token
(Self : Generic_Package_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Semicolon_Token
(Self : Generic_Package_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Generic_Package_Declarations;
|
Exercicios/Teste04.asm | LZattera/MIPS-MARS | 0 | 1984 | <filename>Exercicios/Teste04.asm
#SOMA
.data#random access memory
n1: .word 5
n2: .word 10
.text
lw $t0, n1($zero) #carregou o valor das variaveis para os registradores
lw $t1, n2($zero)
add $t2, $t0, $t1 # n1+n2 (t2 = t0 + t1)
#print o resultado
li $v0, 1
add $a0, $zero, $t2 #coloca no reg a0 o resultado da conta
syscall |
ary-stack.asm | kosmospredanie/mips-asm-examples | 0 | 11459 | <reponame>kosmospredanie/mips-asm-examples
# ary-stack.asm
#
# Implement Stack using an array (stack capacity: 10)
#
## DATA ##
.data
# Current length
len: .word 0
# Array (cap: 10)
arr: .word 0 0 0 0 0 0 0 0 0 0
## MACROS ##
.include "macros.asm"
.eqv CAPACITY 10
# Gets the address to (base + idx*4)
#
# @param %base The base address
# @param %idx Index (either an immediate value or register name)
# @result $v0 The address
.macro getaddr (%base, %idx)
add $v0, $zero, %idx
mul $v0, $v0, 4 # 1 word = 4 bytes
la $a0, %base
add $v0, $v0, $a0
.end_macro
# Gets the value of the address (base + idx*4)
#
# @param %base The base address
# @param %idx Index (either an immediate value or register name)
# @result $v0 The value of the address
.macro getval (%base, %idx)
getaddr(%base, %idx)
lw $v0, 0($v0)
.end_macro
# Sets the value to the address (base + idx*4)
#
# @param %base The base address
# @param %idx Index (either an immediate value or register name)
# @param %val register of new value
# @param $v0 The value of the address
.macro setval (%base, %idx, %val)
getaddr(%base, %idx)
sw %val, 0($v0)
.end_macro
# Gets the current size of the stack
#
# @result $v0 The current size
.macro getsize ()
getval(len, 0)
.end_macro
# Sets the current size of the stack
#
# @param %size new value register
.macro setsize (%size)
setval(len, 0, %size)
.end_macro
# Increases the current size by 1
.macro inc_size ()
getsize()
add $a1, $v0, 1
setsize($a1)
.end_macro
# Decreases the current size by 1
.macro dec_size ()
getsize()
sub $a1, $v0, 1
setsize($a1)
.end_macro
# Prints the stack.
.macro print_stack ()
print_str(":: Stack: (size: ")
getsize()
move $t1, $v0 # $t1 = the current length of the array
print_int($t1)
print_str(") [ ")
ble $t1, 0, printstack_end # goto printstack_end if len <= 0
li $t0, 0
printstack_loop:
getval(arr, $t0)
print_int($v0)
print_str(" ")
add $t0, $t0, 1
blt $t0, $t1, printstack_loop # repeat if $t0 < len
printstack_end:
print_str("]\n")
.end_macro
# Pushes an item into the stack.
#
# @param %val An item (either an immediate value or register name)
.macro push (%val)
add $t0, $zero, %val # $t0 = item
getsize()
li $t1, CAPACITY # $t1 = CAPACITY
blt $v0, $t1, do_push # goto do_push if len < CAPACITY
print_str(":: WARN: Stack capacity exceeded! Your input has been discarded\n")
print_stack()
j push_end
do_push:
setval(arr, $v0, $t0) # arr[len] = item
inc_size() # Update length
print_stack()
push_end:
.end_macro
# Removes and gets an item from the stack.
#
# @result $v0 An pop
.macro pop ()
getsize()
sub $t0, $v0, 1 # $t0 = len - 1
bgt $v0, 0, do_pop # goto do_pop if not empty
print_str(":: WARN: Stack is empty!\n")
print_stack()
j pop_end
do_pop:
print_str(":: Popped item: ")
getval(arr, $t0) # get arr[len-1]
print_int($v0)
dec_size() # Update length
print_char('\n')
print_stack()
pop_end:
.end_macro
## TEXT (PROGRAM) ##
.text
.globl main
main:
print_str(":: Usage:\n")
print_str(":: - Input a zero or positive number => push\n")
print_str(":: - Input a negative number => pop\n")
loop:
print_str("> Input: ")
read_int()
bge $v0, 0, push_input # goto push_input if the input is not a negative number
pop()
j loop
push_input:
push($v0)
j loop
|
programs/oeis/075/A075123.asm | karttu/loda | 0 | 93430 | <gh_stars>0
; A075123: a(n) is the least positive integer > a(n-1) and a(n) is not 2*a(i)+a(j) for 1<=i<j<n.
; 1,2,3,6,9,14,17,22,25,30,33,38,41,46,49,54,57,62,65,70,73,78,81,86,89,94,97,102,105,110,113,118,121,126,129,134,137,142,145,150,153,158,161,166,169,174,177,182,185,190,193,198,201,206,209,214,217,222,225,230
mov $2,$0
mul $0,2
sub $0,1
add $2,1
add $0,$2
trn $0,8
mov $1,$2
lpb $0,1
trn $0,2
add $1,2
lpe
|
src/frontend/Experimental_Ada_ROSE_Connection/parser/ada_c_demo/source/ada_code.ads | ouankou/rose | 488 | 1067 | <filename>src/frontend/Experimental_Ada_ROSE_Connection/parser/ada_c_demo/source/ada_code.ads
package Ada_Code is
procedure Ada_Proc;
pragma Export (C, Ada_Proc, "Ada_Proc");
procedure Ada_C_Caller;
pragma Export (C, Ada_C_Caller, "Ada_C_Caller");
end Ada_Code;
|
P2/palindrone.asm | alxzzhou/BUAA_CO_2020 | 1 | 174235 | .data
buf: .space 32
.macro getstr(%s)
li $v0,12
syscall
move %s,$v0
.end_macro
.text
li $v0,5
syscall
move $s0,$v0
li $t0,0
li $t1,0
read_buf:
beq $t0,$s0,read_end
getstr($t2)
sb $t2,buf($t1)
addi $t1,$t1,1
addi $t0,$t0,1
j read_buf
read_end:
li $t0,0
li $t1,0
li $t2,0
subi $s1,$s0,1 #s1 = s0 - 1 = n - 1
divu $s2,$s0,2 #s2 = floor( n/2 )
check:
beq $t0,$s2,check_end
sub $t1,$s1,$t0 #t1 = s1 - t0
lb $t2,buf($t0)
lb $t3,buf($t1)
bne $t2,$t3,done_0
addi $t0,$t0,1
j check
check_end:
li $a0,1
li $v0,1
syscall
j done
done_0:
li $a0,0
li $v0,1
syscall
done:
li $v0,10
syscall
|
tictactoe.asm | FinnishArmy/ASM-Tic-Tac-Toe | 0 | 246202 | <reponame>FinnishArmy/ASM-Tic-Tac-Toe
#Tic-Tac-Toe
#<NAME>
.data
grid: .word '_' '_' '_' '_' '_' '_' '_' '_' '_'
prompt: .asciiz "\nAre you 'X' or 'O':"
input: .asciiz "\nEnter a number from 1-9 starting from the top left:"
player2: .asciiz "\nO has won."
player1: .asciiz "\nX has won."
playAgain: .asciiz "\nNew game? (Y/n)"
#Begin program
.text
start:
#Player 1 Prompt
la $a0, prompt
li $v0, 4
syscall
#Check for entry
li $v0, 12
syscall
#Set player 1 move
move $s0, $v0
#Set player 2 entry
beq $s0, 'X', setPlayer2
li $s1, 'X'
setPlayer2:
li $s1, 'O'
la $s2, grid
#Print the board
move $a0, $s2
jal gridDisplay
#Loop until win
repeat:
#Player 1 Moves
move $a0, $s2
move $a1, $s0
jal placeMark
move $a0, $s2
jal gridDisplay
move $a0, $s2
move $a1, $s0
jal checkWinner
beq $v0, 0, next
li $v0, 4
la $a0, player1
syscall
j nextGame
next:
#Player 2 Moves
move $a0, $s2
move $a1, $s1
jal placeMark
move $a0, $s2
jal gridDisplay
move $a0, $s2
move $a1, $s1
jal checkWinner
beq $v0, 0, repeat
li $v0, 4
la $a0, player2
syscall
j nextGame
nextGame:
la $a0, playAgain
li $v0, 4
syscall
li $v0, 12
syscall
beq $v0, 'Y', start
#End of Tic-Tac-Toe
end:
li $v0, 10
syscall
#Board Printing
gridDisplay:
li $t0, 1
move $t1, $a0
li $t3, 3
li $a0, 10
li $v0, 11
syscall
dispLoop:
bgt $t0, 9, retDisp
lw $a0, ($t1)
li $v0, 11
syscall
div $t0, $t3
mfhi $t2
beqz $t2, nextLine
#Space
li $a0, 32
li $v0, 11
syscall
addi $t0, $t0, 1
addi $t1, $t1, 4
j dispLoop
nextLine:
li $a0, 10
li $v0, 11
syscall
addi $t0, $t0, 1
addi $t1, $t1, 4
j dispLoop
retDisp:
jr $ra
placeMark:
move $t0, $a0
la $a0, input
li $v0, 4
syscall
li $v0, 5
syscall
addi $v0, $v0, -1
mul $v0, $v0, 4
add $t0, $t0, $v0
lw $t1, ($t0)
beq $t1, '_', change
jr $ra
change:
sw $a1, ($t0)
jr $ra
checkWinner:
move $t0, $a0
li $t1, 1
li $v0, 1
loop:
bgt $t1, 9, ret
lw $t2, ($t0)
beq $t2, $a1, nextCol2
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol2
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol3
li $v0, 0
j ret
nextCol2:
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextCol3
addi $t0, $t0, 8
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextRow
addi $t0, $t0, 8
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, nextDiag
nextCol3:
addi $t0, $t0, 4
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
nextRow:
addi $t0, $t0, 12
lw $t2, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
nextDiag:
addi $t0, $t0, 16
lw $t1, ($t0)
addi $t1, $t1, 1
beq $t2, $a1, ret
j loop
ret:
jr $ra
|
ElementScripter_AppSpecific.scpt | sancarn/Element-Scripter | 7 | 3201 | //Element Scripter for specific programs.
//Add this script to a service and bind it to a keyboard shortcut for quick documentation of GUI elements.
//Great for complex applications which may have many GUIs
var procName = "Safari"
var wndID = 0
//SIMULATE EXIT-SUB WITH BREAK:
Script: {
//Setup app for notifications.
var app = Application.currentApplication()
app.includeStandardAdditions = true
//Setup system element processing.
var system = Application('System Events')
system.includeStandardAdditions = true
//Get process
var proc = system.applicationProcesses.byName(procName)
//Get correct window
var wnd = proc.windows[wndID]
//Notify user that this may take a while
app.displayNotification('Gathering GUI Elements from window "' + wnd.title() + '" of process "' + procName + '". This may take a while...', {
withTitle: 'Element Scripter',
//subtitle: 'Subtitle',
soundName: 'Sosumi'
})
var elements = wnd.entireContents()
var a = []
var s = "Address|Title|Name|Description|Help|Role|Enabled|Focused|Position|Size|Value"
for(var i=0;i<elements.length;i++){
//Try to get el, if cannot then Cannot get element
try {
var el = elements[i]
} catch (e) {
s = s + "Cannot get element\n"
continue
}
cmds = [Automation.getDisplayString,el.title,el.name,el.description,el.help,el.role,el.enabled,el.focused,el.position,el.size,el.value]
p = [];
for(var j=0;j<cmds.length;j++){
try{
p.push(cmds[j](el))
} catch (e) {
p.push("'UNK'")
}
}
s = s + "\n" + p.join("|")
}
var textEdit = Application("TextEdit");
var newDoc = textEdit.Document().make();
textEdit.activate()
newDoc.text = s
app.displayNotification('Elements from window "' + wnd.title() + '" of process "' + procName + '" have been extracted into text edit.', {
withTitle: 'Element Scripter',
soundName: 'Sosumi'
})
//EXIT-SUB
break Script
//END-OF-SCRIPT
}
|
tests/misc/dir_align.asm | cizo2000/sjasmplus | 0 | 173349 | DEVICE ZXSPECTRUM48
org $8000
; 17 bytes block of "default" memory values
db "ABCDEFGHIJKLMNOPZ"
ALIGN 0 ; error
ALIGN 1,-1 ; error
ALIGN 1,256 ; error
ALIGN 3 ; error
ALIGN 5,10 ; error
ALIGN $10000 ; error
; re-run over the initial values again with different ALIGN directives
org $8000
db 'a' ; [8000] = 'a'
ALIGN 1 ; effective nothing should happen here
ALIGN 1, '!' ; and neighter here
ALIGN 2 ; this should advance to $8002 + preserve memory
ALIGN 4, 'b' ; [8002] = [8003] = 'b'
ALIGN 7, '!' ; error
ALIGN 8 ; advance to 8008, preserve memory
ALIGN 16, 'c' ; [8008..800F] = 'c'
ALIGN ; should not make any difference (already at MOD 4 address)
; the final result should be "aBbbEFGHccccccccZ"
SAVEBIN "dir_align.bin", $8000, 17 ; modified area is saved into BIN file
|
programs/oeis/052/A052530.asm | jmorken/loda | 1 | 20861 | ; A052530: a(n) = 4*a(n-1) - a(n-2), with a(0) = 0, a(1) = 2.
; 0,2,8,30,112,418,1560,5822,21728,81090,302632,1129438,4215120,15731042,58709048,219105150,817711552,3051741058,11389252680,42505269662,158631825968,592022034210,2209456310872,8245803209278,30773756526240,114849222895682,428623135056488,1599643317330270,5969950134264592
mov $2,2
lpb $0
sub $0,1
add $1,$2
add $2,$1
add $2,$1
lpe
|
FoldingText.lbaction/Contents/Scripts/getvisible.scpt | raguay/MyLaunchBarActions | 29 | 2918 | tell application "FoldingText"
tell front document
evaluate script "function(editor, options) {
var Pasteboard = require('ft/system/pasteboard').Pasteboard,
tree = editor.tree(),
results = [];
tree.nodes().forEach(function(each) {
if (!editor.nodeIsHiddenInFold(each) && !editor.isCollapsed(each)) {
results.push(each.line());
}
});
results = results.join('\\n');
Pasteboard.writeString(results);
return results;
}" with options {}
end tell
end tell
|
src/apsepp-output_class-standard.ads | thierr26/ada-apsepp | 0 | 20755 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
package Apsepp.Output_Class.Standard is
----------------------------------------------------------------------------
protected type Output_Standard is new Output_Interfa with
overriding
procedure Put_Line (S : String);
end Output_Standard;
----------------------------------------------------------------------------
end Apsepp.Output_Class.Standard;
|
out/TLC/Equality.agda | JoeyEremondi/agda-soas | 39 | 13240 | <filename>out/TLC/Equality.agda
{-
This second-order equational theory was created from the following second-order syntax description:
syntax TLC | Λ
type
N : 0-ary
_↣_ : 2-ary | r30
𝟙 : 0-ary
_⊗_ : 2-ary | l40
𝟘 : 0-ary
_⊕_ : 2-ary | l30
term
app : α ↣ β α -> β | _$_ l20
lam : α.β -> α ↣ β | ƛ_ r10
unit : 𝟙
pair : α β -> α ⊗ β | ⟨_,_⟩
fst : α ⊗ β -> α
snd : α ⊗ β -> β
abort : 𝟘 -> α
inl : α -> α ⊕ β
inr : β -> α ⊕ β
case : α ⊕ β α.γ β.γ -> γ
ze : N
su : N -> N
nrec : N α (α,N).α -> α
theory
(ƛβ) b : α.β a : α |> app (lam(x.b[x]), a) = b[a]
(ƛη) f : α ↣ β |> lam (x. app(f, x)) = f
(𝟙η) u : 𝟙 |> u = unit
(fβ) a : α b : β |> fst (pair(a, b)) = a
(sβ) a : α b : β |> snd (pair(a, b)) = b
(pη) p : α ⊗ β |> pair (fst(p), snd(p)) = p
(𝟘η) e : 𝟘 c : α |> abort(e) = c
(lβ) a : α f : α.γ g : β.γ |> case (inl(a), x.f[x], y.g[y]) = f[a]
(rβ) b : β f : α.γ g : β.γ |> case (inr(b), x.f[x], y.g[y]) = g[b]
(cη) s : α ⊕ β c : (α ⊕ β).γ |> case (s, x.c[inl(x)], y.c[inr(y)]) = c[s]
(zeβ) z : α s : (α,N).α |> nrec (ze, z, r m. s[r,m]) = z
(suβ) z : α s : (α,N).α n : N |> nrec (su (n), z, r m. s[r,m]) = s[nrec (n, z, r m. s[r,m]), n]
(ift) t f : α |> if (true, t, f) = t
(iff) t f : α |> if (false, t, f) = f
-}
module TLC.Equality 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 TLC.Signature
open import TLC.Syntax
open import SOAS.Metatheory.SecondOrder.Metasubstitution Λ:Syn
open import SOAS.Metatheory.SecondOrder.Equality Λ:Syn
private
variable
α β γ τ : ΛT
Γ Δ Π : Ctx
infix 1 _▹_⊢_≋ₐ_
-- Axioms of equality
data _▹_⊢_≋ₐ_ : ∀ 𝔐 Γ {α} → (𝔐 ▷ Λ) α Γ → (𝔐 ▷ Λ) α Γ → Set where
ƛβ : ⁅ α ⊩ β ⁆ ⁅ α ⁆̣ ▹ ∅ ⊢ (ƛ 𝔞⟨ x₀ ⟩) $ 𝔟 ≋ₐ 𝔞⟨ 𝔟 ⟩
ƛη : ⁅ α ↣ β ⁆̣ ▹ ∅ ⊢ ƛ (𝔞 $ x₀) ≋ₐ 𝔞
𝟙η : ⁅ 𝟙 ⁆̣ ▹ ∅ ⊢ 𝔞 ≋ₐ unit
fβ : ⁅ α ⁆ ⁅ β ⁆̣ ▹ ∅ ⊢ fst (⟨ 𝔞 , 𝔟 ⟩) ≋ₐ 𝔞
sβ : ⁅ α ⁆ ⁅ β ⁆̣ ▹ ∅ ⊢ snd (⟨ 𝔞 , 𝔟 ⟩) ≋ₐ 𝔟
pη : ⁅ α ⊗ β ⁆̣ ▹ ∅ ⊢ ⟨ (fst 𝔞) , (snd 𝔞) ⟩ ≋ₐ 𝔞
𝟘η : ⁅ 𝟘 ⁆ ⁅ α ⁆̣ ▹ ∅ ⊢ abort 𝔞 ≋ₐ 𝔟
lβ : ⁅ α ⁆ ⁅ α ⊩ γ ⁆ ⁅ β ⊩ γ ⁆̣ ▹ ∅ ⊢ case (inl 𝔞) (𝔟⟨ x₀ ⟩) (𝔠⟨ x₀ ⟩) ≋ₐ 𝔟⟨ 𝔞 ⟩
rβ : ⁅ β ⁆ ⁅ α ⊩ γ ⁆ ⁅ β ⊩ γ ⁆̣ ▹ ∅ ⊢ case (inr 𝔞) (𝔟⟨ x₀ ⟩) (𝔠⟨ x₀ ⟩) ≋ₐ 𝔠⟨ 𝔞 ⟩
cη : ⁅ α ⊕ β ⁆ ⁅ (α ⊕ β) ⊩ γ ⁆̣ ▹ ∅ ⊢ case 𝔞 (𝔟⟨ inl x₀ ⟩) (𝔟⟨ inr x₀ ⟩) ≋ₐ 𝔟⟨ 𝔞 ⟩
zeβ : ⁅ α ⁆ ⁅ α · N ⊩ α ⁆̣ ▹ ∅ ⊢ nrec ze 𝔞 (𝔟⟨ x₀ ◂ x₁ ⟩) ≋ₐ 𝔞
suβ : ⁅ α ⁆ ⁅ α · N ⊩ α ⁆ ⁅ N ⁆̣ ▹ ∅ ⊢ nrec (su 𝔠) 𝔞 (𝔟⟨ x₀ ◂ x₁ ⟩) ≋ₐ 𝔟⟨ (nrec 𝔠 𝔞 (𝔟⟨ x₀ ◂ x₁ ⟩)) ◂ 𝔠 ⟩
open EqLogic _▹_⊢_≋ₐ_
open ≋-Reasoning
-- Derived equations
ift : ⁅ α ⁆ ⁅ α ⁆̣ ▹ ∅ ⊢ if true 𝔞 𝔟 ≋ 𝔞
ift = ax lβ with《 unit ◃ 𝔞 ◃ 𝔟 》
iff : ⁅ α ⁆ ⁅ α ⁆̣ ▹ ∅ ⊢ if false 𝔞 𝔟 ≋ 𝔟
iff = ax rβ with《 unit ◃ 𝔞 ◃ 𝔟 》
-- Double beta reduction
ƛβ² : ⁅ β · α ⊩ γ ⁆ ⁅ α ⁆ ⁅ β ⁆̣ ▹ ∅ ⊢ (ƛ (ƛ 𝔞⟨ x₀ ◂ x₁ ⟩)) $ 𝔟 $ 𝔠 ≋ 𝔞⟨ 𝔠 ◂ 𝔟 ⟩
ƛβ² = begin
(ƛ (ƛ 𝔞⟨ x₀ ◂ x₁ ⟩)) $ 𝔟 $ 𝔠
≋⟨ cong[ ax ƛβ with《 (ƛ 𝔞⟨ x₀ ◂ x₁ ⟩) ◃ 𝔟 》 ]inside ◌ᵈ $ 𝔠 ⟩
(ƛ 𝔞⟨ x₀ ◂ 𝔟 ⟩) $ 𝔠
≋⟨ ax ƛβ with《 (𝔞⟨ x₀ ◂ 𝔟 ⟩) ◃ 𝔠 》 ⟩
𝔞⟨ 𝔠 ◂ 𝔟 ⟩
∎
-- Uncurrying and arithmetic
1+2 : ⁅⁆ ▹ ∅ ⊢ uncurry $ plus $ ⟨ su ze , su (su ze) ⟩ ≋ su (su (su ze))
1+2 = begin
uncurry $ plus $ ⟨ su ze , su (su ze) ⟩
≋⟨ thm ƛβ² with《 x₁ $ fst x₀ $ snd x₀ ◃ plus ◃ ⟨ su ze , su (su ze) ⟩ 》 ⟩
plus $ fst ⟨ su ze , su (su ze) ⟩ $ snd ⟨ su ze , su (su ze) ⟩
≋⟨ cong₂[ ax fβ with《 su ze ◃ su (su ze) 》 ][
ax sβ with《 su ze ◃ su (su ze) 》 ]inside plus $ ◌ᵃ $ ◌ᵇ ⟩
plus $ su ze $ su (su ze)
≋⟨ thm ƛβ² with《 nrec x₁ x₀ (su x₀) ◃ su ze ◃ su (su ze) 》 ⟩
nrec (su ze) (su (su ze)) (su x₀)
≋⟨ ax suβ with《 su (su ze) ◃ su x₀ ◃ ze 》 ⟩
su (nrec ze (su (su ze)) (su x₀))
≋⟨ cong[ ax zeβ with《 su (su ze) ◃ su x₀ 》 ]inside su ◌ᵃ ⟩
su (su (su ze))
∎
|
examples/indx.asm | x86128/pymesm | 2 | 95022 | org -0x1000
ptr uart 1000
xta uart-1,1
xta uart+5,2
xta uart[-2],3
stop 1234,4
vtm 10,5
dorg -2048
|
Altair101/asm/programsUntested/pBootPlay.asm | tigerfarm/arduino | 2 | 243075 | <gh_stars>1-10
; ------------------------------------------------
; Play MP3 files.
;
; ------------------------------------------------
Begin:
; ------------------------------------------------
MVI A,1 ; MP3 file: Operational.
OUT 10 ; Single play.
org 52 ; NOPs to give time to complete the playing of the MP3 and have silence after until the next MP3 is played.
HLT ;
; ------------------------------------------------
MVI A,11 ; MP3 file: Good morning.
OUT 10 ; Single play.
org 78 ; NOPs to give time to complete the playing of the MP3 and have silence after until the next MP3 is played.
HLT ;
; ------------------------------------------------
MVI A,8 ; MP3 file: Play a game.
OUT 10 ; Single play.
org 110 ; NOPs to give time to complete the playing of the MP3 and have silence after until the next MP3 is played.
HLT ;
; ------------------------------------------------
JMP Begin
END
|
programs/streamplay/wavefile.asm | chaos4ever/chaos-old | 0 | 89030 | global wavefile, wavefile_end
wavefile:
incbin "wavefile.wav"
wavefile_end: |
FlashLedDelay/boardsetup.asm | peteri/stm8ldiscovery | 0 | 171814 | stm8/
#include "mapping.inc"
#include "variables.inc"
#include "stm8l152c6.inc"
ram0_start.b EQU $ram0_segment_start
ram0_end.b EQU $ram0_segment_end
ram1_start.w EQU $ram1_segment_start
ram1_end.w EQU $ram1_segment_end
segment 'rom'
;
; Setup up the gpio ports
;
.init_gpio.l
; set everything to have a pullup resistor in input mode
mov PA_CR1,#$FF
mov PB_CR1,#$FF
mov PC_CR1,#$FF
mov PD_CR1,#$FF
mov PE_CR1,#$FF
mov PA_CR2,#$00
mov PB_CR2,#$00
mov PC_CR2,#$00
mov PD_CR2,#$00
mov PE_CR2,#$00
mov PA_DDR,#$00
mov PB_DDR,#$00
mov PC_DDR,#$00
mov PD_DDR,#$00
mov PE_DDR,#$00
; setup for LEDs
bset PE_DDR,#7
bset PE_CR1,#7
bset PC_DDR,#7
bset PC_CR1,#7
ret
end
|
Sem IV Microprocessors Lab/Hardware Programs (part b)/elev.asm | prithvihv/VTU_CSE_LABS | 1 | 20481 | UP MACRO N
LOCAL AGN
MOV AL,0F0H
AGN:MOV DX,PA
OUT DX,AL
DELAY
INC AL
CMP AL,N
JLE AGN
ENDM
DOWN MACRO M
LOCAL AGN
MOV AL,M
AGN: MOV DX,PA
OUT DX,AL
DELAY
DEC AL
CMP AL,0F0H
JGE AGN
ENDM
DELAY MACRO
LOCAL D1,D2
PUSH BX
PUSH CX
MOV BX,0FFFH
D1:MOV CX,0FFFFH
D2:LOOP D2
DEC BX
JNZ D1
POP CX
POP BX
ENDM
.MODEL SMALL
.DATA
PA EQU 9800H
PB EQU 9801H
CWR EQU 9803H
.CODE
MOV AX,@DATA
MOV DS,AX
MOV AL,82H
MOV DX,CWR
OUT DX,AL
ECH: MOV AL,00
MOV DX,PA
OUT DX,AL
MOV AL,0F0H
MOV DX,PA
OUT DX,AL
MOV DX,PB
IN AL,DX
AND AL,0FH
CMP AL,0EH
JNE L1
DELAY
JMP ECH
L1: CMP AL,0DH
JNE L3
PUSH AX
UP 0F3H
DELAY
DELAY
DELAY
MOV AL,00
MOV DX,PA
OUT DX,AL
DOWN 0F3H
POP AX
L3: CMP AL,0BH
JNE L4
PUSH AX
UP 0F6H
DELAY
DELAY
DELAY
MOV AL,00
MOV DX,PA
OUT DX,AL
DOWN 0F6H
POP AX
L4: CMP AL,07H
JNE L5
PUSH AX
UP 0F9H
DELAY
DELAY
DELAY
MOV AL,00
MOV DX,PA
OUT DX,AL
DOWN 0F9H
POP AX
L5: MOV AH,0BH
INT 21H
OR AL,AL
JNZ STOP
JMP ECH
STOP: MOV AH,4CH
INT 21H
END
|
examples/simple/quantifierIn/quantifierIn-output.agda | wenkokke/vehicle | 11 | 13035 | <gh_stars>10-100
-- WARNING: This file was generated automatically by Vehicle
-- and should not be modified manually!
-- Metadata
-- - Agda version: 2.6.2
-- - AISEC version: 0.1.0.1
-- - Time generated: ???
{-# OPTIONS --allow-exec #-}
open import Vehicle
open import Data.Unit
open import Data.Integer as ℤ using (ℤ)
open import Data.List
open import Data.List.Relation.Unary.All as List
module quantifierIn-output where
private
VEHICLE_PROJECT_FILE = "TODO_projectFile"
emptyList : List ℤ
emptyList = []
abstract
empty : List.All (λ (x : ℤ) → ⊤) emptyList
empty = checkProperty record
{ projectFile = VEHICLE_PROJECT_FILE
; propertyUUID = "TODO_propertyUUID"
} |
test/interaction/Issue591/M.agda | cruhland/agda | 1,989 | 7538 | module Issue591.M where
|
data/baseStats/nidoranm.asm | etdv-thevoid/pokemon-rgb-enhanced | 1 | 92977 | db NIDORAN_M ; pokedex id
db 46 ; base hp
db 57 ; base attack
db 40 ; base defense
db 50 ; base speed
db 40 ; base special
db POISON ; species type 1
db POISON ; species type 2
db 235 ; catch rate
db 60 ; base exp yield
INCBIN "pic/gsmon/nidoranm.pic",0,1 ; 55, sprite dimensions
dw NidoranMPicFront
dw NidoranMPicBack
; attacks known at lvl 0
db TACKLE
db LEER
db 0
db 0
db 3 ; growth rate
; learnset
tmlearn 6,7,8
tmlearn 9,10,14
tmlearn 20,24
tmlearn 25,28,31,32
tmlearn 33,34,37
tmlearn 44
tmlearn 50,51
db BANK(NidoranMPicFront)
|
oeis/108/A108165.asm | neoneye/loda-programs | 11 | 163756 | <gh_stars>10-100
; A108165: a(n)=a(n-1) +A108173(n+1) -A108173(n).
; Submitted by <NAME>
; 2,5,9,12,15,19,22,26,29,32,36,39,42,46,49,53,56,59,63,66,70,73,76,80,83,86,90,93,97,100,103,107,110,114,117,120,124,127,130,134,137,141,144,147,151,154,157,161,164,168,171,174,178,181,185,188,191,195,198,201
add $0,1
mov $1,114
mul $1,$0
add $1,$0
div $1,34
mov $0,$1
sub $0,1
|
code_sender/safari/safari-rstudio.applescript | fredcallaway/SendCode | 177 | 1408 | on run argv
tell application "Safari"
tell front window's current tab to do JavaScript "
var input = document.getElementById('rstudio_console_input');
var textarea = input.getElementsByTagName('textarea')[0];
textarea.value += \"" & item 1 of argv & "\";
var e = document.createEvent('KeyboardEvent');
e.initKeyboardEvent('input');
textarea.dispatchEvent(e);
var e = document.createEvent('KeyboardEvent');
e.initKeyboardEvent('keydown');
Object.defineProperty(e, 'keyCode', {'value' : 13});
input.dispatchEvent(e);
"
end tell
end run
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.