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 |
|---|---|---|---|---|
test/13_mul.asm | x86128/pymesm | 2 | 27284 | #
# Test for instructions А*Х, А/Х.
#
org 1
lbl start
vtm stack,15
ntr 3
xta cdu5l
mul c5udl # 13/2**64
atx 0,15
yta 64
stx ws
aex cau
uia fail
xta ws
aex cau41l # 65/2**24
uia fail
xta c5u5l # 5/2**64
mul cim13 # = -65
atx 0,15
yta 64
stx ws
aex ca1ufs
uia fail
xta ws
eaddn 88 # 64+24
aex cd0fbf # -65!-
uia fail
ntr 2
xta c848u # 2.
mul c84cu # 3.
atx ws
aex c84cu # 3.
aex c02u
uia fail # !=6
lbl pass
stop 0o12345,6
lbl fail
stop 0o76543,2
dorg 0o2000 # данные с адреса 2000
arr cdu5l 0o6400000000000005
arr c5udl 0o2400000000000015
arr cau 0o5000000000000000
arr cau41l 0o5000000000000101
arr c5u5l 0o2400000000000005
arr cim13 0o6437777777777763
arr ca1ufs 0o5037777777777777
arr cd0fbf 0o6417777777777677
arr c848u 0o4110000000000000
arr c84cu 0o4114000000000000 # 3.
arr c02u 0o0040000000000000
mem ws 1
mem stack 10 # стек
|
src/cups-cups.adb | persan/a-cups | 0 | 19376 | package body CUPS.CUPS is
----------------
-- GetDefault --
----------------
function GetDefault return String is
V : Chars_Ptr := Cups_Cups_H.CupsGetDefault;
begin
if V /= Null_Ptr then
return Interfaces.C.Strings.Value (V);
else
return "";
end if;
end GetDefault;
---------------
-- PrintFile --
---------------
function PrintFile
(Name : String;
Filename : String;
Title : String;
Num_Options : Job_Id;
Options : Option_T) return Job_Id
is
L_Name : Chars_Ptr := New_String (Name);
L_Filename : Chars_Ptr := New_String (Filename);
L_Title : Chars_Ptr := New_String (Title);
L_Num_Options : Int := Int (Num_Options);
Ret : Int;
begin
Ret := Cups_Cups_H.CupsPrintFile
(Name => L_Name,
Filename => L_Filename,
Title => L_Title,
Num_Options => L_Num_Options,
Options => Options);
Free (L_Name);
Free (L_Filename);
Free (L_Title);
return Job_Id (Ret);
end PrintFile;
---------------
-- CancelJob --
---------------
procedure CancelJob
(Name : String := Cups.GetDefault;
JobId : Integer := -1 )
is
L_Name : Chars_Ptr := New_String (Name);
L_Id : Int := Int (JobId);
Ret : Int;
begin
Ret := Cups_Cups_H.CupsCancelJob
(Name => L_Name,
Job_Id => L_Id);
Free (L_Name);
--return Job_Id (Ret);
end CancelJob;
----------------------------
-- GetDefaultPrinterState --
----------------------------
function GetDefaultPrinterState return String
is
L_State : Chars_Ptr := New_String ("printer-state");
Num_Dests : Int;
Dest : aliased Cups.Destination_T := null;
Destinations : aliased Cups.Destination_T := null;
Ret : Chars_Ptr;
begin
Num_Dests := Cups_Cups_H.CupsGetDests (Destinations'Address);
Dest := Cups_Cups_H.CupsGetDest (Name => Interfaces.C.Strings.Null_Ptr,
Instance => Interfaces.C.Strings.Null_Ptr,
Num_Dests => Num_Dests,
Dests => Destinations);
if Dest /= null then
Ada.Text_IO.Put_Line ("Printer found!: " & Value (Dest.Name));
Ret := Cups_Cups_H.CupsGetOption ( Name => L_State,
Num_Options => Dest.Num_Options,
Options => Dest.Options);
if Ret = Interfaces.C.Strings.Null_Ptr then
return "null";
else
return Value (Ret);
end if;
else
return "null";
end if;
end GetDefaultPrinterState;
--------------------
-- PrintRawString --
--------------------
procedure PrintString ( Str : String; Raw : Boolean)
is
package BS_PS is new Ada.Strings.Bounded.Generic_Bounded_Length (Max => 20);
Num_Options : Job_Id := 0;
Printer_State : BS_PS.Bounded_String;
Id : Job_Id := 0;
Cancel_Job : Job_Id := 0;
Options : aliased Cups.Option_T := null;
Temp_File : Ada.Text_IO.File_Type;
Temp_File_Name : Standard.String := "TempPrintFile.txt";
begin
Printer_State := BS_PS.To_Bounded_String (Cups.GetDefaultPrinterState);
Ada.Text_IO.Put_Line ("Printer state: " & BS_PS.To_String (Printer_State));
-- If a printer queue exists
if BS_PS.To_String (Printer_State) /= "null" then
case Raw is
when True =>
SetRawPrinting (Num_Options => Num_Options,
Options => Options);
when False =>
null;
end case;
-- Create the file for printing
Ada.Text_IO.Create (Temp_File, Ada.Text_IO.Out_File, Temp_File_Name);
Ada.Text_IO.Put_Line (Temp_File, Str);
-- Close before sending to printer
Ada.Text_IO.Close (Temp_File);
-- Print file
Id := Cups.PrintFile (Cups.GetDefault, Temp_File_Name, "Test Print", Num_Options, Options);
-- Did the print succeed?
if Id /= 0 then
Ada.Text_IO.Put_Line ("Printing!");
else
Ada.Text_IO.Put_Line ("Printing failed!");
end if;
else
Ada.Text_IO.Put_Line ("No printer found!");
end if;
end PrintString;
---------------------
-- SetRawPrinting --
---------------------
procedure SetRawPrinting (Num_Options : in out Job_ID;
Options : aliased Option_T) is
begin
Num_Options := Cups.AddOption ("raw", "true", Num_Options, Options);
Num_Options := Cups.AddOption ("usb-no-reattach-default", "true", Num_Options, Options);
end SetRawPrinting;
---------------
-- AddOption --
---------------
function AddOption
(Name : String;
Value : String;
Num_Options : Job_Id;
Options : aliased Option_T) return Job_Id
is
L_Name : Chars_Ptr := New_String (Name);
L_Value : Chars_Ptr := New_String (Value);
L_Num_Options : Int := Int (Num_Options);
Ret : Int;
begin
Ret := Cups_Cups_H.CupsAddOption
(Name => L_Name ,
Value => L_Value,
Num_Options => L_Num_Options,
Options => Options'Address);
Free (L_Name);
Free (L_Value);
return Job_Id (Ret);
end AddOption;
---------------
-- GetOption --
---------------
function GetOption
(Name : String;
Num_Options : Job_Id;
Options : Option_T) return String
is
L_Name : Chars_Ptr := New_String (Name);
L_Num_Options : Int := Int (Num_Options);
Ret : Chars_Ptr;
begin
Ret := Cups_Cups_H.CupsGetOption
(Name => L_Name,
Num_Options => L_Num_Options,
Options => Options);
Free (L_Name);
if Ret = Interfaces.C.Strings.Null_Ptr then
return "null";
else
return Value (Ret);
end if;
end GetOption;
end CUPS.CUPS;
|
travis/test/elif.asm | km2m/nasm | 2,219 | 8999 | %macro DosPrintMsg 1+
%ifnid %1
section .data
%%str_to_print:db %1
section .text
mov dx,%%str_to_print
mov ah,9
int 0x21
%else
mov dx,(%1)
mov ah,9
int 0x21
%endif
%endmacro
%macro DosExit 1
%if (%1) == 0
;use short-form return 0 exit
int 0x20
%elif ((%1) < 256) && ((%1) > 0)
mov ax,0x4C00 | (%1)
int 0x21
%else
%error Invalid return value
%endif
%endmacro
section .text
DosPrintMsg predefined_str
DosPrintMsg "Using string with macro-defined label",10,0
DosExit 0
DosExit 1
section .data
predefined_str:db "Using string with predefined label",10,0
|
drivers/dense_ad-integrator.ads | sciencylab/lagrangian-solver | 0 | 10206 | with Numerics, Numerics.Sparse_Matrices, Chebyshev, Ada.Text_IO;
use Numerics, Numerics.Sparse_Matrices, Chebyshev, Ada.Text_IO;
generic
K : in Nat;
N_Constraints : in Pos := 0;
package Dense_AD.Integrator is
N : constant Nat := (Num - N_Constraints) / 2;
type Dense_Or_Sparse is (Dense, Sparse);
type Create_Or_Append is (Create, Append, Neither);
type Variable is record
T : Real := 0.0;
X : Vector := (others => 0.0);
end record;
type Control_Type is record
Dto : Real := 1.0;
Dt : Real := 1.0;
Dtn : Real := 1.0;
Tol : Real := 1.0e-10;
Err : Real := 1.0;
Started : Boolean := False;
Max_Dt : Real := 1.0;
end record;
type Array_Of_Vectors is array (1 .. Num) of Real_Vector (1 .. K);
function New_Control_Type (Dt : in Real := 1.0;
Tol : in Real := 1.0e-10;
Started : in Boolean := False) return Control_Type;
function Chebyshev_Transform (Y : in Real_Vector) return Array_Of_Vectors
with Pre => Y'First = 1 and Y'Length = Num * K;
function Interpolate (A : in Array_Of_Vectors;
T : in Real;
L : in Real;
R : in Real) return Vector;
procedure Update (Var : in out Variable;
Y : in Real_Vector;
Dt : in Real)
with Pre => Y'First = 1 and Y'Length = Num * K;
function Update (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Var : in Variable;
Control : in out Control_Type;
Density : in Dense_Or_Sparse) return Real_Vector;
function Update (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Var : in Variable;
Control : in out Control_Type) return Real_Vector;
procedure Print_Lagrangian (File : in File_Type;
Var : in Variable;
Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Fore : in Field := 3;
Aft : in Field := 5;
Exp : in Field := 3);
procedure Print_Lagrangian (Var : in Variable;
Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Fore : in Field := 3;
Aft : in Field := 5;
Exp : in Field := 3);
procedure Print_XYZ (File : in out File_Type;
Var : in Variable);
procedure Print_XYZ (File : in out File_Type;
Var : in Variable;
Name : in String;
Mode : in Create_Or_Append := Neither);
procedure Print_CSV (File : in out File_Type;
Var : in Variable;
Name : in String;
Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Mode : in Create_Or_Append := Neither);
function Hamiltonian (T : in Real;
X : in Vector;
Lagrangian : not null access
function (T : real; X : Vector) return AD_Type)
return Real;
function Split (Y : in Real_Vector) return Array_Of_Vectors
with Pre => Y'First = 1 and Y'Length = Num * K;
Grid : constant Real_Vector := Chebyshev_Gauss_Lobatto (K, 0.0, 1.0);
NK : constant Nat := Num * K;
private
Collocation_Density : Dense_Or_Sparse := Sparse;
procedure Iterate (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Y : in out Real_Vector;
Var : in Variable;
Control : in out Control_Type);
procedure Colloc (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Q : in out Real_Vector;
Var : in Variable;
Control : in out Control_Type);
procedure Collocation (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Q : in out Real_Vector;
Var : in Variable;
Control : in out Control_Type);
procedure FJ (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Var : in Variable;
Control : in Control_Type;
Q : in Real_Vector;
F : out Real_Vector;
J : out Real_Matrix);
procedure Sp_Collocation (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Q : in out Real_Vector;
Var : in Variable;
Control : in out Control_Type);
procedure Sp_FJ (Lagrangian : not null access
function (T : real; X : Vector) return AD_Type;
Var : in Variable;
Control : in Control_Type;
Q : in Real_Vector;
F : out Sparse_Vector;
J : out Sparse_Matrix);
type Array_Of_Sparse_Matrix is array (1 .. 4) of Sparse_Matrix;
function Setup return Array_Of_Sparse_Matrix;
Der : constant Real_Matrix := Derivative_Matrix (K, 0.0, 1.0);
EyeN : constant Sparse_Matrix := Eye (N);
EyeK : constant Sparse_Matrix := Eye (K);
Eye2N : constant Sparse_Matrix := Eye (2 * N);
EyeNc : constant Sparse_Matrix := Eye (N_Constraints);
D : constant Sparse_Matrix := Sparse (Der);
ZeroN : constant Sparse_Matrix := Zero (N);
ZeroNc : constant Sparse_Matrix := Zero (N_Constraints);
Zero2N : constant Sparse_Matrix := Zero (2 * N);
Sp : constant Array_Of_Sparse_Matrix := Setup;
Mat_A : constant Real_Matrix := Dense (Sp (1));
Mat_B : constant Real_Matrix := Dense (Sp (2));
Mat_C : constant Real_Matrix := Dense (Sp (3));
Mat_D : constant Real_Matrix := Dense (Sp (4));
end Dense_AD.Integrator;
|
oeis/145/A145664.asm | neoneye/loda-programs | 11 | 247841 | <reponame>neoneye/loda-programs
; A145664: a(n) = numerator of polynomial of genus 1 and level n for m = 6 = A[1,n](6).
; Submitted by <NAME>
; 0,6,39,236,2835,42531,255191,10718052,257233353,2315100317,2315100338,152796622518,1833559470601,71508819355749,429052916136639,2574317496821836,123567239847463143,6301929232220740413
mul $0,2
mov $1,41
lpb $0
sub $0,2
div $1,2
add $2,1
dif $3,2
mul $3,$2
add $3,$1
mul $1,$2
mul $1,2
mul $3,12
lpe
mov $0,$3
gcd $3,$1
mov $1,$0
div $1,$3
mov $0,$1
|
programs/oeis/158/A158371.asm | karttu/loda | 1 | 87241 | <filename>programs/oeis/158/A158371.asm<gh_stars>1-10
; A158371: 576n^2 - 2n.
; 574,2300,5178,9208,14390,20724,28210,36848,46638,57580,69674,82920,97318,112868,129570,147424,166430,186588,207898,230360,253974,278740,304658,331728,359950,389324,419850,451528,484358,518340,553474,589760,627198,665788,705530,746424,788470,831668,876018,921520,968174,1015980,1064938,1115048,1166310,1218724,1272290,1327008,1382878,1439900,1498074,1557400,1617878,1679508,1742290,1806224,1871310,1937548,2004938,2073480,2143174,2214020,2286018,2359168,2433470,2508924,2585530,2663288,2742198,2822260,2903474,2985840,3069358,3154028,3239850,3326824,3414950,3504228,3594658,3686240,3778974,3872860,3967898,4064088,4161430,4259924,4359570,4460368,4562318,4665420,4769674,4875080,4981638,5089348,5198210,5308224,5419390,5531708,5645178,5759800,5875574,5992500,6110578,6229808,6350190,6471724,6594410,6718248,6843238,6969380,7096674,7225120,7354718,7485468,7617370,7750424,7884630,8019988,8156498,8294160,8432974,8572940,8714058,8856328,8999750,9144324,9290050,9436928,9584958,9734140,9884474,10035960,10188598,10342388,10497330,10653424,10810670,10969068,11128618,11289320,11451174,11614180,11778338,11943648,12110110,12277724,12446490,12616408,12787478,12959700,13133074,13307600,13483278,13660108,13838090,14017224,14197510,14378948,14561538,14745280,14930174,15116220,15303418,15491768,15681270,15871924,16063730,16256688,16450798,16646060,16842474,17040040,17238758,17438628,17639650,17841824,18045150,18249628,18455258,18662040,18869974,19079060,19289298,19500688,19713230,19926924,20141770,20357768,20574918,20793220,21012674,21233280,21455038,21677948,21902010,22127224,22353590,22581108,22809778,23039600,23270574,23502700,23735978,23970408,24205990,24442724,24680610,24919648,25159838,25401180,25643674,25887320,26132118,26378068,26625170,26873424,27122830,27373388,27625098,27877960,28131974,28387140,28643458,28900928,29159550,29419324,29680250,29942328,30205558,30469940,30735474,31002160,31269998,31538988,31809130,32080424,32352870,32626468,32901218,33177120,33454174,33732380,34011738,34292248,34573910,34856724,35140690,35425808,35712078,35999500
mov $1,12
mov $2,$0
add $2,1
mul $2,2
mul $1,$2
pow $1,2
sub $1,$2
|
exercises/exercise4/test5-2.asm | Dark15/assembly | 1 | 21633 |
jmp near start
text db 'L',0x07,'a',0x07,'b',0x07,'e',0x07,'l',0x07,' ',0x07,'o',0x07,\
'f',0x07,'f',0x07,'s',0x07,'e',0x07,'t',0x07,':',0x07
start:
mov ax, 0x07c0
mov ds, ax
mov ax, 0xb800
mov es, ax
cld ;将Direction Flag设置为0,表示从低地址到高地址
mov si, text ;si指向text指向的内存地址
mov di, 0 ;设置输出的起始地址
mov cx, 13 ;设置要显示的字符个数
rep movsw ;将text中的字符复制到屏幕的第0行的第0列开始的位置
jmp short $
times 510 - ($ - $$) db 0
dw 0xAA55
|
Light/Package.agda | zamfofex/lightlib | 1 | 6344 | <filename>Light/Package.agda
{-# OPTIONS --omega-in-omega --no-termination-check --overlapping-instances #-}
module Light.Package where
open import Light.Level using (Setω)
record Meta : Setω where
field Dependencies : Setω
field Library : Dependencies → Setω
record Package (meta : Meta) : Setω where
instance constructor package
open Meta meta
field ⦃ dependencies ⦄ : Dependencies
field ⦃ library ⦄ : Library dependencies
open Package ⦃ ... ⦄ public
|
Transynther/x86/_processed/NONE/_ht_st_zr_un_/i7-7700_9_0xca.log_21829_1643.asm | ljhsiun2/medusa | 9 | 27213 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x9db4, %r14
clflush (%r14)
nop
nop
cmp $24767, %rsi
mov $0x6162636465666768, %rax
movq %rax, %xmm2
movups %xmm2, (%r14)
nop
nop
cmp %rsi, %rsi
lea addresses_A_ht+0x8550, %rsi
lea addresses_normal_ht+0x3d50, %rdi
clflush (%rdi)
nop
nop
nop
inc %r14
mov $103, %rcx
rep movsl
nop
nop
nop
nop
and %r14, %r14
lea addresses_WT_ht+0xfc38, %rsi
lea addresses_UC_ht+0x7628, %rdi
nop
nop
xor $9154, %r10
mov $14, %rcx
rep movsq
nop
add $29857, %rax
lea addresses_WT_ht+0x14ff8, %rsi
cmp %rdi, %rdi
movb (%rsi), %r14b
nop
nop
nop
inc %r10
lea addresses_normal_ht+0x2638, %rsi
lea addresses_normal_ht+0x186e8, %rdi
nop
sub %r13, %r13
mov $41, %rcx
rep movsw
nop
nop
nop
nop
sub $13734, %r14
lea addresses_D_ht+0x15038, %rsi
lea addresses_UC_ht+0xdd24, %rdi
nop
nop
nop
and $47435, %r15
mov $70, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $23743, %r10
lea addresses_normal_ht+0x3838, %rsi
lea addresses_normal_ht+0xf838, %rdi
clflush (%rdi)
nop
dec %rax
mov $9, %rcx
rep movsw
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_WC_ht+0x13f38, %rdi
nop
nop
nop
nop
cmp %r14, %r14
mov (%rdi), %r13w
nop
nop
and %r14, %r14
lea addresses_normal_ht+0x15438, %rsi
nop
nop
nop
nop
nop
and %r13, %r13
movb $0x61, (%rsi)
nop
nop
cmp %r10, %r10
lea addresses_WC_ht+0x13038, %rsi
xor $35250, %r14
mov $0x6162636465666768, %rcx
movq %rcx, (%rsi)
nop
and $37339, %rax
lea addresses_normal_ht+0x7258, %rsi
lea addresses_UC_ht+0x1ab98, %rdi
nop
nop
nop
xor %r13, %r13
mov $33, %rcx
rep movsq
nop
nop
and %r15, %r15
lea addresses_D_ht+0x10d82, %rdi
nop
sub %rax, %rax
movw $0x6162, (%rdi)
nop
nop
nop
dec %rsi
lea addresses_WT_ht+0x8eac, %rsi
nop
nop
nop
and %r13, %r13
movups (%rsi), %xmm2
vpextrq $1, %xmm2, %rdi
nop
and $53411, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %r8
push %rdx
push %rsi
// Store
lea addresses_WT+0xe718, %r10
nop
nop
nop
add $31934, %r11
movw $0x5152, (%r10)
nop
nop
nop
nop
and $29262, %r8
// Store
lea addresses_D+0x12094, %r14
nop
nop
xor %r15, %r15
movw $0x5152, (%r14)
nop
nop
add $12195, %rdx
// Store
lea addresses_RW+0x6e58, %r14
nop
nop
nop
sub %r11, %r11
mov $0x5152535455565758, %rsi
movq %rsi, (%r14)
inc %r11
// Store
lea addresses_normal+0x74a6, %rsi
clflush (%rsi)
xor %r14, %r14
movl $0x51525354, (%rsi)
nop
xor $34683, %rdx
// Faulty Load
lea addresses_WT+0x1038, %rsi
cmp $17934, %r10
movups (%rsi), %xmm2
vpextrq $0, %xmm2, %r8
lea oracles, %r15
and $0xff, %r8
shlq $12, %r8
mov (%r15,%r8,1), %r8
pop %rsi
pop %rdx
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': True, 'size': 1, 'NT': True, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'44': 1043, '46': 2463, '48': 72, '00': 657, '96': 1, '5c': 1, '53': 1384, '0c': 1, '49': 163, 'cc': 1, '6e': 1, 'f6': 1, 'ff': 14684, '02': 1, '45': 1353, '12': 1, '3c': 1, '84': 1}
44 00 ff 53 46 00 44 53 46 ff ff ff ff ff 46 ff 46 ff ff ff ff ff ff 45 ff 46 53 ff ff ff ff ff 45 ff 46 ff ff 45 ff ff ff ff ff ff ff 46 ff ff 53 46 46 ff ff 44 ff ff ff 46 ff ff 44 45 ff ff 46 ff ff ff ff 45 ff ff ff ff ff 45 ff ff ff ff ff ff ff ff 45 46 ff 44 ff ff 46 ff 45 ff ff 44 ff ff 46 44 ff ff 45 ff ff ff ff ff 46 ff ff ff 44 ff 45 ff ff 53 46 ff ff 45 ff ff ff ff 45 ff ff ff 53 ff 45 53 ff ff ff 49 46 ff ff ff 45 ff 53 ff ff 45 ff ff 53 46 00 ff ff ff ff 45 ff ff ff ff ff ff 46 ff ff ff 46 53 53 ff ff ff ff 44 53 ff ff ff ff ff ff ff ff ff 53 ff 46 ff ff 45 ff ff 53 46 ff ff ff ff ff 48 ff ff ff ff ff 46 ff ff ff 53 ff 46 44 44 ff ff ff ff ff ff ff ff ff 45 ff 46 53 53 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 44 ff ff ff 46 ff ff 00 ff 49 ff ff ff ff 46 ff ff ff ff ff ff ff ff ff 46 ff ff ff ff ff ff ff ff ff 45 ff 46 ff 44 ff ff ff ff ff ff ff 46 44 ff ff ff ff ff 44 ff 45 ff ff ff ff 46 ff 44 46 ff ff ff 53 53 ff ff ff 00 ff 46 44 ff ff ff ff ff ff ff ff 46 ff ff ff ff ff 46 ff ff ff 46 ff 44 ff ff ff ff ff 00 45 ff ff ff ff ff ff 44 ff 46 46 ff 44 53 45 ff ff 46 53 ff ff ff ff 53 ff 44 ff ff 46 ff ff 44 45 45 ff 45 45 00 ff 46 ff 45 ff 46 ff ff 45 53 ff ff ff ff ff 53 ff 46 44 ff ff ff 44 ff 45 12 46 44 46 46 ff ff ff ff ff 00 46 ff ff ff ff 45 ff 53 ff ff ff ff 45 ff ff 46 ff ff 45 ff ff 45 53 ff ff 46 ff ff ff ff ff ff ff 45 ff ff 46 53 ff 45 ff 45 ff ff ff 00 ff ff ff ff 46 ff 44 ff ff ff ff ff ff ff ff 53 45 ff 46 ff ff ff 45 53 ff ff ff ff ff ff ff ff ff ff 44 45 ff ff ff ff ff ff ff ff 00 45 45 ff ff ff 44 ff ff ff 53 46 ff 44 45 46 ff ff ff ff ff ff ff ff ff ff ff ff 45 ff ff 44 ff ff 00 ff ff ff ff 45 ff ff ff ff ff 46 ff ff 53 ff ff ff 44 53 46 46 44 ff ff ff ff ff ff 46 ff 46 44 ff 45 46 ff 53 46 ff ff 45 ff 46 ff 44 ff 53 ff ff ff ff ff ff 53 ff ff 46 ff ff 45 ff ff ff ff ff ff ff ff ff ff ff 46 ff 44 44 ff 45 53 ff 53 53 ff 44 ff ff ff ff 46 53 ff ff ff ff ff 46 00 ff ff 46 ff ff ff ff 53 ff ff 44 ff ff ff 44 ff 45 46 ff ff ff 53 46 ff ff ff ff ff ff ff ff ff 46 44 ff 46 ff ff 44 ff ff 44 ff ff ff 44 ff ff ff 48 ff ff ff ff 49 ff ff ff ff ff 45 ff ff ff 45 ff ff ff ff ff ff ff 46 ff ff 45 ff 46 ff ff ff ff ff 00 53 ff 46 ff ff ff ff ff ff ff 44 ff 46 44 44 00 44 ff 45 ff 46 53 46 00 ff ff ff 53 ff 45 ff ff ff 49 46 46 ff ff ff 46 53 45 ff ff 53 46 44 ff 45 ff ff ff ff ff ff 00 ff 44 ff ff 53 ff 53 ff ff 46 ff ff 45 ff ff 46 46 ff ff 53 ff 45 45 ff ff ff ff ff ff ff 53 00 ff ff ff ff ff ff ff ff ff ff ff ff 44 46 ff ff 53 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 48 ff ff 46 ff ff ff 00 ff 45 ff 46 46 ff ff ff 53 ff 46 46 ff ff 00 ff ff 45 53 46 44 ff ff 00 ff ff ff ff 44 45 ff ff ff 53 46 00 ff 49 ff ff ff 46 ff ff 45 ff ff ff ff 46 ff ff ff ff 45 45 ff ff ff ff 45 ff 00 ff 46 ff ff ff 53 ff ff ff 00 ff 44 ff ff ff ff ff ff ff ff ff 53 ff ff ff 46 00 ff ff ff ff ff 45 46 ff ff ff 45 ff ff ff ff 45 ff ff ff 45 ff ff ff ff 53 ff ff ff 44 ff ff 45 ff 46 53 ff ff ff ff ff ff ff ff 53 ff 44 ff ff ff 53 ff ff ff 45 ff 46
*/
|
45/runtime/rt/llegasup.asm | minblock/msdos | 0 | 102781 | TITLE LLEGASUP - LowLevel EGA support (shared routines)
;***
; LLEGASUP - LowLevel EGA support
;
; Copyright <C> 1987, Microsoft Corporation
;
;Purpose:
; This module contains support routines extracted from LLEGA.ASM
; which are shared by EGA and VGA functions.
;
;******************************************************************************
INCLUDE switch.inc ;feature switches
INCLUDE rmacros.inc
USESEG _BSS
USESEG GR_TEXT
INCLUDE seg.inc
INCLUDE ibmunv.inc
INCLUDE baslibma.inc
INCLUDE llgrp.inc
sBegin _BSS
;
;
; ***************************************************************************
; External variables
; ***************************************************************************
;
externB b$EgaPalSup
externD b$InitPalette
externB b$MaxColor
externB b$Monitor
externW B$LEOFST
externW B$REOFST
externW B$VTOFST
externW B$VBOFST
externW B$VLOFST
externW B$VROFST
externB B$VLMASK
externB B$VRMASK
externD b$AddrC
externB b$AttrC
externW b$BytesPerRow
externB b$DivShift
externB b$EgaWrMd
externW b$Incr1
externW b$Incr2
externW b$IncrY
externB b$MaskC
externB b$MaxAttr
externW b$ModMask
externW b$OffC
externB b$PaintBorder
externW b$PenC
externB b$Planes
externW b$SegC
externB b$Tiling
externW b$SaveCa
externB b$SaveCm
externB b$PlaneMask
;
; ***************************************************************************
; External function vectors
; ***************************************************************************
;
externW b$PutVector
externW b$ReadC
externW b$PalTrans
externW b$PalPut
;
; ***************************************************************************
; Local variables
; ***************************************************************************
staticB AttrTile,,4 ;tile attribute pattern table
staticB ColorBits,,8 ;table of rotated tiling patterns
staticW ByteCount,,1
staticB EgaPalette,,17
;
sEnd _BSS
assumes CS,GR_TEXT
sBegin GR_TEXT
externNP B$BumpDS
externNP B$BumpES
externNP B$DecDS
externNP B$OutWord
externNP B$ResetEGA
;***
; B$EgaMapXYC_D
;
;Purpose:
; Map given X and Y coordinates to the graphics cursor for Screen 7.
;Entry:
; CX = X coordinate
; DX = Y coordinate
;Exit:
; b$OffC, b$MaskC updated
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaMapXYC_D,<PUBLIC,NEAR>
cBegin
mov bx,dx ;multiply y by 40 to compute row displacement
shl dx,1 ;dx=2*Y
shl dx,1 ;dx=4*Y
add dx,bx ;dx=5*Y
jmp short MapCommon
cEnd <nogen>
;***
; B$EgaMapXYC
;
;Purpose:
; Map given X and Y coordinates to the graphics cursor for EGA modes
;Entry:
; CX = X coordinate
; DX = Y coordinate
;Exit:
; b$OffC, b$MaskC updated
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaMapXYC,<PUBLIC,NEAR>
cBegin
mov bx,dx ;multiply y by 80 to compute row displacement
shl dx,1 ;dx=2*Y
shl dx,1 ;dx=4*Y
add dx,bx ;dx=5*Y
shl dx,1 ;dx=10*Y
MapCommon:
shl dx,1 ;dx=20*Y
shl dx,1 ;dx=40*Y
shl dx,1 ;dx=80*Y (40*Y for mode 0DH)
mov ax,cx ;save x
shr ax,1 ;div by PixelsPerByte (8)
shr ax,1 ; to get byte index
shr ax,1
add dx,ax ;add x byte offset to y row address
mov b$OffC,dx ;save byte offset
and cl,7 ;mask in x bit addr
mov ch,10000000B ;leftmost pixel on in shift mask
shr ch,cl ;move over to get mask
mov b$MaskC,ch ;store cursor mask
cEnd
;***
; B$EgaLeftC/B$EgaLeftC_13
;
;Purpose:
; Move graphics cursor left 1 pixel for EGA modes or Screen 13,
; depending on entry point. No test is made for screen boundaries.
;Entry:
; None
;Exit:
; b$MaskC, b$OffC updated
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaLeftC,<PUBLIC,NEAR>
cBegin
rol b$MaskC,1
jc LeftCnext ;go if not in same byte
ret
labelNP <PUBLIC,B$EgaLeftC_13>
LeftCnext:
dec b$OffC ;move byte pointer
cEnd
;***
; B$EgaChkUpC
;
;Purpose:
; Move graphics cursor up 1 pixel for EGA modes. A test is made for
; boundaries. If it is a boundary then PSW.C is set upon return and
; no move is made.
;
;Entry:
; None
;Exit:
; b$MaskC, b$OffC updated
; PSW.C = set if original graphics cursor was on screen top edge.
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaChkUpC,<PUBLIC,NEAR>
cBegin
MOV AX,b$OffC ;[AX] = cursor offset
CMP AX,B$VTOFST ;already on top of viewport ?
JAE B$EgaUpC ;less than VTOFST means on top of
;viewport
STC ;STC to indicate that cursor already
cEnd ;on top of viewport
;***
; B$EgaUpC
;
;Purpose:
; Move graphics cursor up 1 pixel for EGA modes. No test is made for
; screen boundaries.
;Entry:
; None
;Exit:
; b$MaskC, b$OffC updated
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaUpC,<PUBLIC,NEAR>
cBegin
mov ax,b$BytesPerRow
sub b$OffC,ax ;up one row
clc ;(no error for ChkUpC)
cEnd
;***
; B$EgaChkDownC
;
;Purpose:
; Move graphics cursor down 1 pixel for EGA modes. If beyond the
; bottom edge, PSW.C is set upon return and no move is made.
;Entry:
; None
;Exit:
; PSW.C = set if original cursor was on screen edge.
; b$MaskC, b$OffC Updated otherwise
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaChkDownC,<PUBLIC,NEAR>
cBegin
MOV AX,b$OffC ;[AX] = cursor offset
CMP AX,B$VBOFST ;already at the bottom of viewport?
JB B$EgaDownC ;Brif not
STC ;STC to indicate that cursor is
cEnd ;on bottom of viewport
;***
; B$EgaDownC
;
;Purpose:
; Move graphics cursor down 1 pixel for EGA modes. No test is made for
; screen boundaries.
;Entry:
; None
;Exit:
; b$MaskC, b$OffC Updated
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaDownC,<PUBLIC,NEAR>
cBegin
mov ax,b$BytesPerRow
add b$OffC,ax ;down one row
clc ;(no error for ChkDownC)
cEnd
;***
; B$EgaSetAttr
;
;Purpose:
; Set b$AttrC to user-supplied attribute for EGA modes. If
; user-supplied attribute is outside legal range, use maximum legal
; attribute.
;Entry:
; AL = attribute
;Exit:
; b$AttrC set to new attribute
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaSetAttr,<PUBLIC,NEAR>,<AX>
cBegin
cmp al,b$MaxAttr ;test against maximum attribute
jbe SetAttrOk ;Brif legal
mov al,b$MaxAttr ;limit to max
SetAttrOk:
mov b$AttrC,al
clc ;exit no error
cEnd
;***
; B$EgaReadC
;
;Purpose:
; For EGA modes, return the attribute of the current pixel as
; specified by b$MaskC and b$OffC.
;
;Entry:
; b$MaskC and b$OffC specify pixel to read
;Exit:
; AL = attribute of pixel
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaReadC,<PUBLIC,NEAR>,<SI,ES>
cBegin
les si,b$AddrC
mov bx,0103H ;start at plane 3 and dec by 1 for 4 planes
ReadCX1:
EGAINT10CLI ; disable interrupts if using EGAINT10
MOV DX,GRPADD ;address of graphics index register
MOV AX,RWMREG ;r/w mode index in AL, 0 in AH
OutWord ;set read mode to 0 so that we read byte
;specified as 0/1 for one plane at a time
MOV AL,RMPREG ;AL=index to read map reg
OUT DX,AL ;indicate next data for read map register
INC DX ;data port address
MOV al,bl ;al = plane number
xor ah,ah ;ah = color accumulator
MOV cl,b$MaskC ;bit position
ReadC1:
OUT DX,AL ;indicate plane to read
MOV ch,ES:[si] ;get 8 bits for plane
AND ch,cl ;isolate bit to read
neg ch ;carry = (ch==0)?0:1
rcl ah,1 ;shift bit into color accumulator
sub al,bh ;reference next color plane to read
jae ReadC1 ;do next plane
XCHG AH,AL ;color attribute returned in AL
CALL B$ResetEGA ;set up EGA for next BIOS write
cEnd
;***
; B$EgaReadC_F
;
;Purpose:
; For Screen 10, return the attribute of the current pixel as
; specified by b$MaskC and b$OffC.
;
;Entry:
; b$MaskC and b$OffC specify pixel to read
;Exit:
; AL = attribute of pixel
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaReadC_F,<PUBLIC,NEAR>,<SI,ES>
cBegin
les si,b$AddrC
mov bx,0202H ;start at plane 2 and dec by 2 for 2 planes
; (0&2)
jmp short ReadCX1 ;continue in common code
cEnd <nogen>
;***
; B$EgaReadC_64K
;
;Purpose:
; For Screen 9/64K, return the attribute of the current pixel as
; specified by b$MaskC and b$OffC.
;
;Entry:
; b$MaskC and b$OffC specify pixel to read
;Exit:
; AL = attribute of pixel
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaReadC_64K,<PUBLIC,NEAR>,<SI,ES>
cBegin
les si,b$AddrC
mov bx,si ;copy video address
mov bh,2 ;bh = dec by 2 between planes
and bl,1 ;1 if odd, 0 if even
add bl,bh ;bl = plane (use maps 3 and 1 if odd address)
; ( or maps 2 and 0 if even address)
jmp short ReadCX1 ;continue in common code
cEnd <nogen>
;***
; B$EgaSetC
;
;Purpose:
; Set the pixel defined by the current graphics cursor to
; the current attribute for EGA modes.
;Entry:
; b$PenC = cursor mask and attribute
; b$AddrC = address of pixel byte
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaSetC,<PUBLIC,NEAR>,<ES>
cBegin
EGAINT10CLI ; disable interrupts if using EGAINT10
MOV DX,GRPADD ;address of graphics index port
MOV AL,RWMREG ;index to the graphics controller mode reg
OUT DX,AL
MOV AL,b$EgaWrMd ;write mode 2; odd/even or sequential addr.
INC DX ;address data port
OUT DX,AL
MOV AL,BMKREG ;index to the bit mask register
DEC DX
OUT DX,AL
mov ax,b$PenC ;[al] = cursor mask, [ah] = attribute
INC DX
OUT DX,AL ;set bit mask
les bx,b$AddrC ;[BX] = cursor offset, [DS] = segment
XCHG ah,es:[BX] ;latch screen contents and do a color write
;reset EGA regs to those expected by the BIOS
MOV AL,0FFH ;set all mask bits
OUT DX,AL
MOV AL,RWMREG ;index to the graphics controller mode reg
DEC DX
OUT DX,AL
MOV AL,b$EgaWrMd ;odd/even or sequential addr.
and al,10H ;set write mode 0 for bios
INC DX
OUT DX,AL
EGAINT10STI ; reenable interrupts if using EGAINT10
cEnd
;***
; B$EgaSetPixC
;
;Purpose:
; Set the pixel defined by the current graphics cursor to
; the current attribute for EGA modes. This is identical
; to B$EgaSetC with the initialization and termination code
; extracted to make it faster when multiple pixels are being
; set in a graphics functin (ie: CIRCLE). A call to
; B$EgaSetPixFirstC should preceed the first call to
; B$EgaSetPixC. A call to B$ResetEGA should follow
; the last. B$EgaSetPixFirstC sets up ES which should be
; preserved for all B$SetPixC calls.
;Entry:
; ES = video segment (set up by B$EgaSetPix)
; b$PenC = cursor mask and attribute
; b$OffC = address of pixel
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaSetPixC,<PUBLIC,NEAR>
cBegin
MOV DX,GRPADD+1 ;address graphics data port
mov ax,b$PenC ;[al] = cursor mask, [ah] = attribute
OUT DX,AL
mov bx,b$OffC ;[BX] = cursor offset
;[ES] = setup by SetPixFirstC
XCHG ah,ES:[BX] ;latch screen contents and do a color write
cEnd
;***
; B$EgaSetPixFirstC
;
;Purpose:
; Set up ES to the video segment and set up EGA write mode so
; repeated calls can be made to B$EgaSetPixC without having
; to reinitialize.
;Entry:
; b$SegC = video segment
; b$EgaWrMd = EGA write mode to set up
;Exit:
; ES = video segment
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaSetPixFirstC,<PUBLIC,NEAR>
cBegin
mov es,b$SegC ;ES = video segment for B$SetPix
MOV DX,GRPADD ;address of graphics index port
MOV AL,RWMREG ;index the graphics controller mode reg
OUT DX,AL
MOV AL,b$EgaWrMd ;write mode 2; odd/even or sequential addr.
INC DX ;address data port
OUT DX,AL
MOV AL,BMKREG ;index to the bit mask register
DEC DX ;leave bit mask register addressed so all
OUT DX,AL ; we have to do is output the mask
cEnd
;***
; B$EgaLineX
;
;Purpose:
; Draw an X-major line for EGA modes.
;Entry:
; AH = color (b$AttrC)
; AL = bit accumulator
; BH = bit mask
; BL unused
; CX = point count
; DX = EGA graphics controller data port
; SI = delta decision value
; DI = line style
; BP = video offset
; ES = video segment
; Incr1 = major axis delta update value
; Incr2 = minor axis delta update value
; IncrY = BP change for Y movement
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaLineX,<PUBLIC,NEAR>
cBegin
MOV DX,GRPADD+1 ;graphics controller data port for bit mask
LineEXloop:
ROL DI,1 ;next line style bit
JNC LineEX2 ;go if bit is 0 not to plot
OR AL,BH ;OR this bit into byte mask
LineEX2:
OR SI,SI ;time to move in Y (+ or 0 delta)?
JNS LineEX4 ;go if so
ADD SI,b$Incr1 ;update delta for X movement
ROR BH,1 ;move to next X
JC LineEX3 ;go if not still in same byte
LOOP LineEXloop
JMP SHORT LineEX7
LineEX3:
OUT DX,AL ;output mask from accumulated pixels
MOV AL,AH ;color for write
XCHG AL,ES:[BP] ;read loads latches, write color thru mask
XOR AL,AL ;clear pixel accumulator
INC BP ;go to next byte
LOOP LineEXloop
JMP SHORT LineEX7
LineEX4:
ADD SI,b$Incr2 ;update delta for Y movement
OUT DX,AL ;output mask from accumulated pixels
MOV AL,AH ;color for write
XCHG AL,ES:[BP] ;read loads latches, write color thru mask
XOR AL,AL ;clear pixel accumulator
ROR BH,1 ;move to next X
ADC BP,b$IncrY ;move to next Y (+1 if next X byte)
LOOP LineEXloop
LineEX7: ;flush accumulated pixels
OUT DX,AL ;output mask from accumulated pixels
XCHG AH,ES:[BP] ;read loads latches, write color thru mask
cEnd
;***
; B$EgaLineY
;
;Purpose:
; Draw a Y-major line for EGA modes.
;Entry:
; AH = color (b$AttrC)
; AL = bit mask
; BH = trash for XCHG
; BL unused
; CX = point count
; DX = EGA graphics controller data port
; SI = delta decision value
; DI = line style
; BP = video offset
; ES = video segment
; Incr1 = major axis delta update value
; Incr2 = minor axis delta update value
; IncrY = BP change for Y movement
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaLineY,<PUBLIC,NEAR>
cBegin
MOV DX,GRPADD+1 ;graphics controller data port for bit mask
LineEYloop:
ROL DI,1 ;next line style bit
JNC LineEY2 ;go if bit is 0 not to plot
OUT DX,AL ;output bit mask
MOV BH,AH ;color for write
XCHG BH,ES:[BP] ;read loads latches, write color thru mask
LineEY2:
OR SI,SI ;time to move in X (+ or 0 delta)?
JNS LineEY3 ;go if so
ADD SI,b$Incr1 ;update delta for Y movement
ADD BP,b$IncrY ;move to next Y
LOOP LineEYloop
ret
LineEY3:
ADD SI,b$Incr2 ;update delta for X movement
ROR AL,1 ;move to next X
ADC BP,b$IncrY ;move to next Y (+1 if next X byte)
LOOP LineEYloop
cEnd
;***
; B$EgaLineV
;
;Purpose:
; Draw a vertical line for EGA modes.
;Entry:
; AH = color (b$AttrC)
; AL = bit mask
; BX = IncrY = BP change for Y movement
; CX = point count
; DI = line style
; BP = video offset
; ES = video segment
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaLineV,<PUBLIC,NEAR>
cBegin
MOV DX,GRPADD+1 ;graphics controller data port for bit mask
OUT DX,AL ;output mask
MOV BX,b$IncrY ;to register here
LineEVloop:
ROL DI,1 ;next line style bit
JNC LineEV2 ;go if bit is 0 not to plot
MOV AL,AH ;color for write
XCHG AL,ES:[BP] ;read loads latches, write color thru mask
LineEV2:
ADD BP,BX ;to next Y
LOOP LineEVloop
cEnd
;***
; PutPreset/PutOther
;
;Purpose:
; Support routine for EGA PUT. Write to the specified screen byte
; the specified attribute (after NOTing it if entry point is Preset).
; Write will apply bit-wise logic as defined by the contents of
; DTRREG, which is set up in PUT action routines which then branch
; to PutOther.
;Entry:
; AH = attribute
; ES:DI = screen address
;Exit:
; DI incremented to next screen address
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc PutPreset,<NEAR>
cBegin
not ah ;NEGATE DATA FOR PRESET
labelNP PutOther
xchg ah,es:[di] ;read loads latches, write sets data according
inc di ; to EGA function set in DTRREG
cEnd
labelW PutTable ;EGA write function according to put action
DB 10000B ;Or
DB 01000B ;And
DB 00000B ;Preset (data unmodified, but NOT before)
DB 00000B ;Pset (data unmodified)
DB 11000B ;Xor
;***
; B$EgaPutAction_64K
;
;Purpose:
; Set b$PutVector to appropriate PUT action routine for Screen 9/64K.
; Set up DTRREG according to PUT action table values so that next
; screen write will apply the requested PUT action to the data.
;Entry:
; AL = PUT action [0..4] representing (OR, AND, PRESET, PSET, XOR)
;Exit:
; b$PutVector set to entry point of appropriate PUT action routine
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPutAction_64K,<PUBLIC,NEAR>
cBegin
mov bl,11001100B ;setup for first plane pair (after two shifts)
SKIP 2 ;fall thru to normal PutAction
cEnd <nogen>
;***
; B$EgaPutAction_F
;
;Purpose:
; Set b$PutVector to appropriate PUT action routine for Screen 10.
; Set up DTRREG according to PUT action table values so that next
; screen write will apply the requested PUT action to the data.
;Entry:
; AL = PUT action [0..4] representing (OR, AND, PRESET, PSET, XOR)
;Exit:
; b$PutVector set to entry point of appropriate PUT action routine
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPutAction_F,<PUBLIC,NEAR>
cBegin ;(NOTE: SKIP above!!)
mov bl,01000100B ;setup for first plane (after two shifts)
SKIP 2 ;fall thru to normal PutAction
cEnd <nogen>
;***
; B$EgaPutAction
;
;Purpose:
; Set b$PutVector to appropriate PUT action routine for EGA modes.
; Set up DTRREG according to PUT action table values so that next
; screen write will apply the requested PUT action to the data.
;Entry:
; AL = PUT action [0..4] representing (OR, AND, PRESET, PSET, XOR)
;Exit:
; b$PutVector set to entry point of appropriate PUT action routine
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPutAction,<PUBLIC,NEAR>
cBegin
;(NOTE: SKIPs above!!)
mov bl,10001000B ;setup for first plane (after 1 shift)
mov b$PlaneMask,bl
;NOTE: the plane mask is replicated in both nibbles for wrap-around
; shift, but will be masked to the low nibble for map-enabling
mov bx,GR_TEXTOFFSET PutPreset ;assume preset
cmp al,2 ;is it?
je IsPreset ;go if so
mov bx,GR_TEXTOFFSET PutOther ;all others use same code and
IsPreset: ; rely on EGA for operation
mov b$PutVector,bx ;save vector
mov bx,GR_TEXTOFFSET PutTable ;EGA function table
xlat cs:[bx] ;convert put action to EGA func
mov ah,al
MOV DX,GRPADD ;address graphics controller
mov al,DTRREG ;data rotate/function register
OutWord ;select EGA logical operation
cEnd
ASSUME DS:NOTHING
;***
; B$EgaNReadL_F
;
;Purpose:
; Read a line of pixels from the screen to an array for Screen 10.
;Entry:
; ES:DI = screen address
; DS:SI = array address
; CL = array align shift count
; BP = count of bits (not pixels) to read
; BH = plane to read from
;Exit:
; DS:SI = updated to array byte past point filled
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaNReadL_F,<PUBLIC,NEAR>
cBegin
shl bh,1 ;logical plane 0 = physical plane 0
;logical plane 1 = physical plane 2
cEnd <nogen> ;fall thru to regular NReadL
;***
; B$EgaNReadL
;
;Purpose:
; Read a line of pixels from the screen to an array for EGA modes.
;Entry:
; DS:SI = screen address
; ES:DI = array address
; CL = array align shift count
; CH = mask for last partial byte
; BP = count of bits (not pixels) to read
; BH = plane to read from
;Exit:
; ES:DI = updated to array byte past point filled
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaNReadL,<PUBLIC,NEAR>
cBegin
MOV DX,GRPADD ;address graphics controller
MOV al,RMPREG ;read map select register
out dx,al
mov al,bh
inc dx
out dx,al
mov ah,[si] ;preload hi byte
inc si
NRdLoop:
lodsb ;fill ax word with video bytes
mov bh,al ;this lo byte will become next hi byte
rol ax,cl ;align to array
sub bp,8 ;8 bits done
jbe NRdLast ;go if bit count exhausted
mov es:[di],ah ;save full byte
inc di
mov ah,bh ;move lo byte (BH) to hi byte (AH)
jnz NRdLoop ;loop if no offset overflow
call B$BumpES ;move array pointer over segment boundary
jmp short NRdLoop ;go do another
NRdLast:
and ah,ch ;strip unused bits from last byte
mov es:[di],ah ;save last byte
inc di
jnz NRdDone
call B$BumpES ;move array pointer over segment boundary
NRdDone:
cEnd
;***
; B$EgaNWriteL_F
;
;Purpose:
; Write a line of pixels from an array to the screen for Screen 10.
;Entry:
; ES:DI = screen address
; DS:SI = array address
; CL = array align shift count
; BP = count of bits (not pixels) to write
; DL = last partial byte mask
; DH = first partial byte mask
;Exit:
; DS:SI = updated to array byte past point used
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaNWriteL_F,<PUBLIC,NEAR>
cBegin
rol b$PlaneMask,1 ;logical plane 0 = physical plane 0
;logical plane 1 = physical plane 2
;must shift plane mask twice (1 more below)
cEnd <nogen> ;fall thru to regular NWriteL
;***
; B$EgaNWriteL
;
;Purpose:
; Write a line of pixels from an array to the screen for EGA modes.
;Entry:
; ES:DI = screen address
; DS:SI = array address
; CL = array align shift count
; BP = count of bits (not pixels) to write
; DL = last partial byte mask
; DH = first partial byte mask
; BH = plane
;Exit:
; DS:SI = updated to array byte past point used
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaNWriteL,<PUBLIC,NEAR>
cBegin
rol b$PlaneMask,1 ;shift plane mask by one plane
push dx
MOV BL,DH ;first byte bit mask
MOV DX,GRPADD ;address graphics controller
mov al,BMKREG ; bit mask register
OUT DX,AL ;set index register
XCHG AX,BX ;set up data in AL, plane moves to AH
INC DX
OUT DX,AL
DEC DX
MOV AL,RWMREG ;set r/w mode 0
OUT DX,AL
XOR AL,AL
INC DX
OUT DX,AL
DEC DX
MOV al,RMPREG ;read map select register
OUT DX,AL
MOV AL,AH ;[al] = plane number
INC DX
OUT DX,AL
MOV DX,SEQADD ;address the sequencer
MOV AL,MMREG ; map mask register
OUT DX,AL
mov al,b$PlaneMask ;get plane mask bit
and al,0FH ;strip to nibble
INC DX
OUT DX,AL
pop dx
mov ah,[si] ;preload byte from array
inc si
jnz NWrOvfl1
call B$BumpDS ;move array pointer over segment boundary
NWrOvfl1:
.erre ID_SSEQDS ;assumes ss = ds
mov bx,ss:[b$PutVector] ;preload PUT action vector
ror ax,cl ;align to video
add bp,cx
sub bp,8 ;account for first partial byte
jbe NWrLast ;go if last byte
call bx ;put the byte
mov dh,0FFH ;mask for whole bytes in the middle
push ax
push dx
mov ah,dh ;middle byte bit mask
MOV DX,GRPADD ;address graphics controller
mov al,BMKREG ; bit mask register
OUT DX,AL
XCHG AL,AH ;bit mask to AL and output
INC DX
OUT DX,AL
EGAINT10STI ;reenable ints if using EGAINT10
pop dx
pop ax
jmp short NWrLoop2
NWrLoop:
call bx ;put the byte via PUT action vector
NWrLoop2:
rol ax,cl ;re-align to array
lodsb ;fill ax word with array bytes
or si,si
jz NWrOvfl3 ;go if address overflow
NWrOvfl2:
xchg ah,al
ror ax,cl ;align to video
sub bp,8 ;8 bits done
ja NWrLoop ;go if bit count not exhausted
add bp,8 ;restore BP to #bits in last byte
cmp cx,bp ;did we use any of the second byte?
jb NWrLast ;go if so
or si,si ;at start of segment?
jnz NWrUnfl ;go if not
call B$DecDS ;backup to previous segment
NWrUnfl:
dec si ;move ptr back
NWrLast:
push ax
and dh,dl ;combine first|middle mask with end mask
mov ah,dh ;last byte bit mask
MOV DX,GRPADD ;address graphics controller
mov al,BMKREG ; bit mask register
EGAINT10CLI ;disable ints for direct EGA manipulation
OUT DX,AL
XCHG AL,AH
INC DX
OUT DX,AL ;output bit mask
DEC DX
pop ax
.erre ID_SSEQDS ;assumes ss = ds
call bx ;put the last byte
EGAINT10STI ;reenable ints if using EGAINT10
cEnd
NWrOvfl3:
call B$BumpDS ;move array pointer over segment boundary
jmp short NWrOvfl2 ;back to loop
ASSUME DS:DGROUP
;***
; B$EgaNSetC
;
;Purpose:
; Set a horizontal line of pixels to the current attribute for EGA
; modes. The line starts at the current cursor position and moves right.
;
; This becomes a bit of a mess with EGAINT10 and QCG support. Here's
; the current approach:
; No EGAINT10 (QCG or not, doesn't matter) --
; No problem, just execute straight code, modifying the EGA
; hardware directly where needed.
; EGAINT10 and no QCG --
; Disable ints at the beginning and reenable them at the end.
; This will work because in the worst case the entire routine
; takes approx. 1500 clock cycles, and we are using a ceiling
; of 1800 clock cycles between CLI/STI.
; EGAINT10 and QCG --
; Now things get ugly. We can't just disable ints over the
; whole routine because it would exceed the 1800 clock max.
; Instead, we use a combination of writing regs through the
; EGAINT10 interface (like setting RWMReg, because it's needed
; for the entire routine), and modifying regs directly within
; small CLI/STI brackets (like setting BMKReg for a byte and
; then restoring it before reenabling ints).
;Entry:
; b$AddrC specifies start pixel
; b$PenC = cursor mask and attribute
; BX = number of pixels to set
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaNSetC,<PUBLIC,NEAR>,<ES,DI>
cBegin
EGAINT10CLI ;disable ints for entire routine if EGAINT10
MOV DX,GRPADD ;address of graphics index register
MOV AL,RWMREG ;r/w mode register
OUT DX,AL ;index the mode register
MOV AL,b$EgaWrMd ;write mode 2; odd/even or sequential addr.
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
MOV AL,BMKREG
OUT DX,AL ;index the mask register
INC DX ;to data port
les di,b$AddrC ;graphics cursor address
mov cx,b$PenC ;ch = desired attribute
;cl = cursor mask
or cl,cl ;left aligned in byte?
js NSet2a ;go if so, skip single-bit start
NSet1:
xor ah,ah ;zero out new mask accumulator
NSet2:
or ah,cl ;include this pixel in mask
dec bx ;decrement pixel count
jz NSet4 ;treat as last byte if bit count exhausted
ror cl,1 ;move 1 pixel right
jnb NSet2 ;continue if not right-most bit
mov al,ah ;mask to AL for OUT
out dx,al ;set bit mask
mov al,ch ;copy desired attribute
xchg al,es:[di] ;set the byte
inc di ;bump cursor byte pointer
NSet2a:
push cx
mov al,0FFH ;set bit mask for full bytes
out dx,al
mov ax,bx ;remaining bit count
mov cl,b$DivShift ;pixels/byte divisor shift
shr ax,cl ;compute full byte count
jz NSet3 ;go do remaining bits if no full bytes
xchg ax,cx ;byte count to cx
mov al,ah ;attribute byte
rep stosb ;block write full bytes
NSet3:
pop cx
and bx,b$ModMask ;mask in remaining bit count
jnz NSet1 ;go do remaining bits
jmp short NSet5 ;no bits remaining - exit
NSet4: ;update last byte
mov al,ah ;mask to AL for OUT
out dx,al ;set bit mask
xchg ch,es:[di] ;set the byte
NSet5:
EGAINT10STI ;reenable ints if using EGAINT10
CALL B$ResetEGA ;call routine to reset write mode for BIOS
cEnd
;***
; B$EgaPaintBound_11
;
;Purpose:
; Called by PAINT before painting each scan line for
; Screen 11 to facilitate fast viewport edge detection.
; Set VIEW left and right cursor addresses and masks.
;Entry:
; b$OffC = address of current pixel
;Exit:
; B$LEOFST = left edge offset
; B$REOFST = right edge offset
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPaintBound_11,<PUBLIC,NEAR>
cBegin
mov AX,b$OffC ;video offset
MOV CX,80 ;divisor = 80
XOR DX,DX
DIV CX ;quotient in AX = row # (INT(b$OffC/80))
SHL AX,1 ;row * 2
JMP SHORT PntBndCommon ;finish the math and store the results
cEnd <nogen>
;***
; B$EgaPaintBound_D
;
;Purpose:
; Called by PAINT before painting each scan line for
; Screen 7 to facilitate fast viewport edge detection.
; Set VIEW left and right cursor addresses and masks.
;Entry:
; b$OffC = address of current pixel
;Exit:
; B$LEOFST = left edge offset
; B$REOFST = right edge offset
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPaintBound_D,<PUBLIC,NEAR>
cBegin
mov ax,b$OffC ;video offset
MOV CX,40 ;divisor = 40
XOR DX,DX
DIV CX ;quotient in AX = INT(CLOC/40) -- this is row
CALL PntBndCommon ;finish the math and store the results
JMP SHORT SetColorBits ;set up ColorBits array and exit
cEnd <nogen>
;***
; B$EgaPaintBound
;
;Purpose:
; Called by PAINT before painting each scan line for
; EGA modes to facilitate fast viewport edge detection.
; Set VIEW left and right cursor addresses and masks.
;Entry:
; b$OffC = address of current pixel
;Exit:
; B$LEOFST = left edge offset
; B$REOFST = right edge offset
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaPaintBound,<PUBLIC,NEAR>
cBegin
mov ax,b$OffC ;video offset
MOV CX,80 ;divisor = 80
XOR DX,DX
DIV CX ;quotient in AX = INT(CLOC/80) -- this is row
SHL AX,1 ;row * 2
CALL PntBndCommon ;finish the math and store the results
; In order for SCANL and SCANR to be able to check whether any tiles
; will actually change, we need bit-specific information about the
; tile pattern for the current byte. This is collected as binary
; representations of the colors of each bit, and stored in the array
; ColorBits.
;
; At this point, the SetTile routine has set up the AttrTile array
; with the tile pattern for this row. Now calculate the ColorBits
; array.
SetColorBits:
PUSH DI
PUSH SI
PUSH BX
MOV SI,7 ;offset to color array
MOV DI,3 ;offset into AttrTile
SHFTBT:
XOR BH,BH ;clear byte for isolating one color
GETCOL:
ROR AttrTile[DI],1 ;plane 3 bit
RCL BH,1 ;rotate carry into color accumulator
DEC DI ;next plane
TEST b$Planes,2 ;if 2-plane graphics --
JZ GETCL1 ;we need to pass up next plane down --
DEC DI ;to find color bit for odd/even mode
ROR AttrTile[DI],1 ;get bit for low plane
RCL BH,1 ;rotate carry
JMP SHORT STTIL3
GETCL1:
ROR AttrTile[DI],1 ;plane 2 bit
RCL BH,1 ;rotate carry
DEC DI ;for 4-plane, repeat down through 0
ROR AttrTile[DI],1 ;plane 1 bit
RCL BH,1
DEC DI
ROR AttrTile[DI],1 ;plane 0 bit
RCL BH,1
STTIL3:
MOV ColorBits[SI],BH ;store color in array element
MOV DI,3 ;go back to plane 3 pattern
DEC SI ;next lower offset in color array
JNS SHFTBT ;and shift out next color
POP BX
POP SI
POP DI
cEnd
cProc PntBndCommon,<NEAR>
cBegin
SHL AX,1 ;row * 2 (or row * 4)
SHL AX,1 ; * 4 (or row * 8)
SHL AX,1 ; * 8 (or row * 16)
MOV DX,AX ;save (row * 8) or (row * 16)
SHL AX,1 ;row * 16 (or row * 32)
SHL AX,1 ;row * 32 (or row * 64)
ADD AX,DX ;(row*32) + (row*8) = row*40 = byte address
;(or (row*64)+(row*16)=row*80 = byte address)
;left margin of screen at this row
MOV DX,AX ;two copies of this value
ADD AX,B$VLOFST ;byte address at (x=0) + offset to viewport
MOV B$LEOFST,AX ;left margin = byte address of left margin
ADD DX,B$VROFST ;byte address at (x=0) + offset to viewport
MOV B$REOFST,DX ;right margin = byte address of right margin
cEnd
;***
; B$EgaSetTile
;
;Purpose:
; This routine stores the internal form of the current tile attribute.
; This routine is called each time a row is to be painted.
;Entry:
; BL = internal form of the tile attribute
; BH = which plane the attribute is for
;Exit:
; AttrTile[plane] = attribute
; b$AttrC = attribute
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaSetTile,<PUBLIC,NEAR>,<AX,DI>
cBegin
MOV AL,BH
XOR AH,AH
MOV DI,AX ;DI = 1 based plane number
CMP b$Planes,2 ;2 plane system?
JA FOUR_PLANE
SHL DI,1 ;plane now 2 or 4
DEC DI
MOV AttrTile[DI],BL
FOUR_PLANE:
DEC DI ;0 based
MOV AttrTile[DI],BL
MOV b$AttrC,BL ;set attribute to the tile attribute
cEnd
;***
; B$EgaScanInit
;
;Purpose:
; This routine does some initialization for both ScanL and ScanR
; for EGA modes. Set up EGA Read/Write Mode register for color
; compare read and EGA Color Compare register with b$PaintBorder.
;Entry:
; None
;Exit:
; ES:SI = Video segment address (b$AddrC)
; CH = cursor mask (b$MaskC)
; CL = flag for pixels changed (0)
; BX = count of pixels changed (0)
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
cProc B$EgaScanInit,<PUBLIC,NEAR>,<DX>
cBegin
les si,b$AddrC ;di=cursor offset, es=video seg
mov ch,b$MaskC ;ch=cursor mask
MOV DX,GRPADD ;address of graphics index register
MOV AL,RWMREG
OUT DX,AL ;index the mode register
MOV AL,8H ;set read mode 1 for color compare
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
MOV AL,LOW CLCREG
OUT DX,AL ;index the color compare register
MOV AL,b$PaintBorder ;set up color compare with border attribute
INC DX ;to data port
OUT DX,AL
XOR CL,CL ;flag for pixels changed
XOR BX,BX ;count of pixels changed initialized to 0
cEnd
;***
; B$EgaPAINPX
;Purpose:
; Paint first byte (and) last byte (and) whole bytes in between
; Fast write is left to right or v.v. depending on whether SCANR, SCANL.
; Call has reset or set direction flag.
;
; This becomes a bit of a mess with EGAINT10 and QCG support. Here's
; the current approach:
; No EGAINT10 (QCG or not, doesn't matter) --
; No problem, just execute straight code, modifying the EGA
; hardware directly where needed.
; EGAINT10 and no QCG --
; Disable ints at the beginning and reenable them at the end.
; This will work because in the worst case the entire routine
; takes approx. 1500 clock cycles, and we are using a ceiling
; of 1800 clock cycles between CLI/STI. TILING is an exception:
; If tiling is used then the routine takes too long, but there
; is an opportune point in the middle to reenable ints and then
; disable them again without too much of a speed hit.
; EGAINT10 and QCG --
; Now things get ugly. We can't just disable ints over the
; whole routine because it would exceed the 1800 clock max.
; Instead, we use a combination of writing regs through the
; EGAINT10 interface (like setting RWMReg, because it's needed
; for the entire routine), and modifying regs directly within
; small CLI/STI brackets (like setting BMKReg for a byte and
; then restoring it before reenabling ints).
;Entry:
; DI = first byte
; SI = last byte,
; BL = bit mask for first byte
; BH = bit mask for last byte
; BP = count of whole bytes to paint in between first and last
; CH = 00 if SCANR (for INC DI before REP) or
; = FF if SCANL (for DEC DI before REP)
;Exit:
; CL = non-zero to flag pixels changed
;Uses:
;Exceptions:
;******************************************************************************
; Now to write the whole line from [DI], first pixel, to [SI],
; final pixel first set up for write mode 2, if solid color PAINT,
; or 0, if tile PAINT.
cProc B$EgaPAINPX,<PUBLIC,NEAR>,<DX>
cBegin
MOV DX,GRPADD
MOV AH,b$EgaWrMd
CMP b$Tiling,0
JZ PAINT1
AND AH,10H ;if TILE write, use write mode 0
PAINT1:
MOV AL,LOW RWMREG
EGAINT10CLI ;disable interrupts if using EGAINT10
OUT DX,AL ;index the mode register
XCHG AL,AH ;set write mode
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
; Set up bit mask.
MOV AL,LOW BMKREG
OUT DX,AL ;index the bit mask register
MOV AL,BL
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
; Latch
MOV AL,ES:[DI]
CMP b$Tiling,0
JZ NOTIL1 ;tiling not on, write solid color b$AttrC
CALL WRTTIL ;else call routine for writing partial tile
JMP SHORT CHKLST ;proceed to check for a last byte
NOTIL1:
; Write first byte.
MOV BL,b$AttrC
MOV ES:[DI],BL
CHKLST:
OR BH,BH ;see if a last byte to write
JNZ MORWRT
CALL CLRMSK ;all done -- clear bit mask
JMP SHORT WHLBYT
MORWRT:
; Set up bit mask for last byte.
MOV AL,LOW BMKREG
OUT DX,AL ;index the bit mask register
MOV AL,BH ;set mask
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
; Latch
MOV AL,ES:[SI]
CMP b$Tiling,0
JZ NOTIL2
XCHG DI,SI ;WRTTIL addresses screen with DI
CALL WRTTIL ;if tiling is on, set [partial] last byte
XCHG DI,SI ;restore DI for whole-byte write
JMP SHORT CLRBT1
NOTIL2:
MOV ES:[SI],BL ;write last byte
CLRBT1:
CALL CLRMSK
WHLBYT:
OR BP,BP ;check if intermediate whole bytes
JZ CLRBT2
; Set up to write all whole bytes.
INC DI ;if SCANR, go right
OR CH,CH
JZ BYTE2
DEC DI
DEC DI ;else start to left of first byte
BYTE2:
MOV BH,CH ;may need INC/DEC flag for 2-plane write
MOV CX,BP ;whole-byte counter in CX
MOV AL,BL ;attribute in AL for no-tile speed routine
CMP b$Tiling,0 ;see whether tiling is on
JZ WRITE4
CALL TILSET ;set up for copy of off-screen tile
; NOTE: This call has the effect of immunizing all bits from
; processor writes therefore, we must clear the bit mask
; following the write if tiling is on.
; QCG tiling always does slow loop, so 2-plane hack isn't needed?
TEST b$Planes,4 ;check for four-plane graphics mode
JNZ WRITE4 ;if 2 planes, need byte-by-byte write routine
; QCG: would need to fix bkg mask here if using this code
OR BH,BH ;see whether SCANR or SCANL
JNZ CALLFT ;non-zero flag indicates move left
CALL WRTRGT ;zero indicates move right
JMP SHORT CLRBT2
CALLFT:
CALL WRTLFT
JMP SHORT CLRBT2
WRITE4:
REP STOSB
CLRBT2:
EGAINT10STI ; reenable interrupts at common exit
MOV CL,1 ;single pixels counted in B$EgaCHKBTR calls
;non-zero as pixels changed flag
cEnd
;***
; WRTTIL
;Purpose:
; Used for writing first and last bytes, possibly partial bytes,
; to the screen when tiling is on for EGA modes.
; At entry, the bit mask has been set up for the byte to write, and the
; contents have been latched.
; This routine writes the relevant bits to each plane one at a time,
; using the map mask register to enable the planes from 3 to 0 and
; writing from AttrTile from offset 3 down to 0.
;
;Entry:
; ES:DI = screen address
; AttrTile = tile value to write
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;*******************************************************************************
WRTTIL:
PUSH DX
PUSH BX
MOV DX,SEQADD ;index port for sequencer
MOV AL,LOW MMREG ;index to Map Mask Register
OUT DX,AL
INC DX
MOV AL,8H ;start with plane 3
MOV BX,3
WRTPLN:
OUT DX,AL ;set up for one plane
MOV AH,AttrTile[BX] ;get tile pattern for that plane
MOV ES:[DI],AH ;write to one plane
MOV AH,ES:[DI] ;latch that write
DEC BX
SHR AL,1 ;next plane down the list
JNB WRTPLN ;repeat 3,2,1,0
DEC DX ;back to SEQADD
MOV AL,MMREG
OUT DX,AL ;index the register
XCHG AL,AH
MOV AL,0FH ;reeanable all planes
INC DX ;to data port
OUT DX,AL
POP BX
POP DX
RET
;***
; TILSET
;Purpose:
; Prepares for write of whole tile bytes to the screen in the following
; fashion :
;
; i. uses the routine WRTTIL to write the tile pattern, plane by
; plane, at the first offscreen address (6D60H); and, if we are
; in odd/even mode, writes it at the second offscreen address also
; ii. sends 0 to Bit Mask Register to indicate all bits immune
; iii.reenables write to all planes
;
; This sets up the card so that it will always write not from processor
; data but from the latches. If more than 64K, mode 10H, we can perform
; one latch read at the off-screen address and then write on-screen bytes
; in the tile pattern simply by changing the address back on-screen and
; asking for writes to the screen.
; If we are in odd/even mode, we must perform a latch for each byte
; written, at the even address for even bytes, at the odd address for odd
; bytes. These reads occur within the routines WRTRGT and WRTLFT, which
; then write to the screen from the latches, byte by byte.
;Entry:
; ES:DI = screen address
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;******************************************************************************
TILSET: ;this routine altered for Modes D,E support
TEST b$Planes,4 ;see if 4-plane tile
JNZ TILST4 ;if so, just write first whole byte,latch,exit
PUSH DI ;for odd/even mode, save on-screen byte address
MOV DI,OFFSCN ;and substitute offscreen address (fancy
CALL WRTTIL ;monitor only)
INC DI ;if 2-plane, move to odd offscreen address
CALL WRTTIL ;and write to the 2 odd planes
POP DI ;restore on-screen address
JMP SHORT TILSEX ;no need to latch for 2-plane tile
TILST4:
CALL WRTTIL
MOV AL,ES:[DI] ;latch
TILSEX:
MOV AL,BMKREG ;send 0 to Bit Mask Register
OUT DX,AL ;index the bit mask register
XOR AL,AL ;disable all bits
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
RET
;***
; B$EgaPIXCNT
;Purpose:
; Whether or not we actually change any pixels, we have to send
; the number "painted".
;
;Entry:
; BP = number of whole bytes painted
; DX = number of single pixels painted
;Exit:
; BX = total number of pixels painted
;Uses:
; BP, DX
;Exceptions:
;***************************************************************************
cProc B$EgaPIXCNT,<PUBLIC,NEAR>
cBegin
SHL BP,1 ;no. whole bytes * 2
SHL BP,1 ; * 4
SHL BP,1 ; * 8
SCNEX1:
ADD DX,BP ;pixel count
MOV BX,DX
cEnd
;***
; B$EgaSETCMP
;Purpose:
; Set color compare register to current paint attribute.
;
; This routine os called to set up the color compare register for
; PIXLF2/PIXLF3/PIXRT2/PIXRT3. Since these routines can take more
; time than is allowed between CLI/STI, this routine must use an
; EGAINT10 call to set the reg.
;Entry:
; b$AttrC = attribute
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;*****************************************************************************
cProc B$EgaSETCMP,<PUBLIC,NEAR>,<DX>
cBegin
MOV DX,GRPADD
MOV AL,LOW CLCREG
OUT DX,AL ;index the color compare register
MOV AL,b$AttrC
INC DX ;to data port
OUT DX,AL
cEnd
;***
; CLRMSK
;Purpose:
; Clear bit mask so full bytes will be written.
;Entry:
; None
;Exit:
; None
;Uses:
; per conv.
;Exceptions:
;****************************************************************************
CLRMSK:
MOV AX,0FFH SHL 8 + BMKREG ;AH=FF,AL=8
OUT DX,AL ;index the bit mask register
XCHG AL,AH
INC DX ;to data port
OUT DX,AL
DEC DX ;back to index port
RET
;***
; B$EgaCHKBTR
;Purpose:
; Check byte right.
; Look through byte setting up bit mask.
; BX is used for bit masks, left and right bytes
;
;Entry:
; AL = border bits set
; AH = viewport edge mask if in this byte
; CH = bit mask
; DX = count of pixels painted so far
;Exit:
; BH = final bit mask
; CH = updated b$MaskC
; DX = updated to reflect pixels painted
;Uses:
; per conv.
;Exceptions:
;****************************************************************************
cProc B$EgaCHKBTR,<PUBLIC,NEAR>
cBegin
MOV BH,CH ;initial bit mask
;if viewport edge coincides with a border pixel, don't count as painted
; TEST BH,AH ;is this viewport edge pixel?
; JNZ BYTEX1 ;yes, set pixels (BH) and exit with
; current b$MaskC
BYTLP:
TEST CH,AL ;check for border pixel
JNZ BYTEXT
OR BH,CH ;add pixel to set
TEST BH,AH ;have we just OR'd in viewport edge?
JNZ BYTEX1 ;if so, exit with CH current and
; BH=bit mask
INC DX ;count pixels painted
ROR CH,1 ;move over one
JNB BYTLP ;repeat if not end of byte
ROL CH,1 ;if off edge, rotate bit in at right
BYTEXT:
; Final bit mask returned in BH.
NOT AL ;0 if border pixel(s) in AL
AND BH,AL ;cross out border pixel in bit mask
RET
; This exit only if viewport edge was encountered.
BYTEX1:
INC DX ;indicate one (more) pixel set
cEnd
;***
; B$EgaCHKBTL
;Purpose:
; Check byte left.
; Look through byte setting up bit mask.
; BX is used for bit masks, left and right bytes
;
;Entry:
; AL = border bits set
; AH = viewport edge mask if in this byte
; CH = bit mask
; DX = count of pixels painted so far
;Exit:
; BH = final bit mask
; CH = value for updating b$MaskC
; DX = updated to reflect pixels painted
;Uses:
; per conv.
;Exceptions:
;**************************************************************************
cProc B$EgaCHKBTL,<PUBLIC,NEAR>
cBegin
; First check whether least significant bit is border (thinking
; right to left). If so, we have moved one byte too far to the
; left for b$OffC, and want to set nothing in this byte.
TEST AL,CH
JZ BYTLF0
INC DI ;increment for b$OffC
JMP SHORT BYTLFX
BYTLF0:
MOV BH,CH ;initial bit mask
TEST BH,AH ;is this viewport edge pixel?
JNZ BYTLF1 ;yes, set pixels (BH) and exit with
; preexisting b$MaskC
BYTLFT:
TEST CH,AL ;check for border pixel
JNZ BYTLFX
OR BH,CH ;add pixel to set
TEST BH,AH ;test for viewport edge bit encountered
JNZ BYTLF1 ;if found, exit with CH at that bit
INC DX ;count pixels painted
ROL CH,1 ;move over one
JNB BYTLFT ;repeat if not end of byte
BYTLFX:
ROR CH,1 ;else set up as rightmost pixel
NOT AL
AND BH,AL ; final bit mask returned in BH
RET
BYTLF1: ;this exit only if viewport edge bit encountered
INC DX ;count one (more) pixel painted
cEnd
;***
; PIXRT2
;Purpose:
; Check for non-paint pixels right for 4 plane EGA modes.
; Look through entire range of non-border pixels left to right
; to determine whether any will actually change color.
; AL is used for Color Don't Care mask
;
;Entry:
; SI = byte address of leftmost byte in range
; BL = bit mask for leftmost byte
; BH = bit mask for rightmost byte
; DI = total number of whole bytes -1
; ES = video segment
;Exit:
; CL = 0 if no pixels found to change, non-zero if pixels to change
;Uses:
; per conv.
;Exceptions:
;****
cProc PIXRT2,<NEAR>
cBegin
XOR CL,CL ;maybe no bits change
; read first byte
MOV AL,ES:[SI] ;bit pattern of first byte with 0's where
;color not paint attribute
AND AL,BL ;AND now produces difference if non-paint
;bit in significant position
XOR AL,BL ;for significant bits in our first byte (bit
;set in BH), then non-paint will be one
JNZ BITFDR ;found a bit to change
OR DI,DI ;any more bytes?
JZ PIXLAST ;Brif not, test the last byte
; Look at whole bytes within viewport range until non-paint color found.
LKPNTR:
INC SI
MOV AL,ES:[SI]
NOT AL ;check if all bits set (all paint color)
OR AL,AL ;NOT does not affect flags
JNZ BITFDR
DEC DI
JNZ LKPNTR ;keep looking until search of complete
;bytes is exhausted
; On last byte now, mask in BH.
PIXLAST:
INC SI
MOV AL,ES:[SI] ;do last compare
AND AL,BH ;significant bit = 0 if not paint color
XOR AL,BH ;if different, not paint
JZ NOBITR
BITFDR:
MOV CL,AL ;set change bits flag to non-zero
NOBITR:
cEnd
;***
; B$EgaTILRGT
;Purpose:
; Check for non-paint pixels right if tiling is on.
; Use READC to do bit-wise color compares with tile colors stored in
; color array ColorBits (colors of bits 0 to 7 configured left to right
; are represented in the array as elements offset 0 to 7 from base
; address).
;
;Entry:
; BL = bit mask for leftmost partial byte
; BH = bit mask for rightmost partial byte
; DI = count of whole bytes
; ES:SI = screen address
;Exit:
; CL = 0 iff no pixels to change
;Uses:
; per conv.
;Exceptions:
;****
cProc B$EgaTILRGT,<PUBLIC,NEAR>,<DX,BP>
cBegin
PUSH b$OffC
PUSH b$PenC
PUSH BX ;copy for BH check
MOV ByteCount,DI ;whole byte counter
MOV AL,BL ;copy bit mask from BL
OR AL,AL ;make sure at least 1 bit is set
JZ TILRT5
CALL LOWCHK ;check first partial byte (uses mask in AL)
JNZ TILRT1 ;if no carry, non-match was found
TILRT5:
CMP ByteCount,0 ;see whether whole bytes to check
JZ TILRT4
TILRT2:
INC SI
MOV b$OffC,SI
MOV b$MaskC,80H
XOR BP,BP ;offset to color array
TILRT3:
CALL [b$ReadC]
CMP AL,ColorBits[BP] ;check for non-match
JNZ TILRT1
INC BP
SHR b$MaskC,1 ;move to next bit
JNB TILRT3
DEC ByteCount
JNZ TILRT2 ;keep looking until all whole bytes done
TILRT4:
POP BX ;get bit mask in BH
OR BH,BH
PUSH BX
JZ TILRT6 ;BH=0 indicates no "last byte"
MOV AL,BH ;get last partial byte
INC SI
CALL HICHK
JNZ TILRT1 ;exit if non-match found
TILRT6:
MOV CL,-1
TILRT1:
INC CL ;non-zero if pixels changed
POP BX
POP b$PenC
POP b$OffC
cEnd
;***
; PIXLF2
;Purpose:
; Check for non-paint pixels left for 4 plane EGA modes.
; Look through entire range of non-border pixels right to left
; to determine whether any will actually change color.
; BH/BL = bit masks for leftmost and rightmost bytes, respectively
; DI = total whole bytes between first and last
;
;Entry:
; SI = byte address of rightmost byte in range
; BL = bit mask for rightmost byte
; BH = bit mask for leftmost byte
; DI = total number of whole bytes
; ES = video segment
;Exit:
; CL = 0 if no pixels found to change, non-zero if pixels to change
;Uses:
; per conv.
;Exceptions:
;****
cProc PIXLF2,<NEAR>
cBegin
XOR CL,CL ;maybe no bits change
; read first byte
MOV AL,ES:[SI] ;bit pattern of first byte with 0's where
;color not paint attribute
AND AL,BL ;AND now produces difference if non-paint
;bit in significant position
XOR AL,BL ;for significant bits in our first byte (bit
;set in BH), then non-paint will be one
JNZ BITFDL ;found a bit to change
OR BH,BH ;see if only one byte
JZ NOBITL ;nothing to paint
OR DI,DI ;see if only a "last byte"
JZ LSTBYT
; Look at whole bytes within viewport range until non-paint color found.
LKPNTL:
DEC SI
MOV AL,ES:[SI]
NOT AL ;check if all bits set (all paint color)
OR AL,AL ;NOT does not affect flags
JNZ BITFDL
DEC DI
JNZ LKPNTL ;keep looking until search of complete
;bytes is exhausted
; On last byte now, mask in BH.
LSTBYT:
DEC SI
MOV AL,ES:[SI] ;do last compare
AND AL,BH ;significant bit = 0 if not paint color
XOR AL,BH ;if different, not paint
JZ NOBITL
BITFDL:
MOV CL,AL ;set change bits flag to non-zero
NOBITL:
cEnd
;***
; B$EgaTILLFT
;Purpose:
; Check for non-paint pixels left if tiling is on.
; Use READC to do bit-wise color compares with tile colors stored in
; color array ColorBits (colors of bits 0 to 7 configured left to right
; are represented in the array as elements offset 0 to 7 from base
; address).
;
;Entry:
; BL = bit mask for rightmost partial byte
; BH = bit mask for leftmost partial byte
; DI = count of whole bytes
; ES:SI = screen address
;Exit:
; CL = 0 iff no pixels to change
;Uses:
; per conv.
;Exceptions:
;****
cProc B$EgaTILLFT,<PUBLIC,NEAR>,<DX,BP>
cBegin
PUSH b$OffC
PUSH b$PenC
PUSH BX
MOV AL,BL ;copy of bit mask for rightmost byte
MOV ByteCount,DI ;store whole byte counter
OR AL,AL ;make sure at least 1 bit set
JZ TILLF5
CALL HICHK ;check first [partial] byte using mask in [AL]
JNZ TILLF1 ;exit if non-match found
TILLF5:
CMP ByteCount,0 ;check for intermediate whole bytes
JZ TILLF4 ;if not, proceed to check for last byte
TILLF2:
DEC SI ;move left on line
MOV b$OffC,SI ; store in b$OffC for READC
MOV b$MaskC,1 ;start at rightmost bit
MOV BP,7 ;rightmost element of color array
TILLF3:
CALL [b$ReadC] ;determine color of pixel (returned in AL)
CMP AL,ColorBits[BP] ;look for non-match
JNZ TILLF1 ;when we find one, we can exit
DEC BP
SHL b$MaskC,1 ;move to next bit left
JNB TILLF3 ;continue 'til we shift out of byte left
DEC ByteCount ;prepare to check next byte left
JNZ TILLF2
TILLF4:
POP BX
OR BH,BH ;see whether a "last byte"
PUSH BX
JZ TILLF6 ;if not, there was only 1 byte
MOV AL,BH ;get last byte's bit mask
DEC SI
CALL LOWCHK ;look through last [partial] byte for match
JNZ TILLF1
TILLF6:
MOV CL,-1
TILLF1:
INC CL ;non-zero if pixels changed
POP BX
POP b$PenC
POP b$OffC
cEnd
;***
; HICHK
;Purpose:
; Check partial byte for tile pattern match, where byte may be
; partial in that some low bits may be immunized from PAINT and
; therefore must be skipped during the tile pattern check.
;
;Entry:
; AL = screen byte to check
; ColorBits array contains tile pattern to check against
;Exit:
; PSW.C set iff no match found
;Uses:
; per conv.
;Exceptions:
;****
cProc HICHK,<NEAR>
cBegin
MOV CH,10000000B ;rotate will start mask at 0000/0001
MOV BP,8 ;start counter at 8
HICHK1:
ROL CH,1
DEC BP ;offset to first bit to check for color
ROR AL,1 ;shift immune bits out right
JNB HICHK1 ;if we got a 1, we found a relevant bit
MOV b$MaskC,CH
HICHK2:
PUSH AX ;store state of shift mask
MOV b$OffC,SI
CALL b$ReadC ;get color for this pixel
CMP ColorBits[BP],AL ;see if match
POP AX ;restore shift mask
JNZ HICHK3 ;our goal is just one non-matching pixel
DEC BP
ROR AL,1 ;look for additional 0's to left of first 1
JNB HICHK4
SHL b$MaskC,1
JNB HICHK2
HICHK4:
XOR BP,BP ;return ZF set if no match found
HICHK3:
cEnd
;***
; LOWCHK
;Purpose:
; Check partial byte for tile pattern match, where byte may be
; partial in that some high bits may be immunized from PAINT and
; therefore must be skipped during the tile pattern check.
;
;Entry:
; AL = screen byte to check
; ColorBits array contains tile pattern to check against
;Exit:
; PSW.C set iff no match found
;Uses:
; per conv.
;Exceptions:
;****
cProc LOWCHK,<NEAR>
cBegin
MOV CH,00000001B ;rotate will start mask at 1000/0000
XOR BP,BP
NOT BP ;counter at -1
LWCHK1:
ROR CH,1
INC BP ;offset to first bit to check for color
ROL AL,1 ;shift immune bits out left
JNB LWCHK1 ;if we got a 1, we found a relevant bit
MOV b$OffC,SI
MOV b$MaskC,CH
LWCHK2:
PUSH AX ;store state of shift mask
CALL b$ReadC ;get color for this pixel
CMP ColorBits[BP],AL ;see if match
POP AX ;restore state of shift mask
JNZ LWCHK3 ;our goal is just one non-matching pixel
ROL AL,1 ;look for any trailing 0's indicating immune
JNB LWCHK4
INC BP
SHR b$MaskC,1
JNB LWCHK2
LWCHK4:
XOR BP,BP ;set ZF
LWCHK3: ;non-zero indicates non-match
cEnd
;***
; WRTLFT
;Purpose:
; Used for tiling if in odd/even mode, during SCANL.
; Latches off-screen tile pattern at even address when DI even, and
; at odd address when DI odd, then "writes" this pattern at DI.
;
;Entry:
; ES:DI = screen address of start byte
; CX = count of bytes to write
;Exit:
; ES:DI = screen address of stop byte
;Uses:
; SI
;Exceptions:
;****
cProc WRTLFT,<NEAR>
cBegin
MOV SI,OFFSCN ;get address of off-screen location
TEST DI,1 ;see whether first byte odd
JNZ INCBYL
INC SI ;even byte, so set up for DEC loop
DECBYL:
DEC SI ;SI gets even offscreen byte address
MOV AL,ES:[SI] ;latch even byte pattern
MOV ES:[DI],AL ;dummy write puts latched byte out
DEC DI ;move left on write line
DEC CX ;decrement byte counter
JCXZ LFTEX
INCBYL:
INC SI ;point to odd offscreen byte
MOV AL,ES:[SI] ;latch odd byte pattern
MOV ES:[DI],AL ;dummy write of latched pattern
DEC DI ;move left
LOOP DECBYL
LFTEX:
cEnd
;***
; WRTRGT
;Purpose:
; Used for tiling if in odd/even mode, during SCANR.
; Latches off-screen tile pattern at even address when DI even, and
; at odd address when DI odd, then "writes" this pattern at DI.
;
;Entry:
; ES:DI = screen address of start byte
; CX = count of bytes to write
;Exit:
; ES:DI = screen address of stop byte
;Uses:
; SI
;Exceptions:
;****
cProc WRTRGT,<NEAR>
cBegin
MOV SI,OFFSCN ;get address of off-screen location
TEST DI,1 ;see whether first byte odd
JNZ INCBYR
INC SI ;even byte, so set up for DEC loop
DECBYR:
DEC SI ;SI gets even offscreen byte address
MOV AL,ES:[SI] ;latch even byte pattern
MOV ES:[DI],AL ;dummy write puts latched byte out
INC DI ;move right on write line
DEC CX ;decrement byte counter
JCXZ RGTEX
INCBYR:
INC SI ;point to odd offscreen byte
MOV AL,ES:[SI] ;latch odd byte pattern
MOV ES:[DI],AL ;dummy write of latched pattern
INC DI ;move right
LOOP DECBYR
RGTEX:
cEnd
;***
; ScanL
;Purpose:
; To scan left beginning one pixel to the left of the current
; graphics cursor setting pixels to the paint attribute until
; either edge of viewport or border is found; to return
; certain information to the calling routine.
;
; Algorithm for SCANL2 is as follows: starting next left to b$OffC
; b$MaskC:
;
; i. While (not border) AND (not viewport edge) AND (not left
; edge of byte) move left in byte.
; ii. If (left edge of byte) then
; decrement b$OffC, set up b$MaskC, go to i.
; Else
; test if on border pixel
; x. if true, exit unchanged
; xx. else
; xx1. set up bit mask for first byte
; xx2. calculate # whole bytes if any
; xx3. set up bit mask for last byte if any
; xx4. see whether any pixels in range will
; change color
; xx41. if not, exit to pixel count routine
; xx42. if so, paint all pixels
; xx5. calculate number of pixels "painted"
; xx6. exit with appropriate information
;Entry:
; b$AttrC = attribute to paint
; b$PaintBorder = border attribute which ends paint
; b$OffC, b$MaskC specify pixel one to right of first to examine
;Exit:
; BX = number of nonborder pixels tested
; CL = 0 ifF no pixels changed color
; b$OffC, b$MaskC specify location of last pixel painted, or
; unchanged if only border pixels found
;Uses:
; per conv.
;Exceptions:
;****************************************************************************
cProc B$EgaScanL,<PUBLIC,NEAR>,<ES>
cBegin
CALL B$EgaScanInit
ROL CH,1 ;see if cursor is left edge of byte
JNB VWPCK1
SUB SI,1 ;if so, start next byte left
JNC VWPCK1 ;(SUB used since DEC doesn't set carry)
JMP BRDEX1 ;if negative, hit corner of screen
VWPCK1: ;to check first for viewport edge byte
CMP SI,B$LEOFST ;see if on edge of viewport, or off to left
JNB VWPCK2 ;if viewport byte or to right,
JMP BRDEX1 ; continue, else off to left; do nothing, exit
VWPCK2: ;to check for edge bit if in edge byte
JNZ NOTEDG ;if not viewport edge byte, skip
CMP CH,B$VLMASK ;bit check else compare first pixel left with
;viewport edge bit -- if farther left, we are
; JA BRDEX1 ;are left of viewport edge and must
JNA NOTEDG ;exit
JMP BRDEX1
NOTEDG: ;exit
MOV DI,SI ;extra copy of first byte address
MOV CL,CH ;extra copy of initial bit mask
MOV BP,-1 ;this will be count of whole bytes
XOR DX,DX ;this will be #pixels painted
XOR AH,AH ;initialize this byte's viewport mask to 0
; read first byte off the screen
MOV AL,ES:[DI]
TEST AL,CH ;see whether initial pixel is border
JZ SRCHLF ;if not, start search left
XOR CL,CL ;else set pixels-changed flag back to 0
JMP SHORT BRDEX1 ;and exit gracefully
SRCHLF:
; look for border or viewport in first byte
CMP DI,B$LEOFST ;is this in fact viewport edge byte?
JNZ NOTVWL
MOV AH,B$VLMASK ;if so, set up viewport mask in AH
NOTVWL:
; while not border
TEST AL,CH
JNZ HAVPIX
; and not viewport edge
TEST AH,CH
JNZ HAVPIX
; and not off the edge of the byte
ROL CH,1
JNB NOTVWL
; keep moving left - edge of first byte
DEC DI ;next byte address left
INC BP ;count of intermediate bytes
MOV AL,ES:[DI] ;read next byte left
JMP SHORT SRCHLF ;check next byte
HAVPIX:
; Here when border or viewport edge found.
; Set up bit mask for first (possibly only) byte.
; SI = rightmost byte
; DI = leftmost byte (possibly same byte)
; CL = mask for rightmost bit in rightmost byte
; If viewport edge was found, AH will contain the viewport bit
; mask, and DI is the viewport edge byte. If SI=DI=viewport edge
; byte, we need to retain the viewport mask in AH. Otherwise
; clear AH and fetch the mask again later if needed for DI.
CMP SI,B$LEOFST ;see if rightmost byte is LEFT viewport
JZ SINOTV ;if so, don't clear viewport mask
; register
XOR AH,AH ;else clear AH for B$EgaCHKBTL on
SINOTV: ; rightmost byte
MOV CH,CL ;initial bit position in CH
MOV AL,ES:[SI] ;get border bits if any
CALL B$EgaCHKBTL ;set up bit mask for first byte
MOV BL,BH ;store in BL
XOR BH,BH ;there may be only one byte
; see if more than 1 byte to paint
PUSH SI ;save a copy of rightmost address
INC BP ;see if still -1
JZ ONEBYT
DEC BP ;if not, recover real value
MOV CH,1 ;set up mask for final byte
MOV AL,ES:[DI] ;get border bits if any
CMP DI,B$LEOFST ;was this viewport byte?
JNZ DINOTV ;no -- don't need viewport mask
MOV AH,B$VLMASK ;yes -- get viewport mask for CHKTBL
DINOTV:
CALL B$EgaCHKBTL ;set up leftmost byte bit mask in BH
ONEBYT:
MOV b$OffC,DI
MOV b$MaskC,CH ;update cursor
PUSH DI ;save a copy of leftmost address
MOV DI,BP ;store whole byte count for PIXLF2
CMP b$Tiling,0
JZ COLCM5
CALL B$EgaTILLFT
JMP SHORT COLCM6
COLCM5:
CALL B$EgaSETCMP ;set color compare register to paint attribute
CALL PIXLF2 ;see whether any pixels in range will change
COLCM6:
POP SI ;restore leftmost address to SI
POP DI ;restore rightmost address to DI
OR CL,CL ;returns CL non-zero if changes needed
JZ BRDEXT
; We found at least 1 pixel to change, so set entire range
; set pixels-changed flag, set up write mode 2
XOR CH,CH
NOT CH ;set to FF as decrement flag
STD ;for SCANL, decrement from DI
CALL B$EgaPAINPX
CLD
BRDEXT:
CALL B$EgaPIXCNT ;returns # pixels "painted" in BX
BRDEX1:
CALL B$ResetEGA
cEnd
;***
; ScanR
;Purpose:
; To scan right beginning with the graphics cursor at entry
; setting certain pixels to the current graphics attribute
; (color or tile pattern); to return certain information to
; the calling routine .
;
; ScanR algorithm is as follows :
; i. Search right until
; a. DX pixels have been tested without encountering non-
; border,
; OR
; b. viewport edge is encountered without encountering non-
; border,
; OR
; c. a non-border pixel is found.
; ii. If a. or b., then exit with
; [BX] = number of pixels painted = 0
; [CL] = pixels modified flag = 0
; [DX] = border pixels skipped during successful search for
; non-border pixel = 0
; graphics cursor preserved
; CSAVE (cursor values returned by previous SCANs) preserved
;
; iii.If c., then continue searching right painting non-border
; pixels until
; a. a border pixel is found
; OR
; b. the edge of the viewport is encountered
; then exit with
; [BX] = count of pixels painted (even if no color change
; [CL] = pixels modified flag (0 if no pixels changed color)
; [DX] = entry [DX] - count of border pixels searched before
; encountering non-border
; b$OffC, b$MaskC = last pixel examined (border or viewport
; edge, painted if viewport edge
; b$SaveCa,b$SaveCm = cursor values for first non-border pixel
;
; This routine, which is specific to the EGA graphics modes, takes
; advantage of the following special properties of the EGA card :
; a. The ability to return 8-bit color compare to a specified
; color with respect to all 4 planes via a single MOV
; b. The ability to write to all four planes via a single MOV
;
; The algorithm is as follows : starting with b$OffC, b$MaskC
;
; i. While (border) and (not viewport edge) and (not DX=0) and
; (not right edge of byte) do
; move right in byte
; decrement DX
; ii. If (right edge of byte) then
; increment b$OffC, set up b$MaskC
; go to i.
; Else
; test if on border pixel
; x. if true, exit with appropriate information
; xx. else
; xx1. save pertinent information including bit mask for
; first byte
; xx2. calculate number of bytes between b$OffC and
; viewport edge
; xx3. read all bytes until edge or border pixel
; xx4. analyze last byte
; xx5. set CL = 0
; starting at CSAVE, while (pixel = paint
; attribute) and (not end of range) read right
; if (pixel = non-attribute) then
; CL = non-zero
; write first byte, whole bytes, last byte
; xx6. exit with appropriate information.
;
;Entry:
; DX = count of border pixels which may be skipped
; b$AddrC, b$MaskC = starting pixel
; b$PaintBorder = attribute of paint region border
; b$AttrC = attribute to paint
; B$REOFST, B$VRMASK = right viewport edge
;Exit:
; BX = number of pixels painted
; (whether or not they changed color)
; CL = 0 iff no pixels changed color
; DX = remaining border pixel count
; b$OffC, b$MaskC = the last non-border pixel examined/painted
; SI, AL = the first non-border pixel encountered
;Uses:
; per conv.
;Exceptions:
;*****************************************************************************
cProc B$EgaScanR,<PUBLIC,NEAR>,<ES>
cBegin
; set up EGA registers for color compare read
; point ES:[SI] to screen memory, b$MaskC in CH
; CL = 0 (pixels changed flag)
CALL B$EgaScanInit ;setup
; perform color compare on first byte
MOV AL,ES:[SI] ;bits set where border found
; starting at entry cursor, search right looking for non-border,
; viewport edge, or end-of-byte as long as DX does not decrement to 0
XOR AH,AH ;initialize viewport mask to 0
SRCHRT:
CMP SI,B$REOFST ;check whether we are in viewport edge byte
JNZ NOTVPR
MOV AH,B$VRMASK ;if so, get viewport edge mask
NOTVPR:
; While border...
TEST AL,CH ;compare color compare mask with b$MaskC
JZ ENDRT ;if pixel not border, exit loop
; and not viewport edge...
TEST AH,CH ;compare viewport edge mask with b$MaskC
JNZ ENDRT ;if edge found, exit
; and DX is greater than 0...
DEC DX ;contains # pixels which can be skipped
JZ ENDRT ;in search for non-border pixel
; and not off the edge of the byte...
ROR CH,1 ;shift bit mask right
; repeat the search
JNB NOTVPR
; end of first byte.
INC SI ;next byte address
MOV AL,ES:[SI]
MOV CH,80H ;mask now 1000/0000 for next search
JMP SHORT SRCHRT
; either (not border) OR (viewport edge) OR (DX = 0)
ENDRT:
TEST AL,CH ;border?
JZ NOTBRD ;if so, we are either at viewport edge
XOR DX,DX ;or have skipped DX pixels and therefore
JMP SHORT SCNEX2 ;should exit with info as initialized
; look for viewport edge to determine how many bytes to
; look through for border pixel
NOTBRD:
PUSH DX ;store skipcount for later
XOR DX,DX ;use to count pixels painted
MOV b$SaveCa,SI ;we have a new CSAVE
PUSH SI ;store copy of first byte address
MOV b$SaveCm,CH
CALL B$EgaCHKBTR ;set up byte for write, and count some pixels
;(AH = viewport edge mask if any)
MOV BL,BH ;store first bit mask in BL
XOR BH,BH ;zero BH until last byte bit mask if any
XOR BP,BP ;start whole byte count at 0
MOV DI,B$REOFST
SUB DI,SI ;viewport edge address - first byte address
TEST BL,1 ;if last bit not set, we found border for sure
JZ WRTPIX ;if just one byte, we're done
OR DI,DI ;check also if we hit viewport edge
JZ WRTPIX ;if so, also done
; else look through DI bytes for border (this includes
; viewport edge byte)
DEC BP ;start increment at -1
MOV CH,80H ;start each byte at left edge
SCANEM:
INC BP ;whole byte count
INC SI ;point to byte
MOV AL,ES:[SI] ;read each byte for color compare
OR AL,AL ;check for occurrence of border pixel(s)
JNZ BRDPIX ;set up last byte
DEC DI ;decrement to 0 to include last byte
JNZ SCANEM ;go check out this byte
;[alice]MOV AH,B$VRMASK ;if edge of viewport, get viewport mask
;and proceed to set up byte for write
BRDPIX:
CMP SI,B$REOFST ;if viewport edge not reached, skip
JNZ BRDRFD ; since it was border with no
; viewport edge
;this instruction reached if
; viewport edge byte
;this byte may contain border also
MOV AH,B$VRMASK ;if edge of viewport, get viewport mask
BRDRFD:
CALL B$EgaCHKBTR ;set up byte for write
; most recent call to B$EgaCHKBTR has generated new cursor
; location and mask
WRTPIX:
MOV b$OffC,SI
MOV b$MaskC,CH
POP DI ;restore leftmost byte address
PUSH DI ;save a copy for leftmost add. for painting
PUSH SI ;save copy of rightmost address also
MOV SI,DI ;leftmost byte address in SI for PIXRT2
MOV DI,BP ;PIXRGT will use DI to count whole bytes
CMP b$Tiling,0 ;see if tiling is on
JZ COLCM1
CALL B$EgaTILRGT ;need routine for reading individual pixels
JMP SHORT COLCM2 ;for position-sensitive compare
COLCM1:
CALL B$EgaSETCMP ;set color compare register to paint attribute
CALL PIXRT2 ;routine to determine whether any pixels change
COLCM2:
POP SI ;restore rightmost
POP DI ;and leftmost byte addresses
OR CL,CL ;non-zero indicates at least one must change
JZ NOPNTR
XOR CH,CH ;zero as increment flag
CLD ;for SCANR, paint routine should increment REP
CALL B$EgaPAINPX ;set line
NOPNTR:
CALL B$EgaPIXCNT ;return # pixels "painted" in BX
POP DX ;skipcount in DX
SCNEX2:
CALL B$ResetEGA ;reset EGA registers for BIOS write mode 0
MOV SI,b$SaveCa ;return CSAVE
MOV AL,b$SaveCm
cEnd
sEnd GR_TEXT
END
|
bootloader/boot.asm | UtkarshMe/Jazz | 7 | 81592 | <reponame>UtkarshMe/Jazz<filename>bootloader/boot.asm<gh_stars>1-10
; ---------------------------------------------------------------------
; The bootloader for Jazz (github.com/coditva/Jazz)
; Author: <NAME>
; vi:filetype=nasm
; ---------------------------------------------------------------------
bits 16
org 0x7c00
boot:
mov ax, 0x2401
int 0x15 ; enable A20 bit
mov ax, 0x3 ; set text-mode to 3
int 0x10 ; set VGA text-mode
; ---------------------------------------------------------------------
; we will enter 32bit protected mode now
; but first, gotta setup a Global Descriptor Table (GDT)
lgdt [gdt_pointer] ; load the gdt table
mov eax, cr0 ; set protected mode
or eax, 0x1 ; on special
mov cr0, eax ; CPU reg cr0
jmp CODE_SEG:boot2 ; long jump to the code segment
; ---------------------------------------------------------------------
; define the data structure for a GDT
gdt_start:
dq 0x0
gdt_code:
dw 0xFFFF
dw 0x0
db 0x0
db 10011010b
db 11001111b
db 0x0
gdt_data:
dw 0xFFFF
dw 0x0
db 0x0
db 10010010b
db 11001111b
db 0x0
gdt_end:
; ---------------------------------------------------------------------
; setup the data structure for the gdt_pointer
gdt_pointer:
dw gdt_end - gdt_start
dd gdt_start
; ---------------------------------------------------------------------
; define segments
CODE_SEG equ gdt_code - gdt_start
DATA_SEG equ gdt_data - gdt_start
; ---------------------------------------------------------------------
; setup complete, let's get into 32bit!
bits 32
boot2:
mov ax, DATA_SEG ; setup segment registers
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
; ---------------------------------------------------------------------
; let's print something using VGA text
mov ebx, 0xb8000 ; the VGA buffer is located at 0xb8000
; we will be sending all text to this
mov esi, hello ; load the string to be printed
.loop:
lodsb ; load a byte
add al, 0x0 ; check if it is zero
jz halt ; halt if it is
or eax, 0x0200 ; add formatting info
mov word [ebx], ax ; send to VGA
add ebx, 2 ; increment address
jmp .loop
halt:
cli ; clear interrupts flag (block interrupts)
hlt ; hlt
hello:
db "I love OSDev. My bootloader is awesome!", 0
; ---------------------------------------------------------------------
; mark this as bootable
times 510-($-$$) db 0 ; fill the remaining memory with 0
dw 0xaa55 ; add the magic number
|
src/Convergence.agda | boystrange/FairSubtypingAgda | 4 | 16906 | <gh_stars>1-10
-- MIT License
-- Copyright (c) 2021 <NAME> and <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.
{-# OPTIONS --guardedness --sized-types #-}
open import Data.Empty
open import Data.Product
open import Data.Sum
open import Data.List using ([]; _∷_; _∷ʳ_; _++_)
open import Relation.Nullary
open import Relation.Unary using (_∈_; _⊆_;_∉_)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst; sym)
open import Relation.Binary.Construct.Closure.ReflexiveTransitive using (_◅◅_)
open import Function.Base using (case_of_)
open import Common
module Convergence {ℙ : Set} (message : Message ℙ)
where
open import Trace message
open import SessionType message
open import Transitions message
open import HasTrace message
open import Session message
open import TraceInclusion message
open import Divergence message
open import FairCompliance message
PreConvergence : (SessionType -> SessionType -> Set) -> SessionType -> SessionType -> Set
PreConvergence rel T S =
∀{φ} (tφ : T HasTrace φ) (sφ : ¬ S HasTrace φ) ->
∃[ ψ ] ∃[ x ] (ψ ⊑ φ × ∃ λ (tψ : T HasTrace (ψ ∷ʳ O x)) ->
∃ λ (sψ : S HasTrace (ψ ∷ʳ O x)) ->
rel (after tψ) (after sψ))
data _↓_ : SessionType -> SessionType -> Set where
converge : ∀{T S} -> PreConvergence _↓_ T S -> T ↓ S
Convergence : SessionType -> SessionType -> Set
Convergence = PreConvergence _↓_
con-sound : ∀{T S} -> T ↓ S -> ConvergenceS T S
con-sound {T} {S} (converge C) {R} comp with fair-compliance->may-succeed comp
... | (R' # T') , reds , win#def w tdef with unzip-red* reds
... | φ , rr , tr with S HasTrace? φ
... | yes (S' , sdef , sr) = _ , zip-red* rr sr , win#def w sdef
... | no nsφ with C (_ , tdef , tr) nsφ
... | (ψ , x , prefix , tψx , sψx , con)
with ⊑-has-co-trace prefix (_ , win->defined w , rr) | has-trace-snoc sψx
... | rψ | sψ@(_ , sdef , _) , _ with client-wins-or-accepts-prefix comp rψ tψx
... | inj₁ wψ = _ , zip-traces rψ sψ , win#def wψ sdef
... | inj₂ rψx with zip-traces rψx tψx
... | reds' with con-sound con (fair-compliance-red* comp reds')
... | (_ , reds'' , success) = _ , zip-traces rψx sψx ◅◅ reds'' , success
inclusion->convergence : ∀{T S} -> TraceInclusionS T S -> T ↓ S
inclusion->convergence sub = converge λ tφ nsφ -> ⊥-elim (nsφ (sub tφ))
not-convergence->exclusion : ∀{T S} -> ¬ T ↓ S -> ¬ TraceInclusionS T S
not-convergence->exclusion not sub = not (inclusion->convergence sub)
not-convergence+divergence : ∀{T S} -> T ↓ S -> T ↑ S -> ⊥
not-convergence+divergence (converge F) div =
let φ = _↑_.trace div in
let tφ = _↑_.with-trace div in
let nsφ = _↑_.without-trace div in
let _ , _ , pre , tψx , sψx , con' = F tφ nsφ in
let div' = _↑_.divergence div pre tψx sψx in
not-convergence+divergence con' div'
↓->preconv : ∀{S T} → S ↓ T → PreConvergence _↓_ S T
↓->preconv (converge x) = x
conv->defined : ∀{S T} → Defined S → S ↓ T → Defined T
conv->defined {_} {nil} inp (converge f) with f {[]} (inp _ , inp , refl) (λ x → not-nil-has-trace x)
... | _ , _ , none , _ , ht , _ = ⊥-elim (not-nil-has-trace ht)
conv->defined {_} {inp _} inp (converge _) = inp
conv->defined {_} {out _} inp (converge _) = out
conv->defined {_} {nil} out (converge f) with f {[]} (out _ , out , refl) (λ x → not-nil-has-trace x)
... | _ , _ , none , _ , ht , _ = ⊥-elim (not-nil-has-trace ht)
conv->defined {_} {inp _} out (converge _) = inp
conv->defined {_} {out _} out (converge _) = out
nil-converges : ∀{S} → nil ↓ S
nil-converges {S} = converge λ tφ _ → ⊥-elim (not-nil-has-trace tφ)
end-converges : ∀{T S} → End T → Defined S → T ↓ S
end-converges (inp e) def = converge λ tφ sφ →
let eq = empty-inp-has-empty-trace e tφ in
⊥-elim (sφ (subst (λ ψ → _ HasTrace ψ) (sym eq) (_ , def , refl)))
end-converges (out e) def = converge λ tφ sφ →
let eq = empty-out-has-empty-trace e tφ in
⊥-elim (sφ (subst (λ ψ → _ HasTrace ψ) (sym eq) (_ , def , refl)))
pre-conv-inp-back : ∀{f g}
→ (∀{x} → x ∈ dom f → PreConvergence _↓_ (f x .force) (g x .force))
→ PreConvergence _↓_ (inp f) (inp g)
pre-conv-inp-back _ {[]} _ no-tr = ⊥-elim (no-tr (_ , inp , refl))
pre-conv-inp-back {f} conv {I x ∷ tr} ok-tr no-tr with x ∈? f
pre-conv-inp-back {f} conv {I x ∷ tr} (_ , def , step inp red) no-tr | yes ok-x =
let ϕ , α , (pref , (_ , d , r) , (_ , d' , r') , pr) = conv ok-x (_ , def , red) λ (_ , d , r) → no-tr (_ , d , step inp r) in
I x ∷ ϕ , α , some pref , (_ , d , step inp r) , (_ , d' , step inp r') , pr
pre-conv-inp-back {f} conv {I x ∷ tr} ok-tr no-tr | no no-x = ⊥-elim (no-x (inp-hastrace->defined ok-tr))
pre-conv-inp-back _ {O _ ∷ _} (_ , _ , step () _) _ |
oeis/173/A173862.asm | neoneye/loda-programs | 11 | 82686 | <reponame>neoneye/loda-programs<filename>oeis/173/A173862.asm
; A173862: a(n) = A158772(n-1)/21.
; 1,1,1,2,2,2,4,4,4,8,8,8,16,16,16,32,32,32,64,64,64,128,128,128,256,256,256,512,512,512,1024,1024,1024,2048,2048,2048,4096,4096,4096,8192,8192,8192,16384,16384,16384,32768,32768,32768,65536,65536,65536,131072,131072,131072,262144,262144,262144,524288,524288,524288,1048576,1048576,1048576,2097152,2097152,2097152,4194304,4194304,4194304,8388608,8388608,8388608,16777216,16777216,16777216,33554432,33554432,33554432,67108864,67108864,67108864,134217728,134217728,134217728,268435456,268435456
div $0,3
mov $1,2
pow $1,$0
mov $0,$1
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/support/enumchek.ada | best08618/asylo | 7 | 16893 | <reponame>best08618/asylo<gh_stars>1-10
-- THIS GENERIC PROCEDURE IS INTENDED FOR USE IN CONJUNCTION WITH THE ACVC
-- CHAPTER 13 C TESTS. IT IS INSTANTIATED WITH TWO TYPES. THE FIRST IS AN
-- ENUMERATION TYPE FOR WHICH AN ENUMERATION CLAUSE HAS BEEN GIVEN, AND THE
-- SECOND IS AN INTEGER TYPE WHOSE 'SIZE IS THE SAME AS THE 'SIZE OF THIS
-- ENUMERATION TYPE.
-- THE PROCEDURE ENUM_CHECK IS THEN CALLED WITH THREE ARGUMENTS. THE FIRST IS
-- AN ENUMERATION LITERAL FROM THE ENUMERATION TYPE, THE SECOND IS AN INTEGER
-- LITERAL WHICH IS THE VALUE OF THE EXPECTED REPRESENTATION (TAKEN FROM THE
-- ENUMERATION REPRESENTATION CLAUSE), AND THE THIRD IS A STRING DESCRIBING OR
-- NAMING THE TYPE (USED IN A CALL TO FAILED IF THE REPRESENTATION CHECK FAILS).
-- THE CHECK IS TO CONVERT THE ENUMERATION VALUE TO A BOOLEAN ARRAY WITH A
-- LENGTH CORRESONDING TO THE 'SIZE OF THE ENUMERATION TYPE. AN INTEGER TYPE
-- IS THEN CREATED WITH THIS SAME 'SIZE, AND THE REQUIRED REPRESENTATION VALUE
-- IS CONVERTED FROM THIS TYPE TO A BOOLEAN ARRAY WITH THE SAME LENGTH. THE
-- TWO BOOLEAN ARRAYS ARE THEN COMPARED AND SHOULD BE EQUAL. THE CONVERSIONS
-- ARE PERFORMED USING APPROPRIATE INSTANTIATIONS OF UNCHECKED_CONVERSION.
-- AUTHOR: <NAME>, UNCOPYRIGHTED, PUBLIC DOMAIN USE AUTHORIZED
GENERIC
TYPE ENUM_TYPE IS PRIVATE;
TYPE INT_TYPE IS RANGE <>;
PROCEDURE ENUM_CHECK (TEST_VALUE : ENUM_TYPE;
REP_VALUE : INT_TYPE;
TYPE_ID : STRING);
WITH UNCHECKED_CONVERSION;
WITH REPORT; USE REPORT;
PROCEDURE ENUM_CHECK (TEST_VALUE : ENUM_TYPE;
REP_VALUE : INT_TYPE;
TYPE_ID : STRING) IS
TYPE BIT_ARRAY_TYPE IS ARRAY (1 .. ENUM_TYPE'SIZE) OF BOOLEAN;
PRAGMA PACK (BIT_ARRAY_TYPE);
FUNCTION TO_BITS IS NEW UNCHECKED_CONVERSION (ENUM_TYPE, BIT_ARRAY_TYPE);
FUNCTION TO_BITS IS NEW UNCHECKED_CONVERSION (INT_TYPE, BIT_ARRAY_TYPE);
BIT_ARRAY_1 : BIT_ARRAY_TYPE;
BIT_ARRAY_2 : BIT_ARRAY_TYPE;
INT_VALUE : INT_TYPE := INT_TYPE (REP_VALUE);
BEGIN
-- VERIFY CORRECT CALL (THIS IS A SANITY CHECK ON THE TEST ITSELF)
IF ENUM_TYPE'SIZE /= INT_TYPE'SIZE THEN
FAILED ("ERROR IN ENUM_CHECK CALL: SIZES DO NOT MATCH");
END IF;
BIT_ARRAY_1 := TO_BITS (TEST_VALUE);
BIT_ARRAY_2 := TO_BITS (INT_VALUE);
IF BIT_ARRAY_1 /= BIT_ARRAY_2 THEN
FAILED ("CHECK ON REPRESENTATION OF TYPE " & TYPE_ID & " FAILED.");
END IF;
END ENUM_CHECK;
|
tests/common.adb | faelys/natools-web | 1 | 10101 | <filename>tests/common.adb
------------------------------------------------------------------------------
-- Copyright (c) 2014-2015, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- IMPLEMENTATION NOTES --
-- Counter is a "simple" protected holding a natural value that can be --
-- incremented, and for which a given threshold can be waited. --
-- It should be free of race conditions. --
-- The general architecture of Counter can be explained by considering two --
-- states: a long-lived "base" state, when `Release_Block` queue is empty, --
-- and a short-lived "pulsing" state, when `Release_Block` holds a task in --
-- its queue. --
-- In base state, waiting tasks call `Wait_Version`, which either exists --
-- immediately or requeues them in `Block_Until_Increment` where they stay --
-- blocked until entering the pulsing state. --
-- In pulsing state, public entries are blocked, and all tasks in --
-- `Block_Until_Increment` queue are requeued in `Wait_Version`. When this --
-- is done, pulsing state ends. --
-- Immediately after coming back to base state, waiting tasks execute --
-- `Wait_Version`, which unlocks them or requeues them again in --
-- `Block_Until_Increment`. --
-- Note that right after coming back to base state, there might be both --
-- waiting tasks queued on `Wait_Version` and updating tasks queued on --
-- `Increment`. The order in which they are serviced should be semantically --
-- equivalent, but servicing `Increment` first lowers the number of --
-- requeues and should therefore be a bit more efficient. --
------------------------------------------------------------------------------
with Ada.Calendar.Formatting;
with Ada.Text_IO;
with Natools.Web.Exchanges;
with Natools.Web.Sites.Test_Updates;
with Syslog;
package body Common is
protected body Counter is
function Get_Value return Natural is
begin
return Value;
end Get_Value;
entry Wait_Version (Minimum : in Natural)
when Release_Block'Count = 0 and then Increment'Count = 0 is
begin
if Minimum > Value then
requeue Block_Until_Increment;
end if;
end Wait_Version;
entry Increment when Release_Block'Count = 0 is
begin
Value := Value + 1;
requeue Release_Block;
end Increment;
entry Block_Until_Increment (Minimum : in Natural)
when Release_Block'Count > 0 is
begin
requeue Wait_Version;
end Block_Until_Increment;
entry Release_Block when Block_Until_Increment'Count = 0 is
begin
null;
end Release_Block;
end Counter;
overriding procedure Queue
(Object : in out Holder;
Update : in Natools.Web.Sites.Updates.Site_Update'Class)
is
package Holders renames Natools.Web.Sites.Holders;
begin
Holders.Queue (Holders.Holder (Object), Update);
Holders.Queue (Holders.Holder (Object), Increment_Count'(null record));
end Queue;
overriding procedure Load
(Self : in out Holder;
File_Name : in String)
is
package Holders renames Natools.Web.Sites.Holders;
begin
Holders.Load (Holders.Holder (Self), File_Name);
Holders.Queue
(Holders.Holder (Self),
Natools.Web.Sites.Test_Updates.Load_Date_Override'
(New_Date => Ada.Calendar.Formatting.Time_Of
(1980, 1, 1, 10, 30, 42)));
end Load;
not overriding procedure Purge (Self : in out Holder) is
package Holders renames Natools.Web.Sites.Holders;
Update : Natools.Web.Sites.Updates.Expiration_Purger;
begin
Holders.Queue (Holders.Holder (Self), Update);
end Purge;
overriding procedure Update
(Self : in Increment_Count;
Object : in out Natools.Web.Sites.Site)
is
pragma Unreferenced (Self, Object);
begin
Counter.Increment;
end Update;
function Respond (Request : AWS.Status.Data) return AWS.Response.Data is
Aliased_Request : aliased constant AWS.Status.Data := Request;
Exchange : aliased Natools.Web.Exchanges.Exchange
(Aliased_Request'Access);
begin
Site.Respond (Exchange);
return Natools.Web.Exchanges.Response (Exchange);
end Respond;
procedure Text_IO_Log
(Severity : in Natools.Web.Severities.Code;
Message : in String) is
begin
Ada.Text_IO.Put_Line
('[' & Natools.Web.Severities.Code'Image (Severity) & "] "
& Message);
end Text_IO_Log;
Severity_Table : constant array (Natools.Web.Severities.Code)
of Syslog.Severities.Code
:= (Natools.Web.Severities.Critical => Syslog.Severities.Critical,
Natools.Web.Severities.Error => Syslog.Severities.Error,
Natools.Web.Severities.Warning => Syslog.Severities.Warning,
Natools.Web.Severities.Info => Syslog.Severities.Informational);
procedure Syslog_Log
(Severity : in Natools.Web.Severities.Code;
Message : in String) is
begin
Syslog.Log (Severity_Table (Severity), Message);
end Syslog_Log;
end Common;
|
orka_plugin_sdl/src/orka-inputs-sdl.ads | onox/orka | 52 | 8887 | <gh_stars>10-100
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with SDL.Events.Mice;
with SDL.Video.Windows;
with Orka.Inputs.Pointers.Default;
package Orka.Inputs.SDL is
pragma Preelaborate;
type SDL_Pointer_Input is new Pointers.Default.Abstract_Pointer_Input with private;
overriding
procedure Set_Cursor_Mode
(Object : in out SDL_Pointer_Input;
Mode : Pointers.Default.Cursor_Mode);
procedure Set_Button_State
(Object : in out SDL_Pointer_Input;
Subject : Standard.SDL.Events.Mice.Buttons;
State : Pointers.Button_State);
procedure Set_Window
(Object : in out SDL_Pointer_Input;
Window : Standard.SDL.Video.Windows.Window);
function Create_Pointer_Input return Inputs.Pointers.Pointer_Input_Ptr;
private
type SDL_Pointer_Input is new Pointers.Default.Abstract_Pointer_Input with record
Window : Standard.SDL.Video.Windows.ID;
end record;
end Orka.Inputs.SDL;
|
LCD/Multi.asm | xfrings/8051-Experiments | 0 | 16329 | ;MULTI LINE AND MULTI SCREEN CONTINUOUS THROUGH DISPLAY
;TESTED AND CHECKED ON AT89C51- C51002/003
;09/08/2007
;PROGRAM RUN----------- SUCCESS.
ORG 0000H ; P1.1-RS
SJMP 0030H ; P1.2-R/W
ORG 0030H ; P1.3-EN
START: CLR A
MOV P1,A
MOV P2,A
MOV P3,A
MOV R3,A
MOV R4,A
INIT: MOV A,#38H
LCALL COMMAND
MOV A,#0CH
LCALL COMMAND
MOV A,#06H
LCALL COMMAND
MOV A,#01H
LCALL COMMAND
;MOV A,#'V'
;LCALL DISPLAY
REWRT: MOV R3,#00H
MOV R4,#00H
MOV R0,#00H
MOV DPTR,#0F80H
;CHAR BYTES FROM 0F80H
LOOP: CLR A
INC R3
MOVC A,@A+DPTR
INC DPTR
LCALL DISPLAY
LCALL DELAY
INC R0
CJNE R0,#20H,SIP1
MOV R0,#00H
LCALL CLEAR
SIP1: CLR A
MOVC A,@A+DPTR
CJNE R3,#10H,SKIP
MOV R3,#00H
INC R4
CJNE R4,#02H,NEXT
MOV R4,#00H
LCALL LINE1
SJMP SKIP
NEXT: LCALL LINE2
SKIP: CJNE A,#0FFH,LOOP
LCALL CLEAR
SJMP REWRT
HERE: SJMP HERE
COMMAND:LCALL READY
CLR P1.2
CLR P1.1
MOV P2,A
SETB P1.3
NOP
CLR P1.3
RET
READY: SETB P2.7
CLR P1.1
SETB P1.2
BUSY: CLR P1.3
SETB P1.3
JB P2.7,BUSY
NOP
CLR P1.3
RET
DISPLAY:LCALL READY
CLR P1.2
SETB P1.1
MOV P2,A
SETB P1.3
NOP
CLR P1.3
RET
DELAY: MOV R7,#01H
WAITC: MOV R6,#0FFH
WAITB: MOV R5,#0FFH
WAITA: DJNZ R5,WAITA
DJNZ R6,WAITB
DJNZ R7,WAITC
RET
CLEAR: MOV A,#01H
LCALL COMMAND
RET
LINE1: MOV A,#80H
LCALL COMMAND
RET
LINE2: MOV A,#0C0H
LCALL COMMAND
RET
ORG 0F80H
;DB 'hey mel !!!'
;DB 'Be The Change You Want To See!'
DB 'A GREAT MIND CAN SOAR HIGH IN IMAGINATION YET BE FIRMLY GROUNDED'
END |
data/pokemon/dex_entries/golduck.asm | Dev727/ancientplatinum | 28 | 15742 | <filename>data/pokemon/dex_entries/golduck.asm
db "DUCK@" ; species name
dw 507, 1690 ; height, weight
db "It swims grace-"
next "fully along on the"
next "quiet, slow-moving"
page "rivers and lakes"
next "of which it is so"
next "fond.@"
|
alloy4fun_models/trashltl/models/9/pYCpPb3c4ocZLBQoj.als | Kaixi26/org.alloytools.alloy | 0 | 11 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idpYCpPb3c4ocZLBQoj_prop10 {
always (Protected in Protected')
}
pred __repair { idpYCpPb3c4ocZLBQoj_prop10 }
check __repair { idpYCpPb3c4ocZLBQoj_prop10 <=> prop10o } |
external/source/exploits/cve-2018-8897/exe/Native.asm | OsmanDere/metasploit-framework | 26,932 | 96187 | .code
__swapgs PROC
swapgs
ret
__swapgs ENDP
__rollback_isr PROC
mov rdx, [rsp] ; rdx = Return pointer
lea r8, [rsp+8h] ; r8 = Old stack
mov [rcx], rdx ; isr stack.rip = Return pointer
mov [rcx+18h], r8 ; isr stack.rsp = Old stack
mov rsp, rcx ; stack = isr stack
iretq ; return
__rollback_isr ENDP
__set_gs_base PROC
wrgsbase rcx
ret
__set_gs_base ENDP
__readss PROC
xor eax, eax
mov ax, ss
ret
__readss ENDP
__read_gs_base PROC
rdgsbase rax
ret
__read_gs_base ENDP
__triggervuln PROC
mov [rcx+8*0], r12 ; save registers
mov [rcx+8*1], r13
mov [rcx+8*2], r14
mov [rcx+8*3], r15
mov [rcx+8*4], rdi
mov [rcx+8*5], rsi
mov [rcx+8*6], rbx
mov [rcx+8*7], rbp
mov [rcx+8*8], rsp
pushfq
pop [rcx+8*9]
mov ss, word ptr [rdx] ; Defer debug exception
int 3 ; Execute with interrupts disabled
nop
nop
nop
nop
mov r12, [rcx+8*0] ; load registers
mov r13, [rcx+8*1]
mov r14, [rcx+8*2]
mov r15, [rcx+8*3]
mov rdi, [rcx+8*4]
mov rsi, [rcx+8*5]
mov rbx, [rcx+8*6]
mov rbp, [rcx+8*7]
mov rsp, [rcx+8*8]
push [rcx+8*9]
popfq
ret
__triggervuln ENDP
__setxmm0 PROC
movups xmm0, [rcx]
ret
__setxmm0 ENDP
__setxmm1 PROC
movups xmm1, [rcx]
ret
__setxmm1 ENDP
__setxmm2 PROC
movups xmm2, [rcx]
ret
__setxmm2 ENDP
__setxmm3 PROC
movups xmm3, [rcx]
ret
__setxmm3 ENDP
__setxmm4 PROC
movups xmm4, [rcx]
ret
__setxmm4 ENDP
__setxmm5 PROC
movups xmm5, [rcx]
ret
__setxmm5 ENDP
__setxmm6 PROC
movups xmm6, [rcx]
ret
__setxmm6 ENDP
__setxmm7 PROC
movups xmm7, [rcx]
ret
__setxmm7 ENDP
__setxmm8 PROC
movups xmm8, [rcx]
ret
__setxmm8 ENDP
__setxmm9 PROC
movups xmm9, [rcx]
ret
__setxmm9 ENDP
__setxmm10 PROC
movups xmm10, [rcx]
ret
__setxmm10 ENDP
__setxmm11 PROC
movups xmm11, [rcx]
ret
__setxmm11 ENDP
__setxmm12 PROC
movups xmm12, [rcx]
ret
__setxmm12 ENDP
__setxmm13 PROC
movups xmm13, [rcx]
ret
__setxmm13 ENDP
__setxmm14 PROC
movups xmm14, [rcx]
ret
__setxmm14 ENDP
__setxmm15 PROC
movups xmm15, [rcx]
ret
__setxmm15 ENDP
end
|
src/fmt.adb | likai3g/afmt | 0 | 29555 | <reponame>likai3g/afmt<filename>src/fmt.adb<gh_stars>0
pragma Ada_2020;
with Ada.Text_IO;
with Ada.Unchecked_Conversion;
with System;
package body Fmt is
function To_Ptr is
new Ada.Unchecked_Conversion(System.Address, Argument_Ptr);
function "&" (Values : Arguments; New_Item : Argument_Type'Class) return Arguments
is
begin
return Values & To_Ptr(New_Item'Address);
end "&";
type Piece_Info is record
Begin_At : Positive; -- first pos include in piece
End_At : Natural; -- first pos not include in piece
Length : Natural; -- final length
Arg_Id : Natural; -- >0 when the piece is an expr,
Num_Esc : Natural; -- >0 when the piece contains escape char
end record;
type Piece_Infos is array(Positive range <>) of Piece_Info;
function Total_Length (PS : Piece_Infos) return Natural
is
L : Natural := 0;
begin
-- return [for P of PS => P.Length]'Reduce("+", 0);
for P of PS loop
L := L + P.Length;
end loop;
return L;
end Total_Length;
function Get_Expr_Count (
Template : String)
return Natural
is
R : Natural := 0;
I : Positive := Template'First;
begin
while I < Template'Last loop
case Template(I) is
when '\' =>
I := I + 2;
when '{' =>
I := I + 1;
while I < Template'Last loop
exit when Template(I) = '}';
I := I + 1;
end loop;
I := I + 1;
R := R + 1;
when others =>
I := I + 1;
end case;
end loop;
return R;
end Get_Expr_Count;
function Compute_Piece_Infos (
Template : String;
Values : Arguments)
return Piece_Infos
is
Info : Piece_Infos(1 .. Get_Expr_Count(Template) * 2 + 1);
I : Natural := Template'First;
NB, NE : Natural;
SB, SE : Natural;
K : Positive := Info'First;
Auto_Id : Positive := Values'First;
begin
Info(K) := (I, I, 0, 0, 0);
loop
case Template(I) is
when '{' =>
K := K + 1;
Info(K) := (I, I, 0, 0, 0);
-- scan optional arg_id
NB := I + 1;
NE := NB;
while NE < Template'Last loop
exit when not (Template(NE) in '0' .. '9');
Info(K).Arg_Id := Info(K).Arg_Id * 10 + Character'Pos(Template(NE)) - Character'Pos('0');
NE := NE + 1;
end loop;
if NE = NB then
Info(K).Arg_Id := Auto_Id;
Auto_Id := Auto_Id + 1;
end if;
-- scan Edit info
SB := NE;
SE := SB;
while SE < Template'Last loop
exit when Template(SE) = '}';
SE := SE + 1;
end loop;
Info(K).End_At := SE + 1;
if Info(K).Arg_Id in Values'Range then
declare
Arg : constant Argument_Ptr := Values(Info(K).Arg_Id);
begin
if Template(SB) = ':' then
Arg.Parse(Template(SB + 1 .. SE - 1));
else
-- always call Parse
-- Arugment may set default edit here
Arg.Parse("");
end if;
Info(K).Length := Arg.Get_Length;
end;
else
-- index invalid, treat as empty piece
Info(K).Arg_Id := 0;
end if;
-- scan next piece
K := K + 1;
I := SE + 1;
Info(K) := (I, I, 0, 0, 0);
exit when I > Template'Last;
when '\' =>
Info(K).Num_Esc := Info(K).Num_Esc + 1;
I := I + 1;
Info(K).End_At := I;
exit when I > Template'Last;
I := I + 1;
Info(K).Length := Info(K).Length + 1;
Info(K).End_At := I;
exit when I > Template'Last;
when others =>
I := I + 1;
Info(K).Length := Info(K).Length + 1;
Info(K).End_At := I;
exit when I > Template'Last;
end case;
end loop;
return Info;
end Compute_Piece_Infos;
function Get_Edit_Begin_Pos (Source : String) return Natural
is
begin
for I in Source'Range loop
if Source(I) = ':' then
return I + 1;
end if;
end loop;
return Source'Last + 1;
end Get_Edit_Begin_Pos;
function Format (
Template : String;
Values : Arguments := FAB)
return String
is
PS : Piece_Infos := Compute_Piece_Infos(Template, Values);
R : String(1 .. Total_Length(PS));
I : Positive := R'First;
begin
for P of PS loop
if P.Length > 0 then
declare
RP : String renames R(I .. I + P.Length - 1);
TS : String renames Template(P.Begin_At .. P.End_At - 1);
PB, PE : Natural;
RF, RL : Natural;
Ch : Character;
begin
if P.Arg_Id /= 0 then
declare
Arg : constant Argument_Ptr := Values(P.Arg_Id);
begin
Arg.Put(TS(Get_Edit_Begin_Pos(TS) .. TS'Last - 1), RP);
end;
else
if P.Num_Esc = 0 then
RP := TS;
else
PB := P.Begin_At;
RF := RP'First;
while P.Num_Esc > 0 loop
PE := PB;
-- find next esc pos
while PE < P.End_At loop
exit when Template(PE) = '\';
PE := PE + 1;
end loop;
RL := PE - PB;
if RL > 0 then
-- copy non esc part
RP(RF .. RF + RL - 1) := Template(PB .. PE - 1);
end if;
PB := PE + 1;
RF := RF + RL;
if PB < P.End_At then
-- copy esc char
Ch := Template(PB);
case Ch is
when 'n' =>
RP(RF) := ASCII.LF;
when 't' =>
RP(RF) := ASCII.HT;
when 'r' =>
RP(RF) := ASCII.CR;
when others =>
RP(RF) := Ch;
end case;
RF := RF + 1;
PB := PB + 1;
end if;
P.Num_Esc := P.Num_Esc - 1;
end loop;
-- final part
if RF <= RP'Last then
RP(RF .. RP'Last) := Template(PB .. P.End_At - 1);
end if;
end if;
end if;
end;
I := I + P.Length;
end if;
end loop;
-- TODO
-- finalize values here?
return R;
end Format;
function Format (
Template : String;
Value : Argument_Type'Class)
return String
is
Values : constant Arguments := [To_Ptr(Value'Address)];
begin
return Format(Template, Values);
end Format;
function Generic_Format (
Template : String;
Value : Value_Type)
return String
is
begin
return Format(Template, To_Argument(Value));
end Generic_Format;
procedure Parse_KV_Edit (
Edit : String;
Conf : not null access procedure(K : String; V : String))
is
ET : constant Positive := Edit'Last + 1;
KB, KE : Positive;
VB, VE : Positive;
begin
KB := Edit'First;
while KB < ET loop
KE := KB;
while KE < ET loop
exit when Edit(KE) = '=';
KE := KE + 1;
end loop;
VB := KE + 1;
VE := VB;
while VE < ET loop
exit when Edit(VE) = ',';
VE := VE + 1;
end loop;
if KE > KB then
Conf(Edit(KB .. KE - 1), Edit(VB .. VE - 1));
end if;
KB := VE + 1;
end loop;
end Parse_KV_Edit;
overriding
procedure Parse (
Self : in out Placeholder_Argument_Type;
Edit : String)
is
subtype Virtual is Placeholder_Argument_Type'Class;
T : constant Natural := Edit'Last;
I : Natural := Edit'First;
W : Natural := 0;
begin
if Edit'Length > 0 then
while I < T loop
if Edit(I) = '%' and then Virtual(Self).Is_Valid_Placeholder(Edit(I + 1)) then
I := I + 1;
W := W + Virtual(Self).Get_Placeholder_Width(Edit(I));
else
W := W + 1;
end if;
I := I + 1;
end loop;
Self.Length := W;
elsif Self.Default_Edit /= null and then Self.Default_Edit'Length > 0 then
Self.Parse(Self.Default_Edit.all);
end if;
end Parse;
overriding
function Get_Length (
Self : in out Placeholder_Argument_Type)
return Natural
is
begin
return Self.Length;
end Get_Length;
overriding
procedure Put (
Self : in out Placeholder_Argument_Type;
Edit : String;
To : in out String)
is
subtype Virtual is Placeholder_Argument_Type'Class;
T : constant Natural := Edit'Last;
EB, EE : Natural; -- edit piece range
TB, TE : Natural; -- to piece range
Name : Character;
begin
if Edit'Length > 0 then
EB := Edit'First;
EE := EB;
TB := To'First;
TE := TB;
while EE < T loop
if Edit(EE) = '%' and then Virtual(Self).Is_Valid_Placeholder(Edit(EE + 1)) then
-- output non placeholder
To(TB .. TE - 1) := Edit(EB .. EE - 1);
-- output placeholder
Name := Edit(EE + 1);
TB := TE;
TE := TB + Virtual(Self).Get_Placeholder_Width(Name);
Virtual(Self).Put_Placeholder(Name, To(TB .. TE - 1));
-- next piece
EB := EE + 2;
EE := EB;
TB := TE;
TE := TB;
else
EE := EE + 1;
TE := TE + 1;
end if;
end loop;
if EB <= Edit'Last then
To(TB .. To'Last) := Edit(EB .. Edit'Last);
end if;
elsif Self.Default_Edit /= null and then Self.Default_Edit'Length > 0 then
Self.Put(Virtual(Self).Default_Edit.all, To);
end if;
end Put;
function Is_Decimal_Number (S : String) return Boolean
is
begin
return S'Length > 0 and then (for all Ch of S => Ch in Decimal_Digit);
end Is_Decimal_Number;
function Safe_Abs (X : Long_Long_Integer) return Interfaces.Unsigned_64
is
use Interfaces;
function Cast is
new Ada.Unchecked_Conversion(Long_Long_Integer, Unsigned_64);
V : constant Unsigned_64 := Cast(X);
begin
return (if X < 0 then not V + 1 else V);
end Safe_Abs;
end Fmt;
|
oeis/051/A051408.asm | neoneye/loda-programs | 11 | 10428 | <filename>oeis/051/A051408.asm<gh_stars>10-100
; A051408: a(n+1) = a(n) + sum of digits of (a(n)^3).
; Submitted by <NAME>
; 3,12,30,39,66,102,120,138,165,192,237,255,291,318,345,372,417,444,489,525,552,597,633,669,714,759,804,849,885,921,966,1011,1038,1083,1128,1164,1218,1254,1299,1353,1407,1452,1488,1533,1578,1623,1668,1713,1758,1785,1830,1866,1929,1992,2046,2100,2118,2154,2217,2262,2316,2361,2406,2460,2505,2559,2622,2676,2730,2757,2802,2856,2901,2937,2982,3027,3081,3126,3180,3207,3252,3297,3351,3396,3441,3477,3513,3567,3621,3666,3720,3765,3810,3837,3891,3954,4008,4062,4107,4152
mov $2,$0
add $2,2
mov $3,$0
lpb $3
mov $0,$2
sub $2,1
sub $3,1
sub $0,$3
pow $0,3
seq $0,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
add $2,$0
lpe
mov $0,$2
add $0,1
|
include/sf-network-types.ads | danva994/ASFML-1.6 | 1 | 2262 | <filename>include/sf-network-types.ads
-- ////////////////////////////////////////////////////////////
-- //
-- // SFML - Simple and Fast Multimedia Library
-- // Copyright (C) 2007-2009 <NAME> (<EMAIL>)
-- //
-- // This software is provided 'as-is', without any express or implied warranty.
-- // In no event will the authors be held liable for any damages arising from the use of this software.
-- //
-- // Permission is granted to anyone to use this software for any purpose,
-- // including commercial applications, and to alter it and redistribute it freely,
-- // subject to the following restrictions:
-- //
-- // 1. The origin of this software must not be misrepresented;
-- // you must not claim that you wrote the original software.
-- // If you use this software in a product, an acknowledgment
-- // in the product documentation would be appreciated but is not required.
-- //
-- // 2. Altered source versions must be plainly marked as such,
-- // and must not be misrepresented as being the original software.
-- //
-- // 3. This notice may not be removed or altered from any source distribution.
-- //
-- ////////////////////////////////////////////////////////////
package Sf.Network.Types is
type sfFtpDirectoryResponse is null record;
type sfFtpDirectoryResponse_Ptr is access all sfFtpDirectoryResponse;
type sfFtpListingResponse is null record;
type sfFtpListingResponse_Ptr is access all sfFtpListingResponse;
type sfFtpResponse is null record;
type sfFtpResponse_Ptr is access all sfFtpResponse;
type sfFtp is null record;
type sfFtp_Ptr is access all sfFtp;
type sfHttpRequest is null record;
type sfHttpRequest_Ptr is access all sfHttpRequest;
type sfHttpResponse is null record;
type sfHttpResponse_Ptr is access all sfHttpResponse;
type sfHttp is null record;
type sfHttp_Ptr is access all sfHttp;
type sfPacket is null record;
type sfPacket_Ptr is access all sfPacket;
type sfSelectorTCP is null record;
type sfSelectorTCP_Ptr is access all sfSelectorTCP;
type sfSelectorUDP is null record;
type sfSelectorUDP_Ptr is access all sfSelectorUDP;
type sfSocketTCP is null record;
type sfSocketTCP_Ptr is access all sfSocketTCP;
type sfSocketUDP is null record;
type sfSocketUDP_Ptr is access all sfSocketUDP;
private
pragma Convention (C, sfFtpDirectoryResponse);
pragma Convention (C, sfFtpDirectoryResponse_Ptr);
pragma Convention (C, sfFtpListingResponse);
pragma Convention (C, sfFtpListingResponse_Ptr);
pragma Convention (C, sfFtpResponse);
pragma Convention (C, sfFtpResponse_Ptr);
pragma Convention (C, sfFtp);
pragma Convention (C, sfFtp_Ptr);
pragma Convention (C, sfHttpRequest);
pragma Convention (C, sfHttpRequest_Ptr);
pragma Convention (C, sfHttpResponse);
pragma Convention (C, sfHttpResponse_Ptr);
pragma Convention (C, sfHttp);
pragma Convention (C, sfHttp_Ptr);
pragma Convention (C, sfPacket);
pragma Convention (C, sfPacket_Ptr);
pragma Convention (C, sfSelectorTCP);
pragma Convention (C, sfSelectorTCP_Ptr);
pragma Convention (C, sfSelectorUDP);
pragma Convention (C, sfSelectorUDP_Ptr);
pragma Convention (C, sfSocketTCP);
pragma Convention (C, sfSocketTCP_Ptr);
pragma Convention (C, sfSocketUDP);
pragma Convention (C, sfSocketUDP_Ptr);
end Sf.Network.Types;
|
programs/oeis/266/A266155.asm | neoneye/loda | 22 | 23095 | <filename>programs/oeis/266/A266155.asm
; A266155: Triangle read by rows giving successive states of cellular automaton generated by "Rule 19" initiated with a single ON (black) cell.
; 1,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
mov $14,$0
mov $26,$0
cmp $26,0
add $14,$26
lpb $0
mod $0,2
mov $8,2
add $10,2
mul $10,3
pow $14,2
sub $10,$14
sub $8,$10
sub $0,$8
lpe
trn $1,60
lpb $12,8
cmp $1,0
add $14,$15
trn $14,3
sub $15,2
lpe
mov $0,$1
|
oeis/268/A268682.asm | neoneye/loda-programs | 11 | 24792 | ; A268682: Decimal expansion of 1 - 1/sqrt(2).
; Submitted by <NAME>
; 2,9,2,8,9,3,2,1,8,8,1,3,4,5,2,4,7,5,5,9,9,1,5,5,6,3,7,8,9,5,1,5,0,9,6,0,7,1,5,1,6,4,0,6,2,3,1,1,5,2,5,9,6,3,4,1,1,6,6,0,1,3,1,0,0,4,6,3,3,7,6,0,7,6,8,9,4,6,4,8,0,5,7,4,8,0,6,2,3,2,8,3,6,1,7,9,2,1,3,6
seq $0,10503 ; Decimal expansion of 1/sqrt(2).
sub $2,$0
mov $0,$2
add $0,9
|
libsrc/target/zx-common/graphics/w_stencil_render.asm | ahjelm/z88dk | 640 | 173378 | ;
; z88dk GFX library
;
; Render the "stencil".
; The dithered horizontal lines base their pattern on the Y coordinate
; and on an 'intensity' parameter (0..11).
; Basic concept by <NAME>
;
; Machine code version by <NAME>, 22/4/2009
;
; stencil_render(unsigned char *stencil, unsigned char intensity)
;
INCLUDE "graphics/grafix.inc"
SECTION code_graphics
PUBLIC stencil_render
PUBLIC _stencil_render
EXTERN dither_pattern
EXTERN w_pixeladdress
EXTERN leftbitmask, rightbitmask
EXTERN __zx_screenmode
EXTERN __zx_console_attr
IF FORsam
; This code won't work on the same due to the lack of correct paging
; but it is assembled as part of zx-common
EXTERN SCREEN_BASE
ENDIF
;
; $Id: w_stencil_render.asm,v 1.6 2016-07-14 17:44:17 pauloscustodio Exp $
;
.stencil_exit
pop ix
ret
.stencil_render
._stencil_render
push ix
ld ix,4
add ix,sp
;call swapgfxbk
ld bc,maxy
push bc
.yloop
pop bc
dec bc
ld a,b
and c
cp 255
jr z,stencil_exit
push bc
ld d,b
ld e,c
ld l,(ix+2) ; stencil
ld h,(ix+3)
add hl,bc
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
dec hl
ld a,d ; check left side for current Y position..
and e
cp 127
jr z,yloop ; ...loop if nothing to be drawn
ld bc,maxy*2
add hl,bc
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
pop bc
push bc
push hl
ld a,(ix+0) ; intensity
push de ; X1
call dither_pattern
pop hl ; X1
ld (pattern1+1),a
ld (pattern2+1),a
push bc
ld d,b
ld e,c
call w_pixeladdress ; bitpos0 = pixeladdress(x,y)
call leftbitmask ; LeftBitMask(bitpos0)
pop bc
ld h,d
ld l,e
call mask_pattern
ex (sp),hl ; X2 <-> adr0
push af ; mask
ld d,b
ld e,c
push bc
call w_pixeladdress ; bitpos1 = pixeladdress(x+width-1,y)
call rightbitmask ; RightBitMask(bitpos1)
pop bc
ld (bitmaskr+1),a ; bitmask1 = LeftBitMask(bitpos0)
pop af ; pattern to be drawn (left-masked)
pop hl ; adr0
ld b,a
ld a,h
cp d
jr nz,noobt
ld a,l
cp e
jr z,onebyte
.noobt
ld a,b
ld (hl),a ; (offset) = (offset) AND bitmask0
call nextcol
ld a,h
cp d
jr nz,pattern2
ld a,l
cp e
.pattern2
ld a,0
jr z,bitmaskr
ld b,a
.fill_row_loop ; do
ld a,b
ld (hl),a ; (offset) = pattern
call nextcol
ld a,h
cp d
jr nz,fill_row_loop
ld a,l
cp e
jr nz,fill_row_loop ; while ( r-- != 0 )
.bitmaskr
ld a,0
call mask_pattern
ld (hl),a
call nextcol
jp yloop
.onebyte
ld a,b
ld (pattern1+1),a
jr bitmaskr
; Prepare an edge byte, basing on the byte mask in A
; and on the pattern being set in (pattern1+1)
.mask_pattern
push de
ld d,a ; keep a copy of mask
and (hl) ; mask data on screen
ld e,a ; save masked data
ld a,d ; retrieve mask
cpl ; invert it
.pattern1
and 0 ; prepare fill pattern portion
or e ; mix with masked data
pop de
ret
; Colour the pixel we were just on and step to the next column
nextcol:
ld a,(__zx_screenmode)
cp 6
jr z,nextcol_hires ;No colour in hires
cp 2 ;High colour
jr nz,standard_modes
set 5,h
ld a,(__zx_console_attr)
ld (hl),a
res 5,h
inc hl
ret
standard_modes:
; We are on a standard zx screen
push hl
ld a,h
and @00100000
ld c,a ;Save page flag
ld a,h
rrca
rrca
rrca
and 3
IF FORsam
or +(SCREEN_BASE / 256) + 24
ELSE
or 88
ENDIF
IF FORts2068|zxn
or c ;Add in screen 1 bit
ENDIF
ld h,a
ld a,(__zx_console_attr)
ld (hl),a
; And increment the column
pop hl
inc hl
ret
nextcol_hires:
ld a,h
xor @00100000
cp h
ld h,a
ret nc
inc hl
ret
|
src/Categories/Category/Construction/SetoidDiscrete.agda | Trebor-Huang/agda-categories | 279 | 14296 | <filename>src/Categories/Category/Construction/SetoidDiscrete.agda
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Construction.SetoidDiscrete where
open import Data.Unit using (⊤; tt)
open import Function using (flip)
open import Level using (Lift; lift)
open import Relation.Binary using (Setoid; IsEquivalence)
open import Categories.Category.Core using (Category)
open import Categories.Category.Discrete using (DiscreteCategory)
open import Categories.Morphism using (_≅_; ≅-isEquivalence)
{-
This is a better version of Discrete, which is more in line with
the rest of this library, and makes a Category out of a Setoid.
It is still 'wrong' as the equivalence is completely uninformative.
-}
Discrete : ∀ {o ℓ e} (A : Setoid o ℓ) → DiscreteCategory o ℓ e
Discrete {o} {ℓ} {e} A = record
{ category = C
; isDiscrete = record
{ isGroupoid = record { _⁻¹ = sym }
}
}
where
open Setoid A
C : Category o ℓ e
C = record
{ Obj = Carrier
; _⇒_ = _≈_
; _≈_ = λ _ _ → Lift e ⊤
; id = Setoid.refl A
; _∘_ = flip trans
}
|
oeis/025/A025873.asm | neoneye/loda-programs | 11 | 100252 | <filename>oeis/025/A025873.asm<gh_stars>10-100
; A025873: Expansion of 1/((1-x^4)(1-x^8)(1-x^11)).
; Submitted by <NAME>(s2)
; 1,0,0,0,1,0,0,0,2,0,0,1,2,0,0,1,3,0,0,2,3,0,1,2,4,0,1,3,4,0,2,3,5,1,2,4,5,1,3,4,6,2,3,5,7,2,4,5,8,3,4,6,9,3,5,7,10,4,5,8,11,4,6,9,12,5,7,10,13,5,8,11,14,6,9,12,15
mov $2,$0
mov $4,2
lpb $4
mov $0,$2
sub $4,1
add $0,$4
trn $0,1
seq $0,29079 ; Expansion of 1/((1-x)(1-x^4)(1-x^8)(1-x^11)).
mov $3,$4
mul $3,$0
add $5,$3
lpe
min $2,1
mul $2,$0
mov $0,$5
sub $0,$2
|
text/varDump.applescript | adriannier/applescript-functions | 7 | 832 | (*
Returns the textual representation of a variable.
*)
log varDump({1, 2, 3})
log varDump({a:1, b:1, c:1})
log varDump(date "Wednesday, October 21, 2015 at 12:00:00 AM")
log varDump(path to home folder)
log varDump(0.3)
log varDump(true)
on varDump(var)
try
if class of var is list then
item 0 of var
else
return var as text
end if
on error e
if class of var is list then
return text (offset of "{" in e) thru -2 of e
else if class of var is record then
return text (offset of "{" in e) thru -17 of e
end if
return missing value
end try
end varDump
|
x265/source/common/x86/pixel-32.asm | xu5343/ffmpegtoolkit_CentOS7 | 14 | 3948 | <reponame>xu5343/ffmpegtoolkit_CentOS7
;*****************************************************************************
;* pixel-32.asm: x86_32 pixel metrics
;*****************************************************************************
;* Copyright (C) 2003-2013 x264 project
;* Copyright (C) 2013-2017 MulticoreWare, Inc
;*
;* Authors: <NAME> <<EMAIL>>
;* <NAME> <<EMAIL>>
;*
;* This program is free software; you can redistribute it and/or modify
;* it under the terms of the GNU General Public License as published by
;* the Free Software Foundation; either version 2 of the License, or
;* (at your option) any later version.
;*
;* This program is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;* GNU General Public License for more details.
;*
;* You should have received a copy of the GNU General Public License
;* along with this program; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
;*
;* This program is also available under a commercial proprietary license.
;* For more information, contact us at <EMAIL>.
;*****************************************************************************
%include "x86inc.asm"
%include "x86util.asm"
cextern pw_ppmmppmm
cextern pw_pmpmpmpm
SECTION .text
INIT_MMX mmx2
%macro LOAD_DIFF_4x8P 1 ; dx
LOAD_DIFF m0, m7, none, [r0+%1], [r2+%1]
LOAD_DIFF m1, m6, none, [r0+%1+r1], [r2+%1+r3]
LOAD_DIFF m2, m7, none, [r0+%1+r1*2], [r2+%1+r3*2]
LOAD_DIFF m3, m6, none, [r0+%1+r4], [r2+%1+r5]
lea r0, [r0+4*r1]
lea r2, [r2+4*r3]
LOAD_DIFF m4, m7, none, [r0+%1], [r2+%1]
LOAD_DIFF m5, m6, none, [r0+%1+r1], [r2+%1+r3]
LOAD_DIFF m6, m7, none, [r0+%1+r1*2], [r2+%1+r3*2]
movq [spill], m5
LOAD_DIFF m7, m5, none, [r0+%1+r4], [r2+%1+r5]
movq m5, [spill]
%endmacro
%macro SUM4x8_MM 0
movq [spill], m6
movq [spill+8], m7
ABSW2 m0, m1, m0, m1, m6, m7
ABSW2 m2, m3, m2, m3, m6, m7
paddw m0, m2
paddw m1, m3
movq m6, [spill]
movq m7, [spill+8]
ABSW2 m4, m5, m4, m5, m2, m3
ABSW2 m6, m7, m6, m7, m2, m3
paddw m4, m6
paddw m5, m7
paddw m0, m4
paddw m1, m5
paddw m0, m1
%endmacro
;-----------------------------------------------------------------------------
; int pixel_sa8d_8x8( uint8_t *, intptr_t, uint8_t *, intptr_t )
;-----------------------------------------------------------------------------
cglobal pixel_sa8d_8x8_internal
push r0
push r2
sub esp, 0x74
%define args esp+0x74
%define spill esp+0x60 ; +16
%define trans esp+0 ; +96
LOAD_DIFF_4x8P 0
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movq [spill], m1
TRANSPOSE4x4W 4, 5, 6, 7, 1
movq [trans+0x00], m4
movq [trans+0x08], m5
movq [trans+0x10], m6
movq [trans+0x18], m7
movq m1, [spill]
TRANSPOSE4x4W 0, 1, 2, 3, 4
movq [trans+0x20], m0
movq [trans+0x28], m1
movq [trans+0x30], m2
movq [trans+0x38], m3
mov r0, [args+4]
mov r2, [args]
LOAD_DIFF_4x8P 4
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movq [spill], m7
TRANSPOSE4x4W 0, 1, 2, 3, 7
movq [trans+0x40], m0
movq [trans+0x48], m1
movq [trans+0x50], m2
movq [trans+0x58], m3
movq m7, [spill]
TRANSPOSE4x4W 4, 5, 6, 7, 1
movq m0, [trans+0x00]
movq m1, [trans+0x08]
movq m2, [trans+0x10]
movq m3, [trans+0x18]
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
SUM4x8_MM
movq [trans], m0
movq m0, [trans+0x20]
movq m1, [trans+0x28]
movq m2, [trans+0x30]
movq m3, [trans+0x38]
movq m4, [trans+0x40]
movq m5, [trans+0x48]
movq m6, [trans+0x50]
movq m7, [trans+0x58]
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
SUM4x8_MM
pavgw m0, [trans]
add esp, 0x7c
ret
%undef args
%undef spill
%undef trans
%macro SUM_MM_X3 8 ; 3x sum, 4x tmp, op
pxor %7, %7
pshufw %4, %1, q1032
pshufw %5, %2, q1032
pshufw %6, %3, q1032
paddusw %1, %4
paddusw %2, %5
paddusw %3, %6
punpcklwd %1, %7
punpcklwd %2, %7
punpcklwd %3, %7
pshufw %4, %1, q1032
pshufw %5, %2, q1032
pshufw %6, %3, q1032
%8 %1, %4
%8 %2, %5
%8 %3, %6
%endmacro
%macro LOAD_4x8P 1 ; dx
pxor m7, m7
movd m6, [r0+%1+7*FENC_STRIDE]
movd m0, [r0+%1+0*FENC_STRIDE]
movd m1, [r0+%1+1*FENC_STRIDE]
movd m2, [r0+%1+2*FENC_STRIDE]
movd m3, [r0+%1+3*FENC_STRIDE]
movd m4, [r0+%1+4*FENC_STRIDE]
movd m5, [r0+%1+5*FENC_STRIDE]
punpcklbw m6, m7
punpcklbw m0, m7
punpcklbw m1, m7
movq [spill], m6
punpcklbw m2, m7
punpcklbw m3, m7
movd m6, [r0+%1+6*FENC_STRIDE]
punpcklbw m4, m7
punpcklbw m5, m7
punpcklbw m6, m7
movq m7, [spill]
%endmacro
%macro HSUMSUB2 4
pshufw m4, %1, %3
pshufw m5, %2, %3
pmullw %1, %4
pmullw m5, %4
paddw %1, m4
paddw %2, m5
%endmacro
;-----------------------------------------------------------------------------
; void intra_sa8d_x3_8x8( uint8_t *fenc, uint8_t edge[36], int *res )
;-----------------------------------------------------------------------------
cglobal intra_sa8d_x3_8x8, 2,3
SUB esp, 0x94
%define edge esp+0x70 ; +32
%define spill esp+0x60 ; +16
%define trans esp+0 ; +96
%define sum esp+0 ; +32
pxor m7, m7
movq m0, [r1+7]
movq m2, [r1+16]
movq m1, m0
movq m3, m2
punpcklbw m0, m7
punpckhbw m1, m7
punpcklbw m2, m7
punpckhbw m3, m7
movq m6, [pw_ppmmppmm]
HSUMSUB2 m0, m2, q1032, m6
HSUMSUB2 m1, m3, q1032, m6
movq m6, [pw_pmpmpmpm]
HSUMSUB2 m0, m2, q2301, m6
HSUMSUB2 m1, m3, q2301, m6
movq m4, m0
movq m5, m2
paddw m0, m1
paddw m2, m3
psubw m4, m1
psubw m3, m5
movq [edge+0], m0
movq [edge+8], m4
movq [edge+16], m2
movq [edge+24], m3
LOAD_4x8P 0
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movq [spill], m0
TRANSPOSE4x4W 4, 5, 6, 7, 0
movq [trans+0x00], m4
movq [trans+0x08], m5
movq [trans+0x10], m6
movq [trans+0x18], m7
movq m0, [spill]
TRANSPOSE4x4W 0, 1, 2, 3, 4
movq [trans+0x20], m0
movq [trans+0x28], m1
movq [trans+0x30], m2
movq [trans+0x38], m3
LOAD_4x8P 4
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movq [spill], m7
TRANSPOSE4x4W 0, 1, 2, 3, 7
movq [trans+0x40], m0
movq [trans+0x48], m1
movq [trans+0x50], m2
movq [trans+0x58], m3
movq m7, [spill]
TRANSPOSE4x4W 4, 5, 6, 7, 0
movq m0, [trans+0x00]
movq m1, [trans+0x08]
movq m2, [trans+0x10]
movq m3, [trans+0x18]
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movq [spill+0], m0
movq [spill+8], m1
ABSW2 m2, m3, m2, m3, m0, m1
ABSW2 m4, m5, m4, m5, m0, m1
paddw m2, m4
paddw m3, m5
ABSW2 m6, m7, m6, m7, m4, m5
movq m0, [spill+0]
movq m1, [spill+8]
paddw m2, m6
paddw m3, m7
paddw m2, m3
ABSW m1, m1, m4
paddw m2, m1 ; 7x4 sum
movq m7, m0
movq m1, [edge+8] ; left bottom
psllw m1, 3
psubw m7, m1
ABSW2 m0, m7, m0, m7, m5, m3
paddw m0, m2
paddw m7, m2
movq [sum+0], m0 ; dc
movq [sum+8], m7 ; left
movq m0, [trans+0x20]
movq m1, [trans+0x28]
movq m2, [trans+0x30]
movq m3, [trans+0x38]
movq m4, [trans+0x40]
movq m5, [trans+0x48]
movq m6, [trans+0x50]
movq m7, [trans+0x58]
HADAMARD8_V 0, 1, 2, 3, 4, 5, 6, 7
movd [sum+0x10], m0
movd [sum+0x12], m1
movd [sum+0x14], m2
movd [sum+0x16], m3
movd [sum+0x18], m4
movd [sum+0x1a], m5
movd [sum+0x1c], m6
movd [sum+0x1e], m7
movq [spill], m0
movq [spill+8], m1
ABSW2 m2, m3, m2, m3, m0, m1
ABSW2 m4, m5, m4, m5, m0, m1
paddw m2, m4
paddw m3, m5
paddw m2, m3
movq m0, [spill]
movq m1, [spill+8]
ABSW2 m6, m7, m6, m7, m4, m5
ABSW m1, m1, m3
paddw m2, m7
paddw m1, m6
paddw m2, m1 ; 7x4 sum
movq m1, m0
movq m7, [edge+0]
psllw m7, 3 ; left top
mov r2, [edge+0]
add r2, [edge+16]
lea r2, [4*r2+32]
and r2, 0xffc0
movd m6, r2 ; dc
psubw m1, m7
psubw m0, m6
ABSW2 m0, m1, m0, m1, m5, m6
movq m3, [sum+0] ; dc
paddw m0, m2
paddw m1, m2
movq m2, m0
paddw m0, m3
paddw m1, [sum+8] ; h
psrlq m2, 16
paddw m2, m3
movq m3, [edge+16] ; top left
movq m4, [edge+24] ; top right
psllw m3, 3
psllw m4, 3
psubw m3, [sum+16]
psubw m4, [sum+24]
ABSW2 m3, m4, m3, m4, m5, m6
paddw m2, m3
paddw m2, m4 ; v
SUM_MM_X3 m0, m1, m2, m3, m4, m5, m6, pavgw
mov r2, r2m
pxor m7, m7
punpckldq m2, m1
pavgw m0, m7
pavgw m2, m7
movd [r2+8], m0 ; dc
movq [r2+0], m2 ; v, h
ADD esp, 0x94
RET
%undef edge
%undef spill
%undef trans
%undef sum
;-----------------------------------------------------------------------------
; void pixel_ssim_4x4x2_core( const uint8_t *pix1, intptr_t stride1,
; const uint8_t *pix2, intptr_t stride2, int sums[2][4] )
;-----------------------------------------------------------------------------
cglobal pixel_ssim_4x4x2_core, 0,5
mov r1, r1m
mov r3, r3m
mov r4, 4
pxor m0, m0
.loop:
mov r0, r0m
mov r2, r2m
add r0, r4
add r2, r4
pxor m1, m1
pxor m2, m2
pxor m3, m3
pxor m4, m4
%rep 4
movd m5, [r0]
movd m6, [r2]
punpcklbw m5, m0
punpcklbw m6, m0
paddw m1, m5
paddw m2, m6
movq m7, m5
pmaddwd m5, m5
pmaddwd m7, m6
pmaddwd m6, m6
paddd m3, m5
paddd m4, m7
paddd m3, m6
add r0, r1
add r2, r3
%endrep
mov r0, r4m
lea r0, [r0+r4*4]
pshufw m5, m1, q0032
pshufw m6, m2, q0032
paddusw m1, m5
paddusw m2, m6
punpcklwd m1, m2
pshufw m2, m1, q0032
pshufw m5, m3, q0032
pshufw m6, m4, q0032
paddusw m1, m2
paddd m3, m5
paddd m4, m6
punpcklwd m1, m0
punpckldq m3, m4
movq [r0+0], m1
movq [r0+8], m3
sub r4, 4
jge .loop
emms
RET
|
programs/oeis/206/A206544.asm | jmorken/loda | 1 | 240492 | <gh_stars>1-10
; A206544: Period 12: repeat 1, 3, 5, 7, 9, 11, 11, 9, 7, 5, 3, 1.
; 1,3,5,7,9,11,11,9,7,5,3,1,1,3,5,7,9,11,11,9,7,5,3,1,1,3,5,7,9,11,11,9,7,5,3,1,1,3,5,7,9,11,11,9,7,5,3,1,1,3,5,7,9,11,11,9,7,5,3,1,1,3,5,7,9,11,11,9,7,5,3,1
mov $1,$0
lpb $0
sub $0,1
trn $0,4
add $1,2
add $1,$2
sub $1,$0
trn $0,1
add $2,2
add $2,$0
trn $0,6
trn $1,$2
add $1,$0
lpe
mul $1,2
add $1,1
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1329.asm | ljhsiun2/medusa | 9 | 88670 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xdef1, %rsi
lea addresses_WC_ht+0x4aaa, %rdi
clflush (%rsi)
nop
nop
nop
nop
xor %r12, %r12
mov $38, %rcx
rep movsb
nop
lfence
lea addresses_A_ht+0xddd5, %r14
clflush (%r14)
nop
inc %rbx
and $0xffffffffffffffc0, %r14
vmovaps (%r14), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rcx
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0x88d, %rbx
nop
nop
nop
xor %r13, %r13
mov (%rbx), %edi
nop
nop
nop
inc %rbx
lea addresses_normal_ht+0x144f1, %rdi
nop
nop
nop
nop
nop
cmp $44329, %rcx
movb $0x61, (%rdi)
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WT_ht+0x10a9, %r14
nop
nop
nop
nop
cmp %r13, %r13
mov (%r14), %rdi
nop
dec %rsi
lea addresses_WC_ht+0x68f1, %r12
and $9118, %r14
mov (%r12), %edi
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_A_ht+0x1c93b, %rsi
lea addresses_WC_ht+0x9831, %rdi
nop
nop
nop
dec %r15
mov $123, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $18892, %r13
lea addresses_normal_ht+0x42f1, %rsi
lea addresses_WC_ht+0xfe81, %rdi
nop
nop
nop
and $34234, %r14
mov $36, %rcx
rep movsq
sub %r12, %r12
lea addresses_A_ht+0x2b1d, %rsi
lea addresses_A_ht+0x1ed91, %rdi
nop
dec %r12
mov $117, %rcx
rep movsb
nop
sub %r12, %r12
lea addresses_normal_ht+0xb951, %rcx
nop
nop
nop
cmp %r15, %r15
mov $0x6162636465666768, %rdi
movq %rdi, (%rcx)
nop
nop
nop
nop
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbp
push %rbx
push %rcx
push %rdx
// Store
mov $0x6f1, %rbx
nop
nop
nop
sub $20736, %r10
movl $0x51525354, (%rbx)
nop
sub %rbx, %rbx
// Store
lea addresses_A+0x90f1, %rdx
nop
xor %rax, %rax
mov $0x5152535455565758, %rbp
movq %rbp, (%rdx)
nop
nop
add %rcx, %rcx
// Store
lea addresses_US+0xc971, %rdx
nop
nop
nop
nop
and %rbx, %rbx
movb $0x51, (%rdx)
nop
nop
nop
dec %r10
// Store
lea addresses_RW+0x138f1, %r9
nop
nop
nop
nop
nop
cmp %rbp, %rbp
movw $0x5152, (%r9)
nop
nop
nop
and %rbp, %rbp
// Store
lea addresses_UC+0x18013, %rax
nop
nop
cmp %rdx, %rdx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm2
vmovups %ymm2, (%rax)
nop
nop
and %rdx, %rdx
// Store
lea addresses_PSE+0x8191, %rdx
clflush (%rdx)
nop
cmp $38520, %r10
mov $0x5152535455565758, %rcx
movq %rcx, %xmm7
vmovaps %ymm7, (%rdx)
nop
nop
nop
cmp $57538, %r9
// Store
lea addresses_RW+0x17231, %r10
nop
nop
nop
nop
nop
sub %rax, %rax
movb $0x51, (%r10)
nop
nop
nop
nop
cmp $15265, %rax
// Faulty Load
lea addresses_A+0x90f1, %rcx
nop
nop
nop
inc %rbp
movb (%rcx), %bl
lea oracles, %rbp
and $0xff, %rbx
shlq $12, %rbx
mov (%rbp,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_P', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_RW', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_PSE', 'AVXalign': True, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_RW', 'AVXalign': True, 'size': 1}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}}
{'src': {'same': True, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 8}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strrstrip.asm | jpoikela/z88dk | 640 | 104197 | <reponame>jpoikela/z88dk<filename>libsrc/_DEVELOPMENT/string/c/sdcc_iy/strrstrip.asm
; char *strrstrip(char *s)
SECTION code_clib
SECTION code_string
PUBLIC _strrstrip
EXTERN asm_strrstrip
_strrstrip:
pop af
pop hl
push hl
push af
jp asm_strrstrip
|
_anim/Yadrin.asm | kodishmediacenter/msu-md-sonic | 9 | 20043 | ; ---------------------------------------------------------------------------
; Animation script - Yadrin enemy
; ---------------------------------------------------------------------------
Ani_Yad: dc.w @stand-Ani_Yad
dc.w @walk-Ani_Yad
@stand: dc.b 7, 0, afEnd
even
@walk: dc.b 7, 0, 3, 1, 4, 0, 3, 2, 5, afEnd
even |
Task/Dot-product/AppleScript/dot-product-1.applescript | LaudateCorpus1/RosettaCodeData | 1 | 33 | -- DOT PRODUCT ---------------------------------------------------------------
-- dotProduct :: [Number] -> [Number] -> Number
on dotProduct(xs, ys)
script product
on |λ|(a, b)
a * b
end |λ|
end script
if length of xs = length of ys then
sum(zipWith(product, xs, ys))
else
missing value -- arrays of differing dimension
end if
end dotProduct
-- TEST ----------------------------------------------------------------------
on run
dotProduct([1, 3, -5], [4, -2, -1])
--> 3
end run
-- GENERIC FUNCTIONS ---------------------------------------------------------
-- foldl :: (a -> b -> a) -> a -> [b] -> a
on foldl(f, startValue, xs)
tell mReturn(f)
set v to startValue
set lng to length of xs
repeat with i from 1 to lng
set v to |λ|(v, item i of xs, i, xs)
end repeat
return v
end tell
end foldl
-- min :: Ord a => a -> a -> a
on min(x, y)
if y < x then
y
else
x
end if
end min
-- Lift 2nd class handler function into 1st class script wrapper
-- mReturn :: Handler -> Script
on mReturn(f)
if class of f is script then
f
else
script
property |λ| : f
end script
end if
end mReturn
-- sum :: [Number] -> Number
on sum(xs)
script add
on |λ|(a, b)
a + b
end |λ|
end script
foldl(add, 0, xs)
end sum
-- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
on zipWith(f, xs, ys)
set lng to min(length of xs, length of ys)
set lst to {}
tell mReturn(f)
repeat with i from 1 to lng
set end of lst to |λ|(item i of xs, item i of ys)
end repeat
return lst
end tell
end zipWith
|
src/keystore-marshallers.ads | thierr26/ada-keystore | 0 | 28914 | <gh_stars>0
-----------------------------------------------------------------------
-- keystore-marshallers -- Data marshaller for the keystore
-- Copyright (C) 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Streams;
with Ada.Calendar;
with Interfaces;
with Util.Encoders.AES;
with Keystore.Buffers;
private package Keystore.Marshallers is
use Ada.Streams;
BT_TYPE_HEADER_SIZE : constant := 16;
SIZE_U16 : constant := 2;
SIZE_U32 : constant := 4;
SIZE_U64 : constant := 8;
SIZE_DATE : constant := SIZE_U64;
SIZE_HMAC : constant := 32;
SIZE_KIND : constant := SIZE_U32;
SIZE_BLOCK : constant := SIZE_U32;
SIZE_SECRET : constant := 32;
SIZE_IV : constant := 16;
subtype Block_Count is Buffers.Block_Count;
subtype Block_Number is Buffers.Block_Number;
subtype Block_Index is Buffers.Block_Index;
subtype Buffer_Size is Buffers.Buffer_Size;
subtype Block_Type is Stream_Element_Array (Block_Index);
BT_HEADER_START : constant Block_Index := Block_Index'First;
BT_DATA_START : constant Block_Index := BT_HEADER_START + BT_TYPE_HEADER_SIZE;
type Marshaller is limited record
Buffer : Keystore.Buffers.Storage_Buffer;
Pos : Block_Index := Block_Type'First;
end record;
-- Set the block header with the tag and wallet identifier.
procedure Set_Header (Into : in out Marshaller;
Tag : in Interfaces.Unsigned_16;
Id : in Keystore.Wallet_Identifier) with
Post => Into.Pos = BT_DATA_START - 1;
procedure Set_Header (Into : in out Marshaller;
Value : in Interfaces.Unsigned_32) with
Pre => Into.Pos = Block_Type'First;
procedure Put_Unsigned_16 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_16) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Unsigned_32 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_32) with
Pre => Into.Pos <= Block_Type'Last - 4;
procedure Put_Unsigned_64 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_64) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Kind (Into : in out Marshaller;
Value : in Entry_Type) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Block_Number (Into : in out Marshaller;
Value : in Block_Number) with
Pre => Into.Pos <= Block_Type'Last - 4;
procedure Put_Block_Index (Into : in out Marshaller;
Value : in Block_Index) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Buffer_Size (Into : in out Marshaller;
Value : in Buffer_Size) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_String (Into : in out Marshaller;
Value : in String) with
Pre => Into.Pos <= Block_Type'Last - 4 - Value'Length;
procedure Put_Date (Into : in out Marshaller;
Value : in Ada.Calendar.Time) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Storage_Block (Into : in out Marshaller;
Value : in Buffers.Storage_Block) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Secret (Into : in out Marshaller;
Value : in Secret_Key;
Protect_Key : in Secret_Key;
Protect_IV : in Secret_Key) with
Pre => Into.Pos <= Block_Type'Last - Value.Length;
procedure Put_HMAC_SHA256 (Into : in out Marshaller;
Key : in Secret_Key;
Content : in Ada.Streams.Stream_Element_Array) with
Pre => Into.Pos <= Block_Type'Last - SIZE_HMAC;
procedure Put_UUID (Into : in out Marshaller;
Value : in UUID_Type) with
Pre => Into.Pos <= Block_Type'Last - 16;
function Get_Header (From : in out Marshaller) return Interfaces.Unsigned_32 with
Post => From.Pos = Block_Type'First + 3;
function Get_Header_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with
Post => From.Pos = Block_Type'First + 1;
function Get_Unsigned_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with
Pre => From.Pos <= Block_Type'Last - 2;
function Get_Unsigned_32 (From : in out Marshaller) return Interfaces.Unsigned_32 with
Pre => From.Pos <= Block_Type'Last - 4;
function Get_Unsigned_64 (From : in out Marshaller) return Interfaces.Unsigned_64 with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_String (From : in out Marshaller;
Length : in Natural) return String with
Pre => Stream_Element_Offset (Length) < Block_Type'Last and
From.Pos <= Block_Type'Length - Stream_Element_Offset (Length);
function Get_Date (From : in out Marshaller) return Ada.Calendar.Time with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_Kind (From : in out Marshaller) return Entry_Type with
Pre => From.Pos <= Block_Type'Last - 2;
function Get_Block_Number (From : in out Marshaller) return Block_Count is
(Block_Count (Get_Unsigned_32 (From)));
function Get_Storage_Block (From : in out Marshaller) return Buffers.Storage_Block with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_Block_Index (From : in out Marshaller) return Block_Index is
(Block_Index (Get_Unsigned_16 (From)));
function Get_Buffer_Size (From : in out Marshaller) return Buffer_Size is
(Buffer_Size (Get_Unsigned_16 (From)));
procedure Get_Secret (From : in out Marshaller;
Secret : out Secret_Key;
Protect_Key : in Secret_Key;
Protect_IV : in Secret_Key);
procedure Get_UUID (From : in out Marshaller;
UUID : out UUID_Type) with
Pre => From.Pos <= Block_Type'Last - 16;
procedure Get_Data (From : in out Marshaller;
Size : in Ada.Streams.Stream_Element_Offset;
Data : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) with
Pre => From.Pos <= Block_Type'Last - Size;
procedure Skip (From : in out Marshaller;
Count : in Block_Index) with
Pre => From.Pos <= Block_Type'Last - Count;
end Keystore.Marshallers;
|
src/bb_pico_bsp-spi.ads | Fabien-Chouteau/bb_pico_bsp | 0 | 14722 | <gh_stars>0
with System;
with HAL;
with HAL.SPI;
package BB_Pico_Bsp.SPI is
function Port return not null HAL.SPI.Any_SPI_Port;
procedure Go_Slow;
-- Set a slow baud rate for the STMPE811 touch controller
procedure Go_Fast;
-- Set a fast baud rate for the LCD pixel transfer
procedure DMA_Transmit (Addr : System.Address; Len : HAL.UInt32);
function DMA_Busy return Boolean;
end BB_Pico_Bsp.SPI;
|
oeis/289/A289156.asm | neoneye/loda-programs | 11 | 82916 | ; A289156: Largest area of triangles with integer sides and area = n times perimeter.
; 60,1224,8436,34320,103020,254040,546084,1060896,1907100,3224040,5185620,8004144,11934156,17276280,24381060,33652800,45553404,60606216,79399860,102592080,130913580,165171864,206255076,255135840,312875100,380625960,459637524,551258736,656942220,778248120,916847940,1074528384,1253195196,1454877000,1681729140,1936037520,2220222444,2536842456,2888598180,3278336160,3709052700,4183897704,4706178516,5279363760,5907087180,6593151480,7341532164,8156381376,9042031740,10003000200,11043991860,12169903824
mul $0,2
add $0,2
sub $2,$0
mul $0,$2
bin $0,3
div $0,$2
div $0,2
mul $0,12
|
data/battle_tower/parties.asm | genterz/pokecross | 28 | 171222 | BattleTowerMons:
; 10 groups of 21 mons.
BattleTowerMons1:
db JOLTEON
db MIRACLEBERRY
db THUNDERBOLT, HYPER_BEAM, SHADOW_BALL, ROAR
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 40000
bigdw 35000
bigdw 40000
dn 13, 13, 11, 13 ; DVs
db 15, 5, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 41 ; HP
bigdw 41 ; Max HP
bigdw 25 ; Atk
bigdw 24 ; Def
bigdw 37 ; Spd
bigdw 34 ; SAtk
bigdw 31 ; SDef
db "SANDA-SU@@@"
db ESPEON
db LEFTOVERS
db MUD_SLAP, PSYCHIC_M, PSYCH_UP, TOXIC
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 40000
bigdw 50000
bigdw 35000
bigdw 40000
bigdw 40000
dn 14, 13, 15, 11 ; DVs
db 10, 10, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 39 ; HP
bigdw 39 ; Max HP
bigdw 26 ; Atk
bigdw 24 ; Def
bigdw 35 ; Spd
bigdw 38 ; SAtk
bigdw 31 ; SDef
db "E-HUi@@@@@@"
db UMBREON
db GOLD_BERRY
db SHADOW_BALL, IRON_TAIL, PSYCH_UP, TOXIC
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 45000
bigdw 50000
bigdw 40000
dn 13, 11, 14, 15 ; DVs
db 15, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 46 ; HP
bigdw 46 ; Max HP
bigdw 25 ; Atk
bigdw 34 ; Def
bigdw 26 ; Spd
bigdw 25 ; SAtk
bigdw 39 ; SDef
db "BURAtuKI-@@"
db WOBBUFFET
db FOCUS_BAND
db COUNTER, MIRROR_COAT, SAFEGUARD, DESTINY_BOND
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 7, 15, 13, 7 ; DVs
db 20, 20, 25, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 66 ; HP
bigdw 66 ; Max HP
bigdw 18 ; Atk
bigdw 25 ; Def
bigdw 19 ; Spd
bigdw 18 ; SAtk
bigdw 23 ; SDef
db "SO-NANSU@@@"
db KANGASKHAN
db MIRACLEBERRY
db REVERSAL, HYPER_BEAM, EARTHQUAKE, ATTRACT
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 40000
bigdw 30000
bigdw 40000
bigdw 30000
bigdw 30000
dn 14, 15, 12, 15 ; DVs
db 15, 5, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 47 ; HP
bigdw 47 ; Max HP
bigdw 31 ; Atk
bigdw 29 ; Def
bigdw 29 ; Spd
bigdw 20 ; SAtk
bigdw 28 ; SDef
db "GARU-RA@@@@"
db CORSOLA
db SCOPE_LENS
db SURF, PSYCHIC_M, RECOVER, ANCIENTPOWER
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 40000
bigdw 30000
bigdw 33300
bigdw 30000
bigdw 30000
dn 15, 14, 15, 13 ; DVs
db 15, 10, 20, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 38 ; HP
bigdw 38 ; Max HP
bigdw 23 ; Atk
bigdw 29 ; Def
bigdw 19 ; Spd
bigdw 24 ; SAtk
bigdw 28 ; SDef
db "SANI-GO@@@@"
db MILTANK
db GOLD_BERRY
db BLIZZARD, EARTHQUAKE, HYPER_BEAM, TOXIC
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 35000
dn 11, 11, 13, 15 ; DVs
db 5, 10, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 46 ; HP
bigdw 46 ; Max HP
bigdw 27 ; Atk
bigdw 32 ; Def
bigdw 31 ; Spd
bigdw 20 ; SAtk
bigdw 26 ; SDef
db "MIRUTANKU@@"
db AERODACTYL
db LEFTOVERS
db HYPER_BEAM, SUPERSONIC, EARTHQUAKE, BITE
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 13, 11, 15, 11 ; DVs
db 5, 20, 10, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 43 ; HP
bigdw 43 ; Max HP
bigdw 32 ; Atk
bigdw 24 ; Def
bigdw 38 ; Spd
bigdw 23 ; SAtk
bigdw 26 ; SDef
db "PUTERA@@@@@"
db LAPRAS
db MIRACLEBERRY
db BLIZZARD, SURF, THUNDERBOLT, PSYCHIC_M
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 15, 13, 14, 11 ; DVs
db 5, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 52 ; HP
bigdw 52 ; Max HP
bigdw 29 ; Atk
bigdw 27 ; Def
bigdw 24 ; Spd
bigdw 28 ; SAtk
bigdw 30 ; SDef
db "RAPURASU@@@"
db SNEASEL
db GOLD_BERRY
db SLASH, FAINT_ATTACK, SURF, BLIZZARD
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 35000
bigdw 30000
bigdw 30000
bigdw 30000
dn 15, 11, 11, 15 ; DVs
db 20, 20, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 38 ; HP
bigdw 38 ; Max HP
bigdw 31 ; Atk
bigdw 22 ; Def
bigdw 34 ; Spd
bigdw 19 ; SAtk
bigdw 27 ; SDef
db "NIyu-RA@@@@"
db PORYGON2
db BRIGHTPOWDER
db PSYCHIC_M, BLIZZARD, HYPER_BEAM, TRI_ATTACK
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 40000
bigdw 30000
bigdw 30000
dn 15, 11, 13, 14 ; DVs
db 10, 5, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 44 ; HP
bigdw 44 ; Max HP
bigdw 28 ; Atk
bigdw 30 ; Def
bigdw 23 ; Spd
bigdw 33 ; SAtk
bigdw 31 ; SDef
db "PORIGON2@@@"
db MISDREAVUS
db FOCUS_BAND
db PERISH_SONG, MEAN_LOOK, PAIN_SPLIT, SHADOW_BALL
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 14, 15, 13, 15 ; DVs
db 5, 5, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 37 ; HP
bigdw 37 ; Max HP
bigdw 24 ; Atk
bigdw 24 ; Def
bigdw 28 ; Spd
bigdw 29 ; SAtk
bigdw 29 ; SDef
db "MUUMA@@@@@@"
db HOUNDOUR
db GOLD_BERRY
db FAINT_ATTACK, SOLARBEAM, ROAR, SUNNY_DAY
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 33000
bigdw 30000
dn 15, 13, 15, 14 ; DVs
db 20, 10, 20, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 36 ; HP
bigdw 36 ; Max HP
bigdw 24 ; Atk
bigdw 17 ; Def
bigdw 25 ; Spd
bigdw 28 ; SAtk
bigdw 22 ; SDef
db "DERUBIRU@@@"
db GIRAFARIG
db KINGS_ROCK
db PSYBEAM, MUD_SLAP, SHADOW_BALL, AGILITY
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 14, 13, 15, 13 ; DVs
db 20, 10, 15, 30 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 39 ; HP
bigdw 39 ; Max HP
bigdw 28 ; Atk
bigdw 24 ; Def
bigdw 29 ; Spd
bigdw 29 ; SAtk
bigdw 24 ; SDef
db "KIRINRIKI@@"
db BLISSEY
db QUICK_CLAW
db HEADBUTT, SOLARBEAM, ROLLOUT, STRENGTH
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 32000
bigdw 40000
bigdw 30000
bigdw 30000
bigdw 30000
dn 13, 15, 12, 14 ; DVs
db 15, 10, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 77 ; HP
bigdw 77 ; Max HP
bigdw 14 ; Atk
bigdw 14 ; Def
bigdw 22 ; Spd
bigdw 27 ; SAtk
bigdw 39 ; SDef
db "HAPINASU@@@"
db SNORLAX
db MIRACLEBERRY
db HEADBUTT, PROTECT, SNORE, SURF
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 14, 15, 15, 7 ; DVs
db 15, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 57 ; HP
bigdw 57 ; Max HP
bigdw 34 ; Atk
bigdw 25 ; Def
bigdw 18 ; Spd
bigdw 23 ; SAtk
bigdw 32 ; SDef
db "KABIGON@@@@"
db EXEGGUTOR
db KINGS_ROCK
db TOXIC, GIGA_DRAIN, THIEF, CONFUSION
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 15, 14, 15, 14 ; DVs
db 10, 5, 10, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 45 ; HP
bigdw 45 ; Max HP
bigdw 31 ; Atk
bigdw 29 ; Def
bigdw 23 ; Spd
bigdw 37 ; SAtk
bigdw 25 ; SDef
db "NAtuSI-@@@@"
db HERACROSS
db GOLD_BERRY
db REVERSAL, ENDURE, COUNTER, ROCK_SMASH
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 15, 7, 15, 7 ; DVs
db 15, 10, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 43 ; HP
bigdw 43 ; Max HP
bigdw 37 ; Atk
bigdw 25 ; Def
bigdw 29 ; Spd
bigdw 18 ; SAtk
bigdw 29 ; SDef
db "HERAKUROSU@"
db UNOWN
db BERRY
db HIDDEN_POWER, 0, 0, 0
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 15, 15, 15, 15 ; DVs
db 15, 0, 0, 0 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 36 ; HP
bigdw 36 ; Max HP
bigdw 26 ; Atk
bigdw 21 ; Def
bigdw 21 ; Spd
bigdw 26 ; SAtk
bigdw 21 ; SDef
db "ANNO-N@@@@@"
db TAUROS
db KINGS_ROCK
db HEADBUTT, SWAGGER, TAIL_WHIP, ICY_WIND
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 5, 5, 7 ; DVs
db 15, 15, 30, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 40 ; HP
bigdw 40 ; Max HP
bigdw 30 ; Atk
bigdw 29 ; Def
bigdw 32 ; Spd
bigdw 18 ; SAtk
bigdw 24 ; SDef
db "KENTAROSU@@"
db MR__MIME
db QUICK_CLAW
db TOXIC, PSYCH_UP, FIRE_PUNCH, HEADBUTT
dw 0 ; OT ID
dt 1000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 3, 6, 7 ; DVs
db 10, 10, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 10 ; Level
db 0, 0 ; Status
bigdw 34 ; HP
bigdw 34 ; Max HP
bigdw 19 ; Atk
bigdw 22 ; Def
bigdw 28 ; Spd
bigdw 30 ; SAtk
bigdw 34 ; SDef
db "BARIYA-DO@@"
BattleTowerMons2:
db UMBREON
db LEFTOVERS
db PROTECT, TOXIC, MUD_SLAP, ATTRACT
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 12, 15, 11, 12 ; DVs
db 10, 10, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 81 ; HP
bigdw 81 ; Max HP
bigdw 46 ; Atk
bigdw 66 ; Def
bigdw 46 ; Spd
bigdw 44 ; SAtk
bigdw 72 ; SDef
db "BURAtuKI-@@"
db STARMIE
db GOLD_BERRY
db RECOVER, PSYCHIC_M, SURF, PSYCH_UP
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 13, 11, 13, 11 ; DVs
db 20, 10, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 71 ; HP
bigdw 71 ; Max HP
bigdw 51 ; Atk
bigdw 54 ; Def
bigdw 67 ; Spd
bigdw 60 ; SAtk
bigdw 54 ; SDef
db "SUTA-MI-@@@"
db GYARADOS
db MIRACLEBERRY
db HYPER_BEAM, DRAGON_RAGE, THUNDERBOLT, FIRE_BLAST
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 10, 15, 13 ; DVs
db 5, 10, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 83 ; HP
bigdw 83 ; Max HP
bigdw 72 ; Atk
bigdw 51 ; Def
bigdw 54 ; Spd
bigdw 45 ; SAtk
bigdw 61 ; SDef
db "GIyaRADOSU@"
db STEELIX
db GOLD_BERRY
db ROAR, IRON_TAIL, SWAGGER, EARTHQUAKE
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 30000
bigdw 50000
dn 15, 15, 15, 15 ; DVs
db 20, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 77 ; HP
bigdw 77 ; Max HP
bigdw 55 ; Atk
bigdw 102 ; Def
bigdw 31 ; Spd
bigdw 44 ; SAtk
bigdw 48 ; SDef
db "HAGANE-RU@@"
db ALAKAZAM
db BERRY_JUICE
db PSYCHIC_M, PSYCH_UP, TOXIC, THUNDERPUNCH
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 50000
bigdw 40000
dn 15, 13, 14, 15 ; DVs
db 10, 10, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 68 ; HP
bigdw 68 ; Max HP
bigdw 42 ; Atk
bigdw 36 ; Def
bigdw 69 ; Spd
bigdw 75 ; SAtk
bigdw 55 ; SDef
db "HU-DEiN@@@@"
db ARCANINE
db BRIGHTPOWDER
db FLAMETHROWER, ROAR, HYPER_BEAM, IRON_TAIL
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 35000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 11, 15, 11 ; DVs
db 15, 20, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 81 ; HP
bigdw 81 ; Max HP
bigdw 64 ; Atk
bigdw 52 ; Def
bigdw 60 ; Spd
bigdw 60 ; SAtk
bigdw 52 ; SDef
db "UINDEi@@@@@"
db HERACROSS
db FOCUS_BAND
db ENDURE, REVERSAL, MEGAHORN, EARTHQUAKE
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 30000
bigdw 45000
bigdw 30000
bigdw 45000
dn 13, 15, 13, 14 ; DVs
db 10, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 78 ; HP
bigdw 78 ; Max HP
bigdw 68 ; Atk
bigdw 51 ; Def
bigdw 52 ; Spd
bigdw 37 ; SAtk
bigdw 59 ; SDef
db "HERAKUROSU@"
db EXEGGUTOR
db LEFTOVERS
db HYPER_BEAM, PSYCHIC_M, TOXIC, DREAM_EATER
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 15, 13, 14, 11 ; DVs
db 5, 10, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 83 ; HP
bigdw 83 ; Max HP
bigdw 60 ; Atk
bigdw 55 ; Def
bigdw 43 ; Spd
bigdw 70 ; SAtk
bigdw 46 ; SDef
db "NAtuSI-@@@@"
db AERODACTYL
db GOLD_BERRY
db REST, HYPER_BEAM, EARTHQUAKE, DRAGON_RAGE
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 15, 11, 11, 11 ; DVs
db 10, 5, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 78 ; HP
bigdw 78 ; Max HP
bigdw 64 ; Atk
bigdw 45 ; Def
bigdw 72 ; Spd
bigdw 44 ; SAtk
bigdw 50 ; SDef
db "PUTERA@@@@@"
db BLISSEY
db BRIGHTPOWDER
db PSYCHIC_M, SUBMISSION, SOFTBOILED, COUNTER
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 30000
bigdw 50000
dn 11, 13, 15, 14 ; DVs
db 10, 25, 10, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 148 ; HP
bigdw 148 ; Max HP
bigdw 24 ; Atk
bigdw 22 ; Def
bigdw 41 ; Spd
bigdw 51 ; SAtk
bigdw 75 ; SDef
db "HAPINASU@@@"
db LAPRAS
db GOLD_BERRY
db PSYCHIC_M, THUNDERBOLT, BLIZZARD, CONFUSE_RAY
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 55000
bigdw 30000
bigdw 40000
bigdw 55000
bigdw 30000
dn 15, 14, 13, 7 ; DVs
db 10, 15, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 98 ; HP
bigdw 98 ; Max HP
bigdw 53 ; Atk
bigdw 52 ; Def
bigdw 45 ; Spd
bigdw 50 ; SAtk
bigdw 54 ; SDef
db "RAPURASU@@@"
db PIKACHU
db LIGHT_BALL
db THUNDERBOLT, THUNDER_WAVE, STRENGTH, TOXIC
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 15, 12, 15, 14 ; DVs
db 15, 20, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 58 ; HP
bigdw 58 ; Max HP
bigdw 44 ; Atk
bigdw 32 ; Def
bigdw 58 ; Spd
bigdw 41 ; SAtk
bigdw 37 ; SDef
db "PIKATIyuU@@"
db SCIZOR
db FOCUS_BAND
db STEEL_WING, SLASH, TOXIC, SANDSTORM
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 40000
bigdw 45000
bigdw 40000
bigdw 45000
bigdw 50000
dn 15, 13, 15, 14 ; DVs
db 25, 20, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 73 ; HP
bigdw 73 ; Max HP
bigdw 73 ; Atk
bigdw 60 ; Def
bigdw 47 ; Spd
bigdw 43 ; SAtk
bigdw 53 ; SDef
db "HAtuSAMU@@@"
db HITMONCHAN
db GOLD_BERRY
db THUNDERPUNCH, ICE_PUNCH, FIRE_PUNCH, MEGA_PUNCH
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 35000
bigdw 50000
bigdw 30000
dn 15, 11, 15, 13 ; DVs
db 15, 15, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 67 ; HP
bigdw 67 ; Max HP
bigdw 63 ; Atk
bigdw 50 ; Def
bigdw 52 ; Spd
bigdw 32 ; SAtk
bigdw 62 ; SDef
db "EBIWARA-@@@"
db TAUROS
db BRIGHTPOWDER
db THUNDERBOLT, EARTHQUAKE, HYPER_BEAM, BLIZZARD
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 30000
bigdw 30000
dn 15, 11, 14, 15 ; DVs
db 15, 10, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 76 ; HP
bigdw 76 ; Max HP
bigdw 61 ; Atk
bigdw 58 ; Def
bigdw 63 ; Spd
bigdw 35 ; SAtk
bigdw 47 ; SDef
db "KENTAROSU@@"
db AZUMARILL
db MYSTIC_WATER
db SURF, BLIZZARD, ATTRACT, RAIN_DANCE
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 14, 13, 15, 7 ; DVs
db 15, 5, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 82 ; HP
bigdw 82 ; Max HP
bigdw 40 ; Atk
bigdw 52 ; Def
bigdw 41 ; Spd
bigdw 37 ; SAtk
bigdw 49 ; SDef
db "MARIRURI@@@"
db MILTANK
db KINGS_ROCK
db EARTHQUAKE, THUNDER, ATTRACT, SURF
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 13, 15, 15, 14 ; DVs
db 10, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 83 ; HP
bigdw 83 ; Max HP
bigdw 52 ; Atk
bigdw 63 ; Def
bigdw 61 ; Spd
bigdw 36 ; SAtk
bigdw 48 ; SDef
db "MIRUTANKU@@"
db WIGGLYTUFF
db GOLD_BERRY
db HYPER_BEAM, BLIZZARD, FIRE_BLAST, ATTRACT
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 12, 7, 15, 14 ; DVs
db 5, 5, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 98 ; HP
bigdw 98 ; Max HP
bigdw 47 ; Atk
bigdw 35 ; Def
bigdw 39 ; Spd
bigdw 50 ; SAtk
bigdw 40 ; SDef
db "PUKURIN@@@@"
db WIGGLYTUFF
db PINK_BOW
db PSYCHIC_M, SWAGGER, PSYCH_UP, HEADBUTT
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 12, 7, 7, 7 ; DVs
db 10, 15, 10, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 97 ; HP
bigdw 97 ; Max HP
bigdw 46 ; Atk
bigdw 34 ; Def
bigdw 34 ; Spd
bigdw 46 ; SAtk
bigdw 36 ; SDef
db "PUKURIN@@@@"
db NIDOKING
db BERRY
db BLIZZARD, EARTHQUAKE, SURF, THUNDERPUNCH
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 5, 6, 4, 6 ; DVs
db 5, 10, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 74 ; HP
bigdw 74 ; Max HP
bigdw 52 ; Atk
bigdw 46 ; Def
bigdw 49 ; Spd
bigdw 50 ; SAtk
bigdw 46 ; SDef
db "NIDOKINGU@@"
db QUAGSIRE
db QUICK_CLAW
db AMNESIA, EARTHQUAKE, SURF, RAIN_DANCE
dw 0 ; OT ID
dt 8000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 5, 5, 4, 7 ; DVs
db 20, 10, 15, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 20 ; Level
db 0, 0 ; Status
bigdw 81 ; HP
bigdw 81 ; Max HP
bigdw 49 ; Atk
bigdw 49 ; Def
bigdw 29 ; Spd
bigdw 42 ; SAtk
bigdw 42 ; SDef
db "NUO-@@@@@@@"
BattleTowerMons3:
db JOLTEON
db MIRACLEBERRY
db THUNDERBOLT, THUNDER_WAVE, ROAR, MUD_SLAP
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 55000
dn 13, 11, 14, 13 ; DVs
db 15, 20, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 103 ; HP
bigdw 103 ; Max HP
bigdw 68 ; Atk
bigdw 64 ; Def
bigdw 107 ; Spd
bigdw 96 ; SAtk
bigdw 87 ; SDef
db "SANDA-SU@@@"
db POLIWRATH
db BRIGHTPOWDER
db DOUBLE_TEAM, SURF, FISSURE, SUBMISSION
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 55000
bigdw 55000
bigdw 55000
bigdw 50000
dn 13, 13, 15, 11 ; DVs
db 15, 15, 5, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 119 ; HP
bigdw 119 ; Max HP
bigdw 81 ; Atk
bigdw 87 ; Def
bigdw 73 ; Spd
bigdw 70 ; SAtk
bigdw 82 ; SDef
db "NIyoROBON@@"
db STARMIE
db LEFTOVERS
db THUNDER_WAVE, PSYCHIC_M, RECOVER, SURF
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 15, 15, 15 ; DVs
db 20, 10, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 101 ; HP
bigdw 101 ; Max HP
bigdw 75 ; Atk
bigdw 81 ; Def
bigdw 99 ; Spd
bigdw 90 ; SAtk
bigdw 81 ; SDef
db "SUTA-MI-@@@"
db JYNX
db GOLD_BERRY
db BLIZZARD, LOVELY_KISS, DREAM_EATER, ATTRACT
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 50000
dn 15, 11, 14, 14 ; DVs
db 5, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 102 ; HP
bigdw 102 ; Max HP
bigdw 60 ; Atk
bigdw 49 ; Def
bigdw 83 ; Spd
bigdw 98 ; SAtk
bigdw 86 ; SDef
db "RU-ZIyuRA@@"
db DUGTRIO
db KINGS_ROCK
db EARTHQUAKE, SLUDGE_BOMB, SLASH, MUD_SLAP
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 50000
bigdw 50000
dn 14, 15, 15, 15 ; DVs
db 10, 10, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 81 ; HP
bigdw 81 ; Max HP
bigdw 77 ; Atk
bigdw 56 ; Def
bigdw 102 ; Spd
bigdw 60 ; SAtk
bigdw 72 ; SDef
db "DAGUTORIO@@"
db BELLOSSOM
db BRIGHTPOWDER
db GIGA_DRAIN, SUNNY_DAY, SOLARBEAM, DOUBLE_TEAM
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 45000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 15, 13, 11 ; DVs
db 5, 5, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 109 ; HP
bigdw 109 ; Max HP
bigdw 76 ; Atk
bigdw 81 ; Def
bigdw 60 ; Spd
bigdw 82 ; SAtk
bigdw 88 ; SDef
db "KIREIHANA@@"
db BLISSEY
db LEFTOVERS
db TOXIC, REFLECT, SOFTBOILED, PROTECT
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 30000
bigdw 45000
bigdw 30000
bigdw 45000
dn 15, 11, 14, 13 ; DVs
db 10, 20, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 217 ; HP
bigdw 217 ; Max HP
bigdw 32 ; Atk
bigdw 33 ; Def
bigdw 59 ; Spd
bigdw 73 ; SAtk
bigdw 109 ; SDef
db "HAPINASU@@@"
db HOUNDOOM
db CHARCOAL
db FLAMETHROWER, CRUNCH, SHADOW_BALL, DREAM_EATER
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 15, 13, 14, 13 ; DVs
db 15, 15, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 108 ; HP
bigdw 108 ; Max HP
bigdw 84 ; Atk
bigdw 59 ; Def
bigdw 86 ; Spd
bigdw 94 ; SAtk
bigdw 76 ; SDef
db "HERUGA-@@@@"
db MACHAMP
db MIRACLEBERRY
db CROSS_CHOP, ICE_PUNCH, EARTHQUAKE, FIRE_BLAST
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 15, 13, 11, 14 ; DVs
db 5, 15, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 118 ; HP
bigdw 118 ; Max HP
bigdw 108 ; Atk
bigdw 75 ; Def
bigdw 61 ; Spd
bigdw 68 ; SAtk
bigdw 80 ; SDef
db "KAIRIKI-@@@"
db CROBAT
db GOLD_BERRY
db ATTRACT, CONFUSE_RAY, TOXIC, WING_ATTACK
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 30000
bigdw 50000
dn 14, 15, 13, 12 ; DVs
db 15, 10, 10, 35 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 111 ; HP
bigdw 111 ; Max HP
bigdw 83 ; Atk
bigdw 74 ; Def
bigdw 103 ; Spd
bigdw 70 ; SAtk
bigdw 76 ; SDef
db "KUROBAtuTO@"
db PORYGON2
db BRIGHTPOWDER
db PSYCHIC_M, RECOVER, HYPER_BEAM, TRI_ATTACK
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 55000
bigdw 30000
bigdw 40000
bigdw 55000
bigdw 30000
dn 13, 15, 13, 11 ; DVs
db 10, 20, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 117 ; HP
bigdw 117 ; Max HP
bigdw 73 ; Atk
bigdw 83 ; Def
bigdw 66 ; Spd
bigdw 87 ; SAtk
bigdw 81 ; SDef
db "PORIGON2@@@"
db MAROWAK
db THICK_CLUB
db EARTHQUAKE, RETURN, HYPER_BEAM, BONEMERANG
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 30000
dn 13, 13, 14, 11 ; DVs
db 10, 20, 5, 10 ; PP
db 255 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 99 ; HP
bigdw 99 ; Max HP
bigdw 77 ; Atk
bigdw 94 ; Def
bigdw 56 ; Spd
bigdw 54 ; SAtk
bigdw 72 ; SDef
db "GARAGARA@@@"
db ELECTRODE
db BRIGHTPOWDER
db LIGHT_SCREEN, THUNDERBOLT, PROTECT, THUNDER
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 40000
bigdw 45000
bigdw 40000
bigdw 45000
bigdw 50000
dn 11, 13, 14, 15 ; DVs
db 30, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 98 ; HP
bigdw 98 ; Max HP
bigdw 57 ; Atk
bigdw 69 ; Def
bigdw 113 ; Spd
bigdw 78 ; SAtk
bigdw 78 ; SDef
db "MARUMAIN@@@"
db LAPRAS
db LEFTOVERS
db RAIN_DANCE, WATER_GUN, ICY_WIND, STRENGTH
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 35000
bigdw 50000
bigdw 30000
dn 15, 13, 14, 11 ; DVs
db 5, 25, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 142 ; HP
bigdw 142 ; Max HP
bigdw 80 ; Atk
bigdw 74 ; Def
bigdw 65 ; Spd
bigdw 75 ; SAtk
bigdw 81 ; SDef
db "RAPURASU@@@"
db LANTURN
db GOLD_BERRY
db RAIN_DANCE, THUNDER, SURF, FLAIL
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 30000
bigdw 30000
dn 13, 13, 14, 11 ; DVs
db 5, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 139 ; HP
bigdw 139 ; Max HP
bigdw 62 ; Atk
bigdw 64 ; Def
bigdw 66 ; Spd
bigdw 70 ; SAtk
bigdw 70 ; SDef
db "RANTA-N@@@@"
db ESPEON
db MIRACLEBERRY
db CONFUSION, SWIFT, TOXIC, PSYCH_UP
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 14, 15, 15, 7 ; DVs
db 25, 20, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 99 ; HP
bigdw 99 ; Max HP
bigdw 68 ; Atk
bigdw 66 ; Def
bigdw 96 ; Spd
bigdw 103 ; SAtk
bigdw 82 ; SDef
db "E-HUi@@@@@@"
db TENTACRUEL
db KINGS_ROCK
db WRAP, TOXIC, SLUDGE_BOMB, BUBBLEBEAM
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 47000
bigdw 45000
dn 15, 14, 15, 14 ; DVs
db 20, 10, 10, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 110 ; HP
bigdw 110 ; Max HP
bigdw 71 ; Atk
bigdw 68 ; Def
bigdw 90 ; Spd
bigdw 77 ; SAtk
bigdw 101 ; SDef
db "DOKUKURAGE@"
db GENGAR
db GOLD_BERRY
db THIEF, LICK, NIGHT_SHADE, GIGA_DRAIN
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 7, 15, 7 ; DVs
db 10, 30, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 101 ; HP
bigdw 101 ; Max HP
bigdw 68 ; Atk
bigdw 61 ; Def
bigdw 96 ; Spd
bigdw 103 ; SAtk
bigdw 70 ; SDef
db "GENGA-@@@@@"
db URSARING
db GOLD_BERRY
db HEADBUTT, PROTECT, ROAR, LEER
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 7, 4, 5 ; DVs
db 15, 10, 20, 30 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 114 ; HP
bigdw 114 ; Max HP
bigdw 100 ; Atk
bigdw 67 ; Def
bigdw 53 ; Spd
bigdw 65 ; SAtk
bigdw 65 ; SDef
db "RINGUMA@@@@"
db FEAROW
db BRIGHTPOWDER
db MIRROR_MOVE, PURSUIT, PECK, SWIFT
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 7, 7, 7 ; DVs
db 20, 20, 35, 20 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 96 ; HP
bigdw 96 ; Max HP
bigdw 75 ; Atk
bigdw 61 ; Def
bigdw 82 ; Spd
bigdw 58 ; SAtk
bigdw 58 ; SDef
db "ONIDORIRU@@"
db PRIMEAPE
db MIRACLEBERRY
db LOW_KICK, KARATE_CHOP, REVERSAL, FOCUS_ENERGY
dw 0 ; OT ID
dt 27000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 7, 6, 7 ; DVs
db 20, 25, 15, 30 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 30 ; Level
db 0, 0 ; Status
bigdw 99 ; HP
bigdw 99 ; Max HP
bigdw 85 ; Atk
bigdw 58 ; Def
bigdw 78 ; Spd
bigdw 58 ; SAtk
bigdw 64 ; SDef
db "OKORIZARU@@"
BattleTowerMons4:
db TAUROS
db GOLD_BERRY
db RETURN, HYPER_BEAM, EARTHQUAKE, IRON_TAIL
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 15, 14 ; DVs
db 20, 5, 10, 15 ; PP
db 255 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 143 ; HP
bigdw 143 ; Max HP
bigdw 119 ; Atk
bigdw 113 ; Def
bigdw 127 ; Spd
bigdw 70 ; SAtk
bigdw 94 ; SDef
db "KENTAROSU@@"
db KINGDRA
db LEFTOVERS
db SURF, DRAGONBREATH, HYPER_BEAM, BLIZZARD
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 14, 15 ; DVs
db 15, 20, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 142 ; HP
bigdw 142 ; Max HP
bigdw 115 ; Atk
bigdw 113 ; Def
bigdw 106 ; Spd
bigdw 115 ; SAtk
bigdw 115 ; SDef
db "KINGUDORA@@"
db SNORLAX
db QUICK_CLAW
db ATTRACT, BODY_SLAM, PSYCH_UP, EARTHQUAKE
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 14, 13, 13, 13 ; DVs
db 15, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 205 ; HP
bigdw 205 ; Max HP
bigdw 126 ; Atk
bigdw 89 ; Def
bigdw 61 ; Spd
bigdw 89 ; SAtk
bigdw 125 ; SDef
db "KABIGON@@@@"
db LAPRAS
db LEFTOVERS
db THUNDERBOLT, ICE_BEAM, CONFUSE_RAY, SURF
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 14, 11 ; DVs
db 15, 10, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 186 ; HP
bigdw 186 ; Max HP
bigdw 107 ; Atk
bigdw 101 ; Def
bigdw 86 ; Spd
bigdw 103 ; SAtk
bigdw 111 ; SDef
db "RAPURASU@@@"
db STEELIX
db GOLD_BERRY
db SANDSTORM, IRON_TAIL, EARTHQUAKE, TOXIC
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 14, 15, 13, 11 ; DVs
db 10, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 137 ; HP
bigdw 137 ; Max HP
bigdw 106 ; Atk
bigdw 199 ; Def
bigdw 61 ; Spd
bigdw 79 ; SAtk
bigdw 87 ; SDef
db "HAGANE-RU@@"
db ALAKAZAM
db KINGS_ROCK
db PSYCHIC_M, THUNDERPUNCH, RECOVER, FIRE_PUNCH
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 13, 14, 15 ; DVs
db 10, 15, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 126 ; HP
bigdw 126 ; Max HP
bigdw 76 ; Atk
bigdw 73 ; Def
bigdw 135 ; Spd
bigdw 147 ; SAtk
bigdw 107 ; SDef
db "HU-DEiN@@@@"
db STARMIE
db LEFTOVERS
db BLIZZARD, THUNDERBOLT, SURF, PSYCHIC_M
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 45000
dn 15, 13, 11, 14 ; DVs
db 5, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 131 ; HP
bigdw 131 ; Max HP
bigdw 99 ; Atk
bigdw 104 ; Def
bigdw 127 ; Spd
bigdw 117 ; SAtk
bigdw 105 ; SDef
db "SUTA-MI-@@@"
db WOBBUFFET
db GOLD_BERRY
db COUNTER, MIRROR_COAT, SAFEGUARD, DESTINY_BOND
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 11, 15, 14, 7 ; DVs
db 20, 20, 25, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 233 ; HP
bigdw 233 ; Max HP
bigdw 62 ; Atk
bigdw 85 ; Def
bigdw 64 ; Spd
bigdw 59 ; SAtk
bigdw 79 ; SDef
db "SO-NANSU@@@"
db GOLEM
db FOCUS_BAND
db EXPLOSION, EARTHQUAKE, MEGA_PUNCH, ROCK_SLIDE
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 13, 13, 14, 13 ; DVs
db 5, 10, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 145 ; HP
bigdw 145 ; Max HP
bigdw 125 ; Atk
bigdw 139 ; Def
bigdw 74 ; Spd
bigdw 80 ; SAtk
bigdw 88 ; SDef
db "GORO-NIya@@"
db SCIZOR
db SCOPE_LENS
db SLASH, STEEL_WING, PURSUIT, HYPER_BEAM
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 40000
bigdw 50000
dn 11, 13, 15, 14 ; DVs
db 20, 25, 20, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 139 ; HP
bigdw 139 ; Max HP
bigdw 139 ; Atk
bigdw 117 ; Def
bigdw 89 ; Spd
bigdw 82 ; SAtk
bigdw 102 ; SDef
db "HAtuSAMU@@@"
db DUGTRIO
db KINGS_ROCK
db EARTHQUAKE, HYPER_BEAM, SLUDGE_BOMB, MUD_SLAP
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 11, 11 ; DVs
db 10, 5, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 108 ; HP
bigdw 108 ; Max HP
bigdw 103 ; Atk
bigdw 78 ; Def
bigdw 131 ; Spd
bigdw 75 ; SAtk
bigdw 91 ; SDef
db "DAGUTORIO@@"
db SLOWBRO
db MIRACLEBERRY
db SURF, PSYCHIC_M, EARTHQUAKE, BLIZZARD
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 11, 15, 12, 15 ; DVs
db 15, 10, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 157 ; HP
bigdw 157 ; Max HP
bigdw 95 ; Atk
bigdw 126 ; Def
bigdw 60 ; Spd
bigdw 119 ; SAtk
bigdw 103 ; SDef
db "YADORAN@@@@"
db PORYGON2
db NO_ITEM
db CONVERSION2, CONVERSION, PSYBEAM, THIEF
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
dn 11, 12, 14, 15 ; DVs
db 30, 30, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 147 ; HP
bigdw 147 ; Max HP
bigdw 99 ; Atk
bigdw 108 ; Def
bigdw 86 ; Spd
bigdw 123 ; SAtk
bigdw 115 ; SDef
db "PORIGON2@@@"
db ARCANINE
db CHARCOAL
db FLAME_WHEEL, LEER, BODY_SLAM, ROAR
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 11, 11 ; DVs
db 25, 30, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 152 ; HP
bigdw 152 ; Max HP
bigdw 127 ; Atk
bigdw 102 ; Def
bigdw 111 ; Spd
bigdw 115 ; SAtk
bigdw 99 ; SDef
db "UINDEi@@@@@"
db FORRETRESS
db LEFTOVERS
db RAPID_SPIN, PROTECT, TOXIC, SANDSTORM
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 10, 7, 15 ; DVs
db 40, 10, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 140 ; HP
bigdw 140 ; Max HP
bigdw 111 ; Atk
bigdw 147 ; Def
bigdw 64 ; Spd
bigdw 87 ; SAtk
bigdw 87 ; SDef
db "HUoRETOSU@@"
db OMASTAR
db GOLD_BERRY
db CURSE, WATER_GUN, ANCIENTPOWER, ROCK_SMASH
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 14, 15, 15, 7 ; DVs
db 10, 25, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 133 ; HP
bigdw 133 ; Max HP
bigdw 86 ; Atk
bigdw 139 ; Def
bigdw 83 ; Spd
bigdw 124 ; SAtk
bigdw 88 ; SDef
db "OMUSUTA-@@@"
db CHARIZARD
db KINGS_ROCK
db FIRE_SPIN, DRAGON_RAGE, FLY, SLASH
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 14 ; DVs
db 15, 10, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 142 ; HP
bigdw 142 ; Max HP
bigdw 106 ; Atk
bigdw 100 ; Def
bigdw 119 ; Spd
bigdw 125 ; SAtk
bigdw 106 ; SDef
db "RIZA-DON@@@"
db EXEGGUTOR
db BRIGHTPOWDER
db EGG_BOMB, STOMP, PSYCH_UP, CONFUSION
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 7, 14, 7 ; DVs
db 10, 20, 10, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 158 ; HP
bigdw 158 ; Max HP
bigdw 115 ; Atk
bigdw 100 ; Def
bigdw 82 ; Spd
bigdw 132 ; SAtk
bigdw 84 ; SDef
db "NAtuSI-@@@@"
db HYPNO
db BRIGHTPOWDER
db CONFUSION, THUNDERPUNCH, HEADBUTT, DISABLE
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 7, 7, 10 ; DVs
db 25, 15, 15, 20 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 146 ; HP
bigdw 146 ; Max HP
bigdw 86 ; Atk
bigdw 83 ; Def
bigdw 81 ; Spd
bigdw 88 ; SAtk
bigdw 122 ; SDef
db "SURI-PA-@@@"
db MUK
db QUICK_CLAW
db SCREECH, TOXIC, SLUDGE, HARDEN
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 5, 6, 11 ; DVs
db 40, 10, 20, 30 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 161 ; HP
bigdw 161 ; Max HP
bigdw 111 ; Atk
bigdw 86 ; Def
bigdw 67 ; Spd
bigdw 83 ; SAtk
bigdw 111 ; SDef
db "BETOBETON@@"
db ELECTABUZZ
db KINGS_ROCK
db LIGHT_SCREEN, THUNDERPUNCH, SWIFT, SNORE
dw 0 ; OT ID
dt 64000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 5, 7, 7 ; DVs
db 30, 15, 20, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 40 ; Level
db 0, 0 ; Status
bigdw 124 ; HP
bigdw 124 ; Max HP
bigdw 93 ; Atk
bigdw 71 ; Def
bigdw 111 ; Spd
bigdw 103 ; SAtk
bigdw 95 ; SDef
db "EREBU-@@@@@"
BattleTowerMons5:
db KINGDRA
db GOLD_BERRY
db SURF, HYPER_BEAM, BLIZZARD, DRAGONBREATH
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 55000
bigdw 55000
bigdw 60000
bigdw 50000
bigdw 55000
dn 13, 13, 15, 15 ; DVs
db 15, 5, 5, 20 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 179 ; HP
bigdw 179 ; Max HP
bigdw 142 ; Atk
bigdw 143 ; Def
bigdw 132 ; Spd
bigdw 144 ; SAtk
bigdw 144 ; SDef
db "KINGUDORA@@"
db HOUNDOOM
db MIRACLEBERRY
db REST, CRUNCH, DREAM_EATER, FLAMETHROWER
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 60000
bigdw 60000
bigdw 60000
dn 13, 13, 15, 12 ; DVs
db 10, 15, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 178 ; HP
bigdw 178 ; Max HP
bigdw 135 ; Atk
bigdw 98 ; Def
bigdw 145 ; Spd
bigdw 157 ; SAtk
bigdw 127 ; SDef
db "HERUGA-@@@@"
db SHUCKLE
db LEFTOVERS
db SANDSTORM, REST, TOXIC, WRAP
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 55000
dn 15, 13, 12, 15 ; DVs
db 10, 10, 10, 20 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 123 ; HP
bigdw 123 ; Max HP
bigdw 60 ; Atk
bigdw 278 ; Def
bigdw 52 ; Spd
bigdw 59 ; SAtk
bigdw 279 ; SDef
db "TUBOTUBO@@@"
db SNORLAX
db LEFTOVERS
db HYPER_BEAM, EARTHQUAKE, SURF, PSYCH_UP
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 60000
bigdw 55000
bigdw 55000
bigdw 60000
bigdw 55000
dn 15, 13, 14, 15 ; DVs
db 5, 10, 15, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 263 ; HP
bigdw 263 ; Max HP
bigdw 159 ; Atk
bigdw 112 ; Def
bigdw 79 ; Spd
bigdw 114 ; SAtk
bigdw 159 ; SDef
db "KABIGON@@@@"
db LAPRAS
db GOLD_BERRY
db THUNDERBOLT, SURF, CONFUSE_RAY, BLIZZARD
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 55000
bigdw 60000
bigdw 60000
bigdw 55000
bigdw 60000
dn 13, 13, 13, 13 ; DVs
db 15, 15, 10, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 234 ; HP
bigdw 234 ; Max HP
bigdw 133 ; Atk
bigdw 128 ; Def
bigdw 107 ; Spd
bigdw 133 ; SAtk
bigdw 143 ; SDef
db "RAPURASU@@@"
db JOLTEON
db KINGS_ROCK
db THUNDERBOLT, THUNDER_WAVE, SHADOW_BALL, HIDDEN_POWER
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 55000
bigdw 60000
bigdw 57000
bigdw 55000
bigdw 55000
dn 14, 13, 15, 15 ; DVs
db 15, 20, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 161 ; HP
bigdw 161 ; Max HP
bigdw 114 ; Atk
bigdw 107 ; Def
bigdw 179 ; Spd
bigdw 159 ; SAtk
bigdw 144 ; SDef
db "SANDA-SU@@@"
db SCIZOR
db LEFTOVERS
db HYPER_BEAM, SLASH, AGILITY, METAL_CLAW
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 13, 15, 14, 13 ; DVs
db 5, 20, 30, 35 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 169 ; HP
bigdw 169 ; Max HP
bigdw 175 ; Atk
bigdw 145 ; Def
bigdw 111 ; Spd
bigdw 99 ; SAtk
bigdw 124 ; SDef
db "HAtuSAMU@@@"
db SLOWKING
db MINT_BERRY
db REST, SURF, PSYCHIC_M, AMNESIA
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 45000
bigdw 50000
bigdw 50000
dn 13, 15, 13, 14 ; DVs
db 10, 15, 10, 20 ; PP
db 15 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 196 ; HP
bigdw 196 ; Max HP
bigdw 118 ; Atk
bigdw 126 ; Def
bigdw 75 ; Spd
bigdw 146 ; SAtk
bigdw 156 ; SDef
db "YADOKINGU@@"
db MACHAMP
db GOLD_BERRY
db CROSS_CHOP, EARTHQUAKE, FIRE_BLAST, THUNDERPUNCH
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 40000
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 44000
dn 15, 15, 14, 12 ; DVs
db 5, 10, 5, 15 ; PP
db 13 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 187 ; HP
bigdw 187 ; Max HP
bigdw 176 ; Atk
bigdw 127 ; Def
bigdw 99 ; Spd
bigdw 108 ; SAtk
bigdw 128 ; SDef
db "KAIRIKI-@@@"
db STARMIE
db SCOPE_LENS
db THUNDER_WAVE, RECOVER, THUNDERBOLT, SURF
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 44000
bigdw 40000
bigdw 45000
bigdw 40000
dn 15, 15, 15, 15 ; DVs
db 20, 20, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 161 ; HP
bigdw 161 ; Max HP
bigdw 121 ; Atk
bigdw 130 ; Def
bigdw 161 ; Spd
bigdw 145 ; SAtk
bigdw 130 ; SDef
db "SUTA-MI-@@@"
db DUGTRIO
db KINGS_ROCK
db EARTHQUAKE, SLASH, HYPER_BEAM, SLUDGE_BOMB
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 40000
bigdw 50000
bigdw 45000
bigdw 50000
dn 15, 7, 15, 14 ; DVs
db 10, 20, 5, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 135 ; HP
bigdw 135 ; Max HP
bigdw 125 ; Atk
bigdw 89 ; Def
bigdw 166 ; Spd
bigdw 96 ; SAtk
bigdw 116 ; SDef
db "DAGUTORIO@@"
db ELECTRODE
db MIRACLEBERRY
db THUNDERBOLT, EXPLOSION, MIRROR_COAT, REST
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 54000
bigdw 40000
bigdw 50000
dn 7, 13, 15, 14 ; DVs
db 15, 5, 20, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 161 ; HP
bigdw 161 ; Max HP
bigdw 88 ; Atk
bigdw 117 ; Def
bigdw 185 ; Spd
bigdw 126 ; SAtk
bigdw 126 ; SDef
db "MARUMAIN@@@"
db AERODACTYL
db KINGS_ROCK
db HYPER_BEAM, EARTHQUAKE, FIRE_BLAST, IRON_TAIL
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 15, 13, 13, 13 ; DVs
db 5, 10, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 181 ; HP
bigdw 181 ; Max HP
bigdw 152 ; Atk
bigdw 110 ; Def
bigdw 174 ; Spd
bigdw 104 ; SAtk
bigdw 119 ; SDef
db "PUTERA@@@@@"
db CROBAT
db LEFTOVERS
db CONFUSE_RAY, ATTRACT, HYPER_BEAM, TOXIC
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 40000
bigdw 50000
bigdw 40000
bigdw 50000
dn 14, 15, 15, 15 ; DVs
db 10, 15, 5, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 178 ; HP
bigdw 178 ; Max HP
bigdw 134 ; Atk
bigdw 127 ; Def
bigdw 175 ; Spd
bigdw 117 ; SAtk
bigdw 127 ; SDef
db "KUROBAtuTO@"
db ZAPDOS
db MIRACLEBERRY
db DRILL_PECK, THUNDERBOLT, THUNDER_WAVE, HYPER_BEAM
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 40000
bigdw 50000
dn 15, 13, 13, 14 ; DVs
db 20, 15, 20, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 190 ; HP
bigdw 190 ; Max HP
bigdw 137 ; Atk
bigdw 129 ; Def
bigdw 143 ; Spd
bigdw 171 ; SAtk
bigdw 136 ; SDef
db "SANDA-@@@@@"
db SKARMORY
db GOLD_BERRY
db SANDSTORM, FLY, STEEL_WING, TOXIC
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 40000
dn 13, 7, 14, 13 ; DVs
db 10, 15, 25, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 164 ; HP
bigdw 164 ; Max HP
bigdw 125 ; Atk
bigdw 179 ; Def
bigdw 116 ; Spd
bigdw 83 ; SAtk
bigdw 113 ; SDef
db "EA-MUDO@@@@"
db FORRETRESS
db LEFTOVERS
db SANDSTORM, TOXIC, EXPLOSION, SWAGGER
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 45000
bigdw 40000
dn 12, 15, 13, 13 ; DVs
db 10, 10, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 169 ; HP
bigdw 169 ; Max HP
bigdw 134 ; Atk
bigdw 189 ; Def
bigdw 84 ; Spd
bigdw 103 ; SAtk
bigdw 103 ; SDef
db "HUoRETOSU@@"
db STEELIX
db MIRACLEBERRY
db SANDSTORM, IRON_TAIL, REST, EARTHQUAKE
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 40000
bigdw 45000
dn 13, 13, 13, 13 ; DVs
db 10, 15, 10, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 176 ; HP
bigdw 176 ; Max HP
bigdw 130 ; Atk
bigdw 245 ; Def
bigdw 73 ; Spd
bigdw 99 ; SAtk
bigdw 109 ; SDef
db "HAGANE-RU@@"
db GIRAFARIG
db SCOPE_LENS
db DREAM_EATER, CRUNCH, PSYCHIC_M, EARTHQUAKE
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 4, 5, 5, 6 ; DVs
db 15, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 161 ; HP
bigdw 161 ; Max HP
bigdw 114 ; Atk
bigdw 100 ; Def
bigdw 120 ; Spd
bigdw 126 ; SAtk
bigdw 101 ; SDef
db "KIRINRIKI@@"
db GYARADOS
db MIRACLEBERRY
db HYPER_BEAM, SURF, RAIN_DANCE, ZAP_CANNON
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 7, 5, 6, 5 ; DVs
db 5, 15, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 193 ; HP
bigdw 193 ; Max HP
bigdw 162 ; Atk
bigdw 114 ; Def
bigdw 117 ; Spd
bigdw 95 ; SAtk
bigdw 135 ; SDef
db "GIyaRADOSU@"
db ARTICUNO
db GOLD_BERRY
db BLIZZARD, HYPER_BEAM, ROAR, ICY_WIND
dw 0 ; OT ID
dt 125000 ; Exp
; Stat exp
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
bigdw 40000
dn 4, 5, 5, 6 ; DVs
db 5, 5, 20, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 50 ; Level
db 0, 0 ; Status
bigdw 181 ; HP
bigdw 181 ; Max HP
bigdw 119 ; Atk
bigdw 135 ; Def
bigdw 120 ; Spd
bigdw 131 ; SAtk
bigdw 161 ; SDef
db "HURI-ZA-@@@"
BattleTowerMons6:
db KINGDRA
db LEFTOVERS
db DRAGONBREATH, SURF, HYPER_BEAM, BLIZZARD
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 55000
bigdw 55000
bigdw 50000
bigdw 60000
bigdw 60000
dn 13, 13, 15, 14 ; DVs
db 20, 15, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 211 ; HP
bigdw 211 ; Max HP
bigdw 169 ; Atk
bigdw 167 ; Def
bigdw 161 ; Spd
bigdw 172 ; SAtk
bigdw 172 ; SDef
db "KINGUDORA@@"
db TYRANITAR
db GOLD_BERRY
db CRUNCH, EARTHQUAKE, ROCK_SLIDE, HYPER_BEAM
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 55000
bigdw 60000
bigdw 55000
bigdw 60000
bigdw 55000
dn 15, 13, 14, 13 ; DVs
db 15, 10, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 240 ; HP
bigdw 240 ; Max HP
bigdw 220 ; Atk
bigdw 187 ; Def
bigdw 131 ; Spd
bigdw 169 ; SAtk
bigdw 175 ; SDef
db "BANGIRASU@@"
db HOUNDOOM
db MIRACLEBERRY
db FLAMETHROWER, CRUNCH, DREAM_EATER, REST
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 60000
bigdw 55000
bigdw 55000
bigdw 60000
bigdw 55000
dn 15, 11, 14, 15 ; DVs
db 15, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 212 ; HP
bigdw 212 ; Max HP
bigdw 165 ; Atk
bigdw 113 ; Def
bigdw 172 ; Spd
bigdw 189 ; SAtk
bigdw 153 ; SDef
db "HERUGA-@@@@"
db PORYGON2
db LEFTOVERS
db BLIZZARD, RECOVER, TOXIC, PSYCHIC_M
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 55000
dn 13, 13, 13, 14 ; DVs
db 5, 20, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 223 ; HP
bigdw 223 ; Max HP
bigdw 149 ; Atk
bigdw 161 ; Def
bigdw 125 ; Spd
bigdw 182 ; SAtk
bigdw 170 ; SDef
db "PORIGON2@@@"
db MACHAMP
db QUICK_CLAW
db FIRE_PUNCH, CROSS_CHOP, THUNDERPUNCH, EARTHQUAKE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 15, 13, 14, 15 ; DVs
db 15, 5, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 226 ; HP
bigdw 226 ; Max HP
bigdw 212 ; Atk
bigdw 148 ; Def
bigdw 120 ; Spd
bigdw 134 ; SAtk
bigdw 158 ; SDef
db "KAIRIKI-@@@"
db ZAPDOS
db MINT_BERRY
db REST, DRILL_PECK, THUNDERBOLT, THUNDER_WAVE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 13, 15, 13 ; DVs
db 10, 20, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 229 ; HP
bigdw 229 ; Max HP
bigdw 160 ; Atk
bigdw 155 ; Def
bigdw 177 ; Spd
bigdw 203 ; SAtk
bigdw 161 ; SDef
db "SANDA-@@@@@"
db WOBBUFFET
db GOLD_BERRY
db COUNTER, MIRROR_COAT, DESTINY_BOND, SAFEGUARD
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 45000
dn 15, 13, 14, 13 ; DVs
db 20, 20, 5, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 346 ; HP
bigdw 346 ; Max HP
bigdw 95 ; Atk
bigdw 122 ; Def
bigdw 94 ; Spd
bigdw 92 ; SAtk
bigdw 122 ; SDef
db "SO-NANSU@@@"
db AERODACTYL
db LEFTOVERS
db HYPER_BEAM, SUPERSONIC, EARTHQUAKE, BITE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 15, 13, 13, 13 ; DVs
db 5, 20, 10, 25 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 215 ; HP
bigdw 215 ; Max HP
bigdw 182 ; Atk
bigdw 131 ; Def
bigdw 208 ; Spd
bigdw 124 ; SAtk
bigdw 142 ; SDef
db "PUTERA@@@@@"
db DRAGONITE
db MIRACLEBERRY
db HYPER_BEAM, ICY_WIND, THUNDERBOLT, SURF
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 13, 13, 15, 13 ; DVs
db 5, 15, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 229 ; HP
bigdw 229 ; Max HP
bigdw 214 ; Atk
bigdw 164 ; Def
bigdw 152 ; Spd
bigdw 172 ; SAtk
bigdw 172 ; SDef
db "KAIRIyu-@@@"
db UMBREON
db GOLD_BERRY
db MUD_SLAP, MOONLIGHT, PSYCHIC_M, FAINT_ATTACK
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 14, 15 ; DVs
db 10, 5, 10, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 232 ; HP
bigdw 232 ; Max HP
bigdw 134 ; Atk
bigdw 185 ; Def
bigdw 132 ; Spd
bigdw 128 ; SAtk
bigdw 212 ; SDef
db "BURAtuKI-@@"
db ARCANINE
db CHARCOAL
db FLAMETHROWER, CRUNCH, EXTREMESPEED, IRON_TAIL
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 40000
bigdw 55000
bigdw 50000
dn 15, 13, 14, 13 ; DVs
db 15, 15, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 228 ; HP
bigdw 228 ; Max HP
bigdw 188 ; Atk
bigdw 146 ; Def
bigdw 170 ; Spd
bigdw 173 ; SAtk
bigdw 149 ; SDef
db "UINDEi@@@@@"
db SKARMORY
db MIRACLEBERRY
db STEEL_WING, FLY, TOXIC, PROTECT
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 15, 11, 14, 11 ; DVs
db 25, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 196 ; HP
bigdw 196 ; Max HP
bigdw 152 ; Atk
bigdw 218 ; Def
bigdw 138 ; Spd
bigdw 99 ; SAtk
bigdw 135 ; SDef
db "EA-MUDO@@@@"
db BLISSEY
db LEFTOVERS
db SOFTBOILED, TOXIC, PROTECT, PSYCHIC_M
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 50000
dn 15, 11, 12, 13 ; DVs
db 10, 10, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 424 ; HP
bigdw 424 ; Max HP
bigdw 66 ; Atk
bigdw 63 ; Def
bigdw 117 ; Spd
bigdw 143 ; SAtk
bigdw 215 ; SDef
db "HAPINASU@@@"
db SNORLAX
db PINK_BOW
db ROCK_SLIDE, SURF, BODY_SLAM, EARTHQUAKE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 10, 15, 12 ; DVs
db 10, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 307 ; HP
bigdw 307 ; Max HP
bigdw 186 ; Atk
bigdw 128 ; Def
bigdw 92 ; Spd
bigdw 130 ; SAtk
bigdw 184 ; SDef
db "KABIGON@@@@"
db HERACROSS
db FOCUS_BAND
db REVERSAL, MEGAHORN, EARTHQUAKE, COUNTER
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 50000
bigdw 50000
dn 13, 15, 14, 13 ; DVs
db 15, 10, 10, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 214 ; HP
bigdw 214 ; Max HP
bigdw 200 ; Atk
bigdw 146 ; Def
bigdw 156 ; Spd
bigdw 101 ; SAtk
bigdw 167 ; SDef
db "HERAKUROSU@"
db JYNX
db MIRACLEBERRY
db BLIZZARD, PSYCHIC_M, SHADOW_BALL, ICY_WIND
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 15, 14, 11 ; DVs
db 5, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 196 ; HP
bigdw 196 ; Max HP
bigdw 116 ; Atk
bigdw 98 ; Def
bigdw 168 ; Spd
bigdw 189 ; SAtk
bigdw 165 ; SDef
db "RU-ZIyuRA@@"
db BLASTOISE
db GOLD_BERRY
db SURF, EARTHQUAKE, RAPID_SPIN, BLIZZARD
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 14 ; DVs
db 15, 10, 40, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 209 ; HP
bigdw 209 ; Max HP
bigdw 155 ; Atk
bigdw 174 ; Def
bigdw 149 ; Spd
bigdw 156 ; SAtk
bigdw 180 ; SDef
db "KAMEtuKUSU@"
db RHYDON
db QUICK_CLAW
db EARTHQUAKE, SURF, IRON_TAIL, ROCK_SLIDE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 11, 15, 10 ; DVs
db 10, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 245 ; HP
bigdw 245 ; Max HP
bigdw 212 ; Atk
bigdw 195 ; Def
bigdw 104 ; Spd
bigdw 104 ; SAtk
bigdw 104 ; SDef
db "SAIDON@@@@@"
db SANDSLASH
db SCOPE_LENS
db EARTHQUAKE, SLASH, HYPER_BEAM, SNORE
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 11, 7, 6, 7 ; DVs
db 10, 20, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 201 ; HP
bigdw 201 ; Max HP
bigdw 164 ; Atk
bigdw 171 ; Def
bigdw 116 ; Spd
bigdw 93 ; SAtk
bigdw 105 ; SDef
db "SANDOPAN@@@"
db PARASECT
db GOLD_BERRY
db SPORE, GIGA_DRAIN, HYPER_BEAM, SLUDGE_BOMB
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 6, 5, 15 ; DVs
db 15, 5, 5, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 171 ; HP
bigdw 171 ; Max HP
bigdw 152 ; Atk
bigdw 134 ; Def
bigdw 72 ; Spd
bigdw 120 ; SAtk
bigdw 144 ; SDef
db "PARASEKUTO@"
db GOLEM
db BRIGHTPOWDER
db EXPLOSION, EARTHQUAKE, FIRE_PUNCH, FRUSTRATION
dw 0 ; OT ID
dt 216000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 6, 5, 7 ; DVs
db 5, 10, 15, 20 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 60 ; Level
db 0, 0 ; Status
bigdw 205 ; HP
bigdw 205 ; Max HP
bigdw 171 ; Atk
bigdw 194 ; Def
bigdw 90 ; Spd
bigdw 105 ; SAtk
bigdw 117 ; SDef
db "GORO-NIya@@"
BattleTowerMons7:
db JOLTEON
db MIRACLEBERRY
db THUNDERBOLT, HYPER_BEAM, SHADOW_BALL, ROAR
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 60000
bigdw 56000
bigdw 55000
bigdw 50000
bigdw 60000
dn 15, 11, 14, 15 ; DVs
db 15, 5, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 231 ; HP
bigdw 231 ; Max HP
bigdw 158 ; Atk
bigdw 145 ; Def
bigdw 245 ; Spd
bigdw 222 ; SAtk
bigdw 201 ; SDef
db "SANDA-SU@@@"
db VAPOREON
db LEFTOVERS
db BLIZZARD, SHADOW_BALL, SURF, MUD_SLAP
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 60000
bigdw 60000
bigdw 50000
dn 11, 15, 14, 15 ; DVs
db 5, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 318 ; HP
bigdw 318 ; Max HP
bigdw 149 ; Atk
bigdw 152 ; Def
bigdw 158 ; Spd
bigdw 218 ; SAtk
bigdw 197 ; SDef
db "SIyaWA-ZU@@"
db UMBREON
db GOLD_BERRY
db FAINT_ATTACK, MOONLIGHT, PSYCH_UP, TOXIC
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 54000
bigdw 60000
bigdw 55000
bigdw 50000
bigdw 58000
dn 13, 13, 13, 13 ; DVs
db 20, 5, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 274 ; HP
bigdw 274 ; Max HP
bigdw 156 ; Atk
bigdw 217 ; Def
bigdw 152 ; Spd
bigdw 149 ; SAtk
bigdw 247 ; SDef
db "BURAtuKI-@@"
db BLISSEY
db GOLD_BERRY
db COUNTER, SOFTBOILED, SHADOW_BALL, THUNDERBOLT
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 55000
bigdw 55000
bigdw 55000
bigdw 58000
bigdw 50000
dn 13, 15, 14, 13 ; DVs
db 20, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 495 ; HP
bigdw 495 ; Max HP
bigdw 77 ; Atk
bigdw 80 ; Def
bigdw 143 ; Spd
bigdw 166 ; SAtk
bigdw 250 ; SDef
db "HAPINASU@@@"
db SNORLAX
db LEFTOVERS
db ROCK_SLIDE, EARTHQUAKE, BLIZZARD, SHADOW_BALL
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 55000
bigdw 55000
bigdw 60000
bigdw 55000
bigdw 50000
dn 13, 13, 13, 13 ; DVs
db 10, 10, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 365 ; HP
bigdw 365 ; Max HP
bigdw 217 ; Atk
bigdw 156 ; Def
bigdw 105 ; Spd
bigdw 152 ; SAtk
bigdw 215 ; SDef
db "KABIGON@@@@"
db HOUNDOOM
db KINGS_ROCK
db CRUNCH, FLAMETHROWER, FAINT_ATTACK, ROAR
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 58000
bigdw 50000
bigdw 55000
bigdw 60000
bigdw 55000
dn 13, 13, 12, 13 ; DVs
db 15, 15, 20, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 245 ; HP
bigdw 245 ; Max HP
bigdw 187 ; Atk
bigdw 133 ; Def
bigdw 197 ; Spd
bigdw 217 ; SAtk
bigdw 175 ; SDef
db "HERUGA-@@@@"
db TYRANITAR
db LEFTOVERS
db EARTHQUAKE, CRUNCH, ROCK_SLIDE, HYPER_BEAM
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 45000
bigdw 50000
bigdw 45000
dn 13, 11, 13, 15 ; DVs
db 10, 15, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 279 ; HP
bigdw 279 ; Max HP
bigdw 247 ; Atk
bigdw 211 ; Def
bigdw 147 ; Spd
bigdw 196 ; SAtk
bigdw 203 ; SDef
db "BANGIRASU@@"
db ZAPDOS
db GOLD_BERRY
db THUNDERBOLT, DRILL_PECK, THUNDER_WAVE, HYPER_BEAM
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 13, 11, 13, 15 ; DVs
db 15, 20, 20, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 264 ; HP
bigdw 264 ; Max HP
bigdw 187 ; Atk
bigdw 177 ; Def
bigdw 200 ; Spd
bigdw 238 ; SAtk
bigdw 189 ; SDef
db "SANDA-@@@@@"
db EXEGGUTOR
db MIRACLEBERRY
db REST, EXPLOSION, PSYCHIC_M, GIGA_DRAIN
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 45000
dn 13, 13, 14, 13 ; DVs
db 10, 5, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 268 ; HP
bigdw 268 ; Max HP
bigdw 194 ; Atk
bigdw 177 ; Def
bigdw 140 ; Spd
bigdw 235 ; SAtk
bigdw 151 ; SDef
db "NAtuSI-@@@@"
db UMBREON
db GOLD_BERRY
db MOONLIGHT, FAINT_ATTACK, PSYCHIC_M, SHADOW_BALL
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
bigdw 50000
dn 15, 13, 14, 11 ; DVs
db 5, 20, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 269 ; HP
bigdw 269 ; Max HP
bigdw 155 ; Atk
bigdw 214 ; Def
bigdw 152 ; Spd
bigdw 142 ; SAtk
bigdw 240 ; SDef
db "BURAtuKI-@@"
db GYARADOS
db BRIGHTPOWDER
db SURF, THUNDERBOLT, HYPER_BEAM, ROAR
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 55000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 11, 14, 15 ; DVs
db 15, 15, 5, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 271 ; HP
bigdw 271 ; Max HP
bigdw 235 ; Atk
bigdw 169 ; Def
bigdw 178 ; Spd
bigdw 148 ; SAtk
bigdw 204 ; SDef
db "GIyaRADOSU@"
db QUAGSIRE
db MIRACLEBERRY
db EARTHQUAKE, SURF, SLUDGE_BOMB, IRON_TAIL
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 13, 14, 13, 13 ; DVs
db 10, 15, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 266 ; HP
bigdw 266 ; Max HP
bigdw 180 ; Atk
bigdw 180 ; Def
bigdw 110 ; Spd
bigdw 152 ; SAtk
bigdw 152 ; SDef
db "NUO-@@@@@@@"
db URSARING
db SCOPE_LENS
db SLASH, EARTHQUAKE, HYPER_BEAM, THUNDERPUNCH
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 50000
dn 15, 13, 14, 13 ; DVs
db 20, 10, 5, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 262 ; HP
bigdw 262 ; Max HP
bigdw 245 ; Atk
bigdw 166 ; Def
bigdw 138 ; Spd
bigdw 166 ; SAtk
bigdw 166 ; SDef
db "RINGUMA@@@@"
db MR__MIME
db KINGS_ROCK
db REFLECT, FIRE_PUNCH, PSYCHIC_M, ENCORE
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 45000
bigdw 50000
bigdw 50000
dn 11, 13, 15, 11 ; DVs
db 20, 15, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 195 ; HP
bigdw 195 ; Max HP
bigdw 120 ; Atk
bigdw 151 ; Def
bigdw 190 ; Spd
bigdw 198 ; SAtk
bigdw 226 ; SDef
db "BARIYA-DO@@"
db PRIMEAPE
db QUICK_CLAW
db CROSS_CHOP, ICE_PUNCH, THUNDERPUNCH, ROCK_SLIDE
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 50000
bigdw 50000
dn 11, 13, 14, 15 ; DVs
db 5, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 227 ; HP
bigdw 227 ; Max HP
bigdw 202 ; Atk
bigdw 145 ; Def
bigdw 196 ; Spd
bigdw 148 ; SAtk
bigdw 162 ; SDef
db "OKORIZARU@@"
db GIRAFARIG
db GOLD_BERRY
db AGILITY, BATON_PASS, CRUNCH, EARTHQUAKE
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 13 ; DVs
db 30, 40, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 231 ; HP
bigdw 231 ; Max HP
bigdw 176 ; Atk
bigdw 154 ; Def
bigdw 183 ; Spd
bigdw 187 ; SAtk
bigdw 152 ; SDef
db "KIRINRIKI@@"
db HITMONLEE
db FOCUS_BAND
db REVERSAL, ENDURE, BODY_SLAM, MEGA_KICK
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 14 ; DVs
db 15, 10, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 202 ; HP
bigdw 202 ; Max HP
bigdw 232 ; Atk
bigdw 137 ; Def
bigdw 186 ; Spd
bigdw 112 ; SAtk
bigdw 217 ; SDef
db "SAWAMURA-@@"
db HERACROSS
db BRIGHTPOWDER
db REVERSAL, ENDURE, MEGAHORN, EARTHQUAKE
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 7, 15, 7 ; DVs
db 15, 10, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 251 ; HP
bigdw 251 ; Max HP
bigdw 239 ; Atk
bigdw 158 ; Def
bigdw 183 ; Spd
bigdw 109 ; SAtk
bigdw 186 ; SDef
db "HERAKUROSU@"
db VENUSAUR
db BRIGHTPOWDER
db SUNNY_DAY, SOLARBEAM, SYNTHESIS, HYPER_BEAM
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 6, 4, 4 ; DVs
db 5, 10, 5, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 233 ; HP
bigdw 233 ; Max HP
bigdw 159 ; Atk
bigdw 159 ; Def
bigdw 152 ; Spd
bigdw 180 ; SAtk
bigdw 180 ; SDef
db "HUSIGIBANA@"
db CHARIZARD
db SCOPE_LENS
db SLASH, EARTHQUAKE, HYPER_BEAM, FLAMETHROWER
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 5, 6, 4, 4 ; DVs
db 20, 10, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 230 ; HP
bigdw 230 ; Max HP
bigdw 159 ; Atk
bigdw 152 ; Def
bigdw 180 ; Spd
bigdw 193 ; SAtk
bigdw 159 ; SDef
db "RIZA-DON@@@"
db BLASTOISE
db QUICK_CLAW
db HYDRO_PUMP, ICE_PUNCH, HYPER_BEAM, IRON_TAIL
dw 0 ; OT ID
dt 343000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 6, 6, 4 ; DVs
db 5, 15, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 70 ; Level
db 0, 0 ; Status
bigdw 231 ; HP
bigdw 231 ; Max HP
bigdw 161 ; Atk
bigdw 183 ; Def
bigdw 152 ; Spd
bigdw 159 ; SAtk
bigdw 187 ; SDef
db "KAMEtuKUSU@"
BattleTowerMons8:
db JOLTEON
db MIRACLEBERRY
db THUNDER_WAVE, THUNDERBOLT, IRON_TAIL, ROAR
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 60000
bigdw 55000
bigdw 60000
bigdw 55000
bigdw 55000
dn 15, 13, 14, 11 ; DVs
db 20, 15, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 263 ; HP
bigdw 263 ; Max HP
bigdw 179 ; Atk
bigdw 170 ; Def
bigdw 281 ; Spd
bigdw 245 ; SAtk
bigdw 221 ; SDef
db "SANDA-SU@@@"
db SNORLAX
db LEFTOVERS
db REST, BELLY_DRUM, SNORE, EARTHQUAKE
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 60000
bigdw 55000
bigdw 50000
bigdw 55500
bigdw 60000
dn 13, 11, 14, 13 ; DVs
db 10, 10, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 415 ; HP
bigdw 415 ; Max HP
bigdw 248 ; Atk
bigdw 170 ; Def
bigdw 121 ; Spd
bigdw 178 ; SAtk
bigdw 250 ; SDef
db "KABIGON@@@@"
db HOUNDOOM
db MINT_BERRY
db REST, CRUNCH, FLAMETHROWER, SUNNY_DAY
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 55000
bigdw 55000
bigdw 55000
dn 15, 13, 13, 11 ; DVs
db 10, 15, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 280 ; HP
bigdw 280 ; Max HP
bigdw 217 ; Atk
bigdw 152 ; Def
bigdw 224 ; Spd
bigdw 245 ; SAtk
bigdw 197 ; SDef
db "HERUGA-@@@@"
db TAUROS
db GOLD_BERRY
db EARTHQUAKE, BODY_SLAM, IRON_TAIL, HYPER_BEAM
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 50000
dn 15, 13, 13, 14 ; DVs
db 10, 15, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 276 ; HP
bigdw 276 ; Max HP
bigdw 233 ; Atk
bigdw 221 ; Def
bigdw 236 ; Spd
bigdw 135 ; SAtk
bigdw 183 ; SDef
db "KENTAROSU@@"
db LAPRAS
db MINT_BERRY
db REST, SURF, CONFUSE_RAY, PSYCHIC_M
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 15, 13, 11 ; DVs
db 10, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 366 ; HP
bigdw 366 ; Max HP
bigdw 205 ; Atk
bigdw 201 ; Def
bigdw 168 ; Spd
bigdw 202 ; SAtk
bigdw 218 ; SDef
db "RAPURASU@@@"
db TYRANITAR
db MIRACLEBERRY
db REST, CRUNCH, EARTHQUAKE, ROCK_SLIDE
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 15, 13, 11 ; DVs
db 10, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 318 ; HP
bigdw 318 ; Max HP
bigdw 286 ; Atk
bigdw 249 ; Def
bigdw 169 ; Spd
bigdw 218 ; SAtk
bigdw 226 ; SDef
db "BANGIRASU@@"
db GENGAR
db NO_ITEM
db THUNDERBOLT, SHADOW_BALL, CONFUSE_RAY, THIEF
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 55000
bigdw 50000
dn 13, 14, 13, 13 ; DVs
db 15, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 247 ; HP
bigdw 247 ; Max HP
bigdw 173 ; Atk
bigdw 165 ; Def
bigdw 248 ; Spd
bigdw 277 ; SAtk
bigdw 189 ; SDef
db "GENGA-@@@@@"
db FORRETRESS
db LEFTOVERS
db EXPLOSION, TOXIC, SOLARBEAM, SWAGGER
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 50000
dn 15, 13, 14, 13 ; DVs
db 5, 10, 10, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 273 ; HP
bigdw 273 ; Max HP
bigdw 217 ; Atk
bigdw 293 ; Def
bigdw 133 ; Spd
bigdw 165 ; SAtk
bigdw 165 ; SDef
db "HUoRETOSU@@"
db KINGDRA
db MINT_BERRY
db REST, SURF, BLIZZARD, DRAGONBREATH
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 40000
bigdw 55000
bigdw 50000
dn 15, 11, 14, 13 ; DVs
db 10, 15, 5, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 273 ; HP
bigdw 273 ; Max HP
bigdw 225 ; Atk
bigdw 214 ; Def
bigdw 209 ; Spd
bigdw 221 ; SAtk
bigdw 221 ; SDef
db "KINGUDORA@@"
db DRAGONITE
db GOLD_BERRY
db THUNDER_WAVE, SURF, THUNDERBOLT, OUTRAGE
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 45000
dn 13, 13, 13, 13 ; DVs
db 20, 15, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 303 ; HP
bigdw 303 ; Max HP
bigdw 284 ; Atk
bigdw 221 ; Def
bigdw 197 ; Spd
bigdw 228 ; SAtk
bigdw 228 ; SDef
db "KAIRIyu-@@@"
db PORYGON2
db LEFTOVERS
db PSYCHIC_M, RECOVER, HYPER_BEAM, TRI_ATTACK
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 40000
bigdw 55000
bigdw 50000
dn 13, 15, 14, 13 ; DVs
db 10, 20, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 293 ; HP
bigdw 293 ; Max HP
bigdw 197 ; Atk
bigdw 213 ; Def
bigdw 169 ; Spd
bigdw 237 ; SAtk
bigdw 221 ; SDef
db "PORIGON2@@@"
db JYNX
db QUICK_CLAW
db LOVELY_KISS, BLIZZARD, DREAM_EATER, PSYCHIC_M
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
dn 13, 15, 13, 15 ; DVs
db 10, 5, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 264 ; HP
bigdw 264 ; Max HP
bigdw 149 ; Atk
bigdw 127 ; Def
bigdw 221 ; Spd
bigdw 257 ; SAtk
bigdw 225 ; SDef
db "RU-ZIyuRA@@"
db MANTINE
db GOLD_BERRY
db SURF, CONFUSE_RAY, BLIZZARD, WING_ATTACK
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 40000
bigdw 45000
bigdw 40000
bigdw 45000
bigdw 50000
dn 13, 15, 13, 12 ; DVs
db 15, 10, 5, 35 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 256 ; HP
bigdw 256 ; Max HP
bigdw 132 ; Atk
bigdw 181 ; Def
bigdw 180 ; Spd
bigdw 196 ; SAtk
bigdw 292 ; SDef
db "MANTAIN@@@@"
db SKARMORY
db QUICK_CLAW
db STEEL_WING, FLY, MUD_SLAP, TOXIC
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 35000
bigdw 50000
bigdw 50000
dn 13, 13, 14, 15 ; DVs
db 25, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 258 ; HP
bigdw 258 ; Max HP
bigdw 196 ; Atk
bigdw 286 ; Def
bigdw 183 ; Spd
bigdw 137 ; SAtk
bigdw 185 ; SDef
db "EA-MUDO@@@@"
db MOLTRES
db CHARCOAL
db FLAMETHROWER, SKY_ATTACK, STEEL_WING, HYPER_BEAM
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 40000
bigdw 50000
dn 13, 13, 15, 14 ; DVs
db 15, 5, 25, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 300 ; HP
bigdw 300 ; Max HP
bigdw 225 ; Atk
bigdw 213 ; Def
bigdw 213 ; Spd
bigdw 271 ; SAtk
bigdw 207 ; SDef
db "HUaIYA-@@@@"
db AERODACTYL
db MIRACLEBERRY
db HYPER_BEAM, REST, EARTHQUAKE, ROAR
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 40000
bigdw 50000
dn 15, 15, 14, 13 ; DVs
db 5, 10, 10, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 282 ; HP
bigdw 282 ; Max HP
bigdw 237 ; Atk
bigdw 177 ; Def
bigdw 275 ; Spd
bigdw 165 ; SAtk
bigdw 189 ; SDef
db "PUTERA@@@@@"
db ELECTRODE
db KINGS_ROCK
db THUNDERBOLT, EXPLOSION, MIRROR_COAT, TOXIC
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 40000
bigdw 40000
bigdw 50000
dn 15, 15, 14, 15 ; DVs
db 15, 5, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 250 ; HP
bigdw 250 ; Max HP
bigdw 153 ; Atk
bigdw 181 ; Def
bigdw 291 ; Spd
bigdw 201 ; SAtk
bigdw 201 ; SDef
db "MARUMAIN@@@"
db DUGTRIO
db SCOPE_LENS
db SLASH, EARTHQUAKE, THIEF, MUD_SLAP
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 40000
dn 15, 13, 13, 13 ; DVs
db 20, 10, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 214 ; HP
bigdw 214 ; Max HP
bigdw 201 ; Atk
bigdw 145 ; Def
bigdw 261 ; Spd
bigdw 145 ; SAtk
bigdw 177 ; SDef
db "DAGUTORIO@@"
db VICTREEBEL
db QUICK_CLAW
db GIGA_DRAIN, SLUDGE_BOMB, HYPER_BEAM, TOXIC
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 5, 6, 5 ; DVs
db 5, 10, 5, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 260 ; HP
bigdw 260 ; Max HP
bigdw 217 ; Atk
bigdw 151 ; Def
bigdw 161 ; Spd
bigdw 207 ; SAtk
bigdw 143 ; SDef
db "UTUBOtuTO@@"
db PINSIR
db GOLD_BERRY
db HYPER_BEAM, SUBMISSION, STRENGTH, TOXIC
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 4, 6, 4 ; DVs
db 5, 25, 15, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 241 ; HP
bigdw 241 ; Max HP
bigdw 250 ; Atk
bigdw 205 ; Def
bigdw 185 ; Spd
bigdw 133 ; SAtk
bigdw 157 ; SDef
db "KAIROSU@@@@"
db GRANBULL
db BRIGHTPOWDER
db ROAR, SHADOW_BALL, HYPER_BEAM, THUNDERPUNCH
dw 0 ; OT ID
dt 512000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 6, 5, 7 ; DVs
db 20, 15, 5, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 80 ; Level
db 0, 0 ; Status
bigdw 286 ; HP
bigdw 286 ; Max HP
bigdw 242 ; Atk
bigdw 169 ; Def
bigdw 119 ; Spd
bigdw 146 ; SAtk
bigdw 146 ; SDef
db "GURANBURU@@"
BattleTowerMons9:
db UMBREON
db KINGS_ROCK
db FAINT_ATTACK, MUD_SLAP, MOONLIGHT, CONFUSE_RAY
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 55000
bigdw 60000
bigdw 55000
dn 15, 13, 14, 13 ; DVs
db 20, 10, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 349 ; HP
bigdw 349 ; Max HP
bigdw 203 ; Atk
bigdw 278 ; Def
bigdw 202 ; Spd
bigdw 188 ; SAtk
bigdw 314 ; SDef
db "BURAtuKI-@@"
db DRAGONITE
db QUICK_CLAW
db FIRE_BLAST, HYPER_BEAM, OUTRAGE, BLIZZARD
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 65000
bigdw 50000
bigdw 56000
bigdw 60000
bigdw 60000
dn 15, 13, 14, 13 ; DVs
db 5, 5, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 343 ; HP
bigdw 343 ; Max HP
bigdw 322 ; Atk
bigdw 252 ; Def
bigdw 229 ; Spd
bigdw 263 ; SAtk
bigdw 263 ; SDef
db "KAIRIyu-@@@"
db STARMIE
db LEFTOVERS
db RECOVER, THUNDERBOLT, SURF, PSYCHIC_M
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 55000
bigdw 60000
dn 13, 15, 13, 13 ; DVs
db 20, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 289 ; HP
bigdw 289 ; Max HP
bigdw 218 ; Atk
bigdw 239 ; Def
bigdw 287 ; Spd
bigdw 263 ; SAtk
bigdw 236 ; SDef
db "SUTA-MI-@@@"
db CLOYSTER
db LEFTOVERS
db EXPLOSION, BLIZZARD, SURF, ICY_WIND
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 13, 11, 13, 15 ; DVs
db 5, 5, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 266 ; HP
bigdw 266 ; Max HP
bigdw 248 ; Atk
bigdw 398 ; Def
bigdw 203 ; Spd
bigdw 234 ; SAtk
bigdw 162 ; SDef
db "PARUSIeN@@@"
db CROBAT
db GOLD_BERRY
db WING_ATTACK, HAZE, HYPER_BEAM, GIGA_DRAIN
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 12, 15 ; DVs
db 35, 30, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 325 ; HP
bigdw 325 ; Max HP
bigdw 243 ; Atk
bigdw 221 ; Def
bigdw 310 ; Spd
bigdw 207 ; SAtk
bigdw 225 ; SDef
db "KUROBAtuTO@"
db PORYGON2
db QUICK_CLAW
db TOXIC, PSYCHIC_M, RECOVER, PROTECT
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
dn 15, 13, 14, 13 ; DVs
db 10, 10, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 325 ; HP
bigdw 325 ; Max HP
bigdw 223 ; Atk
bigdw 239 ; Def
bigdw 190 ; Spd
bigdw 266 ; SAtk
bigdw 248 ; SDef
db "PORIGON2@@@"
db KINGDRA
db LEFTOVERS
db DRAGONBREATH, SURF, HYPER_BEAM, BLIZZARD
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 45000
dn 13, 15, 13, 14 ; DVs
db 20, 15, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 309 ; HP
bigdw 309 ; Max HP
bigdw 248 ; Atk
bigdw 255 ; Def
bigdw 230 ; Spd
bigdw 248 ; SAtk
bigdw 248 ; SDef
db "KINGUDORA@@"
db TYRANITAR
db QUICK_CLAW
db HYPER_BEAM, CRUNCH, EARTHQUAKE, ROCK_SLIDE
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 45000
bigdw 50000
dn 13, 15, 13, 14 ; DVs
db 5, 15, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 354 ; HP
bigdw 354 ; Max HP
bigdw 321 ; Atk
bigdw 279 ; Def
bigdw 185 ; Spd
bigdw 250 ; SAtk
bigdw 259 ; SDef
db "BANGIRASU@@"
db LAPRAS
db MINT_BERRY
db REST, SURF, THUNDERBOLT, PSYCHIC_M
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 55000
dn 11, 13, 14, 15 ; DVs
db 10, 15, 15, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 405 ; HP
bigdw 405 ; Max HP
bigdw 227 ; Atk
bigdw 221 ; Def
bigdw 187 ; Spd
bigdw 237 ; SAtk
bigdw 255 ; SDef
db "RAPURASU@@@"
db ESPEON
db GOLD_BERRY
db PSYCHIC_M, SHADOW_BALL, SUNNY_DAY, MORNING_SUN
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 13, 15, 14 ; DVs
db 10, 15, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 294 ; HP
bigdw 294 ; Max HP
bigdw 194 ; Atk
bigdw 185 ; Def
bigdw 282 ; Spd
bigdw 313 ; SAtk
bigdw 250 ; SDef
db "E-HUi@@@@@@"
db MACHAMP
db QUICK_CLAW
db CROSS_CHOP, VITAL_THROW, FIRE_BLAST, EARTHQUAKE
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 55000
bigdw 55000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 13, 14, 13 ; DVs
db 5, 10, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 337 ; HP
bigdw 337 ; Max HP
bigdw 314 ; Atk
bigdw 221 ; Def
bigdw 181 ; Spd
bigdw 194 ; SAtk
bigdw 230 ; SDef
db "KAIRIKI-@@@"
db SNORLAX
db MIRACLEBERRY
db FIRE_BLAST, SURF, EARTHQUAKE, HYPER_BEAM
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 13 ; DVs
db 5, 15, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 455 ; HP
bigdw 455 ; Max HP
bigdw 279 ; Atk
bigdw 199 ; Def
bigdw 135 ; Spd
bigdw 194 ; SAtk
bigdw 275 ; SDef
db "KABIGON@@@@"
db ARCANINE
db MINT_BERRY
db SUNNY_DAY, FLAMETHROWER, EXTREMESPEED, REST
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 45000
bigdw 55000
dn 13, 15, 13, 14 ; DVs
db 5, 15, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 336 ; HP
bigdw 336 ; Max HP
bigdw 274 ; Atk
bigdw 225 ; Def
bigdw 247 ; Spd
bigdw 262 ; SAtk
bigdw 226 ; SDef
db "UINDEi@@@@@"
db BLISSEY
db LEFTOVERS
db SOLARBEAM, SUNNY_DAY, SOFTBOILED, FIRE_BLAST
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 50000
dn 11, 13, 15, 14 ; DVs
db 10, 5, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 633 ; HP
bigdw 633 ; Max HP
bigdw 90 ; Atk
bigdw 95 ; Def
bigdw 180 ; Spd
bigdw 214 ; SAtk
bigdw 322 ; SDef
db "HAPINASU@@@"
db HOUNDOOM
db BRIGHTPOWDER
db FLAMETHROWER, CRUNCH, SUNNY_DAY, SOLARBEAM
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 50000
bigdw 50000
dn 13, 11, 15, 14 ; DVs
db 15, 15, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 309 ; HP
bigdw 309 ; Max HP
bigdw 235 ; Atk
bigdw 164 ; Def
bigdw 252 ; Spd
bigdw 277 ; SAtk
bigdw 223 ; SDef
db "HERUGA-@@@@"
db SKARMORY
db QUICK_CLAW
db SANDSTORM, STEEL_WING, TOXIC, RETURN
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 14, 15, 15, 7 ; DVs
db 10, 25, 10, 20 ; PP
db 255 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 279 ; HP
bigdw 279 ; Max HP
bigdw 223 ; Atk
bigdw 333 ; Def
bigdw 207 ; Spd
bigdw 139 ; SAtk
bigdw 193 ; SDef
db "EA-MUDO@@@@"
db SHUCKLE
db LEFTOVERS
db TOXIC, WRAP, PROTECT, ENCORE
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 14 ; DVs
db 10, 20, 10, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 203 ; HP
bigdw 203 ; Max HP
bigdw 99 ; Atk
bigdw 493 ; Def
bigdw 90 ; Spd
bigdw 97 ; SAtk
bigdw 493 ; SDef
db "TUBOTUBO@@@"
db FLAREON
db MINT_BERRY
db HYPER_BEAM, FLAMETHROWER, SHADOW_BALL, ROAR
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 7, 15, 7 ; DVs
db 5, 15, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 293 ; HP
bigdw 293 ; Max HP
bigdw 315 ; Atk
bigdw 175 ; Def
bigdw 198 ; Spd
bigdw 238 ; SAtk
bigdw 265 ; SDef
db "BU-SUTA-@@@"
db MILTANK
db LEFTOVERS
db MILK_DRINK, EARTHQUAKE, ATTRACT, BODY_SLAM
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 4, 7, 5, 7 ; DVs
db 10, 10, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 322 ; HP
bigdw 322 ; Max HP
bigdw 194 ; Atk
bigdw 245 ; Def
bigdw 232 ; Spd
bigdw 128 ; SAtk
bigdw 182 ; SDef
db "MIRUTANKU@@"
db TAUROS
db PINK_BOW
db THUNDERBOLT, HYPER_BEAM, ATTRACT, EARTHQUAKE
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 5, 7, 6 ; DVs
db 15, 5, 15, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 284 ; HP
bigdw 284 ; Max HP
bigdw 234 ; Atk
bigdw 223 ; Def
bigdw 254 ; Spd
bigdw 126 ; SAtk
bigdw 180 ; SDef
db "KENTAROSU@@"
db MUK
db QUICK_CLAW
db TOXIC, SLUDGE_BOMB, ATTRACT, GIGA_DRAIN
dw 0 ; OT ID
dt 729000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 5, 4, 4, 4 ; DVs
db 10, 10, 15, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 90 ; Level
db 0, 0 ; Status
bigdw 342 ; HP
bigdw 342 ; Max HP
bigdw 241 ; Atk
bigdw 185 ; Def
bigdw 140 ; Spd
bigdw 167 ; SAtk
bigdw 230 ; SDef
db "BETOBETON@@"
BattleTowerMons10:
db HOUNDOOM
db MINT_BERRY
db CRUNCH, FLAMETHROWER, ROAR, REST
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
dn 15, 13, 14, 13 ; DVs
db 15, 15, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 347 ; HP
bigdw 347 ; Max HP
bigdw 276 ; Atk
bigdw 192 ; Def
bigdw 284 ; Spd
bigdw 312 ; SAtk
bigdw 252 ; SDef
db "HERUGA-@@@@"
db MACHAMP
db QUICK_CLAW
db CROSS_CHOP, EARTHQUAKE, HYPER_BEAM, VITAL_THROW
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
dn 15, 13, 14, 15 ; DVs
db 5, 10, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 377 ; HP
bigdw 377 ; Max HP
bigdw 356 ; Atk
bigdw 252 ; Def
bigdw 204 ; Spd
bigdw 226 ; SAtk
bigdw 266 ; SDef
db "KAIRIKI-@@@"
db KINGDRA
db LEFTOVERS
db SURF, DRAGONBREATH, REST, TOXIC
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
bigdw 60000
dn 13, 15, 15, 14 ; DVs
db 15, 20, 10, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 349 ; HP
bigdw 349 ; Max HP
bigdw 282 ; Atk
bigdw 286 ; Def
bigdw 266 ; Spd
bigdw 284 ; SAtk
bigdw 284 ; SDef
db "KINGUDORA@@"
db JOLTEON
db BRIGHTPOWDER
db THUNDERBOLT, ROAR, THUNDER_WAVE, IRON_TAIL
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 30000
bigdw 50000
dn 15, 13, 15, 14 ; DVs
db 15, 20, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 323 ; HP
bigdw 323 ; Max HP
bigdw 220 ; Atk
bigdw 206 ; Def
bigdw 338 ; Spd
bigdw 308 ; SAtk
bigdw 278 ; SDef
db "SANDA-SU@@@"
db TAUROS
db KINGS_ROCK
db HYPER_BEAM, EARTHQUAKE, IRON_TAIL, THUNDERBOLT
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 13, 14, 15 ; DVs
db 5, 10, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 341 ; HP
bigdw 341 ; Max HP
bigdw 290 ; Atk
bigdw 276 ; Def
bigdw 308 ; Spd
bigdw 170 ; SAtk
bigdw 230 ; SDef
db "KENTAROSU@@"
db ARCANINE
db LEFTOVERS
db FLAMETHROWER, EXTREMESPEED, IRON_TAIL, HYPER_BEAM
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 50000
dn 13, 13, 14, 15 ; DVs
db 15, 5, 15, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 374 ; HP
bigdw 374 ; Max HP
bigdw 306 ; Atk
bigdw 246 ; Def
bigdw 281 ; Spd
bigdw 290 ; SAtk
bigdw 250 ; SDef
db "UINDEi@@@@@"
db CHARIZARD
db SCOPE_LENS
db FLAMETHROWER, EARTHQUAKE, SLASH, FLY
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 55000
bigdw 55000
dn 15, 14, 13, 15 ; DVs
db 15, 10, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 343 ; HP
bigdw 343 ; Max HP
bigdw 258 ; Atk
bigdw 247 ; Def
bigdw 289 ; Spd
bigdw 311 ; SAtk
bigdw 263 ; SDef
db "RIZA-DON@@@"
db ELECTRODE
db BRIGHTPOWDER
db THUNDER_WAVE, THUNDERBOLT, EXPLOSION, MIRROR_COAT
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 50000
bigdw 45000
bigdw 45000
dn 15, 11, 14, 15 ; DVs
db 20, 15, 5, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 309 ; HP
bigdw 309 ; Max HP
bigdw 190 ; Atk
bigdw 222 ; Def
bigdw 366 ; Spd
bigdw 248 ; SAtk
bigdw 248 ; SDef
db "MARUMAIN@@@"
db RHYDON
db MIRACLEBERRY
db SURF, EARTHQUAKE, HYPER_BEAM, ROCK_SLIDE
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 45000
dn 15, 13, 14, 15 ; DVs
db 15, 10, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 404 ; HP
bigdw 404 ; Max HP
bigdw 350 ; Atk
bigdw 329 ; Def
bigdw 168 ; Spd
bigdw 178 ; SAtk
bigdw 178 ; SDef
db "SAIDON@@@@@"
db STEELIX
db LEFTOVERS
db EARTHQUAKE, HYPER_BEAM, SWAGGER, CRUNCH
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 60000
bigdw 50000
dn 15, 13, 13, 14 ; DVs
db 10, 5, 15, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 343 ; HP
bigdw 343 ; Max HP
bigdw 260 ; Atk
bigdw 489 ; Def
bigdw 152 ; Spd
bigdw 198 ; SAtk
bigdw 218 ; SDef
db "HAGANE-RU@@"
db FEAROW
db KINGS_ROCK
db DRILL_PECK, STEEL_WING, HYPER_BEAM, MUD_SLAP
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 55000
bigdw 50000
bigdw 50000
bigdw 55000
bigdw 50000
dn 15, 13, 12, 15 ; DVs
db 20, 25, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 324 ; HP
bigdw 324 ; Max HP
bigdw 270 ; Atk
bigdw 216 ; Def
bigdw 287 ; Spd
bigdw 212 ; SAtk
bigdw 212 ; SDef
db "ONIDORIRU@@"
db MISDREAVUS
db FOCUS_BAND
db PERISH_SONG, MEAN_LOOK, PAIN_SPLIT, SHADOW_BALL
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 45000
bigdw 50000
bigdw 55000
bigdw 50000
bigdw 55000
dn 11, 13, 14, 15 ; DVs
db 5, 5, 20, 15 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 309 ; HP
bigdw 309 ; Max HP
bigdw 202 ; Atk
bigdw 209 ; Def
bigdw 258 ; Spd
bigdw 263 ; SAtk
bigdw 263 ; SDef
db "MUUMA@@@@@@"
db SNEASEL
db SCOPE_LENS
db SLASH, BLIZZARD, DREAM_EATER, FAINT_ATTACK
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 48000
bigdw 45000
bigdw 50000
dn 15, 13, 14, 15 ; DVs
db 20, 5, 15, 20 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 301 ; HP
bigdw 301 ; Max HP
bigdw 280 ; Atk
bigdw 195 ; Def
bigdw 316 ; Spd
bigdw 160 ; SAtk
bigdw 240 ; SDef
db "NIyu-RA@@@@"
db SCIZOR
db QUICK_CLAW
db STEEL_WING, HYPER_BEAM, SLASH, TOXIC
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 45000
dn 15, 11, 15, 14 ; DVs
db 25, 5, 20, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 333 ; HP
bigdw 333 ; Max HP
bigdw 350 ; Atk
bigdw 282 ; Def
bigdw 220 ; Spd
bigdw 196 ; SAtk
bigdw 246 ; SDef
db "HAtuSAMU@@@"
db BLISSEY
db LEFTOVERS
db THUNDERBOLT, BLIZZARD, FIRE_BLAST, SOFTBOILED
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 40000
bigdw 50000
bigdw 30000
bigdw 30000
dn 13, 13, 15, 14 ; DVs
db 15, 5, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 703 ; HP
bigdw 703 ; Max HP
bigdw 101 ; Atk
bigdw 106 ; Def
bigdw 188 ; Spd
bigdw 226 ; SAtk
bigdw 346 ; SDef
db "HAPINASU@@@"
db PILOSWINE
db MINT_BERRY
db REST, BLIZZARD, HYPER_BEAM, EARTHQUAKE
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 7 ; DVs
db 10, 5, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 387 ; HP
bigdw 387 ; Max HP
bigdw 290 ; Atk
bigdw 248 ; Def
bigdw 190 ; Spd
bigdw 194 ; SAtk
bigdw 194 ; SDef
db "INOMU-@@@@@"
db EXEGGUTOR
db QUICK_CLAW
db PSYCHIC_M, TOXIC, EXPLOSION, GIGA_DRAIN
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 14, 15, 14 ; DVs
db 10, 10, 5, 5 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 375 ; HP
bigdw 375 ; Max HP
bigdw 280 ; Atk
bigdw 258 ; Def
bigdw 200 ; Spd
bigdw 338 ; SAtk
bigdw 218 ; SDef
db "NAtuSI-@@@@"
db OMASTAR
db LEFTOVERS
db SURF, ANCIENTPOWER, BLIZZARD, TOXIC
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
bigdw 50000
dn 15, 11, 14, 7 ; DVs
db 15, 5, 5, 10 ; PP
db 100 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 331 ; HP
bigdw 331 ; Max HP
bigdw 210 ; Atk
bigdw 332 ; Def
bigdw 198 ; Spd
bigdw 304 ; SAtk
bigdw 214 ; SDef
db "OMUSUTA-@@@"
db GOLEM
db BRIGHTPOWDER
db EXPLOSION, EARTHQUAKE, ROCK_SLIDE, FIRE_BLAST
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 4, 4, 6 ; DVs
db 5, 10, 10, 5 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 329 ; HP
bigdw 329 ; Max HP
bigdw 282 ; Atk
bigdw 316 ; Def
bigdw 146 ; Spd
bigdw 170 ; SAtk
bigdw 190 ; SDef
db "GORO-NIya@@"
db HITMONCHAN
db FOCUS_BAND
db COUNTER, FIRE_PUNCH, THUNDERPUNCH, ICE_PUNCH
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 6, 7, 7, 6 ; DVs
db 20, 15, 15, 15 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 265 ; HP
bigdw 265 ; Max HP
bigdw 270 ; Atk
bigdw 220 ; Def
bigdw 214 ; Spd
bigdw 130 ; SAtk
bigdw 280 ; SDef
db "EBIWARA-@@@"
db LANTURN
db QUICK_CLAW
db SURF, RAIN_DANCE, ZAP_CANNON, CONFUSE_RAY
dw 0 ; OT ID
dt 1000000 ; Exp
; Stat exp
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
bigdw 30000
dn 7, 6, 5, 7 ; DVs
db 15, 5, 5, 10 ; PP
db 0 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data
db 100 ; Level
db 0, 0 ; Status
bigdw 425 ; HP
bigdw 425 ; Max HP
bigdw 178 ; Atk
bigdw 176 ; Def
bigdw 192 ; Spd
bigdw 214 ; SAtk
bigdw 214 ; SDef
db "RANTA-N@@@@"
|
beafix_benchmarks/BEAFIX_ALL_D3/production_inv1_1_repair.als | Kaixi26/org.alloytools.alloy | 0 | 1563 | //Line and OP: Line 28 <JEE>
//ORIGINAL: parts
//MUTATION: (c . parts)
open util/integer as integer
open util/ordering[Position] as ordering
sig Position {
}
sig Product {
}
sig Component extends Product {
parts : set Product,
cposition : one Position
}
sig Resource extends Product {
}
sig Robot {
rposition : one Position
}
pred inv1 []{
all c : Component | some (c . parts)
}
pred inv2 []{
all c : Component | c !in (c . (^ parts))
}
pred inv3 []{
(Component . cposition) in (Robot . rposition)
}
pred inv4 []{
all c : Component | ((c . parts) . cposition) in ((c . cposition) . (* ordering/prev[]))
}
pred inv1_OK []{
all c : Component | some (c . parts)
}
pred inv2_OK []{
all c : Component | c !in (c . (^ parts))
}
pred inv3_OK []{
(Component . cposition) in (Robot . rposition)
}
pred inv4_OK []{
all c : Component | ((c . parts) . cposition) in ((c . cposition) . (* ordering/prev[]))
}
assert inv1_Repaired {
inv1[] <=> inv1_OK[]
}
assert inv2_Repaired {
inv2[] <=> inv2_OK[]
}
assert inv3_Repaired {
inv3[] <=> inv3_OK[]
}
assert inv4_Repaired {
inv4[] <=> inv4_OK[]
}
check inv1_Repaired expect 0
check inv2_Repaired expect 0
check inv3_Repaired expect 0
check inv4_Repaired expect 0
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c55b11a.ada | best08618/asylo | 7 | 3718 | <gh_stars>1-10
-- C55B11A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT, IN 'FOR IN ST RANGE L .. R LOOP', THE PARAMETER IS OF
-- THE TYPE ST'BASE; THAT IS THAT IT CAN BE ASSIGNED TO OTHER
-- VARIABLES DECLARED WITH SOME OTHER SUBTYPES OF ST.
-- HISTORY:
-- DHH 08/15/88 CREATED ORIGINAL TEST.
WITH REPORT; USE REPORT;
PROCEDURE C55B11A IS
TYPE ENUM IS (A, B, C, D, E, F, G, H);
SUBTYPE ONE IS ENUM RANGE A .. H;
SUBTYPE TWO IS ENUM RANGE B .. H;
SUBTYPE THREE IS ENUM RANGE C .. H;
SUBTYPE FOUR IS ENUM RANGE D .. H;
GLOBAL : INTEGER := 0;
VAR_1 : ONE;
VAR_2 : TWO;
VAR_3 : THREE;
VAR_4 : FOUR;
PROCEDURE CHECK_VAR(T : ENUM) IS
BEGIN
GLOBAL := GLOBAL + 1;
CASE T IS
WHEN D =>
IF GLOBAL /= IDENT_INT(1) THEN
FAILED("VAR_1 WRONG VALUE");
END IF;
WHEN E =>
IF GLOBAL /= IDENT_INT(2) THEN
FAILED("VAR_2 WRONG VALUE");
END IF;
WHEN F =>
IF GLOBAL /= IDENT_INT(3) THEN
FAILED("VAR_3 WRONG VALUE");
END IF;
WHEN G =>
IF GLOBAL /= IDENT_INT(4) THEN
FAILED("VAR_4 WRONG VALUE");
END IF;
WHEN OTHERS =>
FAILED("WRONG VALUE TO PROCEDURE");
END CASE;
END CHECK_VAR;
BEGIN
TEST("C55B11A", "CHECK THAT, IN 'FOR IN ST RANGE L .. R LOOP', " &
"THE PARAMETER IS OF THE TYPE ST'BASE; THAT IS " &
"THAT IT CAN BE ASSIGNED TO OTHER VARIABLES " &
"DECLARED WITH SOME OTHER SUBTYPES OF ST");
FOR I IN ONE RANGE D .. G LOOP
CASE I IS
WHEN D =>
VAR_1 := I;
CHECK_VAR(VAR_1);
WHEN E =>
VAR_2 := I;
CHECK_VAR(VAR_2);
WHEN F =>
VAR_3 := I;
CHECK_VAR(VAR_3);
WHEN G =>
VAR_4 := I;
CHECK_VAR(VAR_4);
END CASE;
END LOOP;
RESULT;
END C55B11A;
|
src/exercices/Commerce.agda | d-plaindoux/colca | 2 | 12143 | <reponame>d-plaindoux/colca
--
-- Created by Dependently-Typed Lambda Calculus on 2020-09-23
-- Commerce
-- Author: dplaindoux
--
{-# OPTIONS --without-K --safe #-}
module Commerce where
open import Relation.Nullary using (Reflects; Dec; yes; no)
open import Data.Bool using (Bool; true; false)
open import Data.Nat using (ℕ; _+_; _≥?_; _≥_)
open import Agda.Builtin.Nat using (_-_)
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎; step-≡)
module Customer where
record Account : Set where
field
balance : ℕ
account : ℕ -> Account
account n = record { balance = n }
_↑_ : Account → ℕ → Account
c ↑ n = account (Account.balance c + n)
_↓_ : Account → ℕ → Account
c ↓ n = account (Account.balance c - n )
infixl 50 _↑_
infixl 50 _↓_
module Product where
record Item : Set where
field
price : ℕ
data Basket : Set where
∅ : Basket
_then_ : Item → Basket → Basket
total : Basket → ℕ
total ∅ = 0
total (a then b) = Item.price a + total b
module Payment where
open Customer
open Product
pay : (c : Account) → (p : Basket) → {Account.balance c ≥ total p} → Account
pay c p = c ↓ total p
module Front where
pay? : Account → Basket → Account
pay? c p with Account.balance c ≥? total p
... | yes proof = pay c p {proof}
... | no _ = c |
src/main/fragment/mos6502-common/vbsm1=pbsc1_derefidx_vbuyy_minus_pbsc2_derefidx_vbuyy.asm | jbrandwood/kickc | 2 | 12294 | sec
lda {c1},y
sbc {c2},y
sta {m1}
|
kernel/groovy/src/main/antlr4/GroovyLexer.g4 | altavir/beakerx | 7 | 2711 | /*
* Copyright 2014 TWO SIGMA OPEN SOURCE, LLC
*
* 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.
*/
lexer grammar GroovyLexer;
@members {
enum Brace {
ROUND,
SQUARE,
CURVE,
};
java.util.Deque<Brace> braceStack = new java.util.ArrayDeque<Brace>();
Brace topBrace = null;
int lastTokenType = 0;
long tokenIndex = 0;
long tlePos = 0;
@Override public Token nextToken() {
if (!(_interp instanceof PositionAdjustingLexerATNSimulator))
_interp = new PositionAdjustingLexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
return super.nextToken();
}
public void emit(Token token) {
tokenIndex++;
lastTokenType = token.getType();
//System.out.println("EM: " + tokenNames[lastTokenType != -1 ? lastTokenType : 0] + ": " + lastTokenType + " TLE = " + (tlePos == tokenIndex) + " " + tlePos + "/" + tokenIndex + " " + token.getText());
if (token.getType() == ROLLBACK_ONE) {
((PositionAdjustingLexerATNSimulator)getInterpreter()).resetAcceptPosition(getInputStream(), _tokenStartCharIndex - 1, _tokenStartLine, _tokenStartCharPositionInLine - 1);
}
super.emit(token);
}
public void pushBrace(Brace b) {
braceStack.push(b);
topBrace = braceStack.peekFirst();
//System.out.println("> " + topBrace);
}
public void popBrace() {
braceStack.pop();
topBrace = braceStack.peekFirst();
//System.out.println("> " + topBrace);
}
public boolean isSlashyStringAlowed() {
java.util.List<Integer> ints = java.util.Arrays.asList(PLUS, NOT, BNOT, MULT); // FIXME add more operators.
//System.out.println("SP: " + " TLECheck = " + (tlePos == tokenIndex) + " " + tlePos + "/" + tokenIndex);
boolean isLastTokenOp = ints.contains(Integer.valueOf(lastTokenType));
boolean res = isLastTokenOp || tlePos == tokenIndex;
//System.out.println("SP: " + tokenNames[lastTokenType] + ": " + lastTokenType + " res " + res + (res ? ( isLastTokenOp ? " op" : " tle") : ""));
return res;
}
}
LINE_COMMENT: '//' .*? '\n' -> type(NL) ;
BLOCK_COMMENT: '/*' .*? '*/' -> type(NL) ;
SHEBANG_COMMENT: { tokenIndex == 0 }? '#!' .*? '\n' -> skip ;
WS: [ \t]+ -> skip ;
LPAREN : '(' { pushBrace(Brace.ROUND); tlePos = tokenIndex + 1; } -> pushMode(DEFAULT_MODE) ;
RPAREN : ')' { popBrace(); } -> popMode ;
LBRACK : '[' { pushBrace(Brace.SQUARE); tlePos = tokenIndex + 1; } -> pushMode(DEFAULT_MODE) ;
RBRACK : ']' { popBrace(); } -> popMode ;
LCURVE : '{' { pushBrace(Brace.CURVE); tlePos = tokenIndex + 1; } -> pushMode(DEFAULT_MODE) ;
RCURVE : '}' { popBrace(); } -> popMode ;
MULTILINE_STRING:
('\'\'\'' STRING_ELEMENT*? '\'\'\''
| '"""' STRING_ELEMENT*? '"""'
| '\'' STRING_ELEMENT*? (NL | '\'')
| '"' STRING_ELEMENT*? (NL | '"')) -> type(STRING)
;
SLASHY_STRING: '/' { isSlashyStringAlowed() }? SLASHY_STRING_ELEMENT*? '/' -> type(STRING) ;
STRING: '"' DQ_STRING_ELEMENT*? '"' | '\'' QUOTED_STRING_ELEMENT*? '\'' ;
GSTRING_START: '"' DQ_STRING_ELEMENT*? '$' -> pushMode(DOUBLE_QUOTED_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE) ;
SLASHY_GSTRING_START: '/' SLASHY_STRING_ELEMENT*? '$' -> type(GSTRING_START), pushMode(SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE) ;
fragment SLASHY_STRING_ELEMENT: SLASHY_ESCAPE | ~('$' | '/') ;
fragment STRING_ELEMENT: ESC_SEQUENCE | ~('$') ;
fragment QUOTED_STRING_ELEMENT: ESC_SEQUENCE | ~('\'') ;
fragment DQ_STRING_ELEMENT: ESC_SEQUENCE | ~('"' | '$') ;
mode DOUBLE_QUOTED_GSTRING_MODE ;
GSTRING_END: '"' -> popMode ;
GSTRING_PART: '$' -> pushMode(GSTRING_TYPE_SELECTOR_MODE) ;
GSTRING_ELEMENT: (ESC_SEQUENCE | ~('$' | '"')) -> more ;
mode SLASHY_GSTRING_MODE ;
SLASHY_GSTRING_END: '/' -> type(GSTRING_END), popMode ;
SLASHY_GSTRING_PART: '$' -> type(GSTRING_PART), pushMode(GSTRING_TYPE_SELECTOR_MODE) ;
SLASHY_GSTRING_ELEMENT: (SLASHY_ESCAPE | ~('$' | '/')) -> more ;
mode GSTRING_TYPE_SELECTOR_MODE ; // We drop here after exiting curved brace?
GSTRING_BRACE_L: '{' { pushBrace(Brace.CURVE); tlePos = tokenIndex + 1; } -> type(LCURVE), popMode, pushMode(DEFAULT_MODE) ;
GSTRING_ID: [A-Za-z_][A-Za-z0-9_]* -> type(IDENTIFIER), popMode, pushMode(GSTRING_PATH) ;
mode GSTRING_PATH ;
GSTRING_PATH_PART: '.' [A-Za-z_][A-Za-z0-9_]* ;
ROLLBACK_ONE: . -> popMode, channel(HIDDEN) ; // This magic is for exit this state if
mode DEFAULT_MODE ;
fragment SLASHY_ESCAPE: '\\' '/' ;
fragment ESC_SEQUENCE: '\\' [btnfr"'\\] | OCTAL_ESC_SEQ ;
fragment OCTAL_ESC_SEQ: '\\' [0-3]? [0-7]? [0-7] ;
// Numbers
DECIMAL: SIGN? DIGITS ('.' DIGITS EXP_PART? | EXP_PART) DECIMAL_TYPE_MODIFIER? ;
INTEGER: SIGN? (('0x' | '0X') HEX_DIGITS | '0' OCT_DIGITS | DEC_DIGITS) INTEGER_TYPE_MODIFIER? ;
fragment DIGITS: [0-9] | [0-9][0-9_]*[0-9] ;
fragment DEC_DIGITS: [0-9] | [1-9][0-9_]*[0-9] ;
fragment OCT_DIGITS: [0-7] | [0-7][0-7_]*[0-7] ;
fragment HEX_DIGITS: [0-9abcdefABCDEF] | [0-9abcdefABCDEF][0-9abcdefABCDEF_]*[0-9abcdefABCDEF] ; // Simplify by extracting one digit element?
fragment SIGN: ('-'|'+') ;
fragment EXP_PART: ([eE] SIGN? [0-9]+) ;
fragment INTEGER_TYPE_MODIFIER: ('G' | 'L' | 'I' | 'g' | 'l' | 'i') ;
fragment DECIMAL_TYPE_MODIFIER: ('G' | 'D' | 'F' | 'g' | 'd' | 'f') ;
KW_CLASS: 'class' ;
KW_INTERFACE: 'interface' ;
KW_ENUM: 'enum' ;
KW_PACKAGE: 'package' ;
KW_IMPORT: 'import' ;
KW_EXTENDS: 'extends' ;
KW_IMPLEMENTS: 'implements' ;
KW_DEF: 'def' ;
KW_NULL: 'null' ;
KW_TRUE: 'true' ;
KW_FALSE: 'false' ;
KW_NEW: 'new' ;
KW_SUPER: 'super' ;
KW_IN: 'in' ;
KW_FOR: 'for' ;
KW_IF: 'if' ;
KW_ELSE: 'else' ;
KW_WHILE: 'while' ;
KW_SWITCH: 'switch' ;
KW_CASE: 'case' ;
KW_DEFAULT: 'default' ;
KW_CONTINUE: 'continue' ;
KW_BREAK: 'break' ;
KW_RETURN: 'return' ;
KW_TRY: 'try' ;
KW_CATCH: 'catch' ;
KW_FINALLY: 'finally' ;
KW_THROW: 'throw' ;
KW_THROWS: 'throws' ;
RUSHIFT_ASSIGN: '>>>=' ;
RSHIFT_ASSIGN: '>>=' ;
LSHIFT_ASSIGN: '<<=' ;
//RUSHIFT: '>>>' ;
SPACESHIP: '<=>' ;
SAFE_DOT: '?.' ;
STAR_DOT: '*.' ;
ATTR_DOT: '.@' ;
LTE: '<=' ;
GTE: '>=' ;
CLOSURE_ARG_SEPARATOR: '->' ;
DECREMENT: '--' ;
INCREMENT: '++' ;
POWER: '**' ;
LSHIFT: '<<' ;
//RSHIFT: '>>' ;
RANGE: '..' ;
ORANGE: '..<' ;
EQUAL: '==' ;
UNEQUAL: '!=' ;
MATCH: '==~' ;
FIND: '=~' ;
AND: '&&' ;
OR: '||' ;
PLUS_ASSIGN: '+=' ;
MINUS_ASSIGN: '-=' ;
MULT_ASSIGN: '*=' ;
DIV_ASSIGN: '/=' ;
MOD_ASSIGN: '%=' ;
BAND_ASSIGN: '&=' ;
XOR_ASSIGN: '^=' ;
BOR_ASSIGN: '|=' ;
SEMICOLON: ';' ;
DOT: '.' ;
COMMA: ',' ;
AT: '@' ;
ASSIGN: '=' ;
LT: '<' ;
GT: '>' ;
COLON: ':' ;
BOR: '|' ;
NOT: '!' ;
BNOT: '~' ;
MULT: '*' ;
DIV: '/' ;
MOD: '%' ;
PLUS: '+' ;
MINUS: '-' ;
BAND: '&' ;
XOR: '^' ;
QUESTION: '?' ;
KW_AS: 'as' ;
KW_INSTANCEOF: 'instanceof' ;
// Modifiers
VISIBILITY_MODIFIER: (KW_PUBLIC | KW_PROTECTED | KW_PRIVATE) ;
fragment KW_PUBLIC: 'public' ;
fragment KW_PROTECTED: 'protected' ;
fragment KW_PRIVATE: 'private' ;
KW_ABSTRACT: 'abstract' ;
KW_STATIC: 'static' ;
KW_FINAL: 'final' ; // Class
KW_TRANSIENT: 'transient' ; // methods and fields
KW_NATIVE: 'native' ; // Methods and fields, as fields are accesors in Groovy.
KW_VOLATILE: 'volatile' ; // Fields only
KW_SYNCHRONIZED: 'synchronized' ; // Methods and fields.
KW_STRICTFP: 'strictfp';
/** Nested newline within a (..) or [..] are ignored. */
IGNORE_NEWLINE : '\r'? '\n' { topBrace == Brace.ROUND || topBrace == Brace.SQUARE }? -> skip ;
// Match both UNIX and Windows newlines
NL: '\r'? '\n';
IDENTIFIER: [A-Za-z_$][A-Za-z0-9_$]*;
|
WebAppsGenerator.Core/Grammar/SneakParser.g4 | drajwer/web-apps-generator | 0 | 5663 | parser grammar SneakParser;
options { tokenVocab=SneakLexer; }
compileUnit : EOF
;
file : classDefs
;
classDefs : classDef classDefs
| /* epsilon */
;
classDef : annotations CLASS ID NEWLINE body
;
body : INDENT properties DEDENT
| /* epsilon */
;
properties : (property NEWLINE)* property NEWLINE?
;
property : annotations ID COLON TYPE
;
annotations : (annotation NEWLINE)*
;
annotation : HASH ID params
;
params : /* epsilon */
| '(' paramlist ')'
;
paramlist : (param COMMA)* param
;
param : ID
| ID '=' VALUE
; |
programs/oeis/037/A037537.asm | neoneye/loda | 22 | 178824 | ; A037537: Base-4 digits are, in order, the first n terms of the periodic sequence with initial period 1,2,1.
; 1,6,25,101,406,1625,6501,26006,104025,416101,1664406,6657625,26630501,106522006,426088025,1704352101,6817408406,27269633625,109078534501,436314138006,1745256552025,6981026208101,27924104832406
mov $1,4
pow $1,$0
mul $1,100
div $1,63
mov $0,$1
|
Des_Ada/src/p_stephandler.adb | VMika/Des_Ada | 0 | 4313 | <filename>Des_Ada/src/p_stephandler.adb<gh_stars>0
with Ada.Text_IO; use Ada.Text_IO;
with P_StructuralTypes;
use P_StructuralTypes;
package body P_stephandler is
function Get_NextHandler (Self : in out T_StepHandler) return Ptr_Handler is
begin
return Self.NextHandler;
end;
procedure Set_NextHandler (Self : in out T_StepHandler;
Ptr_StepHandler : Ptr_Handler) is
begin
Self.NextHandler := Ptr_StepHandler;
end;
procedure Set_BinaryContainer (Self : in out T_StepHandler;
Ptr_BinaryContainer : BinaryContainer_Access) is
begin
Self.Ptr_BinaryContainer := Ptr_BinaryContainer;
end;
function Get_BinaryContainer (Self : in out T_StepHandler)
return BinaryContainer_Access is
begin
return Self.Ptr_BinaryContainer;
end;
end P_stephandler;
|
8088/cga/1024colors/1024.asm | reenigne/reenigne | 92 | 22396 | <reponame>reenigne/reenigne<filename>8088/cga/1024colors/1024.asm
org 0
cpu 8086
cli
; Copy data
mov ax,cs
mov ds,ax
mov ax,0xb800
mov es,ax
mov cx,8000
mov si,data
xor di,di
cld
rep movsw
; Scanline 0 = row 0 of 2-line screen (Address 0 = blank)
; Scanline 1 = row 1 of 2-line screen (Address 160 = pixel line 0)
; Scanline 2 = row 0 of 2-line screen (Address 160 = pixel line 0)
; Scanline 3 = row 1 of 2-line screen (Address 320 = pixel line 1)
; ...
; Scanline 198 = row 0 of 2-line screen (Address 15840 = pixel line 98)
; Scanline 199 = row 1 of 2-line screen (Address 16000 = pixel line 99)
; Scanline 200 = row 0 of 62-line screen (Address 16000 = pixel line 99)
; Scanline 201 = row 1 of 62-line screen (Address 16160 = blank)
; ...
; Scanline 224 = row 24 of 62-line screen - sync start
; ...
; Scanline 261 = row 61 of 62-line screen
; Mode 09
; 1 +HRES 1
; 2 +GRPH 0
; 4 +BW 0
; 8 +VIDEO ENABLE 8
; 0x10 +1BPP 0
; 0x20 +ENABLE BLINK 0
mov dx,0x3d8
mov al,0x09
out dx,al
; Palette 00
; 1 +OVERSCAN B 0
; 2 +OVERSCAN G 2
; 4 +OVERSCAN R 4
; 8 +OVERSCAN I 0
; 0x10 +BACKGROUND I 0
; 0x20 +COLOR SEL 0
inc dx
mov al,0
out dx,al
mov dl,0xd4
; 0xff Horizontal Total 71
mov ax,0x7100
out dx,ax
; 0xff Horizontal Displayed 50
mov ax,0x5001
out dx,ax
; 0xff Horizontal Sync Position 5a
mov ax,0x5a02
out dx,ax
; 0x0f Horizontal Sync Width 0d
mov ax,0x0003
out dx,ax
; 0x7f Vertical Total 3d
mov ax,0x3d04
out dx,ax
; 0x1f Vertical Total Adjust 00
mov ax,0x0005
out dx,ax
; 0x7f Vertical Displayed 02
mov ax,0x0206
out dx,ax
; 0x7f Vertical Sync Position 18
mov ax,0x1807
out dx,ax
; 0x03 Interlace Mode 02
mov ax,0x0208
out dx,ax
; 0x1f Max Scan Line Address 00
mov ax,0x0009
out dx,ax
; Cursor Start 06
; 0x1f Cursor Start 6
; 0x60 Cursor Mode 0
mov ax,0x060a
out dx,ax
; 0x1f Cursor End 07
mov ax,0x070b
out dx,ax
; 0x3f Start Address (H) 00
mov ax,0x000c
out dx,ax
; 0xff Start Address (L) 00
mov ax,0x000d
out dx,ax
; 0x3f Cursor (H) 03
mov ax,0x030e
out dx,ax
; 0xff Cursor (L) c0
mov ax,0xc00f
out dx,ax
%macro waitForDisplayEnable 0
%%waitForDisplayEnable
in al,dx ; 1 1 2
test al,1 ; 2 0 2
jnz %%waitForDisplayEnable ; 2 0 2
%endmacro
%macro waitForDisplayDisable 0
%%waitForDisplayDisable
in al,dx ; 1 1 2
test al,1 ; 2 0 2
jz %%waitForDisplayDisable ; 2 0 2
%endmacro
%macro waitForVerticalSync 0
%%waitForVerticalSync
in al,dx
test al,8
jz %%waitForVerticalSync
%endmacro
%macro waitForNoVerticalSync 0
%%waitForNoVerticalSync
in al,dx
test al,8
jnz %%waitForNoVerticalSync
%endmacro
mov dl,0xda
mov bx,80 ; Initial
mov cx,0 ; Frame counter
frameLoop:
waitForVerticalSync
waitForNoVerticalSync
; During line 0-1 we set up the start address for line 2 and change the vertical total to 0x01
waitForDisplayEnable
mov dl,0xd4
mov ax,0x0104 ; 4: Vertical total: 2 rows/frame
out dx,ax
mov dl,0xda
waitForDisplayDisable
waitForDisplayEnable
mov dl,0xd4
mov ah,bh
mov al,0x0c
out dx,ax ; Start address high
mov ah,bl
inc ax
out dx,ax ; Start address low
add bx,80 ; Next start address
mov dl,0xda
waitForDisplayDisable
; During lines 2..199 we set up the start address for the next line
%rep 99
waitForDisplayEnable
waitForDisplayDisable
waitForDisplayEnable
mov dl,0xd4
mov ah,bh
mov al,0x0c
out dx,ax ; Start address high
mov ah,bl
inc ax
out dx,ax ; Start address low
add bx,80 ; Next start address
mov dl,0xda
waitForDisplayDisable
%endrep
; During line 200 we set up the start address for line 0 and change the vertical total to 0x3d
waitForDisplayEnable
mov dl,0xd4
mov ax,0x3d04 ; 4: Vertical total: 62 rows/frame
out dx,ax
mov dl,0xda
waitForDisplayDisable
waitForDisplayEnable
mov dl,0xd4
mov ax,0x000c
out dx,ax ; Start address high
inc ax
out dx,ax ; Start address low
mov bx,80
mov dl,0xda
waitForDisplayDisable
; Take a screenshot after 1 second
inc cx
cmp cx,60
jne noScreenshot
; int 0x60
noScreenshot:
; Wait a further minute before exiting
cmp cx,3600*5
je finish
jmp frameLoop
finish:
; Set the CGA back to a normal mode so we don't risk breaking anything
mov ax,3
int 0x10
; Relinquish control
int 0x67
data:
;%rep 80
; db 0x00,0x00
;%endrep
;
;%assign i 0
;%rep 50
; %rep 2
; db 0x00,0x00
; %rep 26
; %rep 3
; %if (i & 0x3ff) < 256
; db 0x55
; %elif (i & 0x3ff) < 512
; db 0x13
; %elif (i & 0x3ff) < 768
; db 0xb0
; %else
; db 0xb1
; %endif
; db (i & 0xff)
; %endrep
; %assign i i+1
; %endrep
; db 0x00,0x00
; %assign i i-26
; %endrep
; %assign i i+26
;%endrep
;
;%rep 80
; db 0x00,0x00
;%endrep
|
programs/oeis/019/A019427.asm | neoneye/loda | 22 | 14881 | ; A019427: Continued fraction for tan(1/4).
; 0,3,1,10,1,18,1,26,1,34,1,42,1,50,1,58,1,66,1,74,1,82,1,90,1,98,1,106,1,114,1,122,1,130,1,138,1,146,1,154,1,162,1,170,1,178,1,186,1,194,1,202,1,210,1,218,1,226,1,234,1,242,1,250,1,258,1,266,1,274,1,282,1,290,1,298,1,306,1,314,1,322,1,330,1,338,1,346,1,354,1,362,1,370,1,378,1,386,1,394
mul $0,2
mov $3,$0
lpb $0
mov $1,$0
dif $0,2
cmp $2,0
add $3,$2
mod $1,$3
seq $1,92535 ; G.f.: (1+x^2)*(1+x^3)/((1-x)*(1-x^2)).
mul $1,2
min $3,1
lpe
div $1,2
mov $0,$1
|
FormalAnalyzer/models/apps/BrightenMyPath.als | Mohannadcse/IoTCOM_BehavioralRuleExtractor | 0 | 3732 | module app_BrightenMyPath
open IoTBottomUp as base
open cap_runIn
open cap_now
open cap_motionSensor
open cap_switch
one sig app_BrightenMyPath extends IoTApp {
motion1 : some cap_motionSensor,
switch1 : some cap_switch,
} {
rules = r
//capabilities = motion1 + switch1
}
abstract sig r extends Rule {}
one sig r0 extends r {}{
triggers = r0_trig
conditions = r0_cond
commands = r0_comm
}
abstract sig r0_trig extends Trigger {}
one sig r0_trig0 extends r0_trig {} {
capabilities = app_BrightenMyPath.motion1
attribute = cap_motionSensor_attr_motion
value = cap_motionSensor_attr_motion_val_active
}
abstract sig r0_cond extends Condition {}
abstract sig r0_comm extends Command {}
one sig r0_comm0 extends r0_comm {} {
capability = app_BrightenMyPath.switch1
attribute = cap_switch_attr_switch
value = cap_switch_attr_switch_val_on
}
|
programs/oeis/104/A104199.asm | neoneye/loda | 22 | 16969 | ; A104199: Lower bound on a straddle prime pair.
; 3,5,7,7,7,11,13,13,13,17,19,19,19,23,23,23,23,23,29,31,31,31,31,31,37,37,37,41,43,43,43,47,47,47,47,47,53,53,53,53,53,59,61,61,61,61,61,67,67,67,71,73,73,73,73,73,79,79,79,83,83,83,83,83,89,89,89,89,89,89,89
seq $0,73169 ; a(n)=A002808(n)-n, difference between n-th composite and n.
sub $0,2
seq $0,40 ; The prime numbers.
|
alloy4fun_models/trashltl/models/13/H4YSLohFCYukRuZxB.als | Kaixi26/org.alloytools.alloy | 0 | 4623 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idH4YSLohFCYukRuZxB_prop14 {
always Protected & Trash not in Protected
}
pred __repair { idH4YSLohFCYukRuZxB_prop14 }
check __repair { idH4YSLohFCYukRuZxB_prop14 <=> prop14o } |
test/Succeed/NewEquations.agda | alhassy/agda | 3 | 8923 | {-# OPTIONS --rewriting #-}
module NewEquations where
open import Common.Prelude hiding (map; _++_)
open import Common.Equality
infixr 5 _++_
map : ∀ {A B : Set} → (A → B) → List A → List B
map f [] = []
map f (x ∷ xs) = (f x) ∷ (map f xs)
_++_ : ∀ {A : Set} → List A → List A → List A
[] ++ ys = ys
(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
fold : ∀ {A B : Set} → (A → B → B) → B → List A → B
fold f v [] = v
fold f v (x ∷ xs) = f x (fold f v xs)
++-[] : ∀ {A} {xs : List A} → xs ++ [] ≡ xs
++-[] {xs = []} = refl
++-[] {xs = x ∷ xs} = cong (_∷_ x) ++-[]
++-assoc : ∀ {A} {xs ys zs : List A} → (xs ++ ys) ++ zs ≡ xs ++ (ys ++ zs)
++-assoc {xs = []} = refl
++-assoc {xs = x ∷ xs} = cong (_∷_ x) (++-assoc {xs = xs})
map-id : ∀ {A} {xs : List A} → map (λ x → x) xs ≡ xs
map-id {xs = []} = refl
map-id {xs = x ∷ xs} = cong (_∷_ x) map-id
map-fuse : ∀ {A B C} {f : B → C} {g : A → B} {xs : List A} → map f (map g xs) ≡ map (λ x → f (g x)) xs
map-fuse {xs = []} = refl
map-fuse {xs = x ∷ xs} = cong (_∷_ _) map-fuse
map-++ : ∀ {A B} {f : A → B} {xs ys : List A} → map f (xs ++ ys) ≡ (map f xs) ++ (map f ys)
map-++ {xs = []} = refl
map-++ {xs = x ∷ xs} = cong (_∷_ _) (map-++ {xs = xs})
fold-map : ∀ {A B C} {f : A → B} {c : B → C → C} {n : C} {xs : List A} →
fold c n (map f xs) ≡ fold (λ x → c (f x)) n xs
fold-map {xs = []} = refl
fold-map {c = c} {xs = x ∷ xs} = cong (c _) (fold-map {xs = xs})
fold-++ : ∀ {A B} {c : A → B → B} {n : B} {xs ys : List A} →
fold c n (xs ++ ys) ≡ fold c (fold c n ys) xs
fold-++ {xs = []} = refl
fold-++ {c = c} {xs = x ∷ xs} = cong (c _) (fold-++ {xs = xs})
{-# BUILTIN REWRITE _≡_ #-}
{-# REWRITE ++-[] #-}
{-# REWRITE ++-assoc #-}
{-# REWRITE map-id #-}
{-# REWRITE map-fuse #-}
{-# REWRITE map-++ #-}
{-# REWRITE fold-map #-}
{-# REWRITE fold-++ #-}
record _×_ (A B : Set) : Set where
constructor _,_
field
fst : A
snd : B
swap : ∀ {A B} → A × B → B × A
swap (x , y) = y , x
test₁ : ∀ {A B} {xs : List (A × B)} → map swap (map swap xs) ≡ xs
test₁ = refl
|
src/Interrupt.asm | sharksym/vgmplay-sharksym | 6 | 22268 | <reponame>sharksym/vgmplay-sharksym
;
; Interrupt handler (IM2 mode)
;
Interrupt_HEAPBLOCK_SIZE: equ 200H
Interrupt_HOOK_SIZE: equ 5
Interrupt: MACRO
table:
dw 0
entry:
dw 0
ENDM
; ix = this
Interrupt_Construct:
ld bc,Interrupt_HEAPBLOCK_SIZE
push ix
ld ix,Heap_main
call Heap_AllocateAligned
pop ix
ld a,d
cp 0C0H
call c,System_ThrowException
cp 100H - Interrupt_HOOK_SIZE
call nc,System_ThrowException
ld (ix + Interrupt.table),e
ld (ix + Interrupt.table + 1),d
ld a,d
inc a
ld (ix + Interrupt.entry),a
ld (ix + Interrupt.entry + 1),a
ld (de),a
ld l,e
ld h,d
inc de
ld bc,100H
ldir
ld l,a
ld h,a
ld (hl),0C3H ; jp
inc hl
ld (hl),38H
inc hl
ld (hl),00H
call System_CheckEIState
ld a,(ix + Interrupt.table + 1)
di
ld i,a
im 2
ret po
ei
ret
; ix = this
Interrupt_Destruct:
im 1
ld e,(ix + Interrupt.table)
ld d,(ix + Interrupt.table + 1)
ld bc,Interrupt_HEAPBLOCK_SIZE
push ix
ld ix,Heap_main
call Heap_Free
pop ix
ret
; hl = new handler address
; de = old hook
; ix = this
Interrupt_Hook:
push hl
ld l,(ix + Interrupt.entry)
ld h,(ix + Interrupt.entry + 1)
ld bc,Interrupt_HOOK_SIZE
ldir
pop de
ld l,(ix + Interrupt.entry)
ld h,(ix + Interrupt.entry + 1)
call System_CheckEIState
di
ld (hl),0C3H ; jp
inc hl
ld (hl),e
inc hl
ld (hl),d
ret po
ei
ret
;
SECTION RAM
Interrupt_instance: Interrupt
ENDS
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_m_geterr_callee.asm | Toysoft/z88dk | 0 | 179555 | <reponame>Toysoft/z88dk
; void esx_m_geterr(uint16_t error,unsigned char *msg)
SECTION code_esxdos
PUBLIC esx_m_geterr_callee
EXTERN asm_esx_m_geterr
esx_m_geterr_callee:
pop af
pop hl
pop de
push af
jp asm_esx_m_geterr
|
tools/scitools/conf/understand/ada/ada05/s-tpoben.ads | brucegua/moocos | 1 | 24513 | <reponame>brucegua/moocos
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . --
-- E N T R I E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains all the simple primitives related to
-- Protected_Objects with entries (i.e init, lock, unlock).
-- The handling of protected objects with no entries is done in
-- System.Tasking.Protected_Objects, the complex routines for protected
-- objects with entries in System.Tasking.Protected_Objects.Operations.
-- The split between Entries and Operations is needed to break circular
-- dependencies inside the run time.
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
with Ada.Finalization;
-- used for Limited_Controlled
with Unchecked_Conversion;
package System.Tasking.Protected_Objects.Entries is
pragma Elaborate_Body;
subtype Positive_Protected_Entry_Index is
Protected_Entry_Index range 1 .. Protected_Entry_Index'Last;
type Find_Body_Index_Access is access
function
(O : System.Address;
E : Protected_Entry_Index)
return Protected_Entry_Index;
type Protected_Entry_Body_Array is
array (Positive_Protected_Entry_Index range <>) of Entry_Body;
-- This is an array of the executable code for all entry bodies of
-- a protected type.
type Protected_Entry_Body_Access is access all Protected_Entry_Body_Array;
type Protected_Entry_Queue_Array is
array (Protected_Entry_Index range <>) of Entry_Queue;
-- This type contains the GNARL state of a protected object. The
-- application-defined portion of the state (i.e. private objects)
-- is maintained by the compiler-generated code.
-- note that there is a simplified version of this type declared in
-- System.Tasking.PO_Simple that handle the simple case (no entries).
type Protection_Entries (Num_Entries : Protected_Entry_Index) is new
Ada.Finalization.Limited_Controlled
with record
L : aliased Task_Primitives.Lock;
-- The underlying lock associated with a Protection_Entries.
-- Note that you should never (un)lock Object.L directly, but instead
-- use Lock_Entries/Unlock_Entries.
Compiler_Info : System.Address;
-- Pointer to compiler-generated record representing protected object
Call_In_Progress : Entry_Call_Link;
-- Pointer to the entry call being executed (if any)
Ceiling : System.Any_Priority;
-- Ceiling priority associated with the protected object
New_Ceiling : System.Any_Priority;
-- New ceiling priority associated to the protected object. In case
-- of assignment of a new ceiling priority to the protected object the
-- frontend generates a call to set_ceiling to save the new value in
-- this field. After such assignment this value can be read by means
-- of the 'Priority attribute, which generates a call to get_ceiling.
-- However, the ceiling of the protected object will not be changed
-- until completion of the protected action in which the assignment
-- has been executed (AARM D.5.2 (10/2)).
Owner : Task_Id;
-- This field contains the protected object's owner. Null_Task
-- indicates that the protected object is not currently being used.
-- This information is used for detecting the type of potentially
-- blocking operations described in the ARM 9.5.1, par. 15 (external
-- calls on a protected subprogram with the same target object as that
-- of the protected action).
Old_Base_Priority : System.Any_Priority;
-- Task's base priority when the protected operation was called
Pending_Action : Boolean;
-- Flag indicating that priority has been dipped temporarily in order
-- to avoid violating the priority ceiling of the lock associated with
-- this protected object, in Lock_Server. The flag tells Unlock_Server
-- or Unlock_And_Update_Server to restore the old priority to
-- Old_Base_Priority. This is needed because of situations (bad
-- language design?) where one needs to lock a PO but to do so would
-- violate the priority ceiling. For example, this can happen when an
-- entry call has been requeued to a lower-priority object, and the
-- caller then tries to cancel the call while its own priority is
-- higher than the ceiling of the new PO.
Finalized : Boolean := False;
-- Set to True by Finalize to make this routine idempotent
Entry_Bodies : Protected_Entry_Body_Access;
-- Pointer to an array containing the executable code for all entry
-- bodies of a protected type.
-- The following function maps the entry index in a call (which denotes
-- the queue to the proper entry) into the body of the entry.
Find_Body_Index : Find_Body_Index_Access;
Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries);
end record;
-- No default initial values for this type, since call records
-- will need to be re-initialized before every use.
type Protection_Entries_Access is access all Protection_Entries'Class;
-- See comments in s-tassta.adb about the implicit call to Current_Master
-- generated by this declaration.
function To_Address is
new Unchecked_Conversion (Protection_Entries_Access, System.Address);
function To_Protection is
new Unchecked_Conversion (System.Address, Protection_Entries_Access);
function Get_Ceiling
(Object : Protection_Entries_Access) return System.Any_Priority;
-- Returns the new ceiling priority of the protected object
function Has_Interrupt_Or_Attach_Handler
(Object : Protection_Entries_Access) return Boolean;
-- Returns True if an Interrupt_Handler or Attach_Handler pragma applies
-- to the protected object. That is to say this primitive returns False for
-- Protection, but is overriden to return True when interrupt handlers are
-- declared so the check required by C.3.1(11) can be implemented in
-- System.Tasking.Protected_Objects.Initialize_Protection.
procedure Initialize_Protection_Entries
(Object : Protection_Entries_Access;
Ceiling_Priority : Integer;
Compiler_Info : System.Address;
Entry_Bodies : Protected_Entry_Body_Access;
Find_Body_Index : Find_Body_Index_Access);
-- Initialize the Object parameter so that it can be used by the runtime
-- to keep track of the runtime state of a protected object.
procedure Lock_Entries (Object : Protection_Entries_Access);
-- Lock a protected object for write access. Upon return, the caller owns
-- the lock to this object, and no other call to Lock or Lock_Read_Only
-- with the same argument will return until the corresponding call to
-- Unlock has been made by the caller. Program_Error is raised in case of
-- ceiling violation.
procedure Lock_Entries
(Object : Protection_Entries_Access; Ceiling_Violation : out Boolean);
-- Same as above, but return the ceiling violation status instead of
-- raising Program_Error.
procedure Lock_Read_Only_Entries (Object : Protection_Entries_Access);
-- Lock a protected object for read access. Upon return, the caller owns
-- the lock for read access, and no other calls to Lock with the same
-- argument will return until the corresponding call to Unlock has been
-- made by the caller. Other calls to Lock_Read_Only may (but need not)
-- return before the call to Unlock, and the corresponding callers will
-- also own the lock for read access.
--
-- Note: we are not currently using this interface, it is provided for
-- possible future use. At the current time, everyone uses Lock for both
-- read and write locks.
procedure Set_Ceiling
(Object : Protection_Entries_Access;
Prio : System.Any_Priority);
-- Sets the new ceiling priority of the protected object
procedure Unlock_Entries (Object : Protection_Entries_Access);
-- Relinquish ownership of the lock for the object represented by the
-- Object parameter. If this ownership was for write access, or if it was
-- for read access where there are no other read access locks outstanding,
-- one (or more, in the case of Lock_Read_Only) of the tasks waiting on
-- this lock (if any) will be given the lock and allowed to return from
-- the Lock or Lock_Read_Only call.
private
procedure Finalize (Object : in out Protection_Entries);
-- Clean up a Protection object; in particular, finalize the associated
-- Lock object.
end System.Tasking.Protected_Objects.Entries;
|
Projects/PJZ2/Framework/MusicReplay/P6112-Play.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 21 | 18432 | <reponame>jonathanbennett73/amiga-pjz-planet-disco-balls
; #-----+-----------------------------------------#
; |Name:| P6112 - Optimized Player 6.1 Playroutine|
; +-----+-----------------------------------------+
; |V1.06| P6112,E1x/E2x fix |
; |V1.05| P6111, EDx fix,better init/exit,Dxx note|
; |V1.04| P6110, E6x command fix+new option |
; |V1.03| P6109, compatibility changes only. |
; |V1.02| Cleaned up P6108 with minor changes. |
; |V1.01| 2.4-3 scanlines faster than my p6107. |
; | | SLen (song length) bug fixed |
; | | lev6 implemented with "poke DMA here" |
; | | Two options for clickless sound start |
; | | P61_Osc precis samplewindow tracking |
; | | Many optimization options - read the |
; | | info or leave them at defaults. |
; +-----+-----------------------------------------+
; | by Photon/Scoopex |
; #-----------------------------------------------#
;SPECIAL NOTE FOR THIS VERSION:
;-----------------------------
;Tutorial here: http://youtu.be/xBtHO-IuN9E
;Put it in your demo: http://youtu.be/JYLcIR6tyO4
;I'm leaving the P61 project, feeling I've left it in good shape.
;There is nothing left to optimize, and I've gone through everything I could
;find that was bad and fixed it.
;I support this only with the readme.txt and all the comment documentation.
;Please follow the advice in my Youtube tutorial specifically made for adding
;P61 to your demo before deciding the playroutine is at fault. If you are sure
;you have found a bug, fix it yourself.
;A song must fail in the example source and play correctly in P61con, before
;you can suspect the playroutine is at fault.
;A note on syncing: apart from the new options for $1Fx, channel triggers, and
;oscilloscope ptrs I added, you should no longer ask musicians to scatter E8x
;commands in the song. Don't worry, it plays fine in P61 and always has.
;But some non-legacy trackers destroy the loop with a filter where E8x commands
;are used. 80x is an alternative, which works in all trackers, according to
;them. To use it, just replace E8x with 80x in the module and you need change
;nothing else.
;P6112:
;E1x/E2x fix. One line changed in the source, in the GetNote macro used by
;these two effects combined with a note trigger (i.e. for F-3 E1x, not --- E1x)
;P6111:
;- Fix notedelay bug introduced in P6108
;- Fix in legacy code, CIA regs were modified in init/exit even when p61_cia=0.
;- Verified that $9xx offset behavior takes effect at loop end, a behavior
;used by chip musicians.
;Dxx command: P61 has never implemented Dxx support other than for xx=00.
;I took a good look, and the way I see it, only pointers to previously
;decrunched notesteps are stored. This means patternloop backjumps work, but
;forward jumps to some offset from the pattern start pointer - doesn't.
;xx steps must first be decrunched. This will cause a spike in rastertime
;(CPU load) used, which is counter to my efforts to make the P61 playroutine
;match the performance of optimized normal Protracker playroutines.
;So I've decided to not implement it. Instead, musicians are recommended to
;copy the jumped-to pattern and delete xx notes to make the offset=0. Then
;the Dxx command can be changed to a D00 command, which is supported.
;The copied pattern will only add 16 bytes or so to the filesize, and
;performance will remain excellent.
;---
;P6110: A bug regarding Patternloops (E6x) was introduced in P6108 when I added
;super optimization flags. This is fixed, but it also revealed the obvious:
;that Patternloop is incompatible with suppF01=0. The example will set this
;automatically for you, but you will not get the great speed gains if you try
;split4=1 unless you SET THE USECODE PROPERLY.
;Of course all modes will work properly if you leave everything at default
;in the example, but I recommend to set the usecode to get the most out of p61
; - not just the size gain.
;Also, new option: set visuctrs=1 to get elapsed time since last instrument
;trigger in P61visuctr0..3.
;NOTE: vasm users MUST turn optimizations off for the jmp xx(PC) instructions
;in the jump tables and at P61_motuuli. If not, the source will assemble
;without errors, but generate bra.b which WILL cause fatal run-time errors.
;May the Source be with you! //Photon
;Credits to Jarno for V6.1A, and bugfixers up to 6.1.0.6.
;(Notes from previous versions below.)
* The Player 6.1A - by Guru / Sahara Surfers
* Interrupt problem with 060 fixed by NoName/Haujobb^Sector 7
* Some Enforcer Hits fixed by Platon42
* Memory trashing bug in routine P61_End fixed by Tolkien
* Bug in routine P61_Init (when opt020=1) fixed by The Dark Coder/Trinity^Morbid Visions
* for Devpac 3, ASM-One, PhxAss and maybe some other assemblers
*
* NEEDS: Default sizes must be words (ASM-One default...)
* Preferably no optimizations on (the jump table must be word jumps)
*
* Tested with Devpac 3.04 by Guru
* Tested with PhxAss 4.14, Asm-Pro 1.1 and ASM-One 1.29
*
* Note 1:All the bugfixes done after version 610.2 (the latest release from
* Guru / Sahara Surfers) are marked with the comment "* BUGFIX"
* followed by some explanations, so that if can quickly copy them
* into a previous version tailored to your needs.
*
* Note 2:The unelegant double WRITE to INTREQ unforunately seems to be
* the best solution to the "interrupt problem" that occurs on
* some 040/060 equipped Amiga. On many 040/060 Amigas it is enough
* to put an access to whatever hardware register and a NOP between
* the first write to INTREQ and he RTE. However we had reports that
* on some Amiga it is really necessary to do a double write to INTREQ
********************************
* Player 6.1A � *
* All in one-version *
* Version 610.6 *
* � 1992-95 <NAME> *
* All rights reserved *
* Fixed by: NoName, Platon42, *
* Tolkien and The Dark Coder *
********************************
nowaveforms=noshorts
copdma=1-lev6
Custom_Block_Size=16 ;d7 used to replace clr.* instead of this const
ifnd player61_i
player61_i:set 1
ifnd exec_types_i
exec_types_i:set 1
include_version:equ 40
extern_lib:macro
xref _lvo\1
endm
structure:macro
\1:equ 0
soffset:set \2
endm
fptr:macro
\1:equ soffset
soffset:set soffset+4
endm
bool:macro
\1:equ soffset
soffset:set soffset+2
endm
byte:macro
\1:equ soffset
soffset:set soffset+1
endm
ubyte:macro
\1:equ soffset
soffset:set soffset+1
endm
word:macro
\1:equ soffset
soffset:set soffset+2
endm
uword:macro
\1:equ soffset
soffset:set soffset+2
endm
short:macro
\1:equ soffset
soffset:set soffset+2
endm
ushort:macro
\1:equ soffset
soffset:set soffset+2
endm
long:macro
\1:equ soffset
soffset:set soffset+4
endm
ulong:macro
\1:equ soffset
soffset:set soffset+4
endm
float:macro
\1:equ soffset
soffset:set soffset+4
endm
double:macro
\1:equ soffset
soffset:set soffset+8
endm
aptr:macro
\1:equ soffset
soffset:set soffset+4
endm
cptr:macro
\1:equ soffset
soffset:set soffset+4
endm
rptr:macro
\1:equ soffset
soffset:set soffset+2
endm
label:macro
\1:equ soffset
endm
struct:macro
\1:equ soffset
soffset:set soffset+\2
endm
alignword:macro
soffset:set (soffset+1)&$fffffffe
endm
alignlong:macro
soffset:set (soffset+3)&$fffffffc
endm
enum:macro
ifc '\1',''
eoffset:set 0
endc
ifnc '\1',''
eoffset:set \1
endc
endm
eitem:macro
\1:equ eoffset
eoffset:set eoffset+1
endm
bitdef0:macro
\1\3\2:equ \4
endm
bitdef:macro
bitdef0 \1,\2,b_,\3
\@bitdef:set 1<<\3
bitdef0 \1,\2,f_,\@bitdef
endm
library_minimum:equ 33
endc ;ifnd
structure Player_Header,0
ulong P61_InitOffset
ulong P61_MusicOffset
ulong P61_EndOffset
ulong P61_SetRepeatOffset
ulong P61_SetPositionOffset
uword P61_MasterVolume
uword P61_UseTempo
uword P61_PlayFlag
uword P61_E8_info
aptr P61_UseVBR
uword P61_Position
uword P61_Pattern
uword P61_Row
aptr P61_Cha0Offset
aptr P61_Cha1Offset
aptr P61_Cha2Offset
aptr P61_Cha3Offset
label Player_Header_SIZE
structure Channel_Block,0
ubyte P61_SN_Note
ubyte P61_Command
ubyte P61_Info
ubyte P61_Pack
aptr P61_Sample
uword P61_OnOff
aptr P61_ChaPos
aptr P61_TempPos
uword P61_TempLen
uword P61_Note
uword P61_Period
uword P61_Volume
uword P61_Fine
uword P61_Offset
uword P61_LOffset
uword P61_ToPeriod
uword P61_TPSpeed
ubyte P61_VibCmd
ubyte P61_VibPos
ubyte P61_TreCmd
ubyte P61_TrePos
uword P61_RetrigCount
ubyte P61_Funkspd
ubyte P61_Funkoff
aptr P61_Wave
uword P61_TData
aptr P61_TChaPos
aptr P61_TTempPos
uword P61_TTempLen
uword P61_Shadow
ifne oscillo ;Filled in by P61_osc call (div ptrs by 4)
aptr P61_oscptr ;points to end of current frame's sample-chunk.
uword P61_oscptrrem ;remainder for precision (internal use only)
aptr P61_oscptrWrap ;wrap (end) pointer for current Paula soundloop
endc
uword P61_DMABit
label Channel_Block_Size
structure Sample_Block,0
aptr P61_SampleOffset
uword P61_SampleLength
aptr P61_RepeatOffset
uword P61_RepeatLength
uword P61_SampleVolume
uword P61_FineTune
label Sample_Block_SIZE
P61_ft=usecode&1
P61_pu=usecode&2
P61_pd=usecode&4
P61_tp=usecode&40
P61_vib=usecode&80
P61_tpvs=usecode&32
P61_vbvs=usecode&64
P61_tre=usecode&$80
P61_arp=usecode&$100
P61_sof=usecode&$200
P61_vs=usecode&$400
P61_pj=usecode&$800
P61_vl=usecode&$1000
P61_pb=usecode&$2800
P61_sd=usecode&$8000
P61_ec=usecode&$ffff0000
P61_fi=usecode&$10000
P61_fsu=usecode&$20000
P61_fsd=usecode&$40000
P61_sft=usecode&$200000
P61_pl=usecode&$400000&((1-split4)*$400000) ;incompatible with split4.
P61_timing=usecode&$1000000
P61_rt=usecode&$2000000
P61_fvu=usecode&$4000000
P61_fvd=usecode&$8000000
P61_nc=usecode&$10000000
P61_nd=usecode&$20000000
P61_pde=usecode&$40000000
P61_il=usecode&$80000000
endc
ifne asmonereport
********** REPORT **********
printt ""
printt "Options used:"
printt "-------------"
ifne p61fade
printt "Mastervolume on"
else
printt "Mastervolume off"
endc
ifne p61system
printt "System friendly"
else
printt "System killer"
endc
ifne p61cia
printt "CIA-tempo on"
else
printt "CIA-tempo off"
endc
ifne p61exec
printt "ExecBase valid"
else
printt "ExecBase invalid"
endc
;; --- wicked nasty nested ifs ---
ifne lev6
printt "Level 6 IRQ on"
else
ifeq (noshorts&(1-p61system))
printt "FAIL: Non-lev6 NOT available for p61system=1 or noshorts=0!"
else
printt "Non-lev6 implemented with 'poke DMAbits byte to a specified address'."
printt "* READ DOCS for how to specify it and how it works."
endc ;noshorts&(1-p61system)
endc ;lev6
;; --- end of wicked nasty nested ifs ---
ifne opt020
printt "MC68020 optimizations"
else
printt "Normal MC68000 code"
endc
printt "Channels:"
printv channels
ifgt channels-4
printt "FAIL: More than 4 channels."
endc
ifeq channels
printt "FAIL: Can't have 0 channels."
endc
printt "UseCode:"
printv usecode
printt "Player binary size:"
printv P61E-P61B
********** REPORT END **********
endc ;ifne asmonereport
P61B:
P61_motuuli:
jmp P61_Init(PC)
ifeq p61cia
jmp P61_Music(PC)
else
rts
rts
endc
jmp P61_End(PC)
rts ;no P61_SetRepeat
rts
ifne p61jump
jmp P61_SetPosition(PC)
else
rts
rts
endc
P61_Master:
dc.w 64
P61_Tempo:
dc.w 1
P61_Play:
dc.w 1
P61_E8:
dc.w 0
P61_VBR:
dc.l 0
P61_Pos:
dc.w 0
P61_Patt:
dc.w 0
P61_CRow:
dc.w 0
P61_Temp0Offset:
dc.l P61_temp0-P61_motuuli
P61_Temp1Offset:
dc.l P61_temp1-P61_motuuli
P61_Temp2Offset:
dc.l P61_temp2-P61_motuuli
P61_Temp3Offset:
dc.l P61_temp3-P61_motuuli
P61_getnote:macro
moveq #$7e,d0
and.b (a5),d0
beq.b .nonote
ifne P61_vib
clr.b P61_VibPos(a5)
endc
ifne P61_tre
clr.b P61_TrePos(a5)
endc
ifne P61_ft
add P61_Fine(a5),d0
endc
move d0,P61_Note(a5)
move P61_periods-P61_cn(a3,d0),P61_Period(a5) ;P6112 fix.
.nonote:
endm
ifeq p61system
ifne p61cia
P61_intti:
movem.l d0-a6,-(sp)
tst.b $bfdd00
lea $dff000+C,a6
move #$2000,$9c-C(a6)
move #$2000,$9c-C(a6)
bsr P61_Music
movem.l (sp)+,d0-a6
nop
rte
endc
endc
ifne p61system
P61_lev6server:
movem.l d2-d7/a2-a6,-(sp)
lea P61_timeron(pc),a0
tst (a0)
beq.b P61_ohi
lea $dff000+C,a6
move P61_server(pc),d0
beq.b P61_musica
subq #1,d0
beq P61_dmason
ifeq nowaveforms
bra P61_setrepeat
else
bra.b P61_ohi
endc
P61_musica:
bsr P61_Music
P61_ohi:
movem.l (sp)+,d2-d7/a2-a6
moveq #1,d0
rts
endc
********** P61_Init **********
* Input: A0=P61-module addr.
* A1 [LONG] = 0 if samples are internal to the module
* Address of samples otherwise
* A2 [LONG] = Address of sample buffer if the module uses packed
* samples, otherwise can be left uninitialized
* A4 [LONG] = Address where 'DMA ON' byte (low 8 bits of DMACON)
* should be poked. ONLY used together with lev6=0.
* D0 [WORD] = 0 autodetect CIA Timer frequency, if ExecBase
* is valid otherwise assume PAL
* 1 assume PAL
* 2 assume NTSC
* [Used only in CIA-enabled mode]
* Uses: D0-A7, A6 set to $dff000+C (your custombase) at exit.
* Returns: D0=0 if okay (i.e. P61 module!). No need to change D0.l.
* NOTE: the define 'start' has been made runtime. move.w #<startpos>,P61_InitPos instead.
P61_Init:
lea $dff000+C,a6
ifeq p61system
ifne quietstart
move.w #$f,$96-C(A6) ;audiodma off
lea $a0-C(A6),a5 ;chan 0
lea P61_Quiet(PC),a3
moveq #0,d1
moveq #channels-1,d5
.choffl:move.l a3,(a5)+ ;ptr
move.l #1<<16+124,(a5)+ ;len, 'fastest common' period
move.l d1,(a5)+ ;quiet volume & audchan.
addq.w #4,a5
dbf d5,.choffl
endc
endc
cmp.l #"P61A",(a0)+
beq.b .modok
subq.l #4,a0
.modok:
ifne p61cia
move d0,-(sp)
endc
moveq #0,d0
cmp.l d0,a1
bne.b .redirect
move (a0),d0
lea (a0,d0.l),a1
.redirect:
move.l a2,a6
lea 8(a0),a2
moveq #$40,d0
and.b 3(a0),d0
bne.b .buffer
move.l a1,a6
subq.l #4,a2
.buffer:
lea P61_cn(pc),a3
move.w #$ff00,d1
move.w d1,P61_OnOff+P61_temp0-P61_cn(a3) ;stop active decsteps
move.w d1,P61_OnOff+P61_temp1-P61_cn(a3)
move.w d1,P61_OnOff+P61_temp2-P61_cn(a3)
move.w d1,P61_OnOff+P61_temp3-P61_cn(a3)
ifne copdma
move.l a4,p61_DMApokeAddr-P61_cn(a3)
endc
moveq #$1f,d1
and.b 3(a0),d1
move.l a0,-(sp)
;; --- insert pan/echo in this loop ---
lea P61_samples(pc),a4
subq #1,d1
moveq #0,d4
P61_lopos:
move.l a6,(a4)+
move (a2)+,d4
bpl.b P61_kook
neg d4
lea P61_samples-16(pc),a5
ifeq opt020
asl #4,d4
move.l (a5,d4),d6
else
add d4,d4
move.l (a5,d4*8),d6
endc
move.l d6,-4(a4)
ifeq opt020
move 4(a5,d4),d4
else
move 4(a5,d4*8),d4
endc
sub.l d4,a6
sub.l d4,a6
bra.b P61_jatk
P61_kook:
move.l a6,d6
tst.b 3(a0)
bpl.b P61_jatk
tst.b (a2)
bmi.b P61_jatk
move d4,d0
subq #2,d0
bmi.b P61_jatk
move.l a1,a5
move.b (a5)+,d2
sub.b (a5),d2
move.b d2,(a5)+
.loop:sub.b (a5),d2
move.b d2,(a5)+
sub.b (a5),d2
move.b d2,(a5)+
dbf d0,.loop
P61_jatk:
move d4,(a4)+
moveq #0,d2
move.b (a2)+,d2
moveq #0,d3
move.b (a2)+,d3
moveq #0,d0
move (a2)+,d0
bmi.b .norepeat
move d4,d5
sub d0,d5
move.l d6,a5
add.l d0,a5
add.l d0,a5
move.l a5,(a4)+
move d5,(a4)+
bra.b P61_gene
.norepeat:
move.l d6,(a4)+
move #1,(a4)+
P61_gene:
move d3,(a4)+
moveq #$f,d0
and d2,d0
mulu #74,d0
move d0,(a4)+
tst -6(a2)
bmi.b .nobuffer
moveq #$40,d0
and.b 3(a0),d0
beq.b .nobuffer
move d4,d7
tst.b d2
bpl.b .copy
subq #1,d7
moveq #0,d5
moveq #0,d4
.lo: move.b (a1)+,d4
moveq #$f,d3
and d4,d3
lsr #4,d4
sub.b .table(pc,d4),d5
move.b d5,(a6)+
sub.b .table(pc,d3),d5
move.b d5,(a6)+
dbf d7,.lo
bra.b .kop
.copy:
add d7,d7
subq #1,d7
.cob:
move.b (a1)+,(a6)+
dbf d7,.cob
bra.b .kop
.table:
dc.b 0,1,2,4,8,16,32,64,128,-64,-32,-16,-8,-4,-2,-1
.nobuffer:
move.l d4,d6
add.l d6,d6
add.l d6,a6
add.l d6,a1
.kop:
dbf d1,P61_lopos
move.l (sp)+,a0
and.b #$7f,3(a0)
move.l a2,-(sp)
lea P61_temp0(pc),a1
lea P61_temp1(pc),a2
lea P61_temp2(pc),a4
lea P61_temp3(pc),a5
moveq #Channel_Block_Size/2-2,d0
moveq #0,d1
.cl: move d1,(a1)+
move d1,(a2)+
move d1,(a4)+
move d1,(a5)+
dbf d0,.cl
lea P61_temp0-P61_cn(a3),a1
lea P61_emptysample-P61_cn(a3),a2
moveq #channels-1,d0
.loo:
move.l a2,P61_Sample(a1)
lea Channel_Block_Size(a1),a1
dbf d0,.loo
move.l (sp)+,a2
move.l a2,P61_positionbase-P61_cn(a3)
moveq #$7f,d1
and.b 2(a0),d1
ifeq opt020
lsl #3,d1
lea (a2,d1.l),a4
else
lea (a2,d1.l*8),a4
endc
move.l a4,P61_possibase-P61_cn(a3) ;base to pos. indices.
move.l a4,a1
moveq #-1,d0
.search:
cmp.b (a1)+,d0
bne.b .search
move.l a1,P61_patternbase-P61_cn(a3)
move.l a1,d0
sub.l a4,d0
subq.w #1,d0 ;this is the * BUGFIX! whoa!
move d0,P61_slen-P61_cn(a3)
;; --- Bugfix: P61_Init gives P61_slen=actual songlength +1.
;; --- This did not affect NextPattern, because it looks for endbyte flag.
;; --- It did affect Bxx/Dxx, but I guess nobody has tried to jump or
;; --- break to Last Pattern, ever. Now fixed to set correct SLen and
;; --- suddenly Bxx/Dxx/Setposition works as they should. //Photon
add.w P61_InitPos(pc),a4 ;position from which to start playing the song
moveq #0,d0
move.b (a4)+,d0
move.l a4,P61_spos-P61_cn(a3)
lsl #3,d0
add.l d0,a2
move.l a1,a4
moveq #0,d0 ;hi word must be clear to manage >32K of patterns
move (a2)+,d0 ;and no movem-signextend. This code is correct.
lea (a4,d0.l),a1
move.l a1,P61_ChaPos+P61_temp0-P61_cn(a3)
move (a2)+,d0
lea (a4,d0.l),a1
move.l a1,P61_ChaPos+P61_temp1-P61_cn(a3)
move (a2)+,d0
lea (a4,d0.l),a1
move.l a1,P61_ChaPos+P61_temp2-P61_cn(a3)
move (a2)+,d0
lea (a4,d0.l),a1
move.l a1,P61_ChaPos+P61_temp3-P61_cn(a3)
ifeq nowaveforms
lea P61_setrepeat(pc),a0
move.l a0,P61_intaddr-P61_cn(a3)
endc
move #63,P61_rowpos-P61_cn(a3)
move #6,P61_speed-P61_cn(a3)
move #5,P61_speed2-P61_cn(a3)
clr P61_speedis1-P61_cn(a3)
ifne P61_pl
clr.l P61_plcount-P61_cn(a3)
endc
ifne P61_pde
clr P61_pdelay-P61_cn(a3)
clr P61_pdflag-P61_cn(a3)
endc
clr (a3) ;start frame of very first song note.
;"reused" patterns with effects coming out of nowhere
;at start of song require 0. Otherwise F0x speed-2 is
;ok, except if split4=1, set to F-speed - #channels.
;Don't change if you don't need 'the very quickest click to start' speed.
moveq #2,d0
and.b $bfe001,d0
move.b d0,P61_ofilter-P61_cn(a3)
bset #1,$bfe001
ifeq p61system
ifne p61exec
move.l 4.w,a6
moveq #0,d0
btst d0,297(a6)
beq.b .no68010
lea P61_liko(pc),a5
jsr -$1e(a6)
.no68010:
move.l d0,P61_VBR-P61_cn(a3)
endc
move.l P61_VBR-P61_cn(a3),a0
lea $78(a0),a0
move.l a0,P61_vektori-P61_cn(a3)
move.l (a0),P61_oldlev6-P61_cn(a3)
ifeq copdma
lea P61_dmason(pc),a1 ;set 'dma-on-interrupt'.
move.l a1,(a0)
endc
endc
moveq #$f,d0
lea $dff000+C,a6 ;a6 trashed above.
ifeq quietstart
moveq #$0,d1 ;original code
move d1,$a8-C(a6)
move d1,$b8-C(a6)
move d1,$c8-C(a6)
move d1,$d8-C(a6)
move d0,$96-C(a6)
endc
ifne nowaveforms
move.w d0,P61_NewDMA-P61_cn(a3) ;"NEXTframe setloop" to be triggered
endc
ifeq p61system
ifeq copdma
lea P61_dmason(pc),a1 ;again?
move.l a1,(a0)
endc
move #$2000,$9a-C(a6) ;old timerb OFF
lea $bfd000,a0
lea P61_timers(pc),a1
move.b #$7f,$d00(a0)
ifne p61cia ;only affect cia if actually used
move.b #$10,$e00(a0)
endc
move.b #$10,$f00(a0)
ifne p61cia
move.b $400(a0),(a1)+
move.b $500(a0),(a1)+
else
addq.w #2,a1
endc
move.b $600(a0),(a1)+
move.b $700(a0),(a1)
endc
ifeq (p61system+p61cia)
move.b #$82,$d00(a0)
endc
ifne p61cia
move (sp)+,d0
subq #1,d0
beq.b P61_ForcePAL
subq #1,d0
beq.b P61_NTSC
ifne p61exec
move.l 4.w,a1
cmp.b #60,$213(a1)
beq.b P61_NTSC
endc
P61_ForcePAL:
move.l #1773447,d0
bra.b P61_setcia
P61_NTSC:
move.l #1789773,d0
P61_setcia:
move.l d0,P61_timer-P61_cn(a3)
divu #125,d0
move d0,P61_thi2-P61_cn(a3)
sub #$1f0*2,d0
move d0,P61_thi-P61_cn(a3)
ifeq p61system
move P61_thi2-P61_cn(a3),d0
move.b d0,$400(a0)
lsr #8,d0
move.b d0,$500(a0)
lea P61_intti(pc),a1
move.l a1,P61_tintti-P61_cn(a3)
move.l P61_vektori(pc),a2
move.l a1,(a2)
move.b #$83,$d00(a0)
move.b #$11,$e00(a0)
endc
endc
ifeq p61system
ifeq copdma
move #$e000,$9a-C(a6) ;level 6 timer B int, at least for setloop
else
move #$c000,$9a-C(a6) ;no level 6 timer B int, please
;(bit 14 is cleared above.)
endc
ifne quietstart
move.w #$800f,$96-C(A6) ;make all used channels start a quiet loop.
endc
moveq #0,d0
rts
ifne p61exec
P61_liko:
dc.l $4E7A0801
rte
endc
endc
ifne p61system
move.l a6,-(sp)
ifne p61cia
clr P61_server-P61_cn(a3)
else
move #1,P61_server-P61_cn(a3)
endc
move.l 4.w,a6
moveq #-1,d0
jsr -$14a(a6)
move.b d0,P61_sigbit-P61_cn(a3)
bmi P61_err
lea P61_allocport(pc),a1
move.l a1,P61_portti-P61_cn(a3)
move.b d0,15(a1)
move.l a1,-(sp)
suba.l a1,a1
jsr -$126(a6)
move.l (sp)+,a1
move.l d0,16(a1)
lea P61_reqlist(pc),a0
move.l a0,(a0)
addq.l #4,(a0)
clr.l 4(a0)
move.l a0,8(a0)
lea P61_dat(pc),a1
move.l a1,P61_reqdata-P61_cn(a3)
lea P61_allocreq(pc),a1
lea P61_audiodev(pc),a0
moveq #0,d0
moveq #0,d1
jsr -$1bc(a6)
tst.l d0
bne P61_err
st.b P61_audioopen-P61_cn(a3)
lea P61_timerint(pc),a1
move.l a1,P61_timerdata-P61_cn(a3)
lea P61_lev6server(pc),a1
move.l a1,P61_timerdata+8-P61_cn(a3)
moveq #0,d3
lea P61_cianame(pc),a1
P61_openciares:
moveq #0,d0
move.l 4.w,a6
jsr -$1f2(a6)
move.l d0,P61_ciares-P61_cn(a3)
beq.b P61_err
move.l d0,a6
lea P61_timerinterrupt(pc),a1
moveq #0,d0
jsr -6(a6)
tst.l d0
beq.b P61_gottimer
addq.l #4,d3
lea P61_timerinterrupt(pc),a1
moveq #1,d0
jsr -6(a6)
tst.l d0
bne.b P61_err
P61_gottimer:
lea P61_craddr+8(pc),a6
move.l P61_ciaaddr(pc,d3),d0
move.l d0,(a6)
sub #$100,d0
move.l d0,-(a6)
moveq #2,d3
btst #9,d0
bne.b P61_timerB
subq.b #1,d3
add #$100,d0
P61_timerB:
add #$900,d0
move.l d0,-(a6)
move.l d0,a0
and.b #%10000000,(a0)
move.b d3,P61_timeropen-P61_cn(a3)
moveq #0,d0
ifne p61cia
move.l P61_craddr+4(pc),a1
move.b P61_tlo(pc),(a1)
move.b P61_thi(pc),$100(a1)
endc
or.b #$19,(a0)
st P61_timeron-P61_cn(a3)
P61_pois:
move.l (sp)+,a6
rts
P61_err:moveq #-1,d0
bra.b P61_pois
P61_ciaaddr:
dc.l $bfd500,$bfd700
endc
********** P61_End **********
* Input: none.
* Uses: D0-D1/A0-A1/A3/A6, A6 set to $dff000+C (your custombase) at exit.
P61_End:
lea $dff000+C,a6
moveq #0,d0
move d0,$a8-C(a6)
move d0,$b8-C(a6)
move d0,$c8-C(a6)
move d0,$d8-C(a6)
move #$f,$96-C(a6)
and.b #%11111101,$bfe001
move.b P61_ofilter(pc),d0
or.b d0,$bfe001
ifeq p61system
move #$2000,$9a-C(a6)
move.l P61_vektori(pc),a0
move.l P61_oldlev6(pc),(a0)
lea $bfd000,a0
lea P61_timers(pc),a1
ifne p61cia ;only affect cia if used
move.b (a1)+,$400(a0)
move.b (a1)+,$500(a0)
else
addq.w #2,a1
endc
move.b (a1)+,$600(a0)
move.b (a1)+,$700(a0)
ifne p61cia
move.b #$10,$e00(a0)
endc
move.b #$10,$f00(a0)
else
move.l a6,-(sp)
lea P61_cn(pc),a3
moveq #0,d0
clr P61_timeron-P61_cn(a3)
move.b P61_timeropen(pc),d0
beq.b P61_rem1
move.l P61_ciares(pc),a6
lea P61_timerinterrupt(pc),a1
subq.b #1,d0
jsr -12(a6)
P61_rem1:
move.l 4.w,a6
tst.b P61_audioopen-P61_cn(a3)
beq.b P61_rem2
lea P61_allocreq(pc),a1
jsr -$1c2(a6)
clr.b P61_audioopen-P61_cn(a3)
P61_rem2:
moveq #0,d0
move.b P61_sigbit(pc),d0
bmi.b P61_rem3
jsr -$150(a6)
st P61_sigbit-P61_cn(a3)
P61_rem3:
move.l (sp)+,a6
endc
rts
;WHY not just cond-add mulu to where the finalvolume is set??
;"<NAME>." (c) The Big A/Phenomena.
ifne p61fade
P61_mfade:
lea $dff0a8,a4
move P61_Master(pc),d0
move P61_temp0+P61_Shadow(pc),d1
mulu d0,d1
lsr #6,d1
move d1,(a4)
ifgt channels-1
move P61_temp1+P61_Shadow(pc),d1
mulu d0,d1
lsr #6,d1
move d1,$10(a4)
endc
ifgt channels-2
move P61_temp2+P61_Shadow(pc),d1
mulu d0,d1
lsr #6,d1
move d1,$20(a4)
endc
ifgt channels-3
move P61_temp3+P61_Shadow(pc),d1
mulu d0,d1
lsr #6,d1
move d1,$30(a4)
endc
rts
endc
ifne oscillo
******************************************
;Call directly after P61_Music to get ptr,count of samples playing THIS frame
;Input: a0=P61_temp0/1/2/3 (selects channel)
;Output: d0-d1/d4/a2=WrapCount.w,Count.w,Replen=0,SamplePtr
;Only if d0.w>0:d2/d4/a1=LoopEndPtr,Replen,LoopStartPtr
;Destroys: d0-d4/a1-a2, a0 points to next channel in oscdata.
;Usage:
;If d1=0, this channel has not yet started playing sounds, and there is no
;usable data in the other registers. (I.e. don't start drawing oscilloscope
;for this chan yet.). D1 is tested at exit, so you can just beq to skip the
;channel.
;If d0<=0, just read d1 bytes from a2-ptr.
;If d0>0, subtract it from d1 and read d1 bytes from a2-ptr. Backup Loopstart
;in a1 to (for example) a3. Then read d0 bytes from a1-ptr, if you hit the
;LoopEnd address in d2, then read the remaining bytes from Loopstart that
;you saved in a3.
;----------------
;Most samples have a short loop at the end. If you extend all short loops to
;578 bytes, you won't have to check your sample-read-address vs the WrapPtr
;in d2 in your loop.
;A silent, short loop of 2 bytes at the end is common to end an instrument.
;P61_emptyloop578 has been provided to save this check for you for all
;one-shot instruments.
;Set the oscextloops option to 0 if you haven't extended the other loops. This
;will enable an extra modulo div and disable P61_emptyloop578. You will also
;have to check for "end of replen" yourself in-loop, as mentioned.
;Bonus checkable things:
;If d4=0, the instrument has not yet reached its end loop.
;oscextloops=0: if d4=1, the instrument ended (playing quiet 2-byte loop)
;oscextloops=1: only if d2=P61_emptyloop578E has the instrument ended.
;Some bragging:
;The sample-window start and end points are rounded for convenience.
;They are rounded so that the ptrs and counts generate sample-windows with no
;gap or overlap between each frame, for a perfect sequence of memory areas.
;Internally it calculates with an accuracy of 1/262144, or about 6-7 decimals.
;It supports 128KB samples with <64KB loops.
;It's fully possible to do per-frame mixing directly into playing samples
;using this precision.
oscextloops=0 ;this saves a modulo-div
oscbigempty=0 ;optional buf regardless of oscextloops option
ticksframePAL=70937*4+2 ;50.00028194 Hz
ticksframeNTSC=59719*4+3 ;59.94005233 Hz
P61_osc:
move.w P61_Period(a0),d4 ;check for div0
bne.b .non0
.div0: lea Channel_Block_Size(a0),a0 ;next chan
moveq #0,d1 ;return count of 0.
rts
.non0:
lea P61_oscptr(a0),a0
move.l (a0)+,d0 ;ptr "x4"
moveq #3,d3
and.l d0,d3 ;remainder for wrapcalc
move.l d0,d2
addq.l #2,d2
lsr.l #2,d2
move.l d2,a2 ;ptr result.
move.l #ticksframePAL,d2 ;for NTSC, use the NTSC constant above.
divu d4,d2 ;count.w "x4", (ticks/frame) div period)
moveq #0,d1
move.w d2,d1 ;'cleared hi word'
clr.w d2 ;modulo in hi word (mod<<16)/period
divu d4,d2 ;f.ex. 379/380 converted to 65536ths
add.w d2,(a0)+ ;ptr.rem updated
addx.l d1,d0 ;add count+"carry"=nextframe/'end' ptr
move.l d0,-6(a0) ;saved.
move.l d0,d1
addq.l #2,d1
lsr.l #2,d1
sub.l a2,d1 ;correctly aliased sample-window byte count.
moveq #0,d2 ;default replen 0->d4 later
sub.l (a0)+,d0 ;loopend hit?
blt.b .nowr
;; --- handle overshoot ---
move.l P61_Sample-P61_DMABit(a0),a1 ;a1 "trashed"
ifeq oscbigempty
move.w 10(a1),d2 ;replen
subq.w #1,d2
endc
move.l 6(a1),a1 ;repptr
ifne oscbigempty
bne.b .nol1
lea P61_emptyloop578(PC),a1 ;replace with nice big loopbuffer.
.nol1:
endc
;; --- a1 loopstartptr result done ---
ifeq oscbigempty
addq.l #1,d2 ;128KB support but <64KB loops, see divu.
add.l d2,d2 ;wordlen->bytelen
else
move.l #P61_emptyquiet578E-P61_emptyquiet578,d2
endc
;; --- d2 replen result done ---
move.l a1,d4 ;loopstart
lsl.l #2,d4 ;"x4"
or.b d3,d4 ;keep round-bits, d3 usable now
addq.w #2,d0 ;word size okay cos positive; hi word clr.
lsr.w #2,d0 ;rounded count result.
move.l d0,d3
ifeq oscextloops
divu d2,d3 ;overshoot modulo replen.
clr.w d3 ;(to not accumulate overshoot but stay in loop)
swap d3
endc
add.w d3,d3 ;unrounded count modulized, x4.
add.w d3,d3 ;will be at most 578.
add.l d4,d3
move.l d3,-10(a0) ;jump to near loopstart. remainder kept, ofc.
move.l d2,d4 ;proper replen
add.l a1,d2 ;LoopEndPtr result.
move.l d2,d3
lsl.l #2,d3
move.l d3,-4(a0) ;new endptr(x4) for compare.
bra.s .ct
.nowr:
move.l d2,d4 ;replen, also done in wrap, before adding a1.
addq.l #2,d0 ;long cos negative and 128KB support.
asr.l #2,d0 ;rounded wraplen result.
.ct:
addq.w #2,a0 ;skip P61_DMAbit
tst.w d1 ;test the count.
RTS
ifne oscbigempty
P61_emptyloop578:
dcb.w 578/2,0 ;@@ this "sample" MUST be in chipmem!
P61_emptyloop578E:
endc
endc
ifne p61jump
******************************************
* P61_SetPosition
; Call P61_SetPosition to jump to a specific position in the song
; If called AFTER P61_Music, what's written below will be true but happen one
; frame later.
;� OPTIONALLY Starts from the beginning if out of limits. �
* Input: D0.b=songposition. A6=your custombase ("$dff000")
* Uses: D0-D1/A0-A1/A3
;If you want to change pos 'at next note', call this when P61_cn=(P61_speed2-1)
;if you also need to change pos 'in rhythm', AND P61_CRow with f.ex. 2^n-1.
;if that equals 2^n-1 ("all 1s"), and cn is 'in tempo', you will get a smooth
;transition. If n is 64, you are sure to make the switch at pattern end.
;@@ NOTE: If you use this with split4=1, be aware that it must then decrunch
;up to 2 framesteps before starting to play the song (meaning the song won't
;start playing quite instantly).
P61_SetPosition:
lea P61_cn(pc),a3
ifne split4
move.w P61_speed2(PC),d1 ;if _Speedis1, _cn doesn't matter.
subq.w #3,d1 ;allow 2 more pre-decrunch frames.
else
move.w P61_speed2(PC),d1 ;if _Speedis1, _cn doesn't matter.
subq.w #1,d1
endc
;new pattern reaches your ears NEXT frame or CIA-int, or 3 frames later with
;the split4 option.
move.w d1,(a3) ;instant SetPos, ie. decrunch next NOW
ifne P61_pl
clr P61_plflag-P61_cn(a3)
endc
moveq #0,d1
move.b d0,d1
move.l d1,d0
ifeq optjmp
cmp P61_slen-P61_cn(a3),d0
blo.b .e
moveq #0,d0
.e:
endc
move d0,P61_Pos-P61_cn(a3)
add.l P61_possibase(pc),d0
move.l d0,P61_spos-P61_cn(a3)
moveq #63,d0 ;yeah, the original SetPos is, like, wrong.
move d0,P61_rowpos-P61_cn(a3)
clr P61_CRow-P61_cn(a3)
move.l P61_spos(pc),a1
move.l P61_patternbase(pc),a0
addq #1,P61_Pos-P61_cn(a3)
move.b (a1)+,d0
move.l a1,P61_spos-P61_cn(a3)
move.l P61_positionbase(pc),a1
move d0,P61_Patt-P61_cn(a3)
lsl #3,d0
add.l d0,a1
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp0-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp1-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp2-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp3-P61_cn(a3)
lea P61_temp0(PC),a3
clr.b P61_Pack+Channel_Block_Size*0(a3) ;force new take
clr.b P61_Pack+Channel_Block_Size*1(a3)
clr.b P61_Pack+Channel_Block_Size*2(a3)
clr.b P61_Pack+Channel_Block_Size*3(a3)
clr.b P61_TempLen+1+Channel_Block_Size*0(a3) ;force TakeNORM
clr.b P61_TempLen+1+Channel_Block_Size*1(a3)
clr.b P61_TempLen+1+Channel_Block_Size*2(a3)
clr.b P61_TempLen+1+Channel_Block_Size*3(a3)
move.w #$ff00,d0
move.w d0,P61_OnOff+Channel_Block_Size*0(a3) ;stop active decsteps
move.w d0,P61_OnOff+Channel_Block_Size*1(a3)
move.w d0,P61_OnOff+Channel_Block_Size*2(a3)
move.w d0,P61_OnOff+Channel_Block_Size*3(a3)
clr.b P61_dma+1-P61_temp0(a3) ;stop playing channels
move.w #$000f,$96-C(A6) ;indeed, in speakers too.
ifne nowaveforms
clr P61_NewDMA-P61_temp0(a3) ;stop DMA next note
endc
ifne copdma
move.l p61_DMApokeAddr(PC),a3 ;don't set DMA until playtime
clr.b (a3)
endc
rts
endc
********** Main entry point from CIA/VB int or frame loop **********
* Input: A6=your custombase ("$dff000")
* Uses: D0-A7, A6 set to $dff000+C (your custombase) at exit.
P61_Music:
lea P61_cn(pc),a3
moveq #0,d7 ;replaced clr.* with move.* d7,
lea $a0-C(a6),a4 ;Aud Chan Base.
ifne playflag
tst P61_Play-P61_cn(a3) ;set by init if CIA
bne.b P61_ohitaaa
ifne p61cia
ifne p61system
move.l P61_craddr+4(pc),a0
move.b P61_tlo2(pc),(a0)
move.b P61_thi2(pc),$100(a0)
endc
endc
rts
endc
P61_ohitaaa:
ifne visuctrs ;easy visualizer counters.
addq.w #1,P61_visuctr0-P61_cn(a3) ;inc elapsed #calls since last
addq.w #1,P61_visuctr1-P61_cn(a3)
addq.w #1,P61_visuctr2-P61_cn(a3)
addq.w #1,P61_visuctr3-P61_cn(a3)
endc
ifne p61fade
pea P61_mfade(pc)
endc
move.w (a3),d4
cmp.w P61_speed2(pc),d4 ;Really compares with P61_speed, 1 added later.
beq.w P61_playtime ;if new note frame, handle
;; --- no new note ---
; bsr P61_Synth ;synth/pan/echo cpu-mix routine. Not done yet.
;(note: re-cmp to d4 if you put something here.)
ifeq suppF01
blt.b P61_nowrap ;otherwise last was not playtime-frame.
endc
;; --- first frame of new step ---
;rolled over from playtime to frame after. incompatible with F01.
ifeq suppF01
ifne nowaveforms
move.b P61_dma+1-P61_cn(a3),P61_NewDMA+1-P61_cn(a3) ;or set by fx
endc
clr.w d4
subq #1,P61_rowpos-P61_cn(a3) ;next pattern-step
bpl.b P61_nonewpatt
P61_nextpattern:
ifne P61_pl
move d7,P61_plflag-P61_cn(a3)
endc
move.l P61_patternbase(pc),a0
moveq #63,d0
move d0,P61_rowpos-P61_cn(a3)
move d7,P61_CRow-P61_cn(a3)
move.l P61_spos(pc),a1
addq #1,P61_Pos-P61_cn(a3)
move.b (a1)+,d0
bpl.b P61_dk
move.l P61_possibase(pc),a1
move.b (a1)+,d0
move d7,P61_Pos-P61_cn(a3)
P61_dk:
move.l a1,P61_spos-P61_cn(a3)
move d0,P61_Patt-P61_cn(a3)
lsl #3,d0
move.l P61_positionbase(pc),a1
add.l d0,a1
move.w (a1)+,d0 ;no movem sign-extend... check.
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp0-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp1-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp2-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp3-P61_cn(a3)
bra.b P61_nowrap
P61_nonewpatt:
moveq #63,d0
sub P61_rowpos-P61_cn(a3),d0
move d0,P61_CRow-P61_cn(a3)
endc
;; --- end of rolled over code ---
P61_nowrap:
addq.w #1,d4 ;NOW I do!
move d4,(a3)
P61_delay:
ifne nowaveforms ;nd,rt,sof, or note triggered dmaoff
move.w P61_NewDMA(PC),d5 ;on last P61_Music call?
beq.b .nosetloops
move.l P61_Sample+P61_temp0(PC),a0
move.l 6(a0),(a4) ;loop start
move.w 10(a0),4(a4) ;loop len
ifgt channels-1
move.l P61_Sample+P61_temp1(PC),a0
move.l 6(a0),$10(a4) ;loop start
move.w 10(a0),$14(a4) ;loop len
endc
ifgt channels-2
move.l P61_Sample+P61_temp2(PC),a0
move.l 6(a0),$20(a4) ;loop start
move.w 10(a0),$24(a4) ;loop len
endc
ifgt channels-3
move.l P61_Sample+P61_temp3(PC),a0
move.l 6(a0),$30(a4) ;loop start
move.w 10(a0),$34(a4) ;loop len
endc
move.w d7,P61_NewDMA-P61_cn(a3) ;poll (clear)
.nosetloops:
endc
ifne p61cia
ifne p61system
move.l P61_craddr+4(pc),a0
move.b P61_tlo2(pc),(a0)
move.b P61_thi2(pc),$100(a0)
endc
endc
********** mainfx handling **********
lea P61_temp0(pc),a5
moveq #channels-1,d5
P61_lopas:
tst.b P61_OnOff+1(a5)
beq.w P61_contfxdone
moveq #$f,d0
and (a5),d0
ifeq opt020
add d0,d0
move P61_jtab2(pc,d0),d0
else
move P61_jtab2(pc,d0*2),d0
endc
jmp P61_jtab2(pc,d0)
P61_jtab2:
dc P61_contfxdone-P61_jtab2
ifne P61_pu
dc P61_portup-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_pd
dc P61_portdwn-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_tp
dc P61_toneport-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_vib
dc P61_vib2-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_tpvs
dc P61_tpochvslide-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_vbvs
dc P61_vibochvslide-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_tre
dc P61_tremo-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
ifne P61_arp
dc P61_arpeggio-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
dc P61_contfxdone-P61_jtab2
ifne P61_vs
dc P61_volslide-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
dc P61_contfxdone-P61_jtab2
dc P61_contfxdone-P61_jtab2
dc P61_contfxdone-P61_jtab2
ifne P61_ec
dc P61_contecommands-P61_jtab2
else
dc P61_contfxdone-P61_jtab2
endc
dc P61_contfxdone-P61_jtab2
;; --- end of contfx table ---
ifne P61_ec
P61_contecommands:
move.b P61_Info(a5),d0
and #$f0,d0
lsr #3,d0
move P61_etab2(pc,d0),d0
jmp P61_etab2(pc,d0)
P61_etab2:
dc P61_contfxdone-P61_etab2
ifne P61_fsu
dc P61_fineup2-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
ifne P61_fsd
dc P61_finedwn2-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
ifne P61_rt
dc P61_retrig-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
ifne P61_fvu
dc P61_finevup2-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
ifne P61_fvd
dc P61_finevdwn2-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
ifne P61_nc
dc P61_notecut-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
ifne P61_nd
dc P61_notedelay-P61_etab2
else
dc P61_contfxdone-P61_etab2
endc
dc P61_contfxdone-P61_etab2
dc P61_contfxdone-P61_etab2
endc
ifne P61_fsu
P61_fineup2:
tst (a3)
bne.w P61_contfxdone
moveq #$f,d0
and.b P61_Info(a5),d0
sub d0,P61_Period(a5)
moveq #113,d0
cmp P61_Period(a5),d0
ble.b .jup
move d0,P61_Period(a5)
.jup: move P61_Period(a5),6(a4)
bra.w P61_contfxdone
endc
ifne P61_fsd
P61_finedwn2:
tst (a3)
bne.w P61_contfxdone
moveq #$f,d0
and.b P61_Info(a5),d0
add d0,P61_Period(a5)
cmp #856,P61_Period(a5)
ble.b .jup
move #856,P61_Period(a5)
.jup: move P61_Period(a5),6(a4)
bra.w P61_contfxdone
endc
ifne P61_fvu
P61_finevup2:
tst (a3)
bne.w P61_contfxdone
moveq #$f,d0
and.b P61_Info(a5),d0
add d0,P61_Volume(a5)
moveq #64,d0
cmp P61_Volume(a5),d0
bge.b .jup
move d0,P61_Volume(a5)
.jup: move P61_Volume(a5),8(a4)
bra.w P61_contfxdone
endc
ifne P61_fvd
P61_finevdwn2:
tst (a3)
bne.w P61_contfxdone
moveq #$f,d0
and.b P61_Info(a5),d0
sub d0,P61_Volume(a5)
bpl.b .jup
move d7,P61_Volume(a5)
.jup: move P61_Volume(a5),8(a4)
bra.w P61_contfxdone
endc
ifne P61_nc
P61_notecut:
moveq #$f,d0
and.b P61_Info(a5),d0
cmp (a3),d0
bne.w P61_contfxdone
ifeq p61fade
move d7,8(a4)
else
move d7,P61_Shadow(a5)
endc
move d7,P61_Volume(a5)
bra.w P61_contfxdone
endc
ifne P61_nd
P61_notedelay:
moveq #$f,d0
and.b P61_Info(a5),d0
cmp (a3),d0
bne.w P61_contfxdone
moveq #$7e,d0
and.b (a5),d0
beq.w P61_contfxdone
move P61_DMABit(a5),d0
move d0,$96-C(a6) ;turn chan dma off
or d0,P61_dma-P61_cn(a3) ;flag for turnon later
ifne nowaveforms
or d0,P61_NewDMA-P61_cn(a3) ;no interrupt needed, done next frame.
endc
move.l P61_Sample(a5),a1 ;set new ptr len already
ifeq oscillo
move.l (a1)+,(a4)
move (a1),4(a4)
else
;; --- wohoo oscilloscope ptrs ---
moveq #0,d1
move.l (a1)+,d0
move (a1),d1
move.l d0,(a4)
move.w d1,4(a4)
subq.w #1,d1
addq.l #1,d1 ;128KB support for sample endptr
lsl.l #2,d0 ;clear remainder.
move.l d0,P61_oscptr(a5)
move.w d7,P61_oscptrrem(a5) ;clear remainder.
lsl.l #3,d1
add.l d0,d1
move.l d1,P61_oscptrWrap(a5) ;wrap endptr for compare.
endc
; move P61_Period(a5),(a4)
; subq.l #6,a4
move P61_Period(a5),6(a4) ;bugfix from P6108+
ifne copdma
move.l p61_DMApokeAddr(PC),a0
move.b P61_dma+1-P61_cn(a3),(a0) ;keep updated.
endc
ifeq copdma&nowaveforms ;both must be on to skip int.
ifeq p61system ;int starter.
lea P61_dmason(pc),a1
move.l P61_vektori(pc),a0
move.l a1,(a0)
move.b #$f0,$bfd600
move.b #$01,$bfd700
move.b #$19,$bfdf00
else
move #1,P61_server-P61_cn(a3)
move.l P61_craddr+4(pc),a1
move.b #$f0,(a1)
move.b #1,$100(a1)
endc
endc
bra.w P61_contfxdone
endc
ifne P61_rt
P61_retrig:
subq #1,P61_RetrigCount(a5)
bne.w P61_contfxdone
move P61_DMABit(a5),d0
move d0,$96-C(a6)
or d0,P61_dma-P61_cn(a3)
ifne nowaveforms
or d0,P61_NewDMA-P61_cn(a3) ;no interrupt needed, done next frame.
endc
move.l P61_Sample(a5),a1
ifeq oscillo
move.l (a1)+,(a4)
move (a1),4(a4)
else
;; --- wohoo oscilloscope ptrs ---
moveq #0,d1
move.l (a1)+,d0
move (a1),d1
move.l d0,(a4)
move.w d1,4(a4)
subq.w #1,d1
addq.l #1,d1 ;128KB support for sample endptr
lsl.l #2,d0 ;clear remainder.
move.l d0,P61_oscptr(a5)
move.w d7,P61_oscptrrem(a5) ;clear remainder.
lsl.l #3,d1
add.l d0,d1
move.l d1,P61_oscptrWrap(a5) ;wrap endptr for compare.
endc
ifne copdma
move.l p61_DMApokeAddr(PC),a0
move.b P61_dma+1-P61_cn(a3),(a0) ;keep updated.
endc
ifeq copdma&nowaveforms ;both must be on to skip int.
ifeq p61system ;int starter.
lea P61_dmason(pc),a1
move.l P61_vektori(pc),a0
move.l a1,(a0)
move.b #$f0,$bfd600
move.b #$01,$bfd700
move.b #$19,$bfdf00
else
move #1,P61_server-P61_cn(a3)
move.l P61_craddr+4(pc),a1
move.b #$f0,(a1)
move.b #1,$100(a1)
endc
endc
moveq #$f,d0
and.b P61_Info(a5),d0
move d0,P61_RetrigCount(a5)
bra.w P61_contfxdone
endc
ifne P61_arp
P61_arplist:
dc.b 0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0
dc.b 1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1
P61_arpeggio:
move (a3),d0
move.b P61_arplist(pc,d0),d0
beq.b .arp0
bmi.b .arp1
move.b P61_Info(a5),d0
lsr #4,d0
bra.b .arp3
.arp0:
move P61_Note(a5),d0
move P61_periods-P61_cn(a3,d0),6(a4)
bra.w P61_contfxdone
.arp1:
moveq #$f,d0
and.b P61_Info(a5),d0
.arp3:
add d0,d0
add P61_Note(a5),d0
move P61_periods-P61_cn(a3,d0),6(a4)
bra.w P61_contfxdone
endc
;; --- period table move to before P61_cn ---
ifne P61_vs
P61_volslide:
move.b P61_Info(a5),d0
sub.b d0,P61_Volume+1(a5)
bpl.b .test
move d7,P61_Volume(a5)
ifeq p61fade
move d7,8(a4)
else
move d7,P61_Shadow(a5)
endc
bra.w P61_contfxdone
.test:
moveq #64,d0
cmp P61_Volume(a5),d0
bge.b .ncs
move d0,P61_Volume(a5)
ifeq p61fade
move d0,8(a4)
else
move d0,P61_Shadow(a5)
endc
bra.w P61_contfxdone
.ncs:
ifeq p61fade
move P61_Volume(a5),8(a4)
else
move P61_Volume(a5),P61_Shadow(a5)
endc
bra.w P61_contfxdone
endc
ifne P61_tpvs
P61_tpochvslide:
move.b P61_Info(a5),d0
sub.b d0,P61_Volume+1(a5)
bpl.b .test
move d7,P61_Volume(a5)
ifeq p61fade
move d7,8(a4)
else
move d7,P61_Shadow(a5)
endc
bra.b P61_toneport
.test:
moveq #64,d0
cmp P61_Volume(a5),d0
bge.b .ncs
move d0,P61_Volume(a5)
.ncs:
ifeq p61fade
move P61_Volume(a5),8(a4)
else
move P61_Volume(a5),P61_Shadow(a5)
endc
endc
ifne P61_tp
P61_toneport:
move P61_ToPeriod(a5),d0
beq.w P61_contfxdone
move P61_TPSpeed(a5),d1
cmp P61_Period(a5),d0
blt.b .topoup
add d1,P61_Period(a5)
cmp P61_Period(a5),d0
bgt.b .setper
move d0,P61_Period(a5)
move d7,P61_ToPeriod(a5)
move d0,6(a4)
bra.b P61_contfxdone
.topoup:
sub d1,P61_Period(a5)
cmp P61_Period(a5),d0
blt.b .setper
move d0,P61_Period(a5)
move d7,P61_ToPeriod(a5)
.setper:
move P61_Period(a5),6(a4)
else
nop
endc
bra.w P61_contfxdone
ifne P61_pu
P61_portup:
moveq #0,d0
move.b P61_Info(a5),d0
ifne use1Fx
cmp.b #$f0,d0
bhs.b P61_contfxdone
endc
sub d0,P61_Period(a5)
moveq #113,d0
cmp P61_Period(a5),d0
ble.b .skip
move d0,P61_Period(a5)
move d0,6(a4)
bra.b P61_contfxdone
.skip:
move P61_Period(a5),6(a4)
bra.w P61_contfxdone
endc
ifne P61_pd
P61_portdwn:
moveq #0,d0
move.b P61_Info(a5),d0
add d0,P61_Period(a5)
cmp #856,P61_Period(a5) ;max period=6.95 (7) scanlines per two samples.
ble.b .skip
move #856,d0
move d0,P61_Period(a5)
move d0,6(a4)
bra.b P61_contfxdone
.skip:
move P61_Period(a5),6(a4)
; bra.w P61_contfxdone
endc
********** MainFX returns here from all fx **********
P61_contfxdone:
ifne P61_il
bsr.w P61_funk2
endc
lea Channel_Block_Size(a5),a5
lea Custom_Block_Size(a4),a4
dbf d5,P61_lopas
;; --- splitchans or normal decrunch ---
ifeq split4
cmp P61_speed2(PC),d4 ;'decrunch frame'? (1 before playtime)
bne.w P61_ret2
P61_preplay2:
.pr: ifle (channels-splitchans)
printt "splitchans >= channels! Must be less."
else
moveq #(channels-splitchans)-1,d5 ;do preplay "first" half
lea P61_temp0(pc),a5
bra.w P61_preplay
endc
else ;split4
;; --- split4 decrunch ---
;Copies relevant chandata from a0 to a5
CHANCPY: macro
movem.l (a0),d0-d4
movem.l d0-d4,(a5)
ifne P61_ft
move.l P61_Volume(a0),P61_Volume(a5) ;vol+ft
else
move.w P61_Volume(a0),P61_Volume(a5) ;vol
endc
ifne P61_sof
move.w P61_Offset(a0),P61_Offset(a5)
endc
ifne P61_il
move.l P61_Wave(a0),P61_Wave(a5)
endc
endm
P61_split4:
move.w P61_speed2(PC),d5
cmp.w d5,d4
beq.b .pr2
subq.w #1,d5
cmp.w d5,d4
beq.b .pr1
subq.w #1,d5
cmp.w d5,d4
bne.w P61_ret2 ;last decrunchframe is in playtime
.pr0:
lea P61_temp0copy(PC),a5 ;dst
lea P61_temp0(PC),a0 ;src
CHANCPY
bra.w P61_preplay ;decrunches to copy
.pr1:
ifgt channels-1
lea P61_temp1copy(PC),a5 ;dst
lea P61_temp1(PC),a0 ;src
CHANCPY
bra.w P61_preplay ;decrunches to copy
else
rts
endc
.pr2:
lea P61_temp0copy(PC),a0 ;src
lea P61_temp0(PC),a5 ;dst
CHANCPY
ifgt channels-1
lea P61_temp1copy(PC),a0 ;src
lea P61_temp1(PC),a5 ;dst
CHANCPY
endc
ifgt channels-2
lea P61_temp2(PC),a5 ;...and decrunch this chan to normal
bra.w P61_preplay
else
rts
endc
endc ;if split4
********** My Jump Table **********
P61_MyJpt:;jump table,%x1111xxx,%x111xxxx,%x11xxxxx=note,cmd,all - else empty
; REPT 12
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
jmp P61_all(PC)
jmp P61_all2(PC)
; ENDR
jmp P61_cmd(PC)
jmp P61_cmd2(PC)
jmp P61_cmd(PC)
jmp P61_cmd2(PC)
jmp P61_noote(PC)
jmp P61_note2(PC)
jmp P61_empty(PC)
jmp P61_empty2(PC)
; REPT 12
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
jmp P61_allS(PC)
jmp P61_all2S(PC)
; ENDR
jmp P61_cmdS(PC)
jmp P61_cmd2S(PC)
jmp P61_cmdS(PC)
jmp P61_cmd2S(PC)
jmp P61_noteS(PC)
jmp P61_note2S(PC)
jmp P61_emptyS(PC)
; jmp P61_empty2S(PC)
********** END OF MYJPT **********
P61_empty2S:
move d7,(a5)+
move.b d7,(a5)+
;; --- alt exit ---
P61_proccompS:
move.b (a0)+,d1
move.b d1,d0
add.b d1,d1
bpl.b P61_permexit ;bit 6 was 0
;; --- stay in chan, repeat ---
.b6set: bcs.b .bit16
.bit8: move.b d7,(a5)
subq.l #3,a5 ;stay tuned to this channel!
and.w d4,d0 ;nec to clr hi byte
move.b d0,P61_TempLen+1(a5)
move.b (a0)+,d0 ;hi word is clear. (constant)
move.l a0,P61_ChaPos(a5) ;dupe of above
sub.l d0,a0 ;this 'repeats' same but doesnt update!
.jedi1: move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJpt+256(PC,d1.w)
.bit16: move.b d7,(a5)
subq.l #3,a5
and.w d4,d0 ;nec to clr hi byte
move.b d0,P61_TempLen+1(a5)
ifeq opt020
move.b (a0)+,d0 ;hi word is clear. (constant)
lsl #8,d0
move.b (a0)+,d0
else
move.w (a0)+,d0 ;(potentially) odd-address word-read.
endc
move.l a0,P61_ChaPos(a5) ;dupe of above
sub.l d0,a0 ;this 'repeats' same but doesnt update!
.jedi2: move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJpt+256(PC,d1.w)
P61_Take:
tst.b P61_TempLen+1(a5) ;faster than subq + addq!
bne.b P61_takeone
P61_TakeNorm: ;this is more frequent than takeone
move.l P61_ChaPos(a5),a0 ;dflt - if takenorm
move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJpt+256+4(PC,d1.w) ;first call can be this...
P61_takeone:
subq.b #1,P61_TempLen+1(a5)
move.l P61_TempPos(a5),a0
P61_Jedi: ;temp/repeat. copy below proccompS.
move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJpt+256(PC,d1.w) ;but rest is always this
;; --- alt (perm) exit --- ;does not affect maxtime.
P61_permexit:
move.b d0,(a5)
move.l a0,P61_ChaPos-3(a5)
bra.w P61_permdko
ifne P61_pde
P61_return:
rts
endc
********** Replay, Decrunch notes **********
;This routine is optimized absolutely and gets the Henrik-stamp of approval.
;d3,a4,a6 are usable ... if you can find a use for them.
ifne P61_pde
P61_preplay:
tst P61_pdflag-P61_cn(a3)
bne.b P61_return
else
P61_preplay:
endc
;; --- The hipper wilderbeest run gnu linux at midnight! ---
ifne P61_ft
lea (P61_samples-16)-P61_cn(a3),a2
endc
moveq #$3f,d4
moveq #-$10,d6 ;intelligent on/off-flag
moveq #0,d0 ;clear hi word, never dirtied below.
;; --- decrunch loop ---
P61_loaps:
;remember... code with BRAS in it is PANTS!
;As female coders know, they are often quite unnecessary.
ifne P61_pl ;make some backup copy of chanparams
lea P61_TData(a5),a1
move 2(a5),(a1)+
move.l P61_ChaPos(a5),(a1)+
move.l P61_TempPos(a5),(a1)+
move P61_TempLen(a5),(a1)
endc
moveq #-65,d1 ;%10111111 const
and.b P61_Pack(a5),d1
add.b d1,d1 ;sign in carry
beq.b P61_Take ;6 lsb bits 0?
bcc.b P61_nodko
addq #3,a5
subq.b #1,(a5)
bra.w P61_permdko
P61_nodko:
move.b d7,P61_OnOff+1(a5)
subq.b #1,P61_Pack(a5)
addq #3,a5
bra.w P61_koto
;; --- routines ---
P61_empty:
move d7,(a5)+
move.b d7,(a5)+
bra.w P61_ex
P61_all:
move.b d0,(a5)+ ;but this can't...
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.w P61_ex
P61_cmd:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+ ;join common endcontinues...
bra.w P61_ex
P61_noote:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
bra.w P61_ex
;; --- copyS ---
P61_emptyS:
move d7,(a5)+
move.b d7,(a5)+
bra.w P61_exS
P61_allS:
move.b d0,(a5)+ ;but this can't...
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.b P61_exS
P61_cmdS:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+ ;join common endcontinues...
bra.b P61_exS
;; --- ---
********** copy, perm exit **********
P61_empty2:
move d7,(a5)+
move.b d7,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdko
P61_all2:
move.b d0,(a5)+
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdko
P61_cmd2:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdko
P61_note2:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdko
;; --- copyS, diff exit ---
P61_note2S:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
bra.w P61_proccompS
P61_all2S:
move.b d0,(a5)+
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.w P61_proccompS
P61_cmd2S:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+
bra.w P61_proccompS
;; --- ---
P61_noteS:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
;; --- norm (temp) exit ---
;This exit is called when you have max rastertime.
P61_exS:
move.b (a0)+,(a5)
P61_ex:
move.l a0,P61_TempPos-3(a5)
P61_permdko:
move.w d6,P61_OnOff-3(a5) ;was byte size in word var...
move -3(a5),d0
and #$1f0,d0
beq.b .koto
ifne P61_ft
lea (a2,d0),a1 ;this is not the same a2 as the fix.
else
lea (P61_samples-16)-P61_cn(a3),a1
add d0,a1
endc
move.l a1,P61_Sample-3(a5)
ifne P61_ft
move.l P61_SampleVolume(a1),P61_Volume-3(a5)
else
move P61_SampleVolume(a1),P61_Volume-3(a5)
endc
ifne P61_il
move.l P61_RepeatOffset(a1),P61_Wave-3(a5)
endc
ifne P61_sof
move d7,P61_Offset-3(a5)
endc
.koto:
P61_koto:
ifeq split4 ;split4 means only do once.
lea Channel_Block_Size-3(a5),a5
dbf d5,P61_loaps
endc
P61_ret2:
rts
********** END OF LOAPS LOOP **********
********** here comes another :) **********
ifeq dupedec
P61_playtime:
addq.w #1,(a3) ;inc framecount past _Speed for detection+reset later
ifeq split4
ifgt splitchans
moveq #splitchans-1,d5 ;channels split off?(optimization flag)
lea P61_temp0+Channel_Block_Size*(channels-splitchans)(PC),a5
bsr P61_preplay
endc ;if splitchans
else
ifgt channels-3
lea P61_temp3(PC),a5
bsr P61_preplay
endc
endc ;if split4.
endc ;dupedec=0 ends here
ifgt (splitchans+split4) ;one of these must be on for dupe-code
ifne dupedec ;dupedec...you asked for it...
********** My Jump Table **********
P61_MyJptB:;jump table,%x1111xxx,%x111xxxx,%x11xxxxx=note,cmd,all - else empty
; REPT 12
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
jmp P61_allB(PC)
jmp P61_all2B(PC)
; ENDR
jmp P61_cmdB(PC)
jmp P61_cmd2B(PC)
jmp P61_cmdB(PC)
jmp P61_cmd2B(PC)
jmp P61_nooteB(PC)
jmp P61_note2B(PC)
jmp P61_emptyB(PC)
jmp P61_empty2B(PC)
; REPT 12
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
jmp P61_allSB(PC)
jmp P61_all2SB(PC)
; ENDR
jmp P61_cmdSB(PC)
jmp P61_cmd2SB(PC)
jmp P61_cmdSB(PC)
jmp P61_cmd2SB(PC)
jmp P61_noteSB(PC)
jmp P61_note2SB(PC)
jmp P61_emptySB(PC)
jmp P61_empty2SB(PC)
********** END OF MYJPT **********
P61_empty2SB:
move d7,(a5)+
move.b d7,(a5)+
;; --- alt exit ---
P61_proccompSB:
move.b (a0)+,d1
move.b d1,d0
add.b d1,d1
bpl.b P61_permexitB ;bit 6 was 0
;; --- stay in chan, repeat ---
.b6setB:bcs.b .bit16B
.bit8B: move.b d7,(a5)
subq.l #3,a5 ;stay tuned to this channel!
and.w d4,d0 ;nec to clr hi byte
move.b d0,P61_TempLen+1(a5)
move.b (a0)+,d0 ;hi word is clear. (constant)
move.l a0,P61_ChaPos(a5) ;dupe of above
sub.l d0,a0 ;this 'repeats' same but doesnt update!
.jedi1B:move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJptB+256(PC,d1.w)
.bit16B:move.b d7,(a5)
subq.l #3,a5
and.w d4,d0 ;nec to clr hi byte
move.b d0,P61_TempLen+1(a5)
ifeq opt020
move.b (a0)+,d0 ;hi word is clear. (constant)
lsl #8,d0
move.b (a0)+,d0
else
move.w (a0)+,d0 ;(potentially) odd-address word-read.
endc
move.l a0,P61_ChaPos(a5) ;dupe of above
sub.l d0,a0 ;this 'repeats' same but doesnt update!
.jedi2B:move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJptB+256(PC,d1.w)
P61_TakeB:
tst.b P61_TempLen+1(a5) ;faster than sub + add!
bne.b P61_takeoneB
P61_TakeNormB: ;this is more frequent than takeone
move.l P61_ChaPos(a5),a0 ;dflt - if takenorm
move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJptB+256+4(PC,d1.w) ;first call can be this...
P61_takeoneB:
subq.b #1,P61_TempLen+1(a5)
move.l P61_TempPos(a5),a0
P61_JediB: ;temp/repeat. copy below proccompS.
move.b (a0)+,d0 ;used in .empty etc
moveq #-8,d1 ;if sign, new P61_pack, retaddr-2
and.b d0,d1
jmp P61_MyJptB+256(PC,d1.w) ;but rest is always this
;; --- alt (perm) exit --- ;does not affect maxtime.
P61_permexitB:
move.b d0,(a5)
move.l a0,P61_ChaPos-3(a5)
bra.w P61_permdkoB
********** Replay, Decrunch notes **********
;This routine is optimized absolutely and gets the Henrik-stamp of approval.
;d3,a4,a6 are usable ... if you can find a use for them.
P61_playtime:
addq.w #1,(a3) ;is wrong now, but never used below.
ifne split4
ifgt channels-3
lea P61_temp3(PC),a5
else
bra.w P61_playtimeCont
endc ;ifgt channels-3
else ;not split4, splitchans.
moveq #splitchans-1,d5 ;channels split off?(optimization flag)
lea P61_temp0+Channel_Block_Size*(channels-splitchans)(PC),a5
endc
ifne P61_pde
P61_preplayB:
tst P61_pdflag-P61_cn(a3)
bne.w P61_return
else
P61_preplayB:
endc
;; --- The hipper wilderbeest run gnu linux at midnight! ---
moveq #$3f,d4
moveq #-$10,d6 ;intelligent on/off-flag
moveq #0,d0 ;clear hi word, never dirtied below.
;; --- decrunch loop ---
P61_loapsB:
;remember... code with BRAS in it is PANTS!
;As female coders know, they are often quite unnecessary.
ifne P61_pl ;make some backup copy of chanparams
lea P61_TData(a5),a1
move 2(a5),(a1)+
move.l P61_ChaPos(a5),(a1)+
move.l P61_TempPos(a5),(a1)+
move P61_TempLen(a5),(a1)
endc
moveq #-65,d1 ;%10111111 const
and.b P61_Pack(a5),d1
add.b d1,d1 ;sign in carry
beq.b P61_TakeB ;6 lsb bits 0?
bcc.b P61_nodkoB
addq #3,a5
subq.b #1,(a5)
bra.w P61_permdkoB
P61_nodkoB:
move.b d7,P61_OnOff+1(a5)
subq.b #1,P61_Pack(a5)
addq #3,a5
bra.w P61_kotoB
;; --- routines ---
P61_emptyB:
move d7,(a5)+
move.b d7,(a5)+
bra.w P61_exB
P61_allB:
move.b d0,(a5)+ ;but this can't...
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.w P61_exB
P61_cmdB:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+ ;join common endcontinues...
bra.w P61_exB
P61_nooteB:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
bra.w P61_exB
;; --- copyS ---
P61_emptySB:
move d7,(a5)+
move.b d7,(a5)+
bra.w P61_exSB
P61_allSB:
move.b d0,(a5)+ ;but this can't...
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.b P61_exSB
P61_cmdSB:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+ ;join common endcontinues...
bra.b P61_exSB
;; --- ---
********** copy, perm exit **********
P61_empty2B:
move d7,(a5)+
move.b d7,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdkoB
P61_all2B:
move.b d0,(a5)+
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdkoB
P61_cmd2B:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdkoB
P61_note2B:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
move.l a0,P61_ChaPos-3(a5)
bra.b P61_permdkoB
;; --- copyS, diff exit ---
P61_note2SB:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
bra.w P61_proccompSB
P61_all2SB:
move.b d0,(a5)+
ifeq opt020
move.b (a0)+,(a5)+
move.b (a0)+,(a5)+
else
move (a0)+,(a5)+
endc
bra.w P61_proccompSB
P61_cmd2SB:
moveq #$f,d1
and d0,d1
move d1,(a5)+
move.b (a0)+,(a5)+
bra.w P61_proccompSB
;; --- ---
P61_noteSB:
moveq #7,d1
and d0,d1
lsl #8,d1
move.b (a0)+,d1
lsl #4,d1
move d1,(a5)+
move.b d7,(a5)+
;; --- norm (temp) exit ---
;This exit is called when you have max rastertime.
P61_exSB:
move.b (a0)+,(a5)
P61_exB:
move.l a0,P61_TempPos-3(a5)
P61_permdkoB:
move.w d6,P61_OnOff-3(a5) ;was byte size in word var...
move -3(a5),d0
and #$1f0,d0
beq.b .kotoB
lea (P61_samples-16)-P61_cn(a3),a1
add d0,a1
move.l a1,P61_Sample-3(a5)
ifne P61_ft
move.l P61_SampleVolume(a1),P61_Volume-3(a5)
else
move P61_SampleVolume(a1),P61_Volume-3(a5)
endc
ifne P61_il
move.l P61_RepeatOffset(a1),P61_Wave-3(a5)
endc
ifne P61_sof
move d7,P61_Offset-3(a5)
endc
.kotoB:
P61_kotoB:
ifeq split4 ;split4 means only do once.
lea Channel_Block_Size-3(a5),a5
dbf d5,P61_loapsB
endc
;; --- end of dupedec ---
endc
endc
********** playtime continues **********
P61_playtimeCont:
ifne P61_pde
tst P61_pdelay-P61_cn(a3)
beq.b .djdj
subq #1,P61_pdelay-P61_cn(a3)
bne.w P61_delay
tst P61_speedis1-P61_cn(a3)
bne.w P61_delay
move d7,P61_pdflag-P61_cn(a3)
bra.w P61_delay
.djdj:
move d7,P61_pdflag-P61_cn(a3)
endc
ifne suppF01
tst P61_speedis1-P61_cn(a3)
beq.b .mo
lea P61_temp0(pc),a5
moveq #channels-1,d5
.chl: bsr.w P61_preplay ;then do the remaining from prev frame
ifeq split4 ;split4 means preplay is one-shot. So ext loop.
lea Channel_Block_Size-3(a5),a5
dbf d5,.chl
endc
.mo:
endc ;suppF01
ifeq copdma&nowaveforms ;both must be off to skip int.
ifeq p61system ;main 'new note' int starter.
lea P61_dmason(pc),a1
move.l P61_vektori(pc),a0
move.l a1,(a0)
move.b #$f0,$bfd600 ;496 ticks=11.000677 scanlines,
move.b #$01,$bfd700 ;dmaoff $1.38 scanlines later on 68000.
move.b #$19,$bfdf00 ;With unlucky timing and max period 856
;minimum="$1.38->2"+7+1=10 scanlines.
;With nonlev6 (copdma), "9 scanlines from call" is possible, but only with a
;margin of 51 color clocks. If chansplit/split4 is used, you must add 2
;scanlines decrunch time before dmaclr occurs. So 11 is good.
else
move #1,P61_server-P61_cn(a3)
move.l P61_craddr+4(pc),a1
move.b #$f0,(a1)
move.b #1,$100(a1)
endc
endc
moveq #0,d4 ;clr dmamask accumulator
moveq #channels-1,d5
lea P61_temp0(pc),a5
bra.w P61_loscont ;I'd trade a bra for 2 Leias any day!
;; --- start of jtab (jumptable) ---
ifne p61bigjtab
rept 16*15
dc.w P61_nocha-.j
endr
endc
dc P61_fxdone-.j ;$0xx
ifne use1Fx
dc P61_Trigger-.j
else
dc P61_fxdone-.j
endc
dc P61_fxdone-.j
ifne P61_tp
dc P61_settoneport-.j
else
dc P61_fxdone-.j
endc
ifne P61_vib ;$4xx
dc P61_vibrato-.j
else
dc P61_fxdone-.j
endc
ifne P61_tpvs
dc P61_toponochange-.j
else
dc P61_fxdone-.j
endc
dc P61_fxdone-.j
ifne P61_tre
dc P61_settremo-.j
else
dc P61_fxdone-.j
endc
dc P61_fxdone-.j ;$8xx
ifne P61_sof
dc P61_sampleoffse-.j
else
dc P61_fxdone-.j
endc
dc P61_fxdone-.j
ifne P61_pj
dc P61_posjmp-.j
else
dc P61_fxdone-.j
endc
ifne P61_vl ;$Cxx
dc P61_volum-.j
else
dc P61_fxdone-.j
endc
ifne P61_pb
dc P61_pattbreak-.j
else
dc P61_fxdone-.j
endc
ifne P61_ec
dc P61_ecommands-.j
else
dc P61_fxdone-.j
endc
ifne P61_sd ;Fxx
dc P61_cspeed-.j
else
dc P61_fxdone-.j
endc
.j:
P61_jtab:
;; --- end of table ---
P61_los:
lea Custom_Block_Size(a4),a4
lea Channel_Block_Size(a5),a5
P61_loscont:
move P61_OnOff(a5),d0 ;$ff00/$ffff? if off, will goto nocha.
ifeq p61bigjtab
tst.b d0
beq.s P61_nocha
endc
or (a5),d0
add d0,d0 ;->$fe00..$fffe (if big jtab)
move P61_jtab(PC,d0),d0
jmp P61_jtab(PC,d0)
P61_fxdone: ;this sets dma and paula values
moveq #$7e,d0
and.b (a5),d0
beq.b P61_nocha
ifne P61_vib
move.b d7,P61_VibPos(a5)
endc
ifne P61_tre
move.b d7,P61_TrePos(a5)
endc
ifne P61_ft
add P61_Fine(a5),d0
endc
move d0,P61_Note(a5)
move P61_periods-P61_cn(a3,d0),P61_Period(a5)
P61_zample: ;also direct target for finetune retrig
ifne P61_sof
tst P61_Offset(a5)
bne.w P61_pek
endc
;; --- check DMA-mask for pan/echo samplestarts, modify it, mix. ---
; bsr P61_Synth ;synth/pan/echo cpu-mix routine. Not done yet.
;; --- modify below code to not touch synth/pan/echo fixchans ---
or P61_DMABit(a5),d4 ;accumulate channels touched
move.l P61_Sample(a5),a1 ;skipped if nocha
ifeq oscillo
move.l (a1)+,(a4)
move (a1),4(a4)
else
;; --- wohoo oscilloscope ptrs ---
moveq #0,d1
move.l (a1)+,d0
move (a1),d1
move.l d0,(a4)
move.w d1,4(a4)
subq.w #1,d1
addq.l #1,d1 ;128KB support for sample endptr
lsl.l #2,d0 ;clear remainder.
move.l d0,P61_oscptr(a5)
move.w d7,P61_oscptrrem(a5) ;clear remainder.
lsl.l #3,d1
add.l d0,d1
move.l d1,P61_oscptrWrap(a5) ;wrap endptr for compare.
endc ;oscillo
P61_nocha:
ifeq p61fade
move.l P61_Period(a5),6(a4)
else
move P61_Period(a5),6(a4)
move P61_Volume(a5),P61_Shadow(a5)
endc
P61_skip:
ifne P61_il
bsr.w P61_funk2
endc
DBF d5,P61_los
P61_chansdone:
ifne clraudxdat
move.w d4,d5
lsl.w #3,d5
add.b d5,d5
bpl.b .noch3
move.w d7,$da-C(A6) ;clear AUDxDAT
.noch3: add.b d5,d5
bpl.b .noch2
move.w d7,$ca-C(A6) ;clear AUDxDAT
.noch2: add.b d5,d5
bpl.b .noch1
move.w d7,$ba-C(A6) ;clear AUDxDAT
.noch1: add.b d5,d5
bpl.b .noch0
move.w d7,$aa-C(A6) ;clear AUDxDAT
.noch0:
endc
move d4,$96-C(a6) ;DMAclear - changed to not be written 4 times
ifne visuctrs
lea P61_visuctr0+channels*2(PC),a0
moveq #channels-1,d5
.visul: subq.w #2,a0
btst d5,d4
beq.s .noctr0
move.w d7,(a0)
.noctr0:
dbf d5,.visul
endc
ifne copdma
move.l p61_DMApokeAddr(PC),a0
move.b d4,(a0) ;only the low byte is poked, allowing other dma
endc
move.b d4,P61_dma+1-P61_cn(a3)
;; --- non-rolled over code --- compatible with F01.
ifne suppF01 ;moved to here in P6110.
ifne nowaveforms
move.b d4,P61_NewDMA+1-P61_cn(a3) ;or set by fx
endc
move.w d7,(a3) ;clr p61_cn
ifne P61_pl
tst.b P61_plflag+1-P61_cn(a3)
beq.b P61_ohittaa
lea P61_temp0(pc),a1
lea P61_looppos(pc),a0
moveq #channels-1,d0
.talt:
move.b 1(a0),3(a1)
addq.l #2,a0
move.l (a0)+,P61_ChaPos(a1)
move.l (a0)+,P61_TempPos(a1)
move (a0)+,P61_TempLen(a1)
lea Channel_Block_Size(a1),a1
dbf d0,.talt
move P61_plrowpos(pc),P61_rowpos-P61_cn(a3)
move.b d7,P61_plflag+1-P61_cn(a3)
moveq #63,d0
sub P61_rowpos-P61_cn(a3),d0
move d0,P61_CRow-P61_cn(a3)
rts
P61_ohittaa: ;nextrow
endc
subq #1,P61_rowpos-P61_cn(a3) ;next pattern-step
bpl.b P61_nonewpatt
P61_nextpattern:
ifne P61_pl
move d7,P61_plflag-P61_cn(a3)
endc
move.l P61_patternbase(pc),a0
moveq #63,d0
move d0,P61_rowpos-P61_cn(a3)
move d7,P61_CRow-P61_cn(a3)
move.l P61_spos(pc),a1
addq #1,P61_Pos-P61_cn(a3)
move.b (a1)+,d0
bpl.b P61_dk
move.l P61_possibase(pc),a1
move.b (a1)+,d0
move d7,P61_Pos-P61_cn(a3)
P61_dk:
move.l a1,P61_spos-P61_cn(a3)
move d0,P61_Patt-P61_cn(a3)
lsl #3,d0
move.l P61_positionbase(pc),a1
add.l d0,a1
move.w (a1)+,d0 ;no movem sign-extend... check.
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp0-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0 ;for some reason this code doesn't
add.l a0,d0 ;use 'ifgt channels-1' etc. Kept as is.
move.l d0,P61_ChaPos+P61_temp1-P61_cn(a3)
moveq #0,d0
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp2-P61_cn(a3)
moveq #0,d0
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp3-P61_cn(a3)
rts
P61_nonewpatt:
moveq #63,d0
sub P61_rowpos-P61_cn(a3),d0
move d0,P61_CRow-P61_cn(a3)
;; --- end of non-rolled over code ---
endc ;suppF01
rts ;end of P61_playtime.
********** FX routines **********
ifne use1Fx
P61_Trigger:
move.b P61_Info(a5),d0
cmp.b #$f0,d0
blo.w P61_fxdone
move.b d0,P61_PTrig+1-P61_cn(a3)
bra.w P61_fxdone
endc
ifne P61_tp
P61_settoneport:
move.b P61_Info(a5),d0
beq.b P61_toponochange
move.b d0,P61_TPSpeed+1(a5)
P61_toponochange:
moveq #$7e,d0
and.b (a5),d0
beq.w P61_nocha
add P61_Fine(a5),d0
move d0,P61_Note(a5)
move P61_periods-P61_cn(a3,d0),P61_ToPeriod(a5)
bra.w P61_nocha
endc
ifne P61_sof
P61_sampleoffse:
moveq #0,d1
move #$ff00,d1
and 2(a5),d1
bne.b .deq
move P61_LOffset(a5),d1
.deq:
move d1,P61_LOffset(a5)
add d1,P61_Offset(a5)
moveq #$7e,d0
and.b (a5),d0
beq.w P61_nocha
move P61_Offset(a5),d2
add d1,P61_Offset(a5)
move d2,d1
ifne P61_vib
move.b d7,P61_VibPos(a5)
endc
ifne P61_tre
move.b d7,P61_TrePos(a5)
endc
ifne P61_ft
add P61_Fine(a5),d0
endc
move d0,P61_Note(a5)
move P61_periods-P61_cn(a3,d0),P61_Period(a5)
bra.b P61_hup
P61_pek:
moveq #0,d1
move P61_Offset(a5),d1
P61_hup:
or P61_DMABit(a5),d4 ;don't write 4 times, please.
move.l P61_Sample(a5),a1
move.l (a1)+,d0
add.l d1,d0
move.l d0,(a4)
lsr #1,d1
move (a1),d6
sub d1,d6
bpl.b P61_offok
move.l -4(a1),(a4)
moveq #1,d6
P61_offok:
move d6,4(a4)
ifne oscillo
;; --- wohoo oscilloscope ptrs ---
moveq #0,d1
move.w d6,d1
subq.w #1,d1
addq.l #1,d1 ;128KB support for sample endptr
lsl.l #2,d0 ;clear remainder.
move.l d0,P61_oscptr(a5)
move.w d7,P61_oscptrrem(a5) ;clear remainder.
lsl.l #3,d1
add.l d0,d1
move.l d1,P61_oscptrWrap(a5) ;wrap endptr for compare.
endc ;oscillo
bra.w P61_nocha ;continues to where ints etc is handled
endc
ifne P61_vl
P61_volum:
move.b P61_Info(a5),P61_Volume+1(a5)
bra.w P61_fxdone
endc
ifne P61_pj
P61_posjmp:
moveq #0,d0
move.b P61_Info(a5),d0
ifeq optjmp
cmp P61_slen-P61_cn(a3),d0
blo.b .e
moveq #0,d0
endc
.e: move d0,P61_Pos-P61_cn(a3)
add.l P61_possibase(pc),d0
move.l d0,P61_spos-P61_cn(a3)
endc
ifne P61_pb
P61_pattbreak: ;needs to be execd if posjmp, and P61_pj>0.
moveq #64,d0
move d0,P61_rowpos-P61_cn(a3)
move d7,P61_CRow-P61_cn(a3)
P61_Bc: move.l P61_spos(pc),a1
move.l P61_patternbase(pc),a0
addq #1,P61_Pos-P61_cn(a3)
move.b (a1)+,d0
bpl.b P61_dk2
move.l P61_possibase(pc),a1
move.b (a1)+,d0
move d7,P61_Pos-P61_cn(a3)
P61_dk2:
move.l a1,P61_spos-P61_cn(a3)
move.l P61_positionbase(pc),a1
move d0,P61_Patt-P61_cn(a3)
lsl #3,d0
add.l d0,a1
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp0-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp1-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp2-P61_cn(a3)
moveq #0,d0 ;actually faster than lea (a0,d0.l)
move.w (a1)+,d0
add.l a0,d0
move.l d0,P61_ChaPos+P61_temp3-P61_cn(a3)
bra.w P61_fxdone
endc
ifne P61_vib
P61_vibrato:
move.b P61_Info(a5),d0
beq.w P61_fxdone
move.b d0,d1
move.b P61_VibCmd(a5),d2
and.b #$f,d0
beq.b P61_vibskip
and.b #$f0,d2
or.b d0,d2
P61_vibskip:
and.b #$f0,d1
beq.b P61_vibskip2
and.b #$f,d2
or.b d1,d2
P61_vibskip2:
move.b d2,P61_VibCmd(a5)
bra.w P61_fxdone
endc
ifne P61_tre
P61_settremo:
move.b P61_Info(a5),d0
beq.w P61_fxdone
move.b d0,d1
move.b P61_TreCmd(a5),d2
moveq #$f,d3
and.b d3,d0
beq.b P61_treskip
and.b #$f0,d2
or.b d0,d2
P61_treskip:
and.b #$f0,d1
beq.b P61_treskip2
and.b d3,d2
or.b d1,d2
P61_treskip2:
move.b d2,P61_TreCmd(a5)
bra.w P61_fxdone
endc
ifne P61_ec
P61_ecommands:
move.b P61_Info(a5),d0
and.w #$f0,d0
lsr #3,d0
move P61_etab(pc,d0),d0
jmp P61_etab(pc,d0)
P61_etab:
ifne P61_fi
dc P61_filter-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_fsu
dc P61_fineup-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_fsd
dc P61_finedwn-P61_etab
else
dc P61_fxdone-P61_etab
endc
dc P61_fxdone-P61_etab ;e3
dc P61_fxdone-P61_etab ;e4
ifne P61_sft ;e5
dc P61_setfinetune-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_pl ;e6,patternloop
dc P61_patternloop-P61_etab
else
dc P61_fxdone-P61_etab
endc
dc P61_fxdone-P61_etab ;e7
ifne P61_timing
dc P61_sete8-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_rt
dc P61_setretrig-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_fvu
dc P61_finevup-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_fvd
dc P61_finevdwn-P61_etab
else
dc P61_fxdone-P61_etab
endc
dc P61_fxdone-P61_etab
ifne P61_nd
dc P61_ndelay-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_pde
dc P61_pattdelay-P61_etab
else
dc P61_fxdone-P61_etab
endc
ifne P61_il
dc P61_funk-P61_etab
else
dc P61_fxdone-P61_etab
endc
endc
ifne P61_fi
P61_filter:
move.b P61_Info(a5),d0
and.b #$fd,$bfe001
or.b d0,$bfe001
bra.w P61_fxdone
endc
ifne P61_fsu
P61_fineup:
P61_getnote
moveq #$f,d0
and.b P61_Info(a5),d0
sub d0,P61_Period(a5)
moveq #113,d0
cmp P61_Period(a5),d0
ble.b .jup
move d0,P61_Period(a5)
.jup:
moveq #$7e,d0
and.b (a5),d0
bne.w P61_zample
bra.w P61_nocha
endc
ifne P61_fsd
P61_finedwn:
P61_getnote
moveq #$f,d0
and.b P61_Info(a5),d0
add d0,P61_Period(a5)
cmp #856,P61_Period(a5)
ble.b .jup
move #856,P61_Period(a5)
.jup: moveq #$7e,d0
and.b (a5),d0
bne.w P61_zample
bra.w P61_nocha
endc
ifne P61_sft
P61_setfinetune:
moveq #$f,d0
and.b P61_Info(a5),d0
ifeq opt020
add d0,d0
move P61_mulutab(pc,d0),P61_Fine(a5)
else
move P61_mulutab(pc,d0*2),P61_Fine(a5)
endc
bra.w P61_fxdone
P61_mulutab:
dc 0,74,148,222,296,370,444,518,592,666,740,814,888,962,1036,1110
endc
;; --- E6x start ---
ifne P61_pl
P61_patternloop:
moveq #$f,d0
and.b P61_Info(a5),d0 ;E6x, x=0?
beq.b P61_setloop ;then set loop start point ONLY
tst.b P61_plflag-P61_cn(a3) ;not first encounter?
bne.b P61_noset ;then don't set start count
move d0,P61_plcount-P61_cn(a3) ;set start count
st.b P61_plflag-P61_cn(a3) ;and flag
P61_noset:
tst P61_plcount-P61_cn(a3) ;loop count expired?
bne.b P61_looppaa
move.b d7,P61_plflag-P61_cn(a3) ;then clear flag and done
bra.w P61_fxdone
P61_looppaa:
st.b P61_plflag+1-P61_cn(a3) ;else special-flag jump later
subq #1,P61_plcount-P61_cn(a3) ;and dec loop count
bra.w P61_fxdone
P61_setloop:
tst.b P61_plflag-P61_cn(a3) ;flag already set?
bne.w P61_fxdone ;then do nothing
move P61_rowpos(pc),P61_plrowpos-P61_cn(a3) ;else set pos
lea P61_temp0+P61_TData(pc),a1 ;& prep chans
lea P61_looppos(pc),a0
moveq #channels-1,d0
.talt:
move.l (a1)+,(a0)+
move.l (a1)+,(a0)+
move.l (a1),(a0)+
lea Channel_Block_Size-8(a1),a1
dbf d0,.talt
bra.w P61_fxdone ;and done.
endc
;; --- E6x end ---
ifne P61_fvu
P61_finevup:
moveq #$f,d0
and.b P61_Info(a5),d0
add d0,P61_Volume(a5)
moveq #64,d0
cmp P61_Volume(a5),d0
bge.w P61_fxdone
move d0,P61_Volume(a5)
bra.w P61_fxdone
endc
ifne P61_fvd
P61_finevdwn:
moveq #$f,d0
and.b P61_Info(a5),d0
sub d0,P61_Volume(a5)
bpl.w P61_fxdone
move d7,P61_Volume(a5)
bra.w P61_fxdone
endc
ifne P61_timing
P61_sete8:
moveq #$f,d0
and.b P61_Info(a5),d0
move d0,P61_E8-P61_cn(a3)
bra.w P61_fxdone
endc
ifne P61_rt
P61_setretrig:
moveq #$f,d0
and.b P61_Info(a5),d0
move d0,P61_RetrigCount(a5)
bra.w P61_fxdone
endc
ifne P61_nd
P61_ndelay:
moveq #$7e,d0
and.b (a5),d0
beq.w P61_skip
ifne P61_vib
move.b d7,P61_VibPos(a5)
endc
ifne P61_tre
move.b d7,P61_TrePos(a5)
endc
ifne P61_ft
add P61_Fine(a5),d0
endc
move d0,P61_Note(a5)
move P61_periods-P61_cn(a3,d0),P61_Period(a5)
ifeq p61fade
move P61_Volume(a5),8(a4)
else
move P61_Volume(a5),P61_Shadow(a5)
endc
bra.w P61_skip
endc
ifne P61_pde
P61_pattdelay:
moveq #$f,d0
and.b P61_Info(a5),d0
move d0,P61_pdelay-P61_cn(a3)
st P61_pdflag-P61_cn(a3)
bra.w P61_fxdone
endc
ifne P61_sd
P61_cspeed:
moveq #0,d0
move.b P61_Info(a5),d0
ifne p61cia
tst P61_Tempo-P61_cn(a3)
beq.b P61_VBlank
cmp.b #32,d0
bhs.b P61_STempo
endc
P61_VBlank:
cmp.b #1,d0
beq.b P61_jkd
move.b d0,P61_speed+1-P61_cn(a3)
subq.b #1,d0
move.b d0,P61_speed2+1-P61_cn(a3)
move d7,P61_speedis1-P61_cn(a3)
bra.w P61_fxdone
P61_jkd:
move.b d0,P61_speed+1-P61_cn(a3)
move.b d0,P61_speed2+1-P61_cn(a3)
st P61_speedis1-P61_cn(a3)
bra.w P61_fxdone
ifne p61cia
P61_STempo:
move.l P61_timer(pc),d1
divu d0,d1
move d1,P61_thi2-P61_cn(a3)
sub #$1f0*2,d1
move d1,P61_thi-P61_cn(a3)
ifeq p61system
move P61_thi2-P61_cn(a3),d1
move.b d1,$bfd400
lsr #8,d1
move.b d1,$bfd500
endc
bra P61_fxdone
endc
endc
ifne P61_vbvs
P61_vibochvslide:
move.b P61_Info(a5),d0
sub.b d0,P61_Volume+1(a5)
bpl.b P61_test62
move d7,P61_Volume(a5)
ifeq p61fade
move d7,8(a4)
else
move d7,P61_Shadow(a5)
endc
bra.b P61_vib2
P61_test62:
moveq #64,d0
cmp P61_Volume(a5),d0
bge.b .ncs2
move d0,P61_Volume(a5)
.ncs2:
ifeq p61fade
move P61_Volume(a5),8(a4)
else
move P61_Volume(a5),P61_Shadow(a5)
endc
endc
ifne P61_vib
P61_vib2:
move #$f00,d0
move P61_VibCmd(a5),d1
and d1,d0
lsr #3,d0
lsr #2,d1
and #$1f,d1
add d1,d0
move P61_Period(a5),d1
moveq #0,d2
move.b P61_vibtab(pc,d0),d2
tst.b P61_VibPos(a5)
bmi.b .vibneg
add d2,d1
bra.b P61_vib4
.vibneg:sub d2,d1
P61_vib4:
move d1,6(a4)
move.b P61_VibCmd(a5),d0
lsr.b #2,d0
and #$3c,d0
add.b d0,P61_VibPos(a5)
bra.w P61_contfxdone
endc
ifne P61_tre
P61_tremo:
move #$f00,d0
move P61_TreCmd(a5),d1
and d1,d0
lsr #3,d0
lsr #2,d1
and #$1f,d1
add d1,d0
move P61_Volume(a5),d1
moveq #0,d2
move.b P61_vibtab(pc,d0),d2
tst.b P61_TrePos(a5)
bmi.b .treneg
add d2,d1
cmp #64,d1
ble.b P61_tre4
moveq #64,d1
bra.b P61_tre4
.treneg:
sub d2,d1
bpl.b P61_tre4
moveq #0,d1
P61_tre4:
ifeq p61fade
move d1,8(a4)
else
move d1,P61_Shadow(a5)
endc
move.b P61_TreCmd(a5),d0
lsr.b #2,d0
and #$3c,d0
add.b d0,P61_TrePos(a5)
bra.w P61_contfxdone
endc
ifne (P61_vib+P61_tre)
P61_vibtab:
; incbin "vibtab"
dc.b $00,$00,$00,$00,$00,$00,$00,$00
dc.b $00,$00,$00,$00,$00,$00,$00,$00
dc.b $00,$00,$00,$00,$00,$00,$00,$00
dc.b $00,$00,$00,$00,$00,$00,$00,$00
dc.b $00,$00,$00,$00,$00,$00,$01,$01
dc.b $01,$01,$01,$01,$01,$01,$01,$01
dc.b $01,$01,$01,$01,$01,$01,$01,$01
dc.b $01,$01,$01,$00,$00,$00,$00,$00
dc.b $00,$00,$00,$01,$01,$01,$02,$02
dc.b $02,$03,$03,$03,$03,$03,$03,$03
dc.b $03,$03,$03,$03,$03,$03,$03,$03
dc.b $02,$02,$02,$01,$01,$01,$00,$00
dc.b $00,$00,$01,$01,$02,$02,$03,$03
dc.b $04,$04,$04,$05,$05,$05,$05,$05
dc.b $05,$05,$05,$05,$05,$05,$04,$04
dc.b $04,$03,$03,$02,$02,$01,$01,$00
dc.b $00,$00,$01,$02,$03,$03,$04,$05
dc.b $05,$06,$06,$07,$07,$07,$07,$07
dc.b $07,$07,$07,$07,$07,$07,$06,$06
dc.b $05,$05,$04,$03,$03,$02,$01,$00
dc.b $00,$00,$01,$02,$03,$04,$05,$06
dc.b $07,$07,$08,$08,$09,$09,$09,$09
dc.b $09,$09,$09,$09,$09,$08,$08,$07
dc.b $07,$06,$05,$04,$03,$02,$01,$00
dc.b $00,$01,$02,$03,$04,$05,$06,$07
dc.b $08,$09,$09,$0a,$0b,$0b,$0b,$0b
dc.b $0b,$0b,$0b,$0b,$0b,$0a,$09,$09
dc.b $08,$07,$06,$05,$04,$03,$02,$01
dc.b $00,$01,$02,$04,$05,$06,$07,$08
dc.b $09,$0a,$0b,$0c,$0c,$0d,$0d,$0d
dc.b $0d,$0d,$0d,$0d,$0c,$0c,$0b,$0a
dc.b $09,$08,$07,$06,$05,$04,$02,$01
dc.b $00,$01,$03,$04,$06,$07,$08,$0a
dc.b $0b,$0c,$0d,$0e,$0e,$0f,$0f,$0f
dc.b $0f,$0f,$0f,$0f,$0e,$0e,$0d,$0c
dc.b $0b,$0a,$08,$07,$06,$04,$03,$01
dc.b $00,$01,$03,$05,$06,$08,$09,$0b
dc.b $0c,$0d,$0e,$0f,$10,$11,$11,$11
dc.b $11,$11,$11,$11,$10,$0f,$0e,$0d
dc.b $0c,$0b,$09,$08,$06,$05,$03,$01
dc.b $00,$01,$03,$05,$07,$09,$0b,$0c
dc.b $0e,$0f,$10,$11,$12,$13,$13,$13
dc.b $13,$13,$13,$13,$12,$11,$10,$0f
dc.b $0e,$0c,$0b,$09,$07,$05,$03,$01
dc.b $00,$02,$04,$06,$08,$0a,$0c,$0d
dc.b $0f,$10,$12,$13,$14,$14,$15,$15
dc.b $15,$15,$15,$14,$14,$13,$12,$10
dc.b $0f,$0d,$0c,$0a,$08,$06,$04,$02
dc.b $00,$02,$04,$06,$09,$0b,$0d,$0f
dc.b $10,$12,$13,$15,$16,$16,$17,$17
dc.b $17,$17,$17,$16,$16,$15,$13,$12
dc.b $10,$0f,$0d,$0b,$09,$06,$04,$02
dc.b $00,$02,$04,$07,$09,$0c,$0e,$10
dc.b $12,$14,$15,$16,$17,$18,$19,$19
dc.b $19,$19,$19,$18,$17,$16,$15,$14
dc.b $12,$10,$0e,$0c,$09,$07,$04,$02
dc.b $00,$02,$05,$08,$0a,$0d,$0f,$11
dc.b $13,$15,$17,$18,$19,$1a,$1b,$1b
dc.b $1b,$1b,$1b,$1a,$19,$18,$17,$15
dc.b $13,$11,$0f,$0d,$0a,$08,$05,$02
dc.b $00,$02,$05,$08,$0b,$0e,$10,$12
dc.b $15,$17,$18,$1a,$1b,$1c,$1d,$1d
dc.b $1d,$1d,$1d,$1c,$1b,$1a,$18,$17
dc.b $15,$12,$10,$0e,$0b,$08,$05,$02
endc
ifne P61_il
P61_funk:
moveq #$f,d0
and.b P61_Info(a5),d0
move.b d0,P61_Funkspd(a5)
bra.w P61_fxdone
P61_funk2:
moveq #0,d0
move.b P61_Funkspd(a5),d0
beq.b P61_funkend
move.b P61_FunkTable(pc,d0),d0
add.b d0,P61_Funkoff(a5)
bpl.b P61_funkend
move.b d7,P61_Funkoff(a5)
move.l P61_Sample(a5),a1
move.l P61_RepeatOffset(a1),d1
move P61_RepeatLength(a1),d0
add.l d0,d0
add.l d1,d0
move.l P61_Wave(a5),a0
addq.l #1,a0
cmp.l d0,a0
blo.b P61_funkok
move.l d1,a0
P61_funkok:
move.l a0,P61_Wave(a5)
not.b (a0)
P61_funkend:
rts
P61_FunkTable:
dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128
endc
********** rest is NOT part of P61_music **********
********** timing interrupt entry point **********
;; --- first int, DMAs on again. ---
ifeq copdma
P61_dmason:
ifeq p61system
tst.b $bfdd00
move #$2000,$dff09c
move #$2000,$dff09c
ifeq nowaveforms
move.b #$19,$bfdf00 ;retrigger to chain replen int.
move.l a0,-(sp)
move.l P61_vektori(pc),a0 ;put another int in '$78.w'
move.l P61_intaddr(pc),(a0)
move.l (sp)+,a0
endc
move P61_dma(pc),$dff096 ;on only. includes $8200.
nop
rte
else
move P61_dma(pc),$dff096 ;on only. includes $8200.
lea P61_server(pc),a3
addq #1,(a3)
move.l P61_craddr(pc),a0
move.b #$19,(a0)
bra P61_ohi
endc
endc ;ifeq copdma
;; --- second chained int, replen ---
ifeq nowaveforms
P61_setrepeat:
ifeq p61system
tst.b $bfdd00
movem.l a0/a1,-(sp)
lea $dff0a0,a1
move #$2000,-4(a1)
move #$2000,-4(a1)
else
lea $dff0a0,a1
endc
move.l P61_Sample+P61_temp0(pc),a0
addq.l #6,a0
move.l (a0)+,(a1)+
move (a0),(a1)
ifgt channels-1
move.l P61_Sample+P61_temp1(pc),a0
addq.l #6,a0
move.l (a0)+,12(a1)
move (a0),16(a1)
endc
ifgt channels-2
move.l P61_Sample+P61_temp2(pc),a0
addq.l #6,a0
move.l (a0)+,28(a1)
move (a0),32(a1)
endc
ifgt channels-3
move.l P61_Sample+P61_temp3(pc),a0
addq.l #6,a0
move.l (a0)+,44(a1)
move (a0),48(a1)
endc
ifne p61system
ifne p61cia
lea P61_server(pc),a3
clr (a3)
move.l P61_craddr+4(pc),a0
move.b P61_tlo(pc),(a0)
move.b P61_thi(pc),$100(a0)
endc
bra P61_ohi
endc
ifeq p61system
ifne p61cia
move.l P61_vektori(pc),a0
move.l P61_tintti(pc),(a0)
endc
movem.l (sp)+,a0/a1
nop
rte
endc
endc ;ifeq nowaveforms
P61_temp0:
dcb.b Channel_Block_Size-2,0
dc 1
P61_temp1:
dcb.b Channel_Block_Size-2,0
dc 2
P61_temp2:
dcb.b Channel_Block_Size-2,0
dc 4
P61_temp3:
dcb.b Channel_Block_Size-2,0
dc 8
ifne split4
P61_temp0copy: dcb.b P61_Wave+4,0 ;temp storage for split4.
P61_temp1copy: dcb.b P61_Wave+4,0
endc
P61_cn:
dc 0
P61_periods:
ifne P61_ft
; incbin "A:INC/SND/periods"
dc.w $0358,$0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
dc.w $008f,$0087,$007f,$0078,$0071,$0352,$0352,$0322
dc.w $02f5,$02cb,$02a2,$027d,$0259,$0237,$0217,$01f9
dc.w $01dd,$01c2,$01a9,$0191,$017b,$0165,$0151,$013e
dc.w $012c,$011c,$010c,$00fd,$00ef,$00e1,$00d5,$00c9
dc.w $00bd,$00b3,$00a9,$009f,$0096,$008e,$0086,$007e
dc.w $0077,$0071,$034c,$034c,$031c,$02f0,$02c5,$029e
dc.w $0278,$0255,$0233,$0214,$01f6,$01da,$01bf,$01a6
dc.w $018e,$0178,$0163,$014f,$013c,$012a,$011a,$010a
dc.w $00fb,$00ed,$00e0,$00d3,$00c7,$00bc,$00b1,$00a7
dc.w $009e,$0095,$008d,$0085,$007d,$0076,$0070,$0346
dc.w $0346,$0317,$02ea,$02c0,$0299,$0274,$0250,$022f
dc.w $0210,$01f2,$01d6,$01bc,$01a3,$018b,$0175,$0160
dc.w $014c,$013a,$0128,$0118,$0108,$00f9,$00eb,$00de
dc.w $00d1,$00c6,$00bb,$00b0,$00a6,$009d,$0094,$008c
dc.w $0084,$007d,$0076,$006f,$0340,$0340,$0311,$02e5
dc.w $02bb,$0294,$026f,$024c,$022b,$020c,$01ef,$01d3
dc.w $01b9,$01a0,$0188,$0172,$015e,$014a,$0138,$0126
dc.w $0116,$0106,$00f7,$00e9,$00dc,$00d0,$00c4,$00b9
dc.w $00af,$00a5,$009c,$0093,$008b,$0083,$007c,$0075
dc.w $006e,$033a,$033a,$030b,$02e0,$02b6,$028f,$026b
dc.w $0248,$0227,$0208,$01eb,$01cf,$01b5,$019d,$0186
dc.w $0170,$015b,$0148,$0135,$0124,$0114,$0104,$00f5
dc.w $00e8,$00db,$00ce,$00c3,$00b8,$00ae,$00a4,$009b
dc.w $0092,$008a,$0082,$007b,$0074,$006d,$0334,$0334
dc.w $0306,$02da,$02b1,$028b,$0266,$0244,$0223,$0204
dc.w $01e7,$01cc,$01b2,$019a,$0183,$016d,$0159,$0145
dc.w $0133,$0122,$0112,$0102,$00f4,$00e6,$00d9,$00cd
dc.w $00c1,$00b7,$00ac,$00a3,$009a,$0091,$0089,$0081
dc.w $007a,$0073,$006d,$032e,$032e,$0300,$02d5,$02ac
dc.w $0286,$0262,$023f,$021f,$0201,$01e4,$01c9,$01af
dc.w $0197,$0180,$016b,$0156,$0143,$0131,$0120,$0110
dc.w $0100,$00f2,$00e4,$00d8,$00cc,$00c0,$00b5,$00ab
dc.w $00a1,$0098,$0090,$0088,$0080,$0079,$0072,$006c
dc.w $038b,$038b,$0358,$0328,$02fa,$02d0,$02a6,$0280
dc.w $025c,$023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194
dc.w $017d,$0168,$0153,$0140,$012e,$011d,$010d,$00fe
dc.w $00f0,$00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0
dc.w $0097,$008f,$0087,$007f,$0078,$0384,$0384,$0352
dc.w $0322,$02f5,$02cb,$02a3,$027c,$0259,$0237,$0217
dc.w $01f9,$01dd,$01c2,$01a9,$0191,$017b,$0165,$0151
dc.w $013e,$012c,$011c,$010c,$00fd,$00ee,$00e1,$00d4
dc.w $00c8,$00bd,$00b3,$00a9,$009f,$0096,$008e,$0086
dc.w $007e,$0077,$037e,$037e,$034c,$031c,$02f0,$02c5
dc.w $029e,$0278,$0255,$0233,$0214,$01f6,$01da,$01bf
dc.w $01a6,$018e,$0178,$0163,$014f,$013c,$012a,$011a
dc.w $010a,$00fb,$00ed,$00df,$00d3,$00c7,$00bc,$00b1
dc.w $00a7,$009e,$0095,$008d,$0085,$007d,$0076,$0377
dc.w $0377,$0346,$0317,$02ea,$02c0,$0299,$0274,$0250
dc.w $022f,$0210,$01f2,$01d6,$01bc,$01a3,$018b,$0175
dc.w $0160,$014c,$013a,$0128,$0118,$0108,$00f9,$00eb
dc.w $00de,$00d1,$00c6,$00bb,$00b0,$00a6,$009d,$0094
dc.w $008c,$0084,$007d,$0076,$0371,$0371,$0340,$0311
dc.w $02e5,$02bb,$0294,$026f,$024c,$022b,$020c,$01ee
dc.w $01d3,$01b9,$01a0,$0188,$0172,$015e,$014a,$0138
dc.w $0126,$0116,$0106,$00f7,$00e9,$00dc,$00d0,$00c4
dc.w $00b9,$00af,$00a5,$009c,$0093,$008b,$0083,$007b
dc.w $0075,$036b,$036b,$033a,$030b,$02e0,$02b6,$028f
dc.w $026b,$0248,$0227,$0208,$01eb,$01cf,$01b5,$019d
dc.w $0186,$0170,$015b,$0148,$0135,$0124,$0114,$0104
dc.w $00f5,$00e8,$00db,$00ce,$00c3,$00b8,$00ae,$00a4
dc.w $009b,$0092,$008a,$0082,$007b,$0074,$0364,$0364
dc.w $0334,$0306,$02da,$02b1,$028b,$0266,$0244,$0223
dc.w $0204,$01e7,$01cc,$01b2,$019a,$0183,$016d,$0159
dc.w $0145,$0133,$0122,$0112,$0102,$00f4,$00e6,$00d9
dc.w $00cd,$00c1,$00b7,$00ac,$00a3,$009a,$0091,$0089
dc.w $0081,$007a,$0073,$035e,$035e,$032e,$0300,$02d5
dc.w $02ac,$0286,$0262,$023f,$021f,$0201,$01e4,$01c9
dc.w $01af,$0197,$0180,$016b,$0156,$0143,$0131,$0120
dc.w $0110,$0100,$00f2,$00e4,$00d8,$00cb,$00c0,$00b5
dc.w $00ab,$00a1,$0098,$0090,$0088,$0080,$0079,$0072
else
; incbin "periods.nft"
dc.w $0358,$0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
dc.w $008f,$0087,$007f,$0078,$0071
endc
P61_dma:
dc $8200
P61_rowpos:
dc 0
P61_slen:
dc 0
P61_speed:
dc 0
P61_speed2:
dc 0
P61_speedis1:
dc 0
P61_spos:
dc.l 0
ifeq p61system
P61_vektori:
dc.l 0
P61_oldlev6:
dc.l 0
endc
P61_ofilter:
dc 0
P61_timers:
dc.l 0
ifne p61cia
P61_tintti:
dc.l 0
P61_thi:
dc.b 0
P61_tlo:
dc.b 0
P61_thi2:
dc.b 0
P61_tlo2:
dc.b 0
P61_timer:
dc.l 0
endc
ifne P61_pl
P61_plcount:
dc 0
P61_plflag:
dc 0
P61_plreset:
dc 0
P61_plrowpos:
dc 0
P61_looppos:
dcb.b 12*channels,0
endc
ifne P61_pde
P61_pdelay:
dc 0
P61_pdflag:
dc 0
endc
P61_samples:
dcb.b 16*31,0
P61_emptysample:
dcb.b 16,0
P61_positionbase:
dc.l 0
P61_possibase:
dc.l 0
P61_patternbase:
dc.l 0
P61_intaddr:
dc.l 0
ifne p61system
P61_server:
dc 0
P61_miscbase:
dc.l 0
P61_audioopen:
dc.b 0
P61_sigbit:
dc.b -1
P61_ciares:
dc.l 0
P61_craddr:
dc.l 0,0,0
P61_dat:
dc $f00
P61_timerinterrupt:
dc 0,0,0,0,127
P61_timerdata:
dc.l 0,0,0
P61_timeron:
dc 0
P61_allocport:
dc.l 0,0
dc.b 4,0
dc.l 0
dc.b 0,0
dc.l 0
P61_reqlist:
dc.l 0,0,0
dc.b 5,0
P61_allocreq:
dc.l 0,0
dc 127
dc.l 0
P61_portti:
dc.l 0
dc 68
dc.l 0,0,0
dc 0
P61_reqdata:
dc.l 0
dc.l 1,0,0,0,0,0,0
dc 0
P61_audiodev:
dc.b 'audio.device',0
P61_cianame:
dc.b 'ciab.resource',0
P61_timeropen:
dc.b 0
P61_timerint:
dc.b 'P61_TimerInterrupt',0,0
endc
P61_InitPos:
dc.w 0 ;P61_Init starts playing the song from this position.
;; --- optional declares ---
ifne use1Fx
P61_PTrig: dc.w 0 ;Poll this Custom trigger, using 'Bxx',pos $80-$ff
endc
ifne nowaveforms
P61_NewDMA: dc.w 0
endc
ifne copdma
p61_DMApokeAddr:dc.l 0
endc
P61_PattFlag: dc.w 0
P61_etu:
ifne quietstart
P61_Quiet: dc.w 0 ;@@this "sample" MUST be in chipmem!
endc
ifne visuctrs
P61_visuctr0: dc.w $4000 ;pretend long elapsed time at start
P61_visuctr1: dc.w $4000 ;(to not show inital trigger on all channels.)
P61_visuctr2: dc.w $4000
P61_visuctr3: dc.w $4000
endc
P61E: ;end of player binary
samples: ;ds.b 65536 <--declare some space if used.
|
Definition/Typed/Weakening.agda | CoqHott/logrel-mltt | 2 | 6548 | {-# OPTIONS --safe #-}
module Definition.Typed.Weakening where
open import Definition.Untyped as U hiding (wk)
open import Definition.Untyped.Properties
open import Definition.Typed
import Tools.PropositionalEquality as PE
-- Weakening type
data _∷_⊆_ : Wk → Con Term → Con Term → Set where
id : ∀ {Γ} → id ∷ Γ ⊆ Γ
step : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ → step ρ ∷ Δ ∙ A ^ r ⊆ Γ
lift : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ → lift ρ ∷ Δ ∙ U.wk ρ A ^ r ⊆ Γ ∙ A ^ r
-- -- Weakening composition
_•ₜ_ : ∀ {ρ ρ′ Γ Δ Δ′} → ρ ∷ Γ ⊆ Δ → ρ′ ∷ Δ ⊆ Δ′ → ρ • ρ′ ∷ Γ ⊆ Δ′
id •ₜ η′ = η′
step η •ₜ η′ = step (η •ₜ η′)
lift η •ₜ id = lift η
lift η •ₜ step η′ = step (η •ₜ η′)
_•ₜ_ {lift ρ} {lift ρ′} {Δ′ = Δ′ ∙ A ^ rA} (lift η) (lift η′) =
PE.subst (λ x → lift (ρ • ρ′) ∷ x ⊆ Δ′ ∙ A ^ rA)
(PE.cong₂ (λ x y → x ∙ y ^ rA) PE.refl (PE.sym (wk-comp ρ ρ′ A)))
(lift (η •ₜ η′))
-- Weakening of judgements
wkIndex : ∀ {Γ Δ n A r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρn = wkVar ρ n
in ⊢ Δ → n ∷ A ^ r ∈ Γ → ρn ∷ ρA ^ r ∈ Δ
wkIndex id ⊢Δ i = PE.subst (λ x → _ ∷ x ^ _ ∈ _) (PE.sym (wk-id _)) i
wkIndex (step ρ) (⊢Δ ∙ A) i = PE.subst (λ x → _ ∷ x ^ _ ∈ _)
(wk1-wk _ _)
(there (wkIndex ρ ⊢Δ i))
wkIndex (lift ρ) (⊢Δ ∙ A) (there i) = PE.subst (λ x → _ ∷ x ^ _ ∈ _)
(wk1-wk≡lift-wk1 _ _)
(there (wkIndex ρ ⊢Δ i))
wkIndex (lift ρ) ⊢Δ here =
let G = _
n = _
in PE.subst (λ x → n ∷ x ^ _ ∈ G)
(wk1-wk≡lift-wk1 _ _)
here
mutual
wk : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
in ⊢ Δ → Γ ⊢ A ^ r → Δ ⊢ ρA ^ r
wk ρ ⊢Δ (Uⱼ ⊢Γ) = Uⱼ ⊢Δ
wk ρ ⊢Δ (univ A) = univ (wkTerm ρ ⊢Δ A)
wkTerm : ∀ {Γ Δ A t r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρt = U.wk ρ t
in ⊢ Δ → Γ ⊢ t ∷ A ^ r → Δ ⊢ ρt ∷ ρA ^ r
wkTerm ρ ⊢Δ (univ <l ⊢Γ) = univ <l ⊢Δ
wkTerm ρ ⊢Δ (ℕⱼ ⊢Γ) = ℕⱼ ⊢Δ
wkTerm ρ ⊢Δ (Emptyⱼ ⊢Γ) = Emptyⱼ ⊢Δ
wkTerm ρ ⊢Δ (Πⱼ <l ▹ <l' ▹ F ▹ G) = let ρF = wkTerm ρ ⊢Δ F
in Πⱼ <l ▹ <l' ▹ ρF ▹ (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G)
wkTerm ρ ⊢Δ (∃ⱼ F ▹ G) = let ρF = wkTerm ρ ⊢Δ F
in ∃ⱼ ρF ▹ (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G)
wkTerm ρ ⊢Δ (var ⊢Γ x) = var ⊢Δ (wkIndex ρ ⊢Δ x)
wkTerm ρ ⊢Δ (lamⱼ <l <l' F t) = let ρF = wk ρ ⊢Δ F
in lamⱼ <l <l' ρF (wkTerm (lift ρ) (⊢Δ ∙ ρF) t)
wkTerm ρ ⊢Δ (_∘ⱼ_ {G = G} g a) = PE.subst (λ x → _ ⊢ _ ∷ x ^ _)
(PE.sym (wk-β G))
(wkTerm ρ ⊢Δ g ∘ⱼ wkTerm ρ ⊢Δ a)
wkTerm ρ ⊢Δ (⦅_,_,_,_⦆ⱼ {G = GG} F G t u )
= let ρF = wk ρ ⊢Δ F in ⦅ wk ρ ⊢Δ F , wk (lift ρ) (⊢Δ ∙ ρF) G , wkTerm ρ ⊢Δ t , PE.subst (λ X → _ ⊢ _ ∷ X ^ [ % , _ ]) (wk-β GG) (wkTerm ρ ⊢Δ u) ⦆ⱼ
wkTerm ρ ⊢Δ (fstⱼ F G t) = let ρF = wkTerm ρ ⊢Δ F in
let ρG = (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G) in
fstⱼ ρF ρG (wkTerm ρ ⊢Δ t)
wkTerm ρ ⊢Δ (sndⱼ {G = G} F Gⱼ t) = let ρF = wkTerm ρ ⊢Δ F in
let ρG = (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) Gⱼ) in
PE.subst (λ X → _ ⊢ _ ∷ X ^ [ % , _ ]) (PE.sym (wk-β G)) (sndⱼ ρF ρG (wkTerm ρ ⊢Δ t))
wkTerm ρ ⊢Δ (zeroⱼ ⊢Γ) = zeroⱼ ⊢Δ
wkTerm ρ ⊢Δ (sucⱼ n) = sucⱼ (wkTerm ρ ⊢Δ n)
wkTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrecⱼ {G = G} {rG = rG} {lG = lG} {s = s} ⊢G ⊢z ⊢s ⊢n) =
PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ∷ x ^ _) (PE.sym (wk-β G))
(natrecⱼ (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢G)
(PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β G) (wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ rG , ι lG ])
(wk-β-natrec ρ G rG lG)
(wkTerm [ρ] ⊢Δ ⊢s))
(wkTerm [ρ] ⊢Δ ⊢n))
wkTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Emptyrecⱼ {A = A} {e = e} ⊢A ⊢e) =
(Emptyrecⱼ (wk [ρ] ⊢Δ ⊢A) (wkTerm [ρ] ⊢Δ ⊢e))
wkTerm ρ ⊢Δ (Idⱼ A t u) = Idⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ u)
wkTerm ρ ⊢Δ (Idreflⱼ t) = Idreflⱼ (wkTerm ρ ⊢Δ t)
wkTerm ρ ⊢Δ (transpⱼ {P = P} A Pⱼ t s u e) =
let ρA = wk ρ ⊢Δ A in
let ρP = wk (lift ρ) (⊢Δ ∙ ρA) Pⱼ in
let ρt = wkTerm ρ ⊢Δ t in
let ρs = PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β P) (wkTerm ρ ⊢Δ s) in
let ρu = wkTerm ρ ⊢Δ u in
let ρe = wkTerm ρ ⊢Δ e in
PE.subst (λ x → _ ⊢ transp _ _ _ _ _ _ ∷ x ^ _) (PE.sym (wk-β P))
(transpⱼ ρA ρP ρt ρs ρu ρe)
wkTerm ρ ⊢Δ (castⱼ A B e t) =
castⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t)
wkTerm ρ ⊢Δ (castreflⱼ A t) =
castreflⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t)
wkTerm ρ ⊢Δ (conv t A≡B) = conv (wkTerm ρ ⊢Δ t) (wkEq ρ ⊢Δ A≡B)
wkEq : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρB = U.wk ρ B
in ⊢ Δ → Γ ⊢ A ≡ B ^ r → Δ ⊢ ρA ≡ ρB ^ r
wkEq ρ ⊢Δ (univ A≡B) = univ (wkEqTerm ρ ⊢Δ A≡B)
wkEq ρ ⊢Δ (refl A) = refl (wk ρ ⊢Δ A)
wkEq ρ ⊢Δ (sym A≡B) = sym (wkEq ρ ⊢Δ A≡B)
wkEq ρ ⊢Δ (trans A≡B B≡C) = trans (wkEq ρ ⊢Δ A≡B) (wkEq ρ ⊢Δ B≡C)
wkEqTerm : ∀ {Γ Δ A t u r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρt = U.wk ρ t
ρu = U.wk ρ u
in ⊢ Δ → Γ ⊢ t ≡ u ∷ A ^ r → Δ ⊢ ρt ≡ ρu ∷ ρA ^ r
wkEqTerm ρ ⊢Δ (refl t) = refl (wkTerm ρ ⊢Δ t)
wkEqTerm ρ ⊢Δ (sym t≡u) = sym (wkEqTerm ρ ⊢Δ t≡u)
wkEqTerm ρ ⊢Δ (trans t≡u u≡r) = trans (wkEqTerm ρ ⊢Δ t≡u) (wkEqTerm ρ ⊢Δ u≡r)
wkEqTerm ρ ⊢Δ (conv t≡u A≡B) = conv (wkEqTerm ρ ⊢Δ t≡u) (wkEq ρ ⊢Δ A≡B)
wkEqTerm ρ ⊢Δ (Π-cong <l <l' F F≡H G≡E) =
let ρF = wk ρ ⊢Δ F
in Π-cong <l <l' ρF (wkEqTerm ρ ⊢Δ F≡H)
(wkEqTerm (lift ρ) (⊢Δ ∙ ρF) G≡E)
wkEqTerm ρ ⊢Δ (∃-cong F F≡H G≡E) =
let ρF = wk ρ ⊢Δ F
in ∃-cong ρF (wkEqTerm ρ ⊢Δ F≡H)
(wkEqTerm (lift ρ) (⊢Δ ∙ ρF) G≡E)
wkEqTerm ρ ⊢Δ (app-cong {G = G} f≡g a≡b) =
PE.subst (λ x → _ ⊢ _ ≡ _ ∷ x ^ _)
(PE.sym (wk-β G))
(app-cong (wkEqTerm ρ ⊢Δ f≡g) (wkEqTerm ρ ⊢Δ a≡b))
wkEqTerm ρ ⊢Δ (β-red {a = a} {t = t} {G = G} l< l<' F ⊢t ⊢a) =
let ρF = wk ρ ⊢Δ F
in PE.subst (λ x → _ ⊢ _ ≡ _ ∷ x ^ _)
(PE.sym (wk-β G))
(PE.subst (λ x → _ ⊢ U.wk _ ((lam _ ▹ t ^ _) ∘ a ^ _) ≡ x ∷ _ ^ _)
(PE.sym (wk-β t))
(β-red l< l<' ρF (wkTerm (lift ρ) (⊢Δ ∙ ρF) ⊢t)
(wkTerm ρ ⊢Δ ⊢a)))
wkEqTerm ρ ⊢Δ (η-eq lF lG F f g f0≡g0) =
let ρF = wk ρ ⊢Δ F
in η-eq lF lG ρF (wkTerm ρ ⊢Δ f)
(wkTerm ρ ⊢Δ g)
(PE.subst (λ t → _ ⊢ t ∘ _ ^ _ ≡ _ ∷ _ ^ _)
(PE.sym (wk1-wk≡lift-wk1 _ _))
(PE.subst (λ t → _ ⊢ _ ≡ t ∘ _ ^ _ ∷ _ ^ _)
(PE.sym (wk1-wk≡lift-wk1 _ _))
(wkEqTerm (lift ρ) (⊢Δ ∙ ρF) f0≡g0)))
wkEqTerm ρ ⊢Δ (suc-cong m≡n) = suc-cong (wkEqTerm ρ ⊢Δ m≡n)
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-cong {s = s} {s′ = s′} {F = F} {l = l}
F≡F′ z≡z′ s≡s′ n≡n′) =
PE.subst (λ x → Δ ⊢ natrec _ _ _ _ _ ≡ _ ∷ x ^ _) (PE.sym (wk-β F))
(natrec-cong (wkEq (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) F≡F′)
(PE.subst (λ x → Δ ⊢ _ ≡ _ ∷ x ^ _) (wk-β F)
(wkEqTerm [ρ] ⊢Δ z≡z′))
(PE.subst (λ x → Δ ⊢ U.wk ρ s
≡ U.wk ρ s′ ∷ x ^ [ ! , ι l ])
(wk-β-natrec _ F ! l)
(wkEqTerm [ρ] ⊢Δ s≡s′))
(wkEqTerm [ρ] ⊢Δ n≡n′))
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-zero {z} {s} {F} {l = l} ⊢F ⊢z ⊢s) =
PE.subst (λ x → Δ ⊢ natrec _ (U.wk (lift _) F) _ _ _ ≡ _ ∷ x ^ _)
(PE.sym (wk-β F))
(natrec-zero (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F)
(PE.subst (λ x → Δ ⊢ U.wk ρ z ∷ x ^ _)
(wk-β F)
(wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ])
(wk-β-natrec _ F ! l)
(wkTerm [ρ] ⊢Δ ⊢s)))
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-suc {n} {z} {s} {F} {l = l} ⊢n ⊢F ⊢z ⊢s) =
PE.subst (λ x → Δ ⊢ natrec _ (U.wk (lift _) F) _ _ _
≡ _ ∘ (natrec _ _ _ _ _) ^ _ ∷ x ^ _)
(PE.sym (wk-β F))
(natrec-suc (wkTerm [ρ] ⊢Δ ⊢n)
(wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F)
(PE.subst (λ x → Δ ⊢ U.wk ρ z ∷ x ^ _)
(wk-β F)
(wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ])
(wk-β-natrec _ F ! l)
(wkTerm [ρ] ⊢Δ ⊢s)))
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Emptyrec-cong {A = A} {A' = A'} {e = e} {e' = e'} A≡A' ⊢e ⊢e') =
Emptyrec-cong (wkEq [ρ] ⊢Δ A≡A') (wkTerm [ρ] ⊢Δ ⊢e) (wkTerm [ρ] ⊢Δ ⊢e')
wkEqTerm [ρ] ⊢Δ (proof-irrelevance t u) = proof-irrelevance (wkTerm [ρ] ⊢Δ t) (wkTerm [ρ] ⊢Δ u)
wkEqTerm ρ ⊢Δ (Id-cong A t u) = Id-cong (wkEqTerm ρ ⊢Δ A) (wkEqTerm ρ ⊢Δ t) (wkEqTerm ρ ⊢Δ u)
wkEqTerm {ρ = ρ} [ρ] ⊢Δ (Id-Π {rA = rA} {t = t} {u = u} <l <l' Aⱼ Bⱼ tⱼ uⱼ) =
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ univ ρA) Bⱼ in
let ρt = wkTerm [ρ] ⊢Δ tⱼ in
let ρu = wkTerm [ρ] ⊢Δ uⱼ in
PE.subst
(λ x → _ ⊢ Id _ (U.wk ρ t) _ ≡ Π _ ^ _ ° _ ▹ Id _ (x ∘ _ ^ _) _ ° _ ° _ ∷ _ ^ [ ! , _ ])
(wk1-wk≡lift-wk1 ρ t)
(PE.subst
(λ x → _ ⊢ Id _ _ (U.wk ρ u) ≡ Π _ ^ _ ° _ ▹ Id _ _ (x ∘ _ ^ _) ° _ ° _ ∷ _ ^ [ ! , _ ])
(wk1-wk≡lift-wk1 ρ u)
(Id-Π <l <l' ρA ρB ρt ρu))
wkEqTerm ρ ⊢Δ (Id-ℕ-00 ⊢Γ) = Id-ℕ-00 ⊢Δ
wkEqTerm ρ ⊢Δ (Id-ℕ-SS m n) = Id-ℕ-SS (wkTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n)
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-U-ΠΠ {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} Aⱼ Bⱼ A'ⱼ B'ⱼ) =
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in
let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in
let l = ⁰ in
let l' = ¹ in
let pred = λ A1 A1' A2' B1 B1' → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π A1' ^ rA ° ⁰ ▹ Id (U l) (B1 [ cast l A2' A1 (Idsym (Univ rA l) A1 A2' (var 1)) (var 0) ]↑) B1' ° l' ° l') ∷ SProp l' ^ [ ! , next l' ] in
let j1 : pred (wk1 (wk1 (U.wk ρ A))) (wk1 (U.wk ρ A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))
j1 = Id-U-ΠΠ ρA ρB ρA' ρB' in
let j2 = PE.subst (λ x → pred (wk1 (wk1 (U.wk ρ A))) x (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1-wk≡lift-wk1 ρ A') j1 in
let j3 = PE.subst (λ x → pred x (U.wk (lift ρ) (wk1 A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A) j2 in
let j4 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) x (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A') j3 in
let j5 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) x (wk1d (U.wk (lift ρ) B'))) (wk1d-wk≡lift-wk1d ρ B) j4 in
let j6 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1d B)) x) (wk1d-wk≡lift-wk1d ρ B') j5 in
let j7 = PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) (U.wk (lift (lift ρ)) (wk1d B) [ (cast l (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1 (wk1 A))) x (var 0)) ]↑) (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ [ ! , next l' ]) (PE.sym (wk-Idsym (lift (lift ρ)) (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1))) j6 in
PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) x (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ [ ! , _ ]) (PE.sym (wk-β↑ {ρ = lift ρ} {a = cast l (wk1 (wk1 A')) (wk1 (wk1 A)) (Idsym (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1)) (var 0)} (wk1d B))) j7
wkEqTerm ρ ⊢Δ (Id-U-ℕℕ ⊢Γ) = Id-U-ℕℕ ⊢Δ
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-SProp {A = A} {B = B} Aⱼ Bⱼ) =
let ρA = wkTerm [ρ] ⊢Δ Aⱼ
ρB = wkTerm [ρ] ⊢Δ Bⱼ
l = ⁰
l' = ¹
in
PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° l') ▹ (Π _ ^ % ° ⁰ ▹ x ° _ ° l') ∷ _ ^ [ ! , _ ])
(wk1d-wk≡lift-wk1d ρ (wk1 A))
(PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° l') ▹ (Π _ ^ % ° ⁰ ▹ U.wk (lift (step id)) x ° _ ° l') ∷ _ ^ [ ! , _ ])
(wk1-wk≡lift-wk1 ρ A)
(PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) (U.wk ρ B) ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ x ° ⁰ ° l') ▹ (Π x ^ % ° ⁰ ▹ _ ° ⁰ ° l') ∷ SProp ¹ ^ [ ! , _ ])
(wk1-wk≡lift-wk1 ρ B) (Id-SProp {A = U.wk ρ A} {B = U.wk ρ B} ρA ρB)))
wkEqTerm ρ ⊢Δ (Id-ℕ-0S n) = Id-ℕ-0S (wkTerm ρ ⊢Δ n)
wkEqTerm ρ ⊢Δ (Id-ℕ-S0 n) = Id-ℕ-S0 (wkTerm ρ ⊢Δ n)
wkEqTerm ρ ⊢Δ (Id-U-ℕΠ A B) =
let ρA = wkTerm ρ ⊢Δ A in
let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in
Id-U-ℕΠ ρA ρB
wkEqTerm ρ ⊢Δ (Id-U-Πℕ A B) =
let ρA = wkTerm ρ ⊢Δ A in
let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in
Id-U-Πℕ ρA ρB
wkEqTerm ρ ⊢Δ (Id-U-ΠΠ!% eq A B A' B') =
let ρA = wkTerm ρ ⊢Δ A
ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B
ρA' = wkTerm ρ ⊢Δ A'
ρB' = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA')) B'
in Id-U-ΠΠ!% eq ρA ρB ρA' ρB'
wkEqTerm ρ ⊢Δ (cast-cong A B t e e') = cast-cong (wkEqTerm ρ ⊢Δ A) (wkEqTerm ρ ⊢Δ B) (wkEqTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ e')
wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (cast-Π {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} {e = e} {f = f} Aⱼ Bⱼ A'ⱼ B'ⱼ eⱼ fⱼ) = let l = ⁰ in let lA = ⁰ in let lB = ⁰ in
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in
let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in
let ρe = wkTerm [ρ] ⊢Δ eⱼ in
let ρf = wkTerm [ρ] ⊢Δ fⱼ in
let pred = λ A1 A1' e1 f1 → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = cast l A1' A1 (Idsym (Univ rA l) A1 A1' (fst e1)) (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd e1) ∘ (var 0) ^ ¹) (f1 ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , _ ] in
let j0 : pred (wk1 (U.wk ρ A)) (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))
j0 = cast-Π ρA ρB ρA' ρB' ρe ρf
in
let j1 = PE.subst (λ x → pred x (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A) j0 in
let j2 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) x (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A') j1 in
let j3 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) x (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ e) j2 in
let j4 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 e)) x) (wk1-wk≡lift-wk1 ρ f) j3 in
let j5 = PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = cast l (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 A)) x (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , ι l ]) (PE.sym (wk-Idsym (lift ρ) (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e)))) j4 in
PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = U.wk (lift ρ) (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0)) in cast l x (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , ι l ]) (PE.sym (wk-β↑ {ρ = ρ} {a = (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0))} B)) j5
wkEqTerm ρ ⊢Δ (cast-ℕ-0 e) = cast-ℕ-0 (wkTerm ρ ⊢Δ e)
wkEqTerm ρ ⊢Δ (cast-ℕ-S e n) = cast-ℕ-S (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ n)
mutual
wkRed : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρB = U.wk ρ B
in ⊢ Δ → Γ ⊢ A ⇒ B ^ r → Δ ⊢ ρA ⇒ ρB ^ r
wkRed ρ ⊢Δ (univ A⇒B) = univ (wkRedTerm ρ ⊢Δ A⇒B)
wkRedTerm : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρt = U.wk ρ t
ρu = U.wk ρ u
in ⊢ Δ → Γ ⊢ t ⇒ u ∷ A ^ l → Δ ⊢ ρt ⇒ ρu ∷ ρA ^ l
wkRedTerm ρ ⊢Δ (conv t⇒u A≡B) = conv (wkRedTerm ρ ⊢Δ t⇒u) (wkEq ρ ⊢Δ A≡B)
wkRedTerm ρ ⊢Δ (app-subst {B = B} t⇒u a) =
PE.subst (λ x → _ ⊢ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β B))
(app-subst (wkRedTerm ρ ⊢Δ t⇒u) (wkTerm ρ ⊢Δ a))
wkRedTerm ρ ⊢Δ (β-red {A} {B} {lF} {lG} {a} {t} l< l<' ⊢A ⊢t ⊢a) =
let ⊢ρA = wk ρ ⊢Δ ⊢A
in PE.subst (λ x → _ ⊢ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β B))
(PE.subst (λ x → _ ⊢ U.wk _ ((lam _ ▹ t ^ _) ∘ a ^ _) ⇒ x ∷ _ ^ _)
(PE.sym (wk-β t))
(β-red l< l<' ⊢ρA (wkTerm (lift ρ) (⊢Δ ∙ ⊢ρA) ⊢t)
(wkTerm ρ ⊢Δ ⊢a)))
wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-subst {s = s} {F = F} {l = l} ⊢F ⊢z ⊢s n⇒n′) =
PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β F))
(natrec-subst (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F)
(PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β F)
(wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ])
(wk-β-natrec _ F ! l)
(wkTerm [ρ] ⊢Δ ⊢s))
(wkRedTerm [ρ] ⊢Δ n⇒n′))
wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-zero {s = s} {F = F} {l = l} ⊢F ⊢z ⊢s) =
PE.subst (λ x → _ ⊢ natrec _ (U.wk (lift ρ) F) _ _ _ ⇒ _ ∷ x ^ _)
(PE.sym (wk-β F))
(natrec-zero (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F)
(PE.subst (λ x → _ ⊢ _ ∷ x ^ _)
(wk-β F)
(wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ])
(wk-β-natrec ρ F ! l)
(wkTerm [ρ] ⊢Δ ⊢s)))
wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-suc {s = s} {F = F} {l = l} ⊢n ⊢F ⊢z ⊢s) =
PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ⇒ _ ∘ natrec _ _ _ _ _ ^ _ ∷ x ^ _)
(PE.sym (wk-β F))
(natrec-suc (wkTerm [ρ] ⊢Δ ⊢n)
(wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F)
(PE.subst (λ x → _ ⊢ _ ∷ x ^ _)
(wk-β F)
(wkTerm [ρ] ⊢Δ ⊢z))
(PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ])
(wk-β-natrec ρ F ! l)
(wkTerm [ρ] ⊢Δ ⊢s)))
wkRedTerm ρ ⊢Δ (Id-subst A t u) = Id-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ u)
wkRedTerm ρ ⊢Δ (Id-ℕ-subst m n) = Id-ℕ-subst (wkRedTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (Id-ℕ-0-subst n) = Id-ℕ-0-subst (wkRedTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (Id-ℕ-S-subst m n) = Id-ℕ-S-subst (wkTerm ρ ⊢Δ m) (wkRedTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (Id-U-subst A B) = Id-U-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B)
wkRedTerm ρ ⊢Δ (Id-U-ℕ-subst B) = Id-U-ℕ-subst (wkRedTerm ρ ⊢Δ B)
wkRedTerm ρ ⊢Δ (Id-U-Π-subst A P B) = let ρA = wkTerm ρ ⊢Δ A in Id-U-Π-subst ρA (wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) P) (wkRedTerm ρ ⊢Δ B)
wkRedTerm {ρ = ρ} [ρ] ⊢Δ (Id-Π {t = t} {u = u} <l <l' Aⱼ Bⱼ tⱼ uⱼ) =
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in
let ρt = wkTerm [ρ] ⊢Δ tⱼ in
let ρu = wkTerm [ρ] ⊢Δ uⱼ in
PE.subst
(λ x → _ ⊢ Id _ (U.wk ρ t) _ ⇒ Π _ ^ _ ° _ ▹ Id _ (x ∘ _ ^ _) _ ° _ ° _ ∷ _ ^ _)
(wk1-wk≡lift-wk1 ρ t)
(PE.subst
(λ x → _ ⊢ Id _ _ (U.wk ρ u) ⇒ Π _ ^ _ ° _ ▹ Id _ _ (x ∘ _ ^ _) ° _ ° _ ∷ _ ^ _)
(wk1-wk≡lift-wk1 ρ u)
(Id-Π <l <l' ρA ρB ρt ρu))
wkRedTerm ρ ⊢Δ (Id-ℕ-00 ⊢Γ) = Id-ℕ-00 ⊢Δ
wkRedTerm ρ ⊢Δ (Id-ℕ-SS m n) = Id-ℕ-SS (wkTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n)
wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-U-ΠΠ {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} Aⱼ Bⱼ A'ⱼ B'ⱼ) =
let l = ⁰ in
let l' = ¹ in
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in
let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in
let pred = λ A1 A1' A2' B1 B1' → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π A1' ^ rA ° ⁰ ▹ Id (U l) (B1 [ cast l A2' A1 (Idsym (Univ rA l) A1 A2' (var 1)) (var 0) ]↑) B1' ° l' ° l') ∷ SProp l' ^ next l' in
let j1 : pred (wk1 (wk1 (U.wk ρ A))) (wk1 (U.wk ρ A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))
j1 = Id-U-ΠΠ ρA ρB ρA' ρB' in
let j2 = PE.subst (λ x → pred (wk1 (wk1 (U.wk ρ A))) x (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1-wk≡lift-wk1 ρ A') j1 in
let j3 = PE.subst (λ x → pred x (U.wk (lift ρ) (wk1 A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A) j2 in
let j4 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) x (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A') j3 in
let j5 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) x (wk1d (U.wk (lift ρ) B'))) (wk1d-wk≡lift-wk1d ρ B) j4 in
let j6 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1d B)) x) (wk1d-wk≡lift-wk1d ρ B') j5 in
let j7 = PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) (U.wk (lift (lift ρ)) (wk1d B) [ (cast l (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1 (wk1 A))) x (var 0)) ]↑) (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ next l') (PE.sym (wk-Idsym (lift (lift ρ)) (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1))) j6 in
PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) x (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ next l') (PE.sym (wk-β↑ {ρ = lift ρ} {a = cast l (wk1 (wk1 A')) (wk1 (wk1 A)) (Idsym (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1)) (var 0)} (wk1d B))) j7
wkRedTerm ρ ⊢Δ (Id-U-ℕℕ ⊢Γ) = Id-U-ℕℕ ⊢Δ
wkRedTerm {ρ = ρ} [ρ] ⊢Δ (Id-SProp {A = A} {B = B} Aⱼ Bⱼ) =
let ρA = wkTerm [ρ] ⊢Δ Aⱼ
ρB = wkTerm [ρ] ⊢Δ Bⱼ
l = ⁰
l' = ¹
in
PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° _) ▹ (Π _ ^ % ° ⁰ ▹ x ° _ ° _) ∷ _ ^ _)
(wk1d-wk≡lift-wk1d ρ (wk1 A))
(PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° _) ▹ (Π _ ^ % ° ⁰ ▹ U.wk (lift (step id)) x ° _ ° _) ∷ _ ^ _ )
(wk1-wk≡lift-wk1 ρ A)
(PE.subst
(λ x → _ ⊢ Id (SProp l) (U.wk ρ A) (U.wk ρ B) ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ x ° ⁰ ° _) ▹ (Π x ^ % ° ⁰ ▹ _ ° ⁰ ° _) ∷ SProp ¹ ^ _ )
(wk1-wk≡lift-wk1 ρ B) (Id-SProp {A = U.wk ρ A} {B = U.wk ρ B} ρA ρB)))
wkRedTerm ρ ⊢Δ (Id-ℕ-0S n) = Id-ℕ-0S (wkTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (Id-ℕ-S0 n) = Id-ℕ-S0 (wkTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (Id-U-ℕΠ A B) =
let ρA = wkTerm ρ ⊢Δ A in
let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in
Id-U-ℕΠ ρA ρB
wkRedTerm ρ ⊢Δ (Id-U-Πℕ A B) =
let ρA = wkTerm ρ ⊢Δ A in
let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in
Id-U-Πℕ ρA ρB
wkRedTerm ρ ⊢Δ (Id-U-ΠΠ!% eq A B A' B') =
let ρA = wkTerm ρ ⊢Δ A
ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B
ρA' = wkTerm ρ ⊢Δ A'
ρB' = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA')) B'
in Id-U-ΠΠ!% eq ρA ρB ρA' ρB'
wkRedTerm ρ ⊢Δ (cast-subst A B e t) = cast-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t)
wkRedTerm ρ ⊢Δ (cast-ℕ-subst B e t) = cast-ℕ-subst (wkRedTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t)
wkRedTerm ρ ⊢Δ (cast-Π-subst A P B e t) = let ρA = wkTerm ρ ⊢Δ A in cast-Π-subst ρA (wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) P) (wkRedTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t)
wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (cast-Π {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} {e = e} {f = f} Aⱼ Bⱼ A'ⱼ B'ⱼ eⱼ fⱼ) = let l = ⁰ in let lA = ⁰ in let lB = ⁰ in
let ρA = wkTerm [ρ] ⊢Δ Aⱼ in
let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in
let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in
let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in
let ρe = wkTerm [ρ] ⊢Δ eⱼ in
let ρf = wkTerm [ρ] ⊢Δ fⱼ in
let pred = λ A1 A1' e1 f1 → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = cast l A1' A1 (Idsym (Univ rA l) A1 A1' (fst e1)) (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd e1) ∘ (var 0) ^ ¹) (f1 ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ _ in
let j0 : pred (wk1 (U.wk ρ A)) (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))
j0 = cast-Π ρA ρB ρA' ρB' ρe ρf
in
let j1 = PE.subst (λ x → pred x (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A) j0 in
let j2 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) x (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A') j1 in
let j3 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) x (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ e) j2 in
let j4 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 e)) x) (wk1-wk≡lift-wk1 ρ f) j3 in
let j5 = PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = cast l (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 A)) x (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ ι l) (PE.sym (wk-Idsym (lift ρ) (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e)))) j4 in
PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = U.wk (lift ρ) (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0)) in cast l x (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ ι l) (PE.sym (wk-β↑ {ρ = ρ} {a = (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0))} B)) j5
wkRedTerm ρ ⊢Δ (cast-ℕ-0 e) = cast-ℕ-0 (wkTerm ρ ⊢Δ e)
wkRedTerm ρ ⊢Δ (cast-ℕ-S e n) = cast-ℕ-S (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ n)
wkRedTerm ρ ⊢Δ (cast-ℕ-cong e n) = cast-ℕ-cong (wkTerm ρ ⊢Δ e) (wkRedTerm ρ ⊢Δ n)
wkRed* : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρB = U.wk ρ B
in ⊢ Δ → Γ ⊢ A ⇒* B ^ r → Δ ⊢ ρA ⇒* ρB ^ r
wkRed* ρ ⊢Δ (id A) = id (wk ρ ⊢Δ A)
wkRed* ρ ⊢Δ (A⇒A′ ⇨ A′⇒*B) = wkRed ρ ⊢Δ A⇒A′ ⇨ wkRed* ρ ⊢Δ A′⇒*B
wkRed*Term : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρt = U.wk ρ t
ρu = U.wk ρ u
in ⊢ Δ → Γ ⊢ t ⇒* u ∷ A ^ l → Δ ⊢ ρt ⇒* ρu ∷ ρA ^ l
wkRed*Term ρ ⊢Δ (id t) = id (wkTerm ρ ⊢Δ t)
wkRed*Term ρ ⊢Δ (t⇒t′ ⇨ t′⇒*u) = wkRedTerm ρ ⊢Δ t⇒t′ ⇨ wkRed*Term ρ ⊢Δ t′⇒*u
wkRed:*: : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρB = U.wk ρ B
in ⊢ Δ → Γ ⊢ A :⇒*: B ^ r → Δ ⊢ ρA :⇒*: ρB ^ r
wkRed:*: ρ ⊢Δ [[ ⊢A , ⊢B , D ]] = [[ wk ρ ⊢Δ ⊢A , wk ρ ⊢Δ ⊢B , wkRed* ρ ⊢Δ D ]]
wkRed:*:Term : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ →
let ρA = U.wk ρ A
ρt = U.wk ρ t
ρu = U.wk ρ u
in ⊢ Δ → Γ ⊢ t :⇒*: u ∷ A ^ l → Δ ⊢ ρt :⇒*: ρu ∷ ρA ^ l
wkRed:*:Term ρ ⊢Δ [[ ⊢t , ⊢u , d ]] =
[[ wkTerm ρ ⊢Δ ⊢t , wkTerm ρ ⊢Δ ⊢u , wkRed*Term ρ ⊢Δ d ]]
|
oeis/230/A230096.asm | neoneye/loda-programs | 11 | 3847 | <filename>oeis/230/A230096.asm
; A230096: Number of tilings of an n X 1 rectangle (using tiles of dimension 1 X 1 and 2 X 1) that share no tile at the same position with their mirrored image.
; 1,0,0,2,2,2,2,6,6,10,10,22,22,42,42,86,86,170,170,342,342,682,682,1366,1366,2730,2730,5462,5462,10922,10922,21846,21846,43690,43690,87382,87382,174762,174762,349526,349526,699050,699050,1398102,1398102,2796202,2796202,5592406,5592406,11184810,11184810,22369622,22369622,44739242,44739242,89478486,89478486,178956970,178956970,357913942,357913942,715827882,715827882,1431655766,1431655766,2863311530,2863311530,5726623062,5726623062,11453246122,11453246122,22906492246,22906492246,45812984490
mov $3,1
lpb $0
trn $0,2
mov $2,$3
add $2,$3
mov $3,$1
add $1,$2
lpe
mov $0,$3
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_542.asm | ljhsiun2/medusa | 9 | 242130 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x2882, %rbx
nop
nop
nop
nop
nop
xor $25506, %r11
mov (%rbx), %ecx
inc %r13
lea addresses_A_ht+0x3b6e, %rsi
lea addresses_A_ht+0xcea4, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and %rax, %rax
mov $83, %rcx
rep movsb
xor %rdi, %rdi
lea addresses_D_ht+0x13522, %rcx
nop
nop
nop
dec %r13
movw $0x6162, (%rcx)
nop
nop
nop
and %rax, %rax
lea addresses_WC_ht+0x2ed2, %rax
nop
nop
nop
cmp %r11, %r11
movb (%rax), %r13b
nop
cmp %r13, %r13
lea addresses_UC_ht+0x2be2, %r11
nop
sub %rcx, %rcx
movw $0x6162, (%r11)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x49e2, %r13
clflush (%r13)
nop
nop
nop
nop
cmp $26146, %rsi
movb $0x61, (%r13)
nop
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_UC_ht+0x179e2, %r13
clflush (%r13)
and %rax, %rax
movups (%r13), %xmm3
vpextrq $0, %xmm3, %r11
and %rax, %rax
lea addresses_A_ht+0x14a1a, %r13
nop
nop
nop
nop
and $15015, %rdi
mov (%r13), %r11
sub $52954, %rcx
lea addresses_WC_ht+0x1d8e2, %rsi
lea addresses_A_ht+0x1902a, %rdi
nop
nop
nop
sub $41673, %rbx
mov $103, %rcx
rep movsb
nop
nop
nop
and %rsi, %rsi
lea addresses_WC_ht+0xe1e2, %rsi
lea addresses_UC_ht+0x169e2, %rdi
nop
sub $34524, %r10
mov $90, %rcx
rep movsb
nop
sub %rdi, %rdi
lea addresses_WT_ht+0x1e862, %rbx
nop
nop
nop
and %r10, %r10
mov (%rbx), %rcx
nop
and $60525, %rbx
lea addresses_normal_ht+0xa562, %r10
clflush (%r10)
nop
nop
nop
nop
nop
add %rbx, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%r10)
nop
nop
nop
nop
sub $5113, %rcx
lea addresses_UC_ht+0xb9e2, %r11
and $45205, %rdi
mov $0x6162636465666768, %r13
movq %r13, %xmm5
vmovups %ymm5, (%r11)
nop
nop
nop
nop
nop
dec %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r9
push %rbp
push %rdi
push %rdx
// Store
lea addresses_RW+0x8562, %r11
nop
nop
nop
nop
dec %rbp
mov $0x5152535455565758, %r9
movq %r9, (%r11)
sub %r9, %r9
// Store
lea addresses_RW+0x19e02, %r14
nop
nop
nop
nop
nop
cmp $62755, %r12
mov $0x5152535455565758, %rdi
movq %rdi, (%r14)
add %r12, %r12
// Faulty Load
lea addresses_D+0xc9e2, %r9
nop
nop
nop
inc %rdx
mov (%r9), %bp
lea oracles, %r11
and $0xff, %rbp
shlq $12, %rbp
mov (%r11,%rbp,1), %rbp
pop %rdx
pop %rdi
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_RW'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}}
{'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
*/
|
alloy4fun_models/trashltl/models/7/9hDaj48rAFmn6tCYi.als | Kaixi26/org.alloytools.alloy | 0 | 4823 | open main
pred id9hDaj48rAFmn6tCYi_prop8 {
always all f,g: File| f->g in link implies eventually always f in Trash
}
pred __repair { id9hDaj48rAFmn6tCYi_prop8 }
check __repair { id9hDaj48rAFmn6tCYi_prop8 <=> prop8o } |
src/MJ/Semantics/Functional.agda | metaborg/mj.agda | 10 | 6536 | <reponame>metaborg/mj.agda
open import MJ.Types
open import MJ.Classtable
import MJ.Syntax as Syntax
import MJ.Semantics.Values as Values
--
-- Substitution-free interpretation of welltyped MJ
--
module MJ.Semantics.Functional {c} (Σ : CT c) (ℂ : Syntax.Impl Σ) where
open import Prelude
open import Data.Vec hiding (init)
open import Data.Vec.All.Properties.Extra as Vec∀++
open import Data.Sum
open import Data.List as List
open import Data.List.All as List∀ hiding (lookup)
open import Data.List.All.Properties.Extra
open import Data.List.Any
open import Data.List.Prefix
open import Data.List.Properties.Extra as List+
open import Data.Maybe as Maybe using (Maybe; just; nothing)
open import Relation.Binary.PropositionalEquality
open import Data.Star.Indexed
import Data.Vec.All as Vec∀
open Membership-≡
open Values Σ
open CT Σ
open Syntax Σ
-- open import MJ.Semantics.Objects.Hierarchical Σ ℂ using (encoding)
open import MJ.Semantics.Objects.Flat Σ ℂ using (encoding)
open ObjEncoding encoding
open Heap encoding
⊒-res : ∀ {a}{I : World c → Set a}{W W'} → W' ⊒ W → Res I W' → Res I W
⊒-res {W = W} p (W' , ext' , μ' , v) = W' , ⊑-trans p ext' , μ' , v
mutual
--
-- object initialization
--
init : ∀ {W} cid → Cont (fromList (Class.constr (clookup cid))) (λ W → Obj W cid) W
init cid E μ with Impl.bodies ℂ cid
init cid E μ | impl super-args defs with evalₙ (defs FLD) E μ
... | W₁ , ext₁ , μ₁ , vs with clookup cid | inspect clookup cid
-- case *without* super initialization
init cid E μ | impl nothing defs | (W₁ , ext₁ , μ₁ , vs) | (class nothing constr decls) | [ eq ] =
W₁ , ext₁ , μ₁ , vs
-- case *with* super initialization
init cid E μ | impl (just sc) defs | (W₁ , ext₁ , μ₁ , vs) |
(class (just x) constr decls) | [ eq ] with evalₑ-all sc (Vec∀.map (coerce ext₁) E) μ₁
... | W₂ , ext₂ , μ₂ , svs with init x (all-fromList svs) μ₂
... | W₃ , ext₃ , μ₃ , inherited = W₃ , ⊑-trans (⊑-trans ext₁ ext₂) ext₃ , μ₃ ,
(List∀.map (coerce (⊑-trans ext₂ ext₃)) vs ++-all inherited)
{-}
init cid E μ with Impl.bodies ℂ cid
init cid E μ | impl super-args defs with evalₙ (defs FLD) E μ
... | W₁ , ext₁ , μ₁ , vs with clookup cid | inspect clookup cid
-- case *without* super initialization
init cid E μ | impl nothing defs | (W₁ , ext₁ , μ₁ , vs) |
(class nothing constr decls) | [ eq ] =
, ext₁
, μ₁
, record {
own = λ{
MTH → List∀.tabulate (λ _ → tt) ;
FLD → subst (λ C → All _ (Class.decls C FLD)) (sym eq) vs
};
inherited = subst (λ C → Maybe.All _ (Class.parent C)) (sym eq) nothing
}
-- case *with* super initialization
init cid E μ | impl (just sc) defs | (W₁ , ext₁ , μ₁ , vs) |
(class (just x) constr decls) | [ eq ] with evalₑ-all sc (Vec∀.map (coerce ext₁) E) μ₁
... | W₂ , ext₂ , μ₂ , svs with init x (all-fromList svs) μ₂
... | W₃ , ext₃ , μ₃ , sO =
, ⊑-trans (⊑-trans ext₁ ext₂) ext₃
, μ₃
, record {
own = λ{
MTH → List∀.tabulate (λ _ → tt) ;
FLD → subst
(λ C → All _ (Class.decls C FLD))
(sym eq)
(List∀.map (coerce (⊑-trans ext₂ ext₃)) vs)
};
inherited = subst (λ C → Maybe.All _ (Class.parent C)) (sym eq) (just sO)
}
-}
evalₑ-all : ∀ {n}{Γ : Ctx c n}{as} →
All (Expr Γ) as → ∀ {W} → Cont Γ (λ W' → All (Val W') as) W
evalₑ-all [] E μ = , ⊑-refl , μ , []
evalₑ-all (px ∷ exps) E μ with evalₑ px E μ
... | W' , ext' , μ' , v with evalₑ-all exps (Vec∀.map (coerce ext') E) μ'
... | W'' , ext'' , μ'' , vs = W'' , ⊑-trans ext' ext'' , μ'' , coerce ext'' v ∷ vs
--
-- evaluation of expressions
--
{-# TERMINATING #-}
evalₑ : ∀ {n}{Γ : Ctx c n}{a} → Expr Γ a → ∀ {W} → Cont Γ (flip Val a) W
evalₑ (upcast sub e) E μ with evalₑ e E μ
... | W' , ext' , μ' , (ref r s) = W' , ext' , μ' , ref r (<:-trans s sub)
-- primitive values
evalₑ unit = pure (const unit)
evalₑ (num n) = pure (const (num n))
-- variable lookup
evalₑ (var i) = pure (λ E → Vec∀.lookup i E)
-- object allocation
evalₑ (new C args) {W} E μ with evalₑ-all args E μ
-- create the object, typed under the current heap shape
... | W₁ , ext₁ , μ₁ , vs with init C (all-fromList vs) μ₁
... | W₂ , ext₂ , μ₂ , O =
let
-- extension fact for the heap extended with the new object allocation
ext = ∷ʳ-⊒ (obj C) W₂
in
, ⊑-trans (⊑-trans ext₁ ext₂) ext
, all-∷ʳ (List∀.map (coerce ext) μ₂) (coerce ext (obj C O))
, ref (∈-∷ʳ W₂ (obj C)) refl -- value typed under the extended heap
-- binary interger operations
evalₑ (iop f l r) E μ with evalₑ l E μ
... | W₁ , ext₁ , μ₁ , (num i) with evalₑ r (Vec∀.map (coerce ext₁) E) μ₁
... | W₂ , ext₂ , μ₂ , (num j) = W₂ , ⊑-trans ext₁ ext₂ , μ₂ , num (f i j)
-- method calls
evalₑ (call {C} e mtd args) E μ with evalₑ e E μ -- eval obj expression
... | W₁ , ext₁ , μ₁ , r@(ref o sub) with ∈-all o μ₁ -- lookup obj on the heap
... | val ()
... | obj cid O with evalₑ-all args (Vec∀.map (coerce ext₁) E) μ₁ -- eval arguments
... | W₂ , ext₂ , μ₂ , vs =
-- and finally eval the body of the method under the environment
-- generated from the call arguments and the object's "this"
⊒-res
(⊑-trans ext₁ ext₂)
(eval-body cmd (ref (∈-⊒ o ext₂) <:-fact Vec∀.∷ all-fromList vs) μ₂)
where
-- get the method definition
cmd = getDef C mtd ℂ
-- get a subtyping fact
<:-fact = <:-trans sub (proj₁ (proj₂ mtd))
-- field lookup in the heap
evalₑ (get e fld) E μ with evalₑ e E μ
... | W' , ext' , μ' , ref o C<:C₁ with ∈-all o μ'
... | (val ())
-- apply the runtime subtyping fact to weaken the member fact
... | obj cid O = W' , ext' , μ' , getter O (mem-inherit Σ C<:C₁ fld)
--
-- command evaluation
--
evalc : ∀ {n m}{I : Ctx c n}{O : Ctx c m}{W : World c}{a} →
-- we use a sum for abrupt returns
Cmd I a O → Cont I (λ W → (Val W a) ⊎ (Env O W)) W
-- new locals variable
evalc (loc x e) E μ with evalₑ e E μ
... | W₁ , ext₁ , μ₁ , v = W₁ , ext₁ , μ₁ , inj₂ (v Vec∀.∷ (Vec∀.map (coerce ext₁) E))
-- assigning to a local
evalc (asgn i x) E μ with evalₑ x E μ
... | W₁ , ext₁ , μ₁ , v = W₁ , ext₁ , μ₁ , inj₂ (Vec∀.map (coerce ext₁) E Vec∀++.[ i ]≔ v)
-- setting a field
-- start by lookuping up the referenced object on the heap & eval the expression to assign it
evalc (set rf fld e) E μ with evalₑ rf E μ
... | W₁ , ext₁ , μ₁ , ref p s with List∀.lookup μ₁ p | evalₑ e (Vec∀.map (coerce ext₁) E) μ₁
... | (val ()) | _
... | (obj cid O) | (W₂ , ext₂ , μ₂ , v) = let ext = ⊑-trans ext₁ ext₂ in
, ext
, (μ₂ All[ ∈-⊒ p ext₂ ]≔' -- update the store at the reference location
-- update the object at the member location
obj cid (
setter (coerce ext₂ O) (mem-inherit Σ s fld) v
)
)
, (inj₂ $ Vec∀.map (coerce ext) E)
-- side-effectful expressions
evalc (do x) E μ with evalₑ x E μ
... | W₁ , ext₁ , μ₁ , _ = W₁ , ext₁ , μ₁ , inj₂ (Vec∀.map (coerce ext₁) E)
-- early returns
evalc (ret x) E μ with evalₑ x E μ
... | W₁ , ext₁ , μ₁ , v = W₁ , ext₁ , μ₁ , inj₁ v
eval-body : ∀ {n}{I : Ctx c n}{W : World c}{a} → Body I a → Cont I (λ W → Val W a) W
eval-body (body ε re) E μ = evalₑ re E μ
eval-body (body (x ◅ xs) re) E μ with evalc x E μ
... | W₁ , ext₁ , μ₁ , inj₂ E₁ = ⊒-res ext₁ (eval-body (body xs re) E₁ μ₁)
... | W₁ , ext₁ , μ₁ , inj₁ v = _ , ext₁ , μ₁ , v
evalₙ : ∀ {n}{I : Ctx c n}{W : World c}{as} → All (Body I) as →
Cont I (λ W → All (Val W) as) W
evalₙ [] E μ = , ⊑-refl , μ , []
evalₙ (px ∷ bs) E μ with eval-body px E μ
... | W₁ , ext₁ , μ₁ , v with evalₙ bs (Vec∀.map (coerce ext₁) E) μ₁
... | W₂ , ext₂ , μ₂ , vs = W₂ , ⊑-trans ext₁ ext₂ , μ₂ , coerce ext₂ v ∷ vs
eval : ∀ {a} → Prog a → ∃ λ W → Store W × Val W a
eval (lib , main) with eval-body main Vec∀.[] []
... | W , ext , μ , v = W , μ , v
|
test_programs/uart.asm | mfkiwl/QNICE-FPGA-hyperRAM | 53 | 27346 | ; very basic UART test which echos all input chars back to the terminal
; plus it displays the ASCII code of the character on the TIL
; by sy2002 in August 2015
.ORG 0x8000
#define FPGA
#include "../dist_kit/sysdef.asm"
MOVE IO$TIL_DISPLAY, R12
MOVE 0xFFAA, @R12
MOVE IO$UART_SRA, R0 ; R0: address of status register
MOVE IO$UART_RHRA, R1 ; R1: address of receiver register
MOVE IO$UART_THRA, R2 ; R2: address of transmit register
_IO$GETC_LOOP MOVE @R0, R3 ; read status register
AND 0x0001, R3 ; character waiting in read latch?
RBRA _IO$GETC_LOOP, Z ; loop until a char. is received
MOVE @R1, R8 ; store received character ...
MOVE R8, @R12 ; ... and write it to TIL
_IO$SETC_WAIT MOVE @R0, R3 ; read status register
AND 0x0002, R3 ; ready to transmit?
RBRA _IO$SETC_WAIT, Z ; loop until ready
MOVE R8, @R2 ; echo character back to terminal
RBRA _IO$GETC_LOOP, 1 ; next char
ABRA 0, 1
|
oeis/015/A015593.asm | neoneye/loda-programs | 11 | 22776 | <gh_stars>10-100
; A015593: a(n) = 11*a(n-1) + 2*a(n-2).
; Submitted by <NAME>(s4)
; 0,1,11,123,1375,15371,171831,1920883,21473375,240048891,2683484551,29998427843,335349675375,3748843284811,41907975483671,468485416890003,5237155536757375,58545681738111131,654476810192737191,7316336275596331363,81788652651945119375,914307851722588975851,10220963674252368973111,114259216120221236655923,1277293304670938341161375,14278744783620764226086971,159620779229170283169279431,1784386061088114643314247683,19947488230427601642795283375,222991142656879847357376612491
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $2,2
mul $3,11
add $3,$1
mov $1,$2
lpe
mov $0,$3
|
src/libraries/Rejuvenation_Lib/src/rejuvenation-find_and_replacer.adb | selroc/Renaissance-Ada | 1 | 11622 | with Rejuvenation; use Rejuvenation;
with Rejuvenation.Finder; use Rejuvenation.Finder;
with Rejuvenation.Placeholders; use Rejuvenation.Placeholders;
with Rejuvenation.Replacer; use Rejuvenation.Replacer;
with String_Maps; use String_Maps;
package body Rejuvenation.Find_And_Replacer is
function Accept_All_Matches (Match : Match_Pattern) return Boolean is
pragma Unreferenced (Match);
-- In Ada 2022 replace with aspect on formal parameter Match
-- + make function expression!
begin
return True;
end Accept_All_Matches;
procedure Find_And_Replace
(TR : in out Text_Rewrite'Class; Node : Ada_Node'Class;
Find_Pattern, Replace_Pattern : Pattern;
Accept_Match : Match_Accepter := Accept_All_Matches'Access;
Before, After : Node_Location := No_Trivia)
is
function Get_Placeholder_Replacement (Match : Match_Pattern) return Map;
function Get_Placeholder_Replacement (Match : Match_Pattern) return Map
is
Result : Map;
begin
for Placeholder_Name of Rejuvenation.Placeholders
.Get_Placeholder_Names
(Replace_Pattern.As_Ada_Node)
loop
declare
Placeholder_Nodes : constant Node_List.Vector :=
Match.Get_Placeholder_As_Nodes (Placeholder_Name);
begin
if Placeholder_Nodes.Length = 0 then
Result.Insert (Placeholder_Name, "");
else
declare
TN : Text_Rewrite :=
Make_Text_Rewrite_Nodes
(Placeholder_Nodes.First_Element,
Placeholder_Nodes.Last_Element, All_Trivia,
All_Trivia);
-- always include comments of place holders
begin
for Node of Placeholder_Nodes loop
Find_And_Replace
(TN, Node, Find_Pattern, Replace_Pattern,
Accept_Match, Before, After);
end loop;
Result.Insert (Placeholder_Name, TN.ApplyToString);
end;
end if;
end;
end loop;
return Result;
end Get_Placeholder_Replacement;
Matches : constant Match_Pattern_List.Vector :=
(if Find_Pattern.As_Ada_Node.Kind in Ada_Ada_List then
Find_Non_Contained_Sub_List (Node, Find_Pattern)
else Find_Non_Contained_Full (Node, Find_Pattern));
begin
for Match of Matches loop
if Accept_Match (Match) then
declare
Match_Nodes : constant Node_List.Vector := Match.Get_Nodes;
Replacements : constant Map :=
Get_Placeholder_Replacement (Match);
begin
TR.Replace
(Match_Nodes.First_Element, Match_Nodes.Last_Element,
Replace (Replace_Pattern.As_Ada_Node, Replacements), Before,
After, Node.Unit.Get_Charset);
end;
end if;
end loop;
end Find_And_Replace;
function Find_And_Replace
(File_Path : String; Find_Pattern, Replace_Pattern : Pattern;
Accept_Match : Match_Accepter := Accept_All_Matches'Access;
Before, After : Node_Location := No_Trivia) return Boolean
is
Ctx : constant Analysis_Context := Create_Context;
File_Unit : constant Analysis_Unit := Ctx.Get_From_File (File_Path);
TR : Text_Rewrite_Unit := Make_Text_Rewrite_Unit (File_Unit);
begin
Find_And_Replace
(TR, File_Unit.Root, Find_Pattern, Replace_Pattern, Accept_Match,
Before, After);
TR.Apply;
return TR.HasReplacements;
end Find_And_Replace;
end Rejuvenation.Find_And_Replacer;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104a.ada | best08618/asylo | 7 | 22105 | <reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104a.ada<gh_stars>1-10
-- C64104A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT CONSTRAINT_ERROR IS RAISED FOR OUT OF RANGE SCALAR
-- ARGUMENTS. SUBTESTS ARE:
-- (A) STATIC IN ARGUMENT.
-- (B) DYNAMIC IN ARGUMENT.
-- (C) IN OUT, OUT OF RANGE ON CALL.
-- (D) OUT, OUT OF RANGE ON RETURN.
-- (E) IN OUT, OUT OF RANGE ON RETURN.
-- HISTORY:
-- DAS 01/14/81
-- CPP 07/03/84
-- LB 11/20/86 ADDED CODE TO ENSURE IN SUBTESTS WHICH CHECK
-- RETURNED VALUES, THAT SUBPROGRAMS ARE ACTUALLY
-- CALLED.
-- JET 08/04/87 FIXED HEADER FOR STANDARD FORMAT.
WITH REPORT; USE REPORT;
PROCEDURE C64104A IS
SUBTYPE DIGIT IS INTEGER RANGE 0..9;
CALLED : BOOLEAN;
D : DIGIT;
I : INTEGER;
M1 : CONSTANT INTEGER := IDENT_INT(-1);
COUNT : INTEGER := 0;
SUBTYPE SI IS INTEGER RANGE M1 .. 10;
PROCEDURE P1 (PIN : IN DIGIT; WHO : STRING) IS -- (A), (B)
BEGIN
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - P1 " & WHO);
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P1 FOR " & WHO);
END P1;
PROCEDURE P2 (PINOUT : IN OUT DIGIT; WHO : STRING) IS -- (C)
BEGIN
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - P2 " & WHO);
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P2 FOR " & WHO);
END P2;
PROCEDURE P3 (POUT : OUT SI; WHO : STRING) IS -- (D)
BEGIN
IF WHO = "10" THEN
POUT := IDENT_INT(10); -- (10 IS NOT A DIGIT)
ELSE
POUT := -1;
END IF;
CALLED := TRUE;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P3 FOR " & WHO);
END P3;
PROCEDURE P4 (PINOUT : IN OUT INTEGER; WHO : STRING) IS -- (E)
BEGIN
IF WHO = "10" THEN
PINOUT := 10; -- (10 IS NOT A DIGIT)
ELSE
PINOUT := IDENT_INT(-1);
END IF;
CALLED := TRUE;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN P4 FOR" & WHO);
END P4;
BEGIN
TEST ("C64104A", "CHECK THAT CONSTRAINT_ERROR IS RAISED " &
"FOR OUT OF RANGE SCALAR ARGUMENTS");
BEGIN -- (A)
P1 (10, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P1 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P1 (10)");
END; -- (A)
BEGIN -- (B)
P1 (IDENT_INT (-1), "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P1 (" &
"IDENT_INT (-1))");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P1 (" &
"IDENT_INT (-1))");
END; --(B)
BEGIN -- (C)
I := IDENT_INT (10);
P2 (I, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P2 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P2 (10)");
END; -- (C)
BEGIN -- (C1)
I := IDENT_INT (-1);
P2 (I, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR P2 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P2 (-1)");
END; -- (C1)
BEGIN -- (D)
CALLED := FALSE;
D := IDENT_INT (1);
P3 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P3 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P3 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P3 (10)");
END; -- (D)
BEGIN -- (D1)
CALLED := FALSE;
D := IDENT_INT (1);
P3 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P3 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P3 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P3 (-1)");
END; -- (D1)
BEGIN -- (E)
CALLED := FALSE;
D := 9;
P4 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P4 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P4 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P4 (10)");
END; -- (E)
BEGIN -- (E1)
CALLED := FALSE;
D := 0;
P4 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM" &
" P4 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("SUBPROGRAM P4 WAS NOT CALLED");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR P4 (-1)");
END; -- (E1)
IF (COUNT /= 8) THEN
FAILED ("INCORRECT NUMBER OF CONSTRAINT_ERRORS RAISED");
END IF;
RESULT;
END C64104A;
|
tests/natools-s_expressions-templates-tests-dates.adb | faelys/natools | 0 | 736 | ------------------------------------------------------------------------------
-- Copyright (c) 2014, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Calendar.Formatting;
with Ada.Calendar.Time_Zones;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Test_Tools;
with Natools.S_Expressions.Templates.Dates;
with Natools.Static_Maps.S_Expressions.Templates.Dates.T;
package body Natools.S_Expressions.Templates.Tests.Dates is
procedure Test_Render
(Test : in out NT.Test;
Template : in String;
Expected : in String;
Value : in Ada.Calendar.Time;
Time_Zone : Ada.Calendar.Time_Zones.Time_Offset := 0);
-- Run Template with Value and compare the result with Expected
------------------------------
-- Local Helper Subprograms --
------------------------------
procedure Test_Render
(Test : in out NT.Test;
Template : in String;
Expected : in String;
Value : in Ada.Calendar.Time;
Time_Zone : Ada.Calendar.Time_Zones.Time_Offset := 0)
is
Input : aliased Test_Tools.Memory_Stream;
Output : Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (To_Atom (Template));
Parser.Next;
Output.Set_Expected (To_Atom (Expected));
Templates.Dates.Render (Output, Parser, Value, Time_Zone);
Output.Check_Stream (Test);
end Test_Render;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Composite_Components (Report);
Forced_Time_Zone (Report);
Padded_Components (Report);
RFC_3339 (Report);
Simple_Components (Report);
Static_Hash_Map (Report);
Weekday_In_Time_Zone (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
procedure Composite_Components (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Composite date and time formats");
begin
Test_Render
(Test, "(YYYYMMDD)T(HHMMSS)",
"20111125T082052",
Ada.Calendar.Formatting.Time_Of (2011, 11, 25, 8, 20, 52));
Test_Render
(Test, "(big-endian-date ""."")1: (time "":"")",
"2013.10.01 18:49:11",
Ada.Calendar.Formatting.Time_Of (2013, 10, 1, 18, 49, 11));
Test_Render
(Test, "(little-endian-date ""/"")1: (time h m)1:s",
"11/10/2013 21h51m08s",
Ada.Calendar.Formatting.Time_Of (2013, 10, 11, 21, 51, 8));
Test_Render
(Test, "(big-endian-date 1: 1: )2:, (little-endian-time 1:;)",
"2013 10 13, 00;47;15",
Ada.Calendar.Formatting.Time_Of (2013, 10, 13, 15, 47, 0));
Test_Render
(Test, "(SSMMHH)(DDMMYYYY)",
"01082129012014",
Ada.Calendar.Formatting.Time_Of (2014, 1, 29, 21, 8, 1));
exception
when Error : others => Test.Report_Exception (Error);
end Composite_Components;
procedure Forced_Time_Zone (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Time zone set in template");
Moment : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
(2012, 8, 29, 22, 42, 16, Time_Zone => 0);
begin
Test_Render
(Test, "(in-zone 0 (rfc-3339))",
"2012-08-29T22:42:16Z", Moment);
Test_Render
(Test, "(in-zone CEST (rfc-3339))",
"2012-08-30T00:42:16+02:00", Moment);
Test_Render
(Test, "(in-zone -01:12 (rfc-3339))",
"2012-08-29T21:30:16-01:12", Moment);
Test_Render
(Test, "(in-zone +0130 (rfc-3339))",
"2012-08-30T00:12:16+01:30", Moment);
Test_Render
(Test, "(in-zone -10 (rfc-3339))",
"2012-08-29T12:42:16-10:00", Moment);
Test_Render
(Test, "(in-zone FOO (rfc-3339))",
"", Moment);
Test_Render
(Test, "(in-zone BARST (rfc-3339))",
"", Moment);
Test_Render
(Test, "(in-zone 12345 (rfc-3339))",
"", Moment);
exception
when Error : others => Test.Report_Exception (Error);
end Forced_Time_Zone;
procedure Padded_Components (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Simple time components with padding");
Template : constant String
:= "(padded-month)(padded-day)(padded-hour)(minute)(padded-second)";
begin
Test_Render
(Test, Template,
"1125082052",
Ada.Calendar.Formatting.Time_Of (2011, 11, 25, 8, 20, 52));
Test_Render
(Test, Template,
"1001184911",
Ada.Calendar.Formatting.Time_Of (2013, 10, 1, 18, 49, 11));
Test_Render
(Test, Template,
"1011215108",
Ada.Calendar.Formatting.Time_Of (2013, 10, 11, 21, 51, 8));
Test_Render
(Test, Template,
"1013154700",
Ada.Calendar.Formatting.Time_Of (2013, 10, 13, 15, 47, 0));
Test_Render
(Test, Template,
"012921801",
Ada.Calendar.Formatting.Time_Of (2014, 1, 29, 21, 8, 1));
exception
when Error : others => Test.Report_Exception (Error);
end Padded_Components;
procedure RFC_3339 (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("RFC-3339 format");
begin
Test_Render
(Test, "(rfc-3339)",
"2011-11-25T08:20:52Z",
Ada.Calendar.Formatting.Time_Of (2011, 11, 25, 8, 20, 52));
Test_Render
(Test, "(rfc-3339)",
"2013-10-01T18:49:11Z",
Ada.Calendar.Formatting.Time_Of (2013, 10, 1, 18, 49, 11));
Test_Render
(Test, "(rfc-3339)",
"2013-10-11T21:51:08Z",
Ada.Calendar.Formatting.Time_Of (2013, 10, 11, 21, 51, 8));
Test_Render
(Test, "(rfc-3339)",
"2013-10-13T15:47:00Z",
Ada.Calendar.Formatting.Time_Of (2013, 10, 13, 15, 47, 0));
Test_Render
(Test, "(rfc-3339)",
"2014-01-29T21:08:01Z",
Ada.Calendar.Formatting.Time_Of (2014, 1, 29, 21, 8, 1));
exception
when Error : others => Test.Report_Exception (Error);
end RFC_3339;
procedure Simple_Components (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Simple time components");
Template : constant String
:= "3:Le "
& "(day-of-week lundi mardi mercredi jeudi vendredi samedi dimanche)"
& "1: "
& "(day (suffix (er 1)))"
& "1: "
& "(month janvier février mars avril mai juin juillet"
& " août septembre octobre novembre décembre)"
& "1: (year)"
& """ à """
& "(hour) 1:h (padded-minute)"
& "4: et (second)"
& "1: (second (image-range secondes (seconde 1 0)))";
begin
Test_Render
(Test, Template,
"Le vendredi 25 novembre 2011 à 8h20 et 52 secondes",
Ada.Calendar.Formatting.Time_Of (2011, 11, 25, 8, 20, 52));
Test_Render
(Test, Template,
"Le mardi 1er octobre 2013 à 18h49 et 11 secondes",
Ada.Calendar.Formatting.Time_Of (2013, 10, 1, 18, 49, 11));
Test_Render
(Test, Template,
"Le vendredi 11 octobre 2013 à 21h51 et 8 secondes",
Ada.Calendar.Formatting.Time_Of (2013, 10, 11, 21, 51, 8));
Test_Render
(Test, Template,
"Le dimanche 13 octobre 2013 à 15h47 et 0 seconde",
Ada.Calendar.Formatting.Time_Of (2013, 10, 13, 15, 47, 0));
Test_Render
(Test, Template,
"Le mercredi 29 janvier 2014 à 21h08 et 1 seconde",
Ada.Calendar.Formatting.Time_Of (2014, 1, 29, 21, 8, 1));
exception
when Error : others => Test.Report_Exception (Error);
end Simple_Components;
procedure Static_Hash_Map (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Parse errors in template");
begin
if not Natools.Static_Maps.S_Expressions.Templates.Dates.T then
Test.Fail;
end if;
exception
when Error : others => Test.Report_Exception (Error);
end Static_Hash_Map;
procedure Weekday_In_Time_Zone (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Week day in various time zones");
Early : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
(2015, 11, 11, 0, 29, 0, Time_Zone => 0);
Late : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
(2015, 11, 11, 23, 31, 0, Time_Zone => 0);
Template_Prefix : constant String := "(in-zone ";
Template_Suffix : constant String
:= " (day-of-week Monday Tuesday Wednesday"
& " Thursday Friday Saturday Sunday) 1: "
& " (day (suffix th (st 1 21 31) (nd 2 22) (rd 3 23))) 2:, "
& " (hour) 1:: (padded-minute))";
procedure Double_Test (Zone, Expected_Early, Expected_Late : String);
procedure Double_Test (Zone, Expected_Early, Expected_Late : String) is
begin
Test_Render
(Test, Template_Prefix & Zone & Template_Suffix,
Expected_Early, Early);
Test_Render
(Test, Template_Prefix & Zone & Template_Suffix,
Expected_Late, Late);
end Double_Test;
begin
Double_Test ("0", "Wednesday 11th, 0:29", "Wednesday 11th, 23:31");
Double_Test ("-01:00", "Tuesday 10th, 23:29", "Wednesday 11th, 22:31");
Double_Test ("+01:00", "Wednesday 11th, 1:29", "Thursday 12th, 0:31");
exception
when Error : others => Test.Report_Exception (Error);
end Weekday_In_Time_Zone;
end Natools.S_Expressions.Templates.Tests.Dates;
|
src/prototyping/term/examples/Prelude.agda | larrytheliquid/agda | 1 | 13195 | <reponame>larrytheliquid/agda
module Prelude where
data _==_ {A : Set}(x : A) : A → Set where
refl : x == x
J : {A : Set} {x y : A} (P : (x y : A) → x == y -> Set) →
(∀ z → P z z refl) → (p : x == y) → P x y p
J P h refl = h _
|
test/09-perses-left.g4 | nsumner/antlr2pnf | 3 | 128 |
grammar test09;
entry: a;
a: b c | d | ;
b: a d | c d;
c: 'c';
d: 'd';
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95022b.ada | best08618/asylo | 7 | 6298 | -- C95022B.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT IT IS POSSIBLE TO ACCEPT AN ENTRY CALL FROM INSIDE
-- THE BODY OF AN ACCEPT STATEMENT.
-- CHECK THE CASE OF ABORT DURING THE INNERMOST ACCEPT.
-- <NAME> 25-FEB-1984
-- JBG 6/1/84
WITH REPORT; USE REPORT;
PROCEDURE C95022B IS
BEGIN
TEST("C95022B", "CHECK THAT EMBEDDED RENDEZVOUS ARE PROCESSED " &
"CORRECTLY (ABORT CASE)");
DECLARE
TASK TYPE CLIENT IS
ENTRY GET_ID (I : INTEGER);
END CLIENT;
T_ARR : ARRAY (1..4) OF CLIENT;
TASK KILL IS
ENTRY ME;
END KILL;
TASK SERVER IS
ENTRY E1;
ENTRY E2;
ENTRY E3;
ENTRY E4;
END SERVER;
TASK BODY SERVER IS
BEGIN
ACCEPT E1 DO
ACCEPT E2 DO
ACCEPT E3 DO
ACCEPT E4 DO
KILL.ME;
E1; -- WILL DEADLOCK UNTIL ABORT.
END E4;
END E3;
END E2;
END E1;
END SERVER;
TASK BODY KILL IS
BEGIN
ACCEPT ME;
ABORT SERVER;
END;
TASK BODY CLIENT IS
ID : INTEGER;
BEGIN
ACCEPT GET_ID( I : INTEGER) DO
ID := I;
END GET_ID;
CASE ID IS
WHEN 1 => SERVER.E1;
WHEN 2 => SERVER.E2;
WHEN 3 => SERVER.E3;
WHEN 4 => SERVER.E4;
WHEN OTHERS => FAILED ("INCORRECT ID");
END CASE;
FAILED ("TASKING_ERROR NOT RAISED IN CLIENT" &
INTEGER'IMAGE(ID));
EXCEPTION
WHEN TASKING_ERROR =>
NULL;
WHEN OTHERS =>
FAILED("EXCEPTION IN CLIENT" & INTEGER'IMAGE(ID));
END CLIENT;
BEGIN
FOR I IN 1 .. 4 LOOP
T_ARR(I).GET_ID(I);
END LOOP;
END;
RESULT;
END C95022B;
|
Parser_Tools/src/implementation/lexer-source-file.adb | robdaemon/AdaYaml | 6 | 20857 | -- part of ParserTools, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "copying.txt"
package body Lexer.Source.File is
overriding procedure Read_Data (S : in out Instance; Buffer : out String;
Length : out Natural) is
use type Ada.Directories.File_Size;
begin
Length := Natural'Min (Buffer'Length, Natural (S.Input_Length - S.Input_At));
declare
subtype Read_Blob is String (1 .. Length);
begin
Read_Blob'Read (S.Stream, Buffer (Buffer'First .. Buffer'First + Length - 1));
S.Input_At := S.Input_At + Ada.Directories.File_Size (Length);
end;
end Read_Data;
overriding procedure Finalize (Object : in out Instance) is
begin
Ada.Streams.Stream_IO.Close (Object.File);
end Finalize;
function As_Source (File_Path : String) return Pointer is
Ret : constant access Instance :=
new Instance'(Source.Instance with Input_At => 0,
Input_Length => Ada.Directories.Size (File_Path),
others => <>);
begin
Ada.Streams.Stream_IO.Open (Ret.File, Ada.Streams.Stream_IO.In_File,
File_Path);
Ret.Stream := Ada.Streams.Stream_IO.Stream (Ret.File);
return Pointer (Ret);
end As_Source;
end Lexer.Source.File;
|
audio/sfx/cry23_2.asm | AmateurPanda92/pokemon-rby-dx | 9 | 104556 | SFX_Cry23_2_Ch4:
dutycycle 240
squarenote 15, 15, 7, 1984
squarenote 6, 14, 4, 1985
squarenote 10, 15, 6, 1984
squarenote 4, 13, 3, 1986
squarenote 8, 12, 1, 1984
endchannel
SFX_Cry23_2_Ch5:
dutycycle 95
squarenote 15, 9, 7, 1921
squarenote 6, 8, 4, 1920
squarenote 10, 9, 6, 1921
squarenote 15, 8, 3, 1921
endchannel
SFX_Cry23_2_Ch7:
noisenote 3, 15, 2, 60
noisenote 13, 14, 6, 44
noisenote 15, 13, 7, 60
noisenote 8, 12, 1, 44
endchannel
|
programs/oeis/292/A292290.asm | karttu/loda | 0 | 17699 | <filename>programs/oeis/292/A292290.asm<gh_stars>0
; A292290: Number of vertices of type A at level n of the hyperbolic Pascal pyramid.
; 0,0,3,6,12,27,66,168,435,1134,2964,7755,20298,53136,139107,364182,953436,2496123,6534930,17108664,44791059,117264510,307002468,803742891,2104226202,5508935712,14422580931,37758807078,98853840300,258802713819,677554301154,1773860189640,4644026267763,12158218613646,31830629573172,83333670105867,218170380744426,571177472127408,1495362035637795,3914908634785974
sub $0,1
lpb $0,1
sub $0,1
add $1,$2
add $2,$1
add $1,3
lpe
|
programs/oeis/121/A121722.asm | neoneye/loda | 22 | 93160 | ; A121722: Triangle T(n,k) = 1 + k*n*(n+1)/2, read by rows.
; 1,1,2,1,4,7,1,7,13,19,1,11,21,31,41,1,16,31,46,61,76,1,22,43,64,85,106,127,1,29,57,85,113,141,169,197,1,37,73,109,145,181,217,253,289,1,46,91,136,181,226,271,316,361,406,1,56,111,166,221,276,331,386,441,496,551,1,67,133,199,265,331,397,463,529,595,661,727,1,79,157,235,313,391,469,547,625,703,781,859,937,1,92,183,274,365,456,547,638,729
mov $1,$0
seq $1,25682 ; Exponent of 9 (value of j) in n-th number of form 8^i*9^j.
sub $0,$1
mul $0,$1
add $0,1
|
oeis/193/A193249.asm | neoneye/loda-programs | 11 | 169586 | <gh_stars>10-100
; A193249: Snub dodecahedron with faces of centered polygons.
; Submitted by <NAME>(s4)
; 1,153,755,2107,4509,8261,13663,21015,30617,42769,57771,75923,97525,122877,152279,186031,224433,267785,316387,370539,430541,496693,569295,648647,735049,828801,930203,1039555,1157157,1283309,1418311,1562463,1716065,1879417,2052819,2236571,2430973,2636325,2852927,3081079,3321081,3573233,3837835,4115187,4405589,4709341,5026743,5358095,5703697,6063849,6438851,6829003,7234605,7655957,8093359,8547111,9017513,9504865,10009467,10531619,11071621,11629773,12206375,12801727,13416129,14049881,14703283
mov $1,$0
mul $1,10
add $1,8
bin $1,2
sub $1,1
mul $0,$1
add $0,1
|
test/Succeed/non-fol-theorems/Issue12.agda | asr/apia | 10 | 13922 | <reponame>asr/apia
------------------------------------------------------------------------------
-- Issue 12
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module Issue12 where
postulate
D : Set
∃ : (A : D → Set) → Set
postulate foo : (B C : D → Set) → ∃ C → ∃ C
{-# ATP prove foo #-}
postulate bar : (B C : D → Set) → ∃ B → ∃ B
{-# ATP prove bar #-}
|
programs/oeis/198/A198276.asm | neoneye/loda | 22 | 86526 | ; A198276: 19*2^n-1.
; 18,37,75,151,303,607,1215,2431,4863,9727,19455,38911,77823,155647,311295,622591,1245183,2490367,4980735,9961471,19922943,39845887,79691775,159383551,318767103,637534207,1275068415,2550136831,5100273663,10200547327,20401094655,40802189311,81604378623,163208757247,326417514495,652835028991,1305670057983,2611340115967,5222680231935,10445360463871,20890720927743,41781441855487,83562883710975,167125767421951,334251534843903,668503069687807,1337006139375615,2674012278751231,5348024557502463,10696049115004927,21392098230009855,42784196460019711,85568392920039423,171136785840078847,342273571680157695,684547143360315391,1369094286720630783,2738188573441261567,5476377146882523135,10952754293765046271,21905508587530092543,43811017175060185087,87622034350120370175,175244068700240740351,350488137400481480703,700976274800962961407,1401952549601925922815,2803905099203851845631,5607810198407703691263,11215620396815407382527,22431240793630814765055,44862481587261629530111,89724963174523259060223,179449926349046518120447,358899852698093036240895,717799705396186072481791,1435599410792372144963583,2871198821584744289927167,5742397643169488579854335,11484795286338977159708671,22969590572677954319417343,45939181145355908638834687,91878362290711817277669375,183756724581423634555338751,367513449162847269110677503,735026898325694538221355007,1470053796651389076442710015,2940107593302778152885420031,5880215186605556305770840063,11760430373211112611541680127,23520860746422225223083360255,47041721492844450446166720511,94083442985688900892333441023,188166885971377801784666882047,376333771942755603569333764095,752667543885511207138667528191,1505335087771022414277335056383,3010670175542044828554670112767,6021340351084089657109340225535,12042680702168179314218680451071
mov $1,2
pow $1,$0
sub $1,1
mul $1,19
add $1,18
mov $0,$1
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_360_1255.asm | ljhsiun2/medusa | 9 | 98167 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_360_1255.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x18434, %rcx
clflush (%rcx)
cmp $61557, %rdx
mov (%rcx), %r11d
nop
nop
nop
nop
nop
inc %r14
lea addresses_normal_ht+0x1926c, %rsi
lea addresses_WT_ht+0x19c2c, %rdi
clflush (%rdi)
nop
nop
nop
sub $23292, %r9
mov $12, %rcx
rep movsb
sub $55795, %rdi
lea addresses_D_ht+0x6b2f, %rcx
clflush (%rcx)
nop
nop
nop
xor %rsi, %rsi
mov (%rcx), %r14
nop
nop
nop
dec %r11
lea addresses_A_ht+0x8dac, %rsi
lea addresses_UC_ht+0x1881c, %rdi
nop
nop
nop
nop
nop
xor %rbp, %rbp
mov $5, %rcx
rep movsb
nop
cmp %rdx, %rdx
lea addresses_WC_ht+0x842c, %r14
nop
nop
and %rdi, %rdi
movb $0x61, (%r14)
nop
nop
nop
nop
nop
xor $15250, %rsi
lea addresses_WC_ht+0x136ec, %rsi
lea addresses_WC_ht+0x16e1c, %rdi
clflush (%rdi)
nop
nop
nop
nop
sub %r11, %r11
mov $75, %rcx
rep movsq
nop
nop
nop
inc %rdx
lea addresses_WT_ht+0x1752c, %rsi
lea addresses_WT_ht+0x34ee, %rdi
dec %r14
mov $115, %rcx
rep movsq
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_UC_ht+0x1d82c, %rsi
lea addresses_A_ht+0x15eac, %rdi
nop
nop
nop
nop
nop
dec %rdx
mov $111, %rcx
rep movsq
nop
dec %rsi
lea addresses_D_ht+0x42c, %rsi
nop
nop
nop
nop
cmp $3220, %r9
mov (%rsi), %rbp
nop
nop
nop
dec %r9
lea addresses_normal_ht+0xdf57, %rsi
nop
nop
xor %r9, %r9
movl $0x61626364, (%rsi)
nop
nop
nop
and $54376, %rdx
lea addresses_UC_ht+0x2f9c, %rcx
nop
nop
nop
nop
xor %r14, %r14
mov (%rcx), %rbp
nop
nop
sub %rdx, %rdx
lea addresses_A_ht+0xd48c, %r9
sub %rdi, %rdi
movl $0x61626364, (%r9)
add %rcx, %rcx
lea addresses_WT_ht+0x1770c, %rcx
xor $65394, %rdi
mov $0x6162636465666768, %r14
movq %r14, %xmm1
movups %xmm1, (%rcx)
add $16601, %r9
lea addresses_WC_ht+0x19a2c, %rsi
lea addresses_D_ht+0x6a2c, %rdi
nop
inc %r14
mov $52, %rcx
rep movsb
nop
nop
sub $17678, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rbx
push %rdx
push %rsi
// Store
lea addresses_normal+0x1a02c, %r10
nop
nop
nop
nop
nop
xor %r9, %r9
movl $0x51525354, (%r10)
nop
nop
nop
nop
add %r8, %r8
// Store
lea addresses_A+0x142c, %rbx
clflush (%rbx)
nop
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %r15
movq %r15, %xmm3
movups %xmm3, (%rbx)
nop
nop
nop
nop
nop
dec %rdx
// Store
mov $0x4f17a3000000032c, %r8
clflush (%r8)
nop
nop
nop
nop
nop
sub $34188, %r15
mov $0x5152535455565758, %rdx
movq %rdx, (%r8)
nop
nop
and $5957, %r15
// Store
lea addresses_UC+0x1782c, %r15
nop
and %r10, %r10
mov $0x5152535455565758, %rbx
movq %rbx, (%r15)
nop
nop
add $30731, %r8
// Store
lea addresses_US+0x4b34, %rdx
nop
nop
nop
nop
sub $1378, %rsi
movw $0x5152, (%rdx)
nop
nop
nop
nop
dec %r8
// Faulty Load
lea addresses_A+0xcc2c, %r8
clflush (%r8)
cmp %r9, %r9
movb (%r8), %bl
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal', 'AVXalign': True, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_NC', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'src': {'NT': True, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}}
{'00': 360}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
test/Succeed/Issue1436-5.agda | shlevy/agda | 1,989 | 5662 | module _ where
module A where
infix 2 c
infix 1 d
syntax c x = x ↑
syntax d x y = x ↓ y
data D : Set where
● : D
c : D → D
d : D → D → D
module B where
syntax d x y = x ↓ y
data D : Set where
d : D → D → D
open A
open B
rejected : A.D
rejected = ● ↑ ↓ ●
|
tools/win32/prepsrc.asm | scientech-com-ua/case | 17 | 4975 |
format PE console 4.0
entry start
include 'win32a.inc'
section '.data' data readable writeable
_usage db 'preprocessed source dumper for flat assembler',0Dh,0Ah
db 'usage: prepsrc <input> <output>',0Dh,0Ah
db 0
_error_prefix db 'error: ',0
_error_suffix db '.',0Dh,0Ah,0
input_file dd 0
output_file dd 0
display_handle dd ?
bytes_count dd ?
params rb 1000h
section '.text' code readable executable
start:
mov [display_handle],STD_OUTPUT_HANDLE
call get_params
jnc make_dump
mov esi,_usage
call display_string
invoke ExitProcess,2
make_dump:
call preprocessed_source
invoke ExitProcess,0
error:
mov [display_handle],STD_ERROR_HANDLE
mov esi,_error_prefix
call display_string
pop esi
call display_string
mov esi,_error_suffix
call display_string
invoke ExitProcess,1
get_params:
invoke GetCommandLine
mov esi,eax
mov edi,params
find_command_start:
lodsb
cmp al,20h
je find_command_start
cmp al,22h
je skip_quoted_name
skip_name:
lodsb
cmp al,20h
je find_param
or al,al
jz all_params
jmp skip_name
skip_quoted_name:
lodsb
cmp al,22h
je find_param
or al,al
jz all_params
jmp skip_quoted_name
find_param:
lodsb
cmp al,20h
je find_param
cmp al,0Dh
je all_params
or al,al
jz all_params
cmp [input_file],0
jne get_output_file
mov [input_file],edi
jmp process_param
get_output_file:
cmp [output_file],0
jne bad_params
mov [output_file],edi
process_param:
cmp al,22h
je string_param
copy_param:
stosb
lodsb
cmp al,20h
je param_end
cmp al,0Dh
je param_end
or al,al
jz param_end
jmp copy_param
string_param:
lodsb
cmp al,22h
je string_param_end
cmp al,0Dh
je param_end
or al,al
jz param_end
stosb
jmp string_param
bad_params:
stc
ret
param_end:
dec esi
string_param_end:
xor al,al
stosb
jmp find_param
all_params:
cmp [input_file],0
je bad_params
cmp [output_file],0
je bad_params
clc
ret
include 'system.inc'
include '..\prepsrc.inc'
section '.idata' import data readable writeable
library kernel32,'KERNEL32.DLL'
include 'api\kernel32.inc'
|
Cameras/SOTTR/InjectableGenericCameraSystem/Interceptor.asm | valdisiljuconoks/InjectableGenericCameraSystem | 7 | 19462 | <filename>Cameras/SOTTR/InjectableGenericCameraSystem/Interceptor.asm
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;// Part of Injectable Generic Camera System
;// Copyright(c) 2017, <NAME>
;// All rights reserved.
;// https://github.com/FransBouma/InjectableGenericCameraSystem
;//
;// Redistribution and use in source and binary forms, with or without
;// modification, are permitted provided that the following conditions are met :
;//
;// * Redistributions of source code must retain the above copyright notice, this
;// list of conditions and the following disclaimer.
;//
;// * Redistributions in binary form must reproduce the above copyright notice,
;// this list of conditions and the following disclaimer in the documentation
;// and / or other materials provided with the distribution.
;//
;// 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.
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;---------------------------------------------------------------
; Game specific asm file to intercept execution flow to obtain addresses, prevent writes etc.
;---------------------------------------------------------------
;---------------------------------------------------------------
; Public definitions so the linker knows which names are present in this file
PUBLIC cameraStructInterceptor
PUBLIC cameraWrite1Interceptor
;---------------------------------------------------------------
;---------------------------------------------------------------
; Externs which are used and set by the system. Read / write these
; values in asm to communicate with the system
EXTERN g_cameraEnabled: byte
EXTERN g_cameraStructAddress: qword
;---------------------------------------------------------------
;---------------------------------------------------------------
; Own externs, defined in InterceptorHelper.cpp
EXTERN _cameraStructInterceptionContinue: qword
EXTERN _cameraWrite1InterceptionContinue: qword
.data
;---------------------------------------------------------------
; Scratch pad
.code
cameraStructInterceptor PROC
;SOTTR.exe+853FC4E - 48 8D AC 24 B8FFFFFF - lea rbp,[rsp-00000048]
;SOTTR.exe+853FC56 - 48 81 EC 48010000 - sub rsp,00000148 { 328 }
;SOTTR.exe+853FC5D - 41 B1 01 - mov r9l,01 { 1 }
;SOTTR.exe+853FC60 - 31 DB - xor ebx,ebx
;SOTTR.exe+853FC62 - 89 59 28 - mov [rcx+28],ebx << INTERCEPT HERE
;SOTTR.exe+853FC65 - 45 31 C0 - xor r8d,r8d
;SOTTR.exe+853FC68 - 0F28 82 80000000 - movaps xmm0,[rdx+00000080] << Camera struct address in rdx.
;SOTTR.exe+853FC6F - 49 89 CF - mov r15,rcx
;SOTTR.exe+853FC72 - 41 0FB6 D1 - movzx edx,r9l << CONTINUE HERE
;SOTTR.exe+853FC76 - 0F29 44 24 60 - movaps [rsp+60],xmm0
;SOTTR.exe+853FC7B - E8 0060F1F7 - call SOTTR.exe+455C80
;SOTTR.exe+853FC80 - 49 8B 8F E0070000 - mov rcx,[r15+000007E0]
;SOTTR.exe+853FC87 - 49 89 C5 - mov r13,rax
;SOTTR.exe+853FC8A - 48 89 44 24 48 - mov [rsp+48],rax
;
; Alternative (but on very HOT path)
;
;SOTTR.exe+5D3F16A - 48 85 C0 - test rax,rax
;SOTTR.exe+5D3F16D - 0F84 74010000 - je SOTTR.exe+5D3F2E7
;SOTTR.exe+5D3F173 - 0F28 50 30 - movaps xmm2,[rax+30]
;SOTTR.exe+5D3F177 - 41 0F5C 94 24 80000000 - subps xmm2,[r12+00000080] << Camera struct address in r12
;SOTTR.exe+5D3F180 - 49 8B 87 60060000 - mov rax,[r15+00000660]
;SOTTR.exe+5D3F187 - 0F59 D2 - mulps xmm2,xmm2
;SOTTR.exe+5D3F18A - 0F28 CA - movaps xmm1,xmm2
;SOTTR.exe+5D3F18D - 0F28 C2 - movaps xmm0,xmm2
;SOTTR.exe+5D3F190 - 0FC6 CA 02 - shufps xmm1,xmm202 { 2 }
;SOTTR.exe+5D3F194 - 0FC6 C2 01 - shufps xmm0,xmm201 { 1 }
;SOTTR.exe+5D3F198 - F3 0F58 C1 - addss xmm0,xmm1
;SOTTR.exe+5D3F19C - F3 0F10 88 D0000000 - movss xmm1,[rax+000000D0]
;SOTTR.exe+5D3F1A4 - F3 0F59 C9 - mulss xmm1,xmm1
mov [rcx+28h],ebx
xor r8d,r8d
mov [g_cameraStructAddress], rdx
movaps xmm0, xmmword ptr [rdx+00000080h]
mov r15,rcx
jmp qword ptr [_cameraStructInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraStructInterceptor ENDP
cameraWrite1Interceptor PROC
; Write is used by many paths / targets, only block writes for the camera address we found (if any)
;SOTTR.exe+5EE33C8 - 66 0F7F 41 60 - movdqa [rcx+60],xmm0
;SOTTR.exe+5EE33CD - 0F28 4A 70 - movaps xmm1,[rdx+70]
;SOTTR.exe+5EE33D1 - 66 0F7F 49 70 - movdqa [rcx+70],xmm1
;SOTTR.exe+5EE33D6 - 0F28 82 80000000 - movaps xmm0,[rdx+00000080]
;SOTTR.exe+5EE33DD - 66 0F7F 81 80000000 - movdqa [rcx+00000080],xmm0 << INTERCEPT HERE << WRITE COORDS
;SOTTR.exe+5EE33E5 - 0F28 8A A0000000 - movaps xmm1,[rdx+000000A0]
;SOTTR.exe+5EE33EC - 0F29 89 A0000000 - movaps [rcx+000000A0],xmm1 << WRITE QUATERNION
;SOTTR.exe+5EE33F3 - 8B 82 B0000000 - mov eax,[rdx+000000B0] << WRITE FOV
;SOTTR.exe+5EE33F9 - 89 81 B0000000 - mov [rcx+000000B0],eax
;SOTTR.exe+5EE33FF - 8B 82 B4000000 - mov eax,[rdx+000000B4] << CONTINUE HERE
;SOTTR.exe+5EE3405 - 89 81 B4000000 - mov [rcx+000000B4],eax
;SOTTR.exe+5EE340B - 8B 82 B8000000 - mov eax,[rdx+000000B8]
;SOTTR.exe+5EE3411 - 89 81 B8000000 - mov [rcx+000000B8],eax
;SOTTR.exe+5EE3417 - 8B 82 BC000000 - mov eax,[rdx+000000BC]
;SOTTR.exe+5EE341D - 89 81 BC000000 - mov [rcx+000000BC],eax
;SOTTR.exe+5EE3423 - 0F28 82 C0000000 - movaps xmm0,[rdx+000000C0]
;SOTTR.exe+5EE342A - 66 0F7F 81 C0000000 - movdqa [rcx+000000C0],xmm0
;SOTTR.exe+5EE3432 - 0F28 8A D0000000 - movaps xmm1,[rdx+000000D0]
cmp byte ptr [g_cameraEnabled], 1
jne originalCode
cmp qword ptr rcx, [g_cameraStructAddress]
je exit
originalCode:
movdqa xmmword ptr [rcx+00000080h],xmm0
movaps xmm1, xmmword ptr [rdx+000000A0h]
movaps xmmword ptr [rcx+000000A0h],xmm1
mov eax,[rdx+000000B0h]
mov [rcx+000000B0h],eax
exit:
jmp qword ptr [_cameraWrite1InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraWrite1Interceptor ENDP
END |
oeis/108/A108982.asm | neoneye/loda-programs | 11 | 20438 | <filename>oeis/108/A108982.asm
; A108982: Inverse binomial of A003949.
; 1,6,29,146,729,3646,18229,91146,455729,2278646,11393229,56966146,284830729,1424153646,7120768229,35603841146,178019205729,890096028646,4450480143229,22252400716146,111262003580729,556310017903646,2781550089518229,13907750447591146,69538752237955729,347693761189778646,1738468805948893229,8692344029744466146,43461720148722330729,217308600743611653646,1086543003718058268229,5432715018590291341146,27163575092951456705729,135817875464757283528646,679089377323786417643229,3395446886618932088216146
mov $1,5
pow $1,$0
mul $1,7
sub $1,5
div $1,6
add $1,1
mov $0,$1
|
oeis/000/A000178.asm | neoneye/loda-programs | 11 | 3102 | <filename>oeis/000/A000178.asm
; A000178: Superfactorials: product of first n factorials.
; Submitted by <NAME>
; 1,1,2,12,288,34560,24883200,125411328000,5056584744960000,1834933472251084800000,6658606584104736522240000000,265790267296391946810949632000000000,127313963299399416749559771247411200000000000,792786697595796795607377086400871488552960000000000000,69113789582492712943486800506462734562847413501952000000000000000,90378331112371142262979521568630736335023247731599748366336000000000000000000,1890966832292234727042877370627225068196418587883634153182519380410368000000000000000000000
mov $1,1
mov $2,1
mov $3,1
lpb $0
sub $0,1
add $2,1
mul $3,$1
mul $1,$2
lpe
mov $0,$3
|
oeis/141/A141570.asm | neoneye/loda-programs | 11 | 98100 | ; A141570: Primes of the form 2*3*5*7*n+83.
; Submitted by <NAME>
; 83,293,503,1553,1973,2393,3023,3863,4073,4283,4493,4703,5333,6173,6803,7013,7433,7643,7853,8273,8693,9323,9533,9743,10163,11003,11213,11423,11633,12263,12473,12893,13103,13313,13523,14153,14783,15413,16253,16673,16883,17093,18143,18353,18773,19403,20663,20873,21503,21713,22133,22343,22973,23603,23813,24023,24443,25073,25703,25913,27803,28433,28643,29063,29483,30113,30323,31583,31793,32003,32213,32423,32633,32843,33053,33893,34313,35153,35363,35573,35993,36833,37253,37463,38303,38723,38933,39563
mov $1,36
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
add $1,49
mul $3,2
add $3,10
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,56
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,141
mul $0,2
add $0,83
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_read.asm | jpoikela/z88dk | 640 | 10506 | <filename>libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_read.asm
; uint16_t esx_f_read(unsigned char handle, void *dst, size_t nbytes)
SECTION code_esxdos
PUBLIC esx_f_read
EXTERN asm_esx_f_read
esx_f_read:
pop af
pop bc
pop hl
pop de
push de
push hl
push bc
push af
ld a,e
jp asm_esx_f_read
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _esx_f_read
defc _esx_f_read = esx_f_read
ENDIF
|
programs/oeis/051/A051673.asm | jmorken/loda | 1 | 29219 | <reponame>jmorken/loda<gh_stars>1-10
; A051673: Cubic star numbers: a(n) = n^3 + 4*Sum_{i=0..n-1} i^2.
; 0,1,12,47,120,245,436,707,1072,1545,2140,2871,3752,4797,6020,7435,9056,10897,12972,15295,17880,20741,23892,27347,31120,35225,39676,44487,49672,55245,61220,67611,74432,81697,89420,97615,106296,115477,125172,135395,146160,157481,169372,181847,194920,208605,222916,237867,253472,269745,286700,304351,322712,341797,361620,382195,403536,425657,448572,472295,496840,522221,548452,575547,603520,632385,662156,692847,724472,757045,790580,825091,860592,897097,934620,973175,1012776,1053437,1095172,1137995,1181920,1226961,1273132,1320447,1368920,1418565,1469396,1521427,1574672,1629145,1684860,1741831,1800072,1859597,1920420,1982555,2046016,2110817,2176972,2244495,2313400,2383701,2455412,2528547,2603120,2679145,2756636,2835607,2916072,2998045,3081540,3166571,3253152,3341297,3431020,3522335,3615256,3709797,3805972,3903795,4003280,4104441,4207292,4311847,4418120,4526125,4635876,4747387,4860672,4975745,5092620,5211311,5331832,5454197,5578420,5704515,5832496,5962377,6094172,6227895,6363560,6501181,6640772,6782347,6925920,7071505,7219116,7368767,7520472,7674245,7830100,7988051,8148112,8310297,8474620,8641095,8809736,8980557,9153572,9328795,9506240,9685921,9867852,10052047,10238520,10427285,10618356,10811747,11007472,11205545,11405980,11608791,11813992,12021597,12231620,12444075,12658976,12876337,13096172,13318495,13543320,13770661,14000532,14232947,14467920,14705465,14945596,15188327,15433672,15681645,15932260,16185531,16441472,16700097,16961420,17225455,17492216,17761717,18033972,18308995,18586800,18867401,19150812,19437047,19726120,20018045,20312836,20610507,20911072,21214545,21520940,21830271,22142552,22457797,22776020,23097235,23421456,23748697,24078972,24412295,24748680,25088141,25430692,25776347,26125120,26477025,26832076,27190287,27551672,27916245,28284020,28655011,29029232,29406697,29787420,30171415,30558696,30949277,31343172,31740395,32140960,32544881,32952172,33362847,33776920,34194405,34615316,35039667,35467472,35898745
mov $4,$0
lpb $0
sub $0,1
mov $1,$2
add $3,$4
add $2,$3
add $1,$2
add $4,4
lpe
|
Working Disassembly/General/Sprites/Continue/Map - Player Icons.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 5 | 84907 | Map_5CD00: dc.w word_5CD12-Map_5CD00
dc.w word_5CD20-Map_5CD00
dc.w word_5CD2E-Map_5CD00
dc.w word_5CD36-Map_5CD00
dc.w word_5CD3E-Map_5CD00
dc.w word_5CD46-Map_5CD00
dc.w word_5CD4E-Map_5CD00
dc.w word_5CD56-Map_5CD00
dc.w word_5CD5E-Map_5CD00
word_5CD12: dc.w 2
dc.b $F4, 5, 0, 0, $FF, $F4
dc.b 4, 8, 0, 4, $FF, $F4
word_5CD20: dc.w 2
dc.b $F4, 5, 0, 0, $FF, $F4
dc.b 4, 8, 0, 7, $FF, $F4
word_5CD2E: dc.w 1
dc.b $F4, 6, 0, $A, $FF, $F8
word_5CD36: dc.w 1
dc.b $F4, 6, 0, $10, $FF, $F8
word_5CD3E: dc.w 1
dc.b $FC, 5, 0, $16, $FF, $F2
word_5CD46: dc.w 1
dc.b $FC, 5, 0, $1A, $FF, $F2
word_5CD4E: dc.w 1
dc.b $FC, 5, 0, $1E, $FF, $F2
word_5CD56: dc.w 1
dc.b $F4, 6, 0, $22, $FF, $F8
word_5CD5E: dc.w 1
dc.b $F4, 6, 0, $28, $FF, $F8
|
oeis/127/A127968.asm | neoneye/loda-programs | 11 | 95078 | <reponame>neoneye/loda-programs
; A127968: a(n) = F(n+1) + (1-(-1)^n)/2, where F() = Fibonacci numbers A000045.
; Submitted by <NAME>(s4)
; 1,2,2,4,5,9,13,22,34,56,89,145,233,378,610,988,1597,2585,4181,6766,10946,17712,28657,46369,75025,121394,196418,317812,514229,832041,1346269,2178310,3524578,5702888,9227465,14930353,24157817,39088170,63245986,102334156,165580141,267914297,433494437,701408734,1134903170,1836311904,2971215073,4807526977,7778742049,12586269026,20365011074,32951280100,53316291173,86267571273,139583862445,225851433718,365435296162,591286729880,956722026041,1548008755921,2504730781961,4052739537882,6557470319842
mov $2,1
lpb $0
sub $0,2
add $1,$2
add $2,$1
lpe
add $2,$0
lpb $0
sub $0,1
add $2,$1
lpe
mov $0,$2
|
oeis/138/A138639.asm | neoneye/loda-programs | 11 | 19933 | <filename>oeis/138/A138639.asm
; A138639: Nonnegative integers n such that 19*n-1 is prime.
; Submitted by <NAME>
; 2,6,8,12,20,30,32,36,42,48,56,68,72,78,90,92,96,98,110,116,126,138,140,152,156,158,168,170,176,182,186,188,198,210,212,222,236,242,246,252,272,278,288,296,302,306,308,312,320,330,338,356,368,380,386,396,398,410,422,426,456,470,476,482,498,506,510,516,530,540,552,558,560,566,572,582,588,600,602,608,620,630,632,642,660,662,666,680,686,690,692,702,708,720,728,732,746,750,758,768
mov $1,9
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,27
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,11
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,19
add $0,2
|
release/src-rt-6.x.4708/router/gmp/mpn/mul_1.asm | zaion520/ATtomato | 2 | 88646 | <reponame>zaion520/ATtomato<gh_stars>1-10
../mpn/arm/mul_1.asm |
nerdy-nights/basic/main.asm | ryanplusplus/nes-dev | 0 | 178524 | <reponame>ryanplusplus/nes-dev
.include "header.inc"
.segment "STARTUP"
.segment "CODE"
reset:
sei ; Disable IRQs
cld ; Disable decimal mode
ldx #$40
stx $4017 ; Disable APU frame IRQ
ldx #$ff
txs ; Set up stack
inx ; Now X = 0
stx $2000 ; Disable NMI
stx $2001 ; Disable rendering
stx $4010 ; Disable DMC IRQs
; Wait for vblank to make sure PPU is ready
vblankwait1:
bit $2002
bpl vblankwait1
clrmem:
lda #$00
sta $0000, x
sta $0100, x
sta $0200, x
sta $0300, x
sta $0400, x
sta $0500, x
sta $0600, x
sta $0700, x
lda #$fe
sta $0300, x
inx
bne clrmem
; Wait for second vblank, PPU is ready after this
vblankwait2:
bit $2002
bpl vblankwait2
lda #%10000000 ; Intensify blues
sta $2001
forever:
jmp forever
nmi:
rti
.segment "VECTORS"
.word nmi
.word reset
.word 0 ; IRQ, unused
.segment "CHARS"
|
unix/inet-internal-unix_sockets.ads | annexi-strayline/ASAP-INET | 0 | 21270 | <reponame>annexi-strayline/ASAP-INET
------------------------------------------------------------------------------
-- --
-- Internet Protocol Suite Package --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Streams; use Ada.Streams;
with INET.IP;
limited with INET.TCP;
with Interfaces.C;
with Ada.Finalization;
package INET.Internal.UNIX_Sockets is
type Operation_Status is
(OK,
Not_Ready,
Timedout,
Not_Connected,
Connection_Reset,
Connection_Refused,
Net_Unreachable,
Host_Unreachable,
Unauthorized,
Address_Occupied,
Other_Failure);
type Transport_Protocol is (TCP, UDP);
type UNIX_Socket (Protocol: Transport_Protocol) is limited private;
function Socket_Active (Socket: UNIX_Socket) return Boolean;
-- Returns True if the socket has been allocated and is active.
--
-- For UDP sockets, this always returns True.
procedure TCP_Connect (Socket : in out UNIX_Socket;
Address: in IP.IP_Address;
Port : in INET.TCP.TCP_Port;
Status : out Operation_Status;
Errno : out Interfaces.C.int)
with Pre => Socket.Protocol = TCP;
-- Attempts to connect the Socket to the specified Address and Port. The
-- Socket shall be a new socket and shall not be already connected or
-- listening.
--
-- If the socket is already allocated, it is closed and a new one is
-- allocated. This behaviour is required in order for Address to be either
-- v4 or v6, and follows the capabilities of the higher-level TCP_Connection
-- type.
--
-- Errno can be queried in the case of Other_Failure to build a more
-- informative exception message.
procedure TCP_Bind_Listener (Socket : in out UNIX_Socket;
Address: in IP.IP_Address;
Port : in INET.TCP.TCP_Port;
Backlog: in Positive;
Status : out Operation_Status;
Errno : out Interfaces.C.int)
with Pre => Socket.Protocol = TCP;
-- Attempts to both bind and initiate listening on Socket. The Socket shall
-- be a new socket and shall not already by connected or listening.
--
-- If the socket is already allocated, Program_Error is raised.
--
-- Errno can be queries in the case of Other_Failure to build a more
-- informative exception message. Errno may be set by either the bind or
-- listen process.
procedure TCP_Accept_Connection (Listen_Socket : in UNIX_Socket;
New_Socket : in out UNIX_Socket;
Client_Address: out IP.IP_Address;
Client_Port : out INET.TCP.TCP_Port;
Status : out Operation_Status;
Errno : out Interfaces.C.int)
with Pre => Listen_Socket.Protocol = TCP and Socket_Active (Listen_Socket)
and New_Socket.Protocol = TCP;
-- Blocks indefinately for a connection to arrive on Listen_Socket. This
-- Connection is then set on New_Socket. Client_Address and Client_Port
-- are updated to indicate the address and port of the client at the other
-- end of New_Socket.
--
-- Status will typically be either OK, or Other_Failure, since failures
-- are not normally expected on accept operations
--
-- If New_Socket is already active, it is closed immediately on entry to
-- TCP_Accept_Connection.
type Data_Direction is (Outbound, Inbound, Both);
procedure TCP_Shutdown (Socket : in out UNIX_Socket;
Direction: in Data_Direction)
with Pre => Socket.Protocol = TCP;
-- Invokes the TCP "Shutdown" procedure for the socket in the given
-- direction. If the socket is already shutdown, no action is taken.
procedure TCP_Receive_Immediate (Socket : in out UNIX_Socket;
Buffer : out Stream_Element_Array;
Last : out Stream_Element_Offset;
Status : out Operation_Status;
Errno : out Interfaces.C.int)
with Pre => Socket.Protocol = TCP and Socket_Active (Socket);
-- Receives as much data as is immediately available into Buffer, and
-- indicates the amount of data received with Last.
--
-- All UNIX_Socket objects are non-blocking.
--
-- If Peek is True, the data is left on the operating system's buffer, and
-- will be re-read on the next Receive
--
-- errno is set only if Status is not OK
procedure TCP_Send_Immediate (Socket : in out UNIX_Socket;
Buffer : in Stream_Element_Array;
Last : out Stream_Element_Offset;
Status : out Operation_Status;
Errno : out Interfaces.C.int)
with Pre => Socket.Protocol = TCP and Socket_Active (Socket);
-- Sends as much data as is immediately possible from Buffer, and indicates
-- the amount of data actually sent with Last.
--
-- Status should be checked if Last < Buffer'Last. A status of "OK"
-- indicates the OS has no more space in the outbound buffer.
--
-- errno is set only if Status is not OK
procedure Wait (Socket : in UNIX_Socket;
Direction: in Data_Direction);
procedure Wait (Socket : in UNIX_Socket;
Direction: in Data_Direction;
Timeout : in Duration)
with Pre => Timeout > 0.0;
-- Waits for the socket to be ready for operations in the selected
-- direction. A call to Wait may be interrupted by a signal or error, and
-- should always be followed by TCP_Receive_Immediate or TCP_Send_Immediate.
-- This operation is intended to allow a task to sleep on a socket.
function TCP_Socket_Descriptor (Socket: UNIX_Socket)
return Interfaces.C.int
with Pre => Socket_Active (Socket) and Socket.Protocol = TCP;
procedure UDP_Socket_Descriptors
(Socket : in UNIX_Socket;
IPv4_Descriptor: out Interfaces.C.int;
IPv6_Descriptor: out Interfaces.C.int)
with Pre => Socket_Active (Socket) and Socket.Protocol = UDP;
-- Returns the underlying descriptor number for a Socket. This facility is
-- available for layered protocols such as TLS which need to drive the
-- socket IO directly.
--
-- These descriptors shall be used immediately and not stored elsewhere.
private
use Interfaces.C;
Invalid_Descriptor: constant := -1;
type UNIX_Socket (Protocol: Transport_Protocol) is limited
new Ada.Finalization.Limited_Controlled with
record
case Protocol is
when TCP =>
TCP_Socket : int := Invalid_Descriptor;
when UDP =>
UDP_v4_Socket: int := Invalid_Descriptor;
UDP_v6_Socket: int := Invalid_Descriptor;
end case;
end record;
overriding procedure Initialize (Socket: in out UNIX_Socket);
overriding procedure Finalize (Socket: in out UNIX_Socket);
end INET.Internal.UNIX_Sockets;
|
Task/Higher-order-functions/Ada/higher-order-functions-1.ada | LaudateCorpus1/RosettaCodeData | 1 | 491 | with Ada.Text_Io; use Ada.Text_Io;
procedure Subprogram_As_Argument is
type Proc_Access is access procedure;
procedure Second is
begin
Put_Line("Second Procedure");
end Second;
procedure First(Proc : Proc_Access) is
begin
Proc.all;
end First;
begin
First(Second'Access);
end Subprogram_As_Argument;
|
programs/oeis/189/A189574.asm | karttu/loda | 0 | 240541 | <reponame>karttu/loda<filename>programs/oeis/189/A189574.asm
; A189574: Partial sums of A189572.
; 0,1,1,1,2,2,3,3,4,4,4,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,16,17,17,18,18,18,19,19,20,20,21,21,21,22,22,23,23,23,24,24,25,25,25,26,26,27,27,28,28,28,29,29,30,30,30,31,31,32,32,33,33,33,34,34
mov $3,$0
mov $5,$0
lpb $3,1
mov $0,$5
sub $3,1
sub $0,$3
mov $10,2
mov $12,$0
lpb $10,1
mov $0,$12
sub $10,1
add $0,$10
sub $0,1
mov $2,3
mov $6,$0
mul $6,$0
mov $7,$0
add $7,$0
add $7,1
mov $9,$0
lpb $2,1
lpb $6,1
add $0,2
add $7,2
trn $6,$7
lpe
mov $2,1
lpe
mov $4,$0
mov $11,$9
mul $11,5
add $4,$11
div $4,2
mov $8,$10
lpb $8,1
sub $8,1
mov $13,$4
lpe
lpe
lpb $12,1
mov $12,0
sub $13,$4
lpe
mov $4,$13
sub $4,3
add $1,$4
lpe
|
src/xmlhelpers.adb | bracke/websitegenerator | 1 | 15442 | package body Xmlhelpers is
procedure Add_Node
(Node_Name, Node_Value : String; Parent_Node : DOM.Core.Element;
Feed : Node)
is
Feed_Text : Text;
Feed_Data : DOM.Core.Element;
begin
Feed_Data :=
Append_Child (Parent_Node, Create_Element (Feed, Node_Name));
Feed_Text := Create_Text_Node (Feed, Node_Value);
if Append_Child (Feed_Data, Feed_Text) /= null then
return;
end if;
end Add_Node;
procedure Add_Link
(Parent_Node : DOM.Core.Element; Url, Relationship : String; Feed : Node)
is
Link_Node : DOM.Core.Element;
begin
Link_Node := Append_Child (Parent_Node, Create_Element (Feed, "link"));
Set_Attribute (Link_Node, "rel", Relationship);
Set_Attribute (Link_Node, "href", Url);
end Add_Link;
procedure Add_Generator (Parent_Node : DOM.Core.Element; Feed : Node) is
Generator_Node : DOM.Core.Element;
Feed_Text : Text;
begin
Generator_Node :=
Append_Child (Parent_Node, Create_Element (Feed, "generator"));
Set_Attribute (Generator_Node, "uri", Version.Link);
Set_Attribute (Generator_Node, "version", Version.Current);
Feed_Text := Create_Text_Node (Feed, Version.Name);
if Append_Child (Generator_Node, Feed_Text) /= null then
return;
end if;
end Add_Generator;
procedure Add_Author
(Parent_Node : DOM.Core.Element; Name, Email : String; Feed : Node)
is
Author_Node : DOM.Core.Element;
begin
Author_Node :=
Append_Child (Parent_Node, Create_Element (Feed, "author"));
if Name'Length > 0 then
Add_Node ("name", Name, Author_Node, Feed);
end if;
if Email'Length > 0 then
Add_Node ("email", Email, Author_Node, Feed);
end if;
end Add_Author;
end Xmlhelpers;
|
src/cmd_flags.adb | wiremoons/apass | 3 | 8485 | <reponame>wiremoons/apass<gh_stars>1-10
-------------------------------------------------------------------------------
-- Package : Cmd_Flags --
-- Description : Manage user provided CLI flags for the program. --
-- Author : <NAME> <<EMAIL>> --
-- License : MIT Open Source. --
-------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line;
-- local packages
with Show_Version;
package body Cmd_Flags is
function Command_Line_Flags_Exist return Boolean is
----------------------------------------------
-- Parse and manage and command line flags --
----------------------------------------------
-- GNAT.Command_Line variables and config
Help_Option : aliased Boolean := False;
Version_Option : aliased Boolean := False;
Config : Command_Line_Configuration;
begin
-- define params for the 'help' option
Define_Switch
(Config,
Help_Option'Access,
Switch => "-h",
Long_Switch => "--help",
Help => "Show command line usage for application");
-- define params for the 'version' option
Define_Switch
(Config,
Version_Option'Access,
Switch => "-v",
Long_Switch => "--version",
Help => "Show version details");
-- Additional help message as first line of 'Display_Help()'
Set_Usage
(Config,
Usage => "[switches] [arguments]",
Help => "Program to generate passwords from random three letter words.");
-- cli flags parse using config and above defined switched
Getopt (Config);
-- show program 'version' if requested
if Version_Option then
Show_Version.Show;
return True;
end if;
-- show 'help' if requested
if Help_Option then
New_Line (1);
Display_Help (Config);
return True;
end if;
-- no cli params : so just return
--Try_Help; -- alternative one line response
return False;
exception
when Invalid_Switch =>
New_Line (1);
Put_Line (Standard_Error, "Exception caught: caused by the use of an invalid command line switch.");
New_Line (1);
Display_Help (Config);
return True;
when Invalid_Parameter =>
New_Line (1);
Put_Line
(Standard_Error,
"Exception caught: caused by the use of an invalid parameter to a command line switch.");
New_Line (1);
Display_Help (Config);
return True;
when Exit_From_Command_Line =>
New_Line (1);
Put_Line (Standard_Error, "Exit following display of help message.");
return True;
end Command_Line_Flags_Exist;
end Cmd_Flags;
|
code/6502/invaders/aliens.asm | visrealm/hbc-56 | 65 | 18875 | <gh_stars>10-100
; Troy's HBC-56 - 6502 - Invaders - Aliens
;
; Copyright (c) 2021 <NAME>
;
; This code is licensed under the MIT license
;
; https://github.com/visrealm/hbc-56
;
;
INVADER1_TYPE = INVADER1
INVADER2_TYPE = INVADER2
INVADER3_TYPE = INVADER3
INVADER1_PATT = 128
INVADER2_PATT = 136
INVADER3_PATT = 144
; -----------------------------------------------------------------------------
; Aliens setup
; -----------------------------------------------------------------------------
setupAliens:
; setup alien types
lda #<INVADER1_TYPE
sta INV1_BASE_ADDR_L
lda #>INVADER1_TYPE
sta INV1_BASE_ADDR_H
lda #<INVADER2_TYPE
sta INV2_BASE_ADDR_L
lda #>INVADER2_TYPE
sta INV2_BASE_ADDR_H
lda #<INVADER3_TYPE
sta INV3_BASE_ADDR_L
lda #>INVADER3_TYPE
sta INV3_BASE_ADDR_H
; colors
+tmsSetAddrColorTable 16
ldy #INVADER_OFFSET_COLOR
lda (INV1_BASE_ADDR_L), y
+tmsPut
lda (INV2_BASE_ADDR_L), y
+tmsPut
lda (INV3_BASE_ADDR_L), y
+tmsPut
jsr aliensSetTiles0
rts
; -----------------------------------------------------------------------------
; aliensUpdateTileset: Update patterns for a single alien type
; -----------------------------------------------------------------------------
!macro aliensUpdateAlienTileset .patternIndex, .baseAddress, .offset {
+tmsSetAddrPattTableInd .patternIndex
+tmsSetSourceAddressIndOffset .baseAddress, .offset
+tmsSendBytes 16
}
; -----------------------------------------------------------------------------
; aliensUpdateTileset: Update patterns for all aliens
; -----------------------------------------------------------------------------
!macro aliensUpdateTileset .offset {
+aliensUpdateAlienTileset INVADER1_PATT, INV1_BASE_ADDR_L, .offset
+aliensUpdateAlienTileset INVADER2_PATT, INV2_BASE_ADDR_L, .offset
+aliensUpdateAlienTileset INVADER3_PATT, INV3_BASE_ADDR_L, .offset
}
; -----------------------------------------------------------------------------
; alienColor: Get the color for the given alien type
; -----------------------------------------------------------------------------
; Inputs:
; A: tile index
; Outputs:
; A: color
; -----------------------------------------------------------------------------
alien1Color:
lda (INV1_BASE_ADDR_L), y
+lsr4
rts
alien2Color:
lda (INV2_BASE_ADDR_L), y
+lsr4
rts
alien3Color:
lda (INV3_BASE_ADDR_L), y
+lsr4
rts
alienColor:
ldy #INVADER_OFFSET_COLOR
cmp #INVADER2_PATT
bcc alien1Color
cmp #INVADER3_PATT
bcc alien2Color
jmp alien3Color
; -----------------------------------------------------------------------------
; Alien tileset 0: Base offset
; -----------------------------------------------------------------------------
aliensSetTiles0:
+aliensUpdateTileset 0
lda #0
sta INVADER_PIXEL_OFFSET
rts
; -----------------------------------------------------------------------------
; Alien tileset 1: 2px offset
; -----------------------------------------------------------------------------
aliensSetTiles1:
+aliensUpdateTileset INVADER_OFFSET_2
lda #2
sta INVADER_PIXEL_OFFSET
rts
; -----------------------------------------------------------------------------
; Alien tileset 2: 4px offset
; -----------------------------------------------------------------------------
aliensSetTiles2:
+aliensUpdateTileset INVADER_OFFSET_4
lda #4
sta INVADER_PIXEL_OFFSET
rts
; -----------------------------------------------------------------------------
; Alien tileset 3: 6px offset
; -----------------------------------------------------------------------------
aliensSetTiles3:
+aliensUpdateTileset INVADER_OFFSET_6
lda #6
sta INVADER_PIXEL_OFFSET
rts
|
programs/oeis/130/A130123.asm | neoneye/loda | 22 | 24650 | <reponame>neoneye/loda
; A130123: Infinite lower triangular matrix with 2^k in the right diagonal and the rest zeros. Triangle, T(n,k), n zeros followed by the term 2^k. Triangle by columns, (2^k, 0, 0, 0, ...).
; 1,0,2,0,0,4,0,0,0,8,0,0,0,0,16,0,0,0,0,0,32,0,0,0,0,0,0,64,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,256,0,0,0,0,0,0,0,0,0,512,0,0,0,0,0,0,0,0,0,0,1024,0,0,0,0,0,0,0,0,0,0,0,2048,0,0,0,0,0,0,0,0,0,0,0,0,4096,0,0,0,0,0,0,0,0,0
mov $7,$0
mov $8,2
lpb $8
sub $8,1
add $0,$8
sub $0,1
mov $2,1
add $2,$0
mov $4,0
mov $5,$2
mov $6,2
lpb $5
mul $4,2
add $4,1
trn $5,$6
add $6,1
lpe
mov $3,$8
lpb $3
mov $1,$4
sub $3,1
lpe
lpe
lpb $7
sub $1,$4
mov $7,0
lpe
mov $0,$1
|
SrcAll/V1_Functions.asm | mytechnotalent/c64-assembly | 2 | 12957 | <reponame>mytechnotalent/c64-assembly
ifdef BuildC64
include "..\SrcC64\V1_Functions.asm"
endif
ifdef BuildVIC
include "..\SrcVIC\V1_Functions.asm"
endif
ifdef BuildBBC
include "..\SrcBBC\V1_Functions.asm"
endif
ifdef BuildAP2
include "..\SrcAP2\V1_Functions.asm"
endif
ifdef BuildLNX
include "..\SrcLNX\V1_Functions.asm"
endif
ifdef BuildPCE
include "..\SrcPCE\V1_Functions.asm"
endif
ifdef BuildNES
include "..\SrcNES\V1_Functions.asm"
endif
ifdef BuildSNS
include "..\SrcSNS\V1_Functions.asm"
endif
ifdef BuildA52
include "\SrcA52\V1_Functions.asm"
endif
ifdef BuildA80
include "\SrcA52\V1_Functions.asm"
endif |
alloy4fun_models/trashltl/models/9/n4hfxuyJ9sRLD3epg.als | Kaixi26/org.alloytools.alloy | 0 | 869 | open main
pred idn4hfxuyJ9sRLD3epg_prop10 {
always Protected in Protected'
}
pred __repair { idn4hfxuyJ9sRLD3epg_prop10 }
check __repair { idn4hfxuyJ9sRLD3epg_prop10 <=> prop10o } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.