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
|
---|---|---|---|---|
system/hideApplication.applescript | adriannier/applescript-functions | 7 | 3556 | (*
Hides the application defined by the name provided as the parameter.
*)
hideApplication("Finder")
hideApplication("VMware Fusion")
on hideApplication(appName)
(* Hides the application defined by the name provided as the parameter. *)
tell application "System Events"
if (exists process appName) is false then
-- Find out the application's process name,
-- If there's no process that has the same name as the application.
set foundProcess to false
-- Go through the displayed name, title and short name properties
try
-- Is there a process with the displayed name set to the app name?
set foundProcess to first process whose displayed name is appName
on error
try
-- Is there a process with the title set to the app name?
set foundProcess to first process whose title is appName
on error
try
-- Is there a process with the short name set to the app name?
set foundProcess to first process whose short name is appName
end try
end try
end try
if foundProcess is not false then
-- Matching process name found; use it instead of the application name
set appName to name of foundProcess
end if
end if
-- Hide the process
set visible of process appName to false
end tell
end hideApplicationByName |
programs/oeis/022/A022313.asm | jmorken/loda | 1 | 5501 | <reponame>jmorken/loda
; A022313: a(n) = a(n-1) + a(n-2) + 1, with a(0) = 0 and a(1) = 8.
; 0,8,9,18,28,47,76,124,201,326,528,855,1384,2240,3625,5866,9492,15359,24852,40212,65065,105278,170344,275623,445968,721592,1167561,1889154,3056716,4945871,8002588,12948460,20951049,33899510,54850560,88750071,143600632,232350704,375951337,608302042,984253380,1592555423,2576808804,4169364228,6746173033,10915537262,17661710296,28577247559,46238957856,74816205416,121055163273,195871368690,316926531964,512797900655,829724432620,1342522333276,2172246765897,3514769099174,5687015865072,9201784964247,14888800829320,24090585793568,38979386622889,63069972416458,102049359039348,165119331455807,267168690495156,432288021950964,699456712446121,1131744734397086,1831201446843208,2962946181240295,4794147628083504,7757093809323800
mov $1,4
mov $3,36
lpb $0
sub $0,1
mov $2,$1
mov $1,$3
add $3,$2
lpe
sub $1,4
div $1,4
|
libsrc/genmath/dcompar.asm | dex4er/deb-z88dk | 1 | 83398 | ;
; Z88dk Generic Floating Point Math Library
;
; common routine for double precision comparisons
;
; $Id: dcompar.asm,v 1.2 2007/10/12 14:49:16 stefano Exp $:
XLIB dcompar
LIB compare
.dcompar
POP HL ;save 1st return addr
POP AF ;save 2nd return addr
POP DE ;get number to compare
POP IX
POP BC
PUSH AF ;replace 2nd addr
PUSH HL ;replace 1st addr, fall into...
jp compare
|
thirdparty/ffmpeg/libavcodec/x86/vorbisdsp.asm | yashrajsingh1998/ApraPipes1 | 2,151 | 20826 | <gh_stars>1000+
;******************************************************************************
;* Vorbis x86 optimizations
;* Copyright (C) 2006 <NAME> <<EMAIL>>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg 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
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
pdw_80000000: times 4 dd 0x80000000
SECTION .text
%if ARCH_X86_32
INIT_MMX 3dnow
cglobal vorbis_inverse_coupling, 3, 3, 6, mag, ang, block_size
pxor m7, m7
lea magq, [magq+block_sizeq*4]
lea angq, [angq+block_sizeq*4]
neg block_sizeq
.loop:
mova m0, [magq+block_sizeq*4]
mova m1, [angq+block_sizeq*4]
mova m2, m0
mova m3, m1
pfcmpge m2, m7 ; m <= 0.0
pfcmpge m3, m7 ; a <= 0.0
pslld m2, 31 ; keep only the sign bit
pxor m1, m2
mova m4, m3
pand m3, m1
pandn m4, m1
pfadd m3, m0 ; a = m + ((a < 0) & (a ^ sign(m)))
pfsub m0, m4 ; m = m + ((a > 0) & (a ^ sign(m)))
mova [angq+block_sizeq*4], m3
mova [magq+block_sizeq*4], m0
add block_sizeq, 2
jl .loop
femms
RET
%endif
INIT_XMM sse
cglobal vorbis_inverse_coupling, 3, 3, 6, mag, ang, block_size
mova m5, [pdw_80000000]
shl block_sized, 2
add magq, block_sizeq
add angq, block_sizeq
neg block_sizeq
align 16
.loop:
mova m0, [magq+block_sizeq]
mova m1, [angq+block_sizeq]
xorps m2, m2
xorps m3, m3
cmpleps m2, m0 ; m <= 0.0
cmpleps m3, m1 ; a <= 0.0
andps m2, m5 ; keep only the sign bit
xorps m1, m2
mova m4, m3
andps m3, m1
andnps m4, m1
addps m3, m0 ; a = m + ((a < 0) & (a ^ sign(m)))
subps m0, m4 ; m = m + ((a > 0) & (a ^ sign(m)))
mova [angq+block_sizeq], m3
mova [magq+block_sizeq], m0
add block_sizeq, mmsize
jl .loop
RET
|
awa/plugins/awa-questions/regtests/awa-questions-modules-tests.adb | fuzzysloth/ada-awa | 0 | 10695 | -----------------------------------------------------------------------
-- awa-questions-modules-tests -- Unit tests for storage service
-- Copyright (C) 2013, 2014 <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.Strings.Unbounded;
with Util.Test_Caller;
with Util.Beans.Basic;
with Util.Beans.Objects;
with Security.Contexts;
with ASF.Contexts.Faces;
with ASF.Contexts.Faces.Mockup;
with AWA.Permissions;
with AWA.Services.Contexts;
with AWA.Questions.Modules;
with AWA.Questions.Beans;
with AWA.Votes.Beans;
with AWA.Tests.Helpers.Users;
package body AWA.Questions.Modules.Tests is
use Util.Tests;
use ADO;
package Caller is new Util.Test_Caller (Test, "Questions.Services");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test AWA.Questions.Services.Save_Question",
Test_Create_Question'Access);
Caller.Add_Test (Suite, "Test AWA.Questions.Services.Delete_Question",
Test_Delete_Question'Access);
Caller.Add_Test (Suite, "Test AWA.Questions.Queries question-list",
Test_List_Questions'Access);
Caller.Add_Test (Suite, "Test AWA.Questions.Beans questionVote bean",
Test_Question_Vote'Access);
Caller.Add_Test (Suite, "Test AWA.Questions.Beans questionVote bean (anonymous user)",
Test_Question_Vote'Access);
end Add_Tests;
-- ------------------------------
-- Test creation of a question.
-- ------------------------------
procedure Test_Create_Question (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
Q : AWA.Questions.Models.Question_Ref;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "<EMAIL>");
T.Manager := AWA.Questions.Modules.Get_Question_Module;
T.Assert (T.Manager /= null, "There is no question manager");
Q.Set_Title ("How can I append strings in Ada?");
Q.Set_Description ("I have two strings that I want to concatenate. + does not work.");
T.Manager.Save_Question (Q);
T.Assert (Q.Is_Inserted, "The new question was not inserted");
Q.Set_Description ("I have two strings that I want to concatenate. + does not work. "
& "I also tried '.' without success. What should I do?");
T.Manager.Save_Question (Q);
Q.Set_Description ("I have two strings that I want to concatenate. + does not work. "
& "I also tried '.' without success. What should I do? "
& "This is a stupid question for someone who reads this file. "
& "But I need some long text for the unit test.");
T.Manager.Save_Question (Q);
end Test_Create_Question;
-- ------------------------------
-- Test deletion of a question.
-- ------------------------------
procedure Test_Delete_Question (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
Q : AWA.Questions.Models.Question_Ref;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "<EMAIL>");
T.Manager := AWA.Questions.Modules.Get_Question_Module;
T.Assert (T.Manager /= null, "There is no question manager");
Q.Set_Title ("How can I search strings in Ada?");
Q.Set_Description ("I have two strings that I want to search. % does not work.");
T.Manager.Save_Question (Q);
T.Assert (Q.Is_Inserted, "The new question was not inserted");
T.Manager.Delete_Question (Q);
end Test_Delete_Question;
-- ------------------------------
-- Test list of questions.
-- ------------------------------
procedure Test_List_Questions (T : in out Test) is
use AWA.Questions.Models;
use AWA.Questions.Beans;
use type Util.Beans.Basic.Readonly_Bean_Access;
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
Module : AWA.Questions.Modules.Question_Module_Access;
List : Util.Beans.Basic.Readonly_Bean_Access;
Bean : Util.Beans.Objects.Object;
Count : Natural;
begin
AWA.Tests.Helpers.Users.Anonymous (Context, Sec_Ctx);
Module := AWA.Questions.Modules.Get_Question_Module;
List := AWA.Questions.Beans.Create_Question_List_Bean (Module);
T.Assert (List /= null, "The Create_Question_List_Bean returned null");
Bean := Util.Beans.Objects.To_Object (List);
T.Assert (not Util.Beans.Objects.Is_Null (Bean), "The list bean should not be null");
T.Assert (List.all in Questions.Beans.Question_List_Bean'Class,
"The Create_Question_List_Bean returns an invalid bean");
Count := Questions.Beans.Question_List_Bean'Class (List.all).Questions.Get_Count;
T.Assert (Count > 0, "The list of question is empty");
end Test_List_Questions;
-- ------------------------------
-- Do a vote on a question through the question vote bean.
-- ------------------------------
procedure Do_Vote (T : in out Test) is
use type Util.Beans.Basic.Readonly_Bean_Access;
Context : ASF.Contexts.Faces.Mockup.Mockup_Faces_Context;
Outcome : Ada.Strings.Unbounded.Unbounded_String;
Bean : Util.Beans.Basic.Readonly_Bean_Access;
Vote : AWA.Votes.Beans.Vote_Bean_Access;
begin
Context.Set_Parameter ("id", "1");
Bean := Context.Get_Bean ("questionVote");
T.Assert (Bean /= null, "The questionVote bean was not created");
T.Assert (Bean.all in AWA.Votes.Beans.Vote_Bean'Class,
"The questionVote is not a Vote_Bean");
Vote := AWA.Votes.Beans.Vote_Bean (Bean.all)'Access;
Vote.Rating := 1;
Vote.Entity_Id := 1;
Vote.Vote_Up (Outcome);
end Do_Vote;
-- ------------------------------
-- Test anonymous user voting for a question.
-- ------------------------------
procedure Test_Question_Vote_Anonymous (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
begin
AWA.Tests.Helpers.Users.Anonymous (Context, Sec_Ctx);
Do_Vote (T);
T.Fail ("Anonymous users should not be allowed to vote");
exception
when AWA.Permissions.NO_PERMISSION =>
null;
end Test_Question_Vote_Anonymous;
-- ------------------------------
-- Test voting for a question.
-- ------------------------------
procedure Test_Question_Vote (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "<EMAIL>");
Do_Vote (T);
end Test_Question_Vote;
end AWA.Questions.Modules.Tests;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1117.asm | ljhsiun2/medusa | 9 | 22908 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xd95c, %rbx
nop
mfence
movl $0x61626364, (%rbx)
nop
nop
nop
nop
nop
sub $24508, %r8
lea addresses_WT_ht+0x1d859, %rax
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
and $0xffffffffffffffc0, %rax
vmovaps %ymm0, (%rax)
nop
nop
nop
and $25317, %rcx
lea addresses_WC_ht+0x116dd, %r8
nop
nop
nop
nop
add $33746, %r12
mov $0x6162636465666768, %rcx
movq %rcx, (%r8)
nop
nop
nop
xor $48630, %r11
lea addresses_D_ht+0xaa59, %rdi
nop
sub %rcx, %rcx
movb $0x61, (%rdi)
nop
xor $2624, %rcx
lea addresses_WT_ht+0xc659, %rsi
lea addresses_normal_ht+0x1df19, %rdi
nop
nop
nop
nop
nop
inc %r11
mov $49, %rcx
rep movsw
nop
cmp $48050, %rax
lea addresses_WT_ht+0x11659, %rsi
lea addresses_WC_ht+0xb7f1, %rdi
nop
nop
sub $33872, %rbx
mov $56, %rcx
rep movsl
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x1d289, %rcx
clflush (%rcx)
nop
xor $38909, %rax
movl $0x61626364, (%rcx)
and %rcx, %rcx
lea addresses_WT_ht+0x5bd9, %rbx
nop
nop
xor %r8, %r8
mov (%rbx), %r11d
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0x1dc59, %rax
nop
nop
nop
sub %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm6
and $0xffffffffffffffc0, %rax
movntdq %xmm6, (%rax)
nop
nop
nop
nop
add $62571, %rbx
lea addresses_WT_ht+0x160c1, %rsi
lea addresses_UC_ht+0xb0d9, %rdi
nop
nop
nop
nop
nop
add $44836, %r11
mov $66, %rcx
rep movsq
nop
nop
nop
nop
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rcx
push %rdx
// Load
lea addresses_RW+0x1e439, %rdx
nop
nop
nop
nop
cmp %r11, %r11
mov (%rdx), %rcx
nop
nop
nop
nop
and %rcx, %rcx
// Store
lea addresses_WC+0xe8d1, %r15
nop
nop
nop
add $39705, %r13
mov $0x5152535455565758, %rcx
movq %rcx, (%r15)
nop
nop
nop
nop
cmp $9451, %rcx
// Store
lea addresses_RW+0x1d6c9, %r11
nop
nop
nop
add %r13, %r13
movw $0x5152, (%r11)
nop
nop
nop
nop
nop
sub $37607, %rdx
// Faulty Load
lea addresses_RW+0x15859, %r10
and %rcx, %rcx
movups (%r10), %xmm1
vpextrq $0, %xmm1, %r15
lea oracles, %rcx
and $0xff, %r15
shlq $12, %r15
mov (%rcx,%r15,1), %r15
pop %rdx
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 5, 'NT': True, 'type': 'addresses_RW', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WC', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
alloy4fun_models/trainstlt/models/4/BjkkhKRzgfzF8Dotj.als | Kaixi26/org.alloytools.alloy | 0 | 2072 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idBjkkhKRzgfzF8Dotj_prop5 {
always(
all t:Train {
some (t.pos & Exit) => no t.pos'
some (t.pos & (Track-Exit)) => some tk2: (t.pos).prox { t.pos' = tk2 }
}
)
}
pred __repair { idBjkkhKRzgfzF8Dotj_prop5 }
check __repair { idBjkkhKRzgfzF8Dotj_prop5 <=> prop5o } |
snapgear_linux/lib/libgmp/mpn/x86/diveby3.asm | impedimentToProgress/UCI-BlueChip | 0 | 80769 | <reponame>impedimentToProgress/UCI-BlueChip
# x86 mpn_divexact_by3 -- mpn division by 3, expecting no remainder.
#
# cycles/limb
# P5 17.0
# P6 13.5
# K7 10.0
# Copyright (C) 2000 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
# The GNU MP Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# The GNU MP Library 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 Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the GNU MP Library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
include(`../config.m4')
# mp_limb_t mpn_divexact_by3 (mp_ptr dst, mp_srcptr src, mp_size_t size);
#
# Divide src,size by 3 and store the quotient in dst,size. If src,size
# isn't exactly divisible by 3 the result in dst,size won't be very useful.
# The return value is 0 if src,size was divisible by 3, or non-zero if not.
defframe(PARAM_SIZE,12)
defframe(PARAM_SRC, 8)
defframe(PARAM_DST, 4)
deflit(`FRAME',0)
dnl multiplicative inverse of 3, modulo 2^32
deflit(INVERSE_3, 0xAAAAAAAB)
dnl ceil(b/3) and ceil(b*2/3) where b=2^32
deflit(ONE_THIRD_CEIL, 0x55555556)
deflit(TWO_THIRDS_CEIL, 0xAAAAAAAB)
.text
ALIGN(8)
PROLOGUE(mpn_divexact_by3)
movl PARAM_SRC, %ecx
pushl %ebp
FRAME_pushl()
movl PARAM_SIZE, %ebp
pushl %edi
FRAME_pushl()
movl PARAM_DST, %edi
pushl %esi
FRAME_pushl()
movl $INVERSE_3, %esi
pushl %ebx
FRAME_pushl()
leal (%ecx,%ebp,4), %ecx
xorl %ebx, %ebx
leal (%edi,%ebp,4), %edi
negl %ebp
ALIGN(8)
L(top):
# eax scratch, low product
# ebx carry limb (0 to 3)
# ecx &src[size]
# edx scratch, high product
# esi multiplier
# edi &dst[size]
# ebp counter, limbs, negative
movl (%ecx,%ebp,4), %eax
subl %ebx, %eax
setc %bl
mull %esi
cmpl $ONE_THIRD_CEIL, %eax
movl %eax, (%edi,%ebp,4)
sbbl $-1, %ebx # +1 if eax>=ceil(b/3)
cmpl $TWO_THIRDS_CEIL, %eax
sbbl $-1, %ebx # +1 if eax>=ceil(b*2/3)
incl %ebp
jnz L(top)
movl %ebx, %eax
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
EPILOGUE()
|
source/labs/lab3/delay_code.asm | MarsUniversity/ECE382 | 0 | 90761 |
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
.text ; Assemble into program memory
.retain ; Override ELF conditional linking
; and retain current section
.retainrefs ; Additionally retain any sections
; that have references to current
; section
; need to declare our subroutine functions so C can access them
.global Delay160ms
.global Delay40ms
;-------------------------------------------------------------------------------
; Name: Delay40ms - updated for 8MHz clock
; Inputs: none
; Outputs: none
; Purpose: this is a 40ms delay.
; Registers: r7 preserved
;-------------------------------------------------------------------------------
Delay40ms:
push r7
mov #0xD154, r7 ;should be ~20ms, based on 8MHz clock - plenty of room for error
delay:
dec r7
jnz delay
mov #0xD154, r7 ;should be ~20ms, based on 8MHz clock - plenty of room for error
delay2:
dec r7
jnz delay2
pop r7
ret
;-------------------------------------------------------------------------------
; Name: Delay160ms - updated for 8 MHz clock
; Inputs: none
; Outputs: none
; Purpose: creates ~160ms delay
; Registers: r7 preserved
;-------------------------------------------------------------------------------
Delay160ms:
push r7
call #Delay40ms
call #Delay40ms
call #Delay40ms
call #Delay40ms
pop r7
ret
|
models/hol/sygus/hackers_del/hd_14.als | johnwickerson/alloystar | 2 | 4735 | <reponame>johnwickerson/alloystar
/**
* NOTE: make sure to set "Options -> Prevent overflows" to "No"
*
* floor of average of two integers
*/
module hd_14
open hdXY[hd14]
one sig Lit1 extends IntLit {}
fact {
IntLit<:val = Lit1->1
}
--------------------------------------------------------------------------------
-- Helpers
--------------------------------------------------------------------------------
fun hd14[x, y: Int]: Int {
bvadd[bvand[x, y],
bvshr[bvxor[x, y], 1]]
}
--------------------------------------------------------------------------------
-- Commands
--------------------------------------------------------------------------------
-- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-14-d0-prog.sl)
run synthIntNodeI for 0 but 5 Int, 5 IntVarVal,
exactly 1 BvXor, exactly 1 BvShr, exactly 1 BvAnd, exactly 1 BvAdd
-- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-14-d1-prog.sl)
run synthIntNodeI for 0 but 4 Int, 4 IntVarVal,
exactly 1 BvAdd, exactly 1 BvSub, exactly 1 BvNot, exactly 1 BvNeg, exactly 1 BvAnd, exactly 1 BvOr, exactly 1 BvXor, exactly 1 BvShr, exactly 1 BvSha
-- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/hackers_del/hd-14-d5-prog.sl)
run synthIntNodeI for 0 but 4 Int, 4 IntVarVal,
exactly 3 BinaryIntOp, exactly 2 UnaryIntOp
|
source/asis/spec/ada-strings-maps.ads | faelys/gela-asis | 4 | 19566 | ------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of ada.ads file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
package Ada.Strings.Maps is
pragma Pure (Maps);
-- Representation for a set of character values:
type Character_Set is private;
pragma Preelaborable_Initialization (Character_Set);
Null_Set : constant Character_Set;
type Character_Range is
record
Low : Character;
High : Character;
end record;
-- Represents Character range Low..High
type Character_Ranges is
array (Positive range <>) of Character_Range;
function To_Set
(Ranges : in Character_Ranges) return Character_Set;
function To_Set (Span : in Character_Range) return Character_Set;
function To_Ranges
(Set : in Character_Set) return Character_Ranges;
function "=" (Left, Right : in Character_Set) return Boolean;
function "not" (Right : in Character_Set) return Character_Set;
function "and" (Left, Right : in Character_Set) return Character_Set;
function "or" (Left, Right : in Character_Set) return Character_Set;
function "xor" (Left, Right : in Character_Set) return Character_Set;
function "-" (Left, Right : in Character_Set) return Character_Set;
function Is_In (Element : in Character;
Set : in Character_Set)
return Boolean;
function Is_Subset (Elements : in Character_Set;
Set : in Character_Set)
return Boolean;
function "<=" (Left : in Character_Set;
Right : in Character_Set)
return Boolean renames Is_Subset;
-- Alternative representation for a set of character values:
subtype Character_Sequence is String;
function To_Set
(Sequence : in Character_Sequence)return Character_Set;
function To_Set (Singleton : in Character) return Character_Set;
function To_Sequence
(Set : in Character_Set) return Character_Sequence;
-- Representation for a character to character mapping:
type Character_Mapping is private;
pragma Preelaborable_Initialization (Character_Mapping);
function Value (Map : in Character_Mapping;
Element : in Character)
return Character;
Identity : constant Character_Mapping;
function To_Mapping (From, To : in Character_Sequence)
return Character_Mapping;
function To_Domain (Map : in Character_Mapping)
return Character_Sequence;
function To_Range (Map : in Character_Mapping)
return Character_Sequence;
type Character_Mapping_Function is
access function (From : in Character) return Character;
private
pragma Import (Ada, Character_Set);
pragma Import (Ada, Null_Set);
pragma Import (Ada, Character_Mapping);
pragma Import (Ada, Identity);
end Ada.Strings.Maps;
|
libsrc/target/kaypro83/xorpixl.asm | jpoikela/z88dk | 640 | 173901 | ;
; Kaypro ('83 versions) pseudo graphics routines
; Version for the standard text symbols
;
; <NAME> 2018
;
;
; Xor pixel at (x,y) coordinate.
;
;
;
SECTION code_clib
PUBLIC xorpixel
EXTERN plot_end
EXTERN plot_decode
EXTERN GRAPHICS_CHAR_SET
EXTERN GRAPHICS_CHAR_UNSET
EXTERN __kayproii_gfxmode
EXTERN generic_console_printc
EXTERN generic_console_vpeek
EXTERN CONSOLE_ROWS
EXTERN CONSOLE_COLUMNS
.xorpixel
ld a,h
cp CONSOLE_COLUMNS
ret nc
ld a,(__kayproii_gfxmode)
and a
jr z,xor_one
; Plotting with funny characters
ld a,l
cp CONSOLE_ROWS * 2
ret nc
push bc
call plot_decode
jr c,odd
xor 1
jr even
.odd
xor 2
.even
jp plot_end
xor_one:
ld a,l
cp CONSOLE_ROWS
ret nc
push bc ;save entry bc
ld c,h
ld b,l
ld e,1
call generic_console_vpeek
ld b,GRAPHICS_CHAR_SET
cp GRAPHICS_CHAR_UNSET
jr z,xor_done
ld b,GRAPHICS_CHAR_UNSET
xor_done:
ld (hl),b
pop bc
ret
|
Library/Kernel/Graphics/graphicsRaster.asm | steakknife/pcgeos | 504 | 20508 | <filename>Library/Kernel/Graphics/graphicsRaster.asm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: KernelGraphics
FILE: Graphics/graphicsRaster.asm
AUTHOR: <NAME>
ROUTINES:
Name Description
---- -----------
GLB GrBitBlt Transfer a bit-boundary block of pixels
between two locations in video memory.
EXT BltCommon where the real work of Blting gets done
INT ScaleScalarSimple Scale a pair of scalar quantities, assuming
no rotation
INT CalcDestRegion Calc clipped dest region for blts
INT CalcInvalRegion Calculate a new invalid region and update
it in window struct (Also clean up a few
things from blt)
INT CopyRegToWindow Copy a region into one of the LMem blocks
in the window structure.
INT GrFillBitmapAtCP Treat a monochrome bitmap as a mask,
filling it with the current area color.
INT GrFillBitmap Treat a monochrome bitmap as a mask,
filling it with the current area color.
GLB GrDrawBitmapAtCP Draw a bitmap
GLB GrDrawBitmap Draw a bitmap
INT BMCheckAllocation This function is called by the Bitmap
drawing functions to determine if we can
use the bitmap as is, or if we have to
allocate another buffer to do scaling,
format conversion or decompaction.
INT InitBitmapPalette The bitmap has a palette stored with it.
Deal with setting up a buffer to make the
translation painless.
INT BMCallBack Supply next line of bitmap to video driver
INT BMTrivialReject Do a trivial reject test for the bitmap
routine. Also translates the origin to
device coordinates.
INT CalcLineSize Calculate the line width (bytes) for a scan
line of a bitmap
REVISION HISTORY:
Name Date Description
---- ---- -----------
jad 11/88 initial version
jad 1/89 updated
jad 4/89 implemented first pass at true BitBlt
jad 6/89 started adding support for rotated bitmaps
jad 8/89 Started breaking out parts to KLib, added documentation
jad 8/89 Added GrCreateBitmap and GrDestroyBitmap
DESCRIPTION:
This file contains the application interface for all raster graphics
output. Most of the routines here call the currently selected
screen driver to do most of the work, and deal with coordinate
translation and restricting access to the driver at this level.
$Id: graphicsRaster.asm,v 1.1 97/04/05 01:13:04 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrWinBlt segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrBitBlt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Transfer a bit-boundary block of pixels between two locations
in video memory.
CALLED BY: GLOBAL
PASS: ax - x document coordinate (source)
bx - y document coordinate (source)
cx - x document coordinate (destination)
dx - y document coordinate (destination)
si - width of block (document units)
di - handle of graphics state
pushed on the stack (in this order):
(word) height of block (document units)
(word) control flags:
enum: BLTM_COPY to leave source alone
BLTM_CLEAR to clear source rect
BLTM_MOVE to clear and inval source rect
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
translate from document coordinates to screen coordinates;
calculate the effective destination (see below);
call driver to transfer block;
add part-not-copied to invalid region;
if (flags set to invalidate source rect)
invalidate source rect;
To make this blt function useful, it has to do the appropriate
region manipulations and send redraw events to the window
if the entire region is not copied. The effective destination
consists of the source rectangle ANDed with the current clip
region, shifted to the destination rectangle, and ANDed again
with the current clip region. (see CalcDestRegion)
After the copy takes place, we need to send a redraw event to
the window. We do this by adding part of the window to the
current invalid region, which signals the window manager to
send the redraw message.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 11/88... Initial version
Jim 3/89 Changed to support transformation matrix
Jim 4/89 Changed to calculate proper clip regions and
sending of redraw events.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrBitBlt proc far
ON_STACK retf
call EnterGraphics
ON_STACK di es ds si ax bx cx dx bp retf retf
xchgdw axbx, cxdx
call SetDocPenPos
xchgdw axbx, cxdx
jc exitBltGSeg ; don't deal with gstrings well
; check for NULL window. That's bad too
tst ds:[GS_window] ; if no window, bail
jz exitBltGSeg
test es:[W_grFlags], mask WGF_MASK_NULL ; see if null mask
jnz exitBltG
; translate the coordinates and sizes into device coords
call GrTransCoord2Far ; translate coordinates
jc exitBltG ; overflow
xchg si, ax ; get width
mov bp, sp ; look at stack
test es:[W_curTMatrix].TM_flags, TM_COMPLEX
jz haveHeightWidth
push bx, si ; save y pos
ON_STACK si bx di es ds si ax bx cx dx bp retf retf
mov bx, [bp].EG_param2 ; get height
mov si, W_curTMatrix
call ScaleScalarSimple ; translate height
mov [bp].EG_param2, bx
pop bx, si
ON_STACK di es ds si ax bx cx dx bp retf retf
; call the common routine, reinstate params passed on stack
haveHeightWidth:
xchg si, ax ; restore regs
push [bp].EG_param2 ; pass height
push [bp].EG_param1 ; pass flags
ON_STACK ax ax di es ds si ax bx cx dx bp retf retf
call BltCommon
; copy all of ExitGraphics here, since we need to pop arguments
; that were passed on the stack
ON_STACK di es ds si ax bx cx dx bp retf retf
exitBltG label near
LoadVarSeg ds
; check to see if we need to release a bitmap
tst es:[W_bitmap].segment ; check VM file handle
jnz releaseBitmap
; now release the window
releaseWin:
mov bx,es:[W_header.LMBH_handle] ;release window
call MemUnlockV ; unlock/disown window
exitBltGSeg label near
ON_STACK di es ds si ax bx cx dx bp retf retf
LoadVarSeg ds
pop bx ;recover di passed
ON_STACK es ds si ax bx cx dx bp retf retf
mov di, bx
call MemUnlock ; unlock gstate
pop dx, cx, bx, ax, si, ds, es
pop bp
add sp, 4 ; skip the retf from EnterGraphics to us
ret 4 ; and return to our caller, biffing the args
; we're bltting on a vidmem device -- don't ask me why.
; release the locked bitmap
releaseBitmap:
push ds
mov ds, es:[W_bmSegment]
mov es:[W_bmSegment], 0
call HugeArrayUnlockDir
pop ds
EC < push bx, di >
EC < mov bx, es:[W_bitmap].segment >
EC < mov di, es:[W_bitmap].offset >
EC < call ECCheckHugeArrayFar >
EC < pop bx, di >
jmp releaseWin
GrBitBlt endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BltCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: where the real work of Blting gets done
CALLED BY: EXTERNAL
GrBitBlt, WinBitBlt
PASS: es - segment of window where blt takes place
ax - source x position (device coords)
bx - source y position (device coords)
cx - dest x position (device coords)
dx - dest y position (device coords)
si - width of source (device units)
pushed on stack (in this order):
- (word) height of blt (device units)
- (word) flags for blt:
enum: BLTM_COPY - leave source alone
BLTM_CLEAR - clear source rect
BLTM_MOVE - clear/inval src rect
RETURN: es - new window segment (may have changed)
DESTROYED: ax,bx,cx,dx,si,di
PSEUDO CODE/STRATEGY:
see BltBlt, above
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 04/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BC_local struct
BC_rReg RectRegion <> ; rectangle region
BC_width word ; width of blt
BC_local ends
finishBlt label near
jmp doneBlt
BltCommon proc near bltFlags:word, bltHeight:word
BCframe local BC_local
; before we do anything, nuke any save unders in the window
push ax,bx,cx,dx
mov ax, es:[W_winRect].R_left ; get coords of window
mov bx, es:[W_winRect].R_top
mov cx, es:[W_winRect].R_right
mov dx, es:[W_winRect].R_bottom
mov di, DR_VID_COLLIDE_UNDER
call es:[W_driverStrategy]
pop ax,bx,cx,dx
; if transformation matrix has rotation components,
; then use a different routine
EC < test es:[W_TMatrix].TM_flags, TM_ROTATED >
EC < ERROR_NZ GRAPHICS_NO_ROTATED_BIT_BLT_SUPPORT >
; establish addresssing for parameters and local space
.enter
mov BCframe.BC_width, si ; save width
tst si ; check for zero
jz finishBlt ; just bail
tst bltHeight ; check for zero
jz finishBlt ; just bail
EC < call Check4CoordsFar ; check bounds >
EC < push ax,bx,cx,dx >
EC < add ax, BCframe.BC_width ; check right >
EC < add bx, bltHeight ; check bottom >
EC < add cx, BCframe.BC_width ; check right >
EC < add dx, bltHeight ; check bottom >
EC < call Check4CoordsFar >
EC < pop ax,bx,cx,dx >
; create rect region for source
push ax, bx ; save source pos
dec bx ; scan line above first
mov BCframe.BC_rReg.RR_y1M1, bx ; store y1-1
add bx, bltHeight ; calc bottom coord
mov BCframe.BC_rReg.RR_y2, bx
mov BCframe.BC_rReg.RR_x1, ax
add ax, BCframe.BC_width ; calc x2
dec ax
mov BCframe.BC_rReg.RR_x2, ax
mov ax, EOREGREC
mov BCframe.BC_rReg.RR_eo1, ax ; end of first record
mov BCframe.BC_rReg.RR_eo2, ax ; end of second record
mov BCframe.BC_rReg.RR_eo3, ax ; end of region
pop ax, bx ; save source pos
; set up pointer to rect region and calc new dest clip reg
lea si, BCframe.BC_rReg
segmov ds, ss ; ds:si -> rect region
sub cx, ax ; cx = x shift amount
sub dx, bx ; dx = y shift amt
call CalcDestRegion ; set up destination
push cx, dx ; save shift amounts
add cx, ax ; restore dest pos
add dx, bx
; do trivial reject test only need to check destination
; in x and y
push cx, dx ; save coordinates
cmp cx, es:[W_maskRect].R_right
jg BC_noBlt ; reject: after right
add cx, BCframe.BC_width
dec cx
cmp cx, es:[W_maskRect].R_left
jl BC_noBlt ; reject: before left
cmp dx, es:[W_maskRect].R_bottom
jg BC_noBlt ; reject: below bottom
add dx, bltHeight
dec dx
cmp dx, es:[W_maskRect].R_top
jl BC_noBlt ; reject: above top
pop cx, dx
; call the video driver to transfer the bits
push bp ; save frame pointer
mov si, BCframe.BC_width ; restore width
mov bp, bltHeight ; restore height
mov di, DR_VID_MOVBITS
call es:[W_driverStrategy] ; make call to driver
pop bp ; restore frame pointer
; reset the clip region back to normal and set up new inval reg
BC_cInval:
pop cx, dx ; restore shift amounts
lea si, BCframe.BC_rReg
segmov ds, ss ; ds:si -> rect region
mov bx, bltFlags ; pass copy/move flag
call CalcInvalRegion ; calc new inval reg
doneBlt label near
.leave
ret 4 ; kill things passed
;----------------------------------------------------------------------------
; dest is outside window, so don't blt it.
BC_noBlt:
pop cx, dx ; restore stack
jmp BC_cInval ; and just calc new
BltCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ScaleScalarSimple
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Scale a pair of scalar quantities, assuming no rotation
CALLED BY: INTERNAL
PASS: ax, bx - pair of x/y quantities to scale
es:si - pointer to TMatrix to use
RETURN: ax - rounded, scaled x quatity
bx - rounded, scaled y quantity
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
just multiply ax by the TM_11 component of the matrix
and multiply bx by the TM_22 component of the matrix
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 07/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ScaleScalarSimple proc near
uses cx, dx
.enter
push bx ; save height
mov bx, ax
clr ax
mov cx, es:[si].TM_11.WWF_frac ; get fraction
mov dx, es:[si].TM_11.WWF_int ; get integer
call GrRegMul32 ; dx.cx = new width
pop bx ; restore height
add ch, 80h
adc dx, 0
push dx ; save new width
clr ax
mov cx, es:[si].TM_22.WWF_frac ; get fraction
mov dx, es:[si].TM_22.WWF_int ; get integer
call GrRegMul32 ; dx.cx = new height
mov bx, dx ; bx = new height
add ch, 80h
adc bx, 0
pop ax ; ax = new width
.leave
ret
ScaleScalarSimple endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalcDestRegion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calc clipped dest region for blts
CALLED BY: INTERNAL
BltCommon
PASS: cx - shift amount, x
dx - shift amount, y
ds:si - pointer to source region
es - locked window segment
RETURN: es - window segment (may have changed)
ds - window segment
es:W_maskReg - resulting mask for blt operation
es:W_temp2Reg - former maskReg
DESTROYED: di
es:W_temp1Reg
PSEUDO CODE/STRATEGY:
What we need to do here is calculate the effective
destination region for the blt.
First, we start with a source region. This region may be
non-rectangular if there is rotation applied to the window,
so just assume (worst case) that is an arbitrary shape. This
source region represents the bits that we are trying to move
by some offset (passed here in cx and dx) to another part of
the screen. Call this other part the destination region (i.e.
the one we're trying to calculate).
Part of the source may be obscured. To get the effective
part of the source region, we AND with the current mask
region (maskReg = visReg AND clipReg AND updateReg AND
NOT (invalReg)). Then we shift the result by the passed
offsets. Then we AND again with maskReg to get the final
effective destination region.
copy region to window struct; ; temp2 = source
AND with mask region; ; temp1 = src ^ mask
SHIFT to destination coordinate; ; shift temp1
AND again with mask region ; temp2 = temp1 ^ mask
STORE as the new mask region ; mask = temp2
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 04/89 Initial version
jim 8/89 Rewritten to use maskReg instead of visReg
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDestRegion proc near
; allocate local space to store shift amounts
push bp
mov bp, sp
sub sp, 4
mov [bp-4], cx ; save x shift
mov [bp-2], dx ; save y shift
push ax, bx ; save regs
; copy region to window
mov di, es:[W_temp2Reg] ; temp2 = source reg
call CopyRegToWindow
segmov ds, es ; set ds -> window
; AND source region with mask region
mov si, ds:[W_temp2Reg] ; *ds:si -> src reg
mov bx, ds:[W_maskReg] ; *es:bx -> visible reg
mov di, ds:[W_temp1Reg] ; *es:di -> result reg
call FarWinANDReg ; temp1=src AND vis
segmov ds, es ; update ds
; test for any inval region, need to deal with it if so
mov si, ds:[W_invalReg] ; get handle
mov di, ds:[si] ; get pointer
cmp {word} ds:[di], EOREGREC ; any invalReg ?
jne CDR_someInval ; yes, deal with it
; check to see if resulting source is out of bounds
CDR_chkSource:
mov si, ds:[W_temp1Reg] ; get handle
mov di, ds:[si] ; get pointer
cmp {word} ds:[di], EOREGREC ; see if source reg NULL
jne CDR_shift ; no, continue
mov si, ds:[W_temp1Reg] ; yes, swap handles
mov di, ds:[W_temp2Reg]
mov ds:[W_temp1Reg], di
mov ds:[W_temp2Reg], si
jmp CDR_setMask ; and set flags
; shift the resulting region to destination location
CDR_shift:
mov cx, [bp-4] ; restore shift amounts
mov dx, [bp-2]
mov si, ds:[W_temp1Reg] ; region to shift
mov si, ds:[si] ; get offset to region
call GrMoveReg ; move the region
; AND with maskReg again
mov si, ds:[W_maskReg] ; *ds:si -> partial res
mov bx, ds:[W_temp1Reg] ; *es:bx -> vis reg
mov di, ds:[W_temp2Reg] ; *es:di -> result reg
call FarWinANDReg ; temp1=partial result
segmov ds, es ; update ds
; swap handles so that mask region is final one
CDR_setMask:
mov si, ds:[W_temp2Reg]
mov di, ds:[W_maskReg]
mov ds:[W_temp2Reg], di
mov ds:[W_maskReg], si
; set up resulting region as clip region
call SetupMaskFlags ; set new opt flags
; all done, restore regs and exit
mov cx, [bp-4] ; restore shift amounts
mov dx, [bp-2]
pop ax, bx ; restore regs
mov sp, bp ; restore stack ptr
pop bp ; restore base pointer
ret
;---------- some non-NULL invalid region, deal with it
; need to subtract out the inval region. So AND it with
; NOT(inval).
CDR_someInval:
mov si, ds:[W_invalReg] ; need NOT(inval)
mov di, ds:[W_temp2Reg] ; store it here
call FarWinNOTReg ; temp2=NOT(inval)
segmov ds, es ; restore ds
; swap some handles. We will end up trashing inval,
; but we can reconstruct it from NOT(inval) later.
mov si, ds:[W_invalReg] ; swap handles
mov di, ds:[W_temp2Reg] ;
mov ds:[W_temp2Reg], si ; temp2 = inval
mov ds:[W_invalReg], di ; inval = NOT(inval)
; now do the AND. NOT(inval) is now in inval.
mov si, ds:[W_temp1Reg] ; get (src & mask)
mov bx, ds:[W_invalReg] ; ~inval
mov di, ds:[W_temp2Reg] ;
call FarWinANDReg ; temp2=temp1 & ~(inval)
segmov ds, es ;
; swap some handles. We need to have the result in temp1
; to hook up with the rest of the routine.
mov si, ds:[W_temp1Reg] ; swap handles
mov di, ds:[W_temp2Reg] ;
mov bx, ds:[W_invalReg] ;
mov ds:[W_temp2Reg], bx ; temp2 = ~inval
mov ds:[W_temp1Reg], di ; temp1=src&mask&~inval
mov ds:[W_invalReg], si ; inval = garbage
; reconstruct the inval region again. we have ~inval in temp2
mov si, ds:[W_temp2Reg] ; get ~inval
mov di, ds:[W_invalReg] ; store it back here
call FarWinNOTReg ; inval = inval
segmov ds, es ;
jmp CDR_chkSource
CalcDestRegion endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalcInvalRegion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate a new invalid region and update it in window struct
(Also clean up a few things from blt)
CALLED BY: INTERNAL
BltCommon
PASS: bx - flag indicates whether to inval/clear source
region (see BitBlt header, above)
cx, dx - x,y offsets between source and dest regions
ds:si - source region
es - window segment
es:maskReg - effective destination from blt
es:temp2Reg - old mask region (left over from CalcDestReg)
RETURN: es - new window segment
DESTROYED: ax,bx,cx,dx,si,di,ds
PSEUDO CODE/STRATEGY:
if (bit set to invalidate source)
invalReg += (source v full dest) ^ old maskReg ^
~(effective dest)
else if (bit set to clear source)
clear the following region instead of adding it to inval:
invalReg += (source v full dest) ^ old maskReg ^
~(effective dest)
else
invalReg += full desk ^ old maskReg ^ ~(effective dest)
make sure W_grFlags set right;
Basically, we form the partial product
old mask AND NOT (effective destination)
in maskReg. This is used as a base to and with either the
full destination or the full dest ORed with the source.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
It is unfortunate, but we end up losing the old mask reg, due
to lack of region chunks. Things could be optimized if
we had another temporary chunk for region calcs. (Avoid
the eventual recalc of the maskReg)
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 04/89 Initial version
jim 8/89 fixed to use leftover results from CalcDestReg
also added support for BLTM_CLEAR mode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CIR_local struct
CIR_flag word ; move/copy flags
CIR_shiftX word ; amount to shift source, x
CIR_shiftY word ; amount to shift source, y
CIR_srcOff word ; source region offset
CIR_srcSeg word ; source region segment
CIR_local ends
CIR_loc equ [bp-size CIR_local]
CalcInvalRegion proc near
; allocate some space for local scratch and save few things
push bp
mov bp, sp
sub sp, size CIR_local
mov CIR_loc.CIR_flag, bx ; save move/copy flags
mov CIR_loc.CIR_srcOff, si ; save source pointer
mov si, ds
mov CIR_loc.CIR_srcSeg, si ; save source segment
mov CIR_loc.CIR_shiftX, cx ; save offset
mov CIR_loc.CIR_shiftY, dx
segmov ds, es ; save overrides
; we're messing with the mask region, so invalidate it
and ds:[W_grFlags], not mask WGF_MASK_VALID
; calc NOT (effective destination)
mov si, ds:[W_maskReg] ; calc NOT effect dest
mov di, ds:[W_temp1Reg] ; put in temp1
call FarWinNOTReg ; temp1 = NOT eff dest
segmov ds, es ; restore ds
; and with old mask region
mov si, ds:[W_temp2Reg] ; old mask reg
mov bx, ds:[W_temp1Reg] ; not(eff dest)
mov di, ds:[W_maskReg] ; mask ^ ~(eff dest)
call FarWinANDReg ;
; at this point:
; W_temp1Reg = NOT(effective destination)
; W_temp2Reg = old mask region
; W_maskReg = old mask AND NOT (effective dest)
; copy and shift the passed region to destination location
mov si, CIR_loc.CIR_srcSeg ; get source reg segment
mov ds, si
mov si, CIR_loc.CIR_srcOff ; get offset too
mov di, es:[W_temp2Reg] ; temp1 = target reg
call CopyRegToWindow
segmov ds, es ; restore ds->window
; shift the resulting region to destination location
mov cx, CIR_loc.CIR_shiftX ; restore shift amounts
mov dx, CIR_loc.CIR_shiftY
mov si, ds:[W_temp2Reg] ; region to shift
mov si, ds:[si] ; get offset to region
call GrMoveReg ; move the region
; now and with current content of maskReg, almost done w/1st pt
mov si, ds:[W_maskReg] ; first source
mov bx, ds:[W_temp2Reg] ; full dest
mov di, ds:[W_temp1Reg] ; put it here
call FarWinANDReg ;
segmov ds, es ; restore ds
; now just add to inval region, done with dest
mov si, ds:[W_temp1Reg] ; don't add if not null
mov si, ds:[si]
cmp {word} ds:[si], EOREGREC ; NULL ?
je CIR_check ; yes, skip work
call WinAddToInvalReg ; add result to inval
segmov es, ds ; restore es
; check to see if invalidating source, if so, handle it
CIR_check:
cmp byte ptr CIR_loc.CIR_flag, BLTM_COPY ; just a copy ?
jne CIR_invalSource ; no, handle move/inval
; all finished, cleanup and leave
CIR_done:
mov sp, bp ; restore stack pointer
pop bp ; restore frame pointer
ret
;------------------------
; include source in inval reg.
CIR_invalSource:
; copy the passed region to destination location
mov si, CIR_loc.CIR_srcSeg ; get source reg segment
mov ds, si
mov si, CIR_loc.CIR_srcOff ; get offset too
mov di, es:[W_temp2Reg] ; temp1 = target reg
call CopyRegToWindow
segmov ds, es ; restore ds->window
; AND directly with previous result
mov si, ds:[W_maskReg] ; maskReg = partial res
mov bx, ds:[W_temp2Reg] ; temp1 = target reg
mov di, ds:[W_temp1Reg]
call FarWinANDReg
segmov ds, es ; restore ds->window
; if resulting region is null, all done
mov si, ds:[W_temp1Reg] ; don't add if not null
mov si, ds:[si]
cmp {word} ds:[si], EOREGREC ; NULL ?
je CIR_done ; yes, skip work
; check for clear or inval...
cmp byte ptr CIR_loc.CIR_flag, BLTM_MOVE ; inval ?
jne CIR_clear ; no, just clear it
call WinAddToInvalReg ; yes, add to inval
segmov es, ds ; restore es
jmp CIR_done
; just clear the region, use window function
CIR_clear:
mov si, ds:[W_temp1Reg] ; swap region temp
mov di, ds:[W_invalReg]
mov ds:[W_invalReg], si
mov ds:[W_temp1Reg], di
call WinWashOut
mov si, ds:[W_temp1Reg] ; swap 'em back
mov di, ds:[W_invalReg]
mov ds:[W_invalReg], si
mov ds:[W_temp1Reg], di
jmp CIR_done
CalcInvalRegion endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CopyRegToWindow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy a region into one of the LMem blocks in the window
structure.
CALLED BY: INTERNAL
CalcDestRegion, CalcInvalRegion
PASS: ds:si - far pointer to region
es:di - far ptr to LMem handle of chunk to copy to
RETURN: es - new segment address of LMem heap
region copied to (resized) LMem chunk
DESTROYED: ax,bx,cx,dx,si,di
PSEUDO CODE/STRATEGY:
determine the size of the region to be copied;
resize the LMem chunk to that size;
copy the bytes;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 08/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CopyRegToWindow proc near
push si ; save pointer to reg
call GrGetPtrRegBounds ; sets si past end
mov cx, si ; save end ptr
pop si ; restore ptr to reg
sub cx, si ; cx = size of region
; resize target chunk
mov ax, es ; swap segments
mov bx, ds
mov ds, ax
mov es, bx
mov ax, di ; copy c-handle to ax
call LMemReAlloc ; make space for reg
mov ax, es ; swap segments
mov bx, ds
mov ds, ax
mov es, bx
mov di, es:[di] ; get ptr to new space
sar cx, 1 ; #bytes -> #words
rep movsw ; copy region over
ret
CopyRegToWindow endp
GrWinBlt ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrFillBitmap GrFillBitmapAtCP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Treat a monochrome bitmap as a mask, filling it with the
current area color.
CALLED BY: GLOBAL
PASS: ax - x value of coordinate (dest, only GrDrawBitmap)
bx - y value of coordinate (dest, only GrDrawBitmap)
ds:si - pointer to bitmap
dx:cx - vfptr to callBack routine
(dx must be 0 if no callBack routine supplied)
di - handle of graphics state
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
join in with normal bitmap drawing code asap
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrFillBitmapAtCP proc far
if 0 ;FULL_EXECUTE_IN_PLACE
EC< push bx >
EC< mov bx, ds >
EC< call ECAssertValidFarPointerXIP >
EC< pop bx >
endif
call EnterGraphics
call GetDocPenPos
jnc maskBitmapCommon
; handle writing to a gstring
mov al, GR_FILL_BITMAP_CP ; set opcode
jmp bmcpGSCommon
GrFillBitmapAtCP endp
GrFillBitmap proc far
BMframe local BitmapFrame
if 0 ;FULL_EXECUTE_IN_PLACE
EC< push bx >
EC< mov bx, ds >
EC< call ECAssertValidFarPointerXIP >
EC< pop bx >
endif
call EnterGraphics ; returns with ds->gState
call SetDocPenPos
jnc maskBitmapCommon
; handle writing to a gstring
mov bp, [bp].EG_ds ; retreive bitmap seg pointer
push cx, dx ; save callback address
mov dx, bx ; write out coordinate and opcode
mov bx, ax ; put x position in bx
mov al, GR_FILL_BITMAP
jz GSCommon ; if GString, jump
mov al, GR_DRAW_RECT ; if path, draw a rectangle
GSCommon:
mov cl, size Point ; write 4 bytes at first
mov ch, GSSC_DONT_FLUSH
call GSStoreBytes ; write em out
pop cx, dx ; restore callback address
jmp writeBitmapData
maskBitmapCommon label near
; make sure there is no evil window lurking
call TrivialReject ; won't return if rejected
; set up a local stack frame to save some stuff away
mov di, ss:[bp].EG_ds ; save old bp (bm segment)
.enter ; allocate stack frame
if FULL_EXECUTE_IN_PLACE and ERROR_CHECK
push ds
mov ds, di
test ds:[si].B_type, mask BMT_COMPLEX
pop ds
jz continue
tst dx
jz continue
push bx, si
movdw bxsi, dxcx
call ECAssertValidFarPointerXIP
pop bx, si
continue:
endif
mov BMframe.BF_cbFunc.segment, dx ; save ptr to callback
mov BMframe.BF_cbFunc.offset, cx ;
mov BMframe.BF_origBM.segment, di ; save ptr to bitmap
mov BMframe.BF_origBM.offset, si
mov BMframe.BF_finalBM.segment, di ; save ptr to bitmap
mov BMframe.BF_finalBM.offset, si
clr cx
mov BMframe.BF_finalBMsliceSize, cx ; init # bytes/scanline
mov BMframe.BF_getSliceDSize, cx ; init callback flag
mov BMframe.BF_args.PBA_flags, cx
mov BMframe.BF_imageFlags, cl
mov BMframe.BF_stateFlags, cx ; init state flags
mov BMframe.BF_opType, mask BMOT_FILL_MASK
jmp bitmapTrivialReject
.leave .UNREACHED
GrFillBitmap endp
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrDrawBitmap, GrDrawBitmapAtCP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a bitmap
CALLED BY: GLOBAL
PASS: ax - x value of coordinate (dest, only GrDrawBitmap)
bx - y value of coordinate (dest, only GrDrawBitmap)
ds:si - pointer to bitmap
dx:cx - pointer to callBack routine
(dx must be 0 if no callBack routine supplied)
(vfptr on XIP systems)
di - handle of graphics state
RETURN: ds:si - if a callback routine is supplied, ds:si is set
to the value supplied in the last call to the
callback function.
Otherwise it will be the same as the passed ds:si.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Do trivial reject on whole bitmap;
Set up kernel callback routine if complex;
call common routine to draw bitmap;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
The supplied callback routine is given a pointer to the
passed bitmap in ds:si and is expected to return ds:si
pointing at the next slice. It is also expected to set
the carry if the bitmap is completed.
CallBack routine:
passed: ds:si - points at bitmap (for the
first call to the callback
routine, this is the same
pointer as was passed to
GrDrawBitmap, on subsequent
calls, the pointer is the
same as the callback supplied
the last go-around).
returns: ds:si - should point at new slice,
which can be totally different
carry - set if bitmap is completely
drawn (i.e. no more slices),
else clear
also, it should not trash *any* other registers
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 1/89... Initial version
Jim 3/89 Changed to support transformation matrix
Jim 6/89 Broke up routine to handle complex bitmaps
more easily.
Jim 1/90 Added scaling support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
GrDrawBitmapAtCP proc far
if 0 ;FULL_EXECUTE_IN_PLACE
EC< push bx >
EC< mov bx, ds >
EC< call ECAssertValidFarPointerXIP >
EC< pop bx >
endif
call EnterGraphics
call GetDocPenPos
jnc drawBitmapCommon
; handle writing to a gstring
mov al, GR_DRAW_BITMAP_CP ; set opcode
bmcpGSCommon label near
jz cpGSCommon ; if GString, jump
mov al, GR_DRAW_RECT_TO ; if path, draw a rectangle
cpGSCommon:
mov bp, ss:[bp].EG_ds ; retreive bitmap seg pointer
mov bx, cx ; save register
clr cl ; no data bytes yet
mov ch, GSSC_DONT_FLUSH
call GSStoreBytes ; just write opcode
mov cx, bx ; restore reg
jmp writeBitmapData ; join up with code below
GrDrawBitmapAtCP endp
GrDrawBitmap proc far
BMframe local BitmapFrame
if FULL_EXECUTE_IN_PLACE
EC< push bx >
EC< mov bx, ds >
EC< call ECAssertValidFarPointerXIP >
EC< pop bx >
endif
call EnterGraphics ; returns with ds->gState
call SetDocPenPos
jnc drawBitmapCommon
; write the bitmap to the GString
mov bp, [bp].EG_ds ; retreive bitmap seg pointer
push cx, dx ; save callback address
mov dx, bx ; write out coordinate and opcode
mov bx, ax ; put x position in bx
mov al, GR_DRAW_BITMAP
jz GSCommon ; if GString, jump
mov al, GR_DRAW_RECT ; if path, draw a rectangle
GSCommon:
mov cl, size Point ; write 4 bytes at first
mov ch, GSSC_DONT_FLUSH
call GSStoreBytes ; write em out
pop cx, dx ; restore callback address
; now write out bitmap data (including header)
writeBitmapData label near
call BitmapToString ; copy bitmap to graphics string
jmp ExitGraphicsGseg
; update pen position
drawBitmapCommon label near
; make sure there is no evil window lurking
call TrivialReject ; won't return if rejected
; set up a local stack frame to save some stuff away
mov di, ss:[bp].EG_ds ; save old bp (bm segment)
.enter ; allocate stack frame
if FULL_EXECUTE_IN_PLACE and ERROR_CHECK
push ds
mov ds, di
test ds:[si].B_type, mask BMT_COMPLEX
pop ds
jz continue
tst dx
jz continue
push bx, si
movdw bxsi, dxcx
call ECAssertValidFarPointerXIP
pop bx, si
continue:
endif
mov BMframe.BF_cbFunc.segment, dx ; save ptr to callback
mov BMframe.BF_cbFunc.offset, cx ;
mov BMframe.BF_origBM.segment, di ; save ptr to bitmap
mov BMframe.BF_origBM.offset, si
mov BMframe.BF_finalBM.segment, di ; save ptr to bitmap
mov BMframe.BF_finalBM.offset, si
clr cx
mov BMframe.BF_finalBMsliceSize, cx ; init # bytes/scanline
mov BMframe.BF_getSliceDSize, cx ; init callback flag
mov BMframe.BF_args.PBA_flags, cx
mov BMframe.BF_opType, cl ; init function pointer
mov BMframe.BF_imageFlags, cl ; not doing image thing
mov BMframe.BF_stateFlags, cx ; init state flags
; check if bitmap is visible at all. save device coordinates
bitmapTrivialReject label near
stc ; check entire bitmap
push ax, bx
call BMTrivialReject ; returns carry set if rejected
pop ax, bx
jnc setDrawPoint ; visible, so continue
endShort:
jmp bitmapEnd
; store the starting position (& error in that position)
; for the bitmap (assumes document coord for bitmap origin
; is in (ax, bx))
setDrawPoint:
call BitmapSetDrawPoint ; window coords -> (ax, bx)
jc endShort
; get the format of the video buffer (bits/pixel)
mov cx, ds ; save GState seg
mov di, DR_VID_INFO ; get ptr to info table
call es:[W_driverStrategy] ; driver knows where
mov ds, dx ; set ds:si -> table
mov dl, ds:[si].VDI_bmFormat ; bitmap format supp
and dl, mask BMT_FORMAT ; only interested in bits/pix
mov BMframe.BF_deviceType, dl ; and save it
; check if we need to allocate a supplementary buffer
mov ds, BMframe.BF_finalBM.segment ; get ptr to bitmap
mov si, BMframe.BF_finalBM.offset ; and offset
if (DISPLAY_CMYK_BITMAPS eq FALSE)
EC < mov dl, ds:[si].B_type ; get color format >
EC < and dl, mask BMT_FORMAT >
EC < cmp dl, BMF_4CMYK ; don't do this >
EC < ERROR_AE GRAPHICS_CMYK_BITMAPS_NOT_SUPPORTED >
endif
; check to see if we need to allocate another block
call BMCheckAllocation ; more work to do ?
jc alloc ; yep, do it.
; nothing complicated about this bitmap. just draw it.
; if it's a complex one, we need a loop to do each piece.
; first, copy the header.
mov dx, cx ; save gstate segment in dx
mov BMframe.BF_args.PBA_data.segment, ds
mov BMframe.BF_args.PBA_data.offset, si
mov cx, ds:[si].B_width ; copy over right pieces
mov BMframe.BF_args.PBA_bm.B_width, cx
mov ax, {word} ds:[si].B_compact
and ah, not mask BMT_COMPLEX ; don't set this for driver
mov {word} BMframe.BF_args.PBA_bm.B_compact, ax
xchg al, ah ; al = B_type
call CalcLineSize ; ax = line size
mov BMframe.BF_args.PBA_size, ax
; if there is a palette stored with the bitmap, then pass
; that information to the video driver
mov cl, ds:[si].B_type ; grab type information
test cl, mask BMT_PALETTE ; see if there is one there
jnz handlePalette
; if we're filling the bitmap with the current area color,
; then set the complex bit in the PutBitsArgs, which will
; signal to the video driver that we want that...
test BMframe.BF_opType, mask BMOT_FILL_MASK
jz checkComplex
setFillFlag:
or BMframe.BF_args.PBA_flags, mask PBF_FILL_MASK
checkComplex:
test cl, mask BMT_COMPLEX ; more than 1 piece ?
jnz handleComplex
add BMframe.BF_args.PBA_data.offset, size Bitmap
mov cx, ds:[si].B_height ; store height
mov BMframe.BF_args.PBA_bm.B_height, cx
mov ds, dx ; restore gState seg
mov di,DR_VID_PUTBITS ; use putbits
mov ax, BMframe.BF_drawPoint.P_x
mov bx, BMframe.BF_drawPoint.P_y
call es:[W_driverStrategy] ; make call to driver
; all done drawing the bitmap. If we allocated some space
; to store a palette, then release the block
bitmapEnd:
test BMframe.BF_args.PBA_flags, mask PBF_ALLOC_PALETTE
jz palFreed
mov bx, {word} BMframe.BF_palette ; get handle
call MemFree ; release block
palFreed:
movdw axbx, BMframe.BF_origBM ; get (maybe updated) ptr
.leave ; restore stack
mov ss:[bp].EG_ds, ax ; setup return values
mov ss:[bp].EG_si, bx
jmp ExitGraphics ; all done, go home
;-------------------------------------------------------------------------
; need to alloc some space, use different routine. This will
; end up drawing the whole thing.
alloc:
call DrawSlice ; alloc and draw
jmp bitmapEnd
; there is a palette stored with the bitmap. Handle it.
; unless we are filling the bitmap. Then skip it.
handlePalette:
test BMframe.BF_opType, mask BMOT_FILL_MASK
jnz setFillFlag
call InitBitmapPalette
jmp checkComplex
; the bitmap may be in more than one piece. Draw one piece
; at a time.
handleComplex:
mov BMframe.BF_origBMtype, cl
mov cx, ds:[si].CB_numScans ; get hight of this piece
jcxz afterVideoCall ; allow slice to have no data
mov BMframe.BF_args.PBA_bm.B_height, cx
mov cx, ds:[si].CB_data ; get data pointer
add BMframe.BF_args.PBA_data.offset, cx
complexLoop:
mov ax, BMframe.BF_drawPoint.P_x ; reload x position
mov di,DR_VID_PUTBITS ; use putbits
mov ds, dx
push dx ; save gstate segment
call es:[W_driverStrategy] ; make call to driver
doCallBack:
call BMCallBack ; get next slice
pop dx ; restore gstate seg
jc bitmapEnd
mov bx, ds:[si].CB_startScan ; get first scan line
add bx, BMframe.BF_drawPoint.P_y ; new y position
jmp complexLoop
afterVideoCall:
push dx
jmp doCallBack
GrDrawBitmap endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BitmapSetDrawPoint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the drawing point for the Bitmap, and also calculates
any error in that position so that we can scale appropriately
CALLED BY: INTERNAL
PASS: inherits BitmapFrame
es - Window segment
(ax,bx) - Document coordinate of bitmap origin
RETURN: (ax,bx) - Window coordinate of bitmap origin
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Sets BF_drawPoint, BF_drawPointErrorX, BF_drawPointErrorY
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 7/17/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BitmapSetDrawPoint proc far
BMframe local BitmapFrame
uses cx, dx, si, ds
.enter inherit
; First transform the coordinate pair to device coordinates
segmov ds, es, si
mov si, offset W_curTMatrix
mov_tr dx, ax
clr ax, cx
call TransCoordFixed
jc done ; if error, abort
; Round the results, and record the device coordinate and
; the error in that position (positive error means we
; rounded down, negative error indicates we rounded up).
; Due to the beauty of WWFixed notation, a value greater
; than or equal to 8000h causes us to round, and that
; value is also negative (when viewed as a signed number).
; Also, we include the "rounding" of the eventual bitmap
; dimension now to avoid later rounding problems (imagine
; relying upon the carry value after something like
; fractional width + error X position + 8000h).
rndwwf dxcx ; rounded X position -> dx
rndwwf bxax ; rounded Y position -> bx
add cx, 8000h ; include rounding
add ax, 8000h ; include rounding
; Store the results
mov BMframe.BF_drawPointErrorX, cx
mov BMframe.BF_drawPointErrorY, ax
mov_tr ax, dx
mov BMframe.BF_drawPoint.P_x, ax
mov BMframe.BF_drawPoint.P_y, bx
clc
done:
.leave
ret
BitmapSetDrawPoint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BMCheckAllocation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This function is called by the Bitmap drawing functions to
determine if we can use the bitmap as is, or if we have to
allocate another buffer to do scaling, format conversion or
decompaction.
CALLED BY: INTERNAL
GrDrawBitmap, GrDrawHugeBitmap
PASS: ds:si - points to bitmap header
es - locked window
RETURN: carry - set if we need to allocate a block
DESTROYED: dl
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 1/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BMCheckAllocation proc far
BMframe local BitmapFrame
.enter inherit
; if there is any compaction, we need to alloc a block
cmp ds:[si].B_compact, BMC_UNCOMPACTED ; alloc if compacted
jnz allocateBlock
; allocate if scaled or rotated (which probably means we have
; to scale the puppy)
test es:[W_curTMatrix].TM_flags, TM_COMPLEX
jnz allocateBlock
mov dl, ds:[si].B_type ; get color format
test dl, mask BMT_COMPLEX ; check for resolution if any
jz checkFormat ; not complex, check format
; if complex, we might have a bitmap whose resolution is not
; 72 DPI. Check and treat like a scale if that is the case.
cmp ds:[si].CB_xres, DEF_BITMAP_RES ; normal width ?
jne allocateBlock ; no, go the long way
cmp ds:[si].CB_yres, DEF_BITMAP_RES ; same check in height
jne allocateBlock
checkFormat:
and dl, mask BMT_FORMAT ; isolate format
cmp dl, BMF_MONO ; if mono, ok
je done ; skip if mono (carry clr)
if (DISPLAY_CMYK_BITMAPS eq TRUE)
cmp dl, BMF_4CMYK
jae done
endif
cmp {byte} BMframe.BF_deviceType, dl ; need to translate
jb allocateBlock ; color ?
clc
done:
.leave
ret
; something is complicated. Alloc away.
allocateBlock:
stc
jmp done
BMCheckAllocation endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitBitmapPalette
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The bitmap has a palette stored with it. Deal with
setting up a buffer to make the translation painless.
CALLED BY: INTERNAL
GrDrawBitmap, DrawSlice
PASS: ds:si - pointer to Bitmap header
cl - B_type for bitmap
BMframe on stack
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 3/16/92 Initial version
Don 2/08/94 Optimized, fixed 256->16 color mapping
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitBitmapPalette proc far
uses cx, bx, ax, es, di, si, dx
BMframe local BitmapFrame
.enter inherit
EC < cmp BMframe.BF_deviceType, BMFormat >
EC < ERROR_AE GRAPHICS_BITMAP_INTERNAL_ERROR >
mov di, si
add di, ds:[si].CB_palette ; get pointer to palette
cmp {word} ds:[di], 0 ; if zero entries, bad palette
je badPalette
mov dx, es ; save window
or BMframe.BF_args.PBA_flags, mask PBF_ALLOC_PALETTE
mov ax, 256 ; assume 256 1-byte entries
cmp BMframe.BF_deviceType, BMF_24BIT ; see if we need RGBs
jb haveSize
mov ax, 256*(size RGBValue) ; alloc enuf space
haveSize:
mov cx, (HAF_STANDARD_NO_ERR_LOCK shl 8) or mask HF_SWAPABLE
call MemAllocFar
mov BMframe.BF_palette, bx ; save handle
mov BMframe.BF_args.PBA_pal.segment, ax
clr BMframe.BF_args.PBA_pal.offset
mov es, ax ; es:di -> pal block
clr di
; OK, we have the necc buffer space. Init the space.
; es:di -> space to store palette info
; There are two different scenarios here. If the device we
; are drawing on is 24BIT or CMYK, then we need to build out
; a palette with RGB values as entries. If the device is 4
; or 8-bit, then we need indices. Which means that we need
; to map the desired RGB values to the closest index.
cmp BMframe.BF_deviceType, BMF_24BIT ; see if we need RGBs
jb doIndexLookup ; no, need indices
; since we need RGB values, just copy them from the bitmap
; header.
EC < test BMframe.BF_args.PBA_flags, mask PBF_PAL_TYPE >
EC < ERROR_NZ GRAPHICS_BITMAP_INTERNAL_ERROR >
add si, ds:[si].CB_palette ; get pointer to palette
lodsw ; ax = number of entries
mov cx, ax ; get count in cx
shl cx, 1
add cx, ax ; cx = #bytes
shr cx, 1 ; div 2 for words (always even)
rep movsw ; copy palette
done:
.leave
ret
; palette has size zero
; turn off palette bit to avoid further complications
; NOTE: we don't want to turn it off in the source bitmap, as
; that would be modifying the user's data. But we do
; want to reset it in the PB_args structure.
badPalette:
and BMframe.BF_args.PBA_bm.B_type, not mask BMT_PALETTE
jmp done
; we have an indexed palette. So figure what the 1-to-1
; mapping will be (need to map each RGB value to a valid index)
doIndexLookup:
or BMframe.BF_args.PBA_flags, \
BMPT_INDEX shl offset PBF_PAL_TYPE
add si, ds:[si].CB_palette ; get pointer to palette
lodsw ; ax = number of entries
mov cx, ax ; loop countd
mov ax, (0xff shl 8) ; map to all 256 entries
cmp BMframe.BF_deviceType, BMF_8BIT
je checkFor16Colors
mov ax, (0x0f shl 8) ; else only use first 16 entries
checkFor16Colors:
cmp cx, 16 ; if only 16, optimize look-up
je colorLoop
mov al, ah ; mark AH non-zero to denote
; a non-16-color bitmap
cmp cx, 256
ja badPalette
; we have a 2 or 256-color palette that we want to map to
; the current Window's palette. Take some care to only
; map to the resolution of the device, however, by using
; the maximum # of entries value (pass in AH) to limit
; our search in the Window's palette.
colorLoop:
push ax ; save # of entries to map to
lodsb ; get next RED
mov bx, ds:[si] ; get GREEN and BLUE
push ds, si, cx
call GetCurrentPalette ; ds:si -> palette
mov ch, ah ; ch -> # of entries to check
call MapRGBtoIndex ; just use default mapping
pop ds, si, cx
mov al, ah ; al <- closest index
stosb ; store index
add si, 2
pop ax ; restore entry count
loop colorLoop
; See if we should now fill out the rest of the palette
; structure, so that was can optimize our look-up of
; 4-bit/pixel bitmaps.
tst al ; this optimization only works
jnz done ; ...on 16-color bitmaps
cmp BMframe.BF_deviceType, BMF_4BIT
jne done ; ...and 4-bit/pixel devices
; now we need to set the high nibble of each byte
; but only for 4BIT devices
mov di, 15 ; back to beginning
mov bx, 240 ; es:bx -> end of palette
orLoop:
mov al, es:[di] ; get nibble
mov cl, 4
shl al, cl ; up to high nibble
mov cx, di ; save pointer
mov di, 15
innerLoop:
or al, es:[di]
mov es:[bx][di], al
and al, 0xf0
dec di
jns innerLoop
mov di, cx ; restore pointer
sub bx, 16
sub di, 1
jns orLoop
jmp done
InitBitmapPalette endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetCurrentPalette
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get a pointer to the palette for the window
CALLED BY: INTERNAL
InitBitmapPalette
PASS: dx - Window segment
RETURN: ds:si - Pointer to Palette entries
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
MS 2/ 4/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetCurrentPalette proc far
.enter
mov ds, dx ; ds -> Window
tst ds:[W_palette] ; see if there is a custom one
jz useDefault ; if not, use the default palette
; OK, there's a custom palette. W_palette holds the chunk handle
mov si, ds:[W_palette] ; get chunk handle and...
mov si, ds:[si] ; ...dereference it
done:
.leave
ret
; there is no custom palette, so use the default system one
useDefault:
LoadVarSeg ds
mov si, offset idata:defaultPalette ; ptr to start of pal
jmp done
GetCurrentPalette endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BMCallBack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Supply next line of bitmap to video driver
CALLED BY: INTERNAL (video driver)
PASS: inherits stack frame from GrDrawBitmap
RETURN: carry - set if no more bitmap to draw, else clear
ds:si - pointer to new bitmap slice
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call BMGetSlice to get next scan of bitmap;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 06/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BMCallBack proc far
uses ax, bx, dx, di
BMframe local BitmapFrame
.enter inherit
; just call the BMGetSlice routine - it does all the work
test BMframe.BF_origBMtype, mask BMT_HUGE ; don't load if
jnz callGetSlice ; Huge
mov ds, BMframe.BF_origBM.segment ; get ptr to orig bm
mov si, BMframe.BF_origBM.offset
callGetSlice:
call BMGetSlice
mov ds, BMframe.BF_finalBM.segment ; return new slice ptr
mov si, BMframe.BF_finalBM.offset
jc done
mov BMframe.BF_args.PBA_data.segment, ds
mov ax, ds:[si].CB_data
add ax, si
mov BMframe.BF_args.PBA_data.offset, ax
mov ax, ds:[si].CB_numScans
mov BMframe.BF_args.PBA_bm.B_height, ax
clc
done:
.leave
ret
BMCallBack endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BMTrivialReject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do a trivial reject test for the bitmap routine. Also
translates the origin to device coordinates.
CALLED BY: INTERNAL
GrDrawBitmap
PASS: carry - set to check entire bitmap
clear to check current slice (for complex ones)
ax - x coordinate to draw string at (doc coords)
bx - y coordinate to draw string at (doc coords)
es - Window segment
inherits stack frame from GrDrawBitmap
RETURN: carry - set if rejected
ax - translated x coordinate (dev coords)
bx - translated y coordinate (dev coords)
si - offset to bitmap header
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
check bounds of bitmap vs. bounds of window
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 06/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BMTrivialReject proc near
uses cx,dx,ds ; save things we trash
BMframe local BitmapFrame
.enter inherit
; set up pointer to bitmap
mov ds, BMframe.BF_origBM.segment ; get segment address
mov si, BMframe.BF_origBM.offset ; ds:si -> bitmap
mov dx, bx ; set up rect coords
mov cx, ax ; in (ax,bx)-(cx,dx)
; check flag for what to test. Setup regs to do testing
jnc checkSlice ; check this slice
; check whole bitmap.
add dx, ds:[si].B_height ; add in full height
; get width
getWidth:
add cx, ds:[si].B_width ; slice width=bm width
dec cx ; back up one in each
dec dx
; if we're rotated, we need to do some extra work..
test es:[W_curTMatrix].TM_flags, TM_COMPLEX ;
jnz complexReject ; do extra work
test ds:[si].B_type, mask BMT_COMPLEX ; might have res info
jnz checkResolution ; if complex
; check extent of bitmap
doRejectTest:
call GrTransCoord2 ; translate coordinates
cmp ax, es:[W_maskRect.R_right]
jg rejectIt ; reject: after right
cmp cx, es:[W_maskRect.R_left]
jl rejectIt ; reject: before left
cmp bx, es:[W_maskRect.R_bottom]
jg rejectIt ; reject: below bottom
cmp dx, es:[W_maskRect.R_top]
jl rejectIt ; reject: above top
clc ; signal ok
done:
.leave
ret
rejectIt:
stc ; signal reject
jmp done
; special case: just check this slice
checkSlice:
add dx, ds:[si].CB_numScans ; add in #rows
jmp getWidth
; we might have to do something if the resolution is no 72dpi
checkResolution:
cmp ds:[si].CB_xres, DEF_BITMAP_RES ; check for 72dpi
jne complexReject
cmp ds:[si].CB_yres, DEF_BITMAP_RES ; check for 72dpi
je doRejectTest
; special case: tmatrix has rotation
complexReject:
mov cx, ax ; can't pass stuff in
mov dx, bx ; ax,bx
call BMComplexReject ; do special check
pushf ; save carry status
mov ax, cx
mov bx, dx
call GrTransCoord ; pass back trans coords
popf
jmp done ; all done
BMTrivialReject endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalcLineSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate the line width (bytes) for a scan line of a bitmap
CALLED BY: INTERNAL
GetBitSizeBlock, DrawSlice
PASS: al - B_type byte
cx - width of bitmap (pixels)
RETURN: ax - #bytes needed
DESTROYED: cx
PSEUDO CODE/STRATEGY:
case BMT_FORMAT:
BMF_MONO: #bytes = (width+7)>>3
BMF_4BIT: #bytes = (width+1)>>1
BMF_8BIT: #bytes = width
BMF_24BIT: #bytes = width * 3
BMF_4CMYK: #bytes = 4*((width+7)>>3)
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 06/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcLineSize proc far
uses dx
.enter
mov ah, al ; make a copy
and ah, mask BMT_FORMAT ; isolate format
xchg ax, cx ; ax = line width, cx = flags
mov dx, ax ; save line width
add dx, 7 ; calc mask size
shr dx, 1
shr dx, 1
shr dx, 1
cmp ch, BMF_MONO ; are we monochrome ?
ja colorCalc ; no, do color calculation
mov ax, dx ; ax = BMF_MONO size
; done with scan line calc. If there is a mask, add that in
checkMask:
test cl, mask BMT_MASK ; mask stored too ?
jz done
add ax, dx
done:
.leave
ret
; more than one bit/pixel, calc size
colorCalc:
cmp ch, BMF_8BIT ; this is really like mono
je checkMask
jb calcVGA ; if less, must be 4BIT
cmp ch, BMF_24BIT ; this is really like mono
je calcRGB
; it's CMYK or CMY, this should be easy
mov ax, dx ; it's 4 times the mask size
shl ax, 1
shl ax, 1
jmp checkMask
; it's 4BIT
calcVGA:
inc ax ; yes, round up
shr ax, 1 ; and calc #bytes
jmp checkMask
; it's RGB.
calcRGB:
mov dx, ax ; *1
shl ax, 1 ; *2
add ax, dx ; *3
add dx, 7 ; recalc mask since we used dx
shr dx, 1
shr dx, 1
shr dx, 1
jmp checkMask
; THIS FALLS THROUGH IF MASK
CalcLineSize endp
|
src/asf-views-nodes-jsf.ads | Letractively/ada-asf | 0 | 8768 | -----------------------------------------------------------------------
-- views.nodes.jsf -- JSF Core Tag Library
-- Copyright (C) 2010, 2011, 2012, 2013, 2014 <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 ASF.Views.Nodes;
with ASF.Contexts.Facelets;
with ASF.Validators;
-- The <b>ASF.Views.Nodes.Jsf</b> package implements various JSF Core Tag
-- components which alter the component tree but don't need to create
-- new UI components in the usual way. The following components are supported:
--
-- <f:attribute name='...' value='...'/>
-- <f:converter converterId='...'/>
-- <f:validateXXX .../>
-- <f:facet name='...'>...</f:facet>
--
-- The <b>f:attribute</b>, <b>f:converter</b> and <b>f:validateXXX</b> tags don't create any
-- component. The <b>f:facet</b> creates components that are inserted as a facet component
-- in the component tree.
package ASF.Views.Nodes.Jsf is
-- ------------------------------
-- Converter Tag
-- ------------------------------
-- The <b>Converter_Tag_Node</b> is created in the facelet tree when
-- the <f:converter> element is found. When building the component tree,
-- we have to find the <b>Converter</b> object and attach it to the
-- parent component. The parent component must implement the <b>Value_Holder</b>
-- interface.
type Converter_Tag_Node is new Views.Nodes.Tag_Node with private;
type Converter_Tag_Node_Access is access all Converter_Tag_Node'Class;
-- Create the Converter Tag
function Create_Converter_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Views.Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children. Get the specified converter and
-- add it to the parent component. This operation does not create any
-- new UIComponent.
overriding
procedure Build_Components (Node : access Converter_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- ------------------------------
-- Convert Date Time Tag
-- ------------------------------
-- The <b>Convert_Date_Time_Tag_Node</b> is created in the facelet tree when
-- the <f:converterDateTime> element is found. When building the component tree,
-- we have to find the <b>Converter</b> object and attach it to the
-- parent component. The parent component must implement the <b>Value_Holder</b>
-- interface.
type Convert_Date_Time_Tag_Node is new Views.Nodes.Tag_Node with private;
type Convert_Date_Time_Tag_Node_Access is access all Convert_Date_Time_Tag_Node'Class;
-- Create the Converter Tag
function Create_Convert_Date_Time_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children. Get the specified converter and
-- add it to the parent component. This operation does not create any
-- new UIComponent.
overriding
procedure Build_Components (Node : access Convert_Date_Time_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- ------------------------------
-- Validator Tag
-- ------------------------------
-- The <b>Validator_Tag_Node</b> is created in the facelet tree when
-- the <f:validateXXX> element is found. When building the component tree,
-- we have to find the <b>Validator</b> object and attach it to the
-- parent component. The parent component must implement the <b>Editable_Value_Holder</b>
-- interface.
type Validator_Tag_Node is new Views.Nodes.Tag_Node with private;
type Validator_Tag_Node_Access is access all Validator_Tag_Node'Class;
-- Create the Validator Tag
function Create_Validator_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Views.Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Get the validator instance that corresponds to the validator tag.
-- Returns in <b>Validator</b> the instance if it exists and indicate
-- in <b>Shared</b> whether it must be freed or not when the component is deleted.
procedure Get_Validator (Node : in Validator_Tag_Node;
Context : in out Contexts.Facelets.Facelet_Context'Class;
Validator : out Validators.Validator_Access;
Shared : out Boolean);
-- Get the specified validator and add it to the parent component.
-- This operation does not create any new UIComponent.
overriding
procedure Build_Components (Node : access Validator_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- ------------------------------
-- Range Validator Tag
-- ------------------------------
-- The <b>Range_Validator_Tag_Node</b> is created in the facelet tree when
-- the <f:validateLongRange> element is found.
-- The parent component must implement the <b>Editable_Value_Holder</b>
-- interface.
type Range_Validator_Tag_Node is new Validator_Tag_Node with private;
type Range_Validator_Tag_Node_Access is access all Range_Validator_Tag_Node'Class;
-- Create the Range_Validator Tag
function Create_Range_Validator_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Get the validator instance that corresponds to the range validator.
-- Returns in <b>Validator</b> the validator instance if it exists and indicate
-- in <b>Shared</b> whether it must be freed or not when the component is deleted.
overriding
procedure Get_Validator (Node : in Range_Validator_Tag_Node;
Context : in out Contexts.Facelets.Facelet_Context'Class;
Validator : out Validators.Validator_Access;
Shared : out Boolean);
-- ------------------------------
-- Length Validator Tag
-- ------------------------------
-- The <b>Length_Validator_Tag_Node</b> is created in the facelet tree when
-- the <f:validateLength> element is found. When building the component tree,
-- we have to find the <b>Validator</b> object and attach it to the
-- parent component. The parent component must implement the <b>Editable_Value_Holder</b>
-- interface.
type Length_Validator_Tag_Node is new Validator_Tag_Node with private;
type Length_Validator_Tag_Node_Access is access all Length_Validator_Tag_Node'Class;
-- Create the Length_Validator Tag. Verifies that the XML node defines
-- the <b>minimum</b> or the <b>maximum</b> or both attributes.
function Create_Length_Validator_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Get the validator instance that corresponds to the validator tag.
-- Returns in <b>Validator</b> the instance if it exists and indicate
-- in <b>Shared</b> whether it must be freed or not when the component is deleted.
overriding
procedure Get_Validator (Node : in Length_Validator_Tag_Node;
Context : in out Contexts.Facelets.Facelet_Context'Class;
Validator : out Validators.Validator_Access;
Shared : out Boolean);
-- ------------------------------
-- Attribute Tag
-- ------------------------------
-- The <b>Attribute_Tag_Node</b> is created in the facelet tree when
-- the <f:attribute> element is found. When building the component tree,
-- an attribute is added to the parent component.
type Attribute_Tag_Node is new Views.Nodes.Tag_Node with private;
type Attribute_Tag_Node_Access is access all Attribute_Tag_Node'Class;
-- Create the Attribute Tag
function Create_Attribute_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Views.Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
-- Adds the attribute to the component node.
-- This operation does not create any new UIComponent.
overriding
procedure Build_Components (Node : access Attribute_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- ------------------------------
-- Facet Tag
-- ------------------------------
-- The <b>Facet_Tag_Node</b> is created in the facelet tree when
-- the <f:facet> element is found. After building the component tree,
-- we have to add the component as a facet element of the parent component.
--
type Facet_Tag_Node is new Views.Nodes.Tag_Node with private;
type Facet_Tag_Node_Access is access all Facet_Tag_Node'Class;
-- Create the Facet Tag
function Create_Facet_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Views.Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the facet component of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Facet_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- ------------------------------
-- Metadata Tag
-- ------------------------------
-- The <b>Metadata_Tag_Node</b> is created in the facelet tree when
-- the <f:metadata> element is found. This special component is inserted as a special
-- facet component on the UIView parent component.
type Metadata_Tag_Node is new Views.Nodes.Tag_Node with private;
type Metadata_Tag_Node_Access is access all Metadata_Tag_Node'Class;
-- Create the Metadata Tag
function Create_Metadata_Tag_Node (Binding : in Binding_Access;
Line : in Views.Line_Info;
Parent : in Views.Nodes.Tag_Node_Access;
Attributes : in Views.Nodes.Tag_Attribute_Array_Access)
return Views.Nodes.Tag_Node_Access;
-- Build the component tree from the tag node and attach it as a metadata information
-- facet for the UIView parent component.
overriding
procedure Build_Components (Node : access Metadata_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Contexts.Facelets.Facelet_Context'Class);
-- The elaboration check is disabled on the Create_XXX operation because they
-- are referenced by the Components.Core.Factory to define a static UI binding.
-- This reference triggers the implicit Elaborate_All for the Nodes.JSF package.
-- At the end, we obtain a circular dependency that cannot be resolved.
-- It is safe to suppress the elaboration check because these Create_XXX operation
-- are not invoked before the application is initialized and a view is rendered.
pragma Suppress (Elaboration_Check, On => Create_Attribute_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Converter_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Convert_Date_Time_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Facet_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Metadata_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Length_Validator_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Range_Validator_Tag_Node);
pragma Suppress (Elaboration_Check, On => Create_Validator_Tag_Node);
private
type Converter_Tag_Node is new Views.Nodes.Tag_Node with record
Converter : EL.Objects.Object;
end record;
type Convert_Date_Time_Tag_Node is new Views.Nodes.Tag_Node with record
Date_Style : Tag_Attribute_Access;
Time_Style : Tag_Attribute_Access;
Locale : Tag_Attribute_Access;
Pattern : Tag_Attribute_Access;
Format : Tag_Attribute_Access;
end record;
type Validator_Tag_Node is new Views.Nodes.Tag_Node with record
Validator : EL.Objects.Object;
end record;
type Length_Validator_Tag_Node is new Validator_Tag_Node with record
Minimum : Tag_Attribute_Access;
Maximum : Tag_Attribute_Access;
end record;
type Range_Validator_Tag_Node is new Validator_Tag_Node with record
Minimum : Tag_Attribute_Access;
Maximum : Tag_Attribute_Access;
end record;
type Attribute_Tag_Node is new Views.Nodes.Tag_Node with record
Attr : aliased Tag_Attribute;
Attr_Name : Tag_Attribute_Access;
Value : Tag_Attribute_Access;
end record;
type Facet_Tag_Node is new Views.Nodes.Tag_Node with record
Facet_Name : Tag_Attribute_Access;
end record;
type Metadata_Tag_Node is new Views.Nodes.Tag_Node with null record;
end ASF.Views.Nodes.Jsf;
|
programs/oeis/037/A037582.asm | neoneye/loda | 22 | 178049 | <gh_stars>10-100
; A037582: Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 1,3.
; 1,13,131,1313,13131,131313,1313131,13131313,131313131,1313131313,13131313131,131313131313,1313131313131,13131313131313,131313131313131,1313131313131313,13131313131313131,131313131313131313,1313131313131313131,13131313131313131313
seq $0,42 ; Unary representation of natural numbers.
sub $0,1
mul $0,36
add $0,39
div $0,24
mul $0,78
div $0,11
mul $0,4
div $0,36
add $0,1
|
grammar/PlSqlParser.g4 | jameschenjav/antlr-plsql | 3 | 409 | <filename>grammar/PlSqlParser.g4
/**
* Oracle(c) PL/SQL 11g Parser
*
* Copyright (c) 2009-2011 <NAME> <<EMAIL>>
* Copyright (c) 2015-2017 <NAME> (KvanTTT, <EMAIL>, Positive Technologies).
* Copyright (c) 2017 <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.
*/
parser grammar PlSqlParser;
options { tokenVocab=PlSqlLexer; }
javln
: sql_plus_command? (main (SEMICOLON | sql_plus_command)?)+ EOF
;
main
: create_function_body
| create_procedure_body
| create_package
| create_package_body
| create_table
| create_trigger
| create_view
| anonymouse_block
;
// sql_script
// : ((unit_statement | sql_plus_command) SEMICOLON?)* EOF
// ;
// unit_statement
// : transaction_control_statements
// | alter_function
// | alter_package
// | alter_procedure
// | alter_sequence
// | alter_trigger
// | alter_type
// | alter_table
// | alter_index
// | alter_user
// | create_function_body
// | create_procedure_body
// | create_package
// | create_package_body
// | create_index
// | create_table
// | create_tablespace
// | create_view //TODO
// // | create_directory //TODO
// | create_materialized_view
// | create_materialized_view_log
// | create_user
// | create_sequence
// | create_trigger
// | create_type
// | create_synonym
// | drop_function
// | drop_package
// | drop_procedure
// | drop_sequence
// | drop_trigger
// | drop_type
// | data_manipulation_language_statements
// | drop_table
// | drop_index
// | comment_on_column
// | comment_on_table
// | anonymous_block
// | grant_statement
// ;
// DDL -> SQL Statements for Stored PL/SQL Units
// Function DDLs
drop_function
: DROP FUNCTION regular_name ';'
;
alter_function
: ALTER FUNCTION regular_name COMPILE DEBUG? compiler_parameters_clause* (REUSE SETTINGS)? ';'
;
create_function_body
: CREATE (OR REPLACE)? FUNCTION regular_name parameters
RETURN type_spec (invoker_rights_clause | parallel_enable_clause | result_cache_clause | DETERMINISTIC)*
((PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) | (PIPELINED | AGGREGATE) USING regular_name) ';'
;
// Creation Function - Specific Clauses
parallel_enable_clause
: PARALLEL_ENABLE partition_by_clause?
;
partition_by_clause
: '(' PARTITION expression BY (ANY | (HASH | RANGE | LIST) paren_column_list) streaming_clause? ')'
;
result_cache_clause
: RESULT_CACHE relies_on_part?
;
relies_on_part
: RELIES_ON '(' tableview_name (',' tableview_name)* ')'
;
streaming_clause
: (ORDER | CLUSTER) expression BY paren_column_list
;
// Package DDLs
drop_package
: DROP PACKAGE BODY? (id_expression '.')? common_name ';'
;
alter_package
: ALTER PACKAGE common_name COMPILE DEBUG? (PACKAGE | BODY | SPECIFICATION)? compiler_parameters_clause* (REUSE SETTINGS)? ';'
;
create_package
: CREATE (OR REPLACE)? PACKAGE (id_expression '.')? common_name invoker_rights_clause? (IS | AS) package_obj_spec* END common_name? ';'
;
create_package_body
: CREATE (OR REPLACE)? PACKAGE BODY (id_expression '.')? common_name (IS | AS) package_obj_body* (BEGIN seq_of_statements)? END common_name? ';'
;
// Create Package Specific Clauses
package_obj_spec
: variable_declaration
| subtype_declaration
| cursor_declaration
| exception_declaration
| pragma_declaration
| type_declaration
| procedure_spec
| function_spec
;
procedure_spec
: PROCEDURE common_name parameters ';'
;
function_spec
: FUNCTION common_name parameters
RETURN type_spec (DETERMINISTIC)? (RESULT_CACHE)? ';'
;
package_obj_body
: variable_declaration
| subtype_declaration
| cursor_declaration
| exception_declaration
| type_declaration
| procedure_body
| function_body
| procedure_spec
| function_spec
;
// Procedure DDLs
drop_procedure
: DROP PROCEDURE regular_name ';'
;
alter_procedure
: ALTER PROCEDURE regular_name COMPILE DEBUG? compiler_parameters_clause* (REUSE SETTINGS)? ';'
;
function_body
: FUNCTION common_name parameters
RETURN type_spec (invoker_rights_clause | parallel_enable_clause | result_cache_clause | DETERMINISTIC)*
((PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) | (PIPELINED | AGGREGATE) USING regular_name) ';'
;
procedure_body
: PROCEDURE common_name parameters (IS | AS)
(DECLARE? seq_of_declare_specs? body | call_spec | EXTERNAL) ';'
;
create_procedure_body
: CREATE (OR REPLACE)? PROCEDURE regular_name parameters
invoker_rights_clause? (IS | AS)
(DECLARE? seq_of_declare_specs? body | call_spec | EXTERNAL) ';'
;
parameters
: ('(' parameter (',' parameter)* ')')?
;
// Trigger DDLs
drop_trigger
: DROP TRIGGER regular_name ';'
;
alter_trigger
: ALTER TRIGGER alter_trigger_name=regular_name
((ENABLE | DISABLE) | RENAME TO rename_trigger_name=regular_name | COMPILE DEBUG? compiler_parameters_clause* (REUSE SETTINGS)?) ';'
;
create_trigger
: CREATE ( OR REPLACE )? TRIGGER regular_name
(simple_dml_trigger | compound_dml_trigger | non_dml_trigger)
trigger_follows_clause? (ENABLE | DISABLE)? trigger_when_clause? trigger_body ';'
;
trigger_follows_clause
: FOLLOWS regular_name (',' regular_name)*
;
trigger_when_clause
: WHEN '(' expression ')'
;
// Create Trigger Specific Clauses
simple_dml_trigger
: (BEFORE | AFTER | INSTEAD OF) dml_event_clause referencing_clause? for_each_row?
;
for_each_row
: FOR EACH ROW
;
compound_dml_trigger
: FOR dml_event_clause referencing_clause?
;
non_dml_trigger
: (BEFORE | AFTER) non_dml_event (OR non_dml_event)* ON (DATABASE | (common_name '.')? SCHEMA)
;
trigger_body
: COMPOUND TRIGGER
| CALL identifier
| DECLARE? trigger_block
;
routine_clause
: routine_name function_argument?
;
compound_trigger_block
: COMPOUND TRIGGER seq_of_declare_specs? timing_point_section+ END regular_name
;
timing_point_section
: bk=BEFORE STATEMENT IS trigger_block BEFORE STATEMENT ';'
| bk=BEFORE EACH ROW IS trigger_block BEFORE EACH ROW ';'
| ak=AFTER STATEMENT IS trigger_block AFTER STATEMENT ';'
| ak=AFTER EACH ROW IS trigger_block AFTER EACH ROW ';'
;
non_dml_event
: ALTER
| ANALYZE
| ASSOCIATE STATISTICS
| AUDIT
| COMMENT
| CREATE
| DISASSOCIATE STATISTICS
| DROP
| GRANT
| NOAUDIT
| RENAME
| REVOKE
| TRUNCATE
| DDL
| STARTUP
| SHUTDOWN
| DB_ROLE_CHANGE
| LOGON
| LOGOFF
| SERVERERROR
| SUSPEND
| DATABASE
| SCHEMA
| FOLLOWS
;
dml_event_clause
: dml_event_element (OR dml_event_element)* ON dml_event_nested_clause? tableview_name
;
dml_event_element
: (DELETE | INSERT | UPDATE) (OF column_list)?
;
dml_event_nested_clause
: NESTED TABLE tableview_name OF
;
referencing_clause
: REFERENCING referencing_element+
;
referencing_element
: (NEW | OLD | PARENT) column_alias
;
// DDLs
drop_type
: DROP TYPE BODY? id_expr_name (FORCE | VALIDATE)? ';'
;
alter_type
: ALTER TYPE id_expr_name
(compile_type_clause
| replace_type_clause
//TODO | {input.LT(2).getText().equalsIgnoreCase("attribute")}? alter_attribute_definition
| alter_method_spec
| alter_collection_clauses
| modifier_clause
) dependent_handling_clause? ';'
;
// Alter Type Specific Clauses
compile_type_clause
: COMPILE DEBUG? (SPECIFICATION | BODY)? compiler_parameters_clause* (REUSE SETTINGS)?
;
replace_type_clause
: REPLACE invoker_rights_clause? AS OBJECT '(' object_member_spec (',' object_member_spec)* ')'
;
alter_method_spec
: alter_method_element (',' alter_method_element)*
;
alter_method_element
: (ADD | DROP) (map_order_function_spec | subprogram_spec)
;
alter_attribute_definition
: (ADD | MODIFY | DROP) ATTRIBUTE (attribute_definition | '(' attribute_definition (',' attribute_definition)* ')')
;
attribute_definition
: common_name type_spec?
;
alter_collection_clauses
: MODIFY (LIMIT expression | ELEMENT TYPE type_spec)
;
dependent_handling_clause
: INVALIDATE
| CASCADE (CONVERT TO SUBSTITUTABLE | NOT? INCLUDING TABLE DATA)? dependent_exceptions_part?
;
dependent_exceptions_part
: FORCE? EXCEPTIONS INTO tableview_name
;
create_type
: CREATE (OR REPLACE)? TYPE (type_definition | type_body) ';'
;
// Create Type Specific Clauses
type_definition
: id_expr_name (OID CHAR_STRING)? object_type_def?
;
object_type_def
: invoker_rights_clause? (object_as_part | object_under_part) sqlj_object_type?
('(' object_member_spec (',' object_member_spec)* ')')? modifier_clause*
;
object_as_part
: (IS | AS) (OBJECT | varray_type_def | nested_table_type_def)
;
object_under_part
: UNDER type_spec
;
nested_table_type_def
: TABLE OF type_spec (NOT NULL)?
;
sqlj_object_type
: EXTERNAL NAME expression LANGUAGE JAVA USING (SQLDATA | CUSTOMDATUM | ORADATA)
;
type_body
: BODY id_expr_name (IS | AS) (type_body_elements)+ END
;
type_body_elements
: map_order_func_declaration
| subprog_decl_in_type
;
map_order_func_declaration
: (MAP | ORDER) MEMBER func_decl_in_type
;
subprog_decl_in_type
: (MEMBER | STATIC) (proc_decl_in_type | func_decl_in_type | constructor_declaration)
;
proc_decl_in_type
: PROCEDURE regular_name '(' type_elements_parameter (',' type_elements_parameter)* ')'
(IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';')
;
func_decl_in_type
: FUNCTION regular_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')?
RETURN type_spec (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';')
;
constructor_declaration
: FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION type_spec
('(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')')?
RETURN SELF AS RESULT (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';')
;
// Common Type Clauses
modifier_clause
: NOT? (INSTANTIABLE | FINAL | OVERRIDING)
;
object_member_spec
: identifier type_spec sqlj_object_type_attr?
| element_spec
;
sqlj_object_type_attr
: EXTERNAL NAME expression
;
element_spec
: modifier_clause? element_spec_options+ (',' pragma_clause)?
;
element_spec_options
: subprogram_spec
| constructor_spec
| map_order_function_spec
;
subprogram_spec
: (MEMBER | STATIC) (type_procedure_spec | type_function_spec)
;
type_procedure_spec
: PROCEDURE regular_name '(' type_elements_parameter (',' type_elements_parameter)* ')' ((IS | AS) call_spec)?
;
type_function_spec
: FUNCTION regular_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')?
RETURN (type_spec | SELF AS RESULT) ((IS | AS) call_spec | EXTERNAL VARIABLE? NAME expression)?
;
constructor_spec
: FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION
type_spec ('(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')')?
RETURN SELF AS RESULT ((IS | AS) call_spec)?
;
map_order_function_spec
: (MAP | ORDER) MEMBER type_function_spec
;
pragma_clause
: PRAGMA RESTRICT_REFERENCES '(' pragma_elements (',' pragma_elements)* ')'
;
pragma_elements
: identifier
| DEFAULT
;
type_elements_parameter
: common_name type_spec
;
// Sequence DDLs
drop_sequence
: DROP SEQUENCE id_expr_name ';'
;
alter_sequence
: ALTER SEQUENCE id_expr_name sequence_spec+ ';'
;
create_sequence
: CREATE SEQUENCE id_expr_name (sequence_start_clause | sequence_spec)* ';'
;
// Common Sequence
sequence_spec
: INCREMENT BY UNSIGNED_INTEGER
| MAXVALUE UNSIGNED_INTEGER
| NOMAXVALUE
| MINVALUE UNSIGNED_INTEGER
| NOMINVALUE
| CYCLE
| NOCYCLE
| CACHE UNSIGNED_INTEGER
| NOCACHE
| ORDER
| NOORDER
;
sequence_start_clause
: START WITH UNSIGNED_INTEGER
;
create_index
: CREATE UNIQUE? INDEX regular_name ON tableview_name paren_column_list (TABLESPACE id_expression)? (COMPUTE STATISTICS)? ';'
;
alter_index
: ALTER INDEX old_index_name=regular_name RENAME TO new_index_name=regular_name ';'
;
create_user
: CREATE USER
id_expression
( identified_by
| identified_other_clause
| user_tablespace_clause
| quota_clause
| profile_clause
| password_expire_clause
| user_lock_clause
| user_editions_clause
| container_clause
)+ ';'
;
// The standard clauses only permit one user per statement.
// The proxy clause allows multiple users for a proxy designation.
alter_user
: ALTER USER
id_expression
( alter_identified_by
| identified_other_clause
| user_tablespace_clause
| quota_clause
| profile_clause
| user_default_role_clause
| password_expire_clause
| user_lock_clause
| alter_user_editions_clause
| container_clause
| container_data_clause
)+
';'
| (','? id_expression)+ proxy_clause ';'
;
alter_identified_by
: identified_by (REPLACE id_expression)?
;
identified_by
: IDENTIFIED BY id_expression
;
identified_other_clause
: IDENTIFIED (EXTERNALLY | GLOBALLY) (AS quoted_string)?
;
user_tablespace_clause
: (DEFAULT | TEMPORARY) TABLESPACE id_expression
;
quota_clause
: QUOTA (size_clause | UNLIMITED) ON id_expression
;
profile_clause
: PROFILE id_expression
;
role_clause
: (','? role_name)+
| ALL (EXCEPT (','? role_name)+)*
;
user_default_role_clause
: DEFAULT ROLE (NONE | role_clause)
;
password_expire_clause
: PASSWORD EXPIRE
;
user_lock_clause
: ACCOUNT (LOCK | UNLOCK)
;
user_editions_clause
: ENABLE EDITIONS
;
alter_user_editions_clause
: user_editions_clause (FOR (','? regular_id)+)? FORCE?
;
proxy_clause
: REVOKE CONNECT THROUGH (ENTERPRISE USERS | id_expression)
| GRANT CONNECT THROUGH
( ENTERPRISE USERS
| id_expression
(WITH (NO ROLES | ROLE role_clause))?
(AUTHENTICATION REQUIRED)?
(AUTHENTICATED USING (PASSWORD | CERTIFICATE | DISTINGUISHED NAME))?
)
;
container_names
: LEFT_PAREN (','? id_expression)+ RIGHT_PAREN
;
set_container_data
: SET CONTAINER_DATA EQUALS_OP (ALL | DEFAULT | container_names)
;
add_rem_container_data
: (ADD | REMOVE) CONTAINER_DATA EQUALS_OP container_names
;
container_data_clause
: set_container_data
| add_rem_container_data (FOR regular_name)?
;
drop_index
: DROP INDEX regular_name ';'
;
grant_statement
: GRANT
( ','?
(role_name
| system_privilege
| object_privilege paren_column_list?
)
)+
(ON grant_object_name)?
TO (','? grantee_name | PUBLIC)+
(WITH (ADMIN | DELEGATE) OPTION)?
(WITH HIERARCHY OPTION)?
(WITH GRANT OPTION)?
container_clause? ';'
;
container_clause
: CONTAINER EQUALS_OP (CURRENT | ALL)
;
create_view
: CREATE (OR REPLACE)? (OR? FORCE)? EDITIONING? VIEW
tableview_name view_options?
AS subquery order_by_clause? subquery_restriction_clause?
;
view_options
: ( view_alias_constraint
| object_view_clause
// | xmltype_view_clause //TODO
)
;
view_alias_constraint
: '(' ( ','? (table_alias inline_constraint* | out_of_line_constraint) )+ ')'
;
object_view_clause
: OF id_expr_name
( WITH OBJECT (IDENTIFIER|ID|OID) ( DEFAULT | '(' (','? REGULAR_ID)+ ')' )
| UNDER tableview_name
)
( '(' ( ','? (out_of_line_constraint | REGULAR_ID inline_constraint ) )+ ')' )*
;
inline_constraint
: (CONSTRAINT constraint_name)?
( NOT? NULL
| UNIQUE
| PRIMARY KEY
| references_clause
| check_constraint
)
constraint_state?
;
out_of_line_constraint
: ( (CONSTRAINT constraint_name)?
( primary_key_clause
| foreign_key_clause
| unique_key_clause
| check_constraint
)
)+
constraint_state?
;
constraint_state
: ( NOT? DEFERRABLE
| INITIALLY (IMMEDIATE|DEFERRED)
| (RELY|NORELY)
| (ENABLE|DISABLE)
| (VALIDATE|NOVALIDATE)
)+
;
create_tablespace
: CREATE (BIGFILE | SMALLFILE)?
( permanent_tablespace_clause
| temporary_tablespace_clause
| undo_tablespace_clause
)
';'
;
permanent_tablespace_clause
: TABLESPACE id_expression datafile_specification?
( MINIMUM EXTENT size_clause
| BLOCKSIZE size_clause
| logging_clause
| FORCE LOGGING
| (ONLINE | OFFLINE)
| ENCRYPTION tablespace_encryption_spec
| DEFAULT //TODO table_compression? storage_clause?
| extent_management_clause
| segment_management_clause
| flashback_mode_clause
)*
;
tablespace_encryption_spec
: USING encrypt_algorithm=CHAR_STRING
;
logging_clause
: LOGGING
| NOLOGGING
| FILESYSTEM_LIKE_LOGGING
;
extent_management_clause
: EXTENT MANAGEMENT LOCAL
( AUTOALLOCATE
| UNIFORM (SIZE size_clause)?
)?
;
segment_management_clause
: SEGMENT SPACE_KEYWORD MANAGEMENT (AUTO | MANUAL)
;
flashback_mode_clause
: FLASHBACK (ON | OFF)
;
temporary_tablespace_clause
: TEMPORARY TABLESPACE tablespace_name=id_expression
tempfile_specification?
tablespace_group_clause? extent_management_clause?
;
tablespace_group_clause
: TABLESPACE GROUP (REGULAR_ID | CHAR_STRING)
;
undo_tablespace_clause
: UNDO TABLESPACE tablespace_name=id_expression
datafile_specification?
extent_management_clause? tablespace_retention_clause?
;
tablespace_retention_clause
: RETENTION (GUARANTEE | NOGUARANTEE)
;
datafile_specification
: DATAFILE
(','? datafile_tempfile_spec)
;
tempfile_specification
: TEMPFILE
(','? datafile_tempfile_spec)
;
datafile_tempfile_spec
: CHAR_STRING? (SIZE size_clause)? REUSE? autoextend_clause?
;
redo_log_file_spec
: DATAFILE ( CHAR_STRING
| '(' ( ','? CHAR_STRING )+ ')'
)?
(SIZE size_clause)?
(BLOCKSIZE size_clause)?
REUSE?
;
autoextend_clause
: AUTOEXTEND (OFF | ON (NEXT size_clause)? maxsize_clause? )
;
maxsize_clause
: MAXSIZE (UNLIMITED | size_clause)
;
build_clause
: BUILD (IMMEDIATE | DEFERRED)
;
parallel_clause
: NOPARALLEL
| PARALLEL parallel_count=UNSIGNED_INTEGER
;
create_materialized_view_log
: CREATE MATERIALIZED VIEW LOG ON tableview_name
( ( physical_attributes_clause
| TABLESPACE tablespace_name=id_expression
| logging_clause
| (CACHE | NOCACHE)
)+
)?
parallel_clause?
// table_partitioning_clauses TODO
( WITH
( ','?
( OBJECT ID
| PRIMARY KEY
| ROWID
| SEQUENCE
| COMMIT SCN
)
)*
('(' ( ','? regular_id )+ ')' new_values_clause? )?
mv_log_purge_clause?
)*
;
new_values_clause
: (INCLUDING | EXCLUDING ) NEW VALUES
;
mv_log_purge_clause
: PURGE
( IMMEDIATE (SYNCHRONOUS | ASYNCHRONOUS)?
// |START WITH CLAUSES TODO
)
;
create_materialized_view
: CREATE MATERIALIZED VIEW tableview_name
(OF id_expr_name )?
//scoped_table_ref and column alias goes here TODO
( ON PREBUILT TABLE ( (WITH | WITHOUT) REDUCED PRECISION)?
| physical_properties? (CACHE | NOCACHE)? parallel_clause? build_clause?
)
( USING INDEX ( (physical_attributes_clause | TABLESPACE mv_tablespace=id_expression)+ )*
| USING NO INDEX
)?
create_mv_refresh?
(FOR UPDATE)?
( (DISABLE | ENABLE) QUERY REWRITE )?
AS subquery order_by_clause?
';'
;
create_mv_refresh
: ( NEVER REFRESH
| REFRESH
( (FAST | COMPLETE | FORCE)
| ON (DEMAND | COMMIT)
| (START WITH | NEXT) //date goes here TODO
| WITH (PRIMARY KEY | ROWID)
| USING
( DEFAULT (MASTER | LOCAL)? ROLLBACK SEGMENT
| (MASTER | LOCAL)? ROLLBACK SEGMENT rb_segment=REGULAR_ID
)
| USING (ENFORCED | TRUSTED) CONSTRAINTS
)+
)
;
create_table
: CREATE (GLOBAL TEMPORARY)? TABLE tableview_name
( '(' (','? datatype_null_enable)+
(',' (CONSTRAINT constraint_name)?
( primary_key_clause
| foreign_key_clause
| unique_key_clause
| check_constraint
)
)*
')' )?
(ON COMMIT (DELETE | PRESERVE) ROWS)?
physical_properties?
table_compression?
// Column_properties clause goes here
// Partition clause goes here
table_range_partition_by_clause?
// Many more varations to capture
row_movement_clause?
flashback_archive_clause?
(AS subquery)?
';'
;
table_range_partition_by_clause
: PARTITION BY RANGE
paren_column_list
(INTERVAL '(' expression ')'
(STORE IN '('
(','? tablespace_name=REGULAR_ID )+
')'
)?
)?
'('
(COMMA? PARTITION partition_name=REGULAR_ID
VALUES LESS THAN
// Supposed to be literal in here, will need to refine this
'('
(','? CHAR_STRING
| ','? standard_function
| ','? numeric
| ','? MAXVALUE
)+
')'
(TABLESPACE partition_tablespace=id_expression)?
(ON COMMIT (DELETE | PRESERVE) ROWS)?
deferred_segment_creation?
physical_attributes_clause?
)+
')'
;
datatype_null_enable
: id_name datatype
SORT? (DEFAULT expression)? (ENCRYPT ( USING CHAR_STRING )? (IDENTIFIED BY REGULAR_ID)? CHAR_STRING? ( NO? SALT )? )?
(NOT NULL)? (ENABLE | DISABLE)?
;
//Technically, this should only allow 'K' | 'M' | 'G' | 'T' | 'P' | 'E'
// but having issues with examples/numbers01.sql line 11 "sysdate -1m"
size_clause
: UNSIGNED_INTEGER REGULAR_ID?
;
table_compression
: COMPRESS
( BASIC
| FOR ( OLTP
| (QUERY | ARCHIVE) (LOW | HIGH)?
)
)?
| NOCOMPRESS
;
physical_attributes_clause
: (PCTFREE pctfree=UNSIGNED_INTEGER
| PCTUSED pctused=UNSIGNED_INTEGER
| INITRANS inittrans=UNSIGNED_INTEGER
| storage_clause
)+
;
storage_clause
: STORAGE '('
(INITIAL initial_size=size_clause
| NEXT next_size=size_clause
| MINEXTENTS minextents=(UNSIGNED_INTEGER | UNLIMITED)
| PCTINCREASE pctincrease=UNSIGNED_INTEGER
| FREELISTS freelists=UNSIGNED_INTEGER
| FREELIST GROUPS freelist_groups=UNSIGNED_INTEGER
| OPTIMAL (size_clause | NULL )
| BUFFER_POOL (KEEP | RECYCLE | DEFAULT)
| FLASH_CACHE (KEEP | NONE | DEFAULT)
| ENCRYPT
)+
')'
;
deferred_segment_creation
: SEGMENT CREATION (IMMEDIATE | DEFERRED)
;
segment_attributes_clause
: ( physical_attributes_clause
| TABLESPACE tablespace_name=id_expression
| logging_clause
)+
;
physical_properties
: deferred_segment_creation? segment_attributes_clause table_compression?
;
row_movement_clause
: (ENABLE | DISABLE)? ROW MOVEMENT
;
flashback_archive_clause
: ( FLASHBACK ARCHIVE flashback_archive=REGULAR_ID
| NO FLASHBACK ARCHIVE
)
;
drop_table
: DROP TABLE tableview_name SEMICOLON
;
comment_on_column
: COMMENT ON COLUMN tableview_name PERIOD id_name IS quoted_string
;
// Synonym DDL Clauses
create_synonym
// Synonym's schema cannot be specified for public synonyms
: CREATE (OR REPLACE)? PUBLIC SYNONYM common_name FOR (common_name PERIOD)? id_expression (AT_SIGN common_name)?
| CREATE (OR REPLACE)? SYNONYM (common_name PERIOD)? common_name FOR (common_name PERIOD)? id_expression (AT_SIGN common_name)?
;
comment_on_table
: COMMENT ON TABLE tableview_name IS quoted_string
;
alter_table
: ALTER TABLE tableview_name
( add_constraint
| drop_constraint
| enable_constraint
| disable_constraint
)
;
add_constraint
: ADD (CONSTRAINT constraint_name)?
( primary_key_clause
| foreign_key_clause
| unique_key_clause
| check_constraint
)
;
check_constraint
: CHECK '(' expression ')' DISABLE?
;
drop_constraint
: DROP CONSTRAINT constraint_name
;
enable_constraint
: ENABLE CONSTRAINT constraint_name
;
disable_constraint
: DISABLE CONSTRAINT constraint_name
;
foreign_key_clause
: FOREIGN KEY paren_column_list references_clause on_delete_clause?
;
references_clause
: REFERENCES tableview_name paren_column_list
;
on_delete_clause
: ON DELETE (CASCADE | SET NULL)
;
unique_key_clause
: UNIQUE paren_column_list
// TODO implement USING INDEX clause
;
primary_key_clause
: PRIMARY KEY paren_column_list
// TODO implement USING INDEX clause
;
// Anonymous PL/SQL code block
anonymous_block
: (DECLARE seq_of_declare_specs)? BEGIN seq_of_statements exceptions? END SEMICOLON
;
// Common DDL Clauses
invoker_rights_clause
: AUTHID (CURRENT_USER | DEFINER)
;
compiler_parameters_clause
: identifier '=' expression
;
call_spec
: LANGUAGE (java_spec | c_spec)
;
// Call Spec Specific Clauses
java_spec
: JAVA NAME CHAR_STRING
;
c_spec
: C_LETTER (NAME CHAR_STRING)? LIBRARY identifier c_agent_in_clause? (WITH CONTEXT)? c_parameters_clause?
;
c_agent_in_clause
: AGENT IN '(' argument_list ')'
;
c_parameters_clause
: PARAMETERS '(' (argument_list | '.' '.' '.') ')'
;
parameter
: common_name parameter_desc type_spec? default_value_part?
;
parameter_desc
: (IN | OUT | INOUT | NOCOPY)*
;
default_value_part
: (ASSIGN_OP | DEFAULT) expression
;
// Elements Declarations
seq_of_declare_specs
: declare_spec+
;
declare_spec
: variable_declaration
| subtype_declaration
| cursor_declaration
| exception_declaration
| pragma_declaration
| type_declaration
| procedure_spec
| function_spec
| procedure_body
| function_body
;
// incorporates constant_declaration
variable_declaration
: identifier CONSTANT? type_spec (NOT NULL)? default_value_part? ';'
;
subtype_declaration
: SUBTYPE identifier IS type_spec (RANGE expression '..' expression)? (NOT NULL)? ';'
;
// cursor_declaration incorportates curscursor_body and cursor_spec
cursor_declaration
: CURSOR identifier ('(' (','? parameter_spec)+ ')' )? (RETURN type_spec)? (IS select_statement)? ';'
;
parameter_spec
: common_name (IN? type_spec)? default_value_part?
;
exception_declaration
: identifier EXCEPTION ';'
;
pragma_declaration
: PRAGMA (SERIALLY_REUSABLE
| AUTONOMOUS_TRANSACTION
| EXCEPTION_INIT '(' id_name ',' numeric_negative ')'
| INLINE '(' id1=identifier ',' expression ')'
| RESTRICT_REFERENCES '(' (identifier | DEFAULT) (',' identifier)+ ')') ';'
;
// Record Declaration Specific Clauses
// incorporates ref_cursor_type_definition
record_type_def
: RECORD '(' (','? field_spec)+ ')'
;
field_spec
: id_name type_spec? (NOT NULL)? default_value_part?
;
ref_cursor_type_def
: REF CURSOR (RETURN type_spec)?
;
type_declaration
: TYPE identifier IS (table_type_def | varray_type_def | record_type_def | ref_cursor_type_def) ';'
;
table_type_def
: TABLE OF type_spec table_indexed_by_part? (NOT NULL)?
;
table_indexed_by_part
: (idx1=INDEXED | idx2=INDEX) BY type_spec
;
varray_type_def
: (VARRAY | VARYING ARRAY) '(' expression ')' OF type_spec (NOT NULL)?
;
// Statements
seq_of_statements
: (statement (';' | EOF) | label_declaration)+
;
label_declaration
: ltp1= '<' '<' id_expression '>' '>'
;
statement
: CREATE swallow_to_semi
| TRUNCATE swallow_to_semi
| body
| block
| assignment_statement
| continue_statement
| exit_statement
| goto_statement
| if_statement
| loop_statement
| forall_statement
| null_statement
| raise_statement
| return_statement
| case_statement/*[true]*/
| sql_statement
| function_call
| pipe_row_statement
;
swallow_to_semi
: ~';'+
;
assignment_statement
: (general_element | bind_variable) ASSIGN_OP expression
;
continue_statement
: CONTINUE id_expression? (WHEN expression)?
;
exit_statement
: EXIT id_expression? (WHEN expression)?
;
goto_statement
: GOTO id_expression
;
if_statement
: IF expression THEN seq_of_statements elsif_part* else_part? END IF
;
elsif_part
: ELSIF expression THEN seq_of_statements
;
else_part
: ELSE seq_of_statements
;
loop_statement
: label_declaration? (WHILE expression | FOR cursor_loop_param)? LOOP seq_of_statements END LOOP id_expression?
;
// Loop Specific Clause
cursor_loop_param
: regular_name IN REVERSE? lower_bound range_separator='..' upper_bound
| record_name IN (cursor_name ('(' argument_list? ')')? | '(' select_statement ')')
;
forall_statement
: FORALL regular_name IN bounds_clause sql_statement (SAVE EXCEPTIONS)?
;
bounds_clause
: lower_bound '..' upper_bound
| INDICES OF regular_name between_bound?
| VALUES OF regular_name
;
between_bound
: BETWEEN lower_bound AND upper_bound
;
lower_bound
: concatenation
;
upper_bound
: concatenation
;
null_statement
: NULL
;
raise_statement
: RAISE id_name?
;
return_statement
: RETURN expression?
;
function_call
: CALL? routine_name function_argument?
;
pipe_row_statement
: PIPE ROW '(' expression ')';
body
: BEGIN seq_of_statements exceptions? END id_expression?
;
exceptions
: EXCEPTION exception_handler+
;
// Body Specific Clause
exception_handler
: WHEN id_name (OR id_name)* THEN seq_of_statements
;
trigger_block
: (DECLARE? seq_of_declare_specs)? body
;
anonymouse_block
: (DECLARE? seq_of_declare_specs)? body
;
block
: DECLARE seq_of_declare_specs body
;
// SQL Statements
sql_statement
: execute_immediate
| data_manipulation_language_statements
| cursor_manipulation_statements
| transaction_control_statements
;
execute_immediate
: EXECUTE IMMEDIATE expression (into_clause using_clause? | using_clause dynamic_returning_clause? | dynamic_returning_clause)?
;
// Execute Immediate Specific Clause
dynamic_returning_clause
: (RETURNING | RETURN) into_clause
;
// DML Statements
data_manipulation_language_statements
: merge_statement
| lock_table_statement
| select_statement
| update_statement
| delete_statement
| insert_statement
| explain_statement
;
// Cursor Manipulation Statements
cursor_manipulation_statements
: close_statement
| open_statement
| fetch_statement
| open_for_statement
;
close_statement
: CLOSE cursor_name
;
open_statement
: OPEN cursor_name ('(' argument_list ')')?
;
fetch_statement
: FETCH cursor_name (it1=INTO (','? variable_name)+ | BULK COLLECT INTO (','? variable_name)+)
;
open_for_statement
: OPEN variable_name FOR (select_statement | expression) using_clause?
;
// Transaction Control SQL Statements
transaction_control_statements
: set_transaction_command
| set_constraint_command
| commit_statement
| rollback_statement
| savepoint_statement
;
set_transaction_command
: SET TRANSACTION
(READ (ONLY | WRITE) | ISOLATION LEVEL (SERIALIZABLE | READ COMMITTED) | USE ROLLBACK SEGMENT common_name)?
(NAME quoted_string)?
;
set_constraint_command
: SET (CONSTRAINT | CONSTRAINTS) (ALL | (','? constraint_name)+) (IMMEDIATE | DEFERRED)
;
commit_statement
: COMMIT WORK?
(COMMENT expression | FORCE (CORRUPT_XID expression | CORRUPT_XID_ALL | expression (',' expression)?))?
write_clause?
;
write_clause
: WRITE (WAIT | NOWAIT)? (IMMEDIATE | BATCH)?
;
rollback_statement
: ROLLBACK WORK? (TO SAVEPOINT? common_name | FORCE quoted_string)?
;
savepoint_statement
: SAVEPOINT common_name
;
// Dml
/* TODO
//SHOULD BE OVERRIDEN!
compilation_unit
: seq_of_statements* EOF
;
//SHOULD BE OVERRIDEN!
seq_of_statements
: select_statement
| update_statement
| delete_statement
| insert_statement
| lock_table_statement
| merge_statement
| explain_statement
// | case_statement[true]
;
*/
explain_statement
: EXPLAIN PLAN (SET STATEMENT_ID '=' quoted_string)? (INTO tableview_name)?
FOR (select_statement | update_statement | delete_statement | insert_statement | merge_statement)
;
select_statement
: (WITH factoring_element (',' factoring_element)*)? subquery (for_update_clause | order_by_clause)*
;
// Select Specific Clauses
factoring_element
: common_name paren_column_list? AS '(' subquery order_by_clause? ')'
search_clause? cycle_clause?
;
search_clause
: SEARCH (DEPTH | BREADTH) FIRST BY id_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)?
(',' id_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)?)* SET id_name
;
cycle_clause
: CYCLE column_list SET id_name TO expression DEFAULT expression
;
subquery
: subquery_basic_elements subquery_operation_part*
;
subquery_basic_elements
: query_block
| '(' subquery ')'
;
subquery_operation_part
: (UNION ALL? | INTERSECT | MINUS) subquery_basic_elements
;
query_block
: SELECT (DISTINCT | UNIQUE | ALL)? selected_fields into_clause?
from_clause where_clause? hierarchical_query_clause? group_by_clause? model_clause?
;
selected_fields
: selected_element ( ',' selected_element )*
;
selected_element
: select_list_elements column_alias?
;
from_clause
: FROM table_ref (',' table_ref)*
;
select_list_elements
: ( tableview_name '.' )? '*'
| expression
;
// NOTE to PIVOT clause
// according the SQL reference this should not be possible
// according to he reality it is. Here we probably apply pivot/unpivot onto whole join clause
// eventhough it is not enclosed in parenthesis. See pivot examples 09,10,11
table_ref
: table_ref_aux join_clause* (pivot_clause | unpivot_clause)?
;
table_ref_aux
: table_ref_aux_internal flashback_query_clause* (/*{isTableAlias()}?*/ table_alias)?
;
table_ref_aux_internal
: dml_table_expression_clause (pivot_clause | unpivot_clause)? # table_ref_aux_internal_one
| '(' table_ref subquery_operation_part* ')' (pivot_clause | unpivot_clause)? # table_ref_aux_internal_two
| ONLY '(' dml_table_expression_clause ')' # table_ref_aux_internal_three
;
join_clause
: query_partition_clause? (CROSS | NATURAL)? (INNER | outer_join_type)?
JOIN table_ref_aux query_partition_clause? (join_on_part | join_using_part)*
;
join_on_part
: ON expression
;
join_using_part
: USING paren_column_list
;
outer_join_type
: (FULL | LEFT | RIGHT) OUTER?
;
query_partition_clause
: PARTITION BY (('(' (subquery | argument_list)? ')') | argument_list)
;
flashback_query_clause
: VERSIONS BETWEEN (SCN | TIMESTAMP) expression
| AS OF (SCN | TIMESTAMP | SNAPSHOT) expression
;
pivot_clause
: PIVOT XML? '(' (','? pivot_element)+ pivot_for_clause pivot_in_clause ')'
;
pivot_element
: id_name '(' expression ')' column_alias?
;
pivot_for_clause
: FOR (id_name | paren_column_list)
;
pivot_in_clause
: IN '(' (subquery | (','? ANY)+ | (','? pivot_in_clause_element)+) ')'
;
pivot_in_clause_element
: pivot_in_clause_elements column_alias?
;
pivot_in_clause_elements
: expression
| '(' argument_list? ')'
;
unpivot_clause
: UNPIVOT ((INCLUDE | EXCLUDE) NULLS)?
'(' (id_name | paren_column_list) pivot_for_clause unpivot_in_clause ')'
;
unpivot_in_clause
: IN '(' (','? unpivot_in_elements)+ ')'
;
unpivot_in_elements
: (id_name | paren_column_list)
(AS (constant | '(' (','? constant)+ ')'))?
;
hierarchical_query_clause
: CONNECT BY NOCYCLE? expression start_part?
| start_part CONNECT BY NOCYCLE? expression
;
start_part
: START WITH expression
;
group_by_clause
: GROUP BY (','? group_by_elements)+ having_clause?
| having_clause (GROUP BY (','? group_by_elements)+)?
;
group_by_elements
: grouping_sets_clause
| rollup_cube_clause
| expression
;
rollup_cube_clause
: (ROLLUP | CUBE) '(' (','? grouping_sets_elements)+ ')'
;
grouping_sets_clause
: GROUPING SETS '(' (','? grouping_sets_elements)+ ')'
;
grouping_sets_elements
: rollup_cube_clause
| '(' argument_list? ')'
| expression
;
having_clause
: HAVING expression
;
model_clause
: MODEL cell_reference_options* return_rows_clause? reference_model* main_model
;
cell_reference_options
: (IGNORE | KEEP) NAV
| UNIQUE (DIMENSION | SINGLE REFERENCE)
;
return_rows_clause
: RETURN (UPDATED | ALL) ROWS
;
reference_model
: REFERENCE common_name ON '(' subquery ')' model_column_clauses cell_reference_options*
;
main_model
: (MAIN common_name)? model_column_clauses cell_reference_options* model_rules_clause
;
model_column_clauses
: model_column_partition_part? DIMENSION BY model_column_list MEASURES model_column_list
;
model_column_partition_part
: PARTITION BY model_column_list
;
model_column_list
: '(' (','? model_column)+ ')'
;
model_column
: (expression | query_block) column_alias?
;
model_rules_clause
: model_rules_part? '(' (','? model_rules_element)* ')'
;
model_rules_part
: RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? model_iterate_clause?
;
model_rules_element
: (UPDATE | UPSERT ALL?)? cell_assignment order_by_clause? '=' expression
;
cell_assignment
: model_expression
;
model_iterate_clause
: ITERATE '(' expression ')' until_part?
;
until_part
: UNTIL '(' expression ')'
;
order_by_clause
: ORDER SIBLINGS? BY (','? order_by_elements)+
;
order_by_elements
: expression (ASC | DESC)? (NULLS (FIRST | LAST))?
;
for_update_clause
: FOR UPDATE for_update_of_part? for_update_options?
;
for_update_of_part
: OF column_list
;
for_update_options
: SKIP_ LOCKED
| NOWAIT
| WAIT expression
;
update_statement
: UPDATE general_table_ref update_set_clause where_clause? static_returning_clause? error_logging_clause?
;
// Update Specific Clauses
update_set_clause
: SET
((','? column_based_update_set_clause)+ | VALUE '(' identifier ')' '=' expression)
;
column_based_update_set_clause
: id_name '=' expression
| paren_column_list '=' subquery
;
delete_statement
: DELETE FROM? general_table_ref where_clause? static_returning_clause? error_logging_clause?
;
insert_statement
: INSERT (single_table_insert | multi_table_insert)
;
// Insert Specific Clauses
single_table_insert
: insert_into_clause (values_clause static_returning_clause? | select_statement) error_logging_clause?
;
multi_table_insert
: (ALL multi_table_element+ | conditional_insert_clause) select_statement
;
multi_table_element
: insert_into_clause values_clause? error_logging_clause?
;
conditional_insert_clause
: (ALL | FIRST)? conditional_insert_when_part+ conditional_insert_else_part?
;
conditional_insert_when_part
: WHEN expression THEN multi_table_element+
;
conditional_insert_else_part
: ELSE multi_table_element+
;
insert_into_clause
: INTO general_table_ref paren_column_list?
;
values_clause
: VALUES ( regular_id |'(' argument_list? ')' )
;
merge_statement
: MERGE INTO tableview_name table_alias? USING selected_tableview ON '(' expression ')'
(merge_update_clause merge_insert_clause? | merge_insert_clause merge_update_clause?)?
error_logging_clause?
;
// Merge Specific Clauses
merge_update_clause
: WHEN MATCHED THEN UPDATE SET merge_element (',' merge_element)* where_clause? merge_update_delete_part?
;
merge_element
: id_name '=' expression
;
merge_update_delete_part
: DELETE where_clause
;
merge_insert_clause
: WHEN NOT MATCHED THEN INSERT paren_column_list?
VALUES '(' argument_list? ')' where_clause?
;
selected_tableview
: (tableview_name | '(' select_statement ')') table_alias?
;
lock_table_statement
: LOCK TABLE lock_table_element (',' lock_table_element)* IN lock_mode MODE wait_nowait_part?
;
wait_nowait_part
: WAIT expression
| NOWAIT
;
// Lock Specific Clauses
lock_table_element
: tableview_name partition_extension_clause?
;
lock_mode
: ROW SHARE
| ROW EXCLUSIVE
| SHARE UPDATE?
| SHARE ROW EXCLUSIVE
| EXCLUSIVE
;
// Common DDL Clauses
general_table_ref
: (dml_table_expression_clause | ONLY '(' dml_table_expression_clause ')') table_alias?
;
static_returning_clause
: (RETURNING | RETURN) argument_list into_clause
;
error_logging_clause
: LOG ERRORS error_logging_into_part? expression? error_logging_reject_part?
;
error_logging_into_part
: INTO tableview_name
;
error_logging_reject_part
: REJECT LIMIT (UNLIMITED | expression)
;
dml_table_expression_clause
: table_collection_expression
| '(' select_statement subquery_restriction_clause? ')'
| tableview_name sample_clause?
;
table_collection_expression
: (TABLE | THE) ('(' subquery ')' | '(' expression ')' ('(' '+' ')')?)
;
subquery_restriction_clause
: WITH (READ ONLY | CHECK OPTION (CONSTRAINT constraint_name)?)
;
sample_clause
: SAMPLE BLOCK? '(' expression (',' expression)? ')' seed_part?
;
seed_part
: SEED '(' expression ')'
;
argument_list
: argument (',' argument)*
;
// Expression & Condition
expression
: cursor_expression
| logical_expression
;
cursor_expression
: CURSOR '(' subquery ')'
;
logical_expression
: multiset_expression is_expr?
| NOT logical_expression
| logical_expression AND logical_expression
| logical_expression OR logical_expression
;
is_expr
: IS NOT? (
NULL | NAN | PRESENT | INFINITE | A_LETTER SET | EMPTY | OF TYPE?
'(' ONLY? type_spec (',' type_spec)* ')' )
;
multiset_expression
: relational_expression (multiset_type=(MEMBER | SUBMULTISET) OF? concatenation)?
;
relational_expression
: compound_expression
| relational_expression relational_operator compound_expression
;
compound_expression
: concatenation bool_expr?
;
bool_expr
: NOT? (
IN in_elements
| BETWEEN between_elements
| like_type=(LIKE | LIKEC | LIKE2 | LIKE4)
concatenation (ESCAPE concatenation)?
)
;
relational_operator
: '='
| (NOT_EQUAL_OP | '<' '>' | '!' '=' | '^' '=')
| ('<' | '>') '='?
;
in_elements
: '(' subquery ')'
| '(' concatenation (',' concatenation)* ')'
| constant
| bind_variable
| general_element
;
between_elements
: concatenation AND concatenation
;
concatenation
: model_expression interval_expression?
| concatenation op=(ASTERISK | SOLIDUS) model_expression
| concatenation op=(PLUS_SIGN | MINUS_SIGN) model_expression
| concatenation BAR BAR model_expression
;
interval_expression
: AT (LOCAL | TIME ZONE concatenation)
| DAY ('(' concatenation ')')? TO SECOND ('(' concatenation ')')?
| YEAR ('(' concatenation ')')? TO MONTH
;
model_expression
: unary_expression ('[' model_expression_element ']')?
;
model_expression_element
: (ANY | expression) (',' (ANY | expression))*
| single_column_for_loop (',' single_column_for_loop)*
| multi_column_for_loop
;
single_column_for_loop
: FOR id_name
( IN '(' argument_list? ')'
| (LIKE expression)? FROM fromExpr=expression TO toExpr=expression
action_type=(INCREMENT | DECREMENT) action_expr=expression)
;
multi_column_for_loop
: FOR paren_column_list
IN '(' (subquery | '(' argument_list? ')') ')'
;
unary_expression
: ('-' | '+') unary_expression
| PRIOR unary_expression
| CONNECT_BY_ROOT unary_expression
| /*TODO {input.LT(1).getText().equalsIgnoreCase("new") && !input.LT(2).getText().equals(".")}?*/ NEW unary_expression
| DISTINCT unary_expression
| ALL unary_expression
| /*TODO{(input.LA(1) == CASE || input.LA(2) == CASE)}?*/ case_statement /*[false]*/
| quantified_expression
| standard_function
| atom
;
case_statement /*TODO [boolean isStatementParameter]
TODO scope {
boolean isStatement;
}
@init {$case_statement::isStatement = $isStatementParameter;}*/
: id_expression? ck1=CASE expression? case_when_part+ case_else_part? END CASE? id_expression?
;
// CASE
case_when_part
: WHEN expression THEN (/*TODO{$case_statement::isStatement}?*/ seq_of_statements | expression)
;
case_else_part
: ELSE (/*{$case_statement::isStatement}?*/ seq_of_statements | expression)
;
atom
: table_element outer_join_sign
| bind_variable
| constant
| general_element
| '(' subquery ')' subquery_operation_part*
| '(' expression ')'
;
quantified_expression
: (SOME | EXISTS | ALL | ANY) ('(' subquery ')' | '(' expression ')')
;
standard_function
: special_function
| regular_function
| cursor_percent
;
special_function
: CHR '(' concatenation USING NCHAR_CS ')'
| TRIM '(' ((LEADING | TRAILING | BOTH)? quoted_string? FROM)? concatenation ')'
| SUM '(' (DISTINCT | ALL)? expression ')'
| COUNT '(' ( '*' | ((DISTINCT | UNIQUE | ALL)? concatenation)? ) ')' over_clause?
| ROUND '(' expression (',' UNSIGNED_INTEGER)? ')'
| AVG '(' (DISTINCT | ALL)? expression ')'
| MAX '(' (DISTINCT | ALL)? expression ')'
| CAST '(' (MULTISET '(' subquery ')' | concatenation) AS type_spec ')'
| COLLECT '(' (DISTINCT | UNIQUE)? concatenation collect_order_by_part? ')'
| DECOMPOSE '(' concatenation (CANONICAL | COMPATIBILITY)? ')'
| EXTRACT '(' regular_id FROM concatenation ')'
| TRANSLATE '(' expression (USING (CHAR_CS | NCHAR_CS))? (',' expression)* ')'
| TREAT '(' expression AS REF? type_spec ')'
| within_or_over_clause_keyword function_argument
( WITHIN GROUP '(' order_by_clause ')' | over_clause )+
;
regular_function
: id_expr_name '(' argument_list? ')'
;
cursor_percent
: cursor_name ( PERCENT_ISOPEN | PERCENT_FOUND | PERCENT_NOTFOUND | PERCENT_ROWCOUNT )
;
over_clause_keyword
: AVG
| CORR
| LAG
| LEAD
| MAX
| MEDIAN
| MIN
| NTILE
| RATIO_TO_REPORT
| ROW_NUMBER
| SUM
| VARIANCE
| REGR_
| STDDEV
| VAR_
| COVAR_
;
within_or_over_clause_keyword
: CUME_DIST
| DENSE_RANK
| LISTAGG
| PERCENT_RANK
| PERCENTILE_CONT
| PERCENTILE_DISC
| RANK
;
standard_prediction_function_keyword
: PREDICTION
| PREDICTION_BOUNDS
| PREDICTION_COST
| PREDICTION_DETAILS
| PREDICTION_PROBABILITY
| PREDICTION_SET
;
over_clause
: OVER '(' query_partition_clause? (order_by_clause windowing_clause?)? ')'
;
windowing_clause
: windowing_type
(BETWEEN windowing_elements AND windowing_elements | windowing_elements)
;
windowing_type
: ROWS
| RANGE
;
windowing_elements
: UNBOUNDED PRECEDING
| CURRENT ROW
| concatenation (PRECEDING | FOLLOWING)
;
using_clause
: USING ('*' | (','? using_element)+)
;
using_element
: (IN OUT? | OUT)? select_list_elements column_alias?
;
collect_order_by_part
: ORDER BY concatenation
;
cost_matrix_clause
: COST (MODEL AUTO? | '(' (','? common_name)+ ')' VALUES '(' argument_list? ')')
;
xml_passing_clause
: PASSING (BY VALUE)? expression column_alias? (',' expression column_alias?)
;
xml_attributes_clause
: XMLATTRIBUTES
'(' (ENTITYESCAPING | NOENTITYESCAPING)? (SCHEMACHECK | NOSCHEMACHECK)?
(','? xml_multiuse_expression_element)+ ')'
;
xml_namespaces_clause
: XMLNAMESPACES
'(' (concatenation column_alias)? (',' concatenation column_alias)*
xml_general_default_part? ')'
;
xml_table_column
: xml_column_name
(FOR ORDINALITY | type_spec (PATH concatenation)? xml_general_default_part?)
;
xml_general_default_part
: DEFAULT concatenation
;
xml_multiuse_expression_element
: expression (AS (id_expression | EVALNAME concatenation))?
;
xmlroot_param_version_part
: VERSION (NO VALUE | expression)
;
xmlroot_param_standalone_part
: STANDALONE (YES | NO VALUE?)
;
xmlserialize_param_enconding_part
: ENCODING concatenation
;
xmlserialize_param_version_part
: VERSION concatenation
;
xmlserialize_param_ident_part
: NO INDENT
| INDENT (SIZE '=' concatenation)?
;
// SqlPlus
sql_plus_command
: '/'
| EXIT
| PROMPT
| SHOW (ERR | ERRORS)
| START_CMD
| whenever_command
| set_command
;
whenever_command
: WHENEVER (SQLERROR | OSERROR)
( EXIT (SUCCESS | FAILURE | WARNING) (COMMIT | ROLLBACK)
| CONTINUE (COMMIT | ROLLBACK | NONE))
;
set_command
: SET regular_id (CHAR_STRING | ON | OFF | /*EXACT_NUM_LIT*/numeric | regular_id)
;
// Common
partition_extension_clause
: (SUBPARTITION | PARTITION) FOR? '(' argument_list? ')'
;
column_alias
: AS? (identifier | quoted_string)
| AS
;
table_alias
: identifier
| quoted_string
;
where_clause
: WHERE (CURRENT OF cursor_name | expression)
;
into_clause
: (BULK COLLECT)? INTO (','? variable_name)+
;
// Common Named Elements
xml_column_name
: identifier
| quoted_string
;
routine_name
: id_name ('@' common_name)?
;
common_name
: identifier
;
regular_name
: identifier ('.' id_expression)?
;
id_name
: identifier ('.' id_expression)*
;
grantee_name
: id_expression identified_by?
;
role_name
: id_expression
| CONNECT
;
constraint_name
: id_name ('@' common_name)?
;
id_expr_name
: id_expression ('.' id_expression)*
;
variable_name
: (INTRODUCER id_expr_name)? id_expression ('.' id_expression)?
| bind_variable
;
cursor_name
: general_element
| bind_variable
;
record_name
: identifier
| bind_variable
;
tableview_name
: identifier ('.' id_expression)?
('@' common_name | /*TODO{!(input.LA(2) == BY)}?*/ partition_extension_clause)?
;
// Represents a valid DB object name in DDL commands which are valid for several DB (or schema) objects.
// For instance, create synonym ... for <DB object name>, or rename <old DB object name> to <new DB object name>.
// Both are valid for sequences, tables, views, etc.
grant_object_name
: tableview_name
| USER (','? id_expression)+
| DIRECTORY id_expression
| EDITION id_expression
| MINING MODEL id_expression
| JAVA (SOURCE | RESOURCE) id_expression
| SQL TRANSLATION PROFILE id_expression
;
column_list
: (','? id_name)+
;
paren_column_list
: LEFT_PAREN column_list RIGHT_PAREN
;
// PL/SQL Specs
// NOTE: In reality this applies to aggregate functions only
keep_clause
: KEEP '(' DENSE_RANK (FIRST | LAST) order_by_clause ')' over_clause?
;
function_argument
: '(' argument_list? ')' keep_clause?
;
function_argument_analytic
: '(' (','? argument respect_or_ignore_nulls?)* ')' keep_clause?
;
function_argument_modeling
: '(' id_name (',' (numeric | NULL) (',' (numeric | NULL))?)?
USING (tableview_name '.' '*' | '*' | (','? expression column_alias?)+)
')' keep_clause?
;
respect_or_ignore_nulls
: (RESPECT | IGNORE) NULLS
;
argument
: (identifier '=' '>')? expression
;
type_spec
: datatype
| REF? id_expr_name (PERCENT_ROWTYPE | PERCENT_TYPE)?
;
datatype
: native_datatype_element precision_part? (WITH LOCAL? TIME ZONE | CHARACTER SET id_expr_name)?
| INTERVAL (YEAR | DAY) ('(' expression ')')? TO (MONTH | SECOND) ('(' expression ')')?
;
precision_part
: '(' numeric (',' numeric)? (CHAR | BYTE)? ')'
;
native_datatype_element
: BINARY_INTEGER
| PLS_INTEGER
| NATURAL
| BINARY_FLOAT
| BINARY_DOUBLE
| NATURALN
| POSITIVE
| POSITIVEN
| SIGNTYPE
| SIMPLE_INTEGER
| NVARCHAR2
| DEC
| INTEGER
| INT
| NUMERIC
| SMALLINT
| NUMBER
| DECIMAL
| DOUBLE PRECISION?
| FLOAT
| REAL
| NCHAR
| LONG RAW?
| CHAR
| CHARACTER
| VARCHAR2
| VARCHAR
| STRING
| RAW
| BOOLEAN
| DATE
| ROWID
| UROWID
| YEAR
| MONTH
| DAY
| HOUR
| MINUTE
| SECOND
| TIMEZONE_HOUR
| TIMEZONE_MINUTE
| TIMEZONE_REGION
| TIMEZONE_ABBR
| TIMESTAMP
| TIMESTAMP_UNCONSTRAINED
| TIMESTAMP_TZ_UNCONSTRAINED
| TIMESTAMP_LTZ_UNCONSTRAINED
| YMINTERVAL_UNCONSTRAINED
| DSINTERVAL_UNCONSTRAINED
| BFILE
| BLOB
| CLOB
| NCLOB
| MLSLABEL
;
bind_variable
: (BINDVAR | ':' UNSIGNED_INTEGER)
// Pro*C/C++ indicator variables
(INDICATOR? (BINDVAR | ':' UNSIGNED_INTEGER))?
('.' general_element_part)*
;
general_element
: general_element_part ('.' general_element_part)*
;
general_element_part
: (INTRODUCER id_expr_name)? id_expr_name ('@' common_name)? function_argument?
;
table_element
: (INTRODUCER id_expr_name)? id_expr_name
;
object_privilege
: ALL PRIVILEGES?
| ALTER
| DEBUG
| DELETE
| EXECUTE
| FLASHBACK ARCHIVE
| INDEX
| INHERIT PRIVILEGES
| INSERT
| KEEP SEQUENCE
| MERGE VIEW
| ON COMMIT REFRESH
| QUERY REWRITE
| READ
| REFERENCES
| SELECT
| TRANSLATE SQL
| UNDER
| UPDATE
| USE
| WRITE
;
//Ordered by type rather than alphabetically
system_privilege
: ALL PRIVILEGES
| ADVISOR
| ADMINISTER ANY? SQL TUNING SET
| (ALTER | CREATE | DROP) ANY SQL PROFILE
| ADMINISTER SQL MANAGEMENT OBJECT
| CREATE ANY? CLUSTER
| (ALTER | DROP) ANY CLUSTER
| (CREATE | DROP) ANY CONTEXT
| EXEMPT REDACTION POLICY
| ALTER DATABASE
| (ALTER | CREATE) PUBLIC? DATABASE LINK
| DROP PUBLIC DATABASE LINK
| DEBUG CONNECT SESSION
| DEBUG ANY PROCEDURE
| ANALYZE ANY DICTIONARY
| CREATE ANY? DIMENSION
| (ALTER | DROP) ANY DIMENSION
| (CREATE | DROP) ANY DIRECTORY
| (CREATE | DROP) ANY EDITION
| FLASHBACK (ARCHIVE ADMINISTER | ANY TABLE)
| (ALTER | CREATE | DROP) ANY INDEX
| CREATE ANY? INDEXTYPE
| (ALTER | DROP | EXECUTE) ANY INDEXTYPE
| CREATE (ANY | EXTERNAL)? JOB
| EXECUTE ANY (CLASS | PROGRAM)
| MANAGE SCHEDULER
| ADMINISTER KEY MANAGEMENT
| CREATE ANY? LIBRARY
| (ALTER | DROP | EXECUTE) ANY LIBRARY
| LOGMINING
| CREATE ANY? MATERIALIZED VIEW
| (ALTER | DROP) ANY MATERIALIZED VIEW
| GLOBAL? QUERY REWRITE
| ON COMMIT REFRESH
| CREATE ANY? MINING MODEL
| (ALTER | DROP | SELECT | COMMENT) ANY MINING MODEL
| CREATE ANY? CUBE
| (ALTER | DROP | SELECT | UPDATE) ANY CUBE
| CREATE ANY? MEASURE FOLDER
| (DELETE | DROP | INSERT) ANY MEASURE FOLDER
| CREATE ANY? CUBE DIMENSION
| (ALTER | DELETE | DROP | INSERT | SELECT | UPDATE) ANY CUBE DIMENSION
| CREATE ANY? CUBE BUILD PROCESS
| (DROP | UPDATE) ANY CUBE BUILD PROCESS
| CREATE ANY? OPERATOR
| (ALTER | DROP | EXECUTE) ANY OPERATOR
| (CREATE | ALTER | DROP) ANY OUTLINE
| CREATE PLUGGABLE DATABASE
| SET CONTAINER
| CREATE ANY? PROCEDURE
| (ALTER | DROP | EXECUTE) ANY PROCEDURE
| (CREATE | ALTER | DROP ) PROFILE
| CREATE ROLE
| (ALTER | DROP | GRANT) ANY ROLE
| (CREATE | ALTER | DROP) ROLLBACK SEGMENT
| CREATE ANY? SEQUENCE
| (ALTER | DROP | SELECT) ANY SEQUENCE
| (ALTER | CREATE | RESTRICTED) SESSION
| ALTER RESOURCE COST
| CREATE ANY? SQL TRANSLATION PROFILE
| (ALTER | DROP | USE) ANY SQL TRANSLATION PROFILE
| TRANSLATE ANY SQL
| CREATE ANY? SYNONYM
| DROP ANY SYNONYM
| (CREATE | DROP) PUBLIC SYNONYM
| CREATE ANY? TABLE
| (ALTER | BACKUP | COMMENT | DELETE | DROP | INSERT | LOCK | READ | SELECT | UPDATE) ANY TABLE
| (CREATE | ALTER | DROP | MANAGE | UNLIMITED) TABLESPACE
| CREATE ANY? TRIGGER
| (ALTER | DROP) ANY TRIGGER
| ADMINISTER DATABASE TRIGGER
| CREATE ANY? TYPE
| (ALTER | DROP | EXECUTE | UNDER) ANY TYPE
| (CREATE | ALTER | DROP) USER
| CREATE ANY? VIEW
| (DROP | UNDER | MERGE) ANY VIEW
| (ANALYZE | AUDIT) ANY
| BECOME USER
| CHANGE NOTIFICATION
| EXEMPT ACCESS POLICY
| FORCE ANY? TRANSACTION
| GRANT ANY OBJECT? PRIVILEGE
| INHERIT ANY PRIVILEGES
| KEEP DATE TIME
| KEEP SYSGUID
| PURGE DBA_RECYCLEBIN
| RESUMABLE
| SELECT ANY (DICTIONARY | TRANSACTION)
| SYSBACKUP
| SYSDBA
| SYSDG
| SYSKM
| SYSOPER
;
// $>
// $<Lexer Mappings
constant
: TIMESTAMP (quoted_string | bind_variable) (AT TIME ZONE quoted_string)?
| INTERVAL (quoted_string | bind_variable | general_element_part)
(YEAR | MONTH | DAY | HOUR | MINUTE | SECOND)
('(' (UNSIGNED_INTEGER | bind_variable) (',' (UNSIGNED_INTEGER | bind_variable) )? ')')?
(TO ( DAY | HOUR | MINUTE | SECOND ('(' (UNSIGNED_INTEGER | bind_variable) ')')?))?
| numeric
| DATE quoted_string
| quoted_string
| NULL
| TRUE
| FALSE
| DBTIMEZONE
| SESSIONTIMEZONE
| MINVALUE
| MAXVALUE
| DEFAULT
;
numeric
: UNSIGNED_INTEGER
| APPROXIMATE_NUM_LIT
;
numeric_negative
: MINUS_SIGN numeric
;
quoted_string
: CHAR_STRING
//| CHAR_STRING_PERL
| NATIONAL_CHAR_STRING_LIT
;
identifier
: (INTRODUCER id_expr_name)? id_expression
;
id_expression
: regular_id
| delimited_id
;
delimited_id
: DELIMITED_ID
;
outer_join_sign
: '(' '+' ')'
;
regular_id
: REGULAR_ID
| A_LETTER
| ADD
| AFTER
| AGENT
| AGGREGATE
//| ALL
//| ALTER
| ANALYZE
//| AND
//| ANY
| ARRAY
// | AS
//| ASC
| ASSOCIATE
| AT
| ATTRIBUTE
| AUDIT
| AUTHID
| AUTO
| AUTOMATIC
| AUTONOMOUS_TRANSACTION
| BATCH
| BEFORE
//| BEGIN
// | BETWEEN
| BFILE
| BINARY_DOUBLE
| BINARY_FLOAT
| BINARY_INTEGER
| BLOB
| BLOCK
| BODY
| BOOLEAN
| BOTH
// | BREADTH
| BULK
// | BY
| BYTE
| C_LETTER
| CACHE
| CALL
| CANONICAL
| CASCADE
//| CASE
| CAST
| CHAR
| CHAR_CS
| CHARACTER
//| CHECK
| CHR
| CLASS
| CLOB
| CLOSE
| CLUSTER
| COLLECT
| COLUMNS
| COMMENT
| COMMIT
| COMMITTED
| COMPATIBILITY
| COMPLETE
| COMPILE
| COMPOUND
//| CONNECT
//| CONNECT_BY_ROOT
| CONSTANT
| CONSTRAINT
| CONSTRAINTS
| CONSTRUCTOR
| CONTENT
| CONTEXT
| CONTINUE
| CONVERT
| CORRUPT_XID
| CORRUPT_XID_ALL
| COST
| COUNT
//| CREATE
| CROSS
| CUBE
//| CURRENT
| CURRENT_USER
| CURSOR
| CUSTOMDATUM
| CYCLE
| DATA
| DATABASE
//| DATE
| DAY
| DB_ROLE_CHANGE
| DBTIMEZONE
| DDL
| DEBUG
| DEC
| DECIMAL
| DECODE
//| DECLARE
| DECOMPOSE
| DECREMENT
//| DEFAULT
| DEFAULTS
| DEFERRED
| DEFINER
| DELETE
// | DEPTH
//| DESC
| DETERMINISTIC
| DIMENSION
| DISABLE
| DISASSOCIATE
| DIRECTORY
//| DISTINCT
| DOCUMENT
| DOUBLE
//| DROP
| DSINTERVAL_UNCONSTRAINED
| EACH
| ELEMENT
//| ELSE
//| ELSIF
| EMPTY
| ENABLE
| ENCODING
| ENCRYPT
//| END
| ENTITYESCAPING
| ERR
| ERRORS
| ESCAPE
| EVALNAME
| EXCEPTION
| EXCEPTION_INIT
| EXCEPTIONS
| EXCLUDE
//| EXCLUSIVE
| EXECUTE
//| EXISTS
| EXIT
| EXPLAIN
| EXTERNAL
| EXTRACT
| FAILURE
//| FALSE
//| FETCH
| FINAL
| FIRST
| FIRST_VALUE
| FLOAT
| FOLLOWING
| FOLLOWS
//| FOR
| FORALL
| FORCE
// | FROM
| FULL
| FUNCTION
//| GOTO
//| GRANT
//| GROUP
| GREATEST
| GROUPING
| HASH
//| HAVING
| HIDE
| HOUR
| ID
| IDENTIFIER
//| IF
| IGNORE
| IMMEDIATE
// | IN
| INCLUDE
| INCLUDING
| INCREMENT
| INDENT
//| INDEX
| INDEXED
| INDICATOR
| INDICES
| INFINITE
| INLINE
| INNER
| INOUT
//| INSERT
| INSTANTIABLE
| INSTEAD
| INT
| INTEGER
//| INTERSECT
| INTERVAL
// | INTO
| INVALIDATE
//| IS
| ISOLATION
| ITERATE
| JAVA
| JOIN
| KEEP
| KEY
| LANGUAGE
| LAST
| LAST_VALUE
| LEADING
| LEAST
| LEFT
| LEVEL
| LIBRARY
// | LIKE
| LIKE2
| LIKE4
| LIKEC
| LIMIT
| LINK
| LIST
| LOCAL
//| LOCK
| LOCKED
| LOG
| LOGOFF
| LOGON
| LONG
| LOOP
| MAIN
| MAP
| MATCHED
| MAXVALUE
| MEASURES
| MEMBER
| MERGE
//| MINUS
| MINIMUM
| MINUTE
| MINVALUE
| MLSLABEL
//| MODE
| MODEL
| MODIFY
| MONTH
| MULTISET
| NAME
| NAN
| NATURAL
| NATURALN
| NAV
| NCHAR
| NCHAR_CS
| NCLOB
| NESTED
| NEW
| NEXT
| NO
| NOAUDIT
// | NOCACHE
| NOCOPY
| NOCYCLE
| NOENTITYESCAPING
//| NOMAXVALUE
//| NOMINVALUE
| NONE
// | NOORDER
| NOSCHEMACHECK
//| NOT
//| NOWAIT
// | NULL
| NULLS
| NUMBER
| NUMERIC
| NVARCHAR2
| NVL
| OBJECT
//| OF
| OFF
| OID
| OLD
//| ON
| ONLINE
| ONLY
| OPEN
| OPERATOR
//| OPTION
//| OR
| ORADATA
//| ORDER
| ORDINALITY
| OSERROR
| OUT
| OUTER
| OVER
| OVERRIDING
| PACKAGE
| PARALLEL_ENABLE
| PARAMETERS
| PARENT
| PARTITION
| PASSING
| PATH
//| PERCENT_ROWTYPE
//| PERCENT_TYPE
| PIPELINED
//| PIVOT
| PLAN
| PLS_INTEGER
| POLICY
| POSITIVE
| POSITIVEN
| PRAGMA
| PRECEDING
| PRECISION
| PRESENT
//| PRIOR
//| PROCEDURE
| PROFILE
| PROGRAM
| RAISE
| RANGE
| RAW
| READ
| REAL
| RECORD
| REF
| REFERENCE
| REFERENCING
| REJECT
| RELIES_ON
| RENAME
| REPLACE
| RESPECT
| RESTRICT_REFERENCES
| RESULT
| RESULT_CACHE
| RETURN
| RETURNING
| REUSE
| REVERSE
//| REVOKE
| RIGHT
| ROLES
| ROLLBACK
| ROLLUP
| ROW
| ROWID
| ROWS
| RULES
| SALT
| SAMPLE
| SAVE
| SAVEPOINT
| SCHEMA
| SCHEMACHECK
| SCN
// | SEARCH
| SECOND
| SEED
| SEGMENT
// | SELECT
| SELF
// | SEQUENCE
| SEQUENTIAL
| SERIALIZABLE
| SERIALLY_REUSABLE
| SERVERERROR
| SESSIONTIMEZONE
| SET
| SETS
| SETTINGS
//| SHARE
| SHOW
| SHUTDOWN
| SIBLINGS
| SIGNTYPE
| SIMPLE_INTEGER
| SINGLE
//| SIZE
| SKIP_
| SMALLINT
| SNAPSHOT
| SOME
| SPECIFICATION
| SQL
| SQLDATA
| SQLERROR
| STANDALONE
//| START
| STARTUP
| STATEMENT
| STATEMENT_ID
| STATIC
| STATISTICS
| STRING
| STORE
| SUBSTR
| SUBMULTISET
| SUBPARTITION
| SUBSTITUTABLE
| SUBTYPE
| SUCCESS
| SUSPEND
| SYSDATE
| TEMPORARY
//| TABLE
//| THE
//| THEN
| TIME
| TIMESTAMP
| TIMESTAMP_LTZ_UNCONSTRAINED
| TIMESTAMP_TZ_UNCONSTRAINED
| TIMESTAMP_UNCONSTRAINED
| TIMEZONE_ABBR
| TIMEZONE_HOUR
| TIMEZONE_MINUTE
| TIMEZONE_REGION
//| TO
| TO_DATE
| TO_CHAR
| TRAILING
| TRANSACTION
| TRANSLATE
| TREAT
| TRIGGER
| TRIM
//| TRUE
| TRUNCATE
| TYPE
| UNBOUNDED
| UNDER
//| UNION
//| UNIQUE
| UNLIMITED
//| UNPIVOT
| UNTIL
//| UPDATE
| UPDATED
| UPSERT
| UROWID
| USE
| USER
| USERS
//| USING
| VALIDATE
| VALUE
//| VALUES
| VARCHAR
| VARCHAR2
| VARIABLE
| VARRAY
| VARYING
| VERSION
| VERSIONS
| WAIT
| WARNING
| WELLFORMED
// | WHEN
| WHENEVER
// | WHERE
| WHILE
//| WITH
| WITHIN
| WORK
| WRITE
| XML
| XMLAGG
| XMLATTRIBUTES
| XMLCAST
| XMLCOLATTVAL
| XMLELEMENT
| XMLEXISTS
| XMLFOREST
| XMLNAMESPACES
| XMLPARSE
| XMLPI
| XMLQUERY
| XMLROOT
| XMLSERIALIZE
| XMLTABLE
| YEAR
| YES
| YMINTERVAL_UNCONSTRAINED
| ZONE
| PREDICTION
| PREDICTION_BOUNDS
| PREDICTION_COST
| PREDICTION_DETAILS
| PREDICTION_PROBABILITY
| PREDICTION_SET
| CUME_DIST
| DENSE_RANK
| LISTAGG
| PERCENT_RANK
| PERCENTILE_CONT
| PERCENTILE_DISC
| RANK
| AVG
| CORR
| LAG
| LEAD
| MAX
| MEDIAN
| MIN
| NTILE
| RATIO_TO_REPORT
| ROW_NUMBER
| SUM
| VARIANCE
| REGR_
| STDDEV
| VAR_
| COVAR_
;
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_86.asm | ljhsiun2/medusa | 9 | 164468 | .global s_prepare_buffers
s_prepare_buffers:
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x95c3, %rsi
lea addresses_WC_ht+0x6f2f, %rdi
nop
xor $11697, %rdx
mov $71, %rcx
rep movsw
nop
nop
add $1312, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r8
push %rax
push %rdx
push %rsi
// Store
lea addresses_WT+0x1753b, %r15
nop
cmp $55110, %rsi
movb $0x51, (%r15)
nop
nop
nop
nop
add %rdx, %rdx
// Faulty Load
lea addresses_PSE+0x63bb, %rax
xor %r13, %r13
movups (%rax), %xmm6
vpextrq $1, %xmm6, %r15
lea oracles, %r10
and $0xff, %r15
shlq $12, %r15
mov (%r10,%r15,1), %r15
pop %rsi
pop %rdx
pop %rax
pop %r8
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
sr-service-impl/src/main/resources/QueryExpression.g4 | bianyun1981/spring-rest-backend | 5 | 2462 | grammar QueryExpression;
fragment LETTER: [A-Z_];
fragment IPV6_OCTECT: [0-9A-F][0-9A-F][0-9A-F][0-9A-F];
//IPV4_OCTECT: [0-9]?[0-9]?[0-9];
fragment DEC_DOT_DEC: (DEC_DIGIT+ '.' DEC_DIGIT+ | DEC_DIGIT+ '.' | '.' DEC_DIGIT+);
fragment HEX_DIGIT: [0-9A-F];
fragment DEC_DIGIT: [0-9];
fragment OCTAL_ESC
: '\\' ('0'..'3') ('0'..'7') ('0'..'7')
| '\\' ('0'..'7') ('0'..'7')
| '\\' ('0'..'7')
;
fragment ESC_SEQ
// : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
// |
: UNICODE_ESC
| OCTAL_ESC
;
fragment UNICODE_ESC
: '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
;
WS : [\t\r\n ]+->skip;
LITERAL_NULL: ('null' | 'NULL');
LITERAL_TRUE: ('true' | 'TRUE');
LITERAL_FALSE: ('false' | 'FALSE');
DECIMAL: DEC_DIGIT+;
OP_CONTAINS: 'contains';
OP_LIKE: 'like';
IDENTIFIER: ( [a-zA-Z_#] ) ( [a-zA-Z_#$@0-9.] )*;
REAL: (DECIMAL | DEC_DOT_DEC) ('E' [+-]? DEC_DIGIT+);
LR_BRACKET: '(';
RR_BRACKET: ')';
EQUAL: '=';
GREATER: '>';
LESS: '<';
EXCLAMATION: '!';
DOT: '.';
UNDERLINE: '_';
LOGICAL_AND: '&&';
LOGICAL_OR: '||';
SPACE: [ \t\r\n]+;
STRING: '\''( ESC_SEQ | ~('\\'|'\'') )*'\'';
operator: GREATER | LESS | EQUAL | EXCLAMATION EQUAL | GREATER EQUAL | LESS EQUAL | OP_LIKE | OP_CONTAINS;
field: IDENTIFIER;
value: (STRING | DECIMAL | LITERAL_NULL | LITERAL_TRUE | LITERAL_FALSE | IDENTIFIER);
logical_op: LOGICAL_AND | LOGICAL_OR;
//prog: expr+;
condition: field operator value;
expr: expr (logical_op expr)+
| LR_BRACKET expr RR_BRACKET
| condition
;
|
Framework/trackmo/framework/player.asm | kosmonautdnb/TheLandsOfZador | 0 | 175786 | PLAYER_BEGIN SET .
include "player_const.asm"
SUBROUTINE
include "player_code.asm"
include "player_frqtab.asm"
echo "PLAYER: ",[. - PLAYER_BEGIN]
ZP_USEBIOSLOADING = $8f ; 1 ; also defined in persistent.asm
ZP_FOURBYTES = $40 ; 4 ; also defined in persistent.asm
KERNAL_SETLFS = $ffba
KERNAL_SETNAM = $ffbd
KERNAL_SETMSG = $ff90
KERNAL_OPEN = $ffc0
KERNAL_CLOSE = $ffc3
KERNAL_LOAD = $ffd5
KERNAL_SAVE = $ffd8
DELTA = $00
load2 SUBROUTINE
lda ZP_USEBIOSLOADING
bne loadKernal
jsr openfile
jmp loadNormal
loadKernal SUBROUTINE
lda #$01
.waitb
bit $ff1c
beq .waitb
; irgendwie werden die daten bei 07f6 und 0544 ueberschrieben.
sei
lda $ff06
pha
lda #$0b
sta $ff06
lda $05e8
pha
lda $07c2
pha
lda $07ce
pha
lda #$00
sta $ff11
stx ZP_FOURBYTES + 0
sty ZP_FOURBYTES + 1
tay ; 00
.readfn
lda (ZP_FOURBYTES + 0),y
beq .found
iny
bne .readfn ; memsparen
.found
tya
pha
ldx #$7f
.save380
lda $380,x
sta $100+DELTA,x
cpx #restore07d9end - restore07d9start
bpl .zwo1
lda $07d9,x
sta $0180+DELTA,x
lda restore07d9start,x
sta $07d9,x
.zwo1
dex
bpl .save380
sta $ff3e
jsr $F2CE ; !! wichtig !! 0300
lda #<irqh
sta $0314
lda #>irqh
sta $0315
; SETLFS
ldx #8 ; Device Number
lda #1 ; Logical File Number
tay ; SA 1 = take prg header adress
jsr KERNAL_SETLFS
; SETNAM
pla
ldx ZP_FOURBYTES + 0
ldy ZP_FOURBYTES + 1
jsr KERNAL_SETNAM
lda #$00 ; load not verify
jsr KERNAL_LOAD
ldx #$7f
.load380
lda $100+DELTA,x
sta $380,x
cpx #restore07d9end - restore07d9start
bpl .zwo2
lda $0180+DELTA,x
sta $07d9,x
.zwo2
dex
bpl .load380
inx
stx $ff19
lda $9d
sta load_end + 0
lda $9e
sta load_end + 1
pla
sta $07ce
pla
sta $07c2
pla
sta $05e8
pla
sta $ff06
jsr topirq_install
sta $ff3f
cli
rts
restore07d9start
php
sei
sta $ff3f
lda ($9b),y
sta $ff3e
plp
rts
restore07d9end
irqh
lda $ff19
adc #$01
and #$01
sta $ff19
inc $ff09
jmp $fcbe
ORG $0d80 - 3 ; safety bytes
ORG $0d80
SNGBEGIN = .
ECHO "SNGBEGIN: ",[.]
.song
include "../../../Musics/FrameworkSong/asm/song.asm"
ECHO "SONG: ",[.-.song]
echo "TOTAL: ",[. - PLAYER_BEGIN]
|
Application Support/BBEdit/Packages/dStyle.bbpackage/Contents/Scripts/Window/Tile Horizontally on Current Screen.scpt | bhdicaire/bbeditSetup | 0 | 3896 | (* Script to tile windows horizontally on a second monitor in BBEdit
Requires perl screen to help determine screen bounds.
*)
(* Comment out display dialog and set the number of displays to avoid prompt *)
-- set numScreens to 2
set numScreens to button returned of (display dialog "How many monitors do you have?" buttons {"1", "2", "3"} default button "2")
set menubarHeight to 44
-- set a to path to application support from user domain
-- set p to POSIX path of a
set p to POSIX path of ((path to me as text) & "::")
set p to quoted form of p
set screens to {}
set theOutput to do shell script p & "screens.pl " & numScreens & " | sort"
log "screens.pl Output:"
log theOutput
if theOutput = "" then
display dialog "Error gathering screen information. Please verify that screens.pl is located in the same directory as this script."
return
end if
repeat with currLine in (paragraphs of theOutput)
set fields to parseCSV(currLine as text)
set screens to screens & {{item 1 of fields as number, item 2 of fields as number, item 3 of fields as number, item 4 of fields as number, item 5 of fields as text}}
end repeat
tell application "Finder"
set desktopBounds to get bounds of window of desktop
log "desktop window bounds: " & item 1 of desktopBounds & ", " & item 2 of desktopBounds & ", " & item 3 of desktopBounds & ", " & item 4 of desktopBounds
end tell
tell application "BBEdit"
-- get front two windows
set firstWin to get window 1
set secondWin to get window 2
set firstWinOrigin to get position of firstWin
set firstWinScreen to my isOnScreen(firstWinOrigin, screens)
log firstWinScreen
if (firstWinScreen ≥ 0) then
-- add one to firstWinScreen for applescript array indexing
set firstWinScreen to firstWinScreen + 1
-- calc bounds of first window
set targetScreen to item firstWinScreen of screens
log targetScreen
set xTop to (item 4 of targetScreen)
set yTop to (item 5 of targetScreen) + menubarHeight
set xBottom to (((item 2 of targetScreen) / 2) + xTop)
set yBottom to (yTop + (item 3 of targetScreen)) - menubarHeight
log xTop & yTop & xBottom & yBottom
set bounds of firstWin to {xTop, yTop, xBottom, yBottom}
-- second window
set xTop to xBottom
-- yTop should be same
set xBottom to xBottom + ((item 2 of targetScreen) / 2)
-- yBottom should be same
set bounds of secondWin to {xTop, yTop, xBottom, yBottom}
else
-- error
display dialog "Error: Could not determin which screen window is on. Aborting script."
end if
end tell
on parseCSV(theText)
set {od, my text item delimiters} to {my text item delimiters, ","}
set parsedText to text items of theText
set my text item delimiters to od
return parsedText
end parseCSV
on isOnScreen(winPosit, screens)
log "Entering isOnScreen"
repeat with currScreen in screens
set x to item 1 of winPosit
set y to item 2 of winPosit
set xStart to item 4 of currScreen
set xEnd to (xStart + (item 2 of currScreen))
set yStart to item 5 of currScreen
set yEnd to (yStart + (item 3 of currScreen))
if (x ≥ xStart) and (x < xEnd) and (y ≥ yStart) and (y < yEnd) then
log "Window is on screen " & item 1 of currScreen
return item 1 of currScreen
end if
end repeat
-- no bounding screen found...return error value
return -1
end isOnScreen
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-valuti.adb | djamal2727/Main-Bearing-Analytical-Model | 0 | 3960 | <reponame>djamal2727/Main-Bearing-Analytical-Model<filename>Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-valuti.adb<gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . V A L _ U T I L --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Case_Util; use System.Case_Util;
package body System.Val_Util is
---------------
-- Bad_Value --
---------------
procedure Bad_Value (S : String) is
begin
-- Bad_Value might be called with very long strings allocated on the
-- heap. Limit the size of the message so that we avoid creating a
-- Storage_Error during error handling.
if S'Length > 127 then
raise Constraint_Error with "bad input for 'Value: """
& S (S'First .. S'First + 127) & "...""";
else
raise Constraint_Error with "bad input for 'Value: """ & S & '"';
end if;
end Bad_Value;
----------------------
-- Normalize_String --
----------------------
procedure Normalize_String
(S : in out String;
F, L : out Integer)
is
begin
F := S'First;
L := S'Last;
-- Scan for leading spaces
while F <= L and then S (F) = ' ' loop
F := F + 1;
end loop;
-- Check for case when the string contained no characters
if F > L then
Bad_Value (S);
end if;
-- Scan for trailing spaces
while S (L) = ' ' loop
L := L - 1;
end loop;
-- Except in the case of a character literal, convert to upper case
if S (F) /= ''' then
for J in F .. L loop
S (J) := To_Upper (S (J));
end loop;
end if;
end Normalize_String;
-------------------
-- Scan_Exponent --
-------------------
function Scan_Exponent
(Str : String;
Ptr : not null access Integer;
Max : Integer;
Real : Boolean := False) return Integer
is
P : Natural := Ptr.all;
M : Boolean;
X : Integer;
begin
if P >= Max
or else (Str (P) /= 'E' and then Str (P) /= 'e')
then
return 0;
end if;
-- We have an E/e, see if sign follows
P := P + 1;
if Str (P) = '+' then
P := P + 1;
if P > Max then
return 0;
else
M := False;
end if;
elsif Str (P) = '-' then
P := P + 1;
if P > Max or else not Real then
return 0;
else
M := True;
end if;
else
M := False;
end if;
if Str (P) not in '0' .. '9' then
return 0;
end if;
-- Scan out the exponent value as an unsigned integer. Values larger
-- than (Integer'Last / 10) are simply considered large enough here.
-- This assumption is correct for all machines we know of (e.g. in the
-- case of 16 bit integers it allows exponents up to 3276, which is
-- large enough for the largest floating types in base 2.)
X := 0;
loop
if X < (Integer'Last / 10) then
X := X * 10 + (Character'Pos (Str (P)) - Character'Pos ('0'));
end if;
P := P + 1;
exit when P > Max;
if Str (P) = '_' then
Scan_Underscore (Str, P, Ptr, Max, False);
else
exit when Str (P) not in '0' .. '9';
end if;
end loop;
if M then
X := -X;
end if;
Ptr.all := P;
return X;
end Scan_Exponent;
--------------------
-- Scan_Plus_Sign --
--------------------
procedure Scan_Plus_Sign
(Str : String;
Ptr : not null access Integer;
Max : Integer;
Start : out Positive)
is
P : Natural := Ptr.all;
begin
if P > Max then
Bad_Value (Str);
end if;
-- Scan past initial blanks
while Str (P) = ' ' loop
P := P + 1;
if P > Max then
Ptr.all := P;
Bad_Value (Str);
end if;
end loop;
Start := P;
-- Skip past an initial plus sign
if Str (P) = '+' then
P := P + 1;
if P > Max then
Ptr.all := Start;
Bad_Value (Str);
end if;
end if;
Ptr.all := P;
end Scan_Plus_Sign;
---------------
-- Scan_Sign --
---------------
procedure Scan_Sign
(Str : String;
Ptr : not null access Integer;
Max : Integer;
Minus : out Boolean;
Start : out Positive)
is
P : Natural := Ptr.all;
begin
-- Deal with case of null string (all blanks). As per spec, we raise
-- constraint error, with Ptr unchanged, and thus > Max.
if P > Max then
Bad_Value (Str);
end if;
-- Scan past initial blanks
while Str (P) = ' ' loop
P := P + 1;
if P > Max then
Ptr.all := P;
Bad_Value (Str);
end if;
end loop;
Start := P;
-- Remember an initial minus sign
if Str (P) = '-' then
Minus := True;
P := P + 1;
if P > Max then
Ptr.all := Start;
Bad_Value (Str);
end if;
-- Skip past an initial plus sign
elsif Str (P) = '+' then
Minus := False;
P := P + 1;
if P > Max then
Ptr.all := Start;
Bad_Value (Str);
end if;
else
Minus := False;
end if;
Ptr.all := P;
end Scan_Sign;
--------------------------
-- Scan_Trailing_Blanks --
--------------------------
procedure Scan_Trailing_Blanks (Str : String; P : Positive) is
begin
for J in P .. Str'Last loop
if Str (J) /= ' ' then
Bad_Value (Str);
end if;
end loop;
end Scan_Trailing_Blanks;
---------------------
-- Scan_Underscore --
---------------------
procedure Scan_Underscore
(Str : String;
P : in out Natural;
Ptr : not null access Integer;
Max : Integer;
Ext : Boolean)
is
C : Character;
begin
P := P + 1;
-- If underscore is at the end of string, then this is an error and we
-- raise Constraint_Error, leaving the pointer past the underscore. This
-- seems a bit strange. It means e.g. that if the field is:
-- 345_
-- that Constraint_Error is raised. You might think that the RM in this
-- case would scan out the 345 as a valid integer, leaving the pointer
-- at the underscore, but the ACVC suite clearly requires an error in
-- this situation (see for example CE3704M).
if P > Max then
Ptr.all := P;
Bad_Value (Str);
end if;
-- Similarly, if no digit follows the underscore raise an error. This
-- also catches the case of double underscore which is also an error.
C := Str (P);
if C in '0' .. '9'
or else (Ext and then (C in 'A' .. 'F' or else C in 'a' .. 'f'))
then
return;
else
Ptr.all := P;
Bad_Value (Str);
end if;
end Scan_Underscore;
end System.Val_Util;
|
programs/oeis/256/A256533.asm | karttu/loda | 1 | 84573 | <filename>programs/oeis/256/A256533.asm<gh_stars>1-10
; A256533: Product of n and the sum of all divisors of all positive integers <= n.
; 1,8,24,60,105,198,287,448,621,870,1089,1524,1833,2310,2835,3520,4046,4986,5643,6780,7791,8954,9913,11784,13050,14664,16308,18480,20010,22860,24614,27424,29865,32606,35245,39528,42032,45448,48828,53680,56744,62160,65532,70752,75870,80868,84882,92640,97363,104000,109752,117000,122112,130896,137280,146496,153672,161588,167914,180840,187636,196664,206388,217792,226655,239646,247833,260100,270549,284550,293727,311904,321638,334480,348300,363584,375760,393744,405112,425120,440235,456002,468535,492996,508045,525374,541923,563992,578411,605970,622895,645196,664113,684790,703475,735072,752235,776748,800118,829900,848501,878934,898263,928824,957915,984210,1005051,1044684,1066347,1099890,1126761,1164688,1187969,1225842,1253155,1288412,1320813,1353342,1381947,1436760,1464826,1499624,1532580,1572816,1605000,1657152,1686560,1732480,1768719,1815190,1846445,1904892,1940603,1982530,2029725,2081480,2115691,2170878,2206069,2268980,2312259,2359330,2399969,2474784,2518070,2567848,2618952,2676136,2716568,2790600,2832156,2896512,2951370,3015012,3064350,3145272,3190240,3248480,3303384,3384640,3436706,3516858,3565299,3635388,3705075,3769362,3820125,3923640,3977922,4056540,4124862,4201960,4256492,4343736,4412100,4502784,4570848,4644732,4703046,4827600,4887362,4975516,5048238,5142064,5212190,5311788,5380738,5472680,5562270,5660100,5726562,5854080,5922012,6009732,6106230,6215748,6286467,6411042,6483221,6608800,6696516,6791644,6873986,7010664,7096690,7195580,7295094,7420608,7506444,7663320,7744544,7861384,7959810,8066516,8160970,8328528,8422638,8533392,8637360,8787680,8883316,9024744,9115348,9269120,9401175,9520250,9614131,9784164,9879747,10022250,10154529,10302888,10401819,10574226,10687095,10831692,10953429,11102462,11206471,11431920,11537875,11682308,11819034,11973568,12106430,12279828,12398906,12568144,12702486,12870500
mov $2,$0
cal $0,24916 ; a(n) = Sum_{k=1..n} k*floor(n/k); also Sum_{k=1..n} sigma(k) where sigma(n) = sum of divisors of n (A000203).
mov $1,$0
mul $2,$0
add $1,$2
|
alloy4fun_models/trashltl/models/1/SKMJtGToiMRhLLAnA.als | Kaixi26/org.alloytools.alloy | 0 | 137 | <filename>alloy4fun_models/trashltl/models/1/SKMJtGToiMRhLLAnA.als
open main
pred idSKMJtGToiMRhLLAnA_prop2 {
no File until some File
}
pred __repair { idSKMJtGToiMRhLLAnA_prop2 }
check __repair { idSKMJtGToiMRhLLAnA_prop2 <=> prop2o } |
programs/oeis/070/A070574.asm | karttu/loda | 1 | 85939 | ; A070574: n^4 mod 31.
; 0,1,16,19,8,5,25,14,4,20,18,9,28,10,7,2,2,7,10,28,9,18,20,4,14,25,5,8,19,16,1,0,1,16,19,8,5,25,14,4,20,18,9,28,10,7,2,2,7,10,28,9,18,20,4,14,25,5,8,19,16,1,0,1,16,19,8,5,25,14,4,20,18,9,28,10,7,2,2,7,10,28,9
pow $0,4
mod $0,31
mov $1,$0
|
examples/spi/main.adb | ekoeppen/MSP430_Generic_Ada_Drivers | 0 | 15127 | with Interfaces; use Interfaces;
with MSPGD;
with MSPGD.Board; use MSPGD.Board;
with MSPGD.SPI;
with Drivers.Text_IO;
procedure Main is
pragma Preelaborate;
package Text_IO is new Drivers.Text_IO (USART => MSPGD.Board.UART);
Buffer : MSPGD.Buffer_Type (0 .. 15);
begin
Init;
LED_RED.Init;
SPI.Init;
SCLK.Init;
MISO.Init;
MOSI.Init;
SSEL.Init;
SSEL.Set;
Text_IO.Put_Line ("Hello, World!");
loop
if not BUTTON.Is_Set then
for I in Buffer'Range loop Buffer (I) := Unsigned_8 (I + 32); end loop;
LED_RED.Set;
SSEL.Clear;
SPI.Transfer (Buffer);
SSEL.Set;
LED_RED.Clear;
end if;
end loop;
end Main;
|
programs/oeis/225/A225743.asm | neoneye/loda | 22 | 93463 | <filename>programs/oeis/225/A225743.asm
; A225743: Triangular array: row n is least squarefree word of length n using positive integers.
; 1,1,2,1,2,1,1,2,1,3,1,2,1,3,1,1,2,1,3,1,2,1,2,1,3,1,2,1,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,4,1,1,2,1,3,1,2,1,4,1,2,1,2,1,3,1,2,1,4,1,2,1,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,3,1,2,1,4,1,2,1,3,1,1,2,1,3,1,2,1,4,1
lpb $0
add $2,1
sub $0,$2
lpe
seq $0,7814 ; Exponent of highest power of 2 dividing n, a.k.a. the binary carry sequence, the ruler sequence, or the 2-adic valuation of n.
add $0,1
|
examples/AIM4/bag/Equiv.agda | cruhland/agda | 1,989 | 4637 |
module Equiv where
import Prelude
import Eq
open Prelude
open Eq
data Equiv (a : Set) : Set1 where
equiv : (_==_ : a -> a -> Set)
-> (refl : (x : a) -> x == x)
-> (sym : (x y : a) -> x == y -> y == x)
-> (trans : (x y z : a) -> x == y -> y == z -> x == z)
-> Equiv a
rel : {a : Set} -> Equiv a -> (a -> a -> Set)
rel (equiv _==_ _ _ _) = _==_
data Decidable {a : Set} (eq : a -> a -> Set) : Set where
dec : ((x y : a) -> Either (eq x y) (Not (eq x y))) -> Decidable eq
private
boolFunctionsDecidable'
: {a : Set}
-> (f : a -> a -> Bool)
-> (x y : a)
-> (b : Bool)
-> (b =^= f x y)
-> Either (T' f x y) (Not (T' f x y))
boolFunctionsDecidable' eq x y True p = left (leibnizSubst p T unit)
boolFunctionsDecidable' eq x y False p =
right (not (\xy -> leibnizSubst (leibnizSym p) T xy))
boolFunctionsDecidable
: {a : Set} -> (f : a -> a -> Bool) -> Decidable (T' f)
boolFunctionsDecidable f =
dec (\x y -> boolFunctionsDecidable' f x y (f x y) leibnizRefl)
data DecidableEquiv (a : Set) : Set1 where
decEquiv : (eq : Equiv a) -> Decidable (rel eq) -> DecidableEquiv a
rel' : {a : Set} -> (eq : DecidableEquiv a) -> (a -> a -> Set)
rel' (decEquiv eq _) = rel eq
refl : {a : Set} -> (eq : DecidableEquiv a) -> {x : a} -> rel' eq x x
refl (decEquiv (equiv _ refl' _ _) _) = refl' _
sym : {a : Set} -> (eq : DecidableEquiv a) -> {x y : a}
-> rel' eq x y -> rel' eq y x
sym (decEquiv (equiv _ _ sym' _) _) = sym' _ _
trans : {a : Set} -> (eq : DecidableEquiv a) -> {x y z : a}
-> rel' eq x y -> rel' eq y z -> rel' eq x z
trans (decEquiv (equiv _ _ _ trans') _) = trans' _ _ _
decRel : {a : Set} -> (eq : DecidableEquiv a) -> (x y : a)
-> Either (rel' eq x y) (Not (rel' eq x y))
decRel (decEquiv _ (dec f)) = f
private
decRelI : {a : Set} -> (eq : a -> a -> Set) -> {x y : a}
-> Either (eq x y) (Not (eq x y)) -> Bool
decRelI _ (left _) = True
decRelI _ (right _) = False
decRel' : {a : Set} -> DecidableEquiv a -> (a -> a -> Bool)
decRel' eq x y = decRelI (rel' eq) (decRel eq x y)
private
pairEq : {a b : Set} -> DecidableEquiv a -> DecidableEquiv b
-> (p1 p2 : Pair a b) -> Set
pairEq a b (pair x1 x2) (pair y1 y2) = Pair (rel' a x1 y1) (rel' b x2 y2)
refl' : {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-> (x : Pair a b) -> pairEq da db x x
refl' a b (pair x1 x2) = pair (refl a) (refl b)
sym' : {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-> (x y : Pair a b) -> pairEq da db x y -> pairEq da db y x
sym' a b (pair x1 x2) (pair y1 y2) (pair xy1 xy2) =
pair (sym a xy1) (sym b xy2)
trans'
: {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-> (x y z : Pair a b)
-> pairEq da db x y -> pairEq da db y z -> pairEq da db x z
trans' a b (pair x1 x2) (pair y1 y2)
(pair z1 z2) (pair xy1 xy2) (pair yz1 yz2) =
pair (trans a xy1 yz1) (trans b xy2 yz2)
dec'' : {a b : Set} -> {da : DecidableEquiv a} -> {db : DecidableEquiv b}
-> {x1 y1 : a} -> {x2 y2 : b}
-> Either (rel' da x1 y1) (Not (rel' da x1 y1))
-> Either (rel' db x2 y2) (Not (rel' db x2 y2))
-> Either (pairEq da db (pair x1 x2) (pair y1 y2))
(Not (pairEq da db (pair x1 x2) (pair y1 y2)))
dec'' (left xy1) (left xy2) = left (pair xy1 xy2)
dec'' _ (right (not nxy2)) =
right (not (\xy -> nxy2 (snd xy)))
dec'' (right (not nxy1)) (left _) =
right (not (\xy -> nxy1 (fst xy)))
dec' : {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-> (x y : Pair a b) -> Either (pairEq da db x y) (Not (pairEq da db x y))
dec' a b (pair x1 x2) (pair y1 y2) =
dec'' {_} {_} {a} {b} (decRel a x1 y1) (decRel b x2 y2)
pairEquiv
: {a b : Set} -> DecidableEquiv a -> DecidableEquiv b
-> DecidableEquiv (Pair a b)
pairEquiv a b = decEquiv (equiv (pairEq a b)
(refl' a b) (sym' a b) (trans' a b))
(dec (dec' a b))
|
ada/meals.ads | rtoal/enhanced-dining-philosophers | 0 | 3465 | <reponame>rtoal/enhanced-dining-philosophers
------------------------------------------------------------------------------
-- meals.ads
--
-- A package containing the public data type Meal. A meal consists of an en-
-- tree, an optional soup, and an optional dessert. Three meal operations are
-- provided:
--
-- Random_Meal A random meal.
-- Price (M) The price of meal M.
-- S & M concatentates unbounded string S and text of M.
------------------------------------------------------------------------------
with Randoms, Ada.Strings.Unbounded;
use Randoms, Ada.Strings.Unbounded;
package Meals is
type Entree_Selection is (
Paella,
Wu_Hsiang_Chi,
Bogracs_Gulyas,
Spanokopita,
Moui_Nagden,
Sambal_Goreng_Udang
);
type Soup_Selection is (
No_Soup,
Albondigas
);
type Dessert_Selection is (
No_Dessert,
Berog
);
type Meal is record
Entree : Entree_Selection;
Soup : Soup_Selection;
Dessert : Dessert_Selection;
end record;
function Random_Meal return Meal;
function Price (M: Meal) return Float;
function "&" (S: Unbounded_String; M: Meal) return Unbounded_String;
end Meals;
|
src/grammar/ProjectTxtLexer.g4 | derkork/project.txt-js | 0 | 1475 | lexer grammar ProjectTxtLexer;
channels {
COMMENT_CHANNEL
}
fragment WHITESPACE: [ \t]+;
fragment NEWLINE: ( '\r\n' | '\r' | '\n' );
fragment DIGIT: [0-9];
WS: WHITESPACE -> skip;
LINE_COMMENT: '#' ~[\r\n]* -> skip;
INSTRUCTION_ESCAPE: '^^' -> pushMode(TEXT_MODE);
// the two pushMode instructions are to avoid the case when you put a comment
// directly after the first instruction in a line. it ensures that whenever we
// have something that is not a comment in the line we stay in text mode until the
// next line is reached. only at the next line a comment is allowed again.
INSTRUCTION: '^' -> pushMode(TEXT_MODE), pushMode(INSTRUCTION_MODE);
NEW_LINE: NEWLINE;
TEXT: ~[^\r\n]+ -> pushMode(TEXT_MODE);
mode INSTRUCTION_MODE;
TASK_STATE_OPEN: '[ ]';
TASK_STATE_DONE: ('[x]' | '[X]');
TASK_STATE_ON_HOLD: '[!]';
TASK_STATE_IN_PROGRESS: '[>]';
TASK_STATE_MILESTONE: ('[m]' | '[M]');
PERSON_START: '/';
IDREF: '#';
LABELREF: '@';
DEPENDENCY: '<';
ASSIGNMENT: '>';
START: '*' -> pushMode(DATE_MODE);
EFFORT: '~' -> pushMode(DURATION_MODE);
EMAIL: '=>' -> pushMode(EMAIL_MODE);
DUE: '!' -> pushMode(DATE_MODE);
SCHEDULE: '+' -> pushMode(DATE_MODE);
IDENTIFIER: ~[ \r\t\n:<>#@~+*=!]+;
SEPARATOR: ':';
INSTRUCTION_WHITESPACE: WHITESPACE+ -> popMode, type(TEXT);
INSTRUCTION_NEWLINE: NEWLINE+ -> popMode, type(NEW_LINE);
mode DATE_MODE;
YEAR: DIGIT DIGIT DIGIT DIGIT;
HYPHEN: '-';
MONTH_OR_DAY: DIGIT DIGIT?;
DATE_WHITESPACE: WHITESPACE -> popMode, popMode, type(TEXT);
DATE_NEWLINE: NEWLINE+ -> popMode, popMode, type(NEW_LINE);
mode EMAIL_MODE;
ADDRESS: ~[ \t\r\n]+;
ADDRESS_WHITESPACE: WHITESPACE -> popMode, popMode, type(TEXT);
ADDRESS_NEWLINE: NEWLINE+ -> popMode, popMode, type(NEW_LINE);
mode DURATION_MODE;
AMOUNT: DIGIT+;
DAY: 'd';
HOUR: 'h';
MINUTE: 'm';
DURATION_WHITESPACE: WHITESPACE -> popMode, popMode, type(TEXT);
DURATION_NEWLINE: NEWLINE+ -> popMode, popMode, type(NEW_LINE);
mode TEXT_MODE;
TM_TEXT: ~[^\r\n]+ -> type(TEXT);
TM_INSTRUCTION: '^' -> type(INSTRUCTION), pushMode(INSTRUCTION_MODE);
TM_INSTRUCTION_ESCAPE: '^^' -> type(INSTRUCTION_ESCAPE);
TM_NEW_LINE: NEWLINE -> type(NEW_LINE), popMode;
|
programs/oeis/020/A020721.asm | neoneye/loda | 22 | 171294 | ; A020721: Pisot sequences E(7,10), P(7,10).
; 7,10,14,20,29,42,61,89,130,190,278,407,596,873,1279,1874,2746,4024,5897,8642,12665,18561,27202,39866,58426,85627,125492,183917,269543,395034,578950,848492,1243525,1822474,2670965,3914489,5736962,8407926,12322414,18059375,26467300,38789713,56849087,83316386,122106098,178955184,262271569,384377666,563332849,825604417,1209982082,1773314930,2598919346,3808901427,5582216356,8181135701,11990037127,17572253482,25753389182,37743426308,55315679789,81069068970,118812495277,174128175065,255197244034,374009739310,548137914374,803335158407,1177344897716,1725482812089,2528817970495,3706162868210,5431645680298,7960463650792,11666626519001,17098272199298,25058735850089,36725362369089,53823634568386,78882370418474,115607732787562,169431367355947,248313737774420,363921470561981,533352837917927,781666575692346,1145588046254326,1678940884172252,2460607459864597,3606195506118922,5285136390291173,7745743850155769,11351939356274690,16637075746565862,24382819596721630,35734758952996319,52371834699562180,76754654296283809,112489413249280127,164861247948842306
add $0,3
seq $0,77868 ; Expansion of (1-x)^(-1)/(1-x-x^3).
add $0,2
|
third_party/antlr_grammars_v4/bibcode/bibcode.g4 | mikhan808/rsyntaxtextarea-antlr4-extension | 2 | 7651 | <filename>third_party/antlr_grammars_v4/bibcode/bibcode.g4
/*
BSD License
Copyright (c) 2020, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Tom Everett nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// https://web.archive.org/web/20110607153038/http://cdsweb.u-strasbg.fr/simbad/refcode/refcode-paper.html
grammar bibcode;
bibcode
: year publish volume pagesection author EOF
;
year
: DIGIT DIGIT DIGIT DIGIT
;
publish
: (letter | digit | DOT) (letter | digit | DOT) (letter | digit | DOT) (letter | digit | DOT) (letter | digit | DOT)
;
volume
: (letter | digit | DOT) (letter | digit | DOT) (letter | digit | DOT) (letter | digit | DOT)
;
pagesection
: section? page
;
section
: letter
;
page
: (digit | DOT)+
;
author
: letter
;
DOT
: '.'
;
letter
: UPPERLETTER
| LOWERLETTER
;
digit
: DIGIT
;
UPPERLETTER
: [A-Z]
;
LOWERLETTER
: [a-z]
;
DIGIT
: [0-9]
;
WS
: [ \r\n\t]+ -> skip
;
|
ls.asm | mtreffert/xv6-staus-treffert | 0 | 9785 |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <fmtname>:
#include "user.h"
#include "fs.h"
char*
fmtname(char *path)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 56 push %esi
4: 53 push %ebx
5: 83 ec 10 sub $0x10,%esp
8: 8b 5d 08 mov 0x8(%ebp),%ebx
static char buf[DIRSIZ+1];
char *p;
// Find first character after last slash.
for(p=path+strlen(path); p >= path && *p != '/'; p--)
b: 89 1c 24 mov %ebx,(%esp)
e: e8 cd 03 00 00 call 3e0 <strlen>
13: 01 d8 add %ebx,%eax
15: 73 10 jae 27 <fmtname+0x27>
17: eb 13 jmp 2c <fmtname+0x2c>
19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
20: 83 e8 01 sub $0x1,%eax
23: 39 c3 cmp %eax,%ebx
25: 77 05 ja 2c <fmtname+0x2c>
27: 80 38 2f cmpb $0x2f,(%eax)
2a: 75 f4 jne 20 <fmtname+0x20>
;
p++;
2c: 8d 58 01 lea 0x1(%eax),%ebx
// Return blank-padded name.
if(strlen(p) >= DIRSIZ)
2f: 89 1c 24 mov %ebx,(%esp)
32: e8 a9 03 00 00 call 3e0 <strlen>
37: 83 f8 0d cmp $0xd,%eax
3a: 77 53 ja 8f <fmtname+0x8f>
return p;
memmove(buf, p, strlen(p));
3c: 89 1c 24 mov %ebx,(%esp)
3f: e8 9c 03 00 00 call 3e0 <strlen>
44: 89 5c 24 04 mov %ebx,0x4(%esp)
48: c7 04 24 90 0a 00 00 movl $0xa90,(%esp)
4f: 89 44 24 08 mov %eax,0x8(%esp)
53: e8 58 04 00 00 call 4b0 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
58: 89 1c 24 mov %ebx,(%esp)
5b: e8 80 03 00 00 call 3e0 <strlen>
60: 89 1c 24 mov %ebx,(%esp)
63: bb 90 0a 00 00 mov $0xa90,%ebx
68: 89 c6 mov %eax,%esi
6a: e8 71 03 00 00 call 3e0 <strlen>
6f: ba 0e 00 00 00 mov $0xe,%edx
74: 29 f2 sub %esi,%edx
76: 89 54 24 08 mov %edx,0x8(%esp)
7a: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
81: 00
82: 05 90 0a 00 00 add $0xa90,%eax
87: 89 04 24 mov %eax,(%esp)
8a: e8 71 03 00 00 call 400 <memset>
return buf;
}
8f: 83 c4 10 add $0x10,%esp
92: 89 d8 mov %ebx,%eax
94: 5b pop %ebx
95: 5e pop %esi
96: 5d pop %ebp
97: c3 ret
98: 90 nop
99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000000a0 <ls>:
void
ls(char *path)
{
a0: 55 push %ebp
a1: 89 e5 mov %esp,%ebp
a3: 57 push %edi
a4: 56 push %esi
a5: 53 push %ebx
a6: 81 ec 5c 02 00 00 sub $0x25c,%esp
ac: 8b 7d 08 mov 0x8(%ebp),%edi
char buf[512], *p;
int fd;
struct dirent de;
struct stat st;
if((fd = open(path, 0)) < 0){
af: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
b6: 00
b7: 89 3c 24 mov %edi,(%esp)
ba: e8 19 05 00 00 call 5d8 <open>
bf: 85 c0 test %eax,%eax
c1: 89 c3 mov %eax,%ebx
c3: 0f 88 c7 01 00 00 js 290 <ls+0x1f0>
printf(2, "ls: cannot open %s\n", path);
return;
}
if(fstat(fd, &st) < 0){
c9: 8d 75 c8 lea -0x38(%ebp),%esi
cc: 89 74 24 04 mov %esi,0x4(%esp)
d0: 89 04 24 mov %eax,(%esp)
d3: e8 18 05 00 00 call 5f0 <fstat>
d8: 85 c0 test %eax,%eax
da: 0f 88 00 02 00 00 js 2e0 <ls+0x240>
printf(2, "ls: cannot stat %s\n", path);
close(fd);
return;
}
switch(st.type){
e0: 0f b7 45 d0 movzwl -0x30(%ebp),%eax
e4: 66 83 f8 01 cmp $0x1,%ax
e8: 74 66 je 150 <ls+0xb0>
ea: 66 83 f8 02 cmp $0x2,%ax
ee: 66 90 xchg %ax,%ax
f0: 74 16 je 108 <ls+0x68>
}
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
}
break;
}
close(fd);
f2: 89 1c 24 mov %ebx,(%esp)
f5: e8 c6 04 00 00 call 5c0 <close>
}
fa: 81 c4 5c 02 00 00 add $0x25c,%esp
100: 5b pop %ebx
101: 5e pop %esi
102: 5f pop %edi
103: 5d pop %ebp
104: c3 ret
105: 8d 76 00 lea 0x0(%esi),%esi
return;
}
switch(st.type){
case T_FILE:
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
108: 8b 55 d4 mov -0x2c(%ebp),%edx
10b: 8b 75 cc mov -0x34(%ebp),%esi
10e: 89 3c 24 mov %edi,(%esp)
111: 89 95 bc fd ff ff mov %edx,-0x244(%ebp)
117: e8 e4 fe ff ff call 0 <fmtname>
11c: 8b 95 bc fd ff ff mov -0x244(%ebp),%edx
122: 89 74 24 10 mov %esi,0x10(%esp)
126: c7 44 24 0c 02 00 00 movl $0x2,0xc(%esp)
12d: 00
12e: c7 44 24 04 56 0a 00 movl $0xa56,0x4(%esp)
135: 00
136: 89 54 24 14 mov %edx,0x14(%esp)
13a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
141: 89 44 24 08 mov %eax,0x8(%esp)
145: e8 d6 05 00 00 call 720 <printf>
break;
14a: eb a6 jmp f2 <ls+0x52>
14c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
150: 89 3c 24 mov %edi,(%esp)
153: e8 88 02 00 00 call 3e0 <strlen>
158: 83 c0 10 add $0x10,%eax
15b: 3d 00 02 00 00 cmp $0x200,%eax
160: 0f 87 0a 01 00 00 ja 270 <ls+0x1d0>
printf(1, "ls: path too long\n");
break;
}
strcpy(buf, path);
166: 8d 85 c8 fd ff ff lea -0x238(%ebp),%eax
16c: 89 7c 24 04 mov %edi,0x4(%esp)
170: 8d 7d d8 lea -0x28(%ebp),%edi
173: 89 04 24 mov %eax,(%esp)
176: e8 e5 01 00 00 call 360 <strcpy>
p = buf+strlen(buf);
17b: 8d 95 c8 fd ff ff lea -0x238(%ebp),%edx
181: 89 14 24 mov %edx,(%esp)
184: e8 57 02 00 00 call 3e0 <strlen>
189: 8d 95 c8 fd ff ff lea -0x238(%ebp),%edx
18f: 8d 04 02 lea (%edx,%eax,1),%eax
*p++ = '/';
192: c6 00 2f movb $0x2f,(%eax)
195: 83 c0 01 add $0x1,%eax
198: 89 85 c4 fd ff ff mov %eax,-0x23c(%ebp)
19e: 66 90 xchg %ax,%ax
while(read(fd, &de, sizeof(de)) == sizeof(de)){
1a0: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
1a7: 00
1a8: 89 7c 24 04 mov %edi,0x4(%esp)
1ac: 89 1c 24 mov %ebx,(%esp)
1af: e8 fc 03 00 00 call 5b0 <read>
1b4: 83 f8 10 cmp $0x10,%eax
1b7: 0f 85 35 ff ff ff jne f2 <ls+0x52>
if(de.inum == 0)
1bd: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp)
1c2: 74 dc je 1a0 <ls+0x100>
continue;
memmove(p, de.name, DIRSIZ);
1c4: 8d 45 da lea -0x26(%ebp),%eax
1c7: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
1ce: 00
1cf: 89 44 24 04 mov %eax,0x4(%esp)
1d3: 8b 95 c4 fd ff ff mov -0x23c(%ebp),%edx
1d9: 89 14 24 mov %edx,(%esp)
1dc: e8 cf 02 00 00 call 4b0 <memmove>
p[DIRSIZ] = 0;
1e1: 8b 85 c4 fd ff ff mov -0x23c(%ebp),%eax
if(stat(buf, &st) < 0){
1e7: 8d 95 c8 fd ff ff lea -0x238(%ebp),%edx
*p++ = '/';
while(read(fd, &de, sizeof(de)) == sizeof(de)){
if(de.inum == 0)
continue;
memmove(p, de.name, DIRSIZ);
p[DIRSIZ] = 0;
1ed: c6 40 0e 00 movb $0x0,0xe(%eax)
if(stat(buf, &st) < 0){
1f1: 89 74 24 04 mov %esi,0x4(%esp)
1f5: 89 14 24 mov %edx,(%esp)
1f8: e8 e3 02 00 00 call 4e0 <stat>
1fd: 85 c0 test %eax,%eax
1ff: 0f 88 b3 00 00 00 js 2b8 <ls+0x218>
printf(1, "ls: cannot stat %s\n", buf);
continue;
}
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
205: 0f bf 45 d0 movswl -0x30(%ebp),%eax
209: 8b 55 d4 mov -0x2c(%ebp),%edx
20c: 8b 4d cc mov -0x34(%ebp),%ecx
20f: 89 85 c0 fd ff ff mov %eax,-0x240(%ebp)
215: 8d 85 c8 fd ff ff lea -0x238(%ebp),%eax
21b: 89 04 24 mov %eax,(%esp)
21e: 89 95 bc fd ff ff mov %edx,-0x244(%ebp)
224: 89 8d b8 fd ff ff mov %ecx,-0x248(%ebp)
22a: e8 d1 fd ff ff call 0 <fmtname>
22f: 8b 95 bc fd ff ff mov -0x244(%ebp),%edx
235: 89 54 24 14 mov %edx,0x14(%esp)
239: 8b 8d b8 fd ff ff mov -0x248(%ebp),%ecx
23f: 89 4c 24 10 mov %ecx,0x10(%esp)
243: 8b 95 c0 fd ff ff mov -0x240(%ebp),%edx
249: 89 44 24 08 mov %eax,0x8(%esp)
24d: c7 44 24 04 56 0a 00 movl $0xa56,0x4(%esp)
254: 00
255: c7 04 24 01 00 00 00 movl $0x1,(%esp)
25c: 89 54 24 0c mov %edx,0xc(%esp)
260: e8 bb 04 00 00 call 720 <printf>
265: e9 36 ff ff ff jmp 1a0 <ls+0x100>
26a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
break;
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
printf(1, "ls: path too long\n");
270: c7 44 24 04 63 0a 00 movl $0xa63,0x4(%esp)
277: 00
278: c7 04 24 01 00 00 00 movl $0x1,(%esp)
27f: e8 9c 04 00 00 call 720 <printf>
break;
284: e9 69 fe ff ff jmp f2 <ls+0x52>
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
int fd;
struct dirent de;
struct stat st;
if((fd = open(path, 0)) < 0){
printf(2, "ls: cannot open %s\n", path);
290: 89 7c 24 08 mov %edi,0x8(%esp)
294: c7 44 24 04 2e 0a 00 movl $0xa2e,0x4(%esp)
29b: 00
29c: c7 04 24 02 00 00 00 movl $0x2,(%esp)
2a3: e8 78 04 00 00 call 720 <printf>
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
}
break;
}
close(fd);
}
2a8: 81 c4 5c 02 00 00 add $0x25c,%esp
2ae: 5b pop %ebx
2af: 5e pop %esi
2b0: 5f pop %edi
2b1: 5d pop %ebp
2b2: c3 ret
2b3: 90 nop
2b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(de.inum == 0)
continue;
memmove(p, de.name, DIRSIZ);
p[DIRSIZ] = 0;
if(stat(buf, &st) < 0){
printf(1, "ls: cannot stat %s\n", buf);
2b8: 8d 85 c8 fd ff ff lea -0x238(%ebp),%eax
2be: 89 44 24 08 mov %eax,0x8(%esp)
2c2: c7 44 24 04 42 0a 00 movl $0xa42,0x4(%esp)
2c9: 00
2ca: c7 04 24 01 00 00 00 movl $0x1,(%esp)
2d1: e8 4a 04 00 00 call 720 <printf>
continue;
2d6: e9 c5 fe ff ff jmp 1a0 <ls+0x100>
2db: 90 nop
2dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printf(2, "ls: cannot open %s\n", path);
return;
}
if(fstat(fd, &st) < 0){
printf(2, "ls: cannot stat %s\n", path);
2e0: 89 7c 24 08 mov %edi,0x8(%esp)
2e4: c7 44 24 04 42 0a 00 movl $0xa42,0x4(%esp)
2eb: 00
2ec: c7 04 24 02 00 00 00 movl $0x2,(%esp)
2f3: e8 28 04 00 00 call 720 <printf>
close(fd);
2f8: 89 1c 24 mov %ebx,(%esp)
2fb: e8 c0 02 00 00 call 5c0 <close>
return;
300: e9 f5 fd ff ff jmp fa <ls+0x5a>
305: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
309: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000310 <main>:
close(fd);
}
int
main(int argc, char *argv[])
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 83 e4 f0 and $0xfffffff0,%esp
316: 57 push %edi
317: 56 push %esi
318: 53 push %ebx
int i;
if(argc < 2){
ls(".");
exit();
319: bb 01 00 00 00 mov $0x1,%ebx
close(fd);
}
int
main(int argc, char *argv[])
{
31e: 83 ec 14 sub $0x14,%esp
321: 8b 75 08 mov 0x8(%ebp),%esi
324: 8b 7d 0c mov 0xc(%ebp),%edi
int i;
if(argc < 2){
327: 83 fe 01 cmp $0x1,%esi
32a: 7e 1c jle 348 <main+0x38>
32c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ls(".");
exit();
}
for(i=1; i<argc; i++)
ls(argv[i]);
330: 8b 04 9f mov (%edi,%ebx,4),%eax
if(argc < 2){
ls(".");
exit();
}
for(i=1; i<argc; i++)
333: 83 c3 01 add $0x1,%ebx
ls(argv[i]);
336: 89 04 24 mov %eax,(%esp)
339: e8 62 fd ff ff call a0 <ls>
if(argc < 2){
ls(".");
exit();
}
for(i=1; i<argc; i++)
33e: 39 de cmp %ebx,%esi
340: 7f ee jg 330 <main+0x20>
ls(argv[i]);
exit();
342: e8 51 02 00 00 call 598 <exit>
347: 90 nop
main(int argc, char *argv[])
{
int i;
if(argc < 2){
ls(".");
348: c7 04 24 76 0a 00 00 movl $0xa76,(%esp)
34f: e8 4c fd ff ff call a0 <ls>
exit();
354: e8 3f 02 00 00 call 598 <exit>
359: 90 nop
35a: 90 nop
35b: 90 nop
35c: 90 nop
35d: 90 nop
35e: 90 nop
35f: 90 nop
00000360 <strcpy>:
#include "fcntl.h"
#include "user.h"
char*
strcpy(char *s, char *t)
{
360: 55 push %ebp
361: 31 d2 xor %edx,%edx
363: 89 e5 mov %esp,%ebp
365: 8b 45 08 mov 0x8(%ebp),%eax
368: 53 push %ebx
369: 8b 5d 0c mov 0xc(%ebp),%ebx
36c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char *os;
os = s;
while((*s++ = *t++) != 0)
370: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
374: 88 0c 10 mov %cl,(%eax,%edx,1)
377: 83 c2 01 add $0x1,%edx
37a: 84 c9 test %cl,%cl
37c: 75 f2 jne 370 <strcpy+0x10>
;
return os;
}
37e: 5b pop %ebx
37f: 5d pop %ebp
380: c3 ret
381: eb 0d jmp 390 <strcmp>
383: 90 nop
384: 90 nop
385: 90 nop
386: 90 nop
387: 90 nop
388: 90 nop
389: 90 nop
38a: 90 nop
38b: 90 nop
38c: 90 nop
38d: 90 nop
38e: 90 nop
38f: 90 nop
00000390 <strcmp>:
int
strcmp(const char *p, const char *q)
{
390: 55 push %ebp
391: 89 e5 mov %esp,%ebp
393: 53 push %ebx
394: 8b 4d 08 mov 0x8(%ebp),%ecx
397: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
39a: 0f b6 01 movzbl (%ecx),%eax
39d: 84 c0 test %al,%al
39f: 75 14 jne 3b5 <strcmp+0x25>
3a1: eb 25 jmp 3c8 <strcmp+0x38>
3a3: 90 nop
3a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p++, q++;
3a8: 83 c1 01 add $0x1,%ecx
3ab: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
3ae: 0f b6 01 movzbl (%ecx),%eax
3b1: 84 c0 test %al,%al
3b3: 74 13 je 3c8 <strcmp+0x38>
3b5: 0f b6 1a movzbl (%edx),%ebx
3b8: 38 d8 cmp %bl,%al
3ba: 74 ec je 3a8 <strcmp+0x18>
3bc: 0f b6 db movzbl %bl,%ebx
3bf: 0f b6 c0 movzbl %al,%eax
3c2: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
3c4: 5b pop %ebx
3c5: 5d pop %ebp
3c6: c3 ret
3c7: 90 nop
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
3c8: 0f b6 1a movzbl (%edx),%ebx
3cb: 31 c0 xor %eax,%eax
3cd: 0f b6 db movzbl %bl,%ebx
3d0: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
3d2: 5b pop %ebx
3d3: 5d pop %ebp
3d4: c3 ret
3d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
3d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000003e0 <strlen>:
uint
strlen(char *s)
{
3e0: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
3e1: 31 d2 xor %edx,%edx
return (uchar)*p - (uchar)*q;
}
uint
strlen(char *s)
{
3e3: 89 e5 mov %esp,%ebp
int n;
for(n = 0; s[n]; n++)
3e5: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
}
uint
strlen(char *s)
{
3e7: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
3ea: 80 39 00 cmpb $0x0,(%ecx)
3ed: 74 0c je 3fb <strlen+0x1b>
3ef: 90 nop
3f0: 83 c2 01 add $0x1,%edx
3f3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
3f7: 89 d0 mov %edx,%eax
3f9: 75 f5 jne 3f0 <strlen+0x10>
;
return n;
}
3fb: 5d pop %ebp
3fc: c3 ret
3fd: 8d 76 00 lea 0x0(%esi),%esi
00000400 <memset>:
void*
memset(void *dst, int c, uint n)
{
400: 55 push %ebp
401: 89 e5 mov %esp,%ebp
403: 8b 4d 10 mov 0x10(%ebp),%ecx
406: 53 push %ebx
407: 8b 45 08 mov 0x8(%ebp),%eax
char *d;
d = dst;
while(n-- > 0)
40a: 85 c9 test %ecx,%ecx
40c: 74 14 je 422 <memset+0x22>
40e: 0f b6 5d 0c movzbl 0xc(%ebp),%ebx
412: 31 d2 xor %edx,%edx
414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*d++ = c;
418: 88 1c 10 mov %bl,(%eax,%edx,1)
41b: 83 c2 01 add $0x1,%edx
memset(void *dst, int c, uint n)
{
char *d;
d = dst;
while(n-- > 0)
41e: 39 ca cmp %ecx,%edx
420: 75 f6 jne 418 <memset+0x18>
*d++ = c;
return dst;
}
422: 5b pop %ebx
423: 5d pop %ebp
424: c3 ret
425: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000430 <strchr>:
char*
strchr(const char *s, char c)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 8b 45 08 mov 0x8(%ebp),%eax
436: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
43a: 0f b6 10 movzbl (%eax),%edx
43d: 84 d2 test %dl,%dl
43f: 75 11 jne 452 <strchr+0x22>
441: eb 15 jmp 458 <strchr+0x28>
443: 90 nop
444: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
448: 83 c0 01 add $0x1,%eax
44b: 0f b6 10 movzbl (%eax),%edx
44e: 84 d2 test %dl,%dl
450: 74 06 je 458 <strchr+0x28>
if(*s == c)
452: 38 ca cmp %cl,%dl
454: 75 f2 jne 448 <strchr+0x18>
return (char*) s;
return 0;
}
456: 5d pop %ebp
457: c3 ret
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
458: 31 c0 xor %eax,%eax
if(*s == c)
return (char*) s;
return 0;
}
45a: 5d pop %ebp
45b: 90 nop
45c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
460: c3 ret
461: eb 0d jmp 470 <atoi>
463: 90 nop
464: 90 nop
465: 90 nop
466: 90 nop
467: 90 nop
468: 90 nop
469: 90 nop
46a: 90 nop
46b: 90 nop
46c: 90 nop
46d: 90 nop
46e: 90 nop
46f: 90 nop
00000470 <atoi>:
return r;
}
int
atoi(const char *s)
{
470: 55 push %ebp
int n;
n = 0;
while('0' <= *s && *s <= '9')
471: 31 c0 xor %eax,%eax
return r;
}
int
atoi(const char *s)
{
473: 89 e5 mov %esp,%ebp
475: 8b 4d 08 mov 0x8(%ebp),%ecx
478: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
479: 0f b6 11 movzbl (%ecx),%edx
47c: 8d 5a d0 lea -0x30(%edx),%ebx
47f: 80 fb 09 cmp $0x9,%bl
482: 77 1c ja 4a0 <atoi+0x30>
484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
n = n*10 + *s++ - '0';
488: 0f be d2 movsbl %dl,%edx
48b: 83 c1 01 add $0x1,%ecx
48e: 8d 04 80 lea (%eax,%eax,4),%eax
491: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
495: 0f b6 11 movzbl (%ecx),%edx
498: 8d 5a d0 lea -0x30(%edx),%ebx
49b: 80 fb 09 cmp $0x9,%bl
49e: 76 e8 jbe 488 <atoi+0x18>
n = n*10 + *s++ - '0';
return n;
}
4a0: 5b pop %ebx
4a1: 5d pop %ebp
4a2: c3 ret
4a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
4a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000004b0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
4b0: 55 push %ebp
4b1: 89 e5 mov %esp,%ebp
4b3: 56 push %esi
4b4: 8b 45 08 mov 0x8(%ebp),%eax
4b7: 53 push %ebx
4b8: 8b 5d 10 mov 0x10(%ebp),%ebx
4bb: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
4be: 85 db test %ebx,%ebx
4c0: 7e 14 jle 4d6 <memmove+0x26>
n = n*10 + *s++ - '0';
return n;
}
void*
memmove(void *vdst, void *vsrc, int n)
4c2: 31 d2 xor %edx,%edx
4c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
*dst++ = *src++;
4c8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
4cc: 88 0c 10 mov %cl,(%eax,%edx,1)
4cf: 83 c2 01 add $0x1,%edx
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
4d2: 39 da cmp %ebx,%edx
4d4: 75 f2 jne 4c8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
4d6: 5b pop %ebx
4d7: 5e pop %esi
4d8: 5d pop %ebp
4d9: c3 ret
4da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000004e0 <stat>:
return buf;
}
int
stat(char *n, struct stat *st)
{
4e0: 55 push %ebp
4e1: 89 e5 mov %esp,%ebp
4e3: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
4e6: 8b 45 08 mov 0x8(%ebp),%eax
return buf;
}
int
stat(char *n, struct stat *st)
{
4e9: 89 5d f8 mov %ebx,-0x8(%ebp)
4ec: 89 75 fc mov %esi,-0x4(%ebp)
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
4ef: be ff ff ff ff mov $0xffffffff,%esi
stat(char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
4f4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
4fb: 00
4fc: 89 04 24 mov %eax,(%esp)
4ff: e8 d4 00 00 00 call 5d8 <open>
if(fd < 0)
504: 85 c0 test %eax,%eax
stat(char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
506: 89 c3 mov %eax,%ebx
if(fd < 0)
508: 78 19 js 523 <stat+0x43>
return -1;
r = fstat(fd, st);
50a: 8b 45 0c mov 0xc(%ebp),%eax
50d: 89 1c 24 mov %ebx,(%esp)
510: 89 44 24 04 mov %eax,0x4(%esp)
514: e8 d7 00 00 00 call 5f0 <fstat>
close(fd);
519: 89 1c 24 mov %ebx,(%esp)
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
r = fstat(fd, st);
51c: 89 c6 mov %eax,%esi
close(fd);
51e: e8 9d 00 00 00 call 5c0 <close>
return r;
}
523: 89 f0 mov %esi,%eax
525: 8b 5d f8 mov -0x8(%ebp),%ebx
528: 8b 75 fc mov -0x4(%ebp),%esi
52b: 89 ec mov %ebp,%esp
52d: 5d pop %ebp
52e: c3 ret
52f: 90 nop
00000530 <gets>:
return 0;
}
char*
gets(char *buf, int max)
{
530: 55 push %ebp
531: 89 e5 mov %esp,%ebp
533: 57 push %edi
534: 56 push %esi
535: 31 f6 xor %esi,%esi
537: 53 push %ebx
538: 83 ec 2c sub $0x2c,%esp
53b: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
53e: eb 06 jmp 546 <gets+0x16>
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
540: 3c 0a cmp $0xa,%al
542: 74 39 je 57d <gets+0x4d>
544: 89 de mov %ebx,%esi
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
546: 8d 5e 01 lea 0x1(%esi),%ebx
549: 3b 5d 0c cmp 0xc(%ebp),%ebx
54c: 7d 31 jge 57f <gets+0x4f>
cc = read(0, &c, 1);
54e: 8d 45 e7 lea -0x19(%ebp),%eax
551: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
558: 00
559: 89 44 24 04 mov %eax,0x4(%esp)
55d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
564: e8 47 00 00 00 call 5b0 <read>
if(cc < 1)
569: 85 c0 test %eax,%eax
56b: 7e 12 jle 57f <gets+0x4f>
break;
buf[i++] = c;
56d: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
571: 88 44 1f ff mov %al,-0x1(%edi,%ebx,1)
if(c == '\n' || c == '\r')
575: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
579: 3c 0d cmp $0xd,%al
57b: 75 c3 jne 540 <gets+0x10>
57d: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
57f: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
583: 89 f8 mov %edi,%eax
585: 83 c4 2c add $0x2c,%esp
588: 5b pop %ebx
589: 5e pop %esi
58a: 5f pop %edi
58b: 5d pop %ebp
58c: c3 ret
58d: 90 nop
58e: 90 nop
58f: 90 nop
00000590 <fork>:
590: b8 01 00 00 00 mov $0x1,%eax
595: cd 30 int $0x30
597: c3 ret
00000598 <exit>:
598: b8 02 00 00 00 mov $0x2,%eax
59d: cd 30 int $0x30
59f: c3 ret
000005a0 <wait>:
5a0: b8 03 00 00 00 mov $0x3,%eax
5a5: cd 30 int $0x30
5a7: c3 ret
000005a8 <pipe>:
5a8: b8 04 00 00 00 mov $0x4,%eax
5ad: cd 30 int $0x30
5af: c3 ret
000005b0 <read>:
5b0: b8 06 00 00 00 mov $0x6,%eax
5b5: cd 30 int $0x30
5b7: c3 ret
000005b8 <write>:
5b8: b8 05 00 00 00 mov $0x5,%eax
5bd: cd 30 int $0x30
5bf: c3 ret
000005c0 <close>:
5c0: b8 07 00 00 00 mov $0x7,%eax
5c5: cd 30 int $0x30
5c7: c3 ret
000005c8 <kill>:
5c8: b8 08 00 00 00 mov $0x8,%eax
5cd: cd 30 int $0x30
5cf: c3 ret
000005d0 <exec>:
5d0: b8 09 00 00 00 mov $0x9,%eax
5d5: cd 30 int $0x30
5d7: c3 ret
000005d8 <open>:
5d8: b8 0a 00 00 00 mov $0xa,%eax
5dd: cd 30 int $0x30
5df: c3 ret
000005e0 <mknod>:
5e0: b8 0b 00 00 00 mov $0xb,%eax
5e5: cd 30 int $0x30
5e7: c3 ret
000005e8 <unlink>:
5e8: b8 0c 00 00 00 mov $0xc,%eax
5ed: cd 30 int $0x30
5ef: c3 ret
000005f0 <fstat>:
5f0: b8 0d 00 00 00 mov $0xd,%eax
5f5: cd 30 int $0x30
5f7: c3 ret
000005f8 <link>:
5f8: b8 0e 00 00 00 mov $0xe,%eax
5fd: cd 30 int $0x30
5ff: c3 ret
00000600 <mkdir>:
600: b8 0f 00 00 00 mov $0xf,%eax
605: cd 30 int $0x30
607: c3 ret
00000608 <chdir>:
608: b8 10 00 00 00 mov $0x10,%eax
60d: cd 30 int $0x30
60f: c3 ret
00000610 <dup>:
610: b8 11 00 00 00 mov $0x11,%eax
615: cd 30 int $0x30
617: c3 ret
00000618 <getpid>:
618: b8 12 00 00 00 mov $0x12,%eax
61d: cd 30 int $0x30
61f: c3 ret
00000620 <sbrk>:
620: b8 13 00 00 00 mov $0x13,%eax
625: cd 30 int $0x30
627: c3 ret
00000628 <sleep>:
628: b8 14 00 00 00 mov $0x14,%eax
62d: cd 30 int $0x30
62f: c3 ret
00000630 <tick>:
630: b8 15 00 00 00 mov $0x15,%eax
635: cd 30 int $0x30
637: c3 ret
00000638 <fork_tickets>:
638: b8 16 00 00 00 mov $0x16,%eax
63d: cd 30 int $0x30
63f: c3 ret
00000640 <fork_thread>:
640: b8 19 00 00 00 mov $0x19,%eax
645: cd 30 int $0x30
647: c3 ret
00000648 <wait_thread>:
648: b8 1a 00 00 00 mov $0x1a,%eax
64d: cd 30 int $0x30
64f: c3 ret
00000650 <sleep_lock>:
650: b8 17 00 00 00 mov $0x17,%eax
655: cd 30 int $0x30
657: c3 ret
00000658 <wake_lock>:
658: b8 18 00 00 00 mov $0x18,%eax
65d: cd 30 int $0x30
65f: c3 ret
00000660 <putc>:
//struct mutex_t plock;
static void
putc(int fd, char c)
{
660: 55 push %ebp
661: 89 e5 mov %esp,%ebp
663: 83 ec 28 sub $0x28,%esp
666: 88 55 f4 mov %dl,-0xc(%ebp)
write(fd, &c, 1);
669: 8d 55 f4 lea -0xc(%ebp),%edx
66c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
673: 00
674: 89 54 24 04 mov %edx,0x4(%esp)
678: 89 04 24 mov %eax,(%esp)
67b: e8 38 ff ff ff call 5b8 <write>
}
680: c9 leave
681: c3 ret
682: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
689: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000690 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
690: 55 push %ebp
691: 89 e5 mov %esp,%ebp
693: 57 push %edi
694: 89 c7 mov %eax,%edi
696: 56 push %esi
697: 89 ce mov %ecx,%esi
699: 53 push %ebx
69a: 83 ec 2c sub $0x2c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
69d: 8b 4d 08 mov 0x8(%ebp),%ecx
6a0: 85 c9 test %ecx,%ecx
6a2: 74 04 je 6a8 <printint+0x18>
6a4: 85 d2 test %edx,%edx
6a6: 78 5d js 705 <printint+0x75>
neg = 1;
x = -xx;
} else {
x = xx;
6a8: 89 d0 mov %edx,%eax
6aa: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
6b1: 31 c9 xor %ecx,%ecx
6b3: 8d 5d d8 lea -0x28(%ebp),%ebx
6b6: 66 90 xchg %ax,%ax
}
i = 0;
do{
buf[i++] = digits[x % base];
6b8: 31 d2 xor %edx,%edx
6ba: f7 f6 div %esi
6bc: 0f b6 92 7f 0a 00 00 movzbl 0xa7f(%edx),%edx
6c3: 88 14 0b mov %dl,(%ebx,%ecx,1)
6c6: 83 c1 01 add $0x1,%ecx
}while((x /= base) != 0);
6c9: 85 c0 test %eax,%eax
6cb: 75 eb jne 6b8 <printint+0x28>
if(neg)
6cd: 8b 45 d4 mov -0x2c(%ebp),%eax
6d0: 85 c0 test %eax,%eax
6d2: 74 08 je 6dc <printint+0x4c>
buf[i++] = '-';
6d4: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
6d9: 83 c1 01 add $0x1,%ecx
while(--i >= 0)
6dc: 8d 71 ff lea -0x1(%ecx),%esi
6df: 01 f3 add %esi,%ebx
6e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, buf[i]);
6e8: 0f be 13 movsbl (%ebx),%edx
6eb: 89 f8 mov %edi,%eax
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
6ed: 83 ee 01 sub $0x1,%esi
6f0: 83 eb 01 sub $0x1,%ebx
putc(fd, buf[i]);
6f3: e8 68 ff ff ff call 660 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
6f8: 83 fe ff cmp $0xffffffff,%esi
6fb: 75 eb jne 6e8 <printint+0x58>
putc(fd, buf[i]);
}
6fd: 83 c4 2c add $0x2c,%esp
700: 5b pop %ebx
701: 5e pop %esi
702: 5f pop %edi
703: 5d pop %ebp
704: c3 ret
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
705: 89 d0 mov %edx,%eax
707: f7 d8 neg %eax
709: c7 45 d4 01 00 00 00 movl $0x1,-0x2c(%ebp)
710: eb 9f jmp 6b1 <printint+0x21>
712: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000720 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
720: 55 push %ebp
721: 89 e5 mov %esp,%ebp
723: 57 push %edi
724: 56 push %esi
725: 53 push %ebx
726: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
729: 8b 45 0c mov 0xc(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
72c: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
72f: 0f b6 08 movzbl (%eax),%ecx
732: 84 c9 test %cl,%cl
734: 0f 84 96 00 00 00 je 7d0 <printf+0xb0>
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
73a: 8d 55 10 lea 0x10(%ebp),%edx
73d: 31 f6 xor %esi,%esi
73f: 89 55 e4 mov %edx,-0x1c(%ebp)
742: 31 db xor %ebx,%ebx
744: eb 1a jmp 760 <printf+0x40>
746: 66 90 xchg %ax,%ax
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
748: 83 f9 25 cmp $0x25,%ecx
74b: 0f 85 87 00 00 00 jne 7d8 <printf+0xb8>
751: 66 be 25 00 mov $0x25,%si
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
755: 83 c3 01 add $0x1,%ebx
758: 0f b6 0c 18 movzbl (%eax,%ebx,1),%ecx
75c: 84 c9 test %cl,%cl
75e: 74 70 je 7d0 <printf+0xb0>
c = fmt[i] & 0xff;
if(state == 0){
760: 85 f6 test %esi,%esi
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
762: 0f b6 c9 movzbl %cl,%ecx
if(state == 0){
765: 74 e1 je 748 <printf+0x28>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
767: 83 fe 25 cmp $0x25,%esi
76a: 75 e9 jne 755 <printf+0x35>
if(c == 'd'){
76c: 83 f9 64 cmp $0x64,%ecx
76f: 90 nop
770: 0f 84 fa 00 00 00 je 870 <printf+0x150>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
776: 83 f9 70 cmp $0x70,%ecx
779: 74 75 je 7f0 <printf+0xd0>
77b: 83 f9 78 cmp $0x78,%ecx
77e: 66 90 xchg %ax,%ax
780: 74 6e je 7f0 <printf+0xd0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
782: 83 f9 73 cmp $0x73,%ecx
785: 0f 84 8d 00 00 00 je 818 <printf+0xf8>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
78b: 83 f9 63 cmp $0x63,%ecx
78e: 66 90 xchg %ax,%ax
790: 0f 84 fe 00 00 00 je 894 <printf+0x174>
putc(fd, *ap);
ap++;
} else if(c == '%'){
796: 83 f9 25 cmp $0x25,%ecx
799: 0f 84 b9 00 00 00 je 858 <printf+0x138>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
79f: ba 25 00 00 00 mov $0x25,%edx
7a4: 89 f8 mov %edi,%eax
7a6: 89 4d e0 mov %ecx,-0x20(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
7a9: 83 c3 01 add $0x1,%ebx
} else if(c == '%'){
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
7ac: 31 f6 xor %esi,%esi
ap++;
} else if(c == '%'){
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
7ae: e8 ad fe ff ff call 660 <putc>
putc(fd, c);
7b3: 8b 4d e0 mov -0x20(%ebp),%ecx
7b6: 89 f8 mov %edi,%eax
7b8: 0f be d1 movsbl %cl,%edx
7bb: e8 a0 fe ff ff call 660 <putc>
7c0: 8b 45 0c mov 0xc(%ebp),%eax
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
7c3: 0f b6 0c 18 movzbl (%eax,%ebx,1),%ecx
7c7: 84 c9 test %cl,%cl
7c9: 75 95 jne 760 <printf+0x40>
7cb: 90 nop
7cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
state = 0;
}
}
//mutex_unlock(&plock);
}
7d0: 83 c4 2c add $0x2c,%esp
7d3: 5b pop %ebx
7d4: 5e pop %esi
7d5: 5f pop %edi
7d6: 5d pop %ebp
7d7: c3 ret
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
7d8: 89 f8 mov %edi,%eax
7da: 0f be d1 movsbl %cl,%edx
7dd: e8 7e fe ff ff call 660 <putc>
7e2: 8b 45 0c mov 0xc(%ebp),%eax
7e5: e9 6b ff ff ff jmp 755 <printf+0x35>
7ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
7f0: 8b 45 e4 mov -0x1c(%ebp),%eax
7f3: b9 10 00 00 00 mov $0x10,%ecx
ap++;
7f8: 31 f6 xor %esi,%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
7fa: c7 04 24 00 00 00 00 movl $0x0,(%esp)
801: 8b 10 mov (%eax),%edx
803: 89 f8 mov %edi,%eax
805: e8 86 fe ff ff call 690 <printint>
80a: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
80d: 83 45 e4 04 addl $0x4,-0x1c(%ebp)
811: e9 3f ff ff ff jmp 755 <printf+0x35>
816: 66 90 xchg %ax,%ax
} else if(c == 's'){
s = (char*)*ap;
818: 8b 55 e4 mov -0x1c(%ebp),%edx
81b: 8b 32 mov (%edx),%esi
ap++;
81d: 83 c2 04 add $0x4,%edx
820: 89 55 e4 mov %edx,-0x1c(%ebp)
if(s == 0)
823: 85 f6 test %esi,%esi
825: 0f 84 84 00 00 00 je 8af <printf+0x18f>
s = "(null)";
while(*s != 0){
82b: 0f b6 16 movzbl (%esi),%edx
82e: 84 d2 test %dl,%dl
830: 74 1d je 84f <printf+0x12f>
832: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
putc(fd, *s);
838: 0f be d2 movsbl %dl,%edx
s++;
83b: 83 c6 01 add $0x1,%esi
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
83e: 89 f8 mov %edi,%eax
840: e8 1b fe ff ff call 660 <putc>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
845: 0f b6 16 movzbl (%esi),%edx
848: 84 d2 test %dl,%dl
84a: 75 ec jne 838 <printf+0x118>
84c: 8b 45 0c mov 0xc(%ebp),%eax
} else if(c == '%'){
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
84f: 31 f6 xor %esi,%esi
851: e9 ff fe ff ff jmp 755 <printf+0x35>
856: 66 90 xchg %ax,%ax
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
} else if(c == '%'){
putc(fd, c);
858: 89 f8 mov %edi,%eax
85a: ba 25 00 00 00 mov $0x25,%edx
85f: e8 fc fd ff ff call 660 <putc>
864: 31 f6 xor %esi,%esi
866: 8b 45 0c mov 0xc(%ebp),%eax
869: e9 e7 fe ff ff jmp 755 <printf+0x35>
86e: 66 90 xchg %ax,%ax
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
870: 8b 45 e4 mov -0x1c(%ebp),%eax
873: b1 0a mov $0xa,%cl
ap++;
875: 66 31 f6 xor %si,%si
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
878: c7 04 24 01 00 00 00 movl $0x1,(%esp)
87f: 8b 10 mov (%eax),%edx
881: 89 f8 mov %edi,%eax
883: e8 08 fe ff ff call 690 <printint>
888: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
88b: 83 45 e4 04 addl $0x4,-0x1c(%ebp)
88f: e9 c1 fe ff ff jmp 755 <printf+0x35>
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
894: 8b 45 e4 mov -0x1c(%ebp),%eax
ap++;
897: 31 f6 xor %esi,%esi
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
899: 0f be 10 movsbl (%eax),%edx
89c: 89 f8 mov %edi,%eax
89e: e8 bd fd ff ff call 660 <putc>
8a3: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
8a6: 83 45 e4 04 addl $0x4,-0x1c(%ebp)
8aa: e9 a6 fe ff ff jmp 755 <printf+0x35>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
8af: be 78 0a 00 00 mov $0xa78,%esi
8b4: e9 72 ff ff ff jmp 82b <printf+0x10b>
8b9: 90 nop
8ba: 90 nop
8bb: 90 nop
8bc: 90 nop
8bd: 90 nop
8be: 90 nop
8bf: 90 nop
000008c0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
8c0: 55 push %ebp
Header *bp, *p;
bp = (Header*) ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8c1: a1 a8 0a 00 00 mov 0xaa8,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
8c6: 89 e5 mov %esp,%ebp
8c8: 57 push %edi
8c9: 56 push %esi
8ca: 53 push %ebx
8cb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*) ap - 1;
8ce: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8d1: 39 c8 cmp %ecx,%eax
8d3: 73 1d jae 8f2 <free+0x32>
8d5: 8d 76 00 lea 0x0(%esi),%esi
8d8: 8b 10 mov (%eax),%edx
8da: 39 d1 cmp %edx,%ecx
8dc: 72 1a jb 8f8 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
8de: 39 d0 cmp %edx,%eax
8e0: 72 08 jb 8ea <free+0x2a>
8e2: 39 c8 cmp %ecx,%eax
8e4: 72 12 jb 8f8 <free+0x38>
8e6: 39 d1 cmp %edx,%ecx
8e8: 72 0e jb 8f8 <free+0x38>
8ea: 89 d0 mov %edx,%eax
free(void *ap)
{
Header *bp, *p;
bp = (Header*) ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8ec: 39 c8 cmp %ecx,%eax
8ee: 66 90 xchg %ax,%ax
8f0: 72 e6 jb 8d8 <free+0x18>
8f2: 8b 10 mov (%eax),%edx
8f4: eb e8 jmp 8de <free+0x1e>
8f6: 66 90 xchg %ax,%ax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
8f8: 8b 71 04 mov 0x4(%ecx),%esi
8fb: 8d 3c f1 lea (%ecx,%esi,8),%edi
8fe: 39 d7 cmp %edx,%edi
900: 74 19 je 91b <free+0x5b>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
902: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
905: 8b 50 04 mov 0x4(%eax),%edx
908: 8d 34 d0 lea (%eax,%edx,8),%esi
90b: 39 ce cmp %ecx,%esi
90d: 74 21 je 930 <free+0x70>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
90f: 89 08 mov %ecx,(%eax)
freep = p;
911: a3 a8 0a 00 00 mov %eax,0xaa8
}
916: 5b pop %ebx
917: 5e pop %esi
918: 5f pop %edi
919: 5d pop %ebp
91a: c3 ret
bp = (Header*) ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
91b: 03 72 04 add 0x4(%edx),%esi
bp->s.ptr = p->s.ptr->s.ptr;
91e: 8b 12 mov (%edx),%edx
bp = (Header*) ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
920: 89 71 04 mov %esi,0x4(%ecx)
bp->s.ptr = p->s.ptr->s.ptr;
923: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
926: 8b 50 04 mov 0x4(%eax),%edx
929: 8d 34 d0 lea (%eax,%edx,8),%esi
92c: 39 ce cmp %ecx,%esi
92e: 75 df jne 90f <free+0x4f>
p->s.size += bp->s.size;
930: 03 51 04 add 0x4(%ecx),%edx
933: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
936: 8b 53 f8 mov -0x8(%ebx),%edx
939: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
93b: a3 a8 0a 00 00 mov %eax,0xaa8
}
940: 5b pop %ebx
941: 5e pop %esi
942: 5f pop %edi
943: 5d pop %ebp
944: c3 ret
945: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
949: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000950 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
950: 55 push %ebp
951: 89 e5 mov %esp,%ebp
953: 57 push %edi
954: 56 push %esi
955: 53 push %ebx
956: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
959: 8b 5d 08 mov 0x8(%ebp),%ebx
if((prevp = freep) == 0){
95c: 8b 0d a8 0a 00 00 mov 0xaa8,%ecx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
962: 83 c3 07 add $0x7,%ebx
965: c1 eb 03 shr $0x3,%ebx
968: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
96b: 85 c9 test %ecx,%ecx
96d: 0f 84 93 00 00 00 je a06 <malloc+0xb6>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
973: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
975: 8b 50 04 mov 0x4(%eax),%edx
978: 39 d3 cmp %edx,%ebx
97a: 76 1f jbe 99b <malloc+0x4b>
p->s.size -= nunits;
p += p->s.size;
p->s.size = nunits;
}
freep = prevp;
return (void*) (p + 1);
97c: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
983: 90 nop
984: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
if(p == freep)
988: 3b 05 a8 0a 00 00 cmp 0xaa8,%eax
98e: 74 30 je 9c0 <malloc+0x70>
990: 89 c1 mov %eax,%ecx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
992: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
994: 8b 50 04 mov 0x4(%eax),%edx
997: 39 d3 cmp %edx,%ebx
999: 77 ed ja 988 <malloc+0x38>
if(p->s.size == nunits)
99b: 39 d3 cmp %edx,%ebx
99d: 74 61 je a00 <malloc+0xb0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
99f: 29 da sub %ebx,%edx
9a1: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
9a4: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
9a7: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
9aa: 89 0d a8 0a 00 00 mov %ecx,0xaa8
return (void*) (p + 1);
9b0: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
9b3: 83 c4 1c add $0x1c,%esp
9b6: 5b pop %ebx
9b7: 5e pop %esi
9b8: 5f pop %edi
9b9: 5d pop %ebp
9ba: c3 ret
9bb: 90 nop
9bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
morecore(uint nu)
{
char *p;
Header *hp;
if(nu < PAGE)
9c0: 81 fb ff 0f 00 00 cmp $0xfff,%ebx
9c6: b8 00 80 00 00 mov $0x8000,%eax
9cb: bf 00 10 00 00 mov $0x1000,%edi
9d0: 76 04 jbe 9d6 <malloc+0x86>
9d2: 89 f0 mov %esi,%eax
9d4: 89 df mov %ebx,%edi
nu = PAGE;
p = sbrk(nu * sizeof(Header));
9d6: 89 04 24 mov %eax,(%esp)
9d9: e8 42 fc ff ff call 620 <sbrk>
if(p == (char*) -1)
9de: 83 f8 ff cmp $0xffffffff,%eax
9e1: 74 18 je 9fb <malloc+0xab>
return 0;
hp = (Header*)p;
hp->s.size = nu;
9e3: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
9e6: 83 c0 08 add $0x8,%eax
9e9: 89 04 24 mov %eax,(%esp)
9ec: e8 cf fe ff ff call 8c0 <free>
return freep;
9f1: 8b 0d a8 0a 00 00 mov 0xaa8,%ecx
}
freep = prevp;
return (void*) (p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
9f7: 85 c9 test %ecx,%ecx
9f9: 75 97 jne 992 <malloc+0x42>
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
9fb: 31 c0 xor %eax,%eax
9fd: eb b4 jmp 9b3 <malloc+0x63>
9ff: 90 nop
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
a00: 8b 10 mov (%eax),%edx
a02: 89 11 mov %edx,(%ecx)
a04: eb a4 jmp 9aa <malloc+0x5a>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
a06: c7 05 a8 0a 00 00 a0 movl $0xaa0,0xaa8
a0d: 0a 00 00
base.s.size = 0;
a10: b9 a0 0a 00 00 mov $0xaa0,%ecx
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
a15: c7 05 a0 0a 00 00 a0 movl $0xaa0,0xaa0
a1c: 0a 00 00
base.s.size = 0;
a1f: c7 05 a4 0a 00 00 00 movl $0x0,0xaa4
a26: 00 00 00
a29: e9 45 ff ff ff jmp 973 <malloc+0x23>
|
source/directories/machine-pc-linux-gnu/s-nadivo.ads | ytomino/drake | 33 | 27882 | pragma License (Unrestricted);
-- implementation unit specialized for Linux
with C.sys.statfs;
package System.Native_Directories.Volumes is
-- File system information.
pragma Preelaborate;
subtype File_Size is Ada.Streams.Stream_Element_Count;
type File_System is record
Statistics : aliased C.sys.statfs.struct_statfs :=
(f_type => 0, others => <>);
Format_Name_Offset : C.ptrdiff_t;
Format_Name_Length : C.size_t;
Directory_Offset : C.ptrdiff_t;
Directory_Length : C.size_t;
Device_Offset : C.ptrdiff_t;
Device_Length : C.size_t;
Info : C.char_ptr := null; -- the line of /proc/self/mountinfo
end record;
pragma Suppress_Initialization (File_System);
function Is_Assigned (FS : File_System) return Boolean;
pragma Inline (Is_Assigned);
Disable_Controlled : constant Boolean := True;
procedure Get (Name : String; FS : aliased out File_System);
procedure Finalize (FS : in out File_System);
function Size (FS : File_System) return File_Size;
function Free_Space (FS : File_System) return File_Size;
function Format_Name (FS : aliased in out File_System) return String;
function Directory (FS : aliased in out File_System) return String;
function Device (FS : aliased in out File_System) return String;
function Case_Preserving (FS : File_System) return Boolean is (True);
function Case_Sensitive (FS : File_System) return Boolean is (True);
function Is_HFS (FS : File_System) return Boolean is (False);
subtype File_System_Id is C.sys.types.fsid_t;
function Identity (FS : File_System) return File_System_Id;
-- unimplemented
function Owner (FS : File_System) return String
with Import, Convention => Ada, External_Name => "__drake_program_error";
end System.Native_Directories.Volumes;
|
assembler/tests/t_78k0/t_78k0.asm | paulscottrobson/RCA-Cosmac-VIP-III | 1 | 5076 | <gh_stars>1-10
cpu 78070
page 0
relaxed on
include reg78k0.inc
saddr equ 0fe80h
sfr equ 0ff90h
brk
ret
retb
reti
nop
ei
di
halt
stop
adjba
adjbs
mov d,#20
mov saddr,#30
mov sfr,#40
mov a,c
mov e,a
mov a,saddr
mov saddr,a
mov a,sfr
mov sfr,a
mov a,!saddr
mov !saddr,r1
mov psw,#40h
mov a,psw
mov psw,a
mov a,[de]
mov [de],a
mov a,[hl]
mov [hl],a
mov a,[hl+10]
mov [hl+10],a
mov a,[hl+b]
mov [hl+b],a
mov a,[hl+c]
mov [hl+c],a
xch a,d
xch l,a
xch a,saddr
xch a,sfr
xch a,!saddr
xch a,[de]
xch a,[hl]
xch a,[hl+10]
xch a,[hl+b]
xch a,[hl+c]
movw de,#1000
movw saddr,#2000
movw sfr,#3000
movw ax,saddr
movw saddr,ax
movw ax,sfr
movw sfr,ax
movw ax,de
movw hl,ax
movw ax,!saddr
movw !saddr,ax
xchw ax,de
xchw hl,ax
add a,#10
add saddr,#20
add a,c
add h,a
add a,saddr
add a,!saddr
add a,[hl]
add a,[hl+10]
add a,[hl+b]
add a,[hl+c]
addc a,#10
addc saddr,#20
addc a,c
addc h,a
addc a,saddr
addc a,!saddr
addc a,[hl]
addc a,[hl+10]
addc a,[hl+b]
addc a,[hl+c]
sub a,#10
sub saddr,#20
sub a,c
sub h,a
sub a,saddr
sub a,!saddr
sub a,[hl]
sub a,[hl+10]
sub a,[hl+b]
sub a,[hl+c]
subc a,#10
subc saddr,#20
subc a,c
subc h,a
subc a,saddr
subc a,!saddr
subc a,[hl]
subc a,[hl+10]
subc a,[hl+b]
subc a,[hl+c]
and a,#10
and saddr,#20
and a,c
and h,a
and a,saddr
and a,!saddr
and a,[hl]
and a,[hl+10]
and a,[hl+b]
and a,[hl+c]
or a,#10
or saddr,#20
or a,c
or h,a
or a,saddr
or a,!saddr
or a,[hl]
or a,[hl+10]
or a,[hl+b]
or a,[hl+c]
xor a,#10
xor saddr,#20
xor a,c
xor h,a
xor a,saddr
xor a,!saddr
xor a,[hl]
xor a,[hl+10]
xor a,[hl+b]
xor a,[hl+c]
cmp a,#10
cmp saddr,#20
cmp a,c
cmp h,a
cmp a,saddr
cmp a,!saddr
cmp a,[hl]
cmp a,[hl+10]
cmp a,[hl+b]
cmp a,[hl+c]
addw ax,#1234h
subw rp0,#2345h
cmpw ax,#3456h
mulu x
divuw c
inc d
inc saddr
dec e
dec saddr
incw hl
decw de
ror a,1
rol a,1
rorc a,1
rolc a,1
ror4 [hl]
rol4 [hl]
mov1 cy,saddr.3
mov1 cy,sfr.4
mov1 cy,a.5
mov1 cy,psw.6
mov1 cy,[hl].7
mov1 saddr.3,cy
mov1 sfr.4,cy
mov1 a.5,cy
mov1 psw.6,cy
mov1 [hl].7,cy
and1 cy,saddr.3
and1 cy,sfr.4
and1 cy,a.5
and1 cy,psw.6
and1 cy,[hl].7
or1 cy,saddr.3
or1 cy,sfr.4
or1 cy,a.5
or1 cy,psw.6
or1 cy,[hl].7
xor1 cy,saddr.3
xor1 cy,sfr.4
xor1 cy,a.5
xor1 cy,psw.6
xor1 cy,[hl].7
set1 saddr.3
set1 sfr.4
set1 a.5
set1 psw.6
set1 [hl].7
clr1 saddr.3
clr1 sfr.4
clr1 a.5
clr1 psw.6
clr1 [hl].7
set1 cy
clr1 cy
not1 cy
call 1234h
callf 234h
callt [12h]
push psw
push de
pop psw
pop hl
movw sp,#1234h
movw sp,ax
movw ax,sp
br ax
br rp0
br 1234h
br pc
br $pc
br !pc
bc pc
bnc pc
bz pc
bnz pc
bt saddr.3,pc
bt sfr.4,pc
bt a.5,pc
bt psw.6,pc
bt [hl].7,pc
bf saddr.3,pc
bf sfr.4,pc
bf a.5,pc
bf psw.6,pc
bf [hl].7,pc
btclr saddr.3,pc
btclr sfr.4,pc
btclr a.5,pc
btclr psw.6,pc
btclr [hl].7,pc
dbnz b,pc
dbnz c,pc
dbnz saddr,pc
sel rb0
sel rb1
sel rb2
sel rb3
db 1,2,3
dw 1,2,3
dd 1,2,3
dd 1.0,2.0,3.0
dq 1.0,2.0,3.0
dt 1.0,2.0,3.0
db 10 dup (?)
db 0
end
|
oeis/033/A033659.asm | neoneye/loda-programs | 11 | 80927 | <filename>oeis/033/A033659.asm
; A033659: Trajectory of 27 under map x->x + (x-with-digits-reversed).
; Submitted by <NAME>(s4)
; 27,99,198,1089,10890,20691,40293,79497,158994,658845,1207701,2284722,4559544,9019098,17928207,88211178,175322466,839546037,1570191975,7362102726,13634115363,49985258994,99970517988
mov $2,$0
lpb $2
mov $0,$1
add $0,27
seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences).
add $1,$0
sub $2,1
lpe
mov $0,$1
add $0,27
|
programs/oeis/184/A184676.asm | karttu/loda | 1 | 165323 | <reponame>karttu/loda<gh_stars>1-10
; A184676: a(n) = n + floor((n/2-1/(4*n))^2); complement of A183867.
; 1,2,5,7,11,14,19,23,29,34,41,47,55,62,71,79,89,98,109,119,131,142,155,167,181,194,209,223,239,254,271,287,305,322,341,359,379,398,419,439,461,482,505,527,551,574,599,623,649,674,701,727,755,782,811,839,869,898,929,959,991,1022,1055,1087,1121,1154,1189,1223,1259,1294,1331,1367,1405,1442,1481,1519,1559,1598,1639,1679,1721,1762,1805,1847,1891,1934,1979,2023,2069,2114,2161,2207,2255,2302,2351,2399,2449,2498,2549,2599,2651,2702,2755,2807,2861,2914,2969,3023,3079,3134,3191,3247,3305,3362,3421,3479,3539,3598,3659,3719,3781,3842,3905,3967,4031,4094,4159,4223,4289,4354,4421,4487,4555,4622,4691,4759,4829,4898,4969,5039,5111,5182,5255,5327,5401,5474,5549,5623,5699,5774,5851,5927,6005,6082,6161,6239,6319,6398,6479,6559,6641,6722,6805,6887,6971,7054,7139,7223,7309,7394,7481,7567,7655,7742,7831,7919,8009,8098,8189,8279,8371,8462,8555,8647,8741,8834,8929,9023,9119,9214,9311,9407,9505,9602,9701,9799,9899,9998,10099,10199,10301,10402,10505,10607,10711,10814,10919,11023,11129,11234,11341,11447,11555,11662,11771,11879,11989,12098,12209,12319,12431,12542,12655,12767,12881,12994,13109,13223,13339,13454,13571,13687,13805,13922,14041,14159,14279,14398,14519,14639,14761,14882,15005,15127,15251,15374,15499,15623,15749,15874
add $0,3
pow $0,2
sub $0,5
div $0,4
mov $1,$0
|
programs/oeis/027/A027768.asm | karttu/loda | 1 | 177814 | ; A027768: (n+1)*C(n+1,8).
; 8,81,450,1815,5940,16731,42042,96525,205920,413270,787644,1436058,2519400,4273290,7034940,11277222,17651304,27039375,40619150,59942025,87026940,124472205,175587750,244550475,336585600,458177148,617310936,823753700,1089372240
add $0,8
mov $1,$0
bin $1,8
mul $1,$0
|
source/asis/spec/annex_d/ada-execution_time-timers.ads | faelys/gela-asis | 4 | 3128 | ------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of ada.ads file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with System;
package Ada.Execution_Time.Timers is
type Timer (T : not null access constant Ada.Task_Identification.Task_Id) is
tagged limited private;
type Timer_Handler is access protected procedure (TM : in out Timer);
Min_Handler_Ceiling : constant System.Any_Priority :=
implementation-defined;
procedure Set_Handler (TM : in out Timer;
In_Time : in Ada.Real_Time.Time_Span;
Handler : in Timer_Handler);
procedure Set_Handler (TM : in out Timer;
At_Time : in CPU_Time;
Handler : in Timer_Handler);
function Current_Handler (TM : Timer) return Timer_Handler;
procedure Cancel_Handler (TM : in out Timer;
Cancelled : out Boolean);
function Time_Remaining (TM : Timer) return Ada.Real_Time.Time_Span;
Timer_Resource_Error : exception;
private
pragma Import (Ada, Timer);
end Ada.Execution_Time.Timers;
|
programs/oeis/260/A260217.asm | neoneye/loda | 22 | 21677 | ; A260217: Number of base-3 n-digit pandigital numbers.
; 0,0,4,24,100,360,1204,3864,12100,37320,114004,346104,1046500,3155880,9500404,28566744,85831300,257756040,773792404,2322425784,6969374500,20912317800,62745342004,188252803224,564791964100,1694443001160,5083463221204,15250658099064
seq $0,3063 ; a(n) = 3^(n-1)-2^n.
add $0,1
mul $0,2
|
src/apsepp-test_event_class-impl.ads | thierr26/ada-apsepp | 0 | 12168 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Apsepp.Test_Event_Class.Generic_R_Index_Mixin,
Apsepp.Test_Event_Class.Generic_Assert_Num_Mixin,
Apsepp.Test_Event_Class.Generic_Exception_Mixin,
Apsepp.Test_Event_Class.Generic_Timestamp_Mixin;
package Apsepp.Test_Event_Class.Impl is
----------------------------------------------------------------------------
package Derivation is
-----------------------------------------------------
type Test_Event_FCTNA is abstract new Test_Event with private;
overriding
procedure Set (Obj : in out Test_Event_FCTNA;
Data : Test_Event_Data);
overriding
function Has_Previous_Child_Tag (Obj : Test_Event_FCTNA) return Boolean
is (True);
overriding
function Previous_Child_Tag (Obj : Test_Event_FCTNA) return Tag;
-----------------------------------------------------
type Test_Event_NCCS is new Test_Event with private;
-----------------------------------------------------
type Test_Event_PNCC is new Test_Event with private;
-----------------------------------------------------
type Test_Event_FNCC is new Test_Event with private;
-----------------------------------------------------
type Test_Event_PNCA is new Test_Event with private;
-----------------------------------------------------
type Test_Event_FNCA is new Test_Event with private;
-----------------------------------------------------
type Test_Event_NRS is new Test_Event with private;
-----------------------------------------------------
type Test_Event_TRS is new Test_Event with private;
-----------------------------------------------------
type Test_Event_TRC is new Test_Event with private;
overriding
procedure Set (Obj : in out Test_Event_TRC;
Data : Test_Event_Data);
overriding
function Has_Last_Cancelled_R_Index (Obj : Test_Event_TRC) return Boolean
is (True);
overriding
function Last_Cancelled_R_Index
(Obj : Test_Event_TRC) return Test_Routine_Index;
-----------------------------------------------------
type Test_Event_FTRA is new Test_Event with private;
-----------------------------------------------------
type Test_Event_FTRS is new Test_Event with private;
-----------------------------------------------------
type Test_Event_PTA is new Test_Event with private;
-----------------------------------------------------
type Test_Event_FTA is new Test_Event with private;
-----------------------------------------------------
type Test_Event_URE is new Test_Event with private;
-----------------------------------------------------
type Test_Event_PTR is new Test_Event with private;
-----------------------------------------------------
type Test_Event_FTR is new Test_Event with private;
-----------------------------------------------------
type Test_Event_PNR is new Test_Event_Final with private;
-----------------------------------------------------
type Test_Event_FNR is new Test_Event_Final with private;
-----------------------------------------------------
private
type Test_Event_FCTNA is abstract new Test_Event with record
Previous_Child_Tag : Tag;
end record;
type Test_Event_NCCS is new Test_Event with null record;
type Test_Event_PNCC is new Test_Event with null record;
type Test_Event_FNCC is new Test_Event with null record;
type Test_Event_PNCA is new Test_Event with null record;
type Test_Event_FNCA is new Test_Event with null record;
type Test_Event_NRS is new Test_Event with null record;
type Test_Event_TRS is new Test_Event with null record;
type Test_Event_TRC is new Test_Event with record
Last_Cancelled_R_Index : Test_Routine_Index;
end record;
type Test_Event_FTRA is new Test_Event with null record;
type Test_Event_FTRS is new Test_Event with null record;
type Test_Event_PTA is new Test_Event with null record;
type Test_Event_FTA is new Test_Event with null record;
type Test_Event_URE is new Test_Event with null record;
type Test_Event_PTR is new Test_Event with null record;
type Test_Event_FTR is new Test_Event with null record;
type Test_Event_PNR is new Test_Event_Final with null record;
type Test_Event_FNR is new Test_Event_Final with null record;
end Derivation;
----------------------------------------------------------------------------
package R_Index_Mixin is
package TRS_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_TRS);
package FTRA_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_FTRA);
package FTRS_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_FTRS);
package PTA_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_PTA);
package FTA_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_FTA);
package URE_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_URE);
package PTR_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_PTR);
package FTR_R_Mixin
is new Generic_R_Index_Mixin (Derivation.Test_Event_FTR);
end R_Index_Mixin;
----------------------------------------------------------------------------
package Assert_Num_Mixin is
package PTA_R_A_Mixin
is new Generic_Assert_Num_Mixin
(R_Index_Mixin.PTA_R_Mixin.Child_W_R_Index);
package FTA_R_A_Mixin
is new Generic_Assert_Num_Mixin
(R_Index_Mixin.FTA_R_Mixin.Child_W_R_Index);
end Assert_Num_Mixin;
----------------------------------------------------------------------------
package Exception_Mixin is
package FCTNA_Ex_Mixin
is new Generic_Exception_Mixin (Derivation.Test_Event_FCTNA);
package UNCCE_Ex_Mixin
is new Generic_Exception_Mixin (Test_Event);
package UNRE_Ex_Mixin
is new Generic_Exception_Mixin (Test_Event);
package FTRA_R_Ex_Mixin
is new Generic_Exception_Mixin
(R_Index_Mixin.FTRA_R_Mixin.Child_W_R_Index);
package FTRS_R_Ex_Mixin
is new Generic_Exception_Mixin
(R_Index_Mixin.FTRS_R_Mixin.Child_W_R_Index);
package FTA_R_Ex_Mixin
is new Generic_Exception_Mixin
(R_Index_Mixin.FTA_R_Mixin.Child_W_R_Index);
package FTA_R_A_Ex_Mixin
is new Generic_Exception_Mixin
(Assert_Num_Mixin.FTA_R_A_Mixin.Child_W_Assert_Num);
package URE_R_Ex_Mixin
is new Generic_Exception_Mixin
(R_Index_Mixin.URE_R_Mixin.Child_W_R_Index);
end Exception_Mixin;
----------------------------------------------------------------------------
package Timestamp_Mixin is
package FCTNA_Ex_Ti_Mixin is new Generic_Timestamp_Mixin
(Exception_Mixin.FCTNA_Ex_Mixin.Child_W_Exception);
package UNCCE_Ex_Ti_Mixin is new Generic_Timestamp_Mixin
(Exception_Mixin.UNCCE_Ex_Mixin.Child_W_Exception);
package UNRE_Ex_Ti_Mixin is new Generic_Timestamp_Mixin
(Exception_Mixin.UNRE_Ex_Mixin.Child_W_Exception);
package NCCS_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_NCCS);
package PNCC_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_PNCC);
package FNCC_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_FNCC);
package PNCA_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_PNCA);
package FNCA_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_FNCA);
package NRS_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_NRS);
package TRS_R_Ti_Mixin is new Generic_Timestamp_Mixin
(R_Index_Mixin.TRS_R_Mixin.Child_W_R_Index);
package TRC_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_TRC);
package FTRA_R_Ex_Ti_Mixin
is new Generic_Timestamp_Mixin
(Exception_Mixin.FTRA_R_Ex_Mixin.Child_W_Exception);
package FTRS_R_Ex_Ti_Mixin
is new Generic_Timestamp_Mixin
(Exception_Mixin.FTRS_R_Ex_Mixin.Child_W_Exception);
package PTA_R_Ti_Mixin is new Generic_Timestamp_Mixin
(R_Index_Mixin.PTA_R_Mixin.Child_W_R_Index);
package PTA_R_A_Ti_Mixin is new Generic_Timestamp_Mixin
(Assert_Num_Mixin.PTA_R_A_Mixin.Child_W_Assert_Num);
package FTA_R_Ex_Ti_Mixin is new Generic_Timestamp_Mixin
(Exception_Mixin.FTA_R_Ex_Mixin.Child_W_Exception);
package FTA_R_A_Ex_Ti_Mixin is new Generic_Timestamp_Mixin
(Exception_Mixin.FTA_R_A_Ex_Mixin.Child_W_Exception);
package URE_R_Ex_Ti_Mixin
is new Generic_Timestamp_Mixin
(Exception_Mixin.URE_R_Ex_Mixin.Child_W_Exception);
package PTR_R_Ti_Mixin is new Generic_Timestamp_Mixin
(R_Index_Mixin.PTR_R_Mixin.Child_W_R_Index);
package FTR_R_Ti_Mixin is new Generic_Timestamp_Mixin
(R_Index_Mixin.FTR_R_Mixin.Child_W_R_Index);
package PNR_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_PNR);
package FNR_Ti_Mixin
is new Generic_Timestamp_Mixin (Derivation.Test_Event_FNR);
end Timestamp_Mixin;
----------------------------------------------------------------------------
end Apsepp.Test_Event_Class.Impl;
|
ch10/Macro1.asm | William0Friend/my_masm | 0 | 103622 | TITLE Macro Examples - 1 (Macro1.ASM)
; This program demonstrates the MACRO directive.
INCLUDE Irvine32.inc
INCLUDE macros.inc
mPutchar MACRO char
push eax
mov al,char
call WriteChar
pop eax
ENDM
mPrintChar MACRO char,count
LOCAL temp
.data
temp BYTE count DUP(&char),0
.code
push edx
mov edx,OFFSET temp
call WriteString
pop edx
ENDM
mWriteAt MACRO X,Y,literal
mGotoxy X,Y
mWrite literal
ENDM
mPromptInteger MACRO prompt,returnVal
mWrite prompt
call ReadInt
mov returnVal,eax
ENDM
.data
minVal DWORD ?
.code
main PROC
call Clrscr
mWriteAt 15,10,"Hi there"
call Crlf
;---------------------------------
mPutchar 'A'
; Invoke the macro in a loop.
mov al,'A'
mov ecx,20
L1:
mPutchar al
inc al
Loop L1
exit
main ENDP
END main |
alloy4fun_models/trashltl/models/4/jgsThgwQ2EFYBcBQC.als | Kaixi26/org.alloytools.alloy | 0 | 1459 | <filename>alloy4fun_models/trashltl/models/4/jgsThgwQ2EFYBcBQC.als
open main
pred idjgsThgwQ2EFYBcBQC_prop5 {
some Trash
}
pred __repair { idjgsThgwQ2EFYBcBQC_prop5 }
check __repair { idjgsThgwQ2EFYBcBQC_prop5 <=> prop5o } |
smsq/qxl/nasty_e2.asm | olifink/smsqe | 0 | 166035 | <reponame>olifink/smsqe
; Nasty Initialisation for QXL SMSQ/E
; 2006.10.20 1.01 BLAT macro definitions commented out - macro wasn't used (wl)
section header
xref smsq_end
header_base
dc.l nasty_base-header_base ; length of header
dc.l 0 ; module length unknown
dc.l smsq_end-nasty_base ; loaded length
dc.l 0 ; checksum
dc.l 0 ; always select
dc.b 1 ; 1 level down
dc.b 0
dc.w smsq_name-*
smsq_name
dc.w 24,'SMSQ QXL Initialisation '
dc.l ' '
dc.w $200a
section init
xref qxl_speed
xref qxl_isrv
xref qxl_queue_set
xref qxl_mess_add
xref sms_hdop
xref sms_rrtc
xref sms_srtc
xref sms_artc
xref gu_achpp
include 'dev8_keys_sys'
include 'dev8_keys_psf'
include 'dev8_keys_qdos_sms'
include 'dev8_smsq_smsq_base_keys'
include 'dev8_smsq_smsq_config_keys'
include 'dev8_smsq_qxl_keys'
include 'dev8_smsq_qxl_comm_keys'
include 'dev8_mac_assert'
include 'dev8_mac_creg'
*blat macro blv
* xref blatt
* move.b [blv],-(sp)
* jsr blatt
* add.w #2,sp
* endm
*
*blatl macro blv
* xref blattl
* move.l [blv],-(sp)
* jsr blattl
* addq.l #4,sp
* endm
nasty_base
; bsr xx
; bra.s *
xx
; The nasty initialisation requires a return to system state
moveq #sms.xtop,d0
trap #do.sms2 ; do code until rts as extop
; blat #$55
clr.w psf_sr(a5) ; enable interrupts on return
st sys_castt(a6) ; keep caches disabled
lea hw_poll,a0
move.l a0,sms.hpoll ; poll tidy up
lea sms_hdop,a0
move.l a0,sms.t1tab+sms.hdop*4 ; set hdop
assert sms.rrtc,sms.srtc-1,sms.artc-2
lea sms.t1tab+sms.rrtc*4,a1 ; set rtc
lea sms_rrtc,a0
move.l a0,(a1)+
lea sms_srtc,a0
move.l a0,(a1)+
lea sms_artc,a0
move.l a0,(a1)+
assert qxl_ninl,0 ; set ninl to 0
move.l #$00030000,0 ; and address 0 to = QL address 0
assert qxl_ninh,4
st qxl_ninh
move.b #qxl.intn,qxl_intn ; set vectored interrupt number
lea qxl_isrv,a1
move.l a1,qxl_ivec ; and interrupt vector
moveq #0,d0
move.b sms.conf+sms_clock-8,d0
move.w d0,qxl_clock
cmp.l #$60000,sys_ramt(a6)
sle sms.conf+sms_128k ; set small machine <= 256k
clr.w qxl_junk ; clear junk word
clr.w qxl_mtick_count
move.l #qxl_qxpc.alc+qxl_qxpc.ext+qxl_qxpc.qu+qxl_pcqx.alc+qxl_scr.work+qxl.message,d1
move.l sms.usetop,d2
move.l d2,d0
sub.l sys_ramt(a6),d0 ; enough room above RAMTOP?
cmp.l d0,d1
bgt.s qns_respr
sub.l d1,d2 ; put all the buffers etc below usetop
and.w #$fff0,d2
move.l d2,a0
bra.s qns_setbuff
qns_respr
moveq #sms.arpa,d0 ; put all the buffers etc in the RP
trap #do.sms2
qns_setbuff
move.l a0,a3 ; base of buffer area
add.w #qxl_qxpc.ext,a0
;; tst.b $2817f
;; beq.s xx2
;; blatl a0
;;xx2
move.l a0,qxl_qxpc_mess ; qxl-pc buffer
move.l a0,qxl_qxpc_eom(a0) ; empty
lea qxl_qxpc.alc-$8(a0),a1
move.l a1,qxl_qxpc_eob(a0) ; set limit
add.w #qxl_qxpc.alc,a0
move.l a0,qxl_qxpc_qu
lea qxl_qxpc.qu(a0),a2
jsr qxl_queue_set ; set up queue
move.l a2,a0
move.l a0,qxl_pcqx_mess ; pc-qxl buffer
add.w #qxl_pcqx.alc,a0
move.l a0,qxl_scr_work ; screen work area (zero size screen)
move.l sys_ramt(a6),a1
cmp.l a1,a3 ; buffer area above RAMTOP?
ble.s qns_noscrn
move.l a1,qxl_scrb(a0) ; set screen base to RAMTOP
sub.l a1,a3
move.l a3,qxl_scra(a0)
bra.s qns_ssbits
qns_noscrn
clr.l qxl_scra(a0) ; no allocation yet
clr.l qxl_scrb(a0) ; ... so no base address
qns_ssbits
move.b #4,qxl_vql(a0) ; default to 4 colour for QL
move.w #qxl.vchek<<8+qxl.vcopy,qxl_vchek(a0) ; initial scan bits
add.w #qxl_scr.work,a0
move.l a0,qxl_message
clr.w qxl_ms_pcset(a0) ; no PC setup message yet
clr.l qxl_ms_len+qxl_ms_vmode(a0) ; no vga mode message
clr.l qxl_ms_len+qxl_ms_date(a0) ; no date message
clr.l qxl_ms_len+qxl_ms_beep(a0) ; no beep message
clr.l qxl_ms_len+qxl_ms_mouse(a0) ; clear mouse command
clr.l qxl_ms_mouse+qxm_dx(a0)
clr.l qxl_ms_len+qxl_ms_port(a0) ; no port message
clr.l qxl_ms_len+qxl_ms_flow(a0) ; no flow control message
clr.l qxl_ms_len+qxl_ms_phys(a0) ; no physical transaction
clr.l qxl_ms_len+qxl_ms_vgap(a0) ; no VGA palette message
move.w #1,qxl_ms_beep+qxl_ms_spare(a0) ; kill beep
clr.l qxl_kbd_link
clr.l qxl_spp_link
; blat #$81
; blatl qxl_qxpc_mess
; blat #$82
; blatl qxl_pcqx_mess
; blat #$83
; blatl qxl_qxpc_qu
; move.l qxl_qxpc_qu,a1
; blat #$84
; blatl (a1)
; blatl 4(a1)
; blatl 8(a1)
; blatl $c(a1)
; blat #$85
; blatl qxl_scr_work
; blat #$86
; blatl qxl_message
st qxl_junk ; junk incoming messages
and.w #$f8ff,sr ; now we can enable interrupts
jsr qxl_speed ; check speed
move.l qxl_message,a0 ;;; strictly unnecessary
lea qxl_ms_pcset+6(a0),a1
clr.w (a1)
move.l #4<<16+qxm.rsetup<<8,-(a1)
jsr qxl_mess_add ; send request for PC setup message
qns_wait
tst.w qxl_ms_pcset(a0) ; and wait for PC setup message
beq.s qns_wait
sf qxl_junk ; accept incoming messages
; blat (a0)
; blat 7(a0)
rts
;+++
; QXL SMS2 polling interrupt server operating off the poll interrupt.
; See SHD_POLL.
;---
hw_poll
; subq.w #1,$20004
; bgt.s xx
; move.w #50,$20004
; not.w $20006
;xx
or.w #$0700,sr ; disble interrupts until sched or RTE
clr.b sys_plrq(a6) ; request serviced
rts
end
|
projects/batfish/src/main/antlr4/org/batfish/grammar/cisco_xr/CiscoXr_igmp.g4 | pranavbj-amzn/batfish | 763 | 3032 | parser grammar CiscoXr_igmp;
import CiscoXr_common;
options {
tokenVocab = CiscoXrLexer;
}
router_igmp: IGMP NEWLINE router_igmp_inner*;
router_igmp_inner
:
rigmp_null
| rigmp_vrf
| rigmp_vrf_inner
;
rigmp_vrf_inner
:
rigmp_access_group
| rigmp_explicit_tracking
| rigmp_interface
| rigmp_maximum
| rigmp_ssm
| rigmp_traffic
| rigmpv_null
;
rigmp_interface_inner
:
rigmpi_access_group
| rigmpi_explicit_tracking
| rigmpi_maximum
| rigmpi_null
;
rigmp_null
:
(
ACCOUNTING
| NSF
| UNICAST_QOS_ADJUST
) null_rest_of_line
;
rigmpv_null
:
(
QUERY_INTERVAL
| QUERY_MAX_RESPONSE_TIME
| QUERY_TIMEOUT
| ROBUSTNESS_COUNT
| VERSION
) null_rest_of_line
;
rigmpi_null
:
(
JOIN_GROUP
| QUERY_INTERVAL
| QUERY_MAX_RESPONSE_TIME
| QUERY_TIMEOUT
| ROUTER
| STATIC_GROUP
| VERSION
) null_rest_of_line
;
rigmp_access_group: ACCESS_GROUP name = access_list_name NEWLINE;
rigmp_explicit_tracking: EXPLICIT_TRACKING name = access_list_name? NEWLINE;
rigmp_maximum
:
MAXIMUM
(
rigmpm_groups_per_interface
| rigmpm_null
)
;
rigmpm_null
:
(
GROUPS
) null_rest_of_line
;
rigmpm_groups_per_interface
:
GROUPS_PER_INTERFACE igmp_max_groups_per_interface
(THRESHOLD ONE_LITERAL)?
name = access_list_name?
NEWLINE
;
igmp_max_groups_per_interface
:
// 1-40000
uint16
;
rigmp_ssm
:
SSM MAP
(
rigmps_null
| rigmps_static
)
;
rigmps_null
:
(
QUERY
) null_rest_of_line
;
rigmps_static: STATIC IP_ADDRESS name = access_list_name NEWLINE;
rigmp_traffic: TRAFFIC PROFILE name = policy_map_name NEWLINE;
rigmp_vrf: VRF name = vrf_name NEWLINE rigmp_vrf_inner*;
rigmp_interface
:
INTERFACE
(
rigmp_interface_all
| rigmp_interface_named
)
;
rigmp_interface_all: ALL ROUTER DISABLE NEWLINE;
rigmp_interface_named: name = interface_name NEWLINE rigmp_interface_inner*;
rigmpi_access_group: ACCESS_GROUP name = access_list_name NEWLINE;
rigmpi_explicit_tracking: EXPLICIT_TRACKING (DISABLE | name = access_list_name)? NEWLINE;
rigmpi_maximum
:
MAXIMUM GROUPS_PER_INTERFACE igmp_max_groups_per_interface
(THRESHOLD ONE_LITERAL)?
name = access_list_name?
NEWLINE
;
|
sources/ada/magics-ls_magic.adb | reznikmm/jupyter | 4 | 25477 | -- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
with League.JSON.Objects;
with League.JSON.Values;
with Jupyter.Kernels;
procedure Magics.Ls_Magic
(IO_Pub : not null Jupyter.Kernels.IO_Pub_Access;
Silent : Boolean)
is
Result : League.Strings.Universal_String;
Data : League.JSON.Objects.JSON_Object;
begin
if not Silent then
Result.Append ("Available line magics:");
Result.Append (Ada.Characters.Wide_Wide_Latin_1.LF);
Result.Append ("%lsmagic? %alr? %%output? %%writefile? ");
Result.Append ("%gargs? %cargs? %largs? %bargs?");
Data.Insert (+"text/plain", League.JSON.Values.To_JSON_Value (Result));
IO_Pub.Execute_Result
(Data => Data,
Metadata => League.JSON.Objects.Empty_JSON_Object,
Transient => League.JSON.Objects.Empty_JSON_Object);
end if;
end Magics.Ls_Magic;
|
programs/oeis/154/A154287.asm | karttu/loda | 0 | 2566 | ; A154287: (L)-sieve transform of {1,4,9,16,...,n^2,...}=A000290.
; 1,3,6,9,13,18,23,29,35,42,49,57,66,75,85,95,106,117,129,141,154,167,181,195,210,225,241,258,275,293,311,330,349,369,389,410,431,453,475,498,521,545,569
mov $6,$0
mov $8,$0
add $8,1
lpb $8,1
clr $0,6
mov $0,$6
sub $8,1
sub $0,$8
mov $3,$0
mov $5,$0
add $5,1
lpb $5,1
mov $0,$3
sub $5,1
sub $0,$5
mov $1,$0
lpb $0,1
mul $0,2
add $1,1
trn $0,$1
lpe
gcd $1,2
sub $1,1
add $4,$1
lpe
add $7,$4
lpe
mov $1,$7
|
oeis/101/A101000.asm | neoneye/loda-programs | 11 | 19252 | ; A101000: Periodic sequence with period 3.
; Submitted by <NAME>
; 0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3
mod $0,3
mul $0,7
div $0,4
|
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_21829_1243.asm | ljhsiun2/medusa | 9 | 244162 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0xca_notsx.log_21829_1243.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %rax
push %rbp
push %rdx
push %rsi
lea addresses_normal_ht+0x18b91, %r10
nop
nop
nop
nop
sub %rbp, %rbp
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
movups %xmm7, (%r10)
nop
nop
nop
nop
nop
xor $38149, %rdx
lea addresses_normal_ht+0x1b051, %r14
inc %r8
mov (%r14), %bp
nop
xor $21941, %rsi
lea addresses_WC_ht+0x1597c, %rsi
sub %r14, %r14
vmovups (%rsi), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdx
nop
nop
cmp %r8, %r8
lea addresses_D_ht+0x11bd1, %r14
nop
nop
nop
add $15036, %rax
mov (%r14), %rsi
nop
nop
nop
nop
nop
and $28111, %rbp
pop %rsi
pop %rdx
pop %rbp
pop %rax
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %r8
push %rcx
// Store
lea addresses_UC+0x127d1, %rcx
inc %r12
mov $0x5152535455565758, %r8
movq %r8, %xmm2
vmovups %ymm2, (%rcx)
nop
xor %r12, %r12
// Faulty Load
mov $0x6960f900000003d1, %r14
nop
nop
nop
and %r10, %r10
movb (%r14), %cl
lea oracles, %r10
and $0xff, %rcx
shlq $12, %rcx
mov (%r10,%rcx,1), %rcx
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
circle.asm | nagydani/zx-rom-mods | 15 | 22535 | <reponame>nagydani/zx-rom-mods
;; CIRCLE speedup. Fits in the space of the original
STK_TO_A: EQU 2314H
STK_TO_BC: EQU 2307H
REPORT_B_3: EQU 24F9H
PLOT_SUB: EQU 22E5H
TEMPS: EQU 0D4DH
ORG 233BH
C_R_GRE_1: CALL STK_TO_A
PUSH AF
CALL STK_TO_BC
POP AF
CIRCLE_INT: LD H,A
LD L,0
RRA
CIRCLE_L3: LD DE,00FCH
CIRCLE_L1: PUSH AF
CIRCLE_L2: PUSH HL
PUSH BC
LD A,B
ADD H
LD B,A
LD A,C
ADD L
LD C,A
PUSH DE
CALL PLOT_SUB
POP DE
POP BC
POP HL
LD A,0FBH
CP E
LD A,L
JR Z,CIRCLE_M
NEG
CIRCLE_M: LD L,H
LD H,A
INC E
JR NZ,CIRCLE_L2
DEC D
JR NZ,CIRCLE_N
NEG
LD H,A
CIRCLE_N: POP AF
INC L
SUB A,L
JR NC,CIRCLE_NC
ADD A,H
DEC H
CIRCLE_NC: LD E,A
LD A,L
CP H
LD A,E
JR Z,CIRCLE_L3
LD DE,01F8H
JR C,CIRCLE_L1
JP TEMPS
|
BetterTouchTool/BetterTouchTool-Library.applescript | boisy/AppleScripts | 116 | 4370 | <reponame>boisy/AppleScripts<filename>BetterTouchTool/BetterTouchTool-Library.applescript
(*
===============================================================================
BetterTouchTool Library
===============================================================================
Version: 1.0 Updated: 5/27/20, 5:23:56 AM
By: <NAME>
PURPOSE:
This library provides several useful editor functions for BetterTouchTool.
• View the GitHub page for explanations and examples
- https://github.com/kevin-funderburg/AppleScripts/tree/master/BetterTouchTool
REQUIRED:
1. Mac OS X Yosemite 10.10.5+
2. Mac Applications
• BetterTouchTool - https://folivora.ai/
3. EXTERNAL OSAX Additions/LIBRARIES/FUNCTIONS
• None
VERSION HISTORY:
1.0.0 - Initial version.
1.0.1 - Added newJSON property and update() to allow 1 update_trigger
command to BTT instead of 1 per function, much faster.
1.0.2 - Changed parameters to be key-value pairs rather than AppleScript
records to allow for more mutability for trigger objects.
===============================================================================
*)
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use framework "Foundation"
property name : "BetterTouchTool Library"
property id : "com.kfunderburg.library.betterTouchToolLibrary"
property version : "1.0.1"
-- classes, constants, and enums used
property NSJSONSerialization : a reference to current application's NSJSONSerialization
property NSString : a reference to current application's NSString
property ca : a reference to current application
-- modifier key values
property mods : {¬
{name:"cmd", symbol:"⌘", value:1048576}, ¬
{name:"opt", symbol:"⌥", value:524288}, ¬
{name:"ctrl", symbol:"⌃", value:262144}, ¬
{name:"shft", symbol:"⇧", value:131072}, ¬
{name:"fn", symbol:"Fn", value:8388608} ¬
}
-- hex values of colors commonly used
property _colors : {¬
{name:"black", value:"0.000000, 0.000000, 0.000000, 255.000000"}, ¬
{name:"blue", value:"10.000000, 132.000000, 255.000000, 255.000000"}, ¬
{name:"def_background", value:"75.323769, 75.323769, 75.323769, 255.000000"}, ¬
{name:"red", value:"255.000000, 38.028511, 0.000000, 255.000000"}, ¬
{name:"red_transparent", value:"255.000000, 96.000002, 94.000002, 102.000000"}, ¬
{name:"spring", value:"0.000000, 249.085161, 0.000000, 255.000000"}, ¬
{name:"white", value:"255.000000, 255.000000, 255.000000, 255.000000"}, ¬
{name:"lemon", value:"254.853130, 251.316189, 0.000000, 255.000000"} ¬
}
-- value of common BTT actions
property _actions : {¬
{name:"AppleScript (async)", value:195}, ¬
{name:"AppleScript (blocking)", value:172}, ¬
{name:"Close currently open Touch Bar group", value:191}, ¬
{name:"Select Menu Item", value:124}, ¬
{name:"Toggle BetterTouchTool Touch Bar", value:188} ¬
}
-- @description
-- constructor for trigger
--
on trigger(_uid)
script trigger
property class : "trigger"
property parent : script "BetterTouchTool Library"
property uid : _uid
property json : missing value
property newJSON : missing value
on run
if isEmpty(_uid) then
set json to getTrigger(copyUUID())
set uid to json's BTTUUID
end if
return me
end run
-- @description
-- get JSON of currently selected trigger
--
on copyUUID()
try
set the clipboard to ""
delay 0.1
tell application "System Events"
tell process "BetterTouchTool"
keystroke "c" using {command down, shift down}
end tell
end tell
delay 0.1
if (the clipboard) = "" then error number -1000
return the clipboard
on error errMsg number errNum
if errNum = -1000 then
display notification ("Select a trigger and try again") ¬
with title ("Error: Invalid selection") ¬
subtitle ("A trigger must be selected") ¬
sound name "Basso"
else
display dialog (errMsg & return & return & errNum) ¬
buttons {"Cancel", "OK"} ¬
default button ("OK") ¬
with icon caution
end if
end try
end copyUUID
-- @return modifier key value of JSON
--
on getModKeys()
try
return json's BTTRequiredModifierKeys
on error
log "no BTTRequiredModifierKeys"
return 0
end try
end getModKeys
-- @description
-- set the modifier keys required for a trigger
--
-- @param _mod - modifier key to add: cmd, opt, ctrl, shft, fn, or clear
--
on setModKey(_mod)
set modSum to getModKeys()
log "modSum before: " & modSum
if _mod = "clear" then
set modSum to 0
else
repeat with m in mods
if m's name = _mod then
set modSum to modSum + (m's value)
exit repeat
end if
end repeat
end if
setNewJSON({"BTTRequiredModifierKeys", modSum})
end setModKey
on radius()
script radius
property radius : missing value
property parent : my trigger
on run
try
set radius to json's BTTTriggerConfig's BTTTouchBarButtonCornerRadius
on error
set radius to 6 -- default radius
end try
return me
end run
-- @description
-- decrement radius by 1
--
on decrement()
setTo(radius - 1)
end decrement
-- @description
-- increment radius by 1
--
on increment()
setTo(radius + 1)
end increment
-- @description
-- set radius to value
--
-- @param n - value to set radius to
--
on setTo(n)
updateConfig({"BTTTouchBarButtonCornerRadius", n})
display notification "new corner radius: " & n with title "Set Radius"
end setTo
-- @description
-- apply radius to left, all or right edges of button
--
-- @param side - left, right or all
--
on apply(side)
if side = "left" then
set n to 1
else if side = "right" then
set n to 2
else if side = "all" then
set n to 0
else
error "invalid side choice: " & side
end if
updateConfig({"BTTTouchBarApplyCornerRadiusTo", n})
end apply
end script
run radius
end radius
on freeSpace()
script freeSpace
property freeSpace : missing value
property parent : my trigger
on run
try
set freeSpace to json's BTTTriggerConfig's BTTTouchBarFreeSpaceAfterButton
on error
log "No freespace variable in JSON"
set freeSpace to 5 -- default free space
end try
return me
end run
-- @description
-- decrement free space after trigger by 1
--
on increment()
setTo(freeSpace + 1)
end increment
-- @description
-- increment free space after trigger by 1
--
on decrement()
setTo(freeSpace - 1)
end decrement
-- @description
-- set free space of trigger to desired value
--
-- @param n - free space value
--
on setTo(n)
updateConfig({"BTTTouchBarFreeSpaceAfterButton", n})
display notification "new freespace: " & n with title "Set Freespace"
end setTo
end script
run freeSpace
end freeSpace
on padding()
script padding
property padding : missing value
property parent : my trigger
on run
try
set padding to json's BTTTriggerConfig's BTTTouchBarItemPadding
on error
set padding to 0 -- default padding
end try
return me
end run
-- @description
-- increment trigger's padding by 1
--
on increment()
setTo(padding + 1)
end increment
-- @description
-- decrement trigger's padding by 1
--
on decrement()
setTo(padding - 1)
end decrement
-- @description
-- set trigger's padding to desired value
--
-- @param n - padding value
--
on setTo(n)
updateConfig({"BTTTouchBarItemPadding", n})
display notification "new padding: " & n with title "Set Padding"
end setTo
end script
run padding
end padding
on button()
script button
property parent : my trigger
-- @description
-- set color of button's background
--
-- @param _color - name of color
--
on setColor(clr)
updateConfig({"BTTTouchBarButtonColor", (getColor(clr))})
end setColor
-- @description
-- set size of button's icon
-- NOTE: heigth and width are set to same value
--
-- @param _size - size of icon
--
on setIconSize(_size)
updateConfig({"BTTTouchBarItemIconWidth", _size}, {"BTTTouchBarItemIconHeight", _size})
display notification "new icon size: " & _size with title "Set Icon Size"
end setIconSize
-- @description
-- set placement of trigger in touch bar
--
-- @param placement - center, left or right
--
on placement(placement)
if placement = "center" then
set p to 0
else if placement = "left" then
set p to 1
else if placement = "right" then
set p to 2
else
error "invalid placement option: " & placement
end if
updateConfig({"BTTTouchBarItemPlacement", p})
end placement
-- @description
-- sets a trigger's visibility
--
-- @param visibility - true, false, or toggle
--
on setVisible(visibility)
if visibility = true then
set n to 1
else if visibility = false then
set n to 0
else if visibility = "toggle" then
set json to getTrigger(_uid)
if json's BTTEnabled2 = 0 then
set n to 1
else
set n to 0
end if
end if
setNewJSON({"BTTEnabled2", n})
end setVisible
on toggleIconOnly()
try
if json's BTTTriggerConfig's BTTTouchBarOnlyShowIcon then
set n to false
else
set n to true
end if
on error
set n to true
end try
updateConfig({"BTTTouchBarOnlyShowIcon", n})
end toggleIconOnly
end script
end button
on _font()
script _font
property parent : my trigger
-- @description
-- set size of trigger's font
--
-- @param _size - size of font
--
on setSize(_size)
updateConfig({"BTTTouchBarButtonFontSize", _size})
end setSize
-- @description
-- set color of trigger's font
--
-- @param _color - name of color
--
on setColor(clr)
updateConfig({"BTTTouchBarFontColor", (getColor(clr))})
end setColor
end script
end _font
-- @description
-- Set the script of a trigger's AppleScript action
--
-- @param _script - AppleScript text to insert
--
on setInlineAppleScript(_script)
setNewJSON({"BTTInlineAppleScript", _script})
end setInlineAppleScript
-- @description
-- add an action to a trigger
-- NOTE: not all actions are included, I've only included ones
-- that I use frequently
--
-- @param act - action to insert
--
on addAction(act)
setNewJSON(getAction(act))
end addAction
-- @description
-- Rename a trigger
--
-- @param _name - new name
--
on rename(_name)
setNewJSON({"BTTTouchBarButtonName", _name})
end rename
on setNewJSON(update)
set newJSON to its setValue:(item 2 of update) forKey:(item 1 of update) inRecord:newJSON
end setNewJSON
-- @description
-- update a trigger's JSON configuration
--
-- @param update - List of key-value pairs, can be a list of lists of key-value pairs too
--
on updateConfig(update)
if class of item 1 of update = list then
repeat with u in update
updateConfig(u)
end repeat
else
try
set newJSON's BTTTriggerConfig to its setValue:(item 2 of update) forKey:(item 1 of update) inRecord:(newJSON's BTTTriggerConfig)
on error errMsg number errNum
set update to its recordFromLabels:{(item 1 of update)} andValues:{(item 2 of update)}
setNewJSON({"BTTTriggerConfig", update})
end try
end if
end updateConfig
-- @description
-- update trigger's JSON
--
on update()
tell application "BetterTouchTool" to update_trigger uid json my toJSON(newJSON)
end update
end script
run trigger
end trigger
-- @param act - name of action
-- @return value of action
--
on getAction(act)
repeat with a in _actions
if a's name = act then return {"BTTPredefinedActionType", a's value}
end repeat
error "Invalid action: " & act
end getAction
-- @param clr - name of color
-- @return hex value of color
--
on getColor(clr)
repeat with c in _colors
if c's name = clr then return c's value
end repeat
error "Invalid color: " & clr
end getColor
on updateTBwidget:uid withText:_text iconPath:icPath iconData:icData backgroundColor:bgcolor
tell application "BetterTouchTool" to update_touch_bar_widget uid ¬
text _text icon_path icPath icon_data icData background_color getColor(bgcolor)
end updateTBwidget:withText:iconPath:iconData:backgroundColor:
on refreshWidget(uid)
tell application "BetterTouchTool" to refresh_widget uid
end refreshWidget
on getActiveTBgroup()
tell application "BetterTouchTool" to return get_active_touch_bar_group
end getActiveTBgroup
on triggerAction(act)
if isEmpty(act) then error "Invalid action: " & act
tell application "BetterTouchTool" to trigger_action my toJSON(my getAction(act))
end triggerAction
on getVar(var, _class)
if not isEmpty(var) then
tell application "BetterTouchTool"
if _class = string or _class = text or _class = boolean then
set var to get_string_variable var
if var = "true" then return true
if var = "false" then return false
return var
else if _class = number or _class = integer or _class = real then
return get_number_variable var
else
error "_class is not a valid class"
end if
end tell
end if
error "invalid var: var is empty"
end getVar
on setVar:var toVal:_val persist:_persist
if not isEmpty(var) then
tell application "BetterTouchTool"
if class of _val = string or class of _val = boolean then
if _persist then
set _result to set_persistent_string_variable var to _val
else
set _result to set_string_variable var to _val
end if
else if class of _val = number or class of _val = integer or class of _val = real then
if _persist then
set _result to set_persistent_number_variable var to _val
else
set _result to set_number_variable var to _val
end if
else
error "_class is not a valid class"
end if
end tell
if _result ≠ "success" then error "error: variable " & var & " was not set"
end if
end setVar:toVal:persist:
on executeTrigger(uid)
set uid to checkUUID(uid)
tell application "BetterTouchTool" to execute_assigned_actions_for_trigger uid
end executeTrigger
on toggleVar(var)
set v to getVar(var, text)
if v = "true" then
my setVar:var toVal:false persist:true
else
my setVar:var toVal:true persist:true
end if
end toggleVar
on getTrigger(uid)
-- this is a useful function of BTT to get the JSON of a particular trigger,
-- but it will slow down performance dramatically if called multiple times.
-- Use sparingly.
tell application "BetterTouchTool" to set json to get_trigger uid
return my convertJSONToAS:json isPath:false
end getTrigger
--==========================================================
--» Helper Functions
--==========================================================
-- checks if a value is empty
on isEmpty(str)
if str is missing value then return true
return length of str is 0
end isEmpty
-- replace text of string
on SearchandReplace(sourceText, replaceThis, withThat)
set theString to NSString's stringWithString:sourceText
set theString to theString's stringByReplacingOccurrencesOfString:replaceThis withString:withThat
return theString as text
end SearchandReplace
-- pass either a POSIX path to the JSON file, or a JSON string; isPath is a boolean value to tell which
on convertJSONToAS:jsonStringOrPath isPath:isPath
if isPath then -- read file as data
set theData to ca's NSData's dataWithContentsOfFile:jsonStringOrPath
else -- it's a string, convert to data
set aString to NSString's stringWithString:jsonStringOrPath
set theData to aString's dataUsingEncoding:(ca's NSUTF8StringEncoding)
end if
-- convert to Cocoa object
set {theThing, theError} to NSJSONSerialization's JSONObjectWithData:theData options:0 |error|:(reference)
if theThing is missing value then error (theError's localizedDescription() as text) number -10000
-- we don't know the class of theThing for coercion, so...
set listOfThing to ca's NSArray's arrayWithObject:theThing
return item 1 of (theThing as list)
end convertJSONToAS:isPath:
on toJSON(str)
--convert to JSON data
set {theData, theError} to NSJSONSerialization's dataWithJSONObject:str options:0 |error|:(reference)
if theData is missing value then error (theError's localizedDescription() as text) number -10000
-- convert data to a UTF8 string
set someString to NSString's alloc()'s initWithData:theData encoding:(ca's NSUTF8StringEncoding)
return someString as text
end toJSON
on recordFromLabels:labels andValues:values
set theResult to ca's NSDictionary's dictionaryWithObjects:values forKeys:labels
return theResult as record
end recordFromLabels:andValues:
on setValue:val forKey:_key inRecord:rec
set theDict to ca's NSMutableDictionary's dictionaryWithDictionary:rec
theDict's setValue:val forKey:_key
return theDict as record
end setValue:forKey:inRecord:
|
src/stm32/net-interfaces-stm32.ads | stcarrez/ada-enet | 16 | 12882 | <gh_stars>10-100
-----------------------------------------------------------------------
-- net-interfaces-stm32 -- Ethernet driver for STM32F74x
-- Copyright (C) 2016, 2017 <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.
-----------------------------------------------------------------------
package Net.Interfaces.STM32 is
-- Size of the transmit ring.
TX_RING_SIZE : constant Uint32 := 100;
-- Size of the receive ring.
RX_RING_SIZE : constant Uint32 := 500;
-- The STM32F Ethernet driver.
type STM32_Ifnet is limited new Net.Interfaces.Ifnet_Type with null record;
-- Initialize the network interface.
overriding
procedure Initialize (Ifnet : in out STM32_Ifnet);
-- Send a packet to the interface.
overriding
procedure Send (Ifnet : in out STM32_Ifnet;
Buf : in out Net.Buffers.Buffer_Type);
-- Receive a packet from the interface.
overriding
procedure Receive (Ifnet : in out STM32_Ifnet;
Buf : in out Net.Buffers.Buffer_Type);
-- Returns true if the interface driver is ready to receive or send packets.
function Is_Ready (Ifnet : in STM32_Ifnet) return Boolean;
end Net.Interfaces.STM32;
|
oeis/116/A116721.asm | neoneye/loda-programs | 11 | 88038 | <filename>oeis/116/A116721.asm
; A116721: Number of permutations of length n which avoid the patterns 123, 3142, 4312; or avoid the patterns 123, 3421, 4231.
; 1,2,5,12,24,42,67,100,142,194,257,332,420,522,639,772,922,1090,1277,1484,1712,1962,2235,2532,2854,3202,3577,3980,4412,4874,5367,5892,6450,7042,7669,8332,9032,9770,10547,11364,12222,13122,14065,15052,16084,17162,18287,19460,20682,21954,23277,24652,26080,27562,29099,30692,32342,34050,35817,37644,39532,41482,43495,45572,47714,49922,52197,54540,56952,59434,61987,64612,67310,70082,72929,75852,78852,81930,85087,88324,91642,95042,98525,102092,105744,109482,113307,117220,121222,125314,129497,133772
sub $2,$0
add $0,1
trn $0,2
bin $0,2
bin $2,3
sub $0,$2
add $0,1
|
programs/oeis/220/A220154.asm | karttu/loda | 0 | 27258 | ; A220154: Number of 2 X n arrays of the minimum value of corresponding elements and their horizontal or diagonal neighbors in a random, but sorted with lexicographically nondecreasing rows and nonincreasing columns, 0..2 2 X n array.
; 6,11,23,50,88,137,197,268,350,443,547,662,788,925,1073,1232,1402,1583,1775,1978,2192,2417,2653,2900,3158,3427,3707,3998,4300,4613,4937,5272,5618,5975,6343,6722,7112,7513,7925,8348,8782,9227,9683,10150,10628,11117,11617,12128,12650,13183,13727,14282,14848,15425,16013,16612,17222,17843,18475,19118,19772,20437,21113,21800,22498,23207,23927,24658,25400,26153,26917,27692,28478,29275,30083,30902,31732,32573,33425,34288,35162,36047,36943,37850,38768,39697,40637,41588,42550,43523,44507,45502,46508,47525,48553,49592,50642,51703,52775,53858,54952,56057,57173,58300,59438,60587,61747,62918,64100,65293,66497,67712,68938,70175,71423,72682,73952,75233,76525,77828,79142,80467,81803,83150,84508,85877,87257,88648,90050,91463,92887,94322,95768,97225,98693,100172,101662,103163,104675,106198,107732,109277,110833,112400,113978,115567,117167,118778,120400,122033,123677,125332,126998,128675,130363,132062,133772,135493,137225,138968,140722,142487,144263,146050,147848,149657,151477,153308,155150,157003,158867,160742,162628,164525,166433,168352,170282,172223,174175,176138,178112,180097,182093,184100,186118,188147,190187,192238,194300,196373,198457,200552,202658,204775,206903,209042,211192,213353,215525,217708,219902,222107,224323,226550,228788,231037,233297,235568,237850,240143
mov $2,4
mov $3,1
mov $4,$0
add $4,2
lpb $0,1
add $2,$0
sub $0,1
add $2,4
add $3,$4
sub $3,3
add $4,3
lpe
mov $1,$3
trn $1,5
add $2,$3
sub $2,3
add $1,$2
add $1,4
|
programs/oeis/027/A027874.asm | karttu/loda | 0 | 5073 | <reponame>karttu/loda
; A027874: Minimal degree path length of a tree with n leaves.
; 0,4,9,16,23,30,38,46,54,64,74,84,94,104,114,124,134,144,155,166,177,188,199,210,221,232,243,256,269,282,295,308,321,334,347,360,373,386,399,412,425,438,451,464,477,490,503,516,529,542,555,568,581,594,608,622,636,650,664,678,692,706,720,734,748,762,776,790,804,818,832,846,860,874,888,902,916,930,944,958,972,988,1004,1020,1036,1052,1068,1084,1100,1116,1132,1148,1164,1180,1196,1212,1228,1244,1260,1276,1292,1308,1324,1340,1356,1372,1388,1404,1420,1436,1452,1468,1484,1500,1516,1532,1548,1564,1580,1596,1612,1628,1644,1660,1676,1692,1708,1724,1740,1756,1772,1788,1804,1820,1836,1852,1868,1884,1900,1916,1932,1948,1964,1980,1996,2012,2028,2044,2060,2076,2092,2108,2124,2140,2156,2172,2188,2204,2220,2236,2252,2268,2285,2302,2319,2336,2353,2370,2387,2404,2421,2438,2455,2472,2489,2506,2523,2540,2557,2574,2591,2608,2625,2642,2659,2676,2693,2710,2727,2744,2761,2778,2795,2812,2829,2846,2863,2880,2897,2914,2931,2948,2965,2982,2999,3016,3033,3050,3067,3084,3101,3118,3135,3152,3169,3186,3203,3220,3237,3254,3271,3288,3305,3322,3339,3356,3373,3390,3407,3424,3441,3458,3475,3492,3509,3526,3543,3560,3577,3594,3611,3628,3645,3664,3683,3702,3721,3740,3759,3778
mov $4,$0
mov $6,$0
lpb $6,1
clr $0,4
mov $0,$4
sub $6,1
sub $0,$6
lpb $0,1
add $1,3
mov $3,$0
div $0,3
lpe
add $3,$1
add $5,$3
lpe
mov $1,$5
|
4 专业科目/计算机组成/习题/hw/自己动手写CPU/Code/Chapter9_2/AsmTest/inst_rom.asm | ladike/912_project | 640 | 21317 |
inst_rom.om: file format elf32-tradbigmips
Disassembly of section .text:
00000000 <_start>:
0: 34011234 li at,0x1234
4: ac010000 sw at,0(zero)
8: 34015678 li at,0x5678
c: e0010000 sc at,0(zero)
10: 8c010000 lw at,0(zero)
14: 00000000 nop
18: 34010000 li at,0x0
1c: c0010000 ll at,0(zero)
20: 00000000 nop
24: 20210001 addi at,at,1
28: e0010000 sc at,0(zero)
2c: 8c010000 lw at,0(zero)
00000030 <_loop>:
30: 0800000c j 30 <_loop>
34: 00000000 nop
Disassembly of section .reginfo:
00000000 <_ram_end-0x40>:
0: 00000002 srl zero,zero,0x0
...
|
alloy4fun_models/trashltl/models/13/zW78nu4pztitRhkAB.als | Kaixi26/org.alloytools.alloy | 0 | 2355 | <filename>alloy4fun_models/trashltl/models/13/zW78nu4pztitRhkAB.als
open main
pred idzW78nu4pztitRhkAB_prop14 {
all p:Protected | p in Trash implies after p not in Protected
}
pred __repair { idzW78nu4pztitRhkAB_prop14 }
check __repair { idzW78nu4pztitRhkAB_prop14 <=> prop14o } |
programs/oeis/137/A137495.asm | jmorken/loda | 1 | 4274 | <filename>programs/oeis/137/A137495.asm
; A137495: A098601(2n)+A098601(2n+1)
; 2,3,4,7,13,23,40,70,123,216,379,665,1167,2048,3594,6307,11068,19423,34085,59815,104968,184206,323259,567280,995507,1746993,3065759,5380032,9441298,16568323,29075380,51023735,89540413,157132471,275748264,483904470,849193147,1490230088
mov $1,$0
lpb $0
add $2,$1
add $3,$2
sub $2,$0
sub $0,1
sub $3,$1
add $1,$3
sub $2,$3
lpe
add $1,2
add $1,$3
|
oeis/176/A176644.asm | neoneye/loda-programs | 11 | 13433 | <filename>oeis/176/A176644.asm
; A176644: Triangle T(n, k) = 40^(k*(n-k)), read by rows.
; Submitted by <NAME>(s2.)
; 1,1,1,1,40,1,1,1600,1600,1,1,64000,2560000,64000,1,1,2560000,4096000000,4096000000,2560000,1,1,102400000,6553600000000,262144000000000,6553600000000,102400000,1,1,4096000000,10485760000000000,16777216000000000000,16777216000000000000,10485760000000000,4096000000,1,1,163840000000,16777216000000000000,1073741824000000000000000,42949672960000000000000000,1073741824000000000000000,16777216000000000000,163840000000,1,1,6553600000000,26843545600000000000000,68719476736000000000000000000
seq $0,4247 ; Multiplication table read by antidiagonals: T(i,j) = i*j (i>=0, j>=0). Alternatively, multiplication triangle read by rows: P(i,j) = j*(i-j) (i>=0, 0<=j<=i).
mov $1,40
pow $1,$0
mov $0,$1
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c9a009c.ada | best08618/asylo | 7 | 6547 | -- C9A009C.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.
--*
-- TEST ABORT DURING RENDEZVOUS
-- THE CALLING TASK IN THE RENDEVOUS IS DEPENDENT ON THE ABORTED TASK,
-- SO THE DEPENDENT TASK IS INDIRECTLY ABORTED WHILE IN A RENDEVOUS;
-- NEITHER THE CALLING TASK NOR ITS MASTER CAN BE TERMINATED WHILE THE
-- RENDEVOUS CONTINUES.
-- <NAME> 09 MARCH 1984
-- JBG 6/1/84
WITH SYSTEM; USE SYSTEM;
WITH REPORT; USE REPORT;
PROCEDURE C9A009C IS
BEGIN
TEST("C9A009C", "DEPENDENT TASK IN RENDEVOUS WHEN MASTER IS " &
"ABORTED");
DECLARE
-- T2 CONTAINS DEPENDENT TASK T3 WHICH CALLS T1.
-- T1 ABORTS T2 WHILE IN RENDEVOUS WITH T3.
TASK T1 IS
ENTRY E1;
END T1;
TASK BODY T1 IS
TASK T2;
TASK BODY T2 IS
TASK T3;
TASK BODY T3 IS
BEGIN
T1.E1;
FAILED ("T3 NOT ABORTED");
EXCEPTION
WHEN TASKING_ERROR =>
FAILED ("TASKING_ERROR IN T3");
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION IN T3");
END;
BEGIN -- T3 ACTIVATED NOW
NULL;
END T2;
BEGIN -- T1
ACCEPT E1 DO
ABORT T2;
ABORT T2;
ABORT T2; -- WHY NOT?
IF T2'TERMINATED THEN
FAILED ("T2 TERMINATED PREMATURELY");
END IF;
END E1;
EXCEPTION
WHEN TASKING_ERROR =>
FAILED ("TASKING_ERROR IN T1 BECAUSE CALLING TASK "&
"WAS ABORTED");
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION - T1");
END T1;
BEGIN
NULL;
END;
RESULT;
END C9A009C;
|
programs/oeis/079/A079496.asm | karttu/loda | 0 | 93411 | <reponame>karttu/loda
; A079496: a(0) = a(1) = 1; thereafter a(2*n+1) = 2*a(2*n) - a(2*n-1), a(2*n) = 4*a(2*n-1) - a(2*n-2).
; 1,1,3,5,17,29,99,169,577,985,3363,5741,19601,33461,114243,195025,665857,1136689,3880899,6625109,22619537,38613965,131836323,225058681,768398401,1311738121,4478554083,7645370045,26102926097,44560482149,152139002499,259717522849,886731088897,1513744654945,5168247530883,8822750406821,30122754096401,51422757785981,175568277047523,299713796309065,1023286908188737,1746860020068409,5964153172084899
mov $4,2
mov $6,$0
lpb $4,1
mov $0,$6
sub $4,1
add $0,$4
sub $0,1
mul $0,2
cal $0,82981 ; Start with the sequence S(0)={1,1} and for k>0 define S(k) to be I(S(k-1)) where I denotes the operation of inserting, for i=1,2,3..., the term a(i)+a(i+1) between any two terms for which 4a(i+1)<=5a(i). The listed terms are the initial terms of the limit of this process as k goes to infinity.
mov $2,$0
add $2,3
mov $3,$4
mov $5,$2
sub $5,2
div $5,2
lpb $3,1
mov $1,$5
sub $3,1
lpe
lpe
lpb $6,1
sub $1,$5
mov $6,0
lpe
|
src/Categories/Diagram/Limit/Ran.agda | MirceaS/agda-categories | 0 | 16769 | <reponame>MirceaS/agda-categories<filename>src/Categories/Diagram/Limit/Ran.agda
{-# OPTIONS --without-K --safe #-}
module Categories.Diagram.Limit.Ran where
open import Level
open import Data.Product using (Σ)
open import Categories.Category
open import Categories.Category.Complete
open import Categories.Category.Construction.Cones
open import Categories.Category.Construction.Comma
open import Categories.Category.Construction.Properties.Comma
open import Categories.Diagram.Cone.Properties
open import Categories.Diagram.Limit.Properties
open import Categories.Functor
open import Categories.Functor.Properties
open import Categories.Functor.Construction.Constant
open import Categories.NaturalTransformation
open import Categories.NaturalTransformation.Equivalence using () renaming (_≃_ to _≊_)
open import Categories.NaturalTransformation.NaturalIsomorphism using (NaturalIsomorphism; _≃_; module ≃; _ⓘˡ_)
open import Categories.Kan
open import Categories.Diagram.Limit
import Categories.Morphism as Mor
import Categories.Morphism.Reasoning as MR
private
variable
o ℓ e : Level
C D E : Category o ℓ e
-- construct a Ran from a limit
module _ {o ℓ e o′ ℓ′ e′} {C : Category o′ ℓ′ e′} {D : Category o ℓ e}
(F : Functor C D) (X : Functor C E) (Com : Complete (o′ ⊔ ℓ) (ℓ′ ⊔ e) e′ E) where
private
module C = Category C
module D = Category D
module E = Category E
module F = Functor F
module X = Functor X
open Limit
open Cone renaming (commute to K-commute)
open Cone⇒ renaming (commute to ⇒-commute)
open Mor E
G : (d : D.Obj) → Functor (d ↙ F) E
G d = X ∘F Cod (const! d) F
⊤Gd : ∀ d → Limit (G d)
⊤Gd d = Com (G d)
module ⊤Gd d = Limit (⊤Gd d)
f↙F : ∀ {Y Z} (f : Y D.⇒ Z) → Functor (Z ↙ F) (Y ↙ F)
f↙F = along-natˡ′ F
Gf≃ : ∀ {Y Z} (f : Y D.⇒ Z) → G Z ≃ G Y ∘F f↙F f
Gf≃ f = record
{ F⇒G = ntHelper record
{ η = λ _ → X.F₁ C.id
; commute = λ _ → [ X ]-resp-square id-comm-sym
}
; F⇐G = ntHelper record
{ η = λ _ → X.F₁ C.id
; commute = λ _ → [ X ]-resp-square id-comm-sym
}
; iso = λ _ → record
{ isoˡ = [ X ]-resp-∘ C.identity² ○ X.identity
; isoʳ = [ X ]-resp-∘ C.identity² ○ X.identity
}
}
where open MR C
open E.HomReasoning
limY⇒limZ∘ : ∀ {Y Z} (f : Y D.⇒ Z) → Cones (G Y ∘F f↙F f) [ F-map-Coneʳ (f↙F f) (limit (Com (G Y))) , limit (Com (G Y ∘F f↙F f)) ]
limY⇒limZ∘ {Y} f = F⇒arr Com (f↙F f) (G Y)
limZ∘≅limZ : ∀ {Y Z} (f : Y D.⇒ Z) → apex (⊤Gd Z) ≅ apex (Com (G Y ∘F f↙F f))
limZ∘≅limZ {Y} {Z} f = ≃⇒lim≅ (Gf≃ f) (⊤Gd Z) (Com _)
limit-is-ran : Ran F X
limit-is-ran = record
{ R = R
; ε = ε
; δ = δ
; δ-unique = λ {M γ} δ′ eq → δ-unique {M} {γ} δ′ eq
; commutes = commutes
}
where open MR E
open E.HomReasoning
open D.HomReasoning using () renaming (_○_ to _●_ ; ⟺ to ⟷)
R₀ : D.Obj → E.Obj
R₀ d = apex (⊤Gd d)
R₁ : ∀ {A B} → D [ A , B ] → E [ R₀ A , R₀ B ]
R₁ {A} f = _≅_.to (limZ∘≅limZ f) E.∘ arr (limY⇒limZ∘ f)
proj-red : ∀ {Y Z} K (f : Y D.⇒ Z) → ⊤Gd.proj Z K E.∘ R₁ f E.≈ ⊤Gd.proj Y (record { f = D.id D.∘ CommaObj.f K D.∘ f })
proj-red {Y} {Z} K f = begin
⊤Gd.proj Z K E.∘ R₁ f ≈⟨ pullˡ (⇒-commute (≃⇒Cone⇒ (≃.sym (Gf≃ f)) (Com _) (⊤Gd Z))) ⟩
(X.F₁ C.id E.∘ proj (Com _) K) E.∘ arr (limY⇒limZ∘ f) ≈⟨ pullʳ (⇒-commute (limY⇒limZ∘ f)) ⟩
X.F₁ C.id E.∘ ⊤Gd.proj Y _ ≈⟨ elimˡ X.identity ⟩
⊤Gd.proj Y _ ∎
proj≈ : ∀ {d b} {f g : d D.⇒ F.F₀ b} → f D.≈ g → ⊤Gd.proj d record { f = f } E.≈ ⊤Gd.proj d record { f = g }
proj≈ {d} {b} {f} {g} eq = begin
⊤Gd.proj d _ ≈⟨ introˡ X.identity ⟩
X.F₁ C.id E.∘ ⊤Gd.proj d _ ≈⟨ K-commute _ (⊤Gd.limit d) (record { h = C.id ; commute = D.∘-resp-≈ F.identity eq ● MR.id-comm-sym D }) ⟩
⊤Gd.proj d _ ∎
R : Functor D E
R = record
{ F₀ = R₀
; F₁ = R₁
; identity = λ {d} → terminal.⊤-id (⊤Gd d) record
{ commute = λ {Z} → begin
⊤Gd.proj d Z ∘ R₁ D.id ≈⟨ proj-red Z D.id ⟩
⊤Gd.proj d record { f = D.id D.∘ CommaObj.f Z D.∘ D.id } ≈⟨ proj≈ (D.identityˡ ● D.identityʳ) ⟩
⊤Gd.proj d Z ∎
}
; homomorphism = λ {Y Z W} {f g} →
terminal.!-unique₂ (⊤Gd W)
{let module ⊤GY = Cone _ (⊤Gd.limit Y)
module H = Functor (f↙F (g D.∘ f))
in record
{ apex = record
{ ψ = λ K → ⊤GY.ψ (H.F₀ K)
; commute = λ h → ⊤GY.commute (H.F₁ h)
}
}}
{record
{ arr = R₁ (g D.∘ f)
; commute = λ {K} → proj-red K (g D.∘ f)
}}
{record
{ arr = R₁ g ∘ R₁ f
; commute = λ {K} → begin
⊤Gd.proj W K ∘ R₁ g ∘ R₁ f
≈⟨ sym-assoc ⟩
(⊤Gd.proj W K ∘ R₁ g) ∘ R₁ f
≈⟨ proj-red K g ⟩∘⟨refl ⟩
⊤Gd.proj Z record { f = D.id D.∘ CommaObj.f K D.∘ g } ∘ R₁ f
≈⟨ proj-red _ f ⟩
⊤Gd.proj Y record { f = D.id D.∘ (D.id D.∘ CommaObj.f K D.∘ g) D.∘ f }
≈⟨ proj≈ (D.identityˡ ● (MR.assoc²' D)) ⟩
⊤Gd.proj Y record { f = D.id D.∘ CommaObj.f K D.∘ g D.∘ f }
∎
}}
; F-resp-≈ = λ {Y Z} {f g} eq →
terminal.!-unique₂ (⊤Gd Z)
{let module ⊤GY = Cone _ (⊤Gd.limit Y)
module H = Functor (f↙F f)
in record
{ apex = record
{ ψ = λ K → ⊤GY.ψ (H.F₀ K)
; commute = λ h → ⊤GY.commute (H.F₁ h)
}
}}
{record
{ arr = R₁ f
; commute = F-resp-≈-commute D.Equiv.refl
}}
{record
{ arr = R₁ g
; commute = F-resp-≈-commute eq
}}
}
where open E
F-resp-≈-commute : ∀ {Y Z} {K : Category.Obj (Z ↙ F)} {f g : Y D.⇒ Z} → f D.≈ g →
⊤Gd.proj Z K ∘ R₁ g ≈ ⊤Gd.proj Y record { f = D.id D.∘ CommaObj.f K D.∘ f }
F-resp-≈-commute {Y} {Z} {K} {f} {g} eq = begin
⊤Gd.proj Z K ∘ R₁ g ≈⟨ proj-red K g ⟩
⊤Gd.proj Y _ ≈⟨ proj≈ (D.∘-resp-≈ʳ (D.∘-resp-≈ʳ (D.Equiv.sym eq))) ⟩
⊤Gd.proj Y _ ∎
ε : NaturalTransformation (R ∘F F) X
ε = ntHelper record
{ η = λ c → ⊤Gd.proj (F.F₀ c) record { f = D.id }
; commute = λ {Y Z} f → begin
⊤Gd.proj (F.F₀ Z) _ ∘ Functor.F₁ (R ∘F F) f ≈⟨ proj-red _ (F.F₁ f) ⟩
⊤Gd.proj (F.F₀ Y) _ ≈˘⟨ K-commute _ (⊤Gd.limit (F.F₀ Y)) record { h = f ; commute = ⟷ (D.∘-resp-≈ˡ D.identityˡ ● D.∘-resp-≈ˡ D.identityˡ) } ⟩
X.F₁ f ∘ ⊤Gd.proj (F.F₀ Y) _ ∎
}
where open E
δ-Cone : ∀ d (M : Functor D E) → NaturalTransformation (M ∘F F) X → Cone (G d)
δ-Cone d M γ = record
{ apex = record
{ ψ = λ K → γ.η (CommaObj.β K) E.∘ M.F₁ (CommaObj.f K)
; commute = λ {Y Z} f → begin
X.F₁ (Comma⇒.h f) E.∘ γ.η (CommaObj.β Y) E.∘ M.F₁ (CommaObj.f Y)
≈˘⟨ pushˡ (γ.commute (Comma⇒.h f)) ⟩
(γ.η (CommaObj.β Z) E.∘ M.F₁ (F.F₁ (Comma⇒.h f))) E.∘ M.F₁ (CommaObj.f Y)
≈⟨ pullʳ ([ M ]-resp-∘ (Comma⇒.commute f ● D.identityʳ)) ⟩
γ.η (CommaObj.β Z) E.∘ M.F₁ (CommaObj.f Z)
∎
}
}
where module M = Functor M
module γ = NaturalTransformation γ
δ : (M : Functor D E) → NaturalTransformation (M ∘F F) X → NaturalTransformation M R
δ M γ = ntHelper record
{ η = λ d → ⊤Gd.rep d (δ-Cone d M γ)
; commute = λ {Y Z} f →
terminal.!-unique₂ (⊤Gd Z)
{record
{ apex = record
{ ψ = λ W → δ-Cone.ψ Z W E.∘ M.F₁ f
; commute = λ {W V} g → begin
X.F₁ (Comma⇒.h g) E.∘ (γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f
≈⟨ E.sym-assoc ⟩
(X.F₁ (Comma⇒.h g) E.∘ γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f
≈⟨ δ-Cone.commute Z g ⟩∘⟨refl ⟩
(γ.η (CommaObj.β V) E.∘ M.F₁ (CommaObj.f V)) E.∘ M.F₁ f
∎
}
}}
{record
{ arr = ⊤Gd.rep Z (δ-Cone Z M γ) E.∘ M.F₁ f
; commute = pullˡ (⇒-commute (⊤Gd.rep-cone Z (δ-Cone Z M γ)))
}}
{record
{ arr = R₁ f E.∘ ⊤Gd.rep Y (δ-Cone Y M γ)
; commute = λ {W} → begin
⊤Gd.proj Z W E.∘ R₁ f E.∘ ⊤Gd.rep Y (δ-Cone Y M γ)
≈⟨ pullˡ (proj-red W f) ⟩
⊤Gd.proj Y (record { f = D.id D.∘ CommaObj.f W D.∘ f }) E.∘ ⊤Gd.rep Y (δ-Cone Y M γ)
≈⟨ ⇒-commute (⊤Gd.rep-cone Y (δ-Cone Y M γ)) ⟩
γ.η (CommaObj.β W) E.∘ M.F₁ (D.id D.∘ CommaObj.f W D.∘ f)
≈˘⟨ refl⟩∘⟨ [ M ]-resp-∘ (⟷ D.identityˡ) ⟩
γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W) E.∘ M.F₁ f
≈⟨ E.sym-assoc ⟩
(γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f
∎
}}
}
where module M = Functor M
module γ = NaturalTransformation γ
module δ-Cone d = Cone _ (δ-Cone d M γ)
δ-unique : ∀ {M : Functor D E} {α : NaturalTransformation (M ∘F F) X}
(δ′ : NaturalTransformation M R) → α ≊ ε ∘ᵥ δ′ ∘ʳ F → δ′ ≊ δ M α
δ-unique {M} {γ} δ′ eq {d} = ⟺ (⊤Gd.terminal.!-unique d record
{ arr = δ′.η d
; commute = λ {W} → begin
⊤Gd.proj d W E.∘ δ′.η d
≈˘⟨ proj≈ (D.identityˡ ● D.identityˡ) ⟩∘⟨refl ⟩
⊤Gd.proj d (record { f = D.id D.∘ D.id D.∘ CommaObj.f W }) E.∘ δ′.η d
≈˘⟨ pullˡ (proj-red _ (CommaObj.f W)) ⟩
⊤Gd.proj (F.F₀ (CommaObj.β W)) _ E.∘ R₁ (CommaObj.f W) E.∘ δ′.η d
≈˘⟨ pullʳ (δ′.commute (CommaObj.f W)) ⟩
(⊤Gd.proj (F.F₀ (CommaObj.β W)) (record { f = D.id}) E.∘ δ′.η (F.F₀ (CommaObj.β W))) E.∘ M.F₁ (CommaObj.f W)
≈˘⟨ eq ⟩∘⟨refl ⟩
γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)
∎
})
where module M = Functor M
module γ = NaturalTransformation γ
module δ′ = NaturalTransformation δ′
commutes : (M : Functor D E) (α : NaturalTransformation (M ∘F F) X) → α ≊ ε ∘ᵥ δ M α ∘ʳ F
commutes M γ {c} = ⟺ (⇒-commute (⊤Gd.rep-cone (F.F₀ c) (δ-Cone (F.F₀ c) M γ)) ○ elimʳ M.identity)
where module M = Functor M
module γ = NaturalTransformation γ
|
source/containers/a-coinho.adb | ytomino/drake | 33 | 8592 | with Ada.Exceptions.Finally;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
package body Ada.Containers.Indefinite_Holders is
use type Copy_On_Write.Data_Access;
function Upcast is
new Unchecked_Conversion (Data_Access, Copy_On_Write.Data_Access);
function Downcast is
new Unchecked_Conversion (Copy_On_Write.Data_Access, Data_Access);
procedure Free is new Unchecked_Deallocation (Element_Type, Element_Access);
procedure Free is new Unchecked_Deallocation (Data, Data_Access);
procedure Allocate_Element (
Item : out Element_Access;
New_Item : Element_Type);
procedure Allocate_Element (
Item : out Element_Access;
New_Item : Element_Type) is
begin
Item := new Element_Type'(New_Item);
end Allocate_Element;
procedure Free_Data (Data : in out Copy_On_Write.Data_Access);
procedure Free_Data (Data : in out Copy_On_Write.Data_Access) is
X : Data_Access := Downcast (Data);
begin
Free (X.Element);
Free (X);
end Free_Data;
procedure Allocate_Data (
Target : out not null Copy_On_Write.Data_Access;
New_Length : Count_Type;
Capacity : Count_Type);
procedure Allocate_Data (
Target : out not null Copy_On_Write.Data_Access;
New_Length : Count_Type;
Capacity : Count_Type)
is
pragma Unreferenced (New_Length);
pragma Unreferenced (Capacity);
New_Data : constant Data_Access :=
new Data'(Super => <>, Element => null);
begin
Target := Upcast (New_Data);
end Allocate_Data;
procedure Copy_Data (
Target : out not null Copy_On_Write.Data_Access;
Source : not null Copy_On_Write.Data_Access;
Length : Count_Type;
New_Length : Count_Type;
Capacity : Count_Type);
procedure Copy_Data (
Target : out not null Copy_On_Write.Data_Access;
Source : not null Copy_On_Write.Data_Access;
Length : Count_Type;
New_Length : Count_Type;
Capacity : Count_Type)
is
pragma Unreferenced (Length);
pragma Unreferenced (New_Length);
pragma Unreferenced (Capacity);
Aliased_Target : aliased Copy_On_Write.Data_Access;
begin
Allocate_Data (Aliased_Target, 0, 0);
declare
package Holder is
new Exceptions.Finally.Scoped_Holder (
Copy_On_Write.Data_Access,
Free_Data);
begin
Holder.Assign (Aliased_Target);
Allocate_Element (
Downcast (Aliased_Target).Element,
Downcast (Source).Element.all);
Target := Aliased_Target;
Holder.Clear;
end;
end Copy_Data;
procedure Reallocate (Container : in out Holder; To_Update : Boolean);
procedure Reallocate (Container : in out Holder; To_Update : Boolean) is
begin
Copy_On_Write.Unique (
Target => Container.Super'Access,
To_Update => To_Update,
Allocate => Allocate_Data'Access,
Move => Copy_Data'Access,
Copy => Copy_Data'Access,
Free => Free_Data'Access);
end Reallocate;
procedure Unique (Container : in out Holder; To_Update : Boolean);
procedure Unique (Container : in out Holder; To_Update : Boolean) is
begin
if Copy_On_Write.Shared (Container.Super.Data) then
Reallocate (Container, To_Update);
end if;
end Unique;
-- implementation
function Empty_Holder return Holder is
begin
return (Finalization.Controlled with Super => (null, null));
end Empty_Holder;
overriding function "=" (Left, Right : Holder) return Boolean is
Left_Is_Empty : constant Boolean := Is_Empty (Left);
Right_Is_Empty : constant Boolean := Is_Empty (Right);
begin
if Left_Is_Empty /= Right_Is_Empty then
return False;
elsif Left_Is_Empty or else Left.Super.Data = Right.Super.Data then
return True;
else
Unique (Left'Unrestricted_Access.all, False); -- private
Unique (Right'Unrestricted_Access.all, False); -- private
return Downcast (Left.Super.Data).Element.all =
Downcast (Right.Super.Data).Element.all;
end if;
end "=";
function To_Holder (New_Item : Element_Type) return Holder is
begin
return Result : Holder do
Replace_Element (Result, New_Item);
end return;
end To_Holder;
function Is_Empty (Container : Holder) return Boolean is
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
return Data = null or else Data.Element = null;
end Is_Empty;
procedure Clear (Container : in out Holder) is
begin
Copy_On_Write.Clear (Container.Super'Access, Free => Free_Data'Access);
end Clear;
function Element (Container : Holder'Class)
return Element_Type is
begin
return Constant_Reference (Holder (Container)).Element.all;
end Element;
procedure Replace_Element (
Container : in out Holder;
New_Item : Element_Type) is
begin
Clear (Container);
Reallocate (Container, True);
Allocate_Element (Downcast (Container.Super.Data).Element, New_Item);
end Replace_Element;
procedure Query_Element (
Container : Holder'Class;
Process : not null access procedure (Element : Element_Type)) is
begin
Process (Constant_Reference (Holder (Container)).Element.all);
end Query_Element;
procedure Update_Element (
Container : in out Holder'Class;
Process : not null access procedure (Element : in out Element_Type)) is
begin
Process (Reference (Holder (Container)).Element.all);
end Update_Element;
function Constant_Reference (Container : aliased Holder)
return Constant_Reference_Type is
begin
Unique (Container'Unrestricted_Access.all, False);
return (Element => Downcast (Container.Super.Data).Element.all'Access);
end Constant_Reference;
function Reference (Container : aliased in out Holder)
return Reference_Type is
begin
Unique (Container, True);
return (Element => Downcast (Container.Super.Data).Element.all'Access);
end Reference;
procedure Assign (Target : in out Holder; Source : Holder) is
begin
Copy_On_Write.Assign (
Target.Super'Access,
Source.Super'Access,
Free => Free_Data'Access);
end Assign;
function Copy (Source : Holder) return Holder is
begin
return Result : Holder do
Copy_On_Write.Copy (
Result.Super'Access,
Source.Super'Access,
Allocate => Allocate_Data'Access,
Copy => Copy_Data'Access);
end return;
end Copy;
procedure Move (Target : in out Holder; Source : in out Holder) is
begin
Copy_On_Write.Move (
Target.Super'Access,
Source.Super'Access,
Free => Free_Data'Access);
end Move;
overriding procedure Adjust (Object : in out Holder) is
begin
Copy_On_Write.Adjust (Object.Super'Access);
end Adjust;
package body Streaming is
procedure Read (
Stream : not null access Streams.Root_Stream_Type'Class;
Item : out Holder) is
begin
Clear (Item);
Reallocate (Item, True);
Allocate_Element (
Downcast (Item.Super.Data).Element,
Element_Type'Input (Stream));
end Read;
procedure Write (
Stream : not null access Streams.Root_Stream_Type'Class;
Item : Holder) is
begin
Unique (Item'Unrestricted_Access.all, False); -- private
Element_Type'Output (
Stream,
Downcast (Item.Super.Data).Element.all);
end Write;
end Streaming;
end Ada.Containers.Indefinite_Holders;
|
regtests/servlet-server-tests.adb | My-Colaborations/ada-servlet | 0 | 7866 | <gh_stars>0
-----------------------------------------------------------------------
-- servlet-server-tests - Unit tests for server requests
-- Copyright (C) 2018, 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with Util.Files;
with Servlet.Tests;
with Servlet.Core.Files;
with Servlet.Core.Measures;
with Servlet.Core.Tests;
with Servlet.Filters.Dump;
with Servlet.Requests.Mockup;
with Servlet.Responses.Mockup;
package body Servlet.Server.Tests is
use Servlet.Tests;
use Util.Tests;
package Caller is new Util.Test_Caller (Test, "Server");
Except_Servlet : aliased Servlet.Core.Tests.Test_Servlet3;
Upload : aliased Servlet.Core.Tests.Test_Servlet2;
Files : aliased Servlet.Core.Files.File_Servlet;
Dump : aliased Servlet.Filters.Dump.Dump_Filter;
Measures : aliased Servlet.Core.Measures.Measure_Servlet;
All_Servlet : aliased Servlet.Core.Tests.Test_Servlet3;
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Servlet.Server.Service",
Test_Service'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET)",
Test_Get_File'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET 404)",
Test_Get_404'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (POST)",
Test_Post_File_Error'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (POST)",
Test_Post_Content'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET measures)",
Test_Get_Measures'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET with exception)",
Test_Get_With_Exception'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Register_Application",
Test_Register_Remove_Application'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Register_Application (all)",
Test_Register_Application'Access);
end Add_Tests;
-- ------------------------------
-- Initialize the test.
-- ------------------------------
overriding
procedure Set_Up (T : in out Test) is
pragma Unreferenced (T);
use type Servlet.Core.Servlet_Registry_Access;
App : Servlet.Core.Servlet_Registry_Access;
begin
if Servlet.Tests.Get_Application = null then
Servlet.Tests.Initialize (Util.Tests.Get_Properties);
App := Servlet.Tests.Get_Application;
App.Add_Servlet ("Except", Except_Servlet'Access);
App.Add_Mapping ("*.exc", "Except");
-- Register the servlets and filters
App.Add_Servlet (Name => "files", Server => Files'Access);
App.Add_Servlet (Name => "measures", Server => Measures'Access);
App.Add_Filter (Name => "dump", Filter => Dump'Access);
App.Add_Filter (Name => "measures",
Filter => Servlet.Filters.Filter'Class (Measures)'Access);
App.Add_Servlet ("Upload", Upload'Access);
App.Add_Mapping ("*.upload", "Upload");
-- Define servlet mappings
App.Add_Mapping (Name => "files", Pattern => "*.css");
App.Add_Mapping (Name => "files", Pattern => "*.js");
App.Add_Mapping (Name => "files", Pattern => "*.html");
App.Add_Mapping (Name => "files", Pattern => "*.txt");
App.Add_Mapping (Name => "files", Pattern => "*.png");
App.Add_Mapping (Name => "files", Pattern => "*.jpg");
App.Add_Mapping (Name => "files", Pattern => "*.gif");
App.Add_Mapping (Name => "files", Pattern => "*.pdf");
App.Add_Mapping (Name => "files", Pattern => "*.properties");
App.Add_Mapping (Name => "files", Pattern => "*.xhtml");
App.Add_Mapping (Name => "measures", Pattern => "stats.xml");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*");
App.Add_Filter_Mapping (Name => "measures", Pattern => "/ajax/*");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*.xhtml");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.css");
App.Add_Filter_Mapping (Name => "dump", Pattern => "/ajax/*");
end if;
Servlet.Tests.Get_Application.Start;
end Set_Up;
-- ------------------------------
-- Test the Service procedure.
-- ------------------------------
procedure Test_Service (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Request.Set_Method (Method => "GET");
Request.Set_Request_URI (URI => "tst", Split => True);
Request.Set_Protocol (Protocol => "HTTP/1.1");
Servlet.Tests.Get_Server.Service (Request, Reply);
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
end Test_Service;
-- ------------------------------
-- Test a GET request on a static file served by the File_Servlet.
-- ------------------------------
procedure Test_Get_404 (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/file-does-not-exist.txt", "test-404.html");
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
Do_Get (Request, Reply, "/file-does-not-exist.js", "test-404.html");
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
end Test_Get_404;
-- ------------------------------
-- Test a GET request on a static file served by the File_Servlet.
-- ------------------------------
procedure Test_Get_File (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/tests/file.txt", "get-file.txt");
Assert_Contains (T, "A plain text file.", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/plain", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.html", "get-file-set.html");
Assert_Matches (T, "<html></html>", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.js", "get-file.js");
Assert_Matches (T, "^\s*var n = 0;.*", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/javascript", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.css", "get-file.css");
Assert_Matches (T, "^\s*div { margin: 0 }.*", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/css", Reply, "Content-Type");
end Test_Get_File;
-- ------------------------------
-- Test a GET request on the measure servlet
-- ------------------------------
procedure Test_Get_Measures (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/stats.xml", "stats.xml");
-- We must get at least one measure value (assuming the Test_Get_File test
-- was executed).
Assert_Matches (T, "<time count=""\d+"" time=""\d+.\d+ [um]s"" title="".*""/>",
Reply, "Wrong content");
end Test_Get_Measures;
-- ------------------------------
-- Test a POST on a file served by the File_Servlet.
-- ------------------------------
procedure Test_Post_File_Error (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Post (Request, Reply, "/tests/file.css", "post-file.css");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type",
Status => Servlet.Responses.SC_METHOD_NOT_ALLOWED);
end Test_Post_File_Error;
-- ------------------------------
-- Test a POST with a part file to a test servlet.
-- ------------------------------
procedure Test_Post_Content (T : in out Test) is
Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/upload.txt");
Request : Servlet.Requests.Mockup.Part_Request (1);
Reply : Servlet.Responses.Mockup.Response;
begin
Util.Files.Write_File (Path, "Some content");
Request.Set_Part (Position => 1,
Name => "file.txt",
Path => Path,
Content_Type => "text/plain");
Do_Post (Request, Reply, "/tests/file.upload", "post-file.upload");
Assert_Header (T, "Content-Type", "text/plain", Reply, "Content-Type",
Status => Servlet.Responses.SC_OK);
end Test_Post_Content;
-- ------------------------------
-- Test a GET request on servlet that raises an exception.
-- ------------------------------
procedure Test_Get_With_Exception (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Except_Servlet.Raise_Exception := True;
Do_Get (Request, Reply, "/exception-raised.exc", "exception-raised.exc");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type",
Status => Servlet.Responses.SC_INTERNAL_SERVER_ERROR);
Assert_Matches (T, ".*CONSTRAINT_ERROR.*",
Reply, "No exception reported",
Status => Servlet.Responses.SC_INTERNAL_SERVER_ERROR);
end Test_Get_With_Exception;
-- ------------------------------
-- Test a Register_Application and Remove_Application.
-- ------------------------------
procedure Test_Register_Remove_Application (T : in out Test) is
App1 : aliased Servlet.Core.Servlet_Registry;
begin
Servlet.Tests.Get_Server.Register_Application ("my-app", App1'Unchecked_Access);
T.Test_Get_File;
for I in 1 .. 2 loop
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
T.Test_Get_File;
end loop;
exception
when others =>
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
raise;
end Test_Register_Remove_Application;
-- ------------------------------
-- Test a Register_Application and Remove_Application.
-- ------------------------------
procedure Test_Register_Application (T : in out Test) is
App1 : aliased Servlet.Core.Servlet_Registry;
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
App1.Add_Servlet ("all", All_Servlet'Access);
App1.Add_Mapping ("/", "all");
App1.Add_Mapping ("/test", "all");
Servlet.Tests.Get_Server.Register_Application ("", App1'Unchecked_Access);
Servlet.Tests.Get_Server.Start;
Request.Set_Method (Method => "GET");
Request.Set_Request_URI (URI => "/test", Split => True);
Request.Set_Protocol (Protocol => "HTTP/1.1");
Servlet.Tests.Get_Server.Service (Request, Reply);
Assert_Equals (T, Servlet.Responses.SC_OK, Reply.Get_Status, "Invalid response");
T.Test_Get_File;
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
end Test_Register_Application;
end Servlet.Server.Tests;
|
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_21829_2941.asm | ljhsiun2/medusa | 9 | 27402 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x13f96, %r13
nop
nop
nop
nop
and %r14, %r14
mov $0x6162636465666768, %r9
movq %r9, %xmm0
movups %xmm0, (%r13)
nop
nop
dec %rbx
lea addresses_WT_ht+0x1e796, %r10
nop
and %r14, %r14
movl $0x61626364, (%r10)
nop
nop
dec %r14
lea addresses_normal_ht+0x1d16, %rsi
lea addresses_A_ht+0x1bc16, %rdi
nop
nop
nop
inc %r12
mov $53, %rcx
rep movsw
nop
add $3178, %r10
lea addresses_D_ht+0x1ef3, %rsi
lea addresses_D_ht+0x5796, %rdi
clflush (%rdi)
nop
nop
xor %r14, %r14
mov $100, %rcx
rep movsq
nop
add %rbx, %rbx
lea addresses_WT_ht+0xbb56, %rsi
lea addresses_WC_ht+0x11f96, %rdi
clflush (%rdi)
nop
nop
xor %r14, %r14
mov $35, %rcx
rep movsl
nop
add %rcx, %rcx
lea addresses_D_ht+0x15496, %rcx
clflush (%rcx)
nop
xor $7891, %r10
mov (%rcx), %r9d
nop
nop
nop
and $56340, %r13
lea addresses_WC_ht+0x9a36, %rsi
lea addresses_D_ht+0x14096, %rdi
clflush (%rsi)
cmp $21744, %rbx
mov $108, %rcx
rep movsl
nop
nop
nop
add %r14, %r14
lea addresses_normal_ht+0x14c26, %rsi
clflush (%rsi)
dec %r12
vmovups (%rsi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rdi
nop
nop
nop
sub %r12, %r12
lea addresses_WT_ht+0x6796, %rsi
lea addresses_normal_ht+0x1deb2, %rdi
nop
nop
and $15669, %r9
mov $67, %rcx
rep movsq
nop
nop
dec %r13
lea addresses_WC_ht+0x13588, %rbx
nop
xor %r14, %r14
mov $0x6162636465666768, %r13
movq %r13, %xmm7
vmovups %ymm7, (%rbx)
sub $62613, %r10
lea addresses_UC_ht+0xa5d6, %r12
nop
nop
nop
nop
sub $20951, %r10
movups (%r12), %xmm5
vpextrq $1, %xmm5, %r14
nop
nop
sub %r10, %r10
lea addresses_WT_ht+0x18f76, %r14
nop
dec %r13
mov $0x6162636465666768, %r9
movq %r9, %xmm1
movups %xmm1, (%r14)
xor $59811, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rax
push %rbp
push %rbx
push %rdi
// Load
lea addresses_normal+0x95e6, %r8
nop
nop
nop
nop
nop
and $20126, %rbp
mov (%r8), %rbx
nop
nop
nop
and $49992, %r14
// Load
mov $0x1050c30000000b96, %rax
nop
nop
and $59426, %r15
movb (%rax), %bl
nop
nop
and %rbp, %rbp
// Faulty Load
mov $0x7df2260000000f96, %rax
nop
nop
nop
nop
add $60526, %rdi
mov (%rax), %r8d
lea oracles, %rax
and $0xff, %r8
shlq $12, %r8
mov (%rax,%r8,1), %r8
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
libsrc/oz/ozinterrupt/ozintwait.asm | andydansby/z88dk-mk2 | 1 | 165033 | ;
; Sharp OZ family functions
;
; ported from the OZ-7xx SDK by by <NAME>
; by <NAME> - Oct. 2003
;
;
; custom interrupt code + key scanning
; waits for a keystroke, serial data, or interrupt event
;
;
; ------
; $Id: ozintwait.asm,v 1.2 2003/10/27 16:56:57 stefano Exp $
;
XLIB ozintwait
LIB ozcustomisr
XDEF serial_check_hook
XREF KeyBufGetPos
XREF KeyBufPutPos
ozintwait:
di
serial_check_hook:
jp NoSerialCheck
;$serial_check_hook equ $-2
NoSerialCheck:
ld a,(KeyBufGetPos)
ld c,a
ld a,(KeyBufPutPos)
cp c
jr nz,getout
ei
halt
getout:
ei
ret
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_937.asm | ljhsiun2/medusa | 9 | 12739 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %rdi
push %rsi
// Faulty Load
lea addresses_UC+0xdb5a, %r11
nop
nop
nop
nop
nop
add %r12, %r12
mov (%r11), %rdi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1379.asm | ljhsiun2/medusa | 9 | 29376 | <filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1379.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x171f, %rdx
nop
xor $34819, %r10
mov (%rdx), %esi
nop
nop
nop
nop
nop
add $6426, %r11
lea addresses_WT_ht+0x1e1f, %r13
nop
nop
nop
sub %rbp, %rbp
mov (%r13), %ebx
nop
nop
mfence
lea addresses_A_ht+0xf11f, %rsi
lea addresses_A_ht+0xf57d, %rdi
nop
nop
nop
add %rbp, %rbp
mov $82, %rcx
rep movsl
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x7ff, %rcx
nop
xor %rbx, %rbx
mov (%rcx), %r13w
and $3134, %r13
lea addresses_WC_ht+0x17d9f, %rsi
and %rdx, %rdx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm2
vmovups %ymm2, (%rsi)
nop
and $56474, %rcx
lea addresses_WT_ht+0x4f7f, %rsi
nop
nop
nop
nop
xor %r13, %r13
mov (%rsi), %r11w
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x811f, %rsi
nop
nop
nop
nop
nop
cmp %r11, %r11
mov $0x6162636465666768, %rbp
movq %rbp, (%rsi)
nop
and %rdi, %rdi
lea addresses_WT_ht+0x1761f, %rdi
nop
nop
inc %rbx
mov $0x6162636465666768, %rcx
movq %rcx, (%rdi)
nop
nop
nop
xor $58534, %rcx
lea addresses_UC_ht+0x6e1f, %rsi
lea addresses_WT_ht+0x181f, %rdi
and $30857, %rbx
mov $36, %rcx
rep movsw
nop
nop
xor $56020, %rbp
lea addresses_WC_ht+0xbe1f, %rsi
nop
nop
nop
nop
sub $54038, %r10
movl $0x61626364, (%rsi)
nop
nop
nop
nop
nop
dec %rbp
lea addresses_WT_ht+0x9e1f, %r11
nop
cmp %rbx, %rbx
vmovups (%r11), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r10
nop
nop
nop
nop
add $12403, %r10
lea addresses_normal_ht+0xce1f, %rdx
nop
nop
nop
nop
nop
dec %rdi
movups (%rdx), %xmm3
vpextrq $1, %xmm3, %rbp
nop
nop
nop
nop
nop
sub $5548, %r10
lea addresses_D_ht+0x1861f, %rsi
lea addresses_UC_ht+0x7127, %rdi
nop
nop
nop
lfence
mov $47, %rcx
rep movsl
nop
nop
nop
cmp %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r15
push %r8
push %rax
push %rdi
// Store
lea addresses_WT+0xdf9f, %r11
nop
and $15690, %r8
mov $0x5152535455565758, %r10
movq %r10, %xmm4
movups %xmm4, (%r11)
nop
nop
nop
sub $63908, %r10
// Store
lea addresses_US+0x17a27, %rdi
nop
and %r15, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm0
vmovups %ymm0, (%rdi)
nop
nop
nop
nop
nop
inc %r13
// Load
lea addresses_WC+0x66cf, %r13
nop
cmp %r11, %r11
mov (%r13), %r15w
nop
nop
nop
nop
nop
xor $64405, %rdi
// Store
mov $0x630ee0000000021f, %r10
sub %rdi, %rdi
movl $0x51525354, (%r10)
nop
nop
nop
and %r11, %r11
// Store
lea addresses_normal+0x12a1f, %r11
nop
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %r8
movq %r8, %xmm3
vmovups %ymm3, (%r11)
nop
nop
cmp $21397, %r11
// Faulty Load
lea addresses_WC+0x1661f, %rdi
nop
nop
nop
nop
nop
sub %r13, %r13
movb (%rdi), %al
lea oracles, %r8
and $0xff, %rax
shlq $12, %rax
mov (%r8,%rax,1), %rax
pop %rdi
pop %rax
pop %r8
pop %r15
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_US', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_NC', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': True, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
oeis/029/A029551.asm | neoneye/loda-programs | 11 | 80763 | ; A029551: Highest minimal norm for an (even or odd) 3-modular lattice in dimension n.
; 0,2,2,2,2,3,4,4,4,4,4,4,6,6,6,6,6,6
mov $2,$0
lpb $0
mov $0,$2
add $4,1
sub $2,$4
add $3,1
div $0,$3
sub $0,$3
lpe
add $2,2
lpb $3
mul $3,$2
dif $3,8
lpe
add $4,$3
mov $0,$4
|
formats.als | Artyom260/LASR-Game | 0 | 189 | <reponame>Artyom260/LASR-Game<filename>formats.als
black = ecol(FF000000)
red = ecol(FFFF0000)
yellow = ecol(FFFFFF00)
white = ecol(FFFFFFFF)
grey = ecol(FFDDDDDD)
acenter = {para aspc(center)}
aright = {para aspc(right)}
smallest = font("arial", 10)
smallest2 = font("arial", 6)
smaller = font("arial", 12)
medium = font("arial", 14)
larger = font("arial", 16)
morelarger = font("arial", 22)
largest = font("arial", 28)
WindowHeader = #acenter# {char #larger# #black#}
WindowHeader.yellow = #acenter# {char #larger# #yellow#}
WindowHeader.red = #acenter# {char #larger# #red#}
Buttons = #acenter#{char #smaller# #white#}
SmallButtons = #acenter#{char #smaller# #white#}
Editbox = {char #medium# #white#}
EditboxPW = {char #medium# #white# ecap(password)}
MenuIcons = #acenter#{char #smaller# #black#}
ListHeader = {char #smaller# #black#}
Login.Labels = {char #medium# #white#}
Login.Log = {char #medium# #black#}
GameWindow.Messages = #acenter# {char #larger# #white#}
ChooseServer.WindowHead = #WindowHeader#
ServerCard.Name = #acenter#{char #medium# #black#}
ServerCard.Friends = {char #smallest# #black#}
ConnectionInfoPopup.Text = #acenter#{char #smaller# #white#}
ConnectionInfoPopup.Button = #Buttons#
Userlist.Header = #ListHeader#
Userlist.Buttons = #SmallButtons#
Userlist.Info = {char #smallest# #black#}
Userlist.Text = {char #smaller# #black#}
UserInfo.Name = {char #larger# #black#}
UserInfo.Data = {char #larger# #black#}
UserInfo.SmallButtons = #SmallButtons#
UserInfo.Buttons = #Buttons#
Options.WindowHead = #WindowHeader#
Options.Labels = {char #medium# #black#}
Options.LabelsDisabled = {char #medium# ecol(FF777777)}
Options.Values = {char #medium# #black#}
Options.Buttons = #Buttons#
Options.Control.Header = #acenter#{char #medium# #black#}
Options.Control.TestValues = {char #medium# #black#}
Options.Control.TestValues_c = #acenter# {char #medium# #black#}
Options.Control.TestValues_r = #aright# {char #medium# #black#}
Options.Chat.Labels = #acenter#{char #smallest# #black#}
Options.Chat.Edit = #Editbox#
Options.Combobox = #acenter#{char #smaller# #white#}
Options.Cathegory = {char #smaller# #red#}
Options.CathegoryGrey = {char #smaller# ecol(FF777777)}
PracticeWindow.MapConfigHeader = #WindowHeader#
GameConfig.Labels = {char #medium# #black#}
GameConfig.TrackInfo.Labels = {char #smaller# #black#}
GameConfig.TrackInfo.Values = {char #smaller# #black#}
GameConfig.BestLap = {char #medium# #black#}
ControlOptions.Keys = #acenter#{char #medium# #black#}
CarInfo.Labels = {char #smallest# #white#}
CarInfo.Values = {char #smallest# #white#}
CarInfo.Preset.Labels = {char #smaller# #white#}
CarInfo.Preset.Buttons = {char #smallest# #white#}
Tuning.WindowHeader = #WindowHeader#
Tuning.SmallButtons = #acenter#{char #smallest# #white#}
Tuning.Info = {char #smallest# #black#}
BuyWindow.PayLabel = {char #smaller# #black#}
BuyWindow.PayValue = {char #smaller# #black#}
FilePopup.Info = {char #medium# #black#}
ReplayMenu = #acenter#{char #medium# #white#}
ExtraMapperPopup.remainings = #aright#{char #smallest# #white#}
ExtraMapperPopup.iteminfo = {char #smaller# #white#}
ChatBarComponent.friendInfo = {char #smaller# #grey#}
ChatBarComponent.chatThreeLine = {char #smaller# #white#}
NameTag.Text = #acenter#{char #largest# #white#}
NameTag.Text2 = #acenter#{char #largest# #black#}
NameTag.Text3 = #acenter#{char #largest# #red#}
UpWindow.Text = {char #medium# #black#}
UpWindow.Point = #aright#{char #medium# #black#}
UpWindow.RankName = #acenter#{char #medium# #black#}
RedPopups.Label = #acenter#{char #medium# #white#}
HUDCtfInfo.activeNameColor = {char font("verdanab", 14) ecol(ff00cf00) }
HUDCtfInfo.inactiveNameColor = {char font("verdanab", 14) ecol(ffffffff) }
IconMacros = #aright# {char #morelarger# #white#}
UserCardInfos = #acenter# {char #smaller# #black#}
MainMenu.username = {char #larger# #white#}
InfoComponent.whitetext = #aright# {char #medium# #white#}
InfoComponent.blacktext = #aright# {char #medium# #black#}
InfoComponent.whitetext2 = {char #medium# #white#}
InfoComponent.blacktext2 = {char #medium# #black#}
InfoComponent.whitetext3 = #acenter# {char #medium# #white#}
InfoComponent.blacktext3 = #acenter# {char #medium# #black#}
InfoComponent.text4 = {char #medium# ecol(FFFFAA44) }
HUD.text = {char bfont("bfont0",20) #white#}
UserManagement.slot = {char #medium# #white#}
UserManagement.date = #acenter# {char #smaller# #white#}
bmfont1 = #acenter# {char bfont("bfont1",30) #white#}
Popups.centerblack = #acenter# {char #medium# #black#}
Popups.titleRightWhite = #aright# {char #smaller# #white#}
Credits.header = #acenter# {char #largest# #white#}
Credits.role = #aright# {char #larger# #white#}
Credits.name = #aleft# {char #larger# #white#}
Menu.rightWhite = #aright# {char #larger# #white#}
Menu.rightBlack = #aright# {char #larger# #black#}
Menu.carName = #aright# {char #larger# #white#}
Menu.leftWhite = {char #larger# #white#}
Menu.leftBlack = {char #larger# #black#}
IngameMenu.title = #aleft# {char #medium# #grey# ecol(ff779977) }
IngameMenu.title2 = #aright# {char #medium# #grey# ecol(ffddddbb) }
Cellphone.screen = {char #smallest# #black# #aright#}
CardComponent.locked = #aright# {char #smallest# #black# #aright#}
Chat.text = {char #smaller# #white#}
Bottalk.text_w = #acenter# {char #larger# #white#}
Bottalk.text_b = #acenter# {char #larger# #black#}
Bottalk.text = #acenter# {char #smallest# #black#}
PDA.text1 = #acenter# {char #smaller# #white#}
PDA.text2 = #acenter# {char #smaller# #black#}
PDA.text3 = #acenter# {char #smaller# #red#}
PDA.text4 = #acenter# {char #smaller# #yellow#}
PDA.text5 = #acenter# {char #larger# #black#}
PDA.text6 = #acenter# {char #larger# #white#}
Text.smallCenterBlack = #acenter# {char #medium# #black#}
Text.smallCenterWhite = #acenter# {char #medium# #white#}
Text.smallRightBlack = #aright# {char #medium# #black#}
Text.smallRightWhite = #aright# {char #medium# #white#}
Intro.text1 = #acenter# {char #morelarger# #white#}
TrialPopup.text1 = {char #medium# #black#}
TrialPopup.text2 = {char #smaller# #black#}
ServerSelect.headers = {char #medium# #black#}
ServerSelect.text = {char #smaller# #white#}
ServerSelect.text2 = {char #smaller# #white#}
ServerSelect.text_center = #acenter# {char #smaller# #white#}
Console = {char #smaller# #white#}
|
Source/game_map.adb | XMoose25X/Advanced-Dungeon-Assault | 1 | 25618 | <gh_stars>1-10
With Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO, stats, display, player, inventory_list, Ada.Unchecked_Deallocation, System.Address_Image;
Use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO, stats, display, player, inventory_list;
---------------------------------------------------------------------------------------------------
Package Body game_map is
---------------------------------------------------------------------------------------------------
-- <NAME>, <NAME>, <NAME>
-- Map Package
---------------------------------------------------------------------------------------------------
Map_File : File_Type;
Type Item_Set is Array (1..30) of Integer;
Function Empty (Position : in Room_Ptr) Return Boolean is
Begin
If (Position = NULL) then
Return False;
Else
Return True;
End If;
End Empty;
---------------------------------------------------------------------------------------------------
Procedure Action(Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer) is
User : Character := 'o';
Chance : Integer;
begin
If (Pos.Boss = True) then
-- Start Battle
RoomID := 99;
pos.Boss := false;
Elsif (Pos.Statue = True) then -- Statue Location Handling
Map(Pos.Y_Axis, Pos.X_Axis).Color := 's';
--Put(ASCII.ESC & "[H");
Put(ASCII.ESC & "[39;4H");
Put_Line("Found Statue! Y/N ");
Loop
Get_Immediate(User);
If (User = 'n') OR (User ='N') then
RoomID := 49;
New_Line(20);
Exit;
Elsif (User = 'y') OR (User = 'Y') then
RoomID := 50;
Pos.Statue := False;
Map(Pos.Y_Axis, Pos.X_Axis).Color := 't';
New_Line(20);
Exit;
Else
Put(ASCII.ESC & "[39;40H");
Put_Line("Enter a valid character.");
End If;
End Loop;
Elsif (Pos.Item >= 0) then -- Item Location Handling
Map(Pos.Y_Axis, Pos.X_Axis).Color := 's';
Put(ASCII.ESC & "[39;4H");
Put_Line("Found Item Chest! Open it? Y/N ");
Loop
Get_Immediate(User);
If (User = 'n') OR (User ='N') then
RoomID := 31;
New_Line(20);
Exit;
Elsif (User = 'y') OR (User = 'Y') then
RoomID := (Pos.Item); -- Display in Main
Insert(Pos.Item, My_Player.Backpack); -- Add Item
Pos.Item := -1;
Map(Pos.Y_Axis, Pos.X_Axis).Color := 't';
New_Line(20);
Exit;
Else
Put(ASCII.ESC & "[39;40H");
Put_Line("Enter a valid character.");
End If;
End Loop;
Else -- Regular Room
Chance := RandomZero(100);
If (Chance <= 20) then
RoomID := 0;
End If;
End If;
If (Pos.Item = -1) AND (Pos.Statue = False) then -- Set Map Colors
Map(Pos.Y_Axis, Pos.X_Axis).Color := 't';
Else
Map(Pos.Y_Axis, Pos.X_Axis).Color := 's';
End If;
End Action;
---------------------------------------------------------------------------------------------------
Procedure Move_North(Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer) is
Item : Integer := -1;
begin
If (Pos.North = NULL) then
RoomID:= 77;
Else
Pos := Pos.North;
Action(Pos, Map, My_Player, Item);
RoomID := Item;
End If;
end Move_North;
---------------------------------------------------------------------------------------------------
Procedure Move_East(Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer) is
Item : Integer := -1;
begin
If (Pos.East = NULL) then
RoomID:= 77;
Else
Pos := Pos.East;
Action(Pos, Map, My_Player, Item);
RoomID := Item;
End If;
end Move_East;
---------------------------------------------------------------------------------------------------
Procedure Move_South(Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer) is
Item : Integer := -1;
begin
If (Pos.South = NULL) then
RoomID:= 77;
Else
Pos := Pos.South;
Action(Pos, Map, My_Player, Item);
RoomID := Item;
End If;
end Move_South;
---------------------------------------------------------------------------------------------------
Procedure Move_West(Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer) is
Item : Integer := -1;
begin
If (Pos.West = NULL) then
RoomID:= 77;
Else
Pos := Pos.West;
Action(Pos, Map, My_Player, Item);
RoomID := Item;
End If;
end Move_West;
---------------------------------------------------------------------------------------------------
Function "=" (A,B : Room) Return Boolean is
Begin
If ((A.X_Axis = B.X_Axis) AND (A.Y_Axis = B.Y_Axis)) Then
Return True;
Else
Return False;
End If;
End "=";
---------------------------------------------------------------------------------------------------
Function "=" (A : Room_Ptr; B : Room) Return Boolean is
Begin
If ((A.X_Axis = B.X_Axis) AND (A.Y_Axis = B.Y_Axis)) Then
Return True;
Else
Return False;
End If;
End "=";
---------------------------------------------------------------------------------------------------
Procedure Print(Current : in Room_Ptr; Map : in Map_Type) is
Begin
Put("Location: (");
Put(Current.X_Axis, Width => 0);
Put(",");
Put(Current.Y_Axis, Width => 0);
Put_Line(")");
Put("North: (");
If Current.North = NULL then
Put("Wall");
Else
Put(Current.North.X_Axis, Width => 0);
Put(",");
Put(Current.North.Y_Axis, Width => 0);
End If;
Put_Line(")");
Put("East: (");
If Current.East = NULL then
Put("Wall");
Else
Put(Current.East.X_Axis, Width => 0);
Put(",");
Put(Current.East.Y_Axis, Width => 0);
End If;
Put_Line(")");
Put("South: (");
If Current.South = NULL then
Put("Wall");
Else
Put(Current.South.X_Axis, Width => 0);
Put(",");
Put(Current.South.Y_Axis, Width => 0);
End If;
Put_Line(")");
Put("West: (");
If Current.West = NULL then
Put("Wall");
Else
Put(Current.West.X_Axis, Width => 0);
Put(",");
Put(Current.West.Y_Axis, Width => 0);
End If;
Put_Line(")");
Put("Item: ");
Put(Item => Current.Item, Width => 0);
New_Line;
Put("Boss: ");
If (Current.Boss = True) Then
Put_Line("True");
Else
Put_Line("False");
End If;
Put("Statue: ");
If (Current.Statue = True) Then
Put_Line("True");
Else
Put_Line("False");
End If;
Put("Color:");
Put(Map(Current.Y_Axis, Current.X_Axis).Color);
End Print;
---------------------------------------------------------------------------------------------------
Procedure Search (Position : in Room_Ptr; Key : in Room; Location : out Room_Ptr; Found : out Boolean) is
Temp : Room_Ptr;
Begin
If (Position = Key) then
Location := Position; -- Saves Location of Room with Key Coordinates
Found := True; -- Used to Break Recursive Calls
Return;
Else
If (Position.North /= NULL) AND Then (Position.North.Traversed = False) then
Temp := Position.North;
Temp.Traversed := True;
Search(Temp, Key, Location, Found);
If (Found = True) then -- Break out of the Recursive Calls
Return;
End If;
End If;
If (Position.East /= NULL) AND Then (Position.East.Traversed = False) then
Temp := Position.East;
Temp.Traversed := True;
Search(Temp, Key, Location, Found);
If (Found = True) then -- Break out of the Recursive Calls
Return;
End If;
End If;
If (Position.South /= NULL) AND Then (Position.South.Traversed = False) then
Temp := Position.South;
Temp.Traversed := True;
Search(Temp, Key, Location, Found);
If (Found = True) then -- Break out of the Recursive Calls
Return;
End If;
End If;
If (Position.West /= NULL) AND Then(Position.West.Traversed = False) then
Temp := Position.West;
Temp.Traversed := True;
Search(Temp, Key, Location, Found);
If (Found = True) then -- Break out of the Recursive Calls
Return;
End If;
End If;
End If;
End Search;
---------------------------------------------------------------------------------------------------
Procedure Reset (Location : in Room_Ptr) is
Temp : Room_Ptr;
Begin
Temp := Location;
Temp.Traversed := False;
If (Location.North /= NULL) AND Then (Location.North.Traversed = True) then
Temp := Location.North;
Temp.Traversed := False;
Reset(Temp);
End If;
If (Location.East /= NULL) AND Then (Location.East.Traversed = True) then
Temp := Location.East;
Temp.Traversed := False;
Reset(Temp);
End If;
If (Location.South /= NULL) AND Then (Location.South.Traversed = True) then
Temp := Location.South;
Temp.Traversed := False;
Reset(Temp);
End If;
If (Location.West /= NULL) AND Then(Location.West.Traversed = True) then
Temp := Location.West;
Temp.Traversed := False;
Reset(Temp);
End If;
End Reset;
---------------------------------------------------------------------------------------------------
Procedure Traverse (Location : in Room_Ptr; Floor_Map : in out Map_Type; Show_North : in Boolean := True;
Show_East : in Boolean := True; Show_South : in Boolean := True; Show_West : in Boolean := True) is
Temp : Room_Ptr;
Begin
Temp := Location;
If (Temp.Boss = True) then
NULL; -- Don't Change Character when Discovered
Elsif (Temp.Statue = True) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Statue_Icon;
Elsif (Temp.Item >= 0) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Chest_Icon; -- ∞
Else
If (Temp.North /= NULL) then
If (Temp.South /= NULL) then
If (Temp.East /= NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(206); -- ╬
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(204); -- ╠
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
Elsif (Temp.East = NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(185); -- ╣
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(186); -- ║
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
End If;
Elsif (Temp.South = NULL) then
If (Temp.East /= NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(202); -- ╩
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(200); -- ╚
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
Elsif (Temp.East = NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(188); -- ╝
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(186); -- ║
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
End If;
End If;
Elsif (Temp.North = NULL) then
If (Temp.South /= NULL) then
If (Temp.East /= NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(203); -- ╦
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(201); -- ╔
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
Elsif (Temp.East = NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(187); -- ╗
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(186); -- ║
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
End If;
Elsif (Temp.South = NULL) then
If (Temp.East /= NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(205); -- ═
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(205); -- ═
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
Elsif (Temp.East = NULL) then
If (Temp.West /= NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(205); -- ═
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
Elsif (Temp.West = NULL) then
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Chars := Character'Val(219); -- █
If (Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 't') OR
(Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color = 's')then
NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis).Color := 'd';
End If;
End If;
End If;
End If;
End If;
End If;
-- After this point, all adjacent rooms will become visible
If (Show_North = True) Then
If (Location.North /= NULL) then
Temp := Location.North;
Traverse(Temp, Floor_Map, False, False, False, False); -- Calls to assign value
Temp := Location;
Else
If (Temp.Y_Axis = 1) then NULL;
Else
Floor_Map(Temp.Y_Axis - 1, Temp.X_Axis).Chars := Character'Val(219); -- █
End If;
End If;
End If;
If (Show_East = True) Then
If (Location.East /= NULL) then
Temp := Location.East;
Traverse(Temp, Floor_Map, False, False, False, False); -- Calls to assign value
Temp := Location;
Else
If (Temp.X_Axis = Floor_Map'Length(2)) then NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis + 1).Chars := Character'Val(219); -- █
End If;
End If;
End If;
If (Show_South = True) Then
If (Location.South /= NULL) then
Temp := Location.South;
Traverse(Temp, Floor_Map, False, False, False, False); -- Calls to assign value
Temp := Location;
Else
If (Temp.Y_Axis = Floor_Map'Length(1)) then NULL;
Else
Floor_Map(Temp.Y_Axis + 1, Temp.X_Axis).Chars := Character'Val(219); -- █
End If;
End If;
End If;
If (Show_West = True) Then
If (Location.West /= NULL) then
Temp := Location.West;
Traverse(Temp, Floor_Map, False, False, False, False); -- Calls to assign value
Temp := Location;
Else
If (Temp.X_Axis = 1) then NULL;
Else
Floor_Map(Temp.Y_Axis, Temp.X_Axis - 1).Chars := Character'Val(219); -- █
End If;
End If;
End If;
End Traverse;
---------------------------------------------------------------------------------------------------
Procedure Show_Screen (Location : in out Room_Ptr; Floor_Map : in out Map_Type) is
Temp : Room_Ptr;
X_Offset : Integer := 0;
Y_Offset : Integer := 0;
Level : Integer := 1;
begin
clearDisplay;
Temp := Location;
If (Floor_Map'Length(2) = 5) then
Level := 4;
Else
Level := Floor_Map'Length(1) / 10;
End If;
if (Level = 1) then
X_Offset := 67;
Y_Offset := 11;
elsif (Level = 2) then
X_Offset := 57;
Y_Offset := 6;
elsif (Level = 3) then
X_Offset := 50;
Y_Offset := 0;
elsif (Level = 4) then
X_Offset := 69;
Y_Offset := 11;
End if;
setText(1,1, "-----World Map Actions-----", colorWhiteL);
setText(1,2, "Press 'w' to Move North", colorWhiteL);
setText(1,3, "Press 'a' to Move West", colorWhiteL);
setText(1,4, "Press 's' to Move South", colorWhiteL);
setText(1,5, "Press 'd' to Move East", colorWhiteL);
setText(1,6, "Press 'i' to Open Inventory", colorWhiteL);
setText(1,7, "Press 'q' to Quit Game", colorWhiteL);
setText(123,1, "-------Map Key-------", colorWhiteL);
setText(136,2, "O", colorMag);
setText(137,2, " is you", colorWhiteL);
setText(131,3, Boss_Icon, colorRed); -- Ω
setText(132,3, " is the boss", colorWhiteL);
setText(124,4, Statue_Icon, colorYellow);
setText(125,4, " is an angel statue", colorWhiteL);
setText(132,5, Chest_Icon, colorYellow);
setText(133,5, " is a chest", colorWhiteL);
Traverse(Location, Floor_Map);
for i in 1..Floor_Map'Length(1) loop
for j in 1..Floor_Map'Length(2) loop
if (Temp.X_Axis = j) and (Temp.Y_Axis = i) then -- Position Color
setPixel(j + X_Offset, i + Y_Offset,'O', colorMag);
else
if (Floor_Map(i,j).Chars = Boss_Icon) then -- Boss Room Color
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorRed);
elsif (Floor_Map(i,j).Chars = Character'Val(219)) then -- Wall Color
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorBlue);
Elsif (Floor_Map(i,j).Chars = Character'Val(178)) then -- Unknown Color
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorBlackL);
Else -- Path Color
If (Floor_Map(i,j).Color = 'd') then
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorBlackL);
Elsif (Floor_Map(i,j).Color = 't') then
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorGreen);
Elsif (Floor_Map(i,j).Color = 's') then
setPixel(j + X_Offset, i + Y_Offset,Floor_Map(i,j).Chars, colorYellow);
End If;
End If;
end if;
end loop;
new_Line;
end loop;
--Refresh;
end Show_Screen;
---------------------------------------------------------------------------------------------------
Procedure Generate (Level : in Integer) is
Random : Integer;
begin
Random := RandomRange(3);
If (Level = 1) Then
If (Random = 1) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_1/Lvl_1_a.txt");
Elsif (Random = 2) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_1/Lvl_1_b.txt");
Elsif (Random = 3) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_1/Lvl_1_c.txt");
End If;
End If;
If (Level = 2) Then
If (Random = 1) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_2/Lvl_2_a.txt");
Elsif (Random = 2) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_2/Lvl_2_b.txt");
Elsif (Random = 3) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_2/Lvl_2_c.txt");
End If;
End If;
If (Level = 3) Then
If (Random = 1) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_3/Lvl_3_a.txt");
Elsif (Random = 2) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_3/Lvl_3_b.txt");
Elsif (Random = 3) then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_3/Lvl_3_c.txt");
End If;
End If;
If (Level = 4) Then
Open(File => Map_File, Mode => In_File, Name => "Maps/Level_4/Lvl_4.txt");
End If;
End Generate;
---------------------------------------------------------------------------------------------------
Procedure Initialize (Level : in out Coords; Start : Out Room_Ptr) is
Floor : Integer;
begin
If (Level'Length(2) = 5) then
Floor := 4;
Else
Floor := Level'Length(1) / 10; -- Determine Level by Size of Map
End If;
Generate(Floor);
For i in 1..Level'Length(1) Loop -- Outer Loop for Y-Axis
For j in 1..Level'Length(2) Loop -- Inner Loop for X-Axis
Get(File => Map_File, Item => Level(i,j)); -- Row Dominant, (y,x)
--Put(Level(i,j), Width => 0);
End Loop;
If Not End_of_File (Map_File) then -- Checks for End of File
Skip_Line(Map_File); -- Moves to Next Line
end If;
New_Line;
End Loop;
Close(Map_File);
Start := new Room'(North => NULL, East => NULL, South => NULL, West => NULL,
Y_Axis => Level'Length(1), X_Axis => (Level'Length(2) / 2 + 1),
Item => -1, Statue => False, Boss => False, Traversed => False, Set => False);
end Initialize;
---------------------------------------------------------------------------------------------------
Procedure Alter (Layout : in Coords; Area : in out Room_Ptr; Map : in out Map_Type) is
Level : Integer;
Items_1 : Item_Set := (14, 15, 16, 17, 18, 19, 20, 07, 06, 21, Others => 0); -- 11
Items_2 : Item_Set := (14, 15, 16, 17, 18, 19, 20, 07, 01, 02, 03, 04, 05, 06, 21, 08, 09, 10, 11, 12, 13, 22, 23, 30, Others => 0); -- 24
Items_3 : Item_Set := (14, 15, 16, 17, 18, 19, 20, 07, 01, 02, 03, 04, 05, 06, 21, 08, 09, 10, 11, 12, 13, 22, 23, 30, 24, 25, 26, 27, 28, 29); -- 30
begin
If (Map'Length(2) = 5) then
Level := 4;
Else
Level := Map'Length(1) / 10; -- Determine Level by Size of Map
End If;
If (Layout((Area.Y_Axis),(Area.X_Axis)) = 2) Then -- Item
If (Level = 1) then -- Only Get Level 1 Items
Area.Item := Items_1(RandomRange(11));
Elsif (Level = 2) then -- Only Get Level 2 Items
Area.Item := Items_2(RandomRange(24));
Elsif (Level = 3) then -- Only Get Level 3 Items
Area.Item := Items_3(RandomRange(30));
Else -- Level 4 Items
Area.Item := Items_3(RandomRange(30));
End If;
Map((Area.Y_Axis),(Area.X_Axis)).Color := 'd';
Elsif (Layout((Area.Y_Axis),(Area.X_Axis)) = 9) Then -- Boss
Area.Boss := True;
Map((Area.Y_Axis),(Area.X_Axis)).Chars := Boss_Icon; -- Ω
Map((Area.Y_Axis),(Area.X_Axis)).Color := 'b';
Elsif (Layout((Area.Y_Axis),(Area.X_Axis)) = 3) Then -- Statue
Area.Statue := True;
Map((Area.Y_Axis),(Area.X_Axis)).Color := 'd';
End If;
End Alter;
---------------------------------------------------------------------------------------------------
Procedure Link(Level : in out Coords; Current : in out Room_Ptr; Map : in out Map_Type) is
Key : Room; -- Used for Finding if a Room Exists at a Specific Coordinate
Temp : Room_Ptr; -- Will Point to Key
Found : Boolean := False; -- Triggers if Key is Found
Begin
Begin -- Checking for Rooms North
If ((Level(Current.Y_Axis - 1, Current.X_Axis) /= 0) AND (Current.North = NULL)) Then -- Room Should Exist to North
Key.Y_Axis := Current.Y_Axis - 1; -- Declaring the Map Coordinates
Key.X_Axis := Current.X_Axis; -- Declaring the Map Coordinates
Search(Current, Key, Temp, Found); -- Sees if the Key Has Already Been Made
Reset(Current); -- Resets Traversed Flags
If (Found = False) then -- Making New Room to North
Current.North := New Room'(North => NULL, East => NULL, South => Current, West => NULL, Y_Axis => Current.Y_Axis - 1,
X_Axis => Current.X_Axis, Item => -1, Statue => False, Boss => False, Traversed => False, Set => False);
Alter(Level, Current.North, Map);
Elsif (Found = True) then -- Linking to Room North
Current.North := Temp;
Current.North.South := Current;
Found := False; -- Reset Flag
End If;
End If;
Exception
When Constraint_Error => NULL;
End;
Begin -- Checking for Rooms South
If ((Level(Current.Y_Axis + 1, Current.X_Axis) /= 0) AND (Current.South = NULL)) then -- Room Should Exist to South
-- Put_Line("South Shows 1");
Key.Y_Axis := Current.Y_Axis + 1; -- Declaring the Map Coordinates
Key.X_Axis := Current.X_Axis; -- Declaring the Map Coordinates
Search(Current, Key, Temp, Found); -- Sees if the Key Has Already Been Made
Reset(Current); -- Resets Traversed Flags
If (Found = False) then -- Making New Room to South
Current.South := New Room'(North => Current, East => NULL, South => NULL, West => NULL, Y_Axis => Current.Y_Axis + 1,
X_Axis => Current.X_Axis, Item => -1, Statue => False, Boss => False, Traversed => False, Set => False);
Alter(Level, Current.South, Map);
Elsif (Found = True) then -- Linking to Room South
Current.South := Temp;
Current.South.North := Current;
Found := False; -- Reset Flag
End If;
End If;
Exception
When Constraint_Error => NULL;
End;
Begin -- Checking for Rooms East
If ((Level(Current.Y_Axis, Current.X_Axis + 1) /= 0) AND (Current.East = NULL)) then -- Room Should Exist to East
--Put_Line("East Shows 1");
Key.Y_Axis := Current.Y_Axis; -- Declaring the Map Coordinates
Key.X_Axis := Current.X_Axis + 1; -- Declaring the Map Coordinates
Search(Current, Key, Temp, Found); -- Sees if the Key Has Already Been Made
Reset(Current); -- Resets Traversed Flags
If (Found = False) then -- Making New Room to East
Current.East := New Room'(North => NULL, East => NULL, South => NULL, West => Current, Y_Axis => Current.Y_Axis,
X_Axis => Current.X_Axis + 1, Item => -1, Statue => False, Boss => False, Traversed => False, Set => False);
Alter(Level, Current.East, Map);
Elsif (Found = True) then -- Linking to Room East
Current.East := Temp;
Current.East.West := Current;
Found := False; -- Reset Flag
End If;
End If;
Exception
When Constraint_Error => NULL;
End;
Begin -- Checking for Rooms West
If ((Level(Current.Y_Axis, Current.X_Axis - 1) /= 0) AND (Current.West = NULL)) then -- Room Should Exist to West
--Put_Line("West Shows 1");
Key.Y_Axis := Current.Y_Axis; -- Declaring the Map Coordinates
Key.X_Axis := Current.X_Axis - 1; -- Declaring the Map Coordinates
Search(Current, Key, Temp, Found); -- Sees if the Key Has Already Been Made
Reset(Current); -- Resets Traversed Flags
If (Found = False) then -- Making New Room West
Current.West := New Room'(North => NULL, East => Current, South => NULL, West => NULL, Y_Axis => Current.Y_Axis,
X_Axis => Current.X_Axis - 1, Item => -1, Statue => False, Boss => False, Traversed => False, Set => False);
Alter(Level, Current.West, Map);
Elsif (Found = True) then -- Linking Room West
Current.West := Temp;
Current.West.East := Current;
Found := False; -- Reset Flag
End If;
End If;
Exception
When Constraint_Error => NULL;
End;
Current.Set := True; -- Makes sure no room is visited twice
If (Current.North /= NULL) AND then (Current.North.Set = False) then -- Recursive Call North
Link(Level,Current.North, Map);
End If;
If (Current.East /= NULL) AND then (Current.East.Set = False) then -- Recursive Call East
Link(Level,Current.East, Map);
End If;
If (Current.South /= NULL) AND then (Current.South.Set = False) then -- Recursive Call South
Link(Level,Current.South, Map);
End If;
If (Current.West /= NULL) AND then (Current.West.Set = False) then -- Recursive Call West
Link(Level,Current.West, Map);
End If;
End Link;
---------------------------------------------------------------------------------------------------
procedure Free is new Ada.Unchecked_Deallocation(Object => Room, Name => Room_Ptr);
-- Grabage Collection
---------------------------------------------------------------------------------------------------
Procedure Delete_Map (Location : in out Room_Ptr) is
Temp : Room_Ptr;
Begin
Temp := Location;
Temp.Traversed := True;
If (Location.North /= NULL) AND Then (Location.North.Traversed = False) then
Temp := Location.North;
Temp.Traversed := True;
Delete_Map(Temp);
End If;
If (Location.East /= NULL) AND Then (Location.East.Traversed = False) then
Temp := Location.East;
Temp.Traversed := True;
Delete_Map(Temp);
End If;
If (Location.South /= NULL) AND Then (Location.South.Traversed = False) then
Temp := Location.South;
Temp.Traversed := True;
Delete_Map(Temp);
End If;
If (Location.West /= NULL) AND Then(Location.West.Traversed = False) then
Temp := Location.West;
Temp.Traversed := True;
Delete_Map(Temp);
End If;
Free(Location);
End Delete_Map;
---------------------------------------------------------------------------------------------------
End game_map;
|
programs/oeis/189/A189327.asm | neoneye/loda | 22 | 10334 | ; A189327: Number of nondecreasing arrangements of 4 numbers in 0..n with the last equal to n and each after the second equal to the sum of one or two of the preceding four
; 2,6,7,12,12,18,17,24,22,30,27,36,32,42,37,48,42,54,47,60,52,66,57,72,62,78,67,84,72,90,77,96,82,102,87,108,92,114,97,120,102,126,107,132,112,138,117,144,122,150,127,156,132,162,137,168,142,174,147,180,152,186,157,192,162,198,167,204,172,210,177,216,182,222,187,228,192,234,197,240,202,246,207,252,212,258,217,264,222,270,227,276,232,282,237,288,242,294,247,300
mov $1,$0
add $0,1
mod $1,2
add $1,5
mul $0,$1
div $0,2
|
examples/outdated-and-incorrect/iird/IIDg.agda | asr/agda-kanso | 1 | 9265 | <filename>examples/outdated-and-incorrect/iird/IIDg.agda
module IIDg where
open import LF
-- Codes for indexed inductive types
data OPg (I : Set) : Set1 where
ι : I -> OPg I
σ : (A : Set)(γ : A -> OPg I) -> OPg I
δ : (H : Set)(i : H -> I)(γ : OPg I) -> OPg I
-- The top-level structure of values in an IIDg
Args : {I : Set}(γ : OPg I)(U : I -> Set) -> Set
Args (ι _) U = One
Args (σ A γ) U = A × \a -> Args (γ a) U
Args (δ H i γ) U = ((x : H) -> U (i x)) × \_ -> Args γ U
-- The index of a value in an IIDg
Index : {I : Set}(γ : OPg I)(U : I -> Set) -> Args γ U -> I
Index (ι i) U _ = i
Index (σ A γ) U < a | b > = Index (γ a) U b
Index (δ _ _ γ) U < _ | b > = Index γ U b
-- The assumptions of a particular inductive occurrence.
IndArg : {I : Set}(γ : OPg I)(U : I -> Set) -> Args γ U -> Set
IndArg (ι _) U _ = Zero
IndArg (σ A γ) U < a | b > = IndArg (γ a) U b
IndArg (δ H i γ) U < _ | b > = H + IndArg γ U b
-- The index of an inductive occurrence.
IndIndex : {I : Set}(γ : OPg I)(U : I -> Set)(a : Args γ U) -> IndArg γ U a -> I
IndIndex (ι _) U _ ()
IndIndex (σ A γ) U < a | b > h = IndIndex (γ a) U b h
IndIndex (δ A i γ) U < g | b > (inl h) = i h
IndIndex (δ A i γ) U < g | b > (inr h) = IndIndex γ U b h
-- An inductive occurrence.
Ind : {I : Set}(γ : OPg I)(U : I -> Set)(a : Args γ U)(h : IndArg γ U a) -> U (IndIndex γ U a h)
Ind (ι _) U _ ()
Ind (σ A γ) U < a | b > h = Ind (γ a) U b h
Ind (δ H i γ) U < g | b > (inl h) = g h
Ind (δ H i γ) U < _ | b > (inr h) = Ind γ U b h
-- The type of induction hypotheses.
IndHyp : {I : Set}(γ : OPg I)(U : I -> Set)(C : (i : I) -> U i -> Set)(a : Args γ U) -> Set
IndHyp γ U C a = (hyp : IndArg γ U a) -> C (IndIndex γ U a hyp) (Ind γ U a hyp)
-- Large induction hypostheses.
IndHyp₁ : {I : Set}(γ : OPg I)(U : I -> Set)(C : (i : I) -> U i -> Set1)(a : Args γ U) -> Set1
IndHyp₁ γ U C a = (hyp : IndArg γ U a) -> C (IndIndex γ U a hyp) (Ind γ U a hyp)
|
aplib247b.asm | uniabis/z80depacker | 25 | 3386 | <filename>aplib247b.asm
; aPPack decompressor
; original source by dwedit
; very slightly adapted by utopian
; optimized by Metalbrain & <NAME>
;247b
;hl = source
;de = dest
depack ;di
;push iy
or a
ex af,af'
;call init
;pop iy
;ei
;ret
init ld a,128
apbranch1 ldi
aploop2 ld ixh,1
aploop add a,a
jr nz,apnogetbit1
ld a,(hl)
inc hl
rla
apnogetbit1 jr nc,apbranch1
add a,a
jr nz,apnogetbit2
ld a,(hl)
inc hl
rla
apnogetbit2 jr nc,apbranch2
add a,a
jr nz,apnogetbit3
ld a,(hl)
inc hl
rla
apnogetbit3 jr nc,apbranch3
ld bc,16 ;get an offset
apget4bits add a,a
jr nz,apnogetbit4
ld a,(hl)
inc hl
rla
apnogetbit4 rl c
jr nc,apget4bits
jr nz,apbranch4
ex de,hl
ld (hl),b ;write a 0
ex de,hl
inc de
jp aploop2
apbranch4 ex af,af'
ex de,hl ;write a previous byte (1-15 away from dest)
sbc hl,bc
ld a,(hl)
add hl,bc
ld (hl),a
ex af,af'
ex de,hl
inc de
jp aploop2
apbranch3 ld c,(hl) ;use 7 bit offset, length = 2 or 3
inc hl
ex af,af'
rr c
ret z ;if a zero is found here, it's EOF
ld a,2
ld b,0
adc a,b
push hl
ld iyh,b
ld iyl,c
ld h,d
ld l,e
sbc hl,bc
ld c,a
ex af,af'
ldir
pop hl
ld ixh,b
jp aploop
apbranch2 call ap_getgamma ;use a gamma code * 256 for offset, another gamma code for length
dec c
ex af,af'
ld a,c
sub ixh
jr z,ap_r0_gamma
dec a
;do I even need this code?
;bc=bc*256+(hl), lazy 16bit way
ld b,a
ld c,(hl)
inc hl
ld iyh,b
ld iyl,c
push bc
call ap_getgamma2
ex (sp),hl ;bc = len, hl=offs
push de
ex de,hl
ex af,af'
ld a,4
cp d
jr nc,apskip2
inc bc
or a
apskip2 ld hl,127
sbc hl,de
jr c,apskip3
inc bc
inc bc
apskip3 pop hl ;bc = len, de = offs, hl=junk
push hl
or a
sbc hl,de
ex af,af'
pop de ;hl=dest-offs, bc=len, de = dest
ldir
pop hl
ld ixh,b
jp aploop
ap_r0_gamma call ap_getgamma2 ;and a new gamma code for length
push hl
push de
ex de,hl
ld d,iyh
ld e,iyl
sbc hl,de
pop de ;hl=dest-offs, bc=len, de = dest
ldir
pop hl
ld ixh,b
jp aploop
ap5 ld a,(hl)
inc hl
rla
jp apnogetbit5
ap6 ld a, (hl)
inc hl
rla
jp apnogetbit6
ap7 ld a, (hl)
inc hl
rla
jp apnogetbit7
ap8 ld a, (hl)
inc hl
rla
jp apnogetbit8
ap9 ld a, (hl)
inc hl
rla
jp apnogetbit9
ap10 ld a, (hl)
inc hl
rla
ret nc
jp ap_getgammaloop
ap_getgamma2 ex af, af'
ap_getgamma ld bc, 1
add a, a
jr z, ap5
apnogetbit5 rl c
add a, a
jr z, ap6
apnogetbit6 ret nc
add a, a
jr z, ap7
apnogetbit7 rl c
add a, a
jr z, ap8
apnogetbit8 ret nc
ap_getgammaloop add a, a
jr z, ap9
apnogetbit9 rl c
rl b
add a, a
jr z, ap10
apnogetbit10 ret nc
jp ap_getgammaloop
|
Rings/EuclideanDomains/Lemmas.agda | Smaug123/agdaproofs | 4 | 2763 | {-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Groups.Groups
open import Groups.Homomorphisms.Definition
open import Groups.Definition
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Order
open import Setoids.Orders
open import Setoids.Setoids
open import Functions
open import Sets.EquivalenceRelations
open import Rings.Definition
open import Rings.Homomorphisms.Definition
open import Groups.Homomorphisms.Lemmas
open import Rings.IntegralDomains.Definition
open import Rings.IntegralDomains.Examples
open import Rings.EuclideanDomains.Definition
open import Fields.Fields
open import WellFoundedInduction
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Rings.EuclideanDomains.Lemmas {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ _*_ : A → A → A} {R : Ring S _+_ _*_} (E : EuclideanDomain R) where
open import Rings.PrincipalIdealDomains.Definition (EuclideanDomain.isIntegralDomain E)
open import Rings.Ideals.Principal.Definition R
open import Rings.Divisible.Definition R
open Setoid S
open Ring R
open Equivalence eq
euclideanDomainIsPid : {c : _} → PrincipalIdealDomain {c}
euclideanDomainIsPid {pred = pred} ideal = {!!}
-- We definitely need to be able to decide equality in order to deduce this; otherwise we can't tell the difference
-- between "everything is 0" and "something is nonzero", and the proofs are genuinely different in the two cases.
where
r : A
r = {!!}
r!=0 : (r ∼ 0R) → False
r!=0 = {!!}
predR : pred r
predR = {!!}
sr : (s : A) → r ∣ s
sr = EuclideanDomain.divisionAlg r!=0 s!=0 ?
|
PRG/objects/W307Coin.asm | narfman0/smb3_pp1 | 0 | 173279 | .byte $01 ; Unknown purpose
.byte OBJ_AUTOSCROLL, $00, $12
.byte OBJ_TREASURESET, $2B, $07
.byte OBJ_TREASUREBOX, $2C, $16
.byte OBJ_TREASUREBOXAPPEAR, $2D, $16
.byte $FF ; Terminator
|
programs/oeis/293/A293656.asm | neoneye/loda | 22 | 178650 | ; A293656: a(n) = binomial(n+1,2)*n!/n!!.
; 1,3,12,30,120,315,1344,3780,17280,51975,253440,810810,4193280,14189175,77414400,275675400,1579253760,5892561675,35300966400,137493105750,858370867200,3478575575475,22562891366400,94870242967500,637646929920000,2774954606799375
mov $1,$0
add $1,2
add $0,$1
lpb $1
mul $0,$1
sub $1,2
lpe
div $0,4
|
oeis/142/A142483.asm | neoneye/loda-programs | 11 | 20550 | ; A142483: Primes congruent to 11 mod 51.
; Submitted by <NAME>
; 11,113,317,419,521,827,929,1031,1439,1847,1949,2153,2357,2459,2663,2969,3581,3989,4091,4397,4703,5009,5417,5519,5927,6029,6131,6947,7151,7253,7457,7559,8069,8171,8273,8681,8783,9293,9497,9803,10007,10211,10313,11027,12149,12251,12659,13577,13679,13781,13883,14087,14699,15107,15413,15923,16127,16229,16433,16943,17351,17657,18269,18371,19289,19391,19697,20411,20717,20921,21023,21227,21737,21839,22247,22349,22859,22961,23063,23369,23879,23981,24083,24593,25307,25409,25919,26021,26633,27143,27449
mov $1,5
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,51
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,101
|
programs/oeis/076/A076618.asm | jmorken/loda | 1 | 81522 | <filename>programs/oeis/076/A076618.asm
; A076618: Least x>1 such that x^d == 1 (mod d) for each divisor d of n.
; 2,3,4,3,6,7,8,3,4,11,12,7,14,15,16,3,18,7,20,11,22,23,24,7,6,27,4,15,30,31,32,3,34,35,36,7,38,39,40,11,42,43,44,23,16,47,48,7,8,11,52,27,54,7,56,15,58,59,60,31,62,63,22,3,66,67,68,35,70,71,72,7,74,75,16,39
cal $0,7947 ; Largest squarefree number dividing n: the squarefree kernel of n, rad(n), radical of n.
mov $1,$0
add $1,1
|
_maps/obj50.asm | NatsumiFox/AMPS-Sonic-1-2005 | 2 | 172897 | <filename>_maps/obj50.asm
; ---------------------------------------------------------------------------
; Sprite mappings - Yadrin enemy (SYZ)
; ---------------------------------------------------------------------------
dc.w byte_F93A-Map_obj50, byte_F954-Map_obj50
dc.w byte_F96E-Map_obj50, byte_F988-Map_obj50
dc.w byte_F9A2-Map_obj50, byte_F9BC-Map_obj50
byte_F93A: dc.b 5
dc.b $F4, 8, 0, 0, $F4
dc.b $FC, $E, 0, 3, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $31, $FC
byte_F954: dc.b 5
dc.b $F4, 8, 0, $14, $F4
dc.b $FC, $E, 0, $17, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $31, $FC
byte_F96E: dc.b 5
dc.b $F4, 9, 0, $23, $F4
dc.b 4, $D, 0, $29, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $31, $FC
byte_F988: dc.b 5
dc.b $F4, 8, 0, 0, $F4
dc.b $FC, $E, 0, 3, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $37, $FC
byte_F9A2: dc.b 5
dc.b $F4, 8, 0, $14, $F4
dc.b $FC, $E, 0, $17, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $37, $FC
byte_F9BC: dc.b 5
dc.b $F4, 9, 0, $23, $F4
dc.b 4, $D, 0, $29, $EC
dc.b $EC, 4, 0, $F, $FC
dc.b $F4, 2, 0, $11, $C
dc.b 4, 9, 0, $37, $FC
even |
GitSync.applescript | futurelab/GitSync-applescript | 2 | 602 | --Imports:
property ScriptLoader : load script alias ((path to scripts folder from user domain as text) & "file:ScriptLoader.scpt") --prerequisite for loading .applescript files
property TextParser : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "text:TextParser.applescript"))
property ListModifier : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "list:ListModifier.applescript"))
property GitParser : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "git:GitParser.applescript"))
property GitAsserter : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "git:GitAsserter.applescript"))
property GitModifier : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "git:GitModifier.applescript"))
property GitUtil : my ScriptLoader's load(path to scripts folder from user domain, "git:GitUtil.applescript")
property XMLParser : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "xml:XMLParser.applescript"))
property ShellUtil : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "shell:ShellUtil.applescript"))
property KeychainParser : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "shell:KeychainParser.applescript"))
property FileParser : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "file:FileParser.applescript"))
property FileModifier : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "file:FileModifier.applescript"))
property FileAsserter : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "file:FileAsserter.applescript"))
property RegExpUtil : my ScriptLoader's load_script(alias ((path to scripts folder from user domain as text) & "regexp:RegExpUtil.applescript"))
--Properties:
property current_time : 0 --keeps track of the time passed, remember to reset this value pn every init
property the_interval : 60 --static value, increases the time by this value on every interval--TODO: rename to "frequncy" default is set to 60
property repo_list : null --Stores all values the in repositories.xml, remember to reset this value pn every init
property repo_file_path : ""
property options : {"keep local version", "keep remote version", "keep mix of both versions", "open local version", "open remote version", "open mix of both versions", "keep all local versions", "keep all remote versions", "keep all local and remote versions", "open all local versions", "open all remote versions", "open all mixed versions"}
set current_time to 0 --always reset this value on init, applescript has persistent values
initialize()
(*
* Initialize the app, toggles between debug and deploy mode depending fromwhich file type it is run from
*)
on initialize()
if (FileParser's file_name(path to me) = "GitSync.applescript") then --debug mode
set repo_file_path to FileParser's hfs_parent_path(path to me) & "repo.xml"
log repo_file_path
if (ShellUtil's wait_for_internet()) then handle_interval()
else --deploy mode
set repo_file_path to ((path to me) & "Contents" & ":" & "Resources" & ":" & "repo.xml") as text
if (FileAsserter's does_file_exist(repo_file_path) = false) then --if the xml is empty, add some static values to it
set the_repo_xml to my RepoUtil's repo_xml()
FileModifier's write_data(the_repo_xml, repo_file_path, false) --create the repo.xml file inside the GitSync.app
end if --else do nothing, the repo.xml already exists
end if
end initialize
(*
* This will be called on init and then every 60 seconds or the time you specifiy in the return value
* NOTE: this will only be called from an .app mode aka "deploy mode" / "production mode"
*)
on idle {}
if (ShellUtil's wait_for_internet()) then handle_interval()
return the_interval --the_interval --return new idle time in seconds
end idle
(*
* Handles the process of comitting and pushing for multiple repositories
* This is called on every interval
* NOTE: while testing you can call this manually, since idle will only work when you run it from an .app
*)
on handle_interval()
log "handle_interval()"
set repo_list to my RepoUtil's compile_repo_list(repo_file_path) --try to avoid calling this on every intervall, its nice to be able to update on the fly, be carefull though
set current_time_in_min to (current_time / 60) --divide the seconds by 60 seconds to get minutes
log "current_time_in_min: " & current_time_in_min
repeat with repo_item in repo_list --iterate over every repo item
if (current_time_in_min mod (interval of repo_item) = 0) then handle_commit_interval(repo_item, "master") --is true every time spesified by the user
if (current_time_in_min mod (interval of repo_item) = 0) then handle_push_interval(repo_item, "master") --is true every time spesified by the user
end repeat
set current_time to current_time + the_interval --increment the interval (in seconds)
end handle_interval
(*
* Handles the process of making a commit for a single repository
*)
on handle_commit_interval(repo_item, branch)
log "GitSync's handle_commit_interval() a repo with remote path: " & (remote_path of repo_item) & " local path: " & (local_path of repo_item)
if (GitAsserter's has_unmerged_paths(local_path of repo_item)) then --Asserts if there are unmerged paths that needs resolvment
log tab & "has unmerged paths to resolve"
my MergeUtil's resolve_merge_conflicts(local_path of repo_item, branch, GitParser's unmerged_files(local_path of repo_item)) --Asserts if there are unmerged paths that needs resolvment
end if
log do_commit(local_path of repo_item) --if there were no commits false will be returned
--log "has_commited: " & has_commited
end handle_commit_interval
(*
* Handles the process of making a push for a single repository
* NOTE: We must always merge the remote branch into the local branch before we push our changes.
* NOTE: this method performs a "manual pull" on every interval
* TODO: contemplate implimenting a fetch call after the pull call, to update the status, whats the diff between git fetch and git remote update again?
*)
on handle_push_interval(repo_item, branch)
log ("GitSync's handle_push_interval()")
my MergeUtil's manual_merge((local_path of repo_item), (remote_path of repo_item), branch) --commits, merges with promts, (this method also test if a merge is needed or not, and skips it if needed)
set has_local_commits to GitAsserter's has_local_commits((local_path of repo_item), branch) --TODO: maybe use GitAsserter's is_local_branch_ahead instead of this line
if (has_local_commits) then --only push if there are commits to be pushed, hence the has_commited flag, we check if there are commits to be pushed, so we dont uneccacerly push if there are no local commits to be pushed, we may set the commit interval and push interval differently so commits may stack up until its ready to be pushed, read more about this in the projects own FAQ
set the_keychain_item_name to (keychain_item_name of repo_item)
log "the_keychain_item_name: " & the_keychain_item_name
set keychain_data to KeychainParser's keychain_data(keychain_item_name of repo_item)
set keychain_password to the_password of keychain_data
log "keychain_password: " & keychain_password
set remote_account_name to account_name of keychain_data
log "remote_account_name: " & remote_account_name
set push_call_back to GitModifier's push(local_path of repo_item, remote_path of repo_item, remote_account_name, keychain_password, branch)
log "push_call_back: " & push_call_back
end if
end handle_push_interval
(*
* This method generates a git status list,and asserts if a commit is due, and if so, compiles a commit message and then tries to commit
* Returns true if a commit was made, false if no commit was made or an error occured
* NOTE: checks git staus, then adds changes to the index, then compiles a commit message, then commits the changes, and is now ready for a push
* NOTE: only commits if there is something to commit
* TODO: add branch parameter to this call
* NOTE: this a purly local method, does not need to communicate with remote servers etc..
*)
on do_commit(local_repo_path)
log ("GitSync's do_commit()")
--log "do_commit"
set status_list to my StatusUtil's generate_status_list(local_repo_path) --get current status
if (length of status_list > 0) then
log tab & "there is something to add or commit"
--log tab & "length of status_list: " & (length of status_list)
my StatusUtil's process_status_list(local_repo_path, status_list) --process current status by adding files, now the status has changed, some files may have disapared, some files now have status as renamed that prev was set for adding and del
set commit_msg_title to my CommitUtil's sequence_commit_msg_title(status_list) --sequence commit msg title for the commit
log tab & "commit_msg_title: " & commit_msg_title
set commit_msg_desc to my DescUtil's sequence_description(status_list) --sequence commit msg description for the commit
log tab & "commit_msg_desc: " & commit_msg_desc
try --try to make a git commit
set commit_result to GitModifier's commit(local_repo_path, commit_msg_title, commit_msg_desc) --commit
log tab & "commit_result: " & commit_result
on error errMsg
log tab & "----------------ERROR:-----------------" & errMsg
end try
return true --return true to indicate that the commit completed
else
log tab & "nothing to add or commit"
return false --break the flow since there is nothing to commit or process
end if
end do_commit
(*
* Utility methods for parsing the the "git status message"
*)
script CommitUtil
(*
* Returns a a text "commit message title" derived from @param status_list
* @param status_list: a list with records that contain staus type, file name and state
* NOTE: C,I,R seems to never be triggered, COPIED,IGNORED,REMOVED,
* NOTE: In place of Renamed, Git first deletes the file then says its untracked
*)
on sequence_commit_msg_title(status_list)
set num_of_new_files to 0
set num_of_modified_files to 0
set num_of_deleted_files to 0
set num_of_renamed_files to 0
repeat with status_item in status_list
set cmd to cmd of status_item --TODO: rename to type or status_type
if (cmd = "M") then
set num_of_modified_files to num_of_modified_files + 1
else if (cmd = "D") then
set num_of_deleted_files to num_of_deleted_files + 1
else if (cmd = "A") then
set num_of_new_files to num_of_new_files + 1
else if (cmd = "R") then --This command seems to never be triggered in git
set num_of_renamed_files to num_of_renamed_files + 1
else if (cmd = "??") then --untracked files,
set num_of_new_files to num_of_new_files + 1
else if (cmd = "UU") then --unmerged files,
set num_of_modified_files to num_of_modified_files + 1
end if
end repeat
set commit_msg to ""
if (num_of_new_files > 0) then
set commit_msg to commit_msg & "New files added: " & num_of_new_files
end if
if (num_of_modified_files > 0) then
if (length of commit_msg > 0) then set commit_msg to commit_msg & ", " --append comma
set commit_msg to commit_msg & "Files modified: " & num_of_modified_files
end if
if (num_of_deleted_files > 0) then
if (length of commit_msg > 0) then set commit_msg to commit_msg & ", " --append comma
set commit_msg to commit_msg & "Files deleted: " & num_of_deleted_files
end if
if (num_of_renamed_files > 0) then
if (length of commit_msg > 0) then set commit_msg to commit_msg & ", " --append comma
set commit_msg to commit_msg & "Files renamed: " & num_of_renamed_files
end if
return commit_msg
end sequence_commit_msg_title
end script
(*
* Utility methods for generating the "Git Commit Message Description"
*)
script DescUtil
(*
* Returns a "Git Commit Message Description" derived from a "git status list" with "status items records"
*)
on sequence_description(status_list)
set desc_text to ""
set modified_items to {}
set deleted_items to {}
set added_items to {}
repeat with status_item in status_list
if (cmd of status_item is "D") then set deleted_items to ListModifier's add_list(deleted_items, status_item) --add a record to a list
if (cmd of status_item is "M") then set modified_items to ListModifier's add_list(modified_items, status_item) --add a record to a list
if (cmd of status_item is "??") then set added_items to ListModifier's add_list(added_items, status_item) --add a record to a list
if (cmd of status_item is "UU") then set modified_items to ListModifier's add_list(modified_items, status_item) --add a record to a list
end repeat
set desc_text to desc_text & description_paragraph(added_items, "Added ") & return --add an extra line break at the end "paragraph like"
set desc_text to desc_text & description_paragraph(deleted_items, "Deleted ") & return
set desc_text to desc_text & description_paragraph(modified_items, "Modified ")
return desc_text
end sequence_description
(*
* Returns a paragraph with a detailed description for Deleted, added and modified files
*)
on description_paragraph(the_list, prefix_text)
set desc_text to ""
if (length of the_list > 0) then
set the_suffix to " file"
if (length of the_list > 1) then set the_suffix to the_suffix & "s" --multiple
set desc_text to desc_text & prefix_text & length of the_list & the_suffix & ":" & return
repeat with the_item in the_list
set desc_text to desc_text & (file_name of the_item) & return
end repeat
end if
return desc_text
end description_paragraph
end script
(*
* Utils for paraing the git status list
*)
script StatusUtil
(*
* Returns a descriptive status list of the current git changes
* NOTE: you may use short staus, but you must interpret the message if the state has an empty space infront of it
*)
on generate_status_list(local_repo_path)
set the_status to GitParser's status(local_repo_path, "-s") -- the -s stands for short message, and returns a short version of the status message, the short stauslist is used because it is easier to parse than the long status list
--log tab & "the_status: " & the_status
set the_status_list to TextParser's every_paragraph(the_status) --store each line as items in a list
set transformed_list to {}
if (length of the_status_list > 0) then
set transformed_list to my transform_status_list(the_status_list)
else
--log "nothing to commit, working directory clean" --this is the status msg if there has happened nothing new since last, but also if you have commits that are ready for push to origin
end if
--log "len of the_status_list: " & (length of the_status_list)
--log transformed_list
return transformed_list
end generate_status_list
(*
* Transforms the "compact git status list" by adding more context to each item (a list with associative lists, aka records)
* Returns a list with records that contain staus type, file name and state
* NOTE: the short status msg format is like: "M" " M", "A", " A", "R", " R" etc
* NOTE: the space infront of the capetalized char indicates Changes not staged for commit:
* NOTE: Returns = renamed, M = modified, A = addedto index, D = deleted, ?? = untracked file
* NOTE: the state can be: "Changes not staged for commit" , "Untracked files" , "Changes to be committed"
* @Param: the_status_list is a list with status messages like: {"?? test.txt"," M index.html","A home.html"}
* NOTE: can also be "UU" unmerged paths
*)
on transform_status_list(the_status_list)
set transformed_list to {}
repeat with the_status_item in the_status_list
--log "the_status_item: " & the_status_item
set the_status_parts to RegExpUtil's match(the_status_item, "^( )*([MARDU?]{1,2}) (.+)$") --returns 3 capturing groups,
--log "length of the_status_parts: " & (length of the_status_parts)
--log the_status_parts
if ((second item in the_status_parts) = " ") then --aka " M", remember that the second item is the first capturing group
set cmd to third item in the_status_parts --Changes not staged for commit:
set state to "Changes not staged for commit" -- you need to add them
else -- Changes to be committed--aka "M " or "??" or "UU"
set cmd to third item in the_status_parts --rename cmd to type
--log "cmd: " & cmd
if (cmd = "??") then
set state to "Untracked files"
else if (cmd = "UU") then --Unmerged path
--log "Unmerged path"
set state to "Unmerged path"
else
set state to "Changes to be committed" --this is when the file is ready to be commited
end if
end if
set file_name to the fourth item in the_status_parts
--log "state: " & state & ", cmd: " & cmd & ", file_name: " & file_name --logs the file named added changed etc
set status_item to {state:state, cmd:cmd, file_name:file_name} --store the individual parts in an accociative
set transformed_list to ListModifier's add_list(transformed_list, status_item) --add a record to a list
end repeat
return transformed_list
end transform_status_list
(*
* Iterates over the status items and "git add" the item unless it's already added (aka "staged for commit")
* NOTE: if the status list is empty then there is nothing to process
* NOTE: even if a file is removed, its status needs to be added to the next commit
* TODO: Squash some of the states together with if or or or etc
*)
on process_status_list(local_repo_path, status_list)
--log "process_status_list()"
repeat with status_item in status_list
--log "len of status_item: " & (length of status_item)
set state to state of status_item
--set cmd to cmd of status_item
set file_name to file_name of status_item
if state = "Untracked files" then --this is when there exists a new file
log tab & "1. " & "Untracked files"
GitModifier's add(local_repo_path, file_name) --add the file to the next commit
else if state = "Changes not staged for commit" then --this is when you have not added a file that has changed to the next commit
log tab & "2. " & "Changes not staged for commit"
GitModifier's add(local_repo_path, file_name) --add the file to the next commit
else if state = "Changes to be committed" then --this is when you have added a file to the next commit, but not commited it
log tab & "3. " & "Changes to be committed" --do nothing here
else if state = "Unmerged path" then --This is when you have files that have to be resolved first, but eventually added aswell
log tab & "4. " & "Unmerged path"
GitModifier's add(local_repo_path, file_name) --add the file to the next commit
end if
end repeat
end process_status_list
end script
(*
* Utility methods for parsing the repository.xml file
*)
script RepoUtil
(*
* Returns a list with repo values derived from an XML file
* @param file_path is in HSF not POSIX
* TODO: if the interval values is not set, then use default values
* TODO: test if the full/partly file path still works?
*)
on compile_repo_list(file_path) -- rename to generate_repo_list?
--log "file_path: " & file_path
set theXMLRoot to XMLParser's root(file_path)
set num_children to length of XMLParser's every_element(theXMLRoot) --number of xml children in xml root element
set the_repo_list to {}
repeat with i from 1 to num_children
set theXMLChild to XMLParser's element_at(theXMLRoot, i)
set local_path to XMLParser's attribute_value_by_name(theXMLChild, "local-path") --this is the path to the local repository (we need to be in this path to execute git commands on this repo)
set local_path to do shell script "echo " & quoted form of local_path & " | sed 's/ /\\\\ /g'" --Shell doesnt handle file paths with space chars very well. So all space chars are replaced with a backslash and space, so that shell can read the paths.
set remote_path to XMLParser's attribute_value_by_name(theXMLChild, "remote-path")
set is_full_url to RegExpUtil's has_match(remote_path, "^https://.+$") --support for partial and full url
if is_full_url = true then
set remote_path to text 9 thru (length of remote_path) of remote_path --strip away the https://, since this will be added later
end if
--log remote_path
set keychain_item_name to XMLParser's attribute_value_by_name(theXMLChild, "keychain-item-name")
--set commit_int to XMLParser's attribute_value_by_name(theXMLChild, "commit-interval-in-minutes") --defualt is 5min
--set push_int to XMLParser's attribute_value_by_name(theXMLChild, "push-interval-in-minutes") --defualt is 10min
--set pull_int to XMLParser's attribute_value_by_name(theXMLChild, "pull-interval-in-minutes") --default is 30min
set interval to XMLParser's attribute_value_by_name(theXMLChild, "interval") --default is 30min
--set remote_account_name to XMLParser's attribute_value_by_name(theXMLChild, "remote-account-name")
--TODO: use only 1 interval
set key_value_pairs to {local_path:local_path, remote_path:remote_path, keychain_item_name:keychain_item_name, interval:interval} --remote_account_name:remote_account_name,commit_int:commit_int, push_int:push_int--TODO: shouldnt the line bellow be sudo acociative list? or does the record style list work as is?, if you dont need to iterate over the values, you may use record
set the_repo_list to ListModifier's add_list(the_repo_list, key_value_pairs)
end repeat
return the_repo_list
end compile_repo_list
(*
* Returns xml data, for the debug mode
* NOTE: the purpose of this method is to make compiling the .app easier, with this method you can insert some working repos into the repo.xml file inside the GitSync.app
*)
on repo_xml()
set the_repo_xml to "<repositories>" & return --beginning
set the_repo_xml to the_repo_xml & tab & "<repository local-path=\"~/_projects/_code/_active/applescript/GitSync\" remote-path=\"https://github.com/eonist/GitSync.git\" interval=\"1\" keychain-item-name=\"github\"/>" & return
set the_repo_xml to the_repo_xml & tab & "<repository local-path=\"~/_projects/_code/_active/applescript/SqliteEdit/repo\" remote-path=\"github.com/eonist/SqliteEdit.git\" interval=\"1\" keychain-item-name=\"github\"/>" & return
set the_repo_xml to the_repo_xml & tab & "<repository local-path=\"~/Library/Scripts\" remote-path=\"github.com/eonist/applescripts.git\" interval=\"1\" keychain-item-name=\"github\"/>" & return
set the_repo_xml to the_repo_xml & tab & "<repository local-path=\"~/Documents/wiki/GitSync.wiki\" remote-path=\"github.com/eonist/GitSync.wiki\" interval=\"1\" keychain-item-name=\"github\"/>" & return
set the_repo_xml to the_repo_xml & "</repositories>" --end
return the_repo_xml
end repo_xml
end script
--Utility methods for merging branches
script MergeUtil
(*
* Manual merge
* NOTE: tries to merge a remote branch into a local branch
* NOTE: prompts the users if a merge conflicts occure
* TODO: we should use two branch params here since its entirly possible to merge from a different remote branch
*)
on manual_merge(local_path, remote_path, branch)
--log "manual_merge"
log ("MergeUtil's manual_merge()")
if (GitAsserter's has_unmerged_paths(local_path)) then --Asserts if there are unmerged paths that needs resolvment
log tab & "has unmerged paths to resolve"
my MergeUtil's resolve_merge_conflicts(local_path, branch, GitParser's unmerged_files(local_path)) --Asserts if there are unmerged paths that needs resolvment
end if
do_commit(local_path) --its best practice to always commit any uncommited files before you attempt to pull.
try
--log "try"
GitUtil's manual_pull(local_path, remote_path, branch) --manual clone down files
on error errMsg --merge conflicts
log tab & "error: " & errMsg
set unmerged_files to GitParser's unmerged_files(local_path) --compile a list of conflicting files somehow
--log unmerged_files
resolve_merge_conflicts(local_path, branch, unmerged_files) --promt user, merge conflicts occured, resolve by a list of options, title: conflict in file text.txt: use local, use remote, use a mix (opens it up in textedit), use all local, use all remote, use all mix
do_commit(local_path) --add,commit if any files has an altered status
end try
end manual_merge
(*
* Promts the user with a list of options to aid in resolving merge conflicts
* @param branch: the branch you tried to merge into
*)
on resolve_merge_conflicts(local_repo_path, branch, unmerged_files)
--log "resolve_merge_conflicts()"
log ("MergeUtil's resolve_merge_conflicts()")
repeat with unmerged_file in unmerged_files
set last_selected_action to first item in options --you may want to make this a "property" to store the last item more permenantly
set the_action to choose from list options with title "Resolve merge conflict in:" with prompt unmerged_file & ":" default items {last_selected_action} cancel button name "Exit" --promt user with list of options, title: Merge conflict in: unmerged_file
handle_merge_conflict_dialog(the_action, unmerged_file, local_repo_path, branch, unmerged_files)
end repeat
end resolve_merge_conflicts
(*
* Handles the choice made in the merge conflict dialog
* TODO: test the open file clauses
*)
on handle_merge_conflict_dialog(the_action, unmerged_file, local_repo_path, branch, unmerged_files)
--log "handle_merge_conflict_dialog()"
log ("MergeUtil's handle_merge_conflict_dialog(): " & (item 1 of the_action))
if the_action is false then --exit
--error number -128 -- User canceled
--TODO: do the git merge --abort here to revert to the state you were in before the merge attempt, you may also want to display a dialog to informnthe user in which state the files are now.
else
set selected_item to item 1 of the_action
set last_selected_action to selected_item
if selected_item is item 1 of options then --keep local version
GitModifier's check_out(local_repo_path, "--ours", unmerged_file)
else if selected_item is item 2 of options then --keep remote version
GitModifier's check_out(local_repo_path, "--theirs", unmerged_file)
else if selected_item is item 3 of options then --keep mix of both versions
GitModifier's check_out(local_repo_path, branch, unmerged_file)
else if selected_item is item 4 of options then --open local version
GitModifier's check_out(local_repo_path, "--ours", unmerged_file)
FileUtil's open_file(local_repo_path & unmerged_file)
else if selected_item is item 5 of options then --open remote version
GitModifier's check_out(local_repo_path, "--theirs", unmerged_file)
FileUtil's open_file(local_repo_path & unmerged_file)
else if selected_item is item 6 of options then --open mix of both versions
GitModifier's check_out(local_repo_path, branch, unmerged_file)
FileUtil's open_file(local_repo_path & unmerged_file)
else if selected_item is item 7 of options then --keep all local versions
GitModifier's check_out(local_repo_path, "--ours", "*")
else if selected_item is item 8 of options then --keep all remote versions
GitModifier's check_out(local_repo_path, "--theirs", "*")
else if selected_item is item 9 of options then --keep all local and remote versions
GitModifier's check_out(local_repo_path, branch, "*")
else if selected_item is item 10 of options then --open all local versions
GitModifier's check_out(local_repo_path, "--ours", "*")
FileUtil's open_files(FileParser's full_hsf_paths(local_repo_path, unmerged_files))
else if selected_item is item 11 of options then --open all remote versions
GitModifier's check_out(local_repo_path, "--theirs", "*")
FileUtil's open_files(FileParser's full_hsf_paths(local_repo_path, unmerged_files))
else if selected_item is item 12 of options then --open all mixed versions
GitModifier's check_out(local_repo_path, branch, "*")
FileUtil's open_files(FileParser's full_hsf_paths(local_repo_path, unmerged_files))
end if
end if
end handle_merge_conflict_dialog
end script
|
boot.asm | lesmiskin/os | 0 | 16010 | ; Source: pg 12
mov ah, 0x0e ; scrolling teletype BIOS routine.
mov al, 'H'
int 0x10
mov al, 'e'
int 0x10
mov al, 'l'
int 0x10
mov al, 'l'
int 0x10
mov al, 'o'
int 0x10
jmp $ ; make loop(?)
; Padding and magic number for boot recognition
times 510-($-$$) db 0 ; pad to 510 bytes
dw 0xaa55 ; our magic number!
;db 0xaa,0x55 ; our magic number!
;db 0x55 ; our magic number!
|
Projetos/I-VM/bin/nasm/SimpleGt.nasm | mariaeduardabicalho/Z01 | 2 | 243141 | ; 0 - GT
leaw $SP,%A
movw (%A),%D
decw %D
movw %D,(%A)
movw (%A),%A
movw (%A),%D
leaw $SP,%A
subw (%A),$1,%A
subw (%A),%D,%D
leaw $GTscripts/../src/vmExamples/SimpleGt0,%A
jg %D
nop
leaw $SP,%A
subw (%A),$1,%A
movw $0,(%A)
leaw $GT2scripts/../src/vmExamples/SimpleGt0,%A
jmp
nop
GTscripts/../src/vmExamples/SimpleGt0:
leaw $SP,%A
subw (%A),$1,%A
movw $-1,(%A)
GT2scripts/../src/vmExamples/SimpleGt0:
; End
|
src/Native/Runtime/amd64/UniversalTransition.asm | ZZHGit/corert | 0 | 160036 | <reponame>ZZHGit/corert
;;
;; Copyright (c) Microsoft. All rights reserved.
;; Licensed under the MIT license. See LICENSE file in the project root for full license information.
;;
include AsmMacros.inc
ifdef FEATURE_DYNAMIC_CODE
ifdef _DEBUG
TRASH_SAVED_ARGUMENT_REGISTERS equ 1
else
TRASH_SAVED_ARGUMENT_REGISTERS equ 0
endif
if TRASH_SAVED_ARGUMENT_REGISTERS ne 0
EXTERN RhpIntegerTrashValues : QWORD
EXTERN RhpFpTrashValues : QWORD
endif ;; TRASH_SAVED_ARGUMENT_REGISTERS
SIZEOF_RETADDR equ 8h
SIZEOF_ALIGNMENT_PADDING equ 8h
SIZEOF_RETURN_BLOCK equ 10h ; for 16 bytes of conservatively reported space that the callee can
; use to manage the return value that the call eventually generates
SIZEOF_FP_REGS equ 40h ; xmm0-3
SIZEOF_OUT_REG_HOMES equ 20h ; Callee register spill
;
; From CallerSP to ChildSP, the stack frame is composed of the following adjacent regions:
;
; SIZEOF_RETADDR
; SIZEOF_ALIGNMENT_PADDING
; SIZEOF_RETURN_BLOCK
; SIZEOF_FP_REGS
; SIZEOF_OUT_REG_HOMES
;
DISTANCE_FROM_CHILDSP_TO_FP_REGS equ SIZEOF_OUT_REG_HOMES
DISTANCE_FROM_CHILDSP_TO_RETURN_BLOCK equ DISTANCE_FROM_CHILDSP_TO_FP_REGS + SIZEOF_FP_REGS
DISTANCE_FROM_CHILDSP_TO_RETADDR equ DISTANCE_FROM_CHILDSP_TO_RETURN_BLOCK + SIZEOF_RETURN_BLOCK + SIZEOF_ALIGNMENT_PADDING
DISTANCE_FROM_CHILDSP_TO_CALLERSP equ DISTANCE_FROM_CHILDSP_TO_RETADDR + SIZEOF_RETADDR
.errnz DISTANCE_FROM_CHILDSP_TO_CALLERSP mod 16
;;
;; Defines an assembly thunk used to make a transition from managed code to a callee,
;; then (based on the return value from the callee), either returning or jumping to
;; a new location while preserving the input arguments. The usage of this thunk also
;; ensures arguments passed are properly reported.
;;
;; TODO: This code currently only tailcalls, and does not return.
;;
;; Inputs:
;; rcx, rdx, r8, r9, stack space: arguments as normal
;; r10: The location of the target code the UniversalTransition thunk will call
;; r11: The only parameter to the target function (passed in rdx to callee)
;;
;
; Frame layout is:
;
; {StackPassedArgs} ChildSP+0a0 CallerSP+020
; {IntArgRegs (rcx,rdx,r8,r9) (0x20 bytes)} ChildSP+080 CallerSP+000
; {CallerRetaddr} ChildSP+078 CallerSP-008
; {AlignmentPad (0x8 bytes)} ChildSP+070 CallerSP-010
; {ReturnBlock (0x10 bytes)} ChildSP+060 CallerSP-020
; {FpArgRegs (xmm0-xmm3) (0x40 bytes)} ChildSP+020 CallerSP-060
; {CalleeArgumentHomes (0x20 bytes)} ChildSP+000 CallerSP-080
; {CalleeRetaddr} ChildSP-008 CallerSP-088
;
; NOTE: If the frame layout ever changes, the C++ UniversalTransitionStackFrame structure
; must be updated as well.
;
; NOTE: The callee receives a pointer to the base of the ReturnBlock, and the callee has
; knowledge of the exact layout of all pieces of the frame that lie at or above the pushed
; FpArgRegs.
;
; NOTE: The stack walker guarantees that conservative GC reporting will be applied to
; everything between the base of the ReturnBlock and the top of the StackPassedArgs.
;
NESTED_ENTRY RhpUniversalTransition, _TEXT
alloc_stack DISTANCE_FROM_CHILDSP_TO_RETADDR
save_reg_postrsp rcx, 0h + DISTANCE_FROM_CHILDSP_TO_CALLERSP
save_reg_postrsp rdx, 8h + DISTANCE_FROM_CHILDSP_TO_CALLERSP
save_reg_postrsp r8, 10h + DISTANCE_FROM_CHILDSP_TO_CALLERSP
save_reg_postrsp r9, 18h + DISTANCE_FROM_CHILDSP_TO_CALLERSP
save_xmm128_postrsp xmm0, DISTANCE_FROM_CHILDSP_TO_FP_REGS
save_xmm128_postrsp xmm1, DISTANCE_FROM_CHILDSP_TO_FP_REGS + 10h
save_xmm128_postrsp xmm2, DISTANCE_FROM_CHILDSP_TO_FP_REGS + 20h
save_xmm128_postrsp xmm3, DISTANCE_FROM_CHILDSP_TO_FP_REGS + 30h
END_PROLOGUE
if TRASH_SAVED_ARGUMENT_REGISTERS ne 0
; Before calling out, trash all of the argument registers except the ones (rcx, rdx) that
; hold outgoing arguments. All of these registers have been saved to the transition
; frame, and the code at the call target is required to use only the transition frame
; copies when dispatching this call to the eventual callee.
movsd xmm0, mmword ptr [RhpFpTrashValues + 0h]
movsd xmm1, mmword ptr [RhpFpTrashValues + 8h]
movsd xmm2, mmword ptr [RhpFpTrashValues + 10h]
movsd xmm3, mmword ptr [RhpFpTrashValues + 18h]
mov r8, qword ptr [RhpIntegerTrashValues + 10h]
mov r9, qword ptr [RhpIntegerTrashValues + 18h]
endif ; TRASH_SAVED_ARGUMENT_REGISTERS
;
; Call out to the target, while storing and reporting arguments to the GC.
;
mov rdx, r11
lea rcx, [rsp + DISTANCE_FROM_CHILDSP_TO_RETURN_BLOCK]
call r10
LABELED_RETURN_ADDRESS ReturnFromUniversalTransition
; restore fp argument registers
movdqa xmm0, [rsp + DISTANCE_FROM_CHILDSP_TO_FP_REGS ]
movdqa xmm1, [rsp + DISTANCE_FROM_CHILDSP_TO_FP_REGS + 10h]
movdqa xmm2, [rsp + DISTANCE_FROM_CHILDSP_TO_FP_REGS + 20h]
movdqa xmm3, [rsp + DISTANCE_FROM_CHILDSP_TO_FP_REGS + 30h]
; restore integer argument registers
mov rcx, [rsp + 0h + DISTANCE_FROM_CHILDSP_TO_CALLERSP]
mov rdx, [rsp + 8h + DISTANCE_FROM_CHILDSP_TO_CALLERSP]
mov r8, [rsp + 10h + DISTANCE_FROM_CHILDSP_TO_CALLERSP]
mov r9, [rsp + 18h + DISTANCE_FROM_CHILDSP_TO_CALLERSP]
; epilog
nop
; Pop the space that was allocated between the ChildSP and the caller return address.
add rsp, DISTANCE_FROM_CHILDSP_TO_RETADDR
TAILJMP_RAX
NESTED_END RhpUniversalTransition, _TEXT
endif
end
|
impl/reika-j/src/main/java/me/at15/reika/compiler/parser/Reika.g4 | at15/reika | 0 | 4440 | <reponame>at15/reika<filename>impl/reika-j/src/main/java/me/at15/reika/compiler/parser/Reika.g4<gh_stars>0
grammar Reika;
// parser start
prog
: (term ';' | func)+
;
constant
: BOOL # ConsBool
| sign='-'? INT # ConsInt
| sign='-'? DOUBLE # ConsDouble
;
// TODO: merge builtin types?
type
: 'Int' # TypeInt
| 'Double' # TypeDouble
| 'Bool' # TypeBool
| 'List' # TypeList
| type '[' type ']' # TypeGeneric
;
typedId
: ID ':' type
;
// TODO: optionalType: (':' type)? it is used in both var and function
term
: constant # TmCons
| ID # TmVar
| op=('-'|'!') term # TmUnary
| term op=('*'|'/'|'%') term # TmBinary
| term op=('+'|'-') term # TmBinary
| 'val' ID (':' type)? '=' term # TmVal
| '(' term ')' # TmBrackets
| '[' term (',' term)* ']' # TmList
| ID '(' term (',' term )* ')' # TmApp // TODO: can we remove the brackets?
;
func
: 'func' ID '(' typedId (',' typedId)* ')' (':' type)? '{' (term ';')* '}'
;
// parser end
// lexer start
BOOL
: 'true'
| 'false'
;
INT
: '0'
| [1-9] DIGIT*
;
DOUBLE
: DIGIT+ '.' DIGIT+
;
ID
: [a-z] ID_LETTER*
;
//TYPE
// : [A-Z] ID_LETTER*
// ;
fragment DIGIT
: [0-9]
;
fragment ID_LETTER
: [a-z]
| [A-Z]
| '_'
;
WS : [ \t\n\r]+ -> skip;
BLOCK_COMMENT : '/*' .*? '*/' -> skip;
SINGLE_COMMENT : '//' .*? '\n' -> skip;
// lexer end |
src/Categories/2-Functor.agda | Trebor-Huang/agda-categories | 279 | 4711 | <filename>src/Categories/2-Functor.agda
{-# OPTIONS --without-K --safe #-}
module Categories.2-Functor where
open import Level
open import Categories.Category.Monoidal.Instance.StrictCats using (module Product)
open import Categories.2-Category using (2-Category)
open import Categories.Enriched.Functor using (Functor)
2-Functor : ∀ {o ℓ e c d} →
2-Category o ℓ e c → 2-Category o ℓ e d → Set (o ⊔ ℓ ⊔ e ⊔ c ⊔ d)
2-Functor C D = Functor (Product.Cats-Monoidal) C D
|
software/sdrom3/sddos3.asm | AtomicRoland/AtomFpga | 25 | 8148 | <reponame>AtomicRoland/AtomFpga<gh_stars>10-100
.segment "CODE"
.include "math-lib.inc"
.include "atmmcdef.inc"
.include "macros.inc"
.include "int.inc"
.include "sd.inc"
.segment "LAST"
RTS
|
asm/save.ext.asm | RockmanEXEZone/MMBN45-English-Translation | 6 | 85466 | <gh_stars>1-10
.align 2
save_setLastRtcTime:
push r0,r4-r5
ldr r5,=0x2003D40
// Copy the time
ldr r4,=0x8006145
mov r14,r15
bx r4
strb r0,[r5,0xC]
add r4,(0x800614B-0x8006145)
mov r14,r15
bx r4
strb r0,[r5,0xD]
add r4,(0x8006151-0x800614B)
mov r14,r15
bx r4
strb r0,[r5,0xE]
add r4,(0x800615D-0x8006151)
mov r14,r15
bx r4
strb r0,[r5,0xF]
add r4,(0x8006171-0x800615D)
mov r14,r15
bx r4
strb r0,[r5,0x10]
sub r4,(0x8006171-0x8006157)
mov r14,r15
bx r4
strb r0,[r5,0x11]
pop r0,r4-r5
mov r1,r10
ldr r1,[r1,0x44]
add r1,0x54
mov r2,0x14
ldr r3,=0x804AB45
bx r3
.align 2
save_checkSaveString:
push r4-r7,r14
// Load and set build version in save file
ldr r1,=0x2003C80
ldr r2,[@buildVersion]
ldr r0,[r1]
str r2,[r1]
cmp r0,r2
beq @@checkSaveString
// Force map reload if build version does not match
mov r1,r10
ldr r1,[r1,0x40]
mov r0,0x0
str r0,[r1,0x34]
@@checkSaveString:
// Check English save string
ldr r0,=0x804ABA0
bl @compareSaveString
tst r0,r0
beq @@valid
// Check Japanese save string
add r0,=@jpSaveString
bl @compareSaveString
tst r0,r0
bne @@invalid
// Perform save conversion
// Clear last valid time/date
ldr r1,=0x2003D40
mov r0,0x0
strb r0,[r1,0xC] // year
mov r0,0x1
strb r0,[r1,0xD] // month
strb r0,[r1,0xE] // day
mov r0,0x0
strb r0,[r1,0xF] // hour
strb r0,[r1,0x10] // minute
mov r0,0x6
strb r0,[r1,0x11] // weekday
// Clear multiplayer opponent/chip counts
ldr r0,=0x2000A50
ldr r1,=0x280
.if VAR_JP
ldr r2,=0x800092D // memclear(dst, size), multiple of 0x20
mov r14,r2
bl r14
.else
bl 0x800092C
.endif
// Clear player strings + schedule
ldr r0,=0x2000E50
ldr r1,=0x2380
.if VAR_JP
ldr r2,=0x800092D
mov r14,r2
bl r14
.else
bl 0x800092C
.endif
// Re-initialize player strings
.if VAR_JP
ldr r0,=0x8035D81
mov r14,r0
bl r14
.else
bl 0x8035D80
.endif
// Re-initialize schedule
.if VAR_JP
ldr r0,=0x803678D
mov r14,r0
bl r14
.else
bl 0x803678C
.endif
// Truncate player name
ldr r1,=0x2000E50
mov r0,0xE5
strb r0,[r1,0x1]
// Reset multiplayer battle/win counts
mov r1,r10
ldr r1,[r1,0x44]
mov r0,0x0
str r0,[r1,0x1C] // stores 2 halfwords
// Correct most used chip names, remove unrecognized ones
ldr r4,=0x2000CD0
mov r5,0xC
@@loop:
ldr r0,[r4]
tst r0,r0
beq @@next
add r0,r4,0x4
bl @chipNameToID
tst r0,r0
beq @@clear
@@updateName:
// Get name for chip
.if VAR_JP
ldr r1,=0x803864D
mov r14,r1
bl r14
.else
bl 0x803864C
.endif
tst r0,r0
beq @@clear
mov r6,r0
// Clear old name
mov r0,0x0
str r0,[r4,0x4]
str r0,[r4,0x8]
str r0,[r4,0xC]
str r0,[r4,0x10]
str r0,[r4,0x14]
str r0,[r4,0x18]
str r0,[r4,0x1C]
// Copy new name
mov r0,r6
add r1,r4,0x4
.if VAR_JP
ldr r2,=0x8032AC7
mov r14,r2
bl r14
.else
bl 0x8032AC6
.endif
b @@next
@@clear:
str r0,[r4,0x0]
str r0,[r4,0x4]
str r0,[r4,0x8]
str r0,[r4,0xC]
str r0,[r4,0x10]
str r0,[r4,0x14]
str r0,[r4,0x18]
str r0,[r4,0x1C]
@@next:
add r4,0x20
sub r5,0x1
bgt @@loop
// Sort most used chip lists
// Sort Standard
ldr r0,=0x2000CD0
.if VAR_JP
ldr r1,=0x803885B
mov r14,r1
bl r14
.else
bl 0x803885A
.endif
// Sort Mega
ldr r0,=0x2000D50
.if VAR_JP
ldr r1,=0x803885B
mov r14,r1
bl r14
.else
bl 0x803885A
.endif
// Sort Giga
ldr r0,=0x2000DD0
.if VAR_JP
ldr r1,=0x803885B
mov r14,r1
bl r14
.else
bl 0x803885A
.endif
// Update most used chip names
// Fav Standard 1
mov r0,0x5
mov r1,0x0
mov r2,0x0
.if VAR_JP
ldr r3,=0x80389D9
mov r14,r3
bl r14
.else
bl 0x80389D8
.endif
// Fav Standard 2
mov r0,0x6
mov r1,0x1
mov r2,0x0
.if VAR_JP
ldr r3,=0x80389D9
mov r14,r3
bl r14
.else
bl 0x80389D8
.endif
// Fav Standard 3
mov r0,0x7
mov r1,0x2
mov r2,0x0
.if VAR_JP
ldr r3,=0x80389D9
mov r14,r3
bl r14
.else
bl 0x80389D8
.endif
// Fav Mega
mov r0,0x8
mov r1,0x0
mov r2,0x0
.if VAR_JP
ldr r3,=0x80389D9
mov r14,r3
bl r14
.else
bl 0x80389D8
.endif
// Fav Giga
mov r0,0x9
mov r1,0x0
mov r2,0x0
.if VAR_JP
ldr r3,=0x80389D9
mov r14,r3
bl r14
.else
bl 0x80389D8
.endif
// Set English save string
.if VAR_JP
ldr r0,=0x804AB39
mov r14,r0
bl r14
.else
bl 0x804AB38
.endif
@@valid:
bl @removeChipCodes
// Return valid save
mov r0,0x0
b @@end
@@invalid:
mov r0,0x1
@@end:
pop r4-r7,r15
@compareSaveString:
mov r1,r10
ldr r1,[r1,0x44]
add r1,0x54
mov r2,0x13
@@loop:
ldrb r3,[r1,r2]
ldrb r4,[r0,r2]
cmp r3,r4
bne @@true
sub r2,0x1
bge @@loop
@@false:
mov r0,0x0
b @@end
@@true:
mov r0,0x1
@@end:
bx r14
@removeChipCodes:
push r4,r14
// Reset property 0x26 for each Navi
mov r1,r10
ldr r1,[r1,0x78]
mov r2,(0x17 - 0x1)
lsl r2,r2,0x6
add r2,0x26
mov r0,0x3
@@loopNavi:
strb r0,[r1,r2]
sub r2,0x40
bpl @@loopNavi
// Remove codes from folders
ldr r1,=0x1FF01FF
mov r2,r10
ldr r2,[r2,0x74]
ldr r3,=((0x17 * 0x3C) - 0x4)
@@loopFolder:
ldr r0,[r2,r3]
and r0,r1
str r0,[r2,r3]
sub r3,0x4
bpl @@loopFolder
// Remove codes from pack
mov r3,r10
ldr r3,[r3,0x50]
mov r4,(0x137 - 0xFF)
add r4,0xFF
@@loopPack:
// Check if there are different codes
ldr r0,[r3]
cmp r0,0x63
ble @@nextPack
// Sum codes
lsr r1,r0,0x10
add r0,r0,r1
lsl r1,r0,0x10
lsl r0,r0,0x18
add r0,r0,r1
lsr r0,r0,0x18
cmp r0,0x63
ble @@setCount
mov r0,0x63
@@setCount:
str r0,[r3]
// Set pack ID to minimum
ldrh r0,[r3,0x4]
sub r0,0x1
ldrh r1,[r3,0x6]
sub r1,0x1
cmp r0,r1
bls @@next1
mov r0,r1
@@next1:
ldrh r1,[r3,0x8]
sub r1,0x1
ldrh r2,[r3,0xA]
sub r2,0x1
cmp r1,r2
bls @@next2
mov r1,r2
@@next2:
cmp r0,r1
bls @@next3
mov r0,r1
@@next3:
mov r1,0x0
add r0,0x1
str r0,[r3,0x4]
str r1,[r3,0x8]
// Next chip
@@nextPack:
add r3,0xC
sub r4,0x1
bgt @@loopPack
pop r4,r15
.align 2
save_playerNameInputConfirm:
ldrb r0,[r5,0x7]
cmp r0,0x2
bne @@normal
// End profile entry
mov r0,0x20
b @@setState
@@normal:
// Continue to gender screen
mov r0,0x10
@@setState:
strh r0,[r5]
mov r0,0x0
strb r0,[r5,0x6]
pop r15
.align 2
save_rtcReinitConfirm:
push r14
// Check if we're in Continue RTC re-initialization
ldr r1,=0x200F850
ldrb r0,[r1,0x9]
cmp r0,0x4
bne @@normal
// Check if name needs to be initialized
ldr r0,=0x2000E50
ldrb r0,[r0]
tst r0,r0
bne @@normal
// Set game state to profile entry
.if VAR_JP
ldr r0,=0x8039C53
mov r14,r0
bl r14
.else
bl 0x8039C52
.endif
// Skip a graphics glitch
ldr r1,=0x200F5E8
mov r0,0xC
strb r0,[r1]
// Set profile entry to name only
mov r0,0x2
strb r0,[r1,0x7]
pop r15
@@normal:
ldrb r0,[r5,0x1]
tst r0,r0
bne @@state1
@@state0:
.if VAR_JP
ldr r0,=0x8029415
mov r14,r0
bl r14
.else
bl 0x8029414
.endif
@@state1:
.if VAR_JP
ldr r0,=0x8029421
mov r14,r0
bl r14
.else
bl 0x8029420
.endif
.align 2
save_profileEntryExit:
tst r0,r0
beq @@newGame
cmp r0,0x2
bne @@hpProg
@@continue:
// Update player nickname
.if VAR_JP
ldr r0,=0x8038F61
mov r14,r0
bl r14
.else
bl 0x8038F60
.endif
.if VAR_JP
ldr r0,=0x80041F5
mov r14,r0
bl r14
.else
bl 0x80041F4
.endif
// Undo music stop
mov r3,r10
ldr r3,[r3,0x40]
mov r0,0x38
strb r0,[r3,0x19]
mov r0,0x1E
mov r1,0x6
.if VAR_JP
ldr r3,=0x802871F
mov r14,r3
bl r14
.else
bl 0x802871E
.endif
mov r0,0x1E
mov r1,0x1E
.if VAR_JP
ldr r3,=0x80287AF
mov r14,r3
bl r14
.else
bl 0x80287AE
.endif
bne @@openNaviSelect
@@openOverworld:
.if VAR_JP
ldr r0,=0x8030755
mov r14,r0
bl r14
.else
bl 0x8030754
.endif
mov r3,r10
ldr r0,[r3]
mov r1,0x4
strb r1,[r0]
.if VAR_JP
ldr r0,=0x803675D
mov r14,r0
bl r14
.else
bl 0x803675C
.endif
.if VAR_JP
ldr r0,=0x80067DD
mov r14,r0
bl r14
.else
bl 0x80067DC
.endif
pop r15
@@openNaviSelect:
.if VAR_JP
ldr r0,=0x8038DF5
mov r14,r0
bl r14
.else
bl 0x8038DF4
.endif
pop r15
@@hpProg:
mov r3,r10
ldr r0,[r3]
.if VAR_JP
ldr r1,=0x8039F85
mov r14,r1
bl r14
.else
bl 0x8039F84
.endif
@@newGame:
.if VAR_JP
ldr r0,=0x8039FA1
mov r14,r0
bl r14
.else
bl 0x8039FA0
.endif
.pool
@buildVersion:
.if VAR_JP
.dw 0
.else
.db (VAR_VERSION_DATE >> 16) & 0xFF
.db (VAR_VERSION_DATE >> 8) & 0xFF
.db (VAR_VERSION_DATE >> 0) & 0xFF
.db (VAR_EU ? 1 : 0) | (VAR_DEBUG ? 2 : 0) | (VAR_VERSION_REVISION << 2)
.endif
@jpSaveString:
.if VAR_JP
.ascii "ROCKMANEXE4RO 041217"
.else
.ascii "ROCKMANEXE4RO 040607"
.endif
.align 2
@chipNameToID:
// in r0 = chip name ptr
// out r0 = chip ID (0 = none)
push r4-r5,r14
mov r5,r0
// Read first char
ldrb r0,[r5]
cmp r0,0x9F
bgt @@notfound
// Get pointer to first string to check
add r1,=@@chipNameTable
lsl r0,r0,0x1
ldrh r0,[r1,r0]
tst r0,r0
beq @@notfound
add r1,r1,r0
@@checkString:
ldrb r0,[r1]
ldrb r2,[r1,0x1]
lsl r2,r2,0x8
orr r0,r2
beq @@notfound
add r1,0x3
add r2,r5,0x1
@@checkChar:
ldrb r3,[r1]
ldrb r4,[r2]
add r1,0x1
add r2,0x1
cmp r3,r4
bne @@nextString
cmp r3,0xE5
beq @@end
b @@checkChar
@@nextString:
cmp r3,0xE5
beq @@checkString
ldrb r3,[r1]
add r1,0x1
b @@nextString
@@notfound:
mov r0,0x0
@@end:
pop r4-r5,r15
.pool
.align 2
@@chipNameTable:
.dh @@chip_00 - @@chipNameTable // 00
.dh @@chip___ - @@chipNameTable // 01
.dh @@chip___ - @@chipNameTable // 02
.dh @@chip___ - @@chipNameTable // 03
.dh @@chip___ - @@chipNameTable // 04
.dh @@chip___ - @@chipNameTable // 05
.dh @@chip___ - @@chipNameTable // 06
.dh @@chip___ - @@chipNameTable // 07
.dh @@chip___ - @@chipNameTable // 08
.dh @@chip___ - @@chipNameTable // 09
.dh @@chip___ - @@chipNameTable // 0A
.dh @@chip_0B - @@chipNameTable // 0B
.dh @@chip_0C - @@chipNameTable // 0C
.dh @@chip_0D - @@chipNameTable // 0D
.dh @@chip_0E - @@chipNameTable // 0E
.dh @@chip_0F - @@chipNameTable // 0F
.dh @@chip_10 - @@chipNameTable // 10
.dh @@chip_11 - @@chipNameTable // 11
.dh @@chip_12 - @@chipNameTable // 12
.dh @@chip_13 - @@chipNameTable // 13
.dh @@chip_14 - @@chipNameTable // 14
.dh @@chip_15 - @@chipNameTable // 15
.dh @@chip_16 - @@chipNameTable // 16
.dh @@chip_17 - @@chipNameTable // 17
.dh @@chip_18 - @@chipNameTable // 18
.dh @@chip_19 - @@chipNameTable // 19
.dh @@chip_1A - @@chipNameTable // 1A
.dh @@chip___ - @@chipNameTable // 1B
.dh @@chip_1C - @@chipNameTable // 1C
.dh @@chip_1D - @@chipNameTable // 1D
.dh @@chip_1E - @@chipNameTable // 1E
.dh @@chip_1F - @@chipNameTable // 1F
.dh @@chip_20 - @@chipNameTable // 20
.dh @@chip_21 - @@chipNameTable // 21
.dh @@chip_22 - @@chipNameTable // 22
.dh @@chip_23 - @@chipNameTable // 23
.dh @@chip_24 - @@chipNameTable // 24
.dh @@chip_25 - @@chipNameTable // 25
.dh @@chip_26 - @@chipNameTable // 26
.dh @@chip_27 - @@chipNameTable // 27
.dh @@chip_28 - @@chipNameTable // 28
.dh @@chip_29 - @@chipNameTable // 29
.dh @@chip_2A - @@chipNameTable // 2A
.dh @@chip_2B - @@chipNameTable // 2B
.dh @@chip_2C - @@chipNameTable // 2C
.dh @@chip_2D - @@chipNameTable // 2D
.dh @@chip___ - @@chipNameTable // 2E
.dh @@chip_2F - @@chipNameTable // 2F
.dh @@chip___ - @@chipNameTable // 30
.dh @@chip_31 - @@chipNameTable // 31
.dh @@chip_32 - @@chipNameTable // 32
.dh @@chip___ - @@chipNameTable // 33
.dh @@chip_34 - @@chipNameTable // 34
.dh @@chip_35 - @@chipNameTable // 35
.dh @@chip_36 - @@chipNameTable // 36
.dh @@chip___ - @@chipNameTable // 37
.dh @@chip___ - @@chipNameTable // 38
.dh @@chip___ - @@chipNameTable // 39
.dh @@chip___ - @@chipNameTable // 3A
.dh @@chip_3B - @@chipNameTable // 3B
.dh @@chip_3C - @@chipNameTable // 3C
.dh @@chip_3D - @@chipNameTable // 3D
.dh @@chip___ - @@chipNameTable // 3E
.dh @@chip_3F - @@chipNameTable // 3F
.dh @@chip_40 - @@chipNameTable // 40
.dh @@chip_41 - @@chipNameTable // 41
.dh @@chip___ - @@chipNameTable // 42
.dh @@chip___ - @@chipNameTable // 43
.dh @@chip___ - @@chipNameTable // 44
.dh @@chip_45 - @@chipNameTable // 45
.dh @@chip___ - @@chipNameTable // 46
.dh @@chip___ - @@chipNameTable // 47
.dh @@chip_48 - @@chipNameTable // 48
.dh @@chip_49 - @@chipNameTable // 49
.dh @@chip_4A - @@chipNameTable // 4A
.dh @@chip_4B - @@chipNameTable // 4B
.dh @@chip_4C - @@chipNameTable // 4C
.dh @@chip___ - @@chipNameTable // 4D
.dh @@chip_4E - @@chipNameTable // 4E
.dh @@chip_4F - @@chipNameTable // 4F
.dh @@chip___ - @@chipNameTable // 50
.dh @@chip_51 - @@chipNameTable // 51
.dh @@chip___ - @@chipNameTable // 52
.dh @@chip_53 - @@chipNameTable // 53
.dh @@chip___ - @@chipNameTable // 54
.dh @@chip___ - @@chipNameTable // 55
.dh @@chip___ - @@chipNameTable // 56
.dh @@chip___ - @@chipNameTable // 57
.dh @@chip___ - @@chipNameTable // 58
.dh @@chip___ - @@chipNameTable // 59
.dh @@chip___ - @@chipNameTable // 5A
.dh @@chip___ - @@chipNameTable // 5B
.dh @@chip___ - @@chipNameTable // 5C
.dh @@chip___ - @@chipNameTable // 5D
.dh @@chip___ - @@chipNameTable // 5E
.dh @@chip___ - @@chipNameTable // 5F
.dh @@chip___ - @@chipNameTable // 60
.dh @@chip___ - @@chipNameTable // 61
.dh @@chip___ - @@chipNameTable // 62
.dh @@chip___ - @@chipNameTable // 63
.dh @@chip___ - @@chipNameTable // 64
.dh @@chip___ - @@chipNameTable // 65
.dh @@chip___ - @@chipNameTable // 66
.dh @@chip___ - @@chipNameTable // 67
.dh @@chip___ - @@chipNameTable // 68
.dh @@chip___ - @@chipNameTable // 69
.dh @@chip___ - @@chipNameTable // 6A
.dh @@chip___ - @@chipNameTable // 6B
.dh @@chip___ - @@chipNameTable // 6C
.dh @@chip___ - @@chipNameTable // 6D
.dh @@chip___ - @@chipNameTable // 6E
.dh @@chip___ - @@chipNameTable // 6F
.dh @@chip___ - @@chipNameTable // 70
.dh @@chip___ - @@chipNameTable // 71
.dh @@chip___ - @@chipNameTable // 72
.dh @@chip___ - @@chipNameTable // 73
.dh @@chip___ - @@chipNameTable // 74
.dh @@chip___ - @@chipNameTable // 75
.dh @@chip___ - @@chipNameTable // 76
.dh @@chip_77 - @@chipNameTable // 77
.dh @@chip___ - @@chipNameTable // 78
.dh @@chip___ - @@chipNameTable // 79
.dh @@chip___ - @@chipNameTable // 7A
.dh @@chip___ - @@chipNameTable // 7B
.dh @@chip___ - @@chipNameTable // 7C
.dh @@chip___ - @@chipNameTable // 7D
.dh @@chip_7E - @@chipNameTable // 7E
.dh @@chip___ - @@chipNameTable // 7F
.dh @@chip___ - @@chipNameTable // 80
.dh @@chip___ - @@chipNameTable // 81
.dh @@chip___ - @@chipNameTable // 82
.dh @@chip___ - @@chipNameTable // 83
.dh @@chip___ - @@chipNameTable // 84
.dh @@chip___ - @@chipNameTable // 85
.dh @@chip___ - @@chipNameTable // 86
.dh @@chip___ - @@chipNameTable // 87
.dh @@chip___ - @@chipNameTable // 88
.dh @@chip___ - @@chipNameTable // 89
.dh @@chip___ - @@chipNameTable // 8A
.dh @@chip___ - @@chipNameTable // 8B
.dh @@chip___ - @@chipNameTable // 8C
.dh @@chip___ - @@chipNameTable // 8D
.dh @@chip___ - @@chipNameTable // 8E
.dh @@chip___ - @@chipNameTable // 8F
.dh @@chip___ - @@chipNameTable // 90
.dh @@chip___ - @@chipNameTable // 91
.dh @@chip___ - @@chipNameTable // 92
.dh @@chip___ - @@chipNameTable // 93
.dh @@chip___ - @@chipNameTable // 94
.dh @@chip___ - @@chipNameTable // 95
.dh @@chip___ - @@chipNameTable // 96
.dh @@chip___ - @@chipNameTable // 97
.dh @@chip___ - @@chipNameTable // 98
.dh @@chip___ - @@chipNameTable // 99
.dh @@chip___ - @@chipNameTable // 9A
.dh @@chip___ - @@chipNameTable // 9B
.dh @@chip___ - @@chipNameTable // 9C
.dh @@chip_9D - @@chipNameTable // 9D
.dh @@chip___ - @@chipNameTable // 9E
.dh @@chip___ - @@chipNameTable // 9F
@@chip___:
.dh 0x0000
@@chip_00:
.dh 0x0184 :: .db 0x00,0xE5
.dh 0x0000
@@chip_0B:
.dh 0x017E :: .db 0x0B,0x0C,0x17,0x11,0x5B,0x82,0x4C,0xE5 // Japanese アイスキューブ
.dh 0x00B5 :: .db 0x0B,0x12,0x0B,0x0B,0x59,0x4F,0x82,0x02,0xE5 // Japanese アクアアッパー1
.dh 0x00B6 :: .db 0x0B,0x12,0x0B,0x0B,0x59,0x4F,0x82,0x03,0xE5 // Japanese アクアアッパー2
.dh 0x00B7 :: .db 0x0B,0x12,0x0B,0x0B,0x59,0x4F,0x82,0x04,0xE5 // Japanese アクアアッパー3
.dh 0x00FD :: .db 0x0B,0x12,0x0B,0x29,0x3A,0x61,0x70,0xE5 // Japanese アクアマンDS
.dh 0x00FC :: .db 0x0B,0x12,0x0B,0x29,0x3A,0x70,0x6D,0xE5 // Japanese アクアマンSP
.dh 0x00FB :: .db 0x0B,0x12,0x0B,0x29,0x3A,0xE5 // Japanese アクアマン
.dh 0x011F :: .db 0x0B,0x12,0x0B,0x4F,0x36,0x82,0xE5 // Japanese アクアパワー
.dh 0x0095 :: .db 0x0B,0x1A,0x59,0x12,0x7F,0x02,0x01,0xE5 // Japanese アタック+10
.dh 0x00CD :: .db 0x0B,0x1A,0x59,0x12,0x7F,0x04,0x01,0xE5 // Japanese アタック+30
.dh 0x003F :: .db 0x0B,0x2E,0x37,0x12,0x34,0x28,0x02,0xE5 // 2012 demo AirHoc1
.dh 0x0040 :: .db 0x0B,0x2E,0x37,0x12,0x34,0x28,0x03,0xE5 // 2012 demo AirHoc2
.dh 0x0041 :: .db 0x0B,0x2E,0x37,0x12,0x34,0x28,0x04,0xE5 // 2012 demo AirHoc3
.dh 0x0004 :: .db 0x0B,0x2E,0x37,0x1D,0x2D,0x34,0x39,0xE5 // 2012 demo AirShot
.dh 0x0091 :: .db 0x0B,0x32,0x38,0x2D,0x0E,0x31,0x2B,0xE5 // Spikeman AntiDmg
.dh 0x008E :: .db 0x0B,0x32,0x38,0x2D,0x0F,0x30,0x29,0x27,0xE5 // Spikeman AntiElec
.dh 0x008C :: .db 0x0B,0x32,0x38,0x2D,0x10,0x47,0x29,0xE5 // Spikeman AntiFire
.dh 0x0090 :: .db 0x0B,0x32,0x38,0x2D,0x18,0x25,0x3A,0x2D,0xE5 // Spikeman AntiNavi
.dh 0x0093 :: .db 0x0B,0x32,0x38,0x2D,0x1C,0x29,0x27,0x3A,0xE5 // Spikeman AntiRecv
.dh 0x0092 :: .db 0x0B,0x32,0x38,0x2D,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman AntiSwrd
.dh 0x008D :: .db 0x0B,0x32,0x38,0x2D,0x21,0x25,0x38,0x36,0xE5 // Spikeman AntiWatr
.dh 0x008F :: .db 0x0B,0x32,0x38,0x2D,0x21,0x33,0x33,0x28,0xE5 // Spikeman AntiWood
.dh 0x00CC :: .db 0x0B,0x32,0x39,0x26,0x2D,0x37,0xE5 // Spikeman Anubis
.dh 0x0091 :: .db 0x0B,0x33,0x39,0x2E,0x0E,0x32,0x2C,0xE5 // 2012 demo AntiDmg
.dh 0x008E :: .db 0x0B,0x33,0x39,0x2E,0x0F,0x31,0x2A,0x28,0xE5 // 2012 demo AntiElec
.dh 0x008C :: .db 0x0B,0x33,0x39,0x2E,0x10,0x2E,0x37,0x2A,0xE5 // 2012 demo AntiFire
.dh 0x0090 :: .db 0x0B,0x33,0x39,0x2E,0x18,0x26,0x3B,0x2E,0xE5 // 2012 demo AntiNavi
.dh 0x0093 :: .db 0x0B,0x33,0x39,0x2E,0x1C,0x2A,0x28,0x3B,0xE5 // 2012 demo AntiRecv
.dh 0x0092 :: .db 0x0B,0x33,0x39,0x2E,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo AntiSwrd
.dh 0x008D :: .db 0x0B,0x33,0x39,0x2E,0x21,0x26,0x39,0x37,0xE5 // 2012 demo AntiWatr
.dh 0x008F :: .db 0x0B,0x33,0x39,0x2E,0x21,0x34,0x34,0x29,0xE5 // 2012 demo AntiWood
.dh 0x00CC :: .db 0x0B,0x33,0x3A,0x27,0x2E,0x38,0xE5 // 2012 demo Anubis
.dh 0x00FC :: .db 0x0B,0x35,0x39,0x25,0x17,0x3F,0x76,0xE5 // Spikeman AquaManSP
.dh 0x00FD :: .db 0x0B,0x35,0x39,0x25,0x17,0x3F,0x77,0xE5 // Spikeman AquaManDS
.dh 0x00FB :: .db 0x0B,0x35,0x39,0x25,0x17,0x3F,0xE5 // Spikeman AquaMan
.dh 0x011F :: .db 0x0B,0x35,0x39,0x25,0x1A,0x3B,0x36,0xE5 // Spikeman AquaPwr
.dh 0x00B5 :: .db 0x0B,0x35,0x39,0x25,0x1F,0x34,0x02,0xE5 // Spikeman AquaUp1
.dh 0x00B6 :: .db 0x0B,0x35,0x39,0x25,0x1F,0x34,0x03,0xE5 // Spikeman AquaUp2
.dh 0x00B7 :: .db 0x0B,0x35,0x39,0x25,0x1F,0x34,0x04,0xE5 // Spikeman AquaUp3
.dh 0x0075 :: .db 0x0B,0x36,0x29,0x25,0x11,0x36,0x25,0x26,0xE5 // Spikeman AreaGrab
.dh 0x00FC :: .db 0x0B,0x36,0x3A,0x26,0x17,0x26,0x33,0x43,0xE5 // 2012 demo AquaManSP
.dh 0x00FD :: .db 0x0B,0x36,0x3A,0x26,0x17,0x26,0x33,0x44,0xE5 // 2012 demo AquaManDS
.dh 0x00FB :: .db 0x0B,0x36,0x3A,0x26,0x17,0x26,0x33,0xE5 // 2012 demo AquaMan
.dh 0x011F :: .db 0x0B,0x36,0x3A,0x26,0x1A,0x34,0x3C,0x37,0xE5 // 2012 demo AquaPowr
.dh 0x00B5 :: .db 0x0B,0x36,0x3A,0x26,0x1F,0x35,0x02,0xE5 // 2012 demo AquaUp1
.dh 0x00B6 :: .db 0x0B,0x36,0x3A,0x26,0x1F,0x35,0x03,0xE5 // 2012 demo AquaUp2
.dh 0x00B7 :: .db 0x0B,0x36,0x3A,0x26,0x1F,0x35,0x04,0xE5 // 2012 demo AquaUp3
.dh 0x0075 :: .db 0x0B,0x37,0x2A,0x26,0x11,0x37,0x26,0x27,0xE5 // 2012 demo AreaGrab
.dh 0x0095 :: .db 0x0B,0x38,0x2F,0x7F,0x02,0x01,0xE5 // Spikeman Atk+10
.dh 0x00CD :: .db 0x0B,0x38,0x2F,0x7F,0x04,0x01,0xE5 // Spikeman Atk+30
.dh 0x0095 :: .db 0x0B,0x39,0x30,0x48,0x02,0x01,0xE5 // English Atk+10
.dh 0x00CD :: .db 0x0B,0x39,0x30,0x48,0x04,0x01,0xE5 // English Atk+30
.dh 0x0095 :: .db 0x0B,0x39,0x30,0x9E,0x02,0x01,0xE5 // 2012 demo Atk+10
.dh 0x00CD :: .db 0x0B,0x39,0x30,0x9E,0x04,0x01,0xE5 // 2012 demo Atk+30
.dh 0x003F :: .db 0x0B,0x47,0x12,0x33,0x27,0x02,0xE5 // Spikeman AirHoc1
.dh 0x0040 :: .db 0x0B,0x47,0x12,0x33,0x27,0x03,0xE5 // Spikeman AirHoc2
.dh 0x0041 :: .db 0x0B,0x47,0x12,0x33,0x27,0x04,0xE5 // Spikeman AirHoc3
.dh 0x0004 :: .db 0x0B,0x47,0x1D,0x2C,0x33,0x38,0xE5 // Spikeman AirShot
.dh 0x0000
@@chip_0C:
.dh 0x0038 :: .db 0x0C,0x0B,0x0C,0x26,0x58,0x82,0x2B,0xE5 // Japanese イアイフォーム
.dh 0x0175 :: .db 0x0C,0x25,0x27,0x2C,0x2D,0xE5 // Spikeman Bachi
.dh 0x011B :: .db 0x0C,0x25,0x30,0x30,0x17,0x33,0x28,0x29,0xE5 // Spikeman BallMode
.dh 0x002C :: .db 0x0C,0x25,0x30,0x30,0xE5 // Spikeman Ball
.dh 0x0132 :: .db 0x0C,0x25,0x37,0x37,0x19,0x32,0x30,0x3D,0xE5 // Spikeman BassOnly
.dh 0x012D :: .db 0x0C,0x25,0x37,0x37,0xE5 // Spikeman Bass
.dh 0x011B :: .db 0x0C,0x26,0x31,0x31,0x17,0x34,0x29,0x2A,0xE5 // 2012 demo BallMode
.dh 0x0088 :: .db 0x0C,0x26,0x37,0x37,0x02,0x01,0x01,0xE5 // 2012 demo Barr100
.dh 0x0089 :: .db 0x0C,0x26,0x37,0x37,0x03,0x01,0x01,0xE5 // 2012 demo Barr200
.dh 0x0087 :: .db 0x0C,0x26,0x37,0x37,0x2E,0x2A,0x37,0xE5 // 2012 demo Barrier
.dh 0x0132 :: .db 0x0C,0x26,0x38,0x38,0x0B,0x33,0x31,0x3E,0xE5 // 2012 demo BassAnly
.dh 0x012D :: .db 0x0C,0x26,0x38,0x38,0xE5 // 2012 demo Bass
.dh 0x0180 :: .db 0x0C,0x29,0x25,0x38,0xE5 // Spikeman Beat
.dh 0x0180 :: .db 0x0C,0x2A,0x26,0x39,0xE5 // 2012 demo Beat
.dh 0x0068 :: .db 0x0C,0x2D,0x2B,0x12,0x25,0x31,0x36,0x02,0xE5 // Spikeman BigHamr1
.dh 0x0069 :: .db 0x0C,0x2D,0x2B,0x12,0x25,0x31,0x36,0x03,0xE5 // Spikeman BigHamr2
.dh 0x006A :: .db 0x0C,0x2D,0x2B,0x12,0x25,0x31,0x36,0x04,0xE5 // Spikeman BigHamr3
.dh 0x0068 :: .db 0x0C,0x2E,0x2C,0x12,0x26,0x32,0x37,0x02,0xE5 // 2012 demo BigHamr1
.dh 0x0069 :: .db 0x0C,0x2E,0x2C,0x12,0x26,0x32,0x37,0x03,0xE5 // 2012 demo BigHamr2
.dh 0x006A :: .db 0x0C,0x2E,0x2C,0x12,0x26,0x32,0x37,0x04,0xE5 // 2012 demo BigHamr3
.dh 0x0026 :: .db 0x0C,0x2E,0x33,0x29,0x2A,0x37,0x02,0xE5 // 2012 demo Binder1
.dh 0x0027 :: .db 0x0C,0x2E,0x33,0x29,0x2A,0x37,0x03,0xE5 // 2012 demo Binder2
.dh 0x0028 :: .db 0x0C,0x2E,0x33,0x29,0x2A,0x37,0x04,0xE5 // 2012 demo Binder3
.dh 0x0134 :: .db 0x0C,0x30,0x25,0x2F,0x0C,0x42,0x36,0xE5 // Spikeman BlakBarr
.dh 0x00D6 :: .db 0x0C,0x30,0x25,0x2F,0x21,0x43,0x2B,0xE5 // Spikeman BlakWing
.dh 0x0005 :: .db 0x0C,0x30,0x2D,0x3E,0x3E,0x42,0x28,0xE5 // Spikeman Blizzard
.dh 0x0121 :: .db 0x0C,0x30,0x2F,0x21,0x29,0x34,0x33,0x32,0xE5 // Spikeman BlkWepon
.dh 0x002E :: .db 0x0C,0x30,0x2F,0x40,0x45,0xE5 // Spikeman BlkBomb
.dh 0x0135 :: .db 0x0C,0x30,0x39,0x29,0x17,0x33,0x33,0x32,0xE5 // Spikeman BlueMoon
.dh 0x0081 :: .db 0x0C,0x30,0x43,0x28,0x41,0xE5 // Spikeman Blinder
.dh 0x0134 :: .db 0x0C,0x31,0x26,0x30,0x0C,0x26,0x37,0x37,0xE5 // 2012 demo BlakBarr
.dh 0x0121 :: .db 0x0C,0x31,0x26,0x30,0x21,0x2A,0x26,0x35,0xE5 // 2012 demo BlakWeap
.dh 0x00D6 :: .db 0x0C,0x31,0x26,0x30,0x21,0x2E,0x33,0x2C,0xE5 // 2012 demo BlakWing
.dh 0x0081 :: .db 0x0C,0x31,0x2E,0x33,0x29,0x2A,0x37,0xE5 // 2012 demo Blinder
.dh 0x0005 :: .db 0x0C,0x31,0x2E,0x3F,0x3F,0x26,0x37,0x29,0xE5 // 2012 demo Blizzard
.dh 0x002E :: .db 0x0C,0x31,0x30,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo BlkBomb
.dh 0x0135 :: .db 0x0C,0x31,0x3A,0x2A,0x17,0x34,0x34,0x33,0xE5 // 2012 demo BlueMoon
.dh 0x015C :: .db 0x0C,0x34,0x29,0x3E,0x11,0x37,0x29,0xE5 // 2012 demo BodyGrd
.dh 0x004B :: .db 0x0C,0x34,0x34,0x32,0x2A,0x37,0x02,0xE5 // 2012 demo Boomer1
.dh 0x004C :: .db 0x0C,0x34,0x34,0x32,0x2A,0x37,0x03,0xE5 // 2012 demo Boomer2
.dh 0x004D :: .db 0x0C,0x34,0x34,0x32,0x2A,0x37,0x04,0xE5 // 2012 demo Boomer3
.dh 0x0055 :: .db 0x0C,0x34,0x3E,0x0C,0x34,0x32,0x27,0x02,0xE5 // 2012 demo BoyBomb1
.dh 0x0056 :: .db 0x0C,0x34,0x3E,0x0C,0x34,0x32,0x27,0x03,0xE5 // 2012 demo BoyBomb2
.dh 0x0057 :: .db 0x0C,0x34,0x3E,0x0C,0x34,0x32,0x27,0x04,0xE5 // 2012 demo BoyBomb3
.dh 0x0188 :: .db 0x0C,0x34,0x3E,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo BoyBomb
.dh 0x0185 :: .db 0x0C,0x36,0x02,0xE5 // Japanese イワ1
.dh 0x0186 :: .db 0x0C,0x36,0x03,0xE5 // Japanese イワ2
.dh 0x014F :: .db 0x0C,0x38,0x39,0x10,0x26,0x33,0x2C,0x02,0xE5 // 2012 demo BstFang1
.dh 0x0150 :: .db 0x0C,0x38,0x39,0x10,0x26,0x33,0x2C,0x03,0xE5 // 2012 demo BstFang2
.dh 0x0151 :: .db 0x0C,0x38,0x39,0x10,0x26,0x33,0x2C,0x04,0xE5 // 2012 demo BstFang3
.dh 0x0018 :: .db 0x0C,0x39,0x26,0x1D,0x2D,0x28,0x29,0xE5 // Spikeman BubSide
.dh 0x0016 :: .db 0x0C,0x39,0x26,0x26,0x30,0x41,0xE5 // Spikeman Bubbler
.dh 0x0142 :: .db 0x0C,0x39,0x26,0x30,0x1D,0x34,0x36,0x28,0xE5 // Spikeman BublSprd
.dh 0x0017 :: .db 0x0C,0x39,0x26,0x82,0x20,0xE5 // Spikeman Bub-V
.dh 0x00D3 :: .db 0x0C,0x39,0x2B,0x0D,0x2C,0x25,0x43,0xE5 // Spikeman BugChain
.dh 0x0136 :: .db 0x0C,0x39,0x2B,0x0D,0x2C,0x42,0x2B,0xE5 // Spikeman BugCharg
.dh 0x012F :: .db 0x0C,0x39,0x2B,0x0D,0x39,0x36,0x37,0x29,0xE5 // Spikeman BugCurse
.dh 0x00CE :: .db 0x0C,0x39,0x2B,0x10,0x2D,0x3C,0xE5 // Spikeman BugFix
.dh 0x0029 :: .db 0x0C,0x39,0x2B,0x40,0x45,0xE5 // Spikeman BugBomb
.dh 0x0108 :: .db 0x0C,0x39,0x36,0x32,0x17,0x3F,0x76,0xE5 // Spikeman BurnManSP
.dh 0x0109 :: .db 0x0C,0x39,0x36,0x32,0x17,0x3F,0x77,0xE5 // Spikeman BurnManDS
.dh 0x0107 :: .db 0x0C,0x39,0x36,0x32,0x17,0x3F,0xE5 // Spikeman BurnMan
.dh 0x0142 :: .db 0x0C,0x3A,0x27,0x1D,0x35,0x37,0x29,0xE5 // 2012 demo BubSprd
.dh 0x0016 :: .db 0x0C,0x3A,0x27,0x27,0x31,0x2A,0x37,0xE5 // 2012 demo Bubbler
.dh 0x0018 :: .db 0x0C,0x3A,0x27,0x31,0x1D,0x2E,0x29,0x2A,0xE5 // 2012 demo BublSide
.dh 0x0017 :: .db 0x0C,0x3A,0x27,0x49,0x20,0xE5 // English Bub-V
.dh 0x0017 :: .db 0x0C,0x3A,0x27,0x98,0x20,0xE5 // 2012 demo Bub-V
.dh 0x0029 :: .db 0x0C,0x3A,0x2C,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo BugBomb
.dh 0x00D3 :: .db 0x0C,0x3A,0x2C,0x0D,0x2D,0x26,0x2E,0x33,0xE5 // 2012 demo BugChain
.dh 0x0136 :: .db 0x0C,0x3A,0x2C,0x0D,0x2D,0x26,0x37,0x2C,0xE5 // 2012 demo BugCharg
.dh 0x012F :: .db 0x0C,0x3A,0x2C,0x0D,0x3A,0x37,0x38,0x2A,0xE5 // 2012 demo BugCurse
.dh 0x00CE :: .db 0x0C,0x3A,0x2C,0x10,0x2E,0x3D,0xE5 // 2012 demo BugFix
.dh 0x0108 :: .db 0x0C,0x3A,0x37,0x33,0x17,0x26,0x33,0x43,0xE5 // 2012 demo BurnManSP
.dh 0x0109 :: .db 0x0C,0x3A,0x37,0x33,0x17,0x26,0x33,0x44,0xE5 // 2012 demo BurnManDS
.dh 0x0107 :: .db 0x0C,0x3A,0x37,0x33,0x17,0x26,0x33,0xE5 // 2012 demo BurnMan
.dh 0x0108 :: .db 0x0C,0x3A,0x37,0x33,0x37,0x17,0x33,0x43,0xE5 // English BurnrManSP
.dh 0x0108 :: .db 0x0C,0x3A,0x37,0x33,0x37,0x17,0x33,0x44,0xE5 // English BurnrManDS
.dh 0x0107 :: .db 0x0C,0x3A,0x37,0x33,0x37,0x17,0x26,0x33,0xE5 // English BurnrMan
.dh 0x0085 :: .db 0x0C,0x3A,0x4B,0x41,0x4C,0x33,0xE5 // Japanese インビジブル
.dh 0x0088 :: .db 0x0C,0x42,0x36,0x02,0x01,0x01,0xE5 // Spikeman Barr100
.dh 0x0089 :: .db 0x0C,0x42,0x36,0x03,0x01,0x01,0xE5 // Spikeman Barr200
.dh 0x0087 :: .db 0x0C,0x42,0x36,0x2D,0x41,0xE5 // Spikeman Barrier
.dh 0x0026 :: .db 0x0C,0x43,0x28,0x41,0x02,0xE5 // Spikeman Binder1
.dh 0x0027 :: .db 0x0C,0x43,0x28,0x41,0x03,0xE5 // Spikeman Binder2
.dh 0x0028 :: .db 0x0C,0x43,0x28,0x41,0x04,0xE5 // Spikeman Binder3
.dh 0x0000
@@chip_0D:
.dh 0x00E5 :: .db 0x0D,0x0C,0x3A,0x49,0x29,0x3A,0x61,0x70,0xE5 // Japanese ウインドマンDS
.dh 0x00E4 :: .db 0x0D,0x0C,0x3A,0x49,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ウインドマンSP
.dh 0x00E3 :: .db 0x0D,0x0C,0x3A,0x49,0x29,0x3A,0xE5 // Japanese ウインドマン
.dh 0x002C :: .db 0x0D,0x26,0x33,0x33,0x0C,0x26,0x31,0x31,0xE5 // 2012 demo CannBall
.dh 0x011A :: .db 0x0D,0x26,0x33,0x33,0x17,0x34,0x29,0x2A,0xE5 // 2012 demo CannMode
.dh 0x0001 :: .db 0x0D,0x26,0x33,0x33,0x34,0x33,0xE5 // 2012 demo Cannon
.dh 0x0042 :: .db 0x0D,0x2E,0x37,0x28,0x11,0x3A,0x33,0x02,0xE5 // 2012 demo CircGun1
.dh 0x0043 :: .db 0x0D,0x2E,0x37,0x28,0x11,0x3A,0x33,0x03,0xE5 // 2012 demo CircGun2
.dh 0x0044 :: .db 0x0D,0x2E,0x37,0x28,0x11,0x3A,0x33,0x04,0xE5 // 2012 demo CircGun3
.dh 0x0094 :: .db 0x0D,0x33,0x34,0x3D,0x0E,0x31,0x2B,0xE5 // Spikeman CopyDmg
.dh 0x003C :: .db 0x0D,0x33,0x44,0x38,0x41,0x02,0xE5 // Spikeman Counter1
.dh 0x003D :: .db 0x0D,0x33,0x44,0x38,0x41,0x03,0xE5 // Spikeman Counter2
.dh 0x003E :: .db 0x0D,0x33,0x44,0x38,0x41,0x04,0xE5 // Spikeman Counter3
.dh 0x010B :: .db 0x0D,0x34,0x31,0x29,0x17,0x26,0x33,0x43,0xE5 // 2012 demo ColdManSP
.dh 0x010C :: .db 0x0D,0x34,0x31,0x29,0x17,0x26,0x33,0x44,0xE5 // 2012 demo ColdManDS
.dh 0x010A :: .db 0x0D,0x34,0x31,0x29,0x17,0x26,0x33,0xE5 // 2012 demo ColdMan
.dh 0x007F :: .db 0x0D,0x34,0x31,0x34,0x37,0x1A,0x39,0xE5 // 2012 demo ColorPt
.dh 0x0094 :: .db 0x0D,0x34,0x35,0x3E,0x0E,0x32,0x2C,0xE5 // 2012 demo CopyDmg
.dh 0x003C :: .db 0x0D,0x34,0x3A,0x33,0x39,0x2A,0x37,0x02,0xE5 // 2012 demo Counter1
.dh 0x003D :: .db 0x0D,0x34,0x3A,0x33,0x39,0x2A,0x37,0x03,0xE5 // 2012 demo Counter2
.dh 0x003E :: .db 0x0D,0x34,0x3A,0x33,0x39,0x2A,0x37,0x04,0xE5 // 2012 demo Counter3
.dh 0x005B :: .db 0x0D,0x36,0x25,0x2F,0x19,0x39,0x38,0xE5 // Spikeman CrakOut
.dh 0x0176 :: .db 0x0D,0x36,0x37,0x1D,0x3B,0x28,0xE5 // Spikeman CrsSwd
.dh 0x005B :: .db 0x0D,0x37,0x26,0x30,0x19,0x3A,0x39,0xE5 // 2012 demo CrakOut
.dh 0x0176 :: .db 0x0D,0x37,0x34,0x38,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo CrosSwrd
.dh 0x0036 :: .db 0x0D,0x39,0x37,0x38,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman CustSwrd
.dh 0x0174 :: .db 0x0D,0x3A,0x37,0x38,0x2A,0xE5 // 2012 demo Curse
.dh 0x0036 :: .db 0x0D,0x3A,0x38,0x39,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo CustSwrd
.dh 0x011A :: .db 0x0D,0x3F,0x32,0x17,0x33,0x28,0x29,0xE5 // Spikeman CannMode
.dh 0x0001 :: .db 0x0D,0x3F,0x32,0x33,0x32,0xE5 // Spikeman Cannon
.dh 0x010B :: .db 0x0D,0x46,0x28,0x17,0x3F,0x76,0xE5 // Spikeman ColdManSP
.dh 0x010C :: .db 0x0D,0x46,0x28,0x17,0x3F,0x77,0xE5 // Spikeman ColdManDS
.dh 0x010A :: .db 0x0D,0x46,0x28,0x17,0x3F,0xE5 // Spikeman ColdMan
.dh 0x007F :: .db 0x0D,0x46,0x33,0x36,0x1A,0x38,0xE5 // Spikeman ColorPt
.dh 0x0042 :: .db 0x0D,0x47,0x27,0x11,0x44,0x02,0xE5 // Spikeman CircGun1
.dh 0x0043 :: .db 0x0D,0x47,0x27,0x11,0x44,0x03,0xE5 // Spikeman CircGun2
.dh 0x0044 :: .db 0x0D,0x47,0x27,0x11,0x44,0x04,0xE5 // Spikeman CircGun3
.dh 0x002B :: .db 0x0D,0x59,0x48,0x55,0x4F,0x0D,0x45,0x82,0xE5 // Japanese ウッディパウダー
.dh 0x0100 :: .db 0x0D,0x59,0x49,0x29,0x3A,0x61,0x70,0xE5 // Japanese ウッドマンDS
.dh 0x00FF :: .db 0x0D,0x59,0x49,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ウッドマンSP
.dh 0x00FE :: .db 0x0D,0x59,0x49,0x29,0x3A,0xE5 // Japanese ウッドマン
.dh 0x0120 :: .db 0x0D,0x59,0x49,0x4F,0x36,0x82,0xE5 // Japanese ウッドパワー
.dh 0x0000
@@chip_0E:
.dh 0x0004 :: .db 0x0E,0x0B,0x16,0x5B,0x82,0x1E,0xE5 // Japanese エアシュート
.dh 0x003F :: .db 0x0E,0x0B,0x28,0x59,0x13,0x82,0x02,0xE5 // Japanese エアホッケー1
.dh 0x0040 :: .db 0x0E,0x0B,0x28,0x59,0x13,0x82,0x03,0xE5 // Japanese エアホッケー2
.dh 0x0041 :: .db 0x0E,0x0B,0x28,0x59,0x13,0x82,0x04,0xE5 // Japanese エアホッケー3
.dh 0x001E :: .db 0x0E,0x1F,0x41,0x82,0x4E,0x2B,0xE5 // Japanese エナジーボム
.dh 0x00CF :: .db 0x0E,0x26,0x30,0x1A,0x33,0x43,0x38,0xE5 // Spikeman DblPoint
.dh 0x00BD :: .db 0x0E,0x26,0x37,0x30,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo DarkBomb
.dh 0x0170 :: .db 0x0E,0x26,0x37,0x30,0x16,0x26,0x38,0x2A,0xE5 // 2012 demo DarkLase
.dh 0x0140 :: .db 0x0E,0x26,0x37,0x30,0x18,0x2A,0x34,0xE5 // 2012 demo DarkNeo
.dh 0x0178 :: .db 0x0E,0x27,0x31,0x0E,0x37,0x2A,0x26,0x32,0xE5 // 2012 demo DblDream
.dh 0x00CF :: .db 0x0E,0x27,0x31,0x1A,0x34,0x2E,0x33,0x39,0xE5 // 2012 demo DblPoint
.dh 0x012E :: .db 0x0E,0x29,0x30,0x38,0x25,0x1C,0x25,0x3D,0xE5 // Spikeman DeltaRay
.dh 0x012E :: .db 0x0E,0x2A,0x31,0x39,0x26,0x1C,0x26,0x3E,0xE5 // 2012 demo DeltaRay
.dh 0x0065 :: .db 0x0E,0x2D,0x37,0x27,0x33,0x36,0x28,0xE5 // Spikeman Discord
.dh 0x0065 :: .db 0x0E,0x2E,0x38,0x28,0x34,0x37,0x29,0xE5 // 2012 demo Discord
.dh 0x0075 :: .db 0x0E,0x32,0x0B,0x17,0x1B,0x82,0x33,0xE5 // Japanese エリアスチール
.dh 0x002A :: .db 0x0E,0x34,0x11,0x16,0x5C,0x59,0x12,0xE5 // Japanese エレキショック
.dh 0x001A :: .db 0x0E,0x34,0x2C,0x3A,0x1E,0x0B,0x0C,0x17,0xE5 // Japanese エレメントアイス
.dh 0x0080 :: .db 0x0E,0x34,0x2C,0x3A,0x1E,0x15,0x3A,0x49,0xE5 // Japanese エレメントサンド
.dh 0x0019 :: .db 0x0E,0x34,0x2C,0x3A,0x1E,0x26,0x34,0x0B,0xE5 // Japanese エレメントフレア
.dh 0x007E :: .db 0x0E,0x34,0x2C,0x3A,0x1E,0x32,0x82,0x26,0xE5 // Japanese エレメントリーフ
.dh 0x00D5 :: .db 0x0E,0x34,0x2C,0x3A,0x1E,0x45,0x82,0x12,0xE5 // Japanese エレメントダーク
.dh 0x0170 :: .db 0x0E,0x36,0x2F,0x16,0x25,0x37,0x36,0xE5 // Spikeman DrkLasr
.dh 0x00BF :: .db 0x0E,0x36,0x2F,0x16,0x3F,0x27,0x29,0xE5 // Spikeman DrkLance
.dh 0x00D8 :: .db 0x0E,0x36,0x2F,0x16,0x43,0x29,0xE5 // Spikeman DrkLine
.dh 0x0140 :: .db 0x0E,0x36,0x2F,0x17,0x29,0x37,0x2D,0x25,0xE5 // Spikeman DrkMesia
.dh 0x00C2 :: .db 0x0E,0x36,0x2F,0x1C,0x29,0x27,0x33,0x3A,0xE5 // Spikeman DrkRecov
.dh 0x0158 :: .db 0x0E,0x36,0x31,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman DrmSwrd
.dh 0x00BB :: .db 0x0E,0x37,0x30,0x0D,0x26,0x33,0x34,0x33,0xE5 // 2012 demo DrkCanon
.dh 0x0052 :: .db 0x0E,0x37,0x30,0x12,0x34,0x31,0x2A,0xE5 // 2012 demo DrkHole
.dh 0x00BF :: .db 0x0E,0x37,0x30,0x16,0x26,0x33,0x28,0x2A,0xE5 // 2012 demo DrkLance
.dh 0x00D8 :: .db 0x0E,0x37,0x30,0x16,0x2E,0x33,0x2A,0xE5 // 2012 demo DrkLine
.dh 0x00C2 :: .db 0x0E,0x37,0x30,0x1C,0x2A,0x28,0x34,0x3B,0xE5 // 2012 demo DrkRecov
.dh 0x00C0 :: .db 0x0E,0x37,0x30,0x1D,0x35,0x37,0x2A,0x29,0xE5 // 2012 demo DrkSpred
.dh 0x00C1 :: .db 0x0E,0x37,0x30,0x1D,0x39,0x26,0x2C,0x2A,0xE5 // 2012 demo DrkStage
.dh 0x00BC :: .db 0x0E,0x37,0x30,0x1D,0x3C,0x34,0x37,0x29,0xE5 // 2012 demo DrkSword
.dh 0x00BE :: .db 0x0E,0x37,0x30,0x20,0x3A,0x31,0x28,0x33,0xE5 // 2012 demo DrkVulcn
.dh 0x005C :: .db 0x0E,0x39,0x26,0x30,0x0D,0x36,0x25,0x2F,0xE5 // Spikeman DublCrak
.dh 0x0178 :: .db 0x0E,0x39,0x26,0x30,0x0E,0x36,0x31,0xE5 // Spikeman DublDrm
.dh 0x005C :: .db 0x0E,0x3A,0x27,0x31,0x0D,0x37,0x26,0x30,0xE5 // 2012 demo DublCrak
.dh 0x00BB :: .db 0x0E,0x42,0x2F,0x0D,0x3F,0x32,0xE5 // Spikeman DarkCann
.dh 0x00C0 :: .db 0x0E,0x42,0x2F,0x1D,0x34,0x36,0x28,0xE5 // Spikeman DarkSprd
.dh 0x00C1 :: .db 0x0E,0x42,0x2F,0x1D,0x38,0x2B,0xE5 // Spikeman DarkStg
.dh 0x00BC :: .db 0x0E,0x42,0x2F,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman DarkSwrd
.dh 0x00BE :: .db 0x0E,0x42,0x2F,0x20,0x39,0x30,0x27,0xE5 // Spikeman DarkVulc
.dh 0x00BD :: .db 0x0E,0x42,0x2F,0x40,0x45,0xE5 // Spikeman DarkBomb
.dh 0x0000
@@chip_0F:
.dh 0x0064 :: .db 0x0F,0x0D,0x0E,0x3A,0x10,0xE5 // Japanese オウエンカ
.dh 0x011E :: .db 0x0F,0x30,0x29,0x27,0x1A,0x30,0x39,0x37,0xE5 // Spikeman ElecPlus
.dh 0x002A :: .db 0x0F,0x30,0x29,0x27,0x1D,0x2C,0x33,0x2F,0xE5 // Spikeman ElecShok
.dh 0x00D5 :: .db 0x0F,0x30,0x29,0x31,0x0E,0x42,0x2F,0xE5 // Spikeman ElemDark
.dh 0x0019 :: .db 0x0F,0x30,0x29,0x31,0x10,0x30,0x42,0xE5 // Spikeman ElemFlar
.dh 0x001A :: .db 0x0F,0x30,0x29,0x31,0x13,0x27,0x29,0xE5 // Spikeman ElemIce
.dh 0x007E :: .db 0x0F,0x30,0x29,0x31,0x16,0x29,0x25,0x2A,0xE5 // Spikeman ElemLeaf
.dh 0x0080 :: .db 0x0F,0x30,0x29,0x31,0x1D,0x3F,0x28,0xE5 // Spikeman ElemSand
.dh 0x002A :: .db 0x0F,0x31,0x2A,0x28,0x1D,0x2D,0x34,0x30,0xE5 // 2012 demo ElecShok
.dh 0x00D5 :: .db 0x0F,0x31,0x2A,0x32,0x0E,0x26,0x37,0x30,0xE5 // 2012 demo ElemDark
.dh 0x0019 :: .db 0x0F,0x31,0x2A,0x32,0x10,0x31,0x26,0x37,0xE5 // 2012 demo ElemFlar
.dh 0x001A :: .db 0x0F,0x31,0x2A,0x32,0x13,0x28,0x2A,0xE5 // 2012 demo ElemIce
.dh 0x007E :: .db 0x0F,0x31,0x2A,0x32,0x16,0x2A,0x26,0x2B,0xE5 // 2012 demo ElemLeaf
.dh 0x0080 :: .db 0x0F,0x31,0x2A,0x32,0x1D,0x26,0x33,0x29,0xE5 // 2012 demo ElemSand
.dh 0x001E :: .db 0x0F,0x33,0x2A,0x37,0x2C,0x0C,0x34,0x32,0xE5 // 2012 demo EnergBom
.dh 0x001E :: .db 0x0F,0x32,0x41,0x2B,0x40,0x31,0xE5 // Spikeman EnergBom
.dh 0x00CB :: .db 0x0F,0x41,0x44,0x0D,0x15,0x3A,0xE5 // Japanese オジゾウサン
.dh 0x0000
@@chip_10:
.dh 0x003C :: .db 0x10,0x0D,0x3A,0x1A,0x82,0x02,0xE5 // Japanese カウンター1
.dh 0x003D :: .db 0x10,0x0D,0x3A,0x1A,0x82,0x03,0xE5 // Japanese カウンター2
.dh 0x003E :: .db 0x10,0x0D,0x3A,0x1A,0x82,0x04,0xE5 // Japanese カウンター3
.dh 0x0061 :: .db 0x10,0x0D,0x3A,0x1E,0x4E,0x2B,0xE5 // Japanese カウントボム
.dh 0x017B :: .db 0x10,0x10,0x32,0x3E,0x0C,0x14,0xE5 // Japanese カカリゲイコ
.dh 0x008C :: .db 0x10,0x11,0x3E,0x3A,0x11,0x3A,0xE5 // Japanese カキゲンキン
.dh 0x0036 :: .db 0x10,0x17,0x1A,0x2B,0x19,0x82,0x49,0xE5 // Japanese カスタムソード
.dh 0x0064 :: .db 0x10,0x26,0x33,0x2B,0x26,0x37,0x2A,0xE5 // 2012 demo Fanfare
.dh 0x0054 :: .db 0x10,0x26,0x33,0xE5 // 2012 demo Fan
.dh 0x0179 :: .db 0x10,0x26,0x38,0x39,0x10,0x3C,0x29,0xE5 // 2012 demo FastFwd
.dh 0x0060 :: .db 0x10,0x2D,0x3A,0x17,0x22,0x82,0x12,0xE5 // Japanese カモンスネーク
.dh 0x0122 :: .db 0x10,0x2E,0x33,0x26,0x31,0x11,0x3A,0x33,0xE5 // 2012 demo FinalGun
.dh 0x0182 :: .db 0x10,0x2E,0x33,0x26,0x31,0x11,0x3A,0x33,0xE5 // 2012 demo FinalGun
.dh 0x00EA :: .db 0x10,0x2E,0x37,0x2A,0x17,0x26,0x33,0x43,0xE5 // 2012 demo FireManSP
.dh 0x00EB :: .db 0x10,0x2E,0x37,0x2A,0x17,0x26,0x33,0x44,0xE5 // 2012 demo FireManDS
.dh 0x00E9 :: .db 0x10,0x2E,0x37,0x2A,0x17,0x26,0x33,0xE5 // 2012 demo FireMan
.dh 0x011D :: .db 0x10,0x2E,0x37,0x2A,0x1A,0x31,0x3A,0x38,0xE5 // 2012 demo FirePlus
.dh 0x0149 :: .db 0x10,0x30,0x31,0x0D,0x36,0x33,0x37,0x02,0xE5 // Spikeman FlmCros1
.dh 0x014A :: .db 0x10,0x30,0x31,0x0D,0x36,0x33,0x37,0x03,0xE5 // Spikeman FlmCros2
.dh 0x014B :: .db 0x10,0x30,0x31,0x0D,0x36,0x33,0x37,0x04,0xE5 // Spikeman FlmCros3
.dh 0x000C :: .db 0x10,0x30,0x31,0x16,0x43,0x29,0x02,0xE5 // Spikeman FlmLine1
.dh 0x000D :: .db 0x10,0x30,0x31,0x16,0x43,0x29,0x03,0xE5 // Spikeman FlmLine2
.dh 0x000E :: .db 0x10,0x30,0x31,0x16,0x43,0x29,0x04,0xE5 // Spikeman FlmLine3
.dh 0x0149 :: .db 0x10,0x31,0x32,0x0D,0x37,0x34,0x38,0x02,0xE5 // 2012 demo FlmCros1
.dh 0x014A :: .db 0x10,0x31,0x32,0x0D,0x37,0x34,0x38,0x03,0xE5 // 2012 demo FlmCros2
.dh 0x014B :: .db 0x10,0x31,0x32,0x0D,0x37,0x34,0x38,0x04,0xE5 // 2012 demo FlmCros3
.dh 0x000C :: .db 0x10,0x31,0x32,0x16,0x2E,0x33,0x2A,0x02,0xE5 // 2012 demo FlmLine1
.dh 0x000D :: .db 0x10,0x31,0x32,0x16,0x2E,0x33,0x2A,0x03,0xE5 // 2012 demo FlmLine2
.dh 0x000E :: .db 0x10,0x31,0x32,0x16,0x2E,0x33,0x2A,0x04,0xE5 // 2012 demo FlmLine
.dh 0x007F :: .db 0x10,0x31,0x82,0x53,0x0C,0x3A,0x1E,0xE5 // Japanese カラーポイント
.dh 0x0091 :: .db 0x10,0x36,0x32,0x2A,0xE5 // Japanese カワリミ3
.dh 0x0079 :: .db 0x10,0x37,0x38,0x11,0x25,0x39,0x2B,0x29,0xE5 // Spikeman FstGauge
.dh 0x0172 :: .db 0x10,0x38,0x36,0x1D,0x3B,0x33,0x36,0x28,0xE5 // Spikeman FtrSword
.dh 0x0079 :: .db 0x10,0x38,0x39,0x11,0x26,0x3A,0x2C,0x2A,0xE5 // 2012 demo FstGauge
.dh 0x00D1 :: .db 0x10,0x39,0x30,0x30,0x0D,0x39,0x37,0x38,0xE5 // Spikeman FullCust
.dh 0x0172 :: .db 0x10,0x39,0x37,0x1D,0x3C,0x34,0x37,0x29,0xE5 // 2012 demo FtrSword
.dh 0x002D :: .db 0x10,0x3A,0x13,0x1C,0x18,0x3A,0xE5 // Japanese カンケツセン
.dh 0x00D1 :: .db 0x10,0x3A,0x31,0x31,0x0D,0x3A,0x38,0x39,0xE5 // 2012 demo FullCust
.dh 0x0064 :: .db 0x10,0x3F,0x2A,0x42,0x29,0xE5 // Spikeman Fanfare
.dh 0x0054 :: .db 0x10,0x3F,0xE5 // Spikeman Fan
.dh 0x0122 :: .db 0x10,0x43,0x25,0x30,0x11,0x44,0xE5 // Spikeman FinalGun
.dh 0x0182 :: .db 0x10,0x43,0x25,0x30,0x11,0x44,0xE5 // Spikeman FinalGun
.dh 0x00EA :: .db 0x10,0x47,0x29,0x17,0x3F,0x76,0xE5 // Spikeman FireManSP
.dh 0x00EB :: .db 0x10,0x47,0x29,0x17,0x3F,0x77,0xE5 // Spikeman FireManDS
.dh 0x00E9 :: .db 0x10,0x47,0x29,0x17,0x3F,0xE5 // Spikeman FireMan
.dh 0x011D :: .db 0x10,0x47,0x29,0x1A,0x30,0x39,0x37,0xE5 // Spikeman FirePlus
.dh 0x012F :: .db 0x10,0x82,0x17,0x0F,0x4C,0x4A,0x3D,0xE5 // Japanese カースオブバグ
.dh 0x0000
@@chip_11:
.dh 0x007B :: .db 0x11,0x29,0x28,0x28,0x33,0x32,0x02,0xE5 // Spikeman Geddon1
.dh 0x007C :: .db 0x11,0x29,0x28,0x28,0x33,0x32,0x03,0xE5 // Spikeman Geddon2
.dh 0x007D :: .db 0x11,0x29,0x28,0x28,0x33,0x32,0x04,0xE5 // Spikeman Geddon3
.dh 0x002D :: .db 0x11,0x29,0x3D,0x37,0x41,0xE5 // Spikeman Geyser
.dh 0x017C :: .db 0x11,0x2A,0x26,0x37,0x0D,0x2D,0x33,0x2C,0xE5 // 2012 demo GearChng
.dh 0x007B :: .db 0x11,0x2A,0x29,0x29,0x34,0x33,0x02,0xE5 // 2012 demo Geddon1
.dh 0x007C :: .db 0x11,0x2A,0x29,0x29,0x34,0x33,0x03,0xE5 // 2012 demo Geddon2
.dh 0x007D :: .db 0x11,0x2A,0x29,0x29,0x34,0x33,0x04,0xE5 // 2012 demo Geddon3
.dh 0x002D :: .db 0x11,0x2A,0x3E,0x38,0x2A,0x37,0xE5 // 2012 demo Geyser
.dh 0x015A :: .db 0x11,0x2D,0x2B,0x1E,0x2D,0x31,0x0C,0x31,0xE5 // Spikeman GigTimBm
.dh 0x0143 :: .db 0x11,0x2D,0x2B,0x25,0x0D,0x3F,0x02,0xE5 // Spikeman GigaCan1
.dh 0x0144 :: .db 0x11,0x2D,0x2B,0x25,0x0D,0x3F,0x03,0xE5 // Spikeman GigaCan2
.dh 0x0145 :: .db 0x11,0x2D,0x2B,0x25,0x0D,0x3F,0x04,0xE5 // Spikeman GigaCan3
.dh 0x0143 :: .db 0x11,0x2E,0x2C,0x26,0x0D,0x26,0x33,0x02,0xE5 // 2012 demo GigaCan1
.dh 0x0144 :: .db 0x11,0x2E,0x2C,0x26,0x0D,0x26,0x33,0x03,0xE5 // 2012 demo GigaCan2
.dh 0x0145 :: .db 0x11,0x2E,0x2C,0x26,0x0D,0x26,0x33,0x04,0xE5 // 2012 demo GigaCan3
.dh 0x00D7 :: .db 0x11,0x33,0x28,0x12,0x25,0x31,0x31,0x36,0xE5 // Spikeman GodHammr
.dh 0x00D7 :: .db 0x11,0x34,0x29,0x12,0x26,0x32,0x32,0x37,0xE5 // 2012 demo GodHammr
.dh 0x017C :: .db 0x11,0x36,0x0D,0x2C,0x32,0x2B,0xE5 // Spikeman GrChng
.dh 0x0077 :: .db 0x11,0x36,0x25,0x26,0x0C,0x32,0x37,0x2C,0xE5 // Spikeman GrabBnsh
.dh 0x0076 :: .db 0x11,0x36,0x25,0x26,0x1C,0x3A,0x32,0x2B,0xE5 // Spikeman GrabRvng
.dh 0x00B8 :: .db 0x11,0x36,0x29,0x29,0x32,0x21,0x28,0x02,0xE5 // Spikeman GreenWd1
.dh 0x00B9 :: .db 0x11,0x36,0x29,0x29,0x32,0x21,0x28,0x03,0xE5 // Spikeman GreenWd2
.dh 0x00BA :: .db 0x11,0x36,0x29,0x29,0x32,0x21,0x28,0x04,0xE5 // Spikeman GreenWd3
.dh 0x0077 :: .db 0x11,0x37,0x26,0x27,0x0C,0x33,0x38,0x2D,0xE5 // 2012 demo GrabBnsh
.dh 0x0076 :: .db 0x11,0x37,0x26,0x27,0x1C,0x3B,0x33,0x2C,0xE5 // 2012 demo GrabRvng
.dh 0x00B8 :: .db 0x11,0x37,0x2A,0x2A,0x33,0x21,0x29,0x02,0xE5 // 2012 demo GreenWd1
.dh 0x00B9 :: .db 0x11,0x37,0x2A,0x2A,0x33,0x21,0x29,0x03,0xE5 // 2012 demo GreenWd2
.dh 0x00BA :: .db 0x11,0x37,0x2A,0x2A,0x33,0x21,0x29,0x04,0xE5 // 2012 demo GreenWd3
.dh 0x0183 :: .db 0x11,0x38,0x37,0x17,0x27,0x2C,0x11,0x32,0xE5 // Spikeman GtsMchGn
.dh 0x009A :: .db 0x11,0x39,0x38,0x1A,0x32,0x27,0x2C,0x02,0xE5 // Spikeman GutPnch1
.dh 0x009B :: .db 0x11,0x39,0x38,0x1A,0x32,0x27,0x2C,0x03,0xE5 // Spikeman GutPnch2
.dh 0x009C :: .db 0x11,0x39,0x38,0x1A,0x32,0x27,0x2C,0x04,0xE5 // Spikeman GutPnch3
.dh 0x00E1 :: .db 0x11,0x39,0x38,0x37,0x17,0x3F,0x76,0xE5 // Spikeman GutsManSP
.dh 0x00E2 :: .db 0x11,0x39,0x38,0x37,0x17,0x3F,0x77,0xE5 // Spikeman GutsManDS
.dh 0x00E0 :: .db 0x11,0x39,0x38,0x37,0x17,0x3F,0xE5 // Spikeman GutsMan
.dh 0x0058 :: .db 0x11,0x39,0x42,0x28,0x02,0xE5 // Spikeman Guard1
.dh 0x0059 :: .db 0x11,0x39,0x42,0x28,0x03,0xE5 // Spikeman Guard2
.dh 0x005A :: .db 0x11,0x39,0x42,0x28,0x04,0xE5 // Spikeman Guard3
.dh 0x00CB :: .db 0x11,0x39,0x42,0x28,0x2D,0x3F,0xE5 // Spikeman Guardian
.dh 0x0058 :: .db 0x11,0x3A,0x26,0x37,0x29,0x02,0xE5 // 2012 demo Guard1
.dh 0x0059 :: .db 0x11,0x3A,0x26,0x37,0x29,0x03,0xE5 // 2012 demo Guard2
.dh 0x005A :: .db 0x11,0x3A,0x26,0x37,0x29,0x04,0xE5 // 2012 demo Guard3
.dh 0x00CB :: .db 0x11,0x3A,0x26,0x37,0x29,0x2E,0x26,0x33,0xE5 // 2012 demo Guardian
.dh 0x00DB :: .db 0x11,0x3A,0x33,0x0E,0x2A,0x31,0x0F,0x22,0xE5 // 2012 demo GunDelEX
.dh 0x0020 :: .db 0x11,0x3A,0x33,0x0E,0x2A,0x31,0x1D,0x02,0xE5 // 2012 demo GunDelS1
.dh 0x0021 :: .db 0x11,0x3A,0x33,0x0E,0x2A,0x31,0x1D,0x03,0xE5 // 2012 demo GunDelS2
.dh 0x0022 :: .db 0x11,0x3A,0x33,0x0E,0x2A,0x31,0x1D,0x04,0xE5 // 2012 demo GunDelS3
.dh 0x009A :: .db 0x11,0x3A,0x39,0x1A,0x33,0x28,0x2D,0x02,0xE5 // 2012 demo GutPnch1
.dh 0x009B :: .db 0x11,0x3A,0x39,0x1A,0x33,0x28,0x2D,0x03,0xE5 // 2012 demo GutPnch2
.dh 0x009C :: .db 0x11,0x3A,0x39,0x1A,0x33,0x28,0x2D,0x04,0xE5 // 2012 demo GutPnch3
.dh 0x0183 :: .db 0x11,0x3A,0x39,0x38,0x17,0x11,0xE5 // 2012 demo GutsMG
.dh 0x00E1 :: .db 0x11,0x3A,0x39,0x38,0x17,0x26,0x33,0x43,0xE5 // 2012 demo GutsManSP
.dh 0x00E2 :: .db 0x11,0x3A,0x39,0x38,0x17,0x26,0x33,0x44,0xE5 // 2012 demo GutsManDS
.dh 0x00E0 :: .db 0x11,0x3A,0x39,0x38,0x17,0x26,0x33,0xE5 // 2012 demo GutsMan
.dh 0x0020 :: .db 0x11,0x44,0x1D,0x46,0x02,0xE5 // Spikeman GunSol1
.dh 0x0021 :: .db 0x11,0x44,0x1D,0x46,0x03,0xE5 // Spikeman GunSol2
.dh 0x0022 :: .db 0x11,0x44,0x1D,0x46,0x04,0xE5 // Spikeman GunSol3
.dh 0x00DB :: .db 0x11,0x44,0x1D,0x46,0x0F,0x22,0xE5 // Spikeman GunSolEX
.dh 0x011A :: .db 0x11,0x5A,0x23,0x3A,0x2D,0x82,0x49,0xE5 // Japanese キャノンモード
.dh 0x0001 :: .db 0x11,0x5A,0x23,0x3A,0xE5 // Japanese キャノン
.dh 0x0000
@@chip_12:
.dh 0x0079 :: .db 0x12,0x0C,0x59,0x12,0x3E,0x82,0x41,0xE5 // Japanese クイックゲージ
.dh 0x00A9 :: .db 0x12,0x25,0x3B,0x2F,0x0D,0x39,0x38,0x02,0xE5 // Spikeman HawkCut1
.dh 0x00AA :: .db 0x12,0x25,0x3B,0x2F,0x0D,0x39,0x38,0x03,0xE5 // Spikeman HawkCut2
.dh 0x00AB :: .db 0x12,0x25,0x3B,0x2F,0x0D,0x39,0x38,0x04,0xE5 // Spikeman HawkCut3
.dh 0x0179 :: .db 0x12,0x25,0x3D,0x25,0x33,0xE5 // Spikeman Hayao
.dh 0x00A9 :: .db 0x12,0x26,0x3C,0x30,0x0D,0x3A,0x39,0x02,0xE5 // 2012 demo HawkCut1
.dh 0x00AA :: .db 0x12,0x26,0x3C,0x30,0x0D,0x3A,0x39,0x03,0xE5 // 2012 demo HawkCut2
.dh 0x00AB :: .db 0x12,0x26,0x3C,0x30,0x0D,0x3A,0x39,0x04,0xE5 // 2012 demo HawkCut3
.dh 0x0006 :: .db 0x12,0x29,0x25,0x38,0x0C,0x36,0x38,0x2C,0xE5 // Spikeman HeatBrth
.dh 0x0013 :: .db 0x12,0x29,0x25,0x38,0x1D,0x2C,0x33,0x38,0xE5 // Spikeman HeatShot
.dh 0x0015 :: .db 0x12,0x29,0x25,0x38,0x1D,0x2D,0x28,0x29,0xE5 // Spikeman HeatSide
.dh 0x0141 :: .db 0x12,0x29,0x25,0x38,0x1D,0x34,0x36,0x28,0xE5 // Spikeman HeatSprd
.dh 0x0014 :: .db 0x12,0x29,0x25,0x38,0x82,0x20,0xE5 // Spikeman Heat-V
.dh 0x014C :: .db 0x12,0x29,0x30,0x30,0x0C,0x31,0x36,0x02,0xE5 // Spikeman HellBmr1
.dh 0x014D :: .db 0x12,0x29,0x30,0x30,0x0C,0x31,0x36,0x03,0xE5 // Spikeman HellBmr2
.dh 0x014E :: .db 0x12,0x29,0x30,0x30,0x0C,0x31,0x36,0x04,0xE5 // Spikeman HellBmr3
.dh 0x0006 :: .db 0x12,0x2A,0x26,0x39,0x0C,0x37,0x39,0x2D,0xE5 // 2012 demo HeatBrth
.dh 0x0013 :: .db 0x12,0x2A,0x26,0x39,0x1D,0x2D,0x34,0x39,0xE5 // 2012 demo HeatShot
.dh 0x0015 :: .db 0x12,0x2A,0x26,0x39,0x1D,0x2E,0x29,0x2A,0xE5 // 2012 demo HeatSide
.dh 0x0141 :: .db 0x12,0x2A,0x26,0x39,0x1D,0x35,0x37,0x29,0xE5 // 2012 demo HeatSprd
.dh 0x0014 :: .db 0x12,0x2A,0x26,0x39,0x49,0x20,0xE5 // English Heat-V
.dh 0x0014 :: .db 0x12,0x2A,0x26,0x39,0x98,0x20,0xE5 // 2012 demo Heat-V
.dh 0x0002 :: .db 0x12,0x2D,0x0D,0x3F,0x32,0x33,0x32,0xE5 // Spikeman HiCannon
.dh 0x0002 :: .db 0x12,0x2E,0x0D,0x26,0x33,0x33,0x34,0x33,0xE5 // 2012 demo HiCannon
.dh 0x005B :: .db 0x12,0x31,0x59,0x12,0x0B,0x0D,0x1E,0xE5 // Japanese クラックアウト
.dh 0x0133 :: .db 0x12,0x34,0x31,0x3E,0x0E,0x37,0x2A,0x32,0xE5 // 2012 demo HolyDrem
.dh 0x008B :: .db 0x12,0x34,0x31,0x3E,0x1A,0x26,0x33,0x31,0xE5 // 2012 demo HolyPanl
.dh 0x0176 :: .db 0x12,0x35,0x17,0x19,0x82,0x49,0xE5 // Japanese クロスソード
.dh 0x015D :: .db 0x12,0x3D,0x34,0x36,0x0C,0x36,0x37,0x38,0xE5 // Spikeman HyprBrst
.dh 0x0052 :: .db 0x12,0x46,0x29,0xE5 // Spikeman Hole
.dh 0x0133 :: .db 0x12,0x46,0x3D,0x0E,0x36,0x29,0x31,0xE5 // Spikeman HolyDrem
.dh 0x008B :: .db 0x12,0x46,0x3D,0x1A,0x3F,0x30,0xE5 // Spikeman HolyPanl
.dh 0x015D :: .db 0x12,0x49,0x0C,0x3A,0x37,0x38,0x39,0xE5 // English H-Burst
.dh 0x015D :: .db 0x12,0x98,0x0C,0x3A,0x37,0x38,0x39,0xE5 // 2012 demo H-Burst
.dh 0x0000
@@chip_13:
.dh 0x017E :: .db 0x13,0x27,0x29,0x0D,0x39,0x26,0x29,0xE5 // Spikeman IceCube
.dh 0x017E :: .db 0x13,0x28,0x2A,0x0D,0x3A,0x27,0x2A,0xE5 // 2012 demo IceCube
.dh 0x0085 :: .db 0x13,0x32,0x3A,0x2D,0x37,0xE5 // Spikeman Invis
.dh 0x0085 :: .db 0x13,0x33,0x3B,0x2E,0x38,0x2E,0x27,0x31,0xE5 // 2012 demo Invisibl
.dh 0x0085 :: .db 0x13,0x33,0x3B,0x2E,0x38,0xE5 // English Invis
.dh 0x0185 :: .db 0x13,0x3B,0x25,0x02,0xE5 // Spikeman Iwa1
.dh 0x0186 :: .db 0x13,0x3B,0x25,0x03,0xE5 // Spikeman Iwa2
.dh 0x0115 :: .db 0x13,0x3A,0x49,0x82,0x29,0x3A,0x61,0x70,0xE5 // Japanese ケンドーマンDS
.dh 0x0114 :: .db 0x13,0x3A,0x49,0x82,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ケンドーマンSP
.dh 0x0113 :: .db 0x13,0x3A,0x49,0x82,0x29,0x3A,0xE5 // Japanese ケンドーマン
.dh 0x0000
@@chip_14:
.dh 0x00D4 :: .db 0x14,0x29,0x25,0x30,0x33,0x39,0x37,0x3D,0xE5 // Spikeman Jealousy
.dh 0x00D4 :: .db 0x14,0x2A,0x26,0x31,0x34,0x3A,0x38,0x3E,0xE5 // 2012 demo Jealousy
.dh 0x00F9 :: .db 0x14,0x3A,0x33,0x30,0x17,0x26,0x33,0x43,0xE5 // 2012 demo JunkManSP
.dh 0x00FA :: .db 0x14,0x3A,0x33,0x30,0x17,0x26,0x33,0x44,0xE5 // 2012 demo JunkManDS
.dh 0x00F8 :: .db 0x14,0x3A,0x33,0x30,0x17,0x26,0x33,0xE5 // 2012 demo JunkMan
.dh 0x00F9 :: .db 0x14,0x44,0x2F,0x17,0x3F,0x76,0xE5 // Spikeman JunkManSP
.dh 0x00FA :: .db 0x14,0x44,0x2F,0x17,0x3F,0x77,0xE5 // Spikeman JunkManDS
.dh 0x00F8 :: .db 0x14,0x44,0x2F,0x17,0x3F,0xE5 // Spikeman JunkMan
.dh 0x0094 :: .db 0x14,0x50,0x82,0x45,0x2C,0x82,0x41,0xE5 // Japanese コピーダメージ
.dh 0x010C :: .db 0x14,0x82,0x33,0x49,0x29,0x3A,0x61,0x70,0xE5 // Japanese コールドマンDS
.dh 0x010B :: .db 0x14,0x82,0x33,0x49,0x29,0x3A,0x70,0x6D,0xE5 // Japanese コールドマンSP
.dh 0x010A :: .db 0x14,0x82,0x33,0x49,0x29,0x3A,0xE5 // Japanese コールドマン
.dh 0x0000
@@chip_15:
.dh 0x0007 :: .db 0x15,0x0C,0x34,0x3A,0x17,0xE5 // Japanese サイレンス
.dh 0x004E :: .db 0x15,0x0C,0x49,0x4A,0x3A,0x4C,0x82,0x02,0xE5 // Japanese サイドバンブー1
.dh 0x004F :: .db 0x15,0x0C,0x49,0x4A,0x3A,0x4C,0x82,0x03,0xE5 // Japanese サイドバンブー2
.dh 0x0050 :: .db 0x15,0x0C,0x49,0x4A,0x3A,0x4C,0x82,0x04,0xE5 // Japanese サイドバンブー3
.dh 0x017B :: .db 0x15,0x25,0x2F,0x42,0x2D,0xE5 // Spikeman Kakari
.dh 0x0114 :: .db 0x15,0x29,0x32,0x28,0x33,0x17,0x32,0x76,0xE5 // Spikeman KendoMnSP
.dh 0x0115 :: .db 0x15,0x29,0x32,0x28,0x33,0x17,0x32,0x77,0xE5 // Spikeman KendoMnDS
.dh 0x0113 :: .db 0x15,0x29,0x32,0x28,0x33,0x17,0x3F,0xE5 // Spikeman KendoMan
.dh 0x0113 :: .db 0x15,0x2A,0x33,0x29,0x34,0x17,0x26,0x33,0xE5 // 2012 demo KendoMan
.dh 0x0114 :: .db 0x15,0x2A,0x33,0x29,0x34,0x17,0x33,0x43,0xE5 // 2012 demo KendoMnSP
.dh 0x0115 :: .db 0x15,0x2A,0x33,0x29,0x34,0x17,0x33,0x44,0xE5 // 2012 demo KendoMnDS
.dh 0x00D0 :: .db 0x15,0x3A,0x12,0x1B,0x5B,0x0B,0x32,0xE5 // Japanese サンクチュアリ
.dh 0x00EE :: .db 0x15,0x3A,0x45,0x82,0x29,0x3A,0x61,0x70,0xE5 // Japanese サンダーマンDS
.dh 0x00ED :: .db 0x15,0x3A,0x45,0x82,0x29,0x3A,0x70,0x6D,0xE5 // Japanese サンダーマンSP
.dh 0x00EC :: .db 0x15,0x3A,0x45,0x82,0x29,0x3A,0xE5 // Japanese サンダーマン
.dh 0x0039 :: .db 0x15,0x3A,0x45,0x82,0x4E,0x82,0x33,0x02,0xE5 // Japanese サンダーボール1
.dh 0x003A :: .db 0x15,0x3A,0x45,0x82,0x4E,0x82,0x33,0x03,0xE5 // Japanese サンダーボール2
.dh 0x003B :: .db 0x15,0x3A,0x45,0x82,0x4E,0x82,0x33,0x04,0xE5 // Japanese サンダーボール3
.dh 0x011E :: .db 0x15,0x3A,0x45,0x82,0x51,0x31,0x17,0xE5 // Japanese サンダープラス
.dh 0x002F :: .db 0x15,0x3A,0x49,0x32,0x3A,0x3D,0xE5 // Japanese サンドリング
.dh 0x0042 :: .db 0x15,0x82,0x12,0x33,0x3B,0x3A,0x02,0xE5 // Japanese サークルガン1
.dh 0x0043 :: .db 0x15,0x82,0x12,0x33,0x3B,0x3A,0x03,0xE5 // Japanese サークルガン2
.dh 0x0044 :: .db 0x15,0x82,0x12,0x33,0x3B,0x3A,0x04,0xE5 // Japanese サークルガン3
.dh 0x00E8 :: .db 0x15,0x82,0x1B,0x29,0x3A,0x61,0x70,0xE5 // Japanese サーチマンDS
.dh 0x00E7 :: .db 0x15,0x82,0x1B,0x29,0x3A,0x70,0x6D,0xE5 // Japanese サーチマンSP
.dh 0x00E6 :: .db 0x15,0x82,0x1B,0x29,0x3A,0xE5 // Japanese サーチマン
.dh 0x00A0 :: .db 0x15,0x82,0x1B,0x4E,0x2B,0x02,0xE5 // Japanese サーチボム1
.dh 0x00A1 :: .db 0x15,0x82,0x1B,0x4E,0x2B,0x03,0xE5 // Japanese サーチボム2
.dh 0x00A2 :: .db 0x15,0x82,0x1B,0x4E,0x2B,0x04,0xE5 // Japanese サーチボム3
.dh 0x0000
@@chip_16:
.dh 0x0111 :: .db 0x16,0x25,0x37,0x41,0x17,0x32,0x76,0xE5 // Spikeman LaserMnSP
.dh 0x0112 :: .db 0x16,0x25,0x37,0x41,0x17,0x32,0x77,0xE5 // Spikeman LaserMnDS
.dh 0x0110 :: .db 0x16,0x25,0x37,0x41,0x17,0x3F,0xE5 // Spikeman LaserMan
.dh 0x0051 :: .db 0x16,0x26,0x33,0x28,0x2A,0xE5 // 2012 demo Lance
.dh 0x0110 :: .db 0x16,0x26,0x38,0x2A,0x37,0x17,0x26,0x33,0xE5 // 2012 demo LaserMan
.dh 0x0111 :: .db 0x16,0x26,0x38,0x2A,0x37,0x17,0x33,0x43,0xE5 // 2012 demo LaserMnSP
.dh 0x0112 :: .db 0x16,0x26,0x38,0x2A,0x37,0x17,0x33,0x44,0xE5 // 2012 demo LaserMnDS
.dh 0x00C9 :: .db 0x16,0x2D,0x2A,0x29,0x0B,0x39,0x36,0x25,0xE5 // Spikeman LifeAura
.dh 0x001C :: .db 0x16,0x2D,0x2A,0x29,0x1D,0x3D,0x32,0x27,0xE5 // Spikeman LifeSync
.dh 0x00A6 :: .db 0x16,0x2D,0x2B,0x38,0x32,0x43,0x02,0xE5 // Spikeman Ligtnin1
.dh 0x00A7 :: .db 0x16,0x2D,0x2B,0x38,0x32,0x43,0x03,0xE5 // Spikeman Ligtnin2
.dh 0x00A8 :: .db 0x16,0x2D,0x2B,0x38,0x32,0x43,0x04,0xE5 // Spikeman Ligtnin3
.dh 0x00C9 :: .db 0x16,0x2E,0x2B,0x2A,0x0B,0x3A,0x37,0x26,0xE5 // 2012 demo LifeAura
.dh 0x0158 :: .db 0x16,0x2E,0x2B,0x2A,0x1D,0x37,0x29,0xE5 // 2012 demo LifeSrd
.dh 0x001C :: .db 0x16,0x2E,0x2B,0x2A,0x1D,0x3E,0x33,0x28,0xE5 // 2012 demo LifeSync
.dh 0x00A6 :: .db 0x16,0x2E,0x2C,0x39,0x33,0x2E,0x33,0x02,0xE5 // 2012 demo Ligtnin1
.dh 0x00A7 :: .db 0x16,0x2E,0x2C,0x39,0x33,0x2E,0x33,0x03,0xE5 // 2012 demo Ligtnin2
.dh 0x00A8 :: .db 0x16,0x2E,0x2C,0x39,0x33,0x2E,0x33,0x04,0xE5 // 2012 demo Ligtnin3
.dh 0x0092 :: .db 0x16,0x31,0x24,0x49,0x32,0xE5 // Japanese シラハドリ
.dh 0x0034 :: .db 0x16,0x33,0x32,0x2B,0x0C,0x30,0x28,0x29,0xE5 // Spikeman LongBlde
.dh 0x0032 :: .db 0x16,0x33,0x32,0x2B,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman LongSwrd
.dh 0x0034 :: .db 0x16,0x34,0x33,0x2C,0x0C,0x31,0x29,0x2A,0xE5 // 2012 demo LongBlde
.dh 0x0032 :: .db 0x16,0x34,0x33,0x2C,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo LongSwrd
.dh 0x0131 :: .db 0x16,0x3D,0x1F,0x33,0x34,0x59,0x49,0xE5 // Japanese シグナルレッド
.dh 0x0051 :: .db 0x16,0x3F,0x27,0x29,0xE5 // Spikeman Lance
.dh 0x0106 :: .db 0x16,0x57,0x82,0x49,0x29,0x3A,0x61,0x70,0xE5 // Japanese シェードマンDS
.dh 0x0105 :: .db 0x16,0x57,0x82,0x49,0x29,0x3A,0x70,0x6D,0xE5 // Japanese シェードマンSP
.dh 0x0104 :: .db 0x16,0x57,0x82,0x49,0x29,0x3A,0xE5 // Japanese シェードマン
.dh 0x0000
@@chip_17:
.dh 0x0054 :: .db 0x17,0x0C,0x14,0x2A,0xE5 // Japanese スイコミ
.dh 0x0076 :: .db 0x17,0x1B,0x82,0x33,0x32,0x4D,0x3A,0x41,0xE5 // Japanese スチールリベンジ
.dh 0x005F :: .db 0x17,0x1B,0x82,0x33,0x43,0x32,0x82,0xE5 // Japanese スチールゼリー
.dh 0x0077 :: .db 0x17,0x1B,0x82,0x33,0x4F,0x20,0x16,0x5B,0xE5 // Japanese スチールパニシュ
.dh 0x0062 :: .db 0x17,0x1D,0x33,0x17,0x29,0x0C,0x3A,0xE5 // Japanese ステルスマイン
.dh 0x0063 :: .db 0x17,0x1E,0x82,0x3A,0x11,0x5B,0x82,0x4C,0xE5 // Japanese ストーンキューブ
.dh 0x014F :: .db 0x17,0x25,0x28,0x10,0x3F,0x2B,0x02,0xE5 // Spikeman MadFang1
.dh 0x0150 :: .db 0x17,0x25,0x28,0x10,0x3F,0x2B,0x03,0xE5 // Spikeman MadFang2
.dh 0x0151 :: .db 0x17,0x25,0x28,0x10,0x3F,0x2B,0x04,0xE5 // Spikeman MadFang3
.dh 0x005E :: .db 0x17,0x25,0x2B,0x32,0x39,0x31,0xE5 // Spikeman Magnum
.dh 0x0023 :: .db 0x17,0x25,0x2B,0x40,0x30,0x38,0x02,0xE5 // Spikeman MagBolt1
.dh 0x0024 :: .db 0x17,0x25,0x2B,0x40,0x30,0x38,0x03,0xE5 // Spikeman MagBolt2
.dh 0x0025 :: .db 0x17,0x25,0x2B,0x40,0x30,0x38,0x04,0xE5 // Spikeman MagBolt3
.dh 0x017A :: .db 0x17,0x25,0x2F,0x2D,0x31,0xE5 // Spikeman Makim
.dh 0x0023 :: .db 0x17,0x26,0x2C,0x0C,0x34,0x31,0x39,0x02,0xE5 // 2012 demo MagBolt1
.dh 0x0024 :: .db 0x17,0x26,0x2C,0x0C,0x34,0x31,0x39,0x03,0xE5 // 2012 demo MagBolt2
.dh 0x0025 :: .db 0x17,0x26,0x2C,0x0C,0x34,0x31,0x39,0x04,0xE5 // 2012 demo MagBolt3
.dh 0x0155 :: .db 0x17,0x26,0x2C,0x1D,0x2D,0x34,0x30,0x02,0xE5 // 2012 demo MagShok1
.dh 0x0156 :: .db 0x17,0x26,0x2C,0x1D,0x2D,0x34,0x30,0x03,0xE5 // 2012 demo MagShok2
.dh 0x0157 :: .db 0x17,0x26,0x2C,0x1D,0x2D,0x34,0x30,0x04,0xE5 // 2012 demo MagShok3
.dh 0x005E :: .db 0x17,0x26,0x2C,0x33,0x3A,0x32,0xE5 // 2012 demo Magnum
.dh 0x0119 :: .db 0x17,0x26,0x37,0x30,0x2E,0x33,0x2C,0xE5 // 2012 demo Marking
.dh 0x001F :: .db 0x17,0x29,0x2B,0x0F,0x32,0x40,0x31,0xE5 // Spikeman MegEnBom
.dh 0x005F :: .db 0x17,0x29,0x38,0x25,0x11,0x29,0x30,0xE5 // Spikeman MetaGel
.dh 0x00F6 :: .db 0x17,0x29,0x38,0x25,0x30,0x17,0x32,0x76,0xE5 // Spikeman MetalMnSP
.dh 0x00F7 :: .db 0x17,0x29,0x38,0x25,0x30,0x17,0x32,0x77,0xE5 // Spikeman MetalMnDS
.dh 0x00F5 :: .db 0x17,0x29,0x38,0x25,0x30,0x17,0x3F,0xE5 // Spikeman MetalMan
.dh 0x00A3 :: .db 0x17,0x29,0x38,0x29,0x33,0x36,0x37,0x02,0xE5 // Spikeman Meteors1
.dh 0x00A4 :: .db 0x17,0x29,0x38,0x29,0x33,0x36,0x37,0x03,0xE5 // Spikeman Meteors2
.dh 0x00A5 :: .db 0x17,0x29,0x38,0x29,0x33,0x36,0x37,0x04,0xE5 // Spikeman Meteors3
.dh 0x00AF :: .db 0x17,0x29,0x38,0x30,0x11,0x41,0x02,0xE5 // Spikeman MetlGer1
.dh 0x00B0 :: .db 0x17,0x29,0x38,0x30,0x11,0x41,0x03,0xE5 // Spikeman MetlGer2
.dh 0x00B1 :: .db 0x17,0x29,0x38,0x30,0x11,0x41,0x04,0xE5 // Spikeman MetlGer3
.dh 0x001F :: .db 0x17,0x2A,0x2C,0x0F,0x33,0x0C,0x34,0x32,0xE5 // 2012 demo MegEnBom
.dh 0x005F :: .db 0x17,0x2A,0x39,0x26,0x11,0x2A,0x31,0xE5 // 2012 demo MetaGel
.dh 0x00F5 :: .db 0x17,0x2A,0x39,0x26,0x31,0x17,0x26,0x33,0xE5 // 2012 demo MetalMan
.dh 0x00F6 :: .db 0x17,0x2A,0x39,0x26,0x31,0x17,0x33,0x43,0xE5 // 2012 demo MetalMnSP
.dh 0x00F7 :: .db 0x17,0x2A,0x39,0x26,0x31,0x17,0x33,0x44,0xE5 // 2012 demo MetalMnDS
.dh 0x00A3 :: .db 0x17,0x2A,0x39,0x2A,0x34,0x37,0x38,0x02,0xE5 // 2012 demo Meteors1
.dh 0x00A4 :: .db 0x17,0x2A,0x39,0x2A,0x34,0x37,0x38,0x03,0xE5 // 2012 demo Meteors2
.dh 0x00A5 :: .db 0x17,0x2A,0x39,0x2A,0x34,0x37,0x38,0x04,0xE5 // 2012 demo Meteors3
.dh 0x0187 :: .db 0x17,0x2A,0x39,0x31,0x11,0x2A,0x26,0x37,0xE5 // English MetlGear
.dh 0x00AF :: .db 0x17,0x2A,0x39,0x31,0x11,0x2A,0x37,0x02,0xE5 // 2012 demo MetlGer1
.dh 0x00B0 :: .db 0x17,0x2A,0x39,0x31,0x11,0x2A,0x37,0x03,0xE5 // 2012 demo MetlGer2
.dh 0x00B1 :: .db 0x17,0x2A,0x39,0x31,0x11,0x2A,0x37,0x04,0xE5 // 2012 demo MetlGer3
.dh 0x0187 :: .db 0x17,0x2A,0x39,0x31,0x11,0x2A,0x37,0xE5 // 2012 demo MetlGer
.dh 0x0155 :: .db 0x17,0x2B,0x1D,0x2C,0x33,0x2F,0x02,0xE5 // Spikeman MgShok1
.dh 0x0156 :: .db 0x17,0x2B,0x1D,0x2C,0x33,0x2F,0x03,0xE5 // Spikeman MgShok2
.dh 0x0157 :: .db 0x17,0x2B,0x1D,0x2C,0x33,0x2F,0x04,0xE5 // Spikeman MgShok3
.dh 0x0062 :: .db 0x17,0x2E,0x33,0x2A,0xE5 // 2012 demo Mine
.dh 0x001D :: .db 0x17,0x2E,0x33,0x2E,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo MiniBomb
.dh 0x0082 :: .db 0x17,0x33,0x2F,0x33,0x1C,0x39,0x37,0x02,0xE5 // Spikeman MokoRus1
.dh 0x0083 :: .db 0x17,0x33,0x2F,0x33,0x1C,0x39,0x37,0x03,0xE5 // Spikeman MokoRus2
.dh 0x0084 :: .db 0x17,0x33,0x2F,0x33,0x1C,0x39,0x37,0x04,0xE5 // Spikeman MokoRus3
.dh 0x0082 :: .db 0x17,0x34,0x30,0x34,0x1C,0x3A,0x38,0x02,0xE5 // 2012 demo MokoRus1
.dh 0x0083 :: .db 0x17,0x34,0x30,0x34,0x1C,0x3A,0x38,0x03,0xE5 // 2012 demo MokoRus2
.dh 0x0084 :: .db 0x17,0x34,0x30,0x34,0x1C,0x3A,0x38,0x04,0xE5 // 2012 demo MokoRus3
.dh 0x0187 :: .db 0x17,0x38,0x30,0x11,0x29,0x42,0xE5 // Spikeman MtlGear
.dh 0x00CA :: .db 0x17,0x39,0x36,0x25,0x31,0x25,0x37,0x25,0xE5 // Spikeman Muramasa
.dh 0x00CA :: .db 0x17,0x3A,0x37,0x26,0x32,0x26,0x38,0x26,0xE5 // 2012 demo Muramasa
.dh 0x0119 :: .db 0x17,0x42,0x2F,0x43,0x2B,0xE5 // Spikeman Marking
.dh 0x0062 :: .db 0x17,0x43,0x29,0xE5 // Spikeman Mine
.dh 0x001D :: .db 0x17,0x43,0x2D,0x40,0x45,0xE5 // Spikeman MiniBomb
.dh 0x0003 :: .db 0x17,0x49,0x0D,0x26,0x33,0x33,0x34,0x33,0xE5 // English M-Cannon
.dh 0x010F :: .db 0x17,0x4F,0x82,0x12,0x29,0x3A,0x61,0x70,0xE5 // Japanese スパークマンDS
.dh 0x010E :: .db 0x17,0x4F,0x82,0x12,0x29,0x3A,0x70,0x6D,0xE5 // Japanese スパークマンSP
.dh 0x010D :: .db 0x17,0x4F,0x82,0x12,0x29,0x3A,0xE5 // Japanese スパークマン
.dh 0x0012 :: .db 0x17,0x51,0x34,0x59,0x49,0x3B,0x3A,0xE5 // Japanese スプレッドガン
.dh 0x0003 :: .db 0x17,0x82,0x0D,0x3F,0x32,0x33,0x32,0xE5 // Spikeman M-Cannon
.dh 0x008A :: .db 0x17,0x82,0x4F,0x82,0x11,0x1A,0x10,0x43,0xE5 // Japanese スーパーキタカゼ
.dh 0x0177 :: .db 0x17,0x82,0x4F,0x82,0x19,0x20,0x59,0x12,0xE5 // Japanese スーパーソニック
.dh 0x0146 :: .db 0x17,0x82,0x4F,0x82,0x36,0x0C,0x49,0x02,0xE5 // Japanese スーパーワイド1
.dh 0x0147 :: .db 0x17,0x82,0x4F,0x82,0x36,0x0C,0x49,0x03,0xE5 // Japanese スーパーワイド2
.dh 0x0148 :: .db 0x17,0x82,0x4F,0x82,0x36,0x0C,0x49,0x04,0xE5 // Japanese スーパーワイド3
.dh 0x00DC :: .db 0x17,0x82,0x4F,0x82,0x4A,0x33,0x10,0x3A,0xE5 // Japanese スーパーバルカン
.dh 0x0003 :: .db 0x17,0x98,0x0D,0x26,0x33,0x33,0x34,0x33,0xE5 // 2012 demo M-Cannon
.dh 0x0000
@@chip_18:
.dh 0x0096 :: .db 0x18,0x25,0x3A,0x2D,0x7F,0x03,0x01,0xE5 // Spikeman Navi+20
.dh 0x0096 :: .db 0x18,0x26,0x3B,0x2E,0x48,0x03,0x01,0xE5 // English Navi+20
.dh 0x0096 :: .db 0x18,0x26,0x3B,0x2E,0x9E,0x03,0x01,0xE5 // 2012 demo Navi+20
.dh 0x00D9 :: .db 0x18,0x29,0x33,0x20,0x42,0x2D,0xE5 // Spikeman NeoVari
.dh 0x00D9 :: .db 0x18,0x2A,0x34,0x20,0x26,0x37,0x2E,0xE5 // 2012 demo NeoVari
.dh 0x0174 :: .db 0x18,0x36,0x2D,0xE5 // Spikeman Nri
.dh 0x008A :: .db 0x18,0x36,0x38,0x2C,0x21,0x43,0x28,0xE5 // Spikeman NrthWind
.dh 0x008A :: .db 0x18,0x37,0x39,0x2D,0x21,0x2E,0x33,0x29,0xE5 // 2012 demo NrthWind
.dh 0x00AC :: .db 0x18,0x39,0x45,0x36,0x0C,0x30,0x02,0xE5 // Spikeman NumbrBl1
.dh 0x00AD :: .db 0x18,0x39,0x45,0x36,0x0C,0x30,0x03,0xE5 // Spikeman NumbrBl2
.dh 0x00AE :: .db 0x18,0x39,0x45,0x36,0x0C,0x30,0x04,0xE5 // Spikeman NumbrBl3
.dh 0x00F3 :: .db 0x18,0x39,0x45,0x36,0x17,0x32,0x76,0xE5 // Spikeman NumbrMnSP
.dh 0x00F4 :: .db 0x18,0x39,0x45,0x36,0x17,0x32,0x77,0xE5 // Spikeman NumbrMnDS
.dh 0x00F2 :: .db 0x18,0x39,0x45,0x41,0x17,0x32,0xE5 // Spikeman NumberMn
.dh 0x00AC :: .db 0x18,0x3A,0x32,0x27,0x37,0x0C,0x31,0x02,0xE5 // 2012 demo NumbrBl1
.dh 0x00AD :: .db 0x18,0x3A,0x32,0x27,0x37,0x0C,0x31,0x03,0xE5 // 2012 demo NumbrBl2
.dh 0x00AE :: .db 0x18,0x3A,0x32,0x27,0x37,0x0C,0x31,0x04,0xE5 // 2012 demo NumbrBl3
.dh 0x00F2 :: .db 0x18,0x3A,0x32,0x27,0x37,0x17,0x26,0x33,0xE5 // 2012 demo NumbrMan
.dh 0x00F3 :: .db 0x18,0x3A,0x32,0x27,0x37,0x17,0x33,0x43,0xE5 // 2012 demo NumbrMnSP
.dh 0x00F4 :: .db 0x18,0x3A,0x32,0x27,0x37,0x17,0x33,0x44,0xE5 // 2012 demo NumbrMnDS
.dh 0x0000
@@chip_19:
.dh 0x0173 :: .db 0x19,0x20,0x59,0x12,0x4C,0x82,0x2B,0xE5 // Japanese ソニックブーム
.dh 0x011C :: .db 0x19,0x82,0x49,0x2D,0x82,0x49,0xE5 // Japanese ソードモード
.dh 0x0030 :: .db 0x19,0x82,0x49,0xE5 // Japanese ソード
.dh 0x0000
@@chip_1A:
.dh 0x0074 :: .db 0x1A,0x26,0x33,0x31,0x11,0x37,0x26,0x27,0xE5 // 2012 demo PanlGrab
.dh 0x00B2 :: .db 0x1A,0x26,0x33,0x31,0x1D,0x2D,0x39,0x02,0xE5 // 2012 demo PanlSht1
.dh 0x00B3 :: .db 0x1A,0x26,0x33,0x31,0x1D,0x2D,0x39,0x03,0xE5 // 2012 demo PanlSht2
.dh 0x00B4 :: .db 0x1A,0x26,0x33,0x31,0x1D,0x2D,0x39,0x04,0xE5 // 2012 demo PanlSht3
.dh 0x0159 :: .db 0x1A,0x2D,0x30,0x29,0x0E,0x36,0x3A,0x36,0xE5 // Spikeman PileDrvr
.dh 0x0152 :: .db 0x1A,0x2D,0x38,0x12,0x33,0x27,0x2F,0x02,0xE5 // Spikeman PitHock1
.dh 0x0153 :: .db 0x1A,0x2D,0x38,0x12,0x33,0x27,0x2F,0x03,0xE5 // Spikeman PitHock2
.dh 0x0154 :: .db 0x1A,0x2D,0x38,0x12,0x33,0x27,0x2F,0x04,0xE5 // Spikeman PitHock3
.dh 0x0159 :: .db 0x1A,0x2E,0x31,0x2A,0x0E,0x37,0x3B,0x37,0xE5 // 2012 demo PileDrvr
.dh 0x0152 :: .db 0x1A,0x2E,0x39,0x12,0x34,0x30,0x3E,0x02,0xE5 // 2012 demo PitHoky1
.dh 0x0153 :: .db 0x1A,0x2E,0x39,0x12,0x34,0x30,0x3E,0x03,0xE5 // 2012 demo PitHoky2
.dh 0x0154 :: .db 0x1A,0x2E,0x39,0x12,0x34,0x30,0x3E,0x04,0xE5 // 2012 demo PitHoky3
.dh 0x014C :: .db 0x1A,0x2E,0x39,0x1C,0x33,0x2C,0x02,0xE5 // 2012 demo PitRng1
.dh 0x014D :: .db 0x1A,0x2E,0x39,0x1C,0x33,0x2C,0x03,0xE5 // 2012 demo PitRng2
.dh 0x014E :: .db 0x1A,0x2E,0x39,0x1C,0x33,0x2C,0x04,0xE5 // 2012 demo PitRng3
.dh 0x007A :: .db 0x1A,0x32,0x30,0x1C,0x29,0x38,0x36,0x32,0xE5 // Spikeman PnlRetrn
.dh 0x0086 :: .db 0x1A,0x33,0x34,0x39,0x34,0xE5 // Spikeman Popup
.dh 0x007A :: .db 0x1A,0x33,0x31,0x1C,0x2A,0x39,0x37,0x33,0xE5 // 2012 demo PnlRetrn
.dh 0x015B :: .db 0x1A,0x34,0x2E,0x38,0x1A,0x2D,0x26,0x37,0xE5 // 2012 demo PoisPhar
.dh 0x017D :: .db 0x1A,0x34,0x31,0x39,0x37,0x2C,0x38,0x39,0xE5 // 2012 demo Poltrgst
.dh 0x0086 :: .db 0x1A,0x34,0x35,0x1F,0x35,0xE5 // 2012 demo PopUp
.dh 0x009D :: .db 0x1A,0x36,0x33,0x34,0x40,0x31,0x02,0xE5 // Spikeman PropBom1
.dh 0x009E :: .db 0x1A,0x36,0x33,0x34,0x40,0x31,0x03,0xE5 // Spikeman PropBom2
.dh 0x009F :: .db 0x1A,0x36,0x33,0x34,0x40,0x31,0x04,0xE5 // Spikeman PropBom3
.dh 0x00F0 :: .db 0x1A,0x36,0x33,0x38,0x33,0x17,0x32,0x76,0xE5 // Spikeman ProtoMnSP
.dh 0x00F1 :: .db 0x1A,0x36,0x33,0x38,0x33,0x17,0x32,0x77,0xE5 // Spikeman ProtoMnDS
.dh 0x00EF :: .db 0x1A,0x36,0x33,0x38,0x33,0x17,0x3F,0xE5 // Spikeman ProtoMan
.dh 0x015B :: .db 0x1A,0x37,0x32,0x1A,0x2C,0x42,0x33,0xE5 // Spikeman PsnPharo
.dh 0x009D :: .db 0x1A,0x37,0x34,0x35,0x0C,0x34,0x32,0x02,0xE5 // 2012 demo PropBom1
.dh 0x009E :: .db 0x1A,0x37,0x34,0x35,0x0C,0x34,0x32,0x03,0xE5 // 2012 demo PropBom2
.dh 0x009F :: .db 0x1A,0x37,0x34,0x35,0x0C,0x34,0x32,0x04,0xE5 // 2012 demo PropBom3
.dh 0x00EF :: .db 0x1A,0x37,0x34,0x39,0x34,0x17,0x26,0x33,0xE5 // 2012 demo ProtoMan
.dh 0x00F0 :: .db 0x1A,0x37,0x34,0x39,0x34,0x17,0x33,0x43,0xE5 // 2012 demo ProtoMnSP
.dh 0x00F1 :: .db 0x1A,0x37,0x34,0x39,0x34,0x17,0x33,0x44,0xE5 // 2012 demo ProtoMnDS
.dh 0x0175 :: .db 0x1A,0x3A,0x33,0x2E,0x38,0x2D,0x2A,0x37,0xE5 // 2012 demo Punisher
.dh 0x0181 :: .db 0x1A,0x3A,0x3F,0x15,0x53,0x82,0x1E,0xE5 // Japanese タンゴサポート
.dh 0x0074 :: .db 0x1A,0x3F,0x30,0x11,0x36,0x25,0x26,0xE5 // Spikeman PanlGrab
.dh 0x00B2 :: .db 0x1A,0x3F,0x30,0x1D,0x2C,0x38,0x02,0xE5 // Spikeman PanlSht1
.dh 0x00B3 :: .db 0x1A,0x3F,0x30,0x1D,0x2C,0x38,0x03,0xE5 // Spikeman PanlSht2
.dh 0x00B4 :: .db 0x1A,0x3F,0x30,0x1D,0x2C,0x38,0x04,0xE5 // Spikeman PanlSht3
.dh 0x017D :: .db 0x1A,0x46,0x38,0x36,0x2B,0x37,0x38,0xE5 // Spikeman Poltrgst
.dh 0x0103 :: .db 0x1A,0x59,0x51,0x29,0x3A,0x61,0x70,0xE5 // Japanese タップマンDS
.dh 0x0102 :: .db 0x1A,0x59,0x51,0x29,0x3A,0x70,0x6D,0xE5 // Japanese タップマンSP
.dh 0x0101 :: .db 0x1A,0x59,0x51,0x29,0x3A,0xE5 // Japanese タップマン
.dh 0x0000
@@chip_1C:
.dh 0x0045 :: .db 0x1C,0x0C,0x3A,0x26,0x54,0x3A,0x3D,0x02,0xE5 // Japanese ツインファング1
.dh 0x0046 :: .db 0x1C,0x0C,0x3A,0x26,0x54,0x3A,0x3D,0x03,0xE5 // Japanese ツインファング2
.dh 0x0047 :: .db 0x1C,0x0C,0x3A,0x26,0x54,0x3A,0x3D,0x04,0xE5 // Japanese ツインファング3
.dh 0x006B :: .db 0x1C,0x29,0x27,0x33,0x3A,0x02,0x01,0xE5 // Spikeman Recov10
.dh 0x006F :: .db 0x1C,0x29,0x27,0x33,0x3A,0x02,0x03,0x01,0xE5 // Spikeman Recov120
.dh 0x0070 :: .db 0x1C,0x29,0x27,0x33,0x3A,0x02,0x06,0x01,0xE5 // Spikeman Recov150
.dh 0x0071 :: .db 0x1C,0x29,0x27,0x33,0x3A,0x03,0x01,0x01,0xE5 // Spikeman Recov200
.dh 0x0072 :: .db 0x1C,0x29,0x27,0x33,0x3A,0x04,0x01,0x01,0xE5 // Spikeman Recov300
.dh 0x006C :: .db 0x1C,0x29,0x27,0x33,0x3A,0x04,0x01,0xE5 // Spikeman Recov30
.dh 0x006D :: .db 0x1C,0x29,0x27,0x33,0x3A,0x06,0x01,0xE5 // Spikeman Recov50
.dh 0x006E :: .db 0x1C,0x29,0x27,0x33,0x3A,0x09,0x01,0xE5 // Spikeman Recov80
.dh 0x0130 :: .db 0x1C,0x29,0x28,0x1D,0x44,0xE5 // Spikeman RedSun
.dh 0x0073 :: .db 0x1C,0x29,0x34,0x25,0x47,0xE5 // Spikeman Repair
.dh 0x006B :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x02,0x01,0xE5 // 2012 demo Recov10
.dh 0x006F :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x02,0x03,0x01,0xE5 // 2012 demo Recov120
.dh 0x0070 :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x02,0x06,0x01,0xE5 // 2012 demo Recov150
.dh 0x0071 :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x03,0x01,0x01,0xE5 // 2012 demo Recov200
.dh 0x0072 :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x04,0x01,0x01,0xE5 // 2012 demo Recov300
.dh 0x006C :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x04,0x01,0xE5 // 2012 demo Recov30
.dh 0x006D :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x06,0x01,0xE5 // 2012 demo Recov50
.dh 0x006E :: .db 0x1C,0x2A,0x28,0x34,0x3B,0x09,0x01,0xE5 // 2012 demo Recov80
.dh 0x0130 :: .db 0x1C,0x2A,0x29,0x1D,0x3A,0x33,0xE5 // 2012 demo RedSun
.dh 0x0073 :: .db 0x1C,0x2A,0x35,0x26,0x2E,0x37,0xE5 // 2012 demo Repair
.dh 0x017A :: .db 0x1C,0x2A,0x3C,0x2E,0x33,0x29,0xE5 // 2012 demo Rewind
.dh 0x0063 :: .db 0x1C,0x33,0x27,0x2F,0x0D,0x39,0x26,0x29,0xE5 // Spikeman RockCube
.dh 0x0185 :: .db 0x1C,0x34,0x28,0x30,0x02,0xE5 // 2012 demo Rock1
.dh 0x0186 :: .db 0x1C,0x34,0x28,0x30,0x03,0xE5 // 2012 demo Rock2
.dh 0x0063 :: .db 0x1C,0x34,0x28,0x30,0x0D,0x3A,0x27,0x2A,0xE5 // 2012 demo RockCube
.dh 0x0097 :: .db 0x1C,0x34,0x31,0x31,0x0B,0x37,0x34,0x02,0xE5 // 2012 demo RollAro1
.dh 0x0098 :: .db 0x1C,0x34,0x31,0x31,0x0B,0x37,0x34,0x03,0xE5 // 2012 demo RollAro2
.dh 0x0099 :: .db 0x1C,0x34,0x31,0x31,0x0B,0x37,0x34,0x04,0xE5 // 2012 demo RollAro3
.dh 0x00DE :: .db 0x1C,0x34,0x31,0x31,0x43,0xE5 // 2012 demo RollSP
.dh 0x00DF :: .db 0x1C,0x34,0x31,0x31,0x44,0xE5 // 2012 demo RollDS
.dh 0x00DD :: .db 0x1C,0x34,0x31,0x31,0xE5 // 2012 demo Roll
.dh 0x017F :: .db 0x1C,0x39,0x37,0x2C,0xE5 // Spikeman Rush
.dh 0x017F :: .db 0x1C,0x3A,0x38,0x2D,0xE5 // 2012 demo Rush
.dh 0x0097 :: .db 0x1C,0x46,0x30,0x0B,0x36,0x33,0x02,0xE5 // Spikeman RollAro1
.dh 0x0098 :: .db 0x1C,0x46,0x30,0x0B,0x36,0x33,0x03,0xE5 // Spikeman RollAro2
.dh 0x0099 :: .db 0x1C,0x46,0x30,0x0B,0x36,0x33,0x04,0xE5 // Spikeman RollAro3
.dh 0x00DE :: .db 0x1C,0x46,0x30,0x76,0xE5 // Spikeman RollSP
.dh 0x00DF :: .db 0x1C,0x46,0x30,0x77,0xE5 // Spikeman RollDS
.dh 0x00DD :: .db 0x1C,0x46,0x30,0xE5 // Spikeman Roll
.dh 0x0000
@@chip_1D:
.dh 0x002F :: .db 0x1D,0x26,0x33,0x29,0x1C,0x2E,0x33,0x2C,0xE5 // 2012 demo SandRing
.dh 0x00A0 :: .db 0x1D,0x29,0x29,0x2F,0x40,0x31,0x02,0xE5 // Spikeman SeekBom1
.dh 0x00A1 :: .db 0x1D,0x29,0x29,0x2F,0x40,0x31,0x03,0xE5 // Spikeman SeekBom2
.dh 0x00A2 :: .db 0x1D,0x29,0x29,0x2F,0x40,0x31,0x04,0xE5 // Spikeman SeekBom3
.dh 0x00A0 :: .db 0x1D,0x2A,0x2A,0x30,0x0C,0x34,0x32,0x02,0xE5 // 2012 demo SeekBom1
.dh 0x00A1 :: .db 0x1D,0x2A,0x2A,0x30,0x0C,0x34,0x32,0x03,0xE5 // 2012 demo SeekBom2
.dh 0x00A2 :: .db 0x1D,0x2A,0x2A,0x30,0x0C,0x34,0x32,0x04,0xE5 // 2012 demo SeekBom3
.dh 0x00E6 :: .db 0x1D,0x2A,0x37,0x28,0x2D,0x17,0x26,0x33,0xE5 // 2012 demo SerchMan
.dh 0x00E7 :: .db 0x1D,0x2A,0x37,0x28,0x2D,0x17,0x33,0x43,0xE5 // 2012 demo SerchMnSP
.dh 0x00E8 :: .db 0x1D,0x2A,0x37,0x28,0x2D,0x17,0x33,0x44,0xE5 // 2012 demo SerchMnDS
.dh 0x0105 :: .db 0x1D,0x2C,0x25,0x28,0x29,0x17,0x32,0x76,0xE5 // Spikeman ShadeMnSP
.dh 0x0106 :: .db 0x1D,0x2C,0x25,0x28,0x29,0x17,0x32,0x77,0xE5 // Spikeman ShadeMnDS
.dh 0x0104 :: .db 0x1D,0x2C,0x25,0x28,0x29,0x17,0x3F,0xE5 // Spikeman ShadeMan
.dh 0x00D2 :: .db 0x1D,0x2C,0x33,0x38,0x1D,0x38,0x42,0xE5 // Spikeman ShotStar
.dh 0x0104 :: .db 0x1D,0x2D,0x26,0x29,0x2A,0x17,0x26,0x33,0xE5 // 2012 demo ShadeMan
.dh 0x0105 :: .db 0x1D,0x2D,0x26,0x29,0x2A,0x17,0x33,0x43,0xE5 // 2012 demo ShadeMnSP
.dh 0x0106 :: .db 0x1D,0x2D,0x26,0x29,0x2A,0x17,0x33,0x44,0xE5 // 2012 demo ShadeMnDS
.dh 0x004E :: .db 0x1D,0x2D,0x28,0x0C,0x45,0x33,0x02,0xE5 // Spikeman SidBmbo1
.dh 0x004F :: .db 0x1D,0x2D,0x28,0x0C,0x45,0x33,0x03,0xE5 // Spikeman SidBmbo2
.dh 0x0050 :: .db 0x1D,0x2D,0x28,0x0C,0x45,0x33,0x04,0xE5 // Spikeman SidBmbo3
.dh 0x0131 :: .db 0x1D,0x2D,0x2B,0x32,0x30,0x1C,0x29,0x28,0xE5 // Spikeman SignlRed
.dh 0x0007 :: .db 0x1D,0x2D,0x30,0x29,0x32,0x27,0x29,0xE5 // Spikeman Silence
.dh 0x00D2 :: .db 0x1D,0x2D,0x34,0x39,0x1D,0x39,0x26,0x37,0xE5 // 2012 demo ShotStar
.dh 0x004E :: .db 0x1D,0x2E,0x29,0x0C,0x32,0x27,0x34,0x02,0xE5 // 2012 demo SidBmbo1
.dh 0x004F :: .db 0x1D,0x2E,0x29,0x0C,0x32,0x27,0x34,0x03,0xE5 // 2012 demo SidBmbo2
.dh 0x0050 :: .db 0x1D,0x2E,0x29,0x0C,0x32,0x27,0x34,0x04,0xE5 // 2012 demo SidBmdo3
.dh 0x0131 :: .db 0x1D,0x2E,0x2C,0x33,0x31,0x1C,0x2A,0x29,0xE5 // 2012 demo SignlRed
.dh 0x0007 :: .db 0x1D,0x2E,0x31,0x2A,0x33,0x28,0x2A,0xE5 // 2012 demo Silence
.dh 0x0038 :: .db 0x1D,0x30,0x25,0x37,0x2C,0x41,0xE5 // Spikeman Slasher
.dh 0x0078 :: .db 0x1D,0x30,0x33,0x11,0x25,0x39,0x2B,0x29,0xE5 // Spikeman SloGauge
.dh 0x0038 :: .db 0x1D,0x31,0x26,0x38,0x2D,0x2A,0x37,0xE5 // 2012 demo Slasher
.dh 0x0078 :: .db 0x1D,0x31,0x34,0x11,0x26,0x3A,0x2C,0x2A,0xE5 // 2012 demo SloGauge
.dh 0x0060 :: .db 0x1D,0x32,0x25,0x2F,0x29,0xE5 // Spikeman Snake
.dh 0x00D0 :: .db 0x1D,0x32,0x27,0x38,0x39,0x42,0x3D,0xE5 // Spikeman Snctuary
.dh 0x0060 :: .db 0x1D,0x33,0x26,0x30,0x2A,0xE5 // 2012 demo Snake
.dh 0x00D0 :: .db 0x1D,0x33,0x28,0x39,0x3A,0x26,0x37,0x3E,0xE5 // 2012 demo Snctuary
.dh 0x0173 :: .db 0x1D,0x33,0x32,0x2D,0x27,0x0C,0x31,0xE5 // Spikeman SonicBm
.dh 0x0173 :: .db 0x1D,0x34,0x33,0x2E,0x28,0x0C,0x34,0x32,0xE5 // 2012 demo SonicBom
.dh 0x0177 :: .db 0x1D,0x34,0x36,0x1D,0x33,0x32,0x2D,0x27,0xE5 // Spikeman SprSonic
.dh 0x0146 :: .db 0x1D,0x34,0x36,0x21,0x2D,0x28,0x29,0x02,0xE5 // Spikeman SprWide1
.dh 0x0147 :: .db 0x1D,0x34,0x36,0x21,0x2D,0x28,0x29,0x03,0xE5 // Spikeman SprWide2
.dh 0x0148 :: .db 0x1D,0x34,0x36,0x21,0x2D,0x28,0x29,0x04,0xE5 // Spikeman SprWide3
.dh 0x0012 :: .db 0x1D,0x34,0x36,0x29,0x25,0x28,0x41,0xE5 // Spikeman Spreader
.dh 0x010E :: .db 0x1D,0x34,0x42,0x2F,0x17,0x32,0x76,0xE5 // Spikeman SparkMnSP
.dh 0x010F :: .db 0x1D,0x34,0x42,0x2F,0x17,0x32,0x77,0xE5 // Spikeman SparkMnDS
.dh 0x010D :: .db 0x1D,0x34,0x42,0x2F,0x17,0x3F,0xE5 // Spikeman SparkMan
.dh 0x010D :: .db 0x1D,0x35,0x26,0x37,0x30,0x17,0x26,0x33,0xE5 // 2012 demo SparkMan
.dh 0x010E :: .db 0x1D,0x35,0x26,0x37,0x30,0x17,0x33,0x43,0xE5 // 2012 demo SparkMnSP
.dh 0x010F :: .db 0x1D,0x35,0x26,0x37,0x30,0x17,0x33,0x44,0xE5 // 2012 demo SparkMnDS
.dh 0x0177 :: .db 0x1D,0x35,0x37,0x1D,0x34,0x33,0x2E,0x28,0xE5 // 2012 demo SprSonic
.dh 0x0012 :: .db 0x1D,0x35,0x37,0x2A,0x26,0x29,0x2A,0x37,0xE5 // 2012 demo Spreader
.dh 0x001B :: .db 0x1D,0x38,0x25,0x38,0x2D,0x27,0xE5 // Spikeman Static
.dh 0x001B :: .db 0x1D,0x39,0x26,0x39,0x2E,0x28,0xE5 // 2012 demo Static
.dh 0x00DC :: .db 0x1D,0x39,0x34,0x36,0x20,0x39,0x30,0x27,0xE5 // Spikeman SuprVulc
.dh 0x0146 :: .db 0x1D,0x3A,0x35,0x37,0x1D,0x35,0x37,0x02,0xE5 // 2012 demo SuprSpr1
.dh 0x0147 :: .db 0x1D,0x3A,0x35,0x37,0x1D,0x35,0x37,0x03,0xE5 // 2012 demo SuprSpr2
.dh 0x0148 :: .db 0x1D,0x3A,0x35,0x37,0x1D,0x35,0x37,0x04,0xE5 // 2012 demo SuprSpr3
.dh 0x00DC :: .db 0x1D,0x3A,0x35,0x37,0x20,0x3A,0x31,0x28,0xE5 // 2012 demo SuprVulc
.dh 0x0030 :: .db 0x1D,0x3B,0x33,0x36,0x28,0xE5 // Spikeman Sword
.dh 0x011C :: .db 0x1D,0x3B,0x36,0x28,0x17,0x33,0x28,0x29,0xE5 // Spikeman SwrdMode
.dh 0x0030 :: .db 0x1D,0x3C,0x34,0x37,0x29,0xE5 // 2012 demo Sword
.dh 0x011C :: .db 0x1D,0x3C,0x37,0x29,0x17,0x34,0x29,0x2A,0xE5 // 2012 demo SwrdMode
.dh 0x002F :: .db 0x1D,0x3F,0x28,0x1C,0x43,0x2B,0xE5 // Spikeman SandRing
.dh 0x00E7 :: .db 0x1D,0x41,0x27,0x2C,0x17,0x32,0x76,0xE5 // Spikeman SerchMnSP
.dh 0x00E8 :: .db 0x1D,0x41,0x27,0x2C,0x17,0x32,0x77,0xE5 // Spikeman SerchMnDS
.dh 0x00E6 :: .db 0x1D,0x41,0x27,0x2C,0x17,0x3F,0xE5 // Spikeman SerchMan
.dh 0x0066 :: .db 0x1D,0x55,0x3A,0x4F,0x20,0x82,0xE5 // Japanese ティンパニー
.dh 0x0000
@@chip_1E:
.dh 0x0181 :: .db 0x1E,0x26,0x33,0x2C,0x34,0xE5 // 2012 demo Tango
.dh 0x00ED :: .db 0x1E,0x2C,0x44,0x17,0x3F,0x76,0xE5 // Spikeman ThunManSP
.dh 0x00EE :: .db 0x1E,0x2C,0x44,0x17,0x3F,0x77,0xE5 // Spikeman ThunManDS
.dh 0x00EC :: .db 0x1E,0x2C,0x44,0x17,0x3F,0xE5 // Spikeman ThunMan
.dh 0x0039 :: .db 0x1E,0x2C,0x44,0x28,0x41,0x02,0xE5 // Spikeman Thunder1
.dh 0x003A :: .db 0x1E,0x2C,0x44,0x28,0x41,0x03,0xE5 // Spikeman Thunder2
.dh 0x003B :: .db 0x1E,0x2C,0x44,0x28,0x41,0x04,0xE5 // Spikeman Thunder3
.dh 0x0061 :: .db 0x1E,0x2D,0x31,0x29,0x40,0x45,0xE5 // Spikeman TimeBomb
.dh 0x0066 :: .db 0x1E,0x2D,0x31,0x34,0x3F,0x2D,0xE5 // Spikeman Timpani
.dh 0x00ED :: .db 0x1E,0x2D,0x3A,0x33,0x17,0x26,0x33,0x43,0xE5 // 2012 demo ThunManSP
.dh 0x00EE :: .db 0x1E,0x2D,0x3A,0x33,0x17,0x26,0x33,0x44,0xE5 // 2012 demo ThunManDS
.dh 0x00EC :: .db 0x1E,0x2D,0x3A,0x33,0x17,0x26,0x33,0xE5 // 2012 demo ThunMan
.dh 0x011E :: .db 0x1E,0x2D,0x3A,0x33,0x1A,0x31,0x3A,0x38,0xE5 // 2012 demo ThunPlus
.dh 0x0039 :: .db 0x1E,0x2D,0x3A,0x33,0x29,0x2A,0x37,0x02,0xE5 // 2012 demo Thunder1
.dh 0x003A :: .db 0x1E,0x2D,0x3A,0x33,0x29,0x2A,0x37,0x03,0xE5 // 2012 demo Thunder2
.dh 0x003B :: .db 0x1E,0x2D,0x3A,0x33,0x29,0x2A,0x37,0x04,0xE5 // 2012 demo Thunder3
.dh 0x0061 :: .db 0x1E,0x2E,0x32,0x2A,0x0C,0x34,0x32,0x27,0xE5 // 2012 demo TimeBomb
.dh 0x015A :: .db 0x1E,0x2E,0x32,0x2A,0x0C,0x34,0x32,0x48,0xE5 // English TimeBom+
.dh 0x015A :: .db 0x1E,0x2E,0x32,0x2A,0x0C,0x34,0x32,0x9E,0xE5 // 2012 demo TimeBom+
.dh 0x0066 :: .db 0x1E,0x2E,0x32,0x35,0x26,0x33,0x2E,0xE5 // 2012 demo Timpani
.dh 0x005D :: .db 0x1E,0x32,0x51,0x33,0x12,0x31,0x59,0x12,0xE5 // Japanese トリプルクラック
.dh 0x0008 :: .db 0x1E,0x33,0x22,0x82,0x49,0xE5 // Japanese トルネード
.dh 0x0102 :: .db 0x1E,0x33,0x34,0x17,0x3F,0x76,0xE5 // Spikeman TopManSP
.dh 0x0103 :: .db 0x1E,0x33,0x34,0x17,0x3F,0x77,0xE5 // Spikeman TopManDS
.dh 0x0101 :: .db 0x1E,0x33,0x34,0x17,0x3F,0xE5 // Spikeman TopMan
.dh 0x0008 :: .db 0x1E,0x33,0x36,0x32,0x25,0x28,0x33,0xE5 // Spikeman Tornado
.dh 0x0102 :: .db 0x1E,0x34,0x35,0x17,0x26,0x33,0x43,0xE5 // 2012 demo TopManSP
.dh 0x0103 :: .db 0x1E,0x34,0x35,0x17,0x26,0x33,0x44,0xE5 // 2012 demo TopManDS
.dh 0x0101 :: .db 0x1E,0x34,0x35,0x17,0x26,0x33,0xE5 // 2012 demo TopMan
.dh 0x0008 :: .db 0x1E,0x34,0x37,0x33,0x26,0x29,0x34,0xE5 // 2012 demo Tornado
.dh 0x005D :: .db 0x1E,0x36,0x2D,0x34,0x0D,0x36,0x25,0x2F,0xE5 // Spikeman TripCrak
.dh 0x017B :: .db 0x1E,0x37,0x26,0x2E,0x33,0x2E,0x33,0x2C,0xE5 // 2012 demo Training
.dh 0x005D :: .db 0x1E,0x37,0x2E,0x35,0x0D,0x37,0x26,0x30,0xE5 // 2012 demo TripCrak
.dh 0x0045 :: .db 0x1E,0x3B,0x32,0x10,0x32,0x2B,0x02,0xE5 // Spikeman TwnFng1
.dh 0x0046 :: .db 0x1E,0x3B,0x32,0x10,0x32,0x2B,0x03,0xE5 // Spikeman TwnFng2
.dh 0x0047 :: .db 0x1E,0x3B,0x32,0x10,0x32,0x2B,0x04,0xE5 // Spikeman TwnFng3
.dh 0x0045 :: .db 0x1E,0x3C,0x33,0x10,0x33,0x2C,0x02,0xE5 // 2012 demo TwnFng1
.dh 0x0046 :: .db 0x1E,0x3C,0x33,0x10,0x33,0x2C,0x03,0xE5 // 2012 demo TwnFng2
.dh 0x0047 :: .db 0x1E,0x3C,0x33,0x10,0x33,0x2C,0x04,0xE5 // 2012 demo TwnFng3
.dh 0x0181 :: .db 0x1E,0x3F,0x2B,0x33,0xE5 // Spikeman Tango
.dh 0x0053 :: .db 0x1E,0x59,0x51,0x0D,0xE5 // Japanese トップウ
.dh 0x0000
@@chip_1F:
.dh 0x00F4 :: .db 0x1F,0x3A,0x4A,0x82,0x29,0x3A,0x61,0x70,0xE5 // Japanese ナンバーマンDS
.dh 0x00F3 :: .db 0x1F,0x3A,0x4A,0x82,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ナンバーマンSP
.dh 0x00F2 :: .db 0x1F,0x3A,0x4A,0x82,0x29,0x3A,0xE5 // Japanese ナンバーマン
.dh 0x00AC :: .db 0x1F,0x3A,0x4A,0x82,0x4E,0x82,0x33,0x02,0xE5 // Japanese ナンバーボール1
.dh 0x00AD :: .db 0x1F,0x3A,0x4A,0x82,0x4E,0x82,0x33,0x03,0xE5 // Japanese ナンバーボール2
.dh 0x00AE :: .db 0x1F,0x3A,0x4A,0x82,0x4E,0x82,0x33,0x04,0xE5 // Japanese ナンバーボール3
.dh 0x0090 :: .db 0x1F,0x4B,0x17,0x10,0x0D,0x1E,0xE5 // Japanese ナビスカウト
.dh 0x0096 :: .db 0x1F,0x4B,0x7F,0x03,0x01,0xE5 // Japanese ナビ+20
.dh 0x0000
@@chip_20:
.dh 0x0067 :: .db 0x20,0x0E,0x34,0x31,0x31,0xE5 // 2012 demo VDoll
.dh 0x0067 :: .db 0x20,0x0E,0x46,0x30,0xE5 // Spikeman VDoll
.dh 0x0037 :: .db 0x20,0x26,0x37,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo VarSwrd
.dh 0x0117 :: .db 0x20,0x2D,0x28,0x29,0x33,0x17,0x32,0x76,0xE5 // Spikeman VideoMnSP
.dh 0x0118 :: .db 0x20,0x2D,0x28,0x29,0x33,0x17,0x32,0x77,0xE5 // Spikeman VideoMnDS
.dh 0x0116 :: .db 0x20,0x2D,0x28,0x29,0x33,0x17,0x3F,0xE5 // Spikeman VideoMan
.dh 0x0116 :: .db 0x20,0x2E,0x29,0x2A,0x34,0x17,0x26,0x33,0xE5 // 2012 demo VideoMan
.dh 0x0117 :: .db 0x20,0x2E,0x29,0x2A,0x34,0x17,0x33,0x43,0xE5 // 2012 demo VideoMnSP
.dh 0x0118 :: .db 0x20,0x2E,0x29,0x2A,0x34,0x17,0x33,0x44,0xE5 // 2012 demo VideoMnDS
.dh 0x000F :: .db 0x20,0x39,0x30,0x27,0x3F,0x02,0xE5 // Spikeman Vulcan1
.dh 0x0010 :: .db 0x20,0x39,0x30,0x27,0x3F,0x03,0xE5 // Spikeman Vulcan2
.dh 0x0011 :: .db 0x20,0x39,0x30,0x27,0x3F,0x04,0xE5 // Spikeman Vulcan3
.dh 0x000F :: .db 0x20,0x3A,0x31,0x28,0x26,0x33,0x02,0xE5 // 2012 demo Vulcan1
.dh 0x0010 :: .db 0x20,0x3A,0x31,0x28,0x26,0x33,0x03,0xE5 // 2012 demo Vulcan2
.dh 0x0011 :: .db 0x20,0x3A,0x31,0x28,0x26,0x33,0x04,0xE5 // 2012 demo Vulcan3
.dh 0x0037 :: .db 0x20,0x42,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman VarSwrd
.dh 0x0000
@@chip_21:
.dh 0x0048 :: .db 0x21,0x2C,0x2D,0x38,0x21,0x29,0x26,0x02,0xE5 // Spikeman WhitWeb1
.dh 0x0049 :: .db 0x21,0x2C,0x2D,0x38,0x21,0x29,0x26,0x03,0xE5 // Spikeman WhitWeb2
.dh 0x004A :: .db 0x21,0x2C,0x2D,0x38,0x21,0x29,0x26,0x04,0xE5 // Spikeman WhitWeb3
.dh 0x0033 :: .db 0x21,0x2D,0x28,0x29,0x0C,0x30,0x28,0x29,0xE5 // Spikeman WideBlde
.dh 0x0009 :: .db 0x21,0x2D,0x28,0x29,0x1D,0x2C,0x38,0x02,0xE5 // Spikeman WideSht1
.dh 0x000A :: .db 0x21,0x2D,0x28,0x29,0x1D,0x2C,0x38,0x03,0xE5 // Spikeman WideSht2
.dh 0x000B :: .db 0x21,0x2D,0x28,0x29,0x1D,0x2C,0x38,0x04,0xE5 // Spikeman WideSht3
.dh 0x0031 :: .db 0x21,0x2D,0x28,0x29,0x1D,0x3B,0x36,0x28,0xE5 // Spikeman WideSwrd
.dh 0x0048 :: .db 0x21,0x2D,0x2E,0x39,0x21,0x2A,0x27,0x02,0xE5 // 2012 demo WhitWeb1
.dh 0x0049 :: .db 0x21,0x2D,0x2E,0x39,0x21,0x2A,0x27,0x03,0xE5 // 2012 demo WhitWeb2
.dh 0x004A :: .db 0x21,0x2D,0x2E,0x39,0x21,0x2A,0x27,0x04,0xE5 // 2012 demo WhitWeb3
.dh 0x0033 :: .db 0x21,0x2E,0x29,0x2A,0x0C,0x31,0x29,0x2A,0xE5 // 2012 demo WideBlde
.dh 0x0009 :: .db 0x21,0x2E,0x29,0x2A,0x1D,0x2D,0x39,0x02,0xE5 // 2012 demo WideSht1
.dh 0x000A :: .db 0x21,0x2E,0x29,0x2A,0x1D,0x2D,0x39,0x03,0xE5 // 2012 demo WideSht2
.dh 0x000B :: .db 0x21,0x2E,0x29,0x2A,0x1D,0x2D,0x39,0x04,0xE5 // 2012 demo WideSht3
.dh 0x0031 :: .db 0x21,0x2E,0x29,0x2A,0x1D,0x3C,0x37,0x29,0xE5 // 2012 demo WideSwrd
.dh 0x00E4 :: .db 0x21,0x2E,0x33,0x29,0x17,0x26,0x33,0x43,0xE5 // 2012 demo WindManSP
.dh 0x00E5 :: .db 0x21,0x2E,0x33,0x29,0x17,0x26,0x33,0x44,0xE5 // 2012 demo WindManDS
.dh 0x00E3 :: .db 0x21,0x2E,0x33,0x29,0x17,0x26,0x33,0xE5 // 2012 demo WindMan
.dh 0x0035 :: .db 0x21,0x2E,0x33,0x29,0x1C,0x26,0x28,0x30,0xE5 // 2012 demo WindRack
.dh 0x0053 :: .db 0x21,0x2E,0x33,0x29,0xE5 // 2012 demo Wind
.dh 0x00FF :: .db 0x21,0x33,0x33,0x28,0x17,0x3F,0x76,0xE5 // Spikeman WoodManSP
.dh 0x0100 :: .db 0x21,0x33,0x33,0x28,0x17,0x3F,0x77,0xE5 // Spikeman WoodManDS
.dh 0x00FE :: .db 0x21,0x33,0x33,0x28,0x17,0x3F,0xE5 // Spikeman WoodMan
.dh 0x002B :: .db 0x21,0x33,0x33,0x28,0x1A,0x3B,0x28,0x36,0xE5 // Spikeman WoodPwdr
.dh 0x0120 :: .db 0x21,0x33,0x33,0x28,0x1A,0x3B,0x36,0xE5 // Spikeman WoodPwr
.dh 0x00FF :: .db 0x21,0x34,0x34,0x29,0x17,0x26,0x33,0x43,0xE5 // 2012 demo WoodManSP
.dh 0x0100 :: .db 0x21,0x34,0x34,0x29,0x17,0x26,0x33,0x44,0xE5 // 2012 demo WoodManDS
.dh 0x00FE :: .db 0x21,0x34,0x34,0x29,0x17,0x26,0x33,0xE5 // 2012 demo WoodMan
.dh 0x0120 :: .db 0x21,0x34,0x34,0x29,0x1A,0x34,0x3C,0x37,0xE5 // 2012 demo WoodPowr
.dh 0x002B :: .db 0x21,0x34,0x34,0x29,0x1A,0x3C,0x29,0x37,0xE5 // 2012 demo WoodPwdr
.dh 0x00E4 :: .db 0x21,0x43,0x28,0x17,0x3F,0x76,0xE5 // Spikeman WindManSP
.dh 0x00E5 :: .db 0x21,0x43,0x28,0x17,0x3F,0x77,0xE5 // Spikeman WindManDS
.dh 0x00E3 :: .db 0x21,0x43,0x28,0x17,0x3F,0xE5 // Spikeman WindMan
.dh 0x0035 :: .db 0x21,0x43,0x28,0x1C,0x25,0x27,0x2F,0xE5 // Spikeman WindRack
.dh 0x0053 :: .db 0x21,0x43,0x28,0xE5 // Spikeman Wind
.dh 0x0000
@@chip_22:
.dh 0x00D9 :: .db 0x22,0x0F,0x4A,0x32,0x0B,0x4C,0x33,0xE5 // Japanese ネオバリアブル
.dh 0x0000
@@chip_23:
.dh 0x001B :: .db 0x23,0x0C,0x42,0x17,0x1E,0x82,0x2B,0xE5 // Japanese ノイズストーム
.dh 0x0174 :: .db 0x23,0x35,0x0C,0xE5 // Japanese ノロイ
.dh 0x0000
@@chip_24:
.dh 0x00DA :: .db 0x24,0x00,0x1D,0x26,0x3B,0x2A,0x37,0xE5 // English Z Saver
.dh 0x0002 :: .db 0x24,0x0C,0x11,0x5A,0x23,0x3A,0xE5 // Japanese ハイキャノン
.dh 0x015D :: .db 0x24,0x0C,0x4F,0x82,0x4A,0x82,0x17,0x1E,0xE5 // Japanese ハイパーバースト
.dh 0x0179 :: .db 0x24,0x2E,0x0F,0x12,0x32,0xE5 // Japanese ハヤオクリ
.dh 0x00A9 :: .db 0x24,0x2E,0x4C,0x15,0x3C,0x32,0x02,0xE5 // Japanese ハヤブサギリ1
.dh 0x00AA :: .db 0x24,0x2E,0x4C,0x15,0x3C,0x32,0x03,0xE5 // Japanese ハヤブサギリ2
.dh 0x00AB :: .db 0x24,0x2E,0x4C,0x15,0x3C,0x32,0x04,0xE5 // Japanese ハヤブサギリ3
.dh 0x00DA :: .db 0x24,0x82,0x1D,0x25,0x26,0x41,0xE5 // Spikeman Z-Saber
.dh 0x00DA :: .db 0x24,0x98,0x1D,0x26,0x27,0x2A,0x37,0xE5 // 2012 demo Z-Saber
.dh 0x0000
@@chip_25:
.dh 0x008E :: .db 0x25,0x31,0x0C,0x16,0x3A,0xE5 // Japanese ヒライシン
.dh 0x0015 :: .db 0x25,0x82,0x1E,0x15,0x0C,0x49,0xE5 // Japanese ヒートサイド
.dh 0x0013 :: .db 0x25,0x82,0x1E,0x16,0x5C,0x59,0x1E,0xE5 // Japanese ヒートショット
.dh 0x0141 :: .db 0x25,0x82,0x1E,0x17,0x51,0x34,0x59,0x49,0xE5 // Japanese ヒートスプレッド
.dh 0x0014 :: .db 0x25,0x82,0x1E,0x4C,0x0C,0xE5 // Japanese ヒートブイ
.dh 0x0006 :: .db 0x25,0x82,0x1E,0x4C,0x34,0x17,0xE5 // Japanese ヒートブレス
.dh 0x0000
@@chip_26:
.dh 0x0035 :: .db 0x26,0x0D,0x41,0x3A,0x31,0x13,0x59,0x1E,0xE5 // Japanese フウジンラケット
.dh 0x00D1 :: .db 0x26,0x33,0x10,0x17,0x1A,0x2B,0xE5 // Japanese フルカスタム
.dh 0x0149 :: .db 0x26,0x34,0x0C,0x2B,0x12,0x35,0x17,0x02,0xE5 // Japanese フレイムクロス1
.dh 0x014A :: .db 0x26,0x34,0x0C,0x2B,0x12,0x35,0x17,0x03,0xE5 // Japanese フレイムクロス2
.dh 0x014B :: .db 0x26,0x34,0x0C,0x2B,0x12,0x35,0x17,0x04,0xE5 // Japanese フレイムクロス3
.dh 0x000C :: .db 0x26,0x34,0x0C,0x2B,0x31,0x0C,0x3A,0x02,0xE5 // Japanese フレイムライン1
.dh 0x000D :: .db 0x26,0x34,0x0C,0x2B,0x31,0x0C,0x3A,0x03,0xE5 // Japanese フレイムライン2
.dh 0x000E :: .db 0x26,0x34,0x0C,0x2B,0x31,0x0C,0x3A,0x04,0xE5 // Japanese フレイムライン3
.dh 0x00EB :: .db 0x26,0x54,0x0C,0x0B,0x29,0x3A,0x61,0x70,0xE5 // Japanese ファイアマンDS
.dh 0x00EA :: .db 0x26,0x54,0x0C,0x0B,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ファイアマンSP
.dh 0x00E9 :: .db 0x26,0x54,0x0C,0x0B,0x29,0x3A,0xE5 // Japanese ファイアマン
.dh 0x011D :: .db 0x26,0x54,0x0C,0x0B,0x51,0x31,0x17,0xE5 // Japanese ファイアプラス
.dh 0x0172 :: .db 0x26,0x54,0x0C,0x1A,0x82,0x19,0x82,0x49,0xE5 // Japanese ファイターソード
.dh 0x0122 :: .db 0x26,0x54,0x0C,0x1F,0x33,0x3B,0x3A,0xE5 // Japanese ファイナルガン
.dh 0x0182 :: .db 0x26,0x54,0x0C,0x1F,0x33,0x3B,0x3A,0xE5 // Japanese ファイナルガン
.dh 0x0132 :: .db 0x26,0x58,0x33,0x1D,0x0B,0x1F,0x40,0x82,0xE5 // Japanese フォルテアナザー
.dh 0x012D :: .db 0x26,0x58,0x33,0x1D,0xE5 // Japanese フォルテ
.dh 0x0000
@@chip_27:
.dh 0x014C :: .db 0x27,0x33,0x4C,0x82,0x2C,0x31,0x3A,0x02,0xE5 // Japanese ヘルブーメラン1
.dh 0x014D :: .db 0x27,0x33,0x4C,0x82,0x2C,0x31,0x3A,0x03,0xE5 // Japanese ヘルブーメラン2
.dh 0x014E :: .db 0x27,0x33,0x4C,0x82,0x2C,0x31,0x3A,0x04,0xE5 // Japanese ヘルブーメラン3
.dh 0x0078 :: .db 0x27,0x4B,0x82,0x3E,0x82,0x41,0xE5 // Japanese ヘビーゲージ
.dh 0x0000
@@chip_28:
.dh 0x011B :: .db 0x28,0x0D,0x3B,0x3A,0x2D,0x82,0x49,0xE5 // Japanese ホウガンモード
.dh 0x002C :: .db 0x28,0x0D,0x3B,0x3A,0xE5 // Japanese ホウガン
.dh 0x0048 :: .db 0x28,0x36,0x0C,0x1E,0x0D,0x57,0x4C,0x02,0xE5 // Japanese ホワイトウェブ1
.dh 0x0049 :: .db 0x28,0x36,0x0C,0x1E,0x0D,0x57,0x4C,0x03,0xE5 // Japanese ホワイトウェブ2
.dh 0x004A :: .db 0x28,0x36,0x0C,0x1E,0x0D,0x57,0x4C,0x04,0xE5 // Japanese ホワイトウェブ3
.dh 0x0133 :: .db 0x28,0x82,0x32,0x82,0x49,0x32,0x82,0x2B,0xE5 // Japanese ホーリードリーム
.dh 0x008B :: .db 0x28,0x82,0x32,0x82,0x4F,0x22,0x33,0xE5 // Japanese ホーリーパネル
.dh 0x0000
@@chip_29:
.dh 0x017A :: .db 0x29,0x11,0x2D,0x49,0x16,0xE5 // Japanese マキモドシ
.dh 0x008F :: .db 0x29,0x30,0x0C,0x23,0x2D,0x32,0xE5 // Japanese マヨイノモリ
.dh 0x0155 :: .db 0x29,0x3D,0x16,0x5C,0x59,0x12,0x02,0xE5 // Japanese マグショック1
.dh 0x0156 :: .db 0x29,0x3D,0x16,0x5C,0x59,0x12,0x03,0xE5 // Japanese マグショック2
.dh 0x0157 :: .db 0x29,0x3D,0x16,0x5C,0x59,0x12,0x04,0xE5 // Japanese マグショック3
.dh 0x005E :: .db 0x29,0x3D,0x1F,0x2B,0xE5 // Japanese マグナム
.dh 0x0023 :: .db 0x29,0x3D,0x4E,0x33,0x1E,0x02,0xE5 // Japanese マグボルト1
.dh 0x0024 :: .db 0x29,0x3D,0x4E,0x33,0x1E,0x03,0xE5 // Japanese マグボルト2
.dh 0x0025 :: .db 0x29,0x3D,0x4E,0x33,0x1E,0x04,0xE5 // Japanese マグボルト3
.dh 0x014F :: .db 0x29,0x59,0x49,0x26,0x54,0x3A,0x3D,0x02,0xE5 // Japanese マッドファング1
.dh 0x0150 :: .db 0x29,0x59,0x49,0x26,0x54,0x3A,0x3D,0x03,0xE5 // Japanese マッドファング2
.dh 0x0151 :: .db 0x29,0x59,0x49,0x26,0x54,0x3A,0x3D,0x04,0xE5 // Japanese マッドファング3
.dh 0x0119 :: .db 0x29,0x82,0x11,0x3A,0x3D,0xE5 // Japanese マーキング
.dh 0x0000
@@chip_2A:
.dh 0x001D :: .db 0x2A,0x20,0x4E,0x2B,0xE5 // Japanese ミニボム
.dh 0x0000
@@chip_2B:
.dh 0x00CA :: .db 0x2B,0x31,0x29,0x15,0x4C,0x34,0x82,0x49,0xE5 // Japanese ムラマサブレード
.dh 0x0000
@@chip_2C:
.dh 0x00F7 :: .db 0x2C,0x1A,0x33,0x29,0x3A,0x61,0x70,0xE5 // Japanese メタルマンDS
.dh 0x00F6 :: .db 0x2C,0x1A,0x33,0x29,0x3A,0x70,0x6D,0xE5 // Japanese メタルマンSP
.dh 0x00F5 :: .db 0x2C,0x1A,0x33,0x29,0x3A,0xE5 // Japanese メタルマン
.dh 0x00AF :: .db 0x2C,0x1A,0x33,0x3C,0x0B,0x02,0xE5 // Japanese メタルギア1
.dh 0x00B0 :: .db 0x2C,0x1A,0x33,0x3C,0x0B,0x03,0xE5 // Japanese メタルギア2
.dh 0x00B1 :: .db 0x2C,0x1A,0x33,0x3C,0x0B,0x04,0xE5 // Japanese メタルギア3
.dh 0x0187 :: .db 0x2C,0x1A,0x33,0x3C,0x0B,0xE5 // Japanese メタルギア
.dh 0x00A3 :: .db 0x2C,0x1D,0x0F,0x34,0x0C,0x3A,0x02,0xE5 // Japanese メテオレイン1
.dh 0x00A4 :: .db 0x2C,0x1D,0x0F,0x34,0x0C,0x3A,0x03,0xE5 // Japanese メテオレイン2
.dh 0x00A5 :: .db 0x2C,0x1D,0x0F,0x34,0x0C,0x3A,0x04,0xE5 // Japanese メテオレイン3
.dh 0x0130 :: .db 0x2C,0x1D,0x0F,0x34,0x59,0x49,0x15,0x3A,0xE5 // Japanese メテオレッドサン
.dh 0x001F :: .db 0x2C,0x3B,0x0E,0x1F,0x41,0x82,0x4E,0x2B,0xE5 // Japanese メガエナジーボム
.dh 0x0003 :: .db 0x2C,0x3B,0x11,0x5A,0x23,0x3A,0xE5 // Japanese メガキャノン
.dh 0x0058 :: .db 0x2C,0x59,0x1E,0x3B,0x82,0x49,0x02,0xE5 // Japanese メットガード1
.dh 0x0059 :: .db 0x2C,0x59,0x1E,0x3B,0x82,0x49,0x03,0xE5 // Japanese メットガード2
.dh 0x005A :: .db 0x2C,0x59,0x1E,0x3B,0x82,0x49,0x04,0xE5 // Japanese メットガード3
.dh 0x0000
@@chip_2D:
.dh 0x0082 :: .db 0x2D,0x14,0x31,0x59,0x16,0x5B,0x02,0xE5 // Japanese モコラッシュ1
.dh 0x0083 :: .db 0x2D,0x14,0x31,0x59,0x16,0x5B,0x03,0xE5 // Japanese モコラッシュ2
.dh 0x0084 :: .db 0x2D,0x14,0x31,0x59,0x16,0x5B,0x04,0xE5 // Japanese モコラッシュ3
.dh 0x0000
@@chip_2F:
.dh 0x0086 :: .db 0x2F,0x10,0x16,0x1A,0xE5 // Japanese ユカシタ
.dh 0x0000
@@chip_31:
.dh 0x00A6 :: .db 0x31,0x0C,0x1E,0x20,0x3A,0x3D,0x02,0xE5 // Japanese ライトニング1
.dh 0x00A7 :: .db 0x31,0x0C,0x1E,0x20,0x3A,0x3D,0x03,0xE5 // Japanese ライトニング2
.dh 0x00A8 :: .db 0x31,0x0C,0x1E,0x20,0x3A,0x3D,0x04,0xE5 // Japanese ライトニング3
.dh 0x001C :: .db 0x31,0x0C,0x26,0x16,0x3A,0x12,0x35,0xE5 // Japanese ライフシンクロ
.dh 0x017F :: .db 0x31,0x59,0x16,0x5B,0x15,0x53,0x82,0x1E,0xE5 // Japanese ラッシュサポート
.dh 0x0000
@@chip_32:
.dh 0x006B :: .db 0x32,0x10,0x4A,0x32,0x82,0x02,0x01,0xE5 // Japanese リカバリー10
.dh 0x006F :: .db 0x32,0x10,0x4A,0x32,0x82,0x02,0x03,0x01,0xE5 // Japanese リカバリー120
.dh 0x0070 :: .db 0x32,0x10,0x4A,0x32,0x82,0x02,0x06,0x01,0xE5 // Japanese リカバリー150
.dh 0x0071 :: .db 0x32,0x10,0x4A,0x32,0x82,0x03,0x01,0x01,0xE5 // Japanese リカバリー200
.dh 0x0072 :: .db 0x32,0x10,0x4A,0x32,0x82,0x04,0x01,0x01,0xE5 // Japanese リカバリー300
.dh 0x006C :: .db 0x32,0x10,0x4A,0x32,0x82,0x04,0x01,0xE5 // Japanese リカバリー30
.dh 0x006D :: .db 0x32,0x10,0x4A,0x32,0x82,0x06,0x01,0xE5 // Japanese リカバリー50
.dh 0x006E :: .db 0x32,0x10,0x4A,0x32,0x82,0x09,0x01,0xE5 // Japanese リカバリー80
.dh 0x0073 :: .db 0x32,0x52,0x0B,0x79,0xE5 // Japanese リペア-
.dh 0x00D2 :: .db 0x32,0x5B,0x0D,0x18,0x0C,0x3D,0x3A,0xE5 // Japanese リュウセイグン
.dh 0x0000
@@chip_34:
.dh 0x0112 :: .db 0x34,0x82,0x40,0x82,0x29,0x3A,0x61,0x70,0xE5 // Japanese レーザーマンDS
.dh 0x0111 :: .db 0x34,0x82,0x40,0x82,0x29,0x3A,0x70,0x6D,0xE5 // Japanese レーザーマンSP
.dh 0x0110 :: .db 0x34,0x82,0x40,0x82,0x29,0x3A,0xE5 // Japanese レーザーマン
.dh 0x0000
@@chip_35:
.dh 0x0032 :: .db 0x35,0x3A,0x3D,0x19,0x82,0x49,0xE5 // Japanese ロングソード
.dh 0x0034 :: .db 0x35,0x3A,0x3D,0x4C,0x34,0x82,0x49,0xE5 // Japanese ロングブレード
.dh 0x0097 :: .db 0x35,0x82,0x33,0x0B,0x35,0x82,0x02,0xE5 // Japanese ロールアロー1
.dh 0x0098 :: .db 0x35,0x82,0x33,0x0B,0x35,0x82,0x03,0xE5 // Japanese ロールアロー2
.dh 0x0099 :: .db 0x35,0x82,0x33,0x0B,0x35,0x82,0x04,0xE5 // Japanese ロールアロー3
.dh 0x00DF :: .db 0x35,0x82,0x33,0x61,0x70,0xE5 // Japanese ロールDS
.dh 0x00DE :: .db 0x35,0x82,0x33,0x70,0x6D,0xE5 // Japanese ロールSP
.dh 0x00DD :: .db 0x35,0x82,0x33,0xE5 // Japanese ロール
.dh 0x0000
@@chip_36:
.dh 0x0009 :: .db 0x36,0x0C,0x49,0x16,0x5C,0x59,0x1E,0x02,0xE5 // Japanese ワイドショット1
.dh 0x000A :: .db 0x36,0x0C,0x49,0x16,0x5C,0x59,0x1E,0x03,0xE5 // Japanese ワイドショット2
.dh 0x000B :: .db 0x36,0x0C,0x49,0x16,0x5C,0x59,0x1E,0x04,0xE5 // Japanese ワイドショット3
.dh 0x0031 :: .db 0x36,0x0C,0x49,0x19,0x82,0x49,0xE5 // Japanese ワイドソード
.dh 0x0033 :: .db 0x36,0x0C,0x49,0x4C,0x34,0x82,0x49,0xE5 // Japanese ワイドブレード
.dh 0x0067 :: .db 0x36,0x31,0x20,0x3A,0x3C,0x5C,0x0D,0xE5 // Japanese ワラニンギョウ
.dh 0x0000
@@chip_3B:
.dh 0x0020 :: .db 0x3B,0x3A,0x48,0x33,0x19,0x33,0x02,0xE5 // Japanese ガンデルソル1
.dh 0x0021 :: .db 0x3B,0x3A,0x48,0x33,0x19,0x33,0x03,0xE5 // Japanese ガンデルソル2
.dh 0x0022 :: .db 0x3B,0x3A,0x48,0x33,0x19,0x33,0x04,0xE5 // Japanese ガンデルソル3
.dh 0x00DB :: .db 0x3B,0x3A,0x48,0x33,0x19,0x33,0x62,0x75,0xE5 // Japanese ガンデルソルEX
.dh 0x0183 :: .db 0x3B,0x59,0x1C,0x29,0x16,0x3A,0x3B,0x3A,0xE5 // Japanese ガッツマシンガン
.dh 0x00E2 :: .db 0x3B,0x59,0x1C,0x29,0x3A,0x61,0x70,0xE5 // Japanese ガッツマンDS
.dh 0x00E1 :: .db 0x3B,0x59,0x1C,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ガッツマンSP
.dh 0x00E0 :: .db 0x3B,0x59,0x1C,0x29,0x3A,0xE5 // Japanese ガッツマン
.dh 0x009A :: .db 0x3B,0x59,0x1C,0x4F,0x3A,0x1B,0x02,0xE5 // Japanese ガッツパンチ1
.dh 0x009B :: .db 0x3B,0x59,0x1C,0x4F,0x3A,0x1B,0x03,0xE5 // Japanese ガッツパンチ2
.dh 0x009C :: .db 0x3B,0x59,0x1C,0x4F,0x3A,0x1B,0x04,0xE5 // Japanese ガッツパンチ3
.dh 0x0000
@@chip_3C:
.dh 0x017C :: .db 0x3C,0x0B,0x1B,0x57,0x3A,0x41,0xE5 // Japanese ギアチェンジ
.dh 0x015A :: .db 0x3C,0x3B,0x10,0x0D,0x3A,0x1E,0x4E,0x2B,0xE5 // Japanese ギガカウントボム
.dh 0x0143 :: .db 0x3C,0x3B,0x11,0x5A,0x23,0x3A,0x02,0xE5 // Japanese ギガキャノン1
.dh 0x0144 :: .db 0x3C,0x3B,0x11,0x5A,0x23,0x3A,0x03,0xE5 // Japanese ギガキャノン2
.dh 0x0145 :: .db 0x3C,0x3B,0x11,0x5A,0x23,0x3A,0x04,0xE5 // Japanese ギガキャノン3
.dh 0x0000
@@chip_3D:
.dh 0x0138 :: .db 0x3D,0x31,0x3A,0x51,0x32,0x4F,0x36,0x82,0xE5 // Japanese グランプリパワー
.dh 0x00B8 :: .db 0x3D,0x32,0x82,0x3A,0x0D,0x59,0x49,0x02,0xE5 // Japanese グリーンウッド1
.dh 0x00B9 :: .db 0x3D,0x32,0x82,0x3A,0x0D,0x59,0x49,0x03,0xE5 // Japanese グリーンウッド2
.dh 0x00BA :: .db 0x3D,0x32,0x82,0x3A,0x0D,0x59,0x49,0x04,0xE5 // Japanese グリーンウッド3
.dh 0x0000
@@chip_3F:
.dh 0x00D7 :: .db 0x3F,0x59,0x49,0x24,0x3A,0x29,0x82,0xE5 // Japanese ゴッドハンマー
.dh 0x0000
@@chip_40:
.dh 0x015C :: .db 0x40,0x28,0x3D,0x11,0x36,0x28,0xE5 // Spikeman BodyGrd
.dh 0x004B :: .db 0x40,0x33,0x31,0x41,0x02,0xE5 // Spikeman Boomer1
.dh 0x004C :: .db 0x40,0x33,0x31,0x41,0x03,0xE5 // Spikeman Boomer2
.dh 0x004D :: .db 0x40,0x33,0x31,0x41,0x04,0xE5 // Spikeman Boomer3
.dh 0x0055 :: .db 0x40,0x3D,0x40,0x45,0x02,0xE5 // Spikeman BoyBomb1
.dh 0x0056 :: .db 0x40,0x3D,0x40,0x45,0x03,0xE5 // Spikeman BoyBomb2
.dh 0x0057 :: .db 0x40,0x3D,0x40,0x45,0x04,0xE5 // Spikeman BoyBomb3
.dh 0x0188 :: .db 0x40,0x3D,0x40,0x45,0xE5 // Spikeman BoyBomb
.dh 0x0000
@@chip_41:
.dh 0x0152 :: .db 0x41,0x3F,0x12,0x28,0x59,0x13,0x82,0x02,0xE5 // Japanese ジゴクホッケー1
.dh 0x0153 :: .db 0x41,0x3F,0x12,0x28,0x59,0x13,0x82,0x03,0xE5 // Japanese ジゴクホッケー2
.dh 0x0154 :: .db 0x41,0x3F,0x12,0x28,0x59,0x13,0x82,0x04,0xE5 // Japanese ジゴクホッケー3
.dh 0x00D4 :: .db 0x41,0x57,0x31,0x16,0x82,0xE5 // Japanese ジェラシー
.dh 0x00FA :: .db 0x41,0x5A,0x3A,0x12,0x29,0x3A,0x61,0x70,0xE5 // Japanese ジャンクマンDS
.dh 0x00F9 :: .db 0x41,0x5A,0x3A,0x12,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ジャンクマンSP
.dh 0x00F8 :: .db 0x41,0x5A,0x3A,0x12,0x29,0x3A,0xE5 // Japanese ジャンクマン
.dh 0x0000
@@chip_45:
.dh 0x008D :: .db 0x45,0x0C,0x14,0x0D,0x42,0x0C,0xE5 // Japanese ダイコウズイ
.dh 0x005C :: .db 0x45,0x4C,0x33,0x12,0x31,0x59,0x12,0xE5 // Japanese ダブルクラック
.dh 0x0178 :: .db 0x45,0x4C,0x33,0x49,0x32,0x82,0x2B,0xE5 // Japanese ダブルドリーム
.dh 0x00CF :: .db 0x45,0x4C,0x33,0x53,0x0C,0x3A,0x1E,0xE5 // Japanese ダブルポイント
.dh 0x00BB :: .db 0x45,0x82,0x12,0x11,0x5A,0x23,0x3A,0xE5 // Japanese ダークキャノン
.dh 0x00C1 :: .db 0x45,0x82,0x12,0x17,0x1D,0x82,0x41,0xE5 // Japanese ダークステージ
.dh 0x00C0 :: .db 0x45,0x82,0x12,0x17,0x51,0x34,0x59,0x49,0xE5 // Japanese ダークスプレッド
.dh 0x00BC :: .db 0x45,0x82,0x12,0x19,0x82,0x49,0xE5 // Japanese ダークソード
.dh 0x0052 :: .db 0x45,0x82,0x12,0x28,0x82,0x33,0xE5 // Japanese ダークホール
.dh 0x0140 :: .db 0x45,0x82,0x12,0x2C,0x16,0x0B,0x22,0x0F,0xE5 // Japanese ダークメシアネオ
.dh 0x00D8 :: .db 0x45,0x82,0x12,0x31,0x0C,0x3A,0xE5 // Japanese ダークライン
.dh 0x00BF :: .db 0x45,0x82,0x12,0x31,0x3A,0x17,0xE5 // Japanese ダークランス
.dh 0x00C2 :: .db 0x45,0x82,0x12,0x32,0x10,0x4A,0x32,0x82,0xE5 // Japanese ダークリカバリー
.dh 0x0170 :: .db 0x45,0x82,0x12,0x34,0x82,0x40,0x82,0xE5 // Japanese ダークレーザー
.dh 0x00BE :: .db 0x45,0x82,0x12,0x4A,0x33,0x10,0x3A,0xE5 // Japanese ダークバルカン
.dh 0x00BD :: .db 0x45,0x82,0x12,0x4E,0x2B,0xE5 // Japanese ダークボム
.dh 0x0000
@@chip_47:
.dh 0x0171 :: .db 0x47,0x47,0x47,0x47,0xE5 // English ????
@@chip_48:
.dh 0x007B :: .db 0x48,0x17,0x29,0x59,0x1B,0x02,0xE5 // Japanese デスマッチ1
.dh 0x007C :: .db 0x48,0x17,0x29,0x59,0x1B,0x03,0xE5 // Japanese デスマッチ2
.dh 0x007D :: .db 0x48,0x17,0x29,0x59,0x1B,0x04,0xE5 // Japanese デスマッチ3
.dh 0x012E :: .db 0x48,0x33,0x1A,0x34,0x0C,0x0E,0x59,0x41,0xE5 // Japanese デルタレイエッジ
.dh 0x0065 :: .db 0x48,0x55,0x17,0x14,0x82,0x49,0xE5 // Japanese ディスコード
.dh 0x0137 :: .db 0x48,0x5B,0x82,0x0F,0xE5 // Japanese デューオ
.dh 0x0000
@@chip_49:
.dh 0x00C9 :: .db 0x49,0x32,0x82,0x2B,0x0F,0x82,0x31,0xE5 // Japanese ドリームオーラ
.dh 0x0158 :: .db 0x49,0x32,0x82,0x2B,0x19,0x82,0x49,0xE5 // Japanese ドリームソード
.dh 0x0000
@@chip_4A:
.dh 0x0026 :: .db 0x4A,0x0D,0x3A,0x49,0x23,0x82,0x1E,0x02,0xE5 // Japanese バウンドノート1
.dh 0x0027 :: .db 0x4A,0x0D,0x3A,0x49,0x23,0x82,0x1E,0x03,0xE5 // Japanese バウンドノート2
.dh 0x0028 :: .db 0x4A,0x0D,0x3A,0x49,0x23,0x82,0x1E,0x04,0xE5 // Japanese バウンドノート3
.dh 0x0175 :: .db 0x4A,0x1B,0x0B,0x1A,0x32,0xE5 // Japanese バチアタリ
.dh 0x0088 :: .db 0x4A,0x32,0x0B,0x02,0x01,0x01,0xE5 // Japanese バリア100
.dh 0x0089 :: .db 0x4A,0x32,0x0B,0x03,0x01,0x01,0xE5 // Japanese バリア200
.dh 0x0037 :: .db 0x4A,0x32,0x0B,0x4C,0x33,0x19,0x82,0x49,0xE5 // Japanese バリアブルソード
.dh 0x0087 :: .db 0x4A,0x32,0x0B,0xE5 // Japanese バリア
.dh 0x000F :: .db 0x4A,0x33,0x10,0x3A,0x02,0xE5 // Japanese バルカン1
.dh 0x0010 :: .db 0x4A,0x33,0x10,0x3A,0x03,0xE5 // Japanese バルカン2
.dh 0x0011 :: .db 0x4A,0x33,0x10,0x3A,0x04,0xE5 // Japanese バルカン3
.dh 0x0051 :: .db 0x4A,0x3A,0x4C,0x82,0x31,0x3A,0x17,0xE5 // Japanese バンブーランス
.dh 0x00CE :: .db 0x4A,0x3D,0x16,0x5B,0x0D,0x18,0x0C,0xE5 // Japanese バグシュウセイ
.dh 0x00D3 :: .db 0x4A,0x3D,0x1B,0x57,0x82,0x3A,0xE5 // Japanese バグチェーン
.dh 0x0136 :: .db 0x4A,0x3D,0x1B,0x5A,0x82,0x41,0xE5 // Japanese バグチャージ
.dh 0x0029 :: .db 0x4A,0x3D,0x4E,0x2B,0xE5 // Japanese バグボム
.dh 0x0018 :: .db 0x4A,0x4C,0x33,0x15,0x0C,0x49,0xE5 // Japanese バブルサイド
.dh 0x0016 :: .db 0x4A,0x4C,0x33,0x16,0x5C,0x59,0x1E,0xE5 // Japanese バブルショット
.dh 0x0142 :: .db 0x4A,0x4C,0x33,0x17,0x51,0x34,0x59,0x49,0xE5 // Japanese バブルスプレッド
.dh 0x0017 :: .db 0x4A,0x4C,0x33,0x4C,0x0C,0xE5 // Japanese バブルブイ
.dh 0x0093 :: .db 0x4A,0x59,0x49,0x2C,0x48,0x55,0x17,0x3A,0xE5 // Japanese バッドメディスン
.dh 0x0109 :: .db 0x4A,0x82,0x1F,0x82,0x29,0x3A,0x61,0x70,0xE5 // Japanese バーナーマンDS
.dh 0x0108 :: .db 0x4A,0x82,0x1F,0x82,0x29,0x3A,0x70,0x6D,0xE5 // Japanese バーナーマンSP
.dh 0x0107 :: .db 0x4A,0x82,0x1F,0x82,0x29,0x3A,0xE5 // Japanese バーナーマン
.dh 0x0000
@@chip_4B:
.dh 0x0118 :: .db 0x4B,0x48,0x0F,0x29,0x3A,0x61,0x70,0xE5 // Japanese ビデオマンDS
.dh 0x0117 :: .db 0x4B,0x48,0x0F,0x29,0x3A,0x70,0x6D,0xE5 // Japanese ビデオマンSP
.dh 0x0116 :: .db 0x4B,0x48,0x0F,0x29,0x3A,0xE5 // Japanese ビデオマン
.dh 0x0068 :: .db 0x4B,0x59,0x3D,0x24,0x3A,0x29,0x82,0x02,0xE5 // Japanese ビッグハンマー1
.dh 0x0069 :: .db 0x4B,0x59,0x3D,0x24,0x3A,0x29,0x82,0x03,0xE5 // Japanese ビッグハンマー2
.dh 0x006A :: .db 0x4B,0x59,0x3D,0x24,0x3A,0x29,0x82,0x04,0xE5 // Japanese ビッグハンマー3
.dh 0x0180 :: .db 0x4B,0x82,0x1E,0x15,0x53,0x82,0x1E,0xE5 // Japanese ビートサポート
.dh 0x0000
@@chip_4C:
.dh 0x0081 :: .db 0x4C,0x31,0x0C,0x3A,0x49,0xE5 // Japanese ブラインド
.dh 0x00D6 :: .db 0x4C,0x31,0x59,0x12,0x0D,0x0C,0x3A,0x3D,0xE5 // Japanese ブラックウイング
.dh 0x0121 :: .db 0x4C,0x31,0x59,0x12,0x0D,0x0E,0x53,0x3A,0xE5 // Japanese ブラックウエポン
.dh 0x0134 :: .db 0x4C,0x31,0x59,0x12,0x4A,0x32,0x0B,0xE5 // Japanese ブラックバリア
.dh 0x002E :: .db 0x4C,0x31,0x59,0x12,0x4E,0x2B,0xE5 // Japanese ブラックボム
.dh 0x0005 :: .db 0x4C,0x32,0x40,0x82,0x49,0xE5 // Japanese ブリザード
.dh 0x00F1 :: .db 0x4C,0x33,0x82,0x17,0x61,0x70,0xE5 // Japanese ブルースDS
.dh 0x00F0 :: .db 0x4C,0x33,0x82,0x17,0x70,0x6D,0xE5 // Japanese ブルースSP
.dh 0x00EF :: .db 0x4C,0x33,0x82,0x17,0xE5 // Japanese ブルース
.dh 0x0135 :: .db 0x4C,0x33,0x82,0x2B,0x82,0x3A,0x34,0x0C,0xE5 // Japanese ブルームーンレイ
.dh 0x004B :: .db 0x4C,0x82,0x2C,0x31,0x3A,0x02,0xE5 // Japanese ブーメラン1
.dh 0x004C :: .db 0x4C,0x82,0x2C,0x31,0x3A,0x03,0xE5 // Japanese ブーメラン2
.dh 0x004D :: .db 0x4C,0x82,0x2C,0x31,0x3A,0x04,0xE5 // Japanese ブーメラン3
.dh 0x0000
@@chip_4E:
.dh 0x015C :: .db 0x4E,0x48,0x55,0x3B,0x82,0x49,0xE5 // Japanese ボディガード
.dh 0x0055 :: .db 0x4E,0x82,0x0C,0x42,0x4E,0x2B,0x02,0xE5 // Japanese ボーイズボム1
.dh 0x0056 :: .db 0x4E,0x82,0x0C,0x42,0x4E,0x2B,0x03,0xE5 // Japanese ボーイズボム2
.dh 0x0057 :: .db 0x4E,0x82,0x0C,0x42,0x4E,0x2B,0x04,0xE5 // Japanese ボーイズボム3
.dh 0x0188 :: .db 0x4E,0x82,0x0C,0x42,0x4E,0x2B,0xE5 // Japanese ボーイズボム
.dh 0x0000
@@chip_4F:
.dh 0x0159 :: .db 0x4F,0x0C,0x33,0x49,0x31,0x0C,0x4A,0x82,0xE5 // Japanese パイルドライバー
.dh 0x00B2 :: .db 0x4F,0x22,0x33,0x16,0x5B,0x82,0x1E,0x02,0xE5 // Japanese パネルシュート1
.dh 0x00B3 :: .db 0x4F,0x22,0x33,0x16,0x5B,0x82,0x1E,0x03,0xE5 // Japanese パネルシュート2
.dh 0x00B4 :: .db 0x4F,0x22,0x33,0x16,0x5B,0x82,0x1E,0x04,0xE5 // Japanese パネルシュート3
.dh 0x0074 :: .db 0x4F,0x22,0x33,0x17,0x1B,0x82,0x33,0xE5 // Japanese パネルスチール
.dh 0x007A :: .db 0x4F,0x22,0x33,0x32,0x1A,0x82,0x3A,0xE5 // Japanese パネルリターン
.dh 0x0000
@@chip_51:
.dh 0x009D :: .db 0x51,0x35,0x52,0x31,0x4E,0x2B,0x02,0xE5 // Japanese プロペラボム1
.dh 0x009E :: .db 0x51,0x35,0x52,0x31,0x4E,0x2B,0x03,0xE5 // Japanese プロペラボム2
.dh 0x009F :: .db 0x51,0x35,0x52,0x31,0x4E,0x2B,0x04,0xE5 // Japanese プロペラボム3
.dh 0x0000
@@chip_53:
.dh 0x00CC :: .db 0x53,0x0C,0x42,0x3A,0x0B,0x21,0x4B,0x17,0xE5 // Japanese ポイズンアヌビス
.dh 0x015B :: .db 0x53,0x0C,0x42,0x3A,0x26,0x54,0x31,0x0F,0xE5 // Japanese ポイズンファラオ
.dh 0x017D :: .db 0x53,0x33,0x1A,0x82,0x3B,0x0C,0x17,0x1E,0xE5 // Japanese ポルターガイスト
.dh 0x0000
@@chip_77:
.dh 0x00DA :: .db 0x77,0x18,0x0C,0x4A,0x82,0xE5 // Japanese Zセイバー
.dh 0x0000
@@chip_7E:
.dh 0x0171 :: .db 0x7E,0x7E,0x7E,0x7E,0xE5 // Japanese ????
.dh 0x0000
@@chip_9D:
.dh 0x0171 :: .db 0x9D,0x9D,0x9D,0x9D,0xE5 // 2012 demo ????
.dh 0x0000 |
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_718.asm | ljhsiun2/medusa | 9 | 160020 | <filename>Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xca.log_21829_718.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %r9
push %rbx
push %rdi
lea addresses_UC_ht+0x10e5d, %rbx
nop
nop
lfence
and $0xffffffffffffffc0, %rbx
movaps (%rbx), %xmm1
vpextrq $1, %xmm1, %r8
nop
nop
nop
cmp %r14, %r14
lea addresses_A_ht+0x1ee5d, %rdi
add %r9, %r9
mov (%rdi), %r13w
nop
nop
nop
and %r9, %r9
lea addresses_A_ht+0x1485d, %r9
nop
nop
nop
nop
and $5386, %rbx
mov $0x6162636465666768, %r8
movq %r8, (%r9)
dec %rbx
lea addresses_D_ht+0x10a5d, %r8
clflush (%r8)
nop
nop
nop
nop
nop
and $37621, %r11
movb $0x61, (%r8)
nop
nop
nop
add $42763, %r11
pop %rdi
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %rcx
push %rdx
// Faulty Load
mov $0x16022f0000000e5d, %r10
sub %r14, %r14
mov (%r10), %rcx
lea oracles, %r13
and $0xff, %rcx
shlq $12, %rcx
mov (%r13,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Cubical/Algebra/NatSolver/HornerForms.agda | thomas-lamiaux/cubical | 1 | 11893 | <reponame>thomas-lamiaux/cubical<gh_stars>1-10
{-# OPTIONS --safe #-}
module Cubical.Algebra.NatSolver.HornerForms where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat hiding (isZero)
open import Cubical.Data.FinData
open import Cubical.Data.Vec
open import Cubical.Data.Bool using (Bool; true; false; if_then_else_)
private
variable
ℓ : Level
{-
This defines the type of multivariate Polynomials over ℕ.
The construction is based on the algebraic fact
ℕ[X₀][X₁]⋯[Xₙ] ≅ ℕ[X₀,⋯,Xₙ]
BUT: Contrary to algebraic convetions, we will give 'Xₙ' the lowest index
in the definition of 'Variable' below. So if 'Variable n k' is identified
with 'Xₖ', what we construct should rather be denoted with
ℕ[Xₙ][Xₙ₋₁]⋯[X₀]
or, to be precise about the evaluation order:
(⋯((ℕ[Xₙ])[Xₙ₋₁])⋯)[X₀]
-}
data IteratedHornerForms : ℕ → Type ℓ-zero where
const : ℕ → IteratedHornerForms ℕ.zero
0H : {n : ℕ} → IteratedHornerForms (ℕ.suc n)
_·X+_ : {n : ℕ} → IteratedHornerForms (ℕ.suc n) → IteratedHornerForms n
→ IteratedHornerForms (ℕ.suc n)
eval : {n : ℕ} (P : IteratedHornerForms n)
→ Vec ℕ n → ℕ
eval (const r) [] = r
eval 0H (_ ∷ _) = 0
eval (P ·X+ Q) (x ∷ xs) =
(eval P (x ∷ xs)) · x + eval Q xs
module IteratedHornerOperations where
private
1H' : (n : ℕ) → IteratedHornerForms n
1H' ℕ.zero = const 1
1H' (ℕ.suc n) = 0H ·X+ 1H' n
0H' : (n : ℕ) → IteratedHornerForms n
0H' ℕ.zero = const 0
0H' (ℕ.suc n) = 0H
1ₕ : {n : ℕ} → IteratedHornerForms n
1ₕ {n = n} = 1H' n
0ₕ : {n : ℕ} → IteratedHornerForms n
0ₕ {n = n} = 0H' n
X : (n : ℕ) (k : Fin n) → IteratedHornerForms n
X (ℕ.suc m) zero = 1ₕ ·X+ 0ₕ
X (ℕ.suc m) (suc k) = 0ₕ ·X+ X m k
_+ₕ_ : {n : ℕ} → IteratedHornerForms n → IteratedHornerForms n
→ IteratedHornerForms n
(const r) +ₕ (const s) = const (r + s)
0H +ₕ Q = Q
(P ·X+ r) +ₕ 0H = P ·X+ r
(P ·X+ r) +ₕ (Q ·X+ s) = (P +ₕ Q) ·X+ (r +ₕ s)
isZero : {n : ℕ} → IteratedHornerForms (ℕ.suc n)
→ Bool
isZero 0H = true
isZero (P ·X+ P₁) = false
_⋆_ : {n : ℕ} → IteratedHornerForms n → IteratedHornerForms (ℕ.suc n)
→ IteratedHornerForms (ℕ.suc n)
_·ₕ_ : {n : ℕ} → IteratedHornerForms n → IteratedHornerForms n
→ IteratedHornerForms n
r ⋆ 0H = 0H
r ⋆ (P ·X+ Q) = (r ⋆ P) ·X+ (r ·ₕ Q)
const x ·ₕ const y = const (x · y)
0H ·ₕ Q = 0H
(P ·X+ Q) ·ₕ S =
let
z = (P ·ₕ S)
in if (isZero z)
then (Q ⋆ S)
else (z ·X+ 0ₕ) +ₕ (Q ⋆ S)
Variable : (n : ℕ) (k : Fin n) → IteratedHornerForms n
Variable n k = IteratedHornerOperations.X n k
Constant : (n : ℕ) (r : ℕ) → IteratedHornerForms n
Constant ℕ.zero r = const r
Constant (ℕ.suc n) r = IteratedHornerOperations.0ₕ ·X+ Constant n r
|
src/asis/a4g-norm.adb | My-Colaborations/dynamo | 15 | 9453 | <gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . N O R M --
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2011, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
with Asis.Declarations; use Asis.Declarations;
with Asis.Elements; use Asis.Elements;
with Asis.Expressions; use Asis.Expressions;
with Asis.Statements; use Asis.Statements;
with Asis.Set_Get; use Asis.Set_Get;
with A4G.Asis_Tables; use A4G.Asis_Tables;
with A4G.A_Debug; use A4G.A_Debug;
with A4G.A_Output; use A4G.A_Output;
with A4G.A_Types; use A4G.A_Types;
with A4G.Contt.UT; use A4G.Contt.UT;
with A4G.Int_Knds; use A4G.Int_Knds;
with A4G.Itests; use A4G.Itests;
with A4G.Mapping; use A4G.Mapping;
with Atree; use Atree;
with Einfo; use Einfo;
with Namet; use Namet;
with Nlists; use Nlists;
with Output; use Output;
with Sinfo; use Sinfo;
package body A4G.Norm is
use Asis;
----------------------
-- Local functions --
----------------------
function Get_Type_With_Discr (Constr_Node : Node_Id) return Node_Id;
-- for a node of N_Index_Or_Discriminant_Constraint type, which
-- represents a discriminant constraint, this function yields the
-- node representing the type declaration with a known discriminant
-- part, where discriminants being constrained are defined. The
-- intent is to get the right discriminant declarations (as subcomponents
-- of the results), so these discriminant declarations may be implicit,
-- as well as the type represented by the result node.
--
-- NOTE: this function looks like a particular case of some more
-- general function useful for finding out the implicit
-- components of a derived type
function Unwind_Till_Discriminants (Type_Decl : Node_Id) return Node_Id;
-- Starting from the node representing the declaration of access or
-- derived type (ether formal or "normal"), it gives the type
-- declaration node representing the designated or ancestor type
-- (unwinding all the intermediate access or derived types) which
-- has discriminant declarations. This function is supposed to be called
-- in the situation, when it is known for sure, that the desired
-- type indeed has discriminants
--
-- NOTE: this function looks like a particular case of some more
-- general function useful for finding out the first non-access
-- designated/non-derived ancestor type for a given access/derived
-- type
----------------------------
-- Defining_Gen_Parameter --
----------------------------
function Defining_Gen_Parameter (Gen_Form_Par : Node_Id) return Node_Id is
Result_Node : Node_Id;
Gen_Form_Pars : List_Id;
Next_Par : Node_Id;
begin
-- ONLY PARTIAL IMPLEMENTATION FOR OPERATOR_SYMBOL!!!!
-- traversing the tree till the declaration of the corresponding
-- generic unit:
Result_Node := Parent (Gen_Form_Par); -- generic association
Result_Node := Parent (Result_Node); -- generic instantiation
Result_Node := Sinfo.Name (Original_Node (Result_Node));
-- the name of the generic unit being instantiated
Result_Node := Entity (Result_Node);
-- the defining name of the generic unit being instantiated
while Nkind (Original_Node (Result_Node)) not in
N_Generic_Declaration
loop
Result_Node := Parent (Result_Node);
end loop;
Result_Node := Original_Node (Result_Node); -- ???
-- the node representing the declaration of the corresponding generic
-- unit, but this is a rewritten node in the current GNAT model for
-- generics, therefore:
-- looking for the defining occurrence of the corresponding
-- parameter:
Gen_Form_Pars := Generic_Formal_Declarations (Result_Node);
Next_Par := First_Non_Pragma (Gen_Form_Pars);
while Present (Next_Par) loop
-- !!! only partial implementation for generic parameters which
-- !!! are generic functions-operators
if Nkind (Next_Par) in N_Formal_Subprogram_Declaration and then
Nkind (Specification (Next_Par)) = N_Function_Specification
then
Result_Node := Defining_Unit_Name (Specification (Next_Par));
-- cannot have a prefix!!!
if Chars (Result_Node) = Chars (Gen_Form_Par) then
-- note, that this is only a "very partial" solution
-- for generic "+" and "-" functions!!!
return Result_Node;
end if;
end if;
Next_Par := Next_Non_Pragma (Next_Par);
end loop;
return Empty;
-- to raise an exception in the calling context if we are wrong
end Defining_Gen_Parameter;
--------------------
-- Discr_Def_Name --
--------------------
function Discr_Def_Name
(Association : Asis.Discriminant_Association)
return Asis.Defining_Name
is
Result_Node : Node_Id;
Result_Unit : Asis.Compilation_Unit;
Result_Element : Asis.Defining_Name;
Inherited_Discr : Boolean;
begin
-- a normalized association contains the node on which the result
-- should be built as the Node field of Association, see the
-- documentation in the body of Normalized_Discriminant_Associations.
-- So we may start for creating the "rough" version of Result_Element:
Result_Node := Node (Association);
Result_Unit := Enclosing_Unit (Encl_Cont_Id (Association), Result_Node);
Result_Element := Node_To_Element_New
(Node => Result_Node,
Internal_Kind => A_Defining_Identifier,
In_Unit => Result_Unit);
-- and now we have to correct, if needed, the fields
-- Is_Part_Of_Implicit, Is_Part_Of_Inherited and Is_Part_Of_Instance
-- of Result_Element, which are set False by default
Inherited_Discr := Is_Inherited_Discriminant (Result_Node);
Set_From_Implicit (Result_Element, Inherited_Discr);
Set_From_Inherited (Result_Element, Inherited_Discr);
-- for discriminants, to be implicit and to be inherited mean the
-- same
Set_From_Instance (Result_Element, Is_From_Instance (Result_Node));
return Result_Element;
end Discr_Def_Name;
-------------------------
-- Get_Type_With_Discr --
-------------------------
function Get_Type_With_Discr (Constr_Node : Node_Id) return Node_Id is
Result_Node : Node_Id;
Curr_Node : Node_Id;
Curr_Node_Kind : Node_Kind;
begin
-------------------------
-- Implementation Note --
-------------------------
-- The current implementation definitely contains errors and it
-- is far from being perfect.
--
-- For now, at least the problem with the formal types is known
-- as a real source for ASIS crashes. The problem is that GNAT
-- rewrites completely all the tree structures for generic
-- declarations, and the original structures ARE NOT completely
-- decorated. And (at least, now) ASIS works with original
-- tree structures only. So some semantic node fields may be
-- Empty in the original tree structures corresponding to
-- generics. (ASIS will crash, when a discriminant constraint
-- being analyzed is in a generic declaration)
-- first, we have to go from the constraint node to the subtype
-- indication to which this constraint is applied
Curr_Node := Sinfo.Subtype_Mark (Parent (Constr_Node));
-- second, we have to go from this subtype indication to the
-- corresponding base type
Curr_Node := Base_Type (Entity (Curr_Node));
-- this is a defining identifier,
Curr_Node := Parent (Curr_Node);
-- and this should be the node representing a type declaration,
-- the only possible Node Kinds for its *original* node are:
--
-- N_Formal_Type_Declaration,
-- N_Full_Type_Declaration,
-- N_Incomplete_Type_Declaration,
-- N_Private_Extension_Declaration,
-- N_Private_Type_Declaration,
-- N_Protected_Type_Declaration,
--
-- But, for derived and formal derived types, GNAT rewrites the
-- corresponding tree structures: it replaces the original node
-- of N_Formal_Type_Declaration or N_Full_Type_Declaration kind
-- with N_Subtype_Decalration node, but the immediately preceding
-- node is the (inserted) node of N_Full_Type_Declaration kind,
-- this type implicitly defines all the discriminants and
-- components which are inherited by the derived type.
if Debug_Flag_A then
Write_Eol;
Write_Str ("Norm.Get_Type_With_Discr: type on which discriminant ");
Write_Str ("constraint is imposed");
Write_Eol;
Write_Node (Curr_Node);
Write_Eol;
end if;
Curr_Node_Kind := Nkind (Curr_Node);
-- and now we have to analyze the type declaration (definition?)
-- and to choose the further traversing depending on this analysis.
case Curr_Node_Kind is
when N_Incomplete_Type_Declaration |
N_Private_Extension_Declaration |
N_Private_Type_Declaration |
N_Protected_Type_Declaration =>
-- these cases are easy: we already have needed discriminants
-- in the type declaration:
Result_Node := Curr_Node;
when N_Formal_Type_Declaration =>
case Nkind (Sinfo.Formal_Type_Definition (Curr_Node)) is
when N_Formal_Private_Type_Definition =>
-- the situation is the same as for the previous
-- alternative of the external case - the discriminant
-- declarations are already here
Result_Node := Curr_Node;
-- when N_Formal_Derived_Type_Definition =>
-- RM95 12.5.1(11): "The declaration of a formal derived
-- type shall not have a known_discriminant_part"
-- therefore we have to find implicit discriminant
-- declarations
-- in fact, this case can never happen - GNAT inserts
-- the declaration of (implicit) type having the
-- corresponding discriminant declarations just before
-- the derived type declaration, and all the semantic
-- links in the tree are set to this implicit type
when N_Access_To_Object_Definition =>
-- we have to go to the designated type (unwinding other
-- access types, if any) which has these discriminants
Result_Node := Unwind_Till_Discriminants (Result_Node);
when others =>
-- We should never be here
raise Internal_Implementation_Error;
end case;
when N_Full_Type_Declaration =>
case Nkind (Sinfo.Type_Definition (Curr_Node)) is
-- when N_Derived_Type_Definition =>
-- ?????? (it may have its "own" discriminants, and it may
-- inherit discriminants from an ancestor
--
-- in fact, this case can never happen - GNAT inserts
-- the declaration of (implicit) type having the
-- corresponding discriminant declarations just before
-- the derived type declaration, and all the semantic
-- links in the tree are set to this implicit type
when N_Record_Definition =>
-- the situation is the same as for the previous
-- alternative of the external case - the discriminant
-- declarations are already here
Result_Node := Curr_Node;
when N_Access_To_Object_Definition =>
-- we have to go to the designated type (unwinding other
-- access types, if any) which has these discriminants
Result_Node := Unwind_Till_Discriminants (Result_Node);
when others =>
-- We should never be here
raise Internal_Implementation_Error;
end case;
when others =>
-- We should never be here
raise Internal_Implementation_Error;
end case;
return Result_Node;
end Get_Type_With_Discr;
------------------------------------------
-- Normalized_Discriminant_Associations --
------------------------------------------
function Normalized_Discriminant_Associations
(Constr_Elem : Asis.Element;
Constr_Node : Node_Id)
return Asis.Association_List
is
Association_Node_List : constant List_Id := Constraints (Constr_Node);
-- Association_Node_List cannot be No_List or Empty_List
Result_Length : Natural := 0;
Curr_Association_Node : Node_Id;
begin
-------------------------
-- Implementation Note --
-------------------------
-- This code may be incomplete or it may contain errors originated
-- from incomplete analyziz of the situation. But we need some code
-- to start from. So this is the first step of the step-by-step
-- development of this function
-- First, we have to compute the length of the result. We cannot use
-- List_Length (Association_Node_List) for it because of the constraints
-- like this
--
-- T (1, 2, D3|D4 => 3)
Curr_Association_Node := First_Non_Pragma (Association_Node_List);
-- First, counting positional associations which go first (if any)
while Present (Curr_Association_Node) and then
Nkind (Curr_Association_Node) /= N_Discriminant_Association
loop
Result_Length := Result_Length + 1;
Curr_Association_Node := Next_Non_Pragma (Curr_Association_Node);
end loop;
-- Now, we have to count named associations (if any), taking into
-- account bad style like D3|D4 => 3 in discriminant constraints :[
while Present (Curr_Association_Node) loop
-- and if we are here, Curr_Association_Node may be of
-- N_Discriminant_Association kind only
Result_Length := Result_Length +
Natural (List_Length
(Selector_Names (Curr_Association_Node)));
Curr_Association_Node := Next_Non_Pragma (Curr_Association_Node);
end loop;
declare
Result_List : Asis.Association_List (1 .. Result_Length);
-- and now we have to build Result_List in a Element-by-Element
-- manner
--
-- The current implementation approach is:
--
-- - GNAT (3.05) does not rewrite the tree structures for
-- discriminant associations, so we can use the R_Node fields
-- of the result Elements to point to the corresponding
-- expression (and, therefore, we can use the general
-- R_Node-based approach for Enclosing_Element), and we can
-- use the Node field to point to the defining occurrence
-- of the corresponding discriminant
--
-- - We have to find and to go through the definitions of the
-- corresponding discriminants anyway - to order the discriminant
-- associations in the result, as it is required by the
-- Normalized parameter set True. So it would not make sense to
-- postpone finding of the discriminant defining name till
-- it will be required by the
-- Asis.Expressions.Discriminant_Selector_Names query
Discr_Spec_Nodes : List_Id;
-- here we should have the discriminant specifications from the
-- corresponding discriminant part
Type_Decl_Node : Node_Id;
-- the type declaration containing these discriminant
-- specifications
Discr_Spec_Node : Node_Id;
Discr_Def_Id_N : Node_Id;
Discr_Def_Name : Name_Id;
Association_Trav_Node : Node_Id;
Discr_Sel_N_Node : Node_Id;
Is_Positional_Association : Boolean := True;
-- flag indicating if the discriminant association to process is
-- a positional association
begin
Type_Decl_Node := Get_Type_With_Discr (Constr_Node);
Discr_Spec_Nodes := Discriminant_Specifications (Type_Decl_Node);
-- we prefer to have this extra step with Type_Decl_Node to
-- make the maintenance of finding the discriminant specifications
-- easier
Discr_Spec_Node := First_Non_Pragma (Discr_Spec_Nodes);
Curr_Association_Node := First_Non_Pragma (Association_Node_List);
for I in 1 .. Result_Length loop
-- Result_Length is the same as List_Lenght (Discr_Spec_Nodes),
-- otherwise it is an error!
-- We have to process positional and named associations
-- separately
-- Positional associations go first, and they do not have
-- a discriminant names in the tree structures for the constraint
-- being processed, so we have to pick up elements one-by-one
-- from two lists - Discr_Spec_Nodes and Association_Node_List -
-- and to form one component of Result_List from each pair
-- Named associations go last, one named association may
-- be transformed into several normalized ASIS discriminant
-- associations
Discr_Def_Id_N := Defining_Identifier (Discr_Spec_Node);
if Nkind (Curr_Association_Node) = N_Discriminant_Association then
Is_Positional_Association := False;
end if;
if Is_Positional_Association then
-- First, we create A_Discriminant_Association Element
-- from Curr_Association_Node, as we do it for non-normalized
-- associations
Result_List (I) := Node_To_Element_New
(Starting_Element => Constr_Elem,
Node => Curr_Association_Node,
Internal_Kind => A_Discriminant_Association,
Norm_Case => Is_Normalized);
-- And now we have to correct the Node field of this Element:
Set_Node (Result_List (I), Discr_Def_Id_N);
-- And now we have to prepare the next iteration of the loop:
Curr_Association_Node :=
Next_Non_Pragma (Curr_Association_Node);
else
Discr_Def_Name := Chars (Discr_Def_Id_N);
Association_Trav_Node := Curr_Association_Node;
-- as soon as all the positional associations have been
-- processed, Curr_Association_Node is frozen as pointed to the
-- first named association (if any)
Scan_Named_Associations : while Present (Association_Trav_Node)
loop
-- this loop scans all the named associations
Discr_Sel_N_Node :=
First_Non_Pragma (Selector_Names (Association_Trav_Node));
while Present (Discr_Sel_N_Node) loop
-- This loop cans all the discriminant selector names
-- in a given named discriminant association
exit Scan_Named_Associations
when Chars (Discr_Sel_N_Node) = Discr_Def_Name;
Discr_Sel_N_Node := Next_Non_Pragma (Discr_Sel_N_Node);
end loop;
Association_Trav_Node :=
Next_Non_Pragma (Association_Trav_Node);
end loop Scan_Named_Associations;
-- and when we are here, Association_Trav_Node points to the
-- (named) discriminant association containing the expression
-- for Discr_Spec_Node and Discr_Def_Id_N being processed. So:
Result_List (I) := Node_To_Element_New
(Starting_Element => Constr_Elem,
Node => Sinfo.Expression (Association_Trav_Node),
Internal_Kind => A_Discriminant_Association,
Norm_Case => Is_Normalized);
-- And now we have to correct the Node field of this Element,
-- just as for positional associations:
Set_Node (Result_List (I), Discr_Def_Id_N);
end if;
Discr_Spec_Node := Next_Non_Pragma (Discr_Spec_Node);
-- this should not be under "if Is_Positional_Association",
-- because we have to go one step ahead in Discr_Spec_Nodes
-- for every iteration of this loop
end loop;
return Result_List;
end;
end Normalized_Discriminant_Associations;
-------------------------------------
-- Normalized_Generic_Associations --
-------------------------------------
function Normalized_Generic_Associations
(Inst_Elem : Asis.Element;
Templ_Node : Node_Id)
return Asis.Association_List
is
Inst_Node : Node_Id := R_Node (Inst_Elem);
-- Represents the instantiation
Exp_Inst_Node : Node_Id := R_Node (Inst_Elem);
-- Should be send to point to the expanded package created to the
-- instantiation
Current_Formal : Node_Id;
Curr_Form_Original : Node_Id;
-- the generic formal parameter declaration node currently
-- processed, corresponds to Current_Associationin the Result
Current_Formal_Def : Node_Id;
-- the node representing the defining identifier or the defining
-- program unit name from Current_Formal
Current_Actual : Node_Id;
-- the node representing the actual parameter being a part of
-- normalized generic association to be constructed
Tmp : Node_Id;
Current_Norm_Case : Normalization_Cases;
Next_Renaming_In_Instance : Node_Id;
-- Next artificial declaration created in the instance to pass
-- actual parameters
Still_Positional : Boolean := True;
-- during constructing the result we traverse both the formal part
-- and instantiation. This flag shows if we are in the positional
-- (if any) or in the named (if any) part of the generic
-- actual part.
Next_Positional_Actual : Node_Id := Empty;
-- This is the next generic association (if any) being traversed in
-- the positional part of the generic actual part. When all
-- the positional part is traversed, but there are some named
-- associations after them it is set to the first named
-- association. Remains equal to Empty, if there is
-- no generic actual part.
Next_Actual : Node_Id;
-- just needed to traverse the generic actual part, when looking
-- among the named associations for the explicitly provided actual
Actual_Found : Boolean;
No_More_Actual : Boolean := False;
-- Is set to True, when there is no more actual to investigate
-- in the generic actual part
procedure Find_Default;
-- This procedure works on all the objects declared above in
-- Normalized_Generic_Associations as on global variables.
-- It should be called if a generic actual part does not contain
-- any actual for a given pair of Current_Formal-Current_Association,
-- and it defines the default to be used in the normalized generic
-- association, that is, it defines Current_Actual and
-- Current_Spec_Case.
procedure Find_Default is
begin
-- if we do not have a box in the declaration of the
-- corresponding actual parameter, then everything is simple:
if Nkind (Current_Formal) = N_Formal_Object_Declaration then
Tmp := Current_Formal;
while Prev_Ids (Tmp) loop
Tmp := Prev_Non_Pragma (Tmp);
end loop;
Current_Actual := Sinfo.Default_Expression (Tmp);
Current_Norm_Case := Is_Normalized_Defaulted;
elsif Nkind (Current_Formal) in
N_Formal_Subprogram_Declaration and then
Present (Default_Name (Current_Formal))
then
Current_Actual := Default_Name (Current_Formal);
Current_Norm_Case := Is_Normalized_Defaulted;
elsif Nkind (Current_Formal) in
N_Formal_Subprogram_Declaration and then
Box_Present (Current_Formal)
then
-- and this is the most interesting case...
-- ASIS requires in this case to return some "implicit naming
-- expression" being a reference to the actual subprogram. The
-- tree already contains such an expression.
while not (Nkind (Next_Renaming_In_Instance) =
N_Subprogram_Renaming_Declaration
and then
Corresponding_Formal_Spec (Next_Renaming_In_Instance) =
Current_Formal_Def)
loop
Next_Renaming_In_Instance := Next (Next_Renaming_In_Instance);
end loop;
Current_Actual := Sinfo.Name (Next_Renaming_In_Instance);
Current_Norm_Case := Is_Normalized_Defaulted_For_Box;
end if;
end Find_Default;
begin -- Normalized_Generic_Associations
Asis_Element_Table.Init;
----------------------------------------------------------
-- The implementation approach and the representation --
-- of the normalized generic associations --
----------------------------------------------------------
-- Each normalized generic association in ASIS is represented by
-- three nodes:
--
-- R_Node - represents the corresponding instantiation,
-- is used for Enclosing_Element purposes only;
-- Node - represents the defining node of the corresponding
-- generic formal parameter;
-- Node_Field_2 - represents the actual parameter
--
-- See also the documentation of Asis.Expressions.Actual_Parameter
-- for the details of obtaining the actual parameter from
-- a normalized generic association
if Nkind (Inst_Node) not in
N_Function_Instantiation .. N_Procedure_Instantiation
then
Inst_Node := Node (Inst_Elem);
end if;
if Is_Rewrite_Substitution (Exp_Inst_Node)
and then
Nkind (Original_Node (Exp_Inst_Node)) in N_Generic_Instantiation
then
-- This is the case for library-level instantiations
if Nkind (Exp_Inst_Node) = N_Package_Body then
Exp_Inst_Node := Corresponding_Spec (Exp_Inst_Node);
while Nkind (Exp_Inst_Node) /= N_Package_Declaration loop
Exp_Inst_Node := Parent (Exp_Inst_Node);
end loop;
end if;
elsif Nkind (Exp_Inst_Node) = N_Package_Declaration
and then
Nkind (Original_Node (Exp_Inst_Node)) =
N_Formal_Package_Declaration
then
null;
else
Exp_Inst_Node := Prev (Exp_Inst_Node);
end if;
if Nkind (Exp_Inst_Node) = N_Package_Body then
-- Skipping expanded body
Exp_Inst_Node := Prev (Exp_Inst_Node);
end if;
pragma Assert (Nkind (Exp_Inst_Node) = N_Package_Declaration);
Next_Renaming_In_Instance := Specification (Exp_Inst_Node);
Next_Renaming_In_Instance :=
First_Non_Pragma (Visible_Declarations (Next_Renaming_In_Instance));
if No (Generic_Associations (Inst_Node)) then
Still_Positional := False;
No_More_Actual := True;
else
Next_Positional_Actual :=
First_Non_Pragma (Generic_Associations (Inst_Node));
if Present (Selector_Name (Next_Positional_Actual)) then
Still_Positional := False;
end if;
end if;
Current_Formal :=
First_Non_Pragma (Generic_Formal_Declarations (Templ_Node));
while Present (Current_Formal)
and then
(not Comes_From_Source (Original_Node (Current_Formal))
or else
Nkind (Current_Formal) = N_Use_Package_Clause
or else
Nkind (Current_Formal) = N_Use_Type_Clause)
loop
-- This loop is needed because of formal packages - the front-end
-- creates the artificial package declarations nodes for them, so
-- we have to skip these nodes
Current_Formal := Next_Non_Pragma (Current_Formal);
end loop;
Curr_Form_Original := Original_Node (Current_Formal);
-- it cannot be any pragma inside a formal part, so we do not
-- need First/Next_Non_Pragma here
-- This is the main loop, where the next normalized generic
-- association is created
while Present (Current_Formal) loop
-- The only thing we really have to compute is the actual
-- parameter for a given association. Three cases can be possible:
-- 1. an actual is passed in the generic association
-- 2. the default defined in the specification of the corresponding
-- formal parameter is used
-- 3. the corresponding formal procedure has A_Box_Default, and
-- the actual is defined at the place of the instantiation
if Nkind (Curr_Form_Original) in N_Formal_Subprogram_Declaration
or else
Nkind (Curr_Form_Original) = N_Package_Declaration
then
Current_Formal_Def :=
Defining_Unit_Name (Specification (Curr_Form_Original));
else
Current_Formal_Def := Defining_Identifier (Curr_Form_Original);
end if;
-- first, trying to define, if there is an actual in the generic
-- actual part
if Still_Positional then
-- well-defined case - we have an actual in the generic
-- actual part. So, let's just pick it up:
Current_Actual :=
Explicit_Generic_Actual_Parameter (Next_Positional_Actual);
Current_Norm_Case := Is_Normalized;
-- And now we have to try to move Next_Positional_Actual in the
-- generic actual part.
if Present (Next_Non_Pragma (Next_Positional_Actual)) then
Next_Positional_Actual :=
Next_Non_Pragma (Next_Positional_Actual);
if Present (Selector_Name (Next_Positional_Actual)) then
Still_Positional := False;
end if;
else
Still_Positional := False;
No_More_Actual := True;
end if;
elsif not No_More_Actual then
-- Here we have to investigate the named generic associations
-- to see if there is an actual for the currently created
-- normalized ASIS association. We just go through all the
-- named associations and compare Current_Formal_Def with
-- the name of the formal from an association
Next_Actual := Next_Positional_Actual;
Actual_Found := False;
while Present (Next_Actual) loop
-- comparing Current_Formal_Def with the name of the
-- formal parameter in a named association all we have
-- to compare are Chars field
if Comes_From_Source (Next_Actual) and then
(Chars (Current_Formal_Def) =
Chars (Selector_Name (Next_Actual)))
then
Current_Actual :=
Explicit_Generic_Actual_Parameter (Next_Actual);
Current_Norm_Case := Is_Normalized;
Actual_Found := True;
exit;
end if;
Next_Actual := Next_Non_Pragma (Next_Actual);
end loop;
if not Actual_Found then
Find_Default;
end if;
else
-- for sure, no actual is provided in the generic actual
-- part for a given association. We have to pick up the
-- corresponding default parameter
Find_Default;
end if;
Asis_Element_Table.Append (
Node_To_Element_New (Node => R_Node (Inst_Elem),
Node_Field_2 => Current_Actual,
Starting_Element => Inst_Elem,
Internal_Kind => A_Generic_Association,
Norm_Case => Current_Norm_Case));
-- and here we have to correct the following fields in this
-- component of the result:
-- first, Node_To_Element_New set the Node field as Original_Node
-- of Inst_Node, but we need the defining occurrence of the formal
-- parameter here, therefore:
Set_Node
(Asis_Element_Table.Table (Asis_Element_Table.Last),
Current_Formal_Def);
-- then, we have to set On the Is_Part_Of_Implicit flag
Set_From_Implicit
(Asis_Element_Table.Table (Asis_Element_Table.Last));
Current_Formal := Next_Non_Pragma (Current_Formal);
while Present (Current_Formal)
and then
(not Comes_From_Source (Original_Node (Current_Formal))
or else
Nkind (Current_Formal) = N_Use_Package_Clause
or else
Nkind (Current_Formal) = N_Use_Type_Clause)
loop
Current_Formal := Next_Non_Pragma (Current_Formal);
end loop;
Curr_Form_Original := Original_Node (Current_Formal);
end loop;
return Asis.Association_List
(Asis_Element_Table.Table (1 .. Asis_Element_Table.Last));
end Normalized_Generic_Associations;
-----------------------------------
-- Normalized_Param_Associations --
-----------------------------------
function Normalized_Param_Associations
(Call_Elem : Asis.Element)
return Asis.Association_List
is
Call_Node : Node_Id;
-- This node represents a call construct. It may be either
-- A_Fuction_Call expression element or a call statement
Subprogram_Entity : Entity_Id := Empty;
-- In case if Call_Elem represents the call to inherited subprogram,
-- should be sent to subprogram entity, otherwise is Empty
Next_Formal : Node_Id;
-- The specification of the formal parameters of the called entity. We
-- iterate through these specifications to construct the list of
-- normalized associations
Next_Call_Association : Node_Id := Empty;
-- The next parameter association in the call construct. We iterate
-- through these associations one by one while we are in positional
-- associations (if any). Next_Call_Association is equal to Empty only
-- before creating the first association (that is, before processing
-- the first association of the call construct, if any)
Actual_Node : Node_Id := Empty;
-- The node representing the actual parameter. Depending on whether this
-- parameter is submitted explicitly or not, is taken either from
-- Next_Association node or from Next_Formal node.
Still_Positional : Boolean := True;
-- Flag indicating if we are still processing position associations. Is
-- set of by Get_Actual is it detects that we already are in named
-- associations or if there are no associations (any more) in the call
-- context
Norm_Case : Normalization_Cases;
function Get_Call_Node (E : Asis.Element) return Node_Id;
-- Returns the node representing the call.
function Get_First_Formal (E : Asis.Element) return Entity_Id;
-- Returns the declaration node of the first formal parameter of the
-- called entity
function Get_Actual return Node_Id;
-- This function tries to get the next actual parameter from the call,
-- using Next_Call_Association, Still_Positional and Next_Formal as
-- global variables. In case if the next actual parameter is still from
-- positional associations from the call, it moves Next_Call_Association
-- to point to this positional association, otherwise
-- the value of Next_Call_Association is undefined (but tot Empty!)
function Get_Default (N : Node_Id) return Node_Id;
-- Returns the default initialization expression from the declaration
-- of a formal parameter
function Get_Subprogram_Entity (N : Node_Id) return Entity_Id;
-- Provided that N represents a call, checks if this is a call to an
-- inherited subprogram and if it is, returns the entity node of this
-- subprogram. Otherwise returns Empty.
----------------
-- Get_Actual --
----------------
function Get_Actual return Node_Id is
Result : Node_Id := Empty;
Next_Association : Node_Id;
begin
if No (Next_Call_Association) then
-- This is the first call to this function. we have to check if
-- there are positional associations:
if Nkind (Call_Node) in N_Binary_Op then
Next_Call_Association := Left_Opnd (Call_Node);
elsif Nkind (Call_Node) in N_Op then
Next_Call_Association := Right_Opnd (Call_Node);
else
Next_Call_Association :=
First_Non_Pragma (Parameter_Associations (Call_Node));
end if;
if Nkind (Next_Call_Association) /= N_Parameter_Association then
Result := Next_Call_Association;
else
Still_Positional := False;
end if;
end if;
-- Try to get the next appropriate positional association
if No (Result)
and then
Still_Positional
then
if Nkind (Call_Node) in N_Binary_Op then
Next_Call_Association := Right_Opnd (Call_Node);
elsif Nkind (Call_Node) in N_Op then
Next_Call_Association := Empty;
else
Next_Call_Association :=
Next_Non_Pragma (Next_Call_Association);
end if;
if Nkind (Next_Call_Association) /=
N_Parameter_Association
then
Result := Next_Call_Association;
else
Still_Positional := False;
end if;
end if;
-- Try to get the actual from the appropriate named association
if No (Result) then
pragma Assert (not Still_Positional);
Next_Association := Next_Call_Association;
while Present (Next_Association) loop
pragma Assert
(Nkind (Next_Association) = N_Parameter_Association);
if Comes_From_Source (Next_Association)
and then
Chars (Selector_Name (Next_Association)) =
Chars (Defining_Identifier (Next_Formal))
then
Result := Explicit_Actual_Parameter (Next_Association);
exit;
end if;
Next_Association := Next_Non_Pragma (Next_Association);
end loop;
end if;
return Result;
end Get_Actual;
-------------------
-- Get_Call_Node --
-------------------
function Get_Call_Node (E : Asis.Element) return Node_Id is
Result : Node_Id := Node (E);
begin
if Is_Prefix_Notation (E) then
Result := R_Node (E);
if Is_Rewrite_Substitution (Result) and then
Nkind (Result) = N_Explicit_Dereference and then
Nkind (Prefix (Result)) = N_Function_Call
then
Result := Prefix (Result);
end if;
end if;
if Nkind (R_Node (E)) = N_Function_Call
and then
(Nkind (Result) in N_Op_Add .. N_Op_Xor
or else
Nkind (Result) in N_Op_Abs .. N_Op_Plus
or else
Nkind (Result) /= N_Function_Call)
then
-- Call to a user-defined operator function
Result := R_Node (E);
end if;
return Result;
end Get_Call_Node;
-----------------
-- Get_Default --
-----------------
function Get_Default (N : Node_Id) return Node_Id is
Result : Node_Id := N;
begin
while Prev_Ids (Result) loop
Result := Prev_Non_Pragma (Result);
end loop;
Result := Sinfo.Expression (Result);
pragma Assert (Present (Result));
return Result;
end Get_Default;
----------------------
-- Get_First_Formal --
----------------------
function Get_First_Formal (E : Asis.Element) return Entity_Id is
Called_Entity_Element : Asis.Element;
Result : Entity_Id;
begin
-- We use the ASIS semantic queries here to minimize the
-- maintenance efforts.
if Expression_Kind (Call_Elem) = A_Function_Call then
Called_Entity_Element := Corresponding_Called_Function (E);
else
Called_Entity_Element := Corresponding_Called_Entity (E);
end if;
if Declaration_Kind (Called_Entity_Element) in
A_Procedure_Instantiation .. A_Function_Instantiation
then
Called_Entity_Element :=
Corresponding_Declaration (Called_Entity_Element);
end if;
pragma Assert (not Is_Nil (Called_Entity_Element));
Result := Node (Called_Entity_Element);
if Nkind (Result) /= N_Entry_Declaration then
Result := Specification (Result);
end if;
Result := First_Non_Pragma (Parameter_Specifications (Result));
return Result;
end Get_First_Formal;
---------------------------
-- Get_Subprogram_Entity --
---------------------------
function Get_Subprogram_Entity (N : Node_Id) return Entity_Id is
Tmp : Node_Id := N;
Result : Entity_Id := Empty;
begin
if Nkind (N) not in N_Op then
Tmp := Sinfo.Name (N);
end if;
if Nkind (Tmp) in N_Has_Entity then
Tmp := Entity (Tmp);
if Nkind (Parent (Tmp)) = N_Subtype_Declaration then
Result := Tmp;
end if;
end if;
return Result;
end Get_Subprogram_Entity;
begin -- Normalized_Param_Associations
-- ??? Should we have the common code for this function and for
-- Normalized_Generic_Associations???
----------------------------------------------------------
-- The implementation approach and the representation --
-- of the normalized parameter associations --
----------------------------------------------------------
-- Each normalized generic association in ASIS is represented by
-- three nodes:
--
-- R_Node - represents the corresponding call,
-- is used for Enclosing_Element purposes only;
-- Node - represents the defining node of the corresponding
-- formal parameter;
-- Node_Field_1 - in case of a call to implicit inherited subprogram
-- points to subprogram defining node, otherwise Empty
-- Node_Field_2 - represents the actual parameter
Call_Node := Get_Call_Node (Call_Elem);
Subprogram_Entity := Get_Subprogram_Entity (Call_Node);
Next_Formal := Get_First_Formal (Call_Elem);
Asis_Element_Table.Init;
while Present (Next_Formal) loop
Actual_Node := Get_Actual;
Norm_Case := Is_Normalized;
if No (Actual_Node) then
Actual_Node := Get_Default (Next_Formal);
Norm_Case := Is_Normalized_Defaulted;
end if;
Asis_Element_Table.Append (
Node_To_Element_New
(Node => Call_Node,
Node_Field_1 => Subprogram_Entity,
Node_Field_2 => Actual_Node,
Starting_Element => Call_Elem,
Internal_Kind => A_Parameter_Association,
Norm_Case => Norm_Case));
-- first, Node_To_Element_New set the Node field as Original_Node
-- of Call_Node, but we need the defining occurrence of the formal
-- parameter here, therefore:
Set_Node
(Asis_Element_Table.Table (Asis_Element_Table.Last),
Defining_Identifier (Next_Formal));
-- then, we have to set On the Is_Part_Of_Implicit flag
Set_From_Implicit
(Asis_Element_Table.Table (Asis_Element_Table.Last));
Next_Formal := Next_Non_Pragma (Next_Formal);
end loop;
return Asis.Association_List
(Asis_Element_Table.Table (1 .. Asis_Element_Table.Last));
end Normalized_Param_Associations;
----------------------------------------------
-- Normalized_Record_Component_Associations --
----------------------------------------------
-- PARTIALLY IMPLEMENTED, CAN NOT PROCESS VARIANT PARTS!
function Normalized_Record_Component_Associations
(Aggregate : Asis.Element)
return Asis.Element_List
is
Next_Association : Node_Id;
pragma Unreferenced (Next_Association);
-- This node represents the next association in (rewritten) aggregate
Next_Component : Entity_Id;
pragma Unreferenced (Next_Component);
-- Next component entity
In_Discriminants : constant Boolean := False;
pragma Unreferenced (In_Discriminants);
-- Flag that indicates if we are iterating through discriminants
Arg_Node : Node_Id;
-- For Ada95-oriented temporary placeholder implementation!
begin
-- This routine is supposed to generate the list of normalized record
-- component associations for Ada 2005 record aggregates. At the
-- moment it just repeats a simple-minded approach used for Ada 95 code.
-- So it is no more that a placeholder that works on Ada 95 code and
-- on Ada 2005 aggregates that do not contain boxes. The commented
-- code is a part of the attempts to provide a proper Ada 2005
-- implementation
Arg_Node := R_Node (Aggregate);
return N_To_E_List_New
(List => Component_Associations (Arg_Node),
Node_Knd => N_Component_Association,
Internal_Kind => A_Record_Component_Association,
Norm_Case => Is_Normalized,
Starting_Element => Aggregate);
-- Asis_Element_Table.Init;
-- Next_Association := First (Component_Associations (R_Node (Aggregate)));
-- Next_Component := Etype (R_Node (Aggregate));
-- while Ekind (Next_Component) = E_Record_Subtype loop
-- Next_Component := Etype (Next_Component);
-- end loop;
-- Next_Component := Parent (Next_Component);
-- pragma Assert (Nkind (Next_Component) = N_Full_Type_Declaration);
-- -- ??? This may be wrong - what about private or derived types?
-- if Present (Discriminant_Specifications (Next_Component)) then
-- Next_Component :=
-- First (Discriminant_Specifications (Next_Component));
-- In_Discriminants := True;
-- else
-- -- We know for sure that the record type has components!
-- Next_Component :=
-- Component_List (Sinfo.Type_Definition (Next_Component));
-- end if;
-- Not_Implemented_Yet
-- (Diagnosis => "Normalized_Record_Component_Associations");
-- return Asis.Association_List
-- (Asis_Element_Table.Table (1 .. Asis_Element_Table.Last));
end Normalized_Record_Component_Associations;
-------------------------------
-- Unwind_Till_Discriminants --
-------------------------------
function Unwind_Till_Discriminants (Type_Decl : Node_Id) return Node_Id is
Result_Node : Node_Id;
Curr_Node : Node_Id;
begin
Result_Node := Type_Decl;
while not Has_Discriminants (Defining_Identifier (Result_Node)) loop
-- each iteration of the loop unwinds one step of "deriving"
-- or "accessing"
--
-- !!!???!!!??? What really happens with private types in the tree
if Nkind (Result_Node) = N_Full_Type_Declaration then
Curr_Node := Sinfo.Type_Definition (Result_Node);
if Nkind (Curr_Node) = N_Derived_Type_Definition or else
-- ??can it really happen???
Nkind (Curr_Node) = N_Access_To_Object_Definition
then
Curr_Node := Sinfo.Subtype_Mark (Curr_Node);
else
goto Error;
end if;
if Nkind (Curr_Node) = N_Subtype_Indication then
-- this is an error situation - we cannot get any type
-- with discriminants
goto Error;
end if;
elsif Nkind (Result_Node) = N_Formal_Type_Declaration then
Curr_Node := Sinfo.Formal_Type_Definition (Result_Node);
if Nkind (Curr_Node) = N_Formal_Derived_Type_Definition then
-- ??can it really happen???
Curr_Node := Sinfo.Subtype_Mark (Curr_Node);
elsif Nkind (Curr_Node) = N_Access_To_Object_Definition then
Curr_Node := Sinfo.Subtype_Indication (Curr_Node);
if Nkind (Curr_Node) = N_Subtype_Indication then
-- this is an error situation - we cannot get any type
-- with discriminants
goto Error;
end if;
Curr_Node := Base_Type (Curr_Node);
else
goto Error;
end if;
else
goto Error;
end if;
-- as the result of this if statement, we have the subtype mark
-- of the designated/parent subtype
Curr_Node := Base_Type (Entity (Curr_Node));
Result_Node := Parent (Curr_Node);
end loop;
return Result_Node;
<<Error>> raise Internal_Implementation_Error;
end Unwind_Till_Discriminants;
end A4G.Norm;
|
awa/plugins/awa-tags/src/awa-tags-components.ads | twdroeger/ada-awa | 81 | 3402 | <filename>awa/plugins/awa-tags/src/awa-tags-components.ads
-----------------------------------------------------------------------
-- awa-tags-components -- Tags component
-- Copyright (C) 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Beans.Basic;
with Util.Beans.Objects;
with Util.Strings.Vectors;
with EL.Expressions;
with ASF.Components.Html.Forms;
with ASF.Contexts.Faces;
with ASF.Contexts.Writer;
with ASF.Events.Faces;
with ASF.Factory;
with AWA.Tags.Models;
-- == HTML components ==
--
-- === Displaying a list of tags ===
-- The <tt>awa:tagList</tt> component displays a list of tags. Each tag can be rendered as
-- a link if the <tt>tagLink</tt> attribute is defined. The list of tags is passed in the
-- <tt>value</tt> attribute. When rending that list, the <tt>var</tt> attribute is used to
-- setup a variable with the tag value. The <tt>tagLink</tt> attribute is then evaluated
-- against that variable and the result defines the link.
--
-- <awa:tagList value='#{questionList.tags}' id='qtags' styleClass="tagedit-list"
-- tagLink="#{contextPath}/questions/tagged.html?tag=#{tagName}"
-- var="tagName"
-- tagClass="tagedit-listelement tagedit-listelement-old"/>
--
-- === Tag editing ===
-- The <tt>awa:tagList</tt> component allows to add or remove tags associated with a given
-- database entity. The tag management works with the jQuery plugin <b>Tagedit</b>. For this,
-- the page must include the <b>/js/jquery.tagedit.js</b> Javascript resource.
--
-- The tag edition is active only if the <tt>awa:tagList</tt> component is placed within an
-- <tt>h:form</tt> component. The <tt>value</tt> attribute defines the list of tags. This must
-- be a <tt>Tag_List_Bean</tt> object.
--
-- <awa:tagList value='#{question.tags}' id='qtags'
-- autoCompleteUrl='#{contextPath}/questions/lists/tag-search.html'/>
--
-- When the form is submitted and validated, the procedure <tt>Set_Added</tt> and
-- <tt>Set_Deleted</tt> are called on the value bean with the list of tags that were
-- added and removed. These operations are called in the <tt>UPDATE_MODEL_VALUES</tt>
-- phase (ie, before calling the action's bean operation).
--
-- === Tag cloud ===
-- The <tt>awa:tagCloud</tt> component displays a list of tags as a tag cloud.
-- The tags list passed in the <tt>value</tt> attribute must inherit from the
-- <tt>Tag_Info_List_Bean</tt> type which indicates for each tag the number of
-- times it is used.
--
-- <awa:tagCloud value='#{questionTagList}' id='cloud' styleClass="tag-cloud"
-- var="tagName" rows="30"
-- tagLink="#{contextPath}/questions/tagged.html?tag=#{tagName}"
-- tagClass="tag-link"/>
--
package AWA.Tags.Components is
use ASF.Contexts.Writer;
-- Get the Tags component factory.
function Definition return ASF.Factory.Factory_Bindings_Access;
-- ------------------------------
-- Input component
-- ------------------------------
-- The AWA input component overrides the ASF input component to build a compact component
-- that displays a label, the input field and the associated error message if necessary.
--
-- The generated HTML looks like:
--
-- <ul class='taglist'>
-- <li><span>tag</span></li>
-- </ul>
--
-- or
--
-- <input type='text' name='' value='tag'/>
--
type Tag_UIInput is new ASF.Components.Html.Forms.UIInput with record
-- List of tags that have been added.
Added : Util.Strings.Vectors.Vector;
-- List of tags that have been removed.
Deleted : Util.Strings.Vectors.Vector;
-- True if the submitted values are correct.
Is_Valid : Boolean := False;
end record;
type Tag_UIInput_Access is access all Tag_UIInput'Class;
-- Returns True if the tag component must be rendered as readonly.
function Is_Readonly (UI : in Tag_UIInput;
Context : in ASF.Contexts.Faces.Faces_Context'Class) return Boolean;
-- Get the tag after convertion with the optional converter.
function Get_Tag (UI : in Tag_UIInput;
Tag : in Util.Beans.Objects.Object;
Context : in ASF.Contexts.Faces.Faces_Context'Class) return String;
-- Render the tag as a readonly item.
procedure Render_Readonly_Tag (UI : in Tag_UIInput;
Tag : in Util.Beans.Objects.Object;
Class : in Util.Beans.Objects.Object;
Writer : in Response_Writer_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the tag as a link.
procedure Render_Link_Tag (UI : in Tag_UIInput;
Name : in String;
Tag : in Util.Beans.Objects.Object;
Link : in EL.Expressions.Expression;
Class : in Util.Beans.Objects.Object;
Writer : in Response_Writer_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the tag for an input form.
procedure Render_Form_Tag (UI : in Tag_UIInput;
Id : in String;
Tag : in Util.Beans.Objects.Object;
Writer : in Response_Writer_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- a link is rendered for each tag. Otherwise, each tag is rendered as a <tt>span</tt>.
procedure Render_Readonly (UI : in Tag_UIInput;
List : in Util.Beans.Basic.List_Bean_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the list of tags for a form.
procedure Render_Form (UI : in Tag_UIInput;
List : in Util.Beans.Basic.List_Bean_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the javascript to enable the tag edition.
procedure Render_Script (UI : in Tag_UIInput;
Id : in String;
Writer : in Response_Writer_Access;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the input component. Starts the DL/DD list and write the input
-- component with the possible associated error message.
overriding
procedure Encode_Begin (UI : in Tag_UIInput;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the end of the input component. Closes the DL/DD list.
overriding
procedure Encode_End (UI : in Tag_UIInput;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Get the action method expression to invoke if the command is pressed.
function Get_Action_Expression (UI : in Tag_UIInput;
Context : in ASF.Contexts.Faces.Faces_Context'Class)
return EL.Expressions.Method_Expression;
-- Decode any new state of the specified component from the request contained
-- in the specified context and store that state on the component.
--
-- During decoding, events may be enqueued for later processing
-- (by event listeners that have registered an interest), by calling
-- the <b>Queue_Event</b> on the associated component.
overriding
procedure Process_Decodes (UI : in out Tag_UIInput;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Perform the component tree processing required by the <b>Update Model Values</b>
-- phase of the request processing lifecycle for all facets of this component,
-- all children of this component, and this component itself, as follows.
-- <ul>
-- <li>If this component <b>rendered</b> property is false, skip further processing.
-- <li>Call the <b>Process_Updates/b> of all facets and children.
-- <ul>
overriding
procedure Process_Updates (UI : in out Tag_UIInput;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Broadcast the event to the event listeners installed on this component.
-- Listeners are called in the order in which they were added.
overriding
procedure Broadcast (UI : in out Tag_UIInput;
Event : not null access ASF.Events.Faces.Faces_Event'Class;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- ------------------------------
-- Tag Cloud Component
-- ------------------------------
-- The tag cloud component
type Tag_UICloud is new ASF.Components.Html.UIHtmlComponent with null record;
type Tag_Info_Array is array (Positive range <>) of AWA.Tags.Models.Tag_Info;
type Tag_Info_Array_Access is access all Tag_Info_Array;
-- Render the tag cloud component.
overriding
procedure Encode_Children (UI : in Tag_UICloud;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Compute the weight for each tag in the list according to the <tt>minWeight</tt> and
-- <tt>maxWeight</tt> attributes. The computed weight is an integer multiplied by 100
-- and will range from 100x<i>minWeight</i> and 100x<i>maxWeight</i>.
procedure Compute_Cloud_Weight (UI : in Tag_UICloud;
List : in out Tag_Info_Array;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
-- Render the list of tags. If the <tt>tagLink</tt> attribute is defined, a link
-- is rendered for each tag.
procedure Render_Cloud (UI : in Tag_UICloud;
List : in Tag_Info_Array;
Context : in out ASF.Contexts.Faces.Faces_Context'Class);
end AWA.Tags.Components;
|
ada/core/agar-init.adb | auzkok/libagar | 286 | 29557 | ------------------------------------------------------------------------------
-- AGAR CORE LIBRARY --
-- A G A R . C O R E . I N I T --
-- B o d y --
-- --
-- Copyright (c) 2018-2019, <NAME> (<EMAIL>) --
-- Copyright (c) 2010, coreland (<EMAIL>) --
-- --
-- Permission to use, copy, modify, and/or 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. --
------------------------------------------------------------------------------
package body Agar.Init is
procedure Get_Version
(Major : out Natural;
Minor : out Natural;
Patch : out Natural)
is
Version : aliased Agar_Version;
begin
AG_GetVersion (Version'Unchecked_Access);
Major := Natural (Version.Major);
Minor := Natural (Version.Minor);
Patch := Natural (Version.Patch);
end Get_Version;
function Init_Core
(Program_Name : in String;
Verbose : in Boolean := False;
Create_Directory : in Boolean := False;
Software_Timers : in Boolean := False) return Boolean
is
Ch_Name : aliased C.char_array := C.To_C (Program_Name);
C_Flags : C.unsigned := 0;
begin
if Verbose then C_Flags := C_Flags or AG_VERBOSE; end if;
if Create_Directory then C_Flags := C_Flags or AG_CREATE_DATADIR; end if;
if Software_Timers then C_Flags := C_Flags or AG_SOFT_TIMERS; end if;
return 0 = AG_InitCore
(Progname => CS.To_Chars_Ptr (Ch_Name'Unchecked_Access),
Flags => C_Flags);
end;
function Init_Core
(Verbose : in Boolean := False;
Create_Directory : in Boolean := False;
Software_Timers : in Boolean := False) return Boolean
is
C_Flags : C.unsigned := 0;
begin
if Verbose then C_Flags := C_Flags or AG_VERBOSE; end if;
if Create_Directory then C_Flags := C_Flags or AG_CREATE_DATADIR; end if;
if Software_Timers then C_Flags := C_Flags or AG_SOFT_TIMERS; end if;
return 0 = AG_InitCore
(Progname => CS.Null_Ptr,
Flags => C_Flags);
end;
--
-- Proxy procedure to call 'Atexit_Callback' from C.
--
procedure At_Exit_Proxy with Convention => C;
Atexit_Callback : Atexit_Func_Access := null;
procedure At_Exit_Proxy is
begin
if Atexit_Callback /= null then
Atexit_Callback.all;
end if;
end At_Exit_Proxy;
procedure At_Exit (Callback : Atexit_Func_Access) is
begin
Atexit_Callback := Callback;
AG_AtExitFunc (At_Exit_Proxy'Access);
end At_Exit;
end Agar.Init;
|
oeis/015/A015027.asm | neoneye/loda-programs | 11 | 97493 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A015027: q-factorial numbers for q=-12.
; Submitted by <NAME>
; 1,-11,-1463,2333485,44665236385,-10259202810507035,-28277368892180867021255,935288538953861649874525071325,371221802129246962654056875248358359825,-1768082733073463162105209099485375242162416580075,-101053866980328304416804100016021966697144304636338865493975,69308186821631256790594702500567331534641155107421633337916049961674125,570423466696765676556920498610639906168183521282783571322625155434114815880178506625
mov $1,4
mov $2,1
lpb $0
sub $0,1
mul $2,-12
add $2,1
mul $1,$2
lpe
mov $0,$1
div $0,4
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1316.asm | ljhsiun2/medusa | 9 | 240904 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xd3fe, %rsi
lea addresses_normal_ht+0x13a6e, %rdi
nop
nop
nop
add %rdx, %rdx
mov $90, %rcx
rep movsb
nop
sub $10105, %r11
lea addresses_WT_ht+0x160ae, %rcx
nop
nop
nop
nop
cmp $22671, %r15
mov (%rcx), %si
nop
nop
nop
nop
dec %r11
lea addresses_UC_ht+0xc26e, %rsi
lea addresses_WC_ht+0x3dee, %rdi
nop
and %r15, %r15
mov $8, %rcx
rep movsq
nop
nop
nop
add %r15, %r15
lea addresses_A_ht+0x9ee, %rcx
nop
xor $3856, %r15
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
and $0xffffffffffffffc0, %rcx
vmovaps %ymm4, (%rcx)
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0x1efb6, %r15
nop
nop
nop
nop
sub %rax, %rax
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%r15)
and $19149, %r15
lea addresses_D_ht+0xe9ee, %rdi
add $7136, %rdx
vmovups (%rdi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rcx
nop
nop
nop
cmp $42094, %rdx
lea addresses_normal_ht+0xb85b, %r15
xor %rax, %rax
mov (%r15), %esi
nop
nop
nop
nop
xor $40392, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %rbp
push %rbx
push %rdi
push %rsi
// Store
lea addresses_D+0x85ee, %r10
nop
nop
nop
xor %rdi, %rdi
movw $0x5152, (%r10)
nop
nop
nop
nop
dec %r10
// Faulty Load
lea addresses_D+0x85ee, %rdi
nop
nop
dec %rbp
vmovups (%rdi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r13
lea oracles, %r10
and $0xff, %r13
shlq $12, %r13
mov (%r10,%r13,1), %r13
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 6, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'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
*/
|
applescript/spotlight.applescript | jstart/chrisdev | 0 | 1717 | -- Configure spotlight:
-- remove keyboard shortcut
tell application "System Preferences"
set current pane to pane "com.apple.preference.spotlight"
end tell
tell application "System Events"
tell application process "System Preferences"
set theCheckbox to checkbox 1 of window "spotlight"
tell theCheckbox
if (its value as boolean) then click theCheckbox
end tell
end tell
quit application "System Preferences"
end tell
|
oeis/220/A220848.asm | neoneye/loda-programs | 11 | 93765 | <filename>oeis/220/A220848.asm
; A220848: a(n) = sum_(d|n) product_(d_x|n, d_x<=d) d_x.
; Submitted by <NAME>
; 1,3,4,11,6,45,8,75,31,113,12,1905,14,213,244,1099,18,6201,20,8451,466,509,24,346929,131,705,760,22803,30,839019,32,33867,1126,1193,1266,10374657,38,1485,1564,2627571,42,3189609,44,87219,93304,2165,48,260348721,351,127613,2656,143427,54,8666721,3086,10016899,3310,3425,60,47460910473,62,3909,254230,2131019,4296,19271385,68,319203,4834,24363583,72,141305110449,74,5553,427744,444915,6014,37502289,80,3318838771,59809,6809,84,355583464161,7316,7485,7660,60667275,90,537481755039,8380,787347,8746,8933
add $0,1
mov $2,$0
lpb $0
mov $3,$2
lpb $2,2
dif $3,$0
cmp $3,$2
cmp $3,0
lpb $3
div $3,33
add $5,10
mul $5,$0
lpe
lpe
sub $0,1
lpe
mov $0,$5
div $0,10
add $0,1
|
core/src/main/antlr/PineScript.g4 | paulovap/pinelang | 3 | 2935 | /*
BSD License
Copyright (c) $today.year, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Paulo Pinheiro nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
parser grammar PineScript;
options { tokenVocab = PineLexer; }
@header {
package org.pinelang.parser;
}
///////////////////////////
// Parser rules
///////////////////////////
program
: rootMember EOF
;
rootMember
: objectDefinition;
objectDefinition
: ObjectType objectInitializer SEMICOLON?
;
// { ... }
objectInitializer
: LBRACE objectIdentifier?
( objectDefinition
| signalAssignement
| propertyDefinition)* RBRACE
;
objectIdentifier
: ID COLON Identifier SEMICOLON?
;
signalAssignement
: ON Identifier COLON callableExpression SEMICOLON?
;
// prop: ... ;
propertyDefinition
: Identifier COLON expression SEMICOLON?
;
expression
: primitiveExpression
| objectPropertyExpression
| expression binaryOperation expression
| callableExpression
;
binaryOperation
: PLUS // start number values only
| MINUS
| MULTI
| DIV
| REMAINDER // end number values only
| EQ
| AND // start boolean values only
| OR // end boolean values only
;
// height: width;
// height: otherObject.width;
objectPropertyExpression
: Identifier (DOT Identifier)?
;
// visible: true
// width: 100
// text: "Asdf"
primitiveExpression
: TRUE
| FALSE
| IntegerLiteral integerSuffix?
| FloatLiteral
| stringLiteral
;
stringLiteral
: DOUBLE_QUOTE_OPEN STRING DOUBLE_QUOTE_CLOSE
;
integerSuffix
: SUFFIX_DP | SUFFIX_PX
;
callableExpression
// : Identifier LPAREN arguments? RPAREN
: Identifier LPAREN RPAREN
;
arguments
: expression ( ',' expression )*
; |
list1/task2/src/poly.ads | luk9400/nsi | 0 | 30434 | package Poly with SPARK_Mode is
type Vector is array (Natural range <>) of Integer;
function Horner (X: Integer; A: Vector) return Integer;
end Poly;
|
MD407/Kap2/Uppgift2.6.asm | konglobemeralt/DAT017 | 0 | 16978 | @ varför vill de i boken
@ döpa filen till mom5.asm
@ när det är uppg 2.6? smh
start:
LDR R6, =0x55555555 @D som ut
LDR R5, =0x40020C00
STR R6, [R5]
@adressen till port Ds ut data register till R5
LDR R5, =0x40020C14
@adressen till port Es in dataregister till R6
LDR R6, =0x40021010
main:
LDRSB R0, [R6] @read PE0-E7
LDRSB R1, [R6, #1] @read PE8-E15
ADD R0, R0, R1
STRH R0, [R5]
B main
|
programs/oeis/060/A060022.asm | karttu/loda | 0 | 13683 | <gh_stars>0
; A060022: Expansion of (1-x-x^N)/((1-x)(1-x^2)(1-x^3)...(1-x^N)) for N = 3.
; 1,0,1,0,0,-1,-1,-3,-3,-5,-6,-8,-9,-12,-13,-16,-18,-21,-23,-27,-29,-33,-36,-40,-43,-48,-51,-56,-60,-65,-69,-75,-79,-85,-90,-96,-101,-108,-113,-120,-126,-133,-139,-147,-153,-161,-168,-176,-183,-192,-199,-208,-216,-225,-233,-243,-251,-261,-270,-280,-289,-300,-309,-320,-330,-341,-351,-363,-373,-385,-396,-408,-419,-432,-443,-456,-468,-481,-493,-507,-519,-533,-546,-560,-573,-588,-601,-616,-630,-645,-659,-675,-689,-705,-720,-736,-751,-768,-783,-800,-816,-833,-849,-867,-883,-901,-918,-936,-953,-972,-989,-1008,-1026,-1045,-1063,-1083,-1101,-1121,-1140,-1160,-1179,-1200,-1219,-1240,-1260,-1281,-1301,-1323,-1343,-1365,-1386,-1408,-1429,-1452,-1473,-1496,-1518,-1541,-1563,-1587,-1609,-1633,-1656,-1680,-1703,-1728,-1751,-1776,-1800,-1825,-1849,-1875,-1899,-1925,-1950,-1976,-2001,-2028,-2053,-2080,-2106,-2133,-2159,-2187,-2213,-2241,-2268,-2296,-2323,-2352,-2379,-2408,-2436,-2465,-2493,-2523,-2551,-2581,-2610,-2640,-2669,-2700,-2729,-2760,-2790,-2821,-2851,-2883,-2913,-2945,-2976,-3008,-3039,-3072,-3103,-3136,-3168,-3201,-3233,-3267,-3299,-3333,-3366,-3400,-3433,-3468,-3501,-3536,-3570,-3605,-3639,-3675,-3709,-3745,-3780,-3816,-3851,-3888,-3923,-3960,-3996,-4033,-4069,-4107,-4143,-4181,-4218,-4256,-4293,-4332,-4369,-4408,-4446,-4485,-4523,-4563,-4601,-4641,-4680,-4720,-4759,-4800,-4839,-4880,-4920,-4961,-5001,-5043,-5083,-5125
add $0,2
mov $2,$0
bin $0,2
div $2,2
add $0,$2
mov $1,$2
lpb $0,1
sub $0,6
sub $1,1
lpe
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.