text stringlengths 1 1.05M |
|---|
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Alessandro Tasora, Radu Serban
// =============================================================================
#include "chrono/physics/ChLoadContainer.h"
namespace chrono {
// Register into the object factory, to enable run-time dynamic creation and persistence
CH_FACTORY_REGISTER(ChLoadContainer)
ChLoadContainer::ChLoadContainer(const ChLoadContainer& other) : ChPhysicsItem(other) {
loadlist = other.loadlist;
}
void ChLoadContainer::Add(std::shared_ptr<ChLoadBase> newload) {
//TODO Radu: I don't think find can be used on a container of shared pointers which does not support the == operator.
//TODO Radu: check if this is still true, now that we switched to std::shared_ptr
//assert(std::find<std::vector<std::shared_ptr<ChLoadBase>>::iterator>(loadlist.begin(), loadlist.end(), newload)
///== loadlist.end());
loadlist.push_back(newload);
}
void ChLoadContainer::Update(double mytime, bool update_assets) {
for (size_t i = 0; i < loadlist.size(); ++i) {
loadlist[i]->Update();
}
// Overloading of base class:
ChPhysicsItem::Update(mytime, update_assets);
}
void ChLoadContainer::IntLoadResidual_F(const unsigned int off, // offset in R residual
ChVectorDynamic<>& R, // result: the R residual, R += c*F
const double c // a scaling factor
) {
for (size_t i = 0; i < loadlist.size(); ++i) {
loadlist[i]->LoadIntLoadResidual_F(R, c);
}
}
void ChLoadContainer::InjectKRMmatrices(ChSystemDescriptor& mdescriptor) {
for (size_t i = 0; i < loadlist.size(); ++i) {
loadlist[i]->InjectKRMmatrices(mdescriptor);
}
}
void ChLoadContainer::KRMmatricesLoad(double Kfactor, double Rfactor, double Mfactor) {
for (size_t i = 0; i < loadlist.size(); ++i) {
loadlist[i]->KRMmatricesLoad(Kfactor, Rfactor, Mfactor);
}
}
void ChLoadContainer::ArchiveOUT(ChArchiveOut& marchive) {
//***TODO***
}
void ChLoadContainer::ArchiveIN(ChArchiveIn& marchive) {
//***TODO***
}
} // end namespace chrono
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2018 Intel Corporation All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in
; the documentation and/or other materials provided with the
; distribution.
; * Neither the name of Intel Corporation nor the names of its
; contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "reg_sizes.asm"
%include "lz0a_const.asm"
%include "data_struct2.asm"
%include "huffman.asm"
%define USE_HSWNI
%define ARCH 06
%ifdef HAVE_AS_KNOWS_AVX512
%ifidn __OUTPUT_FORMAT__, win64
%define arg1 rcx
%define arg2 rdx
%define arg3 r8
%define hash rsi
%define next_in rdi
%else
%define arg1 rdi
%define arg2 rsi
%define arg3 rdx
%define hash r8
%define next_in rcx
%endif
%define stream arg1
%define level_buf arg1
%define matches_next arg2
%define f_i_end arg3
%define f_i rax
%define file_start rbp
%define tmp r9
%define tmp2 r10
%define prev_len r11
%define prev_dist r12
%define f_i_orig r13
%define hash_table level_buf + _hash_map_hash_table
%define datas zmm0
%define datas_lookup zmm1
%define zhashes zmm2
%define zdists zmm3
%define zdists_lookup zmm4
%define zscatter zmm5
%define zdists2 zmm6
%define zlens1 zmm7
%define zlens2 zmm8
%define zlookup zmm9
%define zlookup2 zmm10
%define match_lookups zmm11
%define zindex zmm12
%define zdist_extra zmm13
%define zdists_tmp zmm14
%define znull_dist_syms zmm15
%define zcode zmm16
%define zthirty zmm17
%define zdist_mask zmm18
%define zshortest_matches zmm19
%define zrot_left zmm20
%define zdatas_perm zmm21
%define zdatas_perm2 zmm22
%define zdatas_perm3 zmm23
%define zdatas_shuf zmm24
%define zhash_prod zmm25
%define zhash_mask zmm26
%define zincrement zmm27
%define zqword_shuf zmm28
%define zones zmm29
%define ztwofiftyfour zmm30
%define zbswap zmm31
%ifidn __OUTPUT_FORMAT__, win64
%define stack_size 10*16 + 6 * 8 + 8
%define func(x) proc_frame x
%macro FUNC_SAVE 0
alloc_stack stack_size
vmovdqa [rsp + 0*16], xmm6
vmovdqa [rsp + 1*16], xmm7
vmovdqa [rsp + 2*16], xmm8
vmovdqa [rsp + 3*16], xmm9
vmovdqa [rsp + 4*16], xmm10
vmovdqa [rsp + 5*16], xmm11
vmovdqa [rsp + 6*16], xmm12
vmovdqa [rsp + 7*16], xmm13
vmovdqu [rsp + 8*16], xmm14
vmovdqa [rsp + 9*16], xmm15
save_reg rsi, 10*16 + 0*8
save_reg rdi, 10*16 + 1*8
save_reg rbp, 10*16 + 2*8
save_reg r12, 10*16 + 3*8
save_reg r13, 10*16 + 4*8
end_prolog
%endm
%macro FUNC_RESTORE 0
vmovdqa xmm6, [rsp + 0*16]
vmovdqa xmm7, [rsp + 1*16]
vmovdqa xmm8, [rsp + 2*16]
vmovdqa xmm9, [rsp + 3*16]
vmovdqa xmm10, [rsp + 4*16]
vmovdqa xmm11, [rsp + 5*16]
vmovdqa xmm12, [rsp + 6*16]
vmovdqa xmm13, [rsp + 7*16]
vmovdqa xmm14, [rsp + 8*16]
vmovdqa xmm15, [rsp + 9*16]
mov rsi, [rsp + 10*16 + 0*8]
mov rdi, [rsp + 10*16 + 1*8]
mov rbp, [rsp + 10*16 + 2*8]
mov r12, [rsp + 10*16 + 3*8]
mov r13, [rsp + 10*16 + 4*8]
add rsp, stack_size
%endm
%else
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push rbp
push r12
push r13
%endm
%macro FUNC_RESTORE 0
pop r13
pop r12
pop rbp
%endm
%endif
%define VECT_SIZE 16
%define HASH_BYTES 2
[bits 64]
default rel
section .text
global gen_icf_map_lh1_06
func(gen_icf_map_lh1_06)
endbranch
FUNC_SAVE
mov file_start, [stream + _next_in]
mov f_i %+ d, dword [stream + _total_in]
mov f_i_orig, f_i
sub file_start, f_i
add f_i_end, f_i
cmp f_i, f_i_end
jge end_main
;; Prep for main loop
vpbroadcastd zdist_mask, dword [stream + _internal_state_dist_mask]
vpbroadcastd zhash_mask, dword [stream + _internal_state_hash_mask]
mov tmp, stream
mov level_buf, [stream + _level_buf]
sub f_i_end, LA
vmovdqu64 zdatas_perm, [datas_perm]
vbroadcasti32x8 zdatas_shuf, [datas_shuf]
vpbroadcastd zhash_prod, [hash_prod]
vmovdqu64 zincrement, [increment]
vmovdqu64 zqword_shuf, [qword_shuf]
vbroadcasti64x2 zdatas_perm2, [datas_perm2]
vbroadcasti64x2 zdatas_perm3, [datas_perm3]
vpbroadcastd zones, [ones]
vbroadcasti32x4 zbswap, [bswap_shuf]
vpbroadcastd zthirty, [thirty]
vmovdqu64 zrot_left, [drot_left]
vpbroadcastd zshortest_matches, [shortest_matches]
vpbroadcastd ztwofiftyfour, [twofiftyfour]
vpbroadcastd znull_dist_syms, [null_dist_syms]
kxorq k0, k0, k0
kmovq k1, [k_mask_1]
kmovq k2, [k_mask_2]
;; Process first byte
vmovd zhashes %+ x, dword [f_i + file_start]
vpmaddwd zhashes, zhashes, zhash_prod
vpmaddwd zhashes, zhashes, zhash_prod
vpandd zhashes, zhashes, zhash_mask
vmovd hash %+ d, zhashes %+ x
cmp byte [tmp + _internal_state_has_hist], IGZIP_NO_HIST
jne .has_hist
;; No history, the byte is a literal
xor prev_len, prev_len
xor prev_dist, prev_dist
mov byte [tmp + _internal_state_has_hist], IGZIP_HIST
jmp .byte_processed
.has_hist:
;; History exists, need to set prev_len and prev_dist accordingly
lea next_in, [f_i + file_start]
;; Determine match lookback distance
xor tmp, tmp
mov tmp %+ w, f_i %+ w
dec tmp
sub tmp %+ w, word [hash_table + HASH_BYTES * hash]
vmovd tmp2 %+ d, zdist_mask %+ x
and tmp %+ d, tmp2 %+ d
neg tmp
;; Check first 8 bytes of match
mov prev_len, [next_in]
xor prev_len, [next_in + tmp - 1]
neg tmp
;; Set prev_dist
%ifidn arg1, rcx
mov tmp2, rcx
%endif
;; The third register is unused on Haswell and later,
;; This line will not work on previous architectures
get_dist_icf_code tmp, prev_dist, tmp
%ifidn arg1, rcx
mov rcx, tmp2
%endif
;; Set prev_len
xor tmp2, tmp2
tzcnt prev_len, prev_len
shr prev_len, 3
cmp prev_len, MIN_DEF_MATCH
cmovl prev_len, tmp2
.byte_processed:
mov word [hash_table + HASH_BYTES * hash], f_i %+ w
add f_i, 1
cmp f_i, f_i_end
jg end_main
;;hash
vmovdqu64 datas %+ y, [f_i + file_start]
vpermq zhashes, zdatas_perm, datas
vpshufb zhashes, zhashes, zdatas_shuf
vpmaddwd zhashes, zhashes, zhash_prod
vpmaddwd zhashes, zhashes, zhash_prod
vpandd zhashes, zhashes, zhash_mask
vpermq zlookup, zdatas_perm2, datas
vpshufb zlookup, zlookup, zqword_shuf
vpermq zlookup2, zdatas_perm3, datas
vpshufb zlookup2, zlookup2, zqword_shuf
;;gather/scatter hashes
knotq k6, k0
vpgatherdd zdists_lookup {k6}, [hash_table + HASH_BYTES * zhashes]
vpbroadcastd zindex, f_i %+ d
vpaddd zindex, zindex, zincrement
vpblendmw zscatter {k1}, zindex, zdists_lookup
knotq k6, k0
vpscatterdd [hash_table + HASH_BYTES * zhashes] {k6}, zscatter
;; Compute hash for next loop
vmovdqu64 datas %+ y, [f_i + file_start + VECT_SIZE]
vpermq zhashes, zdatas_perm, datas
vpshufb zhashes, zhashes, zdatas_shuf
vpmaddwd zhashes, zhashes, zhash_prod
vpmaddwd zhashes, zhashes, zhash_prod
vpandd zhashes, zhashes, zhash_mask
vmovdqu64 datas_lookup %+ y, [f_i + file_start + 2 * VECT_SIZE]
sub f_i_end, VECT_SIZE
cmp f_i, f_i_end
jg .loop1_end
.loop1:
lea next_in, [f_i + file_start]
;; Calculate look back dists
vpaddd zdists, zdists_lookup, zones
vpsubd zdists, zindex, zdists
vpandd zdists, zdists, zdist_mask
vpaddd zdists, zdists, zones
vpsubd zdists, zincrement, zdists
;;gather/scatter hashes
add f_i, VECT_SIZE
kxnorq k6, k6, k6
kxnorq k7, k7, k7
vpgatherdd zdists_lookup {k6}, [hash_table + HASH_BYTES * zhashes]
vpbroadcastd zindex, f_i %+ d
vpaddd zindex, zindex, zincrement
vpblendmw zscatter {k1}, zindex, zdists_lookup
vpscatterdd [hash_table + HASH_BYTES * zhashes] {k7}, zscatter
;; Compute hash for next loop
vpermq zhashes, zdatas_perm, datas_lookup
vpshufb zhashes, zhashes, zdatas_shuf
vpmaddwd zhashes, zhashes, zhash_prod
vpmaddwd zhashes, zhashes, zhash_prod
vpandd zhashes, zhashes, zhash_mask
;;lookup old codes
vextracti32x8 zdists2 %+ y, zdists, 1
kxnorq k6, k6, k6
kxnorq k7, k7, k7
vpgatherdq zlens1 {k6}, [next_in + zdists %+ y]
vpgatherdq zlens2 {k7}, [next_in + zdists2 %+ y]
;; Calculate dist_icf_code
vpaddd zdists, zdists, zones
vpsubd zdists, zincrement, zdists
vpcmpgtd k5, zdists, zones
vplzcntd zdist_extra, zdists
vpsubd zdist_extra {k5}{z}, zthirty, zdist_extra
vpsllvd zcode, zones, zdist_extra
vpsubd zcode, zcode, zones
vpandd zcode {k5}{z}, zdists, zcode
vpsrlvd zdists, zdists, zdist_extra
vpslld zdist_extra, zdist_extra, 1
vpaddd zdists, zdists, zdist_extra
vpslld zcode, zcode, EXTRA_BITS_OFFSET - DIST_OFFSET
vpaddd zdists, zdists, zcode
;; Setup zdists for combining with zlens
vpslld zdists, zdists, DIST_OFFSET
;; xor current data with lookback dist
vpxorq zlens1, zlens1, zlookup
vpxorq zlens2, zlens2, zlookup2
;; Setup registers for next loop
vpermq zlookup, zdatas_perm2, datas
vpshufb zlookup, zlookup, zqword_shuf
vpermq zlookup2, zdatas_perm3, datas
vpshufb zlookup2, zlookup2, zqword_shuf
;; Compute match length
vpshufb zlens1, zlens1, zbswap
vpshufb zlens2, zlens2, zbswap
vplzcntq zlens1, zlens1
vplzcntq zlens2, zlens2
vpmovqd zlens1 %+ y, zlens1
vpmovqd zlens2 %+ y, zlens2
vinserti32x8 zlens1, zlens2 %+ y, 1
vpsrld zlens1, zlens1, 3
;; Preload for next loops
vmovdqu64 datas, datas_lookup
vmovdqu64 datas_lookup %+ y, [f_i + file_start + 2 * VECT_SIZE]
;; Zero out matches which should not be taken
kshiftrw k3, k1, 15
vpermd zlens2, zrot_left, zlens1
vpermd zdists, zrot_left, zdists
vmovd zdists_tmp %+ x, prev_len %+ d
vmovd prev_len %+ d, zlens2 %+ x
vmovdqu32 zlens2 {k3}, zdists_tmp
vmovd zdists_tmp %+ x, prev_dist %+ d
vmovd prev_dist %+ d, zdists %+ x
vmovdqu32 zdists {k3}, zdists_tmp
vpcmpgtd k3, zlens2, zshortest_matches
vpcmpgtd k4, zlens1, zlens2
knotq k3, k3
korq k3, k3, k4
knotq k4, k3
vmovdqu32 zlens1 {k4}{z}, zlens2
;; Update zdists to match zlens1
vpaddd zdists, zdists, zlens1
vpaddd zdists, zdists, ztwofiftyfour
vpmovzxbd zdists {k3}, [f_i + file_start - VECT_SIZE - 1]
vpaddd zdists {k3}, zdists, znull_dist_syms
;;Store zdists
vmovdqu64 [matches_next], zdists
add matches_next, ICF_CODE_BYTES * VECT_SIZE
cmp f_i, f_i_end
jle .loop1
.loop1_end:
lea next_in, [f_i + file_start]
;; Calculate look back dists
vpaddd zdists, zdists_lookup, zones
vpsubd zdists, zindex, zdists
vpandd zdists, zdists, zdist_mask
vpaddd zdists, zdists, zones
vpsubd zdists, zincrement, zdists
;;lookup old codes
vextracti32x8 zdists2 %+ y, zdists, 1
kxnorq k6, k6, k6
kxnorq k7, k7, k7
vpgatherdq zlens1 {k6}, [next_in + zdists %+ y]
vpgatherdq zlens2 {k7}, [next_in + zdists2 %+ y]
;; Restore last update hash value
vextracti32x4 zdists2 %+ x, zdists, 3
vpextrd tmp %+ d, zdists2 %+ x, 3
add tmp %+ d, f_i %+ d
vmovd zhashes %+ x, dword [f_i + file_start + VECT_SIZE - 1]
vpmaddwd zhashes %+ x, zhashes %+ x, zhash_prod %+ x
vpmaddwd zhashes %+ x, zhashes %+ x, zhash_prod %+ x
vpandd zhashes %+ x, zhashes %+ x, zhash_mask %+ x
vmovd hash %+ d, zhashes %+ x
mov word [hash_table + HASH_BYTES * hash], tmp %+ w
;; Calculate dist_icf_code
vpaddd zdists, zdists, zones
vpsubd zdists, zincrement, zdists
vpcmpgtd k5, zdists, zones
vplzcntd zdist_extra, zdists
vpsubd zdist_extra {k5}{z}, zthirty, zdist_extra
vpsllvd zcode, zones, zdist_extra
vpsubd zcode, zcode, zones
vpandd zcode {k5}{z}, zdists, zcode
vpsrlvd zdists, zdists, zdist_extra
vpslld zdist_extra, zdist_extra, 1
vpaddd zdists, zdists, zdist_extra
vpslld zcode, zcode, EXTRA_BITS_OFFSET - DIST_OFFSET
vpaddd zdists, zdists, zcode
;; Setup zdists for combining with zlens
vpslld zdists, zdists, DIST_OFFSET
;; xor current data with lookback dist
vpxorq zlens1, zlens1, zlookup
vpxorq zlens2, zlens2, zlookup2
;; Compute match length
vpshufb zlens1, zlens1, zbswap
vpshufb zlens2, zlens2, zbswap
vplzcntq zlens1, zlens1
vplzcntq zlens2, zlens2
vpmovqd zlens1 %+ y, zlens1
vpmovqd zlens2 %+ y, zlens2
vinserti32x8 zlens1, zlens2 %+ y, 1
vpsrld zlens1, zlens1, 3
;; Zero out matches which should not be taken
kshiftrw k3, k1, 15
vpermd zlens2, zrot_left, zlens1
vpermd zdists, zrot_left, zdists
vmovd zdists_tmp %+ x, prev_len %+ d
vmovd prev_len %+ d, zlens2 %+ x
vmovdqu32 zlens2 {k3}, zdists_tmp
vmovd zdists_tmp %+ x, prev_dist %+ d
vmovd prev_dist %+ d, zdists %+ x
vmovdqu32 zdists {k3}, zdists_tmp
vpcmpgtd k3, zlens2, zshortest_matches
vpcmpgtd k4, zlens1, zlens2
knotq k3, k3
korq k3, k3, k4
knotq k4, k3
vmovdqu32 zlens1 {k4}{z}, zlens2
;; Update zdists to match zlens1
vpaddd zdists, zdists, zlens1
vpaddd zdists, zdists, ztwofiftyfour
vpmovzxbd zdists {k3}, [f_i + file_start - 1]
vpaddd zdists {k3}, zdists, znull_dist_syms
;;Store zdists
vmovdqu64 [matches_next], zdists
add f_i, VECT_SIZE
end_main:
sub f_i, f_i_orig
sub f_i, 1
%ifnidn f_i, rax
mov rax, f_i
%endif
FUNC_RESTORE
ret
endproc_frame
section .data
align 64
;; 64 byte data
datas_perm:
dq 0x0, 0x1, 0x0, 0x1, 0x1, 0x2, 0x1, 0x2
drot_left:
dd 0xf, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6
dd 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe
qword_shuf:
db 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7
db 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8
db 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9
db 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa
db 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb
db 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc
db 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd
db 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe
db 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf
datas_shuf:
db 0x0, 0x1, 0x2, 0x3
db 0x1, 0x2, 0x3, 0x4
db 0x2, 0x3, 0x4, 0x5
db 0x3, 0x4, 0x5, 0x6
db 0x4, 0x5, 0x6, 0x7
db 0x5, 0x6, 0x7, 0x8
db 0x6, 0x7, 0x8, 0x9
db 0x7, 0x8, 0x9, 0xa
increment:
dd 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7
dd 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf
;; 16 byte data
datas_perm2:
dq 0x0, 0x1
datas_perm3:
dq 0x1, 0x2
bswap_shuf:
db 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00
db 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08
;; 8 byte data
k_mask_1:
dq 0xaaaaaaaaaaaaaaaa
k_mask_2:
dq 0x7fff
;; 4 byte data
null_dist_syms:
dd LIT
%define PROD1 0xE84B
%define PROD2 0x97B1
hash_prod:
dw PROD1, PROD2
ones:
dd 0x1
thirty:
dd 0x1e
twofiftyfour:
dd 0xfe
lit_len_mask:
dd LIT_LEN_MASK
shortest_matches:
dd MIN_DEF_MATCH
%endif
|
;------------------------------------------------------------------------------
;
; CpuFlushTlb() for ARM
;
; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;------------------------------------------------------------------------------
EXPORT CpuFlushTlb
AREA cpu_flush_tlb, CODE, READONLY
;/**
; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
;
; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
;
;**/
;VOID
;EFIAPI
;CpuFlushTlb (
; VOID
; );
;
CpuFlushTlb
MOV r0,#0
MCR p15,0,r0,c8,c5,0 ;Invalidate all the unlocked entried in TLB
BX LR
END
|
dnl x86-64 mpn_popcount optimized for Pentium 4.
dnl Copyright 2007 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 3 of the License, or (at
dnl your option) any later version.
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
include_mpn(`x86/pentium4/sse2/popcount.asm')
|
/*
(**************************************************************************)
(* *)
(* Schifra *)
(* Reed-Solomon Error Correcting Code Library *)
(* *)
(* Release Version 0.0.1 *)
(* http://www.schifra.com *)
(* Copyright (c) 2000-2019 Arash Partow, All Rights Reserved. *)
(* *)
(* The Schifra Reed-Solomon error correcting code library and all its *)
(* components are supplied under the terms of the General Schifra License *)
(* agreement. The contents of the Schifra Reed-Solomon error correcting *)
(* code library and all its components may not be copied or disclosed *)
(* except in accordance with the terms of that agreement. *)
(* *)
(* URL: http://www.schifra.com/license.html *)
(* *)
(**************************************************************************)
*/
/*
Description: This example will demonstrate how to instantiate a 16-bit per
symbol Reed-Solomon encoder and decoder, add the full amount
of possible errors, correct the errors, and output the various
pieces of relevant information. Furthermore this example will
demonstrate the use of the Reed-Solomon codec without the use
of LUTs for the finite field computations.
*/
#include <cstddef>
#include <iostream>
#include <string>
#define NO_GFLUT
#include "schifra_galois_field.hpp"
#undef NO_GFLUT
#include "schifra_galois_field_polynomial.hpp"
#include "schifra_sequential_root_generator_polynomial_creator.hpp"
#include "schifra_reed_solomon_encoder.hpp"
#include "schifra_reed_solomon_decoder.hpp"
#include "schifra_reed_solomon_block.hpp"
#include "schifra_error_processes.hpp"
int main()
{
/* Finite Field Parameters */
const std::size_t field_descriptor = 16;
const std::size_t generator_polynomial_index = 0;
const std::size_t generator_polynomial_root_count = 1000;
/* Reed Solomon Code Parameters */
const std::size_t code_length = 65535;
const std::size_t fec_length = 1000;
const std::size_t data_length = code_length - fec_length;
/* Instantiate Finite Field and Generator Polynomials */
const schifra::galois::field field(field_descriptor,
schifra::galois::primitive_polynomial_size14,
schifra::galois::primitive_polynomial14);
schifra::galois::field_polynomial generator_polynomial(field);
if (
!schifra::make_sequential_root_generator_polynomial(field,
generator_polynomial_index,
generator_polynomial_root_count,
generator_polynomial)
)
{
std::cout << "Error - Failed to create sequential root generator!" << std::endl;
return 1;
}
/* Instantiate Encoder and Decoder (Codec) */
typedef schifra::reed_solomon::encoder<code_length,fec_length,data_length> encoder_t;
typedef schifra::reed_solomon::decoder<code_length,fec_length,data_length> decoder_t;
const encoder_t encoder(field, generator_polynomial);
const decoder_t decoder(field, generator_polynomial_index);
std::vector<unsigned int> data(code_length, 0x0000 & field.mask());
/* Instantiate RS Block For Codec */
schifra::reed_solomon::block<code_length,fec_length> block;
schifra::reed_solomon::block<code_length,fec_length> original_block;
schifra::reed_solomon::copy(&data[0], data.size(), block);
original_block = block;
/* Transform message into Reed-Solomon encoded codeword */
if (!encoder.encode(block))
{
std::cout << "Error - Critical encoding failure! "
<< "Msg: " << block.error_as_string() << std::endl;
return 1;
}
/* Add errors at every 3rd location starting at position zero */
schifra::corrupt_message_all_errors_wth_mask(block, 0, field.mask(), 3);
if (!decoder.decode(block))
{
std::cout << "Error - Critical decoding failure! "
<< "Msg: " << block.error_as_string() << std::endl;
return 1;
}
else if (!schifra::are_blocks_equivelent(block, original_block, true, true))
{
std::cout << "Error - Error correction failed!" << std::endl;
return 1;
}
std::cout << "Encoder Parameters [" << encoder_t::trait::code_length << ","
<< encoder_t::trait::data_length << ","
<< encoder_t::trait::fec_length << "]" << std::endl;
std::cout << "Decoder Parameters [" << decoder_t::trait::code_length << ","
<< decoder_t::trait::data_length << ","
<< decoder_t::trait::fec_length << "]" << std::endl;
return 0;
}
|
; A137233: Number of n-digit even numbers.
; 5,45,450,4500,45000,450000,4500000,45000000,450000000,4500000000,45000000000,450000000000,4500000000000,45000000000000,450000000000000,4500000000000000,45000000000000000,450000000000000000
mov $1,10
pow $1,$0
mul $1,6
add $1,5
mul $1,3
div $1,20
mul $1,5
mov $0,$1
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x5665, %rdx
nop
nop
add $25290, %r8
mov (%rdx), %rbx
nop
nop
nop
nop
sub $28358, %r11
lea addresses_A_ht+0x65, %r13
and %rbp, %rbp
movl $0x61626364, (%r13)
nop
cmp %rbx, %rbx
lea addresses_D_ht+0x1da87, %rdx
nop
nop
nop
nop
cmp %r8, %r8
movb $0x61, (%rdx)
nop
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0x1df65, %rbx
add %rdx, %rdx
mov $0x6162636465666768, %r13
movq %r13, %xmm5
movups %xmm5, (%rbx)
nop
add $8627, %r8
lea addresses_WT_ht+0x2765, %rdx
nop
nop
nop
sub $14714, %r13
mov (%rdx), %r8
nop
xor %r8, %r8
lea addresses_WT_ht+0x18065, %rsi
lea addresses_A_ht+0x1d665, %rdi
clflush (%rsi)
nop
nop
nop
nop
add $63789, %r9
mov $5, %rcx
rep movsq
cmp $43826, %rcx
lea addresses_normal_ht+0x1d165, %rsi
lea addresses_WC_ht+0x665, %rdi
nop
nop
add $2588, %rbp
mov $48, %rcx
rep movsq
nop
nop
add $26279, %rbp
lea addresses_WT_ht+0xfa65, %rdx
sub $34695, %r9
mov (%rdx), %cx
nop
xor %r11, %r11
lea addresses_WC_ht+0x122cd, %r8
nop
nop
nop
sub $55562, %rsi
movb (%r8), %cl
nop
nop
nop
nop
cmp $62107, %rsi
lea addresses_D_ht+0x1d65, %rbp
nop
nop
nop
nop
and %rbx, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm5
movups %xmm5, (%rbp)
nop
xor %rcx, %rcx
lea addresses_WC_ht+0x5265, %rsi
lea addresses_WC_ht+0x157a5, %rdi
nop
nop
inc %rdx
mov $6, %rcx
rep movsq
nop
cmp $38865, %r13
lea addresses_UC_ht+0x170a5, %rsi
lea addresses_WC_ht+0x1ee65, %rdi
nop
nop
nop
cmp %r13, %r13
mov $62, %rcx
rep movsl
nop
nop
nop
nop
nop
inc %r8
lea addresses_WC_ht+0x7d65, %rsi
lea addresses_WT_ht+0x5665, %rdi
nop
nop
add $59584, %r8
mov $5, %rcx
rep movsl
nop
nop
nop
nop
xor $52518, %r9
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Faulty Load
lea addresses_D+0x7665, %r8
nop
nop
nop
nop
nop
cmp $52493, %rcx
mov (%r8), %rsi
lea oracles, %r9
and $0xff, %rsi
shlq $12, %rsi
mov (%r9,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'dst': {'same': True, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
[BITS 16]
[ORG 0x7c00]
Start:
xor ax,ax
mov ds,ax
mov es,ax
mov ss,ax
mov sp,0x7c00
TestDiskExtension:
mov [DriveId],dl
mov ah,0x41
mov bx,0x55aa
int 0x13
jc NotSupport
cmp bx,0xaa55
jne NotSupport
LoadLoader:
mov si,ReadPacket
mov word[si],0x10
mov word[si+2],5
mov word[si+4],0x7e00
mov word[si+6],0
mov dword[si+8],1
mov dword[si+0xc],0
mov dl,[DriveId]
mov ah,0x42
int 0x13
jc ReadError
mov dl,[DriveId]
jmp 0x7e00
ReadError:
NotSupport:
mov ah,0x13
mov al,1
mov bx,0xa
xor dx,dx
mov bp,Message
mov cx,MessageLen
int 0x10
End:
hlt
jmp End
DriveId: db 0
Message: db "We have an error in boot process"
MessageLen: equ $-Message
ReadPacket: times 16 db 0
times (0x1be-($-$$)) db 0
db 80h
db 0,2,0
db 0f0h
db 0ffh,0ffh,0ffh
dd 1
dd (20*16*63-1)
times (16*3) db 0
db 0x55
db 0xaa
|
; A053436: a(n) = n+1 + ceiling(n/2)*(ceiling(n/2)-1)*(ceiling(n/2)+1)/6.
; 2,3,5,6,10,11,18,19,30,31,47,48,70,71,100,101,138,139,185,186,242,243,310,311,390,391,483,484,590,591,712,713,850,851,1005,1006,1178,1179,1370,1371,1582,1583,1815,1816,2070,2071,2348,2349,2650,2651,2977,2978,3330,3331,3710,3711,4118,4119,4555,4556,5022,5023,5520,5521,6050,6051,6613,6614,7210,7211,7842,7843,8510,8511,9215,9216,9958,9959,10740,10741,11562,11563,12425,12426,13330,13331,14278,14279,15270,15271,16307,16308,17390,17391,18520,18521,19698,19699,20925,20926
add $0,1
mov $1,1
sub $1,$0
div $1,2
bin $1,3
sub $0,$1
add $0,1
|
#ifndef STAN_MATH_OPENCL_ZEROS_HPP
#define STAN_MATH_OPENCL_ZEROS_HPP
#ifdef STAN_OPENCL
#include <stan/math/opencl/opencl_context.hpp>
#include <stan/math/opencl/matrix_cl_view.hpp>
#include <stan/math/opencl/matrix_cl.hpp>
#include <stan/math/opencl/err/check_opencl.hpp>
#include <stan/math/opencl/kernels/fill.hpp>
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/scal/err/domain_error.hpp>
#include <cl.hpp>
namespace stan {
namespace math {
/** \ingroup opencl
* Stores zeros in the matrix on the OpenCL device.
* Supports writing zeroes to the lower and upper triangular or
* the whole matrix.
*
* @tparam view Specifies if zeros are assigned to
* the entire matrix, lower triangular or upper triangular. The
* value must be of type matrix_cl_view
*/
template <typename T>
template <matrix_cl_view matrix_view>
inline void matrix_cl<T, require_arithmetic_t<T>>::zeros() try {
if (size() == 0) {
return;
}
this->view_ = both(this->view_, invert(matrix_view));
cl::CommandQueue cmdQueue = opencl_context.queue();
opencl_kernels::fill(cl::NDRange(this->rows(), this->cols()), *this, 0.0,
this->rows(), this->cols(), matrix_view);
} catch (const cl::Error& e) {
check_opencl_error("zeros", e);
}
/** \ingroup opencl
* Stores zeros in the stricts triangular part (excluding the diagonal)
* of a matrix on the OpenCL device.
* Supports writing zeroes to the lower and upper triangular.
* Throws if used with the Entire matrix_cl_view.
*
* @tparam view Specifies if zeros are assigned to
* the lower triangular or upper triangular. The
* value must be of type matrix_cl_view
*
* @throw <code>std::invalid_argument</code> if the
* matrix_view parameter is Entire.
*/
template <typename T>
template <matrix_cl_view matrix_view>
inline void matrix_cl<T, require_arithmetic_t<T>>::zeros_strict_tri() try {
if (matrix_view == matrix_cl_view::Entire) {
invalid_argument(
"zeros_strict_tri", "matrix_view",
"matrix_cl_view::Entire is not a valid template parameter value", "");
}
if (matrix_view == matrix_cl_view::Diagonal) {
invalid_argument(
"zeros_strict_tri", "matrix_view",
"matrix_cl_view::Diagonal is not a valid template parameter value", "");
}
if (size() == 0) {
return;
}
this->view_ = both(this->view_, invert(matrix_view));
cl::CommandQueue cmdQueue = opencl_context.queue();
opencl_kernels::fill_strict_tri(cl::NDRange(this->rows(), this->cols()),
*this, 0.0, this->rows(), this->cols(),
matrix_view);
} catch (const cl::Error& e) {
check_opencl_error("zeros_strict_tri", e);
}
} // namespace math
} // namespace stan
#endif
#endif
|
/* Copyright (c) 2017 PaddlePaddle Authors. All Rights Reserved.
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. */
#include <algorithm>
#include <utility>
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/phi/kernels/funcs/blas/blas.h"
#ifdef PADDLE_WITH_MKLDNN
#include "paddle/fluid/platform/mkldnn_helper.h"
#endif
namespace paddle {
namespace operators {
/**
* Printing shape information into a string is easy to use.
*/
inline static std::string DumpMatrixShape(
const phi::funcs::MatDescriptor &desc) {
std::stringstream buffer;
buffer << "[" << desc.batch_size_ << ", " << desc.height_ << ", "
<< desc.width_ << "]";
return buffer.str();
}
/**
* Get row matrix shape from a vector shape. If the rank of x_dim > 1, the
* original x_dim is returned.
*/
static framework::DDim RowMatrixFromVector(const framework::DDim &x_dim) {
if (x_dim.size() > 1) {
return x_dim;
}
return phi::make_ddim({1, x_dim[0]});
}
/**
* Get column matrix shape from a vector shape. If the ran of y_dim > 1, the
* original y_dim is returned.
*/
static framework::DDim ColumnMatrixFromVector(const framework::DDim &y_dim) {
if (y_dim.size() > 1) {
return y_dim;
}
return phi::make_ddim({y_dim[0], 1});
}
template <typename DeviceContext, typename T>
class MatMulKernel : public framework::OpKernel<T> {
public:
void Compute(const framework::ExecutionContext &context) const override {
auto &x = GET_DATA_SAFELY(context.Input<framework::Tensor>("X"), "Input",
"X", "MatMul");
auto &y = GET_DATA_SAFELY(context.Input<framework::Tensor>("Y"), "Input",
"Y", "MatMul");
auto *out = context.Output<framework::Tensor>("Out");
out->mutable_data<T>(context.GetPlace());
auto blas = phi::funcs::GetBlas<DeviceContext, T>(context);
auto mat_dim_a = phi::funcs::CreateMatrixDescriptor(
RowMatrixFromVector(x.dims()), 0, context.Attr<bool>("transpose_X"));
auto mat_dim_b = phi::funcs::CreateMatrixDescriptor(
ColumnMatrixFromVector(y.dims()), 0, context.Attr<bool>("transpose_Y"));
auto scale = static_cast<T>(context.Attr<float>("alpha"));
int head_number = 1;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
head_number = context.Attr<int>("head_number");
#endif
const auto &x_dims = x.dims();
const auto &y_dims = y.dims();
if (head_number <= 1 && x_dims.size() == 3 && y_dims.size() <= 2) {
// the transpose_X must be false, if is true, the transpose cost much time
if (!context.Attr<bool>("transpose_X")) {
mat_dim_a.height_ *= mat_dim_a.batch_size_;
mat_dim_a.batch_size_ = 0;
}
}
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
bool split_vertical_y = (mat_dim_a.width_ != mat_dim_b.height_);
if (head_number > 1) {
blas.MatMulWithHead(x, mat_dim_a, y, mat_dim_b, scale, head_number, out,
T(0), split_vertical_y);
} else {
blas.MatMul(x, mat_dim_a, y, mat_dim_b, scale, out, T(0));
}
#else
blas.MatMul(x, mat_dim_a, y, mat_dim_b, scale, out, T(0));
#endif
}
};
// Reshape a rank-3 tensor from P x M x N to (P * M) x N.
// Identity op if the tensor is not of rank 3.
static framework::Tensor FoldInitDims(const framework::Tensor &input) {
auto output = input;
auto in_dims = input.dims();
if (in_dims.size() == 3) {
output.Resize({in_dims[0] * in_dims[1], in_dims[2]});
}
return output;
}
// Reshape a rank-3 tensor from P x M x N to M x (P * N).
// (Warning: This requires transposing data and writes into new memory.)
// Identity op if the tensor is not of rank 3.
template <typename DeviceContext, typename T>
static framework::Tensor FoldHeadAndLastDims(const DeviceContext &context,
const framework::Tensor &input) {
auto in_dims = input.dims();
if (in_dims.size() != 3) {
return input;
}
framework::Tensor output;
output.Resize({in_dims[1], in_dims[0], in_dims[2]});
output.mutable_data<T>(context.GetPlace());
std::vector<int> axis = {1, 0, 2};
phi::funcs::Transpose<DeviceContext, T, 3> trans;
trans(context, input, &output, axis);
output.Resize({in_dims[1], in_dims[0] * in_dims[2]});
return output;
}
/**
* Reshape a tensor to 3-D or 2-D tensor by matrix descriptor.
*
* The shape would be [BatchSize, H, W] or [H, W].
* If transposed, `H,W` will be swapped.
*/
static void ReshapeTensorIntoMatrixSequence(
framework::Tensor *x, const phi::funcs::MatDescriptor &descriptor) {
int64_t h, w;
h = descriptor.height_;
w = descriptor.width_;
if (descriptor.trans_) {
std::swap(w, h);
}
if (descriptor.batch_size_) {
x->Resize({descriptor.batch_size_, h, w});
} else {
x->Resize({h, w});
}
}
/**
* Reshape the x,y,out tensor to 3-D or 2-D tensor by matrix descriptor
* Out = matmul(x, y)
*
* This method will first calculate X,Y matrix sequence, and then calculate
* the out shape.
*
* Assume X = [BatchSize, H1, W1], Y = [BatchSize, H2, W2]
* The out = [BatchSize, H1, W2]
*
* If there is no batch size in `X` and `Y`, the out will be [H1, W2]
* If any of `X` and `Y` has batch size BatchSize, the out will have the
* BatchSize.
*/
static void ReshapeXYOutIntoMatrixSequence(framework::Tensor *x,
framework::Tensor *y,
framework::Tensor *out, bool trans_x,
bool trans_y) {
auto x_dim = RowMatrixFromVector(x->dims());
auto y_dim = ColumnMatrixFromVector(y->dims());
auto mat_dim_x = phi::funcs::CreateMatrixDescriptor(x_dim, 0, trans_x);
auto mat_dim_y = phi::funcs::CreateMatrixDescriptor(y_dim, 0, trans_y);
if (mat_dim_x.batch_size_ == 0 && mat_dim_y.batch_size_ == 0) {
out->Resize({mat_dim_x.height_, mat_dim_y.width_});
} else {
out->Resize({std::max(mat_dim_x.batch_size_, mat_dim_y.batch_size_),
mat_dim_x.height_, mat_dim_y.width_});
}
ReshapeTensorIntoMatrixSequence(x, mat_dim_x);
ReshapeTensorIntoMatrixSequence(y, mat_dim_y);
}
// Using dimensional constraints on matrix multiplication, it is
// straight-forward to check the following table for when X and Y
// are both matrices.
//
// transpose_X | False | True | False | True
// transpose_Y | False | False | True | True
// -----------+----------+----------+----------+-----------
// dX = | dOut Y^T | Y dOut^T | dOut Y | Y^T dOut^T
// dY = | X^T dOut | X dOut | dOut^T X | dOut^T X^T
//
// When X is a vector of size K, we treat it instead as a matrix of shape
// (1, K). Similarly, when Y is a vector of size K, we treat it instead as
// a matrix of shape (K, 1).
//
// When X and Y are both 3-dimensional tensors, then the first dimension
// the batch dimension can be ignored and the exact same formulas apply
// as for two matrices.
//
// Finally, when, e.g., X is a 3-dimensional tensor but Y is a matrix, we end
// up with formulas like
//
// dY_{ij} = \sum_{p, m} X_{pmi} dOut_{pmj}
//
// To handle this sort of scenario, we reshape X : P x M x K, dOut: P x M x N
// to X: (P * M) x K, dOut: (P * M) x N.
template <typename DeviceContext, typename T>
class MatMulGradKernel : public framework::OpKernel<T> {
public:
void MatMul(const framework::ExecutionContext &context,
const framework::Tensor &a, bool trans_a,
const framework::Tensor &b, bool trans_b,
framework::Tensor *out) const {
out->mutable_data<T>(context.GetPlace());
auto blas = phi::funcs::GetBlas<DeviceContext, T>(context);
auto mat_dim_a = phi::funcs::CreateMatrixDescriptor(a.dims(), 0, trans_a);
auto mat_dim_b = phi::funcs::CreateMatrixDescriptor(b.dims(), 0, trans_b);
int head_number = 1;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
if (context.HasAttr("head_number")) {
head_number = context.Attr<int>("head_number");
}
#endif
if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) {
// the transpose_X must be false, if is true, the transpose cost much time
if (!trans_a) {
mat_dim_a.height_ *= mat_dim_a.batch_size_;
mat_dim_a.batch_size_ = 0;
}
}
blas.MatMul(a, mat_dim_a, b, mat_dim_b,
static_cast<T>(context.Attr<float>("alpha")), out, T(0));
}
void CalcInputGrad(const framework::ExecutionContext &context,
const framework::Tensor &a, bool trans_a,
bool is_fold_init_dims_a, const framework::Tensor &b,
bool trans_b, bool is_fold_init_dims_b,
framework::Tensor *out) const {
if (out == nullptr) return;
bool need_combine = (a.dims().size() == 3 || b.dims().size() == 3) &&
out->dims().size() == 2;
if (!need_combine) {
MatMul(context, a, trans_a, b, trans_b, out);
} else {
auto &ctx = context.template device_context<DeviceContext>();
MatMul(context, is_fold_init_dims_a
? FoldInitDims(a)
: FoldHeadAndLastDims<DeviceContext, T>(ctx, a),
trans_a, is_fold_init_dims_b
? FoldInitDims(b)
: FoldHeadAndLastDims<DeviceContext, T>(ctx, b),
trans_b, out);
}
}
void Compute(const framework::ExecutionContext &context) const override {
auto x = *context.Input<framework::Tensor>("X");
auto y = *context.Input<framework::Tensor>("Y");
auto dout =
*context.Input<framework::Tensor>(framework::GradVarName("Out"));
auto *dx = context.Output<framework::Tensor>(framework::GradVarName("X"));
auto *dy = context.Output<framework::Tensor>(framework::GradVarName("Y"));
bool transpose_x = context.Attr<bool>("transpose_X");
bool transpose_y = context.Attr<bool>("transpose_Y");
ReshapeXYOutIntoMatrixSequence(&x, &y, &dout, transpose_x, transpose_y);
framework::DDim dx_dims;
if (dx) {
dx_dims = dx->dims();
if (dx_dims != x.dims()) {
dx->Resize(x.dims());
}
}
framework::DDim dy_dims;
if (dy) {
dy_dims = dy->dims();
if (dy_dims != y.dims()) {
dy->Resize(y.dims());
}
}
if (transpose_x && transpose_y) {
CalcInputGrad(context, y, true, true, dout, true, false, dx);
CalcInputGrad(context, dout, true, true, x, true, false, dy);
} else if (transpose_x) {
CalcInputGrad(context, y, false, false, dout, true, false, dx);
CalcInputGrad(context, x, false, false, dout, false, true, dy);
} else if (transpose_y) {
CalcInputGrad(context, dout, false, false, y, false, true, dx);
CalcInputGrad(context, dout, true, true, x, false, true, dy);
} else {
CalcInputGrad(context, dout, false, false, y, true, false, dx);
CalcInputGrad(context, x, true, true, dout, false, true, dy);
}
if (dx) {
if (dx_dims != x.dims()) {
dx->Resize(dx_dims);
}
}
if (dy) {
if (dy_dims != y.dims()) {
dy->Resize(dy_dims);
}
}
}
};
framework::DDim GetDimForInput(const framework::InferShapeContext &ctx,
std::string input_name) {
auto shape = ctx.Attrs().Get<std::vector<int>>("fused_reshape_" + input_name);
auto axis =
ctx.Attrs().Get<std::vector<int>>("fused_transpose_" + input_name);
auto dim = ctx.GetInputDim(input_name);
PADDLE_ENFORCE_GT(dim.size(), 0,
platform::errors::InvalidArgument(
"The Input(%s) has not been initialized properly. The "
"shape of Input(%s) = [%s].",
dim));
// if mkldnn reshape+transpose+matmul fuse activated
if (!shape.empty() && !axis.empty()) {
PADDLE_ENFORCE_GE(
shape.size(), 2,
platform::errors::InvalidArgument(
"shape_%s attribute of MatMulOp was implemented for 2, 3 "
"or 4 dimensions.",
input_name));
PADDLE_ENFORCE_LE(
shape.size(), 4,
platform::errors::InvalidArgument(
"shape_%s attribute of MatMulOp was implemented for 2, 3 "
"or 4 dimensions.",
input_name));
PADDLE_ENFORCE_EQ(
shape.size(), axis.size(),
platform::errors::InvalidArgument(
"Ranks of shape_%s and axis_%s attributes of MatMulOp "
"must be equal.",
input_name, input_name));
int num_negative = std::count(shape.begin(), shape.end(), -1);
PADDLE_ENFORCE_LE(num_negative, 1,
platform::errors::InvalidArgument(
"The max number of -1 in fused_reshape_%s is 1 "
"but received %d.",
input_name, num_negative));
auto it_zero = std::find(shape.begin(), shape.end(), 0);
if (it_zero != shape.end()) {
for (uint64_t i = 0; i < shape.size(); i++) {
if (shape[i] == 0) {
PADDLE_ENFORCE_LT(i, dim.size(),
platform::errors::InvalidArgument(
"The index of 0 in fused_reshape_%s ",
"should be less than output dim size, ",
"but the index is %d and output dim size is %d",
input_name, i, dim.size()));
shape[i] = dim.at(i);
}
}
}
// if "-1" is present then one of reshape dims must be infered
auto it_negative = std::find(shape.begin(), shape.end(), -1);
if (it_negative != shape.end()) {
int64_t dim_product = 1;
for (int i = 0; i < dim.size(); i++) {
dim_product *= dim.at(i);
}
int64_t shape_product = std::accumulate(shape.begin(), shape.end(), -1,
std::multiplies<int>());
int index = std::distance(shape.begin(), it_negative);
shape[index] = dim_product / shape_product;
}
dim = dim.reshape(shape).transpose(axis);
}
return dim;
}
template <typename DeviceContext, typename T>
class MatMulDoubleGradKernel : public framework::OpKernel<T> {
public:
void MatMul(const framework::ExecutionContext &context,
const framework::Tensor &a, bool trans_a,
const framework::Tensor &b, bool trans_b, bool flag,
framework::Tensor *out) const {
out->mutable_data<T>(context.GetPlace());
auto blas = phi::funcs::GetBlas<DeviceContext, T>(context);
auto mat_dim_a = phi::funcs::CreateMatrixDescriptor(a.dims(), 0, trans_a);
auto mat_dim_b = phi::funcs::CreateMatrixDescriptor(b.dims(), 0, trans_b);
int head_number = 1;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
head_number = context.Attr<int>("head_number");
#endif
if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) {
// the transpose_X must be false, if is true, the transpose cost much time
if (!trans_a) {
mat_dim_a.height_ *= mat_dim_a.batch_size_;
mat_dim_a.batch_size_ = 0;
}
}
blas.MatMul(a, mat_dim_a, b, mat_dim_b,
static_cast<T>(context.Attr<float>("alpha")), out,
static_cast<T>(flag));
}
void CalcInputGrad(const framework::ExecutionContext &context,
const framework::Tensor &a, bool trans_a,
bool is_fold_init_dims_a, const framework::Tensor &b,
bool trans_b, bool is_fold_init_dims_b, bool flag,
framework::Tensor *out) const {
if (out == nullptr) return;
bool need_combine = (a.dims().size() == 3 || b.dims().size() == 3) &&
out->dims().size() == 2;
if (!need_combine) {
MatMul(context, a, trans_a, b, trans_b, flag, out);
} else {
auto &ctx = context.template device_context<DeviceContext>();
MatMul(context, is_fold_init_dims_a
? FoldInitDims(a)
: FoldHeadAndLastDims<DeviceContext, T>(ctx, a),
trans_a, is_fold_init_dims_b
? FoldInitDims(b)
: FoldHeadAndLastDims<DeviceContext, T>(ctx, b),
trans_b, flag, out);
}
}
void Compute(const framework::ExecutionContext &context) const override {
auto x = *context.Input<framework::Tensor>("X");
auto y = *context.Input<framework::Tensor>("Y");
auto dout = *context.Input<framework::LoDTensor>("DOut");
auto *ddx = context.Input<framework::LoDTensor>("DDX");
auto *ddy = context.Input<framework::LoDTensor>("DDY");
auto *dx = context.Output<framework::LoDTensor>("DX");
auto *dy = context.Output<framework::LoDTensor>("DY");
auto *ddout = context.Output<framework::LoDTensor>("DDOut");
bool transpose_x = context.Attr<bool>("transpose_X");
bool transpose_y = context.Attr<bool>("transpose_Y");
ReshapeXYOutIntoMatrixSequence(&x, &y, &dout, transpose_x, transpose_y);
framework::DDim dx_dims;
if (dx) {
dx_dims = dx->dims();
if (dx_dims != x.dims()) {
dx->Resize(x.dims());
}
}
framework::DDim dy_dims;
if (dy) {
dy_dims = dy->dims();
if (dy_dims != y.dims()) {
dy->Resize(y.dims());
}
}
framework::DDim ddout_dims;
if (ddout) {
ddout_dims = ddout->dims();
if (ddout_dims != dout.dims()) {
ddout->Resize(dout.dims());
}
}
bool ddout_flag = false;
if (ddx) {
auto ddx_mat = *ddx;
if (ddx_mat.dims() != x.dims()) {
ddx_mat.Resize(x.dims());
}
if (dy) {
if (transpose_x && transpose_y) {
// dy = dout' * ddx'
CalcInputGrad(context, dout, true, true, ddx_mat, true, false, false,
dy);
} else if (transpose_x) {
// dy = ddx * dout
CalcInputGrad(context, ddx_mat, false, false, dout, false, true,
false, dy);
} else if (transpose_y) {
// dy = dout' * ddx
CalcInputGrad(context, dout, true, true, ddx_mat, false, true, false,
dy);
} else {
// dy = ddx' * dout
CalcInputGrad(context, ddx_mat, true, true, dout, false, true, false,
dy);
}
}
if (ddout) {
CalcInputGrad(context, ddx_mat, transpose_x, true, y, transpose_y,
false, ddout_flag, ddout);
ddout_flag = true;
}
}
if (ddy) {
auto ddy_mat = *ddy;
if (ddy_mat.dims() != y.dims()) {
ddy_mat.Resize(y.dims());
}
if (dx) {
if (transpose_x && transpose_y) {
// dx = ddy' * dout'
CalcInputGrad(context, ddy_mat, true, true, dout, true, false, false,
dx);
} else if (transpose_x) {
// dx = ddy * dout'
CalcInputGrad(context, ddy_mat, false, false, dout, true, false,
false, dx);
} else if (transpose_y) {
// dx = dout * ddy
CalcInputGrad(context, dout, false, false, ddy_mat, false, true,
false, dx);
} else {
// dx = dout * ddy'
CalcInputGrad(context, dout, false, false, ddy_mat, true, false,
false, dx);
}
}
if (ddout) {
CalcInputGrad(context, x, transpose_x, true, ddy_mat, transpose_y,
false, ddout_flag, ddout);
}
}
if (dx) {
if (dx_dims != x.dims()) {
dx->Resize(dx_dims);
}
}
if (dy) {
if (dy_dims != y.dims()) {
dy->Resize(dy_dims);
}
}
if (ddout) {
if (ddout_dims != dout.dims()) {
ddout->Resize(ddout_dims);
}
}
}
};
class MatMulOp : public framework::OperatorWithKernel {
public:
using framework::OperatorWithKernel::OperatorWithKernel;
protected:
void InferShape(framework::InferShapeContext *context) const override {
OP_INOUT_CHECK(context->HasInput("X"), "Input", "X", "matmul");
OP_INOUT_CHECK(context->HasInput("Y"), "Input", "Y", "matmul");
OP_INOUT_CHECK(context->HasOutput("Out"), "Output", "Out", "matmul");
auto dim_x = GetDimForInput(*context, "X");
auto dim_y = GetDimForInput(*context, "Y");
auto mat_dim_x = phi::funcs::CreateMatrixDescriptor(
RowMatrixFromVector(dim_x), 0,
context->Attrs().Get<bool>("transpose_X"));
auto mat_dim_y = phi::funcs::CreateMatrixDescriptor(
ColumnMatrixFromVector(dim_y), 0,
context->Attrs().Get<bool>("transpose_Y"));
if (mat_dim_x.width_ == -1) {
mat_dim_x.width_ = mat_dim_y.height_;
}
if (mat_dim_y.height_ == -1) {
mat_dim_y.height_ = mat_dim_x.width_;
}
if (context->IsRuntime()) {
PADDLE_ENFORCE_EQ(
mat_dim_x.batch_size_ == mat_dim_y.batch_size_ ||
mat_dim_x.batch_size_ == 0 || mat_dim_y.batch_size_ == 0,
true, platform::errors::InvalidArgument(
"The batch size of the two matrices should be equal, or "
"at least one is zero.\n"
"But received X's shape: %s, Y's shape: %s.",
DumpMatrixShape(mat_dim_x).c_str(),
DumpMatrixShape(mat_dim_y).c_str()));
}
int64_t dim_out_y = mat_dim_y.width_;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
int head_number = context->Attrs().Get<int>("head_number");
bool split_vertical_y = (mat_dim_x.width_ != mat_dim_y.height_);
if (context->IsRuntime()) {
PADDLE_ENFORCE_LE(
head_number, mat_dim_x.width_,
platform::errors::InvalidArgument(
"Unsatisfied mkl acceleration library requirements: "
"The number of heads "
"(%d) must be equal to X's width. But received X's shape: %s.",
head_number, DumpMatrixShape(mat_dim_x).c_str()));
if (!split_vertical_y && head_number > 0) {
dim_out_y = head_number * mat_dim_y.width_;
}
}
#else
PADDLE_ENFORCE_EQ(mat_dim_x.width_, mat_dim_y.height_,
platform::errors::InvalidArgument(
"Input X's width should be equal to the Y's height, "
"but received X's shape: [%s], "
"Y's shape: [%s].",
dim_x, dim_y));
#endif
std::vector<int64_t> dim_out;
if (mat_dim_x.batch_size_ != 0) {
dim_out = phi::vectorize(dim_x);
dim_out[dim_out.size() - 2] = mat_dim_x.height_;
dim_out[dim_out.size() - 1] = dim_out_y;
} else if (mat_dim_y.batch_size_ != 0) {
dim_out = phi::vectorize(dim_y);
dim_out[dim_out.size() - 2] = mat_dim_x.height_;
dim_out[dim_out.size() - 1] = dim_out_y;
} else {
dim_out = {mat_dim_x.height_, dim_out_y};
}
if (dim_x.size() == 1 && dim_out[dim_out.size() - 2] == 1) {
std::swap(dim_out[dim_out.size() - 2], dim_out[dim_out.size() - 1]);
dim_out.resize(dim_out.size() - 1);
}
if (dim_y.size() == 1 && dim_out[dim_out.size() - 1] == 1) {
dim_out.resize(dim_out.size() - 1);
}
if (dim_out.empty()) {
dim_out = {1};
}
framework::DDim ddim_out = phi::make_ddim(dim_out);
#ifdef PADDLE_WITH_MKLDNN
// if mkldnn matmul+transpose+reshape fuse activated
auto reshape_out =
context->Attrs().Get<std::vector<int>>("fused_reshape_Out");
auto transpose_out =
context->Attrs().Get<std::vector<int>>("fused_transpose_Out");
if (!reshape_out.empty() && !transpose_out.empty()) {
auto reshape_out_size = reshape_out.size();
auto transpose_out_size = transpose_out.size();
PADDLE_ENFORCE_EQ(transpose_out_size, 4,
platform::errors::InvalidArgument(
"transpose_out supported rank is 4, "
"received %d",
transpose_out_size));
const std::vector<int> supported_axis{0, 2, 1, 3};
const bool supported_transpose_axis = std::equal(
transpose_out.begin(), transpose_out.end(), supported_axis.begin());
PADDLE_ENFORCE_EQ(
supported_transpose_axis, true,
platform::errors::InvalidArgument(
"supported transpose axis for the fuse are {0, 2, 1, 3}"));
PADDLE_ENFORCE_EQ(
reshape_out_size, 3,
platform::errors::InvalidArgument("reshape_out supported rank is 3, "
"received %d",
reshape_out_size));
// int num_negative = std::count(reshape_out.begin(), reshape_out.end(),
// -1);
// PADDLE_ENFORCE_LE(num_negative, 1,
// platform::errors::InvalidArgument(
// "The max number of -1 in fused_reshape_Out is 1 "
// "but received %d.",
// num_negative));
// auto it_zero = std::find(reshape_out.begin(), reshape_out.end(), 0);
// if (it_zero != reshape_out.end()) {
// for (uint64_t i = 0; i < reshape_out.size(); i++) {
// if (reshape_out[i] == 0) {
// PADDLE_ENFORCE_LT(
// i, ddim_out.size(),
// platform::errors::InvalidArgument(
// "The index of 0 in fused_reshape_Out ",
// "should be less than output dim size, ",
// "but the index is %d and output dim size is %d", i,
// ddim_out.size()));
// reshape_out[i] = ddim_out.at(i);
// }
// }
// }
// if "-1" is present then one of reshape dims must be infered
auto it = std::find(reshape_out.begin(), reshape_out.end(), -1);
if (it != reshape_out.end()) {
int index = std::distance(reshape_out.begin(), it);
auto ddim_out_vec = phi::vectorize(ddim_out);
int ddim_out_product =
std::accumulate(ddim_out_vec.begin(), ddim_out_vec.end(), 1,
std::multiplies<int>());
int reshape_out_product = std::accumulate(
reshape_out.begin(), reshape_out.end(), -1, std::multiplies<int>());
reshape_out[index] = ddim_out_product / reshape_out_product;
}
framework::DDim shape_out =
ddim_out.transpose(transpose_out).reshape(reshape_out);
context->SetOutputDim("Out", shape_out);
} else {
context->SetOutputDim("Out", ddim_out);
}
#else
context->SetOutputDim("Out", ddim_out);
#endif
context->ShareLoD("X", /*->*/ "Out");
}
framework::OpKernelType GetExpectedKernelType(
const framework::ExecutionContext &ctx) const override {
auto input_data_type =
OperatorWithKernel::IndicateOrPromoteVarDataTypes(ctx, "X", "Y");
#ifdef PADDLE_WITH_MKLDNN
using dnnl::memory;
if (this->CanMKLDNNBeUsed(ctx, input_data_type)) {
return framework::OpKernelType(input_data_type, ctx.GetPlace(),
framework::DataLayout::kMKLDNN,
framework::LibraryType::kMKLDNN);
}
#endif
return framework::OpKernelType(input_data_type, ctx.GetPlace());
}
framework::OpKernelType GetKernelTypeForVar(
const std::string &var_name, const framework::Tensor &tensor,
const framework::OpKernelType &expected_kernel_type) const {
if (framework::IsComplexType(expected_kernel_type.data_type_)) {
// only promote inputs’s types when contains complex input
return framework::OpKernelType(
framework::TransToProtoVarType(tensor.dtype()), tensor.place(),
tensor.layout());
} else {
return framework::OpKernelType(expected_kernel_type.data_type_,
tensor.place(), tensor.layout());
}
}
};
class MatMulOpMaker : public framework::OpProtoAndCheckerMaker {
public:
void Make() override {
AddInput("X", "The first input of MatMul op");
AddInput("Y", "The second input of MatMul op");
AddOutput("Out", "The output of MatMul op");
AddAttr<bool>("transpose_X",
R"DOC(If true, use the transpose of `X`.
)DOC")
.SetDefault(false);
AddAttr<bool>("transpose_Y",
R"DOC(If true, use the transpose of `Y`.
)DOC")
.SetDefault(false);
AddAttr<float>("alpha", "The scale of Out").SetDefault(1.0f);
AddAttr<bool>(
"use_mkldnn",
"(bool, default false) Indicates if MKL-DNN kernel will be used")
.SetDefault(false)
.AsExtra();
AddAttr<std::vector<int>>("fused_reshape_X",
R"DOC(Shape of fused reshape of `X` input.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<std::vector<int>>("fused_reshape_Y",
R"DOC(Shape of fused reshape of `Y` input.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<std::vector<int>>("fused_transpose_X",
R"DOC(Axis of fused transpose of `X` input.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<std::vector<int>>("fused_transpose_Y",
R"DOC(Axis of fused transpose of `Y` input.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<std::vector<int>>(
"fused_reshape_Out",
R"DOC(When MKLDNN MatMul_transpose_reshape fuse activated, "
"it's a shape atribute of fused reshape for `Out` output.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<std::vector<int>>(
"fused_transpose_Out",
R"DOC(When MKLDNN MatMul_transpose_reshape fuse activated, "
"it's a axis atribute of fused transpose for `Out` output.)DOC")
.SetDefault({})
.AsExtra();
AddAttr<bool>(
"use_quantizer",
"(bool, default false) "
"This parameter is no longer used. Use 'mkldnn_data_type' instead.")
.SetDefault(false)
.AsExtra();
AddAttr<std::string>(
"mkldnn_data_type",
"(string, default \"float32\"). Data type of mkldnn kernel")
.SetDefault("float32")
.InEnum({"float32", "int8", "bfloat16"})
.AsExtra();
/* int8 parameters */
AddAttr<float>("Scale_x",
"(float, default 1.0f), The quantize scale of X tensor")
.SetDefault(1.0f)
.AsExtra();
AddAttr<float>("Scale_y",
"(float, default 1.0f), The quantize scale of Y tensor")
.SetDefault(1.0f)
.AsExtra();
AddAttr<float>("Scale_out",
"(float, default 1.0f), The quantize scale of output data")
.SetDefault(1.0f)
.AsExtra();
AddAttr<bool>("force_fp32_output",
"(bool, default false) Force INT8 kernel output FP32, only "
"used in MKL-DNN INT8")
.SetDefault(false)
.AsExtra();
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
AddAttr<int>("head_number", "The number of heads of the matrix")
.SetDefault(1);
#endif
AddComment(R"DOC(
MatMul Operator.
This operator is used to perform (batched) matrix multiplication
over the last two dimensions of the input tensors `X` and `Y`.
If a transpose flag is specified, the last two dimensions of the
tensor are transposed. If the tensor is rank-1 of shape [D], then
for `X` it is treated as [1, D] in nontransposed form and as [D, 1]
in transposed form, whereas for `Y` it is the opposite: It is treated
as [D, 1] in nontransposed form and as [1, D] in transposed form.
Examples without transpose:
- X: [K], Y: [K] => Out: [1]
- X: [K], Y: [K, N] => Out: [N]
- X: [B, M, K], Y: [K] => Out: [B, M]
- X: [M, K], Y: [B, K, N] => Out: [B, M, N]
- X: [B, M, K], Y: [B, K, N] => Out: [B, M, N]
- X: [B, ..., M, K], Y: [B, ..., K, N] => Out: [B, ..., M, N]
Example of matrix multiplication with head_number of H
- X: [B, M, K], Y: [B, K, N] => Out: [B, M, H * N]
The behavior is designed to be similar to the `numpy.matmul` function.
The differences are:
- When the rank of the input data is less than or equal to 3, it
is similar to the `numpy.matmul` function.
- When the rank of the input is greater than 3, the rank of X and
Y must be equal, and the first `rank - 2` dimensions must be equal.
- We add `transpose_X` and `transpose_Y` flags.
- We add `head_number` attribute, which is used to multiple two matrixes head
by head, and eventually concatenates the output of several (head_number)
small matrixes multiplication.
Both the input `X` and `Y` can carry the LoD (Level of Details) information,
or not. But the output only shares the LoD information with input `X`.
)DOC");
}
};
class MatMulOpGrad : public framework::OperatorWithKernel {
public:
using framework::OperatorWithKernel::OperatorWithKernel;
protected:
void InferShape(framework::InferShapeContext *context) const override {
OP_INOUT_CHECK(context->HasInput("X"), "Input", "X", "matmul");
OP_INOUT_CHECK(context->HasInput("Y"), "Input", "Y", "matmul");
OP_INOUT_CHECK(context->HasInput(framework::GradVarName("Out")), "Input",
"Out@GRAD", "matmul");
auto x_dims = context->GetInputDim("X");
auto y_dims = context->GetInputDim("Y");
auto x_grad_name = framework::GradVarName("X");
auto y_grad_name = framework::GradVarName("Y");
if (context->HasOutput(x_grad_name)) {
context->SetOutputDim(x_grad_name, x_dims);
}
if (context->HasOutput(y_grad_name)) {
context->SetOutputDim(y_grad_name, y_dims);
}
}
framework::OpKernelType GetExpectedKernelType(
const framework::ExecutionContext &ctx) const override {
auto input_data_type =
OperatorWithKernel::IndicateOrPromoteVarDataTypes(ctx, "X", "Y");
#ifdef PADDLE_WITH_MKLDNN
if (this->CanMKLDNNBeUsed(ctx, input_data_type)) {
return framework::OpKernelType(input_data_type, ctx.GetPlace(),
framework::DataLayout::kMKLDNN,
framework::LibraryType::kMKLDNN);
}
#endif
return framework::OpKernelType(input_data_type, ctx.GetPlace());
}
};
template <typename T>
class MatMulOpGradMaker : public framework::SingleGradOpMaker<T> {
public:
using framework::SingleGradOpMaker<T>::SingleGradOpMaker;
protected:
void Apply(GradOpPtr<T> retv) const override {
retv->SetType("matmul_grad");
retv->SetInput("X", this->Input("X"));
retv->SetInput("Y", this->Input("Y"));
retv->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out"));
retv->SetOutput(framework::GradVarName("X"), this->InputGrad("X"));
retv->SetOutput(framework::GradVarName("Y"), this->InputGrad("Y"));
retv->SetAttrMap(this->Attrs());
}
};
class MatMulOpDoubleGrad : public framework::OperatorWithKernel {
public:
using framework::OperatorWithKernel::OperatorWithKernel;
protected:
void InferShape(framework::InferShapeContext *context) const override {
OP_INOUT_CHECK(context->HasInput("X"), "Input", "X", "matmul");
OP_INOUT_CHECK(context->HasInput("Y"), "Input", "Y", "matmul");
OP_INOUT_CHECK(context->HasInput("DOut"), "Input", "DOut", "matmul");
if (context->HasOutput("DX") && context->HasInput("DDY")) {
context->ShareDim("X", "DX");
}
if (context->HasOutput("DY") && context->HasInput("DDX")) {
context->ShareDim("Y", "DY");
}
if (context->HasOutput("DDOut") &&
(context->HasInput("DDY") || context->HasInput("DDX"))) {
context->ShareDim("DOut", "DDOut");
}
}
};
template <typename T>
class MatMulOpDoubleGradMaker : public framework::SingleGradOpMaker<T> {
public:
using framework::SingleGradOpMaker<T>::SingleGradOpMaker;
protected:
void Apply(GradOpPtr<T> retv) const override {
retv->SetType("matmul_grad_grad");
retv->SetInput("X", this->Input("X"));
retv->SetInput("Y", this->Input("Y"));
retv->SetInput("DOut", this->Input(framework::GradVarName("Out")));
retv->SetInput("DDX", this->OutputGrad(framework::GradVarName("X")));
retv->SetInput("DDY", this->OutputGrad(framework::GradVarName("Y")));
auto ddx = this->OutputGrad(framework::GradVarName("X"));
auto ddy = this->OutputGrad(framework::GradVarName("Y"));
if (!ddx.empty() || !ddy.empty()) {
retv->SetOutput("DDOut", this->InputGrad(framework::GradVarName("Out")));
}
retv->SetOutput(
"DX", ddy.empty() ? this->EmptyInputGrad() : this->InputGrad("X"));
retv->SetOutput(
"DY", ddx.empty() ? this->EmptyInputGrad() : this->InputGrad("Y"));
retv->SetAttrMap(this->Attrs());
}
};
} // namespace operators
} // namespace paddle
namespace ops = paddle::operators;
REGISTER_OPERATOR(matmul, ops::MatMulOp, ops::MatMulOpMaker,
ops::MatMulOpGradMaker<paddle::framework::OpDesc>,
ops::MatMulOpGradMaker<paddle::imperative::OpBase>);
REGISTER_OPERATOR(matmul_grad, ops::MatMulOpGrad,
ops::MatMulOpDoubleGradMaker<paddle::framework::OpDesc>,
ops::MatMulOpDoubleGradMaker<paddle::imperative::OpBase>);
REGISTER_OPERATOR(matmul_grad_grad, ops::MatMulOpDoubleGrad);
REGISTER_OP_CPU_KERNEL(
matmul, ops::MatMulKernel<paddle::platform::CPUDeviceContext, float>,
ops::MatMulKernel<paddle::platform::CPUDeviceContext, double>);
REGISTER_OP_CPU_KERNEL(
matmul_grad,
ops::MatMulGradKernel<paddle::platform::CPUDeviceContext, float>,
ops::MatMulGradKernel<paddle::platform::CPUDeviceContext, double>);
REGISTER_OP_CPU_KERNEL(
matmul_grad_grad,
ops::MatMulDoubleGradKernel<paddle::platform::CPUDeviceContext, float>,
ops::MatMulDoubleGradKernel<paddle::platform::CPUDeviceContext, double>);
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
REGISTER_OP_CUDA_KERNEL(
matmul, ops::MatMulKernel<paddle::platform::CUDADeviceContext, float>,
ops::MatMulKernel<paddle::platform::CUDADeviceContext, double>,
ops::MatMulKernel<paddle::platform::CUDADeviceContext,
paddle::platform::float16>);
REGISTER_OP_CUDA_KERNEL(
matmul_grad,
ops::MatMulGradKernel<paddle::platform::CUDADeviceContext, float>,
ops::MatMulGradKernel<paddle::platform::CUDADeviceContext, double>,
ops::MatMulGradKernel<paddle::platform::CUDADeviceContext,
paddle::platform::float16>);
REGISTER_OP_CUDA_KERNEL(
matmul_grad_grad,
ops::MatMulDoubleGradKernel<paddle::platform::CUDADeviceContext, float>,
ops::MatMulDoubleGradKernel<paddle::platform::CUDADeviceContext, double>);
#endif
REGISTER_OP_VERSION(matmul)
.AddCheckpoint(
R"ROC(Register matmul for adding the attribute of
fused_reshape_Y)ROC",
paddle::framework::compatible::OpVersionDesc().NewAttr(
"fused_reshape_Y",
"In order to support the function of fused the input Y "
" and input X into the input X when "
"using the operator of matmul, and get raw shape of input Y.",
std::vector<int>{}));
|
DATA
x 8*7,7*6,6*5,5*4
PROGRAM
#To treat something like an array, you need a register to hold
#the address of the beginning of the array and another register
#to hold the index. Here we treat x as an array. R2 will hold
#the address of x and R3 will hold the index.
imm R2 x
#start with the variable R6=0
imlo R6 0
#we will simulate the following:
#for(int R3=0,R3<25,R3++) {
imlo R3 0
#we will repeat our "for loop" 25 times. R4 will hold 25.
imlo R4 25
for sub SCR R4 R3
brzr pastfor
brng pastfor
#R5 will contain the address x[i]
add R5 R2 R3
load scr [r5]
#r6=r6+x[i]
add r6 r6 scr
#i=i+1
add r3 r3 one
jump for
pastfor write r6
halt
END
|
<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<asm version="1.0" name="0">
<cp>
<constant value="old2new"/>
<constant value="links"/>
<constant value="NTransientLinkSet;"/>
<constant value="col"/>
<constant value="J"/>
<constant value="main"/>
<constant value="A"/>
<constant value="OclParametrizedType"/>
<constant value="#native"/>
<constant value="Collection"/>
<constant value="J.setName(S):V"/>
<constant value="OclSimpleType"/>
<constant value="OclAny"/>
<constant value="J.setElementType(J):V"/>
<constant value="TransientLinkSet"/>
<constant value="A.__matcher__():V"/>
<constant value="A.__exec__():V"/>
<constant value="self"/>
<constant value="__resolve__"/>
<constant value="1"/>
<constant value="J.oclIsKindOf(J):B"/>
<constant value="18"/>
<constant value="NTransientLinkSet;.getLinkBySourceElement(S):QNTransientLink;"/>
<constant value="J.oclIsUndefined():B"/>
<constant value="15"/>
<constant value="NTransientLink;.getTargetFromSource(J):J"/>
<constant value="17"/>
<constant value="30"/>
<constant value="Sequence"/>
<constant value="2"/>
<constant value="A.__resolve__(J):J"/>
<constant value="QJ.including(J):QJ"/>
<constant value="QJ.flatten():QJ"/>
<constant value="e"/>
<constant value="value"/>
<constant value="resolveTemp"/>
<constant value="S"/>
<constant value="NTransientLink;.getNamedTargetFromSource(JS):J"/>
<constant value="name"/>
<constant value="__matcher__"/>
<constant value="A.__matchImportName():V"/>
<constant value="__exec__"/>
<constant value="ImportName"/>
<constant value="NTransientLinkSet;.getLinksByRule(S):QNTransientLink;"/>
<constant value="A.__applyImportName(NTransientLink;):V"/>
<constant value="Service2Utility"/>
<constant value="A.__applyService2Utility(NTransientLink;):V"/>
<constant value="ImportDevice"/>
<constant value="A.__applyImportDevice(NTransientLink;):V"/>
<constant value="ImportFarm"/>
<constant value="A.__applyImportFarm(NTransientLink;):V"/>
<constant value="ImportOldCrop"/>
<constant value="A.__applyImportOldCrop(NTransientLink;):V"/>
<constant value="OldFarmer2NewFarmer"/>
<constant value="A.__applyOldFarmer2NewFarmer(NTransientLink;):V"/>
<constant value="OldSystem2NewSystem"/>
<constant value="A.__applyOldSystem2NewSystem(NTransientLink;):V"/>
<constant value="OldGateway2NewGateway"/>
<constant value="A.__applyOldGateway2NewGateway(NTransientLink;):V"/>
<constant value="AnalyticsSystem2Analytics"/>
<constant value="A.__applyAnalyticsSystem2Analytics(NTransientLink;):V"/>
<constant value="ImportOldMonitoring"/>
<constant value="A.__applyImportOldMonitoring(NTransientLink;):V"/>
<constant value="ImportOldControlling"/>
<constant value="A.__applyImportOldControlling(NTransientLink;):V"/>
<constant value="OldSensor2NewSensor"/>
<constant value="A.__applyOldSensor2NewSensor(NTransientLink;):V"/>
<constant value="OldActuator2NewActuator"/>
<constant value="A.__applyOldActuator2NewActuator(NTransientLink;):V"/>
<constant value="firstDatabase"/>
<constant value="Database"/>
<constant value="NEW"/>
<constant value="J.allInstances():J"/>
<constant value="J.asSequence():J"/>
<constant value="J.first():J"/>
<constant value="9:51-9:63"/>
<constant value="9:51-9:78"/>
<constant value="9:51-9:92"/>
<constant value="9:51-9:101"/>
<constant value="isDatabaseAvailable"/>
<constant value="J.size():J"/>
<constant value="0"/>
<constant value="J.>(J):J"/>
<constant value="12:47-12:59"/>
<constant value="12:47-12:74"/>
<constant value="12:47-12:82"/>
<constant value="12:85-12:86"/>
<constant value="12:47-12:86"/>
<constant value="__matchImportName"/>
<constant value="Named"/>
<constant value="OLD"/>
<constant value="IN"/>
<constant value="MMOF!Classifier;.allInstancesFrom(S):QJ"/>
<constant value="Service"/>
<constant value="B.not():B"/>
<constant value="108"/>
<constant value="J.isDatabaseAvailable():J"/>
<constant value="IoTSystem"/>
<constant value="J.oclIsUndefined():J"/>
<constant value="J.not():J"/>
<constant value="J.and(J):J"/>
<constant value="AnalyticsSystem"/>
<constant value="51"/>
<constant value="TransientLink"/>
<constant value="NTransientLink;.setRule(MATL!Rule;):V"/>
<constant value="s"/>
<constant value="NTransientLink;.addSourceElement(SJ):V"/>
<constant value="t"/>
<constant value="Analytics"/>
<constant value="NTransientLink;.addTargetElement(SJ):V"/>
<constant value="NTransientLinkSet;.addLink2(NTransientLink;B):V"/>
<constant value="107"/>
<constant value="Monitoring"/>
<constant value="79"/>
<constant value="Controlling"/>
<constant value="342"/>
<constant value="Device"/>
<constant value="178"/>
<constant value="Sensor"/>
<constant value="149"/>
<constant value="177"/>
<constant value="Actuator"/>
<constant value="Crop"/>
<constant value="212"/>
<constant value="Farm"/>
<constant value="Farmer"/>
<constant value="246"/>
<constant value="Gateway"/>
<constant value="280"/>
<constant value="308"/>
<constant value="db"/>
<constant value="27:18-27:28"/>
<constant value="27:18-27:50"/>
<constant value="27:59-27:60"/>
<constant value="27:59-27:70"/>
<constant value="27:59-27:87"/>
<constant value="27:55-27:87"/>
<constant value="27:18-27:87"/>
<constant value="127:3-131:4"/>
<constant value="139:3-143:4"/>
<constant value="151:3-155:4"/>
<constant value="41:21-41:22"/>
<constant value="41:21-41:32"/>
<constant value="41:21-41:49"/>
<constant value="41:17-41:49"/>
<constant value="163:3-169:4"/>
<constant value="177:3-180:4"/>
<constant value="67:20-67:21"/>
<constant value="67:20-67:26"/>
<constant value="67:20-67:43"/>
<constant value="67:16-67:43"/>
<constant value="69:3-75:4"/>
<constant value="80:22-80:23"/>
<constant value="80:22-80:28"/>
<constant value="80:22-80:45"/>
<constant value="80:18-80:45"/>
<constant value="82:3-88:4"/>
<constant value="111:23-111:24"/>
<constant value="111:23-111:34"/>
<constant value="111:23-111:51"/>
<constant value="111:19-111:51"/>
<constant value="113:3-118:4"/>
<constant value="55:3-61:4"/>
<constant value="96:3-101:4"/>
<constant value="102:3-105:4"/>
<constant value="__applyImportFarm"/>
<constant value="NTransientLink;"/>
<constant value="NTransientLink;.getSourceElement(S):J"/>
<constant value="NTransientLink;.getTargetElement(S):J"/>
<constant value="3"/>
<constant value="Location"/>
<constant value="Size"/>
<constant value="Crops"/>
<constant value="Farmers"/>
<constant value="Name"/>
<constant value="56:16-56:17"/>
<constant value="56:16-56:26"/>
<constant value="56:4-56:26"/>
<constant value="57:12-57:13"/>
<constant value="57:12-57:18"/>
<constant value="57:4-57:18"/>
<constant value="58:13-58:14"/>
<constant value="58:13-58:20"/>
<constant value="58:4-58:20"/>
<constant value="59:15-59:16"/>
<constant value="59:15-59:24"/>
<constant value="59:4-59:24"/>
<constant value="60:17-60:18"/>
<constant value="60:17-60:28"/>
<constant value="60:4-60:28"/>
<constant value="20:12-20:13"/>
<constant value="20:12-20:18"/>
<constant value="20:4-20:18"/>
<constant value="link"/>
<constant value="__applyImportOldCrop"/>
<constant value="CropGroup"/>
<constant value="GrowthDuration"/>
<constant value="SeedCode"/>
<constant value="70:12-70:13"/>
<constant value="70:12-70:18"/>
<constant value="70:4-70:18"/>
<constant value="71:17-71:18"/>
<constant value="71:17-71:28"/>
<constant value="71:4-71:28"/>
<constant value="72:22-72:23"/>
<constant value="72:22-72:38"/>
<constant value="72:4-72:38"/>
<constant value="73:16-73:17"/>
<constant value="73:16-73:26"/>
<constant value="73:4-73:26"/>
<constant value="74:12-74:13"/>
<constant value="74:12-74:18"/>
<constant value="74:4-74:18"/>
<constant value="__applyOldFarmer2NewFarmer"/>
<constant value="FarmerID"/>
<constant value="Email"/>
<constant value="PhoneNumber"/>
<constant value="Services"/>
<constant value="Utilities"/>
<constant value="83:16-83:17"/>
<constant value="83:16-83:26"/>
<constant value="83:4-83:26"/>
<constant value="84:13-84:14"/>
<constant value="84:13-84:20"/>
<constant value="84:4-84:20"/>
<constant value="85:19-85:20"/>
<constant value="85:19-85:32"/>
<constant value="85:4-85:32"/>
<constant value="86:12-86:13"/>
<constant value="86:12-86:18"/>
<constant value="86:4-86:18"/>
<constant value="87:17-87:18"/>
<constant value="87:17-87:27"/>
<constant value="87:4-87:27"/>
<constant value="__applyOldSystem2NewSystem"/>
<constant value="4"/>
<constant value="Version"/>
<constant value="Gateways"/>
<constant value="CJ.including(J):CJ"/>
<constant value="Databases"/>
<constant value="DB_"/>
<constant value="J.+(J):J"/>
<constant value="DatabaseID"/>
<constant value="97:15-97:16"/>
<constant value="97:15-97:24"/>
<constant value="97:4-97:24"/>
<constant value="98:17-98:18"/>
<constant value="98:17-98:27"/>
<constant value="98:4-98:27"/>
<constant value="99:16-99:17"/>
<constant value="99:16-99:26"/>
<constant value="99:4-99:26"/>
<constant value="100:26-100:28"/>
<constant value="100:17-100:29"/>
<constant value="100:4-100:29"/>
<constant value="103:13-103:14"/>
<constant value="103:13-103:19"/>
<constant value="103:4-103:19"/>
<constant value="104:18-104:23"/>
<constant value="104:26-104:27"/>
<constant value="104:26-104:32"/>
<constant value="104:18-104:32"/>
<constant value="104:4-104:32"/>
<constant value="__applyOldGateway2NewGateway"/>
<constant value="GatewayID"/>
<constant value="Model"/>
<constant value="Devices"/>
<constant value="114:17-114:18"/>
<constant value="114:17-114:28"/>
<constant value="114:4-114:28"/>
<constant value="115:13-115:14"/>
<constant value="115:13-115:20"/>
<constant value="115:4-115:20"/>
<constant value="116:17-116:18"/>
<constant value="116:17-116:28"/>
<constant value="116:4-116:28"/>
<constant value="117:15-117:16"/>
<constant value="117:15-117:24"/>
<constant value="117:4-117:24"/>
<constant value="__applyAnalyticsSystem2Analytics"/>
<constant value="AnalyticsType"/>
<constant value="DataSource"/>
<constant value="OutputType"/>
<constant value="ServiceID"/>
<constant value="UtilityID"/>
<constant value="Host"/>
<constant value="URI"/>
<constant value="J.firstDatabase():J"/>
<constant value="128:21-128:22"/>
<constant value="128:21-128:36"/>
<constant value="128:4-128:36"/>
<constant value="129:18-129:19"/>
<constant value="129:18-129:30"/>
<constant value="129:4-129:30"/>
<constant value="130:18-130:19"/>
<constant value="130:18-130:30"/>
<constant value="130:4-130:30"/>
<constant value="30:17-30:18"/>
<constant value="30:17-30:28"/>
<constant value="30:4-30:28"/>
<constant value="31:12-31:13"/>
<constant value="31:12-31:18"/>
<constant value="31:4-31:18"/>
<constant value="32:11-32:12"/>
<constant value="32:11-32:16"/>
<constant value="32:4-32:16"/>
<constant value="33:17-33:18"/>
<constant value="33:17-33:28"/>
<constant value="33:4-33:28"/>
<constant value="34:17-34:27"/>
<constant value="34:17-34:43"/>
<constant value="34:4-34:43"/>
<constant value="__applyImportOldMonitoring"/>
<constant value="Metrics"/>
<constant value="Sensors"/>
<constant value="Control"/>
<constant value="140:15-140:16"/>
<constant value="140:15-140:24"/>
<constant value="140:4-140:24"/>
<constant value="141:15-141:16"/>
<constant value="141:15-141:24"/>
<constant value="141:4-141:24"/>
<constant value="142:15-142:16"/>
<constant value="142:15-142:24"/>
<constant value="142:4-142:24"/>
<constant value="__applyImportOldControlling"/>
<constant value="ControlType"/>
<constant value="Action"/>
<constant value="Actuators"/>
<constant value="152:19-152:20"/>
<constant value="152:19-152:32"/>
<constant value="152:4-152:32"/>
<constant value="153:14-153:15"/>
<constant value="153:14-153:22"/>
<constant value="153:4-153:22"/>
<constant value="154:17-154:18"/>
<constant value="154:17-154:28"/>
<constant value="154:4-154:28"/>
<constant value="__applyOldSensor2NewSensor"/>
<constant value="Type"/>
<constant value="State"/>
<constant value="Unit"/>
<constant value="Value"/>
<constant value="Protocol"/>
<constant value="DeviceID"/>
<constant value="Manufacturer"/>
<constant value="IPAddress"/>
<constant value="164:12-164:13"/>
<constant value="164:12-164:18"/>
<constant value="164:4-164:18"/>
<constant value="165:13-165:14"/>
<constant value="165:13-165:20"/>
<constant value="165:4-165:20"/>
<constant value="166:12-166:13"/>
<constant value="166:12-166:18"/>
<constant value="166:4-166:18"/>
<constant value="167:13-167:14"/>
<constant value="167:13-167:20"/>
<constant value="167:4-167:20"/>
<constant value="168:16-168:17"/>
<constant value="168:16-168:26"/>
<constant value="168:16-168:31"/>
<constant value="168:4-168:31"/>
<constant value="44:16-44:17"/>
<constant value="44:16-44:26"/>
<constant value="44:4-44:26"/>
<constant value="45:20-45:21"/>
<constant value="45:20-45:34"/>
<constant value="45:4-45:34"/>
<constant value="46:17-46:18"/>
<constant value="46:17-46:28"/>
<constant value="46:4-46:28"/>
<constant value="__applyOldActuator2NewActuator"/>
<constant value="178:12-178:13"/>
<constant value="178:12-178:18"/>
<constant value="178:4-178:18"/>
<constant value="179:16-179:17"/>
<constant value="179:16-179:26"/>
<constant value="179:16-179:31"/>
<constant value="179:4-179:31"/>
</cp>
<field name="1" type="2"/>
<field name="3" type="4"/>
<operation name="5">
<context type="6"/>
<parameters>
</parameters>
<code>
<getasm/>
<push arg="7"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="9"/>
<pcall arg="10"/>
<dup/>
<push arg="11"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="12"/>
<pcall arg="10"/>
<pcall arg="13"/>
<set arg="3"/>
<getasm/>
<push arg="14"/>
<push arg="8"/>
<new/>
<set arg="1"/>
<getasm/>
<pcall arg="15"/>
<getasm/>
<pcall arg="16"/>
</code>
<linenumbertable>
</linenumbertable>
<localvariabletable>
<lve slot="0" name="17" begin="0" end="24"/>
</localvariabletable>
</operation>
<operation name="18">
<context type="6"/>
<parameters>
<parameter name="19" type="4"/>
</parameters>
<code>
<load arg="19"/>
<getasm/>
<get arg="3"/>
<call arg="20"/>
<if arg="21"/>
<getasm/>
<get arg="1"/>
<load arg="19"/>
<call arg="22"/>
<dup/>
<call arg="23"/>
<if arg="24"/>
<load arg="19"/>
<call arg="25"/>
<goto arg="26"/>
<pop/>
<load arg="19"/>
<goto arg="27"/>
<push arg="28"/>
<push arg="8"/>
<new/>
<load arg="19"/>
<iterate/>
<store arg="29"/>
<getasm/>
<load arg="29"/>
<call arg="30"/>
<call arg="31"/>
<enditerate/>
<call arg="32"/>
</code>
<linenumbertable>
</linenumbertable>
<localvariabletable>
<lve slot="2" name="33" begin="23" end="27"/>
<lve slot="0" name="17" begin="0" end="29"/>
<lve slot="1" name="34" begin="0" end="29"/>
</localvariabletable>
</operation>
<operation name="35">
<context type="6"/>
<parameters>
<parameter name="19" type="4"/>
<parameter name="29" type="36"/>
</parameters>
<code>
<getasm/>
<get arg="1"/>
<load arg="19"/>
<call arg="22"/>
<load arg="19"/>
<load arg="29"/>
<call arg="37"/>
</code>
<linenumbertable>
</linenumbertable>
<localvariabletable>
<lve slot="0" name="17" begin="0" end="6"/>
<lve slot="1" name="34" begin="0" end="6"/>
<lve slot="2" name="38" begin="0" end="6"/>
</localvariabletable>
</operation>
<operation name="39">
<context type="6"/>
<parameters>
</parameters>
<code>
<getasm/>
<pcall arg="40"/>
</code>
<linenumbertable>
</linenumbertable>
<localvariabletable>
<lve slot="0" name="17" begin="0" end="1"/>
</localvariabletable>
</operation>
<operation name="41">
<context type="6"/>
<parameters>
</parameters>
<code>
<getasm/>
<get arg="1"/>
<push arg="42"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="44"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="45"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="46"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="47"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="48"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="49"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="50"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="51"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="52"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="53"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="54"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="55"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="56"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="57"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="58"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="59"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="60"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="61"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="62"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="63"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="64"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="65"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="66"/>
<enditerate/>
<getasm/>
<get arg="1"/>
<push arg="67"/>
<call arg="43"/>
<iterate/>
<store arg="19"/>
<getasm/>
<load arg="19"/>
<pcall arg="68"/>
<enditerate/>
</code>
<linenumbertable>
</linenumbertable>
<localvariabletable>
<lve slot="1" name="33" begin="5" end="8"/>
<lve slot="1" name="33" begin="15" end="18"/>
<lve slot="1" name="33" begin="25" end="28"/>
<lve slot="1" name="33" begin="35" end="38"/>
<lve slot="1" name="33" begin="45" end="48"/>
<lve slot="1" name="33" begin="55" end="58"/>
<lve slot="1" name="33" begin="65" end="68"/>
<lve slot="1" name="33" begin="75" end="78"/>
<lve slot="1" name="33" begin="85" end="88"/>
<lve slot="1" name="33" begin="95" end="98"/>
<lve slot="1" name="33" begin="105" end="108"/>
<lve slot="1" name="33" begin="115" end="118"/>
<lve slot="1" name="33" begin="125" end="128"/>
<lve slot="0" name="17" begin="0" end="129"/>
</localvariabletable>
</operation>
<operation name="69">
<context type="6"/>
<parameters>
</parameters>
<code>
<push arg="70"/>
<push arg="71"/>
<findme/>
<call arg="72"/>
<call arg="73"/>
<call arg="74"/>
</code>
<linenumbertable>
<lne id="75" begin="0" end="2"/>
<lne id="76" begin="0" end="3"/>
<lne id="77" begin="0" end="4"/>
<lne id="78" begin="0" end="5"/>
</linenumbertable>
<localvariabletable>
<lve slot="0" name="17" begin="0" end="5"/>
</localvariabletable>
</operation>
<operation name="79">
<context type="6"/>
<parameters>
</parameters>
<code>
<push arg="70"/>
<push arg="71"/>
<findme/>
<call arg="72"/>
<call arg="80"/>
<pushi arg="81"/>
<call arg="82"/>
</code>
<linenumbertable>
<lne id="83" begin="0" end="2"/>
<lne id="84" begin="0" end="3"/>
<lne id="85" begin="0" end="4"/>
<lne id="86" begin="5" end="5"/>
<lne id="87" begin="0" end="6"/>
</linenumbertable>
<localvariabletable>
<lve slot="0" name="17" begin="0" end="6"/>
</localvariabletable>
</operation>
<operation name="88">
<context type="6"/>
<parameters>
</parameters>
<code>
<push arg="89"/>
<push arg="90"/>
<findme/>
<push arg="91"/>
<call arg="92"/>
<iterate/>
<store arg="19"/>
<load arg="19"/>
<push arg="93"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="95"/>
<getasm/>
<call arg="96"/>
<load arg="19"/>
<get arg="97"/>
<call arg="98"/>
<call arg="99"/>
<call arg="100"/>
<call arg="94"/>
<if arg="95"/>
<load arg="19"/>
<push arg="101"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="102"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="59"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="108"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="111"/>
<load arg="19"/>
<push arg="112"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="113"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="61"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="112"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="111"/>
<load arg="19"/>
<push arg="114"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="111"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="63"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="114"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="111"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="116"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="117"/>
<load arg="19"/>
<get arg="97"/>
<call arg="98"/>
<call arg="99"/>
<call arg="94"/>
<if arg="117"/>
<load arg="19"/>
<push arg="118"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="119"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="65"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="118"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="120"/>
<load arg="19"/>
<push arg="121"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="120"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="67"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="121"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="120"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="122"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="123"/>
<load arg="19"/>
<get arg="124"/>
<call arg="98"/>
<call arg="99"/>
<call arg="94"/>
<if arg="123"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="51"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="122"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="125"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="126"/>
<load arg="19"/>
<get arg="124"/>
<call arg="98"/>
<call arg="99"/>
<call arg="94"/>
<if arg="126"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="53"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="125"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="127"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="128"/>
<load arg="19"/>
<get arg="97"/>
<call arg="98"/>
<call arg="99"/>
<call arg="94"/>
<if arg="128"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="57"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="127"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="124"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="129"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="49"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="124"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="115"/>
<load arg="19"/>
<push arg="97"/>
<push arg="90"/>
<findme/>
<call arg="20"/>
<call arg="94"/>
<if arg="115"/>
<getasm/>
<get arg="1"/>
<push arg="103"/>
<push arg="8"/>
<new/>
<dup/>
<push arg="55"/>
<pcall arg="104"/>
<dup/>
<push arg="105"/>
<load arg="19"/>
<pcall arg="106"/>
<dup/>
<push arg="107"/>
<push arg="97"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<dup/>
<push arg="130"/>
<push arg="70"/>
<push arg="71"/>
<new/>
<pcall arg="109"/>
<pusht/>
<pcall arg="110"/>
<goto arg="115"/>
<enditerate/>
</code>
<linenumbertable>
<lne id="131" begin="14" end="14"/>
<lne id="132" begin="14" end="15"/>
<lne id="133" begin="16" end="16"/>
<lne id="134" begin="16" end="17"/>
<lne id="135" begin="16" end="18"/>
<lne id="136" begin="16" end="19"/>
<lne id="137" begin="14" end="20"/>
<lne id="138" begin="42" end="47"/>
<lne id="139" begin="70" end="75"/>
<lne id="140" begin="98" end="103"/>
<lne id="141" begin="115" end="115"/>
<lne id="142" begin="115" end="116"/>
<lne id="143" begin="115" end="117"/>
<lne id="144" begin="115" end="118"/>
<lne id="145" begin="140" end="145"/>
<lne id="146" begin="168" end="173"/>
<lne id="147" begin="185" end="185"/>
<lne id="148" begin="185" end="186"/>
<lne id="149" begin="185" end="187"/>
<lne id="150" begin="185" end="188"/>
<lne id="151" begin="203" end="208"/>
<lne id="152" begin="219" end="219"/>
<lne id="153" begin="219" end="220"/>
<lne id="154" begin="219" end="221"/>
<lne id="155" begin="219" end="222"/>
<lne id="156" begin="237" end="242"/>
<lne id="157" begin="253" end="253"/>
<lne id="158" begin="253" end="254"/>
<lne id="159" begin="253" end="255"/>
<lne id="160" begin="253" end="256"/>
<lne id="161" begin="271" end="276"/>
<lne id="162" begin="299" end="304"/>
<lne id="163" begin="327" end="332"/>
<lne id="164" begin="333" end="338"/>
</linenumbertable>
<localvariabletable>
<lve slot="1" name="105" begin="6" end="341"/>
<lve slot="0" name="17" begin="0" end="342"/>
</localvariabletable>
</operation>
<operation name="165">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="170"/>
<call arg="30"/>
<set arg="170"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="171"/>
<call arg="30"/>
<set arg="171"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="172"/>
<call arg="30"/>
<set arg="172"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="173"/>
<call arg="30"/>
<set arg="173"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="97"/>
<call arg="30"/>
<set arg="97"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="175" begin="11" end="11"/>
<lne id="176" begin="11" end="12"/>
<lne id="177" begin="9" end="14"/>
<lne id="178" begin="17" end="17"/>
<lne id="179" begin="17" end="18"/>
<lne id="180" begin="15" end="20"/>
<lne id="181" begin="23" end="23"/>
<lne id="182" begin="23" end="24"/>
<lne id="183" begin="21" end="26"/>
<lne id="184" begin="29" end="29"/>
<lne id="185" begin="29" end="30"/>
<lne id="186" begin="27" end="32"/>
<lne id="187" begin="35" end="35"/>
<lne id="188" begin="35" end="36"/>
<lne id="189" begin="33" end="38"/>
<lne id="190" begin="41" end="41"/>
<lne id="191" begin="41" end="42"/>
<lne id="192" begin="39" end="44"/>
<lne id="162" begin="8" end="45"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="45"/>
<lve slot="2" name="105" begin="3" end="45"/>
<lve slot="0" name="17" begin="0" end="45"/>
<lve slot="1" name="193" begin="0" end="45"/>
</localvariabletable>
</operation>
<operation name="194">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="195"/>
<call arg="30"/>
<set arg="195"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="196"/>
<call arg="30"/>
<set arg="196"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="197"/>
<call arg="30"/>
<set arg="197"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="124"/>
<call arg="30"/>
<set arg="124"/>
<pop/>
</code>
<linenumbertable>
<lne id="198" begin="11" end="11"/>
<lne id="199" begin="11" end="12"/>
<lne id="200" begin="9" end="14"/>
<lne id="201" begin="17" end="17"/>
<lne id="202" begin="17" end="18"/>
<lne id="203" begin="15" end="20"/>
<lne id="204" begin="23" end="23"/>
<lne id="205" begin="23" end="24"/>
<lne id="206" begin="21" end="26"/>
<lne id="207" begin="29" end="29"/>
<lne id="208" begin="29" end="30"/>
<lne id="209" begin="27" end="32"/>
<lne id="210" begin="35" end="35"/>
<lne id="211" begin="35" end="36"/>
<lne id="212" begin="33" end="38"/>
<lne id="151" begin="8" end="39"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="39"/>
<lve slot="2" name="105" begin="3" end="39"/>
<lve slot="0" name="17" begin="0" end="39"/>
<lve slot="1" name="193" begin="0" end="39"/>
</localvariabletable>
</operation>
<operation name="213">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="214"/>
<call arg="30"/>
<set arg="214"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="215"/>
<call arg="30"/>
<set arg="215"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="216"/>
<call arg="30"/>
<set arg="216"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="124"/>
<call arg="30"/>
<set arg="124"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="217"/>
<call arg="30"/>
<set arg="218"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="219" begin="11" end="11"/>
<lne id="220" begin="11" end="12"/>
<lne id="221" begin="9" end="14"/>
<lne id="222" begin="17" end="17"/>
<lne id="223" begin="17" end="18"/>
<lne id="224" begin="15" end="20"/>
<lne id="225" begin="23" end="23"/>
<lne id="226" begin="23" end="24"/>
<lne id="227" begin="21" end="26"/>
<lne id="228" begin="29" end="29"/>
<lne id="229" begin="29" end="30"/>
<lne id="230" begin="27" end="32"/>
<lne id="231" begin="35" end="35"/>
<lne id="232" begin="35" end="36"/>
<lne id="233" begin="33" end="38"/>
<lne id="190" begin="41" end="41"/>
<lne id="191" begin="41" end="42"/>
<lne id="192" begin="39" end="44"/>
<lne id="156" begin="8" end="45"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="45"/>
<lve slot="2" name="105" begin="3" end="45"/>
<lve slot="0" name="17" begin="0" end="45"/>
<lve slot="1" name="193" begin="0" end="45"/>
</localvariabletable>
</operation>
<operation name="234">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="19"/>
<push arg="130"/>
<call arg="168"/>
<store arg="235"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="236"/>
<call arg="30"/>
<set arg="236"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="217"/>
<call arg="30"/>
<set arg="218"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="237"/>
<call arg="30"/>
<set arg="237"/>
<dup/>
<getasm/>
<push arg="28"/>
<push arg="8"/>
<new/>
<load arg="235"/>
<call arg="238"/>
<call arg="30"/>
<set arg="239"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
<load arg="235"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<dup/>
<getasm/>
<push arg="240"/>
<load arg="29"/>
<get arg="174"/>
<call arg="241"/>
<call arg="30"/>
<set arg="242"/>
<pop/>
</code>
<linenumbertable>
<lne id="243" begin="15" end="15"/>
<lne id="244" begin="15" end="16"/>
<lne id="245" begin="13" end="18"/>
<lne id="246" begin="21" end="21"/>
<lne id="247" begin="21" end="22"/>
<lne id="248" begin="19" end="24"/>
<lne id="249" begin="27" end="27"/>
<lne id="250" begin="27" end="28"/>
<lne id="251" begin="25" end="30"/>
<lne id="252" begin="36" end="36"/>
<lne id="253" begin="33" end="37"/>
<lne id="254" begin="31" end="39"/>
<lne id="190" begin="42" end="42"/>
<lne id="191" begin="42" end="43"/>
<lne id="192" begin="40" end="45"/>
<lne id="163" begin="12" end="46"/>
<lne id="255" begin="50" end="50"/>
<lne id="256" begin="50" end="51"/>
<lne id="257" begin="48" end="53"/>
<lne id="258" begin="56" end="56"/>
<lne id="259" begin="57" end="57"/>
<lne id="260" begin="57" end="58"/>
<lne id="261" begin="56" end="59"/>
<lne id="262" begin="54" end="61"/>
<lne id="164" begin="47" end="62"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="62"/>
<lve slot="4" name="130" begin="11" end="62"/>
<lve slot="2" name="105" begin="3" end="62"/>
<lve slot="0" name="17" begin="0" end="62"/>
<lve slot="1" name="193" begin="0" end="62"/>
</localvariabletable>
</operation>
<operation name="263">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="264"/>
<call arg="30"/>
<set arg="264"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="265"/>
<call arg="30"/>
<set arg="265"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="97"/>
<call arg="30"/>
<set arg="97"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="266"/>
<call arg="30"/>
<set arg="266"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="267" begin="11" end="11"/>
<lne id="268" begin="11" end="12"/>
<lne id="269" begin="9" end="14"/>
<lne id="270" begin="17" end="17"/>
<lne id="271" begin="17" end="18"/>
<lne id="272" begin="15" end="20"/>
<lne id="273" begin="23" end="23"/>
<lne id="274" begin="23" end="24"/>
<lne id="275" begin="21" end="26"/>
<lne id="276" begin="29" end="29"/>
<lne id="277" begin="29" end="30"/>
<lne id="278" begin="27" end="32"/>
<lne id="190" begin="35" end="35"/>
<lne id="191" begin="35" end="36"/>
<lne id="192" begin="33" end="38"/>
<lne id="161" begin="8" end="39"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="39"/>
<lve slot="2" name="105" begin="3" end="39"/>
<lve slot="0" name="17" begin="0" end="39"/>
<lve slot="1" name="193" begin="0" end="39"/>
</localvariabletable>
</operation>
<operation name="279">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="280"/>
<call arg="30"/>
<set arg="280"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="281"/>
<call arg="30"/>
<set arg="281"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="282"/>
<call arg="30"/>
<set arg="282"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="283"/>
<call arg="30"/>
<set arg="284"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="285"/>
<call arg="30"/>
<set arg="285"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="286"/>
<call arg="30"/>
<set arg="286"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="97"/>
<call arg="30"/>
<set arg="97"/>
<dup/>
<getasm/>
<getasm/>
<call arg="287"/>
<call arg="30"/>
<set arg="239"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="288" begin="11" end="11"/>
<lne id="289" begin="11" end="12"/>
<lne id="290" begin="9" end="14"/>
<lne id="291" begin="17" end="17"/>
<lne id="292" begin="17" end="18"/>
<lne id="293" begin="15" end="20"/>
<lne id="294" begin="23" end="23"/>
<lne id="295" begin="23" end="24"/>
<lne id="296" begin="21" end="26"/>
<lne id="297" begin="29" end="29"/>
<lne id="298" begin="29" end="30"/>
<lne id="299" begin="27" end="32"/>
<lne id="300" begin="35" end="35"/>
<lne id="301" begin="35" end="36"/>
<lne id="302" begin="33" end="38"/>
<lne id="303" begin="41" end="41"/>
<lne id="304" begin="41" end="42"/>
<lne id="305" begin="39" end="44"/>
<lne id="306" begin="47" end="47"/>
<lne id="307" begin="47" end="48"/>
<lne id="308" begin="45" end="50"/>
<lne id="309" begin="53" end="53"/>
<lne id="310" begin="53" end="54"/>
<lne id="311" begin="51" end="56"/>
<lne id="190" begin="59" end="59"/>
<lne id="191" begin="59" end="60"/>
<lne id="192" begin="57" end="62"/>
<lne id="138" begin="8" end="63"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="63"/>
<lve slot="2" name="105" begin="3" end="63"/>
<lve slot="0" name="17" begin="0" end="63"/>
<lve slot="1" name="193" begin="0" end="63"/>
</localvariabletable>
</operation>
<operation name="312">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="313"/>
<call arg="30"/>
<set arg="313"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="314"/>
<call arg="30"/>
<set arg="314"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="315"/>
<call arg="30"/>
<set arg="315"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="283"/>
<call arg="30"/>
<set arg="284"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="285"/>
<call arg="30"/>
<set arg="285"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="286"/>
<call arg="30"/>
<set arg="286"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="97"/>
<call arg="30"/>
<set arg="97"/>
<dup/>
<getasm/>
<getasm/>
<call arg="287"/>
<call arg="30"/>
<set arg="239"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="316" begin="11" end="11"/>
<lne id="317" begin="11" end="12"/>
<lne id="318" begin="9" end="14"/>
<lne id="319" begin="17" end="17"/>
<lne id="320" begin="17" end="18"/>
<lne id="321" begin="15" end="20"/>
<lne id="322" begin="23" end="23"/>
<lne id="323" begin="23" end="24"/>
<lne id="324" begin="21" end="26"/>
<lne id="297" begin="29" end="29"/>
<lne id="298" begin="29" end="30"/>
<lne id="299" begin="27" end="32"/>
<lne id="300" begin="35" end="35"/>
<lne id="301" begin="35" end="36"/>
<lne id="302" begin="33" end="38"/>
<lne id="303" begin="41" end="41"/>
<lne id="304" begin="41" end="42"/>
<lne id="305" begin="39" end="44"/>
<lne id="306" begin="47" end="47"/>
<lne id="307" begin="47" end="48"/>
<lne id="308" begin="45" end="50"/>
<lne id="309" begin="53" end="53"/>
<lne id="310" begin="53" end="54"/>
<lne id="311" begin="51" end="56"/>
<lne id="190" begin="59" end="59"/>
<lne id="191" begin="59" end="60"/>
<lne id="192" begin="57" end="62"/>
<lne id="139" begin="8" end="63"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="63"/>
<lve slot="2" name="105" begin="3" end="63"/>
<lve slot="0" name="17" begin="0" end="63"/>
<lve slot="1" name="193" begin="0" end="63"/>
</localvariabletable>
</operation>
<operation name="325">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="326"/>
<call arg="30"/>
<set arg="326"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="327"/>
<call arg="30"/>
<set arg="327"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="328"/>
<call arg="30"/>
<set arg="328"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="283"/>
<call arg="30"/>
<set arg="284"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="285"/>
<call arg="30"/>
<set arg="285"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="286"/>
<call arg="30"/>
<set arg="286"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="97"/>
<call arg="30"/>
<set arg="97"/>
<dup/>
<getasm/>
<getasm/>
<call arg="287"/>
<call arg="30"/>
<set arg="239"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="329" begin="11" end="11"/>
<lne id="330" begin="11" end="12"/>
<lne id="331" begin="9" end="14"/>
<lne id="332" begin="17" end="17"/>
<lne id="333" begin="17" end="18"/>
<lne id="334" begin="15" end="20"/>
<lne id="335" begin="23" end="23"/>
<lne id="336" begin="23" end="24"/>
<lne id="337" begin="21" end="26"/>
<lne id="297" begin="29" end="29"/>
<lne id="298" begin="29" end="30"/>
<lne id="299" begin="27" end="32"/>
<lne id="300" begin="35" end="35"/>
<lne id="301" begin="35" end="36"/>
<lne id="302" begin="33" end="38"/>
<lne id="303" begin="41" end="41"/>
<lne id="304" begin="41" end="42"/>
<lne id="305" begin="39" end="44"/>
<lne id="306" begin="47" end="47"/>
<lne id="307" begin="47" end="48"/>
<lne id="308" begin="45" end="50"/>
<lne id="309" begin="53" end="53"/>
<lne id="310" begin="53" end="54"/>
<lne id="311" begin="51" end="56"/>
<lne id="190" begin="59" end="59"/>
<lne id="191" begin="59" end="60"/>
<lne id="192" begin="57" end="62"/>
<lne id="140" begin="8" end="63"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="63"/>
<lve slot="2" name="105" begin="3" end="63"/>
<lve slot="0" name="17" begin="0" end="63"/>
<lve slot="1" name="193" begin="0" end="63"/>
</localvariabletable>
</operation>
<operation name="338">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="339"/>
<call arg="30"/>
<set arg="339"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="340"/>
<call arg="30"/>
<set arg="340"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="341"/>
<call arg="30"/>
<set arg="341"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="342"/>
<call arg="30"/>
<set arg="342"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="343"/>
<get arg="339"/>
<call arg="30"/>
<set arg="343"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="344"/>
<call arg="30"/>
<set arg="344"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="345"/>
<call arg="30"/>
<set arg="345"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="346"/>
<call arg="30"/>
<set arg="346"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="347" begin="11" end="11"/>
<lne id="348" begin="11" end="12"/>
<lne id="349" begin="9" end="14"/>
<lne id="350" begin="17" end="17"/>
<lne id="351" begin="17" end="18"/>
<lne id="352" begin="15" end="20"/>
<lne id="353" begin="23" end="23"/>
<lne id="354" begin="23" end="24"/>
<lne id="355" begin="21" end="26"/>
<lne id="356" begin="29" end="29"/>
<lne id="357" begin="29" end="30"/>
<lne id="358" begin="27" end="32"/>
<lne id="359" begin="35" end="35"/>
<lne id="360" begin="35" end="36"/>
<lne id="361" begin="35" end="37"/>
<lne id="362" begin="33" end="39"/>
<lne id="363" begin="42" end="42"/>
<lne id="364" begin="42" end="43"/>
<lne id="365" begin="40" end="45"/>
<lne id="366" begin="48" end="48"/>
<lne id="367" begin="48" end="49"/>
<lne id="368" begin="46" end="51"/>
<lne id="369" begin="54" end="54"/>
<lne id="370" begin="54" end="55"/>
<lne id="371" begin="52" end="57"/>
<lne id="190" begin="60" end="60"/>
<lne id="191" begin="60" end="61"/>
<lne id="192" begin="58" end="63"/>
<lne id="145" begin="8" end="64"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="64"/>
<lve slot="2" name="105" begin="3" end="64"/>
<lve slot="0" name="17" begin="0" end="64"/>
<lve slot="1" name="193" begin="0" end="64"/>
</localvariabletable>
</operation>
<operation name="372">
<context type="6"/>
<parameters>
<parameter name="19" type="166"/>
</parameters>
<code>
<load arg="19"/>
<push arg="105"/>
<call arg="167"/>
<store arg="29"/>
<load arg="19"/>
<push arg="107"/>
<call arg="168"/>
<store arg="169"/>
<load arg="169"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="339"/>
<call arg="30"/>
<set arg="339"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="343"/>
<get arg="339"/>
<call arg="30"/>
<set arg="343"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="344"/>
<call arg="30"/>
<set arg="344"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="345"/>
<call arg="30"/>
<set arg="345"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="346"/>
<call arg="30"/>
<set arg="346"/>
<dup/>
<getasm/>
<load arg="29"/>
<get arg="174"/>
<call arg="30"/>
<set arg="174"/>
<pop/>
</code>
<linenumbertable>
<lne id="373" begin="11" end="11"/>
<lne id="374" begin="11" end="12"/>
<lne id="375" begin="9" end="14"/>
<lne id="376" begin="17" end="17"/>
<lne id="377" begin="17" end="18"/>
<lne id="378" begin="17" end="19"/>
<lne id="379" begin="15" end="21"/>
<lne id="363" begin="24" end="24"/>
<lne id="364" begin="24" end="25"/>
<lne id="365" begin="22" end="27"/>
<lne id="366" begin="30" end="30"/>
<lne id="367" begin="30" end="31"/>
<lne id="368" begin="28" end="33"/>
<lne id="369" begin="36" end="36"/>
<lne id="370" begin="36" end="37"/>
<lne id="371" begin="34" end="39"/>
<lne id="190" begin="42" end="42"/>
<lne id="191" begin="42" end="43"/>
<lne id="192" begin="40" end="45"/>
<lne id="146" begin="8" end="46"/>
</linenumbertable>
<localvariabletable>
<lve slot="3" name="107" begin="7" end="46"/>
<lve slot="2" name="105" begin="3" end="46"/>
<lve slot="0" name="17" begin="0" end="46"/>
<lve slot="1" name="193" begin="0" end="46"/>
</localvariabletable>
</operation>
</asm>
|
#include "encoders.h"
#include "uri.h"
#include <cereal/archives/json.hpp>
#include <cereal/archives/xml.hpp>
#include <codecvt>
#include <iostream>
#include <locale>
#include <string>
namespace coda {
namespace net {
namespace encoding {
void url::encode(const input::map &from, encoded_type &to) const {
std::ostringstream buf;
for (auto it = from.begin(); it != from.end(); ++it) {
buf << it->first;
buf << "=";
buf << it->second;
if (std::next(it) != from.end()) {
buf << "&";
}
}
to = uri::encode(buf.str());
}
void url::encode(const input::str &from, encoded_type &to) const {
to = uri::encode(from);
}
void url::decode(const encoded_type &from, input::str &to) const {
to = uri::decode(from);
}
void url::decode(const encoded_type &from, input::map &to) const {
std::string::size_type pos = from.find('=');
std::string::size_type last_pos = 0;
while (pos != std::string::npos) {
std::string key;
std::string value;
// parse the key
key = from.substr(last_pos, pos);
last_pos = from.find('&', pos);
// parse the value
value = from.substr(pos + 1, last_pos);
to[key] = value;
// find next
pos = from.find('=', last_pos);
}
}
void json::encode(const input::map &from, encoded_type &to) const {
std::ostringstream buf;
cereal::JSONOutputArchive archive(buf);
for (auto &pair : from) {
archive << cereal::make_nvp(pair.first, pair.second);
}
to = buf.str();
}
void json::encode(const input::str &from, encoded_type &to) const {
// TODO: don't assume its a json string
to = from;
}
void json::decode(const encoded_type &from, input::map &to) const {
std::istringstream buf(from);
cereal::JSONInputArchive archive(buf);
auto namePtr = archive.getNodeName();
while (namePtr) {
std::string key = namePtr;
std::string value;
archive(value);
to.emplace(std::move(key), std::move(value));
namePtr = archive.getNodeName();
}
}
void json::decode(const encoded_type &from, input::str &to) const {
// TODO: don't assume its just a string
to = from;
}
void xml::encode(const input::map &from, encoded_type &to) const {
std::ostringstream buf;
cereal::XMLOutputArchive archive(buf);
for (auto &pair : from) {
archive << cereal::make_nvp(pair.first, pair.second);
}
to = buf.str();
}
void xml::encode(const input::str &from, encoded_type &to) const {
// TODO: don't assume its an xml string
to = from;
}
void xml::decode(const encoded_type &from, input::map &to) const {
std::istringstream buf(from);
cereal::XMLInputArchive archive(buf);
auto namePtr = archive.getNodeName();
while (namePtr) {
std::string key = namePtr;
std::string value;
archive(value);
to.emplace(std::move(key), std::move(value));
namePtr = archive.getNodeName();
}
}
void xml::decode(const encoded_type &from, input::str &to) const {
// TODO: don't assume its just a string
to = from;
}
} // namespace encoding
} // namespace net
} // namespace coda |
; #########################################################################
.386
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include bmbutton.inc ; local includes for this file
; #########################################################################
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
mov CommandLine, eax
invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT
invoke ExitProcess,eax
; #########################################################################
WinMain proc hInst :DWORD,
hPrevInst :DWORD,
CmdLine :DWORD,
CmdShow :DWORD
;====================
; Put LOCALs on stack
;====================
LOCAL wc :WNDCLASSEX
LOCAL msg :MSG
LOCAL Wwd :DWORD
LOCAL Wht :DWORD
LOCAL Wtx :DWORD
LOCAL Wty :DWORD
;==================================================
; Fill WNDCLASSEX structure with required variables
;==================================================
invoke LoadIcon,hInst,1 ; icon ID
mov hIcon, eax
szText szClassName,"bmbtn_Class"
mov wc.cbSize, sizeof WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW \
or CS_BYTEALIGNWINDOW
mov wc.lpfnWndProc, offset WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
m2m wc.hInstance, hInst
mov wc.hbrBackground, COLOR_BTNFACE+1
mov wc.lpszMenuName, NULL
mov wc.lpszClassName, offset szClassName
m2m wc.hIcon, hIcon
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor, eax
m2m wc.hIconSm, hIcon
invoke RegisterClassEx, ADDR wc
;================================
; Centre window at following size
;================================
mov Wwd, 250
mov Wht, 150
invoke GetSystemMetrics,SM_CXSCREEN
invoke TopXY,Wwd,eax
mov Wtx, eax
invoke GetSystemMetrics,SM_CYSCREEN
invoke TopXY,Wht,eax
mov Wty, eax
invoke CreateWindowEx,WS_EX_LEFT,
ADDR szClassName,
ADDR szDisplayName,
WS_OVERLAPPED or WS_SYSMENU,
Wtx,Wty,Wwd,Wht,
NULL,NULL,
hInst,NULL
mov hWnd,eax
invoke LoadMenu,hInst,600 ; menu ID
invoke SetMenu,hWnd,eax
invoke ShowWindow,hWnd,SW_SHOWNORMAL
invoke UpdateWindow,hWnd
;===================================
; Loop until PostQuitMessage is sent
;===================================
StartLoop:
invoke GetMessage,ADDR msg,NULL,0,0
cmp eax, 0
je ExitLoop
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
jmp StartLoop
ExitLoop:
return msg.wParam
WinMain endp
; #########################################################################
WndProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
LOCAL var :DWORD
LOCAL caW :DWORD
LOCAL caH :DWORD
LOCAL Rct :RECT
LOCAL hDC :DWORD
LOCAL Ps :PAINTSTRUCT
LOCAL buffer1[128]:BYTE ; these are two spare buffers
LOCAL buffer2[128]:BYTE ; for text manipulation etc..
.if uMsg == WM_COMMAND
.if wParam == 400
szText icoMsg1,"Single Icon Button"
invoke MessageBox,hWin,ADDR icoMsg1,
ADDR szDisplayName,MB_OK
.elseif wParam == 401
szText icoMsg2,"Two Icon Button"
invoke MessageBox,hWin,ADDR icoMsg2,
ADDR szDisplayName,MB_OK
.elseif wParam == 402
szText bmpMsg1,"Single Bitmap Button"
invoke MessageBox,hWin,ADDR bmpMsg1,
ADDR szDisplayName,MB_OK
.elseif wParam == 403
szText bmpMsg2,"Two Bitmap Button"
invoke MessageBox,hWin,ADDR bmpMsg2,
ADDR szDisplayName,MB_OK
.endif
;======== menu commands ========
.elseif uMsg == WM_CREATE
invoke IconButton,hWin,20,20,36,36,400
mov hBtn1, eax
invoke LoadIcon,hInstance,2
invoke SendMessage,hBtn1,BM_SETIMAGE,1,eax
invoke IconButton,hWin,20,60,36,36,401
mov hBtn2, eax
invoke SetWindowLong,hBtn2,GWL_WNDPROC,BtnProc
mov lpBtnProc, eax
invoke LoadIcon,hInstance,2
invoke SendMessage,hBtn2,BM_SETIMAGE,1,eax
invoke LoadBitmap,hInstance,10
mov hBmp1, eax
invoke SetBmpColor,hBmp1
mov hBmp1,eax
invoke LoadBitmap,hInstance,11
mov hBmp2, eax
invoke SetBmpColor,hBmp2
mov hBmp2,eax
invoke BmpButton,hWin,120,20,100,36,402
mov hBtn3, eax
invoke SendMessage,hBtn3,BM_SETIMAGE,0,hBmp1
invoke BmpButton,hWin,120,60,100,36,403
mov hBtn4, eax
invoke SendMessage,hBtn4,BM_SETIMAGE,0,hBmp1
invoke SetWindowLong,hBtn4,GWL_WNDPROC,bmpProc
mov lpfnbmpProc, eax
.elseif uMsg == WM_SIZE
.elseif uMsg == WM_PAINT
invoke BeginPaint,hWin,ADDR Ps
mov hDC, eax
invoke Paint_Proc,hWin,hDC
invoke EndPaint,hWin,ADDR Ps
return 0
.elseif uMsg == WM_CLOSE
.elseif uMsg == WM_DESTROY
invoke PostQuitMessage,NULL
return 0
.endif
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
WndProc endp
; ########################################################################
TopXY proc wDim:DWORD, sDim:DWORD
shr sDim, 1 ; divide screen dimension by 2
shr wDim, 1 ; divide window dimension by 2
mov eax, wDim ; copy window dimension into eax
sub sDim, eax ; sub half win dimension from half screen dimension
return sDim
TopXY endp
; #########################################################################
Paint_Proc proc hWin:DWORD, hDC:DWORD
LOCAL btn_hi :DWORD
LOCAL btn_lo :DWORD
LOCAL Rct :RECT
invoke GetSysColor,COLOR_BTNHIGHLIGHT
mov btn_hi, eax
invoke GetSysColor,COLOR_BTNSHADOW
mov btn_lo, eax
return 0
Paint_Proc endp
; ########################################################################
IconButton proc hParent:DWORD,a:DWORD,b:DWORD,wd:DWORD,ht:DWORD,ID:DWORD
; IconButton PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
; invoke IconButton,hWnd,20,20,100,25,500
szText icoBtnCl,"BUTTON"
szText blnk1,0
invoke CreateWindowEx,0,
ADDR icoBtnCl,ADDR blnk1,
WS_CHILD or WS_VISIBLE or BS_ICON,
a,b,wd,ht,hParent,ID,
hInstance,NULL
ret
IconButton endp
; ########################################################################
BmpButton proc hParent:DWORD,a:DWORD,b:DWORD,wd:DWORD,ht:DWORD,ID:DWORD
; BmpButton PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
; invoke BmpButton,hWnd,20,20,100,25,500
szText bmpBtnCl,"BUTTON"
szText blnk2,0
invoke CreateWindowEx,0,
ADDR bmpBtnCl,ADDR blnk2,
WS_CHILD or WS_VISIBLE or BS_BITMAP,
a,b,wd,ht,hParent,ID,
hInstance,NULL
ret
BmpButton endp
; #########################################################################
BtnProc proc hCtl :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
.if uMsg == WM_KEYDOWN
jmp lbd
.elseif uMsg == WM_KEYUP
jmp lbu
.elseif uMsg == WM_LBUTTONDOWN
lbd:
invoke LoadIcon,hInstance,3
invoke SendMessage,hBtn2,BM_SETIMAGE,1,eax
.elseif uMsg == WM_LBUTTONUP
lbu:
invoke LoadIcon,hInstance,2
invoke SendMessage,hBtn2,BM_SETIMAGE,1,eax
.endif
invoke CallWindowProc,lpBtnProc,hCtl,uMsg,wParam,lParam
ret
BtnProc endp
; #########################################################################
SetBmpColor proc hBitmap:DWORD
LOCAL mDC :DWORD
LOCAL hBrush :DWORD
LOCAL hOldBmp :DWORD
LOCAL hReturn :DWORD
LOCAL hOldBrush :DWORD
invoke CreateCompatibleDC,NULL
mov mDC,eax
invoke SelectObject,mDC,hBitmap
mov hOldBmp,eax
invoke GetSysColor,COLOR_BTNFACE
invoke CreateSolidBrush,eax
mov hBrush,eax
invoke SelectObject,mDC,hBrush
mov hOldBrush,eax
invoke GetPixel,mDC,1,1
invoke ExtFloodFill,mDC,1,1,eax,FLOODFILLSURFACE
invoke SelectObject,mDC,hOldBrush
invoke DeleteObject,hBrush
invoke SelectObject,mDC,hBitmap
mov hReturn,eax
invoke DeleteDC,mDC
mov eax,hReturn
ret
SetBmpColor endp
; #########################################################################
bmpProc proc hCtl :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
.if uMsg == WM_KEYDOWN
jmp lbda
.elseif uMsg == WM_KEYUP
jmp lbua
.elseif uMsg == WM_LBUTTONDOWN
lbda:
invoke SendMessage,hBtn4,BM_SETIMAGE,0,hBmp2
.elseif uMsg == WM_LBUTTONUP
lbua:
invoke SendMessage,hBtn4,BM_SETIMAGE,0,hBmp1
.endif
invoke CallWindowProc,lpfnbmpProc,hCtl,uMsg,wParam,lParam
ret
bmpProc endp
; #########################################################################
end start
|
; A137173: A006516 at positions with even indices, A007582 at positions with odd indices.
; 0,1,1,3,6,10,28,36,120,136,496,528,2016,2080,8128,8256,32640,32896,130816,131328,523776,524800,2096128,2098176,8386560,8390656,33550336,33558528,134209536,134225920,536854528,536887296,2147450880,2147516416
mov $1,1
lpb $0
sub $0,2
mul $1,2
lpe
add $1,$0
bin $1,2
|
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int N = 51;
long long bino[N][N];
void bino_table() {
for (int i = 0; i < N; i++) {
bino[i][0] = 1;
bino[i][i] = 1;
}
for (int i = 1; i < N; i++) {
for (int j = 1; j < i; j++) {
bino[i][j] = (bino[i-1][j-1] + bino[i-1][j]) ;
}
}
}
void solve() {
bino_table();
cout << fixed << setprecision(8);
int n, A, B;
cin >> n >> A >> B;
vector<ll> a(n);
for (auto& x: a) {
cin >> x;
}
sort(a.begin(), a.end(), greater<ll>());
double sum = 0;
for (int i = 0; i < A; i++) {
sum += a[i];
}
sum /= A;
if (A>=n || a[A]!=a[0]) {
int need = 0;
for (int i = 0; i < A; i++) {
if (a[i]==a[A-1]) need++;
}
int tot = 0;
for (int i = 0; i < n; i++) {
if (a[i]==a[A-1]) tot++;
}
ll res = bino[tot][need];
cout << sum << "\n" << res;
} else {
int i = A;
for (; i < n;i++) {
if (a[i] != a[0]) break;
}
ll res = 0;
B = min(i, B);
for (int j = A; j <= B; j++) {
res += bino[i][j];
}
cout << sum << "\n" << res;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
solve();
cout << endl;
}
|
// Andrei Gaponenko, 2015, with most of the code picked from Rob's DiagnosticG4.
#include <string>
#include <vector>
#include "TDirectory.h"
#include "TH1.h"
#include "fhiclcpp/ParameterSet.h"
#include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/Provenance.h"
#include "canvas/Utilities/InputTag.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art_root_io/TFileService.h"
#include "MCDataProducts/inc/StatusG4.hh"
namespace mu2e {
//================================================================
class StatusG4Analyzer : public art::EDAnalyzer {
art::InputTag input_;
TH1D *hStatusValue_ = nullptr;
TH1D *hNG4Tracks_ = nullptr;
TH1D *hNG4TracksLog_ = nullptr;
TH1D *hOverflowSimPart_ = nullptr;
TH1D *hNKilledStep_ = nullptr;
TH1D *hRealTime_ = nullptr;
TH1D *hRealTimeWide_ = nullptr;
TH1D *hCPUTime_ = nullptr;
TH1D *hCPUTimeWide_ = nullptr;
public:
struct Config {
fhicl::Atom<art::InputTag> input {
fhicl::Name("input"),
fhicl::Comment("The InputTag of the StatusG4 object to analyze.")
};
};
using Parameters = art::EDAnalyzer::Table<Config>;
explicit StatusG4Analyzer(const Parameters& conf);
virtual void analyze(const art::Event& event);
};
//================================================================
StatusG4Analyzer::StatusG4Analyzer(const Parameters& conf)
: art::EDAnalyzer(conf)
, input_(conf().input())
{
art::ServiceHandle<art::TFileService> tfs;
hStatusValue_ = tfs->make<TH1D>("statusValue", "Non-zero values of the G4 status", 20, 0., 20.);
hNG4Tracks_ = tfs->make<TH1D>("numG4Tracks", "Number of tracks created by G4", 200, 0., 2000.);
hNG4TracksLog_ = tfs->make<TH1D>("numG4TracksLog", "log10(Number of tracks created by G4)", 100, 0., 10.);
hOverflowSimPart_ = tfs->make<TH1D>("overflowSimParticles", "Count of events with SimParticle overflows", 1, -0.5, 0.5);
hNKilledStep_ = tfs->make<TH1D>( "hNKilledStep", "Number Killed by Step Limit", 100, 0., 100. );
hRealTime_ = tfs->make<TH1D>( "hRealTime", "Wall Clock time/event (10 ms ticks);(ms)", 50, 0., 500. );
hRealTimeWide_ = tfs->make<TH1D>( "hRealTimeWide", "Wall Clock time/event (10 ms ticks);(ms)", 100, 0., 10000. );
hCPUTime_ = tfs->make<TH1D>( "hCPUTime", "CPU time/event(10 ms ticks);(ms)", 50, 0., 500. );
hCPUTimeWide_ = tfs->make<TH1D>( "hCPUTimeWide", "CPU time/event(10 ms ticks);(ms)", 100, 0., 10000. );
}
//================================================================
void StatusG4Analyzer::analyze(const art::Event& event) {
const auto sh = event.getValidHandle<StatusG4>(input_);
if ( sh->status() != 0 ){
hStatusValue_->Fill(sh->status());
}
hNG4Tracks_->Fill(sh->nG4Tracks());
hNG4TracksLog_->Fill( (sh->nG4Tracks() > 0) ? log10(sh->nG4Tracks()) : 0 );
if(sh->overflowSimParticles()) hOverflowSimPart_->Fill(0.);
if ( sh->nKilledStepLimit() > 0 ) { hNKilledStep_->Fill(sh->nKilledStepLimit()); }
// Convert times to ms;
double cpu = sh->cpuTime()*1000.;
double real = sh->realTime()*1000.;
hRealTime_ ->Fill(real);
hRealTimeWide_->Fill(real);
hCPUTime_ ->Fill(cpu);
hCPUTimeWide_ ->Fill(cpu);
}
//================================================================
} // namespace mu2e
DEFINE_ART_MODULE(mu2e::StatusG4Analyzer);
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll x,y,cs=0;
while(cin>>x>>y){
if(x==0&&y==0) break;
if(x==0||x==1)
{
cout<<"Case "<<++cs<<": :-\\"<<endl;
}
else if(x<=y)
{
cout<<"Case "<<++cs<<": :-|"<<endl;
}
else cout<<"Case "<<++cs<<": :-("<<endl;
}
return 0;
}
|
/*
* Copyright (C) 2009 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
*/
#include "config.h"
#include "platform/win/SystemInfo.h"
#if _WIN32_WINNT_WINBLUE
#include <versionhelpers.h>
#endif
#include <windows.h>
namespace blink {
#ifndef _WIN32_WINNT_WINBLUE
static bool IsWindowsVistaOrGreater()
{
OSVERSIONINFOEXW osvi = { };
osvi.dwOSVersionInfoSize = sizeof(osvi);
osvi.dwMajorVersion = HIBYTE(_WIN32_WINNT_VISTA);
osvi.dwMinorVersion = LOBYTE(_WIN32_WINNT_VISTA);
DWORDLONG conditoin = 0;
VER_SET_CONDITION(conditoin, VER_MAJORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(conditoin, VER_MINORVERSION, VER_GREATER_EQUAL);
return !!::VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION, conditoin);
}
#endif
bool isWindowsVistaOrGreater()
{
static bool initialized = false;
static bool cachedIsWindowsVistaOrGreater;
if (!initialized) {
initialized = true;
cachedIsWindowsVistaOrGreater = IsWindowsVistaOrGreater();
}
return cachedIsWindowsVistaOrGreater;
}
} // namespace blink
|
; A069515: Number of transpositions (interchanges of adjacent digits, sometimes called inversions) needed to change all n-digit base 3 numbers into nondecreasing order.
; 0,3,24,135,648,2835,11664,45927,174960,649539,2361960,8444007,29760696,103630995,357128352,1219657095,4132485216,13904090883,46490458680,154580775111,511395045480,1684116865683,5523066491184
mov $2,3
pow $2,$0
mul $2,$0
add $0,3
mul $0,$2
sub $0,$2
mov $1,$0
div $1,9
mul $1,3
|
db DEX_GLISCOR ; pokedex id
db 75 ; base hp
db 95 ; base attack
db 125 ; base defense
db 95 ; base speed
db 60 ; base special
db GROUND ; species type 1
db FLYING ; species type 2
db 35 ; catch rate
db 202 ; base exp yield
INCBIN "pic/ymon/gliscor.pic",0,1 ; 77, sprite dimensions
dw GliscorPicFront
dw GliscorPicBack
; attacks known at lvl 0
db GUST
db POISON_STING
db DIG
db 0
db 5 ; growth rate
; learnset
tmlearn 2,4,6
tmlearn 9,10,15
tmlearn 20,23
tmlearn 31,32
tmlearn 33,34,38,39
tmlearn 43,44
tmlearn 50,52
db BANK(GliscorPicFront)
|
; A117910: Expansion of (1+x+x^2+x^4)/((1-x^3)(1-x^6)).
; 1,1,1,1,2,1,2,3,2,2,4,2,3,5,3,3,6,3,4,7,4,4,8,4,5,9,5,5,10,5,6,11,6,6,12,6,7,13,7,7,14,7,8,15,8,8,16,8,9,17,9,9,18,9,10,19,10,10,20,10,11,21,11,11,22,11,12,23,12,12,24,12,13,25,13,13,26,13,14,27,14
mov $3,2
mov $7,$0
lpb $3,1
mov $0,$7
sub $3,1
add $0,$3
sub $0,2
mov $2,8
mov $5,2
mov $6,$0
div $6,3
add $6,$0
lpb $0,1
mov $0,1
pow $6,2
mul $6,2
div $6,$5
lpe
mul $2,2
mov $4,$3
div $6,$2
lpb $4,1
mov $1,$6
sub $4,1
lpe
lpe
lpb $7,1
sub $1,$6
mov $7,0
lpe
add $1,1
|
;
;
SECTION code_clib
PUBLIC generic_console_cls
PUBLIC generic_console_scrollup
PUBLIC generic_console_printc
PUBLIC generic_console_set_ink
PUBLIC generic_console_set_paper
PUBLIC generic_console_set_inverse
PUBLIC generic_console_calc_xypos
PUBLIC generic_console_plotc
PUBLIC generic_console_pointxy
PUBLIC __spc1000_attr
EXTERN printc_MODE1
EXTERN printc_MODE2
EXTERN __MODE2_attr
EXTERN tms9918_cls
EXTERN tms9918_scrollup
EXTERN tms9918_printc
EXTERN tms9918_set_ink
EXTERN tms9918_set_paper
EXTERN tms9918_set_inverse
EXTERN generic_console_flags
EXTERN mc6847_map_colour
EXTERN CONSOLE_COLUMNS
EXTERN CONSOLE_ROWS
EXTERN __spc1000_mode
EXTERN __console_w
defc DISPLAY = 0x0000
generic_console_set_inverse:
ld b,a
ld a,(hl)
ld c,0
rlca
rl c
ld a,(__spc1000_attr)
and 254
or c
ld (__spc1000_attr),a
ld a,(__spc1000_mode)
cp 10
ld a,b
jp z,tms9918_set_inverse
ret
generic_console_set_paper:
push af
call mc6847_map_colour
ld a,b
rrca
rrca
and @11000000
ld (__MODE2_attr+1),a
call set_css
pop af
ld b,a
ld a,(__spc1000_mode)
cp 10
ld a,b
jp z,tms9918_set_paper
ret
generic_console_set_ink:
push af
call mc6847_map_colour
ld a,b
and 7
ld (__ink_colour),a
rrca
rrca
and @11000000
ld (__MODE2_attr),a
call set_css
pop af
ld a,(__spc1000_mode)
cp 10
ld a,b
jp z,tms9918_set_ink
ret
set_css:
ld a,b
rlca
rlca
and @00000010
ld c,a
ld a,(__spc1000_attr)
and @11111101
or c
ld (__spc1000_attr),a
ret
generic_console_cls:
ld a,(__spc1000_mode)
and a
jr z,cls_text
cp 10
jp z,tms9918_cls
jr cls_hires
cls_text:
ld bc,0
ld hl, CONSOLE_ROWS * CONSOLE_COLUMNS
cls_1:
ld a,' '
out (c),a
set 3,b
ld a,(__spc1000_attr)
out (c),a
res 3,b
inc bc
dec hl
ld a,h
or l
jr nz,cls_1
ret
cls_hires:
ld bc,0
ld hl, +(32 * 24 * 8)
ld e,0
cls_hires_1:
out (c),e
inc bc
dec hl
ld a,h
or l
jr nz,cls_hires_1
generic_console_pointxy:
call generic_console_calc_xypos
ld c,l
ld b,h
in l,(c)
set 3,b
in a,(c)
and @00011101
cp @00011101
ld a,0 ;No graphics drawn
ret nz ;Not a graphics character
ld a,l
and @00111111
ret
generic_console_plotc:
call generic_console_calc_xypos
ld c,l
ld b,h
ld l,a
ld a,(__MODE2_attr) ;It's shifted for us
and @11000000
or l
out (c),a
set 3,b
ld a,(__ink_colour)
rrca
and 2 ;Set the CSS flag as appropriate
or @00011101 ;3x2, CSS not set
out (c),a
ret
; c = x
; b = y
; a = character to print
; e = raw
generic_console_printc:
ld d,a ;Save character
ld a,(__spc1000_mode)
cp 1
jp z,printc_MODE1
cp 2
jp z,printc_MODE2
cp 10
ld a,d
jp z,tms9918_printc
call generic_console_calc_xypos
ld c,l
ld b,h
cp $60
jr c,hardware_chars
; We do something with characters > 0xe0 here
cp $e0
jr nc,high_chars
and $7f
out (c),a
ld a,(__spc1000_attr)
and 3
or 8
write_attr:
set 3,b
out (c),a
ret
high_chars:
and $f
ld d,a
ld a,(__spc1000_attr)
dec a
and 7
rlca
rlca
rlca
rlca
or d
out (c),a
ld a,(__spc1000_attr)
or 4
jr write_attr
hardware_chars:
out (c),a
ld a,(__spc1000_attr)
jr write_attr
generic_console_calc_xypos:
ld hl,DISPLAY
ld de,(__console_w)
ld d,0
and a
sbc hl,de
inc b
generic_console_printc_1:
add hl,de
djnz generic_console_printc_1
generic_console_printc_3:
add hl,bc ;hl now points to address in display
ret
generic_console_scrollup:
ld a,(__spc1000_mode)
cp 10
jp z,tms9918_scrollup
push de
push bc
and a
jr z,scrollup_text
jr scrollup_hires
scrollup_text:
ld bc, CONSOLE_COLUMNS ;source
ld hl, +((CONSOLE_ROWS -1)* CONSOLE_COLUMNS)
scroll_loop:
push hl
in e,(c)
set 3,b
in d,(c)
res 3,b
ld hl,-CONSOLE_COLUMNS
add hl,bc
ld c,l
ld b,h
out (c),e
set 3,b
out (c),d
res 3,b
ld hl,CONSOLE_COLUMNS + 1
add hl,bc
ld c,l
ld b,h
pop hl
dec hl
ld a,h
or l
jr nz,scroll_loop
ld hl,-CONSOLE_COLUMNS
add hl,bc
ld c,l
ld b,h
ld e,32
ld d,' '
ld a,(__spc1000_attr)
scroll_loop_2:
out (c),d
set 3,b
out (c),a
res 3,b
inc bc
dec e
jr nz,scroll_loop_2
pop bc
pop de
ret
scrollup_hires:
ld bc, 32 * 8
ld hl, +(32 * 23 * 8)
scroll_hires_1:
in e,(c)
dec b
out (c),e
inc b
inc bc
dec hl
ld a,h
or l
jr nz,scroll_hires_1
ld l,0
xor a
scrollup_hires_2:
out (c),a
inc bc
dec l
jr nz,scrollup_hires_2
pop bc
pop de
ret
SECTION data_clib
__spc1000_attr: defb 0
__ink_colour: defb 7
|
; ===============================================================
; Jun 2007
; ===============================================================
;
; uchar zx_aaddr2cx(void *attraddr)
;
; Attribute address to character x coordinate.
;
; ===============================================================
SECTION code_clib
SECTION code_arch
PUBLIC asm_zx_aaddr2cx
asm_zx_aaddr2cx:
; enter : hl = valid attribute address
;
; exit : l = character x coordinate of attr square
;
; uses : af, l
ld a,l
and $1f
ld l,a
IF __SCCZ80
ld h,0
ENDIF
ret
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdx
lea addresses_D_ht+0x87f2, %r15
nop
nop
nop
nop
and %rbp, %rbp
vmovups (%r15), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r13
nop
nop
and %r13, %r13
lea addresses_A_ht+0x7432, %rbx
nop
nop
nop
nop
nop
cmp $37402, %rax
mov (%rbx), %dx
nop
nop
nop
add $14602, %rdx
lea addresses_WT_ht+0x13ccc, %rax
nop
nop
and $52574, %rcx
movups (%rax), %xmm6
vpextrq $1, %xmm6, %r15
nop
nop
nop
nop
cmp $64051, %rdx
lea addresses_UC_ht+0x10072, %rax
nop
nop
nop
nop
nop
and $24661, %rdx
mov $0x6162636465666768, %r13
movq %r13, (%rax)
nop
nop
inc %rax
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r15
push %r9
push %rbp
// Store
lea addresses_normal+0x8bf2, %r9
nop
and %rbp, %rbp
movw $0x5152, (%r9)
nop
nop
and %rbp, %rbp
// Faulty Load
lea addresses_PSE+0x173f2, %r10
clflush (%r10)
nop
nop
nop
inc %r13
mov (%r10), %r15
lea oracles, %r14
and $0xff, %r15
shlq $12, %r15
mov (%r14,%r15,1), %r15
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': True}}
{'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
*/
|
; A104449: Fibonacci sequence with initial values a(0) = 3 and a(1) = 1.
; 3,1,4,5,9,14,23,37,60,97,157,254,411,665,1076,1741,2817,4558,7375,11933,19308,31241,50549,81790,132339,214129,346468,560597,907065,1467662,2374727,3842389,6217116,10059505,16276621,26336126,42612747,68948873,111561620,180510493,292072113,472582606,764654719,1237237325,2001892044,3239129369,5241021413,8480150782,13721172195,22201322977,35922495172,58123818149,94046313321,152170131470,246216444791,398386576261,644603021052,1042989597313,1687592618365,2730582215678,4418174834043,7148757049721,11566931883764,18715688933485,30282620817249,48998309750734,79280930567983,128279240318717,207560170886700,335839411205417,543399582092117,879238993297534,1422638575389651,2301877568687185,3724516144076836,6026393712764021
mov $1,3
lpb $0
sub $0,1
mov $3,$2
add $2,$1
add $3,1
mov $1,$3
lpe
|
-- 7 Billion Humans (2056) --
-- 22: Number Royale --
-- Author: ansvonwa
-- Size: 6
-- Speed: 9
-- Speed Tests: 9, 9, 9
pickup s
a:
if myitem < e or
myitem < w:
b:
step s
jump b
endif
step w
jump a
|
ori $1, $0, 8
ori $2, $0, 0
ori $3, $0, 10
ori $4, $0, 7
sw $4, 0($0)
sw $1, 4($0)
sw $4, 8($0)
sw $2, 12($0)
sw $1, 16($0)
sw $3, 20($0)
sw $3, 24($0)
sw $1, 28($0)
sw $3, 32($0)
sw $2, 36($0)
sw $4, 40($0)
sw $2, 44($0)
sw $4, 48($0)
sw $4, 52($0)
sw $1, 56($0)
sw $3, 60($0)
sw $1, 64($0)
sw $2, 68($0)
sw $2, 72($0)
sw $2, 76($0)
sw $4, 80($0)
sw $4, 84($0)
sw $4, 88($0)
sw $4, 92($0)
sw $1, 96($0)
sw $4, 100($0)
sw $4, 104($0)
sw $4, 108($0)
sw $2, 112($0)
sw $4, 116($0)
sw $1, 120($0)
sw $4, 124($0)
bne $2, $2, TAG1
mfhi $1
bne $2, $1, TAG1
sw $2, 0($1)
TAG1:
sh $1, 0($1)
mult $1, $1
sw $1, 0($1)
lhu $3, 0($1)
TAG2:
srl $1, $3, 6
mult $1, $1
mfhi $4
slt $2, $3, $3
TAG3:
sh $2, 0($2)
nor $1, $2, $2
beq $1, $2, TAG4
mtlo $1
TAG4:
slt $1, $1, $1
bgtz $1, TAG5
sltu $1, $1, $1
bgez $1, TAG5
TAG5:
mult $1, $1
addi $2, $1, 3
bne $2, $1, TAG6
mtlo $2
TAG6:
lbu $3, 0($2)
andi $2, $2, 2
div $2, $2
bne $3, $3, TAG7
TAG7:
mfhi $1
srl $4, $1, 13
addi $4, $4, 14
mflo $3
TAG8:
subu $2, $3, $3
lbu $1, 0($2)
subu $3, $3, $2
mthi $3
TAG9:
mtlo $3
addiu $3, $3, 14
bgtz $3, TAG10
multu $3, $3
TAG10:
mtlo $3
mthi $3
mthi $3
bltz $3, TAG11
TAG11:
sb $3, 0($3)
beq $3, $3, TAG12
sb $3, 0($3)
sb $3, 0($3)
TAG12:
ori $2, $3, 9
mthi $3
mtlo $2
lbu $2, 0($2)
TAG13:
sb $2, 0($2)
mthi $2
multu $2, $2
mfhi $1
TAG14:
lui $1, 5
sll $0, $0, 0
div $1, $1
ori $3, $1, 10
TAG15:
blez $3, TAG16
mthi $3
sll $0, $0, 0
sll $0, $0, 0
TAG16:
bltz $3, TAG17
mthi $3
mthi $3
sll $0, $0, 0
TAG17:
lui $4, 13
mult $3, $4
sll $0, $0, 0
lui $1, 6
TAG18:
mfhi $4
xori $4, $1, 9
bne $1, $1, TAG19
sll $0, $0, 0
TAG19:
bltz $4, TAG20
sll $0, $0, 0
sll $0, $0, 0
beq $4, $4, TAG20
TAG20:
sll $0, $0, 0
blez $3, TAG21
mtlo $3
lui $3, 15
TAG21:
mfhi $3
srl $3, $3, 11
lw $4, 0($3)
mflo $2
TAG22:
sll $0, $0, 0
srlv $1, $2, $2
lui $1, 6
sll $0, $0, 0
TAG23:
blez $1, TAG24
addiu $4, $1, 4
mflo $1
multu $1, $1
TAG24:
addu $4, $1, $1
sll $3, $4, 4
div $1, $4
div $1, $1
TAG25:
srl $3, $3, 1
sll $0, $0, 0
bgez $3, TAG26
mflo $2
TAG26:
bltz $2, TAG27
lb $1, 0($2)
sll $3, $2, 15
mthi $2
TAG27:
mflo $3
div $3, $3
srl $1, $3, 7
lbu $2, 0($3)
TAG28:
mtlo $2
lui $4, 15
blez $4, TAG29
mtlo $2
TAG29:
sll $0, $0, 0
mthi $1
mult $1, $1
sltu $2, $4, $4
TAG30:
mthi $2
bgez $2, TAG31
sh $2, 0($2)
lb $2, 0($2)
TAG31:
lh $1, 0($2)
mthi $1
sh $2, 0($1)
bgtz $2, TAG32
TAG32:
mtlo $1
beq $1, $1, TAG33
multu $1, $1
nor $3, $1, $1
TAG33:
sb $3, 0($3)
mtlo $3
mthi $3
bne $3, $3, TAG34
TAG34:
nor $2, $3, $3
addiu $3, $2, 1
multu $3, $3
mfhi $3
TAG35:
sh $3, 2($3)
blez $3, TAG36
xori $1, $3, 14
bgez $1, TAG36
TAG36:
addiu $2, $1, 11
mthi $1
lhu $3, 5($2)
bgtz $3, TAG37
TAG37:
mthi $3
sll $0, $0, 0
sll $0, $0, 0
beq $3, $3, TAG38
TAG38:
mflo $3
mthi $3
andi $2, $3, 0
mflo $2
TAG39:
blez $2, TAG40
mthi $2
lbu $3, 0($2)
lb $3, 0($2)
TAG40:
xori $2, $3, 10
slti $4, $3, 2
bgtz $2, TAG41
lui $3, 1
TAG41:
lui $1, 4
multu $3, $1
mtlo $1
xor $2, $3, $3
TAG42:
lui $3, 5
sll $0, $0, 0
lui $3, 10
divu $3, $3
TAG43:
srav $1, $3, $3
sll $0, $0, 0
sll $0, $0, 0
xor $2, $3, $3
TAG44:
lui $3, 4
mult $3, $2
lb $2, 0($2)
ori $1, $3, 3
TAG45:
addiu $2, $1, 1
divu $1, $2
divu $1, $2
srav $3, $1, $1
TAG46:
mthi $3
bne $3, $3, TAG47
sll $0, $0, 0
bne $3, $3, TAG47
TAG47:
mflo $2
lui $4, 8
xori $3, $4, 11
beq $3, $3, TAG48
TAG48:
lui $1, 0
srlv $4, $3, $3
mfhi $4
slt $3, $4, $4
TAG49:
mult $3, $3
mthi $3
bltz $3, TAG50
sw $3, 0($3)
TAG50:
lui $3, 4
xori $4, $3, 1
mult $3, $3
mflo $4
TAG51:
xori $2, $4, 15
bgez $4, TAG52
slti $3, $4, 5
lui $4, 6
TAG52:
multu $4, $4
bne $4, $4, TAG53
mflo $3
ori $1, $4, 1
TAG53:
sll $2, $1, 0
lui $3, 15
lui $4, 5
addu $1, $1, $4
TAG54:
slti $4, $1, 14
bltz $1, TAG55
mthi $1
bgtz $4, TAG55
TAG55:
mult $4, $4
multu $4, $4
bne $4, $4, TAG56
lh $2, 0($4)
TAG56:
beq $2, $2, TAG57
lb $1, 0($2)
beq $2, $1, TAG57
mtlo $1
TAG57:
mflo $2
blez $1, TAG58
mfhi $1
xori $3, $1, 5
TAG58:
mtlo $3
sll $0, $0, 0
multu $3, $4
mflo $1
TAG59:
lui $3, 13
mtlo $3
ori $3, $3, 4
add $4, $1, $1
TAG60:
sw $4, 0($4)
mult $4, $4
beq $4, $4, TAG61
srlv $3, $4, $4
TAG61:
multu $3, $3
bltz $3, TAG62
sb $3, 0($3)
beq $3, $3, TAG62
TAG62:
lui $4, 15
sll $0, $0, 0
srl $4, $3, 13
bne $1, $1, TAG63
TAG63:
mtlo $4
mtlo $4
sb $4, 0($4)
lui $1, 14
TAG64:
addu $3, $1, $1
bne $3, $1, TAG65
sll $0, $0, 0
mfhi $1
TAG65:
sll $0, $0, 0
multu $1, $1
addiu $2, $1, 13
sll $0, $0, 0
TAG66:
lui $1, 9
divu $1, $2
xori $3, $1, 1
mult $3, $1
TAG67:
bgtz $3, TAG68
sll $0, $0, 0
lw $4, 0($3)
lbu $1, 0($3)
TAG68:
beq $1, $1, TAG69
sll $0, $0, 0
sra $2, $1, 14
slti $2, $1, 10
TAG69:
mflo $2
sll $0, $0, 0
multu $1, $1
lui $1, 4
TAG70:
mtlo $1
sll $0, $0, 0
ori $3, $1, 2
lui $1, 9
TAG71:
mfhi $1
addiu $3, $1, 2
mult $1, $1
lui $2, 10
TAG72:
lui $2, 3
sll $0, $0, 0
blez $2, TAG73
sll $0, $0, 0
TAG73:
mthi $2
mthi $2
addu $4, $2, $2
mthi $4
TAG74:
mtlo $4
sll $0, $0, 0
sll $0, $0, 0
lui $1, 4
TAG75:
bne $1, $1, TAG76
and $1, $1, $1
bltz $1, TAG76
lui $2, 0
TAG76:
lw $4, 0($2)
multu $2, $4
mflo $1
addu $1, $4, $1
TAG77:
bgtz $1, TAG78
sltiu $1, $1, 8
bltz $1, TAG78
sb $1, 0($1)
TAG78:
sb $1, 0($1)
addu $3, $1, $1
or $1, $3, $1
div $3, $3
TAG79:
lb $1, 0($1)
multu $1, $1
mfhi $1
mfhi $4
TAG80:
lui $1, 15
beq $1, $4, TAG81
mult $4, $4
add $2, $4, $1
TAG81:
sll $0, $0, 0
sll $0, $0, 0
bgtz $2, TAG82
multu $1, $2
TAG82:
mult $1, $1
srlv $1, $1, $1
mtlo $1
sll $0, $0, 0
TAG83:
multu $1, $1
ori $2, $1, 10
sll $0, $0, 0
divu $2, $1
TAG84:
div $2, $2
mflo $1
bne $2, $2, TAG85
sb $1, 0($1)
TAG85:
mfhi $4
divu $1, $1
mult $4, $4
mfhi $4
TAG86:
mult $4, $4
multu $4, $4
beq $4, $4, TAG87
mflo $4
TAG87:
sra $3, $4, 5
or $3, $4, $3
beq $3, $3, TAG88
addiu $3, $3, 12
TAG88:
mflo $2
lui $1, 3
mflo $4
divu $3, $1
TAG89:
bne $4, $4, TAG90
mflo $3
sb $3, 0($4)
bgez $3, TAG90
TAG90:
lw $1, 0($3)
bltz $1, TAG91
sh $3, 0($3)
sw $3, -256($1)
TAG91:
sh $1, -256($1)
div $1, $1
mult $1, $1
sra $2, $1, 7
TAG92:
lb $1, 0($2)
lb $4, 0($2)
lbu $3, 0($4)
multu $2, $2
TAG93:
mtlo $3
beq $3, $3, TAG94
multu $3, $3
beq $3, $3, TAG94
TAG94:
lhu $3, 0($3)
mthi $3
xor $4, $3, $3
mthi $4
TAG95:
mthi $4
mthi $4
sra $4, $4, 15
lbu $3, 0($4)
TAG96:
sh $3, 0($3)
beq $3, $3, TAG97
lui $2, 7
lb $2, 0($3)
TAG97:
blez $2, TAG98
sll $0, $0, 0
mflo $4
lui $2, 2
TAG98:
lui $1, 3
sll $0, $0, 0
div $2, $1
bne $2, $2, TAG99
TAG99:
mult $1, $1
mthi $1
mthi $1
lui $2, 12
TAG100:
beq $2, $2, TAG101
sltiu $4, $2, 0
subu $4, $4, $4
lui $2, 12
TAG101:
andi $3, $2, 5
lui $1, 4
sll $0, $0, 0
beq $3, $1, TAG102
TAG102:
andi $1, $2, 5
bgez $2, TAG103
addu $4, $2, $2
blez $2, TAG103
TAG103:
mult $4, $4
bgtz $4, TAG104
sll $0, $0, 0
srav $2, $4, $4
TAG104:
srl $2, $2, 2
sltiu $4, $2, 1
sll $0, $0, 0
sllv $2, $2, $2
TAG105:
sll $0, $0, 0
sllv $4, $2, $1
bne $1, $1, TAG106
mflo $1
TAG106:
bne $1, $1, TAG107
and $2, $1, $1
lhu $2, 0($2)
lui $1, 6
TAG107:
sll $0, $0, 0
mthi $4
lui $4, 5
bne $1, $1, TAG108
TAG108:
divu $4, $4
sll $1, $4, 10
sll $0, $0, 0
subu $2, $1, $1
TAG109:
ori $3, $2, 1
lbu $1, 0($3)
multu $2, $1
mult $1, $1
TAG110:
lui $1, 5
sltiu $2, $1, 0
nor $3, $1, $2
bltz $1, TAG111
TAG111:
addiu $1, $3, 15
sll $0, $0, 0
mfhi $1
beq $1, $1, TAG112
TAG112:
mflo $2
addi $4, $2, 10
slti $1, $4, 11
bgtz $2, TAG113
TAG113:
sb $1, 0($1)
sb $1, 0($1)
lb $3, 0($1)
bltz $1, TAG114
TAG114:
subu $1, $3, $3
sltiu $2, $3, 6
lui $2, 10
bne $2, $1, TAG115
TAG115:
multu $2, $2
lui $3, 7
mult $2, $3
mflo $3
TAG116:
mthi $3
lbu $4, 0($3)
add $2, $3, $4
subu $1, $4, $4
TAG117:
sw $1, 0($1)
blez $1, TAG118
lhu $1, 0($1)
mfhi $4
TAG118:
sll $1, $4, 1
mthi $1
addiu $2, $4, 0
add $4, $4, $2
TAG119:
mthi $4
mtlo $4
mflo $3
sb $4, 0($4)
TAG120:
beq $3, $3, TAG121
mtlo $3
bltz $3, TAG121
mthi $3
TAG121:
mflo $2
lbu $4, 0($2)
multu $3, $4
multu $3, $4
TAG122:
lbu $2, 0($4)
mult $2, $4
bgez $4, TAG123
mult $2, $2
TAG123:
multu $2, $2
mtlo $2
mtlo $2
slt $1, $2, $2
TAG124:
lui $1, 14
blez $1, TAG125
addu $3, $1, $1
mfhi $4
TAG125:
lui $3, 9
bgtz $4, TAG126
sltiu $2, $4, 8
multu $3, $2
TAG126:
mthi $2
lbu $1, 0($2)
mflo $1
bne $1, $1, TAG127
TAG127:
mthi $1
mult $1, $1
multu $1, $1
bgtz $1, TAG128
TAG128:
sll $0, $0, 0
lui $4, 4
blez $3, TAG129
lui $3, 6
TAG129:
bne $3, $3, TAG130
multu $3, $3
bltz $3, TAG130
sll $0, $0, 0
TAG130:
sll $0, $0, 0
mthi $3
slt $2, $4, $4
subu $1, $2, $3
TAG131:
sll $0, $0, 0
mthi $2
sll $0, $0, 0
sll $0, $0, 0
TAG132:
sll $0, $0, 0
srav $1, $1, $1
xori $1, $1, 7
sll $0, $0, 0
TAG133:
lui $1, 8
xori $4, $1, 3
andi $2, $1, 0
lui $2, 1
TAG134:
mult $2, $2
mult $2, $2
bne $2, $2, TAG135
mtlo $2
TAG135:
beq $2, $2, TAG136
addiu $2, $2, 14
sltiu $2, $2, 14
divu $2, $2
TAG136:
bne $2, $2, TAG137
lui $1, 0
add $3, $1, $1
multu $1, $3
TAG137:
mthi $3
mthi $3
addiu $2, $3, 0
sw $3, 0($3)
TAG138:
beq $2, $2, TAG139
mfhi $3
multu $2, $2
bgez $2, TAG139
TAG139:
lui $1, 9
bgez $1, TAG140
ori $1, $1, 13
lui $4, 5
TAG140:
sll $0, $0, 0
mtlo $4
bltz $4, TAG141
mtlo $4
TAG141:
mflo $3
mtlo $4
slti $1, $3, 1
blez $1, TAG142
TAG142:
sh $1, 0($1)
multu $1, $1
mult $1, $1
sltu $2, $1, $1
TAG143:
bgez $2, TAG144
lbu $1, 0($2)
mult $1, $2
mfhi $1
TAG144:
sh $1, 0($1)
multu $1, $1
beq $1, $1, TAG145
mtlo $1
TAG145:
mfhi $4
bltz $1, TAG146
lb $4, 0($1)
lui $3, 0
TAG146:
srav $1, $3, $3
sltiu $4, $3, 5
and $1, $3, $3
srlv $2, $1, $1
TAG147:
mflo $4
lbu $4, 0($4)
bne $4, $2, TAG148
mfhi $4
TAG148:
multu $4, $4
ori $1, $4, 10
bne $1, $4, TAG149
srlv $2, $4, $1
TAG149:
bltz $2, TAG150
lhu $2, 0($2)
blez $2, TAG150
sh $2, 0($2)
TAG150:
srl $1, $2, 4
beq $1, $2, TAG151
mflo $2
bltz $1, TAG151
TAG151:
sh $2, 0($2)
lui $3, 6
sll $0, $0, 0
sub $1, $2, $2
TAG152:
sw $1, 0($1)
bne $1, $1, TAG153
mthi $1
beq $1, $1, TAG153
TAG153:
mult $1, $1
beq $1, $1, TAG154
sltiu $1, $1, 14
mtlo $1
TAG154:
multu $1, $1
sb $1, 0($1)
slti $3, $1, 2
multu $3, $1
TAG155:
sb $3, 0($3)
sra $4, $3, 3
mthi $4
xor $1, $4, $4
TAG156:
bne $1, $1, TAG157
lw $2, 0($1)
slti $4, $2, 8
multu $4, $1
TAG157:
addiu $4, $4, 5
bltz $4, TAG158
or $1, $4, $4
xori $3, $4, 5
TAG158:
mult $3, $3
blez $3, TAG159
mfhi $4
lh $3, 0($3)
TAG159:
lbu $3, 0($3)
mthi $3
sb $3, 0($3)
mult $3, $3
TAG160:
mult $3, $3
beq $3, $3, TAG161
xori $3, $3, 0
sltiu $2, $3, 2
TAG161:
beq $2, $2, TAG162
ori $3, $2, 4
sra $4, $3, 6
mtlo $4
TAG162:
mflo $3
lui $2, 12
mult $2, $2
blez $4, TAG163
TAG163:
slt $3, $2, $2
mflo $3
mtlo $3
sll $0, $0, 0
TAG164:
mthi $3
add $3, $3, $3
mflo $3
lw $4, 0($3)
TAG165:
sb $4, -256($4)
mflo $2
mthi $4
xori $2, $4, 4
TAG166:
sll $0, $0, 0
sll $2, $2, 7
mthi $2
mthi $2
TAG167:
sll $0, $0, 0
and $1, $2, $2
sltiu $1, $1, 1
sll $0, $0, 0
TAG168:
sllv $4, $2, $2
bltz $4, TAG169
mflo $1
mflo $1
TAG169:
lui $3, 6
lbu $1, 0($1)
lbu $3, 0($1)
lui $4, 10
TAG170:
mtlo $4
nor $4, $4, $4
mult $4, $4
lui $4, 9
TAG171:
addu $1, $4, $4
mfhi $1
sw $1, 0($1)
mflo $4
TAG172:
xori $4, $4, 9
sltiu $2, $4, 9
addiu $1, $4, 4
mtlo $2
TAG173:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
slt $1, $1, $1
TAG174:
slti $3, $1, 0
andi $3, $3, 14
lw $4, 0($3)
sw $3, -256($4)
TAG175:
blez $4, TAG176
andi $4, $4, 15
addi $3, $4, 8
bgez $4, TAG176
TAG176:
mult $3, $3
lw $1, 0($3)
multu $3, $1
lbu $2, 0($3)
TAG177:
blez $2, TAG178
mfhi $1
multu $2, $1
div $2, $2
TAG178:
bgez $1, TAG179
multu $1, $1
sub $4, $1, $1
mthi $4
TAG179:
mflo $3
lb $3, 0($4)
mthi $3
multu $3, $3
TAG180:
add $1, $3, $3
lhu $3, 0($1)
sw $3, 0($3)
lui $4, 4
TAG181:
sll $0, $0, 0
lui $3, 13
nor $4, $3, $4
mtlo $4
TAG182:
blez $4, TAG183
mflo $1
bgez $4, TAG183
sltu $1, $1, $4
TAG183:
mflo $2
xori $2, $2, 10
sll $0, $0, 0
divu $1, $1
TAG184:
multu $2, $2
beq $2, $2, TAG185
andi $3, $2, 4
sub $2, $3, $2
TAG185:
sll $0, $0, 0
blez $2, TAG186
mthi $1
bgez $1, TAG186
TAG186:
sll $0, $0, 0
mult $1, $1
sll $0, $0, 0
sll $0, $0, 0
TAG187:
lh $3, 0($3)
srav $3, $3, $3
bne $3, $3, TAG188
addi $3, $3, 4
TAG188:
sb $3, 0($3)
sltiu $4, $3, 5
mtlo $4
slti $2, $4, 5
TAG189:
mult $2, $2
srl $4, $2, 3
mtlo $2
beq $4, $4, TAG190
TAG190:
lui $2, 5
bgez $2, TAG191
mflo $2
bgtz $2, TAG191
TAG191:
and $4, $2, $2
lbu $2, 0($4)
sb $2, 0($2)
sra $4, $4, 13
TAG192:
mtlo $4
addiu $1, $4, 11
lh $4, 0($4)
lui $1, 5
TAG193:
bne $1, $1, TAG194
multu $1, $1
addiu $4, $1, 5
sll $0, $0, 0
TAG194:
sll $2, $4, 4
lui $1, 1
sll $0, $0, 0
mflo $3
TAG195:
lui $4, 9
sll $0, $0, 0
sltiu $3, $3, 11
mthi $4
TAG196:
blez $3, TAG197
mfhi $3
bne $3, $3, TAG197
mthi $3
TAG197:
mtlo $3
bgtz $3, TAG198
mthi $3
mthi $3
TAG198:
lui $4, 3
blez $3, TAG199
sra $1, $3, 13
mthi $4
TAG199:
addu $2, $1, $1
divu $2, $2
sh $1, 0($1)
mfhi $1
TAG200:
bne $1, $1, TAG201
mfhi $4
bltz $4, TAG201
mflo $3
TAG201:
lb $2, 0($3)
bne $3, $2, TAG202
divu $3, $3
sh $2, 0($2)
TAG202:
beq $2, $2, TAG203
mfhi $2
beq $2, $2, TAG203
sh $2, 0($2)
TAG203:
sh $2, 0($2)
sh $2, 0($2)
sh $2, 0($2)
add $3, $2, $2
TAG204:
srlv $3, $3, $3
blez $3, TAG205
xori $3, $3, 11
addiu $2, $3, 7
TAG205:
lui $3, 1
sll $0, $0, 0
lui $2, 15
subu $2, $2, $1
TAG206:
lui $1, 12
mthi $2
mtlo $1
subu $2, $2, $2
TAG207:
bne $2, $2, TAG208
lui $2, 1
xori $2, $2, 5
sllv $2, $2, $2
TAG208:
mfhi $1
sltu $1, $1, $2
subu $1, $2, $1
sll $0, $0, 0
TAG209:
sltiu $1, $4, 9
mfhi $3
mfhi $4
sll $0, $0, 0
TAG210:
mthi $4
lui $3, 1
or $1, $4, $3
lui $4, 13
TAG211:
sll $0, $0, 0
sll $0, $0, 0
multu $1, $4
beq $4, $1, TAG212
TAG212:
sltiu $3, $1, 9
lui $2, 9
bgtz $1, TAG213
addiu $4, $1, 15
TAG213:
addiu $3, $4, 3
sll $0, $0, 0
andi $1, $2, 9
sll $0, $0, 0
TAG214:
mult $1, $1
mult $1, $1
sllv $4, $1, $1
sh $1, 0($1)
TAG215:
lw $3, 0($4)
beq $3, $3, TAG216
lhu $1, 0($4)
mult $1, $3
TAG216:
multu $1, $1
lh $1, 0($1)
slt $1, $1, $1
mflo $4
TAG217:
xor $2, $4, $4
multu $4, $4
sb $2, 0($4)
beq $4, $2, TAG218
TAG218:
sb $2, 0($2)
bne $2, $2, TAG219
mtlo $2
sb $2, 0($2)
TAG219:
sw $2, 0($2)
sw $2, 0($2)
mult $2, $2
subu $4, $2, $2
TAG220:
bne $4, $4, TAG221
lui $3, 2
mtlo $3
andi $2, $4, 6
TAG221:
blez $2, TAG222
lui $3, 5
bne $3, $2, TAG222
addi $2, $3, 9
TAG222:
sw $2, 0($2)
sh $2, 0($2)
slti $4, $2, 7
xori $4, $2, 0
TAG223:
mult $4, $4
lui $2, 12
sll $0, $0, 0
bne $2, $4, TAG224
TAG224:
lui $3, 8
sll $0, $0, 0
beq $2, $3, TAG225
sll $0, $0, 0
TAG225:
divu $3, $3
sll $0, $0, 0
lui $4, 3
blez $1, TAG226
TAG226:
sll $0, $0, 0
srl $2, $4, 4
lhu $4, -12288($2)
bne $4, $4, TAG227
TAG227:
lui $4, 8
bne $4, $4, TAG228
sll $0, $0, 0
lui $2, 10
TAG228:
lui $1, 9
sll $0, $0, 0
bne $2, $2, TAG229
mtlo $2
TAG229:
sll $0, $0, 0
sll $2, $2, 13
xori $3, $1, 5
lui $3, 8
TAG230:
srav $1, $3, $3
bne $1, $1, TAG231
mfhi $3
mtlo $3
TAG231:
blez $3, TAG232
sh $3, 0($3)
bltz $3, TAG232
lhu $4, 0($3)
TAG232:
divu $4, $4
divu $4, $4
blez $4, TAG233
addiu $3, $4, 14
TAG233:
sll $4, $3, 15
sll $0, $0, 0
bne $3, $2, TAG234
mflo $1
TAG234:
lui $2, 0
bne $2, $2, TAG235
mfhi $4
mfhi $1
TAG235:
bltz $1, TAG236
sb $1, 0($1)
addiu $4, $1, 4
bgez $4, TAG236
TAG236:
sllv $4, $4, $4
lb $3, 0($4)
multu $4, $3
div $4, $4
TAG237:
lhu $3, 0($3)
addiu $1, $3, 3
lui $1, 4
mfhi $4
TAG238:
mtlo $4
lui $4, 0
bgtz $4, TAG239
lui $2, 7
TAG239:
lui $2, 5
subu $1, $2, $2
srlv $1, $2, $2
mfhi $4
TAG240:
sh $4, 0($4)
addi $4, $4, 11
lui $3, 4
sll $0, $0, 0
TAG241:
srav $1, $3, $3
sll $0, $0, 0
lui $3, 3
mult $3, $1
TAG242:
lui $2, 14
and $1, $3, $2
beq $1, $2, TAG243
mfhi $2
TAG243:
bgtz $2, TAG244
mthi $2
lui $4, 11
mtlo $2
TAG244:
mthi $4
or $3, $4, $4
lb $2, 0($3)
mthi $4
TAG245:
multu $2, $2
beq $2, $2, TAG246
lb $2, 0($2)
ori $2, $2, 5
TAG246:
mtlo $2
addiu $2, $2, 14
bgtz $2, TAG247
mthi $2
TAG247:
addu $4, $2, $2
mflo $2
mthi $2
beq $2, $2, TAG248
TAG248:
sh $2, 0($2)
bne $2, $2, TAG249
sra $1, $2, 3
sltu $2, $1, $2
TAG249:
mthi $2
slti $3, $2, 14
sh $2, 0($2)
beq $3, $3, TAG250
TAG250:
or $3, $3, $3
div $3, $3
bne $3, $3, TAG251
mflo $1
TAG251:
addiu $2, $1, 6
bne $2, $2, TAG252
mthi $2
slt $4, $1, $1
TAG252:
mfhi $2
ori $4, $2, 13
mtlo $2
blez $4, TAG253
TAG253:
srlv $1, $4, $4
mfhi $4
sltiu $3, $4, 3
multu $3, $4
TAG254:
mthi $3
add $2, $3, $3
bne $3, $2, TAG255
multu $2, $3
TAG255:
mfhi $4
nor $2, $4, $4
nor $3, $2, $4
multu $2, $3
TAG256:
bgez $3, TAG257
srav $2, $3, $3
bgez $2, TAG257
lhu $1, 0($3)
TAG257:
srav $2, $1, $1
addu $1, $1, $2
lh $4, 0($1)
xori $4, $1, 8
TAG258:
mult $4, $4
divu $4, $4
slti $2, $4, 6
sw $2, 0($2)
TAG259:
multu $2, $2
mfhi $1
bltz $1, TAG260
mtlo $2
TAG260:
lhu $2, 0($1)
bne $2, $2, TAG261
srav $3, $2, $2
sltu $4, $2, $3
TAG261:
beq $4, $4, TAG262
mult $4, $4
slt $1, $4, $4
multu $1, $4
TAG262:
sb $1, 0($1)
xor $4, $1, $1
andi $1, $1, 12
bne $1, $1, TAG263
TAG263:
lw $3, 0($1)
mthi $3
srav $2, $1, $1
lui $4, 2
TAG264:
srl $3, $4, 1
mult $3, $3
lui $3, 15
srl $2, $4, 7
TAG265:
bne $2, $2, TAG266
sw $2, -1024($2)
mult $2, $2
bgez $2, TAG266
TAG266:
ori $2, $2, 9
lui $2, 9
sll $0, $0, 0
sll $0, $0, 0
TAG267:
bgtz $2, TAG268
mflo $4
srlv $4, $2, $4
lui $3, 11
TAG268:
sll $0, $0, 0
mtlo $3
mflo $3
blez $3, TAG269
TAG269:
addu $1, $3, $3
mflo $4
mthi $1
mult $3, $4
TAG270:
mfhi $3
lui $2, 2
multu $3, $2
lui $3, 0
TAG271:
bltz $3, TAG272
lui $4, 13
bgez $4, TAG272
lui $2, 9
TAG272:
sll $4, $2, 7
divu $4, $2
xor $3, $2, $2
sll $3, $2, 14
TAG273:
sll $0, $0, 0
bne $3, $3, TAG274
addiu $2, $3, 7
mtlo $3
TAG274:
sll $0, $0, 0
lui $3, 4
mfhi $1
sll $0, $0, 0
TAG275:
sb $1, 0($1)
mflo $4
srl $2, $1, 0
mtlo $4
TAG276:
bgtz $2, TAG277
mult $2, $2
and $2, $2, $2
xori $3, $2, 6
TAG277:
srl $1, $3, 3
mfhi $4
mfhi $4
sh $1, 0($3)
TAG278:
sw $4, 0($4)
beq $4, $4, TAG279
lui $4, 2
sb $4, 0($4)
TAG279:
mthi $4
mfhi $4
addiu $1, $4, 12
slt $4, $4, $4
TAG280:
blez $4, TAG281
lb $3, 0($4)
ori $3, $4, 15
srlv $2, $3, $4
TAG281:
beq $2, $2, TAG282
mflo $4
srlv $4, $4, $4
mflo $3
TAG282:
mtlo $3
lw $1, 0($3)
srl $4, $3, 15
lui $3, 6
TAG283:
sll $4, $3, 11
lui $4, 11
sll $0, $0, 0
mfhi $2
TAG284:
sllv $3, $2, $2
sltiu $4, $2, 2
bltz $4, TAG285
lui $2, 9
TAG285:
sll $0, $0, 0
addiu $4, $2, 13
sll $0, $0, 0
lui $2, 10
TAG286:
mfhi $4
lui $4, 8
mult $4, $2
addiu $1, $2, 11
TAG287:
divu $1, $1
mfhi $4
mtlo $4
bne $1, $4, TAG288
TAG288:
lui $1, 7
sra $1, $1, 13
lui $1, 4
mfhi $1
TAG289:
lui $1, 13
srav $4, $1, $1
sll $0, $0, 0
mtlo $1
TAG290:
sll $0, $0, 0
srav $3, $4, $4
sll $0, $0, 0
lui $1, 10
TAG291:
bne $1, $1, TAG292
mflo $2
mthi $2
mult $1, $1
TAG292:
mthi $2
bltz $2, TAG293
sll $0, $0, 0
sra $3, $2, 7
TAG293:
sll $0, $0, 0
bgtz $1, TAG294
sll $0, $0, 0
or $1, $1, $4
TAG294:
sll $0, $0, 0
slt $1, $1, $1
sh $1, 0($1)
bgtz $1, TAG295
TAG295:
mult $1, $1
lui $1, 4
sll $0, $0, 0
sll $0, $0, 0
TAG296:
slti $4, $1, 6
mflo $4
beq $4, $4, TAG297
mthi $1
TAG297:
lw $4, 0($4)
lbu $3, 0($4)
lui $4, 9
xori $1, $4, 0
TAG298:
bgez $1, TAG299
sll $0, $0, 0
beq $4, $4, TAG299
multu $1, $4
TAG299:
div $4, $4
bgez $4, TAG300
addiu $1, $4, 8
beq $4, $1, TAG300
TAG300:
mult $1, $1
bgtz $1, TAG301
mtlo $1
bne $1, $1, TAG301
TAG301:
mflo $3
sll $0, $0, 0
mflo $2
and $3, $2, $3
TAG302:
sll $0, $0, 0
sra $3, $4, 1
sll $4, $4, 5
sll $0, $0, 0
TAG303:
mtlo $1
divu $1, $1
beq $1, $1, TAG304
sll $0, $0, 0
TAG304:
lui $3, 8
lui $3, 7
divu $3, $3
addu $3, $3, $3
TAG305:
xor $3, $3, $3
or $3, $3, $3
lui $3, 5
blez $3, TAG306
TAG306:
mfhi $1
mflo $2
and $3, $3, $3
bltz $2, TAG307
TAG307:
lui $2, 2
sll $0, $0, 0
lui $2, 8
mult $3, $3
TAG308:
mfhi $3
lb $3, 0($3)
blez $3, TAG309
lui $2, 4
TAG309:
mfhi $1
div $2, $2
mult $1, $2
lui $1, 9
TAG310:
mfhi $4
mtlo $1
blez $4, TAG311
subu $2, $4, $1
TAG311:
lui $2, 12
sra $2, $2, 15
lhu $4, 0($2)
sltiu $4, $4, 15
TAG312:
lb $4, 0($4)
mthi $4
sh $4, 0($4)
bgtz $4, TAG313
TAG313:
xori $4, $4, 2
bgtz $4, TAG314
mfhi $3
sb $4, 0($4)
TAG314:
lui $4, 7
bgez $3, TAG315
andi $4, $4, 9
blez $3, TAG315
TAG315:
mflo $3
ori $2, $3, 14
mult $2, $4
sll $0, $0, 0
TAG316:
mflo $2
lui $1, 15
lhu $3, 0($2)
mult $1, $2
TAG317:
srl $3, $3, 15
sb $3, 0($3)
multu $3, $3
mtlo $3
TAG318:
mthi $3
mfhi $3
lh $1, 0($3)
andi $1, $3, 13
TAG319:
mfhi $3
lb $4, 0($1)
mtlo $1
slti $2, $3, 2
TAG320:
addu $3, $2, $2
ori $3, $2, 13
mfhi $3
bgtz $3, TAG321
TAG321:
mult $3, $3
lb $4, 0($3)
bne $4, $4, TAG322
addiu $3, $4, 4
TAG322:
mfhi $4
sh $4, 0($4)
lui $3, 10
lui $2, 9
TAG323:
mult $2, $2
mflo $2
bne $2, $2, TAG324
sh $2, 0($2)
TAG324:
lui $2, 6
slt $2, $2, $2
lhu $1, 0($2)
sllv $2, $2, $2
TAG325:
lbu $4, 0($2)
blez $2, TAG326
sh $4, 0($4)
bne $2, $2, TAG326
TAG326:
mflo $2
lui $1, 13
multu $2, $4
mtlo $1
TAG327:
mfhi $3
blez $3, TAG328
mtlo $1
lui $4, 4
TAG328:
mflo $1
sw $1, 0($4)
sb $1, 0($4)
lui $4, 4
TAG329:
lui $2, 8
beq $2, $4, TAG330
mtlo $4
mfhi $3
TAG330:
and $4, $3, $3
mult $3, $3
beq $4, $3, TAG331
mult $3, $3
TAG331:
mtlo $4
bgtz $4, TAG332
srl $4, $4, 4
mthi $4
TAG332:
bne $4, $4, TAG333
sh $4, 0($4)
lb $1, 0($4)
xori $2, $4, 15
TAG333:
bne $2, $2, TAG334
lui $4, 0
mthi $4
blez $4, TAG334
TAG334:
sub $2, $4, $4
lhu $3, 0($4)
sw $2, 0($3)
mult $3, $2
TAG335:
mtlo $3
mflo $1
mfhi $4
mthi $4
TAG336:
lw $2, 0($4)
mflo $3
beq $3, $4, TAG337
mthi $4
TAG337:
sb $3, 0($3)
addi $1, $3, 10
lbu $2, 0($1)
ori $1, $3, 6
TAG338:
lui $3, 8
mult $1, $3
blez $3, TAG339
lui $3, 1
TAG339:
blez $3, TAG340
mflo $4
sll $0, $0, 0
mfhi $3
TAG340:
slti $1, $3, 6
bgez $1, TAG341
mtlo $3
addi $4, $3, 7
TAG341:
bgez $4, TAG342
slti $1, $4, 2
mflo $3
addiu $3, $1, 0
TAG342:
beq $3, $3, TAG343
multu $3, $3
lui $4, 4
mthi $4
TAG343:
bne $4, $4, TAG344
mtlo $4
beq $4, $4, TAG344
lui $3, 4
TAG344:
divu $3, $3
xori $3, $3, 6
beq $3, $3, TAG345
sll $0, $0, 0
TAG345:
mult $3, $3
lui $1, 4
bne $1, $1, TAG346
mult $1, $1
TAG346:
mthi $1
mthi $1
sll $3, $1, 8
addiu $2, $3, 12
TAG347:
sll $0, $0, 0
mult $2, $2
sll $0, $0, 0
multu $2, $2
TAG348:
srlv $3, $2, $2
blez $3, TAG349
sll $0, $0, 0
sll $0, $0, 0
TAG349:
or $1, $3, $3
xor $1, $1, $1
mtlo $3
bgtz $1, TAG350
TAG350:
multu $1, $1
bgtz $1, TAG351
lui $1, 14
multu $1, $1
TAG351:
lui $1, 4
sltu $2, $1, $1
bltz $1, TAG352
subu $2, $1, $1
TAG352:
lui $4, 2
multu $4, $2
mfhi $2
blez $2, TAG353
TAG353:
mult $2, $2
blez $2, TAG354
lui $3, 13
ori $3, $3, 0
TAG354:
lui $1, 15
subu $1, $3, $3
multu $1, $1
sb $3, 0($1)
TAG355:
lbu $2, 0($1)
lbu $2, 0($1)
lui $1, 12
lui $2, 10
TAG356:
mfhi $4
mtlo $2
blez $2, TAG357
sll $0, $0, 0
TAG357:
mflo $4
multu $4, $1
mthi $1
mtlo $1
TAG358:
sll $0, $0, 0
divu $4, $4
addu $3, $4, $4
sll $0, $0, 0
TAG359:
beq $3, $3, TAG360
sll $0, $0, 0
sb $3, 0($3)
addi $2, $3, 15
TAG360:
sll $0, $0, 0
bne $2, $2, TAG361
multu $2, $2
bgtz $2, TAG361
TAG361:
sll $0, $0, 0
sra $2, $2, 3
mflo $1
sltiu $2, $1, 6
TAG362:
mflo $1
beq $2, $2, TAG363
sb $2, 0($2)
blez $2, TAG363
TAG363:
lh $1, 0($1)
addiu $4, $1, 9
bgez $1, TAG364
addiu $4, $1, 1
TAG364:
blez $4, TAG365
mfhi $4
mthi $4
lui $3, 10
TAG365:
sltiu $2, $3, 10
sw $3, 0($2)
ori $1, $2, 1
lui $1, 1
TAG366:
bne $1, $1, TAG367
addiu $2, $1, 8
mtlo $2
addu $4, $2, $2
TAG367:
beq $4, $4, TAG368
lui $2, 6
lui $2, 11
xor $3, $2, $2
TAG368:
blez $3, TAG369
sll $0, $0, 0
mflo $1
bgtz $3, TAG369
TAG369:
mult $1, $1
sll $0, $0, 0
slt $1, $2, $2
addiu $3, $1, 6
TAG370:
sltiu $2, $3, 7
lui $3, 6
mthi $3
lb $1, 0($2)
TAG371:
lh $4, 0($1)
nor $2, $1, $1
beq $2, $2, TAG372
multu $2, $2
TAG372:
mfhi $4
lhu $2, 1($2)
lh $3, 2($4)
lui $1, 2
TAG373:
mflo $4
bltz $4, TAG374
srav $2, $1, $4
sb $2, 0($4)
TAG374:
sll $0, $0, 0
srl $3, $2, 11
sll $0, $0, 0
divu $3, $2
TAG375:
mtlo $4
andi $1, $4, 9
sltiu $2, $4, 12
lbu $2, 0($2)
TAG376:
bne $2, $2, TAG377
sh $2, 0($2)
mult $2, $2
blez $2, TAG377
TAG377:
sra $4, $2, 2
bne $2, $4, TAG378
mtlo $2
blez $4, TAG378
TAG378:
mthi $4
lh $1, 0($4)
ori $1, $4, 0
sb $1, 0($1)
TAG379:
multu $1, $1
sw $1, 0($1)
mult $1, $1
mult $1, $1
TAG380:
mfhi $4
mfhi $1
mflo $1
sh $4, 0($4)
TAG381:
lbu $4, 0($1)
beq $4, $4, TAG382
lui $4, 6
lui $2, 7
TAG382:
lui $2, 6
mfhi $3
mtlo $2
lui $2, 3
TAG383:
srl $3, $2, 13
bgtz $2, TAG384
xor $4, $2, $3
mflo $3
TAG384:
mflo $3
mthi $3
lui $1, 3
sll $0, $0, 0
TAG385:
mthi $1
divu $1, $1
bgtz $1, TAG386
sra $1, $1, 12
TAG386:
bgtz $1, TAG387
mult $1, $1
bltz $1, TAG387
mflo $4
TAG387:
divu $4, $4
xor $2, $4, $4
lui $1, 14
lui $1, 15
TAG388:
sll $0, $0, 0
bgtz $1, TAG389
mult $1, $1
lb $1, 0($1)
TAG389:
lui $1, 11
beq $1, $1, TAG390
lui $1, 12
divu $1, $1
TAG390:
mtlo $1
ori $1, $1, 13
addiu $4, $1, 5
sll $0, $0, 0
TAG391:
divu $1, $1
addiu $4, $1, 12
bltz $1, TAG392
multu $1, $1
TAG392:
div $4, $4
mthi $4
bgez $4, TAG393
xor $1, $4, $4
TAG393:
mfhi $1
mflo $3
sll $0, $0, 0
lb $3, 0($3)
TAG394:
sb $3, 0($3)
sltu $3, $3, $3
multu $3, $3
mthi $3
TAG395:
mtlo $3
mtlo $3
mflo $1
nor $4, $3, $1
TAG396:
mfhi $1
mtlo $1
mult $4, $1
mfhi $2
TAG397:
sh $2, 0($2)
beq $2, $2, TAG398
mult $2, $2
addi $4, $2, 4
TAG398:
addiu $3, $4, 10
srav $1, $3, $4
beq $3, $1, TAG399
divu $1, $4
TAG399:
sllv $4, $1, $1
lw $2, 0($4)
sw $1, 0($4)
multu $4, $2
TAG400:
mult $2, $2
addu $4, $2, $2
mtlo $4
sltu $3, $4, $2
TAG401:
bne $3, $3, TAG402
sw $3, 0($3)
sb $3, 0($3)
or $4, $3, $3
TAG402:
srl $4, $4, 13
xori $2, $4, 6
lhu $3, 0($4)
lui $4, 4
TAG403:
and $3, $4, $4
sll $0, $0, 0
slti $2, $3, 15
bne $3, $3, TAG404
TAG404:
mflo $3
sw $2, 0($2)
addiu $4, $2, 0
sh $2, 0($3)
TAG405:
bgtz $4, TAG406
mthi $4
sb $4, 0($4)
mthi $4
TAG406:
mult $4, $4
mflo $3
mfhi $4
mthi $4
TAG407:
ori $4, $4, 14
mflo $3
xor $2, $4, $3
mtlo $2
TAG408:
lhu $1, 0($2)
addiu $2, $2, 15
div $2, $2
sb $1, 0($2)
TAG409:
mthi $2
lui $1, 6
lui $1, 1
bne $1, $1, TAG410
TAG410:
lui $1, 5
bltz $1, TAG411
lui $4, 4
divu $1, $1
TAG411:
mult $4, $4
sltu $3, $4, $4
lui $3, 6
sra $4, $3, 6
TAG412:
bgez $4, TAG413
sb $4, -6144($4)
sw $4, 0($4)
lui $3, 6
TAG413:
sltiu $4, $3, 10
mthi $3
sw $4, 0($4)
mtlo $3
TAG414:
multu $4, $4
mult $4, $4
mult $4, $4
bne $4, $4, TAG415
TAG415:
mtlo $4
beq $4, $4, TAG416
sw $4, 0($4)
mfhi $3
TAG416:
mfhi $2
sll $3, $3, 1
andi $3, $2, 2
mflo $1
TAG417:
mtlo $1
sllv $3, $1, $1
lui $1, 1
sll $0, $0, 0
TAG418:
multu $3, $3
mfhi $2
mfhi $2
lui $3, 6
TAG419:
mthi $3
lui $1, 9
xor $3, $1, $1
multu $3, $1
TAG420:
srl $1, $3, 7
addiu $1, $1, 1
beq $1, $3, TAG421
mtlo $1
TAG421:
lbu $3, 0($1)
srl $2, $3, 14
bne $1, $1, TAG422
mult $3, $1
TAG422:
lh $1, 0($2)
mthi $2
mfhi $4
andi $3, $4, 2
TAG423:
bgtz $3, TAG424
lui $2, 15
mthi $3
sll $0, $0, 0
TAG424:
sll $0, $0, 0
mtlo $2
srlv $1, $2, $2
mflo $3
TAG425:
xori $3, $3, 4
div $3, $3
bgez $3, TAG426
mtlo $3
TAG426:
mtlo $3
sll $0, $0, 0
multu $3, $3
bltz $3, TAG427
TAG427:
mflo $1
bne $3, $1, TAG428
addu $4, $1, $1
sllv $1, $4, $4
TAG428:
sll $0, $0, 0
addu $3, $1, $1
lui $3, 4
bltz $3, TAG429
TAG429:
mthi $3
sll $2, $3, 14
mfhi $1
bgtz $3, TAG430
TAG430:
mult $1, $1
mfhi $3
xori $2, $1, 5
lui $1, 7
TAG431:
sll $0, $0, 0
mflo $2
lui $1, 6
beq $1, $1, TAG432
TAG432:
sll $0, $0, 0
sll $0, $0, 0
ori $2, $1, 8
addiu $1, $1, 5
TAG433:
div $1, $1
and $1, $1, $1
beq $1, $1, TAG434
divu $1, $1
TAG434:
sll $0, $0, 0
bne $1, $4, TAG435
mthi $4
lui $1, 11
TAG435:
bne $1, $1, TAG436
div $1, $1
slti $1, $1, 8
mult $1, $1
TAG436:
mtlo $1
sra $1, $1, 11
mflo $1
lw $3, 0($1)
TAG437:
sh $3, 0($3)
sh $3, 0($3)
mtlo $3
sra $4, $3, 5
TAG438:
nor $1, $4, $4
lui $3, 5
bltz $4, TAG439
sb $4, 0($4)
TAG439:
mthi $3
srlv $2, $3, $3
beq $2, $2, TAG440
sllv $3, $2, $3
TAG440:
beq $3, $3, TAG441
div $3, $3
sb $3, 0($3)
srl $1, $3, 12
TAG441:
multu $1, $1
mtlo $1
slt $3, $1, $1
bgez $3, TAG442
TAG442:
andi $4, $3, 4
mfhi $4
bgez $3, TAG443
lui $4, 7
TAG443:
mfhi $3
sll $0, $0, 0
beq $3, $2, TAG444
lui $2, 4
TAG444:
slt $2, $2, $2
sw $2, 0($2)
bne $2, $2, TAG445
sub $4, $2, $2
TAG445:
sra $1, $4, 4
andi $4, $1, 3
mflo $2
sh $1, 0($1)
TAG446:
multu $2, $2
beq $2, $2, TAG447
mfhi $4
sb $4, 0($4)
TAG447:
sll $0, $0, 0
lbu $4, 2($4)
bgtz $4, TAG448
sra $3, $4, 5
TAG448:
lui $1, 9
bltz $1, TAG449
mtlo $3
sw $3, 0($3)
TAG449:
mult $1, $1
sra $1, $1, 14
blez $1, TAG450
slti $4, $1, 7
TAG450:
mthi $4
lbu $4, 0($4)
addu $1, $4, $4
bgez $1, TAG451
TAG451:
mflo $3
mflo $4
srlv $1, $1, $3
mflo $3
TAG452:
lui $3, 15
sll $0, $0, 0
sll $0, $0, 0
or $1, $1, $1
TAG453:
lb $4, 0($1)
or $4, $4, $1
bgez $4, TAG454
mthi $4
TAG454:
mtlo $4
andi $3, $4, 12
bne $4, $4, TAG455
mtlo $3
TAG455:
mfhi $1
bltz $1, TAG456
mtlo $1
mthi $3
TAG456:
mthi $1
lbu $2, 0($1)
blez $1, TAG457
mtlo $1
TAG457:
add $3, $2, $2
mult $3, $3
lui $1, 5
bgez $2, TAG458
TAG458:
sll $0, $0, 0
blez $1, TAG459
lui $3, 7
lui $3, 15
TAG459:
addu $1, $3, $3
lui $1, 5
bne $3, $1, TAG460
sll $0, $0, 0
TAG460:
sb $4, 0($4)
bne $4, $4, TAG461
lbu $1, 0($4)
blez $1, TAG461
TAG461:
lui $2, 9
beq $1, $2, TAG462
sb $1, 0($1)
sll $0, $0, 0
TAG462:
lui $3, 13
divu $3, $2
beq $3, $2, TAG463
andi $3, $2, 0
TAG463:
mflo $1
bgtz $3, TAG464
lhu $3, 0($3)
sh $3, 0($3)
TAG464:
lui $1, 13
mflo $4
slti $4, $4, 13
lui $2, 1
TAG465:
lui $3, 9
sll $0, $0, 0
sll $1, $3, 3
beq $3, $3, TAG466
TAG466:
sltiu $4, $1, 3
sll $0, $0, 0
srav $3, $1, $4
mthi $4
TAG467:
bgtz $3, TAG468
mfhi $3
mtlo $3
blez $3, TAG468
TAG468:
sw $3, 0($3)
mflo $4
bne $4, $4, TAG469
sub $3, $3, $3
TAG469:
xori $4, $3, 14
slti $2, $3, 6
slti $1, $4, 3
lui $3, 5
TAG470:
sll $0, $0, 0
sltu $3, $3, $3
mtlo $3
mtlo $3
TAG471:
beq $3, $3, TAG472
srlv $2, $3, $3
bne $2, $2, TAG472
sub $2, $2, $2
TAG472:
mthi $2
multu $2, $2
bne $2, $2, TAG473
slt $4, $2, $2
TAG473:
lui $2, 11
sh $4, 0($4)
sll $3, $4, 12
sll $0, $0, 0
TAG474:
mtlo $4
bne $4, $4, TAG475
srl $1, $4, 10
sh $1, 0($1)
TAG475:
sll $1, $1, 0
mfhi $4
beq $1, $1, TAG476
mult $1, $4
TAG476:
lui $1, 13
or $4, $4, $1
sll $0, $0, 0
sll $0, $0, 0
TAG477:
subu $4, $4, $4
and $3, $4, $4
lui $1, 12
lb $2, 0($4)
TAG478:
sh $2, 0($2)
sh $2, 0($2)
bltz $2, TAG479
lh $2, 0($2)
TAG479:
mthi $2
lb $1, 0($2)
lui $1, 15
srl $3, $1, 13
TAG480:
sw $3, 0($3)
bgez $3, TAG481
mult $3, $3
sb $3, 0($3)
TAG481:
sll $3, $3, 2
xor $2, $3, $3
bgtz $3, TAG482
mfhi $4
TAG482:
multu $4, $4
lui $2, 0
lw $3, 0($2)
lb $1, 0($4)
TAG483:
lb $1, 0($1)
bltz $1, TAG484
lui $2, 9
lbu $3, 0($1)
TAG484:
mflo $1
mtlo $3
addi $1, $3, 3
lui $3, 14
TAG485:
lui $2, 15
mthi $3
sll $0, $0, 0
mtlo $3
TAG486:
mtlo $3
mthi $3
beq $3, $3, TAG487
mtlo $3
TAG487:
multu $3, $3
subu $1, $3, $3
mult $1, $3
mthi $1
TAG488:
xori $4, $1, 12
sb $4, 0($4)
lw $1, 0($1)
mult $1, $1
TAG489:
beq $1, $1, TAG490
sltu $3, $1, $1
lb $3, 0($3)
lbu $4, 0($3)
TAG490:
lui $1, 7
sh $1, 0($4)
sw $4, 0($4)
mflo $2
TAG491:
multu $2, $2
mthi $2
sh $2, 0($2)
addi $3, $2, 12
TAG492:
bltz $3, TAG493
lui $1, 11
blez $1, TAG493
mthi $3
TAG493:
divu $1, $1
div $1, $1
div $1, $1
bgtz $1, TAG494
TAG494:
sll $0, $0, 0
mult $1, $1
sw $1, 0($4)
blez $4, TAG495
TAG495:
lui $3, 5
subu $1, $3, $4
addiu $2, $3, 4
mthi $4
TAG496:
xor $1, $2, $2
mfhi $1
sll $0, $0, 0
bgtz $1, TAG497
TAG497:
lui $3, 2
mtlo $3
ori $4, $1, 3
mfhi $2
TAG498:
bltz $2, TAG499
divu $2, $2
mtlo $2
addiu $4, $2, 7
TAG499:
bne $4, $4, TAG500
lui $2, 15
mthi $4
lui $1, 0
TAG500:
slti $4, $1, 14
multu $4, $1
lui $4, 4
sll $0, $0, 0
TAG501:
div $4, $4
mfhi $2
div $2, $4
mthi $2
TAG502:
bltz $2, TAG503
mfhi $3
sltiu $4, $2, 9
multu $3, $3
TAG503:
lb $3, 0($4)
xor $3, $3, $4
sb $3, 0($3)
sb $3, 0($3)
TAG504:
bgtz $3, TAG505
lui $2, 15
mtlo $2
bgtz $3, TAG505
TAG505:
addiu $2, $2, 11
subu $2, $2, $2
lui $3, 4
mtlo $3
TAG506:
mfhi $2
lui $2, 8
bgtz $2, TAG507
sll $0, $0, 0
TAG507:
xor $1, $2, $2
sra $3, $2, 13
beq $2, $1, TAG508
sll $0, $0, 0
TAG508:
srlv $3, $3, $3
div $3, $3
slti $4, $3, 4
addiu $3, $3, 11
TAG509:
blez $3, TAG510
andi $3, $3, 8
mfhi $4
srl $2, $3, 15
TAG510:
sw $2, 0($2)
addi $1, $2, 5
and $3, $2, $1
mfhi $4
TAG511:
sra $3, $4, 9
bgez $4, TAG512
addiu $4, $3, 4
bltz $4, TAG512
TAG512:
lhu $4, 0($4)
mtlo $4
sll $1, $4, 1
lui $4, 13
TAG513:
mfhi $3
mtlo $3
mtlo $4
bltz $3, TAG514
TAG514:
lbu $1, 0($3)
mult $3, $1
bltz $1, TAG515
add $1, $3, $3
TAG515:
lbu $1, 0($1)
beq $1, $1, TAG516
mthi $1
sltu $3, $1, $1
TAG516:
lhu $3, 0($3)
lui $1, 8
andi $4, $1, 12
lui $1, 12
TAG517:
bne $1, $1, TAG518
sll $3, $1, 12
bne $3, $3, TAG518
srlv $1, $3, $3
TAG518:
mflo $1
addiu $3, $1, 6
slt $1, $1, $1
lh $4, 0($1)
TAG519:
mfhi $1
mthi $1
lui $4, 15
blez $1, TAG520
TAG520:
mflo $3
bgez $4, TAG521
addu $1, $4, $3
mfhi $1
TAG521:
sll $0, $0, 0
mfhi $2
lui $2, 6
bgtz $2, TAG522
TAG522:
xori $4, $2, 4
mthi $4
subu $2, $4, $2
beq $2, $4, TAG523
TAG523:
lui $1, 4
sw $1, 0($2)
bne $2, $1, TAG524
div $1, $2
TAG524:
mtlo $1
sll $0, $0, 0
bne $2, $2, TAG525
lbu $3, 0($2)
TAG525:
mfhi $4
mfhi $2
mflo $4
divu $3, $4
TAG526:
divu $4, $4
sll $0, $0, 0
lui $3, 14
lui $2, 0
TAG527:
bne $2, $2, TAG528
srav $4, $2, $2
mfhi $4
ori $3, $4, 14
TAG528:
sh $3, 0($3)
subu $2, $3, $3
lhu $3, 0($3)
sh $3, 0($3)
TAG529:
mult $3, $3
lhu $2, 0($3)
lui $2, 12
addu $2, $2, $2
TAG530:
bne $2, $2, TAG531
sll $0, $0, 0
lui $1, 5
div $1, $2
TAG531:
lui $1, 0
beq $1, $1, TAG532
addi $3, $1, 13
beq $1, $1, TAG532
TAG532:
lbu $3, 0($3)
mthi $3
multu $3, $3
beq $3, $3, TAG533
TAG533:
mtlo $3
lui $3, 0
lh $2, 0($3)
mult $3, $3
TAG534:
sw $2, 0($2)
bgez $2, TAG535
slti $3, $2, 1
mtlo $3
TAG535:
lui $4, 4
srlv $1, $4, $4
sll $4, $3, 14
addiu $4, $4, 13
TAG536:
bgez $4, TAG537
slti $4, $4, 12
mthi $4
div $4, $4
TAG537:
sh $4, 0($4)
beq $4, $4, TAG538
mult $4, $4
subu $4, $4, $4
TAG538:
mfhi $2
mtlo $4
bgtz $4, TAG539
srav $4, $2, $4
TAG539:
multu $4, $4
sw $4, 0($4)
mfhi $4
mtlo $4
TAG540:
lui $3, 8
lui $4, 7
lui $3, 12
xor $4, $4, $3
TAG541:
sll $0, $0, 0
mtlo $4
and $4, $4, $4
mfhi $4
TAG542:
sub $3, $4, $4
mtlo $4
bgtz $3, TAG543
mflo $2
TAG543:
lhu $4, 0($2)
beq $4, $2, TAG544
slti $3, $2, 8
bgez $4, TAG544
TAG544:
addiu $2, $3, 3
addu $3, $3, $3
multu $3, $3
mtlo $3
TAG545:
lui $1, 3
sll $0, $0, 0
sb $2, 0($3)
subu $1, $1, $3
TAG546:
sllv $1, $1, $1
lui $3, 10
mult $1, $3
bltz $3, TAG547
TAG547:
multu $3, $3
sra $4, $3, 2
beq $4, $4, TAG548
sll $0, $0, 0
TAG548:
lui $1, 6
srl $2, $1, 1
blez $1, TAG549
sltu $2, $4, $4
TAG549:
lh $2, 0($2)
mthi $2
subu $4, $2, $2
mthi $2
TAG550:
add $4, $4, $4
sltiu $1, $4, 7
slt $2, $1, $4
sllv $1, $2, $2
TAG551:
mthi $1
bgez $1, TAG552
mthi $1
bne $1, $1, TAG552
TAG552:
sb $1, 0($1)
bne $1, $1, TAG553
sh $1, 0($1)
mtlo $1
TAG553:
bgez $1, TAG554
mtlo $1
mflo $3
sltu $3, $1, $1
TAG554:
divu $3, $3
mult $3, $3
mult $3, $3
srl $2, $3, 3
TAG555:
sll $0, $0, 0
divu $3, $3
lui $3, 0
bgtz $3, TAG556
TAG556:
ori $4, $3, 8
div $4, $4
srav $1, $4, $4
beq $1, $4, TAG557
TAG557:
lb $2, 0($1)
lh $2, 0($1)
sw $2, 0($1)
mfhi $4
TAG558:
lui $4, 4
mflo $1
sll $0, $0, 0
mtlo $4
TAG559:
bgtz $1, TAG560
lb $3, 0($1)
lui $3, 1
lbu $4, 0($1)
TAG560:
mflo $1
sll $0, $0, 0
mflo $1
sra $2, $4, 15
TAG561:
div $2, $2
srl $4, $2, 8
beq $4, $2, TAG562
sh $4, 0($4)
TAG562:
sb $4, 0($4)
sw $4, 0($4)
mtlo $4
lh $1, 0($4)
TAG563:
mtlo $1
mtlo $1
lui $1, 3
sltiu $2, $1, 14
TAG564:
or $2, $2, $2
lui $1, 1
beq $2, $1, TAG565
sll $0, $0, 0
TAG565:
mthi $1
mfhi $3
mult $1, $1
mtlo $3
TAG566:
mfhi $2
divu $3, $2
lbu $1, 0($2)
slti $3, $2, 10
TAG567:
bne $3, $3, TAG568
lb $1, 0($3)
beq $1, $1, TAG568
sb $1, 0($1)
TAG568:
sb $1, 0($1)
mfhi $4
sw $4, 0($4)
sb $4, 0($1)
TAG569:
lui $1, 10
mthi $4
lhu $4, 0($4)
ori $3, $4, 7
TAG570:
subu $2, $3, $3
sltiu $2, $2, 4
mtlo $2
multu $2, $3
TAG571:
mfhi $2
beq $2, $2, TAG572
lbu $2, 0($2)
mtlo $2
TAG572:
sltiu $2, $2, 5
nor $1, $2, $2
mfhi $2
multu $2, $2
TAG573:
bgez $2, TAG574
sw $2, 0($2)
sub $3, $2, $2
divu $2, $3
TAG574:
lui $2, 15
divu $3, $3
bgez $3, TAG575
sb $3, 0($3)
TAG575:
sll $0, $0, 0
lui $3, 9
sll $0, $0, 0
lui $4, 2
TAG576:
sll $0, $0, 0
multu $4, $4
mthi $4
sll $0, $0, 0
TAG577:
sll $0, $0, 0
sll $0, $0, 0
addiu $4, $4, 5
bne $2, $4, TAG578
TAG578:
mfhi $4
bne $4, $4, TAG579
nor $3, $4, $4
bgtz $4, TAG579
TAG579:
lui $1, 14
sra $4, $1, 1
bgtz $3, TAG580
sll $0, $0, 0
TAG580:
beq $2, $2, TAG581
andi $1, $2, 14
mfhi $3
lh $4, 0($2)
TAG581:
sltiu $2, $4, 2
sll $0, $0, 0
lui $3, 0
mult $4, $3
TAG582:
sw $3, 0($3)
mtlo $3
bgez $3, TAG583
mflo $2
TAG583:
lui $3, 3
sll $0, $0, 0
beq $2, $2, TAG584
andi $1, $2, 9
TAG584:
srav $4, $1, $1
sra $2, $4, 9
mfhi $2
mflo $1
TAG585:
sra $1, $1, 0
multu $1, $1
slti $3, $1, 11
bgez $1, TAG586
TAG586:
mthi $3
mflo $1
srl $4, $1, 9
sh $3, 0($4)
TAG587:
sltu $1, $4, $4
mtlo $1
multu $4, $4
lbu $3, 0($4)
TAG588:
bgez $3, TAG589
multu $3, $3
divu $3, $3
beq $3, $3, TAG589
TAG589:
multu $3, $3
sb $3, 0($3)
mfhi $3
mtlo $3
TAG590:
mfhi $4
mflo $4
bgtz $4, TAG591
addi $3, $4, 10
TAG591:
lh $1, 0($3)
beq $3, $3, TAG592
mult $3, $1
lb $2, 0($1)
TAG592:
mthi $2
mult $2, $2
lui $3, 13
xori $1, $2, 3
TAG593:
bgtz $1, TAG594
sb $1, 0($1)
beq $1, $1, TAG594
mfhi $3
TAG594:
bltz $3, TAG595
addu $2, $3, $3
addiu $4, $2, 13
sll $0, $0, 0
TAG595:
mfhi $3
sb $3, 0($3)
lui $1, 4
blez $3, TAG596
TAG596:
sll $0, $0, 0
sll $0, $0, 0
lui $2, 9
lui $3, 7
TAG597:
sll $0, $0, 0
bgtz $3, TAG598
addu $3, $3, $3
lui $3, 9
TAG598:
bgtz $3, TAG599
mtlo $3
lui $3, 11
or $4, $3, $3
TAG599:
bne $4, $4, TAG600
lui $3, 13
bne $3, $3, TAG600
divu $4, $3
TAG600:
xor $3, $3, $3
multu $3, $3
lh $4, 0($3)
mthi $4
TAG601:
lui $1, 13
divu $4, $1
bne $4, $4, TAG602
lb $4, -256($4)
TAG602:
addiu $2, $4, 14
sltu $4, $2, $4
lui $3, 14
blez $4, TAG603
TAG603:
mtlo $3
bltz $3, TAG604
sll $3, $3, 8
bne $3, $3, TAG604
TAG604:
sll $0, $0, 0
div $3, $1
blez $3, TAG605
sll $0, $0, 0
TAG605:
lui $1, 5
mult $1, $1
lui $4, 8
addu $3, $3, $3
TAG606:
sll $0, $0, 0
slti $2, $3, 9
sra $2, $3, 8
and $2, $3, $2
TAG607:
lh $1, 0($2)
beq $2, $2, TAG608
mtlo $2
lui $4, 2
TAG608:
srlv $3, $4, $4
sll $0, $0, 0
mflo $3
sb $3, 0($3)
TAG609:
beq $3, $3, TAG610
addu $2, $3, $3
bltz $3, TAG610
add $4, $2, $3
TAG610:
mflo $3
beq $3, $4, TAG611
lui $3, 1
beq $4, $4, TAG611
TAG611:
subu $1, $3, $3
nor $3, $3, $1
bgez $3, TAG612
lui $3, 2
TAG612:
bne $3, $3, TAG613
xor $4, $3, $3
sll $0, $0, 0
bne $3, $3, TAG613
TAG613:
mthi $4
lui $2, 10
addiu $4, $2, 7
mflo $1
TAG614:
mtlo $1
bltz $1, TAG615
sltiu $2, $1, 5
blez $2, TAG615
TAG615:
sb $2, 0($2)
mfhi $1
bgez $2, TAG616
mflo $4
TAG616:
mtlo $4
mfhi $3
mtlo $3
mfhi $1
TAG617:
mflo $1
lh $3, 0($1)
mthi $3
sh $1, -256($3)
TAG618:
lui $1, 2
ori $4, $3, 8
lui $1, 2
divu $1, $1
TAG619:
lui $3, 2
mtlo $3
mflo $2
bne $1, $2, TAG620
TAG620:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
subu $2, $2, $1
TAG621:
beq $2, $2, TAG622
sh $2, 0($2)
mthi $2
addiu $4, $2, 1
TAG622:
bne $4, $4, TAG623
lbu $3, -264($4)
sb $4, 0($3)
sllv $2, $4, $4
TAG623:
mtlo $2
mtlo $2
mthi $2
xori $1, $2, 15
TAG624:
div $1, $1
sll $0, $0, 0
sll $0, $0, 0
multu $1, $1
TAG625:
blez $1, TAG626
subu $1, $1, $1
mtlo $1
multu $1, $1
TAG626:
mult $1, $1
multu $1, $1
lbu $2, 0($1)
mtlo $2
TAG627:
div $2, $2
mthi $2
sw $2, 0($2)
mult $2, $2
TAG628:
sh $2, 0($2)
mtlo $2
mfhi $2
lui $3, 1
TAG629:
mfhi $4
slt $3, $3, $3
sb $3, 0($3)
sb $3, 0($3)
TAG630:
bne $3, $3, TAG631
slti $1, $3, 4
div $3, $1
xor $2, $3, $3
TAG631:
lui $4, 0
mflo $1
lui $3, 1
lui $3, 14
TAG632:
sll $0, $0, 0
beq $1, $1, TAG633
lui $4, 1
sll $4, $3, 7
TAG633:
bltz $4, TAG634
mtlo $4
sll $0, $0, 0
lui $3, 9
TAG634:
mflo $2
mtlo $3
mult $2, $2
sra $2, $3, 0
TAG635:
and $3, $2, $2
bgtz $2, TAG636
sra $4, $3, 11
mflo $4
TAG636:
mflo $2
bltz $2, TAG637
mthi $2
mtlo $4
TAG637:
sltiu $2, $2, 4
lbu $4, 0($2)
mthi $4
addu $2, $2, $2
TAG638:
lui $3, 6
sh $3, 0($2)
sh $3, 0($2)
lui $1, 1
TAG639:
and $3, $1, $1
sll $0, $0, 0
sll $0, $0, 0
mult $3, $3
TAG640:
mthi $3
subu $1, $3, $3
mult $1, $1
sltu $1, $3, $1
TAG641:
bgez $1, TAG642
lui $1, 9
mflo $2
sw $1, 0($2)
TAG642:
mthi $2
sh $2, 0($2)
sra $2, $2, 5
lbu $3, 0($2)
TAG643:
mfhi $2
lh $1, 0($3)
lui $1, 11
mult $2, $1
TAG644:
blez $1, TAG645
sll $0, $0, 0
bgez $1, TAG645
lui $4, 14
TAG645:
andi $2, $4, 14
sra $2, $4, 3
bltz $2, TAG646
mflo $2
TAG646:
sll $0, $0, 0
sll $0, $0, 0
mfhi $4
sb $4, 0($4)
TAG647:
multu $4, $4
lui $4, 11
mflo $2
mult $4, $4
TAG648:
blez $2, TAG649
multu $2, $2
lui $3, 3
lh $3, 0($3)
TAG649:
bne $3, $3, TAG650
mtlo $3
srl $1, $3, 5
multu $1, $3
TAG650:
sra $1, $1, 14
lui $3, 14
mult $3, $3
lui $4, 0
TAG651:
lbu $2, 0($4)
xor $1, $4, $2
sb $2, 0($4)
sltu $2, $2, $4
TAG652:
beq $2, $2, TAG653
mtlo $2
bltz $2, TAG653
addu $2, $2, $2
TAG653:
mthi $2
multu $2, $2
lbu $4, 0($2)
bne $4, $4, TAG654
TAG654:
sw $4, 0($4)
sltiu $4, $4, 8
multu $4, $4
bne $4, $4, TAG655
TAG655:
lui $2, 7
lb $1, 0($4)
bne $2, $4, TAG656
and $4, $1, $1
TAG656:
lui $4, 5
mflo $2
lb $3, 0($2)
mfhi $4
TAG657:
mthi $4
mult $4, $4
beq $4, $4, TAG658
mthi $4
TAG658:
mult $4, $4
bltz $4, TAG659
mflo $2
lui $3, 6
TAG659:
lui $4, 13
addu $3, $3, $3
sll $0, $0, 0
sll $0, $0, 0
TAG660:
mfhi $3
beq $2, $2, TAG661
lw $1, 0($2)
lui $1, 14
TAG661:
andi $1, $1, 6
mtlo $1
lui $2, 4
sra $3, $2, 3
TAG662:
sll $0, $0, 0
divu $3, $3
sltiu $2, $3, 7
lui $3, 0
TAG663:
sh $3, 0($3)
mflo $2
lui $2, 7
ori $4, $3, 7
TAG664:
mthi $4
sb $4, 0($4)
lui $4, 10
bltz $4, TAG665
TAG665:
addu $2, $4, $4
mfhi $3
mtlo $4
beq $3, $4, TAG666
TAG666:
lui $4, 7
lui $1, 3
sll $0, $0, 0
xor $3, $1, $1
TAG667:
mfhi $3
ori $1, $3, 10
mtlo $3
lui $1, 5
TAG668:
sll $0, $0, 0
mfhi $4
mflo $4
mfhi $4
TAG669:
lui $2, 14
mtlo $2
lbu $3, 0($4)
lui $2, 10
TAG670:
sra $3, $2, 3
bne $2, $2, TAG671
sll $0, $0, 0
addiu $2, $3, 3
TAG671:
sll $0, $0, 0
srl $2, $2, 11
div $2, $3
div $2, $2
TAG672:
lb $1, 0($2)
lui $3, 2
mult $2, $2
sll $0, $0, 0
TAG673:
addu $4, $3, $3
divu $3, $3
mfhi $2
mtlo $2
TAG674:
mtlo $2
lui $1, 7
sh $2, 0($2)
mfhi $2
TAG675:
mflo $1
mtlo $1
lui $3, 0
addi $3, $2, 5
TAG676:
slti $4, $3, 10
sb $3, 0($4)
mflo $2
lbu $4, 0($3)
TAG677:
mthi $4
multu $4, $4
lb $3, 0($4)
bgez $3, TAG678
TAG678:
mfhi $4
sub $3, $4, $4
blez $4, TAG679
and $3, $4, $3
TAG679:
mtlo $3
mthi $3
bne $3, $3, TAG680
sh $3, 0($3)
TAG680:
multu $3, $3
sub $4, $3, $3
mfhi $4
and $4, $4, $3
TAG681:
multu $4, $4
mthi $4
mtlo $4
lui $3, 15
TAG682:
bltz $3, TAG683
and $3, $3, $3
lui $2, 1
sra $3, $2, 10
TAG683:
lb $4, 0($3)
addu $3, $4, $3
div $4, $3
sw $4, 0($3)
TAG684:
xori $4, $3, 15
lb $2, 0($3)
div $3, $4
lui $3, 14
TAG685:
bgez $3, TAG686
divu $3, $3
bltz $3, TAG686
multu $3, $3
TAG686:
srl $2, $3, 15
mthi $2
lui $1, 0
mthi $2
TAG687:
bgez $1, TAG688
sw $1, 0($1)
bgtz $1, TAG688
xor $4, $1, $1
TAG688:
bne $4, $4, TAG689
lbu $2, 0($4)
sltu $1, $4, $2
lbu $3, 0($2)
TAG689:
mult $3, $3
lui $4, 8
blez $4, TAG690
mtlo $4
TAG690:
lui $4, 6
multu $4, $4
mthi $4
sllv $1, $4, $4
TAG691:
xori $1, $1, 11
addiu $2, $1, 12
bgtz $2, TAG692
sll $0, $0, 0
TAG692:
addu $3, $2, $2
beq $2, $3, TAG693
sll $0, $0, 0
bne $1, $3, TAG693
TAG693:
lui $3, 10
bgtz $1, TAG694
mthi $1
sltiu $1, $3, 10
TAG694:
or $3, $1, $1
sll $0, $0, 0
blez $3, TAG695
mtlo $1
TAG695:
sll $0, $0, 0
mflo $1
lui $2, 2
sll $0, $0, 0
TAG696:
srav $1, $3, $3
slt $3, $3, $1
nor $1, $3, $3
mflo $3
TAG697:
bgez $3, TAG698
nor $1, $3, $3
addu $1, $3, $3
sh $3, 0($3)
TAG698:
mthi $1
beq $1, $1, TAG699
and $4, $1, $1
mtlo $1
TAG699:
sll $1, $4, 4
slt $2, $1, $1
mthi $1
lui $1, 1
TAG700:
beq $1, $1, TAG701
lui $1, 5
mthi $1
mthi $1
TAG701:
blez $1, TAG702
mfhi $3
addiu $1, $3, 2
andi $2, $1, 9
TAG702:
lw $2, 0($2)
mflo $4
bne $2, $4, TAG703
sw $4, 0($2)
TAG703:
lui $4, 11
srav $2, $4, $4
lui $3, 7
sll $0, $0, 0
TAG704:
sll $0, $0, 0
mtlo $4
bgez $4, TAG705
sll $0, $0, 0
TAG705:
mfhi $4
bne $4, $4, TAG706
div $4, $4
divu $3, $4
TAG706:
srl $3, $4, 12
sll $0, $0, 0
sll $0, $0, 0
sltu $4, $4, $3
TAG707:
mthi $4
bne $4, $4, TAG708
sh $4, 0($4)
lui $4, 9
TAG708:
lui $1, 8
lui $2, 6
sll $0, $0, 0
blez $4, TAG709
TAG709:
srav $2, $2, $2
mflo $4
mthi $2
sll $0, $0, 0
TAG710:
multu $4, $4
bne $4, $4, TAG711
sw $4, 0($4)
nor $2, $4, $4
TAG711:
mthi $2
mult $2, $2
sb $2, 1($2)
divu $2, $2
TAG712:
andi $3, $2, 3
div $2, $3
lb $4, 0($3)
beq $3, $2, TAG713
TAG713:
mult $4, $4
lw $2, 0($4)
xor $4, $4, $2
blez $4, TAG714
TAG714:
mfhi $1
mthi $4
lui $4, 9
bne $1, $4, TAG715
TAG715:
addiu $2, $4, 13
mfhi $2
div $2, $2
divu $2, $4
TAG716:
mfhi $1
mult $2, $2
sw $1, -255($1)
sb $1, -255($2)
TAG717:
andi $3, $1, 4
mthi $3
lui $3, 14
ori $3, $3, 0
TAG718:
andi $4, $3, 6
mult $4, $3
sb $3, 0($4)
or $1, $4, $4
TAG719:
sra $3, $1, 0
mflo $4
slt $4, $4, $4
srav $4, $3, $3
TAG720:
lhu $2, 0($4)
blez $2, TAG721
srl $1, $2, 14
mfhi $2
TAG721:
sllv $2, $2, $2
bne $2, $2, TAG722
lh $3, 0($2)
mthi $3
TAG722:
mthi $3
sll $4, $3, 10
mfhi $2
mfhi $2
TAG723:
mtlo $2
lw $3, 0($2)
multu $3, $3
multu $3, $3
TAG724:
sb $3, 0($3)
mtlo $3
mthi $3
lw $2, 0($3)
TAG725:
multu $2, $2
xori $2, $2, 4
bne $2, $2, TAG726
sra $2, $2, 13
TAG726:
mflo $4
mtlo $2
sw $2, 0($2)
bltz $4, TAG727
TAG727:
mflo $3
multu $4, $4
sw $4, 0($4)
mflo $3
TAG728:
mthi $3
sw $3, 0($3)
mthi $3
mult $3, $3
TAG729:
lbu $2, 0($3)
lui $4, 4
bltz $3, TAG730
slti $2, $4, 9
TAG730:
slti $2, $2, 15
sb $2, 0($2)
lui $1, 10
beq $2, $2, TAG731
TAG731:
sll $0, $0, 0
sllv $4, $1, $1
sll $0, $0, 0
mult $1, $4
TAG732:
mfhi $1
mult $4, $4
div $4, $1
lui $1, 0
TAG733:
lui $1, 13
mult $1, $1
mult $1, $1
or $4, $1, $1
TAG734:
sll $0, $0, 0
mflo $3
blez $4, TAG735
srav $4, $3, $3
TAG735:
mflo $4
lb $1, 0($4)
sll $2, $4, 2
mflo $1
TAG736:
mflo $4
mult $1, $4
lui $3, 13
mult $1, $4
TAG737:
lui $3, 14
srlv $4, $3, $3
andi $1, $3, 15
addu $3, $3, $3
TAG738:
mfhi $4
lui $4, 10
andi $4, $4, 9
sll $0, $0, 0
TAG739:
srl $2, $4, 0
lbu $1, 0($2)
mthi $1
lui $4, 3
TAG740:
mult $4, $4
mflo $1
bne $1, $1, TAG741
sltiu $3, $4, 8
TAG741:
bgez $3, TAG742
lb $3, 0($3)
mthi $3
lh $2, 0($3)
TAG742:
mult $2, $2
multu $2, $2
mflo $2
mult $2, $2
TAG743:
mflo $2
srav $4, $2, $2
mfhi $3
mflo $4
TAG744:
bgtz $4, TAG745
lui $4, 8
mthi $4
bgtz $4, TAG745
TAG745:
mfhi $3
mflo $4
mtlo $4
mtlo $3
TAG746:
lui $4, 14
sll $0, $0, 0
addu $1, $4, $4
lui $1, 11
TAG747:
mfhi $4
mfhi $4
beq $1, $1, TAG748
multu $1, $1
TAG748:
addiu $4, $4, 2
bne $4, $4, TAG749
div $4, $4
sll $0, $0, 0
TAG749:
sll $0, $0, 0
mtlo $4
addiu $2, $4, 2
mfhi $1
TAG750:
nop
nop
test_end:
beq $0, $0, test_end
nop |
#include "Direction.hpp"
#include "Shared/Types.hpp"
namespace uf {
Direction VectToDirection(rpos vector) {
return Direction(
(vector.x > 0 ? Direction::EAST : Direction::NONE) |
(vector.x < 0 ? Direction::WEST : Direction::NONE) |
(vector.y > 0 ? Direction::SOUTH : Direction::NONE) |
(vector.y < 0 ? Direction::NORTH : Direction::NONE) |
(vector.z > 0 ? Direction::UP : Direction::NONE) |
(vector.z < 0 ? Direction::DOWN : Direction::NONE)
);
}
Direction VectToDirection(vec2i vector) {
return Direction(
(vector.x > 0 ? Direction::EAST : Direction::NONE) |
(vector.x < 0 ? Direction::WEST : Direction::NONE) |
(vector.y > 0 ? Direction::SOUTH : Direction::NONE) |
(vector.y < 0 ? Direction::NORTH : Direction::NONE)
);
}
int log2(Direction dir) {
int offset = 0;
while (char(dir) >> ++offset) {}
return offset;
}
rpos DirectionToVect(Direction direction) {
return {bool(direction & Direction::EAST) - bool(direction & Direction::WEST),
bool(direction & Direction::SOUTH) - bool(direction & Direction::NORTH),
bool(direction & Direction::UP) - bool(direction & Direction::DOWN)};
}
Direction operator |(Direction l, Direction r) {
return Direction(char(l) | char(r));
}
Direction operator &(Direction l, Direction r) {
return Direction(char(l) & char(r));
}
} |
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* 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.
*
*/
#include <chrono>
#include <rmf_traffic_ros2/schedule/internal_Node.hpp>
#include <rmf_traffic_ros2/schedule/Query.hpp>
#include <rmf_traffic_ros2/StandardNames.hpp>
#include <rclcpp/rclcpp.hpp>
using namespace std::chrono_literals;
class MissingQueryScheduleNode : public rmf_traffic_ros2::schedule::ScheduleNode
{
public:
MissingQueryScheduleNode(const rclcpp::NodeOptions& options)
: ScheduleNode(options)
{
timer = create_wall_timer(35s, [this]() -> void
{
if (have_queries)
{
RCLCPP_WARN(get_logger(), "Committing suicide");
std::exit(0);
}
});
}
void broadcast_queries() override
{
ScheduleQueries msg;
bool is_first = true;
for (const auto& registered_query: registered_queries)
{
if (is_first)
{
// Don't broadcast the first query so the fail-over node doesn't know about
// it (creates a missing query when the replacement node starts)
is_first = false;
continue;
}
msg.ids.push_back(registered_query.first);
rmf_traffic::schedule::Query original =
registered_queries.at(registered_query.first);
ScheduleQuery query = rmf_traffic_ros2::convert(original);
msg.queries.push_back(query);
const auto& query_topic = mirror_update_topics.find(registered_query.first);
msg.subscriber_counts.push_back(query_topic->second.subscriber_count);
}
queries_info_pub->publish(msg);
have_queries = true;
}
bool have_queries = false;
rclcpp::TimerBase::SharedPtr timer;
};
int main(int argc, char** argv)
{
rclcpp::init(argc, argv);
auto node = std::make_shared<MissingQueryScheduleNode>(rclcpp::NodeOptions());
rclcpp::spin(node);
rclcpp::shutdown();
return 0;
}
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %r8
push %rax
push %rdi
// Store
lea addresses_US+0x5bf4, %r8
nop
nop
nop
nop
nop
sub %r15, %r15
movb $0x51, (%r8)
nop
nop
nop
and $12886, %r10
// Store
lea addresses_US+0x5bf4, %r11
nop
nop
nop
sub %rax, %rax
mov $0x5152535455565758, %r8
movq %r8, (%r11)
nop
nop
nop
nop
nop
sub %rax, %rax
// Store
lea addresses_WC+0x14ef4, %r10
nop
nop
nop
nop
dec %r12
movl $0x51525354, (%r10)
nop
nop
dec %r10
// Faulty Load
lea addresses_US+0x5bf4, %rdi
nop
nop
cmp $47587, %r15
mov (%rdi), %r12d
lea oracles, %rdi
and $0xff, %r12
shlq $12, %r12
mov (%rdi,%r12,1), %r12
pop %rdi
pop %rax
pop %r8
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_US'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_US'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'58': 5}
58 58 58 58 58
*/
|
; A259552: a(n) = (1/4)*n^4 - (1/2)*n^3 + (3/4)*n^2 - (1/2)*n + 41.
; 41,43,53,83,151,281,503,853,1373,2111,3121,4463,6203,8413,11171,14561,18673,23603,29453,36331,44351,53633,64303,76493,90341,105991,123593,143303,165283,189701,216731,246553,279353,315323,354661,397571,444263,494953
add $0,1
bin $0,2
add $0,1
bin $0,2
mul $0,2
add $0,41
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE197_Numeric_Truncation_Error__int_fgets_to_char_74a.cpp
Label Definition File: CWE197_Numeric_Truncation_Error__int.label.xml
Template File: sources-sink-74a.tmpl.cpp
*/
/*
* @description
* CWE: 197 Numeric Truncation Error
* BadSource: fgets Read data from the console using fgets()
* GoodSource: Less than CHAR_MAX
* Sinks: to_char
* BadSink : Convert data to a char
* Flow Variant: 74 Data flow: data passed in a map from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <map>
#define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2)
using namespace std;
namespace CWE197_Numeric_Truncation_Error__int_fgets_to_char_74
{
#ifndef OMITBAD
/* bad function declaration */
void badSink(map<int, int> dataMap);
void bad()
{
int data;
map<int, int> dataMap;
/* Initialize data */
data = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* Put data in a map */
dataMap[0] = data;
dataMap[1] = data;
dataMap[2] = data;
badSink(dataMap);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* good function declarations */
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(map<int, int> dataMap);
static void goodG2B()
{
int data;
map<int, int> dataMap;
/* Initialize data */
data = -1;
/* FIX: Use a positive integer less than CHAR_MAX*/
data = CHAR_MAX-5;
/* Put data in a map */
dataMap[0] = data;
dataMap[1] = data;
dataMap[2] = data;
goodG2BSink(dataMap);
}
void good()
{
goodG2B();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
using namespace CWE197_Numeric_Truncation_Error__int_fgets_to_char_74; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
#include "Emitter.hpp"
#include "Misc.hpp"
#include "global.h"
#include "debug.h"
#include <time.h>
const int HALF_RAND = (RAND_MAX / 2);
char particleArray[2][2];
float RandomNum()
{
int rn;
rn = rand();
return ((float)(rn - HALF_RAND) / (float)HALF_RAND);
}
Emitter :: Emitter(int numParticles)
{
int loop;
// sizeof(tParticle) = 60
// dprintf("sizeof(tParticle) = %d\n", sizeof(tParticle));
// dprintf("sizeof(particleArray) = %d\n", sizeof(particleArray));
deadParticles = (tParticle *)malloc(numParticles * sizeof(tParticle));
if (!deadParticles)
{
dprintf("Out of memory!!\n");
theApp->Stop();
}
firstParticle = deadParticles;
// this is a linked list of particles, so i need to establish links
for (loop = 1; loop < numParticles - 1; loop++)
{
deadParticles[loop].prev = &deadParticles[loop - 1];
deadParticles[loop].next = &deadParticles[loop + 1];
}
deadParticles[0].prev = NULL;
deadParticles[0].next = &deadParticles[1];
deadParticles[numParticles - 1].prev = &deadParticles[numParticles - 2];
deadParticles[numParticles - 1].next = NULL;
totalParticles = numParticles;
particleCount = 0;
SetDefault();
aliveParticles = NULL; // start with no alive particles
}
Emitter :: ~Emitter()
{
delete firstParticle;
}
// Function: RotationToDirection
// Purpose: Convert a Yaw and Pitch to a direction vector
void Emitter :: RotationToDirection(float pitch, float yaw, tVector *direction)
{
direction->x = (float)(-sin(yaw) * cos(pitch));
direction->y = (float)sin(pitch);
direction->z = (float)(cos(pitch) * cos(yaw));
}
void Emitter :: SetPos(RECT *posRect)
{
posUL.x = (float)posRect->left;
posUL.y = (float)posRect->top;
posUL.z = 0;
posLR.x = (float)posRect->right;
posLR.y = (float)posRect->bottom;
posLR.z = 0;
}
void Emitter :: SetPos(int left, int right, int top, int bottom)
{
posUL.x = (float)left;
posUL.y = (float)top;
posUL.z = 0;
posLR.x = (float)right;
posLR.y = (float)bottom;
posLR.z = 0;
}
void Emitter :: SetAngles(float yawAngle, float yawVarAngle, float pitchAngle, float pitchVarAngle)
{
yaw = DEGTORAD(yawAngle);
yawVar = DEGTORAD(yawVarAngle);
pitch = DEGTORAD(pitchAngle);
pitchVar = DEGTORAD(pitchVarAngle);
}
void Emitter :: SetSpeed(float newSpeed, float newSpeedVar)
{
speed = newSpeed;
speedVar = newSpeedVar;
}
void Emitter :: SetForce(float forceX, float forceY, float forceZ)
{
force.x = forceX;
force.y = forceY;
force.z = forceZ;
}
void Emitter :: SetEmits(int newEmits, int newEmitsVar)
{
emitsPerFrame = newEmits;
emitVar = newEmitsVar;
}
void Emitter :: SetLife(int newLife, int newLifeVar)
{
life = newLife;
lifeVar = newLifeVar;
}
void Emitter :: SetColors(int newStartColor, int newStartColorVar, int newEndColor, int newEndColorVar)
{
startColor = (float)newStartColor;
startColorVar = (float)newStartColorVar;
endColor = (float)newEndColor;
endColorVar = (float)newEndColorVar;
}
void Emitter :: SetDefault(void)
{
posUL.x = 225.0f; // XYZ POSITION Upper Left
posUL.y = 120.0f; // XYZ POSITION Upper Left
posUL.z = 0.0f; // XYZ POSITION Upper Left
posLR.x = 320.0f; // XYZ POSITION Upper Left
posLR.y = 120.0f; // XYZ POSITION Upper Left
posLR.z = 50.0f; // XYZ POSITION Upper Left
yaw = DEGTORAD(0.0f);
yawVar = DEGTORAD(360.0f);
pitch = DEGTORAD(270.0f);
pitchVar = DEGTORAD(40.0f);
speed = 3.0f;
speedVar = 0.5f;
force.x = 0.000f;
force.y = 0.04f;
force.z = 0.0f;
emitsPerFrame = 2;
emitVar = 3;
life = 180;
lifeVar = 15;
startColor = 7.0f;
startColorVar = 1.0f;
endColor = 1.0f;
endColorVar = 1.0f;
}
BOOL Emitter :: AddParticle(void)
{
tParticle * thisParticle;
float thisStart;
float thisEnd;
float thisYaw;
float thisPitch;
float thisSpeed;
if ((deadParticles != NULL) && (particleCount < totalParticles) && (life > 0))
{
thisParticle = deadParticles; // the current particle
deadParticles = deadParticles->next; // fix the pool pointers
if (deadParticles != NULL)
deadParticles->prev = NULL;
if (aliveParticles != NULL)
aliveParticles->prev = thisParticle; // set back link
thisParticle->next = aliveParticles; // set its next pointer
thisParticle->prev = NULL; // it has no back pointer
aliveParticles = thisParticle; // set it in the emitter
thisParticle->pos.x = randFloat(posUL.x, posLR.x);
thisParticle->pos.y = randFloat(posUL.y, posLR.y);
thisParticle->pos.z = randFloat(posUL.z, posLR.z);
thisParticle->prevPos.x = thisParticle->pos.x;
thisParticle->prevPos.y = thisParticle->pos.y;
thisParticle->prevPos.z = thisParticle->pos.z;
// calculate the starting direction vector
thisYaw = yaw + (yawVar * RandomNum());
thisPitch = pitch + (pitchVar * RandomNum());
// convert the rotations to a vector
RotationToDirection(thisPitch, thisYaw, &thisParticle->dir);
// multiply in the speed factor
thisSpeed = speed + (speedVar * RandomNum());
thisParticle->dir.x *= thisSpeed;
thisParticle->dir.y *= thisSpeed;
thisParticle->dir.z *= thisSpeed;
thisStart = startColor + (startColorVar * randFloat(0, 1));
thisEnd = endColor + (endColorVar * randFloat(0, 1));
thisParticle->color = thisStart;
thisParticle->life = life + (int)((float)lifeVar * RandomNum());
thisParticle->deltaColor = (thisEnd - thisStart) / (float)thisParticle->life;
particleCount++; // a new particle is born
return TRUE;
}
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
// Function: updateParticle
// Purpose: updateParticle settings
// Arguments: The particle to update and the emitter it came from
///////////////////////////////////////////////////////////////////////////////
BOOL Emitter :: UpdateParticle(tParticle *thisParticle)
{
// IF THIS IS AN VALID PARTICLE
if ((thisParticle != NULL) && (thisParticle->life > 0))
{
// SAVE ITS OLD POS FOR ANTI ALIASING
thisParticle->prevPos.x = thisParticle->pos.x;
thisParticle->prevPos.y = thisParticle->pos.y;
thisParticle->prevPos.z = thisParticle->pos.z;
// CALCULATE THE NEW
thisParticle->pos.x += thisParticle->dir.x;
thisParticle->pos.y += thisParticle->dir.y;
thisParticle->pos.z += thisParticle->dir.z;
// APPLY GLOBAL FORCE TO DIRECTION
thisParticle->dir.x += force.x;
thisParticle->dir.y += force.y;
thisParticle->dir.z += force.z;
// SAVE THE OLD COLOR
thisParticle->prevColor = thisParticle->color;
// GET THE NEW COLOR
thisParticle->color += thisParticle->deltaColor;
thisParticle->life--; // IT IS A CYCLE OLDER
return TRUE;
}
else if (thisParticle != NULL && thisParticle->life == 0) // free this sucker up back to the main pool
{
if (thisParticle->prev != NULL)
thisParticle->prev->next = thisParticle->next;
else
aliveParticles = thisParticle->next;
if (thisParticle->next != NULL)
thisParticle->next->prev = thisParticle->prev;
thisParticle->next = deadParticles;
thisParticle->prev = NULL;
if (deadParticles != NULL)
deadParticles->prev = thisParticle;
deadParticles = thisParticle; // new pool pointer
if (particleCount > 0)
particleCount--; // add one to pool
}
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
// Function: updateEmitter
// Purpose: updateEmitter setting
// Arguments: The Emitter to update
// Notes: This is called once per frame to update the emitter
///////////////////////////////////////////////////////////////////////////////
void Emitter :: Update(void)
{
int loop;
int emits;
tParticle * thisParticle;
tParticle * next;
if (aliveParticles != NULL)
{
// GO THROUGH THE PARTICLES AND UPDATE THEM
thisParticle = aliveParticles;
while (thisParticle)
{
next = thisParticle->next;
UpdateParticle(thisParticle);
thisParticle = next;
}
}
// don't add new particles if life == 0
if (life == 0)
return;
// EMIT PARTICLES FOR THIS FRAME
emits = emitsPerFrame + (int)((float)emitVar * RandomNum());
for (loop = 0; loop < emits; loop++)
AddParticle();
}
///////////////////////////////////////////////////////////////////////////////
// Function: renderEmitter
// Purpose: render particle system
// Arguments: The Emitter to render
// Notes: This is called once per frame to render the emitter
///////////////////////////////////////////////////////////////////////////////
void Emitter :: Render(void)
{
tParticle * thisParticle;
if (aliveParticles != NULL)
{
thisParticle = aliveParticles;
renderer->LockSurface();
while (thisParticle)
{
// if (antiAlias)
// {
// glColor3f(particle->prevColor.r, particle->prevColor.g, particle->prevColor.b);
// glVertex3f(particle->prevPos.x,particle->prevPos.y,particle->prevPos.z);
// }
memset(particleArray, (int)thisParticle->color, sizeof(particleArray));
renderer->DrawArray((char *)particleArray, 2, 2, (int)thisParticle->pos.x, (int)thisParticle->pos.y);
thisParticle = thisParticle->next;
}
renderer->UnlockSurface();
}
}
|
; A140320: a(n) = A137576((3^n-1)/2).
; 1,3,13,55,217,811,2917,10207,34993,118099,393661,1299079,4251529,13817467,44641045,143489071,459165025,1463588515,4649045869,14721978583,46490458681,146444944843,460255540933,1443528742015,4518872583697,14121476824051,44059007691037,137260754729767
mov $1,3
pow $1,$0
mul $1,$0
div $1,3
mul $1,2
add $1,1
mov $0,$1
|
// Transfer data from a buffer to the right hand edge of the screen
// Given a buffer of data
.var buffer_length=$19
.var buffer_width=$0a
test_screen_buffer:
// When the left hand column of the buffer is transfered to the right hand column
// of the screen
lda #<buffer
sta buffer_lo
lda #>buffer
sta buffer_hi
jsr screen_buffer
// Then the left hand buffer contents is on the screen
lda #<screen_right
sta $02
lda #>screen_right
sta $03
ldx #$00
!loop: lda expected_screen,x
ldy #$00
cmp ($02),y
bne !fail+
clc
lda $02
adc #$28
sta $02
bcc !cont+
inc $03
!cont: inx
cpx #$19
bne !loop-
!pass: lda #green
jmp !exit+
!fail: lda #red
!exit: sta $d020
// Then the buffer is shifted left one column
lda #<buffer
sta region_lo
lda #>buffer
sta region_hi
lda #$0a
sta region_x
lda #$19
sta region_y
jsr region_left
ldx #$00
!ol: ldy #$00
!loop: lda #<buffer
sta $02
lda #>buffer
sta $03
lda ($02),y
sta tmp
lda #<expected_buffer
sta $02
lda #>expected_buffer
sta $03
lda ($02),y
cmp tmp
bne !fail+
iny
cpy #$a // buffer_width
bne !loop-
lda $02
clc
adc buffer_width
sta $02
bcc !cont+
inc $03
!cont: inx
cpx buffer_length
bne !ol-
!pass: lda #green
jmp !exit+
!fail: lda #red
!exit: sta $d020
rts
tmp: .byte 0
buffer: .text "abcdefghij"
.text "bcdefghijk"
.text "cdefghijkl"
.text "defghijklm"
.text "efghijklmn"
.text "fghijklmno"
.text "ghijklmnop"
.text "hijklmnopq"
.text "ijklmnopqr"
.text "jklmnopqrs"
.text "klmnopqrst"
.text "lmnopqrstu"
.text "mnopqrstuv"
.text "nopqrstuvw"
.text "opqrstuvwx"
.text "pqrstuvwxy"
.text "qrstuvwxyz"
.text "rstuvwxyza"
.text "stuvwxyzab"
.text "tuvwxyzabc"
.text "uvwxyzabcd"
.text "vwxyzabcde"
.text "wxyzabcdef"
.text "xyzabcdefg"
.text "yzabcdefgh"
.text "zabcdefghi"
expected_screen: .text "abcdefghijklmnopqrstuvwxy"
expected_buffer:
.text "bcdefghij "
.text "cdefghijk "
.text "defghijkl "
.text "efghijklm "
.text "fghijklmn "
.text "ghijklmno "
.text "hijklmnop "
.text "ijklmnopq "
.text "jklmnopqr "
.text "klmnopqrs "
.text "lmnopqrst "
.text "mnopqrstu "
.text "nopqrstuv "
.text "opqrstuvw "
.text "pqrstuvwx "
.text "qrstuvwxy "
.text "rstuvwxyz "
.text "stuvwxyza "
.text "tuvwxyzab "
.text "uvwxyzabc "
.text "vwxyzabcd "
.text "wxyzabcde "
.text "xyzabcdef "
.text "yzabcdefg "
.text "zabcdefgh "
.text "abcdefghi "
|
// file : libbuild2/cc/utility.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#include <libbuild2/cc/utility.hxx>
#include <libbuild2/file.hxx>
using namespace std;
namespace build2
{
namespace cc
{
using namespace bin;
const dir_path module_dir ("cc");
const dir_path module_build_dir (dir_path (module_dir) /= "build");
const dir_path module_build_modules_dir (
dir_path (module_build_dir) /= "modules");
void
normalize_header (path& f)
{
// Interestingly, on most paltforms and with most compilers (Clang on
// Linux being a notable exception) most system/compiler headers are
// already normalized.
//
path_abnormality a (f.abnormalities ());
if (a != path_abnormality::none)
{
// While we can reasonably expect this path to exit, things do go
// south from time to time (like compiling under wine with file
// wlantypes.h included as WlanTypes.h).
//
try
{
// If we have any parent components, then we have to verify the
// normalized path matches realized.
//
path r;
if ((a & path_abnormality::parent) == path_abnormality::parent)
{
r = f;
r.realize ();
}
try
{
f.normalize ();
// Note that we might still need to resolve symlinks in the
// normalized path.
//
if (!r.empty () && f != r && path (f).realize () != r)
f = move (r);
}
catch (const invalid_path&)
{
assert (!r.empty ()); // Shouldn't have failed if no `..`.
f = move (r); // Fallback to realize.
}
}
catch (const invalid_path&)
{
fail << "invalid header path '" << f.string () << "'";
}
catch (const system_error& e)
{
fail << "invalid header path '" << f.string () << "': " << e;
}
}
}
}
}
|
; *********************************************************************************
; *********************************************************************************
;
; File: screen_layer2.asm
; Purpose: Layer 2 console interface, sprites enabled, no shadow.
; Date : 22nd December 2018
; Author: paul@robsons.org.uk
;
; *********************************************************************************
; *********************************************************************************
; *********************************************************************************
;
; Clear Layer 2 Display.
;
; *********************************************************************************
GFXInitialise:
push af
push bc
push de
db $ED,$91,$15,$3 ; Disable LowRes but enable Sprites
ld e,2 ; 3 banks to erase
L2PClear:
ld a,e ; put bank number in bits 6/7
rrc a
rrc a
or 2+1 ; shadow on, visible, enable write paging
ld bc,$123B ; out to layer 2 port
out (c),a
ld hl,$4000 ; erase the bank to $00
ld d,l ; D = 0, slightly quicker.
L2PClearBank: ; assume default palette :)
dec hl
ld (hl),d
ld a,h
or l
jr nz,L2PClearBank
dec e
jp p,L2PClear
xor a
out ($FE),a
pop de
pop bc
pop af
ld hl,$1820 ; still 32 x 24
ret
;
; Print Character E, colour D, position HL
;
GFXCharacterHandler:
push af
push bc
push de
push hl
push ix
ld b,e ; save A temporarily
ld a,b
ld a,h
cp 3
jr nc,__L2Exit ; check position in range
ld a,b
push af
xor a ; convert colour in C to palette index
bit 0,d ; (assumes standard palette)
jr z,__L2Not1
or $03
__L2Not1:
bit 2,d
jr z,__L2Not2
or $1C
__L2Not2:
bit 1,d
jr z,__L2Not3
or $C0
__L2Not3:
ld c,a ; C is foreground
pop af ; restore char
call GFXGetFontGraphicDE ; font offset in DE
push de ; transfer to IX
pop ix
;
; figure out the correct bank.
;
push bc
ld a,h ; this is the page number.
rrc a
rrc a
and $C0 ; in bits 6 & 7
or $03 ; shadow on, visible, enable write pagin.
ld bc,$123B ; out to layer 2 port
out (c),a
pop bc
;
; now figure out position in bank
;
ex de,hl
ld l,e
ld h,0
add hl,hl
add hl,hl
add hl,hl
sla h
sla h
sla h
ld e,8 ; do 8 rows
__L2Outer:
push hl ; save start
ld d,8 ; do 8 columns
ld a,(ix+0) ; get the bit pattern
inc ix
or a
jr z,__L2Blank
__L2Loop:
ld (hl),0 ; background
add a,a ; shift pattern left
jr nc,__L2NotSet
ld (hl),c ; if MSB was set, overwrite with fgr
__L2NotSet:
inc hl
dec d ; do a row
jr nz, __L2Loop
jr __L2Exit1
__L2Blank:
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
__L2Exit1:
pop hl ; restore, go 256 bytes down.
inc h
dec e ; do 8 rows
jr nz,__L2Outer
__L2Exit:
pop ix
pop hl
pop de
pop bc
pop af
ret
|
/*
* Copyright 2008-2011 NVIDIA Corporation
*
* 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.
*/
#include <thrust/random/linear_congruential_engine.h>
#include <thrust/random/detail/mod.h>
#include <thrust/random/detail/random_core_access.h>
namespace thrust
{
namespace random
{
template<typename UIntType, UIntType a, UIntType c, UIntType m>
linear_congruential_engine<UIntType,a,c,m>
::linear_congruential_engine(result_type s)
{
seed(s);
} // end linear_congruential_engine::linear_congruential_engine()
template<typename UIntType, UIntType a, UIntType c, UIntType m>
void linear_congruential_engine<UIntType,a,c,m>
::seed(result_type s)
{
if((detail::mod<UIntType, 1, 0, m>(c) == 0) &&
(detail::mod<UIntType, 1, 0, m>(s) == 0))
m_x = detail::mod<UIntType, 1, 0, m>(1);
else
m_x = detail::mod<UIntType, 1, 0, m>(s);
} // end linear_congruential_engine::seed()
template<typename UIntType, UIntType a, UIntType c, UIntType m>
typename linear_congruential_engine<UIntType,a,c,m>::result_type
linear_congruential_engine<UIntType,a,c,m>
::operator()(void)
{
m_x = detail::mod<UIntType,a,c,m>(m_x);
return m_x;
} // end linear_congruential_engine::operator()()
template<typename UIntType, UIntType a, UIntType c, UIntType m>
void linear_congruential_engine<UIntType,a,c,m>
::discard(unsigned long long z)
{
thrust::random::detail::linear_congruential_engine_discard::discard(*this,z);
} // end linear_congruential_engine::discard()
template<typename UIntType, UIntType a, UIntType c, UIntType m>
template<typename CharT, typename Traits>
std::basic_ostream<CharT,Traits>& linear_congruential_engine<UIntType,a,c,m>
::stream_out(std::basic_ostream<CharT,Traits> &os) const
{
typedef std::basic_ostream<CharT,Traits> ostream_type;
typedef typename ostream_type::ios_base ios_base;
// save old flags & fill character
const typename ios_base::fmtflags flags = os.flags();
const CharT fill = os.fill();
os.flags(ios_base::dec | ios_base::fixed | ios_base::left);
os.fill(os.widen(' '));
// output one word of state
os << m_x;
// restore flags & fill character
os.flags(flags);
os.fill(fill);
return os;
}
template<typename UIntType, UIntType a, UIntType c, UIntType m>
template<typename CharT, typename Traits>
std::basic_istream<CharT,Traits>& linear_congruential_engine<UIntType,a,c,m>
::stream_in(std::basic_istream<CharT,Traits> &is)
{
typedef std::basic_istream<CharT,Traits> istream_type;
typedef typename istream_type::ios_base ios_base;
// save old flags
const typename ios_base::fmtflags flags = is.flags();
is.flags(ios_base::dec);
// input one word of state
is >> m_x;
// restore flags
is.flags(flags);
return is;
}
template<typename UIntType, UIntType a, UIntType c, UIntType m>
bool linear_congruential_engine<UIntType,a,c,m>
::equal(const linear_congruential_engine<UIntType,a,c,m> &rhs) const
{
return m_x == rhs.m_x;
}
template<typename UIntType_, UIntType_ a_, UIntType_ c_, UIntType_ m_>
__host__ __device__
bool operator==(const linear_congruential_engine<UIntType_,a_,c_,m_> &lhs,
const linear_congruential_engine<UIntType_,a_,c_,m_> &rhs)
{
return detail::random_core_access::equal(lhs,rhs);
}
template<typename UIntType, UIntType a, UIntType c, UIntType m>
bool operator!=(const linear_congruential_engine<UIntType,a,c,m> &lhs,
const linear_congruential_engine<UIntType,a,c,m> &rhs)
{
return !(lhs == rhs);
}
template<typename UIntType_, UIntType_ a_, UIntType_ c_, UIntType_ m_,
typename CharT, typename Traits>
std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits> &os,
const linear_congruential_engine<UIntType_,a_,c_,m_> &e)
{
return detail::random_core_access::stream_out(os,e);
}
template<typename UIntType_, UIntType_ a_, UIntType_ c_, UIntType_ m_,
typename CharT, typename Traits>
std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits> &is,
linear_congruential_engine<UIntType_,a_,c_,m_> &e)
{
return detail::random_core_access::stream_in(is,e);
}
} // end random
} // end thrust
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld b, 91
call lwaitly_b
ld a, b1
ldff(40), a
ld a, a5
ldff(4b), a
ld c, 41
ld b, 03
lbegin_waitm3:
ldff a, (c)
and a, b
cmp a, b
jrnz lbegin_waitm3
ld a, 20
ldff(c), a
xor a, a
ldff(0f), a
ld a, 02
ldff(ff), a
ld a, 00
ldff(43), a
ei
.text@1000
lstatint:
nop
.text@1036
ldff a, (c)
and a, b
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
; A026355: a(n) = least k such that s(k) = n+1, where s = A026354.
; 1,2,3,5,6,8,10,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,35,37,39,40,42,44,45,47,48,50,52,53,55,57,58,60,61,63,65,66,68,69,71,73,74,76,78,79,81,82,84,86,87,89,90,92,94,95,97,99,100,102,103,105,107,108,110
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
sub $4,1
sub $0,$4
mov $2,2
mov $8,$0
lpb $2
mov $0,$8
sub $2,1
add $0,$2
sub $0,2
mul $0,21
div $0,34
mov $5,$0
mov $6,$2
lpb $6
mov $3,$5
sub $6,1
lpe
lpe
lpb $8
sub $3,$5
mov $8,0
lpe
mov $5,$3
add $5,1
add $1,$5
lpe
|
;#Mode=CON
.386
.model flat, stdcall
option casemap :none
include windows.inc
include masm32.inc
include kernel32.inc
includelib kernel32.lib
includelib masm32.lib
.const
TextName db 'bad_apple.txt',0
.data?
hINSTANCE HINSTANCE ?
File_Not_End dd ?
buffer db 10000 dup(?)
.CODE
START:
invoke CreateFile,addr TextName,GENERIC_READ,NULL,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
mov hINSTANCE,eax
.if hINSTANCE==INVALID_HANDLE_VALUE
invoke ExitProcess,1
.endif
.while 1
invoke ReadFile,hINSTANCE,addr buffer,9662,addr File_Not_End,NULL
.if !File_Not_End
invoke CloseHandle,hINSTANCE
invoke ExitProcess,0
.endif
invoke locate,0,0
invoke StdOut,addr buffer
invoke Sleep,30
.endw
end START |
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>brk(addr) -> str
Invokes the syscall brk.
See 'man 2 brk' for more information.
Arguments:
addr(void*): addr
Returns:
int
</%docstring>
<%page args="addr=0"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = ['addr']
can_pushstr_array = []
argument_names = ['addr']
argument_values = [addr]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False)))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_brk']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* brk(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)}
|
/*
* Author: Sarah Knepper <sarah.knepper@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
#include <cmath>
#include <iomanip>
#include <iostream>
#include <stdint.h>
#include "ldt0028.hpp"
#include "upm_utilities.h"
int
main(int argc, char** argv)
{
//! [Interesting]
const int NUMBER_OF_SECONDS = 10;
const int MICROSECONDS_PER_SECOND = 1000000;
const int SAMPLES_PER_SECOND = 50;
const int THRESHOLD = 100;
// Create the LDT0-028 Piezo Vibration Sensor object using AIO pin 0
upm::LDT0028 sensor(0);
// Read the signal every 20 milliseconds for 10 seconds
std::cout << "For the next " << NUMBER_OF_SECONDS << " seconds, " << SAMPLES_PER_SECOND
<< " samples will be taken every second." << std::endl
<< std::endl;
uint16_t buffer[NUMBER_OF_SECONDS * SAMPLES_PER_SECOND];
for (int i = 0; i < NUMBER_OF_SECONDS * SAMPLES_PER_SECOND; i++) {
buffer[i] = (uint16_t) sensor.getSample();
upm_delay_us(MICROSECONDS_PER_SECOND / SAMPLES_PER_SECOND);
}
// Print the number of times the reading was greater than the threshold
int count = 0;
for (int i = 0; i < NUMBER_OF_SECONDS * SAMPLES_PER_SECOND; i++) {
if (buffer[i] > THRESHOLD) {
count++;
}
}
std::cout << sensor.name() << " exceeded the threshold value of " << THRESHOLD << " a total of "
<< count << " times," << std::endl
<< "out of a total of " << NUMBER_OF_SECONDS * SAMPLES_PER_SECOND << " readings."
<< std::endl
<< std::endl;
// Print a graphical representation of the average value sampled
// each second for the past 10 seconds, using a scale factor of 15
std::cout << "Now printing a graphical representation of the average reading " << std::endl
<< "each second for the last " << NUMBER_OF_SECONDS << " seconds." << std::endl;
const int SCALE_FACTOR = 15;
for (int i = 0; i < NUMBER_OF_SECONDS; i++) {
long sum = 0;
for (int j = 0; j < SAMPLES_PER_SECOND; j++) {
sum += buffer[i * SAMPLES_PER_SECOND + j];
}
double average = (double) sum / (double) SAMPLES_PER_SECOND;
int stars_to_print = (int) round(average / SCALE_FACTOR);
std::cout << "(" << std::setw(4) << (int) round(average) << ") | ";
for (int j = 0; j < stars_to_print; j++) {
std::cout << "*";
}
std::cout << std::endl;
}
// Delete the sensor object
//! [Interesting]
return 0;
}
|
; A280945: List of primitive triples (x, y, z) of positive integers for which xy - z, yz - x, and zx - y are powers of 2.
; Submitted by Jon Maiga
; 2,2,2,2,2,3,2,6,11,3,5,7
mov $2,1
mov $3,$0
mul $3,4
lpb $3
mul $1,$3
mul $2,$3
add $1,$2
mov $5,$0
max $5,1
div $1,$5
div $2,$5
add $2,$1
sub $3,1
sub $3,$0
lpe
pow $2,3
mov $4,10
pow $4,$0
div $2,$4
mov $6,$2
cmp $6,0
add $2,$6
div $1,$2
mod $1,10
mov $0,$1
add $0,2
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_RW+0x19d8c, %rsi
lea addresses_PSE+0x2582, %rdi
nop
nop
nop
nop
nop
inc %r14
mov $72, %rcx
rep movsb
nop
nop
sub $32013, %r14
// Load
lea addresses_normal+0x1d1a5, %rsi
nop
nop
cmp $8162, %rdx
mov (%rsi), %r8
nop
nop
xor $29752, %rcx
// Store
lea addresses_RW+0x19bcc, %r15
clflush (%r15)
nop
nop
cmp %rcx, %rcx
movl $0x51525354, (%r15)
nop
nop
dec %rdi
// Faulty Load
lea addresses_WT+0x1a8e5, %rdi
nop
nop
nop
nop
sub $42032, %rsi
mov (%rdi), %r8
lea oracles, %rdx
and $0xff, %r8
shlq $12, %r8
mov (%rdx,%r8,1), %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_RW', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_PSE', 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'00': 466}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
pushc -12
wrint
halt
|
//
// gsl-lite is based on GSL: Guidelines Support Library.
// For more information see https://github.com/martinmoene/gsl-lite
//
// Copyright (c) 2015 Martin Moene
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "gsl-lite.t.hpp"
using namespace gsl;
typedef span<int>::index_type index_type;
typedef std::ptrdiff_t size_type;
static std::vector<int> vector_iota( int n )
{
std::vector<int> result;
for ( int i = 0; i < n; ++i )
result.push_back( i );
return result;
}
CASE( "span<>: Disallows construction from a temporary value (C++11) (define gsl_CONFIG_CONFIRMS_COMPILATION_ERRORS)" )
{
#if gsl_CONFIG( CONFIRMS_COMPILATION_ERRORS )
# if gsl_HAVE( IS_DELETE )
span<int> v = 42;
# endif
#endif
}
CASE( "span<>: Disallows construction from a C-array of incompatible type (define gsl_CONFIG_CONFIRMS_COMPILATION_ERRORS)" )
{
#if gsl_CONFIG( CONFIRMS_COMPILATION_ERRORS )
short arr[] = { 1, 2, 3, };
span<int> v = arr;
#endif
}
CASE( "span<>: Disallows construction from a std::array of incompatible type (C++11) (define gsl_CONFIG_CONFIRMS_COMPILATION_ERRORS)" )
{
#if gsl_CONFIG( CONFIRMS_COMPILATION_ERRORS )
# if gsl_HAVE( ARRAY )
std::array<long,3> arr = {{ 1L, 2L, 3L, }};
span<int> v( arr);
# endif
#endif
}
CASE( "span<>: Terminates construction from a nullptr and a non-zero size (C++11)" )
{
#if gsl_HAVE( NULLPTR )
struct F { static void blow() { span<int> v( nullptr, 42 ); } };
EXPECT_THROWS( F::blow() );
#else
EXPECT( !!"nullptr is not available (no C++11)" );
#endif
}
CASE( "span<>: Terminates construction from two pointers in the wrong order" )
{
struct F { static void blow() { int a[2]; span<int> v( &a[1], &a[0] ); } };
EXPECT_THROWS( F::blow() );
}
CASE( "span<>: Terminates construction from a null pointer and a non-zero size" )
{
struct F { static void blow() { int * p = gsl_nullptr; span<int> v( p, 42 ); } };
EXPECT_THROWS( F::blow() );
}
CASE( "span<>: Terminates creation of a sub span of the first n elements for n exceeding the span" )
{
struct F {
static void blow()
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
(void) v.first( 4 );
}};
EXPECT_THROWS( F::blow() );
}
CASE( "span<>: Terminates creation of a sub span of the last n elements for n exceeding the span" )
{
struct F {
static void blow()
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
(void) v.last( 4 );
}};
EXPECT_THROWS( F::blow() );
}
CASE( "span<>: Terminates creation of a sub span outside the span" )
{
struct F {
static void blow_offset()
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
(void) v.subspan( 4 );
}
static void blow_count()
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
(void) v.subspan( 1, 3 );
}};
EXPECT_THROWS( F::blow_offset() );
EXPECT_THROWS( F::blow_count() );
}
CASE( "span<>: Terminates access outside the span" )
{
struct F {
static void blow_ix(size_t i) { int arr[] = { 1, 2, 3, }; span<int> v( arr ); (void) v[i]; }
static void blow_iv(size_t i) { int arr[] = { 1, 2, 3, }; span<int> v( arr ); (void) v(i); }
static void blow_at(size_t i) { int arr[] = { 1, 2, 3, }; span<int> v( arr ); (void) v.at(i); }
};
EXPECT_NO_THROW( F::blow_ix(2) );
EXPECT_NO_THROW( F::blow_iv(2) );
EXPECT_NO_THROW( F::blow_at(2) );
EXPECT_THROWS( F::blow_ix(3) );
EXPECT_THROWS( F::blow_iv(3) );
EXPECT_THROWS( F::blow_at(3) );
}
CASE( "span<>: Allows to default-construct" )
{
span<int> v;
EXPECT( v.size() == index_type( 0 ) );
}
CASE( "span<>: Allows to construct from a nullptr and a zero size (C++11)" )
{
#if gsl_HAVE( NULLPTR )
span< int> v( nullptr, index_type( 0 ) );
span<const int> w( nullptr, index_type( 0 ) );
EXPECT( v.size() == index_type( 0 ) );
EXPECT( w.size() == index_type( 0 ) );
#else
EXPECT( !!"nullptr is not available (no C++11)" );
#endif
}
CASE( "span<>: Allows to construct from a single object (C++11)" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 5 )
#if gsl_HAVE( IS_DELETE )
int x = 0;
span< int> v( x );
span<const int> w( x );
EXPECT( v.size() == index_type( 1 ) );
EXPECT( w.size() == index_type( 1 ) );
#else
EXPECT( !!"=delete is not available (no C++11)" );
#endif
#else
EXPECT( !!"construction from a single object is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 5)" );
#endif
}
CASE( "span<>: Allows to construct from a const single object (C++11)" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 5 )
#if gsl_HAVE( IS_DELETE )
const int x = 0;
span<const int> v( x );
EXPECT( v.size() == index_type( 1 ) );
#else
EXPECT( !!"=delete is not available (no C++11)" );
#endif
#else
EXPECT( !!"construction from a const single object is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 5)" );
#endif
}
CASE( "span<>: Allows to construct from two pointers" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr, arr + gsl_DIMENSION_OF( arr ) );
span<const int> w( arr, arr + gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( w.begin(), w.end(), arr ) );
}
CASE( "span<>: Allows to construct from two pointers to const" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v( arr, arr + gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "span<>: Allows to construct from a non-null pointer and a size" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr, gsl_DIMENSION_OF( arr ) );
span<const int> w( arr, gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( w.begin(), w.end(), arr ) );
}
CASE( "span<>: Allows to construct from a non-null pointer to const and a size" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v( arr, gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "span<>: Allows to construct from a temporary pointer and a size" )
{
int x = 42;
span< int> v( &x, 1 );
span<const int> w( &x, 1 );
EXPECT( std::equal( v.begin(), v.end(), &x ) );
EXPECT( std::equal( w.begin(), w.end(), &x ) );
}
CASE( "span<>: Allows to construct from a temporary pointer to const and a size" )
{
const int x = 42;
span<const int> v( &x, 1 );
EXPECT( std::equal( v.begin(), v.end(), &x ) );
}
CASE( "span<>: Allows to construct from any pointer and a zero size" )
{
struct F {
static void null() {
int * p = gsl_nullptr; span<int> v( p, index_type( 0 ) );
}
static void nonnull() {
int i = 7; int * p = &i; span<int> v( p, index_type( 0 ) );
}
};
EXPECT_NO_THROW( F::null() );
EXPECT_NO_THROW( F::nonnull() );
}
CASE( "span<>: Allows to construct from a C-array" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr );
span<const int> w( arr );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( w.begin(), w.end(), arr ) );
}
CASE( "span<>: Allows to construct from a const C-array" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v( arr );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "span<>: Allows to construct from a C-array with size via decay to pointer (potentially dangerous)" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
{
span< int> v( arr, gsl_DIMENSION_OF(arr) );
span<const int> w( arr, gsl_DIMENSION_OF(arr) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( w.begin(), w.end(), arr ) );
}
#if gsl_CPP14_OR_GREATER
{
span< int> v( arr, 3 );
span<const int> w( arr, 3 );
EXPECT( std::equal( v.begin(), v.end(), arr, arr + 3 ) );
EXPECT( std::equal( w.begin(), w.end(), arr, arr + 3 ) );
}
#endif
}
CASE( "span<>: Allows to construct from a const C-array with size via decay to pointer (potentially dangerous)" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
{
span<const int> v( arr, gsl_DIMENSION_OF(arr) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
#if gsl_CPP14_OR_GREATER
{
span<const int> w( arr, 3 );
EXPECT( std::equal( w.begin(), w.end(), arr, arr + 3 ) );
}
#endif
}
CASE( "span<>: Allows to construct from a std::array<> (C++11)" )
{
# if gsl_HAVE( ARRAY )
std::array<int,9> arr = {{ 1, 2, 3, 4, 5, 6, 7, 8, 9, }};
span<int> v( arr );
EXPECT( std::equal( v.begin(), v.end(), arr.begin() ) );
#if !gsl_DEPRECATE_TO_LEVEL( 5 )
span<const int> w( arr );
EXPECT( std::equal( w.begin(), w.end(), arr.begin() ) );
#endif
#else
EXPECT( !!"std::array<> is not available (no C++11)" );
#endif
}
CASE( "span<>: Allows to construct from a std::array<> with const data (C++11) " "[deprecated-5]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 5 )
#if gsl_HAVE( ARRAY )
std::array<const int,9> arr = {{ 1, 2, 3, 4, 5, 6, 7, 8, 9, }};
span<const int> v( arr );
EXPECT( std::equal( v.begin(), v.end(), arr.begin() ) );
#else
EXPECT( !!"std::array<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"construction from const data is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 5)" );
#endif
}
CASE( "span<>: Allows to construct from a container (std::vector<>)" )
{
std::vector<int> vec = vector_iota(10);
#if gsl_HAVE( CONSTRAINED_SPAN_CONTAINER_CTOR ) || gsl_HAVE( UNCONSTRAINED_SPAN_CONTAINER_CTOR )
span< int> v( vec );
span<const int> w( vec );
EXPECT( std::equal( v.begin(), v.end(), vec.begin() ) );
EXPECT( std::equal( w.begin(), w.end(), vec.begin() ) );
#else
EXPECT( !!"(un)constrained construction from container is not available" );
#endif
}
CASE( "span<>: Allows to construct from a temporary container (potentially dangerous)" )
{
#if gsl_HAVE( CONSTRAINED_SPAN_CONTAINER_CTOR ) || gsl_HAVE( UNCONSTRAINED_SPAN_CONTAINER_CTOR )
std::vector<int> vec = vector_iota( 10 );
EXPECT( std::equal( vec.begin(), vec.end(), span<const int>( vector_iota(10) ).begin() ) );
#else
EXPECT( !!"(un)constrained construction from container is not available" );
#endif
}
CASE( "span<>: Allows to tag-construct from a container (std::vector<>)" )
{
#if gsl_FEATURE_TO_STD( WITH_CONTAINER )
std::vector<int> vec = vector_iota(10);
span< int> v( with_container, vec );
span<const int> w( with_container, vec );
EXPECT( std::equal( v.begin(), v.end(), vec.begin() ) );
EXPECT( std::equal( w.begin(), w.end(), vec.begin() ) );
#else
EXPECT( !!"with_container is not available (gsl_FEATURE_WITH_CONTAINER_TO_STD)" );
#endif
}
CASE( "span<>: Allows to tag-construct from a temporary container (potentially dangerous)" )
{
#if gsl_FEATURE_TO_STD( WITH_CONTAINER )
std::vector<int> vec = vector_iota(10);
EXPECT( std::equal( vec.begin(), vec.end(), span<const int>( with_container, vector_iota( 10 ) ).begin() ) );
#else
EXPECT( !!"with_container is not available (gsl_FEATURE_WITH_CONTAINER_TO_STD)" );
#endif
}
CASE( "span<>: Allows to construct from an empty gsl::shared_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( SHARED_PTR )
span<int> ptr = gsl::shared_ptr<int>( gsl_nullptr );
span<int> s( ptr );
EXPECT( s.size() == index_type( 0 ) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::shared_ptr is not available" );
#endif
#else
EXPECT( !!"construction from shared_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to construct from an empty gsl::unique_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
gsl::unique_ptr<int> ptr = std::unique_ptr<int>( gsl_nullptr );
span<int> s( ptr );
EXPECT( s.size() == index_type( 0 ) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::unique_ptr is not available" );
#endif
#else
EXPECT( !!"construction from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to construct from an empty gsl::unique_ptr (array, C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
gsl::unique_ptr<int[]> ptr = unique_ptr<int[]>( gsl_nullptr );
span<int> s( ptr, 0 );
EXPECT( s.size() == index_type( 0 ) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::unique_ptr is not available" );
#endif
#else
EXPECT( !!"construction from shared_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to construct from a non-empty gsl::shared_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( SHARED_PTR )
shared_ptr<int> ptr = gsl::make_shared<int>( 4 );
span<int> s( ptr );
EXPECT( s.size() == index_type( 1 ) );
EXPECT( s.data() == ptr.get() );
EXPECT( s[0] == 4 );
#else
EXPECT( !!"gsl::shared_ptr is not available" );
#endif
#else
EXPECT( !!"construction from shared_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to construct from a non-empty gsl::unique_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
#if gsl_HAVE( MAKE_UNIQUE )
gsl::unique_ptr<int> ptr = std::make_unique<int>( 4 );
#else
gsl::unique_ptr<int> ptr = unique_ptr<int>( new int( 4 ) );
#endif
span<int> s( ptr );
EXPECT( s.size() == index_type( 1 ) );
EXPECT( s.data() == ptr.get() );
EXPECT( s[0] == 4 );
#else
EXPECT( !!"gsl::unique_ptr is not available" );
#endif
#else
EXPECT( !!"construction from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to construct from a non-empty gsl::unique_ptr (array, C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
#if gsl_HAVE( MAKE_UNIQUE )
gsl::unique_ptr<size_t[]> arr = make_unique<size_t[]>( 4 );
#else
gsl::unique_ptr<size_t[]> arr = unique_ptr<size_t[]>( new size_t[4] );
#endif
for ( size_t i = 0; i < 4; i++ )
arr[i] = i + 1;
span<size_t> s( arr, 4 );
EXPECT( s.size() == index_type( 4 ) );
EXPECT( s.data() == arr.get() );
EXPECT( s[0] == 1u );
EXPECT( s[1] == 2u );
#else
EXPECT( !!"gsl::unique_ptr is not available" );
#endif
#else
EXPECT( !!"construction from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "span<>: Allows to copy-construct from another span of the same type" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr );
span<const int> w( arr );
span< int> x( v );
span<const int> y( w );
EXPECT( std::equal( x.begin(), x.end(), arr ) );
EXPECT( std::equal( y.begin(), y.end(), arr ) );
}
CASE( "span<>: Allows to copy-construct from another span of a compatible type" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr );
span<const int> w( arr );
span<const volatile int> x( v );
span<const volatile int> y( w );
EXPECT( std::equal( x.begin(), x.end(), arr ) );
EXPECT( std::equal( y.begin(), y.end(), arr ) );
}
CASE( "span<>: Allows to move-construct from another span of the same type (C++11)" )
{
#if gsl_CPP11_OR_GREATER
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v(( span< int>( arr ) ));
// span< int> w(( span<const int>( arr ) ));
span<const int> x(( span< int>( arr ) ));
span<const int> y(( span<const int>( arr ) ));
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( x.begin(), x.end(), arr ) );
EXPECT( std::equal( y.begin(), y.end(), arr ) );
#else
EXPECT( !!"move-semantics are not available (no C++11)" );
#endif
}
CASE( "span<>: Allows to copy-assign from another span of the same type" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v( arr );
span< int> s;
span<const int> t;
s = v;
t = v;
EXPECT( std::equal( s.begin(), s.end(), arr ) );
EXPECT( std::equal( t.begin(), t.end(), arr ) );
}
CASE( "span<>: Allows to move-assign from another span of the same type (C++11)" )
{
#if gsl_CPP11_OR_GREATER
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span< int> v;
span<const int> w;
v = span<int>( arr );
w = span<int>( arr );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
EXPECT( std::equal( w.begin(), w.end(), arr ) );
#else
EXPECT( !!"move-semantics are not available (no C++11)" );
#endif
}
CASE( "span<>: Allows to create a sub span of the first n elements" )
{
int arr[] = { 1, 2, 3, 4, 5, };
span<int> v( arr );
index_type count = 3;
span< int> s = v.first( count );
span<const int> t = v.first( count );
EXPECT( s.size() == count );
EXPECT( t.size() == count );
EXPECT( std::equal( s.begin(), s.end(), arr ) );
EXPECT( std::equal( t.begin(), t.end(), arr ) );
}
CASE( "span<>: Allows to create a sub span of the last n elements" )
{
int arr[] = { 1, 2, 3, 4, 5, };
span<int> v( arr );
index_type count = 3;
span< int> s = v.last( count );
span<const int> t = v.last( count );
EXPECT( s.size() == count );
EXPECT( t.size() == count );
EXPECT( std::equal( s.begin(), s.end(), arr + v.size() - count ) );
EXPECT( std::equal( t.begin(), t.end(), arr + v.size() - count ) );
}
CASE( "span<>: Allows to create a sub span starting at a given offset" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
index_type offset = 1;
span< int> s = v.subspan( offset );
span<const int> t = v.subspan( offset );
EXPECT( s.size() == v.size() - offset );
EXPECT( t.size() == v.size() - offset );
EXPECT( std::equal( s.begin(), s.end(), arr + offset ) );
EXPECT( std::equal( t.begin(), t.end(), arr + offset ) );
}
CASE( "span<>: Allows to create a sub span starting at a given offset with a given length" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
index_type offset = 1;
index_type length = 1;
span< int> s = v.subspan( offset, length );
span<const int> t = v.subspan( offset, length );
EXPECT( s.size() == length );
EXPECT( t.size() == length );
EXPECT( std::equal( s.begin(), s.end(), arr + offset ) );
EXPECT( std::equal( t.begin(), t.end(), arr + offset ) );
}
CASE( "span<>: Allows to create an empty sub span at full offset" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
index_type offset = v.size();
span< int> s = v.subspan( offset );
span<const int> t = v.subspan( offset );
EXPECT( s.empty() );
EXPECT( t.empty() );
}
CASE( "span<>: Allows to create an empty sub span at full offset with zero length" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
index_type offset = v.size();
index_type length = 0;
span< int> s = v.subspan( offset, length );
span<const int> t = v.subspan( offset, length );
EXPECT( s.empty() );
EXPECT( t.empty() );
}
CASE( "span<>: Allows forward iteration" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
for ( span<int>::iterator pos = v.begin(); pos != v.end(); ++pos )
{
EXPECT( *pos == arr[ std::distance( v.begin(), pos )] );
}
}
CASE( "span<>: Allows const forward iteration" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
for ( span<int>::const_iterator pos = v.cbegin(); pos != v.cend(); ++pos )
{
EXPECT( *pos == arr[ std::distance( v.cbegin(), pos )] );
}
}
CASE( "span<>: Allows reverse iteration" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
for ( span<int>::reverse_iterator pos = v.rbegin(); pos != v.rend(); ++pos )
{
size_t dist = narrow<size_t>( std::distance(v.rbegin(), pos) );
EXPECT( *pos == arr[ v.size() - 1 - dist ] );
}
}
CASE( "span<>: Allows const reverse iteration" )
{
int arr[] = { 1, 2, 3, };
const span<int> v( arr );
for ( span<int>::const_reverse_iterator pos = v.crbegin(); pos != v.crend(); ++pos )
{
size_t dist = narrow<size_t>( std::distance(v.crbegin(), pos) );
EXPECT( *pos == arr[ v.size() - 1 - dist ] );
}
}
CASE( "span<>: Allows to observe an element via array indexing" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
for ( index_type i = 0; i < v.size(); ++i )
{
EXPECT( v[i] == arr[i] );
EXPECT( w[i] == arr[i] );
}
}
CASE( "span<>: Allows to observe an element via call indexing" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
for ( index_type i = 0; i < v.size(); ++i )
{
EXPECT( v(i) == arr[i] );
EXPECT( w(i) == arr[i] );
}
}
CASE( "span<>: Allows to observe an element via at()" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
for ( index_type i = 0; i < v.size(); ++i )
{
EXPECT( v.at(i) == arr[i] );
EXPECT( w.at(i) == arr[i] );
}
}
CASE( "span<>: Allows to observe an element via data()" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
EXPECT( *v.data() == *v.begin() );
EXPECT( *w.data() == *v.begin() );
for ( index_type i = 0; i < v.size(); ++i )
{
EXPECT( v.data()[i] == arr[i] );
EXPECT( w.data()[i] == arr[i] );
}
}
CASE( "span<>: Allows to change an element via array indexing" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
v[1] = 22;
w[2] = 33;
EXPECT( 22 == arr[1] );
EXPECT( 33 == arr[2] );
}
CASE( "span<>: Allows to change an element via call indexing" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
v(1) = 22;
w(2) = 33;
EXPECT( 22 == arr[1] );
EXPECT( 33 == arr[2] );
}
CASE( "span<>: Allows to change an element via at()" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
v.at(1) = 22;
w.at(2) = 33;
EXPECT( 22 == arr[1] );
EXPECT( 33 == arr[2] );
}
CASE( "span<>: Allows to change an element via data()" )
{
int arr[] = { 1, 2, 3, };
span<int> v( arr );
span<int> const w( arr );
*v.data() = 22;
EXPECT( 22 == *v.data() );
*w.data() = 33;
EXPECT( 33 == *w.data() );
}
CASE( "span<>: Allows to compare equal to another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT( va == va );
EXPECT_NOT( vb == va );
EXPECT_NOT( vc == va );
}
CASE( "span<>: Allows to compare unequal to another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT_NOT( va != va );
EXPECT( vb != va );
EXPECT( vc != va );
}
CASE( "span<>: Allows to compare less than another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT_NOT( va < va );
EXPECT( va < vb );
EXPECT( va < vc );
}
CASE( "span<>: Allows to compare less than or equal to another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT_NOT( vb <= va );
EXPECT( va <= vb );
EXPECT( va <= vc );
}
CASE( "span<>: Allows to compare greater than another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT_NOT( va > va );
EXPECT( vb > va );
EXPECT( vc > va );
}
CASE( "span<>: Allows to compare greater than or equal to another span of the same type" )
{
int a[] = { 1 }, b[] = { 2 }, c[] = { 1, 2 };
span<int> va( a );
span<int> vb( b );
span<int> vc( c );
EXPECT_NOT( va >= vb );
EXPECT( vb >= va );
EXPECT( vc >= va );
}
CASE( "span<>: Allows to compare to another span of the same type and different cv-ness (non-standard)" )
{
#if gsl_CONFIG( ALLOWS_NONSTRICT_SPAN_COMPARISON )
int aa[] = { 1 }, bb[] = { 2 };
span< int> a( aa );
span< const int> ca( aa );
span<volatile int> va( aa );
span< int> b( bb );
span< const int> cb( bb );
EXPECT( va == ca );
EXPECT( a == va );
EXPECT( a == ca );
EXPECT( a != cb );
EXPECT( a <= cb );
EXPECT( a < cb );
EXPECT( b >= ca );
EXPECT( b > ca );
#else
EXPECT( !!"span<>: cannot compare different types (gsl_CONFIG_ALLOWS_NONSTRICT_SPAN_COMPARISON=0)" );
#endif
}
CASE( "span<>: Allows to compare empty spans as equal" )
{
int a;
span<int> p;
span<int> q;
span<int> r( &a, index_type( 0 ) );
EXPECT( p == q );
EXPECT( p == r );
#if gsl_HAVE( NULLPTR ) && ! gsl_DEPRECATE_TO_LEVEL( 5 )
span<int> s( nullptr, 0 );
span<int> t( nullptr, 0 );
EXPECT( s == p );
EXPECT( s == r );
EXPECT( s == t );
#endif
}
CASE( "span<>: Allows to test for empty span via empty(), empty case" )
{
span<int> v;
EXPECT( v.empty() );
}
CASE( "span<>: Allows to test for empty span via empty(), non-empty case" )
{
int a[] = { 1 };
span<int> v( a );
EXPECT_NOT( v.empty() );
}
CASE( "span<>: Allows to obtain the number of elements via size(), as configured" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( va.size() == index_type( gsl_DIMENSION_OF( a ) ) );
EXPECT( vb.size() == index_type( gsl_DIMENSION_OF( b ) ) );
EXPECT( z.size() == index_type( 0 ) );
}
CASE( "span<>: Allows to obtain the number of elements via ssize(), signed" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( va.ssize() == size_type( gsl_DIMENSION_OF( a ) ) );
EXPECT( vb.ssize() == size_type( gsl_DIMENSION_OF( b ) ) );
EXPECT( z.ssize() == 0 );
}
CASE( "span<>: Allows to obtain the number of elements via length() " "[deprecated-3]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 3 )
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( va.length() == index_type( gsl_DIMENSION_OF( a ) ) );
EXPECT( vb.length() == index_type( gsl_DIMENSION_OF( b ) ) );
EXPECT( z.length() == index_type( 0 ) );
#else
EXPECT( !!"length() is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 3)" );
#endif
}
CASE( "span<>: Allows to obtain the number of bytes via size_bytes()" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( va.size_bytes() == index_type( gsl_DIMENSION_OF( a ) * sizeof(int) ) );
EXPECT( vb.size_bytes() == index_type( gsl_DIMENSION_OF( b ) * sizeof(int) ) );
EXPECT( z.size_bytes() == index_type( 0 * sizeof(int) ) );
}
CASE( "span<>: Allows to obtain the number of bytes via length_bytes() " "[deprecated-3]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 3 )
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( va.length_bytes() == index_type( gsl_DIMENSION_OF( a ) * sizeof(int) ) );
EXPECT( vb.length_bytes() == index_type( gsl_DIMENSION_OF( b ) * sizeof(int) ) );
EXPECT( z.length_bytes() == index_type( 0 * sizeof(int) ) );
#else
EXPECT( !!"length_bytes() is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 3)" );
#endif
}
CASE( "span<>: Allows to swap with another span of the same type" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> va0( a );
span<int> vb0( b );
span<int> va( a );
span<int> vb( b );
va.swap( vb );
EXPECT( va == vb0 );
EXPECT( vb == va0 );
}
static bool is_little_endian()
{
union U
{
U() : i(1) {}
int i;
char c[ sizeof(int) ];
};
return 1 != U().c[ sizeof(int) - 1 ];
}
CASE( "span<>: Allows to view the elements as read-only bytes " "[deprecated-2 as member]" )
{
#if gsl_HAVE( SIZED_TYPES )
typedef int32_t type;
#else
typedef int type;
#endif
typedef gsl::byte gyte;
EXPECT( sizeof( type ) == size_t( 4 ) );
type a[] = { 0x12345678, };
gyte be[] = { to_byte(0x12), to_byte(0x34), to_byte(0x56), to_byte(0x78), };
gyte le[] = { to_byte(0x78), to_byte(0x56), to_byte(0x34), to_byte(0x12), };
gyte * b = is_little_endian() ? le : be;
span<type> va( a );
span<const gyte> vc( as_bytes( va ) );
EXPECT( vc[0] == b[0] );
EXPECT( vc[1] == b[1] );
EXPECT( vc[2] == b[2] );
EXPECT( vc[3] == b[3] );
#if !gsl_DEPRECATE_TO_LEVEL( 2 )
span<const gyte> vb( va.as_bytes() ); // deprecated since v0.17.0
EXPECT( vb[0] == b[0] );
EXPECT( vb[1] == b[1] );
EXPECT( vb[2] == b[2] );
EXPECT( vb[3] == b[3] );
#else
EXPECT( !!"span<>::as_bytes() is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 2)" );
#endif
}
CASE( "span<>: Allows to view and change the elements as writable bytes " "[deprecated-2 as member]" )
{
#if gsl_HAVE( SIZED_TYPES )
typedef int32_t type;
#else
typedef int type;
#endif
typedef gsl::byte gyte;
EXPECT( sizeof(type) == size_t( 4 ) );
{
type a[] = { 0x0, };
span<type> va( a );
span<gyte> vc( as_writeable_bytes(va) );
for ( size_t i = 0; i < sizeof(type); ++i )
{
EXPECT( vc[i] == to_byte(0) );
}
vc[0] = to_byte(0x42);
EXPECT( vc[0] == to_byte(0x42) );
for ( size_t i = 1; i < sizeof(type); ++i )
{
EXPECT( vc[i] == to_byte(0) );
}
}
#if !gsl_DEPRECATE_TO_LEVEL( 2 )
{
type a[] = { 0x0, };
span<type> va( a );
span<gyte> vb( va.as_writeable_bytes() );
for ( size_t i = 0; i < sizeof(type); ++i )
{
EXPECT( vb[i] == to_byte(0) );
}
vb[0] = to_byte(0x42);
EXPECT( vb[0] == to_byte(0x42) );
for ( size_t i = 1; i < sizeof(type); ++i )
{
EXPECT( vb[i] == to_byte(0) );
}
}
#else
EXPECT( !!"as_bytes() is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 2)" );
#endif
}
CASE( "span<>: Allows to view the elements as a span of another type" )
{
#if gsl_HAVE( SIZED_TYPES )
typedef int32_t type1;
typedef int16_t type2;
#else
typedef int type1;
typedef short type2;
#endif
EXPECT( sizeof( type1 ) == size_t( 4 ) );
EXPECT( sizeof( type2 ) == size_t( 2 ) );
type1 a[] = { 0x12345678, };
type2 be[] = { type2(0x1234), type2(0x5678), };
type2 le[] = { type2(0x5678), type2(0x1234), };
type2 * b = is_little_endian() ? le : be;
span<type1> va( a );
#if gsl_COMPILER_MSVC_VERSION == 60
span<type2> vb( va.as_span( type2() ) );
#else
span<type2> vb( va.as_span<type2>() );
#endif
EXPECT( vb[0] == b[0] );
EXPECT( vb[1] == b[1] );
}
CASE( "span<>: Allows to change the elements from a span of another type" )
{
#if gsl_HAVE( SIZED_TYPES )
typedef int32_t type1;
typedef int16_t type2;
#else
typedef int type1;
typedef short type2;
#endif
EXPECT( sizeof( type1 ) == size_t( 4 ) );
EXPECT( sizeof( type2 ) == size_t( 2 ) );
type1 a[] = { 0x0, };
span<type1> va( a );
#if gsl_COMPILER_MSVC_VERSION == 60
span<type2> vb( va.as_span( type2() ) );
#else
span<type2> vb( va.as_span<type2>() );
#endif
{for ( size_t i = 0; i < sizeof(type2); ++i ) EXPECT( vb[i] == type2(0) ); }
vb[0] = 0x42;
EXPECT( vb[0] == type2(0x42) );
{for ( size_t i = 1; i < sizeof(type2); ++i ) EXPECT( vb[i] == type2(0) ); }
}
CASE( "copy(): Allows to copy a span to another span of the same element type" )
{
int a[] = { 1, 2, 3, };
int b[] = { 0, 0, 0, 0, 0, };
span<int> src( a );
span<int> dst( b );
copy( src, dst );
EXPECT( src == dst.subspan( 0, src.size() ) );
}
CASE( "copy(): Allows to copy a span to another span of a different element type" )
{
char a[] = { 'a', 'b', 'c', };
int b[] = { 0 , 0 , 0 , 0, 0, };
span<char> src( a );
span<int > dst( b );
copy( src, dst );
for ( span<int>::index_type i = 0; i < src.size(); ++i )
{
EXPECT( src[i] == dst[i] );
}
}
CASE( "size(): Allows to obtain the number of elements in span via size(span), unsigned" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( size( va ) == std::size_t( gsl_DIMENSION_OF( a ) ) );
EXPECT( size( vb ) == std::size_t( gsl_DIMENSION_OF( b ) ) );
EXPECT( size( z ) == std::size_t( 0 ) );
}
CASE( "ssize(): Allows to obtain the number of elements in span via ssize(span), signed" )
{
int a[] = { 1, 2, 3, };
int b[] = { 1, 2, 3, 4, 5, };
span<int> z;
span<int> va( a );
span<int> vb( b );
EXPECT( ssize( va ) == size_type( gsl_DIMENSION_OF( a ) ) );
EXPECT( ssize( vb ) == size_type( gsl_DIMENSION_OF( b ) ) );
EXPECT( ssize( z ) == 0 );
}
#if ! gsl_FEATURE_TO_STD( MAKE_SPAN )
CASE( "make_span(): unavailable (gsl_FEATURE_MAKE_SPAN=0)" )
{
EXPECT( !!"(avoid warning)" ); // suppress: unused parameter 'lest_env' [-Wunused-parameter]
}
#else
CASE( "make_span(): (gsl_FEATURE_MAKE_SPAN=1)" )
{
EXPECT( !!"(avoid warning)" ); // suppress: unused parameter 'lest_env' [-Wunused-parameter]
}
CASE( "make_span(): Allows to build from two pointers" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<int> v = make_span( arr, arr + gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from two const pointers" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v = make_span( arr, arr + gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from a non-null pointer and a size" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<int> v = make_span( arr, gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from a non-null const pointer and a size" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v = make_span( arr, gsl_DIMENSION_OF( arr ) );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from a C-array" )
{
int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<int> v = make_span( arr );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from a const C-array" )
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
span<const int> v = make_span( arr );
EXPECT( std::equal( v.begin(), v.end(), arr ) );
}
CASE( "make_span(): Allows to build from a std::array<> (C++11)" )
{
#if gsl_HAVE( ARRAY )
std::array<int,9> arr = {{ 1, 2, 3, 4, 5, 6, 7, 8, 9, }};
span<int> v = make_span( arr );
EXPECT( std::equal( v.begin(), v.end(), arr.begin() ) );
#else
EXPECT( !!"std::array<> is not available (no C++11)" );
#endif
}
CASE( "make_span(): Allows to build from a const std::array<> (C++11)" )
{
#if gsl_HAVE( ARRAY )
const std::array<int,9> arr = {{ 1, 2, 3, 4, 5, 6, 7, 8, 9, }};
span<const int> v = make_span( arr );
EXPECT( std::equal( v.begin(), v.end(), arr.begin() ) );
#else
EXPECT( !!"std::array<> is not available (no C++11)" );
#endif
}
CASE( "make_span(): Allows to build from a container (std::vector<>)" )
{
std::vector<int> vec = vector_iota(10);
span<int> v = make_span( vec );
EXPECT( std::equal( v.begin(), v.end(), vec.begin() ) );
}
CASE( "make_span(): Allows to build from a const container (std::vector<>)" )
{
const std::vector<int> vec = vector_iota(10);
span<const int> v = make_span( vec );
EXPECT( std::equal( v.begin(), v.end(), vec.begin() ) );
}
CASE( "make_span(): Allows to build from a temporary container (potentially dangerous)" )
{
std::vector<int> vec = vector_iota(10);
EXPECT( std::equal( vec.begin(), vec.end(), make_span( vector_iota( 10 ) ).begin() ) );
}
CASE( "make_span(): Allows to tag-build from a container (std::vector<>)" )
{
#if gsl_FEATURE_TO_STD( WITH_CONTAINER )
std::vector<int> vec = vector_iota(10);
span< int> v = make_span( with_container, vec );
span<const int> w = make_span( with_container, vec );
EXPECT( std::equal( v.begin(), v.end(), vec.begin() ) );
EXPECT( std::equal( w.begin(), w.end(), vec.begin() ) );
#else
EXPECT( !!"with_container is not available (gsl_FEATURE_WITH_CONTAINER_TO_STD)" );
#endif
}
CASE( "make_span(): Allows to tag-build from a temporary container (potentially dangerous)" )
{
#if gsl_FEATURE_TO_STD( WITH_CONTAINER )
std::vector<int> vec = vector_iota(10);
EXPECT( std::equal( vec.begin(), vec.end(), make_span( with_container, vector_iota( 10 ) ).begin() ) );
#else
EXPECT( !!"with_container is not available (gsl_FEATURE_WITH_CONTAINER_TO_STD)" );
#endif
}
CASE( "make_span(): Allows to build from an empty gsl::shared_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( SHARED_PTR )
auto ptr = gsl::shared_ptr<int>( gsl_nullptr );
auto s = make_span( ptr );
EXPECT( s.size() == index_type( 0) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::shared_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from shared_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "make_span(): Allows to build from an empty gsl::unique_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
auto ptr = gsl::unique_ptr<int>( gsl_nullptr );
auto s = make_span( ptr );
EXPECT( s.size() == index_type( 0 ) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::unique_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "make_span(): Allows to build from an empty gsl::unique_ptr (array, C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
auto arr = std::unique_ptr<int[]>( gsl_nullptr );
auto s = make_span( arr, 0 );
EXPECT( s.size() == index_type( 0 ) );
EXPECT( s.data() == gsl_nullptr );
#else
EXPECT( !!"gsl::unique_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "make_span(): Allows to build from a non-empty gsl::shared_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( SHARED_PTR )
auto ptr = gsl::make_shared<int>( 4 );
auto s = make_span( ptr );
EXPECT( s.size() == index_type( 1 ) );
EXPECT( s.data() == ptr.get() );
EXPECT( s[0] == 4 );
#else
EXPECT( !!"gsl::shared_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "make_span(): Allows to build from a non-empty gsl::unique_ptr (C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
#if gsl_HAVE( MAKE_UNIQUE )
auto ptr = gsl::make_unique<int>( 4 );
#else
auto ptr = gsl::unique_ptr<int>( new int(4) );
#endif
auto s = make_span( ptr );
EXPECT( s.size() == index_type( 1 ) );
EXPECT( s.data() == ptr.get() );
EXPECT( s[0] == 4 );
#else
EXPECT( !!"gsl::unique_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from unique_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
CASE( "make_span(): Allows to build from a non-empty gsl::unique_ptr (array, C++11) " "[deprecated-4]" )
{
#if !gsl_DEPRECATE_TO_LEVEL( 4 )
#if gsl_HAVE( UNIQUE_PTR )
#if gsl_HAVE( MAKE_UNIQUE )
auto arr = std::make_unique<size_t[]>(4);
#else
auto arr = std::unique_ptr<size_t[]>( new size_t[4] );
#endif
for ( size_t i = 0; i < 4; i++ )
arr[i] = i + 1;
auto s = make_span( arr, 4 );
EXPECT( s.size() == index_type( 4 ) );
EXPECT( s.data() == arr.get() );
EXPECT( s[0] == 1u );
EXPECT( s[1] == 2u );
#else
EXPECT( !!"gsl::unique_ptr<> is not available (no C++11)" );
#endif
#else
EXPECT( !!"make_span() from shared_ptr is not available (gsl_CONFIG_DEPRECATE_TO_LEVEL >= 4)" );
#endif
}
#endif // gsl_FEATURE( MAKE_SPAN )
#if ! gsl_FEATURE_TO_STD( BYTE_SPAN )
CASE( "byte_span(): unavailable (gsl_FEATURE_BYTE_SPAN=0)" )
{
EXPECT( !!"(avoid warning)" ); // suppress: unused parameter 'lest_env' [-Wunused-parameter]
}
#else
CASE( "byte_span() (gsl_FEATURE_BYTE_SPAN=1)" )
{
EXPECT( !!"(avoid warning)" ); // suppress: unused parameter 'lest_env' [-Wunused-parameter]
}
CASE( "byte_span(): Allows to build a span of gsl::byte from a single object" )
{
int x = (std::numeric_limits<int>::max)();
span<gsl::byte> spn = byte_span( x );
EXPECT( spn.size() == index_type( sizeof x ) );
EXPECT( spn[0] == to_byte( 0xff ) );
}
CASE( "byte_span(): Allows to build a span of const gsl::byte from a single const object" )
{
const int x = (std::numeric_limits<int>::max)();
span<const gsl::byte> spn = byte_span( x );
EXPECT( spn.size() == index_type( sizeof x ) );
EXPECT( spn[0] == to_byte( 0xff ) );
}
#endif // span_PROVIDE( BYTE_SPAN )
// end of file
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; WriteDr1.Asm
;
; Abstract:
;
; AsmWriteDr1 function
;
; Notes:
;
;------------------------------------------------------------------------------
.586p
.model flat,C
.code
;------------------------------------------------------------------------------
; UINTN
; EFIAPI
; AsmWriteDr1 (
; IN UINTN Value
; );
;------------------------------------------------------------------------------
AsmWriteDr1 PROC
mov eax, [esp + 4]
mov dr1, eax
ret
AsmWriteDr1 ENDP
END
|
; A006186: Number of pair-coverings with largest block size 4.
; 1,5,8,10,11,12,12,13,13,13
sub $1,$0
mul $0,4
pow $0,2
sub $1,1
div $0,$1
div $0,$1
add $0,1
|
; A063246: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 99 ).
; 4,12,22,28,38,46,54,62,72,78,88,96,104,112,122,128,138,146,154,162,172,178,188,196,204,212,222,228,238,246,254,262,272,278,288,296,304,312,322,328,338,346,354,362,372,378,388,396,404,412
mov $4,$0
div $0,2
add $0,3
mov $1,9
add $1,$0
mov $2,$4
mul $2,4
mov $3,$2
div $4,3
add $4,6
sub $3,$4
add $1,$3
sub $1,4
mul $1,2
|
; this sample shows how the stack works.
; click 'stack' button in emulator to see the contents of the stack.
; stack is important element in computer architecture.
; this code does nothing useful, except printing "Hi" in the end.
name "stack"
org 100h ; create tiny com file.
mov ax, 1234h
push ax
mov dx, 5678h
push dx
pop bx
pop cx
; function call pushes ip value of the next instruction:
call tfunc
mov ax, 7890h
push ax
pop bx
; interrupts are like funtions,
; but in addition they push code segment into the stack
mov ax, 3
int 10h ; set standart video mode.
; a typical use of stack is to set segment registers.
; set ds to video memory segment:
mov ax, 0b800h
push ax
pop ds
; print "hi":
mov [170h], 'H'
mov [172h], 'i'
; color attribute for 'h'
mov [171h], 11001110b
; color attribute for 'i'
mov [173h], 10011110b
; wait for any key press....
mov ah, 0
int 16h
; here we "pop" the ip value,
; and return control to the operating system:
ret
; the test procedure:
tfunc proc
xor bx, bx
xor cx, cx
; here we "pop" the ip value,
; and return control to the main program:
ret
endp
|
#INCLUDE <P16F873A.INC>
ORG 0X00
GOTO INICIO ; Vá para o início
ATUALIZA BTFSC PORTB, 0X01 ; Caixa d'água totalmente cheia?
RETLW 0X00 ; Sim, desligue o motor
BTFSS PORTB, 0X00 ; Não, mas caixa d'água totalmente vazia?
RETLW 0X04 ; Não, ligue o motor
BTFSS PORTB, 0X02 ; Sim, mas o motor está ligado?
RETLW 0X00 ; Não, permaneça desligado
RETLW 0X04 ; Sim, permaneça ligado
INICIO BSF STATUS, 0X05 ; Vá para o banco 1
MOVLW B'11111011'
MOVWF TRISB ; Rb0 e Rb1 como entrada e Rb3 como saída
BCF STATUS, 0X05 ; Vá para o banco 0
PROGRAMA CALL ATUALIZA ; Vá para a sub-rotina
MOVWF PORTB ; Atualize o estado do motor
GOTO PROGRAMA ; Volte ao início
END
|
; A135966: Triangle, read by rows, where T(n,k) = fibonacci(k(n-k) + 1) for n>=k>=0.
; 1,1,1,1,1,1,1,2,2,1,1,3,5,3,1,1,5,13,13,5,1,1,8,34,55,34,8,1,1,13,89,233,233,89,13,1,1,21,233,987,1597,987,233,21,1,1,34,610,4181,10946,10946,4181,610,34,1,1,55,1597,17711,75025,121393,75025,17711,1597,55,1
seq $0,4247 ; Multiplication table read by antidiagonals: T(i,j) = ij (i>=0, j>=0).
seq $0,71 ; a(n) = Fibonacci(n) - 1.
add $0,1
|
; A173478: a(n) = the smallest number ending in n-1 zeros divisible by n.
; Submitted by Christian Krause
; 1,10,300,1000,10000,300000,7000000,10000000,900000000,1000000000,110000000000,300000000000,13000000000000,70000000000000,300000000000000
mov $1,1
add $1,$0
add $0,1
seq $0,178500 ; a(n) = 10^n * signum(n).
mov $2,$0
mul $0,91
gcd $2,$1
mul $1,$0
dif $1,5
div $1,$2
mov $0,$1
div $0,91
sub $0,2
div $0,2
add $0,1
|
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# 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.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
.p2align 6, 0x90
bswap128:
.byte 3,2,1,0, 7,6,5,4, 11,10,9,8, 15,14,13,12
rol_32_8:
.byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14
bcast:
.byte 0,1,2,3, 0,1,2,3, 0,1,2,3, 0,1,2,3
wzzz:
.byte 0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,12,13,14,15
.p2align 6, 0x90
.globl UpdateSM3
.type UpdateSM3, @function
UpdateSM3:
push %rbp
push %rbx
push %r12
push %r13
push %r14
push %r15
sub $(56), %rsp
movslq %edx, %rdx
movdqa bswap128(%rip), %xmm4
movdqa wzzz(%rip), %xmm7
movdqa bcast(%rip), %xmm8
movdqa rol_32_8(%rip), %xmm9
movq %rdi, (32)(%rsp)
movq %rdx, (40)(%rsp)
.p2align 6, 0x90
.Lsm3_loopgas_1:
vmovdqu (%rsi), %xmm0
vpshufb %xmm4, %xmm0, %xmm0
vmovdqu (16)(%rsi), %xmm1
vpshufb %xmm4, %xmm1, %xmm1
vmovdqu (32)(%rsi), %xmm2
vpshufb %xmm4, %xmm2, %xmm2
vmovdqu (48)(%rsi), %xmm3
vpshufb %xmm4, %xmm3, %xmm3
add $(64), %rsi
mov (%rdi), %r8d
mov (4)(%rdi), %r9d
mov (8)(%rdi), %r10d
mov (12)(%rdi), %r11d
mov (16)(%rdi), %r12d
mov (20)(%rdi), %r13d
mov (24)(%rdi), %r14d
mov (28)(%rdi), %r15d
vmovdqa %xmm0, (%rsp)
vpxor %xmm1, %xmm0, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm0, %xmm1, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm3, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %ebp
mov %r13d, %edx
xor %r10d, %ebp
xor %r14d, %edx
xor %r8d, %ebp
xor %r12d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm0, %xmm0
vpalignr $(12), %xmm1, %xmm2, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (4)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm0, %xmm5
vpxor %xmm0, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %r8d, %ebp
mov %r12d, %edx
xor %r9d, %ebp
xor %r13d, %edx
xor %r15d, %ebp
xor %r11d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm2, %xmm3, %xmm5
vpxor %xmm4, %xmm0, %xmm0
vpxor %xmm5, %xmm0, %xmm0
mov %r14d, %eax
mov (8)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm0, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %ebp
mov %r11d, %edx
xor %r8d, %ebp
xor %r12d, %edx
xor %r14d, %ebp
xor %r10d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (12)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %ebp
mov %r10d, %edx
xor %r15d, %ebp
xor %r11d, %edx
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
xor %r13d, %ebp
xor %r9d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm0, %xmm0
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm1, (%rsp)
vpxor %xmm2, %xmm1, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm1, %xmm2, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (16)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm0, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %ebp
mov %r9d, %edx
xor %r14d, %ebp
xor %r10d, %edx
xor %r12d, %ebp
xor %r8d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm1, %xmm1
vpalignr $(12), %xmm2, %xmm3, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (20)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm1, %xmm5
vpxor %xmm1, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %r12d, %ebp
mov %r8d, %edx
xor %r13d, %ebp
xor %r9d, %edx
xor %r11d, %ebp
xor %r15d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm3, %xmm0, %xmm5
vpxor %xmm4, %xmm1, %xmm1
vpxor %xmm5, %xmm1, %xmm1
mov %r10d, %eax
mov (24)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm1, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %ebp
mov %r15d, %edx
xor %r12d, %ebp
xor %r8d, %edx
xor %r10d, %ebp
xor %r14d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (28)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %ebp
mov %r14d, %edx
xor %r11d, %ebp
xor %r15d, %edx
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
xor %r9d, %ebp
xor %r13d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm1, %xmm1
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm2, (%rsp)
vpxor %xmm3, %xmm2, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm2, %xmm3, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (32)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm1, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %ebp
mov %r13d, %edx
xor %r10d, %ebp
xor %r14d, %edx
xor %r8d, %ebp
xor %r12d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm2, %xmm2
vpalignr $(12), %xmm3, %xmm0, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (36)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm2, %xmm5
vpxor %xmm2, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %r8d, %ebp
mov %r12d, %edx
xor %r9d, %ebp
xor %r13d, %edx
xor %r15d, %ebp
xor %r11d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm0, %xmm1, %xmm5
vpxor %xmm4, %xmm2, %xmm2
vpxor %xmm5, %xmm2, %xmm2
mov %r14d, %eax
mov (40)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm2, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %ebp
mov %r11d, %edx
xor %r8d, %ebp
xor %r12d, %edx
xor %r14d, %ebp
xor %r10d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (44)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %ebp
mov %r10d, %edx
xor %r15d, %ebp
xor %r11d, %edx
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
xor %r13d, %ebp
xor %r9d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm2, %xmm2
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm3, (%rsp)
vpxor %xmm0, %xmm3, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm3, %xmm0, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (48)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm2, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %ebp
mov %r9d, %edx
xor %r14d, %ebp
xor %r10d, %edx
xor %r12d, %ebp
xor %r8d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm3, %xmm3
vpalignr $(12), %xmm0, %xmm1, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (52)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm3, %xmm5
vpxor %xmm3, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %r12d, %ebp
mov %r8d, %edx
xor %r13d, %ebp
xor %r9d, %edx
xor %r11d, %ebp
xor %r15d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm1, %xmm2, %xmm5
vpxor %xmm4, %xmm3, %xmm3
vpxor %xmm5, %xmm3, %xmm3
mov %r10d, %eax
mov (56)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm3, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %ebp
mov %r15d, %edx
xor %r12d, %ebp
xor %r8d, %edx
xor %r10d, %ebp
xor %r14d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (60)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %ebp
mov %r14d, %edx
xor %r11d, %ebp
xor %r15d, %edx
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
xor %r9d, %ebp
xor %r13d, %edx
add %edx, %ebx
add %ebp, %eax
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm3, %xmm3
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm0, (%rsp)
vpxor %xmm1, %xmm0, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm0, %xmm1, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (64)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm3, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm0, %xmm0
vpalignr $(12), %xmm1, %xmm2, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (68)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm0, %xmm5
vpxor %xmm0, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm2, %xmm3, %xmm5
vpxor %xmm4, %xmm0, %xmm0
vpxor %xmm5, %xmm0, %xmm0
mov %r14d, %eax
mov (72)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm0, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (76)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm0, %xmm0
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm1, (%rsp)
vpxor %xmm2, %xmm1, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm1, %xmm2, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (80)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm0, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm1, %xmm1
vpalignr $(12), %xmm2, %xmm3, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (84)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm1, %xmm5
vpxor %xmm1, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm3, %xmm0, %xmm5
vpxor %xmm4, %xmm1, %xmm1
vpxor %xmm5, %xmm1, %xmm1
mov %r10d, %eax
mov (88)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm1, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (92)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm1, %xmm1
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm2, (%rsp)
vpxor %xmm3, %xmm2, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm2, %xmm3, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (96)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm1, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm2, %xmm2
vpalignr $(12), %xmm3, %xmm0, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (100)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm2, %xmm5
vpxor %xmm2, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm0, %xmm1, %xmm5
vpxor %xmm4, %xmm2, %xmm2
vpxor %xmm5, %xmm2, %xmm2
mov %r14d, %eax
mov (104)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm2, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (108)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm2, %xmm2
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm3, (%rsp)
vpxor %xmm0, %xmm3, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm3, %xmm0, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (112)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm2, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm3, %xmm3
vpalignr $(12), %xmm0, %xmm1, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (116)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm3, %xmm5
vpxor %xmm3, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm1, %xmm2, %xmm5
vpxor %xmm4, %xmm3, %xmm3
vpxor %xmm5, %xmm3, %xmm3
mov %r10d, %eax
mov (120)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm3, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (124)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm3, %xmm3
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm0, (%rsp)
vpxor %xmm1, %xmm0, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm0, %xmm1, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (128)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm3, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm0, %xmm0
vpalignr $(12), %xmm1, %xmm2, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (132)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm0, %xmm5
vpxor %xmm0, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm2, %xmm3, %xmm5
vpxor %xmm4, %xmm0, %xmm0
vpxor %xmm5, %xmm0, %xmm0
mov %r14d, %eax
mov (136)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm0, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (140)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm0, %xmm0
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm1, (%rsp)
vpxor %xmm2, %xmm1, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm1, %xmm2, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (144)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm0, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm1, %xmm1
vpalignr $(12), %xmm2, %xmm3, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (148)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm1, %xmm5
vpxor %xmm1, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm1, %xmm1
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm3, %xmm0, %xmm5
vpxor %xmm4, %xmm1, %xmm1
vpxor %xmm5, %xmm1, %xmm1
mov %r10d, %eax
mov (152)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm1, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (156)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm1, %xmm1
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm2, (%rsp)
vpxor %xmm3, %xmm2, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm2, %xmm3, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (160)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm1, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm2, %xmm2
vpalignr $(12), %xmm3, %xmm0, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (164)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm2, %xmm5
vpxor %xmm2, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm2, %xmm2
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm0, %xmm1, %xmm5
vpxor %xmm4, %xmm2, %xmm2
vpxor %xmm5, %xmm2, %xmm2
mov %r14d, %eax
mov (168)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm2, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (172)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm2, %xmm2
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm3, (%rsp)
vpxor %xmm0, %xmm3, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm3, %xmm0, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r12d, %eax
mov (176)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm2, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
vpxor %xmm5, %xmm3, %xmm3
vpalignr $(12), %xmm0, %xmm1, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (180)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm3, %xmm5
vpxor %xmm3, %xmm5, %xmm5
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm3, %xmm3
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
vpalignr $(8), %xmm1, %xmm2, %xmm5
vpxor %xmm4, %xmm3, %xmm3
vpxor %xmm5, %xmm3, %xmm3
mov %r10d, %eax
mov (184)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
vpshufb %xmm8, %xmm3, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (188)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
vpxor %xmm4, %xmm3, %xmm3
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm0, (%rsp)
vpxor %xmm1, %xmm0, %xmm4
vmovdqa %xmm4, (16)(%rsp)
vpalignr $(12), %xmm0, %xmm1, %xmm4
vpslld $(7), %xmm4, %xmm6
vpsrld $(25), %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm4
mov %r8d, %eax
mov (192)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
vpsrldq $(4), %xmm3, %xmm5
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
vpxor %xmm5, %xmm0, %xmm0
vpalignr $(12), %xmm1, %xmm2, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (196)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpshufb %xmm9, %xmm0, %xmm5
vpxor %xmm0, %xmm5, %xmm5
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
vpslld $(15), %xmm5, %xmm6
vpsrld $(17), %xmm5, %xmm5
vpxor %xmm6, %xmm5, %xmm5
vpxor %xmm5, %xmm0, %xmm0
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
vpalignr $(8), %xmm2, %xmm3, %xmm5
vpxor %xmm4, %xmm0, %xmm0
vpxor %xmm5, %xmm0, %xmm0
mov %r14d, %eax
mov (200)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
vpshufb %xmm8, %xmm0, %xmm4
vpsrlq $(17), %xmm4, %xmm4
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
vpshufb %xmm8, %xmm4, %xmm4
vpsllq $(15), %xmm4, %xmm5
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (204)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
vpxor %xmm5, %xmm4, %xmm4
vpsllq $(8), %xmm5, %xmm5
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
vpxor %xmm5, %xmm4, %xmm4
vpshufb %xmm7, %xmm4, %xmm4
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
vpxor %xmm4, %xmm0, %xmm0
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm1, (%rsp)
vpxor %xmm2, %xmm1, %xmm4
vmovdqa %xmm4, (16)(%rsp)
mov %r12d, %eax
mov (208)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (212)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
mov %r10d, %eax
mov (216)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (220)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
vmovdqa %xmm2, (%rsp)
vpxor %xmm3, %xmm2, %xmm4
vmovdqa %xmm4, (16)(%rsp)
mov %r8d, %eax
mov (224)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r12d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r15d, %ebx
add %r11d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
mov %r9d, %edx
mov %r9d, %ebp
and %r10d, %edx
xor %r10d, %ebp
and %r8d, %ebp
add %edx, %ebp
mov %r13d, %edx
xor %r14d, %edx
and %r12d, %edx
xor %r14d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r9d, %r9d
shld $(19), %r13d, %r13d
mov %eax, %r15d
mov %ebx, %r11d
shld $(8), %r11d, %r11d
xor %ebx, %r11d
shld $(9), %r11d, %r11d
xor %ebx, %r11d
mov %r15d, %eax
mov (228)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r11d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r14d, %ebx
add %r10d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
mov %r8d, %edx
mov %r8d, %ebp
and %r9d, %edx
xor %r9d, %ebp
and %r15d, %ebp
add %edx, %ebp
mov %r12d, %edx
xor %r13d, %edx
and %r11d, %edx
xor %r13d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r8d, %r8d
shld $(19), %r12d, %r12d
mov %eax, %r14d
mov %ebx, %r10d
shld $(8), %r10d, %r10d
xor %ebx, %r10d
shld $(9), %r10d, %r10d
xor %ebx, %r10d
mov %r14d, %eax
mov (232)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r10d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r13d, %ebx
add %r9d, %eax
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r15d, %edx
mov %r15d, %ebp
and %r8d, %edx
xor %r8d, %ebp
and %r14d, %ebp
add %edx, %ebp
mov %r11d, %edx
xor %r12d, %edx
and %r10d, %edx
xor %r12d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r15d, %r15d
shld $(19), %r11d, %r11d
mov %eax, %r13d
mov %ebx, %r9d
shld $(8), %r9d, %r9d
xor %ebx, %r9d
shld $(9), %r9d, %r9d
xor %ebx, %r9d
mov %r13d, %eax
mov (236)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r9d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r12d, %ebx
add %r8d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r14d, %edx
mov %r14d, %ebp
and %r15d, %edx
xor %r15d, %ebp
and %r13d, %ebp
add %edx, %ebp
mov %r10d, %edx
xor %r11d, %edx
and %r9d, %edx
xor %r11d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r14d, %r14d
shld $(19), %r10d, %r10d
mov %eax, %r12d
mov %ebx, %r8d
shld $(8), %r8d, %r8d
xor %ebx, %r8d
shld $(9), %r8d, %r8d
xor %ebx, %r8d
vmovdqa %xmm3, (%rsp)
vpxor %xmm0, %xmm3, %xmm4
vmovdqa %xmm4, (16)(%rsp)
mov %r12d, %eax
mov (240)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r8d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r11d, %ebx
add %r15d, %eax
add (%rsp), %ebx
add (16)(%rsp), %eax
mov %r13d, %edx
mov %r13d, %ebp
and %r14d, %edx
xor %r14d, %ebp
and %r12d, %ebp
add %edx, %ebp
mov %r9d, %edx
xor %r10d, %edx
and %r8d, %edx
xor %r10d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r13d, %r13d
shld $(19), %r9d, %r9d
mov %eax, %r11d
mov %ebx, %r15d
shld $(8), %r15d, %r15d
xor %ebx, %r15d
shld $(9), %r15d, %r15d
xor %ebx, %r15d
mov %r11d, %eax
mov (244)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r15d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r10d, %ebx
add %r14d, %eax
add (4)(%rsp), %ebx
add (20)(%rsp), %eax
mov %r12d, %edx
mov %r12d, %ebp
and %r13d, %edx
xor %r13d, %ebp
and %r11d, %ebp
add %edx, %ebp
mov %r8d, %edx
xor %r9d, %edx
and %r15d, %edx
xor %r9d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r12d, %r12d
shld $(19), %r8d, %r8d
mov %eax, %r10d
mov %ebx, %r14d
shld $(8), %r14d, %r14d
xor %ebx, %r14d
shld $(9), %r14d, %r14d
xor %ebx, %r14d
mov %r10d, %eax
mov (248)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r14d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r9d, %ebx
add %r13d, %eax
add (8)(%rsp), %ebx
add (24)(%rsp), %eax
mov %r11d, %edx
mov %r11d, %ebp
and %r12d, %edx
xor %r12d, %ebp
and %r10d, %ebp
add %edx, %ebp
mov %r15d, %edx
xor %r8d, %edx
and %r14d, %edx
xor %r8d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r11d, %r11d
shld $(19), %r15d, %r15d
mov %eax, %r9d
mov %ebx, %r13d
shld $(8), %r13d, %r13d
xor %ebx, %r13d
shld $(9), %r13d, %r13d
xor %ebx, %r13d
mov %r9d, %eax
mov (252)(%rcx), %ebx
shld $(12), %eax, %eax
add %eax, %ebx
add %r13d, %ebx
shld $(7), %ebx, %ebx
xor %ebx, %eax
add %r8d, %ebx
add %r12d, %eax
add (12)(%rsp), %ebx
add (28)(%rsp), %eax
mov %r10d, %edx
mov %r10d, %ebp
and %r11d, %edx
xor %r11d, %ebp
and %r9d, %ebp
add %edx, %ebp
mov %r14d, %edx
xor %r15d, %edx
and %r13d, %edx
xor %r15d, %edx
add %ebp, %eax
add %edx, %ebx
shld $(9), %r10d, %r10d
shld $(19), %r14d, %r14d
mov %eax, %r8d
mov %ebx, %r12d
shld $(8), %r12d, %r12d
xor %ebx, %r12d
shld $(9), %r12d, %r12d
xor %ebx, %r12d
movq (32)(%rsp), %rdi
xor %r8d, (%rdi)
xor %r9d, (4)(%rdi)
xor %r10d, (8)(%rdi)
xor %r11d, (12)(%rdi)
xor %r12d, (16)(%rdi)
xor %r13d, (20)(%rdi)
xor %r14d, (24)(%rdi)
xor %r15d, (28)(%rdi)
movdqa bswap128(%rip), %xmm4
subq $(64), (40)(%rsp)
cmpq $(64), (40)(%rsp)
jge .Lsm3_loopgas_1
add $(56), %rsp
vzeroupper
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbx
pop %rbp
ret
.Lfe1:
.size UpdateSM3, .Lfe1-(UpdateSM3)
|
;############## CMonster by Patrick Davidson
;############## Read in the save game and erase it, sets carry if not found
Read_Files:
ld hl,saved_flag ; clear data
ld (hl),0
ld de,saved_flag+1
ld bc,data_end-data_start
ldir
ld hl,save_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
bcall(_ChkFindSym)
jr c,read_scores
#ifdef TI84CE
bcall(_ChkInRam)
#else
ld a,b
or a
#endif
jr z,its_not_archived_so_dont_unarchive_it
bcall(_Arc_Unarc)
ld hl,save_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
bcall(_ChkFindSym)
its_not_archived_so_dont_unarchive_it:
ld hl,save_identifier
ld b,8
inc de
inc de
compare_identifier:
ld a,(de)
cp (hl)
jr nz,erase_save_file
inc hl
inc de
djnz compare_identifier
ld (saved_flag),a
ex de,hl
ld de,saved_flag+1
ld bc,data_end-data_start
ldir
erase_save_file:
bcall(_ChkFindSym)
bcall(_DelVarArc)
read_scores:
ld de,high_scores
ld a,SCORE_COUNT
build_default_loop:
ld hl,default_high_score
ld bc,ENTRYLEN
ldir
dec a
jr nz,build_default_loop
ld b,SCORE_COUNT-1
ld de,high_scores+TABLE_SIZE-ENTRYLEN-SCORELEN-1
default_inc_loop:
push bc
ld hl,ENTRYLEN
add hl,de ; HL -> next score
ld bc,6
ldir ; copy next score over this one
ex de,hl
call Add_6_Digits_BCD ; double it (moves pointer back)
ld de,-ENTRYLEN
add hl,de
ex de,hl
pop bc
djnz default_inc_loop
ld hl,score_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
bcall(_ChkFindSym)
ret c
#ifdef TI84CE
bcall(_ChkInRam)
#else
ld a,b
or a
#endif
jr z,scores_not_archived_so_dont_unarchive_it
bcall(_Arc_Unarc)
ld hl,score_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
bcall(_ChkFindSym)
scores_not_archived_so_dont_unarchive_it:
ex de,hl
inc hl
inc hl
ld a,SCORE_COUNT
ld de,high_scores
read_scores_from_file_loop:
ld bc,ENTRYLEN-1
ldir
inc de
dec a
jr nz,read_scores_from_file_loop
ret
save_name:
.db AppVarObj,"CMonSave",0
save_identifier:
.db "CMON",5,26,82,7
score_name:
.db AppVarObj,"CMonHigh",0
default_high_score:
.db "PATRICK ANDREW DAVIDSON 000001",0
;############## Write out the save game file
Write_Files:
ld a,(saved_flag)
add a,a
jr nc,not_saving_game
ld hl,save_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
ld hl,8+data_end-data_start
bcall(_CreateAppVar)
ld hl,save_identifier
inc de
inc de
ld bc,8
ldir
ld hl,saved_flag+1
ld bc,data_end-data_start
ldir
ret
not_saving_game:
ld a,(saved_flag)
rra
rra
ret nc
ld hl,score_name
bcall(_Mov9ToOP1) ; copy (HL) to OP1
bcall(_ChkFindSym)
jr c,it_doesnt_exist_so_dont_delete_it
bcall(_DelVarArc)
it_doesnt_exist_so_dont_delete_it:
ld hl,TABLE_SIZE-SCORE_COUNT
bcall(_CreateAppVar)
ld a,SCORE_COUNT
ld hl,high_scores
inc de
inc de
write_score_file_loop:
ld bc,ENTRYLEN-1
ldir
inc hl
dec a
jr nz,write_score_file_loop
ret |
; A246010: a(n) = floor(5*prime(n)^2 / 4).
; 5,11,31,61,151,211,361,451,661,1051,1201,1711,2101,2311,2761,3511,4351,4651,5611,6301,6661,7801,8611,9901,11761,12751,13261,14311,14851,15961,20161,21451,23461,24151,27751,28501,30811,33211,34861,37411,40051,40951,45601,46561,48511,49501,55651,62161,64411,65551,67861,71401,72601,78751,82561,86461,90451,91801,95911,98701,100111,107311,117811,120901,122461,125611,136951,141961,150511,152251,155761,161101,168361,173911,179551,183361,189151,197011,201001,209101,219451,221551,232201,234361,240901
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
pow $0,2
mul $0,5
div $0,4
|
;----------------------------------------------------------------------
; fdopen.asm - user-callable entry point to _fdopen() function.
;----------------------------------------------------------------------
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include rules.asi
include entry.inc
Entry@ fdopen, _fdopen, _RTLENTRY, 8
end
|
; init ZX48 device, put machine code at $8000
DEVICE ZXSPECTRUM48 : ORG $8000
; but make relocation block base address $0000 with DISP
DISP $0000
RELOCATE_START
dw relocate_count
dw relocate_size
label1:
call label1 ; relocate
call absolute1 ; no relocation
label2:
ld hl,label2-label1 ; no relocation
ENT ; error, can't finish DISP which did start outside
RELOCATE_END
absolute1:
ENT
RELOCATE_TABLE
; 05 00
; verify the actual machine code was placed at $8000 in virtual device memory
SAVEBIN "relocation_disp_outside.bin", $8000, $ - $8000
|
; A266471: Number of 4 X n binary arrays with rows and columns lexicographically nondecreasing and column sums nonincreasing.
; Submitted by Jon Maiga
; 5,12,29,66,137,261,463,775,1237,1898,2817,4064,5721,7883,10659,14173,18565,23992,30629,38670,48329,59841,73463,89475,108181,129910,155017,183884,216921,254567,297291,345593,400005,461092,529453,605722,690569,784701,888863,1003839,1130453,1269570,1422097,1588984,1771225,1969859,2185971,2420693,2675205,2950736,3248565,3570022,3916489,4289401,4690247,5120571,5581973,6076110,6604697,7169508,7772377,8415199,9099931,9828593,10603269,11426108,12299325,13225202,14206089,15244405,16342639,17503351
mov $2,5
add $2,$0
bin $2,$0
mov $3,$0
bin $0,4
mul $3,2
sub $0,$3
sub $2,$0
mov $0,$2
add $0,4
|
#include <bits/stdc++.h>
using namespace std;
#ifdef DGC
#include "debug.h"
#else
#define debug(...)
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second
struct info
{
ll a, b;
};
int main()
{
#ifdef DGC
freopen("a.txt", "r", stdin);
//freopen("b.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(0), cin.tie(0);
freopen("expect.in", "r", stdin);
freopen("expect.out", "w", stdout);
int n, q;
cin >> n >> q;
vector<info> a(n);
char ch;
for (auto &i : a)
{
cin >> ch >> i.a >> i.b;
if (ch == '+')
i.b *= -1;
}
vector<ll> sb(n); // sum of b
vector<pair<ll, int>> vp; // val, pos
for (int i = 0; i < n; ++i)
{
sb[i] = a[i].b;
if (i > 0) sb[i] += sb[i-1];
if (sb[i] > 0 && (vp.empty() || sb[i] > vp.back().F))
vp.push_back({ sb[i], i });
}
vector<ll> difa(n); // a[i+1]-a[i]
for (int i = n-2; i >= 0; --i)
difa[i] = a[i+1].a - a[i].a;
vector<pair<ll, int>> z(q);
for (auto &i : z) cin >> i.F, i.S = &i-&z[0];
sort(z.begin(), z.end());
vector<ll> ans(q, -2);
vector<ll> sump(q); // sum on prefix
vector<ll> sum2p(q); // sum2 on prefix
//vector<ll> sum3p(q); // sum3 on prefix
vector<ll> coef(q, 1LL);
for (int i = q-2; i >= 0; --i)
coef[i] = coef[i+1] + z[i+1].F-z[i].F;
debug(coef)
for (int i = 0; i < n-1; ++i)
{
ll x = sb[i];
auto it = lower_bound(z.begin(), z.end(), make_pair(x, 0));
if (it != z.begin())
{
int pos = prev(it) - z.begin();
ll init = -z[pos].F + x;
//sum3p[pos] += difa[i] * (init - 1);
sum2p[pos] += difa[i];
sump[pos] += difa[i] * (init - 1);
sump[pos] -= (coef[pos] - 1) * difa[i];
}
}
debug(sum2p)
debug(sump)
for (int i = q-2; i >= 0; --i)
{
sum2p[i] += sum2p[i+1];
sump[i] += sump[i+1];
}
debug(vp)
for (auto &temp : z)
{
ll init = -temp.F;
int pos = temp.S;
int pos2 = &temp-&z[0];
if (sb[n-1] + init > 0)
{
ans[pos] = -1;
continue;
}
/*auto it = lower_bound(vp.begin(), vp.end(), make_pair(-init, 1<<30));
if (it == vp.end())
{
ans[pos] = 0;
continue;
}*/
ans[pos] = sum2p[pos2] * coef[pos2] + sump[pos2];
debug(temp, ans[pos])
}
for (auto i : ans)
{
if (i == -1)
cout << "INFINITY\n";
else
cout << i << "\n";
}
return 0;
} |
.data
str: .asciiz "5kayyak5"
.text
.globl main
main: la $a0 str
jal palindroma
move $s0 $v0
li $v0 10
syscall |
/*
Copyright (C) 2003-2006 MySQL AB, 2009 Sun Microsystems, Inc.
All rights reserved. Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef NDBT_STATS_HPP
#define NDBT_STATS_HPP
#include <ndb_global.h>
class NDBT_Stats {
public:
NDBT_Stats() { reset(); }
void reset() { sum = sum2 = 0.0; max = DBL_MIN; ; min = DBL_MAX; n = 0;}
void addObservation(double t) {
sum+= t;
sum2 += (t*t);
n++;
if(min > t) min = t;
if(max < t) max = t;
}
void addObservation(Uint64 t) { addObservation(double(t)); }
double getMean() const { return sum/n;}
double getStddev() const { return sqrt(getVariance()); }
double getVariance() const { return (n*sum2 - (sum*sum))/(n*n);}
double getMin() const { return min;}
double getMax() const { return max;}
int getCount() const { return n;}
NDBT_Stats & operator+=(const NDBT_Stats & c){
sum += c.sum;
sum2 += c.sum2;
n += c.n;
if(min > c.min) min = c.min;
if(max < c.max) max = c.max;
return * this;
}
private:
double sum;
double sum2;
int n;
double min, max;
};
inline
double
NDB_SQRT(double x){
assert(x >= 0);
double y = 0;
double s = 1;
double r = 0;
while(y <= x){
y += s;
s += 2;
r += 1;
}
return r - 1;
}
#endif
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; WriteMm3.Asm
;
; Abstract:
;
; AsmWriteMm3 function
;
; Notes:
;
;------------------------------------------------------------------------------
DEFAULT REL
SECTION .text
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmWriteMm3 (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
global ASM_PFX(AsmWriteMm3)
ASM_PFX(AsmWriteMm3):
movq mm3, rcx
ret
|
; A016218: Expansion of 1/((1-x)*(1-4*x)*(1-5*x)).
; 1,10,71,440,2541,14070,75811,400900,2091881,10808930,55442751,282806160,1436400421,7271480590,36715316891,185008240220,930767824161,4676745613050,23475354034231,117743274047080,590182385739101,2956775990710310,14807336201610771
add $0,2
mov $1,9
mov $2,12
lpb $0
sub $0,1
mul $1,5
mul $2,4
lpe
sub $1,$2
div $1,36
add $1,1
mov $0,$1
|
SendToBack PROTO :DWORD
UpdateRAEdit PROTO :DWORD
CreateDlg PROTO :HWND
MakeDialog PROTO :DWORD,:DWORD
DlgEnumProc PROTO :DWORD,:DWORD
PGM_FIRST equ 1400h
PGM_SETCHILD equ PGM_FIRST+1
PGM_RECALCSIZE equ PGM_FIRST+2
PGM_FORWARDMOUSE equ PGM_FIRST+3
PGM_SETBKCOLOR equ PGM_FIRST+4
PGM_GETBKCOLOR equ PGM_FIRST+5
PGM_SETBORDER equ PGM_FIRST+6
PGM_GETBORDER equ PGM_FIRST+7
PGM_SETPOS equ PGM_FIRST+8
PGM_GETPOS equ PGM_FIRST+9
PGM_SETBUTTONSIZE equ PGM_FIRST+10
PGM_GETBUTTONSIZE equ PGM_FIRST+11
PGM_GETBUTTONSTATE equ PGM_FIRST+12
PGM_GETDROPTARGET equ CCM_GETDROPTARGET
ID_DIALOG equ 65502
WS_ALWAYS equ WS_CHILD or WS_VISIBLE or WS_CLIPSIBLINGS or WS_CLIPCHILDREN
MAXMULSEL equ 256
MODE_NOTHING equ 0
MODE_DRAWING equ 1
MODE_MOVING equ 2
MODE_SIZING equ 3
MODE_MULTISEL equ 4
MODE_MULTISELMOVE equ 5
MODE_SELECT equ 6
MODE_MOVINIT equ 7
MODE_MULTISELMOVEINIT equ 8
INIT_NPR equ 32+32+8
.data
szPos db 'Pos: X:',32 dup(0)
DlgX dd 10
DlgY dd 10
szICODLG db '#32106',0
DlgFN db 'MS Sans Serif',0
DlgFS dd 8
DlgID db 'IDD_DLG',0
EdtID db 'IDC_EDT',0
StcID db 'IDC_STC',0
GrbID db 'IDC_GRP',0
BtnID db 'IDC_BTN',0
ChkID db 'IDC_CHK',0
RbtID db 'IDC_RBN',0
CboID db 'IDC_CBO',0
LstID db 'IDC_LST',0
ScbID db 'IDC_SCB',0
TabID db 'IDC_TAB',0
PrbID db 'IDC_PGB',0
TrvID db 'IDC_TRV',0
LsvID db 'IDC_LSV',0
TrbID db 'IDC_TRB',0
UdnID db 'IDC_UDN',0
IcoID db 'IDC_IMG',0
TbrID db 'IDC_TBR',0
SbrID db 'IDC_SBR',0
DtpID db 'IDC_DTP',0
MviID db 'IDC_MVI',0
RedID db 'IDC_RED',0
UdcID db 'IDC_UDC',0
CbeID db 'IDC_CBE',0
ShpID db 'IDC_SHP',0
IpaID db 'IDC_IPA',0
AniID db 'IDC_ANI',0
HotID db 'IDC_HOT',0
PgrID db 'IDC_PGR',0
RebID db 'IDC_REB',0
HdrID db 'IDC_HDR',0
LnkID db 'IDC_LNK',0
LnkCAP db '<a></a>',0
szMnu db ' &File , &Edit , &Help ',0
nPr dd INIT_NPR
PrAll db '(Name),(ID),Left,Top,Width,Height,Caption,Border,SysMenu,MaxButton,MinButton,Enabled,Visible,Clipping,ScrollBar,Default,Auto,Alignment,Mnemonic,WordWrap,MultiLine,Type,Locked,Child,SizeBorder,TabStop,Font,Menu,Class,Notify,AutoScroll,WantCr,'
db 'Sort,Flat,(StartID),TabIndex,Format,SizeGrip,Group,Icon,UseTabs,StartupPos,Orientation,SetBuddy,MultiSelect,HideSel,TopMost,xExStyle,xStyle,IntegralHgt,Image,Buttons,PopUp,OwnerDraw,Transp,Timer,AutoPlay,WeekNum,AviClip,AutoSize,ToolTip,Wrap,'
db 'Divider,DragDrop,'
db 'Smooth,Ellipsis,Language,HasStrings,(HelpID),File,MenuEx,SaveSel'
PrCust db 512 dup(0)
;0-Dialog
ctltypes dd 0
; dd offset szDlgChildClass
dd offset szNULL
dd 0 ;Keep size
dd WS_VISIBLE or WS_CAPTION or WS_MAXIMIZEBOX or WS_MINIMIZEBOX or WS_SYSMENU or WS_SIZEBOX
dd 0C00000h ;Typemask
dd 0 ;ExStyle
dd offset DlgID
dd offset DlgID
dd offset szDIALOGEX
dd 200 ;xsize
dd 300 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111111111100000000110111000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00100000010000111000100000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00101000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;1-Edit
dd 1
dd offset szEditClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or ES_LEFT
dd 0 ;Typemask
dd WS_EX_CLIENTEDGE
dd offset EdtID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000111100100111001000011b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000001011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;2-Static
dd 2
dd offset szStaticClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or SS_LEFT
dd SS_TYPEMASK ;Typemask
dd 0 ;ExStyle
dd offset StcID
dd offset StcID
dd offset szCONTROL
dd 82 ;xsize
dd 16 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000111000111000000000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 01001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;3-GroupBox
dd 3
dd offset szButtonClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or BS_GROUPBOX
dd 0Fh ;Typemask
dd 0 ;ExStyle
dd offset GrbID
dd offset GrbID
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000111000000000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;4-Pushbutton
dd 4
dd offset szButtonClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or BS_PUSHBUTTON
dd 0Fh ;Typemask
dd 0 ;ExStyle
dd offset BtnID
dd offset BtnID
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000111010100110001000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;5-CheckBox
dd 5
dd offset szButtonClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or BS_AUTOCHECKBOX
dd 0Fh ;Typemask
dd 0 ;ExStyle
dd offset ChkID
dd offset ChkID
dd offset szCONTROL
dd 82 ;xsize
dd 16 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111110000111001100100001000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010010000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;6-RadioButton
dd 6
dd offset szButtonClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or BS_AUTORADIOBUTTON
dd 0Fh ;Typemask
dd 0 ;ExStyle
dd offset RbtID
dd offset RbtID
dd offset szCONTROL
dd 82 ;xsize
dd 16 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111110000111001100100001000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010010000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;7-ComboBox
dd 7
dd offset szComboBoxClass
dd 1 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or CBS_DROPDOWNLIST
dd 03h ;Typemask
dd 0 ;ExStyle
dd offset CboID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111100000010001000010b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 10010000000000011100010000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00011000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;8-ListBox
dd 8
dd offset szListBoxClass
dd 1 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or LBS_HASSTRINGS or LBS_NOINTEGRALHEIGHT or LBS_NOTIFY
dd 0 ;Typemask
dd WS_EX_CLIENTEDGE
dd offset LstID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111100000000001000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 10010000100010011100010000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00011000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;9-HScrollBar
dd 9
dd offset szScrollBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or SBS_HORZ
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset ScbID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 16 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;10-VScrollBar
dd 10
dd offset szScrollBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or SBS_VERT
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset ScbID
dd offset szNULL
dd offset szCONTROL
dd 16 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;11-TabControl
dd 11
dd offset szTabControlClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or TCS_FOCUSNEVER
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset TabID
dd offset szNULL
dd offset szCONTROL
dd 150 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000100100001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011001000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;12-ProgressBar
dd 12
dd offset szProgressBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset PrbID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 16 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000001000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 10001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;13-TreeView
dd 13
dd offset szTreeViewClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or TVS_HASLINES or TVS_LINESATROOT or TVS_HASBUTTONS
dd 0 ;Typemask
dd WS_EX_CLIENTEDGE
dd offset TrvID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000010001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000001011001000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;14-ListViev
dd 14
dd offset szListViewClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or LVS_LIST
dd LVS_TYPEMASK ;Typemask
dd WS_EX_CLIENTEDGE
dd offset LsvID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000100010001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 10010000000001011000010000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;15-TrackBar
dd 15
dd offset szTrackBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset TrbID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;16-UpDown
dd 16
dd offset szUpDownClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset UdnID
dd offset szNULL
dd offset szCONTROL
dd 16 ;xsize
dd 19 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111001100000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000001100011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;17-Image
dd 17
dd offset szStaticClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or SS_ICON or SS_CENTERIMAGE
dd SS_TYPEMASK ;Typemask
dd 0 ;ExStyle
dd offset IcoID
dd offset szNULL
dd offset szCONTROL
dd 31 ;xsize
dd 31 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000100010000000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011010000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;18-ToolBar
dd 18
dd offset szToolBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or CCS_TOP
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset TbrID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000100000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 01010000000000011000000000011110b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;19-StatusBar
dd 19
dd offset szStatusBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or CCS_BOTTOM
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset SbrID
dd offset SbrID
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11000010000111000100000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010100000000011000000000011000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;20-DateTimePicker
dd 20
dd offset szDateTimeClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or 4
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset DtpID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000010001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00011000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;21-MonthView
dd 21
dd offset szMonthViewClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd WS_EX_CLIENTEDGE ;ExStyle
dd offset MviID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000010011000000001000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;22-RichEdit
dd 22
dd offset szRichEditClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP
dd 0 ;Typemask
dd WS_EX_CLIENTEDGE ;ExStyle
dd offset RedID
dd offset RedID
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000111100000101001000011b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000001011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001001000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;23-UserDefinedControl
dd 23
dd offset szStaticClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset UdcID
dd offset UdcID
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111111000101100000000001001000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;24-ComboBoxEx
dd 24
dd offset szComboBoxExClass
dd 1 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP or CBS_DROPDOWNLIST
dd 03h ;Typemask
dd 0 ;ExStyle
dd offset CbeID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111100000111000000010001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;25-Static Rect & Line
dd 25
dd offset szStaticClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or SS_BLACKRECT
dd SS_TYPEMASK ;Typemask
dd 0 ;ExStyle
dd offset ShpID
dd offset szNULL
dd offset szCONTROL
dd 22 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000010000000100b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;26-IP Address
dd 26
dd offset szIPAddressClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset IpaID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;27-Animate
dd 27
dd offset szAnimateClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset AniID
dd offset szNULL
dd offset szCONTROL
dd 22 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000100000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000001110100000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;28-HotKey
dd 28
dd offset szHotKeyClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or WS_TABSTOP
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset HotID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;29-HPager
dd 29
dd offset szPagerClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or PGS_HORZ
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset PgrID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;30-VPager
dd 30
dd offset szPagerClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or PGS_VERT
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset PgrID
dd offset szNULL
dd offset szCONTROL
dd 22 ;xsize
dd 82 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;31-ReBar
dd 31
dd offset szReBarClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset RebID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 22 ;ysize
dd 0 ;nmethod
dd 0 ;methods
dd 11111101000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;32-Header
dd 32
dd offset szHeaderClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or HDS_BUTTONS
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset HdrID
dd offset szNULL
dd offset szCONTROL
dd 82 ;xsize
dd 19 ;ysize
dd 0 ;nMethod
dd 0 ;Methods
dd 11111101000111000000000000000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011001000000000001b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
;33-SysLink
dd 33
dd offset szSysLinkClass
dd 0 ;Keep size
dd WS_VISIBLE or WS_CHILD or LWS_TRANSPARENT
dd 0 ;Typemask
dd 0 ;ExStyle
dd offset LnkID
dd offset LnkCAP
dd offset szCONTROL
dd 82 ;xsize
dd 19 ;ysize
dd 0 ;nMethod
dd 0 ;Methods
dd 11111111000111000000000001000000b
; NILTWHCBCMMEVCSDAAMWMTLCSTFMCNAW
dd 00010000000000011000000000000000b
; SFSTFSGIUSOSMHTxxIIBPOTTAWAATWDD
dd 00001000000000000000000000000000b
; SELHHFMS
dd 00000000000000000000000000000000b
;
custtypes TYPES 32 dup(<?>)
dwNOTStyle dd WS_VISIBLE
align 4
dlgdata dd WS_CAPTION or DS_SETFONT ;style
dd 00000000h ;exstyle
dw 0000h ;cdit
dw 4096 ;x
dw 3072 ;y
dw 0060h ;cx
dw 0040h ;cy
dw 0000h ;menu
dw 0000h ;class
dw 0000h ;caption
dlgps dw 0 ;point size
dlgfn dw 33 dup(0) ;face name
.data?
fGrid dd ?
fRSnapToGrid dd ?
fSnapToGrid dd ?
fShowSizePos dd ?
fStyleHex dd ?
fSizeToFont dd ?
fNoDefines dd ?
fSimpleProperty dd ?
fNoResetToolbox dd ?
hSizeing dd 8 dup(?)
hMultiSel dd ?
hReSize dd ?
OldPt POINT <?>
MousePtDown POINT <?>
OldSizeingProc dd ?
dlgpaste DIALOG MAXMULSEL dup(<?>)
SizeRect RECT <?>
;Dialog menu
MnuInx dd ?
hWinBmp HBITMAP ?
dfntwt dd ?
dfntht dd ?
fntwt dd ?
fntht dd ?
mpt POINT <?>
.code
CaptureWin proc
LOCAL rect:RECT
LOCAL hDC:HDC
LOCAL hMemDC:HDC
invoke GetDC,hInvisible
mov hDC,eax
invoke GetClientRect,hDEd,addr rect
invoke GetWindowLong,hDEd,DEWM_SCROLLX
shl eax,3
mov rect.left,eax
invoke GetWindowLong,hDEd,DEWM_SCROLLY
shl eax,3
mov rect.top,eax
invoke CreateCompatibleDC,hDC
mov hMemDC,eax
invoke CreateCompatibleBitmap,hDC,rect.right,rect.bottom
mov hWinBmp,eax
invoke SelectObject,hMemDC,hWinBmp
push eax
invoke BitBlt,hMemDC,0,0,rect.right,rect.bottom,hDC,rect.left,rect.top,SRCCOPY
pop eax
invoke SelectObject,hMemDC,eax
invoke DeleteDC,hMemDC
invoke ReleaseDC,hInvisible,hDC
ret
CaptureWin endp
RestoreWin proc
LOCAL rect:RECT
LOCAL hDC:HDC
LOCAL hMemDC:HDC
invoke GetDC,hInvisible
mov hDC,eax
invoke GetClientRect,hDEd,addr rect
invoke GetWindowLong,hDEd,DEWM_SCROLLX
shl eax,3
mov rect.left,eax
add rect.right,eax
invoke GetWindowLong,hDEd,DEWM_SCROLLY
shl eax,3
mov rect.top,eax
add rect.bottom,eax
invoke CreateCompatibleDC,hDC
mov hMemDC,eax
invoke SelectObject,hMemDC,hWinBmp
push eax
invoke BitBlt,hDC,rect.left,rect.top,rect.right,rect.bottom,hMemDC,0,0,SRCCOPY
pop eax
invoke SelectObject,hMemDC,eax
invoke DeleteDC,hMemDC
invoke ReleaseDC,hInvisible,hDC
ret
RestoreWin endp
GetFreeDlg proc hDlgMem:DWORD
mov eax,hDlgMem
add eax,sizeof DLGHEAD
sub eax,sizeof DIALOG
@@:
add eax,sizeof DIALOG
cmp [eax].DIALOG.hwnd,0
jne @b
ret
GetFreeDlg endp
GetFreeID proc uses esi edi
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
mov eax,[esi].DLGHEAD.ctlid
add esi,sizeof DLGHEAD
sub esi,sizeof DIALOG
mov edi,esi
@@:
add esi,sizeof DIALOG
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
cmp eax,[esi].DIALOG.id
jne @b
mov esi,edi
inc eax
jmp @b
@@:
.endif
ret
GetFreeID endp
IsFreeID proc uses esi,nID:DWORD
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
add esi,sizeof DLGHEAD
sub esi,sizeof DIALOG
mov eax,nID
@@:
add esi,sizeof DIALOG
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
cmp eax,[esi].DIALOG.id
jne @b
mov eax,0
@@:
.endif
.if eax
;ID is free
mov eax,TRUE
.else
mov eax,FALSE
.endif
ret
IsFreeID endp
GetFreeTab proc uses esi edi
LOCAL nTab:DWORD
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
add esi,sizeof DLGHEAD
mov edi,esi
mov nTab,0
@@:
add esi,sizeof DIALOG
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
mov eax,nTab
cmp eax,[esi].DIALOG.tab
jne @b
mov esi,edi
inc nTab
jmp @b
@@:
mov eax,nTab
.endif
ret
GetFreeTab endp
;0 1 2 3 4 5 6 7
;0 1 2 5 3 4 6 7
;if new>old
; if t>old and t<=new then t=t-1
;0 1 2 3 4 5 6 7
;0 2 3 1 4 5 6 7
;if new<old
; if t<old and t>=new then t=t+1
SetNewTab proc uses esi edi,hCtl:HWND,nTab:DWORD
LOCAL nOld:DWORD
invoke GetCtrlMem,hCtl
.if eax
mov esi,eax
invoke GetFreeTab
.if eax<=nTab
.if eax
dec eax
.endif
mov nTab,eax
.endif
mov eax,[esi].DIALOG.tab
mov nOld,eax
mov edi,esi
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
add esi,sizeof DLGHEAD
@@:
add esi,sizeof DIALOG
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
mov eax,nTab
.if eax>nOld
mov eax,[esi].DIALOG.tab
.if eax>nOld && eax<=nTab
dec [esi].DIALOG.tab
.endif
.else
mov eax,[esi].DIALOG.tab
.if eax<nOld && eax>=nTab
inc [esi].DIALOG.tab
.endif
.endif
jmp @b
@@:
mov eax,nTab
mov [edi].DIALOG.tab,eax
.endif
.endif
ret
SetNewTab endp
InsertTab proc uses esi,nTab:DWORD
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
add esi,sizeof DLGHEAD
@@:
add esi,sizeof DIALOG
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
mov eax,nTab
.if eax<=[esi].DIALOG.tab
inc [esi].DIALOG.tab
.endif
jmp @b
@@:
.endif
ret
InsertTab endp
DeleteTab proc uses esi,nTab:DWORD
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
lea esi,[eax+sizeof DLGHEAD]
@@:
lea esi,[esi+sizeof DIALOG]
cmp [esi].DIALOG.hwnd,0
je @f
cmp [esi].DIALOG.hwnd,-1
je @b
mov eax,nTab
.if eax<[esi].DIALOG.tab
dec [esi].DIALOG.tab
.endif
jmp @b
@@:
.endif
ret
DeleteTab endp
SetChanged proc fChanged:DWORD
invoke GetWindowLong,hDEd,DEWM_PROJECT
.if eax
mov edx,fChanged
mov [eax].PROJECT.changed,edx
.endif
invoke NotifyParent
ret
SetChanged endp
DestroySizeingRect proc uses edi
LOCAL rect:RECT
mov edi,offset hSizeing
mov ecx,8
@@:
mov edx,[edi]
.if edx
push ecx
push edx
invoke GetWindowRect,edx,addr rect
invoke ScreenToClient,hDEd,addr rect.left
invoke ScreenToClient,hDEd,addr rect.right
invoke InvalidateRect,hDEd,addr rect,TRUE
pop edx
invoke DestroyWindow,edx
pop ecx
.endif
xor eax,eax
mov [edi],eax
add edi,4
loop @b
invoke UpdateWindow,hDEd
mov hReSize,0
invoke PropertyList,0
ret
DestroySizeingRect endp
DialogTltSize proc uses esi,ccx:DWORD,ccy:DWORD,cdx:DWORD,cdy:DWORD ; *** MOD add: cdx, cdy
LOCAL buffer[64]:BYTE
LOCAL pt:POINT
LOCAL hDC:HDC
LOCAL len:DWORD
LOCAL hOldFont:DWORD
.if fShowSizePos
invoke GetCursorPos,addr mpt
add mpt.y,15
add mpt.x,15
lea esi,buffer
mov [esi],dword ptr ':L ' ; *** MOD
add esi,3
invoke ConvertToDux,ccx
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ':T ' ; *** MOD
add esi,3
invoke ConvertToDuy,ccy
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ' ' ; *** MOD
add esi,4
mov [esi],dword ptr ':R ' ; *** MOD
add esi,3
invoke ConvertToDux,cdx
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ':B ' ; *** MOD
add esi,3
invoke ConvertToDuy,cdy
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ' ' ; *** MOD
add esi,4
mov [esi],dword ptr ':W ' ; *** MOD
add esi,3
mov eax,cdx
sub eax,ccx
invoke ConvertToDux,eax
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ':H ' ; *** MOD
add esi,3
mov eax,cdy
sub eax,ccy
invoke ConvertToDuy,eax
invoke ResEdBinToDec,eax,esi
invoke strlen,esi
add esi,eax
mov [esi],dword ptr ' ' ; *** MOD
invoke GetDC,hTlt
mov hDC,eax
invoke SendMessage,hTlt,WM_GETFONT,0,0
invoke SelectObject,hDC,eax
mov hOldFont,eax
invoke strlen,addr buffer
mov len,eax
invoke GetTextExtentPoint32,hDC,addr buffer,len,addr pt
invoke SelectObject,hDC,hOldFont
invoke ReleaseDC,hTlt,hDC
invoke SetWindowText,hTlt,addr buffer
invoke MoveWindow,hTlt,mpt.x,mpt.y,pt.x,nPropHt,TRUE
invoke ShowWindow,hTlt,SW_SHOWNA
invoke InvalidateRect,hTlt,NULL,TRUE
invoke UpdateWindow,hTlt
.endif
ret
DialogTltSize endp
SizeingProc proc uses edi,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL nInx:DWORD
LOCAL pt:POINT
LOCAL hDC:HDC
LOCAL rect:RECT ; *** MOD add
LOCAL rect1:RECT ; *** MOD add
mov eax,uMsg
.if eax>=WM_MOUSEFIRST && eax<=WM_MOUSELAST
invoke GetWindowLong,hWin,GWL_USERDATA
movzx edx,ax
shr eax,16
mov nInx,eax
.if edx
mov eax,uMsg
.if eax==WM_LBUTTONDOWN
invoke GetFocus
.if eax==hPrpEdtDlgCld
invoke SetFocus,hDEd
mov eax,nInx
mov edi,offset hSizeing
mov eax,[edi+eax*4]
invoke PostMessage,eax,uMsg,wParam,lParam
.else
mov des.fmode,MODE_SIZING
invoke PropertyList,0
mov eax,lParam
movsx edx,ax
mov MousePtDown.x,edx
shr eax,16
cwde
mov MousePtDown.y,eax
invoke GetWindowRect,hReSize,addr des.ctlrect
invoke ScreenToClient,hInvisible,addr des.ctlrect.left
invoke ScreenToClient,hInvisible,addr des.ctlrect.right
invoke GetCtrlMem,hReSize
mov edi,eax
mov eax,[edi].DIALOG.ntype
invoke GetTypePtr,eax
mov eax,[eax].TYPES.keepsize
and eax,1
.if eax
invoke ConvertDuyToPix,[edi].DIALOG.duccy
add eax,des.ctlrect.top
mov des.ctlrect.bottom,eax
.endif
invoke CaptureWin
invoke SetCapture,hWin
invoke SendMessage,hWin,WM_MOUSEMOVE,wParam,lParam
.endif
.elseif eax==WM_LBUTTONUP && des.fmode==MODE_SIZING
mov eax,hReSize
mov des.hselected,eax
invoke SendMessage,hInvisible,WM_LBUTTONUP,0,0
.elseif eax==WM_MOUSEMOVE && des.fmode==MODE_SIZING
invoke CopyRect,addr SizeRect,addr des.ctlrect
mov eax,lParam
movsx edx,ax
sub edx,MousePtDown.x
mov pt.x,edx
shr eax,16
cwde
sub eax,MousePtDown.y
mov pt.y,eax
mov eax,nInx
.if eax==0
;Left,Top
mov eax,pt.x
add SizeRect.left,eax
mov eax,pt.y
add SizeRect.top,eax
invoke SnapPtDu,addr SizeRect.left
.elseif eax==1
;Center,Top
push SizeRect.left
mov eax,pt.y
add SizeRect.top,eax
invoke SnapPtDu,addr SizeRect.left
pop SizeRect.left
.elseif eax==2
;Right,Top
push SizeRect.left
push SizeRect.bottom
mov eax,pt.y
add SizeRect.top,eax
invoke SnapPtDu,addr SizeRect.left
mov eax,pt.x
add SizeRect.right,eax
invoke SnapPtDu,addr SizeRect.right
pop SizeRect.bottom
pop SizeRect.left
.elseif eax==3
;Left,Middle
push SizeRect.top
mov eax,pt.x
add SizeRect.left,eax
invoke SnapPtDu,addr SizeRect.left
pop SizeRect.top
.elseif eax==4
;Right,Middle
push SizeRect.bottom
mov eax,pt.x
add SizeRect.right,eax
invoke SnapPtDu,addr SizeRect.right
pop SizeRect.bottom
.elseif eax==5
;Left,Bottom
push SizeRect.top
push SizeRect.right
mov eax,pt.y
add SizeRect.bottom,eax
invoke SnapPtDu,addr SizeRect.right
mov eax,pt.x
add SizeRect.left,eax
invoke SnapPtDu,addr SizeRect.left
pop SizeRect.right
pop SizeRect.top
.elseif eax==6
;Center,Bottom
push SizeRect.right
mov eax,pt.y
add SizeRect.bottom,eax
invoke SnapPtDu,addr SizeRect.right
pop SizeRect.right
.elseif eax==7
;Right,Bottom
mov eax,pt.x
add SizeRect.right,eax
mov eax,pt.y
add SizeRect.bottom,eax
invoke SnapPtDu,addr SizeRect.right
.endif
invoke RestoreWin
invoke GetDC,hInvisible
mov hDC,eax
invoke GetStockObject,BLACK_BRUSH
invoke FrameRect,hDC,addr SizeRect,eax
invoke ReleaseDC,hInvisible,hDC
; *** MOD
;mov eax,SizeRect.right
;sub eax,SizeRect.left
;mov pt.x,eax
;mov eax,SizeRect.bottom
;sub eax,SizeRect.top
;mov pt.y,eax
;invoke ScreenToClient,des.hdlg,addr SizeRect.left
invoke GetCtrlMem,hReSize
mov edi,eax
mov eax,[edi].DIALOG.ntype
.if eax == 0 ; only dialogboxes
invoke GetClientRect,des.hdlg,addr rect
invoke GetWindowRect,des.hdlg,addr rect1
mov eax,rect.right
add eax,SizeRect.right
sub eax,SizeRect.left
add eax,rect1.left
sub eax,rect1.right ; = SizeRectWdt - non client area
mov ecx,rect.bottom
add ecx,SizeRect.bottom
sub ecx,SizeRect.top
add ecx,rect1.top
sub ecx,rect1.bottom ; = SizeRectHgt - non client area
invoke DialogTltSize,0,0,eax,ecx ; *** MOD
.else
invoke CopyRect,addr rect,addr SizeRect ; *** MOD
invoke MapWindowPoints,hInvisible,des.hdlg,addr rect,2 ; *** MOD
invoke DialogTltSize,rect.left,rect.top,rect.right,rect.bottom ; *** MOD
.endif
; ================
.endif
.endif
.elseif eax==WM_SETCURSOR
invoke GetWindowLong,hWin,GWL_USERDATA
movzx eax,ax
.if eax
invoke LoadCursor,0,eax
.else
invoke LoadCursor,0,IDC_ARROW
.endif
invoke SetCursor,eax
.else
invoke CallWindowProc,OldSizeingProc,hWin,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
SizeingProc endp
DrawSizeingItem proc uses edi,xP:DWORD,yP:DWORD,nInx:DWORD,hCur:DWORD,hPar:DWORD,fLocked:DWORD
LOCAL hWin:HWND
mov eax,nInx
shl eax,2
mov edi,offset hSizeing
add edi,eax
mov eax,[edi]
.if eax
invoke DestroyWindow,eax
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax!=0 && fLocked==FALSE
push [eax].DLGHEAD.locked
pop fLocked
.endif
invoke GetWindowLong,hDEd,DEWM_READONLY
.if eax
mov fLocked,TRUE
.endif
.if fLocked
mov hCur,NULL
.endif
.if hCur
invoke CreateWindowEx,0,
addr szStaticClass,0,
WS_CHILD or WS_VISIBLE or SS_WHITERECT or WS_BORDER or SS_NOTIFY,
xP,yP,6,6,
hPar,0,hInstance,0
.else
invoke CreateWindowEx,0,
addr szStaticClass,0,
WS_CHILD or WS_VISIBLE or SS_GRAYRECT or WS_BORDER or SS_NOTIFY or WS_CLIPSIBLINGS or WS_CLIPCHILDREN,
xP,yP,6,6,
hPar,0,hInstance,0
.endif
mov hWin,eax
mov [edi],eax
mov eax,nInx
shl eax,16
or eax,hCur
invoke SetWindowLong,hWin,GWL_USERDATA,eax
invoke SetWindowLong,hWin,GWL_WNDPROC,offset SizeingProc
mov OldSizeingProc,eax
invoke SetWindowPos,hWin,HWND_TOP,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE
ret
DrawSizeingItem endp
DrawMultiSelItem proc xP:DWORD,yP:DWORD,hPar:HWND,fLocked:DWORD,hPrv:HWND
LOCAL hWin:HWND
.if !fLocked
mov edx,WS_CHILD or WS_CLIPSIBLINGS or WS_VISIBLE or SS_WHITERECT or WS_BORDER
.else
mov edx,WS_CHILD or WS_CLIPSIBLINGS or WS_VISIBLE or SS_GRAYRECT or WS_BORDER
.endif
invoke CreateWindowEx,0,addr szStaticClass,0,edx,xP,yP,6,6,hPar,0,hInstance,0
mov hWin,eax
invoke SetWindowLong,hWin,GWL_USERDATA,hPrv
invoke SetWindowPos,hWin,HWND_TOP,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE
mov eax,hWin
ret
DrawMultiSelItem endp
DestroyMultiSel proc uses ebx,hSel:HWND
LOCAL rect:RECT
.if hSel
mov ebx,8
.while ebx
invoke GetWindowRect,hSel,addr rect
invoke ScreenToClient,hDEd,addr rect.left
invoke ScreenToClient,hDEd,addr rect.right
invoke InvalidateRect,hDEd,addr rect,TRUE
invoke GetWindowLong,hSel,GWL_USERDATA
push eax
invoke DestroyWindow,hSel
pop hSel
dec ebx
.endw
.endif
mov eax,hSel
ret
DestroyMultiSel endp
MultiSelRect proc uses ebx,hWin:HWND,fLocked:DWORD
LOCAL rect:RECT
LOCAL ctlrect:RECT
LOCAL pt:POINT
LOCAL hSel:HWND
mov hSel,0
mov ebx,hMultiSel
.while ebx
invoke GetParent,ebx
.if eax==hWin
invoke DestroyMultiSel,ebx
mov ebx,eax
.if hSel
invoke SetWindowLong,hSel,GWL_USERDATA,ebx
.else
mov hMultiSel,ebx
.endif
xor ebx,ebx
.else
mov ecx,8
.while ecx
push ecx
mov hSel,ebx
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop ecx
dec ecx
.endw
.endif
.endw
mov des.parpt.x,0
mov des.parpt.y,0
invoke ClientToScreen,hWin,addr des.parpt
invoke GetWindowRect,hWin,addr rect
invoke CopyRect,addr des.ctlrect,addr rect
mov eax,des.parpt.x
sub rect.left,eax
sub rect.right,eax
mov eax,des.parpt.y
sub rect.top,eax
sub rect.bottom,eax
invoke CopyRect,addr ctlrect,addr rect
sub rect.right,6
sub rect.bottom,6
mov eax,rect.right
sub eax,rect.left
shr eax,1
add eax,rect.left
mov pt.x,eax
mov eax,rect.bottom
sub eax,rect.top
shr eax,1
add eax,rect.top
mov pt.y,eax
invoke DrawMultiSelItem,rect.left,rect.top,hWin,fLocked,hMultiSel
invoke DrawMultiSelItem,pt.x,rect.top,hWin,fLocked,eax
invoke DrawMultiSelItem,rect.right,rect.top,hWin,fLocked,eax
invoke DrawMultiSelItem,rect.left,pt.y,hWin,fLocked,eax
invoke DrawMultiSelItem,rect.right,pt.y,hWin,fLocked,eax
invoke DrawMultiSelItem,rect.left,rect.bottom,hWin,fLocked,eax
invoke DrawMultiSelItem,pt.x,rect.bottom,hWin,fLocked,eax
invoke DrawMultiSelItem,rect.right,rect.bottom,hWin,fLocked,eax
mov hMultiSel,eax
ret
MultiSelRect endp
SizeingRect proc uses esi,hWin:HWND,fLocked:DWORD
LOCAL fDlg:DWORD
LOCAL rect:RECT
LOCAL pt:POINT
invoke GetCtrlMem,hWin
mov esi,eax
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
mov eax,hWin
mov hReSize,eax
mov fDlg,FALSE
mov eax,(DIALOG ptr [esi]).ntype
.if !eax
mov fDlg,TRUE
.elseif eax==18 || eax==19
test [esi].DIALOG.style,CCS_NORESIZE
.if ZERO?
mov fLocked,TRUE
.endif
.endif
mov des.parpt.x,0
mov des.parpt.y,0
invoke ClientToScreen,hInvisible,addr des.parpt
invoke GetWindowRect,hWin,addr rect
mov eax,[esi].DIALOG.ntype
invoke GetTypePtr,eax
mov eax,[eax].TYPES.keepsize
and eax,1
.if eax
invoke ConvertDuyToPix,[esi].DIALOG.duccy
add eax,rect.top
mov rect.bottom,eax
.endif
invoke CopyRect,addr des.ctlrect,addr rect
mov eax,des.parpt.x
sub rect.left,eax
sub rect.right,eax
mov eax,des.parpt.y
sub rect.top,eax
sub rect.bottom,eax
sub rect.left,6
sub rect.top,6
mov eax,rect.right
sub eax,rect.left
shr eax,1
add eax,rect.left
mov pt.x,eax
mov eax,rect.bottom
sub eax,rect.top
shr eax,1
add eax,rect.top
mov pt.y,eax
.if fDlg
invoke DrawSizeingItem,rect.left,rect.top,0,0,hInvisible,fLocked
invoke DrawSizeingItem,pt.x,rect.top,1,0,hInvisible,fLocked
invoke DrawSizeingItem,rect.right,rect.top,2,0,hInvisible,fLocked
invoke DrawSizeingItem,rect.left,pt.y,3,0,hInvisible,fLocked
invoke DrawSizeingItem,rect.left,rect.bottom,5,0,hInvisible,fLocked
.else
invoke DrawSizeingItem,rect.left,rect.top,0,IDC_SIZENWSE,hInvisible,fLocked
invoke DrawSizeingItem,pt.x,rect.top,1,IDC_SIZENS,hInvisible,fLocked
invoke DrawSizeingItem,rect.right,rect.top,2,IDC_SIZENESW,hInvisible,fLocked
invoke DrawSizeingItem,rect.left,pt.y,3,IDC_SIZEWE,hInvisible,fLocked
invoke DrawSizeingItem,rect.left,rect.bottom,5,IDC_SIZENESW,hInvisible,fLocked
.endif
invoke DrawSizeingItem,rect.right,pt.y,4,IDC_SIZEWE,hInvisible,fLocked
invoke DrawSizeingItem,pt.x,rect.bottom,6,IDC_SIZENS,hInvisible,fLocked
invoke DrawSizeingItem,rect.right,rect.bottom,7,IDC_SIZENWSE,hInvisible,fLocked
invoke PropertyList,hWin
ret
SizeingRect endp
SnapToGrid proc uses edi,hWin:HWND,lpRect:DWORD
LOCAL hPar:HWND
call RSnapToGrid
.if fRSnapToGrid
mov edi,lpRect
invoke GetParent,hWin
mov hPar,eax
mov des.parpt.x,0
mov des.parpt.y,0
invoke ClientToScreen,hPar,addr des.parpt
mov eax,[edi].RECT.left
sub eax,des.parpt.x
cdq
idiv Gridcx
imul Gridcx
add eax,des.parpt.x
sub eax,[edi].RECT.left
add [edi].RECT.left,eax
add [edi].RECT.right,eax
mov eax,[edi].RECT.right
sub eax,[edi].RECT.left
cdq
idiv Gridcx
imul Gridcx
add eax,[edi].RECT.left
inc eax
mov [edi].RECT.right,eax
mov eax,[edi].RECT.top
sub eax,des.parpt.y
cdq
idiv Gridcy
imul Gridcy
add eax,des.parpt.y
sub eax,[edi].RECT.top
add [edi].RECT.top,eax
add [edi].RECT.bottom,eax
mov eax,[edi].RECT.bottom
sub eax,[edi].RECT.top
cdq
idiv Gridcy
imul Gridcy
add eax,[edi].RECT.top
inc eax
mov [edi].RECT.bottom,eax
.endif
ret
SnapToGrid endp
CtlMultiSelect proc hWin:HWND
.if hReSize
invoke GetCtrlMem,hWin
mov eax,[eax].DIALOG.ntype
.if eax && eax!=18 && eax!=19
mov eax,hReSize
.if eax!=hWin
push eax
invoke DestroySizeingRect
pop eax
invoke MultiSelRect,eax,TRUE
invoke MultiSelRect,hWin,FALSE
.endif
.endif
xor eax,eax
ret
.endif
.if hMultiSel
invoke GetParent,hMultiSel
.if eax==hWin
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
invoke GetParent,eax
push eax
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
pop eax
.if hMultiSel
invoke MultiSelRect,eax,FALSE
.else
invoke SizeingRect,eax,FALSE
.endif
xor eax,eax
ret
.else
push eax
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
pop eax
invoke MultiSelRect,eax,TRUE
.endif
.endif
invoke MultiSelRect,hWin,FALSE
ret
CtlMultiSelect endp
DesignDummyProc proc uses ebx,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL rect:RECT
LOCAL hDlg:HWND
LOCAL buffer[16]:BYTE
LOCAL pt:POINT
LOCAL hMem:DWORD
mov eax,uMsg
.if eax==WM_CREATE
invoke GetWindowLong,hWin,GWL_ID
.if eax==123456789
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov ebx,eax
lea ebx,[ebx+sizeof DLGHEAD+sizeof DIALOG]
.while [ebx].DIALOG.hwnd
.if [ebx].DIALOG.hwnd!=-1
invoke GetCtrlID,ebx
invoke GetDlgItem,des.hdlg,eax
mov edx,eax
invoke GetWindowRect,edx,addr rect
invoke ScreenToClient,hWin,addr rect.left
invoke GetCtrlID,ebx
invoke CreateWindowEx,NULL,addr szStaticClass,NULL,WS_CHILD or WS_VISIBLE or SS_CENTER or SS_NOTIFY,rect.left,rect.top,22,18,hWin,eax,hInstance,0
push eax
invoke SendMessage,hTlt,WM_GETFONT,0,0
pop edx
invoke SendMessage,edx,WM_SETFONT,eax,FALSE
.endif
lea ebx,[ebx+sizeof DIALOG]
.endw
call SetTabText
.endif
.elseif eax==WM_CTLCOLORSTATIC
invoke SetBkMode,wParam,TRANSPARENT
invoke SetTextColor,wParam,0FFFFFFh
invoke GetStockObject,BLACK_BRUSH
ret
.elseif eax==WM_COMMAND
invoke GetAsyncKeyState,VK_CONTROL
and eax,8000h
.if eax
invoke GetDlgItem,des.hdlg,wParam
invoke GetCtrlMem,eax
mov eax,[eax].DIALOG.tab
mov nTabSet,eax
.else
invoke GetDlgItem,des.hdlg,wParam
invoke SetNewTab,eax,nTabSet
call SetTabText
invoke SetChanged,TRUE
.endif
inc nTabSet
.elseif eax==WM_LBUTTONDOWN
invoke GetWindowLong,hWin,GWL_ID
.if eax==123456789
mov eax,lParam
movsx eax,ax
mov pt.x,eax
mov eax,lParam
shr eax,16
movsx eax,ax
mov pt.y,eax
invoke ClientToScreen,hWin,addr pt
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov ebx,eax
add ebx,sizeof DLGHEAD
invoke ScreenToClient,des.hdlg,addr pt
mov hDlg,0
.while [ebx].DIALOG.hwnd
.if [ebx].DIALOG.hwnd!=-1
invoke GetCtrlID,ebx
.if eax
invoke GetDlgItem,des.hdlg,eax
.else
mov eax,des.hdlg
.endif
mov edx,eax
invoke GetWindowRect,edx,addr rect
invoke ScreenToClient,des.hdlg,addr rect.left
invoke ScreenToClient,des.hdlg,addr rect.right
mov eax,pt.x
mov edx,pt.y
.if sdword ptr eax>=rect.left && sdword ptr eax<=rect.right && sdword ptr edx>=rect.top && sdword ptr edx<=rect.bottom
invoke GetCtrlID,ebx
.if eax
invoke GetDlgItem,des.hdlg,eax
.else
mov eax,des.hdlg
.endif
mov hDlg,eax
mov hMem,ebx
.endif
.endif
add ebx,sizeof DIALOG
.endw
.if hDlg
mov ebx,hMem
.if ![ebx].DIALOG.ntype
invoke DestroyWindow,hTabSet
invoke ShowWindow,hInvisible,SW_SHOWNA
invoke SizeingRect,des.hdlg,FALSE
xor eax,eax
mov hTabSet,eax
ret
.endif
.endif
.endif
xor eax,eax
.else
ExDef:
invoke DefWindowProc,hWin,uMsg,wParam,lParam
.endif
ret
SetTabText:
mov ecx,1
.while TRUE
push ecx
push ecx
invoke GetDlgItem,hWin,ecx
pop ecx
.if !eax
pop ecx
.break
.endif
push eax
invoke GetDlgItem,des.hdlg,ecx
invoke GetCtrlMem,eax
mov ebx,eax
invoke ResEdBinToDec,[ebx].DIALOG.tab,addr buffer
pop edx
invoke SetWindowText,edx,addr buffer
pop ecx
inc ecx
.endw
retn
DesignDummyProc endp
CreateNewCtl proc uses esi edi,hOwner:DWORD,nType:DWORD,x:DWORD,y:DWORD,ccx:DWORD,ccy:DWORD
LOCAL buffer[MaxName]:BYTE
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
invoke GetFreeDlg,eax
mov edi,eax
invoke GetTypePtr,nType
mov esi,eax
;Set default ctl data
mov [edi].DIALOG.hwnd,1
mov eax,nType
mov [edi].DIALOG.ntype,eax
mov eax,(TYPES ptr [esi]).ID
mov [edi].DIALOG.ntypeid,eax
mov eax,(TYPES ptr [esi]).style
mov [edi].DIALOG.style,eax
mov eax,(TYPES ptr [esi]).exstyle
mov [edi].DIALOG.exstyle,eax
mov eax,x
mov [edi].DIALOG.dux,eax
mov eax,y
mov [edi].DIALOG.duy,eax
.if ccx<3 && ccy<3
invoke ConvertToDux,[esi].TYPES.xsize
invoke SizeX
mov ccx,eax
invoke ConvertToDuy,[esi].TYPES.ysize
invoke SizeY
mov ccy,eax
.endif
mov eax,ccx
mov [edi].DIALOG.duccx,eax
mov eax,ccy
mov [edi].DIALOG.duccy,eax
invoke strcpyn,addr buffer,[esi].TYPES.lpidname,MaxName
invoke GetUnikeName,addr buffer
invoke strcpyn,addr [edi].DIALOG.idname,addr buffer,MaxName
invoke strcpyn,addr [edi].DIALOG.caption,[esi].TYPES.lpcaption,MaxCap
.if !nType
invoke GetFreeProjectitemID,TPE_DIALOG
mov [edi].DIALOG.id,eax
;Set default DLGHEAD info
mov esi,edi
sub esi,sizeof DLGHEAD
inc eax
mov [esi].DLGHEAD.ctlid,eax
mov [esi].DLGHEAD.class,0
mov [esi].DLGHEAD.menuid,0
invoke strcpy,addr [esi].DLGHEAD.font,addr DlgFN
mov eax,DlgFS
mov [esi].DLGHEAD.fontsize,eax
mov [edi].DIALOG.tab,0
.else
invoke GetFreeID
mov [edi].DIALOG.id,eax
mov [edi].DIALOG.tab,-1
invoke GetFreeTab
mov [edi].DIALOG.tab,eax
.if nType==23
invoke strcpy,addr [edi].DIALOG.class,addr szUserControlClass
.endif
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov esi,eax
invoke GetCtrlID,edi
push eax
invoke MakeDialog,esi,eax
invoke SetChanged,TRUE
pop edx
.if edx
invoke GetDlgItem,des.hdlg,edx
.endif
push eax
invoke NotifyParent
pop eax
.endif
ret
CreateNewCtl endp
DesignInvisibleProc proc uses ebx,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL pt:POINT
LOCAL rect:RECT
LOCAL rect1:RECT
LOCAL hCld:HWND
LOCAL hDC:HDC
LOCAL parpt:POINT
LOCAL fShift:DWORD
LOCAL fControl:DWORD
LOCAL fChanged:DWORD
LOCAL nInx:DWORD
LOCAL dblclk:CTLDBLCLICK
mov eax,uMsg
.if eax==WM_MOUSEMOVE
.if des.fmode==MODE_DRAWING
call SnapPt
invoke RestoreWin
mov eax,pt.x
mov des.ctlrect.right,eax
mov eax,pt.y
mov des.ctlrect.bottom,eax
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,rect.right
.if sdword ptr eax<rect.left
inc eax
xchg rect.left,eax
mov rect.right,eax
.endif
mov eax,rect.bottom
.if sdword ptr eax<rect.top
inc eax
xchg rect.top,eax
mov rect.bottom,eax
.endif
call DrawRect
; *** MOD
;mov eax,rect.right
;sub eax,rect.left
;mov edx,rect.bottom
;sub edx,rect.top
invoke MapWindowPoints,hInvisible,des.hdlg,addr rect,2
invoke DialogTltSize,rect.left,rect.top,rect.right,rect.bottom
; ===========
.elseif des.fmode==MODE_MOVING || des.fmode==MODE_MOVINIT
call SnapPt
invoke RestoreWin
mov eax,des.ctlrect.right
sub eax,des.ctlrect.left
;Width
push eax
mov eax,des.ctlrect.bottom
sub eax,des.ctlrect.top
;Height
push eax
invoke SnapPtDu,addr des.ctlrect.left
pop eax
add eax,des.ctlrect.top
mov des.ctlrect.bottom,eax
pop eax
add eax,des.ctlrect.left
mov des.ctlrect.right,eax
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,pt.x
sub eax,MousePtDown.x
add rect.left,eax
mov eax,pt.y
sub eax,MousePtDown.y
add rect.top,eax
invoke SnapPtDu,addr rect.left
mov eax,des.ctlrect.right
sub eax,des.ctlrect.left
add eax,rect.left
mov rect.right,eax
mov eax,des.ctlrect.bottom
sub eax,des.ctlrect.top
add eax,rect.top
mov rect.bottom,eax
call DrawRect
mov eax,pt.x
sub eax,MousePtDown.x
mov edx,pt.y
sub edx,MousePtDown.y
.if sdword ptr eax<-1 || sdword ptr eax>1 || sdword ptr edx<-1 || sdword ptr edx>1 || des.fmode==MODE_MOVING
mov des.fmode,MODE_MOVING
; *** MOD
;invoke ClientToScreen,hInvisible,addr rect.left
;invoke ScreenToClient,des.hdlg,addr rect.left
invoke MapWindowPoints,hInvisible,des.hdlg,addr rect,2
invoke DialogTltSize,rect.left,rect.top,rect.right,rect.bottom
; =============
.endif
.elseif des.fmode==MODE_MULTISELMOVE || des.fmode==MODE_MULTISELMOVEINIT
call SnapPt
mov eax,pt.x
mov edx,pt.y
.if eax!=OldPt.x || edx!=OldPt.y
mov des.fmode,MODE_MULTISELMOVE
mov OldPt.x,eax
mov OldPt.y,edx
invoke RestoreWin
call DrawMultisel
.endif
.elseif des.fmode==MODE_SELECT
call SnapPt
invoke RestoreWin
mov eax,pt.x
mov des.ctlrect.right,eax
mov eax,pt.y
mov des.ctlrect.bottom,eax
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,rect.right
.if sdword ptr eax<rect.left
inc eax
xchg rect.left,eax
mov rect.right,eax
.endif
mov eax,rect.bottom
.if sdword ptr eax<rect.top
inc eax
xchg rect.top,eax
mov rect.bottom,eax
.endif
call DrawRect
.elseif !ToolBoxID
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
invoke ClientToScreen,hWin,addr pt
invoke GetWindowRect,des.hdlg,addr rect
mov eax,rect.left
sub pt.x,eax
mov eax,rect.top
sub pt.y,eax
mov eax,pt.x
mov edx,pt.y
.if eax!=des.dlgpt.x || edx!=des.dlgpt.y
mov des.dlgpt.x,eax
mov des.dlgpt.y,edx
.if (eax>=des.mnurect.left && eax<=des.mnurect.right && edx>=des.mnurect.top && edx <=des.mnurect.bottom) || des.nmnu
shl edx,16
movzx eax,ax
or eax,edx
invoke SendMessage,des.hdlg,WM_NCMOUSEMOVE,wParam,eax
.endif
.endif
.endif
.if hStatus
invoke GetCursorPos,addr pt
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
invoke ScreenToClient,des.hdlg,addr pt
invoke ConvertToDux,pt.x
invoke ResEdBinToDec,eax,offset szPos+7
invoke strlen,offset szPos
mov dword ptr szPos[eax],':Y '
add eax,4
push eax
invoke ConvertToDuy,pt.y
mov edx,eax
pop eax
invoke ResEdBinToDec,edx,addr szPos[eax]
invoke SendMessage,hStatus,SB_SETTEXT,nStatus,offset szPos
.endif
.endif
.elseif eax==WM_LBUTTONDOWN
.if des.nmnu
dec des.dlgpt.x
invoke SendMessage,hWin,WM_MOUSEMOVE,wParam,lParam
.else
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
invoke SetCapture,hWin
mov ebx,des.hdlg
call IsInWindow
.if eax
mov fShift,FALSE
mov fControl,FALSE
mov eax,wParam
test eax,MK_SHIFT
.if !ZERO?
mov fShift,TRUE
.endif
;Control key
test eax,MK_CONTROL
.if !ZERO?
mov fControl,TRUE
.endif
mov eax,hReSize
mov des.hselected,eax
.if hSizeing
invoke DestroySizeingRect
.endif
.if ToolBoxID
;Is readOnly
invoke GetWindowLong,hDEd,DEWM_READONLY
.if !eax
invoke CaptureWin
call SnapPt
mov eax,pt.x
mov MousePtDown.x,eax
mov eax,pt.y
mov MousePtDown.y,eax
mov eax,pt.x
mov des.ctlrect.left,eax
mov des.ctlrect.right,eax
mov eax,pt.y
mov des.ctlrect.top,eax
mov des.ctlrect.bottom,eax
mov des.fmode,MODE_DRAWING
.endif
.else
push ebx
call GetCtrl
pop eax
.if eax!=hCld
; Control
.if !fShift && !fControl
invoke GetWindowLong,hDEd,DEWM_READONLY
.if !eax
mov eax,hMultiSel
.if eax
call IsMultisel
.if eax
mov des.fmode,MODE_MULTISELMOVEINIT
invoke CaptureWin
call SnapPt
mov eax,pt.x
mov MousePtDown.x,eax
mov eax,pt.y
mov MousePtDown.y,eax
call DrawMultisel
ret
.endif
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
invoke UpdateWindow,hDEd
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if ![eax].DLGHEAD.locked
mov eax,hCld
mov des.hselected,eax
invoke CaptureWin
call SnapPt
mov eax,pt.x
mov MousePtDown.x,eax
mov eax,pt.y
mov MousePtDown.y,eax
invoke GetWindowRect,hCld,addr des.ctlrect
invoke ScreenToClient,hInvisible,addr des.ctlrect.left
invoke ScreenToClient,hInvisible,addr des.ctlrect.right
invoke MapWindowPoints,hInvisible,des.hdlg,addr rect,2 ; *** MOD
invoke DialogTltSize,rect.left,rect.top,rect.right,rect.bottom ; *** MOD
mov des.fmode,MODE_MOVINIT
.endif
.endif
.elseif !fShift && fControl
.if hMultiSel
invoke CtlMultiSelect,hCld
.else
call GetCtrl
mov edx,des.hdlg
mov eax,hCld
.if eax!=des.hselected && edx!=des.hselected
invoke CtlMultiSelect,des.hselected
invoke CtlMultiSelect,hCld
.endif
.endif
.if hMultiSel
mov des.fmode,MODE_MULTISEL
invoke PropertyList,-1
.endif
.elseif fShift && !fControl
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
invoke UpdateWindow,hDEd
invoke CaptureWin
call SnapPt
mov eax,pt.x
mov MousePtDown.x,eax
mov eax,pt.y
mov MousePtDown.y,eax
mov eax,pt.x
mov des.ctlrect.left,eax
mov des.ctlrect.right,eax
mov eax,pt.y
mov des.ctlrect.top,eax
mov des.ctlrect.bottom,eax
mov des.fmode,MODE_SELECT
.endif
.else
; Dialog
.if hMultiSel
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
invoke UpdateWindow,hDEd
.endif
mov des.fmode,MODE_NOTHING
mov eax,hCld
.if eax==des.hselected || (fShift && !fControl)
invoke CaptureWin
call SnapPt
mov eax,pt.x
mov MousePtDown.x,eax
mov eax,pt.y
mov MousePtDown.y,eax
mov eax,pt.x
mov des.ctlrect.left,eax
mov des.ctlrect.right,eax
mov eax,pt.y
mov des.ctlrect.top,eax
mov des.ctlrect.bottom,eax
mov des.fmode,MODE_SELECT
.endif
.endif
.endif
invoke NotifyParent
.endif
.endif
.elseif eax==WM_LBUTTONUP
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
invoke ReleaseCapture
.if des.fmode==MODE_DRAWING
invoke RestoreWin
invoke DeleteObject,hWinBmp
invoke ShowWindow,hTlt,SW_HIDE
mov des.fmode,MODE_NOTHING
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,rect.right
.if sdword ptr eax<rect.left
inc eax
xchg rect.left,eax
mov rect.right,eax
.endif
mov eax,rect.bottom
.if sdword ptr eax<rect.top
inc eax
xchg rect.top,eax
mov rect.bottom,eax
.endif
invoke ClientToScreen,hInvisible,addr rect.left
invoke ClientToScreen,hInvisible,addr rect.right
mov ebx,des.hdlg
invoke ScreenToClient,ebx,addr rect.left
invoke ScreenToClient,ebx,addr rect.right
mov eax,rect.right
sub eax,rect.left
mov rect.right,eax
mov eax,rect.bottom
sub eax,rect.top
mov rect.bottom,eax
invoke ConvertToDux,rect.left
invoke SizeX
mov rect.left,eax
invoke ConvertToDux,rect.right
invoke SizeX
mov rect.right,eax
invoke ConvertToDuy,rect.top
invoke SizeY
mov rect.top,eax
invoke ConvertToDuy,rect.bottom
invoke SizeY
mov rect.bottom,eax
mov edx,ToolBoxID
invoke CreateNewCtl,des.hdlg,edx,rect.left,rect.top,rect.right,rect.bottom
.if !fNoResetToolbox
invoke ToolBoxReset
.endif
.elseif des.fmode==MODE_MOVING || des.fmode==MODE_MOVINIT
invoke RestoreWin
invoke DeleteObject,hWinBmp
invoke ShowWindow,hTlt,SW_HIDE
call SnapPt
mov eax,pt.x
mov edx,pt.y
mov fChanged,FALSE
.if (eax!=MousePtDown.x || edx!=MousePtDown.y) && des.fmode==MODE_MOVING
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,pt.x
sub eax,MousePtDown.x
add rect.left,eax
add rect.right,eax
mov eax,pt.y
sub eax,MousePtDown.y
add rect.top,eax
add rect.bottom,eax
invoke ClientToScreen,hInvisible,addr rect.left
invoke ClientToScreen,hInvisible,addr rect.right
invoke ScreenToClient,des.hdlg,addr rect.left
invoke ScreenToClient,des.hdlg,addr rect.right
invoke GetCtrlMem,des.hselected
mov ebx,eax
invoke ConvertToDux,rect.left
invoke SizeX
.if eax!=[ebx].DIALOG.dux
mov [ebx].DIALOG.dux,eax
mov fChanged,TRUE
.endif
invoke ConvertToDuy,rect.top
invoke SizeY
.if eax!=[ebx].DIALOG.duy
mov [ebx].DIALOG.duy,eax
mov fChanged,TRUE
.endif
.endif
.if fChanged
invoke GetWindowLong,des.hselected,GWL_ID
push eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
pop edx
invoke MakeDialog,eax,edx
invoke SetChanged,TRUE
.else
invoke SizeingRect,des.hselected,FALSE
.endif
mov des.fmode,MODE_NOTHING
.elseif des.fmode==MODE_SIZING
invoke RestoreWin
invoke DeleteObject,hWinBmp
invoke ShowWindow,hTlt,SW_HIDE
xor eax,eax
mov des.fmode,eax
mov fChanged,eax
invoke CopyRect,addr rect,addr SizeRect
invoke ClientToScreen,hInvisible,addr rect.left
invoke ClientToScreen,hInvisible,addr rect.right
invoke ScreenToClient,des.hdlg,addr rect.left
invoke ScreenToClient,des.hdlg,addr rect.right
mov eax,des.hdlg
.if eax==des.hselected
;Dialog
mov eax,rect.left
sub rect.right,eax
mov eax,rect.top
sub rect.bottom,eax
xor eax,eax
mov rect.left,eax
mov rect.top,eax
mov rect1.left,eax
mov rect1.top,eax
mov rect1.right,eax
mov rect1.bottom,eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
xor edx,edx
.if [eax].DLGHEAD.menuid
inc edx
.endif
invoke AdjustWindowRectEx,addr rect1,[eax+sizeof DLGHEAD].DIALOG.style,edx,[eax+sizeof DLGHEAD].DIALOG.exstyle
mov eax,rect1.right
sub eax,rect1.left
sub rect.right,eax
mov eax,rect1.bottom
sub eax,rect1.top
sub rect.bottom,eax
.endif
invoke GetWindowLong,des.hselected,GWL_ID
push eax
invoke GetCtrlMem,des.hselected
mov ebx,eax
mov eax,des.hdlg
.if eax!=des.hselected
;Control
invoke ConvertToDux,rect.left
.if eax!=[ebx].DIALOG.dux
mov [ebx].DIALOG.dux,eax
inc fChanged
.endif
invoke ConvertToDuy,rect.top
.if eax!=[ebx].DIALOG.duy
mov [ebx].DIALOG.duy,eax
inc fChanged
.endif
invoke ConvertToDux,rect.right
invoke SizeX
sub eax,[ebx].DIALOG.dux
.if eax!=[ebx].DIALOG.duccx
mov [ebx].DIALOG.duccx,eax
inc fChanged
.endif
invoke ConvertToDuy,rect.bottom
invoke SizeY
sub eax,[ebx].DIALOG.duy
.if eax!=[ebx].DIALOG.duccy
mov [ebx].DIALOG.duccy,eax
inc fChanged
.endif
.else
;Dialog
invoke ConvertToDux,rect.right
invoke SizeX
.if eax!=[ebx].DIALOG.duccx
mov [ebx].DIALOG.duccx,eax
inc fChanged
.endif
invoke ConvertToDuy,rect.bottom
invoke SizeY
.if eax!=[ebx].DIALOG.duccy
mov [ebx].DIALOG.duccy,eax
inc fChanged
.endif
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
pop edx
.if fChanged
invoke MakeDialog,eax,edx
invoke SetChanged,TRUE
.else
invoke PropertyList,des.hselected
.endif
.elseif des.fmode==MODE_MULTISEL
.if !hMultiSel
mov des.fmode,MODE_NOTHING
.endif
.elseif des.fmode==MODE_MULTISELMOVE || des.fmode==MODE_MULTISELMOVEINIT
mov OldPt.x,0FFFFh
mov OldPt.y,0FFFFh
invoke RestoreWin
invoke DeleteObject,hWinBmp
invoke ShowWindow,hTlt,SW_HIDE
mov des.fmode,MODE_NOTHING
call SnapPt
mov eax,pt.x
sub eax,MousePtDown.x
invoke ConvertToDux,eax
invoke SizeX
mov pt.x,eax
mov eax,pt.y
sub eax,MousePtDown.y
invoke ConvertToDuy,eax
invoke SizeY
mov pt.y,eax
.if pt.x || pt.y
mov eax,hMultiSel
@@:
push eax
invoke GetParent,eax
invoke GetCtrlMem,eax
mov edx,eax
mov eax,pt.x
add [edx].DIALOG.dux,eax
mov eax,pt.y
add [edx].DIALOG.duy,eax
pop eax
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
or eax,eax
jne @b
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,-1
invoke PropertyList,-1
invoke SetChanged,TRUE
.endif
.elseif des.fmode==MODE_SELECT
invoke RestoreWin
invoke DeleteObject,hWinBmp
mov des.fmode,MODE_NOTHING
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
invoke UpdateWindow,hDEd
invoke CopyRect,addr rect,addr des.ctlrect
mov eax,rect.right
.if sdword ptr eax<rect.left
inc eax
xchg rect.left,eax
mov rect.right,eax
.endif
mov eax,rect.bottom
.if sdword ptr eax<rect.top
inc eax
xchg rect.top,eax
mov rect.bottom,eax
.endif
invoke ClientToScreen,hWin,addr rect.left
invoke ClientToScreen,hWin,addr rect.right
invoke GetWindowLong,hDEd,DEWM_MEMORY
lea ebx,[eax+sizeof DLGHEAD+sizeof DIALOG]
mov nInx,0
.while [ebx].DIALOG.hwnd
.if [ebx].DIALOG.hwnd!=-1
invoke GetCtrlID,ebx
invoke GetDlgItem,des.hdlg,eax
mov hCld,eax
invoke GetWindowRect,hCld,addr rect1
mov eax,rect1.left
mov ecx,rect1.right
.if (eax>=rect.left && eax<=rect.right) || (ecx>=rect.left && ecx<=rect.right) || (rect.left>=eax && rect.right<=ecx)
mov eax,rect1.top
mov ecx,rect1.bottom
.if (eax>=rect.top && eax<=rect.bottom) || (ecx>=rect.top && ecx<=rect.bottom) || (rect.top>=eax && rect.bottom<=ecx)
mov eax,[ebx].DIALOG.ntype
.if eax!=18 && eax!=19
invoke CtlMultiSelect,hCld
inc nInx
.endif
.endif
.endif
.endif
lea ebx,[ebx+sizeof DIALOG]
.endw
.if nInx==1 && hMultiSel
invoke GetParent,hMultiSel
invoke SizeingRect,eax,FALSE
.elseif hMultiSel
invoke PropertyList,-1
.else
invoke SizeingRect,des.hdlg,FALSE
.endif
.else
mov hCld,0
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
mov ebx,des.hdlg
call IsInWindow
.if eax
call GetCtrl
invoke SizeingRect,hCld,FALSE
.endif
.endif
invoke NotifyParent
invoke SetFocus,hDEd
.elseif eax==WM_LBUTTONDBLCLK
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
mov ebx,des.hdlg
call IsInWindow
.if eax
push ebx
push esi
push edi
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov esi,eax
mov edi,eax
lea esi,[esi+sizeof DLGHEAD]
.while [esi].DIALOG.hwnd
lea esi,[esi+sizeof DIALOG]
.endw
lea esi,[esi-sizeof DIALOG]
.while esi>edi
invoke GetCtrlID,esi
.if eax
invoke GetDlgItem,des.hdlg,eax
mov ebx,eax
.else
mov ebx,des.hdlg
.endif
call IsInWindow
.break .if eax
lea esi,[esi-sizeof DIALOG]
.endw
pop edi
pop esi
pop eax
invoke GetCtrlMem,hCld
mov ebx,eax
mov eax,hRes
mov dblclk.nmhdr.hwndFrom,eax
invoke GetWindowLong,hRes,GWL_ID
push eax
mov dblclk.nmhdr.idFrom,eax
mov dblclk.nmhdr.code,NM_CLICK
mov eax,[ebx].DIALOG.id
mov dblclk.nCtlId,eax
lea eax,[ebx].DIALOG.idname
mov dblclk.lpCtlName,eax
invoke GetCtrlMem,des.hdlg
mov edx,eax
mov dblclk.lpDlgMem,edx
mov eax,[edx].DIALOG.id
mov dblclk.nDlgId,eax
lea eax,[edx].DIALOG.idname
mov dblclk.lpDlgName,eax
invoke GetParent,hRes
pop edx
mov ecx,eax
invoke SendMessage,ecx,WM_NOTIFY,edx,addr dblclk
.endif
.elseif eax==WM_SETCURSOR
invoke GetCursorPos,addr pt
invoke ScreenToClient,hInvisible,addr pt
mov ebx,des.hdlg
call IsInWindow
.if ToolBoxID && (eax || des.fmode==MODE_DRAWING)
invoke LoadCursor,0,IDC_CROSS
.else
invoke LoadCursor,0,IDC_ARROW
.endif
invoke SetCursor,eax
.else
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
IsMultisel:
mov eax,hMultiSel
.if eax
@@:
push eax
invoke GetParent,eax
pop edx
.if eax==hCld
retn
.endif
mov eax,edx
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
or eax,eax
jne @b
.endif
retn
SnapPt:
mov eax,lParam
movsx edx,ax
shr eax,16
cwde
mov pt.x,edx
mov pt.y,eax
invoke SnapPtDu,addr pt
retn
IsInWindow:
invoke GetWindowRect,ebx,addr rect
invoke ScreenToClient,hInvisible,addr rect.left
invoke ScreenToClient,hInvisible,addr rect.right
mov eax,pt.x
mov edx,pt.y
.if sdword ptr eax>=rect.left && sdword ptr eax<=rect.right && sdword ptr edx>=rect.top && sdword ptr edx<=rect.bottom
mov hCld,ebx
mov eax,TRUE
.else
xor eax,eax
.endif
retn
GetCtrl:
push esi
push edi
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov esi,eax
mov edi,eax
lea esi,[esi+sizeof DLGHEAD]
.while [esi].DIALOG.hwnd
lea esi,[esi+sizeof DIALOG]
.endw
lea esi,[esi-sizeof DIALOG]
.while esi>edi
invoke GetCtrlID,esi
.if eax
invoke GetDlgItem,des.hdlg,eax
mov ebx,eax
.else
mov ebx,des.hdlg
.endif
call IsInWindow
.break .if eax
lea esi,[esi-sizeof DIALOG]
.endw
pop edi
pop esi
retn
DrawMultisel:
mov eax,hMultiSel
@@:
push eax
invoke GetParent,eax
push eax
mov edx,eax
invoke GetWindowRect,edx,addr rect
mov eax,pt.x
sub eax,MousePtDown.x
add rect.left,eax
add rect.right,eax
mov eax,pt.y
sub eax,MousePtDown.y
add rect.top,eax
add rect.bottom,eax
invoke ScreenToClient,hInvisible,addr rect.left
invoke ScreenToClient,hInvisible,addr rect.right
call DrawRect
invoke GetParent,hMultiSel
pop edx
.if eax==edx && des.fmode==MODE_MULTISELMOVE
; *** MOD
;invoke ConvertToDlgPt,addr rect.left
invoke MapWindowPoints,hInvisible,des.hdlg,addr rect,2
invoke DialogTltSize,rect.left,rect.top,rect.right,rect.bottom
; =============
.endif
mov ecx,8
pop eax
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
or eax,eax
jne @b
retn
DrawRect:
invoke GetDC,hWin
mov hDC,eax
invoke GetStockObject,BLACK_BRUSH
invoke FrameRect,hDC,addr rect,eax
invoke ReleaseDC,hWin,hDC
retn
DesignInvisibleProc endp
CopyCtl proc uses esi edi ebx
LOCAL hCtl:HWND
.if hReSize
invoke GetCtrlMem,hReSize
.if eax
mov esi,eax
mov edi,offset dlgpaste
mov ecx,sizeof DIALOG
rep movsb
xor eax,eax
stosd
.endif
.elseif hMultiSel
mov edi,offset dlgpaste
mov ebx,hMultiSel
.while ebx
invoke GetParent,ebx
mov hCtl,eax
mov eax,8
.while eax
push eax
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop eax
dec eax
.endw
invoke GetCtrlMem,hCtl
.if eax
mov esi,eax
mov ecx,sizeof DIALOG
rep movsb
.endif
.endw
xor eax,eax
stosd
.endif
invoke SendMessage,hDEd,WM_LBUTTONDOWN,0,0
ret
CopyCtl endp
PasteCtl proc uses esi edi
LOCAL px:DWORD
LOCAL py:DWORD
LOCAL nbr:DWORD
mov nbr,0
mov esi,offset dlgpaste
mov px,9999
mov py,9999
push esi
@@:
mov eax,[esi].DIALOG.hwnd
.if eax
mov eax,[esi].DIALOG.dux
.if (px<80000000 && eax<80000000 && eax<px) || (px>80000000 && eax>80000000 && eax<px) || (px<80000000 && eax>80000000)
mov px,eax
.endif
mov eax,[esi].DIALOG.duy
.if (py<80000000 && eax<80000000 && eax<py) || (py>80000000 && eax>80000000 && eax<py) || (py<80000000 && eax>80000000)
mov py,eax
.endif
add esi,sizeof DIALOG
jmp @b
.endif
pop esi
@@:
mov eax,[esi].DIALOG.hwnd
.if eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
push eax
mov edx,eax
mov edx,[edx].DLGHEAD.ctlid
add eax,sizeof DLGHEAD
mov [esi].DIALOG.id,edx
invoke IsFreeID,edx
.if eax==FALSE
invoke GetFreeID
mov [esi].DIALOG.id,eax
.endif
pop eax
invoke GetFreeDlg,eax
mov edi,eax
push esi
push eax
mov ecx,sizeof DIALOG
rep movsb
pop esi
mov eax,px
sub [esi].DIALOG.dux,eax
mov eax,py
sub [esi].DIALOG.duy,eax
xor eax,eax
mov [esi].DIALOG.himg,eax
invoke GetTypePtr,[esi].DIALOG.ntype
invoke strcpyn,addr [esi].DIALOG.idname,(TYPES ptr [eax]).lpidname,MaxName
invoke GetUnikeName,addr [esi].DIALOG.idname
mov [esi].DIALOG.tab,-1
invoke GetFreeTab
mov [esi].DIALOG.tab,eax
pop esi
add esi,sizeof DIALOG
inc nbr
jmp @b
.endif
.endif
.if nbr
invoke DestroySizeingRect
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,-2
invoke SetChanged,TRUE
.if nbr>1
.while nbr
sub edi,sizeof DIALOG
invoke GetCtrlID,edi
invoke GetDlgItem,des.hdlg,eax
invoke CtlMultiSelect,eax
dec nbr
.endw
.else
sub edi,sizeof DIALOG
invoke GetCtrlID,edi
invoke GetDlgItem,des.hdlg,eax
invoke SizeingRect,eax,FALSE
.endif
invoke NotifyParent
.endif
ret
PasteCtl endp
DeleteCtl proc uses esi
LOCAL hCtl:HWND
.if hReSize
invoke GetCtrlMem,hReSize
.if eax
mov esi,eax
mov eax,[esi].DIALOG.ntype
;Don't delete DialogBox
.if eax
mov [esi].DIALOG.hwnd,-1
invoke DeleteTab,[esi].DIALOG.tab
invoke DestroySizeingRect
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,0
invoke SetChanged,TRUE
.endif
.endif
.elseif hMultiSel
.while hMultiSel
invoke GetParent,hMultiSel
mov hCtl,eax
mov eax,8
.while eax
push eax
invoke GetWindowLong,hMultiSel,GWL_USERDATA
push eax
invoke DestroyWindow,hMultiSel
pop eax
mov hMultiSel,eax
pop eax
dec eax
.endw
invoke GetCtrlMem,hCtl
.if eax
mov esi,eax
mov eax,[esi].DIALOG.ntype
;Don't delete DialogBox
.if eax
mov [esi].DIALOG.hwnd,-1
invoke DeleteTab,[esi].DIALOG.tab
.endif
.endif
.endw
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,0
invoke SetChanged,TRUE
.endif
invoke NotifyParent
ret
DeleteCtl endp
AlignSizeCtl proc uses esi ebx,nFun:DWORD
LOCAL xp:DWORD
LOCAL yp:DWORD
LOCAL wt:DWORD
LOCAL ht:DWORD
LOCAL hCtl:HWND
LOCAL fChanged:DWORD
LOCAL xpmin:DWORD
LOCAL ypmin:DWORD
LOCAL xpmax:DWORD
LOCAL ypmax:DWORD
LOCAL rect:RECT
mov ebx,hMultiSel
.if ebx
;Multi select
mov eax,nFun
.if eax==ALIGN_DLGVCENTER || eax==ALIGN_DLGHCENTER
mov eax,99999
mov xpmin,eax
mov ypmin,eax
neg eax
mov xpmax,eax
mov ypmax,eax
.while ebx
invoke GetParent,ebx
invoke GetCtrlMem,eax
mov esi,eax
mov eax,[esi].DIALOG.dux
.if sdword ptr eax<xpmin
mov xpmin,eax
.endif
add eax,[esi].DIALOG.duccx
.if sdword ptr eax>xpmax
mov xpmax,eax
.endif
mov eax,[esi].DIALOG.duy
.if sdword ptr eax<ypmin
mov ypmin,eax
.endif
add eax,[esi].DIALOG.duccy
.if sdword ptr eax>ypmax
mov ypmax,eax
.endif
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop ecx
dec ecx
.endw
.endw
invoke GetCtrlMem,des.hdlg
mov edx,[eax].DIALOG.duccx
mov rect.right,edx
mov edx,[eax].DIALOG.duccy
mov rect.bottom,edx
mov rect.left,0
mov rect.top,0
mov eax,xpmax
sub eax,xpmin
mov edx,rect.right
sub edx,eax
shr edx,1
sub xpmin,edx
mov eax,ypmax
sub eax,ypmin
mov edx,rect.bottom
sub edx,eax
shr edx,1
sub ypmin,edx
mov ebx,hMultiSel
.while ebx
mov fChanged,FALSE
invoke GetParent,ebx
mov hCtl,eax
invoke GetCtrlMem,hCtl
mov esi,eax
mov eax,nFun
.if eax==ALIGN_DLGVCENTER
mov eax,ypmin
.if eax
sub [esi].DIALOG.duy,eax
inc fChanged
.endif
.elseif eax==ALIGN_DLGHCENTER
mov eax,xpmin
.if eax
sub [esi].DIALOG.dux,eax
inc fChanged
.endif
.endif
call SnapGrid
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop ecx
dec ecx
.endw
.endw
.else
invoke GetParent,ebx
invoke GetCtrlMem,eax
mov esi,eax
mov eax,[esi].DIALOG.dux
mov xp,eax
mov eax,[esi].DIALOG.duy
mov yp,eax
mov eax,[esi].DIALOG.duccx
mov wt,eax
mov eax,[esi].DIALOG.duccy
mov ht,eax
.while ebx
mov fChanged,FALSE
invoke GetParent,ebx
mov hCtl,eax
invoke GetCtrlMem,hCtl
mov esi,eax
mov eax,nFun
.if eax==ALIGN_LEFT
mov eax,xp
.if eax!=[esi].DIALOG.dux
mov [esi].DIALOG.dux,eax
inc fChanged
.endif
.elseif eax==ALIGN_CENTER
mov eax,wt
shr eax,1
add eax,xp
mov edx,[esi].DIALOG.duccx
shr edx,1
add edx,[esi].DIALOG.dux
sub eax,edx
.if eax
add [esi].DIALOG.dux,eax
inc fChanged
.endif
.elseif eax==ALIGN_RIGHT
mov eax,xp
add eax,wt
sub eax,[esi].DIALOG.duccx
.if eax!=[esi].DIALOG.dux
mov [esi].DIALOG.dux,eax
inc fChanged
.endif
.elseif eax==ALIGN_TOP
mov eax,yp
.if eax!=[esi].DIALOG.duy
mov [esi].DIALOG.duy,eax
inc fChanged
.endif
.elseif eax==ALIGN_MIDDLE
mov eax,ht
shr eax,1
add eax,yp
mov edx,[esi].DIALOG.duccy
shr edx,1
add edx,[esi].DIALOG.duy
sub eax,edx
.if eax
add [esi].DIALOG.duy,eax
inc fChanged
.endif
.elseif eax==ALIGN_BOTTOM
mov eax,yp
add eax,ht
sub eax,[esi].DIALOG.duccy
.if eax!=[esi].DIALOG.duy
mov [esi].DIALOG.duy,eax
inc fChanged
.endif
.elseif eax==SIZE_WIDTH
mov eax,wt
.if eax!=[esi].DIALOG.duccx
mov [esi].DIALOG.duccx,eax
inc fChanged
.endif
.elseif eax==SIZE_HEIGHT
mov eax,ht
.if eax!=[esi].DIALOG.duccy
mov [esi].DIALOG.duccy,eax
inc fChanged
.endif
.elseif eax==SIZE_BOTH
mov eax,wt
.if eax!=[esi].DIALOG.duccx
mov [esi].DIALOG.duccx,eax
inc fChanged
.endif
mov eax,ht
.if eax!=[esi].DIALOG.duccy
mov [esi].DIALOG.duccy,eax
inc fChanged
.endif
.endif
call SnapGrid
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop ecx
dec ecx
.endw
.endw
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,-1
invoke SetChanged,TRUE
.else
mov eax,nFun
.if (eax==ALIGN_DLGVCENTER || eax==ALIGN_DLGHCENTER) && hReSize
;Single select
mov eax,hReSize
mov hCtl,eax
invoke GetCtrlMem,hCtl
mov esi,eax
mov eax,[esi].DIALOG.dux
mov xpmin,eax
mov eax,[esi].DIALOG.duy
mov ypmin,eax
mov eax,[esi].DIALOG.duccx
add eax,[esi].DIALOG.dux
mov xpmax,eax
mov eax,[esi].DIALOG.duccy
add eax,[esi].DIALOG.duy
mov ypmax,eax
invoke GetCtrlMem,des.hdlg
mov edx,[eax].DIALOG.duccx
mov rect.right,edx
mov edx,[eax].DIALOG.duccy
mov rect.bottom,edx
mov rect.left,0
mov rect.top,0
mov eax,xpmax
sub eax,xpmin
mov edx,rect.right
sub edx,eax
shr edx,1
sub xpmin,edx
mov eax,ypmax
sub eax,ypmin
mov edx,rect.bottom
sub edx,eax
shr edx,1
sub ypmin,edx
mov eax,nFun
.if eax==ALIGN_DLGVCENTER
mov eax,ypmin
.if eax
sub [esi].DIALOG.duy,eax
inc fChanged
.endif
.elseif eax==ALIGN_DLGHCENTER
mov eax,xpmin
.if eax
sub [esi].DIALOG.dux,eax
inc fChanged
.endif
.endif
call SnapGrid
invoke GetWindowLong,hCtl,GWL_ID
push eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
pop edx
invoke MakeDialog,eax,edx
invoke SetChanged,TRUE
.endif
.endif
invoke NotifyParent
ret
SnapGrid:
retn
call RSnapToGrid
.if fRSnapToGrid
; mov eax,[esi].x
; xor edx,edx
; idiv Gridcx
; imul Gridcx
; .if eax!=[esi].x
; mov [esi].x,eax
; inc fChanged
; .endif
; mov eax,[esi].ccx
; add eax,[esi].x
; xor edx,edx
; idiv Gridcx
; imul Gridcx
; sub eax,[esi].x
; inc eax
; .if eax!=[esi].ccx
; mov [esi].ccx,eax
; inc fChanged
; .endif
; mov eax,[esi].y
; xor edx,edx
; idiv Gridcy
; imul Gridcy
; .if eax!=[esi].y
; mov [esi].y,eax
; inc fChanged
; .endif
; mov eax,[esi].ccy
; add eax,[esi].y
; xor edx,edx
; idiv Gridcy
; imul Gridcy
; sub eax,[esi].y
; inc eax
; .if eax!=[esi].ccy
; mov [esi].ccy,eax
; inc fChanged
; .endif
.endif
retn
AlignSizeCtl endp
MoveMultiSel proc uses esi,x:DWORD,y:DWORD
mov eax,hMultiSel
.while eax
push eax
invoke GetParent,eax
invoke GetCtrlMem,eax
mov esi,eax
.if x
mov eax,(DIALOG ptr [esi]).dux
add eax,x
xor edx,edx
idiv x
imul x
mov (DIALOG ptr [esi]).dux,eax
.endif
.if y
mov eax,(DIALOG ptr [esi]).duy
add eax,y
xor edx,edx
idiv y
imul y
mov (DIALOG ptr [esi]).duy,eax
.endif
mov ecx,8
pop eax
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
.endw
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,-1
invoke SetChanged,TRUE
invoke NotifyParent
ret
MoveMultiSel endp
SizeMultiSel proc uses esi,x:DWORD,y:DWORD
mov eax,hMultiSel
.while eax
push eax
invoke GetParent,eax
invoke GetCtrlMem,eax
mov esi,eax
.if x
mov eax,(DIALOG ptr [esi]).duccx
add eax,x
.if sdword ptr eax>0
xor edx,edx
idiv x
imul x
mov (DIALOG ptr [esi]).duccx,eax
.endif
.endif
.if y
mov eax,(DIALOG ptr [esi]).duccy
add eax,y
.if sdword ptr eax>0
xor edx,edx
idiv y
imul y
mov (DIALOG ptr [esi]).duccy,eax
.endif
.endif
mov ecx,8
pop eax
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
.endw
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke MakeDialog,eax,-1
invoke SetChanged,TRUE
invoke NotifyParent
ret
SizeMultiSel endp
AutoIDMultiSel proc uses esi
LOCAL MinID:DWORD
LOCAL MinTab:DWORD
LOCAL MaxTab:DWORD
LOCAL TabPtr:DWORD
mov eax,hMultiSel
.if eax
mov MinID,7FFFFFFFh
mov MinTab,7FFFFFFFh
.while eax
push eax
invoke GetParent,eax
invoke GetCtrlMem,eax
mov esi,eax
mov eax,(DIALOG ptr [esi]).id
.if sdword ptr eax>0
.if eax<MinID
mov MinID,eax
.endif
.endif
mov eax,(DIALOG ptr [esi]).tab
.if eax<MinTab
mov MinTab,eax
.endif
mov ecx,8
pop eax
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
.endw
invoke GetParent,hMultiSel
invoke GetCtrlMem,eax
mov eax,(DIALOG ptr [eax]).id
.if sdword ptr eax>0
mov MinID,eax
.endif
.while TRUE
call GetNextTab
mov esi,TabPtr
.break .if !esi
.if sdword ptr (DIALOG ptr [esi]).id>0
mov eax,MinID
mov (DIALOG ptr [esi]).id,eax
inc MinID
.endif
inc MinTab
.endw
invoke SetChanged,TRUE
.endif
invoke GetWindowLong,hDEd,DEWM_MEMORY
invoke UpdateRAEdit,eax
invoke NotifyParent
ret
GetNextTab:
mov MaxTab,7FFFFFFFh
mov TabPtr,0
mov eax,hMultiSel
.while eax
push eax
invoke GetParent,eax
invoke GetCtrlMem,eax
mov esi,eax
mov eax,(DIALOG ptr [esi]).tab
.if eax>=MinTab
.if eax<MaxTab
mov MaxTab,eax
mov TabPtr,esi
.endif
.endif
mov ecx,8
pop eax
.while ecx
push ecx
invoke GetWindowLong,eax,GWL_USERDATA
pop ecx
dec ecx
.endw
.endw
retn
AutoIDMultiSel endp
SendToBack proc uses esi edi,hCtl:HWND
LOCAL buffer[512]:BYTE
LOCAL lpSt:DWORD
LOCAL lpFirst:DWORD
LOCAL nID:DWORD
invoke GetCtrlMem,hCtl
mov lpSt,eax
mov esi,eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
add eax,sizeof DLGHEAD+sizeof DIALOG
.while [eax].DIALOG.hwnd==-1
add eax,sizeof DIALOG
.endw
.if [esi].DIALOG.ntype!=11
.while ([eax].DIALOG.ntype==3 || [eax].DIALOG.ntype==11 || [eax].DIALOG.hwnd==-1) && [eax].DIALOG.hwnd
add eax,sizeof DIALOG
.endw
.endif
mov lpFirst,eax
.if eax<lpSt
lea edi,buffer
mov ecx,sizeof DIALOG
rep movsb
mov esi,lpSt
@@:
mov edi,esi
mov ecx,sizeof DIALOG
sub esi,ecx
rep movsb
sub esi,sizeof DIALOG
cmp esi,lpFirst
jge @b
invoke GetCtrlID,lpFirst
mov nID,eax
lea esi,buffer
mov edi,lpFirst
mov ecx,sizeof DIALOG
rep movsb
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov esi,eax
invoke MakeDialog,esi,nID
.endif
ret
SendToBack endp
BringToFront proc uses esi edi,hCtl:HWND
LOCAL buffer[512]:BYTE
LOCAL lpSt:DWORD
LOCAL nID:DWORD
invoke GetCtrlMem,hCtl
mov lpSt,eax
mov esi,eax
lea edi,buffer
mov ecx,sizeof DIALOG
rep movsb
mov edi,esi
sub edi,sizeof DIALOG
@@:
mov ecx,sizeof DIALOG
rep movsb
mov eax,dword ptr [esi]
or eax,eax
jne @b
invoke GetCtrlID,edi
mov nID,eax
lea esi,buffer
mov ecx,sizeof DIALOG
rep movsb
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov esi,eax
invoke MakeDialog,esi,nID
ret
BringToFront endp
GetMnuString proc uses ebx esi edi,lpName:DWORD,lpBuff:DWORD
invoke GetWindowLong,hPrj,0
mov esi,eax
mov edi,lpName
xor ebx,ebx
.if byte ptr [edi]>='0' && byte ptr [edi]<='9'
invoke ResEdDecToBin,edi
mov ebx,eax
.endif
.while [esi].PROJECT.hmem
.if [esi].PROJECT.ntype==TPE_MENU
mov edx,[esi].PROJECT.hmem
.if ebx
cmp ebx,[edx].MNUHEAD.menuid
.break .if ZERO?
.else
invoke strcmp,lpName,addr [edx].MNUHEAD.menuname
.break .if !eax
.endif
.endif
lea esi,[esi+sizeof PROJECT]
.endw
.if [esi].PROJECT.ntype==TPE_MENU
mov esi,[esi].PROJECT.hmem
push esi
mov edi,lpBuff
mov byte ptr [edi],0
add esi,sizeof MNUHEAD
@@:
mov eax,(MNUITEM ptr [esi]).itemflag
.if eax
.if eax!=-1
mov eax,(MNUITEM ptr [esi]).level
.if !eax
.if edi!=lpBuff
mov byte ptr [edi],','
inc edi
.endif
mov byte ptr [edi],' '
inc edi
mov byte ptr [edi],' '
inc edi
invoke strcpy,edi,addr (MNUITEM ptr [esi]).itemcaption
invoke strlen,edi
add edi,eax
mov byte ptr [edi],' '
inc edi
mov byte ptr [edi],' '
inc edi
mov byte ptr [edi],0
.endif
.endif
add esi,sizeof MNUITEM
jmp @b
.endif
pop eax
.else
invoke strcpy,lpBuff,addr szMnu
xor eax,eax
.endif
ret
GetMnuString endp
TestProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL rect:RECT
LOCAL fnt:LOGFONT
mov eax,uMsg
.if eax==WM_INITDIALOG
invoke GetClientRect,hWin,addr rect
push rect.right
pop fntwt
push rect.bottom
pop fntht
invoke SendMessage,hWin,WM_GETFONT,0,0
mov edx,eax
invoke GetObject,edx,sizeof LOGFONT,addr fnt
mov eax,fnt.lfHeight
mov lfntht,eax
mov eax,FALSE
ret
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
TestProc endp
DlgResize proc uses esi edi,hMem:DWORD,lpOldFont:DWORD,nOldSize:DWORD,lpNewFont:DWORD,nNewSize:DWORD
mov eax,nOldSize
mov dlgps,ax
invoke ConvFontToUnicode,offset dlgfn,lpOldFont
invoke CreateDialogIndirectParam,hInstance,offset dlgdata,hDEd,offset TestProc,0
invoke DestroyWindow,eax
push fntwt
pop dfntwt
push fntht
pop dfntht
mov eax,nNewSize
mov dlgps,ax
invoke ConvFontToUnicode,offset dlgfn,lpNewFont
invoke CreateDialogIndirectParam,hInstance,offset dlgdata,hDEd,offset TestProc,0
invoke DestroyWindow,eax
mov esi,hMem
add esi,sizeof DLGHEAD
mov edi,esi
.while [esi].DIALOG.hwnd
.if [esi].DIALOG.hwnd!=-1
; Dont move dialog
.if edi!=esi
mov eax,[esi].DIALOG.dux
call getx
.if fSnapToGrid
xor edx,edx
idiv Gridcx
imul Gridcx
.endif
mov [esi].DIALOG.dux,eax
mov eax,[esi].DIALOG.duy
call gety
.if fSnapToGrid
xor edx,edx
idiv Gridcy
imul Gridcy
.endif
mov [esi].DIALOG.duy,eax
.endif
mov eax,[esi].DIALOG.duccx
call getx
.if fSnapToGrid
xor edx,edx
idiv Gridcx
imul Gridcx
;inc eax
.endif
mov [esi].DIALOG.duccx,eax
mov eax,[esi].DIALOG.duccy
call gety
.if fSnapToGrid
xor edx,edx
idiv Gridcy
imul Gridcy
;inc eax
.endif
mov [esi].DIALOG.duccy,eax
.endif
add esi,sizeof DIALOG
.endw
ret
getx:
.if sdword ptr eax<0
neg eax
shl eax,1
imul dfntwt
xor edx,edx
idiv fntwt
shr eax,1
; adc eax,0
neg eax
.else
shl eax,1
imul dfntwt
xor edx,edx
idiv fntwt
shr eax,1
; adc eax,0
.endif
retn
gety:
.if sdword ptr eax<0
neg eax
shl eax,1
imul dfntht
xor edx,edx
idiv fntht
shr eax,1
; adc eax,0
neg eax
.else
shl eax,1
imul dfntht
xor edx,edx
idiv fntht
shr eax,1
; adc eax,0
.endif
retn
DlgResize endp
GetType proc uses ebx esi,lpDlg:DWORD
mov esi,lpDlg
mov eax,[esi].DIALOG.ntypeid
.if eax
mov ebx,offset ctltypes
xor ecx,ecx
.while ecx<nButtons
.if eax==[ebx].TYPES.ID
mov [esi].DIALOG.ntype,ecx
xor eax,eax
.break
.endif
add ebx,sizeof TYPES
inc ecx
.endw
.if eax
mov [esi].DIALOG.ntype,2
mov [esi].DIALOG.ntypeid,2
.endif
.else
mov eax,[esi].DIALOG.ntype
mov [esi].DIALOG.ntypeid,eax
xor eax,eax
.endif
ret
GetType endp
UpdateRAEdit proc uses ebx esi edi,hMem:DWORD
mov ebx,hMem
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,256*1024
mov edi,eax
invoke ExportDialogNames,ebx
mov esi,eax
invoke strcpy,edi,esi
invoke GlobalUnlock,esi
invoke GlobalFree,esi
invoke ExportDialog,ebx
mov esi,eax
invoke strcat,edi,esi
invoke GlobalUnlock,esi
invoke GlobalFree,esi
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,256*1024
mov esi,eax
invoke SaveToMem,[ebx].DLGHEAD.hred,esi
invoke strcmp,esi,edi
.if eax
invoke SendMessage,[ebx].DLGHEAD.hred,REM_LOCKUNDOID,TRUE,0
invoke SendMessage,[ebx].DLGHEAD.hred,EM_SETSEL,0,-1
invoke SendMessage,[ebx].DLGHEAD.hred,EM_REPLACESEL,TRUE,edi
invoke SendMessage,[ebx].DLGHEAD.hred,REM_LOCKUNDOID,FALSE,0
.endif
invoke GlobalFree,esi
invoke GlobalFree,edi
ret
UpdateRAEdit endp
CloseDialog proc uses esi
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov esi,eax
.if [esi].DLGHEAD.ftextmode
invoke ShowWindow,[esi].DLGHEAD.hred,SW_HIDE
.else
invoke DestroySizeingRect
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
.endif
invoke GetWindowLong,hDEd,DEWM_DIALOG
invoke DestroyWindow,eax
mov des.hdlg,0
invoke SetWindowLong,hDEd,DEWM_MEMORY,0
invoke SetWindowLong,hDEd,DEWM_DIALOG,0
invoke SetWindowLong,hDEd,DEWM_PROJECT,0
invoke ShowWindow,hInvisible,SW_HIDE
.if hTabSet
invoke DestroyWindow,hTabSet
mov hTabSet,0
.endif
.elseif hDialog
invoke SendMessage,hDialog,WM_COMMAND,BN_CLICKED shl 16 or IDOK,0
invoke SendMessage,hDialog,WM_COMMAND,BN_CLICKED shl 16 or IDCANCEL,0
mov hDialog,0
.endif
ret
CloseDialog endp
GetMnuName proc uses ebx esi,lpDlgMem:DWORD,nid:DWORD
mov esi,lpDlgMem
mov eax,[esi].DLGHEAD.lpmnu
.if eax
mov esi,eax
add esi,sizeof MNUHEAD
@@:
mov eax,(MNUITEM ptr [esi]).itemflag
.if eax
.if eax!=-1
mov eax,(MNUITEM ptr [esi]).itemid
.if eax==nid
lea eax,(MNUITEM ptr [esi]).itemname
jmp Ex
.endif
.endif
add esi,sizeof MNUITEM
jmp @b
.endif
.endif
xor eax,eax
Ex:
ret
GetMnuName endp
MakeDlgProc proc uses esi,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL rect:RECT
LOCAL dblclk:CTLDBLCLICK
mov eax,uMsg
.if eax==WM_INITDIALOG
invoke GetWindowRect,hWin,addr rect
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if [eax].DLGHEAD.menuid
invoke GetSystemMetrics,SM_CYMENU
add rect.bottom,eax
.endif
invoke GetWindowLong,hDEd,DEWM_SCROLLY
push eax
invoke GetWindowLong,hDEd,DEWM_SCROLLX
shl eax,3
neg eax
add eax,DlgX
pop edx
shl edx,3
neg edx
add edx,DlgY
mov ecx,rect.bottom
sub ecx,rect.top
mov rect.bottom,ecx
mov ecx,rect.left
sub rect.right,ecx
invoke SetWindowPos,hWin,0,eax,edx,rect.right,rect.bottom,SWP_NOZORDER
invoke EnumChildWindows,hWin,addr DlgEnumProc,hWin
mov eax,FALSE
ret
.elseif eax==WM_COMMAND
mov edx,wParam
movzx eax,dx
shr edx,16
.if !edx
push ebx
mov eax,hRes
mov dblclk.nmhdr.hwndFrom,eax
invoke GetWindowLong,hRes,GWL_ID
push eax
mov dblclk.nmhdr.idFrom,eax
mov dblclk.nmhdr.code,NM_CLICK
mov eax,wParam
mov dblclk.nCtlId,eax
push eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
pop edx
invoke GetMnuName,eax,edx
mov dblclk.lpCtlName,eax
invoke GetCtrlMem,des.hdlg
mov edx,eax
mov dblclk.lpDlgMem,edx
mov eax,[edx].DIALOG.id
mov dblclk.nDlgId,eax
lea eax,[edx].DIALOG.idname
mov dblclk.lpDlgName,eax
invoke GetParent,hRes
pop edx
mov ecx,eax
invoke SendMessage,ecx,WM_NOTIFY,edx,addr dblclk
pop ebx
.endif
.elseif eax==WM_DRAWITEM
mov esi,lParam
invoke GetStockObject,GRAY_BRUSH
invoke FillRect,[esi].DRAWITEMSTRUCT.hdc,addr [esi].DRAWITEMSTRUCT.rcItem,eax
xor eax,eax
inc eax
ret
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
MakeDlgProc endp
MakeDlgClassProc proc uses ebx,hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL buffer[512]:BYTE
LOCAL buffer1[128]:BYTE
LOCAL rect:RECT
LOCAL rect1:RECT
LOCAL rect2:RECT
LOCAL hDC:HDC
LOCAL mDC:HDC
LOCAL nInx:DWORD
LOCAL pt:POINT
LOCAL fMnu:DWORD
mov eax,uMsg
.if eax==WM_NCCALCSIZE
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if [eax].DLGHEAD.menuid
mov ebx,lParam
invoke GetSystemMetrics,SM_CYMENU
add [ebx].NCCALCSIZE_PARAMS.rgrc.top,eax
.if !wParam
add [ebx].NCCALCSIZE_PARAMS.rgrc.bottom,eax
.endif
.endif
.elseif eax==WM_CREATE
.if hGridBr
invoke DeleteObject,hGridBr
mov hGridBr,0
.endif
invoke CreateGridBrush,hWin
.elseif eax==WM_NCPAINT
xor eax,eax
mov des.mnurect.left,eax
mov des.mnurect.top,eax
mov des.mnurect.right,eax
mov des.mnurect.bottom,eax
mov rect1.left,eax
mov rect1.top,eax
mov rect1.right,eax
mov rect1.bottom,eax
mov nInx,eax
mov des.nmnu,eax
mov fMnu,eax
mov rect2.left,eax
mov rect2.top,eax
invoke GetWindowLong,hDEd,DEWM_MEMORY
mov ebx,eax
.if [ebx].DLGHEAD.menuid
invoke GetMnuString,addr [ebx].DLGHEAD.menuid,addr buffer
mov [ebx].DLGHEAD.lpmnu,eax
invoke GetWindowDC,hWin
mov hDC,eax
invoke CreateCompatibleDC,hDC
mov mDC,eax
invoke GetWindowLong,hWin,GWL_STYLE
push eax
invoke GetWindowLong,hWin,GWL_EXSTYLE
pop edx
invoke AdjustWindowRectEx,addr rect1,edx,FALSE,eax
invoke GetWindowRect,hWin,addr rect
mov eax,rect.left
sub rect.right,eax
mov rect.left,0
mov eax,rect.top
sub rect.bottom,eax
mov rect.top,0
mov eax,rect1.left
sub rect.left,eax
mov eax,rect1.right
sub rect.right,eax
mov eax,rect1.top
sub rect.top,eax
mov eax,rect1.bottom
sub rect.bottom,eax
invoke GetSystemMetrics,SM_CYMENU
add eax,rect.top
.if eax<rect.bottom
mov rect.bottom,eax
.endif
invoke CopyRect,addr des.mnurect,addr rect
mov eax,rect.right
sub eax,rect.left
mov rect2.right,eax
mov edx,rect.bottom
sub edx,rect.top
mov rect2.bottom,edx
invoke CreateCompatibleBitmap,hDC,eax,edx
invoke SelectObject,mDC,eax
push eax
invoke FillRect,mDC,addr rect2,COLOR_BTNFACE+1
invoke SetBkMode,mDC,TRANSPARENT
invoke SelectObject,mDC,hMnuFont
push eax
mov eax,rect2.left
mov rect2.right,eax
@@:
invoke GetStrItem,addr buffer,addr buffer1
.if buffer1
inc nInx
xor eax,eax
mov rect1.left,eax
mov rect1.top,eax
mov rect1.right,eax
mov rect1.bottom,eax
invoke DrawText,mDC,addr buffer1,-1,addr rect1,DT_SINGLELINE or DT_CALCRECT
mov eax,rect2.right
mov rect2.left,eax
mov eax,rect1.right
add rect2.right,eax
invoke DrawText,mDC,addr buffer1,-1,addr rect2,DT_SINGLELINE
mov eax,des.dlgpt.x
sub eax,des.mnurect.left
mov edx,des.dlgpt.y
sub edx,des.mnurect.top
.if eax>=rect2.left && eax<=rect2.right && edx>=rect2.top && edx<=rect2.bottom
mov eax,nInx
mov des.nmnu,eax
dec rect2.bottom
invoke GetSystemMetrics,SM_SWAPBUTTON
.if eax
mov eax,VK_RBUTTON
.else
mov eax,VK_LBUTTON
.endif
invoke GetAsyncKeyState,eax
and eax,8000h
push eax
.if eax
mov eax,BDR_SUNKENOUTER
.else
mov eax,BDR_RAISEDINNER
.endif
invoke DrawEdge,mDC,addr rect2,eax,BF_RECT
pop edx
mov eax,[ebx].DLGHEAD.lpmnu
.if eax && edx
mov eax,nInx
mov fMnu,eax
invoke GetWindowRect,hWin,addr rect1
mov eax,rect1.left
add eax,rect.left
add eax,rect2.left
mov pt.x,eax
mov eax,rect1.top
add eax,rect.bottom
dec eax
mov pt.y,eax
.endif
inc rect2.bottom
.endif
jmp @b
.endif
mov eax,rect.right
sub eax,rect.left
mov edx,rect.bottom
sub edx,rect.top
invoke BitBlt,hDC,rect.left,rect.top,eax,edx,mDC,0,0,SRCCOPY
pop eax
invoke SelectObject,mDC,eax
pop eax
invoke SelectObject,mDC,eax
invoke DeleteObject,eax
invoke DeleteDC,mDC
invoke ReleaseDC,hWin,hDC
.if fMnu
mov eax,[ebx].DLGHEAD.lpmnu
add eax,sizeof MNUHEAD
invoke CreateSubMenu,eax,fMnu
.if eax
.if des.hmnu
push eax
invoke DestroyMenu,des.hmnu
mov des.hmnu,0
pop eax
.endif
mov des.hmnu,eax
invoke TrackPopupMenu,des.hmnu,TPM_LEFTALIGN or TPM_LEFTBUTTON,pt.x,pt.y,0,hWin,0
.endif
.endif
.endif
.elseif eax==WM_NCMOUSEMOVE
invoke SetWindowPos,hWin,0,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER or SWP_FRAMECHANGED
invoke UpdateWindow,hWin
.elseif eax==WM_EXITMENULOOP
.if des.hmnu
invoke DestroyMenu,des.hmnu
.endif
xor eax,eax
mov des.hmnu,eax
mov des.dlgpt.x,eax
mov des.dlgpt.y,eax
invoke SetWindowPos,hWin,0,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER or SWP_FRAMECHANGED
invoke UpdateWindow,hWin
.elseif eax==WM_ERASEBKGND
.if fGrid
invoke GetClientRect,hWin,addr rect
invoke FillRect,wParam,addr rect,hGridBr
xor eax,eax
ret
.endif
.endif
invoke DefDlgProc,hWin,uMsg,wParam,lParam
ret
MakeDlgClassProc endp
MakeDialog proc uses esi edi ebx,hMem:DWORD,nSelID:DWORD
LOCAL nInx:DWORD
LOCAL hDlg:HWND
LOCAL racol:RACOLOR
LOCAL buffer[MaxCap]:BYTE
;Get convertiion
mov dlgps,10
mov dlgfn,0
invoke CreateDialogIndirectParam,hInstance,offset dlgdata,hDEd,offset TestProc,0
invoke DestroyWindow,eax
mov eax,fntwt
mov dfntwt,eax
mov eax,fntht
mov dfntht,eax
mov esi,hMem
mov eax,[esi].DLGHEAD.fontsize
mov dlgps,ax
invoke ConvFontToUnicode,offset dlgfn,addr [esi].DLGHEAD.font
invoke CreateDialogIndirectParam,hInstance,offset dlgdata,hDEd,offset TestProc,0
invoke DestroyWindow,eax
.if nSelID==-1
push 0
mov ebx,hMultiSel
@@:
invoke GetParent,ebx
invoke GetWindowLong,eax,GWL_ID
push eax
mov ecx,8
.while ecx
push ecx
invoke GetWindowLong,ebx,GWL_USERDATA
mov ebx,eax
pop ecx
dec ecx
.endw
or ebx,ebx
jne @b
.while hMultiSel
invoke DestroyMultiSel,hMultiSel
mov hMultiSel,eax
.endw
.endif
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,128*1024
mov ebx,eax
push eax
mov [ebx].MyDLGTEMPLATEEX.dlgVer,1
mov [ebx].MyDLGTEMPLATEEX.signature,-1
mov [ebx].MyDLGTEMPLATEEX.helpID,0
mov esi,hMem
mov edi,esi
add esi,sizeof DLGHEAD
mov eax,[esi].DIALOG.style
.if byte ptr [edi].DLGHEAD.font
or eax,DS_SETFONT
.endif
or eax,WS_ALWAYS or DS_NOFAILCREATE
and eax,-1 xor (WS_POPUP or WS_DISABLED or WS_MINIMIZE or WS_MAXIMIZE or WS_CLIPCHILDREN or WS_CLIPSIBLINGS)
mov [ebx].MyDLGTEMPLATEEX.style,eax
push eax
mov eax,[esi].DIALOG.exstyle
and eax,0F7FFFh
and eax,-1 xor (WS_EX_LAYERED or WS_EX_TRANSPARENT or WS_EX_MDICHILD)
mov [ebx].MyDLGTEMPLATEEX.exStyle,eax
push esi
mov ecx,-1
.while [esi].DIALOG.hwnd
.if [esi].DIALOG.hwnd!=-1
inc ecx
.endif
add esi,sizeof DIALOG
.endw
pop esi
mov [ebx].MyDLGTEMPLATEEX.cDlgItems,cx
mov [ebx].MyDLGTEMPLATEEX.x,0
mov [ebx].MyDLGTEMPLATEEX.y,0
mov eax,[esi].DIALOG.duccx
mov [ebx].MyDLGTEMPLATEEX.ccx,ax
mov eax,[esi].DIALOG.duccy
mov [ebx].MyDLGTEMPLATEEX.ccy,ax
mov [ebx].MyDLGTEMPLATEEX.menu,0
add ebx,sizeof MyDLGTEMPLATEEX
;Class
invoke SaveWideChar,addr szDlgChildClass,ebx
add ebx,eax
;Caption
invoke ConvertCaption,addr buffer,addr [esi].DIALOG.caption
invoke SaveWideChar,addr buffer,ebx
add ebx,eax
pop eax
test eax,DS_SETFONT
.if !ZERO?
;Fontsize
mov eax,[edi].DLGHEAD.fontsize
mov [ebx],ax
add ebx,2
;Weight
mov word ptr [ebx],0
add ebx,2
;Italics
mov byte ptr [ebx],0
add ebx,1
;Charset
mov byte ptr [ebx],0
add ebx,1
;Facename
invoke SaveWideChar,addr [edi].DLGHEAD.font,ebx
add ebx,eax
.endif
add esi,sizeof DIALOG
mov edi,esi
mov nInx,0
.while [edi].DIALOG.hwnd
inc nInx
add edi,sizeof DIALOG
.endw
.if nInx
@@:
sub edi,sizeof DIALOG
add ebx,2
and ebx,0FFFFFFFCh
.if [edi].DIALOG.hwnd
.if [edi].DIALOG.hwnd!=-1
mov [ebx].MyDLGITEMTEMPLATEEX.helpID,0
mov eax,[edi].DIALOG.style
or eax,WS_ALWAYS
and eax,-1 xor (WS_POPUP or WS_DISABLED or WS_MINIMIZE or WS_MAXIMIZE or WS_CLIPCHILDREN or WS_CLIPSIBLINGS)
.if [edi].DIALOG.ntype==14
or eax,LVS_SHAREIMAGELISTS
.elseif [edi].DIALOG.ntype==16
and eax,(-1 xor UDS_AUTOBUDDY)
.endif
mov [ebx].MyDLGITEMTEMPLATEEX.style,eax
mov eax,[edi].DIALOG.exstyle
and eax,0F7FFFh
and eax,-1 xor (WS_EX_LAYERED or WS_EX_TRANSPARENT or WS_EX_MDICHILD)
mov [ebx].MyDLGITEMTEMPLATEEX.exStyle,eax
mov eax,[edi].DIALOG.dux
mov [ebx].MyDLGITEMTEMPLATEEX.x,ax
mov eax,[edi].DIALOG.duy
mov [ebx].MyDLGITEMTEMPLATEEX.y,ax
mov eax,[edi].DIALOG.duccx
mov [ebx].MyDLGITEMTEMPLATEEX.ccx,ax
mov eax,[edi].DIALOG.duccy
mov [ebx].MyDLGITEMTEMPLATEEX.ccy,ax
mov eax,nInx
mov [ebx].MyDLGITEMTEMPLATEEX.id,eax
add ebx,sizeof MyDLGITEMTEMPLATEEX
;Class
mov eax,[edi].DIALOG.ntype
mov edx,sizeof TYPES
mul edx
add eax,offset ctltypes
invoke SaveWideChar,[eax].TYPES.lpclass,ebx
add ebx,eax
;Caption
invoke ConvertCaption,addr buffer,addr [edi].DIALOG.caption
invoke SaveWideChar,addr buffer,ebx
add ebx,eax
mov word ptr [ebx],0
add ebx,2
.endif
dec nInx
jne @b
.endif
.endif
pop ebx
invoke GetWindowLong,hDEd,DEWM_DIALOG
.if eax
invoke DestroyWindow,eax
.endif
invoke SetWindowLong,hDEd,DEWM_MEMORY,hMem
invoke CreateDialogIndirectParam,hInstance,ebx,hDEd,offset MakeDlgProc,0
mov hDlg,eax
mov des.hdlg,eax
invoke SetWindowLong,hDEd,DEWM_DIALOG,hDlg
invoke GlobalFree,ebx
mov esi,hMem
invoke SetWindowLong,hDlg,GWL_ID,0
invoke SendMessage,hDlg,WM_NCACTIVATE,1,0
.if nSelID==-1
.while TRUE
pop eax
.break .if !eax
invoke GetDlgItem,hDlg,eax
invoke CtlMultiSelect,eax
.endw
.else
.if nSelID
invoke GetDlgItem,hDlg,nSelID
.else
mov eax,hDlg
.endif
invoke SizeingRect,eax,FALSE
.endif
mov esi,hMem
lea esi,[esi+sizeof DLGHEAD+sizeof DIALOG]
xor ebx,ebx
.while [esi].DIALOG.hwnd
inc ebx
.if [esi].DIALOG.hwnd!=-1
invoke GetDlgItem,des.hdlg,ebx
.if eax
invoke SetWindowPos,eax,HWND_BOTTOM,0,0,0,0,SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE
.endif
.endif
add esi,sizeof DIALOG
.endw
invoke SetWindowPos,hInvisible,HWND_TOP,0,0,0,0,SWP_NOACTIVATE or SWP_SHOWWINDOW or SWP_NOMOVE or SWP_NOSIZE
invoke InvalidateRect,hDEd,NULL,TRUE
invoke UpdateWindow,hDEd
mov esi,hMem
.if ![esi].DLGHEAD.hred
invoke CreateWindowEx,200h,addr szRAEditClass,0,WS_CHILD or STYLE_NOSIZEGRIP or STYLE_NOCOLLAPSE,0,0,0,0,hRes,0,hInstance,0
mov [esi].DLGHEAD.hred,eax
invoke SendMessage,[esi].DLGHEAD.hred,WM_SETFONT,hredfont,0
invoke SendMessage,[esi].DLGHEAD.hred,REM_GETCOLOR,0,addr racol
mov eax,color.back
mov racol.bckcol,eax
mov racol.cmntback,eax
mov racol.strback,eax
mov racol.oprback,eax
mov racol.numback,eax
mov eax,color.text
mov racol.txtcol,eax
mov racol.strcol,0
invoke SendMessage,[esi].DLGHEAD.hred,REM_SETCOLOR,0,addr racol
invoke SendMessage,[esi].DLGHEAD.hred,REM_SETWORDGROUP,0,2
invoke UpdateRAEdit,esi
invoke SendMessage,[esi].DLGHEAD.hred,EM_EMPTYUNDOBUFFER,0,0
.else
invoke UpdateRAEdit,esi
.endif
mov eax,hDlg
mov des.hdlg,eax
ret
MakeDialog endp
CreateDlg proc uses esi edi,lpProItemMem:DWORD
invoke CloseDialog
mov esi,lpProItemMem
invoke SetWindowLong,hDEd,DEWM_PROJECT,esi
mov eax,(PROJECT ptr [esi]).hmem
.if !eax
;Create new dlg
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,MaxMem
mov esi,eax
invoke GlobalLock,esi
invoke SetWindowLong,hDEd,DEWM_MEMORY,esi
invoke CreateNewCtl,hDEd,0,DlgX,DlgY,150,100
.else
;Create existing dlg
mov esi,eax
push esi
add esi,sizeof DLGHEAD
.while [esi].DIALOG.hwnd
mov eax,[esi].DIALOG.ntype
invoke GetTypePtr,eax
mov eax,[eax].TYPES.ID
mov [esi].DIALOG.ntypeid,eax
add esi,sizeof DIALOG
.endw
pop esi
invoke MakeDialog,esi,0
.endif
invoke ShowWindow,hDEd,SW_SHOWNA
mov eax,esi
ret
CreateDlg endp
UndoRedo proc uses ebx esi edi,fRedo:DWORD
invoke GetWindowLong,hDEd,DEWM_MEMORY
.if eax
mov ebx,eax
.if [ebx].DLGHEAD.hred
.if fRedo!=-1
mov edx,EM_UNDO
.if fRedo
mov edx,EM_REDO
.endif
invoke SendMessage,[ebx].DLGHEAD.hred,edx,0,0
invoke SendMessage,[ebx].DLGHEAD.hred,EM_SETSEL,0,0
.endif
invoke GetWindowLong,hPrj,0
mov esi,eax
invoke xGlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,256*1024
mov edi,eax
invoke SaveToMem,[ebx].DLGHEAD.hred,edi
.while ebx!=[esi].PROJECT.hmem
add esi,sizeof PROJECT
.endw
mov [esi].PROJECT.hmem,0
push [ebx].DLGHEAD.hred
push [ebx].DLGHEAD.ftextmode
invoke GetWindowLong,hPrj,0
invoke ParseRCMem,edi,eax
.if fParseError
.if [esi].PROJECT.hmem
invoke GlobalUnlock,[esi].PROJECT.hmem
invoke GlobalFree,[esi].PROJECT.hmem
.endif
mov [esi].PROJECT.hmem,ebx
pop eax
pop eax
.else
mov eax,[esi].PROJECT.hmem
pop [eax].DLGHEAD.ftextmode
pop [eax].DLGHEAD.hred
invoke CreateDlg,esi
invoke GlobalUnlock,ebx
invoke GlobalFree,ebx
.endif
invoke GlobalFree,edi
invoke SetChanged,TRUE
mov fClose,0
.endif
.endif
invoke NotifyParent
ret
UndoRedo endp
|
SFX_Heal_Ailment_3_Ch4:
duty 2
pitchenvelope 1, 4
squarenote 4, 15, 2, 1536
squarenote 4, 15, 2, 1536
pitchenvelope 1, 7
squarenote 15, 15, 2, 1536
pitchenvelope 0, 0
endchannel
|
; A165849: Totally multiplicative sequence with a(p) = 28.
; Submitted by Jon Maiga
; 1,28,28,784,28,784,28,21952,784,784,28,21952,28,784,784,614656,28,21952,28,21952,784,784,28,614656,784,784,21952,21952,28,21952,28,17210368,784,784,784,614656,28,784,784,614656,28,21952,28,21952,21952,784,28,17210368,784,21952,784,21952,28,614656,784,614656,784,784,28,614656,28,784,21952,481890304,784,21952,28,21952,784,21952,28,17210368,28,784,21952,21952,784,21952,28,17210368,614656,784,28,614656,784,784,784,614656,28,614656,784,21952,784,784,784,481890304,28,21952,21952,614656
seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)).
mov $2,28
pow $2,$0
mov $0,$2
|
// Copyright (c) 2014-2017 The Dash Core developers
// Copyright (c) 2017-2018 The Criptoreal Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "privatesend-server.h"
#include "activemasternode.h"
#include "consensus/validation.h"
#include "core_io.h"
#include "init.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "script/interpreter.h"
#include "txmempool.h"
#include "util.h"
#include "utilmoneystr.h"
CPrivateSendServer privateSendServer;
void CPrivateSendServer::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv, CConnman& connman)
{
if(!fMasterNode) return;
if(fLiteMode) return; // ignore all Criptoreal related functionality
if(!masternodeSync.IsBlockchainSynced()) return;
if(strCommand == NetMsgType::DSACCEPT) {
if(pfrom->nVersion < MIN_PRIVATESEND_PEER_PROTO_VERSION) {
LogPrintf("DSACCEPT -- incompatible version! nVersion: %d\n", pfrom->nVersion);
PushStatus(pfrom, STATUS_REJECTED, ERR_VERSION, connman);
return;
}
if(IsSessionReady()) {
// too many users in this session already, reject new ones
LogPrintf("DSACCEPT -- queue is already full!\n");
PushStatus(pfrom, STATUS_ACCEPTED, ERR_QUEUE_FULL, connman);
return;
}
int nDenom;
CTransaction txCollateral;
vRecv >> nDenom >> txCollateral;
LogPrint("privatesend", "DSACCEPT -- nDenom %d (%s) txCollateral %s", nDenom, CPrivateSend::GetDenominationsToString(nDenom), txCollateral.ToString());
masternode_info_t mnInfo;
if(!mnodeman.GetMasternodeInfo(activeMasternode.outpoint, mnInfo)) {
PushStatus(pfrom, STATUS_REJECTED, ERR_MN_LIST, connman);
return;
}
if(vecSessionCollaterals.size() == 0 && mnInfo.nLastDsq != 0 &&
mnInfo.nLastDsq + mnodeman.CountEnabled(MIN_PRIVATESEND_PEER_PROTO_VERSION)/5 > mnodeman.nDsqCount)
{
LogPrintf("DSACCEPT -- last dsq too recent, must wait: addr=%s\n", pfrom->addr.ToString());
PushStatus(pfrom, STATUS_REJECTED, ERR_RECENT, connman);
return;
}
PoolMessage nMessageID = MSG_NOERR;
bool fResult = nSessionID == 0 ? CreateNewSession(nDenom, txCollateral, nMessageID, connman)
: AddUserToExistingSession(nDenom, txCollateral, nMessageID);
if(fResult) {
LogPrintf("DSACCEPT -- is compatible, please submit!\n");
PushStatus(pfrom, STATUS_ACCEPTED, nMessageID, connman);
return;
} else {
LogPrintf("DSACCEPT -- not compatible with existing transactions!\n");
PushStatus(pfrom, STATUS_REJECTED, nMessageID, connman);
return;
}
} else if(strCommand == NetMsgType::DSQUEUE) {
TRY_LOCK(cs_darksend, lockRecv);
if(!lockRecv) return;
if(pfrom->nVersion < MIN_PRIVATESEND_PEER_PROTO_VERSION) {
LogPrint("privatesend", "DSQUEUE -- incompatible version! nVersion: %d\n", pfrom->nVersion);
return;
}
CDarksendQueue dsq;
vRecv >> dsq;
// process every dsq only once
BOOST_FOREACH(CDarksendQueue q, vecDarksendQueue) {
if(q == dsq) {
// LogPrint("privatesend", "DSQUEUE -- %s seen\n", dsq.ToString());
return;
}
}
LogPrint("privatesend", "DSQUEUE -- %s new\n", dsq.ToString());
if(dsq.IsExpired()) return;
masternode_info_t mnInfo;
if(!mnodeman.GetMasternodeInfo(dsq.vin.prevout, mnInfo)) return;
if(!dsq.CheckSignature(mnInfo.pubKeyMasternode)) {
// we probably have outdated info
mnodeman.AskForMN(pfrom, dsq.vin.prevout, connman);
return;
}
if(!dsq.fReady) {
BOOST_FOREACH(CDarksendQueue q, vecDarksendQueue) {
if(q.vin == dsq.vin) {
// no way same mn can send another "not yet ready" dsq this soon
LogPrint("privatesend", "DSQUEUE -- Masternode %s is sending WAY too many dsq messages\n", mnInfo.addr.ToString());
return;
}
}
int nThreshold = mnInfo.nLastDsq + mnodeman.CountEnabled(MIN_PRIVATESEND_PEER_PROTO_VERSION)/5;
LogPrint("privatesend", "DSQUEUE -- nLastDsq: %d threshold: %d nDsqCount: %d\n", mnInfo.nLastDsq, nThreshold, mnodeman.nDsqCount);
//don't allow a few nodes to dominate the queuing process
if(mnInfo.nLastDsq != 0 && nThreshold > mnodeman.nDsqCount) {
LogPrint("privatesend", "DSQUEUE -- Masternode %s is sending too many dsq messages\n", mnInfo.addr.ToString());
return;
}
mnodeman.AllowMixing(dsq.vin.prevout);
LogPrint("privatesend", "DSQUEUE -- new PrivateSend queue (%s) from masternode %s\n", dsq.ToString(), mnInfo.addr.ToString());
vecDarksendQueue.push_back(dsq);
dsq.Relay(connman);
}
} else if(strCommand == NetMsgType::DSVIN) {
if(pfrom->nVersion < MIN_PRIVATESEND_PEER_PROTO_VERSION) {
LogPrintf("DSVIN -- incompatible version! nVersion: %d\n", pfrom->nVersion);
PushStatus(pfrom, STATUS_REJECTED, ERR_VERSION, connman);
return;
}
//do we have enough users in the current session?
if(!IsSessionReady()) {
LogPrintf("DSVIN -- session not complete!\n");
PushStatus(pfrom, STATUS_REJECTED, ERR_SESSION, connman);
return;
}
CDarkSendEntry entry;
vRecv >> entry;
LogPrint("privatesend", "DSVIN -- txCollateral %s", entry.txCollateral.ToString());
if(entry.vecTxDSIn.size() > PRIVATESEND_ENTRY_MAX_SIZE) {
LogPrintf("DSVIN -- ERROR: too many inputs! %d/%d\n", entry.vecTxDSIn.size(), PRIVATESEND_ENTRY_MAX_SIZE);
PushStatus(pfrom, STATUS_REJECTED, ERR_MAXIMUM, connman);
return;
}
if(entry.vecTxOut.size() > PRIVATESEND_ENTRY_MAX_SIZE) {
LogPrintf("DSVIN -- ERROR: too many outputs! %d/%d\n", entry.vecTxOut.size(), PRIVATESEND_ENTRY_MAX_SIZE);
PushStatus(pfrom, STATUS_REJECTED, ERR_MAXIMUM, connman);
return;
}
//do we have the same denominations as the current session?
if(!IsOutputsCompatibleWithSessionDenom(entry.vecTxOut)) {
LogPrintf("DSVIN -- not compatible with existing transactions!\n");
PushStatus(pfrom, STATUS_REJECTED, ERR_EXISTING_TX, connman);
return;
}
//check it like a transaction
{
CAmount nValueIn = 0;
CAmount nValueOut = 0;
CMutableTransaction tx;
for (const auto& txout : entry.vecTxOut) {
nValueOut += txout.nValue;
tx.vout.push_back(txout);
if(txout.scriptPubKey.size() != 25) {
LogPrintf("DSVIN -- non-standard pubkey detected! scriptPubKey=%s\n", ScriptToAsmStr(txout.scriptPubKey));
PushStatus(pfrom, STATUS_REJECTED, ERR_NON_STANDARD_PUBKEY, connman);
return;
}
if(!txout.scriptPubKey.IsPayToPublicKeyHash()) {
LogPrintf("DSVIN -- invalid script! scriptPubKey=%s\n", ScriptToAsmStr(txout.scriptPubKey));
PushStatus(pfrom, STATUS_REJECTED, ERR_INVALID_SCRIPT, connman);
return;
}
}
BOOST_FOREACH(const CTxIn txin, entry.vecTxDSIn) {
tx.vin.push_back(txin);
LogPrint("privatesend", "DSVIN -- txin=%s\n", txin.ToString());
Coin coin;
if(GetUTXOCoin(txin.prevout, coin)) {
nValueIn += coin.out.nValue;
} else {
LogPrintf("DSVIN -- missing input! tx=%s", tx.ToString());
PushStatus(pfrom, STATUS_REJECTED, ERR_MISSING_TX, connman);
return;
}
}
// There should be no fee in mixing tx
CAmount nFee = nValueIn - nValueOut;
if(nFee != 0) {
LogPrintf("DSVIN -- there should be no fee in mixing tx! fees: %lld, tx=%s", nFee, tx.ToString());
PushStatus(pfrom, STATUS_REJECTED, ERR_FEES, connman);
return;
}
{
LOCK(cs_main);
CValidationState validationState;
mempool.PrioritiseTransaction(tx.GetHash(), tx.GetHash().ToString(), 1000, 0.1*COIN);
if(!AcceptToMemoryPool(mempool, validationState, CTransaction(tx), false, NULL, false, true, true)) {
LogPrintf("DSVIN -- transaction not valid! tx=%s", tx.ToString());
PushStatus(pfrom, STATUS_REJECTED, ERR_INVALID_TX, connman);
return;
}
}
}
PoolMessage nMessageID = MSG_NOERR;
entry.addr = pfrom->addr;
if(AddEntry(entry, nMessageID)) {
PushStatus(pfrom, STATUS_ACCEPTED, nMessageID, connman);
CheckPool(connman);
RelayStatus(STATUS_ACCEPTED, connman);
} else {
PushStatus(pfrom, STATUS_REJECTED, nMessageID, connman);
SetNull();
}
} else if(strCommand == NetMsgType::DSSIGNFINALTX) {
if(pfrom->nVersion < MIN_PRIVATESEND_PEER_PROTO_VERSION) {
LogPrintf("DSSIGNFINALTX -- incompatible version! nVersion: %d\n", pfrom->nVersion);
return;
}
std::vector<CTxIn> vecTxIn;
vRecv >> vecTxIn;
LogPrint("privatesend", "DSSIGNFINALTX -- vecTxIn.size() %s\n", vecTxIn.size());
int nTxInIndex = 0;
int nTxInsCount = (int)vecTxIn.size();
BOOST_FOREACH(const CTxIn txin, vecTxIn) {
nTxInIndex++;
if(!AddScriptSig(txin)) {
LogPrint("privatesend", "DSSIGNFINALTX -- AddScriptSig() failed at %d/%d, session: %d\n", nTxInIndex, nTxInsCount, nSessionID);
RelayStatus(STATUS_REJECTED, connman);
return;
}
LogPrint("privatesend", "DSSIGNFINALTX -- AddScriptSig() %d/%d success\n", nTxInIndex, nTxInsCount);
}
// all is good
CheckPool(connman);
}
}
void CPrivateSendServer::SetNull()
{
// MN side
vecSessionCollaterals.clear();
CPrivateSendBase::SetNull();
}
//
// Check the mixing progress and send client updates if a Masternode
//
void CPrivateSendServer::CheckPool(CConnman& connman)
{
if(fMasterNode) {
LogPrint("privatesend", "CPrivateSendServer::CheckPool -- entries count %lu\n", GetEntriesCount());
// If entries are full, create finalized transaction
if(nState == POOL_STATE_ACCEPTING_ENTRIES && GetEntriesCount() >= CPrivateSend::GetMaxPoolTransactions()) {
LogPrint("privatesend", "CPrivateSendServer::CheckPool -- FINALIZE TRANSACTIONS\n");
CreateFinalTransaction(connman);
return;
}
// If we have all of the signatures, try to compile the transaction
if(nState == POOL_STATE_SIGNING && IsSignaturesComplete()) {
LogPrint("privatesend", "CPrivateSendServer::CheckPool -- SIGNING\n");
CommitFinalTransaction(connman);
return;
}
}
// reset if we're here for 10 seconds
if((nState == POOL_STATE_ERROR || nState == POOL_STATE_SUCCESS) && GetTimeMillis() - nTimeLastSuccessfulStep >= 10000) {
LogPrint("privatesend", "CPrivateSendServer::CheckPool -- timeout, RESETTING\n");
SetNull();
}
}
void CPrivateSendServer::CreateFinalTransaction(CConnman& connman)
{
LogPrint("privatesend", "CPrivateSendServer::CreateFinalTransaction -- FINALIZE TRANSACTIONS\n");
CMutableTransaction txNew;
// make our new transaction
for(int i = 0; i < GetEntriesCount(); i++) {
for (const auto& txout : vecEntries[i].vecTxOut)
txNew.vout.push_back(txout);
BOOST_FOREACH(const CTxDSIn& txdsin, vecEntries[i].vecTxDSIn)
txNew.vin.push_back(txdsin);
}
sort(txNew.vin.begin(), txNew.vin.end(), CompareInputBIP69());
sort(txNew.vout.begin(), txNew.vout.end(), CompareOutputBIP69());
finalMutableTransaction = txNew;
LogPrint("privatesend", "CPrivateSendServer::CreateFinalTransaction -- finalMutableTransaction=%s", txNew.ToString());
// request signatures from clients
RelayFinalTransaction(finalMutableTransaction, connman);
SetState(POOL_STATE_SIGNING);
}
void CPrivateSendServer::CommitFinalTransaction(CConnman& connman)
{
if(!fMasterNode) return; // check and relay final tx only on masternode
CTransaction finalTransaction = CTransaction(finalMutableTransaction);
uint256 hashTx = finalTransaction.GetHash();
LogPrint("privatesend", "CPrivateSendServer::CommitFinalTransaction -- finalTransaction=%s", finalTransaction.ToString());
{
// See if the transaction is valid
TRY_LOCK(cs_main, lockMain);
CValidationState validationState;
mempool.PrioritiseTransaction(hashTx, hashTx.ToString(), 1000, 0.1*COIN);
if(!lockMain || !AcceptToMemoryPool(mempool, validationState, finalTransaction, false, NULL, false, true, true))
{
LogPrintf("CPrivateSendServer::CommitFinalTransaction -- AcceptToMemoryPool() error: Transaction not valid\n");
SetNull();
// not much we can do in this case, just notify clients
RelayCompletedTransaction(ERR_INVALID_TX, connman);
return;
}
}
LogPrintf("CPrivateSendServer::CommitFinalTransaction -- CREATING DSTX\n");
// create and sign masternode dstx transaction
if(!CPrivateSend::GetDSTX(hashTx)) {
CDarksendBroadcastTx dstxNew(finalTransaction, activeMasternode.outpoint, GetAdjustedTime());
dstxNew.Sign();
CPrivateSend::AddDSTX(dstxNew);
}
LogPrintf("CPrivateSendServer::CommitFinalTransaction -- TRANSMITTING DSTX\n");
CInv inv(MSG_DSTX, hashTx);
connman.RelayInv(inv);
// Tell the clients it was successful
RelayCompletedTransaction(MSG_SUCCESS, connman);
// Randomly charge clients
ChargeRandomFees(connman);
// Reset
LogPrint("privatesend", "CPrivateSendServer::CommitFinalTransaction -- COMPLETED -- RESETTING\n");
SetNull();
}
//
// Charge clients a fee if they're abusive
//
// Why bother? PrivateSend uses collateral to ensure abuse to the process is kept to a minimum.
// The submission and signing stages are completely separate. In the cases where
// a client submits a transaction then refused to sign, there must be a cost. Otherwise they
// would be able to do this over and over again and bring the mixing to a hault.
//
// How does this work? Messages to Masternodes come in via NetMsgType::DSVIN, these require a valid collateral
// transaction for the client to be able to enter the pool. This transaction is kept by the Masternode
// until the transaction is either complete or fails.
//
void CPrivateSendServer::ChargeFees(CConnman& connman)
{
if(!fMasterNode) return;
//we don't need to charge collateral for every offence.
if(GetRandInt(100) > 33) return;
std::vector<CTransaction> vecOffendersCollaterals;
if(nState == POOL_STATE_ACCEPTING_ENTRIES) {
BOOST_FOREACH(const CTransaction& txCollateral, vecSessionCollaterals) {
bool fFound = false;
BOOST_FOREACH(const CDarkSendEntry& entry, vecEntries)
if(entry.txCollateral == txCollateral)
fFound = true;
// This queue entry didn't send us the promised transaction
if(!fFound) {
LogPrintf("CPrivateSendServer::ChargeFees -- found uncooperative node (didn't send transaction), found offence\n");
vecOffendersCollaterals.push_back(txCollateral);
}
}
}
if(nState == POOL_STATE_SIGNING) {
// who didn't sign?
BOOST_FOREACH(const CDarkSendEntry entry, vecEntries) {
BOOST_FOREACH(const CTxDSIn txdsin, entry.vecTxDSIn) {
if(!txdsin.fHasSig) {
LogPrintf("CPrivateSendServer::ChargeFees -- found uncooperative node (didn't sign), found offence\n");
vecOffendersCollaterals.push_back(entry.txCollateral);
}
}
}
}
// no offences found
if(vecOffendersCollaterals.empty()) return;
//mostly offending? Charge sometimes
if((int)vecOffendersCollaterals.size() >= Params().PoolMaxTransactions() - 1 && GetRandInt(100) > 33) return;
//everyone is an offender? That's not right
if((int)vecOffendersCollaterals.size() >= Params().PoolMaxTransactions()) return;
//charge one of the offenders randomly
std::random_shuffle(vecOffendersCollaterals.begin(), vecOffendersCollaterals.end());
if(nState == POOL_STATE_ACCEPTING_ENTRIES || nState == POOL_STATE_SIGNING) {
LogPrintf("CPrivateSendServer::ChargeFees -- found uncooperative node (didn't %s transaction), charging fees: %s\n",
(nState == POOL_STATE_SIGNING) ? "sign" : "send", vecOffendersCollaterals[0].ToString());
LOCK(cs_main);
CValidationState state;
bool fMissingInputs;
if(!AcceptToMemoryPool(mempool, state, vecOffendersCollaterals[0], false, &fMissingInputs, false, true)) {
// should never really happen
LogPrintf("CPrivateSendServer::ChargeFees -- ERROR: AcceptToMemoryPool failed!\n");
} else {
connman.RelayTransaction(vecOffendersCollaterals[0]);
}
}
}
/*
Charge the collateral randomly.
Mixing is completely free, to pay miners we randomly pay the collateral of users.
Collateral Fee Charges:
Being that mixing has "no fees" we need to have some kind of cost associated
with using it to stop abuse. Otherwise it could serve as an attack vector and
allow endless transaction that would bloat Criptoreal and make it unusable. To
stop these kinds of attacks 1 in 10 successful transactions are charged. This
adds up to a cost of 0.001DRK per transaction on average.
*/
void CPrivateSendServer::ChargeRandomFees(CConnman& connman)
{
if(!fMasterNode) return;
LOCK(cs_main);
BOOST_FOREACH(const CTransaction& txCollateral, vecSessionCollaterals) {
if(GetRandInt(100) > 10) return;
LogPrintf("CPrivateSendServer::ChargeRandomFees -- charging random fees, txCollateral=%s", txCollateral.ToString());
CValidationState state;
bool fMissingInputs;
if(!AcceptToMemoryPool(mempool, state, txCollateral, false, &fMissingInputs, false, true)) {
// should never really happen
LogPrintf("CPrivateSendServer::ChargeRandomFees -- ERROR: AcceptToMemoryPool failed!\n");
} else {
connman.RelayTransaction(txCollateral);
}
}
}
//
// Check for various timeouts (queue objects, mixing, etc)
//
void CPrivateSendServer::CheckTimeout(CConnman& connman)
{
CheckQueue();
if(!fMasterNode) return;
int nLagTime = fMasterNode ? 0 : 10000; // if we're the client, give the server a few extra seconds before resetting.
int nTimeout = (nState == POOL_STATE_SIGNING) ? PRIVATESEND_SIGNING_TIMEOUT : PRIVATESEND_QUEUE_TIMEOUT;
bool fTimeout = GetTimeMillis() - nTimeLastSuccessfulStep >= nTimeout*1000 + nLagTime;
if(nState != POOL_STATE_IDLE && fTimeout) {
LogPrint("privatesend", "CPrivateSendServer::CheckTimeout -- %s timed out (%ds) -- restting\n",
(nState == POOL_STATE_SIGNING) ? "Signing" : "Session", nTimeout);
ChargeFees(connman);
SetNull();
SetState(POOL_STATE_ERROR);
}
}
/*
Check to see if we're ready for submissions from clients
After receiving multiple dsa messages, the queue will switch to "accepting entries"
which is the active state right before merging the transaction
*/
void CPrivateSendServer::CheckForCompleteQueue(CConnman& connman)
{
if(!fMasterNode) return;
if(nState == POOL_STATE_QUEUE && IsSessionReady()) {
SetState(POOL_STATE_ACCEPTING_ENTRIES);
CDarksendQueue dsq(nSessionDenom, activeMasternode.outpoint, GetAdjustedTime(), true);
LogPrint("privatesend", "CPrivateSendServer::CheckForCompleteQueue -- queue is ready, signing and relaying (%s)\n", dsq.ToString());
dsq.Sign();
dsq.Relay(connman);
}
}
// Check to make sure a given input matches an input in the pool and its scriptSig is valid
bool CPrivateSendServer::IsInputScriptSigValid(const CTxIn& txin)
{
CMutableTransaction txNew;
txNew.vin.clear();
txNew.vout.clear();
int i = 0;
int nTxInIndex = -1;
CScript sigPubKey = CScript();
BOOST_FOREACH(CDarkSendEntry& entry, vecEntries) {
for (const auto& txout : entry.vecTxOut)
txNew.vout.push_back(txout);
BOOST_FOREACH(const CTxDSIn& txdsin, entry.vecTxDSIn) {
txNew.vin.push_back(txdsin);
if(txdsin.prevout == txin.prevout) {
nTxInIndex = i;
sigPubKey = txdsin.prevPubKey;
}
i++;
}
}
if(nTxInIndex >= 0) { //might have to do this one input at a time?
txNew.vin[nTxInIndex].scriptSig = txin.scriptSig;
LogPrint("privatesend", "CPrivateSendServer::IsInputScriptSigValid -- verifying scriptSig %s\n", ScriptToAsmStr(txin.scriptSig).substr(0,24));
if(!VerifyScript(txNew.vin[nTxInIndex].scriptSig, sigPubKey, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, MutableTransactionSignatureChecker(&txNew, nTxInIndex))) {
LogPrint("privatesend", "CPrivateSendServer::IsInputScriptSigValid -- VerifyScript() failed on input %d\n", nTxInIndex);
return false;
}
} else {
LogPrint("privatesend", "CPrivateSendServer::IsInputScriptSigValid -- Failed to find matching input in pool, %s\n", txin.ToString());
return false;
}
LogPrint("privatesend", "CPrivateSendServer::IsInputScriptSigValid -- Successfully validated input and scriptSig\n");
return true;
}
//
// Add a clients transaction to the pool
//
bool CPrivateSendServer::AddEntry(const CDarkSendEntry& entryNew, PoolMessage& nMessageIDRet)
{
if(!fMasterNode) return false;
BOOST_FOREACH(CTxIn txin, entryNew.vecTxDSIn) {
if(txin.prevout.IsNull()) {
LogPrint("privatesend", "CPrivateSendServer::AddEntry -- input not valid!\n");
nMessageIDRet = ERR_INVALID_INPUT;
return false;
}
}
if(!CPrivateSend::IsCollateralValid(entryNew.txCollateral)) {
LogPrint("privatesend", "CPrivateSendServer::AddEntry -- collateral not valid!\n");
nMessageIDRet = ERR_INVALID_COLLATERAL;
return false;
}
if(GetEntriesCount() >= CPrivateSend::GetMaxPoolTransactions()) {
LogPrint("privatesend", "CPrivateSendServer::AddEntry -- entries is full!\n");
nMessageIDRet = ERR_ENTRIES_FULL;
return false;
}
BOOST_FOREACH(CTxIn txin, entryNew.vecTxDSIn) {
LogPrint("privatesend", "looking for txin -- %s\n", txin.ToString());
BOOST_FOREACH(const CDarkSendEntry& entry, vecEntries) {
BOOST_FOREACH(const CTxDSIn& txdsin, entry.vecTxDSIn) {
if(txdsin.prevout == txin.prevout) {
LogPrint("privatesend", "CPrivateSendServer::AddEntry -- found in txin\n");
nMessageIDRet = ERR_ALREADY_HAVE;
return false;
}
}
}
}
vecEntries.push_back(entryNew);
LogPrint("privatesend", "CPrivateSendServer::AddEntry -- adding entry\n");
nMessageIDRet = MSG_ENTRIES_ADDED;
nTimeLastSuccessfulStep = GetTimeMillis();
return true;
}
bool CPrivateSendServer::AddScriptSig(const CTxIn& txinNew)
{
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- scriptSig=%s\n", ScriptToAsmStr(txinNew.scriptSig).substr(0,24));
BOOST_FOREACH(const CDarkSendEntry& entry, vecEntries) {
BOOST_FOREACH(const CTxDSIn& txdsin, entry.vecTxDSIn) {
if(txdsin.scriptSig == txinNew.scriptSig) {
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- already exists\n");
return false;
}
}
}
if(!IsInputScriptSigValid(txinNew)) {
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- Invalid scriptSig\n");
return false;
}
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- scriptSig=%s new\n", ScriptToAsmStr(txinNew.scriptSig).substr(0,24));
BOOST_FOREACH(CTxIn& txin, finalMutableTransaction.vin) {
if(txinNew.prevout == txin.prevout && txin.nSequence == txinNew.nSequence) {
txin.scriptSig = txinNew.scriptSig;
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- adding to finalMutableTransaction, scriptSig=%s\n", ScriptToAsmStr(txinNew.scriptSig).substr(0,24));
}
}
for(int i = 0; i < GetEntriesCount(); i++) {
if(vecEntries[i].AddScriptSig(txinNew)) {
LogPrint("privatesend", "CPrivateSendServer::AddScriptSig -- adding to entries, scriptSig=%s\n", ScriptToAsmStr(txinNew.scriptSig).substr(0,24));
return true;
}
}
LogPrintf("CPrivateSendServer::AddScriptSig -- Couldn't set sig!\n" );
return false;
}
// Check to make sure everything is signed
bool CPrivateSendServer::IsSignaturesComplete()
{
BOOST_FOREACH(const CDarkSendEntry& entry, vecEntries)
BOOST_FOREACH(const CTxDSIn& txdsin, entry.vecTxDSIn)
if(!txdsin.fHasSig) return false;
return true;
}
bool CPrivateSendServer::IsOutputsCompatibleWithSessionDenom(const std::vector<CTxOut>& vecTxOut)
{
if(CPrivateSend::GetDenominations(vecTxOut) == 0) return false;
BOOST_FOREACH(const CDarkSendEntry entry, vecEntries) {
LogPrintf("CPrivateSendServer::IsOutputsCompatibleWithSessionDenom -- vecTxOut denom %d, entry.vecTxOut denom %d\n",
CPrivateSend::GetDenominations(vecTxOut), CPrivateSend::GetDenominations(entry.vecTxOut));
if(CPrivateSend::GetDenominations(vecTxOut) != CPrivateSend::GetDenominations(entry.vecTxOut)) return false;
}
return true;
}
bool CPrivateSendServer::IsAcceptableDenomAndCollateral(int nDenom, CTransaction txCollateral, PoolMessage& nMessageIDRet)
{
if(!fMasterNode) return false;
// is denom even smth legit?
std::vector<int> vecBits;
if(!CPrivateSend::GetDenominationsBits(nDenom, vecBits)) {
LogPrint("privatesend", "CPrivateSendServer::IsAcceptableDenomAndCollateral -- denom not valid!\n");
nMessageIDRet = ERR_DENOM;
return false;
}
// check collateral
if(!fUnitTest && !CPrivateSend::IsCollateralValid(txCollateral)) {
LogPrint("privatesend", "CPrivateSendServer::IsAcceptableDenomAndCollateral -- collateral not valid!\n");
nMessageIDRet = ERR_INVALID_COLLATERAL;
return false;
}
return true;
}
bool CPrivateSendServer::CreateNewSession(int nDenom, CTransaction txCollateral, PoolMessage& nMessageIDRet, CConnman& connman)
{
if(!fMasterNode || nSessionID != 0) return false;
// new session can only be started in idle mode
if(nState != POOL_STATE_IDLE) {
nMessageIDRet = ERR_MODE;
LogPrintf("CPrivateSendServer::CreateNewSession -- incompatible mode: nState=%d\n", nState);
return false;
}
if(!IsAcceptableDenomAndCollateral(nDenom, txCollateral, nMessageIDRet)) {
return false;
}
// start new session
nMessageIDRet = MSG_NOERR;
nSessionID = GetRandInt(999999)+1;
nSessionDenom = nDenom;
SetState(POOL_STATE_QUEUE);
nTimeLastSuccessfulStep = GetTimeMillis();
if(!fUnitTest) {
//broadcast that I'm accepting entries, only if it's the first entry through
CDarksendQueue dsq(nDenom, activeMasternode.outpoint, GetAdjustedTime(), false);
LogPrint("privatesend", "CPrivateSendServer::CreateNewSession -- signing and relaying new queue: %s\n", dsq.ToString());
dsq.Sign();
dsq.Relay(connman);
vecDarksendQueue.push_back(dsq);
}
vecSessionCollaterals.push_back(txCollateral);
LogPrintf("CPrivateSendServer::CreateNewSession -- new session created, nSessionID: %d nSessionDenom: %d (%s) vecSessionCollaterals.size(): %d\n",
nSessionID, nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom), vecSessionCollaterals.size());
return true;
}
bool CPrivateSendServer::AddUserToExistingSession(int nDenom, CTransaction txCollateral, PoolMessage& nMessageIDRet)
{
if(!fMasterNode || nSessionID == 0 || IsSessionReady()) return false;
if(!IsAcceptableDenomAndCollateral(nDenom, txCollateral, nMessageIDRet)) {
return false;
}
// we only add new users to an existing session when we are in queue mode
if(nState != POOL_STATE_QUEUE) {
nMessageIDRet = ERR_MODE;
LogPrintf("CPrivateSendServer::AddUserToExistingSession -- incompatible mode: nState=%d\n", nState);
return false;
}
if(nDenom != nSessionDenom) {
LogPrintf("CPrivateSendServer::AddUserToExistingSession -- incompatible denom %d (%s) != nSessionDenom %d (%s)\n",
nDenom, CPrivateSend::GetDenominationsToString(nDenom), nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom));
nMessageIDRet = ERR_DENOM;
return false;
}
// count new user as accepted to an existing session
nMessageIDRet = MSG_NOERR;
nTimeLastSuccessfulStep = GetTimeMillis();
vecSessionCollaterals.push_back(txCollateral);
LogPrintf("CPrivateSendServer::AddUserToExistingSession -- new user accepted, nSessionID: %d nSessionDenom: %d (%s) vecSessionCollaterals.size(): %d\n",
nSessionID, nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom), vecSessionCollaterals.size());
return true;
}
void CPrivateSendServer::RelayFinalTransaction(const CTransaction& txFinal, CConnman& connman)
{
LogPrint("privatesend", "CPrivateSendServer::%s -- nSessionID: %d nSessionDenom: %d (%s)\n",
__func__, nSessionID, nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom));
// final mixing tx with empty signatures should be relayed to mixing participants only
for (const auto entry : vecEntries) {
bool fOk = connman.ForNode(entry.addr, [&txFinal, &connman, this](CNode* pnode) {
connman.PushMessage(pnode, NetMsgType::DSFINALTX, nSessionID, txFinal);
return true;
});
if(!fOk) {
// no such node? maybe this client disconnected or our own connection went down
RelayStatus(STATUS_REJECTED, connman);
break;
}
}
}
void CPrivateSendServer::PushStatus(CNode* pnode, PoolStatusUpdate nStatusUpdate, PoolMessage nMessageID, CConnman& connman)
{
if(!pnode) return;
connman.PushMessage(pnode, NetMsgType::DSSTATUSUPDATE, nSessionID, (int)nState, (int)vecEntries.size(), (int)nStatusUpdate, (int)nMessageID);
}
void CPrivateSendServer::RelayStatus(PoolStatusUpdate nStatusUpdate, CConnman& connman, PoolMessage nMessageID)
{
unsigned int nDisconnected{};
// status updates should be relayed to mixing participants only
for (const auto entry : vecEntries) {
// make sure everyone is still connected
bool fOk = connman.ForNode(entry.addr, [&nStatusUpdate, &nMessageID, &connman, this](CNode* pnode) {
PushStatus(pnode, nStatusUpdate, nMessageID, connman);
return true;
});
if(!fOk) {
// no such node? maybe this client disconnected or our own connection went down
++nDisconnected;
}
}
if (nDisconnected == 0) return; // all is clear
// smth went wrong
LogPrintf("CPrivateSendServer::%s -- can't continue, %llu client(s) disconnected, nSessionID: %d nSessionDenom: %d (%s)\n",
__func__, nDisconnected, nSessionID, nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom));
// notify everyone else that this session should be terminated
for (const auto entry : vecEntries) {
connman.ForNode(entry.addr, [&connman, this](CNode* pnode) {
PushStatus(pnode, STATUS_REJECTED, MSG_NOERR, connman);
return true;
});
}
if(nDisconnected == vecEntries.size()) {
// all clients disconnected, there is probably some issues with our own connection
// do not charge any fees, just reset the pool
SetNull();
}
}
void CPrivateSendServer::RelayCompletedTransaction(PoolMessage nMessageID, CConnman& connman)
{
LogPrint("privatesend", "CPrivateSendServer::%s -- nSessionID: %d nSessionDenom: %d (%s)\n",
__func__, nSessionID, nSessionDenom, CPrivateSend::GetDenominationsToString(nSessionDenom));
// final mixing tx with empty signatures should be relayed to mixing participants only
for (const auto entry : vecEntries) {
bool fOk = connman.ForNode(entry.addr, [&nMessageID, &connman, this](CNode* pnode) {
connman.PushMessage(pnode, NetMsgType::DSCOMPLETE, nSessionID, (int)nMessageID);
return true;
});
if(!fOk) {
// no such node? maybe client disconnected or our own connection went down
RelayStatus(STATUS_REJECTED, connman);
break;
}
}
}
void CPrivateSendServer::SetState(PoolState nStateNew)
{
if(fMasterNode && (nStateNew == POOL_STATE_ERROR || nStateNew == POOL_STATE_SUCCESS)) {
LogPrint("privatesend", "CPrivateSendServer::SetState -- Can't set state to ERROR or SUCCESS as a Masternode. \n");
return;
}
LogPrintf("CPrivateSendServer::SetState -- nState: %d, nStateNew: %d\n", nState, nStateNew);
nState = nStateNew;
}
//TODO: Rename/move to core
void ThreadCheckPrivateSendServer(CConnman& connman)
{
if(fLiteMode) return; // disable all Criptoreal specific functionality
static bool fOneThread;
if(fOneThread) return;
fOneThread = true;
// Make this thread recognisable as the PrivateSend thread
RenameThread("criptoreal-ps-server");
unsigned int nTick = 0;
while (true)
{
MilliSleep(1000);
if(masternodeSync.IsBlockchainSynced() && !ShutdownRequested()) {
nTick++;
privateSendServer.CheckTimeout(connman);
privateSendServer.CheckForCompleteQueue(connman);
}
}
}
|
; A326124: a(n) is the sum of all divisors of the first n positive even numbers.
; 3,10,22,37,55,83,107,138,177,219,255,315,357,413,485,548,602,693,753,843,939,1023,1095,1219,1312,1410,1530,1650,1740,1908,2004,2131,2275,2401,2545,2740,2854,2994,3162,3348,3474,3698,3830,4010,4244,4412,4556,4808,4979,5196,5412,5622,5784,6064,6280,6528,6768,6978,7158,7518,7704,7928,8240,8495,8747,9083,9287,9557,9845,10181,10397,10800,11022,11288,11660,11960,12248,12640,12880,13258,13621,13915,14167,14647,14971,15279,15639,16011,16281,16827,17163,17523,17907,18243,18603,19111,19405,19804,20272,20737,21043,21547,21859,22293,22869,23247,23571,24171,24501,25005,25461,25965,26307,26867,27299,27749,28295,28715,29147,29891,30290,30724,31228,31708,32176,32904,33288,33799,34327,34915,35311,36031,36511,36987,37707,38265,38679,39351,39771,40491,41067,41571,42075,42894,43434,43952,44636,45206,45656,46524,46980,47600,48302,48974,49550,50390,50864,51424,52072,52834,53410,54257,54749,55379,56243,56831,57335,58327,58876,59632,60412,61072,61594,62434,63178,63934,64654,65284,65824,66994,67540,68324,69068,69812,70496,71392,72040,72760,73720,74560,75136,76156,76738,77424,78432,79287,79881,80973,81573,82534,83350,84064,84784,85864,86620,87348,88284,89166,89886,91230,91866,92676,93540,94296,95088,96328,97096,97866,98754,99834,100590,101654,102326,103342,104551,105349,106033,107233,107923,108931,110083,111013,111715,112989,113853,114753,115713,116721,117441,118953,119679,120610,121702,122632,123658,124834,125674,126666,127674,128766
mov $2,$0
add $2,1
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
add $3,1
mul $3,2
cal $3,39653 ; a(0) = 0; for n > 0, a(n) = sigma(n)-1.
add $3,1
add $1,$3
lpe
|
INCLUDE "graphics/grafix.inc"
SECTION code_graphics
PUBLIC gety
PUBLIC _gety
EXTERN __gfx_coords
;
; $Id: w_gety.asm $
;
; ******************************************************************
;
; Get the current X coordinate of the graphics cursor.
;
;
.gety
._gety
ld hl,(__gfx_coords+2)
ret
|
;*******************************************************************************
;* TMS320C55x C/C++ Codegen PC v4.4.1 *
;* Date/Time created: Sat Oct 06 06:37:41 2018 *
;*******************************************************************************
.compiler_opts --hll_source=on --mem_model:code=flat --mem_model:data=large --object_format=coff --silicon_core_3_3 --symdebug:dwarf
.mmregs
.cpl_on
.arms_on
.c54cm_off
.asg AR6, FP
.asg XAR6, XFP
.asg DPH, MDP
.model call=c55_std
.model mem=large
.noremark 5002 ; code respects overwrite rules
;*******************************************************************************
;* GLOBAL FILE PARAMETERS *
;* *
;* Architecture : TMS320C55x *
;* Optimizing for : Speed *
;* Memory : Large Model (23-Bit Data Pointers) *
;* Calls : Normal Library ASM calls *
;* Debug Info : Standard TI Debug Information *
;*******************************************************************************
$C$DW$CU .dwtag DW_TAG_compile_unit
.dwattr $C$DW$CU, DW_AT_name("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$CU, DW_AT_producer("TMS320C55x C/C++ Codegen PC v4.4.1 Copyright (c) 1996-2012 Texas Instruments Incorporated")
.dwattr $C$DW$CU, DW_AT_TI_version(0x01)
.dwattr $C$DW$CU, DW_AT_comp_dir("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug")
; F:\t\cc5p5\ccsv5\tools\compiler\c5500_4.4.1\bin\acp55.exe -@f:\\AppData\\Local\\Temp\\1766412
.sect ".text"
.align 4
.global _MEM_init
$C$DW$1 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_init")
.dwattr $C$DW$1, DW_AT_low_pc(_MEM_init)
.dwattr $C$DW$1, DW_AT_high_pc(0x00)
.dwattr $C$DW$1, DW_AT_TI_symbol_name("_MEM_init")
.dwattr $C$DW$1, DW_AT_external
.dwattr $C$DW$1, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$1, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$1, DW_AT_TI_begin_line(0x3e)
.dwattr $C$DW$1, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$1, DW_AT_TI_max_frame_size(0x01)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 63,column 1,is_stmt,address _MEM_init
.dwfde $C$DW$CIE, _MEM_init
;*******************************************************************************
;* FUNCTION NAME: MEM_init *
;* *
;* Function Uses Regs : T0,SP,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 1 word *
;* (1 return address/alignment) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_init:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 64,column 2,is_stmt
MOV #0, T0
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 65,column 1,is_stmt
$C$DW$2 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$2, DW_AT_low_pc(0x00)
.dwattr $C$DW$2, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$1, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$1, DW_AT_TI_end_line(0x41)
.dwattr $C$DW$1, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$1
.sect ".text"
.align 4
.global _MEM_enableRetentionMode
$C$DW$3 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_enableRetentionMode")
.dwattr $C$DW$3, DW_AT_low_pc(_MEM_enableRetentionMode)
.dwattr $C$DW$3, DW_AT_high_pc(0x00)
.dwattr $C$DW$3, DW_AT_TI_symbol_name("_MEM_enableRetentionMode")
.dwattr $C$DW$3, DW_AT_external
.dwattr $C$DW$3, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$3, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$3, DW_AT_TI_begin_line(0x6b)
.dwattr $C$DW$3, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$3, DW_AT_TI_max_frame_size(0x04)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 108,column 1,is_stmt,address _MEM_enableRetentionMode
.dwfde $C$DW$CIE, _MEM_enableRetentionMode
$C$DW$4 .dwtag DW_TAG_formal_parameter, DW_AT_name("memType")
.dwattr $C$DW$4, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$4, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$4, DW_AT_location[DW_OP_reg12]
;*******************************************************************************
;* FUNCTION NAME: MEM_enableRetentionMode *
;* *
;* Function Uses Regs : T0,AR1,AR2,SP,TC1,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 4 words *
;* (2 return address/alignment) *
;* (2 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_enableRetentionMode:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-3, SP
.dwcfi cfa_offset, 4
$C$DW$5 .dwtag DW_TAG_variable, DW_AT_name("memType")
.dwattr $C$DW$5, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$5, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$5, DW_AT_location[DW_OP_bregx 0x24 0]
$C$DW$6 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$6, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$6, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$6, DW_AT_location[DW_OP_bregx 0x24 1]
MOV T0, *SP(#0) ; |108|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 111,column 2,is_stmt
MOV #0, *SP(#1) ; |111|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 116,column 2,is_stmt
MOV *SP(#0), AR1 ; |116|
|| MOV #1, AR2
CMP AR2 != AR1, TC1 ; |116|
BCC $C$L1,TC1 ; |116|
; branchcc occurs ; |116|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 120,column 3,is_stmt
MOV #43690, *port(#7210) ; |120|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 121,column 3,is_stmt
MOV #43690, *port(#7211) ; |121|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 122,column 3,is_stmt
MOV #43690, *port(#7212) ; |122|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 123,column 3,is_stmt
MOV #43690, *port(#7213) ; |123|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 124,column 2,is_stmt
B $C$L3 ; |124|
; branch occurs ; |124|
$C$L1:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 125,column 7,is_stmt
MOV #0, AR2
CMP AR2 != AR1, TC1 ; |125|
BCC $C$L2,TC1 ; |125|
; branchcc occurs ; |125|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 129,column 3,is_stmt
MOV #43690, *port(#7208) ; |129|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 130,column 2,is_stmt
B $C$L3 ; |130|
; branch occurs ; |130|
$C$L2:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 133,column 3,is_stmt
MOV #-6, *SP(#1) ; |133|
$C$L3:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 164,column 2,is_stmt
MOV *SP(#1), T0 ; |164|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 165,column 1,is_stmt
AADD #3, SP
.dwcfi cfa_offset, 1
$C$DW$7 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$7, DW_AT_low_pc(0x00)
.dwattr $C$DW$7, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$3, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$3, DW_AT_TI_end_line(0xa5)
.dwattr $C$DW$3, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$3
.sect ".text"
.align 4
.global _MEM_disableRetentionMode
$C$DW$8 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_disableRetentionMode")
.dwattr $C$DW$8, DW_AT_low_pc(_MEM_disableRetentionMode)
.dwattr $C$DW$8, DW_AT_high_pc(0x00)
.dwattr $C$DW$8, DW_AT_TI_symbol_name("_MEM_disableRetentionMode")
.dwattr $C$DW$8, DW_AT_external
.dwattr $C$DW$8, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$8, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$8, DW_AT_TI_begin_line(0xcc)
.dwattr $C$DW$8, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$8, DW_AT_TI_max_frame_size(0x04)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 205,column 1,is_stmt,address _MEM_disableRetentionMode
.dwfde $C$DW$CIE, _MEM_disableRetentionMode
$C$DW$9 .dwtag DW_TAG_formal_parameter, DW_AT_name("memType")
.dwattr $C$DW$9, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$9, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$9, DW_AT_location[DW_OP_reg12]
;*******************************************************************************
;* FUNCTION NAME: MEM_disableRetentionMode *
;* *
;* Function Uses Regs : T0,AR1,AR2,SP,TC1,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 4 words *
;* (2 return address/alignment) *
;* (2 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_disableRetentionMode:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-3, SP
.dwcfi cfa_offset, 4
$C$DW$10 .dwtag DW_TAG_variable, DW_AT_name("memType")
.dwattr $C$DW$10, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$10, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$10, DW_AT_location[DW_OP_bregx 0x24 0]
$C$DW$11 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$11, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$11, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$11, DW_AT_location[DW_OP_bregx 0x24 1]
MOV T0, *SP(#0) ; |205|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 208,column 2,is_stmt
MOV #0, *SP(#1) ; |208|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 213,column 2,is_stmt
MOV *SP(#0), AR1 ; |213|
|| MOV #1, AR2
CMP AR2 != AR1, TC1 ; |213|
BCC $C$L4,TC1 ; |213|
; branchcc occurs ; |213|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 217,column 3,is_stmt
MOV #65535, *port(#7210) ; |217|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 218,column 3,is_stmt
MOV #65535, *port(#7211) ; |218|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 219,column 3,is_stmt
MOV #65535, *port(#7212) ; |219|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 220,column 3,is_stmt
MOV #65535, *port(#7213) ; |220|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 221,column 2,is_stmt
B $C$L6 ; |221|
; branch occurs ; |221|
$C$L4:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 222,column 7,is_stmt
MOV #0, AR2
CMP AR2 != AR1, TC1 ; |222|
BCC $C$L5,TC1 ; |222|
; branchcc occurs ; |222|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 227,column 3,is_stmt
MOV #65535, *port(#7208) ; |227|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 228,column 2,is_stmt
B $C$L6 ; |228|
; branch occurs ; |228|
$C$L5:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 231,column 3,is_stmt
MOV #-6, *SP(#1) ; |231|
$C$L6:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 261,column 2,is_stmt
MOV *SP(#1), T0 ; |261|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 262,column 1,is_stmt
AADD #3, SP
.dwcfi cfa_offset, 1
$C$DW$12 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$12, DW_AT_low_pc(0x00)
.dwattr $C$DW$12, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$8, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$8, DW_AT_TI_end_line(0x106)
.dwattr $C$DW$8, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$8
.sect ".text"
.align 4
.global _MEM_enablePartialRetentionMode
$C$DW$13 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_enablePartialRetentionMode")
.dwattr $C$DW$13, DW_AT_low_pc(_MEM_enablePartialRetentionMode)
.dwattr $C$DW$13, DW_AT_high_pc(0x00)
.dwattr $C$DW$13, DW_AT_TI_symbol_name("_MEM_enablePartialRetentionMode")
.dwattr $C$DW$13, DW_AT_external
.dwattr $C$DW$13, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$13, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$13, DW_AT_TI_begin_line(0x15a)
.dwattr $C$DW$13, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$13, DW_AT_TI_max_frame_size(0x0c)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 349,column 1,is_stmt,address _MEM_enablePartialRetentionMode
.dwfde $C$DW$CIE, _MEM_enablePartialRetentionMode
$C$DW$14 .dwtag DW_TAG_formal_parameter, DW_AT_name("memType")
.dwattr $C$DW$14, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$14, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$14, DW_AT_location[DW_OP_reg12]
$C$DW$15 .dwtag DW_TAG_formal_parameter, DW_AT_name("bankNumber")
.dwattr $C$DW$15, DW_AT_TI_symbol_name("_bankNumber")
.dwattr $C$DW$15, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$15, DW_AT_location[DW_OP_reg13]
$C$DW$16 .dwtag DW_TAG_formal_parameter, DW_AT_name("bankMask")
.dwattr $C$DW$16, DW_AT_TI_symbol_name("_bankMask")
.dwattr $C$DW$16, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$16, DW_AT_location[DW_OP_reg0]
;*******************************************************************************
;* FUNCTION NAME: MEM_enablePartialRetentionMode *
;* *
;* Function Uses Regs : AC0,AC0,AC1,AC1,T0,T1,AR1,AR2,AR3,SP,CARRY,TC1,M40, *
;* SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 12 words *
;* (2 return address/alignment) *
;* (10 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_enablePartialRetentionMode:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-11, SP
.dwcfi cfa_offset, 12
$C$DW$17 .dwtag DW_TAG_variable, DW_AT_name("memType")
.dwattr $C$DW$17, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$17, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$17, DW_AT_location[DW_OP_bregx 0x24 0]
$C$DW$18 .dwtag DW_TAG_variable, DW_AT_name("bankNumber")
.dwattr $C$DW$18, DW_AT_TI_symbol_name("_bankNumber")
.dwattr $C$DW$18, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$18, DW_AT_location[DW_OP_bregx 0x24 1]
$C$DW$19 .dwtag DW_TAG_variable, DW_AT_name("bankMask")
.dwattr $C$DW$19, DW_AT_TI_symbol_name("_bankMask")
.dwattr $C$DW$19, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$19, DW_AT_location[DW_OP_bregx 0x24 2]
$C$DW$20 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$20, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$20, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$20, DW_AT_location[DW_OP_bregx 0x24 4]
$C$DW$21 .dwtag DW_TAG_variable, DW_AT_name("regOffset")
.dwattr $C$DW$21, DW_AT_TI_symbol_name("_regOffset")
.dwattr $C$DW$21, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$21, DW_AT_location[DW_OP_bregx 0x24 5]
$C$DW$22 .dwtag DW_TAG_variable, DW_AT_name("regShift")
.dwattr $C$DW$22, DW_AT_TI_symbol_name("_regShift")
.dwattr $C$DW$22, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$22, DW_AT_location[DW_OP_bregx 0x24 6]
$C$DW$23 .dwtag DW_TAG_variable, DW_AT_name("count")
.dwattr $C$DW$23, DW_AT_TI_symbol_name("_count")
.dwattr $C$DW$23, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$23, DW_AT_location[DW_OP_bregx 0x24 7]
$C$DW$24 .dwtag DW_TAG_variable, DW_AT_name("maxBankCount")
.dwattr $C$DW$24, DW_AT_TI_symbol_name("_maxBankCount")
.dwattr $C$DW$24, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$24, DW_AT_location[DW_OP_bregx 0x24 8]
$C$DW$25 .dwtag DW_TAG_variable, DW_AT_name("pSleepRegBaseAddr")
.dwattr $C$DW$25, DW_AT_TI_symbol_name("_pSleepRegBaseAddr")
.dwattr $C$DW$25, DW_AT_type(*$C$DW$T$41)
.dwattr $C$DW$25, DW_AT_location[DW_OP_bregx 0x24 9]
MOV AC0, dbl(*SP(#2)) ; |349|
MOV T1, *SP(#1) ; |349|
MOV T0, *SP(#0) ; |349|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 357,column 2,is_stmt
MOV #0, *SP(#4) ; |357|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 358,column 2,is_stmt
MOV #0, *SP(#5) ; |358|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 359,column 2,is_stmt
MOV #0, *SP(#6) ; |359|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 360,column 2,is_stmt
MOV #0, *SP(#7) ; |360|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 361,column 2,is_stmt
MOV #0, *SP(#8) ; |361|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 362,column 2,is_stmt
MOV #0, *SP(#9) ; |362|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 365,column 2,is_stmt
MOV *SP(#0), AR1 ; |365|
|| MOV #1, AR2
CMP AR2 != AR1, TC1 ; |365|
BCC $C$L8,TC1 ; |365|
; branchcc occurs ; |365|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 367,column 3,is_stmt
MOV #0, AC1 ; |367|
|| MOV dbl(*SP(#2)), AC0 ; |367|
CMPU AC1 != AC0, TC1 ; |367|
BCC $C$L7,TC1 ; |367|
; branchcc occurs ; |367|
MOV #31, AR2 ; |367|
MOV *SP(#1), AR1 ; |367|
CMPU AR1 <= AR2, TC1 ; |367|
BCC $C$L7,TC1 ; |367|
; branchcc occurs ; |367|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 369,column 4,is_stmt
MOV #-6, *SP(#4) ; |369|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 370,column 3,is_stmt
B $C$L13 ; |370|
; branch occurs ; |370|
$C$L7:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 373,column 4,is_stmt
MOV #7210, *SP(#9) ; |373|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 374,column 4,is_stmt
MOV #32, *SP(#8) ; |374|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 376,column 2,is_stmt
B $C$L13 ; |376|
; branch occurs ; |376|
$C$L8:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 377,column 7,is_stmt
MOV #0, AR2
CMP AR2 != AR1, TC1 ; |377|
BCC $C$L12,TC1 ; |377|
; branchcc occurs ; |377|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 379,column 3,is_stmt
MOV #0, AC1 ; |379|
|| MOV dbl(*SP(#2)), AC0 ; |379|
CMPU AC1 != AC0, TC1 ; |379|
BCC $C$L9,TC1 ; |379|
; branchcc occurs ; |379|
MOV *SP(#1), AR1 ; |379|
|| MOV #7, AR2
CMPU AR1 <= AR2, TC1 ; |379|
BCC $C$L10,!TC1 ; |379|
; branchcc occurs ; |379|
$C$L9:
MOV #255, AC0 ; |379|
MOV dbl(*SP(#2)), AC1 ; |379|
CMPU AC1 <= AC0, TC1 ; |379|
BCC $C$L11,TC1 ; |379|
; branchcc occurs ; |379|
$C$L10:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 382,column 4,is_stmt
MOV #-6, *SP(#4) ; |382|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 383,column 3,is_stmt
B $C$L13 ; |383|
; branch occurs ; |383|
$C$L11:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 386,column 4,is_stmt
MOV #7208, *SP(#9) ; |386|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 387,column 4,is_stmt
MOV #8, *SP(#8) ; |387|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 389,column 2,is_stmt
B $C$L13 ; |389|
; branch occurs ; |389|
$C$L12:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 392,column 3,is_stmt
MOV #-6, *SP(#4) ; |392|
$C$L13:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 396,column 2,is_stmt
MOV *SP(#4), AR1 ; |396|
BCC $C$L17,AR1 != #0 ; |396|
; branchcc occurs ; |396|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 398,column 3,is_stmt
MOV #0, AC1 ; |398|
|| MOV dbl(*SP(#2)), AC0 ; |398|
CMPU AC1 != AC0, TC1 ; |398|
BCC $C$L14,TC1 ; |398|
; branchcc occurs ; |398|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 400,column 4,is_stmt
MOV uns(*SP(#1)), AC0 ; |400|
SFTS AC0, #-3, AC0 ; |400|
MOV AC0, *SP(#5) ; |400|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 401,column 4,is_stmt
MOV *SP(#1), AR1 ; |401|
AND #0x0007, AR1, AC0 ; |401|
SFTL AC0, #1 ; |401|
MOV AC0, *SP(#6) ; |401|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 404,column 4,is_stmt
MOV *SP(#5), T0 ; |404|
MOV *SP(#9), AR3 ; |404|
MOV #3, AC0
|| MOV *SP(#6), T1 ; |404|
SFTS AC0, T1, AC0 ; |404|
NOT AC0, AR1 ; |404|
AND port(*AR3(T0)), AR1, AC0 ; |404|
MOV AC0, port(*AR3(T0)) ; |404|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 408,column 4,is_stmt
MOV *SP(#5), T0 ; |408|
MOV *SP(#9), AR3 ; |408|
MOV *SP(#6), T1 ; |408|
|| MOV #2, AC0
SFTS AC0, T1, AC0 ; |408|
OR port(*AR3(T0)), AC0, AR1 ; |408|
MOV AR1, port(*AR3(T0)) ; |408|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 410,column 3,is_stmt
B $C$L17 ; |410|
; branch occurs ; |410|
$C$L14:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 413,column 4,is_stmt
MOV #0, *SP(#1) ; |413|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 415,column 9,is_stmt
MOV #0, *SP(#7) ; |415|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 415,column 20,is_stmt
MOV *SP(#8), AR1 ; |415|
MOV *SP(#7), AR2 ; |415|
CMPU AR2 >= AR1, TC1 ; |415|
BCC $C$L17,TC1 ; |415|
; branchcc occurs ; |415|
$C$L15:
$C$DW$L$_MEM_enablePartialRetentionMode$17$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 417,column 5,is_stmt
MOV dbl(*SP(#2)), AC1 ; |417|
AND #0x0001, AC1, AC1 ; |417|
|| MOV #1, AC0 ; |417|
CMPU AC1 != AC0, TC1 ; |417|
BCC $C$L16,TC1 ; |417|
; branchcc occurs ; |417|
$C$DW$L$_MEM_enablePartialRetentionMode$17$E:
$C$DW$L$_MEM_enablePartialRetentionMode$18$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 419,column 6,is_stmt
MOV AR2, AR1
MOV AR1, *SP(#1) ; |419|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 421,column 6,is_stmt
MOV uns(*SP(#1)), AC0 ; |421|
SFTS AC0, #-3, AC0 ; |421|
MOV AC0, *SP(#5) ; |421|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 422,column 6,is_stmt
MOV *SP(#1), AR1 ; |422|
AND #0x0007, AR1, AC0 ; |422|
SFTL AC0, #1 ; |422|
MOV AC0, *SP(#6) ; |422|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 425,column 6,is_stmt
MOV *SP(#5), T0 ; |425|
MOV *SP(#9), AR3 ; |425|
MOV *SP(#6), T1 ; |425|
|| MOV #3, AC0
SFTS AC0, T1, AC0 ; |425|
NOT AC0, AR1 ; |425|
AND port(*AR3(T0)), AR1, AC0 ; |425|
MOV AC0, port(*AR3(T0)) ; |425|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 429,column 6,is_stmt
MOV *SP(#5), T0 ; |429|
MOV *SP(#9), AR3 ; |429|
MOV *SP(#6), T1 ; |429|
|| MOV #2, AC0
SFTS AC0, T1, AC0 ; |429|
OR port(*AR3(T0)), AC0, AR1 ; |429|
MOV AR1, port(*AR3(T0)) ; |429|
$C$DW$L$_MEM_enablePartialRetentionMode$18$E:
$C$L16:
$C$DW$L$_MEM_enablePartialRetentionMode$19$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 433,column 5,is_stmt
MOV dbl(*SP(#2)), AC0 ; |433|
SFTL AC0, #-1 ; |433|
MOV AC0, dbl(*SP(#2)) ; |433|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 435,column 5,is_stmt
MOV dbl(*SP(#2)), AC0 ; |435|
|| MOV #0, AC1 ; |435|
CMPU AC1 != AC0, TC1 ; |435|
BCC $C$L17,!TC1 ; |435|
; branchcc occurs ; |435|
$C$DW$L$_MEM_enablePartialRetentionMode$19$E:
$C$DW$L$_MEM_enablePartialRetentionMode$20$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 437,column 6,is_stmt
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 415,column 42,is_stmt
ADD #1, *SP(#7) ; |415|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 415,column 20,is_stmt
MOV *SP(#8), AR1 ; |415|
MOV *SP(#7), AR2 ; |415|
CMPU AR2 < AR1, TC1 ; |415|
BCC $C$L15,TC1 ; |415|
; branchcc occurs ; |415|
$C$DW$L$_MEM_enablePartialRetentionMode$20$E:
$C$L17:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 443,column 2,is_stmt
MOV *SP(#4), T0 ; |443|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 444,column 1,is_stmt
AADD #11, SP
.dwcfi cfa_offset, 1
$C$DW$26 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$26, DW_AT_low_pc(0x00)
.dwattr $C$DW$26, DW_AT_TI_return
RET
; return occurs
$C$DW$27 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$27, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\csl_mem.asm:$C$L15:1:1538833061")
.dwattr $C$DW$27, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$27, DW_AT_TI_begin_line(0x19f)
.dwattr $C$DW$27, DW_AT_TI_end_line(0x1b7)
$C$DW$28 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$28, DW_AT_low_pc($C$DW$L$_MEM_enablePartialRetentionMode$17$B)
.dwattr $C$DW$28, DW_AT_high_pc($C$DW$L$_MEM_enablePartialRetentionMode$17$E)
$C$DW$29 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$29, DW_AT_low_pc($C$DW$L$_MEM_enablePartialRetentionMode$18$B)
.dwattr $C$DW$29, DW_AT_high_pc($C$DW$L$_MEM_enablePartialRetentionMode$18$E)
$C$DW$30 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$30, DW_AT_low_pc($C$DW$L$_MEM_enablePartialRetentionMode$19$B)
.dwattr $C$DW$30, DW_AT_high_pc($C$DW$L$_MEM_enablePartialRetentionMode$19$E)
$C$DW$31 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$31, DW_AT_low_pc($C$DW$L$_MEM_enablePartialRetentionMode$20$B)
.dwattr $C$DW$31, DW_AT_high_pc($C$DW$L$_MEM_enablePartialRetentionMode$20$E)
.dwendtag $C$DW$27
.dwattr $C$DW$13, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$13, DW_AT_TI_end_line(0x1bc)
.dwattr $C$DW$13, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$13
.sect ".text"
.align 4
.global _MEM_disablePartialRetentionMode
$C$DW$32 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_disablePartialRetentionMode")
.dwattr $C$DW$32, DW_AT_low_pc(_MEM_disablePartialRetentionMode)
.dwattr $C$DW$32, DW_AT_high_pc(0x00)
.dwattr $C$DW$32, DW_AT_TI_symbol_name("_MEM_disablePartialRetentionMode")
.dwattr $C$DW$32, DW_AT_external
.dwattr $C$DW$32, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$32, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$32, DW_AT_TI_begin_line(0x209)
.dwattr $C$DW$32, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$32, DW_AT_TI_max_frame_size(0x0c)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 524,column 1,is_stmt,address _MEM_disablePartialRetentionMode
.dwfde $C$DW$CIE, _MEM_disablePartialRetentionMode
$C$DW$33 .dwtag DW_TAG_formal_parameter, DW_AT_name("memType")
.dwattr $C$DW$33, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$33, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$33, DW_AT_location[DW_OP_reg12]
$C$DW$34 .dwtag DW_TAG_formal_parameter, DW_AT_name("bankNumber")
.dwattr $C$DW$34, DW_AT_TI_symbol_name("_bankNumber")
.dwattr $C$DW$34, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$34, DW_AT_location[DW_OP_reg13]
$C$DW$35 .dwtag DW_TAG_formal_parameter, DW_AT_name("bankMask")
.dwattr $C$DW$35, DW_AT_TI_symbol_name("_bankMask")
.dwattr $C$DW$35, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$35, DW_AT_location[DW_OP_reg0]
;*******************************************************************************
;* FUNCTION NAME: MEM_disablePartialRetentionMode *
;* *
;* Function Uses Regs : AC0,AC0,AC1,AC1,T0,T1,AR1,AR2,AR3,SP,CARRY,TC1,M40, *
;* SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 12 words *
;* (2 return address/alignment) *
;* (10 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_disablePartialRetentionMode:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-11, SP
.dwcfi cfa_offset, 12
$C$DW$36 .dwtag DW_TAG_variable, DW_AT_name("memType")
.dwattr $C$DW$36, DW_AT_TI_symbol_name("_memType")
.dwattr $C$DW$36, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$36, DW_AT_location[DW_OP_bregx 0x24 0]
$C$DW$37 .dwtag DW_TAG_variable, DW_AT_name("bankNumber")
.dwattr $C$DW$37, DW_AT_TI_symbol_name("_bankNumber")
.dwattr $C$DW$37, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$37, DW_AT_location[DW_OP_bregx 0x24 1]
$C$DW$38 .dwtag DW_TAG_variable, DW_AT_name("bankMask")
.dwattr $C$DW$38, DW_AT_TI_symbol_name("_bankMask")
.dwattr $C$DW$38, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$38, DW_AT_location[DW_OP_bregx 0x24 2]
$C$DW$39 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$39, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$39, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$39, DW_AT_location[DW_OP_bregx 0x24 4]
$C$DW$40 .dwtag DW_TAG_variable, DW_AT_name("regOffset")
.dwattr $C$DW$40, DW_AT_TI_symbol_name("_regOffset")
.dwattr $C$DW$40, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$40, DW_AT_location[DW_OP_bregx 0x24 5]
$C$DW$41 .dwtag DW_TAG_variable, DW_AT_name("regShift")
.dwattr $C$DW$41, DW_AT_TI_symbol_name("_regShift")
.dwattr $C$DW$41, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$41, DW_AT_location[DW_OP_bregx 0x24 6]
$C$DW$42 .dwtag DW_TAG_variable, DW_AT_name("count")
.dwattr $C$DW$42, DW_AT_TI_symbol_name("_count")
.dwattr $C$DW$42, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$42, DW_AT_location[DW_OP_bregx 0x24 7]
$C$DW$43 .dwtag DW_TAG_variable, DW_AT_name("maxBankCount")
.dwattr $C$DW$43, DW_AT_TI_symbol_name("_maxBankCount")
.dwattr $C$DW$43, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$43, DW_AT_location[DW_OP_bregx 0x24 8]
$C$DW$44 .dwtag DW_TAG_variable, DW_AT_name("pSleepRegBaseAddr")
.dwattr $C$DW$44, DW_AT_TI_symbol_name("_pSleepRegBaseAddr")
.dwattr $C$DW$44, DW_AT_type(*$C$DW$T$41)
.dwattr $C$DW$44, DW_AT_location[DW_OP_bregx 0x24 9]
MOV AC0, dbl(*SP(#2)) ; |524|
MOV T1, *SP(#1) ; |524|
MOV T0, *SP(#0) ; |524|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 532,column 2,is_stmt
MOV #0, *SP(#4) ; |532|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 533,column 2,is_stmt
MOV #0, *SP(#5) ; |533|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 534,column 2,is_stmt
MOV #0, *SP(#6) ; |534|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 535,column 2,is_stmt
MOV #0, *SP(#7) ; |535|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 536,column 2,is_stmt
MOV #0, *SP(#8) ; |536|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 537,column 2,is_stmt
MOV #0, *SP(#9) ; |537|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 540,column 2,is_stmt
MOV *SP(#0), AR1 ; |540|
|| MOV #1, AR2
CMP AR2 != AR1, TC1 ; |540|
BCC $C$L19,TC1 ; |540|
; branchcc occurs ; |540|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 542,column 3,is_stmt
MOV #0, AC1 ; |542|
|| MOV dbl(*SP(#2)), AC0 ; |542|
CMPU AC1 != AC0, TC1 ; |542|
BCC $C$L18,TC1 ; |542|
; branchcc occurs ; |542|
MOV #31, AR2 ; |542|
MOV *SP(#1), AR1 ; |542|
CMPU AR1 <= AR2, TC1 ; |542|
BCC $C$L18,TC1 ; |542|
; branchcc occurs ; |542|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 544,column 4,is_stmt
MOV #-6, *SP(#4) ; |544|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 545,column 3,is_stmt
B $C$L24 ; |545|
; branch occurs ; |545|
$C$L18:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 548,column 4,is_stmt
MOV #7210, *SP(#9) ; |548|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 549,column 4,is_stmt
MOV #32, *SP(#8) ; |549|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 551,column 2,is_stmt
B $C$L24 ; |551|
; branch occurs ; |551|
$C$L19:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 552,column 7,is_stmt
MOV #0, AR2
CMP AR2 != AR1, TC1 ; |552|
BCC $C$L23,TC1 ; |552|
; branchcc occurs ; |552|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 554,column 3,is_stmt
MOV #0, AC1 ; |554|
|| MOV dbl(*SP(#2)), AC0 ; |554|
CMPU AC1 != AC0, TC1 ; |554|
BCC $C$L20,TC1 ; |554|
; branchcc occurs ; |554|
MOV *SP(#1), AR1 ; |554|
|| MOV #7, AR2
CMPU AR1 <= AR2, TC1 ; |554|
BCC $C$L21,!TC1 ; |554|
; branchcc occurs ; |554|
$C$L20:
MOV #255, AC0 ; |554|
MOV dbl(*SP(#2)), AC1 ; |554|
CMPU AC1 <= AC0, TC1 ; |554|
BCC $C$L22,TC1 ; |554|
; branchcc occurs ; |554|
$C$L21:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 557,column 4,is_stmt
MOV #-6, *SP(#4) ; |557|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 558,column 3,is_stmt
B $C$L24 ; |558|
; branch occurs ; |558|
$C$L22:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 561,column 4,is_stmt
MOV #7208, *SP(#9) ; |561|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 562,column 4,is_stmt
MOV #8, *SP(#8) ; |562|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 564,column 2,is_stmt
B $C$L24 ; |564|
; branch occurs ; |564|
$C$L23:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 567,column 3,is_stmt
MOV #-6, *SP(#4) ; |567|
$C$L24:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 571,column 2,is_stmt
MOV *SP(#4), AR1 ; |571|
BCC $C$L28,AR1 != #0 ; |571|
; branchcc occurs ; |571|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 573,column 3,is_stmt
MOV #0, AC1 ; |573|
|| MOV dbl(*SP(#2)), AC0 ; |573|
CMPU AC1 != AC0, TC1 ; |573|
BCC $C$L25,TC1 ; |573|
; branchcc occurs ; |573|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 575,column 4,is_stmt
MOV uns(*SP(#1)), AC0 ; |575|
SFTS AC0, #-3, AC0 ; |575|
MOV AC0, *SP(#5) ; |575|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 576,column 4,is_stmt
MOV *SP(#1), AR1 ; |576|
AND #0x0007, AR1, AC0 ; |576|
SFTL AC0, #1 ; |576|
MOV AC0, *SP(#6) ; |576|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 579,column 4,is_stmt
MOV *SP(#5), T0 ; |579|
MOV *SP(#9), AR3 ; |579|
MOV #3, AC0
|| MOV *SP(#6), T1 ; |579|
SFTS AC0, T1, AC0 ; |579|
OR port(*AR3(T0)), AC0, AR1 ; |579|
MOV AR1, port(*AR3(T0)) ; |579|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 581,column 3,is_stmt
B $C$L28 ; |581|
; branch occurs ; |581|
$C$L25:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 584,column 4,is_stmt
MOV #0, *SP(#1) ; |584|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 586,column 9,is_stmt
MOV #0, *SP(#7) ; |586|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 586,column 20,is_stmt
MOV *SP(#8), AR1 ; |586|
MOV *SP(#7), AR2 ; |586|
CMPU AR2 >= AR1, TC1 ; |586|
BCC $C$L28,TC1 ; |586|
; branchcc occurs ; |586|
$C$L26:
$C$DW$L$_MEM_disablePartialRetentionMode$17$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 588,column 5,is_stmt
MOV dbl(*SP(#2)), AC1 ; |588|
AND #0x0001, AC1, AC1 ; |588|
|| MOV #1, AC0 ; |588|
CMPU AC1 != AC0, TC1 ; |588|
BCC $C$L27,TC1 ; |588|
; branchcc occurs ; |588|
$C$DW$L$_MEM_disablePartialRetentionMode$17$E:
$C$DW$L$_MEM_disablePartialRetentionMode$18$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 590,column 6,is_stmt
MOV AR2, AR1
MOV AR1, *SP(#1) ; |590|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 592,column 6,is_stmt
MOV uns(*SP(#1)), AC0 ; |592|
SFTS AC0, #-3, AC0 ; |592|
MOV AC0, *SP(#5) ; |592|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 593,column 6,is_stmt
MOV *SP(#1), AR1 ; |593|
AND #0x0007, AR1, AC0 ; |593|
SFTL AC0, #1 ; |593|
MOV AC0, *SP(#6) ; |593|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 596,column 6,is_stmt
MOV *SP(#5), T0 ; |596|
MOV *SP(#9), AR3 ; |596|
MOV *SP(#6), T1 ; |596|
|| MOV #3, AC0
SFTS AC0, T1, AC0 ; |596|
OR port(*AR3(T0)), AC0, AR1 ; |596|
MOV AR1, port(*AR3(T0)) ; |596|
$C$DW$L$_MEM_disablePartialRetentionMode$18$E:
$C$L27:
$C$DW$L$_MEM_disablePartialRetentionMode$19$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 600,column 5,is_stmt
MOV dbl(*SP(#2)), AC0 ; |600|
SFTL AC0, #-1 ; |600|
MOV AC0, dbl(*SP(#2)) ; |600|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 602,column 5,is_stmt
MOV dbl(*SP(#2)), AC0 ; |602|
|| MOV #0, AC1 ; |602|
CMPU AC1 != AC0, TC1 ; |602|
BCC $C$L28,!TC1 ; |602|
; branchcc occurs ; |602|
$C$DW$L$_MEM_disablePartialRetentionMode$19$E:
$C$DW$L$_MEM_disablePartialRetentionMode$20$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 604,column 6,is_stmt
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 586,column 42,is_stmt
ADD #1, *SP(#7) ; |586|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 586,column 20,is_stmt
MOV *SP(#8), AR1 ; |586|
MOV *SP(#7), AR2 ; |586|
CMPU AR2 < AR1, TC1 ; |586|
BCC $C$L26,TC1 ; |586|
; branchcc occurs ; |586|
$C$DW$L$_MEM_disablePartialRetentionMode$20$E:
$C$L28:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 610,column 2,is_stmt
MOV *SP(#4), T0 ; |610|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 611,column 1,is_stmt
AADD #11, SP
.dwcfi cfa_offset, 1
$C$DW$45 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$45, DW_AT_low_pc(0x00)
.dwattr $C$DW$45, DW_AT_TI_return
RET
; return occurs
$C$DW$46 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$46, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\csl_mem.asm:$C$L26:1:1538833061")
.dwattr $C$DW$46, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$46, DW_AT_TI_begin_line(0x24a)
.dwattr $C$DW$46, DW_AT_TI_end_line(0x25e)
$C$DW$47 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$47, DW_AT_low_pc($C$DW$L$_MEM_disablePartialRetentionMode$17$B)
.dwattr $C$DW$47, DW_AT_high_pc($C$DW$L$_MEM_disablePartialRetentionMode$17$E)
$C$DW$48 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$48, DW_AT_low_pc($C$DW$L$_MEM_disablePartialRetentionMode$18$B)
.dwattr $C$DW$48, DW_AT_high_pc($C$DW$L$_MEM_disablePartialRetentionMode$18$E)
$C$DW$49 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$49, DW_AT_low_pc($C$DW$L$_MEM_disablePartialRetentionMode$19$B)
.dwattr $C$DW$49, DW_AT_high_pc($C$DW$L$_MEM_disablePartialRetentionMode$19$E)
$C$DW$50 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$50, DW_AT_low_pc($C$DW$L$_MEM_disablePartialRetentionMode$20$B)
.dwattr $C$DW$50, DW_AT_high_pc($C$DW$L$_MEM_disablePartialRetentionMode$20$E)
.dwendtag $C$DW$46
.dwattr $C$DW$32, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$32, DW_AT_TI_end_line(0x263)
.dwattr $C$DW$32, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$32
.sect ".text"
.align 4
.global _MEM_setmSDRAMClock
$C$DW$51 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_setmSDRAMClock")
.dwattr $C$DW$51, DW_AT_low_pc(_MEM_setmSDRAMClock)
.dwattr $C$DW$51, DW_AT_high_pc(0x00)
.dwattr $C$DW$51, DW_AT_TI_symbol_name("_MEM_setmSDRAMClock")
.dwattr $C$DW$51, DW_AT_external
.dwattr $C$DW$51, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$51, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$51, DW_AT_TI_begin_line(0x288)
.dwattr $C$DW$51, DW_AT_TI_begin_column(0x0c)
.dwattr $C$DW$51, DW_AT_TI_max_frame_size(0x04)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 649,column 1,is_stmt,address _MEM_setmSDRAMClock
.dwfde $C$DW$CIE, _MEM_setmSDRAMClock
$C$DW$52 .dwtag DW_TAG_formal_parameter, DW_AT_name("clockSwitch")
.dwattr $C$DW$52, DW_AT_TI_symbol_name("_clockSwitch")
.dwattr $C$DW$52, DW_AT_type(*$C$DW$T$28)
.dwattr $C$DW$52, DW_AT_location[DW_OP_reg12]
;*******************************************************************************
;* FUNCTION NAME: MEM_setmSDRAMClock *
;* *
;* Function Uses Regs : T0,AR1,AR2,SP,TC1,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 4 words *
;* (2 return address/alignment) *
;* (2 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_setmSDRAMClock:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-3, SP
.dwcfi cfa_offset, 4
$C$DW$53 .dwtag DW_TAG_variable, DW_AT_name("clockSwitch")
.dwattr $C$DW$53, DW_AT_TI_symbol_name("_clockSwitch")
.dwattr $C$DW$53, DW_AT_type(*$C$DW$T$28)
.dwattr $C$DW$53, DW_AT_location[DW_OP_bregx 0x24 0]
$C$DW$54 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$54, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$54, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$54, DW_AT_location[DW_OP_bregx 0x24 1]
MOV T0, *SP(#0) ; |649|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 652,column 2,is_stmt
MOV #0, *SP(#1) ; |652|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 654,column 2,is_stmt
MOV *SP(#0), AR1 ; |654|
|| MOV #0, AR2
CMP AR2 != AR1, TC1 ; |654|
BCC $C$L29,TC1 ; |654|
; branchcc occurs ; |654|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 656,column 3,is_stmt
AND #0xfffe, *port(#7198) ; |656|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 657,column 2,is_stmt
B $C$L31 ; |657|
; branch occurs ; |657|
$C$L29:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 658,column 7,is_stmt
MOV #1, AR2
CMP AR2 != AR1, TC1 ; |658|
BCC $C$L30,TC1 ; |658|
; branchcc occurs ; |658|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 660,column 3,is_stmt
MOV *port(#7198), AR1 ; |660|
BCLR @#0, AR1 ; |660|
BSET @#0, AR1 ; |660|
MOV AR1, *port(#7198) ; |660|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 661,column 2,is_stmt
B $C$L31 ; |661|
; branch occurs ; |661|
$C$L30:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 664,column 3,is_stmt
MOV #-6, *SP(#1) ; |664|
$C$L31:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 667,column 2,is_stmt
MOV *SP(#1), T0 ; |667|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 668,column 1,is_stmt
AADD #3, SP
.dwcfi cfa_offset, 1
$C$DW$55 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$55, DW_AT_low_pc(0x00)
.dwattr $C$DW$55, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$51, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$51, DW_AT_TI_end_line(0x29c)
.dwattr $C$DW$51, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$51
.sect ".text"
.align 4
.global _MEM_getmSDRAMClock
$C$DW$56 .dwtag DW_TAG_subprogram, DW_AT_name("MEM_getmSDRAMClock")
.dwattr $C$DW$56, DW_AT_low_pc(_MEM_getmSDRAMClock)
.dwattr $C$DW$56, DW_AT_high_pc(0x00)
.dwattr $C$DW$56, DW_AT_TI_symbol_name("_MEM_getmSDRAMClock")
.dwattr $C$DW$56, DW_AT_external
.dwattr $C$DW$56, DW_AT_type(*$C$DW$T$42)
.dwattr $C$DW$56, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$56, DW_AT_TI_begin_line(0x2bf)
.dwattr $C$DW$56, DW_AT_TI_begin_column(0x06)
.dwattr $C$DW$56, DW_AT_TI_max_frame_size(0x02)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 704,column 1,is_stmt,address _MEM_getmSDRAMClock
.dwfde $C$DW$CIE, _MEM_getmSDRAMClock
;*******************************************************************************
;* FUNCTION NAME: MEM_getmSDRAMClock *
;* *
;* Function Uses Regs : AC0,AC0,T0,AR1,SP,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 2 words *
;* (1 return address/alignment) *
;* (1 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_MEM_getmSDRAMClock:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-1, SP
.dwcfi cfa_offset, 2
$C$DW$57 .dwtag DW_TAG_variable, DW_AT_name("bitValue")
.dwattr $C$DW$57, DW_AT_TI_symbol_name("_bitValue")
.dwattr $C$DW$57, DW_AT_type(*$C$DW$T$42)
.dwattr $C$DW$57, DW_AT_location[DW_OP_bregx 0x24 0]
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 707,column 2,is_stmt
MOV *port(#7198), AR1 ; |707|
AND #0x0001, AR1, AC0 ; |707|
MOV AC0, *SP(#0) ; |707|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 709,column 2,is_stmt
MOV AC0, T0
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c",line 710,column 1,is_stmt
AADD #1, SP
.dwcfi cfa_offset, 1
$C$DW$58 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$58, DW_AT_low_pc(0x00)
.dwattr $C$DW$58, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$56, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/src/csl_mem.c")
.dwattr $C$DW$56, DW_AT_TI_end_line(0x2c6)
.dwattr $C$DW$56, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$56
;*******************************************************************************
;* TYPE INFORMATION *
;*******************************************************************************
$C$DW$T$25 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$25, DW_AT_byte_size(0x01)
$C$DW$59 .dwtag DW_TAG_enumerator, DW_AT_name("CSL_MEM_DARAM"), DW_AT_const_value(0x00)
$C$DW$60 .dwtag DW_TAG_enumerator, DW_AT_name("CSL_MEM_SARAM"), DW_AT_const_value(0x01)
$C$DW$61 .dwtag DW_TAG_enumerator, DW_AT_name("CSL_MEM_INVALID"), DW_AT_const_value(0x02)
.dwendtag $C$DW$T$25
$C$DW$T$26 .dwtag DW_TAG_typedef, DW_AT_name("CSL_MemType")
.dwattr $C$DW$T$26, DW_AT_type(*$C$DW$T$25)
.dwattr $C$DW$T$26, DW_AT_language(DW_LANG_C)
$C$DW$T$27 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$27, DW_AT_byte_size(0x01)
$C$DW$62 .dwtag DW_TAG_enumerator, DW_AT_name("CSL_MEM_MSDARAM_CLOCK_ON"), DW_AT_const_value(0x00)
$C$DW$63 .dwtag DW_TAG_enumerator, DW_AT_name("CSL_MEM_MSDARAM_CLOCK_OFF"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$27
$C$DW$T$28 .dwtag DW_TAG_typedef, DW_AT_name("CSL_MEMmSDRAMClock")
.dwattr $C$DW$T$28, DW_AT_type(*$C$DW$T$27)
.dwattr $C$DW$T$28, DW_AT_language(DW_LANG_C)
$C$DW$T$24 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$24, DW_AT_byte_size(0x48)
$C$DW$64 .dwtag DW_TAG_member
.dwattr $C$DW$64, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$64, DW_AT_name("EBSR")
.dwattr $C$DW$64, DW_AT_TI_symbol_name("_EBSR")
.dwattr $C$DW$64, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$64, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$65 .dwtag DW_TAG_member
.dwattr $C$DW$65, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$65, DW_AT_name("RSVD0")
.dwattr $C$DW$65, DW_AT_TI_symbol_name("_RSVD0")
.dwattr $C$DW$65, DW_AT_data_member_location[DW_OP_plus_uconst 0x1]
.dwattr $C$DW$65, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$66 .dwtag DW_TAG_member
.dwattr $C$DW$66, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$66, DW_AT_name("PCGCR1")
.dwattr $C$DW$66, DW_AT_TI_symbol_name("_PCGCR1")
.dwattr $C$DW$66, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$66, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$67 .dwtag DW_TAG_member
.dwattr $C$DW$67, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$67, DW_AT_name("PCGCR2")
.dwattr $C$DW$67, DW_AT_TI_symbol_name("_PCGCR2")
.dwattr $C$DW$67, DW_AT_data_member_location[DW_OP_plus_uconst 0x3]
.dwattr $C$DW$67, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$68 .dwtag DW_TAG_member
.dwattr $C$DW$68, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$68, DW_AT_name("PSRCR")
.dwattr $C$DW$68, DW_AT_TI_symbol_name("_PSRCR")
.dwattr $C$DW$68, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$68, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$69 .dwtag DW_TAG_member
.dwattr $C$DW$69, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$69, DW_AT_name("PRCR")
.dwattr $C$DW$69, DW_AT_TI_symbol_name("_PRCR")
.dwattr $C$DW$69, DW_AT_data_member_location[DW_OP_plus_uconst 0x5]
.dwattr $C$DW$69, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$70 .dwtag DW_TAG_member
.dwattr $C$DW$70, DW_AT_type(*$C$DW$T$21)
.dwattr $C$DW$70, DW_AT_name("RSVD1")
.dwattr $C$DW$70, DW_AT_TI_symbol_name("_RSVD1")
.dwattr $C$DW$70, DW_AT_data_member_location[DW_OP_plus_uconst 0x6]
.dwattr $C$DW$70, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$71 .dwtag DW_TAG_member
.dwattr $C$DW$71, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$71, DW_AT_name("TIAFR")
.dwattr $C$DW$71, DW_AT_TI_symbol_name("_TIAFR")
.dwattr $C$DW$71, DW_AT_data_member_location[DW_OP_plus_uconst 0x14]
.dwattr $C$DW$71, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$72 .dwtag DW_TAG_member
.dwattr $C$DW$72, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$72, DW_AT_name("RSVD2")
.dwattr $C$DW$72, DW_AT_TI_symbol_name("_RSVD2")
.dwattr $C$DW$72, DW_AT_data_member_location[DW_OP_plus_uconst 0x15]
.dwattr $C$DW$72, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$73 .dwtag DW_TAG_member
.dwattr $C$DW$73, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$73, DW_AT_name("ODSCR")
.dwattr $C$DW$73, DW_AT_TI_symbol_name("_ODSCR")
.dwattr $C$DW$73, DW_AT_data_member_location[DW_OP_plus_uconst 0x16]
.dwattr $C$DW$73, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$74 .dwtag DW_TAG_member
.dwattr $C$DW$74, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$74, DW_AT_name("PDINHIBR1")
.dwattr $C$DW$74, DW_AT_TI_symbol_name("_PDINHIBR1")
.dwattr $C$DW$74, DW_AT_data_member_location[DW_OP_plus_uconst 0x17]
.dwattr $C$DW$74, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$75 .dwtag DW_TAG_member
.dwattr $C$DW$75, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$75, DW_AT_name("PDINHIBR2")
.dwattr $C$DW$75, DW_AT_TI_symbol_name("_PDINHIBR2")
.dwattr $C$DW$75, DW_AT_data_member_location[DW_OP_plus_uconst 0x18]
.dwattr $C$DW$75, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$76 .dwtag DW_TAG_member
.dwattr $C$DW$76, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$76, DW_AT_name("PDINHIBR3")
.dwattr $C$DW$76, DW_AT_TI_symbol_name("_PDINHIBR3")
.dwattr $C$DW$76, DW_AT_data_member_location[DW_OP_plus_uconst 0x19]
.dwattr $C$DW$76, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$77 .dwtag DW_TAG_member
.dwattr $C$DW$77, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$77, DW_AT_name("DMA0CESR1")
.dwattr $C$DW$77, DW_AT_TI_symbol_name("_DMA0CESR1")
.dwattr $C$DW$77, DW_AT_data_member_location[DW_OP_plus_uconst 0x1a]
.dwattr $C$DW$77, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$78 .dwtag DW_TAG_member
.dwattr $C$DW$78, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$78, DW_AT_name("DMA0CESR2")
.dwattr $C$DW$78, DW_AT_TI_symbol_name("_DMA0CESR2")
.dwattr $C$DW$78, DW_AT_data_member_location[DW_OP_plus_uconst 0x1b]
.dwattr $C$DW$78, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$79 .dwtag DW_TAG_member
.dwattr $C$DW$79, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$79, DW_AT_name("DMA1CESR1")
.dwattr $C$DW$79, DW_AT_TI_symbol_name("_DMA1CESR1")
.dwattr $C$DW$79, DW_AT_data_member_location[DW_OP_plus_uconst 0x1c]
.dwattr $C$DW$79, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$80 .dwtag DW_TAG_member
.dwattr $C$DW$80, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$80, DW_AT_name("DMA1CESR2")
.dwattr $C$DW$80, DW_AT_TI_symbol_name("_DMA1CESR2")
.dwattr $C$DW$80, DW_AT_data_member_location[DW_OP_plus_uconst 0x1d]
.dwattr $C$DW$80, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$81 .dwtag DW_TAG_member
.dwattr $C$DW$81, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$81, DW_AT_name("SDRAMCCR")
.dwattr $C$DW$81, DW_AT_TI_symbol_name("_SDRAMCCR")
.dwattr $C$DW$81, DW_AT_data_member_location[DW_OP_plus_uconst 0x1e]
.dwattr $C$DW$81, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$82 .dwtag DW_TAG_member
.dwattr $C$DW$82, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$82, DW_AT_name("CCR2")
.dwattr $C$DW$82, DW_AT_TI_symbol_name("_CCR2")
.dwattr $C$DW$82, DW_AT_data_member_location[DW_OP_plus_uconst 0x1f]
.dwattr $C$DW$82, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$83 .dwtag DW_TAG_member
.dwattr $C$DW$83, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$83, DW_AT_name("CGCR1")
.dwattr $C$DW$83, DW_AT_TI_symbol_name("_CGCR1")
.dwattr $C$DW$83, DW_AT_data_member_location[DW_OP_plus_uconst 0x20]
.dwattr $C$DW$83, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$84 .dwtag DW_TAG_member
.dwattr $C$DW$84, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$84, DW_AT_name("CGICR")
.dwattr $C$DW$84, DW_AT_TI_symbol_name("_CGICR")
.dwattr $C$DW$84, DW_AT_data_member_location[DW_OP_plus_uconst 0x21]
.dwattr $C$DW$84, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$85 .dwtag DW_TAG_member
.dwattr $C$DW$85, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$85, DW_AT_name("CGCR2")
.dwattr $C$DW$85, DW_AT_TI_symbol_name("_CGCR2")
.dwattr $C$DW$85, DW_AT_data_member_location[DW_OP_plus_uconst 0x22]
.dwattr $C$DW$85, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$86 .dwtag DW_TAG_member
.dwattr $C$DW$86, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$86, DW_AT_name("CGOCR")
.dwattr $C$DW$86, DW_AT_TI_symbol_name("_CGOCR")
.dwattr $C$DW$86, DW_AT_data_member_location[DW_OP_plus_uconst 0x23]
.dwattr $C$DW$86, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$87 .dwtag DW_TAG_member
.dwattr $C$DW$87, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$87, DW_AT_name("CCSSR")
.dwattr $C$DW$87, DW_AT_TI_symbol_name("_CCSSR")
.dwattr $C$DW$87, DW_AT_data_member_location[DW_OP_plus_uconst 0x24]
.dwattr $C$DW$87, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$88 .dwtag DW_TAG_member
.dwattr $C$DW$88, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$88, DW_AT_name("RSVD3")
.dwattr $C$DW$88, DW_AT_TI_symbol_name("_RSVD3")
.dwattr $C$DW$88, DW_AT_data_member_location[DW_OP_plus_uconst 0x25]
.dwattr $C$DW$88, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$89 .dwtag DW_TAG_member
.dwattr $C$DW$89, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$89, DW_AT_name("ECDR")
.dwattr $C$DW$89, DW_AT_TI_symbol_name("_ECDR")
.dwattr $C$DW$89, DW_AT_data_member_location[DW_OP_plus_uconst 0x26]
.dwattr $C$DW$89, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$90 .dwtag DW_TAG_member
.dwattr $C$DW$90, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$90, DW_AT_name("RSVD4")
.dwattr $C$DW$90, DW_AT_TI_symbol_name("_RSVD4")
.dwattr $C$DW$90, DW_AT_data_member_location[DW_OP_plus_uconst 0x27]
.dwattr $C$DW$90, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$91 .dwtag DW_TAG_member
.dwattr $C$DW$91, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$91, DW_AT_name("RAMSLPMDCNTLR1")
.dwattr $C$DW$91, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR1")
.dwattr $C$DW$91, DW_AT_data_member_location[DW_OP_plus_uconst 0x28]
.dwattr $C$DW$91, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$92 .dwtag DW_TAG_member
.dwattr $C$DW$92, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$92, DW_AT_name("RSVD5")
.dwattr $C$DW$92, DW_AT_TI_symbol_name("_RSVD5")
.dwattr $C$DW$92, DW_AT_data_member_location[DW_OP_plus_uconst 0x29]
.dwattr $C$DW$92, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$93 .dwtag DW_TAG_member
.dwattr $C$DW$93, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$93, DW_AT_name("RAMSLPMDCNTLR2")
.dwattr $C$DW$93, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR2")
.dwattr $C$DW$93, DW_AT_data_member_location[DW_OP_plus_uconst 0x2a]
.dwattr $C$DW$93, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$94 .dwtag DW_TAG_member
.dwattr $C$DW$94, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$94, DW_AT_name("RAMSLPMDCNTLR3")
.dwattr $C$DW$94, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR3")
.dwattr $C$DW$94, DW_AT_data_member_location[DW_OP_plus_uconst 0x2b]
.dwattr $C$DW$94, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$95 .dwtag DW_TAG_member
.dwattr $C$DW$95, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$95, DW_AT_name("RAMSLPMDCNTLR4")
.dwattr $C$DW$95, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR4")
.dwattr $C$DW$95, DW_AT_data_member_location[DW_OP_plus_uconst 0x2c]
.dwattr $C$DW$95, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$96 .dwtag DW_TAG_member
.dwattr $C$DW$96, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$96, DW_AT_name("RAMSLPMDCNTLR5")
.dwattr $C$DW$96, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR5")
.dwattr $C$DW$96, DW_AT_data_member_location[DW_OP_plus_uconst 0x2d]
.dwattr $C$DW$96, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$97 .dwtag DW_TAG_member
.dwattr $C$DW$97, DW_AT_type(*$C$DW$T$22)
.dwattr $C$DW$97, DW_AT_name("RSVD6")
.dwattr $C$DW$97, DW_AT_TI_symbol_name("_RSVD6")
.dwattr $C$DW$97, DW_AT_data_member_location[DW_OP_plus_uconst 0x2e]
.dwattr $C$DW$97, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$98 .dwtag DW_TAG_member
.dwattr $C$DW$98, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$98, DW_AT_name("DMAIFR")
.dwattr $C$DW$98, DW_AT_TI_symbol_name("_DMAIFR")
.dwattr $C$DW$98, DW_AT_data_member_location[DW_OP_plus_uconst 0x30]
.dwattr $C$DW$98, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$99 .dwtag DW_TAG_member
.dwattr $C$DW$99, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$99, DW_AT_name("DMAIER")
.dwattr $C$DW$99, DW_AT_TI_symbol_name("_DMAIER")
.dwattr $C$DW$99, DW_AT_data_member_location[DW_OP_plus_uconst 0x31]
.dwattr $C$DW$99, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$100 .dwtag DW_TAG_member
.dwattr $C$DW$100, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$100, DW_AT_name("USBSCR")
.dwattr $C$DW$100, DW_AT_TI_symbol_name("_USBSCR")
.dwattr $C$DW$100, DW_AT_data_member_location[DW_OP_plus_uconst 0x32]
.dwattr $C$DW$100, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$101 .dwtag DW_TAG_member
.dwattr $C$DW$101, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$101, DW_AT_name("ESCR")
.dwattr $C$DW$101, DW_AT_TI_symbol_name("_ESCR")
.dwattr $C$DW$101, DW_AT_data_member_location[DW_OP_plus_uconst 0x33]
.dwattr $C$DW$101, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$102 .dwtag DW_TAG_member
.dwattr $C$DW$102, DW_AT_type(*$C$DW$T$22)
.dwattr $C$DW$102, DW_AT_name("RSVD7")
.dwattr $C$DW$102, DW_AT_TI_symbol_name("_RSVD7")
.dwattr $C$DW$102, DW_AT_data_member_location[DW_OP_plus_uconst 0x34]
.dwattr $C$DW$102, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$103 .dwtag DW_TAG_member
.dwattr $C$DW$103, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$103, DW_AT_name("DMA2CESR1")
.dwattr $C$DW$103, DW_AT_TI_symbol_name("_DMA2CESR1")
.dwattr $C$DW$103, DW_AT_data_member_location[DW_OP_plus_uconst 0x36]
.dwattr $C$DW$103, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$104 .dwtag DW_TAG_member
.dwattr $C$DW$104, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$104, DW_AT_name("DMA2CESR2")
.dwattr $C$DW$104, DW_AT_TI_symbol_name("_DMA2CESR2")
.dwattr $C$DW$104, DW_AT_data_member_location[DW_OP_plus_uconst 0x37]
.dwattr $C$DW$104, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$105 .dwtag DW_TAG_member
.dwattr $C$DW$105, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$105, DW_AT_name("DMA3CESR1")
.dwattr $C$DW$105, DW_AT_TI_symbol_name("_DMA3CESR1")
.dwattr $C$DW$105, DW_AT_data_member_location[DW_OP_plus_uconst 0x38]
.dwattr $C$DW$105, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$106 .dwtag DW_TAG_member
.dwattr $C$DW$106, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$106, DW_AT_name("DMA3CESR2")
.dwattr $C$DW$106, DW_AT_TI_symbol_name("_DMA3CESR2")
.dwattr $C$DW$106, DW_AT_data_member_location[DW_OP_plus_uconst 0x39]
.dwattr $C$DW$106, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$107 .dwtag DW_TAG_member
.dwattr $C$DW$107, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$107, DW_AT_name("CLKSTOP")
.dwattr $C$DW$107, DW_AT_TI_symbol_name("_CLKSTOP")
.dwattr $C$DW$107, DW_AT_data_member_location[DW_OP_plus_uconst 0x3a]
.dwattr $C$DW$107, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$108 .dwtag DW_TAG_member
.dwattr $C$DW$108, DW_AT_type(*$C$DW$T$23)
.dwattr $C$DW$108, DW_AT_name("RSVD8")
.dwattr $C$DW$108, DW_AT_TI_symbol_name("_RSVD8")
.dwattr $C$DW$108, DW_AT_data_member_location[DW_OP_plus_uconst 0x3b]
.dwattr $C$DW$108, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$109 .dwtag DW_TAG_member
.dwattr $C$DW$109, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$109, DW_AT_name("DIEIDR0")
.dwattr $C$DW$109, DW_AT_TI_symbol_name("_DIEIDR0")
.dwattr $C$DW$109, DW_AT_data_member_location[DW_OP_plus_uconst 0x40]
.dwattr $C$DW$109, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$110 .dwtag DW_TAG_member
.dwattr $C$DW$110, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$110, DW_AT_name("DIEIDR1")
.dwattr $C$DW$110, DW_AT_TI_symbol_name("_DIEIDR1")
.dwattr $C$DW$110, DW_AT_data_member_location[DW_OP_plus_uconst 0x41]
.dwattr $C$DW$110, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$111 .dwtag DW_TAG_member
.dwattr $C$DW$111, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$111, DW_AT_name("DIEIDR2")
.dwattr $C$DW$111, DW_AT_TI_symbol_name("_DIEIDR2")
.dwattr $C$DW$111, DW_AT_data_member_location[DW_OP_plus_uconst 0x42]
.dwattr $C$DW$111, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$112 .dwtag DW_TAG_member
.dwattr $C$DW$112, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$112, DW_AT_name("DIEIDR3")
.dwattr $C$DW$112, DW_AT_TI_symbol_name("_DIEIDR3")
.dwattr $C$DW$112, DW_AT_data_member_location[DW_OP_plus_uconst 0x43]
.dwattr $C$DW$112, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$113 .dwtag DW_TAG_member
.dwattr $C$DW$113, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$113, DW_AT_name("DIEIDR4")
.dwattr $C$DW$113, DW_AT_TI_symbol_name("_DIEIDR4")
.dwattr $C$DW$113, DW_AT_data_member_location[DW_OP_plus_uconst 0x44]
.dwattr $C$DW$113, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$114 .dwtag DW_TAG_member
.dwattr $C$DW$114, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$114, DW_AT_name("DIEIDR5")
.dwattr $C$DW$114, DW_AT_TI_symbol_name("_DIEIDR5")
.dwattr $C$DW$114, DW_AT_data_member_location[DW_OP_plus_uconst 0x45]
.dwattr $C$DW$114, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$115 .dwtag DW_TAG_member
.dwattr $C$DW$115, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$115, DW_AT_name("DIEIDR6")
.dwattr $C$DW$115, DW_AT_TI_symbol_name("_DIEIDR6")
.dwattr $C$DW$115, DW_AT_data_member_location[DW_OP_plus_uconst 0x46]
.dwattr $C$DW$115, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$116 .dwtag DW_TAG_member
.dwattr $C$DW$116, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$116, DW_AT_name("DIEIDR7")
.dwattr $C$DW$116, DW_AT_TI_symbol_name("_DIEIDR7")
.dwattr $C$DW$116, DW_AT_data_member_location[DW_OP_plus_uconst 0x47]
.dwattr $C$DW$116, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$24
$C$DW$T$29 .dwtag DW_TAG_typedef, DW_AT_name("CSL_SysRegs")
.dwattr $C$DW$T$29, DW_AT_type(*$C$DW$T$24)
.dwattr $C$DW$T$29, DW_AT_language(DW_LANG_C)
$C$DW$117 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$117, DW_AT_type(*$C$DW$T$29)
$C$DW$118 .dwtag DW_TAG_TI_ioport_type
.dwattr $C$DW$118, DW_AT_type(*$C$DW$117)
$C$DW$T$30 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$30, DW_AT_type(*$C$DW$118)
$C$DW$T$31 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$31, DW_AT_type(*$C$DW$T$30)
.dwattr $C$DW$T$31, DW_AT_address_class(0x10)
$C$DW$T$32 .dwtag DW_TAG_typedef, DW_AT_name("CSL_SysRegsOvly")
.dwattr $C$DW$T$32, DW_AT_type(*$C$DW$T$31)
.dwattr $C$DW$T$32, DW_AT_language(DW_LANG_C)
$C$DW$T$4 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$4, DW_AT_encoding(DW_ATE_boolean)
.dwattr $C$DW$T$4, DW_AT_name("bool")
.dwattr $C$DW$T$4, DW_AT_byte_size(0x01)
$C$DW$T$5 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$5, DW_AT_encoding(DW_ATE_signed_char)
.dwattr $C$DW$T$5, DW_AT_name("signed char")
.dwattr $C$DW$T$5, DW_AT_byte_size(0x01)
$C$DW$T$6 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$6, DW_AT_encoding(DW_ATE_unsigned_char)
.dwattr $C$DW$T$6, DW_AT_name("unsigned char")
.dwattr $C$DW$T$6, DW_AT_byte_size(0x01)
$C$DW$T$7 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$7, DW_AT_encoding(DW_ATE_signed_char)
.dwattr $C$DW$T$7, DW_AT_name("wchar_t")
.dwattr $C$DW$T$7, DW_AT_byte_size(0x01)
$C$DW$T$8 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$8, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$8, DW_AT_name("short")
.dwattr $C$DW$T$8, DW_AT_byte_size(0x01)
$C$DW$T$33 .dwtag DW_TAG_typedef, DW_AT_name("Int16")
.dwattr $C$DW$T$33, DW_AT_type(*$C$DW$T$8)
.dwattr $C$DW$T$33, DW_AT_language(DW_LANG_C)
$C$DW$T$34 .dwtag DW_TAG_typedef, DW_AT_name("CSL_Status")
.dwattr $C$DW$T$34, DW_AT_type(*$C$DW$T$33)
.dwattr $C$DW$T$34, DW_AT_language(DW_LANG_C)
$C$DW$T$9 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$9, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$9, DW_AT_name("unsigned short")
.dwattr $C$DW$T$9, DW_AT_byte_size(0x01)
$C$DW$T$19 .dwtag DW_TAG_typedef, DW_AT_name("Uint16")
.dwattr $C$DW$T$19, DW_AT_type(*$C$DW$T$9)
.dwattr $C$DW$T$19, DW_AT_language(DW_LANG_C)
$C$DW$119 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$119, DW_AT_type(*$C$DW$T$19)
$C$DW$T$20 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$20, DW_AT_type(*$C$DW$119)
$C$DW$T$21 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$21, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$21, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$21, DW_AT_byte_size(0x0e)
$C$DW$120 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$120, DW_AT_upper_bound(0x0d)
.dwendtag $C$DW$T$21
$C$DW$T$22 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$22, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$22, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$22, DW_AT_byte_size(0x02)
$C$DW$121 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$121, DW_AT_upper_bound(0x01)
.dwendtag $C$DW$T$22
$C$DW$T$23 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$23, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$23, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$23, DW_AT_byte_size(0x05)
$C$DW$122 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$122, DW_AT_upper_bound(0x04)
.dwendtag $C$DW$T$23
$C$DW$123 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$123, DW_AT_type(*$C$DW$T$19)
$C$DW$124 .dwtag DW_TAG_TI_ioport_type
.dwattr $C$DW$124, DW_AT_type(*$C$DW$123)
$C$DW$T$40 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$40, DW_AT_type(*$C$DW$124)
$C$DW$T$41 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$41, DW_AT_type(*$C$DW$T$40)
.dwattr $C$DW$T$41, DW_AT_address_class(0x10)
$C$DW$T$10 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$10, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$10, DW_AT_name("int")
.dwattr $C$DW$T$10, DW_AT_byte_size(0x01)
$C$DW$T$42 .dwtag DW_TAG_typedef, DW_AT_name("Bool")
.dwattr $C$DW$T$42, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$T$42, DW_AT_language(DW_LANG_C)
$C$DW$T$11 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$11, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$11, DW_AT_name("unsigned int")
.dwattr $C$DW$T$11, DW_AT_byte_size(0x01)
$C$DW$T$12 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$12, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$12, DW_AT_name("long")
.dwattr $C$DW$T$12, DW_AT_byte_size(0x02)
$C$DW$T$13 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$13, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$13, DW_AT_name("unsigned long")
.dwattr $C$DW$T$13, DW_AT_byte_size(0x02)
$C$DW$T$37 .dwtag DW_TAG_typedef, DW_AT_name("Uint32")
.dwattr $C$DW$T$37, DW_AT_type(*$C$DW$T$13)
.dwattr $C$DW$T$37, DW_AT_language(DW_LANG_C)
$C$DW$T$14 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$14, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$14, DW_AT_name("long long")
.dwattr $C$DW$T$14, DW_AT_byte_size(0x04)
.dwattr $C$DW$T$14, DW_AT_bit_size(0x28)
.dwattr $C$DW$T$14, DW_AT_bit_offset(0x18)
$C$DW$T$15 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$15, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$15, DW_AT_name("unsigned long long")
.dwattr $C$DW$T$15, DW_AT_byte_size(0x04)
.dwattr $C$DW$T$15, DW_AT_bit_size(0x28)
.dwattr $C$DW$T$15, DW_AT_bit_offset(0x18)
$C$DW$T$16 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$16, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$16, DW_AT_name("float")
.dwattr $C$DW$T$16, DW_AT_byte_size(0x02)
$C$DW$T$17 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$17, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$17, DW_AT_name("double")
.dwattr $C$DW$T$17, DW_AT_byte_size(0x02)
$C$DW$T$18 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$18, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$18, DW_AT_name("long double")
.dwattr $C$DW$T$18, DW_AT_byte_size(0x02)
.dwattr $C$DW$CU, DW_AT_language(DW_LANG_C)
;***************************************************************
;* DWARF CIE ENTRIES *
;***************************************************************
$C$DW$CIE .dwcie 91
.dwcfi cfa_register, 36
.dwcfi cfa_offset, 0
.dwcfi undefined, 0
.dwcfi undefined, 1
.dwcfi undefined, 2
.dwcfi undefined, 3
.dwcfi undefined, 4
.dwcfi undefined, 5
.dwcfi undefined, 6
.dwcfi undefined, 7
.dwcfi undefined, 8
.dwcfi undefined, 9
.dwcfi undefined, 10
.dwcfi undefined, 11
.dwcfi undefined, 12
.dwcfi undefined, 13
.dwcfi same_value, 14
.dwcfi same_value, 15
.dwcfi undefined, 16
.dwcfi undefined, 17
.dwcfi undefined, 18
.dwcfi undefined, 19
.dwcfi undefined, 20
.dwcfi undefined, 21
.dwcfi undefined, 22
.dwcfi undefined, 23
.dwcfi undefined, 24
.dwcfi undefined, 25
.dwcfi same_value, 26
.dwcfi same_value, 27
.dwcfi same_value, 28
.dwcfi same_value, 29
.dwcfi same_value, 30
.dwcfi same_value, 31
.dwcfi undefined, 32
.dwcfi undefined, 33
.dwcfi undefined, 34
.dwcfi undefined, 35
.dwcfi undefined, 36
.dwcfi undefined, 37
.dwcfi undefined, 38
.dwcfi undefined, 39
.dwcfi undefined, 40
.dwcfi undefined, 41
.dwcfi undefined, 42
.dwcfi undefined, 43
.dwcfi undefined, 44
.dwcfi undefined, 45
.dwcfi undefined, 46
.dwcfi undefined, 47
.dwcfi undefined, 48
.dwcfi undefined, 49
.dwcfi undefined, 50
.dwcfi undefined, 51
.dwcfi undefined, 52
.dwcfi undefined, 53
.dwcfi undefined, 54
.dwcfi undefined, 55
.dwcfi undefined, 56
.dwcfi undefined, 57
.dwcfi undefined, 58
.dwcfi undefined, 59
.dwcfi undefined, 60
.dwcfi undefined, 61
.dwcfi undefined, 62
.dwcfi undefined, 63
.dwcfi undefined, 64
.dwcfi undefined, 65
.dwcfi undefined, 66
.dwcfi undefined, 67
.dwcfi undefined, 68
.dwcfi undefined, 69
.dwcfi undefined, 70
.dwcfi undefined, 71
.dwcfi undefined, 72
.dwcfi undefined, 73
.dwcfi undefined, 74
.dwcfi undefined, 75
.dwcfi undefined, 76
.dwcfi undefined, 77
.dwcfi undefined, 78
.dwcfi undefined, 79
.dwcfi undefined, 80
.dwcfi undefined, 81
.dwcfi undefined, 82
.dwcfi undefined, 83
.dwcfi undefined, 84
.dwcfi undefined, 85
.dwcfi undefined, 86
.dwcfi undefined, 87
.dwcfi undefined, 88
.dwcfi undefined, 89
.dwcfi undefined, 90
.dwcfi undefined, 91
.dwendentry
;***************************************************************
;* DWARF REGISTER MAP *
;***************************************************************
$C$DW$125 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0")
.dwattr $C$DW$125, DW_AT_location[DW_OP_reg0]
$C$DW$126 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0")
.dwattr $C$DW$126, DW_AT_location[DW_OP_reg1]
$C$DW$127 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0_G")
.dwattr $C$DW$127, DW_AT_location[DW_OP_reg2]
$C$DW$128 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1")
.dwattr $C$DW$128, DW_AT_location[DW_OP_reg3]
$C$DW$129 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1")
.dwattr $C$DW$129, DW_AT_location[DW_OP_reg4]
$C$DW$130 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1_G")
.dwattr $C$DW$130, DW_AT_location[DW_OP_reg5]
$C$DW$131 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2")
.dwattr $C$DW$131, DW_AT_location[DW_OP_reg6]
$C$DW$132 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2")
.dwattr $C$DW$132, DW_AT_location[DW_OP_reg7]
$C$DW$133 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2_G")
.dwattr $C$DW$133, DW_AT_location[DW_OP_reg8]
$C$DW$134 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3")
.dwattr $C$DW$134, DW_AT_location[DW_OP_reg9]
$C$DW$135 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3")
.dwattr $C$DW$135, DW_AT_location[DW_OP_reg10]
$C$DW$136 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3_G")
.dwattr $C$DW$136, DW_AT_location[DW_OP_reg11]
$C$DW$137 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T0")
.dwattr $C$DW$137, DW_AT_location[DW_OP_reg12]
$C$DW$138 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T1")
.dwattr $C$DW$138, DW_AT_location[DW_OP_reg13]
$C$DW$139 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T2")
.dwattr $C$DW$139, DW_AT_location[DW_OP_reg14]
$C$DW$140 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T3")
.dwattr $C$DW$140, DW_AT_location[DW_OP_reg15]
$C$DW$141 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0")
.dwattr $C$DW$141, DW_AT_location[DW_OP_reg16]
$C$DW$142 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR0")
.dwattr $C$DW$142, DW_AT_location[DW_OP_reg17]
$C$DW$143 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1")
.dwattr $C$DW$143, DW_AT_location[DW_OP_reg18]
$C$DW$144 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR1")
.dwattr $C$DW$144, DW_AT_location[DW_OP_reg19]
$C$DW$145 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2")
.dwattr $C$DW$145, DW_AT_location[DW_OP_reg20]
$C$DW$146 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR2")
.dwattr $C$DW$146, DW_AT_location[DW_OP_reg21]
$C$DW$147 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3")
.dwattr $C$DW$147, DW_AT_location[DW_OP_reg22]
$C$DW$148 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR3")
.dwattr $C$DW$148, DW_AT_location[DW_OP_reg23]
$C$DW$149 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4")
.dwattr $C$DW$149, DW_AT_location[DW_OP_reg24]
$C$DW$150 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR4")
.dwattr $C$DW$150, DW_AT_location[DW_OP_reg25]
$C$DW$151 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5")
.dwattr $C$DW$151, DW_AT_location[DW_OP_reg26]
$C$DW$152 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR5")
.dwattr $C$DW$152, DW_AT_location[DW_OP_reg27]
$C$DW$153 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6")
.dwattr $C$DW$153, DW_AT_location[DW_OP_reg28]
$C$DW$154 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR6")
.dwattr $C$DW$154, DW_AT_location[DW_OP_reg29]
$C$DW$155 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7")
.dwattr $C$DW$155, DW_AT_location[DW_OP_reg30]
$C$DW$156 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR7")
.dwattr $C$DW$156, DW_AT_location[DW_OP_reg31]
$C$DW$157 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FP")
.dwattr $C$DW$157, DW_AT_location[DW_OP_regx 0x20]
$C$DW$158 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XFP")
.dwattr $C$DW$158, DW_AT_location[DW_OP_regx 0x21]
$C$DW$159 .dwtag DW_TAG_TI_assign_register, DW_AT_name("PC")
.dwattr $C$DW$159, DW_AT_location[DW_OP_regx 0x22]
$C$DW$160 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SP")
.dwattr $C$DW$160, DW_AT_location[DW_OP_regx 0x23]
$C$DW$161 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XSP")
.dwattr $C$DW$161, DW_AT_location[DW_OP_regx 0x24]
$C$DW$162 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BKC")
.dwattr $C$DW$162, DW_AT_location[DW_OP_regx 0x25]
$C$DW$163 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK03")
.dwattr $C$DW$163, DW_AT_location[DW_OP_regx 0x26]
$C$DW$164 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK47")
.dwattr $C$DW$164, DW_AT_location[DW_OP_regx 0x27]
$C$DW$165 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST0")
.dwattr $C$DW$165, DW_AT_location[DW_OP_regx 0x28]
$C$DW$166 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST1")
.dwattr $C$DW$166, DW_AT_location[DW_OP_regx 0x29]
$C$DW$167 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST2")
.dwattr $C$DW$167, DW_AT_location[DW_OP_regx 0x2a]
$C$DW$168 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST3")
.dwattr $C$DW$168, DW_AT_location[DW_OP_regx 0x2b]
$C$DW$169 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP")
.dwattr $C$DW$169, DW_AT_location[DW_OP_regx 0x2c]
$C$DW$170 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP05")
.dwattr $C$DW$170, DW_AT_location[DW_OP_regx 0x2d]
$C$DW$171 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP67")
.dwattr $C$DW$171, DW_AT_location[DW_OP_regx 0x2e]
$C$DW$172 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC0")
.dwattr $C$DW$172, DW_AT_location[DW_OP_regx 0x2f]
$C$DW$173 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0")
.dwattr $C$DW$173, DW_AT_location[DW_OP_regx 0x30]
$C$DW$174 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0_H")
.dwattr $C$DW$174, DW_AT_location[DW_OP_regx 0x31]
$C$DW$175 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0")
.dwattr $C$DW$175, DW_AT_location[DW_OP_regx 0x32]
$C$DW$176 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0_H")
.dwattr $C$DW$176, DW_AT_location[DW_OP_regx 0x33]
$C$DW$177 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRS1")
.dwattr $C$DW$177, DW_AT_location[DW_OP_regx 0x34]
$C$DW$178 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC1")
.dwattr $C$DW$178, DW_AT_location[DW_OP_regx 0x35]
$C$DW$179 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1")
.dwattr $C$DW$179, DW_AT_location[DW_OP_regx 0x36]
$C$DW$180 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1_H")
.dwattr $C$DW$180, DW_AT_location[DW_OP_regx 0x37]
$C$DW$181 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1")
.dwattr $C$DW$181, DW_AT_location[DW_OP_regx 0x38]
$C$DW$182 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1_H")
.dwattr $C$DW$182, DW_AT_location[DW_OP_regx 0x39]
$C$DW$183 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CSR")
.dwattr $C$DW$183, DW_AT_location[DW_OP_regx 0x3a]
$C$DW$184 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RPTC")
.dwattr $C$DW$184, DW_AT_location[DW_OP_regx 0x3b]
$C$DW$185 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDP")
.dwattr $C$DW$185, DW_AT_location[DW_OP_regx 0x3c]
$C$DW$186 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XCDP")
.dwattr $C$DW$186, DW_AT_location[DW_OP_regx 0x3d]
$C$DW$187 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN0")
.dwattr $C$DW$187, DW_AT_location[DW_OP_regx 0x3e]
$C$DW$188 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN1")
.dwattr $C$DW$188, DW_AT_location[DW_OP_regx 0x3f]
$C$DW$189 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA01")
.dwattr $C$DW$189, DW_AT_location[DW_OP_regx 0x40]
$C$DW$190 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA23")
.dwattr $C$DW$190, DW_AT_location[DW_OP_regx 0x41]
$C$DW$191 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA45")
.dwattr $C$DW$191, DW_AT_location[DW_OP_regx 0x42]
$C$DW$192 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA67")
.dwattr $C$DW$192, DW_AT_location[DW_OP_regx 0x43]
$C$DW$193 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSAC")
.dwattr $C$DW$193, DW_AT_location[DW_OP_regx 0x44]
$C$DW$194 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CARRY")
.dwattr $C$DW$194, DW_AT_location[DW_OP_regx 0x45]
$C$DW$195 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC1")
.dwattr $C$DW$195, DW_AT_location[DW_OP_regx 0x46]
$C$DW$196 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC2")
.dwattr $C$DW$196, DW_AT_location[DW_OP_regx 0x47]
$C$DW$197 .dwtag DW_TAG_TI_assign_register, DW_AT_name("M40")
.dwattr $C$DW$197, DW_AT_location[DW_OP_regx 0x48]
$C$DW$198 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SXMD")
.dwattr $C$DW$198, DW_AT_location[DW_OP_regx 0x49]
$C$DW$199 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ARMS")
.dwattr $C$DW$199, DW_AT_location[DW_OP_regx 0x4a]
$C$DW$200 .dwtag DW_TAG_TI_assign_register, DW_AT_name("C54CM")
.dwattr $C$DW$200, DW_AT_location[DW_OP_regx 0x4b]
$C$DW$201 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATA")
.dwattr $C$DW$201, DW_AT_location[DW_OP_regx 0x4c]
$C$DW$202 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATD")
.dwattr $C$DW$202, DW_AT_location[DW_OP_regx 0x4d]
$C$DW$203 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RDM")
.dwattr $C$DW$203, DW_AT_location[DW_OP_regx 0x4e]
$C$DW$204 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FRCT")
.dwattr $C$DW$204, DW_AT_location[DW_OP_regx 0x4f]
$C$DW$205 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SMUL")
.dwattr $C$DW$205, DW_AT_location[DW_OP_regx 0x50]
$C$DW$206 .dwtag DW_TAG_TI_assign_register, DW_AT_name("INTM")
.dwattr $C$DW$206, DW_AT_location[DW_OP_regx 0x51]
$C$DW$207 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0LC")
.dwattr $C$DW$207, DW_AT_location[DW_OP_regx 0x52]
$C$DW$208 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1LC")
.dwattr $C$DW$208, DW_AT_location[DW_OP_regx 0x53]
$C$DW$209 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2LC")
.dwattr $C$DW$209, DW_AT_location[DW_OP_regx 0x54]
$C$DW$210 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3LC")
.dwattr $C$DW$210, DW_AT_location[DW_OP_regx 0x55]
$C$DW$211 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4LC")
.dwattr $C$DW$211, DW_AT_location[DW_OP_regx 0x56]
$C$DW$212 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5LC")
.dwattr $C$DW$212, DW_AT_location[DW_OP_regx 0x57]
$C$DW$213 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6LC")
.dwattr $C$DW$213, DW_AT_location[DW_OP_regx 0x58]
$C$DW$214 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7LC")
.dwattr $C$DW$214, DW_AT_location[DW_OP_regx 0x59]
$C$DW$215 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDPLC")
.dwattr $C$DW$215, DW_AT_location[DW_OP_regx 0x5a]
$C$DW$216 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CIE_RETA")
.dwattr $C$DW$216, DW_AT_location[DW_OP_regx 0x5b]
.dwendtag $C$DW$CU
|
// $Id: mouse.cpp,v 1.1 2003/05/06 03:32:35 bush Exp $
// Written by:
// Grant Macklem (Grant.Macklem@colorado.edu)
// Gregory Schmelter (Gregory.Schmelter@colorado.edu)
// Alan Schmidt (Alan.Schmidt@colorado.edu)
// Ivan Stashak (Ivan.Stashak@colorado.edu)
// CSCI 4830/7818: API Programming
// University of Colorado at Boulder, Spring 2003
// http://www.cs.colorado.edu/~main/bgi
//
#include <windows.h> // Provides Win32 API
#include <windowsx.h> // Provides GDI helper macros
#include "winbgi.h" // API routines
#include "winbgitypes.h" // Internal structure data
/*****************************************************************************
*
* Helper functions
*
*****************************************************************************/
// This function tests whether a given kind of mouse event is in range
// MGM: Added static to prevent linker conflicts
static bool MouseKindInRange( int kind )
{
return ( (kind >= WM_MOUSEFIRST) && (kind <= WM_MOUSELAST) );
}
/*****************************************************************************
*
* The actual API calls are implemented below
* MGM: Moved ismouseclick function to top to stop g++ 3.2.3 internal error.
*****************************************************************************/
__declspec(dllexport) bool ismouseclick( int kind )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
return ( MouseKindInRange( kind ) && pWndData->clicks[kind - WM_MOUSEFIRST].size( ) );
}
__declspec(dllexport) void clearmouseclick( int kind )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
// Clear the mouse event
if ( MouseKindInRange( kind ) && pWndData->clicks[kind - WM_MOUSEFIRST].size( ) )
pWndData->clicks[kind - WM_MOUSEFIRST].pop( );
}
__declspec(dllexport) void getmouseclick( int kind, int& x, int& y )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
POINTS where; // POINT (short) to tell where mouse event happened.
// Check if mouse event is in range
if ( !MouseKindInRange( kind ) )
return;
// Set position variables to mouse location, or to NO_CLICK if no event occured
if ( MouseKindInRange( kind ) && pWndData->clicks[kind - WM_MOUSEFIRST].size( ) )
{
where = pWndData->clicks[kind - WM_MOUSEFIRST].front( );
pWndData->clicks[kind - WM_MOUSEFIRST].pop( );
x = where.x;
y = where.y;
}
else
{
x = y = NO_CLICK;
}
}
void setmousequeuestatus( int kind, bool status )
{
if ( MouseKindInRange( kind ) )
BGI__GetWindowDataPtr( )->mouse_queuing[kind - WM_MOUSEFIRST] = status;
}
// TODO: This may be viewport relative. The documentation specifies with will range from 0 to getmaxx()
__declspec(dllexport) int mousex( )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
return pWndData->mouse.x;
}
// TODO: This may be viewport relative. The documentation specifies with will range from 0 to getmaxy()
__declspec(dllexport) int mousey( )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
return pWndData->mouse.y;
}
__declspec(dllexport) void registermousehandler( int kind, void h( int, int ) )
{
WindowData *pWndData = BGI__GetWindowDataPtr( );
if ( MouseKindInRange( kind ) )
pWndData->mouse_handlers[kind - WM_MOUSEFIRST] = h;
}
|
; size_t b_array_append(b_array_t *a, int c)
SECTION code_clib
SECTION code_adt_b_array
PUBLIC b_array_append_callee
EXTERN asm_b_array_append
b_array_append_callee:
pop hl
pop bc
ex (sp),hl
jp asm_b_array_append
|
; A122197: Fractal sequence: count up to successive integers twice.
; 1,1,1,2,1,2,1,2,3,1,2,3,1,2,3,4,1,2,3,4,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,3,4,5,6,7,8,9,10
mov $2,$0
add $2,1
mov $0,$2
lpb $0,1
mov $2,3
add $2,$3
mov $3,$1
mov $1,$0
trn $2,6
sub $0,$2
trn $0,1
add $3,3
sub $3,$1
lpe
|
<%
from pwnlib.shellcraft.aarch64 import mov
from pwnlib.shellcraft.aarch64.linux import read, readn, mmap
from pwnlib import constants as C
%>
<%page args="fd=0, length=None"/>
<%docstring>
Migrates shellcode to a new buffer.
Arguments:
fd(int):
Integer file descriptor to recv data from.
Default is stdin (0).
length(int):
Optional buffer length. If None, the first pointer-width
of data received is the length.
Example:
>>> p = run_assembly(shellcraft.stage())
>>> sc = asm(shellcraft.echo("Hello\n", constants.STDOUT_FILENO))
>>> p.pack(len(sc))
>>> p.send(sc)
>>> p.recvline()
b'Hello\n'
</%docstring>
<%
protection = C.PROT_READ | C.PROT_WRITE | C.PROT_EXEC
flags = C.MAP_ANONYMOUS | C.MAP_PRIVATE
assert isinstance(fd, int)
%>
%if length is None:
/* How many bytes should we receive? */
${read(fd, 'sp', 8)}
ldr x2, [sp]
%else:
${mov('x2', length)}
str x2, [sp]
%endif
/* Page-align, assume <4GB */
lsr x2, x2, #12
add x2, x2, #1
lsl x2, x2, #12
/* Map it */
${mmap(0, 'x2', protection, flags, 0, 0)}
/* Grab the saved size, save the address */
ldr x4, [sp]
/* Save the memory address */
str x0, [sp]
/* Read in all of the data */
${readn(fd, 'x0', 'x4')}
/* Go to shellcode */
ldr x30, [sp]
ret
|
//
// Auto-generated by CTMConverter tool.
//
// Max number of color shifts = 136
// Max number of active physical chars = 249
// Number of chars = 348
// Number of vir chars = 717
// Number of vir chars' = 756
// Number of tiles = 91
// Number of vir tiles = 154
// Number of vir tiles' = 154
// X symmetry (hires) char range = [0, 1)
// X symmetry char range = [0, 2)
// Y symmetry end char = 2
.filenamespace CharTileMap
.label kMaxPhysicalChars = 249
.label kMaxColorShifts = 136
.label kCharSymmetryXHiresStart = $00
.label kCharSymmetryXHiresEnd = $01
.label kCharSymmetryXStart = $00
.label kCharSymmetryXEnd = $02
.label kCharSymmetryYEnd = $02
.label kCharSymmetryEnd = $02
.label kTileSize = 5
.label kTileMapWidth = 183
.label kTileMapHeight = 5
.label kBackgroundColor = $00
.label kMulticolor1 = $09
.label kMulticolor2 = $01
.align 8
CharData:
.byte $00, $00, $00, $00, $00, $00, $00, $00 // $000
.byte $aa, $aa, $aa, $aa, $aa, $aa, $aa, $aa // $001
.byte $00, $00, $00, $00, $00, $00, $00, $51 // $002
.byte $00, $00, $00, $00, $04, $14, $10, $41 // $003
.byte $04, $04, $04, $04, $44, $44, $14, $51 // $004
.byte $1d, $3f, $3b, $1d, $0d, $07, $03, $01 // $005
.byte $00, $00, $00, $00, $00, $00, $40, $d0 // $006
.byte $00, $00, $00, $00, $00, $07, $1d, $34 // $007
.byte $00, $00, $00, $14, $74, $fc, $ec, $74 // $008
.byte $74, $1d, $1f, $1f, $1f, $3d, $74, $f0 // $009
.byte $70, $d0, $c0, $40, $00, $00, $00, $00 // $00a
.byte $00, $00, $01, $07, $1f, $3e, $7e, $5f // $00b
.byte $17, $7f, $ed, $b4, $b0, $f4, $f4, $f4 // $00c
.byte $d0, $44, $1c, $1c, $34, $34, $74, $74 // $00d
.byte $00, $00, $00, $00, $44, $44, $14, $51 // $00e
.byte $07, $1e, $1f, $1e, $77, $6d, $5f, $05 // $00f
.byte $40, $44, $d1, $f5, $9d, $f5, $51, $04 // $010
.byte $70, $70, $40, $40, $40, $50, $40, $50 // $011
.byte $50, $50, $70, $50, $70, $50, $70, $70 // $012
.byte $14, $54, $f5, $e5, $f5, $7d, $54, $14 // $013
.byte $34, $34, $3c, $3d, $1d, $4f, $0f, $04 // $014
.byte $00, $00, $00, $00, $04, $04, $14, $51 // $015
.byte $00, $00, $00, $14, $7d, $79, $7d, $14 // $016
.byte $00, $00, $00, $00, $00, $14, $7d, $6d // $017
.byte $d0, $70, $34, $1c, $0d, $07, $03, $01 // $018
.byte $14, $74, $74, $50, $10, $10, $40, $40 // $019
.byte $00, $00, $01, $01, $03, $07, $07, $07 // $01a
.byte $7d, $14, $c0, $c0, $40, $40, $00, $00 // $01b
.byte $00, $54, $f4, $e4, $74, $14, $00, $00 // $01c
.byte $00, $00, $00, $00, $50, $f4, $7c, $5d // $01d
.byte $0d, $00, $00, $00, $00, $07, $1d, $34 // $01e
.byte $1f, $0b, $0f, $0b, $0f, $0b, $1b, $1b // $01f
.byte $f0, $64, $3c, $1d, $0b, $0f, $06, $07 // $020
.byte $00, $00, $00, $00, $00, $40, $c0, $d0 // $021
.byte $3b, $79, $f9, $ed, $ec, $fc, $74, $54 // $022
.byte $07, $03, $03, $03, $01, $01, $07, $05 // $023
.byte $b4, $b5, $e5, $ef, $ef, $fb, $fb, $7d // $024
.byte $00, $00, $05, $1d, $1b, $7b, $69, $ed // $025
.byte $74, $44, $00, $5f, $79, $6d, $ed, $bd // $026
.byte $00, $00, $40, $50, $50, $10, $10, $10 // $027
.byte $ed, $ef, $ff, $ff, $f7, $df, $dd, $f5 // $028
.byte $b4, $f4, $f5, $d4, $55, $55, $54, $50 // $029
.byte $40, $40, $00, $40, $00, $00, $00, $00 // $02a
.byte $00, $00, $14, $34, $54, $40, $50, $40 // $02b
.byte $f5, $55, $d0, $d0, $d0, $d0, $d0, $d0 // $02c
.byte $00, $00, $00, $10, $30, $34, $1c, $1c // $02d
.byte $00, $00, $00, $c0, $40, $00, $40, $00 // $02e
.byte $50, $40, $10, $11, $11, $43, $43, $47 // $02f
.byte $d0, $d0, $d0, $c1, $c1, $41, $41, $41 // $030
.byte $1d, $0d, $0d, $0d, $0d, $0f, $0f, $0f // $031
.byte $00, $00, $40, $40, $40, $50, $40, $50 // $032
.byte $14, $34, $14, $10, $30, $10, $30, $10 // $033
.byte $0d, $0d, $1d, $35, $f5, $d5, $7f, $5f // $034
.byte $51, $70, $34, $0c, $0d, $5b, $e6, $d7 // $035
.byte $0b, $0b, $1b, $7f, $ed, $fd, $bf, $f5 // $036
.byte $34, $34, $34, $34, $1d, $1c, $1d, $0c // $037
.byte $50, $50, $40, $40, $40, $00, $00, $00 // $038
.byte $00, $00, $14, $30, $14, $00, $04, $00 // $039
.byte $05, $17, $1e, $1e, $06, $47, $d3, $f5 // $03a
.byte $50, $d4, $b5, $bd, $bd, $ff, $fd, $f5 // $03b
.byte $00, $00, $00, $40, $10, $44, $44, $44 // $03c
.byte $04, $04, $01, $04, $05, $04, $05, $05 // $03d
.byte $f4, $ec, $6d, $7b, $1b, $0f, $07, $00 // $03e
.byte $dd, $75, $15, $14, $55, $50, $54, $51 // $03f
.byte $01, $41, $01, $44, $04, $04, $40, $10 // $040
.byte $04, $04, $04, $01, $04, $01, $15, $1d // $041
.byte $44, $11, $00, $00, $01, $01, $00, $01 // $042
.byte $05, $05, $0c, $05, $0d, $1c, $1c, $34 // $043
.byte $1d, $0c, $0d, $05, $04, $15, $13, $51 // $044
.byte $00, $00, $40, $41, $43, $57, $5d, $f5 // $045
.byte $34, $74, $d4, $d0, $c0, $50, $54, $04 // $046
.byte $00, $00, $00, $00, $00, $50, $d0, $50 // $047
.byte $00, $00, $00, $00, $00, $00, $50, $50 // $048
.byte $51, $51, $71, $50, $70, $50, $70, $70 // $049
.byte $01, $01, $41, $44, $44, $14, $14, $51 // $04a
.byte $00, $00, $00, $00, $00, $01, $01, $01 // $04b
.byte $00, $00, $50, $50, $40, $00, $00, $00 // $04c
.byte $51, $51, $11, $10, $00, $00, $04, $44 // $04d
.byte $00, $40, $d0, $c0, $d0, $74, $74, $34 // $04e
.byte $00, $11, $11, $11, $11, $51, $74, $04 // $04f
.byte $40, $00, $04, $04, $10, $10, $44, $44 // $050
.byte $14, $7d, $6d, $7d, $14, $34, $34, $34 // $051
.byte $00, $01, $01, $03, $03, $07, $07, $07 // $052
.byte $00, $00, $00, $00, $34, $64, $74, $d4 // $053
.byte $34, $30, $34, $30, $34, $34, $34, $34 // $054
.byte $0d, $0d, $1d, $1c, $1c, $1c, $1c, $1c // $055
.byte $34, $3c, $34, $3c, $34, $51, $47, $07 // $056
.byte $14, $04, $05, $04, $01, $01, $00, $01 // $057
.byte $1e, $1e, $5b, $fb, $fb, $ef, $ef, $7d // $058
.byte $00, $00, $00, $00, $10, $00, $10, $04 // $059
.byte $17, $1f, $7b, $7b, $7d, $5d, $5d, $5d // $05a
.byte $54, $f4, $d5, $75, $11, $44, $11, $45 // $05b
.byte $10, $04, $04, $04, $04, $04, $05, $01 // $05c
.byte $57, $55, $5f, $7f, $7e, $7f, $5b, $6f // $05d
.byte $17, $dd, $ff, $fa, $de, $b7, $ed, $fc // $05e
.byte $77, $ff, $ff, $ef, $bf, $f5, $5d, $69 // $05f
.byte $54, $75, $d5, $74, $d1, $44, $10, $44 // $060
.byte $1d, $7f, $7b, $7e, $5f, $57, $55, $14 // $061
.byte $df, $77, $df, $f7, $55, $40, $11, $40 // $062
.byte $d4, $74, $54, $45, $05, $1d, $f5, $75 // $063
.byte $ef, $79, $3f, $1d, $17, $05, $41, $00 // $064
.byte $51, $44, $41, $44, $51, $44, $10, $00 // $065
.byte $24, $34, $3c, $2c, $3c, $2c, $3c, $24 // $066
.byte $00, $10, $04, $10, $10, $10, $00, $00 // $067
.byte $10, $10, $10, $40, $40, $00, $01, $03 // $068
.byte $50, $40, $01, $1c, $75, $c4, $c0, $40 // $069
.byte $00, $00, $01, $07, $1e, $7a, $7e, $7f // $06a
.byte $00, $00, $40, $d0, $d4, $94, $d5, $b5 // $06b
.byte $01, $01, $07, $1f, $97, $fb, $5d, $15 // $06c
.byte $7f, $5b, $df, $f7, $ff, $25, $df, $75 // $06d
.byte $f5, $b5, $f5, $f4, $90, $d0, $d0, $40 // $06e
.byte $fb, $db, $ff, $fb, $df, $5d, $5b, $5e // $06f
.byte $6f, $fb, $7f, $7d, $5d, $57, $1d, $07 // $070
.byte $05, $57, $ff, $d7, $7d, $7f, $1f, $0f // $071
.byte $7f, $fb, $ff, $af, $ef, $fb, $fb, $fe // $072
.byte $77, $ff, $dd, $ff, $fa, $de, $f7, $e7 // $073
.byte $5d, $f7, $fd, $d5, $ec, $bd, $bb, $ad // $074
.byte $41, $55, $75, $d5, $74, $11, $44, $10 // $075
.byte $17, $5d, $7f, $7b, $7e, $5f, $17, $45 // $076
.byte $fe, $fd, $ff, $7d, $fd, $dd, $fd, $f1 // $077
.byte $ad, $54, $74, $50, $54, $50, $44, $40 // $078
.byte $d5, $ef, $79, $3f, $5d, $17, $45, $11 // $079
.byte $44, $51, $44, $41, $44, $51, $44, $10 // $07a
.byte $54, $d4, $54, $d4, $50, $c0, $54, $fd // $07b
.byte $ff, $ae, $d5, $d7, $dd, $ff, $5d, $07 // $07c
.byte $50, $50, $50, $d4, $f4, $74, $74, $54 // $07d
.byte $d0, $d4, $f5, $6d, $ef, $bd, $bf, $bd // $07e
.byte $fd, $b5, $fd, $b5, $fc, $f4, $74, $f4 // $07f
.byte $70, $70, $54, $50, $50, $40, $50, $40 // $080
.byte $00, $00, $10, $04, $10, $10, $10, $10 // $081
.byte $07, $1e, $1e, $5f, $77, $ff, $f7, $bb // $082
.byte $50, $44, $d0, $c4, $10, $44, $51, $d4 // $083
.byte $fb, $7a, $7e, $1f, $1f, $17, $0d, $07 // $084
.byte $74, $dd, $f5, $b5, $d4, $51, $44, $11 // $085
.byte $05, $1d, $7d, $ea, $fb, $ef, $fb, $db // $086
.byte $00, $00, $40, $d0, $f4, $d4, $74, $d4 // $087
.byte $00, $00, $14, $14, $40, $40, $10, $10 // $088
.byte $00, $00, $00, $00, $00, $05, $0d, $05 // $089
.byte $14, $34, $14, $04, $04, $01, $01, $01 // $08a
.byte $40, $54, $75, $d5, $74, $11, $44, $10 // $08b
.byte $00, $04, $15, $1f, $1b, $7b, $7e, $7f // $08c
.byte $00, $00, $54, $d1, $f5, $dd, $55, $55 // $08d
.byte $16, $17, $05, $05, $01, $01, $01, $00 // $08e
.byte $50, $50, $50, $d5, $f5, $77, $77, $54 // $08f
.byte $05, $1f, $1e, $1f, $17, $05, $17, $05 // $090
.byte $40, $50, $d0, $94, $f5, $d4, $75, $d4 // $091
.byte $75, $54, $14, $10, $04, $10, $04, $10 // $092
.byte $00, $01, $07, $1f, $5e, $1a, $7a, $fa // $093
.byte $55, $75, $dd, $f7, $fd, $df, $fd, $ff // $094
.byte $41, $51, $41, $50, $54, $51, $d4, $51 // $095
.byte $fb, $7e, $5e, $77, $1f, $07, $11, $04 // $096
.byte $fd, $ff, $fd, $ff, $b7, $ff, $ef, $7f // $097
.byte $d4, $51, $d4, $50, $d0, $54, $40, $44 // $098
.byte $11, $04, $11, $05, $11, $04, $05, $01 // $099
.byte $1c, $40, $7c, $6d, $7d, $55, $75, $5d // $09a
.byte $40, $00, $44, $50, $14, $50, $00, $40 // $09b
.byte $75, $15, $74, $15, $44, $54, $44, $10 // $09c
.byte $40, $40, $10, $40, $51, $40, $50, $51 // $09d
.byte $14, $74, $74, $50, $00, $00, $00, $10 // $09e
.byte $40, $00, $00, $40, $c1, $c5, $45, $41 // $09f
.byte $10, $10, $51, $41, $41, $41, $45, $15 // $0a0
.byte $01, $01, $05, $05, $04, $54, $50, $00 // $0a1
.byte $34, $74, $70, $74, $70, $74, $75, $5d // $0a2
.byte $04, $14, $10, $10, $10, $40, $40, $00 // $0a3
.byte $05, $03, $03, $01, $00, $00, $00, $00 // $0a4
.byte $1c, $3c, $1c, $3c, $1c, $3d, $3d, $3d // $0a5
.byte $6d, $7d, $6d, $ed, $e9, $ed, $ed, $7d // $0a6
.byte $00, $00, $00, $14, $7d, $6d, $7d, $d4 // $0a7
.byte $00, $15, $1d, $7b, $dd, $54, $00, $00 // $0a8
.byte $1d, $3f, $3b, $1d, $0d, $07, $03, $05 // $0a9
.byte $07, $0d, $1c, $34, $30, $10, $40, $d0 // $0aa
.byte $0c, $19, $3c, $74, $e0, $f0, $90, $d0 // $0ab
.byte $1e, $5e, $59, $f7, $df, $fe, $7e, $5f // $0ac
.byte $d7, $7f, $ed, $b4, $b0, $f4, $f4, $f4 // $0ad
.byte $70, $d0, $c0, $40, $00, $00, $00, $01 // $0ae
.byte $00, $00, $00, $00, $00, $00, $00, $03 // $0af
.byte $01, $01, $10, $10, $11, $1f, $1f, $55 // $0b0
.byte $03, $47, $5d, $74, $d0, $51, $0f, $05 // $0b1
.byte $00, $00, $00, $00, $00, $01, $01, $04 // $0b2
.byte $04, $04, $10, $10, $00, $00, $40, $d0 // $0b3
.byte $00, $00, $00, $04, $11, $04, $11, $45 // $0b4
.byte $00, $01, $44, $11, $45, $55, $5d, $77 // $0b5
.byte $01, $14, $45, $57, $5d, $7d, $d7, $7f // $0b6
.byte $11, $55, $5d, $77, $dd, $ff, $fe, $bb // $0b7
.byte $00, $00, $01, $00, $01, $00, $01, $04 // $0b8
.byte $15, $57, $1d, $57, $17, $7f, $1e, $7f // $0b9
.byte $dd, $77, $ff, $fe, $ee, $ba, $ea, $ba // $0ba
.byte $fe, $eb, $ba, $ea, $aa, $aa, $aa, $aa // $0bb
.byte $01, $04, $01, $04, $01, $04, $01, $04 // $0bc
.byte $1e, $7b, $de, $fe, $7a, $fe, $7b, $fe // $0bd
.byte $ea, $aa, $ba, $aa, $ea, $aa, $aa, $aa // $0be
.byte $7a, $fe, $fe, $7b, $de, $7f, $5e, $7f // $0bf
.byte $ea, $aa, $aa, $aa, $aa, $aa, $ea, $aa // $0c0
.byte $00, $05, $00, $05, $04, $01, $04, $10 // $0c1
.byte $5e, $5f, $5f, $57, $5f, $17, $5f, $57 // $0c2
.byte $ea, $ea, $ba, $ea, $ba, $ea, $ba, $ea // $0c3
.byte $aa, $aa, $aa, $aa, $aa, $ab, $aa, $ab // $0c4
.byte $11, $55, $5d, $75, $df, $fb, $ef, $ba // $0c5
.byte $11, $5d, $77, $dd, $ff, $ee, $bb, $ee // $0c6
.byte $14, $51, $45, $5f, $7f, $7f, $fa, $ef // $0c7
.byte $11, $55, $dd, $77, $ff, $ff, $ef, $bb // $0c8
.byte $11, $54, $75, $dd, $77, $f7, $fd, $bd // $0c9
.byte $fa, $ea, $aa, $ea, $aa, $ea, $aa, $ea // $0ca
.byte $ee, $ab, $ae, $ab, $aa, $aa, $aa, $aa // $0cb
.byte $ff, $bd, $ef, $bb, $eb, $af, $bb, $ae // $0cc
.byte $aa, $ea, $ba, $ae, $aa, $aa, $aa, $aa // $0cd
.byte $ab, $ae, $ab, $bb, $ae, $ab, $ae, $bb // $0ce
.byte $ae, $ab, $bb, $ae, $eb, $ae, $bb, $ef // $0cf
.byte $aa, $ea, $aa, $ba, $ea, $ba, $fe, $ba // $0d0
.byte $ba, $aa, $aa, $ab, $aa, $aa, $aa, $aa // $0d1
.byte $aa, $aa, $aa, $aa, $ea, $be, $ab, $aa // $0d2
.byte $aa, $aa, $aa, $ab, $aa, $ab, $fe, $bf // $0d3
.byte $bb, $bf, $ef, $93, $f7, $bd, $f7, $dd // $0d4
.byte $00, $40, $10, $44, $50, $44, $51, $d4 // $0d5
.byte $51, $d4, $55, $d4, $75, $d4, $f5, $dd // $0d6
.byte $f5, $dd, $f5, $dd, $f5, $dd, $f5, $dd // $0d7
.byte $f5, $dd, $f5, $f4, $d5, $74, $d5, $d4 // $0d8
.byte $55, $d4, $55, $d4, $51, $54, $51, $44 // $0d9
.byte $11, $44, $01, $04, $15, $1f, $7e, $7a // $0da
.byte $1f, $77, $5e, $7f, $fe, $ea, $bb, $af // $0db
.byte $ea, $aa, $ea, $aa, $ea, $ee, $bf, $fe // $0dc
.byte $7e, $3b, $1f, $01, $01, $00, $00, $00 // $0dd
.byte $af, $ad, $fb, $7e, $5f, $1d, $05, $01 // $0de
.byte $7f, $de, $77, $df, $f7, $f5, $dd, $75 // $0df
.byte $ba, $ea, $ba, $ea, $fe, $fa, $7f, $7e // $0e0
.byte $aa, $aa, $aa, $aa, $aa, $aa, $aa, $ea // $0e1
.byte $5d, $15, $05, $01, $11, $15, $14, $75 // $0e2
.byte $5f, $57, $17, $5f, $17, $1f, $5e, $1e // $0e3
.byte $aa, $ea, $ba, $ea, $ab, $bb, $af, $bb // $0e4
.byte $d4, $75, $79, $5f, $75, $7f, $1e, $07 // $0e5
.byte $00, $01, $55, $d7, $bb, $57, $fd, $d5 // $0e6
.byte $74, $f4, $f1, $f0, $51, $53, $45, $01 // $0e7
.byte $5e, $5a, $5e, $5a, $da, $7e, $da, $7e // $0e8
.byte $ef, $bd, $ef, $bd, $bf, $f9, $bf, $af // $0e9
.byte $05, $41, $01, $00, $10, $04, $04, $05 // $0ea
.byte $b4, $ad, $ef, $6b, $7b, $7b, $3f, $1b // $0eb
.byte $45, $01, $45, $41, $51, $44, $54, $7d // $0ec
.byte $fa, $7e, $fb, $5e, $7f, $57, $5d, $17 // $0ed
.byte $bb, $ae, $ab, $ee, $ea, $fb, $bf, $77 // $0ee
.byte $be, $ef, $be, $ef, $bb, $af, $b9, $ad // $0ef
.byte $ab, $aa, $eb, $ba, $ea, $fb, $ee, $fe // $0f0
.byte $aa, $aa, $ae, $aa, $af, $ba, $ef, $ef // $0f1
.byte $b5, $ef, $bb, $ff, $bd, $ff, $bd, $dd // $0f2
.byte $dd, $55, $d5, $75, $d5, $74, $51, $44 // $0f3
.byte $bb, $af, $bb, $af, $ab, $af, $ab, $af // $0f4
.byte $ff, $7e, $5f, $77, $5f, $75, $57, $5d // $0f5
.byte $ff, $fe, $ff, $75, $df, $d5, $74, $55 // $0f6
.byte $f5, $d5, $55, $d4, $51, $54, $40, $07 // $0f7
.byte $11, $44, $10, $40, $11, $40, $00, $40 // $0f8
.byte $b9, $af, $bd, $e5, $bd, $f4, $75, $d4 // $0f9
.byte $51, $44, $10, $44, $10, $40, $10, $40 // $0fa
.byte $50, $44, $00, $07, $7e, $17, $45, $04 // $0fb
.byte $0f, $fd, $ed, $b4, $f1, $d0, $44, $10 // $0fc
.byte $51, $d5, $57, $45, $45, $d5, $77, $d7 // $0fd
.byte $54, $d5, $7d, $f7, $7f, $ff, $7b, $ff // $0fe
.byte $40, $11, $41, $55, $57, $d7, $55, $d3 // $0ff
.byte $10, $15, $15, $15, $5f, $7f, $7a, $7a // $100
.byte $ff, $fe, $bb, $ea, $ab, $bb, $ef, $f5 // $101
.byte $bb, $ef, $bd, $b7, $b7, $dc, $75, $51 // $102
.byte $d1, $51, $45, $55, $55, $7d, $75, $fd // $103
.byte $5e, $77, $5f, $57, $1f, $57, $15, $47 // $104
.byte $00, $00, $00, $00, $00, $00, $00, $01 // $105
.byte $04, $04, $10, $10, $40, $40, $40, $01 // $106
.byte $01, $04, $10, $00, $00, $00, $01, $01 // $107
.byte $03, $07, $0f, $19, $39, $6d, $ec, $a4 // $108
.byte $03, $06, $7f, $fa, $7e, $db, $f6, $ff // $109
.byte $b4, $b4, $b4, $b4, $d4, $d4, $d5, $b3 // $10a
.byte $f6, $f7, $a5, $ad, $bf, $ef, $fe, $6f // $10b
.byte $d2, $b3, $de, $fb, $ff, $bd, $f7, $b5 // $10c
.byte $01, $05, $05, $07, $06, $0f, $1e, $1f // $10d
.byte $1f, $1d, $55, $d5, $ff, $ba, $af, $d5 // $10e
.byte $6b, $7a, $6a, $ea, $ba, $ea, $ff, $15 // $10f
.byte $45, $05, $c0, $d4, $b5, $ed, $fd, $15 // $110
.byte $dd, $77, $54, $00, $11, $01, $50, $10 // $111
.byte $1c, $05, $01, $01, $01, $00, $00, $00 // $112
.byte $41, $d7, $b7, $a6, $a7, $e4, $e4, $60 // $113
.byte $c0, $d3, $b6, $b6, $a6, $d0, $00, $00 // $114
.byte $44, $4c, $df, $d9, $44, $44, $00, $00 // $115
.byte $51, $f3, $60, $30, $00, $00, $00, $00 // $116
.byte $04, $08, $09, $09, $0b, $1a, $1a, $1e // $117
.byte $00, $00, $00, $1f, $2b, $5b, $db, $df // $118
.byte $00, $00, $00, $31, $63, $66, $60, $75 // $119
.byte $00, $05, $4b, $cb, $cf, $cd, $05, $7a // $11a
.byte $40, $d5, $7f, $7a, $1a, $1e, $17, $1f // $11b
.byte $5f, $ff, $ea, $ae, $bb, $ef, $bf, $fb // $11c
.byte $36, $eb, $bf, $ff, $fe, $fb, $ae, $ba // $11d
.byte $bd, $ff, $fe, $bb, $ee, $aa, $aa, $aa // $11e
.byte $1e, $1b, $1e, $1b, $1e, $07, $07, $01 // $11f
.byte $ae, $aa, $aa, $aa, $ea, $bb, $ff, $75 // $120
.byte $ab, $ae, $ab, $b7, $ed, $f5, $50, $00 // $121
.byte $bb, $ef, $f5, $d0, $40, $00, $00, $00 // $122
.byte $dd, $74, $40, $57, $7b, $ef, $7b, $1d // $123
.byte $07, $15, $57, $df, $7e, $5f, $de, $7f // $124
.byte $fb, $ef, $bb, $bb, $ef, $ab, $ef, $ab // $125
.byte $15, $45, $10, $10, $10, $04, $04, $01 // $126
.byte $05, $03, $03, $02, $03, $02, $03, $02 // $127
.byte $fe, $7b, $bf, $ff, $ff, $fe, $af, $be // $128
.byte $ef, $ab, $ab, $ed, $af, $ed, $ad, $ad // $129
.byte $07, $36, $03, $0b, $1b, $7a, $ae, $de // $12a
.byte $af, $ba, $ae, $fa, $ee, $fa, $ea, $fa // $12b
.byte $bd, $bd, $ad, $b4, $ad, $b4, $fd, $b4 // $12c
.byte $de, $fa, $ef, $ba, $ef, $b9, $ef, $f4 // $12d
.byte $ba, $ee, $bb, $ed, $ff, $f5, $d5, $00 // $12e
.byte $b4, $d5, $50, $d4, $50, $44, $10, $00 // $12f
.byte $d4, $50, $00, $00, $00, $00, $00, $00 // $130
.byte $ee, $7f, $77, $7d, $1d, $05, $11, $04 // $131
.byte $ff, $bb, $ee, $bb, $ee, $7b, $7e, $5f // $132
.byte $40, $40, $d0, $90, $f4, $b4, $ed, $bd // $133
.byte $00, $40, $10, $00, $04, $00, $01, $00 // $134
.byte $3e, $5f, $57, $4d, $17, $15, $07, $15 // $135
.byte $ef, $bb, $eb, $fb, $eb, $fa, $ee, $fa // $136
.byte $00, $40, $40, $40, $c0, $d0, $d0, $f0 // $137
.byte $07, $15, $05, $05, $05, $01, $05, $01 // $138
.byte $fe, $fb, $7e, $ff, $7e, $df, $7f, $5f // $139
.byte $b0, $b4, $b4, $bc, $e4, $ad, $ed, $bd // $13a
.byte $77, $5f, $57, $5d, $17, $5d, $17, $55 // $13b
.byte $17, $15, $17, $05, $07, $15, $05, $17 // $13c
.byte $00, $00, $00, $00, $00, $00, $07, $0e // $13d
.byte $10, $70, $60, $64, $69, $6b, $2b, $3c // $13e
.byte $5d, $fc, $e8, $6b, $7d, $30, $0f, $fa // $13f
.byte $cb, $80, $b0, $c7, $3e, $ef, $bf, $fe // $140
.byte $57, $fe, $7a, $1e, $17, $0d, $07, $05 // $141
.byte $aa, $ae, $bb, $ee, $bf, $fe, $7a, $ea // $142
.byte $bb, $ee, $bb, $ee, $ba, $ee, $ab, $ae // $143
.byte $07, $15, $57, $5e, $7f, $fe, $7f, $fe // $144
.byte $b7, $bd, $b7, $ad, $bf, $ad, $bb, $af // $145
.byte $05, $00, $01, $01, $00, $00, $00, $00 // $146
.byte $7f, $ee, $7f, $6f, $7b, $7f, $7b, $1a // $147
.byte $bb, $ef, $ab, $eb, $bb, $eb, $fb, $ea // $148
.byte $50, $44, $50, $d4, $50, $d4, $d5, $f4 // $149
.byte $00, $00, $00, $14, $5c, $78, $3b, $3c // $14a
.byte $1b, $1a, $1a, $1e, $fe, $3a, $2b, $be // $14b
.byte $bb, $ea, $ba, $ae, $ba, $ee, $ba, $ee // $14c
.byte $dd, $f5, $bd, $f5, $bd, $f5, $bd, $f4 // $14d
.byte $02, $0b, $af, $bf, $f7, $fe, $fb, $ee // $14e
.byte $b6, $de, $7e, $fa, $ab, $ee, $ab, $ad // $14f
.byte $bb, $ee, $bb, $ef, $fd, $f5, $54, $40 // $150
.byte $94, $f4, $d4, $50, $40, $00, $00, $00 // $151
.byte $ba, $aa, $bb, $af, $bb, $ed, $b4, $50 // $152
.byte $bd, $f4, $f4, $d0, $50, $00, $00, $00 // $153
.byte $03, $07, $03, $01, $01, $00, $00, $00 // $154
.byte $ba, $ea, $fa, $ee, $fb, $7f, $05, $00 // $155
.byte $ab, $ad, $bd, $f4, $d0, $40, $00, $00 // $156
.byte $ef, $79, $3f, $1d, $0e, $05, $41, $00 // $157
.byte $fe, $10, $10, $10, $10, $10, $10, $00 // $158
.byte $fe, $80, $80, $fc, $80, $80, $fe, $00 // $159
.byte $7c, $82, $80, $7c, $02, $82, $7c, $00 // $15a
.byte $48, $48, $48, $48, $00, $00, $48, $00 // $15b
CharDataSymmetricY:
.byte %00000011 // $000 - $007
VirCharData:
.word $0000 // $000 ($000)
.word $d002 // $001 ($001)
.word $d003 // $002 ($002)
.word $d004 // $003 ($003)
.word $d005 // $004 ($004)
.word $d006 // $005 ($005)
.word $d007 // $006 ($006)
.word $d008 // $007 ($007)
.word $d009 // $008 ($008)
.word $d00a // $009 ($009)
.word $d00b // $00a ($00a)
.word $d00c // $00b ($00b)
.word $d00d // $00c ($00c)
.word $d00e // $00d ($00d)
.word $d00f // $00e ($00e)
.word $d010 // $00f ($00f)
.word $d011 // $010 ($010)
.word $d012 // $011 ($011)
.word $d013 // $012 ($012)
.word $d014 // $013 ($013)
.word $d015 // $014 ($014)
.word $d016 // $015 ($015)
.word $d017 // $016 ($016)
.word $d018 // $017 ($017)
.word $d019 // $018 ($018)
.word $d01a // $019 ($019)
.word $d01b // $01a ($01a)
.word $d01c // $01b ($01b)
.word $d01d // $01c ($01c)
.word $d01e // $01d ($01d)
.word $d01f // $01e ($01e)
.word $d020 // $01f ($01f)
.word $d021 // $020 ($020)
.word $d022 // $021 ($021)
.word $d023 // $022 ($022)
.word $d024 // $023 ($023)
.word $d025 // $024 ($024)
.word $d026 // $025 ($025)
.word $d027 // $026 ($026)
.word $d028 // $027 ($027)
.word $d029 // $028 ($028)
.word $d02a // $029 ($029)
.word $d02b // $02a ($02a)
.word $d02c // $02b ($02b)
.word $d02d // $02c ($02c)
.word $d02e // $02d ($02d)
.word $d02f // $02e ($02e)
.word $d030 // $02f ($02f)
.word $d031 // $030 ($030)
.word $d032 // $031 ($031)
.word $d033 // $032 ($032)
.word $d034 // $033 ($033)
.word $d035 // $034 ($034)
.word $d036 // $035 ($035)
.word $d037 // $036 ($036)
.word $d038 // $037 ($037)
.word $d039 // $038 ($038)
.word $d03a // $039 ($039)
.word $d03b // $03a ($03a)
.word $d03c // $03b ($03b)
.word $d03d // $03c ($03c)
.word $d03e // $03d ($03d)
.word $d03f // $03e ($03e)
.word $d040 // $03f ($03f)
.word $d041 // $040 ($040)
.word $d042 // $041 ($041)
.word $d043 // $042 ($042)
.word $d044 // $043 ($043)
.word $d045 // $044 ($044)
.word $d046 // $045 ($045)
.word $d047 // $046 ($046)
.word $d048 // $047 ($047)
.word $d049 // $048 ($048)
.word $d04a // $049 ($049)
.word $d04b // $04a ($04a)
.word $d04c // $04b ($04b)
.word $d04d // $04c ($04c)
.word $d04e // $04d ($04d)
.word $d04f // $04e ($04e)
.word $d050 // $04f ($04f)
.word $d051 // $050 ($050)
.word $d052 // $051 ($051)
.word $d053 // $052 ($052)
.word $d054 // $053 ($053)
.word $d055 // $054 ($054)
.word $d421 // $055 ($055)
.word $d418 // $056 ($056)
.word $d056 // $057 ($057)
.word $d420 // $058 ($058)
.word $d057 // $059 ($059)
.word $d058 // $05a ($05a)
.word $d423 // $05b ($05b)
.word $d416 // $05c ($05c)
.word $d059 // $05d ($05d)
.word $d066 // $05e ($05e)
.word $d067 // $05f ($05f)
.word $d05c // $060 ($060)
.word $d068 // $061 ($061)
.word $d069 // $062 ($062)
.word $d06a // $063 ($063)
.word $d06b // $064 ($064)
.word $d06c // $065 ($065)
.word $d06d // $066 ($066)
.word $d06e // $067 ($067)
.word $d06f // $068 ($068)
.word $d070 // $069 ($069)
.word $d071 // $06a ($06a)
.word $d072 // $06b ($06b)
.word $d073 // $06c ($06c)
.word $d074 // $06d ($06d)
.word $d075 // $06e ($06e)
.word $d076 // $06f ($06f)
.word $d077 // $070 ($070)
.word $d078 // $071 ($071)
.word $d079 // $072 ($072)
.word $d07a // $073 ($073)
.word $d07b // $074 ($074)
.word $d07c // $075 ($075)
.word $d07d // $076 ($076)
.word $d07e // $077 ($077)
.word $d05a // $078 ($078)
.word $d05b // $079 ($079)
.word $d07f // $07a ($07a)
.word $d05d // $07b ($07b)
.word $d05e // $07c ($07c)
.word $d05f // $07d ($07d)
.word $d060 // $07e ($07e)
.word $d080 // $07f ($07f)
.word $d062 // $080 ($080)
.word $d063 // $081 ($081)
.word $d064 // $082 ($082)
.word $d065 // $083 ($083)
.word $d081 // $084 ($084)
.word $d082 // $085 ($085)
.word $d083 // $086 ($086)
.word $d084 // $087 ($087)
.word $d085 // $088 ($088)
.word $d088 // $089 ($089)
.word $d089 // $08a ($08a)
.word $d08a // $08b ($08b)
.word $d08b // $08c ($08c)
.word $d086 // $08d ($08d)
.word $d087 // $08e ($08e)
.word $d08c // $08f ($08f)
.word $d08d // $090 ($090)
.word $d08e // $091 ($091)
.word $d08f // $092 ($092)
.word $d090 // $093 ($093)
.word $d091 // $094 ($094)
.word $d092 // $095 ($095)
.word $d061 // $096 ($096)
.word $d093 // $097 ($097)
.word $d094 // $098 ($098)
.word $d095 // $099 ($099)
.word $d096 // $09a ($09a)
.word $d097 // $09b ($09b)
.word $d098 // $09c ($09c)
.word $d099 // $09d ($09d)
.word $d09a // $09e ($09e)
.word $d09b // $09f ($09f)
.word $d09c // $0a0 ($0a0)
.word $d09d // $0a1 ($0a1)
.word $d09e // $0a2 ($0a2)
.word $d09f // $0a3 ($0a3)
.word $d0a0 // $0a4 ($0a4)
.word $d0a1 // $0a5 ($0a5)
.word $d0a2 // $0a6 ($0a6)
.word $d0a3 // $0a7 ($0a7)
.word $d0a4 // $0a8 ($0a8)
.word $d452 // $0a9 ($0a9)
.word $d455 // $0aa ($0aa)
.word $d41d // $0ab ($0ab)
.word $d0a5 // $0ac ($0ac)
.word $d41f // $0ad ($0ad)
.word $d424 // $0ae ($0ae)
.word $d0a6 // $0af ($0af)
.word $d422 // $0b0 ($0b0)
.word $d0a7 // $0b1 ($0b1)
.word $d0a8 // $0b2 ($0b2)
.word $d0a9 // $0b3 ($0b3)
.word $d0aa // $0b4 ($0b4)
.word $d0ab // $0b5 ($0b5)
.word $d0ac // $0b6 ($0b6)
.word $d0ad // $0b7 ($0b7)
.word $d0ae // $0b8 ($0b8)
.word $d0af // $0b9 ($0b9)
.word $d0b0 // $0ba ($0ba)
.word $d0b1 // $0bb ($0bb)
.word $d0b2 // $0bc ($0bc)
.word $d0b3 // $0bd ($0bd)
.word $f002 // $0be ($0be)
.word $f003 // $0bf ($0bf)
.word $f004 // $0c0 ($0c0)
.word $f005 // $0c1 ($0c1)
.word $f006 // $0c2 ($0c2)
.word $f007 // $0c3 ($0c3)
.word $f008 // $0c4 ($0c4)
.word $f009 // $0c5 ($0c5)
.word $f00a // $0c6 ($0c6)
.word $f00b // $0c7 ($0c7)
.word $f00c // $0c8 ($0c8)
.word $f00d // $0c9 ($0c9)
.word $f00e // $0ca ($0ca)
.word $f00f // $0cb ($0cb)
.word $f010 // $0cc ($0cc)
.word $f011 // $0cd ($0cd)
.word $f012 // $0ce ($0ce)
.word $f013 // $0cf ($0cf)
.word $f014 // $0d0 ($0d0)
.word $f015 // $0d1 ($0d1)
.word $f016 // $0d2 ($0d2)
.word $f017 // $0d3 ($0d3)
.word $f018 // $0d4 ($0d4)
.word $f019 // $0d5 ($0d5)
.word $f01a // $0d6 ($0d6)
.word $f01b // $0d7 ($0d7)
.word $f01c // $0d8 ($0d8)
.word $f01d // $0d9 ($0d9)
.word $f01e // $0da ($0da)
.word $f01f // $0db ($0db)
.word $f020 // $0dc ($0dc)
.word $f021 // $0dd ($0dd)
.word $f022 // $0de ($0de)
.word $f023 // $0df ($0df)
.word $f024 // $0e0 ($0e0)
.word $0000 // $0e1 ($000)
.word $f025 // $0e2 ($0e1)
.word $f026 // $0e3 ($0e2)
.word $f027 // $0e4 ($0e3)
.word $f028 // $0e5 ($0e4)
.word $f029 // $0e6 ($0e5)
.word $f02a // $0e7 ($0e6)
.word $f02b // $0e8 ($0e7)
.word $f02c // $0e9 ($0e8)
.word $f02d // $0ea ($0e9)
.word $f02e // $0eb ($0ea)
.word $f02f // $0ec ($0eb)
.word $f030 // $0ed ($0ec)
.word $f031 // $0ee ($0ed)
.word $f032 // $0ef ($0ee)
.word $f033 // $0f0 ($0ef)
.word $f034 // $0f1 ($0f0)
.word $f035 // $0f2 ($0f1)
.word $f036 // $0f3 ($0f2)
.word $f037 // $0f4 ($0f3)
.word $f038 // $0f5 ($0f4)
.word $f039 // $0f6 ($0f5)
.word $f03a // $0f7 ($0f6)
.word $f03b // $0f8 ($0f7)
.word $f03c // $0f9 ($0f8)
.word $f03d // $0fa ($0f9)
.word $f03e // $0fb ($0fa)
.word $f03f // $0fc ($0fb)
.word $f040 // $0fd ($0fc)
.word $f041 // $0fe ($0fd)
.word $f042 // $0ff ($0fe)
.word $f043 // $100 ($0ff)
.word $f044 // $101 ($100)
.word $f045 // $102 ($101)
.word $f046 // $103 ($102)
.word $f047 // $104 ($103)
.word $f048 // $105 ($104)
.word $f049 // $106 ($105)
.word $f04a // $107 ($106)
.word $f04b // $108 ($107)
.word $f04c // $109 ($108)
.word $f04d // $10a ($109)
.word $f04e // $10b ($10a)
.word $f04f // $10c ($10b)
.word $f050 // $10d ($10c)
.word $f051 // $10e ($10d)
.word $f052 // $10f ($10e)
.word $f053 // $110 ($10f)
.word $f054 // $111 ($110)
.word $f055 // $112 ($111)
.word $f421 // $113 ($112)
.word $f418 // $114 ($113)
.word $f056 // $115 ($114)
.word $f420 // $116 ($115)
.word $f057 // $117 ($116)
.word $f058 // $118 ($117)
.word $f423 // $119 ($118)
.word $f059 // $11a ($119)
.word $f05a // $11b ($11a)
.word $f05b // $11c ($11b)
.word $f05c // $11d ($11c)
.word $f05d // $11e ($11d)
.word $f05e // $11f ($11e)
.word $f05f // $120 ($11f)
.word $f060 // $121 ($120)
.word $f061 // $122 ($121)
.word $f062 // $123 ($122)
.word $f063 // $124 ($123)
.word $f064 // $125 ($124)
.word $f065 // $126 ($125)
.word $f416 // $127 ($126)
.word $f066 // $128 ($127)
.word $f067 // $129 ($128)
.word $f068 // $12a ($129)
.word $f069 // $12b ($12a)
.word $f06a // $12c ($12b)
.word $f06b // $12d ($12c)
.word $f06c // $12e ($12d)
.word $f06d // $12f ($12e)
.word $f06e // $130 ($12f)
.word $f081 // $131 ($130)
.word $f082 // $132 ($131)
.word $f083 // $133 ($132)
.word $f084 // $134 ($133)
.word $f085 // $135 ($134)
.word $f089 // $136 ($135)
.word $f08a // $137 ($136)
.word $f09d // $138 ($137)
.word $f0a1 // $139 ($138)
.word $f09e // $13a ($139)
.word $f0a2 // $13b ($13a)
.word $f0a3 // $13c ($13b)
.word $f09f // $13d ($13c)
.word $f0a0 // $13e ($13d)
.word $f088 // $13f ($13e)
.word $f0ae // $140 ($13f)
.word $f0af // $141 ($140)
.word $f0b0 // $142 ($141)
.word $f0b1 // $143 ($142)
.word $f0a4 // $144 ($143)
.word $f452 // $145 ($144)
.word $f0b2 // $146 ($145)
.word $f455 // $147 ($146)
.word $f0b3 // $148 ($147)
.word $f0a5 // $149 ($148)
.word $f0a6 // $14a ($149)
.word $b002 // $14b ($14a)
.word $b003 // $14c ($14b)
.word $b004 // $14d ($14c)
.word $b00f // $14e ($14d)
.word $b010 // $14f ($14e)
.word $b00e // $150 ($14f)
.word $b011 // $151 ($150)
.word $b012 // $152 ($151)
.word $b013 // $153 ($152)
.word $b014 // $154 ($153)
.word $b015 // $155 ($154)
.word $b048 // $156 ($155)
.word $b047 // $157 ($156)
.word $b04c // $158 ($157)
.word $b04b // $159 ($158)
.word $b04a // $15a ($159)
.word $b049 // $15b ($15a)
.word $b050 // $15c ($15b)
.word $b04f // $15d ($15c)
.word $b04e // $15e ($15d)
.word $b04d // $15f ($15e)
.word $b039 // $160 ($15f)
.word $b067 // $161 ($160)
.word $b06f // $162 ($161)
.word $b03d // $163 ($162)
.word $b06a // $164 ($163)
.word $b06b // $165 ($164)
.word $b06c // $166 ($165)
.word $b06d // $167 ($166)
.word $b06e // $168 ($167)
.word $b070 // $169 ($168)
.word $b071 // $16a ($169)
.word $b072 // $16b ($16a)
.word $b073 // $16c ($16b)
.word $b074 // $16d ($16c)
.word $b075 // $16e ($16d)
.word $b076 // $16f ($16e)
.word $b077 // $170 ($16f)
.word $b078 // $171 ($170)
.word $b079 // $172 ($171)
.word $b07a // $173 ($172)
.word $b07b // $174 ($173)
.word $b07c // $175 ($174)
.word $b07d // $176 ($175)
.word $b07e // $177 ($176)
.word $b05a // $178 ($177)
.word $b05b // $179 ($178)
.word $b07f // $17a ($179)
.word $b05d // $17b ($17a)
.word $b05e // $17c ($17b)
.word $b05f // $17d ($17c)
.word $b060 // $17e ($17d)
.word $b080 // $17f ($17e)
.word $b062 // $180 ($17f)
.word $b063 // $181 ($180)
.word $b064 // $182 ($181)
.word $b065 // $183 ($182)
.word $b019 // $184 ($183)
.word $b081 // $185 ($184)
.word $b005 // $186 ($185)
.word $b006 // $187 ($186)
.word $b007 // $188 ($187)
.word $b008 // $189 ($188)
.word $b082 // $18a ($189)
.word $b083 // $18b ($18a)
.word $b009 // $18c ($18b)
.word $b00a // $18d ($18c)
.word $b084 // $18e ($18d)
.word $b085 // $18f ($18e)
.word $b00d // $190 ($18f)
.word $b086 // $191 ($190)
.word $b087 // $192 ($191)
.word $b033 // $193 ($192)
.word $b088 // $194 ($193)
.word $b089 // $195 ($194)
.word $b08a // $196 ($195)
.word $b08b // $197 ($196)
.word $b02e // $198 ($197)
.word $b059 // $199 ($198)
.word $b05c // $19a ($199)
.word $b068 // $19b ($19a)
.word $b08c // $19c ($19b)
.word $b08d // $19d ($19c)
.word $b08e // $19e ($19d)
.word $b08f // $19f ($19e)
.word $b090 // $1a0 ($19f)
.word $b091 // $1a1 ($1a0)
.word $b092 // $1a2 ($1a1)
.word $b061 // $1a3 ($1a2)
.word $b093 // $1a4 ($1a3)
.word $b094 // $1a5 ($1a4)
.word $b095 // $1a6 ($1a5)
.word $b096 // $1a7 ($1a6)
.word $b097 // $1a8 ($1a7)
.word $b098 // $1a9 ($1a8)
.word $b099 // $1aa ($1a9)
.word $b09a // $1ab ($1aa)
.word $b09b // $1ac ($1ab)
.word $b09c // $1ad ($1ac)
.word $b043 // $1ae ($1ad)
.word $b046 // $1af ($1ae)
.word $d0b4 // $1b0 ($1af)
.word $d0b5 // $1b1 ($1b0)
.word $d0b6 // $1b2 ($1b1)
.word $d0b7 // $1b3 ($1b2)
.word $d0b8 // $1b4 ($1b3)
.word $d0b9 // $1b5 ($1b4)
.word $d0ba // $1b6 ($1b5)
.word $d0bb // $1b7 ($1b6)
.word $d001 // $1b8 ($1b7)
.word $d0bc // $1b9 ($1b8)
.word $d0bd // $1ba ($1b9)
.word $d0be // $1bb ($1ba)
.word $d0bf // $1bc ($1bb)
.word $d0c0 // $1bd ($1bc)
.word $d0c1 // $1be ($1bd)
.word $d0c2 // $1bf ($1be)
.word $d0c3 // $1c0 ($1bf)
.word $d0c4 // $1c1 ($1c0)
.word $d0c5 // $1c2 ($1c1)
.word $d0c6 // $1c3 ($1c2)
.word $d0c7 // $1c4 ($1c3)
.word $d0c8 // $1c5 ($1c4)
.word $d0c9 // $1c6 ($1c5)
.word $d0ca // $1c7 ($1c6)
.word $d0cb // $1c8 ($1c7)
.word $d0cc // $1c9 ($1c8)
.word $d0cd // $1ca ($1c9)
.word $d0ce // $1cb ($1ca)
.word $d0cf // $1cc ($1cb)
.word $d0d0 // $1cd ($1cc)
.word $d0d1 // $1ce ($1cd)
.word $d0d2 // $1cf ($1ce)
.word $d0d3 // $1d0 ($1cf)
.word $d0d4 // $1d1 ($1d0)
.word $0000 // $1d2 ($000)
.word $d0d5 // $1d3 ($1d1)
.word $d0d6 // $1d4 ($1d2)
.word $d0d7 // $1d5 ($1d3)
.word $dcbc // $1d6 ($1d4)
.word $d0d8 // $1d7 ($1d5)
.word $d0d9 // $1d8 ($1d6)
.word $d0da // $1d9 ($1d7)
.word $d0db // $1da ($1d8)
.word $d0dc // $1db ($1d9)
.word $d0dd // $1dc ($1da)
.word $d0de // $1dd ($1db)
.word $d0df // $1de ($1dc)
.word $d0e0 // $1df ($1dd)
.word $d0e1 // $1e0 ($1de)
.word $d0e2 // $1e1 ($1df)
.word $d0e3 // $1e2 ($1e0)
.word $d0e4 // $1e3 ($1e1)
.word $d0e5 // $1e4 ($1e2)
.word $d0e6 // $1e5 ($1e3)
.word $d0e7 // $1e6 ($1e4)
.word $d0e8 // $1e7 ($1e5)
.word $d0e9 // $1e8 ($1e6)
.word $d0ea // $1e9 ($1e7)
.word $d0eb // $1ea ($1e8)
.word $d0ec // $1eb ($1e9)
.word $d0ed // $1ec ($1ea)
.word $d0ee // $1ed ($1eb)
.word $d0ef // $1ee ($1ec)
.word $d0f0 // $1ef ($1ed)
.word $d0f1 // $1f0 ($1ee)
.word $d0f2 // $1f1 ($1ef)
.word $d0f3 // $1f2 ($1f0)
.word $d0f4 // $1f3 ($1f1)
.word $d0f5 // $1f4 ($1f2)
.word $d0f6 // $1f5 ($1f3)
.word $d0f7 // $1f6 ($1f4)
.word $d0f8 // $1f7 ($1f5)
.word $d0f9 // $1f8 ($1f6)
.word $d0fa // $1f9 ($1f7)
.word $d0fb // $1fa ($1f8)
.word $d0fc // $1fb ($1f9)
.word $d0fd // $1fc ($1fa)
.word $d0fe // $1fd ($1fb)
.word $d0ff // $1fe ($1fc)
.word $d100 // $1ff ($1fd)
.word $d101 // $200 ($1fe)
.word $d102 // $201 ($1ff)
.word $d103 // $202 ($200)
.word $d104 // $203 ($201)
.word $d105 // $204 ($202)
.word $d106 // $205 ($203)
.word $d107 // $206 ($204)
.word $d108 // $207 ($205)
.word $d109 // $208 ($206)
.word $d10a // $209 ($207)
.word $d10b // $20a ($208)
.word $d10c // $20b ($209)
.word $d131 // $20c ($20a)
.word $d132 // $20d ($20b)
.word $d133 // $20e ($20c)
.word $d134 // $20f ($20d)
.word $d135 // $210 ($20e)
.word $d136 // $211 ($20f)
.word $d137 // $212 ($210)
.word $d138 // $213 ($211)
.word $d139 // $214 ($212)
.word $d13a // $215 ($213)
.word $d13b // $216 ($214)
.word $d13c // $217 ($215)
.word $d10d // $218 ($216)
.word $d10e // $219 ($217)
.word $d10f // $21a ($218)
.word $d110 // $21b ($219)
.word $d111 // $21c ($21a)
.word $d112 // $21d ($21b)
.word $a113 // $21e ($21c)
.word $a114 // $21f ($21d)
.word $a115 // $220 ($21e)
.word $a116 // $221 ($21f)
.word $d13d // $222 ($220)
.word $d13e // $223 ($221)
.word $d13f // $224 ($222)
.word $d140 // $225 ($223)
.word $d141 // $226 ($224)
.word $d142 // $227 ($225)
.word $d143 // $228 ($226)
.word $d123 // $229 ($227)
.word $d144 // $22a ($228)
.word $d145 // $22b ($229)
.word $d126 // $22c ($22a)
.word $d146 // $22d ($22b)
.word $d147 // $22e ($22c)
.word $d148 // $22f ($22d)
.word $d149 // $230 ($22e)
.word $d14a // $231 ($22f)
.word $d14b // $232 ($230)
.word $d14c // $233 ($231)
.word $d14d // $234 ($232)
.word $d14e // $235 ($233)
.word $d14f // $236 ($234)
.word $d150 // $237 ($235)
.word $d151 // $238 ($236)
.word $d152 // $239 ($237)
.word $d153 // $23a ($238)
.word $d002 // $23b ($001)
.word $d003 // $23c ($002)
.word $d004 // $23d ($003)
.word $d154 // $23e ($239)
.word $d155 // $23f ($23a)
.word $d156 // $240 ($23b)
.word $d421 // $241 ($055)
.word $d416 // $242 ($05c)
.word $d05a // $243 ($078)
.word $d05b // $244 ($079)
.word $d05d // $245 ($07b)
.word $d05e // $246 ($07c)
.word $d05f // $247 ($07d)
.word $d060 // $248 ($07e)
.word $d062 // $249 ($080)
.word $d063 // $24a ($081)
.word $d065 // $24b ($083)
.word $d0a4 // $24c ($0a8)
.word $d452 // $24d ($0a9)
.word $d41d // $24e ($0ab)
.word $d424 // $24f ($0ae)
.word $d0a8 // $250 ($0b2)
.word $d157 // $251 ($23c)
.word $d014 // $252 ($013)
.word $d015 // $253 ($014)
.word $f0b4 // $254 ($23d)
.word $f0b5 // $255 ($23e)
.word $f0b6 // $256 ($23f)
.word $f0b7 // $257 ($240)
.word $f0b8 // $258 ($241)
.word $f0b9 // $259 ($242)
.word $f0ba // $25a ($243)
.word $f0bb // $25b ($244)
.word $f001 // $25c ($245)
.word $f0bc // $25d ($246)
.word $f0bd // $25e ($247)
.word $f0be // $25f ($248)
.word $f0bf // $260 ($249)
.word $f0c0 // $261 ($24a)
.word $f0c1 // $262 ($24b)
.word $f0c2 // $263 ($24c)
.word $f0c3 // $264 ($24d)
.word $f0c4 // $265 ($24e)
.word $f0c5 // $266 ($24f)
.word $f0c6 // $267 ($250)
.word $f0c7 // $268 ($251)
.word $f0c8 // $269 ($252)
.word $f0c9 // $26a ($253)
.word $f0ca // $26b ($254)
.word $f0cb // $26c ($255)
.word $f0cc // $26d ($256)
.word $f0cd // $26e ($257)
.word $f0ce // $26f ($258)
.word $f0cf // $270 ($259)
.word $f0d0 // $271 ($25a)
.word $f0d1 // $272 ($25b)
.word $f0d2 // $273 ($25c)
.word $f0d3 // $274 ($25d)
.word $f0d4 // $275 ($25e)
.word $f0d5 // $276 ($25f)
.word $f0d6 // $277 ($260)
.word $f0d7 // $278 ($261)
.word $fcbc // $279 ($262)
.word $f0d8 // $27a ($263)
.word $f0d9 // $27b ($264)
.word $f0da // $27c ($265)
.word $f0db // $27d ($266)
.word $f0dc // $27e ($267)
.word $f0dd // $27f ($268)
.word $f0de // $280 ($269)
.word $f0df // $281 ($26a)
.word $f0e0 // $282 ($26b)
.word $f0e1 // $283 ($26c)
.word $f0e2 // $284 ($26d)
.word $f0e3 // $285 ($26e)
.word $f0e4 // $286 ($26f)
.word $f0e5 // $287 ($270)
.word $f0e6 // $288 ($271)
.word $f0e7 // $289 ($272)
.word $f0e8 // $28a ($273)
.word $f0e9 // $28b ($274)
.word $f0ea // $28c ($275)
.word $f0eb // $28d ($276)
.word $f0ec // $28e ($277)
.word $f0ed // $28f ($278)
.word $f0ee // $290 ($279)
.word $f0ef // $291 ($27a)
.word $f0f0 // $292 ($27b)
.word $f0f1 // $293 ($27c)
.word $f0f2 // $294 ($27d)
.word $f0f3 // $295 ($27e)
.word $f0f4 // $296 ($27f)
.word $f0f5 // $297 ($280)
.word $f0f6 // $298 ($281)
.word $f0f7 // $299 ($282)
.word $f0f8 // $29a ($283)
.word $f0f9 // $29b ($284)
.word $f0fa // $29c ($285)
.word $f0fb // $29d ($286)
.word $f0fc // $29e ($287)
.word $f0fd // $29f ($288)
.word $f0fe // $2a0 ($289)
.word $f0ff // $2a1 ($28a)
.word $f100 // $2a2 ($28b)
.word $f101 // $2a3 ($28c)
.word $f102 // $2a4 ($28d)
.word $f103 // $2a5 ($28e)
.word $f104 // $2a6 ($28f)
.word $f105 // $2a7 ($290)
.word $f106 // $2a8 ($291)
.word $f107 // $2a9 ($292)
.word $f108 // $2aa ($293)
.word $f109 // $2ab ($294)
.word $f10a // $2ac ($295)
.word $f10b // $2ad ($296)
.word $f10c // $2ae ($297)
.word $f10d // $2af ($298)
.word $f10e // $2b0 ($299)
.word $f10f // $2b1 ($29a)
.word $f110 // $2b2 ($29b)
.word $f111 // $2b3 ($29c)
.word $f112 // $2b4 ($29d)
.word $a117 // $2b5 ($29e)
.word $a118 // $2b6 ($29f)
.word $a119 // $2b7 ($2a0)
.word $a11a // $2b8 ($2a1)
.word $f11b // $2b9 ($2a2)
.word $f11c // $2ba ($2a3)
.word $f11d // $2bb ($2a4)
.word $f11e // $2bc ($2a5)
.word $f11f // $2bd ($2a6)
.word $f120 // $2be ($2a7)
.word $f121 // $2bf ($2a8)
.word $f122 // $2c0 ($2a9)
.word $0000 // $2c1 ($000)
.word $f123 // $2c2 ($2aa)
.word $f124 // $2c3 ($2ab)
.word $f125 // $2c4 ($2ac)
.word $f126 // $2c5 ($2ad)
.word $f127 // $2c6 ($2ae)
.word $f128 // $2c7 ($2af)
.word $f129 // $2c8 ($2b0)
.word $f12a // $2c9 ($2b1)
.word $f12b // $2ca ($2b2)
.word $f12c // $2cb ($2b3)
.word $f12d // $2cc ($2b4)
.word $f12e // $2cd ($2b5)
.word $f12f // $2ce ($2b6)
.word $f130 // $2cf ($2b7)
.word $f131 // $2d0 ($2b8)
.word $f132 // $2d1 ($2b9)
.word $f133 // $2d2 ($2ba)
.word $f134 // $2d3 ($2bb)
.word $f135 // $2d4 ($2bc)
.word $f136 // $2d5 ($2bd)
.word $f137 // $2d6 ($2be)
.word $f138 // $2d7 ($2bf)
.word $f139 // $2d8 ($2c0)
.word $f13a // $2d9 ($2c1)
.word $f13b // $2da ($2c2)
.word $f13c // $2db ($2c3)
.word $f421 // $2dc ($112)
.word $f05a // $2dd ($11a)
.word $f05b // $2de ($11b)
.word $f05d // $2df ($11d)
.word $f05e // $2e0 ($11e)
.word $f05f // $2e1 ($11f)
.word $f060 // $2e2 ($120)
.word $f062 // $2e3 ($122)
.word $f063 // $2e4 ($123)
.word $f065 // $2e5 ($125)
.word $f416 // $2e6 ($126)
.word $f0a4 // $2e7 ($143)
.word $f452 // $2e8 ($144)
.word $f157 // $2e9 ($2c4)
.word $f41d // $2ea ($2c5)
.word $f0a8 // $2eb ($2c6)
.word $f424 // $2ec ($2c7)
.word $f014 // $2ed ($0d0)
.word $f015 // $2ee ($0d1)
.word $1158 // $2ef ($2c8)
.word $2159 // $2f0 ($2c9)
.word $315a // $2f1 ($2ca)
.word $4158 // $2f2 ($2cb)
.word $515b // $2f3 ($2cc)
TileData:
.byte $00, $00, $00, $00, $00 // $000
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00
.byte $00
.byte $00, $00, $00, $00, $00 // $001
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $01
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $03
.byte $00
.byte $00, $00, $00, $00, $0a // $002
.byte $00, $00, $04, $00, $0b
.byte $00, $00, $05, $08, $0c
.byte $00, $00, $06, $09, $02
.byte $00, $00, $07, $00, $02
.byte $00
.byte $00, $00, $00, $00, $03 // $003
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $0d
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $0d
.byte $00
.byte $00, $00, $00, $00, $03 // $004
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $0e
.byte $00, $00, $00, $00, $0f
.byte $00, $00, $00, $00, $0d
.byte $00
.byte $00, $00, $00, $00, $12 // $005
.byte $00, $00, $10, $11, $13
.byte $00, $00, $00, $00, $14
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $0d
.byte $00
.byte $00, $00, $00, $00, $03 // $006
.byte $00, $00, $00, $00, $02
.byte $00, $00, $00, $00, $01
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00
.byte $00
.byte $15, $00, $07, $11, $13 // $007
.byte $00, $17, $1b, $18, $00
.byte $00, $18, $1c, $1e, $21
.byte $00, $19, $1d, $1f, $22
.byte $16, $1a, $07, $20, $23
.byte $00
.byte $00, $00, $2a, $2e, $33 // $008
.byte $24, $27, $2b, $2f, $34
.byte $25, $28, $2c, $30, $35
.byte $26, $29, $2d, $31, $11
.byte $00, $00, $00, $32, $36
.byte $00
.byte $00, $00, $32, $11, $13 // $009
.byte $00, $39, $3d, $36, $43
.byte $37, $3a, $3e, $41, $44
.byte $00, $3b, $3f, $42, $45
.byte $38, $3c, $40, $1e, $21
.byte $00
.byte $00, $00, $10, $48, $13 // $00a
.byte $00, $00, $46, $49, $4c
.byte $00, $00, $47, $4a, $4d
.byte $00, $00, $00, $4b, $4e
.byte $00, $00, $00, $00, $4f
.byte $00
.byte $00, $51, $54, $57, $5a // $00b
.byte $16, $1a, $55, $58, $5b
.byte $00, $00, $56, $59, $44
.byte $00, $52, $1b, $42, $45
.byte $50, $53, $1c, $1e, $21
.byte $00
.byte $00, $00, $00, $00, $4f // $00c
.byte $00, $00, $00, $4b, $4e
.byte $00, $00, $47, $4a, $4d
.byte $00, $00, $46, $49, $4c
.byte $00, $00, $10, $48, $13
.byte $00
.byte $00, $00, $5d, $60, $0e // $00d
.byte $00, $15, $00, $61, $0f
.byte $00, $00, $17, $62, $65
.byte $5c, $53, $5e, $63, $66
.byte $00, $00, $5f, $64, $67
.byte $00
.byte $00, $5f, $10, $6a, $6f // $00e
.byte $38, $3c, $65, $6b, $70
.byte $5f, $63, $66, $6c, $71
.byte $0e, $64, $67, $6d, $72
.byte $68, $12, $69, $6e, $73
.byte $00
.byte $74, $75, $77, $7a, $7f // $00f
.byte $00, $76, $78, $7b, $80
.byte $00, $5f, $79, $7c, $81
.byte $00, $38, $3c, $7d, $82
.byte $00, $00, $5f, $7e, $83
.byte $00
.byte $00, $10, $11, $85, $87 // $010
.byte $00, $00, $04, $86, $88
.byte $00, $18, $05, $08, $0c
.byte $00, $84, $06, $09, $0e
.byte $00, $00, $07, $00, $0f
.byte $00
.byte $00, $00, $32, $6a, $6f // $011
.byte $00, $00, $89, $6b, $70
.byte $00, $38, $3c, $6c, $71
.byte $00, $00, $8a, $6d, $72
.byte $00, $00, $8b, $8c, $73
.byte $00
.byte $00, $00, $5d, $60, $8f // $012
.byte $00, $00, $84, $61, $90
.byte $00, $2d, $8d, $68, $91
.byte $00, $00, $8e, $74, $75
.byte $00, $00, $38, $3c, $92
.byte $00
.byte $00, $00, $00, $00, $96 // $013
.byte $00, $18, $78, $7b, $80
.byte $00, $93, $79, $7c, $81
.byte $8f, $94, $95, $7d, $82
.byte $90, $12, $5d, $7e, $83
.byte $00
.byte $0e, $97, $9a, $9d, $5d // $014
.byte $0f, $98, $9b, $9e, $a0
.byte $69, $99, $9c, $9f, $5d
.byte $77, $7a, $7f, $6d, $72
.byte $00, $5d, $12, $8c, $73
.byte $00
.byte $00, $2d, $a1, $62, $a3 // $015
.byte $00, $00, $5f, $a2, $a4
.byte $00, $00, $10, $11, $13
.byte $00, $00, $32, $36, $43
.byte $00, $00, $89, $59, $44
.byte $00
.byte $00, $38, $3c, $42, $45 // $016
.byte $00, $00, $8a, $40, $a6
.byte $00, $00, $8b, $a5, $a7
.byte $00, $2d, $a1, $62, $a3
.byte $00, $00, $5f, $a2, $a4
.byte $00
.byte $00, $00, $10, $11, $13 // $017
.byte $5c, $a8, $18, $55, $ae
.byte $00, $a9, $aa, $ac, $af
.byte $00, $18, $56, $38, $3c
.byte $50, $5c, $ab, $ad, $b0
.byte $00
.byte $00, $38, $b2, $18, $42 // $018
.byte $18, $19, $54, $55, $b6
.byte $16, $1a, $b3, $b5, $b7
.byte $00, $18, $b4, $08, $0c
.byte $00, $b1, $06, $09, $a4
.byte $00
.byte $00, $10, $11, $13, $0a // $019
.byte $00, $00, $04, $89, $0b
.byte $00, $18, $05, $08, $0c
.byte $00, $84, $06, $b8, $ba
.byte $00, $00, $07, $b9, $bb
.byte $00
.byte $5c, $a8, $10, $11, $13 // $01a
.byte $00, $a9, $aa, $ac, $af
.byte $00, $bc, $bd, $08, $43
.byte $00, $37, $06, $09, $44
.byte $00, $38, $07, $42, $45
.byte $00
.byte $00, $00, $5f, $18, $0e // $01b
.byte $00, $00, $10, $11, $0f
.byte $00, $00, $32, $85, $87
.byte $00, $00, $89, $86, $88
.byte $00, $38, $3c, $42, $45
.byte $00
.byte $00, $00, $5f, $18, $a4 // $01c
.byte $00, $00, $10, $10, $65
.byte $00, $00, $32, $63, $66
.byte $00, $00, $89, $64, $67
.byte $00, $38, $3c, $42, $45
.byte $00
.byte $5c, $a8, $18, $55, $ae // $01d
.byte $00, $a9, $78, $7b, $80
.byte $00, $18, $79, $7c, $81
.byte $50, $5c, $ab, $7d, $82
.byte $00, $38, $b2, $7e, $83
.byte $00
.byte $00, $00, $00, $00, $00 // $01e
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $be
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $c0
.byte $00
.byte $00, $00, $00, $00, $c7 // $01f
.byte $00, $00, $c1, $00, $c8
.byte $00, $00, $c2, $c5, $c9
.byte $00, $00, $c3, $c6, $bf
.byte $00, $00, $c4, $00, $bf
.byte $00
.byte $00, $00, $00, $00, $c0 // $020
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $ca
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $ca
.byte $00
.byte $00, $00, $00, $00, $c0 // $021
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $cb
.byte $00, $00, $00, $00, $cc
.byte $00, $00, $00, $00, $ca
.byte $00
.byte $00, $00, $00, $00, $cf // $022
.byte $00, $00, $cd, $ce, $d0
.byte $00, $00, $00, $00, $d1
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $ca
.byte $00
.byte $00, $00, $00, $00, $c0 // $023
.byte $00, $00, $00, $00, $bf
.byte $00, $00, $00, $00, $be
.byte $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00
.byte $00
.byte $d2, $00, $c4, $ce, $d0 // $024
.byte $00, $d4, $d8, $d5, $00
.byte $00, $d5, $d9, $db, $de
.byte $00, $d6, $da, $dc, $df
.byte $d3, $d7, $c4, $dd, $e0
.byte $00
.byte $21, $21, $28, $2c, $31 // $025
.byte $22, $25, $29, $2d, $32
.byte $23, $26, $2a, $2e, $33
.byte $24, $27, $2b, $2f, $0e
.byte $21, $21, $21, $30, $34
.byte $0c
.byte $21, $21, $30, $0e, $10 // $026
.byte $21, $37, $3b, $34, $41
.byte $35, $38, $3c, $3f, $42
.byte $21, $39, $3d, $40, $43
.byte $36, $3a, $3e, $1b, $1e
.byte $0c
.byte $21, $21, $0d, $46, $10 // $027
.byte $21, $21, $44, $47, $4a
.byte $21, $21, $45, $48, $4b
.byte $21, $21, $21, $49, $4c
.byte $21, $21, $21, $21, $4d
.byte $0c
.byte $11, $3f, $42, $45, $48 // $028
.byte $03, $07, $43, $46, $49
.byte $11, $11, $44, $47, $32
.byte $11, $40, $08, $30, $33
.byte $3e, $41, $09, $0b, $0e
.byte $0d
.byte $21, $21, $21, $21, $4d // $029
.byte $21, $21, $21, $49, $4c
.byte $21, $21, $45, $48, $4b
.byte $21, $21, $44, $47, $4a
.byte $21, $21, $0d, $46, $10
.byte $0c
.byte $21, $01, $5a, $5d, $62 // $02a
.byte $21, $21, $5b, $5e, $63
.byte $21, $21, $5c, $5f, $64
.byte $18, $15, $21, $60, $65
.byte $19, $1b, $1e, $61, $66
.byte $0c
.byte $21, $21, $5a, $5d, $0b // $02b
.byte $21, $12, $21, $6a, $0c
.byte $21, $21, $14, $6b, $6e
.byte $67, $51, $68, $6c, $6f
.byte $21, $21, $69, $6d, $70
.byte $0c
.byte $21, $0d, $0e, $72, $74 // $02c
.byte $21, $21, $01, $73, $75
.byte $21, $15, $02, $05, $09
.byte $21, $71, $03, $06, $0b
.byte $21, $21, $04, $21, $0c
.byte $0c
.byte $01, $16, $1a, $20, $23 // $02d
.byte $01, $01, $56, $1e, $5b
.byte $01, $01, $57, $59, $5c
.byte $01, $0b, $58, $4b, $5d
.byte $01, $01, $49, $5a, $5e
.byte $0e
.byte $21, $0d, $0e, $10, $07 // $02e
.byte $21, $21, $01, $7f, $08
.byte $21, $15, $02, $05, $09
.byte $21, $71, $03, $80, $82
.byte $21, $21, $04, $81, $83
.byte $0c
.byte $67, $84, $0d, $0e, $10 // $02f
.byte $21, $85, $87, $89, $8a
.byte $21, $86, $88, $05, $41
.byte $21, $35, $03, $06, $42
.byte $21, $36, $04, $40, $43
.byte $0c
.byte $21, $21, $69, $15, $0b // $030
.byte $21, $21, $0d, $0e, $0c
.byte $21, $21, $30, $72, $74
.byte $21, $21, $7f, $73, $75
.byte $21, $36, $3a, $40, $43
.byte $0c
.byte $01, $01, $01, $01, $01 // $031
.byte $01, $01, $01, $01, $01
.byte $01, $01, $01, $01, $6b
.byte $01, $01, $01, $01, $6c
.byte $01, $01, $01, $01, $6d
.byte $0e
.byte $01, $01, $01, $01, $6d // $032
.byte $01, $01, $01, $01, $6c
.byte $01, $01, $01, $01, $6e
.byte $01, $01, $01, $01, $6f
.byte $01, $01, $01, $01, $70
.byte $0e
.byte $01, $01, $01, $01, $73 // $033
.byte $01, $01, $71, $72, $74
.byte $01, $01, $01, $01, $75
.byte $01, $01, $01, $01, $6c
.byte $01, $01, $01, $01, $70
.byte $0e
.byte $01, $01, $01, $01, $6d // $034
.byte $01, $01, $01, $01, $6c
.byte $01, $01, $01, $01, $6b
.byte $01, $01, $01, $01, $01
.byte $01, $01, $01, $01, $01
.byte $0e
.byte $01, $01, $01, $01, $7c // $035
.byte $01, $01, $01, $78, $7d
.byte $01, $01, $76, $79, $7e
.byte $01, $01, $77, $7a, $7f
.byte $01, $01, $71, $7b, $74
.byte $0e
.byte $01, $81, $71, $8a, $8f // $036
.byte $80, $83, $86, $8b, $90
.byte $81, $84, $87, $8c, $91
.byte $6e, $85, $88, $8d, $92
.byte $82, $73, $89, $8e, $93
.byte $0e
.byte $94, $95, $97, $9a, $9f // $037
.byte $01, $96, $98, $9b, $a0
.byte $01, $81, $99, $9c, $a1
.byte $01, $80, $83, $9d, $a2
.byte $01, $01, $81, $9e, $a3
.byte $0e
.byte $01, $71, $72, $aa, $ae // $038
.byte $01, $01, $a6, $ab, $af
.byte $01, $a4, $a7, $ac, $b0
.byte $01, $a5, $a8, $ad, $6e
.byte $01, $01, $a9, $01, $6f
.byte $0e
.byte $01, $01, $01, $01, $b1 // $039
.byte $01, $01, $01, $01, $b2
.byte $01, $01, $01, $01, $01
.byte $01, $01, $01, $01, $01
.byte $01, $01, $01, $01, $01
.byte $0e
.byte $01, $01, $b3, $8a, $8f // $03a
.byte $01, $01, $b4, $8b, $90
.byte $01, $80, $83, $8c, $91
.byte $01, $01, $b5, $8d, $92
.byte $01, $01, $b6, $b7, $93
.byte $0e
.byte $01, $01, $b9, $ba, $bc // $03b
.byte $01, $01, $a5, $bb, $bd
.byte $01, $b8, $b1, $82, $be
.byte $01, $01, $b2, $94, $95
.byte $01, $01, $80, $83, $bf
.byte $0e
.byte $01, $01, $01, $01, $73 // $03c
.byte $01, $01, $01, $8b, $90
.byte $01, $01, $01, $8c, $91
.byte $01, $01, $01, $8d, $92
.byte $01, $01, $01, $b7, $93
.byte $0e
.byte $01, $01, $01, $01, $c3 // $03d
.byte $01, $a4, $98, $9b, $a0
.byte $01, $c0, $99, $9c, $a1
.byte $bc, $c1, $c2, $9d, $a2
.byte $bd, $73, $b9, $9e, $a3
.byte $0e
.byte $6e, $c4, $c7, $ca, $b9 // $03e
.byte $6f, $c5, $c8, $cb, $cd
.byte $89, $c6, $c9, $cc, $b9
.byte $97, $9a, $9f, $8d, $92
.byte $01, $b9, $73, $b7, $93
.byte $0e
.byte $82, $be, $6e, $9b, $a0 // $03f
.byte $94, $95, $6f, $9c, $a1
.byte $01, $96, $73, $9d, $a2
.byte $01, $01, $b4, $9e, $a3
.byte $01, $80, $83, $ce, $73
.byte $0e
.byte $01, $01, $81, $a4, $6e // $040
.byte $01, $01, $71, $72, $6f
.byte $01, $01, $b3, $aa, $ae
.byte $01, $01, $b4, $ab, $af
.byte $01, $80, $83, $ce, $cf
.byte $0e
.byte $01, $d4, $d9, $d9, $de // $041
.byte $d0, $d5, $da, $dc, $df
.byte $d1, $d6, $db, $dd, $e0
.byte $d2, $d7, $d8, $d8, $d8
.byte $d3, $d8, $d8, $d8, $e1
.byte $0e
.byte $12, $08, $08, $08, $1d // $042
.byte $13, $08, $08, $08, $1e
.byte $14, $17, $1a, $08, $1f
.byte $15, $18, $08, $08, $20
.byte $16, $19, $1b, $1c, $21
.byte $1b
.byte $03, $04, $05, $07, $08 // $043
.byte $02, $02, $06, $06, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $1d
.byte $29, $2c, $22, $34, $39 // $044
.byte $2a, $2d, $22, $35, $3a
.byte $2b, $2e, $31, $36, $3b
.byte $08, $2f, $32, $37, $3c
.byte $08, $30, $33, $38, $3d
.byte $1b
.byte $1e, $23, $28, $2c, $30 // $045
.byte $1f, $24, $29, $2d, $31
.byte $20, $25, $2a, $2e, $32
.byte $21, $26, $2b, $06, $02
.byte $22, $27, $02, $2f, $33
.byte $1d
.byte $29, $34, $36, $38, $3a // $046
.byte $02, $35, $37, $39, $3b
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $1d
.byte $3c, $3f, $02, $02, $02 // $047
.byte $3d, $40, $43, $02, $02
.byte $3e, $41, $44, $46, $47
.byte $02, $42, $45, $41, $44
.byte $02, $02, $02, $42, $45
.byte $1d
.byte $48, $4d, $02, $02, $02 // $048
.byte $49, $4e, $02, $02, $02
.byte $4a, $4f, $02, $53, $56
.byte $4b, $50, $02, $54, $57
.byte $4c, $51, $52, $55, $58
.byte $1d
.byte $59, $5d, $61, $65, $69 // $049
.byte $5a, $5e, $62, $66, $6a
.byte $5b, $5f, $63, $67, $02
.byte $06, $60, $64, $68, $02
.byte $5c, $02, $02, $02, $02
.byte $1d
.byte $02, $02, $02, $02, $02 // $04a
.byte $02, $02, $02, $02, $02
.byte $6e, $02, $02, $02, $6b
.byte $6f, $02, $02, $02, $6c
.byte $70, $02, $02, $02, $6d
.byte $1d
.byte $72, $7c, $72, $71, $7f // $04b
.byte $02, $7d, $73, $75, $79
.byte $75, $79, $74, $76, $7a
.byte $76, $7a, $7e, $77, $81
.byte $77, $81, $80, $78, $7b
.byte $1d
.byte $22, $22, $22, $22, $a2 // $04c
.byte $22, $22, $22, $22, $a3
.byte $22, $22, $22, $22, $00
.byte $22, $22, $22, $22, $01
.byte $22, $22, $22, $22, $02
.byte $1b
.byte $02, $88, $8d, $8d, $92 // $04d
.byte $84, $89, $8e, $90, $93
.byte $85, $8a, $8f, $91, $94
.byte $86, $8b, $8c, $8c, $8c
.byte $87, $8c, $8c, $8c, $95
.byte $1d
.byte $16, $0c, $0c, $0c, $21 // $04e
.byte $17, $0c, $0c, $0c, $22
.byte $18, $1b, $1e, $0c, $23
.byte $19, $1c, $0c, $0c, $24
.byte $1a, $1d, $1f, $20, $25
.byte $25
.byte $a6, $a7, $a8, $aa, $ab // $04f
.byte $02, $02, $a9, $a9, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $1d
.byte $ac, $af, $02, $b7, $bc // $050
.byte $ad, $b0, $02, $b8, $bd
.byte $ae, $b1, $b4, $b9, $be
.byte $8c, $b2, $b5, $ba, $bf
.byte $8c, $b3, $b6, $bb, $c0
.byte $1d
.byte $c1, $c6, $cb, $cf, $d3 // $051
.byte $c2, $c7, $cc, $d0, $d4
.byte $c3, $c8, $cd, $d1, $d5
.byte $c4, $c9, $ce, $a9, $02
.byte $c5, $ca, $02, $d2, $d6
.byte $1d
.byte $cc, $d7, $d9, $db, $dd // $052
.byte $02, $d8, $da, $dc, $de
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $02, $02, $02, $02, $02
.byte $1d
.byte $df, $e4, $02, $02, $02 // $053
.byte $e0, $4e, $e5, $e9, $ed
.byte $e1, $4f, $e6, $ea, $ee
.byte $e2, $50, $e7, $eb, $ef
.byte $e3, $51, $e8, $ec, $f0
.byte $1d
.byte $52, $56, $59, $5c, $5f // $054
.byte $53, $57, $5a, $5d, $51
.byte $54, $58, $5b, $5e, $51
.byte $09, $51, $51, $51, $51
.byte $55, $51, $51, $51, $51
.byte $27
.byte $10, $13, $01, $01, $01 // $055
.byte $11, $14, $17, $01, $01
.byte $12, $15, $18, $1a, $1b
.byte $01, $16, $19, $15, $18
.byte $01, $01, $01, $16, $19
.byte $2c
.byte $26, $27, $26, $1c, $2c // $056
.byte $01, $28, $1d, $1f, $23
.byte $1f, $23, $1e, $20, $24
.byte $20, $24, $2a, $21, $29
.byte $21, $29, $2b, $22, $25
.byte $2c
.byte $00, $00, $00, $00, $be // $057
.byte $00, $00, $00, $c2, $bf
.byte $00, $00, $00, $c3, $c0
.byte $00, $00, $00, $c4, $c7
.byte $00, $00, $00, $cd, $c8
.byte $00
.byte $00, $00, $00, $c5, $c9 // $058
.byte $00, $00, $00, $00, $ca
.byte $00, $00, $00, $00, $cb
.byte $00, $00, $00, $00, $cc
.byte $00, $00, $00, $00, $cf
.byte $00
.byte $71, $71, $71, $71, $9d // $059
.byte $71, $71, $71, $71, $9e
.byte $71, $71, $71, $71, $04
.byte $71, $71, $71, $71, $05
.byte $71, $71, $71, $71, $06
.byte $25
.byte $0f, $13, $12, $11, $10 // $05a
.byte $10, $0f, $13, $12, $11
.byte $11, $10, $0f, $13, $12
.byte $12, $11, $10, $0f, $13
.byte $13, $12, $11, $10, $0f
.byte $2e
VirTileData:
.word $0000 // $000
.word $001e // $001
.word $0020 // $002
.word $0801 // $003
.word $0009 // $004
.word $0c0a // $005
.word $0803 // $006
.word $0016 // $007
.word $0c15 // $008
.word $0021 // $009
.word $0008 // $00a
.word $080a // $00b
.word $0806 // $00c
.word $0029 // $00d
.word $005a // $00e
.word $0028 // $00f
.word $0027 // $010
.word $0805 // $011
.word $0423 // $012
.word $0c23 // $013
.word $0023 // $014
.word $080c // $015
.word $0425 // $016
.word $0c25 // $017
.word $0816 // $018
.word $0426 // $019
.word $082c // $01a
.word $0001 // $01b
.word $0809 // $01c
.word $000c // $01d
.word $081c // $01e
.word $085a // $01f
.word $0810 // $020
.word $001c // $021
.word $081b // $022
.word $081a // $023
.word $000a // $024
.word $0819 // $025
.word $045a // $026
.word $0006 // $027
.word $0807 // $028
.word $0c5a // $029
.word $001f // $02a
.word $002d // $02b
.word $0804 // $02c
.word $0030 // $02d
.word $0802 // $02e
.word $002e // $02f
.word $002f // $030
.word $002b // $031
.word $0003 // $032
.word $0815 // $033
.word $0817 // $034
.word $0015 // $035
.word $000b // $036
.word $0011 // $037
.word $080d // $038
.word $0004 // $039
.word $0808 // $03a
.word $000d // $03b
.word $003d // $03c
.word $0039 // $03d
.word $003e // $03e
.word $0007 // $03f
.word $0836 // $040
.word $0837 // $041
.word $0005 // $042
.word $0811 // $043
.word $080b // $044
.word $0024 // $045
.word $0026 // $046
.word $002c // $047
.word $003c // $048
.word $0812 // $049
.word $003f // $04a
.word $0002 // $04b
.word $083d // $04c
.word $001d // $04d
.word $083e // $04e
.word $083f // $04f
.word $0839 // $050
.word $083a // $051
.word $0017 // $052
.word $0018 // $053
.word $0019 // $054
.word $001a // $055
.word $001b // $056
.word $0010 // $057
.word $081d // $058
.word $000e // $059
.word $000f // $05a
.word $0012 // $05b
.word $083c // $05c
.word $0818 // $05d
.word $081e // $05e
.word $081f // $05f
.word $0823 // $060
.word $0c05 // $061
.word $0c08 // $062
.word $0c17 // $063
.word $003b // $064
.word $0c38 // $065
.word $0434 // $066
.word $0406 // $067
.word $0036 // $068
.word $0c3f // $069
.word $043f // $06a
.word $0037 // $06b
.word $0c35 // $06c
.word $043b // $06d
.word $0431 // $06e
.word $0834 // $06f
.word $0432 // $070
.word $0831 // $071
.word $0403 // $072
.word $0840 // $073
.word $040a // $074
.word $0c3e // $075
.word $0c3d // $076
.word $0413 // $077
.word $0414 // $078
.word $0833 // $079
.word $0832 // $07a
.word $0057 // $07b
.word $004d // $07c
.word $0050 // $07d
.word $0053 // $07e
.word $0058 // $07f
.word $004e // $080
.word $0051 // $081
.word $0054 // $082
.word $0059 // $083
.word $004f // $084
.word $0052 // $085
.word $0055 // $086
.word $0056 // $087
.word $042a // $088
.word $0022 // $089
.word $0013 // $08a
.word $0443 // $08b
.word $0446 // $08c
.word $0447 // $08d
.word $044b // $08e
.word $0442 // $08f
.word $0445 // $090
.word $0449 // $091
.word $044c // $092
.word $0441 // $093
.word $0444 // $094
.word $0448 // $095
.word $044a // $096
.word $0427 // $097
.word $0821 // $098
.word $0822 // $099
TileMapData:
.byte $00, $00, $00, $00, $01, $00 // $000
.byte $00, $00, $00, $00, $02, $00 // $001
.byte $03, $04, $05, $00, $02, $00 // $002
.byte $06, $07, $08, $00, $09, $00 // $003
.byte $06, $0a, $0b, $00, $02, $00 // $004
.byte $0c, $00, $00, $00, $0d, $00 // $005
.byte $0e, $00, $00, $00, $0f, $00 // $006
.byte $03, $00, $00, $00, $10, $00 // $007
.byte $11, $00, $12, $13, $14, $00 // $008
.byte $15, $00, $16, $17, $00, $00 // $009
.byte $18, $00, $19, $1a, $1b, $00 // $00a
.byte $1c, $00, $00, $00, $1d, $00 // $00b
.byte $1e, $00, $00, $1f, $07, $00 // $00c
.byte $20, $00, $00, $00, $21, $00 // $00d
.byte $22, $00, $00, $00, $0a, $00 // $00e
.byte $23, $00, $00, $00, $24, $00 // $00f
.byte $25, $26, $00, $00, $27, $00 // $010
.byte $28, $00, $00, $00, $00, $00 // $011
.byte $1c, $00, $00, $00, $29, $00 // $012
.byte $25, $00, $00, $00, $01, $00 // $013
.byte $22, $00, $00, $00, $2a, $00 // $014
.byte $18, $00, $00, $00, $2b, $00 // $015
.byte $2c, $00, $00, $00, $2d, $00 // $016
.byte $2e, $00, $00, $00, $2f, $00 // $017
.byte $0c, $00, $00, $00, $30, $00 // $018
.byte $00, $00, $00, $00, $2b, $00 // $019
.byte $03, $00, $00, $00, $31, $00 // $01a
.byte $15, $00, $00, $00, $10, $00 // $01b
.byte $18, $00, $00, $00, $32, $00 // $01c
.byte $1c, $00, $00, $00, $1d, $00 // $01d
.byte $20, $00, $00, $00, $04, $00 // $01e
.byte $33, $00, $00, $00, $0a, $00 // $01f
.byte $1e, $00, $00, $00, $07, $00 // $020
.byte $34, $00, $00, $00, $35, $00 // $021
.byte $22, $00, $00, $00, $1d, $00 // $022
.byte $33, $00, $00, $00, $36, $00 // $023
.byte $18, $00, $00, $00, $04, $00 // $024
.byte $34, $00, $00, $00, $37, $00 // $025
.byte $25, $00, $00, $00, $24, $00 // $026
.byte $38, $00, $00, $00, $32, $00 // $027
.byte $28, $00, $00, $00, $39, $00 // $028
.byte $3a, $00, $00, $00, $3b, $00 // $029
.byte $20, $00, $00, $00, $3c, $00 // $02a
.byte $22, $00, $00, $3d, $3e, $00 // $02b
.byte $1e, $00, $00, $00, $04, $00 // $02c
.byte $23, $00, $00, $00, $3f, $00 // $02d
.byte $40, $00, $00, $00, $37, $00 // $02e
.byte $41, $00, $00, $00, $24, $00 // $02f
.byte $33, $00, $00, $00, $42, $00 // $030
.byte $18, $00, $00, $00, $01, $00 // $031
.byte $20, $00, $00, $00, $02, $00 // $032
.byte $43, $00, $00, $00, $0d, $00 // $033
.byte $18, $00, $00, $00, $0f, $00 // $034
.byte $44, $00, $00, $00, $45, $00 // $035
.byte $0b, $00, $00, $00, $46, $00 // $036
.byte $1e, $00, $00, $00, $31, $00 // $037
.byte $0b, $00, $00, $00, $47, $00 // $038
.byte $11, $00, $00, $00, $10, $00 // $039
.byte $0c, $00, $00, $00, $14, $00 // $03a
.byte $03, $00, $00, $00, $00, $00 // $03b
.byte $06, $00, $00, $00, $00, $00 // $03c
.byte $2c, $00, $00, $00, $00, $00 // $03d
.byte $15, $00, $00, $00, $1b, $00 // $03e
.byte $0b, $00, $00, $00, $1d, $00 // $03f
.byte $44, $00, $00, $00, $21, $00 // $040
.byte $33, $00, $00, $00, $36, $00 // $041
.byte $18, $00, $00, $00, $3c, $00 // $042
.byte $25, $00, $00, $48, $3e, $00 // $043
.byte $49, $00, $00, $3d, $4a, $00 // $044
.byte $33, $00, $00, $00, $36, $00 // $045
.byte $0b, $00, $00, $00, $24, $00 // $046
.byte $2c, $00, $00, $00, $27, $00 // $047
.byte $0c, $00, $00, $00, $00, $00 // $048
.byte $00, $00, $00, $00, $00, $00 // $049
.byte $00, $00, $00, $00, $1b, $00 // $04a
.byte $00, $00, $00, $00, $39, $00 // $04b
.byte $00, $00, $00, $00, $4b, $00 // $04c
.byte $03, $00, $00, $00, $1d, $00 // $04d
.byte $1c, $00, $00, $00, $07, $00 // $04e
.byte $4c, $00, $00, $00, $4d, $00 // $04f
.byte $4e, $00, $00, $00, $36, $00 // $050
.byte $4f, $50, $00, $00, $07, $00 // $051
.byte $51, $00, $00, $00, $52, $00 // $052
.byte $1e, $00, $00, $00, $36, $00 // $053
.byte $23, $00, $00, $00, $53, $00 // $054
.byte $0b, $00, $00, $00, $37, $00 // $055
.byte $06, $00, $00, $00, $24, $00 // $056
.byte $15, $00, $00, $00, $39, $00 // $057
.byte $1c, $00, $00, $00, $32, $00 // $058
.byte $44, $00, $00, $00, $54, $00 // $059
.byte $28, $00, $00, $00, $55, $00 // $05a
.byte $20, $00, $00, $00, $56, $00 // $05b
.byte $20, $00, $00, $00, $35, $00 // $05c
.byte $3a, $00, $00, $00, $1d, $00 // $05d
.byte $44, $00, $00, $00, $3b, $00 // $05e
.byte $3a, $00, $00, $00, $57, $00 // $05f
.byte $58, $00, $00, $00, $3f, $00 // $060
.byte $25, $00, $00, $00, $0a, $00 // $061
.byte $25, $00, $00, $00, $07, $00 // $062
.byte $22, $00, $00, $00, $04, $00 // $063
.byte $43, $00, $00, $00, $3b, $00 // $064
.byte $18, $00, $00, $00, $59, $00 // $065
.byte $22, $00, $00, $00, $5a, $00 // $066
.byte $0b, $00, $00, $00, $57, $00 // $067
.byte $0c, $00, $00, $00, $5b, $00 // $068
.byte $00, $00, $00, $00, $24, $00 // $069
.byte $00, $00, $00, $00, $39, $00 // $06a
.byte $00, $00, $00, $00, $42, $00 // $06b
.byte $00, $00, $00, $00, $27, $00 // $06c
.byte $03, $00, $00, $00, $01, $00 // $06d
.byte $15, $00, $00, $00, $09, $00 // $06e
.byte $4c, $00, $00, $00, $2a, $00 // $06f
.byte $4e, $5c, $00, $00, $14, $00 // $070
.byte $4f, $50, $00, $00, $00, $00 // $071
.byte $33, $00, $00, $00, $1b, $00 // $072
.byte $0b, $00, $00, $00, $3b, $00 // $073
.byte $06, $00, $00, $00, $57, $00 // $074
.byte $15, $00, $00, $00, $52, $00 // $075
.byte $1c, $00, $00, $00, $07, $00 // $076
.byte $0b, $00, $00, $00, $56, $00 // $077
.byte $2c, $00, $00, $00, $21, $00 // $078
.byte $38, $00, $00, $00, $3c, $00 // $079
.byte $20, $00, $00, $48, $3e, $00 // $07a
.byte $18, $00, $00, $3d, $4a, $00 // $07b
.byte $25, $00, $00, $00, $52, $00 // $07c
.byte $23, $00, $00, $00, $53, $00 // $07d
.byte $5d, $00, $00, $00, $52, $00 // $07e
.byte $3a, $00, $00, $00, $07, $00 // $07f
.byte $58, $00, $00, $00, $55, $00 // $080
.byte $1c, $00, $00, $00, $42, $00 // $081
.byte $0b, $00, $00, $00, $39, $00 // $082
.byte $2c, $00, $00, $00, $1d, $00 // $083
.byte $0c, $00, $00, $00, $24, $00 // $084
.byte $03, $00, $00, $00, $39, $00 // $085
.byte $15, $00, $00, $00, $42, $00 // $086
.byte $28, $00, $00, $00, $27, $00 // $087
.byte $3a, $00, $00, $00, $00, $00 // $088
.byte $25, $00, $00, $00, $00, $00 // $089
.byte $1e, $00, $00, $00, $1b, $00 // $08a
.byte $23, $00, $00, $00, $1d, $00 // $08b
.byte $0b, $00, $00, $00, $3f, $00 // $08c
.byte $0c, $00, $00, $00, $55, $00 // $08d
.byte $00, $00, $00, $00, $4d, $00 // $08e
.byte $5e, $00, $00, $00, $56, $00 // $08f
.byte $5f, $00, $00, $00, $04, $00 // $090
.byte $60, $00, $00, $00, $36, $00 // $091
.byte $00, $00, $00, $00, $42, $00 // $092
.byte $00, $00, $00, $00, $32, $00 // $093
.byte $00, $00, $00, $00, $32, $00 // $094
.byte $00, $00, $00, $00, $39, $00 // $095
.byte $61, $00, $00, $00, $42, $00 // $096
.byte $62, $00, $00, $00, $27, $00 // $097
.byte $63, $00, $64, $65, $66, $00 // $098
.byte $0a, $37, $38, $39, $3a, $03 // $099
.byte $18, $00, $6b, $6c, $6d, $00 // $09a
.byte $0b, $00, $6e, $6f, $70, $00 // $09b
.byte $0c, $00, $00, $00, $6e, $00 // $09c
.byte $00, $00, $00, $00, $00, $00 // $09d
.byte $00, $00, $00, $00, $1b, $00 // $09e
.byte $71, $00, $00, $00, $72, $00 // $09f
.byte $73, $00, $00, $00, $74, $00 // $0a0
.byte $75, $76, $00, $77, $78, $00 // $0a1
.byte $73, $00, $00, $00, $77, $00 // $0a2
.byte $79, $00, $00, $00, $42, $00 // $0a3
.byte $7a, $00, $00, $00, $39, $00 // $0a4
.byte $6f, $00, $00, $00, $42, $00 // $0a5
.byte $00, $00, $00, $00, $7b, $00 // $0a6
.byte $00, $7c, $7d, $7e, $7f, $00 // $0a7
.byte $00, $80, $81, $82, $83, $00 // $0a8
.byte $00, $84, $85, $86, $87, $00 // $0a9
.byte $03, $00, $00, $00, $88, $00 // $0aa
.byte $2c, $00, $00, $00, $89, $00 // $0ab
.byte $2c, $00, $00, $00, $39, $00 // $0ac
.byte $11, $00, $00, $00, $8a, $00 // $0ad
.byte $00, $8b, $8c, $8d, $8e, $00 // $0ae
.byte $00, $8f, $90, $91, $92, $00 // $0af
.byte $00, $93, $94, $95, $96, $00 // $0b0
.byte $00, $00, $00, $00, $01, $00 // $0b1
.byte $13, $00, $00, $00, $97, $00 // $0b2
.byte $98, $00, $00, $00, $2f, $00 // $0b3
.byte $5f, $00, $00, $00, $2d, $00 // $0b4
.byte $99, $00, $00, $00, $10, $00 // $0b5
.byte $60, $00, $00, $00, $14, $00 // $0b6
|
; Copyright (c) 2004, Intel Corporation
; All rights reserved. This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; DisablePaging64.Asm
;
; Abstract:
;
; AsmDisablePaging64 function
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; InternalX86DisablePaging64 (
; IN UINT16 Cs,
; IN UINT32 EntryPoint,
; IN UINT32 Context1, OPTIONAL
; IN UINT32 Context2, OPTIONAL
; IN UINT32 NewStack
; );
;------------------------------------------------------------------------------
InternalX86DisablePaging64 PROC
cli
shl rcx, 32 ; rcx[32..47] <- Cs
lea eax, @F
mov esi, r8d
or rcx, rax ; rcx[0..47] <- Cs:@F
mov edi, r9d
mov eax, [rsp + 28h] ; eax <- New Stack
push rcx
retf ; switch to compatibility mode
@@:
mov esp, eax ; set up new stack
mov rax, cr0
btr eax, 31
mov cr0, rax ; disable paging
mov ecx, 0c0000080h
rdmsr
and ah, NOT 1 ; clear LME
wrmsr
mov rax, cr4
and al, NOT (1 SHL 5) ; clear PAE
mov cr4, rax
push rdi ; push Context2
push rsi ; push Context1
call rdx ; transfer control to EntryPoint
hlt ; no one should get here
InternalX86DisablePaging64 ENDP
END
|
_forktest: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
printf(1, "fork test OK\n");
}
int
main(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
forktest();
6: e8 35 00 00 00 call 40 <forktest>
exit();
b: e8 32 03 00 00 call 342 <exit>
00000010 <printf>:
#define N 1000
void
printf(int fd, char *s, ...)
{
10: 55 push %ebp
11: 89 e5 mov %esp,%ebp
13: 53 push %ebx
14: 83 ec 14 sub $0x14,%esp
17: 8b 5d 0c mov 0xc(%ebp),%ebx
write(fd, s, strlen(s));
1a: 89 1c 24 mov %ebx,(%esp)
1d: e8 7e 01 00 00 call 1a0 <strlen>
22: 89 5c 24 04 mov %ebx,0x4(%esp)
26: 89 44 24 08 mov %eax,0x8(%esp)
2a: 8b 45 08 mov 0x8(%ebp),%eax
2d: 89 04 24 mov %eax,(%esp)
30: e8 2d 03 00 00 call 362 <write>
}
35: 83 c4 14 add $0x14,%esp
38: 5b pop %ebx
39: 5d pop %ebp
3a: c3 ret
3b: 90 nop
3c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000040 <forktest>:
void
forktest(void)
{
40: 55 push %ebp
41: 89 e5 mov %esp,%ebp
43: 53 push %ebx
int n, pid;
printf(1, "fork test\n");
for(n=0; n<N; n++){
44: 31 db xor %ebx,%ebx
write(fd, s, strlen(s));
}
void
forktest(void)
{
46: 83 ec 14 sub $0x14,%esp
int n, pid;
printf(1, "fork test\n");
49: c7 44 24 04 14 04 00 movl $0x414,0x4(%esp)
50: 00
51: c7 04 24 01 00 00 00 movl $0x1,(%esp)
58: e8 b3 ff ff ff call 10 <printf>
5d: eb 13 jmp 72 <forktest+0x32>
5f: 90 nop
for(n=0; n<N; n++){
pid = fork();
if(pid < 0)
break;
if(pid == 0)
60: 0f 84 97 00 00 00 je fd <forktest+0xbd>
{
int n, pid;
printf(1, "fork test\n");
for(n=0; n<N; n++){
66: 83 c3 01 add $0x1,%ebx
69: 81 fb e8 03 00 00 cmp $0x3e8,%ebx
6f: 90 nop
70: 74 4e je c0 <forktest+0x80>
pid = fork();
72: e8 c3 02 00 00 call 33a <fork>
if(pid < 0)
77: 85 c0 test %eax,%eax
79: 79 e5 jns 60 <forktest+0x20>
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
}
for(; n > 0; n--){
7b: 85 db test %ebx,%ebx
7d: 8d 76 00 lea 0x0(%esi),%esi
80: 74 15 je 97 <forktest+0x57>
82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(wait() < 0){
88: e8 bd 02 00 00 call 34a <wait>
8d: 85 c0 test %eax,%eax
8f: 90 nop
90: 78 57 js e9 <forktest+0xa9>
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
}
for(; n > 0; n--){
92: 83 eb 01 sub $0x1,%ebx
95: 75 f1 jne 88 <forktest+0x48>
printf(1, "wait stopped early\n");
exit();
}
}
if(wait() != -1){
97: e8 ae 02 00 00 call 34a <wait>
9c: 83 f8 ff cmp $0xffffffff,%eax
9f: 90 nop
a0: 75 60 jne 102 <forktest+0xc2>
printf(1, "wait got too many\n");
exit();
}
printf(1, "fork test OK\n");
a2: c7 44 24 04 46 04 00 movl $0x446,0x4(%esp)
a9: 00
aa: c7 04 24 01 00 00 00 movl $0x1,(%esp)
b1: e8 5a ff ff ff call 10 <printf>
}
b6: 83 c4 14 add $0x14,%esp
b9: 5b pop %ebx
ba: 5d pop %ebp
bb: c3 ret
bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
#define N 1000
void
printf(int fd, char *s, ...)
{
write(fd, s, strlen(s));
c0: c7 04 24 54 04 00 00 movl $0x454,(%esp)
c7: e8 d4 00 00 00 call 1a0 <strlen>
cc: c7 44 24 04 54 04 00 movl $0x454,0x4(%esp)
d3: 00
d4: c7 04 24 01 00 00 00 movl $0x1,(%esp)
db: 89 44 24 08 mov %eax,0x8(%esp)
df: e8 7e 02 00 00 call 362 <write>
exit();
}
if(n == N){
printf(1, "fork claimed to work N times!\n", N);
exit();
e4: e8 59 02 00 00 call 342 <exit>
}
for(; n > 0; n--){
if(wait() < 0){
printf(1, "wait stopped early\n");
e9: c7 44 24 04 1f 04 00 movl $0x41f,0x4(%esp)
f0: 00
f1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
f8: e8 13 ff ff ff call 10 <printf>
exit();
fd: e8 40 02 00 00 call 342 <exit>
}
}
if(wait() != -1){
printf(1, "wait got too many\n");
102: c7 44 24 04 33 04 00 movl $0x433,0x4(%esp)
109: 00
10a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
111: e8 fa fe ff ff call 10 <printf>
exit();
116: e8 27 02 00 00 call 342 <exit>
11b: 66 90 xchg %ax,%ax
11d: 66 90 xchg %ax,%ax
11f: 90 nop
00000120 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 8b 45 08 mov 0x8(%ebp),%eax
126: 8b 4d 0c mov 0xc(%ebp),%ecx
129: 53 push %ebx
char *os;
os = s;
while((*s++ = *t++) != 0)
12a: 89 c2 mov %eax,%edx
12c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
130: 83 c1 01 add $0x1,%ecx
133: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
137: 83 c2 01 add $0x1,%edx
13a: 84 db test %bl,%bl
13c: 88 5a ff mov %bl,-0x1(%edx)
13f: 75 ef jne 130 <strcpy+0x10>
;
return os;
}
141: 5b pop %ebx
142: 5d pop %ebp
143: c3 ret
144: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
14a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000150 <strcmp>:
int
strcmp(const char *p, const char *q)
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 8b 55 08 mov 0x8(%ebp),%edx
156: 53 push %ebx
157: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
15a: 0f b6 02 movzbl (%edx),%eax
15d: 84 c0 test %al,%al
15f: 74 2d je 18e <strcmp+0x3e>
161: 0f b6 19 movzbl (%ecx),%ebx
164: 38 d8 cmp %bl,%al
166: 74 0e je 176 <strcmp+0x26>
168: eb 2b jmp 195 <strcmp+0x45>
16a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
170: 38 c8 cmp %cl,%al
172: 75 15 jne 189 <strcmp+0x39>
p++, q++;
174: 89 d9 mov %ebx,%ecx
176: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
179: 0f b6 02 movzbl (%edx),%eax
p++, q++;
17c: 8d 59 01 lea 0x1(%ecx),%ebx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
17f: 0f b6 49 01 movzbl 0x1(%ecx),%ecx
183: 84 c0 test %al,%al
185: 75 e9 jne 170 <strcmp+0x20>
187: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
189: 29 c8 sub %ecx,%eax
}
18b: 5b pop %ebx
18c: 5d pop %ebp
18d: c3 ret
18e: 0f b6 09 movzbl (%ecx),%ecx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
191: 31 c0 xor %eax,%eax
193: eb f4 jmp 189 <strcmp+0x39>
195: 0f b6 cb movzbl %bl,%ecx
198: eb ef jmp 189 <strcmp+0x39>
19a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000001a0 <strlen>:
return (uchar)*p - (uchar)*q;
}
uint
strlen(char *s)
{
1a0: 55 push %ebp
1a1: 89 e5 mov %esp,%ebp
1a3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1a6: 80 39 00 cmpb $0x0,(%ecx)
1a9: 74 12 je 1bd <strlen+0x1d>
1ab: 31 d2 xor %edx,%edx
1ad: 8d 76 00 lea 0x0(%esi),%esi
1b0: 83 c2 01 add $0x1,%edx
1b3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1b7: 89 d0 mov %edx,%eax
1b9: 75 f5 jne 1b0 <strlen+0x10>
;
return n;
}
1bb: 5d pop %ebp
1bc: c3 ret
uint
strlen(char *s)
{
int n;
for(n = 0; s[n]; n++)
1bd: 31 c0 xor %eax,%eax
;
return n;
}
1bf: 5d pop %ebp
1c0: c3 ret
1c1: eb 0d jmp 1d0 <memset>
1c3: 90 nop
1c4: 90 nop
1c5: 90 nop
1c6: 90 nop
1c7: 90 nop
1c8: 90 nop
1c9: 90 nop
1ca: 90 nop
1cb: 90 nop
1cc: 90 nop
1cd: 90 nop
1ce: 90 nop
1cf: 90 nop
000001d0 <memset>:
void*
memset(void *dst, int c, uint n)
{
1d0: 55 push %ebp
1d1: 89 e5 mov %esp,%ebp
1d3: 8b 55 08 mov 0x8(%ebp),%edx
1d6: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1d7: 8b 4d 10 mov 0x10(%ebp),%ecx
1da: 8b 45 0c mov 0xc(%ebp),%eax
1dd: 89 d7 mov %edx,%edi
1df: fc cld
1e0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1e2: 89 d0 mov %edx,%eax
1e4: 5f pop %edi
1e5: 5d pop %ebp
1e6: c3 ret
1e7: 89 f6 mov %esi,%esi
1e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001f0 <strchr>:
char*
strchr(const char *s, char c)
{
1f0: 55 push %ebp
1f1: 89 e5 mov %esp,%ebp
1f3: 8b 45 08 mov 0x8(%ebp),%eax
1f6: 53 push %ebx
1f7: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
1fa: 0f b6 18 movzbl (%eax),%ebx
1fd: 84 db test %bl,%bl
1ff: 74 1d je 21e <strchr+0x2e>
if(*s == c)
201: 38 d3 cmp %dl,%bl
203: 89 d1 mov %edx,%ecx
205: 75 0d jne 214 <strchr+0x24>
207: eb 17 jmp 220 <strchr+0x30>
209: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
210: 38 ca cmp %cl,%dl
212: 74 0c je 220 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
214: 83 c0 01 add $0x1,%eax
217: 0f b6 10 movzbl (%eax),%edx
21a: 84 d2 test %dl,%dl
21c: 75 f2 jne 210 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
21e: 31 c0 xor %eax,%eax
}
220: 5b pop %ebx
221: 5d pop %ebp
222: c3 ret
223: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
229: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000230 <gets>:
char*
gets(char *buf, int max)
{
230: 55 push %ebp
231: 89 e5 mov %esp,%ebp
233: 57 push %edi
234: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
235: 31 f6 xor %esi,%esi
return 0;
}
char*
gets(char *buf, int max)
{
237: 53 push %ebx
238: 83 ec 2c sub $0x2c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
23b: 8d 7d e7 lea -0x19(%ebp),%edi
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
23e: eb 31 jmp 271 <gets+0x41>
cc = read(0, &c, 1);
240: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
247: 00
248: 89 7c 24 04 mov %edi,0x4(%esp)
24c: c7 04 24 00 00 00 00 movl $0x0,(%esp)
253: e8 02 01 00 00 call 35a <read>
if(cc < 1)
258: 85 c0 test %eax,%eax
25a: 7e 1d jle 279 <gets+0x49>
break;
buf[i++] = c;
25c: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
260: 89 de mov %ebx,%esi
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
262: 8b 55 08 mov 0x8(%ebp),%edx
if(c == '\n' || c == '\r')
265: 3c 0d cmp $0xd,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
267: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
26b: 74 0c je 279 <gets+0x49>
26d: 3c 0a cmp $0xa,%al
26f: 74 08 je 279 <gets+0x49>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
271: 8d 5e 01 lea 0x1(%esi),%ebx
274: 3b 5d 0c cmp 0xc(%ebp),%ebx
277: 7c c7 jl 240 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
279: 8b 45 08 mov 0x8(%ebp),%eax
27c: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
280: 83 c4 2c add $0x2c,%esp
283: 5b pop %ebx
284: 5e pop %esi
285: 5f pop %edi
286: 5d pop %ebp
287: c3 ret
288: 90 nop
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000290 <stat>:
int
stat(char *n, struct stat *st)
{
290: 55 push %ebp
291: 89 e5 mov %esp,%ebp
293: 56 push %esi
294: 53 push %ebx
295: 83 ec 10 sub $0x10,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
298: 8b 45 08 mov 0x8(%ebp),%eax
29b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2a2: 00
2a3: 89 04 24 mov %eax,(%esp)
2a6: e8 d7 00 00 00 call 382 <open>
if(fd < 0)
2ab: 85 c0 test %eax,%eax
stat(char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
2ad: 89 c3 mov %eax,%ebx
if(fd < 0)
2af: 78 27 js 2d8 <stat+0x48>
return -1;
r = fstat(fd, st);
2b1: 8b 45 0c mov 0xc(%ebp),%eax
2b4: 89 1c 24 mov %ebx,(%esp)
2b7: 89 44 24 04 mov %eax,0x4(%esp)
2bb: e8 da 00 00 00 call 39a <fstat>
close(fd);
2c0: 89 1c 24 mov %ebx,(%esp)
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
r = fstat(fd, st);
2c3: 89 c6 mov %eax,%esi
close(fd);
2c5: e8 a0 00 00 00 call 36a <close>
return r;
2ca: 89 f0 mov %esi,%eax
}
2cc: 83 c4 10 add $0x10,%esp
2cf: 5b pop %ebx
2d0: 5e pop %esi
2d1: 5d pop %ebp
2d2: c3 ret
2d3: 90 nop
2d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
2d8: b8 ff ff ff ff mov $0xffffffff,%eax
2dd: eb ed jmp 2cc <stat+0x3c>
2df: 90 nop
000002e0 <atoi>:
return r;
}
int
atoi(const char *s)
{
2e0: 55 push %ebp
2e1: 89 e5 mov %esp,%ebp
2e3: 8b 4d 08 mov 0x8(%ebp),%ecx
2e6: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
2e7: 0f be 11 movsbl (%ecx),%edx
2ea: 8d 42 d0 lea -0x30(%edx),%eax
2ed: 3c 09 cmp $0x9,%al
int
atoi(const char *s)
{
int n;
n = 0;
2ef: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
2f4: 77 17 ja 30d <atoi+0x2d>
2f6: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
2f8: 83 c1 01 add $0x1,%ecx
2fb: 8d 04 80 lea (%eax,%eax,4),%eax
2fe: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
302: 0f be 11 movsbl (%ecx),%edx
305: 8d 5a d0 lea -0x30(%edx),%ebx
308: 80 fb 09 cmp $0x9,%bl
30b: 76 eb jbe 2f8 <atoi+0x18>
n = n*10 + *s++ - '0';
return n;
}
30d: 5b pop %ebx
30e: 5d pop %ebp
30f: c3 ret
00000310 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
310: 55 push %ebp
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
311: 31 d2 xor %edx,%edx
return n;
}
void*
memmove(void *vdst, void *vsrc, int n)
{
313: 89 e5 mov %esp,%ebp
315: 56 push %esi
316: 8b 45 08 mov 0x8(%ebp),%eax
319: 53 push %ebx
31a: 8b 5d 10 mov 0x10(%ebp),%ebx
31d: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
320: 85 db test %ebx,%ebx
322: 7e 12 jle 336 <memmove+0x26>
324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
328: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
32c: 88 0c 10 mov %cl,(%eax,%edx,1)
32f: 83 c2 01 add $0x1,%edx
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
332: 39 da cmp %ebx,%edx
334: 75 f2 jne 328 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
336: 5b pop %ebx
337: 5e pop %esi
338: 5d pop %ebp
339: c3 ret
0000033a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
33a: b8 01 00 00 00 mov $0x1,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <exit>:
SYSCALL(exit)
342: b8 02 00 00 00 mov $0x2,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <wait>:
SYSCALL(wait)
34a: b8 03 00 00 00 mov $0x3,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <pipe>:
SYSCALL(pipe)
352: b8 04 00 00 00 mov $0x4,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <read>:
SYSCALL(read)
35a: b8 05 00 00 00 mov $0x5,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <write>:
SYSCALL(write)
362: b8 10 00 00 00 mov $0x10,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <close>:
SYSCALL(close)
36a: b8 15 00 00 00 mov $0x15,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <kill>:
SYSCALL(kill)
372: b8 06 00 00 00 mov $0x6,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <exec>:
SYSCALL(exec)
37a: b8 07 00 00 00 mov $0x7,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <open>:
SYSCALL(open)
382: b8 0f 00 00 00 mov $0xf,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <mknod>:
SYSCALL(mknod)
38a: b8 11 00 00 00 mov $0x11,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <unlink>:
SYSCALL(unlink)
392: b8 12 00 00 00 mov $0x12,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <fstat>:
SYSCALL(fstat)
39a: b8 08 00 00 00 mov $0x8,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <link>:
SYSCALL(link)
3a2: b8 13 00 00 00 mov $0x13,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <mkdir>:
SYSCALL(mkdir)
3aa: b8 14 00 00 00 mov $0x14,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <chdir>:
SYSCALL(chdir)
3b2: b8 09 00 00 00 mov $0x9,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <dup>:
SYSCALL(dup)
3ba: b8 0a 00 00 00 mov $0xa,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <getpid>:
SYSCALL(getpid)
3c2: b8 0b 00 00 00 mov $0xb,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <sbrk>:
SYSCALL(sbrk)
3ca: b8 0c 00 00 00 mov $0xc,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <sleep>:
SYSCALL(sleep)
3d2: b8 0d 00 00 00 mov $0xd,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <uptime>:
SYSCALL(uptime)
3da: b8 0e 00 00 00 mov $0xe,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <myMemory>:
SYSCALL(myMemory)
3e2: b8 16 00 00 00 mov $0x16,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <inodeTBWalker>:
SYSCALL(inodeTBWalker)
3ea: b8 17 00 00 00 mov $0x17,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <deleteIData>:
SYSCALL(deleteIData)
3f2: b8 18 00 00 00 mov $0x18,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <directoryWalker>:
SYSCALL(directoryWalker)
3fa: b8 19 00 00 00 mov $0x19,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <compareWalkers>:
SYSCALL(compareWalkers)
402: b8 1a 00 00 00 mov $0x1a,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <recoverFS>:
SYSCALL(recoverFS)
40a: b8 1b 00 00 00 mov $0x1b,%eax
40f: cd 40 int $0x40
411: c3 ret
|
; A279321: Period 7: repeat [1, 3, 5, 7, 5, 3, 1].
; 1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5,3,1,1,3,5,7,5
mod $0,7
lpb $0
mul $0,11
mod $0,6
lpe
mov $1,$0
mul $1,2
add $1,1
|
; A320106: Möbius transform of A320107.
; 1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,0
add $0,1
gcd $0,12
mov $1,$0
mov $0,3
sub $1,1
gcd $1,5
mul $1,2
lpb $0,1
sub $0,2
mul $1,9
lpe
div $1,72
|
; int ba_priority_queue_push(ba_priority_queue_t *q, int c)
SECTION code_adt_ba_priority_queue
PUBLIC ba_priority_queue_push_callee
ba_priority_queue_push_callee:
pop hl
pop bc
ex (sp),hl
INCLUDE "adt/ba_priority_queue/z80/asm_ba_priority_queue_push.asm"
|
bits 64
default rel
%include "cabna/sys/conv.nasm"
global print_stats
global used_max
global in_use
extern threads_strucs
extern thread_aligned_size
extern printf
section .text
proc print_stats:
; Print collected statistics for each thread, and print the totals of all
; threads. Called directly via call not via exec_avail, so the things having
; statistics collected are not used to execute it.
; Temporary struc for the totals of all threads.
sub rsp, thread_size
; [rsp + thread.exec_s_max] not totaled.
; [rsp + thread.exec_s_size] not totaled.
mov qword [rsp + thread.execute_calls], 0
mov qword [rsp + thread.executed_mine], 0
mov qword [rsp + thread.needy], 0
mov qword [rsp + thread.sched_calls], 0
mov qword [rsp + thread.sched_mine], 0
; [rsp + thread.alloc_s_max] not totaled.
; [rsp + thread.alloc_s_size] not totaled.
mov qword [rsp + thread.allocate_calls], 0
mov qword [rsp + thread.alloc_orphans], 0
mov qword [rsp + thread.freed], 0
mov qword [rsp + thread.freed_orphans], 0
mov qword [rsp + thread.mmap], 0
mov ebx, amount_threads - 1
.loop:
mov esi, ebx
mov edi, stats_tid_fmtstr
mov eax, 0
call printf
; Calculate the pointer to the thread struc from the thread ID.
mov eax, thread_aligned_size
mul ebx
add eax, threads_strucs
mov ebx, eax
mov rsi, [ebx + thread.exec_s_max]
mov edi, stats_exec_s_max_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.exec_s_size]
mov edi, stats_exec_s_size_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.execute_calls]
add [rsp + thread.execute_calls], rsi
mov edi, stats_execute_calls_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.executed_mine]
add [rsp + thread.executed_mine], rsi
mov edi, stats_executed_mine_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.needy]
add [rsp + thread.needy], rsi
mov edi, stats_needy_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.sched_calls]
add [rsp + thread.sched_calls], rsi
mov edi, stats_sched_calls_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.sched_mine]
add [rsp + thread.sched_mine], rsi
mov edi, stats_sched_mine_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.alloc_s_max]
mov edi, stats_alloc_s_max_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.alloc_s_size]
mov edi, stats_alloc_s_size_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.allocate_calls]
add [rsp + thread.allocate_calls], rsi
mov edi, stats_allocate_calls_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.alloc_orphans]
add [rsp + thread.alloc_orphans], rsi
mov edi, stats_alloc_orphans_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.freed]
add [rsp + thread.freed], rsi
mov edi, stats_freed_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.freed_orphans]
add [rsp + thread.freed_orphans], rsi
mov edi, stats_freed_orphans_fmtstr
mov eax, 0
call printf
mov rsi, [ebx + thread.mmap]
add [rsp + thread.mmap], rsi
mov edi, stats_mmap_fmtstr
mov eax, 0
call printf
mov eax, mmap_tasks * task_size / 1024
mov rsi, [ebx + thread.mmap]
mul rsi
mov rsi, rdx
mov rdx, rax
mov edi, stats_mmap_kb_fmtstr
mov eax, 0
call printf
; Calculate the thread ID from the pointer to the thread struc.
mov eax, ebx
sub eax, threads_strucs
xor edx, edx
mov ebx, thread_aligned_size
div ebx
mov ebx, eax
sub ebx, 1
jnc .loop
mov esi, amount_threads
mov edi, stats_total_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.execute_calls]
mov edi, stats_execute_calls_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.executed_mine]
mov edi, stats_executed_mine_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.needy]
mov edi, stats_needy_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.sched_calls]
mov edi, stats_sched_calls_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.sched_mine]
mov edi, stats_sched_mine_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.allocate_calls]
mov edi, stats_allocate_calls_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.alloc_orphans]
mov edi, stats_alloc_orphans_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.freed]
mov edi, stats_freed_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.freed_orphans]
mov edi, stats_freed_orphans_fmtstr
mov eax, 0
call printf
mov rsi, [used_max]
mov edi, stats_used_max_fmtstr
mov eax, 0
call printf
mov rsi, [in_use]
mov edi, stats_in_use_fmtstr
mov eax, 0
call printf
mov rsi, [rsp + thread.mmap]
mov edi, stats_mmap_fmtstr
mov eax, 0
call printf
mov eax, mmap_tasks * task_size / 1024
mov rsi, [rsp + thread.mmap]
mul rsi
mov rsi, rdx
mov rdx, rax
mov edi, stats_mmap_kb_fmtstr
mov eax, 0
call printf
add rsp, thread_size
ret
section .data align=128
used_max: dq 0
in_use: dq 0
align 128, db 0 ; Not a serious necessity, but why not.
stats_tid_fmtstr: db `Thread %u:\n`,0
stats_exec_s_max_fmtstr: db ` exec_s max: %15lu\n`,0
stats_exec_s_size_fmtstr: db ` exec_s size: %15lu\n`,0
stats_execute_calls_fmtstr: db ` execute calls: %15lu\n`,0
stats_executed_mine_fmtstr: db ` executed mine: %15lu\n`,0
stats_needy_fmtstr: db ` needy: %15lu\n`,0
stats_sched_calls_fmtstr: db ` sched calls: %15lu\n`,0
stats_sched_mine_fmtstr: db ` sched mine: %15lu\n`,0
stats_alloc_s_max_fmtstr: db ` alloc_s max: %15lu\n`,0
stats_alloc_s_size_fmtstr: db ` alloc_s size: %15lu\n`,0
stats_allocate_calls_fmtstr: db ` allocate calls:%15lu\n`,0
stats_alloc_orphans_fmtstr: db ` alloc orphans: %15lu\n`,0
stats_freed_fmtstr: db ` freed: %15lu\n`,0
stats_freed_orphans_fmtstr: db ` freed orphans: %15lu\n`,0
stats_used_max_fmtstr: db ` used max: %15lu\n`,0
stats_in_use_fmtstr: db ` in use: %15lu\n`,0
stats_mmap_fmtstr: db ` mmaps: %15lu\n`,0
stats_mmap_kb_fmtstr: db ` KB mmaped: %lu,%lu\n`,0
stats_total_fmtstr: db `Totals of %u threads:\n`,0
|
; A010551: Multiply successively by 1,1,2,2,3,3,4,4,..., n >= 1, a(0) = 1.
; Submitted by Jon Maiga
; 1,1,1,2,4,12,36,144,576,2880,14400,86400,518400,3628800,25401600,203212800,1625702400,14631321600,131681894400,1316818944000,13168189440000,144850083840000,1593350922240000,19120211066880000,229442532802560000,2982752926433280000,38775788043632640000,542861032610856960000,7600054456551997440000,114000816848279961600000,1710012252724199424000000,27360196043587190784000000,437763136697395052544000000,7441973323855715893248000000,126513546505547170185216000000,2277243837099849063333888000000
mov $3,1
lpb $0
mov $2,$0
sub $0,1
add $2,1
div $2,2
mul $3,$2
lpe
mov $0,$3
|
// ======================================================================== //
// Copyright 2009-2019 Intel Corporation //
// //
// 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. //
// ======================================================================== //
#undef NDEBUG
// ospray
#include "Spheres.h"
#include "common/Data.h"
#include "common/Model.h"
#include "common/OSPCommon.h"
// ispc-generated files
#include "Spheres_ispc.h"
namespace ospray {
Spheres::Spheres()
{
this->ispcEquivalent = ispc::Spheres_create(this);
}
std::string Spheres::toString() const
{
return "ospray::Spheres";
}
void Spheres::finalize(Model *model)
{
Geometry::finalize(model);
radius = getParam1f("radius",0.01f);
materialID = getParam1i("materialID",0);
bytesPerSphere = getParam1i("bytes_per_sphere",4*sizeof(float));
texcoordData = getParamData("texcoord");
offset_center = getParam1i("offset_center",0);
offset_radius = getParam1i("offset_radius",-1);
offset_materialID = getParam1i("offset_materialID",-1);
offset_colorID = getParam1i("offset_colorID",-1);
sphereData = getParamData("spheres");
colorData = getParamData("color");
colorOffset = getParam1i("color_offset",0);
if (colorData) {
if (hasParam("color_format")) {
colorFormat = static_cast<OSPDataType>(getParam1i("color_format",
OSP_UNKNOWN));
} else {
colorFormat = colorData->type;
}
if (colorFormat != OSP_FLOAT4 && colorFormat != OSP_FLOAT3
&& colorFormat != OSP_FLOAT3A && colorFormat != OSP_UCHAR4)
{
throw std::runtime_error("#ospray:geometry/spheres: invalid "
"colorFormat specified! Must be one of: "
"OSP_FLOAT4, OSP_FLOAT3, OSP_FLOAT3A or "
"OSP_UCHAR4.");
}
} else {
colorFormat = OSP_UNKNOWN;
}
colorStride = getParam1i("color_stride",
colorFormat == OSP_UNKNOWN ?
0 : sizeOf(colorFormat));
if (sphereData.ptr == nullptr) {
throw std::runtime_error("#ospray:geometry/spheres: no 'spheres' data "
"specified");
}
numSpheres = sphereData->numBytes / bytesPerSphere;
postStatusMsg(2) << "#osp: creating 'spheres' geometry, #spheres = "
<< numSpheres;
if (numSpheres >= (1ULL << 30)) {
throw std::runtime_error("#ospray::Spheres: too many spheres in this "
"sphere geometry. Consider splitting this "
"geometry in multiple geometries with fewer "
"spheres (you can still put all those "
"geometries into a single model, but you can't "
"put that many spheres into a single geometry "
"without causing address overflows)");
}
const char* spherePtr = (const char*)sphereData->data;
bounds = empty;
for (uint32_t i = 0; i < numSpheres; i++, spherePtr += bytesPerSphere) {
const float r = offset_radius < 0 ?
radius : *(const float*)(spherePtr + offset_radius);
const vec3f center = *(const vec3f*)(spherePtr + offset_center);
bounds.extend(box3f(center - r, center + r));
}
// check whether we need 64-bit addressing
bool huge_mesh = false;
if (colorData && colorData->numBytes > INT32_MAX)
huge_mesh = true;
if (texcoordData && texcoordData->numBytes > INT32_MAX)
huge_mesh = true;
ispc::SpheresGeometry_set(getIE(),
model->getIE(),
sphereData->data,
materialList ? ispcMaterialPtrs.data() : nullptr,
texcoordData ?
(ispc::vec2f *)texcoordData->data : nullptr,
colorData ? colorData->data : nullptr,
colorOffset,
colorStride,
colorFormat,
numSpheres,
bytesPerSphere,
radius,
materialID,
offset_center,
offset_radius,
offset_materialID,
offset_colorID,
huge_mesh);
}
OSP_REGISTER_GEOMETRY(Spheres,spheres);
} // ::ospray
|
/**
* \file test/src/host_static_calc.cpp
*
* This file is part of MegBrain, a deep learning framework developed by Megvii.
*
* \brief static calculating on host to check opr correctness
*
* \copyright Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
*/
#include "megbrain/test/host_static_calc.h"
void mgb::elemwise_static_calc(opr::Elemwise::Mode mode,
HostTensorND &dest, const std::vector<HostTensorND>& inputs) {
#if defined(ANDROID) || defined(IOS) || defined(__arm__)
static opr::intl::UniqPtrWithCN<megdnn::Elemwise> opr_impl;
static std::mutex mtx;
MGB_LOCK_GUARD(mtx);
#else
static thread_local opr::intl::UniqPtrWithCN<megdnn::Elemwise> opr_impl;
#endif
auto cn = CompNode::default_cpu();
if (!opr_impl) {
opr_impl = opr::intl::create_megdnn_opr<megdnn::Elemwise>(cn);
}
DeviceTensorND dev_dest{cn};
SmallVector<DeviceTensorND> dev_inp(inputs.size());
for (size_t i = 0; i < inputs.size(); ++ i) {
dev_inp[i].comp_node(cn).copy_from(inputs[i]);
}
opr::Elemwise::perform(mode, dev_dest, dev_inp, opr_impl);
dest.copy_from(dev_dest);
}
// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}
|
; A170001: Number of reduced words of length n in Coxeter group on 40 generators S_i with relations (S_i)^2 = (S_i S_j)^35 = I.
; 1,40,1560,60840,2372760,92537640,3608967960,140749750440,5489240267160,214080370419240,8349134446350360,325616243407664040,12699033492898897560,495262306223057004840,19315229942699223188760
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
div $3,$2
mul $2,39
lpe
mov $0,$2
div $0,39
|
;
; Generic game device library - VG-5000 port
; Stefano Bodrato - 2014
;
; $Id: joystick.asm,v 1.2 2015/01/19 01:32:45 pauloscustodio Exp $
;
PUBLIC joystick
EXTERN getk
.joystick
;__FASTALL__ : joystick no. in HL
;ld a,l
call getk
ld a,l
ld l,0
cp ' '
jr nz,no_fire1_a
set 4,l
jr j_done
.no_fire1_a
cp '1'
jr nz,no_fire2_a
set 5,l
jr j_done
.no_fire2_a
cp 9
jr nz,no_up_a
set 3,l
jr j_done
.no_up_a
cp 10
jr nz,no_down_a
set 2,l
jr j_done
.no_down_a
cp 8
jr nz,no_left_a
set 1,l
jr j_done
.no_left_a
cp 7
jr nz,no_right_a
set 0,l
.no_right_a
.j_done
ret
|
VER_NEG PROC
CMP SN1,1
JE NEG1
JMP CNT
NEG1:
NEG NUM1
CNT:
CMP SN2,1
JE NEG2
JMP FIN_VER_NEG
NEG2:
NEG NUM2
FIN_VER_NEG:
RET
VER_NEG ENDP |
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "native_thread.cpp"
#include "nsk_tools.cpp"
#include "jni_tools.cpp"
#include "jvmti_tools.cpp"
#include "agent_tools.cpp"
#include "jvmti_FollowRefObjects.cpp"
#include "Injector.cpp"
#include "JVMTITools.cpp"
#include "agent_common.cpp"
#include "redefclass023.cpp"
|
title "Context Swap"
;++
;
; Copyright (c) 1989, 2000 Microsoft Corporation
;
; Module Name:
;
; ctxswap.asm
;
; Abstract:
;
; This module implements the code necessary to field the dispatch
; interrupt and to perform kernel initiated context switching.
;
; Author:
;
; Shie-Lin Tzong (shielint) 14-Jan-1990
;
; Environment:
;
; Kernel mode only.
;
; Revision History:
;
; 22-feb-90 bryanwi
; write actual swap context procedure
;
;--
.586p
.xlist
include ks386.inc
include i386\kimacro.inc
include mac386.inc
include callconv.inc
include irqli386.inc
FPOFRAME macro a, b
.FPO ( a, b, 0, 0, 0, 0 )
endm
.list
EXTRNP KefAcquireSpinLockAtDpcLevel,1,,FASTCALL
EXTRNP KefReleaseSpinLockFromDpcLevel,1,,FASTCALL
EXTRNP HalClearSoftwareInterrupt,1,IMPORT,FASTCALL
EXTRNP HalRequestSoftwareInterrupt,1,IMPORT,FASTCALL
ifndef NT_UP
EXTRNP KiIdleSchedule,1,,FASTCALL
endif
EXTRNP KiQueueReadyThread,2,,FASTCALL
EXTRNP KiRetireDpcList,1,,FASTCALL
EXTRNP _KiQuantumEnd,0
EXTRNP _KiTimerExpiration,4
EXTRNP _KeBugCheckEx,5
extrn _KiTrap13:PROC
extrn _KeFeatureBits:DWORD
extrn __imp__KeRaiseIrqlToSynchLevel@0:DWORD
extrn _KiIdleSummary:DWORD
EXTRNP WmiTraceContextSwap,2,,FASTCALL
if DBG
extrn _KdDebuggerEnabled:BYTE
EXTRNP _DbgBreakPoint,0
EXTRNP _KdPollBreakIn,0
extrn _DbgPrint:near
extrn _MsgDpcTrashedEsp:BYTE
extrn _MsgDpcTimeout:BYTE
extrn _KiDPCTimeout:DWORD
endif
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
cPublicFastCall KiRDTSC, 1
rdtsc ; read the timestamp counter
mov [ecx], eax ; return the low 32 bits
mov [ecx+4], edx ; return the high 32 bits
fstRET KiRDTSC
fstENDP KiRDTSC
page ,132
subttl "Swap Context"
;++
;
; BOOLEAN
; KiSwapContext (
; IN PKTHREAD OldThread
; IN PKTHREAD NewThread
; )
;
; Routine Description:
;
; This function is a small wrapper, callable from C code, that marshalls
; arguments and calls the actual swap context routine.
;
; Arguments:
;
; OldThread (ecx) - Supplies the address of the old thread
; NewThread (edx) - Supplies the address of the new thread.
;
; Return Value:
;
; If a kernel APC is pending, then a value of TRUE is returned. Otherwise,
; a value of FALSE is returned.
;
;--
cPublicFastCall KiSwapContext, 2
.fpo (0, 0, 0, 4, 1, 0)
;
; N.B. The following registers MUST be saved such that ebp is saved last.
; This is done so the debugger can find the saved ebp for a thread
; that is not currently in the running state.
;
sub esp, 4*4
mov [esp+12], ebx ; save registers
mov [esp+8], esi ;
mov [esp+4], edi ;
mov [esp+0], ebp ;
mov ebx, PCR[PcSelfPcr] ; set address of PCR
mov edi, ecx ; set old thread address
mov esi, edx ; set next thread address
movzx ecx, byte ptr [edi].ThWaitirql ; set APC interrupt bypass disable
CAPSTART <@KiSwapContext@8,SwapContext>
call SwapContext ; swap context
CAPEND <@KiSwapContext@8>
mov ebp, [esp+0] ; restore registers
mov edi, [esp+4] ;
mov esi, [esp+8] ;
mov ebx, [esp+12] ;
add esp, 4*4 ;
fstRET KiSwapContext ;
fstENDP KiSwapContext
page ,132
subttl "Dispatch Interrupt"
;++
;
; Routine Description:
;
; This routine is entered as the result of a software interrupt generated
; at DISPATCH_LEVEL. Its function is to process the Deferred Procedure Call
; (DPC) list, and then perform a context switch if a new thread has been
; selected for execution on the processor.
;
; This routine is entered at IRQL DISPATCH_LEVEL with the dispatcher
; database unlocked. When a return to the caller finally occurs, the
; IRQL remains at DISPATCH_LEVEL, and the dispatcher database is still
; unlocked.
;
; Arguments:
;
; None
;
; Return Value:
;
; None.
;
;--
align 16
cPublicProc _KiDispatchInterrupt ,0
cPublicFpo 0, 0
mov ebx, PCR[PcSelfPcr] ; get address of PCR
;
; Disable interrupts and check if there is any work in the DPC list
; of the current processor.
;
kdi00: cli ; disable interrupts
mov eax, [ebx]+PcPrcbData+PbDpcQueueDepth ; get DPC queue depth
or eax, [ebx]+PcPrcbData+PbTimerRequest ; merge timer request
ifndef NT_UP
or eax, [ebx]+PcPrcbData+PbDeferredReadyListHead ; merge deferred list head
endif
jz short kdi40 ; if z, no DPC's or timers to process
push ebp ; save register
;
; Exceptions occuring in DPCs are unrelated to any exception handlers
; in the interrupted thread. Terminate the exception list.
;
push [ebx].PcExceptionList
mov [ebx].PcExceptionList, EXCEPTION_CHAIN_END
;
; Switch to the DPC stack for this processor.
;
mov edx, esp
mov esp, [ebx].PcPrcbData.PbDpcStack
push edx
.fpo (0, 0, 0, 1, 1, 0)
mov ecx, [ebx].PcPrcb ; get current PRCB address
CAPSTART <_KiDispatchInterrupt,@KiRetireDpcList@4>
fstCall KiRetireDpcList ; process the current DPC list
CAPEND <_KiDispatchInterrupt>
;
; Switch back to the current thread stack, restore the exception list
; and saved EBP.
;
pop esp
pop [ebx].PcExceptionList
pop ebp
.fpo (0, 0, 0, 0, 0, 0)
;
; Check to determine if quantum end is requested.
;
; N.B. If a new thread is selected as a result of processing the quantum
; end request, then the new thread is returned with the dispatcher
; database locked. Otherwise, NULL is returned with the dispatcher
; database unlocked.
;
kdi40: sti ; enable interrupts
cmp byte ptr [ebx].PcPrcbData.PbQuantumEnd, 0 ; quantum end requested
jne kdi90 ; if neq, quantum end request
;
; Check to determine if a new thread has been selected for execution on this
; processor.
;
cmp dword ptr [ebx].PcPrcbData.PbNextThread, 0 ; check if next thread
je kdi70 ; if eq, then no new thread
;
; N.B. The following registers MUST be saved such that ebp is saved last.
; This is done so the debugger can find the saved ebp for a thread
; that is not currently in the running state.
;
.fpo (0, 0, 0, 3, 1, 0)
sub esp, 3*4
mov [esp+8], esi ; save registers
mov [esp+4], edi ;
mov [esp+0], ebp ;
mov edi, [ebx].PcPrcbData.PbCurrentThread ; get current thread address (as old thread)
;
; Raise IRQL to SYNCH level, set context swap busy for the old thread, and
; acquire the current PRCB lock.
;
ifndef NT_UP
call dword ptr [__imp__KeRaiseIrqlToSynchLevel@0] ; raise IRQL to SYNCH
mov byte ptr [edi].ThSwapBusy, 1 ; set context swap busy
lea ecx, [ebx].PcPrcbData.PbPrcbLock ; get PRCB lock address
lock bts dword ptr [ecx], 0 ; try to acquire PRCB lock
jnc short kdi50 ; if nc, PRCB lock acquired
fstCall KefAcquireSpinLockAtDpcLevel ; acquire current PRCB lock
endif
;
; Get the next thread address, set the thread state to running, queue the old
; running thread, and swap context to the next thread.
;
kdi50: mov esi, [ebx].PcPrcbData.PbNextThread ; get next thread address
and dword ptr [ebx].PcPrcbData.PbNextThread, 0 ; clear next thread address
mov [ebx].PcPrcbData.PbCurrentThread, esi ; set current thread address
mov byte ptr [esi]+ThState, Running ; set thread state to running
mov byte ptr [edi].ThWaitReason, WrDispatchInt ; set wait reason
mov ecx, edi ; set address of curent thread
lea edx, [ebx].PcPrcbData ; set address of PRCB
fstCall KiQueueReadyThread ; ready thread for execution
CAPSTART <_KiDispatchInterrupt,SwapContext>
mov cl, APC_LEVEL ; set APC interrupt bypass disable
call SwapContext ; swap context
CAPEND <_KiDispatchInterrupt>
mov ebp, [esp+0] ; restore registers
mov edi, [esp+4] ;
mov esi, [esp+8] ;
add esp, 3*4
kdi70: stdRET _KiDispatchInterrupt ; return
;
; Process quantum end event.
;
; N.B. If the quantum end code returns a NULL value, then no next thread
; has been selected for execution. Otherwise, a next thread has been
; selected and the source thread lock has been acquired.
;
kdi90: mov byte ptr [ebx].PcPrcbData.PbQuantumEnd, 0 ; clear quantum end indicator
CAPSTART <_KiDispatchInterrupt,_KiQuantumEnd@0>
stdCall _KiQuantumEnd ; process quantum end
CAPEND <_KiDispatchInterrupt>
stdRET _KiDispatchInterrupt ; return
stdENDP _KiDispatchInterrupt
page ,132
subttl "Swap Context to Next Thread"
;++
;
; Routine Description:
;
; This routine is called to swap context from one thread to the next.
; It swaps context, flushes the data, instruction, and translation
; buffer caches, restores nonvolatile integer registers, and returns
; to its caller.
;
; N.B. It is assumed that the caller (only callers are within this
; module) saved the nonvolatile registers, ebx, esi, edi, and
; ebp. This enables the caller to have more registers available.
;
; Arguments:
;
; cl - APC interrupt bypass disable (zero enable, nonzero disable).
; edi - Address of previous thread.
; esi - Address of next thread.
; ebx - Address of PCR.
;
; Return value:
;
; al - Kernel APC pending.
; ebx - Address of PCR.
; esi - Address of current thread object.
;
;--
;
; NOTE: The ES: override on the move to ThState is part of the
; lazy-segment load system. It assures that ES has a valid
; selector in it, thus preventing us from propagating a bad
; ES across a context switch.
;
; Note that if segments, other than the standard flat segments,
; with limits above 2 gig exist, neither this nor the rest of
; lazy segment loads are reliable.
;
; Note that ThState must be set before the dispatcher lock is released
; to prevent KiSetPriorityThread from seeing a stale value.
;
ifndef NT_UP
public _ScPatchFxb
public _ScPatchFxe
endif
public SwapContext
align 16
SwapContext proc
;
; Save the APC disable flag.
;
push ecx ; save APC bypass disable
cPublicFpo 0, 1
;
; Wait for context to be swapped for the target thread.
;
ifndef NT_UP
sc00: cmp byte ptr [esi].ThSwapBusy, 0 ; check if context swap busy
je short sc01 ; if e, context swap idle
YIELD ; yield execution for SMT system
jmp short sc00 ;
endif
;
; Increment the number of context switches on this processor.
;
; N.B. This increment is done here is force the cache block containing the
; context switch count into the cache as write exclusive. There are
; several other references to this cache block in the following code.
;
sc01: inc dword ptr [ebx]+PcContextSwitches ; processor count
;
; Save the thread exception list head.
;
push [ebx]+PcExceptionList ; save thread exception list head
cPublicFpo 0, 2
;
; Check for context swap logging.
;
cmp [ebx]+PcPerfGlobalGroupMask, 0 ; check if logging enable
jne sc92 ; If not, then check if we are enabled
sc03:
ifndef NT_UP
if DBG
mov cl, [esi]+ThNextProcessor ; get current processor number
cmp cl, [ebx]+PcPrcbData+PbNumber ; same as running processor?
jne sc_error2 ; if ne, processor number mismatch
endif
endif
;
; Accumulate the total time spent in a thread.
;
ifdef PERF_DATA
test _KeFeatureBits, KF_RDTSC ; feature supported?
jz short @f ; if z, feature not present
rdtsc ; read cycle counter
sub eax, [ebx].PcPrcbData.PbThreadStartCount.LiLowPart ; sub off thread
sbb edx, [ebx].PcPrcbData.PbThreadStartCount.LiHighPart ; starting time
add [edi].EtPerformanceCountLow, eax ; accumlate thread run time
adc [edi].EtPerformanceCountHigh, edx ;
add [ebx].PcPrcbData.PbThreadStartCount.LiLowPart, eax ; set new thread
adc [ebx].PcPrcbData.PbThreadStartCount.LiHighPart, edx ; starting time
@@: ;
endif
;
; On a uniprocessor system the NPX state is swapped in a lazy manner.
; If a thread whose state is not in the coprocessor attempts to perform
; a coprocessor operation, the current NPX state is swapped out (if needed),
; and the new state is swapped in durning the fault. (KiTrap07)
;
; On a multiprocessor system we still fault in the NPX state on demand, but
; we save the state when the thread switches out (assuming the NPX state
; was loaded). This is because it could be difficult to obtain the thread's
; NPX in the trap handler if it was loaded into a different processor's
; coprocessor.
;
mov ebp, cr0 ; get current CR0
mov edx, ebp ;
ifndef NT_UP
cmp byte ptr [edi]+ThNpxState, NPX_STATE_LOADED ; check if NPX state
je sc_save_npx_state ; if e, NPX state not loaded
endif
;
; Save the old stack pointer and compute the new stack limits.
;
sc05: mov [edi]+ThKernelStack, esp ; save old kernel stack pointer
mov eax, [esi]+ThInitialStack ; get new initial stack pointer
;
; (eax) = Initial Stack
; (ebx) = PCR
; (edi) = OldThread
; (esi) = NewThread
; (ebp) = Current CR0
; (edx) = Current CR0
;
.errnz (NPX_STATE_NOT_LOADED - CR0_TS - CR0_MP)
.errnz (NPX_STATE_LOADED - 0)
ifdef NT_UP
;
; On UP systems floating point state might be being changed by an ISR so we
; block interrupts.
;
cli
endif
movzx ecx, byte ptr [esi]+ThNpxState ; new NPX state is (or is not) loaded
and edx, NOT (CR0_MP+CR0_EM+CR0_TS) ; clear thread settable NPX bits
or ecx, edx ; or in new thread's cr0
or ecx, [eax]+FpCr0NpxState-NPX_FRAME_LENGTH ; merge new thread settable state
cmp ebp, ecx ; check if old and new CR0 match
jne sc_reload_cr0 ; if ne, change in CR0
sc06:
ifdef NT_UP
sti
endif
if DBG
mov eax, [esi]+ThKernelStack ; set new stack pointer
cmp esi, dword ptr [eax-4]
je @f
int 3
@@:
xchg esp, eax
mov [eax-4], edi ; Save thread address on stack below stack pointer
else
mov esp, [esi]+ThKernelStack ; set new stack pointer
endif
;
; Check if the old process is the same as the new process.
;
mov ebp, [esi].ThApcState.AsProcess ; get old process address
mov eax, [edi].ThApcState.AsProcess ; get old process address
cmp ebp, eax ; check if process match
jz short sc23 ; if z, process match
;
; Set the processor bit in the new process and clear the old.
;
ifndef NT_UP
mov ecx, [ebx]+PcSetMemberCopy ; get processor set member
lock xor [ebp]+PrActiveProcessors, ecx ; set bit in new processor set
lock xor [eax]+PrActiveProcessors, ecx ; clear bit in old processor set
if DBG
test [ebp]+PrActiveProcessors, ecx ; test if bit set in new set
jz sc_error5 ; if z, bit not set in new set
test [eax]+PrActiveProcessors, ecx ; test if bit clear in old set
jnz sc_error4 ; if nz, bit not clear in old set
endif
endif
;
; LDT switch, If either the target or source process have an LDT we need to
; load the ldt
;
mov ecx, [ebp]+PrLdtDescriptor
or ecx, [eax]+PrLdtDescriptor
jnz sc_load_ldt ; if nz, LDT limit
sc_load_ldt_ret:
;
; Load the new CR3 and as a side effect flush non-global TB entries.
;
mov eax, [ebp]+PrDirectoryTableBase ; get new directory base
mov cr3, eax ; and flush TB
;
; Set context swap idle for the old thread.
;
sc23: ;
ifndef NT_UP
and byte ptr [edi].ThSwapBusy, 0 ; clear old thread swap busy
endif
xor eax, eax
mov gs, eax
;
; Set the TEB descriptor to point to the thread TEB and set the TEB address
; in the PCR. The es override here is to force lazy segment loading to occure.
;
mov eax, es:[esi]+ThTeb ; get user TEB address
mov [ebx]+PcTeb, eax ; set user TEB address
mov ecx, [ebx]+PcGdt ; get GDT address
mov [ecx]+(KGDT_R3_TEB+KgdtBaseLow), ax ;
shr eax, 16 ;
mov [ecx]+(KGDT_R3_TEB+KgdtBaseMid), al ;
mov [ecx]+(KGDT_R3_TEB+KgdtBaseHi), ah ;
;
; Adjust the initial stack address, if necessary, and store in the TSS so V86
; mode threads and 32 bit threads can share a common trapframe structure and
; the NPX save area will be accessible in the same manner on all threads.
;
mov eax, [esi].ThInitialStack ; get initial stack address
sub eax, NPX_FRAME_LENGTH
.errnz (EFLAGS_V86_MASK AND 0FF00FFFFh)
test byte ptr [eax] - KTRAP_FRAME_LENGTH + TsEFlags + 2, EFLAGS_V86_MASK / 10000h
jnz short sc24 ; if nz, V86 frame, no adjustment
sub eax, TsV86Gs - TsHardwareSegSs ; bias for missing fields
sc24: mov ecx, [ebx]+PcTssCopy ; get TSS address
mov [ecx]+TssEsp0, eax ; set initial kernel stack address
;
; Set the IOPM map offset value.
;
; N.B. This may be a redundant load of this value if the process did not
; change during the context switch. However, always reloading this
; value saves several instructions under the context swap lock.
;
mov ax, [ebp]+PrIopmOffset ; set IOPM offset
mov [ecx]+TssIoMapBase, ax ;
;
; Update context switch counters.
;
inc dword ptr [esi]+ThContextSwitches ; thread count
;
; Restore thread exception list head and get APC bypass disable.
;
pop [ebx].PcExceptionList ; restore thread exception list head
pop ecx ; get APC bypass disable
;
; Check if an attempt is being made to context switch while in a DPC routine.
;
cmp word ptr [ebx]+PcPrcbData+PbDpcRoutineActive, 0 ; check if DPC active
jne sc91 ; bugcheck if DPC active.
;
; If the new thread has a kernel mode APC pending, then request an APC
; interrupt.
;
cmp byte ptr [esi].ThApcState.AsKernelApcPending, 0 ; APC pending?
jne short sc80 ; if ne, kernel APC pending
xor eax, eax ; set return value
ret ; return
;
; The new thread has an APC interrupt pending.
;
; If the the special APC disable count is nonzero, then return no kernel APC
; pending. An APC will be requested when the special APC disable count reaches
; zero.
;
; If APC interrupt bypass is not enabled, then request a software interrupt
; at APC_LEVEL and return no kernel APC pending. Otherwise, return kernel APC
; pending.
;
sc80: cmp word ptr [esi].ThSpecialApcDisable, 0 ; check if special APC disable
jne short sc90 ; if ne, special APC disable
test cl, cl ; test for APC bypass disable
jz short sc90 ; if z, APC bypass enabled
mov cl, APC_LEVEL ; request software interrupt level
fstCall HalRequestSoftwareInterrupt ;
or eax, esp ; clear ZF flag
sc90: setz al ; set return value
ret ; return
;
; Set for new LDT value
;
sc_load_ldt:
mov eax, [ebp+PrLdtDescriptor] ;
test eax, eax
je @f
mov ecx, [ebx]+PcGdt ; get GDT address
mov [ecx+KGDT_LDT], eax ;
mov eax, [ebp+PrLdtDescriptor+4] ;
mov [ecx+KGDT_LDT+4], eax ;
;
; Set up int 21 descriptor of IDT. If the process does not have an Ldt, it
; should never make any int 21 calls. If it does, an exception is generated. If
; the process has an Ldt, we need to update int21 entry of LDT for the process.
; Note the Int21Descriptor of the process may simply indicate an invalid
; entry. In which case, the int 21 will be trapped to the kernel.
;
mov ecx, [ebx]+PcIdt ;
mov eax, [ebp+PrInt21Descriptor] ;
mov [ecx+21h*8], eax ;
mov eax, [ebp+PrInt21Descriptor+4] ;
mov [ecx+21h*8+4], eax ;
mov eax, KGDT_LDT
@@: lldt ax
jmp sc_load_ldt_ret
;
; Cr0 has changed (ie, floating point processor present), load the new value.
;
sc_reload_cr0:
if DBG
test byte ptr [esi]+ThNpxState, NOT (CR0_TS+CR0_MP)
jnz sc_error ;
test dword ptr [eax]+FpCr0NpxState-NPX_FRAME_LENGTH, NOT (CR0_PE+CR0_MP+CR0_EM+CR0_TS)
jnz sc_error3 ;
endif
mov cr0,ecx ; set new CR0 NPX state
jmp sc06
;
; Save coprocessor's current context. FpCr0NpxState is the current thread's
; CR0 state. The following bits are valid: CR0_MP, CR0_EM, CR0_TS. MVDMs
; may set and clear MP & EM as they please and the settings will be reloaded
; on a context switch (but they will not be saved from CR0 to Cr0NpxState).
; The kernel sets and clears TS as required.
;
; (ebp) = Current CR0
; (edx) = Current CR0
;
ifndef NT_UP
sc_save_npx_state:
and edx, NOT (CR0_MP+CR0_EM+CR0_TS) ; we need access to the NPX state
mov ecx, [edi].ThInitialStack ; get NPX save save area address
sub ecx, NPX_FRAME_LENGTH
cmp ebp, edx ; Does CR0 need reloading?
je short sc_npx10
mov cr0, edx ; set new cr0
mov ebp, edx ; (ebp) = (edx) = current cr0 state
sc_npx10:
;
; The fwait following the fnsave is to make sure that the fnsave has stored the
; data into the save area before this coprocessor state could possibly be
; context switched in and used on a different (co)processor. I've added the
; clocks from when the dispatcher lock is released and don't believe it's a
; possibility. I've also timed the impact this fwait seems to have on a 486
; when performing lots of numeric calculations. It appears as if there is
; nothing to wait for after the fnsave (although the 486 manual says there is)
; and therefore the calculation time far outweighed the 3clk fwait and it
; didn't make a noticable difference.
;
;
; If FXSR feature is NOT present on the processor, the fxsave instruction is
; patched at boot time to start using fnsave instead
;
_ScPatchFxb:
; fxsave [ecx] ; save NPX state
db 0FH, 0AEH, 01
_ScPatchFxe:
mov byte ptr [edi]+ThNpxState, NPX_STATE_NOT_LOADED ; set no NPX state
mov dword ptr [ebx].PcPrcbData+PbNpxThread, 0 ; clear npx owner
jmp sc05
endif
;
; This code is out of line to optimize the normal case with tracing is off.
;
sc92: mov eax, [ebx]+PcPerfGlobalGroupMask ; Load the ptr into eax
cmp eax, 0 ; catch race condition on pointer here
jz sc03 ; instead of above in mainline code
mov edx, esi ; pass the new ETHREAD object
mov ecx, edi ; pass the old ETHREAD object
test dword ptr [eax+PERF_CONTEXTSWAP_OFFSET], PERF_CONTEXTSWAP_FLAG
jz sc03 ; return if our flag is not set
fstCall WmiTraceContextSwap ; call the Wmi context swap trace
jmp sc03 ;
;
; A context switch was attempted while executing a DPC - bug check.
;
.fpo (2, 0, 0, 0, 0, 0)
sc91: stdCall _KeBugCheckEx <ATTEMPTED_SWITCH_FROM_DPC, edi, esi, 0, 0>
ret ; return
if DBG
sc_error5: int 3
sc_error4: int 3
sc_error3: int 3
sc_error2: int 3
sc_error: int 3
endif
SwapContext endp
page , 132
subttl "Flush EntireTranslation Buffer"
;++
;
; VOID
; KeFlushCurrentTb (
; )
;
; Routine Description:
;
; This function flushes the entire translation buffer (TB) on the current
; processor and also flushes the data cache if an entry in the translation
; buffer has become invalid.
;
; Arguments:
;
; Return Value:
;
; None.
;
;--
cPublicProc _KeFlushCurrentTb ,0
ktb00: mov eax, cr3 ; (eax) = directory table base
mov cr3, eax ; flush TLB
stdRET _KeFlushCurrentTb
ktb_gb: mov eax, cr4 ; *** see Ki386EnableGlobalPage ***
and eax, not CR4_PGE ; This FlushCurrentTb version gets copied into
mov cr4, eax ; ktb00 at initialization time if needed.
or eax, CR4_PGE
mov cr4, eax
ktb_eb: stdRET _KeFlushCurrentTb
stdENDP _KeFlushCurrentTb
;;
;; moved KiFlushDcache below KeFlushCurrentTb for BBT purposes. BBT
;; needs an end label to treat KeFlushCurrentTb as data and to keep together.
;;
page , 132
subttl "Flush Data Cache"
;++
;
; VOID
; KiFlushDcache (
; )
;
; VOID
; KiFlushIcache (
; )
;
; Routine Description:
;
; This routine does nothing on i386 and i486 systems. Why? Because
; (a) their caches are completely transparent, (b) they don't have
; instructions to flush their caches.
;
; Arguments:
;
; None.
;
; Return Value:
;
; None.
;
;--
cPublicProc _KiFlushDcache ,0
cPublicProc _KiFlushIcache ,0
stdRET _KiFlushIcache
stdENDP _KiFlushIcache
stdENDP _KiFlushDcache
_TEXT$00 ends
INIT SEGMENT DWORD PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
;++
;
; VOID
; Ki386EnableGlobalPage (
; IN volatile PLONG Number
; )
;
; /*++
;
; Routine Description:
;
; This routine enables the global page PDE/PTE support in the system,
; and stalls until complete and them sets the current processor's cr4
; register to enable global page support.
;
; Arguments:
;
; Number - Supplies a pointer to the count of the number of processors in
; the configuration.
;
; Return Value:
;
; None.
;--
cPublicProc _Ki386EnableGlobalPage,1
push esi
push edi
push ebx
mov edx, [esp+16] ; pointer to Number
pushfd
cli
;
; Wait for all processors
;
lock dec dword ptr [edx] ; count down
egp10: YIELD
cmp dword ptr [edx], 0 ; wait for all processors to signal
jnz short egp10
cmp byte ptr PCR[PcNumber], 0 ; processor 0?
jne short egp20
;
; Install proper KeFlushCurrentTb function.
;
mov edi, ktb00
mov esi, ktb_gb
mov ecx, ktb_eb - ktb_gb + 1
rep movsb
mov byte ptr [ktb_eb], 0
;
; Wait for P0 to signal that proper flush TB handlers have been installed
;
egp20: cmp byte ptr [ktb_eb], 0
jnz short egp20
;
; Flush TB, and enable global page support
; (note load of CR4 is explicitly done before the load of CR3
; to work around P6 step B0 errata 11)
;
mov eax, cr4
and eax, not CR4_PGE ; should not be set, but let's be safe
mov ecx, cr3
mov cr4, eax
mov cr3, ecx ; Flush TB
or eax, CR4_PGE ; enable global TBs
mov cr4, eax
popfd
pop ebx
pop edi
pop esi
stdRET _Ki386EnableGlobalPage
stdENDP _Ki386EnableGlobalPage
;++
;
; VOID
; Ki386EnableDE (
; IN volatile PLONG Number
; )
;
; /*++
;
; Routine Description:
;
; This routine sets DE bit in CR4 to enable IO breakpoints
;
; Arguments:
;
; Number - Supplies a pointer to the count of the number of processors in
; the configuration.
;
; Return Value:
;
; None.
;--
cPublicProc _Ki386EnableDE,1
mov eax, cr4
or eax, CR4_DE
mov cr4, eax
stdRET _Ki386EnableDE
stdENDP _Ki386EnableDE
;++
;
; VOID
; Ki386EnableFxsr (
; IN volatile PLONG Number
; )
;
; /*++
;
; Routine Description:
;
; This routine sets OSFXSR bit in CR4 to indicate that OS supports
; FXSAVE/FXRSTOR for use during context switches
;
; Arguments:
;
; Number - Supplies a pointer to the count of the number of processors in
; the configuration.
;
; Return Value:
;
; None.
;--
cPublicProc _Ki386EnableFxsr,1
mov eax, cr4
or eax, CR4_FXSR
mov cr4, eax
stdRET _Ki386EnableFxsr
stdENDP _Ki386EnableFxsr
;++
;
; VOID
; Ki386EnableXMMIExceptions (
; IN volatile PLONG Number
; )
;
; /*++
;
; Routine Description:
;
; This routine installs int 19 XMMI unmasked Numeric Exception handler
; and sets OSXMMEXCPT bit in CR4 to indicate that OS supports
; unmasked Katmai New Instruction technology exceptions.
;
; Arguments:
;
; Number - Supplies a pointer to count of the number of processors in
; the configuration.
;
; Return Value:
;
; None.
;--
cPublicProc _Ki386EnableXMMIExceptions,1
;Set up IDT for INT19
mov ecx,PCR[PcIdt] ;Get IDT address
lea eax, [ecx] + 098h ;XMMI exception is int 19
mov byte ptr [eax + 5], 08eh ;P=1,DPL=0,Type=e
mov word ptr [eax + 2], KGDT_R0_CODE ;Kernel code selector
mov edx, offset FLAT:_KiTrap13 ;Address of int 19 handler
mov ecx,edx
mov word ptr [eax],cx ;addr moves into low byte
shr ecx,16
mov word ptr [eax + 6],cx ;addr moves into high byte
;Enable XMMI exception handling
mov eax, cr4
or eax, CR4_XMMEXCPT
mov cr4, eax
stdRET _Ki386EnableXMMIExceptions
stdENDP _Ki386EnableXMMIExceptions
;++
;
; VOID
; Ki386EnableCurrentLargePage (
; IN ULONG IdentityAddr,
; IN ULONG IdentityCr3
; )
;
; /*++
;
; Routine Description:
;
; This routine enables the large page PDE support in the processor.
;
; Arguments:
;
; IdentityAddr - Supplies the linear address of the beginning of this
; function where (linear == physical).
;
; IdentityCr3 - Supplies a pointer to the temporary page directory and
; page tables that provide both the kernel (virtual ->physical) and
; identity (linear->physical) mappings needed for this function.
;
; Return Value:
;
; None.
;--
public _Ki386EnableCurrentLargePageEnd
cPublicProc _Ki386EnableCurrentLargePage,2
mov ecx,[esp]+4 ; (ecx)-> IdentityAddr
mov edx,[esp]+8 ; (edx)-> IdentityCr3
pushfd ; save current IF state
cli ; disable interrupts
mov eax, cr3 ; (eax)-> original Cr3
mov cr3, edx ; load Cr3 with Identity mapping
sub ecx, offset _Ki386EnableCurrentLargePage
add ecx, offset _Ki386LargePageIdentityLabel
jmp ecx ; jump to (linear == physical)
_Ki386LargePageIdentityLabel:
mov ecx, cr0
and ecx, NOT CR0_PG ; clear PG bit to disable paging
mov cr0, ecx ; disable paging
jmp $+2
mov edx, cr4
or edx, CR4_PSE ; enable Page Size Extensions
mov cr4, edx
mov edx, offset OriginalMapping
or ecx, CR0_PG ; set PG bit to enable paging
mov cr0, ecx ; enable paging
jmp edx ; Return to original mapping.
OriginalMapping:
mov cr3, eax ; restore original Cr3
popfd ; restore interrupts to previous
stdRET _Ki386EnableCurrentLargePage
_Ki386EnableCurrentLargePageEnd:
stdENDP _Ki386EnableCurrentLargePage
INIT ends
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
page , 132
subttl "Swap Process"
;++
;
; VOID
; KiSwapProcess (
; IN PKPROCESS NewProcess,
; IN PKPROCESS OldProcess
; )
;
; Routine Description:
;
; This function swaps the address space to another process by flushing
; the data cache, the instruction cache, the translation buffer, and
; establishes a new directory table base.
;
; It also swaps in the LDT and IOPM of the new process. This is necessary
; to avoid bogus mismatches in SwapContext.
;
; NOTE: keep in sync with process switch part of SwapContext
;
; Arguments:
;
; Process - Supplies a pointer to a control object of type process.
;
; Return Value:
;
; None.
;
;--
cPublicProc _KiSwapProcess ,2
cPublicFpo 2, 0
mov edx,[esp]+4 ; (edx)-> New process
mov eax,[esp]+8 ; (eax)-> Old Process
;
; Set the processor number in the new process and clear it in the old.
;
ifndef NT_UP
mov ecx, PCR[PcSetMember]
lock xor [edx]+PrActiveProcessors,ecx ; set bit in new processor set
lock xor [eax]+PrActiveProcessors,ecx ; clear bit in old processor set
if DBG
test [edx]+PrActiveProcessors,ecx ; test if bit set in new set
jz kisp_error1 ; if z, bit not set in new set
test [eax]+PrActiveProcessors,ecx ; test if bit clear in old set
jnz kisp_error ; if nz, bit not clear in old set
endif
endif
;
; Change LDT, If either the source or target process has an LDT we need to
; load the new one.
;
mov ecx, [edx]+PrLdtDescriptor
or ecx, [eax]+PrLdtDescriptor
jnz kisp_load_ldt ; if nz, LDT limit
kisp_load_ldt_ret: ; if nz, LDT limit
;
; Load the new CR3 and as a side effect flush non-global TB entries.
;
mov eax,[edx]+PrDirectoryTableBase
mov cr3,eax
mov ecx,PCR[PcTssCopy] ; (ecx)-> TSS
;
; Clear gs so it can't leak across processes
;
xor eax,eax ; assume ldtr is to be NULL
mov gs,ax ; Clear gs. (also workarounds
;
; Change IOPM
;
mov ax,[edx]+PrIopmOffset
mov [ecx]+TssIoMapBase,ax
stdRET _KiSwapProcess
kisp_load_ldt:
;
; Edit LDT descriptor
;
mov eax,[edx+PrLdtDescriptor]
test eax, eax
je @f
mov ecx,PCR[PcGdt]
mov [ecx+KGDT_LDT],eax
mov eax,[edx+PrLdtDescriptor+4]
mov [ecx+KGDT_LDT+4],eax
;
; Set up int 21 descriptor of IDT. If the process does not have Ldt, it
; should never make any int 21 call. If it does, an exception is generated.
; If the process has Ldt, we need to update int21 entry of LDT for the process.
; Note the Int21Descriptor of the process may simply indicate an invalid
; entry. In which case, the int 21 will be trapped to the kernel.
;
mov ecx, PCR[PcIdt]
mov eax, [edx+PrInt21Descriptor]
mov [ecx+21h*8], eax
mov eax, [edx+PrInt21Descriptor+4]
mov [ecx+21h*8+4], eax
mov eax,KGDT_LDT ;@@32-bit op to avoid prefix
@@: lldt ax
jmp kisp_load_ldt_ret
if DBG
kisp_error1: int 3
kisp_error: int 3
endif
stdENDP _KiSwapProcess
page ,132
subttl "Idle Loop"
;++
;
; VOID
; KiIdleLoop(
; VOID
; )
;
; Routine Description:
;
; This routine continuously executes the idle loop and never returns.
;
; Arguments:
;
; ebx - Address of the current processor's PCR.
;
; Return value:
;
; None - routine never returns.
;
;--
cPublicFastCall KiIdleLoop ,0
cPublicFpo 0, 0
if DBG
xor edi, edi ; reset poll breakin counter
endif
jmp short kid20 ; Skip HalIdleProcessor on first iteration
;
; There are no entries in the DPC list and a thread has not been selected
; for execution on this processor. Call the HAL so power managment can be
; performed.
;
; N.B. The HAL is called with interrupts disabled. The HAL will return
; with interrupts enabled.
;
; N.B. Use a call instruction instead of a push-jmp, as the call instruction
; executes faster and won't invalidate the processor's call-return stack
; cache.
;
kid10: lea ecx, [ebx].PcPrcbData.PbPowerState
call dword ptr [ecx].PpIdleFunction ; (ecx) = Arg0
;
; Give the debugger an opportunity to gain control on debug systems.
;
; N.B. On an MP system the lowest numbered idle processor is the only
; processor that polls for a breakin request.
;
kid20:
if DBG
ifndef NT_UP
mov eax, _KiIdleSummary ; get idle summary
mov ecx, [ebx].PcSetMember ; get set member
dec ecx ; compute right bit mask
and eax, ecx ; check if any lower bits set
jnz short CheckDpcList ; if nz, not lowest numbered
endif
dec edi ; decrement poll counter
jg short CheckDpcList ; if g, not time to poll
POLL_DEBUGGER ; check if break in requested
endif
kid30:
if DBG
ifndef NT_UP
mov edi, 20 * 1000 ; set breakin poll interval
else
mov edi, 100 ; UP idle loop has a HLT in it
endif
endif
CheckDpcList0: ;
YIELD
;
; Disable interrupts and check if there is any work in the DPC list of the
; current processor or a target processor.
;
CheckDpcList:
;
; N.B. The following code enables interrupts for a few cycles, then
; disables them again for the subsequent DPC and next thread
; checks.
;
sti ; enable interrupts
nop ;
nop ;
cli ; disable interrupts
;
; Process the deferred procedure call list for the current processor.
;
mov eax, [ebx]+PcPrcbData+PbDpcQueueDepth ; get DPC queue depth
or eax, [ebx]+PcPrcbData+PbTimerRequest ; merge timer request
ifndef NT_UP
or eax, [ebx]+PcPrcbData+PbDeferredReadyListHead ; merge deferred list head
endif
jz short CheckNextThread ; if z, no DPC's or timers to process
mov cl, DISPATCH_LEVEL ; set interrupt level
fstCall HalClearSoftwareInterrupt ; clear software interrupt
lea ecx, [ebx].PcPrcbData ; set current PRCB address
CAPSTART <@KiIdleLoop@0,@KiRetireDpcList@4>
fstCall KiRetireDpcList ; process the current DPC list
CAPEND <@KiIdleLoop@0>
if DBG
xor edi, edi ; clear breakin poll interval
endif
;
; Check if a thread has been selected to run on the current processor.
;
CheckNextThread: ;
cmp dword ptr [ebx].PcPrcbData.PbNextThread, 0 ; thread selected?
ifdef NT_UP
je short kid10 ; if eq, no thread selected
else
je kid40 ; if eq, no thread selected.
endif
;
; Raise IRQL to synchronization level and enable interrupts.
;
ifndef NT_UP
RaiseIrql SYNCH_LEVEL, NoOld ; raise IRQL to synchronizaiton level
endif
sti ; enable interrupts
mov edi, [ebx].PcPrcbData.PbCurrentThread ; get idle thread address
;
; Set context swap busy for idle thread and acquire the PRCB lock.
;
ifndef NT_UP
mov byte ptr [edi].ThSwapBusy, 1 ; set context swap busy
lock bts dword ptr [ebx].PcPrcbData.PbPrcbLock, 0 ; try to acquire PRCB Lock
jnc short kid33 ; if nc, PRCB lock acquired
lea ecx, [ebx].PcPrcbData.PbPrcbLock ; get PRCB lock address
fstCall KefAcquireSpinLockAtDpcLevel ; acquire current PRCB lock
endif
;
; If a thread had been scheduled for this processor but was removed from
; eligibility (e.g., an affinity change), then the new thread could be the
; idle thread.
;
kid33: mov esi, [ebx].PcPrcbData.PbNextThread ; get next thread address
ifndef NT_UP
cmp esi, edi ; check if idle thread
je short kisame ; if e, processor idle again
endif
and dword ptr [ebx].PcPrcbData.PbNextThread, 0 ; clear next thread
mov [ebx].PcPrcbData.PbCurrentThread, esi ; set new thread address
mov byte ptr [esi]+ThState, Running ; set thread state running
;
; Clear idle schedule since a new thread has been selected for execution on
; this processor and release the PRCB lock.
;
ifndef NT_UP
and byte ptr [ebx].PcPrcbData.PbIdleSchedule, 0 ; clear idle schedule
and dword ptr [ebx].PcPrcbData.PbPrcbLock, 0 ; release current PRCB lock
endif
kid35: ;
CAPSTART <@KiIdleLoop@0,SwapContext>
mov ecx, APC_LEVEL ; set APC bypass disable
call SwapContext ; swap context
CAPEND <@KiIdleLoop@0>
ifndef NT_UP
LowerIrql DISPATCH_LEVEL ; lower IRQL to dispatch level
endif
jmp kid30 ;
;
; The new thread is the Idle thread (same as old thread). This can happen
; rarely when a thread scheduled for this processor is made unable to run
; on this processor. As this processor has again been marked idle, other
; processors may unconditionally assign new threads to this processor.
;
ifndef NT_UP
kisame: and dword ptr [ebx].PcPrcbData.PbNextThread, 0 ; clear next thread
and dword ptr [ebx].PcPrcbData.PbPrcbLock, 0 ; release current PRCB lock
and byte ptr [edi].ThSwapBusy, 0 ; set idle thread context swap idle
jmp kid30 ;
;
; Call idle schedule if requested.
;
kid40: cmp byte ptr [ebx].PcPrcbData.PbIdleSchedule, 0 ; check if idle schedule
je kid10 ; if e, idle schedule not requested
sti ; enable interrupts
lea ecx, [ebx].PcPrcbData ; get current PRCB address
fstCall KiIdleSchedule ; attempt to schedule thread
test eax, eax ; test if new thread schedule
mov esi, eax ; set new thread address
mov edi, [ebx].PcPrcbData.PbIdleThread ; get idle thread address
jnz short kid35 ; if nz, new thread scheduled
jmp kid30 ;
endif
fstENDP KiIdleLoop
ifdef DBGMP
cPublicProc _KiPollDebugger,0
cPublicFpo 0,3
push eax
push ecx
push edx
POLL_DEBUGGER
pop edx
pop ecx
pop eax
stdRET _KiPollDebugger
stdENDP _KiPollDebugger
endif
page , 132
subttl "Adjust TSS ESP0 value"
;++
;
; VOID
; KiAdjustEsp0 (
; IN PKTRAP_FRAME TrapFrame
; )
;
; Routine Description:
;
; This routine puts the apropriate ESP0 value in the esp0 field of the
; TSS. This allows protect mode and V86 mode to use the same stack
; frame. The ESP0 value for protected mode is 16 bytes lower than
; for V86 mode to compensate for the missing segment registers.
;
; Arguments:
;
; TrapFrame - Supplies a pointer to the TrapFrame.
;
; Return Value:
;
; None.
;
;--
cPublicProc _Ki386AdjustEsp0 ,1
if DBG
;
; Make sure we are not called when the trap frame can be
; edited by a SetContextThread.
;
CurrentIrql
cmp al, APC_LEVEL
jge @f
int 3
@@:
endif
mov eax, PCR[PcPrcbData.PbCurrentThread] ; get current thread address
mov edx, [esp + 4] ; edx -> trap frame
mov eax, [eax]+ThInitialStack ; eax = base of stack
test dword ptr [edx]+TsEFlags, EFLAGS_V86_MASK ; is this a V86 frame?
jnz short ae10 ; if nz, V86 frame
sub eax, TsV86Gs - TsHardwareSegSS ; compensate for missing regs
ae10: sub eax, NPX_FRAME_LENGTH ;
pushfd ; Make sure we don't move
cli ; processors while we do this
mov edx, PCR[PcTssCopy] ;
mov [edx]+TssEsp0, eax ; set Esp0 value
popfd ;
stdRET _Ki386AdjustEsp0
stdENDP _Ki386AdjustEsp0
_TEXT$00 ends
end
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/eval/eval/value_type.h>
#include <vespa/eval/eval/value_type_spec.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <ostream>
using namespace vespalib::eval;
const size_t npos = ValueType::Dimension::npos;
TEST("require that ANY value type can be created") {
ValueType t = ValueType::any_type();
EXPECT_TRUE(t.type() == ValueType::Type::ANY);
EXPECT_EQUAL(t.dimensions().size(), 0u);
}
TEST("require that ERROR value type can be created") {
ValueType t = ValueType::error_type();
EXPECT_TRUE(t.type() == ValueType::Type::ERROR);
EXPECT_EQUAL(t.dimensions().size(), 0u);
}
TEST("require that DOUBLE value type can be created") {
ValueType t = ValueType::double_type();
EXPECT_TRUE(t.type() == ValueType::Type::DOUBLE);
EXPECT_EQUAL(t.dimensions().size(), 0u);
}
TEST("require that TENSOR value type can be created") {
ValueType t = ValueType::tensor_type({{"x", 10},{"y"}});
EXPECT_TRUE(t.type() == ValueType::Type::TENSOR);
ASSERT_EQUAL(t.dimensions().size(), 2u);
EXPECT_EQUAL(t.dimensions()[0].name, "x");
EXPECT_EQUAL(t.dimensions()[0].size, 10u);
EXPECT_EQUAL(t.dimensions()[1].name, "y");
EXPECT_EQUAL(t.dimensions()[1].size, npos);
}
TEST("require that TENSOR value type sorts dimensions") {
ValueType t = ValueType::tensor_type({{"x", 10}, {"z", 30}, {"y"}});
EXPECT_TRUE(t.type() == ValueType::Type::TENSOR);
ASSERT_EQUAL(t.dimensions().size(), 3u);
EXPECT_EQUAL(t.dimensions()[0].name, "x");
EXPECT_EQUAL(t.dimensions()[0].size, 10u);
EXPECT_EQUAL(t.dimensions()[1].name, "y");
EXPECT_EQUAL(t.dimensions()[1].size, npos);
EXPECT_EQUAL(t.dimensions()[2].name, "z");
EXPECT_EQUAL(t.dimensions()[2].size, 30u);
}
TEST("require that dimension names can be obtained") {
EXPECT_EQUAL(ValueType::double_type().dimension_names(),
std::vector<vespalib::string>({}));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 10}, {"x", 30}}).dimension_names(),
std::vector<vespalib::string>({"x", "y"}));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 10}, {"x", 30}, {"z"}}).dimension_names(),
std::vector<vespalib::string>({"x", "y", "z"}));
}
TEST("require that dimension index can be obtained") {
EXPECT_EQUAL(ValueType::error_type().dimension_index("x"), ValueType::Dimension::npos);
EXPECT_EQUAL(ValueType::any_type().dimension_index("x"), ValueType::Dimension::npos);
EXPECT_EQUAL(ValueType::double_type().dimension_index("x"), ValueType::Dimension::npos);
EXPECT_EQUAL(ValueType::tensor_type({}).dimension_index("x"), ValueType::Dimension::npos);
auto my_type = ValueType::tensor_type({{"y", 10}, {"x"}, {"z", 0}});
EXPECT_EQUAL(my_type.dimension_index("x"), 0u);
EXPECT_EQUAL(my_type.dimension_index("y"), 1u);
EXPECT_EQUAL(my_type.dimension_index("z"), 2u);
EXPECT_EQUAL(my_type.dimension_index("w"), ValueType::Dimension::npos);
}
void verify_equal(const ValueType &a, const ValueType &b) {
EXPECT_TRUE(a == b);
EXPECT_TRUE(b == a);
EXPECT_FALSE(a != b);
EXPECT_FALSE(b != a);
}
void verify_not_equal(const ValueType &a, const ValueType &b) {
EXPECT_TRUE(a != b);
EXPECT_TRUE(b != a);
EXPECT_FALSE(a == b);
EXPECT_FALSE(b == a);
}
TEST("require that value types can be compared") {
TEST_DO(verify_equal(ValueType::error_type(), ValueType::error_type()));
TEST_DO(verify_not_equal(ValueType::error_type(), ValueType::any_type()));
TEST_DO(verify_not_equal(ValueType::error_type(), ValueType::double_type()));
TEST_DO(verify_not_equal(ValueType::error_type(), ValueType::tensor_type({})));
TEST_DO(verify_equal(ValueType::any_type(), ValueType::any_type()));
TEST_DO(verify_not_equal(ValueType::any_type(), ValueType::double_type()));
TEST_DO(verify_not_equal(ValueType::any_type(), ValueType::tensor_type({})));
TEST_DO(verify_equal(ValueType::double_type(), ValueType::double_type()));
TEST_DO(verify_not_equal(ValueType::double_type(), ValueType::tensor_type({})));
TEST_DO(verify_equal(ValueType::tensor_type({{"x"}, {"y"}}), ValueType::tensor_type({{"y"}, {"x"}})));
TEST_DO(verify_not_equal(ValueType::tensor_type({{"x"}, {"y"}}), ValueType::tensor_type({{"x"}, {"y"}, {"z"}})));
TEST_DO(verify_equal(ValueType::tensor_type({{"x", 10}, {"y", 20}}), ValueType::tensor_type({{"y", 20}, {"x", 10}})));
TEST_DO(verify_not_equal(ValueType::tensor_type({{"x", 10}, {"y", 20}}), ValueType::tensor_type({{"x", 10}, {"y", 10}})));
TEST_DO(verify_not_equal(ValueType::tensor_type({{"x", 10}}), ValueType::tensor_type({{"x"}})));
}
void verify_predicates(const ValueType &type,
bool expect_any, bool expect_error, bool expect_double, bool expect_tensor,
bool expect_maybe_tensor, bool expect_abstract, bool expect_unknown_dimensions)
{
EXPECT_EQUAL(type.is_any(), expect_any);
EXPECT_EQUAL(type.is_error(), expect_error);
EXPECT_EQUAL(type.is_double(), expect_double);
EXPECT_EQUAL(type.is_tensor(), expect_tensor);
EXPECT_EQUAL(type.maybe_tensor(), expect_maybe_tensor);
EXPECT_EQUAL(type.is_abstract(), expect_abstract);
EXPECT_EQUAL(type.unknown_dimensions(), expect_unknown_dimensions);
}
TEST("require that type-related predicate functions work as expected") {
TEST_DO(verify_predicates(ValueType::any_type(),
true, false, false, false,
true, true, true));
TEST_DO(verify_predicates(ValueType::error_type(),
false, true, false, false,
false, false, false));
TEST_DO(verify_predicates(ValueType::double_type(),
false, false, true, false,
false, false, false));
TEST_DO(verify_predicates(ValueType::tensor_type({}),
false, false, false, true,
true, true, true));
TEST_DO(verify_predicates(ValueType::tensor_type({{"x"}}),
false, false, false, true,
true, false, false));
TEST_DO(verify_predicates(ValueType::tensor_type({{"x", 0}}),
false, false, false, true,
true, true, false));
}
TEST("require that dimension predicates work as expected") {
ValueType type = ValueType::tensor_type({{"x"}, {"y", 10}, {"z", 0}});
ASSERT_EQUAL(3u, type.dimensions().size());
EXPECT_TRUE(type.dimensions()[0].is_mapped());
EXPECT_TRUE(!type.dimensions()[0].is_indexed());
EXPECT_TRUE(!type.dimensions()[0].is_bound());
EXPECT_TRUE(!type.dimensions()[1].is_mapped());
EXPECT_TRUE(type.dimensions()[1].is_indexed());
EXPECT_TRUE(type.dimensions()[1].is_bound());
EXPECT_TRUE(!type.dimensions()[2].is_mapped());
EXPECT_TRUE(type.dimensions()[2].is_indexed());
EXPECT_TRUE(!type.dimensions()[2].is_bound());
}
TEST("require that duplicate dimension names result in error types") {
EXPECT_TRUE(ValueType::tensor_type({{"x"}, {"x"}}).is_error());
}
TEST("require that removing dimensions from non-abstract non-tensor types gives error type") {
EXPECT_TRUE(ValueType::error_type().reduce({"x"}).is_error());
EXPECT_TRUE(ValueType::double_type().reduce({"x"}).is_error());
}
TEST("require that removing dimensions from abstract maybe-tensor types gives any type") {
EXPECT_TRUE(ValueType::any_type().reduce({"x"}).is_any());
EXPECT_TRUE(ValueType::tensor_type({}).reduce({"x"}).is_any());
}
TEST("require that dimensions can be removed from tensor value types") {
ValueType type = ValueType::tensor_type({{"x", 10}, {"y", 20}, {"z", 30}});
EXPECT_EQUAL(ValueType::tensor_type({{"y", 20}, {"z", 30}}), type.reduce({"x"}));
EXPECT_EQUAL(ValueType::tensor_type({{"x", 10}, {"z", 30}}), type.reduce({"y"}));
EXPECT_EQUAL(ValueType::tensor_type({{"x", 10}, {"y", 20}}), type.reduce({"z"}));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 20}}), type.reduce({"x", "z"}));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 20}}), type.reduce({"z", "x"}));
}
TEST("require that removing an empty set of dimensions means removing them all") {
EXPECT_EQUAL(ValueType::tensor_type({{"x", 10}, {"y", 20}, {"z", 30}}).reduce({}), ValueType::double_type());
}
TEST("require that removing non-existing dimensions gives error type") {
EXPECT_TRUE(ValueType::tensor_type({{"y"}}).reduce({"x"}).is_error());
EXPECT_TRUE(ValueType::tensor_type({{"y", 10}}).reduce({"x"}).is_error());
}
TEST("require that removing all dimensions gives double type") {
ValueType type = ValueType::tensor_type({{"x", 10}, {"y", 20}, {"z", 30}});
EXPECT_EQUAL(ValueType::double_type(), type.reduce({"x", "y", "z"}));
}
TEST("require that dimensions can be combined for tensor value types") {
ValueType tensor_type_xy = ValueType::tensor_type({{"x"}, {"y"}});
ValueType tensor_type_yz = ValueType::tensor_type({{"y"}, {"z"}});
ValueType tensor_type_xyz = ValueType::tensor_type({{"x"}, {"y"}, {"z"}});
ValueType tensor_type_y = ValueType::tensor_type({{"y"}});
EXPECT_EQUAL(ValueType::join(tensor_type_xy, tensor_type_yz), tensor_type_xyz);
EXPECT_EQUAL(ValueType::join(tensor_type_yz, tensor_type_xy), tensor_type_xyz);
EXPECT_EQUAL(ValueType::join(tensor_type_y, tensor_type_y), tensor_type_y);
}
TEST("require that indexed dimensions combine to the minimal dimension size") {
ValueType tensor_0 = ValueType::tensor_type({{"x", 0}});
ValueType tensor_10 = ValueType::tensor_type({{"x", 10}});
ValueType tensor_20 = ValueType::tensor_type({{"x", 20}});
EXPECT_EQUAL(ValueType::join(tensor_10, tensor_0), tensor_0);
EXPECT_EQUAL(ValueType::join(tensor_10, tensor_10), tensor_10);
EXPECT_EQUAL(ValueType::join(tensor_10, tensor_20), tensor_10);
}
void verify_combinable(const ValueType &a, const ValueType &b) {
EXPECT_TRUE(!ValueType::join(a, b).is_error());
EXPECT_TRUE(!ValueType::join(b, a).is_error());
EXPECT_TRUE(!ValueType::join(a, b).is_any());
EXPECT_TRUE(!ValueType::join(b, a).is_any());
}
void verify_not_combinable(const ValueType &a, const ValueType &b) {
EXPECT_TRUE(ValueType::join(a, b).is_error());
EXPECT_TRUE(ValueType::join(b, a).is_error());
}
void verify_maybe_combinable(const ValueType &a, const ValueType &b) {
EXPECT_TRUE(ValueType::join(a, b).is_any());
EXPECT_TRUE(ValueType::join(b, a).is_any());
}
TEST("require that mapped and indexed dimensions are not combinable") {
verify_not_combinable(ValueType::tensor_type({{"x", 10}}), ValueType::tensor_type({{"x"}}));
}
TEST("require that dimension combining is only allowed (yes/no/maybe) for appropriate types") {
std::vector<ValueType> types = { ValueType::any_type(), ValueType::error_type(), ValueType::double_type(),
ValueType::tensor_type({}), ValueType::tensor_type({{"x"}}) };
for (size_t a = 0; a < types.size(); ++a) {
for (size_t b = a; b < types.size(); ++b) {
TEST_STATE(vespalib::make_string("a='%s', b='%s'", types[a].to_spec().c_str(), types[b].to_spec().c_str()).c_str());
if (types[a].is_error() || types[b].is_error()) {
verify_not_combinable(types[a], types[b]);
} else if (types[a].is_any() || types[b].is_any()) {
verify_maybe_combinable(types[a], types[b]);
} else if (types[a].is_double() || types[b].is_double()) {
verify_combinable(types[a], types[b]);
} else if (types[a].unknown_dimensions() || types[b].unknown_dimensions()) {
verify_maybe_combinable(types[a], types[b]);
} else {
verify_combinable(types[a], types[b]);
}
}
}
}
TEST("require that value type can make spec") {
EXPECT_EQUAL("any", ValueType::any_type().to_spec());
EXPECT_EQUAL("error", ValueType::error_type().to_spec());
EXPECT_EQUAL("double", ValueType::double_type().to_spec());
EXPECT_EQUAL("tensor", ValueType::tensor_type({}).to_spec());
EXPECT_EQUAL("tensor(x{})", ValueType::tensor_type({{"x"}}).to_spec());
EXPECT_EQUAL("tensor(y[10])", ValueType::tensor_type({{"y", 10}}).to_spec());
EXPECT_EQUAL("tensor(z[])", ValueType::tensor_type({{"z", 0}}).to_spec());
EXPECT_EQUAL("tensor(x{},y[10],z[])", ValueType::tensor_type({{"x"}, {"y", 10}, {"z", 0}}).to_spec());
}
TEST("require that value type spec can be parsed") {
EXPECT_EQUAL(ValueType::any_type(), ValueType::from_spec("any"));
EXPECT_EQUAL(ValueType::double_type(), ValueType::from_spec("double"));
EXPECT_EQUAL(ValueType::tensor_type({}), ValueType::from_spec("tensor"));
EXPECT_EQUAL(ValueType::tensor_type({}), ValueType::from_spec("tensor()"));
EXPECT_EQUAL(ValueType::tensor_type({{"x"}}), ValueType::from_spec("tensor(x{})"));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 10}}), ValueType::from_spec("tensor(y[10])"));
EXPECT_EQUAL(ValueType::tensor_type({{"z", 0}}), ValueType::from_spec("tensor(z[])"));
EXPECT_EQUAL(ValueType::tensor_type({{"x"}, {"y", 10}, {"z", 0}}), ValueType::from_spec("tensor(x{},y[10],z[])"));
}
TEST("require that value type spec can be parsed with extra whitespace") {
EXPECT_EQUAL(ValueType::any_type(), ValueType::from_spec(" any "));
EXPECT_EQUAL(ValueType::double_type(), ValueType::from_spec(" double "));
EXPECT_EQUAL(ValueType::tensor_type({}), ValueType::from_spec(" tensor "));
EXPECT_EQUAL(ValueType::tensor_type({}), ValueType::from_spec(" tensor ( ) "));
EXPECT_EQUAL(ValueType::tensor_type({{"x"}}), ValueType::from_spec(" tensor ( x { } ) "));
EXPECT_EQUAL(ValueType::tensor_type({{"y", 10}}), ValueType::from_spec(" tensor ( y [ 10 ] ) "));
EXPECT_EQUAL(ValueType::tensor_type({{"z", 0}}), ValueType::from_spec(" tensor ( z [ ] ) "));
EXPECT_EQUAL(ValueType::tensor_type({{"x"}, {"y", 10}, {"z", 0}}),
ValueType::from_spec(" tensor ( x { } , y [ 10 ] , z [ ] ) "));
}
TEST("require that malformed value type spec is parsed as error") {
EXPECT_TRUE(ValueType::from_spec("").is_error());
EXPECT_TRUE(ValueType::from_spec(" ").is_error());
EXPECT_TRUE(ValueType::from_spec("error").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor tensor").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{10})").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},)").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(,x{})").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},,y{})").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{} y{})").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{}").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{}),").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x[10)").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x[foo])").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x,y)").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},x{})").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},x[10])").is_error());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},x[])").is_error());
}
struct ParseResult {
vespalib::string spec;
const char *pos;
const char *end;
const char *after;
ValueType type;
ParseResult(const vespalib::string &spec_in);
~ParseResult();
bool after_inside() const { return ((after > pos) && (after < end)); }
};
ParseResult::ParseResult(const vespalib::string &spec_in)
: spec(spec_in),
pos(spec.data()),
end(pos + spec.size()),
after(nullptr),
type(value_type::parse_spec(pos, end, after))
{ }
ParseResult::~ParseResult() { }
TEST("require that we can parse a partial string into a type with the low-level API") {
ParseResult result("tensor(a[]) , ");
EXPECT_EQUAL(result.type, ValueType::tensor_type({{"a", 0}}));
ASSERT_TRUE(result.after_inside());
EXPECT_EQUAL(*result.after, ',');
}
TEST("require that we can parse an abstract tensor type from a partial string") {
ParseResult result("tensor , ");
EXPECT_EQUAL(result.type, ValueType::tensor_type({}));
ASSERT_TRUE(result.after_inside());
EXPECT_EQUAL(*result.after, ',');
}
TEST("require that 'error' is the valid representation of the error type") {
ParseResult valid(" error ");
ParseResult invalid(" fubar ");
EXPECT_EQUAL(valid.type, ValueType::error_type());
EXPECT_TRUE(valid.after == valid.end); // parse ok
EXPECT_EQUAL(invalid.type, ValueType::error_type());
EXPECT_TRUE(invalid.after == nullptr); // parse not ok
}
TEST("require that a sparse type must be a tensor with dimensions that all are mapped") {
EXPECT_TRUE(ValueType::from_spec("tensor(x{})").is_sparse());
EXPECT_TRUE(ValueType::from_spec("tensor(x{},y{})").is_sparse());
EXPECT_FALSE(ValueType::from_spec("tensor()").is_sparse());
EXPECT_FALSE(ValueType::from_spec("tensor(x[])").is_sparse());
EXPECT_FALSE(ValueType::from_spec("tensor(x{},y[])").is_sparse());
EXPECT_FALSE(ValueType::from_spec("double").is_sparse());
EXPECT_FALSE(ValueType::from_spec("any").is_sparse());
EXPECT_FALSE(ValueType::from_spec("error").is_sparse());
}
TEST("require that a dense type must be a tensor with dimensions that all are indexed") {
EXPECT_TRUE(ValueType::from_spec("tensor(x[])").is_dense());
EXPECT_TRUE(ValueType::from_spec("tensor(x[],y[])").is_dense());
EXPECT_FALSE(ValueType::from_spec("tensor()").is_dense());
EXPECT_FALSE(ValueType::from_spec("tensor(x{})").is_dense());
EXPECT_FALSE(ValueType::from_spec("tensor(x[],y{})").is_dense());
EXPECT_FALSE(ValueType::from_spec("double").is_dense());
EXPECT_FALSE(ValueType::from_spec("any").is_dense());
EXPECT_FALSE(ValueType::from_spec("error").is_dense());
}
TEST("require that tensor dimensions can be renamed") {
EXPECT_EQUAL(ValueType::from_spec("tensor(x{})").rename({"x"}, {"y"}),
ValueType::from_spec("tensor(y{})"));
EXPECT_EQUAL(ValueType::from_spec("tensor(x{},y[])").rename({"x","y"}, {"y","x"}),
ValueType::from_spec("tensor(y{},x[])"));
EXPECT_EQUAL(ValueType::from_spec("tensor(x{})").rename({"x"}, {"x"}),
ValueType::from_spec("tensor(x{})"));
EXPECT_EQUAL(ValueType::from_spec("tensor(x{})").rename({}, {}), ValueType::error_type());
EXPECT_EQUAL(ValueType::double_type().rename({}, {}), ValueType::error_type());
EXPECT_EQUAL(ValueType::from_spec("tensor(x{},y{})").rename({"x"}, {"y","z"}), ValueType::error_type());
EXPECT_EQUAL(ValueType::from_spec("tensor(x{},y{})").rename({"x","y"}, {"z"}), ValueType::error_type());
EXPECT_EQUAL(ValueType::tensor_type({}).rename({"x"}, {"y"}), ValueType::any_type());
EXPECT_EQUAL(ValueType::any_type().rename({"x"}, {"y"}), ValueType::any_type());
EXPECT_EQUAL(ValueType::double_type().rename({"a"}, {"b"}), ValueType::error_type());
EXPECT_EQUAL(ValueType::error_type().rename({"a"}, {"b"}), ValueType::error_type());
}
TEST("require that types can be concatenated") {
ValueType error = ValueType::error_type();
ValueType any = ValueType::any_type();
ValueType tensor = ValueType::tensor_type({});
ValueType scalar = ValueType::double_type();
ValueType vx_2 = ValueType::from_spec("tensor(x[2])");
ValueType vx_m = ValueType::from_spec("tensor(x{})");
ValueType vx_3 = ValueType::from_spec("tensor(x[3])");
ValueType vx_5 = ValueType::from_spec("tensor(x[5])");
ValueType vx_any = ValueType::from_spec("tensor(x[])");
ValueType vy_7 = ValueType::from_spec("tensor(y[7])");
ValueType mxy_22 = ValueType::from_spec("tensor(x[2],y[2])");
ValueType mxy_52 = ValueType::from_spec("tensor(x[5],y[2])");
ValueType mxy_29 = ValueType::from_spec("tensor(x[2],y[9])");
ValueType cxyz_572 = ValueType::from_spec("tensor(x[5],y[7],z[2])");
ValueType cxyz_m72 = ValueType::from_spec("tensor(x{},y[7],z[2])");
EXPECT_EQUAL(ValueType::concat(error, vx_2, "x"), error);
EXPECT_EQUAL(ValueType::concat(vx_2, error, "x"), error);
EXPECT_EQUAL(ValueType::concat(error, any, "x"), error);
EXPECT_EQUAL(ValueType::concat(any, error, "x"), error);
EXPECT_EQUAL(ValueType::concat(vx_m, vx_2, "x"), error);
EXPECT_EQUAL(ValueType::concat(vx_2, vx_m, "x"), error);
EXPECT_EQUAL(ValueType::concat(vx_m, vx_m, "x"), error);
EXPECT_EQUAL(ValueType::concat(vx_m, scalar, "x"), error);
EXPECT_EQUAL(ValueType::concat(scalar, vx_m, "x"), error);
EXPECT_EQUAL(ValueType::concat(vy_7, vx_m, "z"), cxyz_m72);
EXPECT_EQUAL(ValueType::concat(tensor, vx_2, "x"), any);
EXPECT_EQUAL(ValueType::concat(vx_2, tensor, "x"), any);
EXPECT_EQUAL(ValueType::concat(any, vx_2, "x"), any);
EXPECT_EQUAL(ValueType::concat(vx_2, any, "x"), any);
EXPECT_EQUAL(ValueType::concat(any, tensor, "x"), any);
EXPECT_EQUAL(ValueType::concat(tensor, any, "x"), any);
EXPECT_EQUAL(ValueType::concat(scalar, scalar, "x"), vx_2);
EXPECT_EQUAL(ValueType::concat(vx_2, scalar, "x"), vx_3);
EXPECT_EQUAL(ValueType::concat(scalar, vx_2, "x"), vx_3);
EXPECT_EQUAL(ValueType::concat(vx_2, vx_3, "x"), vx_5);
EXPECT_EQUAL(ValueType::concat(vx_2, vx_any, "x"), vx_any);
EXPECT_EQUAL(ValueType::concat(vx_any, vx_2, "x"), vx_any);
EXPECT_EQUAL(ValueType::concat(scalar, vx_2, "y"), mxy_22);
EXPECT_EQUAL(ValueType::concat(vx_2, scalar, "y"), mxy_22);
EXPECT_EQUAL(ValueType::concat(vx_2, vx_3, "y"), mxy_22);
EXPECT_EQUAL(ValueType::concat(vx_3, vx_2, "y"), mxy_22);
EXPECT_EQUAL(ValueType::concat(mxy_22, vx_3, "x"), mxy_52);
EXPECT_EQUAL(ValueType::concat(vx_3, mxy_22, "x"), mxy_52);
EXPECT_EQUAL(ValueType::concat(mxy_22, vy_7, "y"), mxy_29);
EXPECT_EQUAL(ValueType::concat(vy_7, mxy_22, "y"), mxy_29);
EXPECT_EQUAL(ValueType::concat(vx_5, vy_7, "z"), cxyz_572);
}
TEST("require that 'either' gives appropriate type") {
ValueType error = ValueType::error_type();
ValueType any = ValueType::any_type();
ValueType tensor = ValueType::tensor_type({});
ValueType scalar = ValueType::double_type();
ValueType vx_2 = ValueType::from_spec("tensor(x[2])");
ValueType vx_m = ValueType::from_spec("tensor(x{})");
ValueType vx_3 = ValueType::from_spec("tensor(x[3])");
ValueType vx_any = ValueType::from_spec("tensor(x[])");
ValueType vy_2 = ValueType::from_spec("tensor(y[2])");
ValueType mxy_22 = ValueType::from_spec("tensor(x[2],y[2])");
ValueType mxy_23 = ValueType::from_spec("tensor(x[2],y[3])");
ValueType mxy_32 = ValueType::from_spec("tensor(x[3],y[2])");
ValueType mxy_any2 = ValueType::from_spec("tensor(x[],y[2])");
ValueType mxy_2any = ValueType::from_spec("tensor(x[2],y[])");
EXPECT_EQUAL(ValueType::either(vx_2, error), error);
EXPECT_EQUAL(ValueType::either(error, vx_2), error);
EXPECT_EQUAL(ValueType::either(vx_2, vx_2), vx_2);
EXPECT_EQUAL(ValueType::either(vx_2, scalar), any);
EXPECT_EQUAL(ValueType::either(scalar, vx_2), any);
EXPECT_EQUAL(ValueType::either(vx_2, mxy_22), tensor);
EXPECT_EQUAL(ValueType::either(tensor, vx_2), tensor);
EXPECT_EQUAL(ValueType::either(vx_2, vy_2), tensor);
EXPECT_EQUAL(ValueType::either(vx_2, vx_m), tensor);
EXPECT_EQUAL(ValueType::either(vx_2, vx_3), vx_any);
EXPECT_EQUAL(ValueType::either(mxy_22, mxy_23), mxy_2any);
EXPECT_EQUAL(ValueType::either(mxy_32, mxy_22), mxy_any2);
}
TEST_MAIN() { TEST_RUN_ALL(); }
|
PAGE ,132
TITLE Windows Protect Mode Routines
.xlist
include kernel.inc
.386p
include protect.inc
include pdb.inc
.list
ifdef WOW
;
; the dpmi func 04f1h is idential to function 00h, except that
; the descriptor base and limit are not initialized to zero.
;
;
; the dpmi func 04f2h is identical to 0ch except that it
; sets 'count' (in cx) LDTs at one time. The first selector is in
; register bx. The descriptor data is in gdtdsc[bx], gdtdsc[bx+8]
; etc. This data is shared between dpmi (dosx.exe) and us and thus
; need not be passed in es:di
WOW_DPMIFUNC_00 equ 04f1h
WOW_DPMIFUNC_0C equ 04f2h
endif
MovsDsc Macro ;Move (copy) a descriptor (4 words)
cld
movsd
movsd
endm
CheckDS Macro
local okds
if KDEBUG
push ax
mov ax, ds
SetKernelDS
cmp ax, ArenaSel
mov ds, ax
UnSetKernelDS
je short okds
int 3
int 3
okds:
pop ax
endif
endm
CheckLDT Macro selector
if KDEBUG
test selector,SEL_LDT
jnz short @F
int 3
@@:
endif
Endm
DPMICALL MACRO callno
mov ax, callno
call DPMIProc
ENDM
MY_SEL equ 0F00h ; Access word to indicate selector owned by kernel
externW pLocalHeap
DataBegin
ifdef WOW
externW SelectorFreeBlock
externW UserSelArray
externB fBooting
globalW high0c,0
globalD FlatAddressArray,0
endif
externW MyCSSeg
externW WinFlags
externW ArenaSel
externW pGlobalHeap
externW MyCSAlias
extrn kr1dsc:WORD
extrn kr2dsc:WORD
extrn blotdsc:WORD
extrn DemandLoadSel:WORD
extrn FreeArenaList:DWORD
extrn FreeArenaCount:DWORD
extrn HighestArena:DWORD
extrn temp_arena:DWORD
extrn SelTableLen:word
extrn SelTableStart:DWORD
extrn temp_sel:WORD
extrn FirstFreeSel:WORD
extrn CountFreeSel:WORD
DataEnd
DataBegin INIT
RModeCallStructure STRUC
RMCS_EDI dd 0
RMCS_ESI dd 0
RMCS_EBP dd 0
RMCS_Res dd 0
RMCS_EBX dd 0
RMCS_EDX dd 0
RMCS_ECX dd 0
RMCS_EAX dd 0
RMCS_Flags dw 0
RMCS_ES dw 0
RMCS_DS dw 0
RMCS_FS dw 0
RMCS_GS dw 0
RMCS_IP dw 0
RMCS_CS dw 0
RMCS_SP dw 0
RMCS_SS dw 0
RModeCallStructure ENDS
MyCallStruc RModeCallStructure <>
globalD lpProc,0
public MS_DOS_Name_String
MS_DOS_Name_String db "MS-DOS", 0
DataEnd INIT
externFP IGlobalFree
externFP IGlobalAlloc
ifdef WOW
externFP kSYSERRORBOX
externFP VirtualAlloc
endif
sBegin CODE
assumes cs,CODE
assumes ds,nothing
externNP genter
extrn GrowHeapDib: FAR
extrn LocalNotifyDib: FAR
extrn LocalNotifyDefault: FAR
extrn FreeHeapDib: FAR
externNP gleave
extrn IGlobalFix:FAR ;Far calls in this segment
extrn GlobalHandleNorip:FAR
extrn IGlobalFlags:FAR
extrn IGlobalHandle: FAR
extrn Free_Object2: FAR
extrn mycsds:WORD
extrn gdtdsc:WORD
ifdef WOW
externD prevInt31proc
endif
sEnd CODE
sBegin INITCODE
assumes cs,CODE
assumes ds,nothing
;=======================================================================;
; ;
; 386 PROTECTED MODE INITIALISATION ROUTINES ;
; ;
;=======================================================================;
; this function is not used in ROM since DOSX switches to Pmode before
; jumping to kernel. this means the enhanced mode loader will have
; to do something similar...
;-----------------------------------------------------------------------;
; SwitchToPMODE ;
; ;
; Entry: ;
; In Real or Virtual Mode ;
; ES -> PSP ;
; ;
; Returns: ;
; In Protect Mode ;
; BX -> LDT selector ;
; SI -> Segment of start of available memory ;
; ES -> PSP ;
; ;
; Error Returns: ;
; Exits via DOS call 4Ch ;
; ;
; Registers Preserved: ;
; ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,DATA
assumes es,nothing
cProc SwitchToPMODE,<PUBLIC,NEAR>
cBegin nogen
push cx
push es ; Current PSP
mov ax, 1687h
int 2Fh ; Get PMODE switch entry
or ax, ax ; Can we do it?
jnz NoPMODE
xor bh, bh ; Set CPU type now
cmp cl, 3 ; At least a 386?
jb NoPMODE
mov bl,WF_CPU386
je short @F ; If 386
mov bl,WF_CPU486 ; No, assume 486 for now
@@:
mov WinFlags, bx ; Save away CPU type
mov word ptr [lpProc][0], di
mov word ptr [lpProc][2], es
pop ax ; PSP
add ax, 10h ; Skip the PSP
mov es, ax ; Give this to the DOS extender
add si, ax ; Start of memory available to us
; THIS IS IT FOLKS!
xor ax, ax ; 16-bit app
call [lpProc] ; Switch to PROTECTED mode
jc NoPMODE ; No, still Real/Virtual mode
mov ax, cs
and al, 7 ; LDT, Ring 3
cmp al, 7
jne short BadDPMI ; Insist on Ring 3!
mov bx, cs ; Allocate CS Alias
DPMICALL 000Ah
mov MyCSAlias, ax ; Save CS Alias in DS
mov bx, ds ; Use alias to update code seg var
mov ds, ax
assumes ds, CODE
mov MyCSDS, bx ; The DS selector
mov ds, bx
ReSetKernelDS
push es
push si
mov ax, 168Ah ; See if we have MS-DOS extensions
mov si, dataoffset MS_DOS_Name_String
int 2Fh ; DS:SI -> MS-DOS string
cmp al, 8Ah ; Have extensions?
je short BadDPMI ; no extensions, screwed
mov [lpProc][0], di ; Save CallBack address
mov [lpProc][2], es
mov ax, 0100h ; Get base of LDT
call [lpProc]
jc short NoLDTParty
verw ax ; Writeable?
jnz short NoLDTParty ; nope, don't bother with it yet
mov es, MyCSAlias
assumes es,CODE
mov gdtdsc, ax
assumes es,nothing
NoLDTParty:
pop si
pop es
push si ; Unlock all of our memory
ifndef WOW ; For WOW its all pageable
movzx ebx, si
shl ebx, 4 ; Linear address of start of our memory
movzx esi, es:[PDB_block_len] ; End of our memory
shl esi, 4
sub esi, ebx ; Size of our block
mov di, si
shr esi, 10h
mov cx, bx
shr ebx, 10h
mov ax, 0602h
int 31h ; Mark region as pageable.
endif
pop bx
mov ax, 2 ; Convert start of memory to selector
int 31h
mov si, ax
xor bx, bx
pop cx
ret
BadDPMI:
;
; Call real/virtual mode to whine
;
xor cx, cx ; Nothing on stack to copy
xor bh, bh ; Flags to DPMI
mov ax, MyCSSeg
mov MyCallStruc.RMCS_DS, ax ; Real mode DS will be parent PDB
mov MyCallStruc.RMCS_ES, cx ; Real mode ES will be 0
mov MyCallStruc.RMCS_CS, ax ; Real mode CS
mov MyCallStruc.RMCS_IP, codeoffset RModeCode ; Real mode IP
smov es, ds
mov di, dataOffset MyCallStruc ; ES:DI points to call structure
mov ax, 0301h ; Call Real Mode Procedure
int 31h
jmps GoodBye
RModeCode:
mov dx, codeoffset szInadequate
mov ah, 9
int 21h
retf
;Inadequate:
; DB 'KRNL386: Inadequate DPMI Server',13,10,'$'
externB <szNoPMode, szInadequate>
NoPMODE: ; NOTE: stack trashed...
ifdef WOW
;** Put Up a Dialog Box If we fail to Enter Protect Mode
;** Prepare the dialog box
push cs ;In our DS
push codeOFFSET szNoPMode ; -> unable to enter Prot Mode
push ds
externB <syserr>
push dataOffset syserr ;Caption
push 0 ;No left button
push SEB_CLOSE + SEB_DEFBUTTON ;Button 1 style
push 0 ;No right button
call kSYSERRORBOX ;Put up the system error message
externNP ExitKernel
jmp ExitKernel
else ; Not WOW
mov dx, codeoffset szNoPMode
; call complain
; DB 'KRNL386: Unable to enter Protected Mode',13,10,'$'
;complain:
; pop dx
push cs
pop ds ; DS:DX -> error message
mov ah,9 ; Print error message
int 21h
endif; WOW
GoodBye:
mov ax, 4CFFh
int 21h
cEnd nogen
;-----------------------------------------------------------------------;
; LDT_Init ;
; ;
; Entry: ;
; DS -> CS ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
cProc LDT_Init,<PUBLIC,NEAR>,<ax,bx,cx,di,es>
cBegin
ReSetKernelDS
cmp gdtdsc, 0
jz short SlowAllocation
;
; Scan LDT for free selectors and
; put on a linked list
;
mov es, gdtdsc
mov cx, 1
DPMICALL 0000h ; Get selector from win386
and al, NOT SEG_RING_MASK
mov FirstFreeSel, ax ; Set up header
mov si, ax
mov word ptr es:[si], -1
mov word ptr es:[si].dsc_access, MY_SEL ; MINE!
mov cx, es
lsl ecx, ecx ; limit of LDT
xor eax, eax
steal_sels:
mov di, si ; prev selector in list
not_this_one:
add si, DSC_LEN ; use add for flags
jz short end_ldt
cmp si, cx
ja short end_ldt
cmp dword ptr es:[si], eax
jne not_this_one
cmp dword ptr es:[si][4], eax
jne not_this_one
mov word ptr es:[di], si ; Link into list
mov word ptr es:[si].dsc_access, MY_SEL ; MINE!
inc CountFreeSel
jmps steal_sels
end_ldt:
mov word ptr es:[di], -1
SlowAllocation:
push es ; Get random selectors
smov es, ds
ReSetKernelDS es
UnSetKernelDS
; Could get 3 selectors at once here,
; but get_sel is more efficient for just 1
mov cx, 1 ; Argument to get_sel
call get_sel
or si, SEG_RING
mov kr1dsc, si
call get_sel
mov kr2dsc, si
call get_sel
mov blotdsc, si
call get_sel
or si, SEG_RING
mov DemandLoadSel, si ; for demand loading segments
smov ds, es
pop es
UnSetKernelDS es
cEnd
sEnd INITCODE
sBegin CODE
assumes cs,CODE
assumes ds,nothing
;=======================================================================;
; ;
; SELECTOR ALLOCATION/DEALLOCATION ROUTINES ;
; ;
;=======================================================================;
;-----------------------------------------------------------------------;
; AllocSelector
;
;
; Entry:
;
; Returns:
; AX = 0 if out of selectors
;
; Registers Destroyed:
;
; History:
; Thu 08-Dec-1988 14:17:38 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
ifdef WOW
labelFP <PUBLIC,AllocSelectorWOW>
mov ax, 1
jmps AllocSelectorWorker
labelFP <PUBLIC,AllocSelector>
xor ax, ax
; fall through
cProc AllocSelectorWorker,<PUBLIC,FAR>,<di,si,es>
parmW selector
localV OldDsc,DSC_LEN
localW fDontSetDescriptor
cBegin
mov fDontSetDescriptor, ax
else
cProc AllocSelector,<PUBLIC,FAR>,<di,si,es>
parmW selector
localV OldDsc,DSC_LEN
cBegin
endif
mov cx, 1
lsl ecx, dword ptr selector
jz short as_present
call get_sel ; He passed in some junk, give him
ifdef WOW ; just one selector...
; If we have a good selector, use DPMI to write it through to the
; system LDT before giving it to an application to use.
jz short as_exit1
mov ax, [bp+4] ; Get caller CS.
cmp ax, IGROUP ; Don't write thru if it's KRNL386 calling.
je short as_exit
cmp ax, _NRESTEXT
je short as_exit
cmp ax, _MISCTEXT
je short as_exit
;Set shadow LDT entry to known state.
push bx
push ds
mov ds, gdtdsc ; Get shadow LDT in DS
UnSetKernelDS
mov bx, si
mov [bx].dsc_limit, 00h ; Set entry to: BASE = 0, LIMIT = 0, BYTES,
mov [bx].dsc_lbase, 00h ; DPL = 3, PRESENT, DATA
mov [bx].dsc_mbase, 00h
mov [bx].dsc_hbase, 00h
mov ax, DSC_DATA+DSC_PRESENT
mov word ptr [bx].dsc_access, ax
pop ds
DPMICALL WOW_DPMIFUNC_0C ; Write shadow LDT entry thru to system LDT.
pop bx
jmps as_exit
else
jnz short as_exit ; just one selector...
jmps as_exit1
endif
as_present:
Limit_To_Selectors ecx
call get_sel
jz short as_exit1
ifdef WOW
test fDontSetDescriptor, 1
jnz as_exit
endif
smov es, ss
lea di, OldDsc ; ES:DI points to descriptor
mov bx, selector ; BX gets old selector
push ds
mov ds, gdtdsc
push si ; Get Descriptor
mov si, bx
and si, not 7
MovsDsc
lea di, [di-DSC_LEN] ; Restore DI
pop si
pop ds
mov bx, si ; BX gets new selector
or bl, SEG_RING
call fill_in_selector_array ; and set new array to match
as_exit:
or si, SEG_RING
as_exit1:
mov ax,si
cEnd
;-----------------------------------------------------------------------;
; AllocResSelArray - Allocate a resource Selector array (see resaux) ;
; Combination of AllocSelectorArray + SetResourceOwner;
; Entry: ;
; nSels = # selectors required ;
; parmW owner ;
; ;
; ;
; ;
; get_sel - get an array of selectors ;
; ;
; Entry: ;
; CX = # selectors required ;
; ;
; Returns: ;
; SI = First Selector ;
; DS = LDT ;
; ZF = 0 ;
; ;
; Error Returns: ;
; SI = 0 ;
; ZF = 1 ;
; ;
; Registers Preserved: ;
; DI,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; mattfe March 30th 1993 - WOW Specific Routine, by combining the two ;
; routines I can reduce the number of DPMI calls by 40/1 for loading ;
; a typical app. ;
;-----------------------------------------------------------------------;
ifdef WOW
assumes ds, nothing
assumes es, nothing
cProc AllocResSelArray,<PUBLIC,NEAR>,<cx,si,di,es,ds>
parmW nSels
parmW owner
cBegin
mov cx, nSels
call get_sel
mov ax, si
jz short ARSA_fail
or si, SEG_RING
mov bx, si
mov dx, cx
push ds
mov ds, gdtdsc
push bx
and bl, not 7
;; For the first selector mark it with the resource owner
mov cx, owner
mov ds:[bx].dsc_owner, cx
mov word ptr ds:[bx].dsc_access, (DSC_DISCARDABLE SHL 8) + DSC_DATA
mov cx,nSels
mov ds:[bx].dsc_hbase, cl ; Save number of selectors here
mov cx, DSC_DATA+DSC_PRESENT
lea bx, [bx+DSC_LEN]
dec dx
jz ASRA_CallNT
ARSA_fill_in_access:
mov word ptr ds:[bx].dsc_access, cx
lea bx, [bx+DSC_LEN]
dec dx
jnz ARSA_fill_in_access
ASRA_CallNT:
mov bx,si ; First Selector
mov cx,nSels ; Count
DPMICALL WOW_DPMIFUNC_0C
SetKernelDS
mov ds, pGlobalHeap
UnSetKernelDS
cCall AssociateSelector32,<si,0,owner> ; And save in selector table
pop ax ; Return first sel
pop ds
ARSA_fail:
cEnd
endif ; WOW
;-----------------------------------------------------------------------;
; AllocSelectorArray - external entry for get_sel ;
; Entry: ;
; nSels = # selectors required ;
; ;
; get_sel - get an array of selectors ;
; ;
; Entry: ;
; CX = # selectors required ;
; ;
; Returns: ;
; SI = First Selector ;
; DS = LDT ;
; ZF = 0 ;
; ;
; Error Returns: ;
; SI = 0 ;
; ZF = 1 ;
; ;
; Registers Preserved: ;
; DI,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds, nothing
assumes es, nothing
cProc AllocSelectorArray,<PUBLIC,FAR>,<si>
parmW nSels
cBegin
mov cx, nSels
call get_sel
mov ax, si
jz short asa_fail
or si, SEG_RING
mov bx, si
mov dx, cx
mov cx, DSC_DATA+DSC_PRESENT
ifdef WOW ; LATER should use single op to update
fill_in_access: ; complete LDT with one call.
DPMICALL 0009h
lea bx, [bx+DSC_LEN]
dec dx
jnz fill_in_access
else
push ds
mov ds, gdtdsc
push bx
and bl, not 7
fill_in_access:
mov word ptr ds:[bx].dsc_access, cx
lea bx, [bx+DSC_LEN]
dec dx
jnz fill_in_access
pop bx
pop ds
endif; WOW
mov ax, si
asa_fail:
cEnd
if KDEBUG
cProc check_free_sel_list,<PUBLIC,NEAR>
cBegin
pushf
pusha
push ds
call SetKernelDSProc ; Must call direct in this file
ReSetKernelDS
mov cx, CountFreeSel
cmp cx, 2 ; Only check list with more than 1 entry.
jb cfl_ok
inc cx ; Count dummy entry.
mov si, FirstFreeSel ; Pointer to head of list
mov ds, gdtdsc ; Get shadow LDT in DS
UnSetKernelDS
cfl_loop:
mov ax, word ptr [si] ; Get next.
cmp ax, 0FFFFH ; -1 is sentinal
je short cfl_trashed
mov di, si ; Save prev. for debugging.
mov si, ax
loop cfl_loop
mov ax, word ptr [si] ; Get sentinal.
cfl_done:
cmp ax, 0FFFFH ; -1 is sentinal
je short cfl_ok ; Must have sentinal and
cfl_trashed:
kerror 0, <Free sel list is trashed>
cfl_ok:
pop ds
popa
popf
cEnd
endif
cProc get_sel,<PUBLIC,NEAR>
localW MySel
cBegin
pusha
gs_retry_get_sel:
call SetKernelDSProc ; Must call direct in this file
ReSetKernelDS
mov si, FirstFreeSel ; Pointer to head of list
mov ds, gdtdsc
UnSetKernelDS
mov dx, cx ; Sels wanted
mov ax, word ptr [si]
inc ax ; -1 teminated
jz short gs_searchfailed
if KDEBUG
call check_free_sel_list
endif
cmp cx, 1 ; One selector only?
jne short gs_selblock
dec ax
mov di, ax
mov word ptr [di].dsc_access, DSC_USED ; Mark it used
mov di, word ptr [di] ; Unlink it
mov word ptr [si], di
mov si, ax
jmp got_my_sel
gs_selblock: ; Following stolen from DOSX
mov bx, si ; Start of list of free sels
lea si, [si+DSC_LEN] ; Start search here!
mov di, ds
lsl di, di ; limit of LDT
and di, NOT 7
gs_jail:
mov ax, si ; Starting selector
mov cx, dx ; number to check
gs_sb0:
cmp word ptr ds:[si].dsc_access, MY_SEL ; This one free?
jnz short gs_sb1 ; nope, keep looking
lea si, [si+DSC_LEN]
cmp si, di ; Falling off the end?
jae short gs_searchfailed
loop gs_sb0 ; All we wanted?
jmps gs_gotblock
gs_sb1:
lea si, [si+DSC_LEN] ; Restart scan after this selector
cmp si, di
jb short gs_jail
jmps gs_searchfailed
; Got our block, now blast them out
gs_gotblock: ; of the free list
mov cx, dx ; # selectors
push cx
shl dx, 3 ; Length of our array of selectors
add dx, ax ; First selector after our array
mov si, [bx] ; Next selector in free list
gs_blast:
inc si
jz short gs_blasted ; Gone thru whole list
dec si
cmp si, ax ; See if in range
jb short gs_noblast
cmp si, dx
jb short gs_unlink
gs_noblast:
mov bx, si
mov si, [si] ; Follow the link
jmps gs_blast
gs_unlink: ; This one is in range
mov si, [si] ; Unlink it
mov [bx], si
loop gs_blast ; Stop search when unlinked them all
gs_blasted:
pop cx
mov si, ax
lea si, [si].dsc_access ; Now mark them used
gs_markused:
mov byte ptr [si], DSC_USED
lea si, [si+DSC_LEN]
cmp si, dx
jb short gs_markused
mov si, ax
jmps got_my_sel
gs_searchfailed: ; Failed from our list, try WIN386
mov cx, dx
;;;%out Take me out later
;;; mov ds, gdtdsc
;;; UnSetKernelDS
gs_slow:
ifdef WOW
;; Calling DPMI to do anything is very slow, so lets grab at minimum 256
;; selectors at a time, that way we don't have to call again for a while
call SetKernelDSProc ; Must call direct in this file
ReSetKernelDS
push cx
test fbooting,1 ; Don't do optimization during boot
; since free_Sel will return them to
; DPMI.
jnz gs_0100
add cx,256 ; get more than we need
DPMICALL 0000h
jc gs_0100 ; Failed, then just grab the required
mov bx, ax ; number.
gs_free_loop:
cCall free_sel,<bx> ; Got the selectors, put them on
lea bx, [bx+DSC_LEN] ; our free list the easy way...
loop gs_free_loop
pop cx
jmp gs_retry_get_sel
gs_0100:
pop cx
endif; WOW
DPMICALL 0000h ; Call DPMI to get one
and al, NOT SEG_RING_MASK
mov si, ax
or si, si ; Did we get it?
jnz short got_dpmi_sel
if KDEBUG
push es
pusha
krDebugOut DEB_WARN, "Out of selectors"
popa
pop es
jmp gs_exit
else
jmps gs_exit
endif
; Try to avoid running out of selectors under Enhanced mode by keeping
; 256 selectors free. This will hopefully allow win386 to grow the
; LDT while there is still memory to do so.
got_my_sel:
SetKernelDS
sub CountFreeSel, cx
ifndef WOW
;; See above WOW code which grabs chunks of 256 selectors from DOSX
;; we don't need to do this.
test byte ptr WinFlags, WF_ENHANCED ; Standard mode can't grow the
jz got_either_sel ; LDT so don't bother
cmp CountFreeSel, 256
jae got_either_sel
lsl bx, gdtdsc ; LDT already full size?
cmp bx, 0F000h
ja got_either_sel
push ax
push cx
mov cx, 256
DPMICALL 0000h
jc gs_after_free
mov bx, ax
gs_free_it:
cCall free_sel,<bx> ; Got the selectors, put them on
lea bx, [bx+DSC_LEN] ; our free list the easy way...
loop gs_free_it
gs_after_free:
pop cx
pop ax
endif; NOT WOW
jmps got_either_sel
got_dpmi_sel:
SetKernelDS
got_either_sel:
cmp SelTableLen, 0
je short gs_exit ; Not set yet
push eax
.ERRNZ DSC_LEN-8
lea eax, [esi+ecx*DSC_LEN][-DSC_LEN] ; AX has last selector
shr ax, 1 ; ignore high word...
cmp ax, SelTableLen
pop eax
jb short gs_exit ; Can associate this selector
if KDEBUG
int 3
endif
mov bx, si
xor si, si
or bl, SEG_RING
as_free:
DPMICALL 0001h ; Free selector
; Give to WIN386 since we can't use it
lea bx, [bx+DSC_LEN]
loop as_free
gs_exit:
mov ds, gdtdsc
UnSetKernelDS
mov MySel, si
popa
mov si, MySel
or si, si ; Set ZF for caller
cEnd
;-----------------------------------------------------------------------;
; alloc_disc_data_sel
; alloc_data_sel
; alloc_data_sel32
; alloc_disc_CS_sel
; alloc_CS_sel
; alloc_NP_data_sel
; alloc_NP_CS_sel
;
; Set appropriate access rights flags then use
; alloc_sel to get a selector.
;
; Entry:
; Base address and Limit OR Owner
;
; Returns:
; Selector in AX
;
; Registers Destroyed:
; AX
;
; History:
; Fri 15-Jul-1988 21:05:19 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
public alloc_data_sel32
alloc_data_sel32 label near
cProc alloc_data_sel,<PUBLIC,NEAR>
; parmD Address
; parmD Limit
cBegin nogen
mov ax,DSC_PRESENT+DSC_DATA
jmps alloc_sel
cEnd nogen
;-----------------------------------------------------------------------;
; alloc_sel ;
; ;
; Entry: ;
; AL = flags ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; BX,CX,DX,DI,SI,DS,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
; Thu 07-Apr-1988 21:33:27 -by- David N. Weise [davidw] ;
; Added the GlobalNotify check. ;
; ;
; Sun Feb 01, 1987 07:48:39p -by- David N. Weise [davidw] ;
; Added this nifty comment block. ;
;-----------------------------------------------------------------------;
cProc alloc_sel,<PUBLIC,NEAR>,<bx,dx,si,di,ds,es>
parmD Address
parmD Limit
localV DscBuf,DSC_LEN
cBegin
push ecx
mov cx, 1
test al, DSC_PRESENT
jz short as_oneonly
mov ecx, Limit ; Calculate how many selectors required
cmp ecx, 100000h ; More than 1Mb?
jb short as_byte
add ecx, 0FFFh ; Round to 4K pages
and cx, not 0FFFh
mov Limit, ecx
shr Limit, 12 ; # 4K pages
or ah, DSC_GRANULARITY ; 4K granularity!
as_byte:
dec Limit ; Came in as length, now limit
add ecx, 0FFFFh
shr ecx, 16 ; # selectors in array
as_oneonly:
call get_sel
jz short a_s_exit ; No selectors left
mov bx, si ; Selector in bx for DPMI
or bl, SEL_LDT
lea di, DscBuf
smov es, ss ; es:di points to descriptor buffer
test al, DSC_PRESENT
jnz short set_everything
push ax
mov ds, gdtdsc
and bl, not 7
pop word ptr [bx].dsc_access
mov ax, word ptr Limit
mov [bx].dsc_limit, ax
mov [bx].dsc_hbase, cl ; Number of selectors here
ifdef WOW
smov es, ds ; es:di -> descriptor
mov di, bx
or bl, SEG_RING ; bx selector #
DPMICALL 000Ch ; Set descriptor
endif; WOW
jmps as_done
set_everything:
and ah, not 0Fh ; Zero limit 19:16
or ah, byte ptr Limit+2 ; Fill in limit 19:16
mov word ptr DscBuf.dsc_access, ax
mov ax, Limit.lo
mov DscBuf.dsc_limit, ax
mov ax, Address.lo
mov DscBuf.dsc_lbase, ax
mov ax, Address.hi
mov DscBuf.dsc_mbase, al
mov DscBuf.dsc_hbase, ah
call fill_in_selector_array
as_done:
or si, SEG_RING
a_s_exit:
mov ax, si
pop ecx
cEnd
;-----------------------------------------------------------------------;
; free_sel ;
; FreeSelector ;
; ;
; Entry: ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc IFreeSelector,<FAR,PUBLIC>
parmW selector
cBegin
xor ax, ax
mov es, ax
cCall FreeSelArray,<selector>
cEnd
assumes ds, nothing
assumes es, nothing
ifdef WOW
; save cx too.
cProc free_sel,<PUBLIC,NEAR>,<ax,bx,si,ds,cx>
else
cProc free_sel,<PUBLIC,NEAR>,<ax,bx,si,ds>
endif
parmW selector
cBegin
pushf ; !!! for the nonce
mov bx,selector ; must be careful in gcompact
; to ignore error return
call SetKernelDSProc ; Must call direct in this file
ReSetKernelDS
cmp gdtdsc, 0
je short give_to_win386
sel_check bx
mov si, bx
shr si, 1
cmp si, SelTableLen
if 0
mov si, SelTableLen
shl si, 1
cmp bx, si
endif
jae short give_to_win386
mov si, FirstFreeSel
inc CountFreeSel
mov ds, gdtdsc
UnSetKernelDS
ifdef WOW
mov cx, word ptr [bx+4]
endif
; Link into list
mov ax, [si] ; ax := head.next
mov [si], bx ; head.next := new
mov [bx], ax ; new.next := ax
mov word ptr [bx][2], 0
mov dword ptr [bx][4], MY_SEL SHL 8 ; Make it free
ifdef WOW
cmp cx, MY_SEL
jz sel_freed
or bl, SEG_RING ; Ensure Table bit correct
mov cx, 1
DPMICALL WOW_DPMIFUNC_0C
endif
jmps sel_freed
give_to_win386:
or bl, SEG_RING ; Ensure Table bit correct
DPMICALL 0001H
sel_freed:
popf
cEnd
;-----------------------------------------------------------------------;
; FreeSelArray ;
; ;
; Entry: ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc FreeSelArray,<PUBLIC,NEAR>,<ax,bx>
parmW selector
cBegin
push ecx
mov cx, 1 ; In case lar, lsl fail, one sel to free
mov bx, selector
Handle_To_Sel bl
ifdef WOW
if KDEBUG
push ds
SetKernelDS
cmp DemandLoadSel, 0 ; Skip the test if we're freeing DemandLoadSel
UnSetKernelDS
pop ds
je short fsa_no_test
push bx
push ds
mov ds, gdtdsc
and bl, not 7
mov ch, [bx].dsc_access
pop ds
pop bx
lar ax, bx
and ah, 0feh ;ignore access bit
and ch, 0feh ;ignore access bit
cmp ah, ch
je short LDTs_match
kerror 0, <System LDT does not match Shadow LDT>
LDTs_match:
xor ch, ch
fsa_no_test:
endif
endif
lar ax, bx
jnz short just_free_it ; I'm completely confused...
test ah, DSC_CODEDATA ; Code or data?
jz short just_free_it ; No, assume only one selector
test ah, DSC_PRESENT ; Present?
jnz short use_limit ; yes, calculate # sels from limit
ifdef WOW
; MarkSelNotPresent Saves Number of selectors in the dsc_hbase entry to get
; it back directly from our copy of the LDT.
push bx
push ds
mov ds, gdtdsc
and bl, not 7
xor cx,cx
mov cl,[bx].dsc_hbase ; Get Saved # selectors
pop ds
pop bx
else
push dx ; DPMI call 6 returns CX:DX
DPMICALL 0006h ; Get physical address
shr cx, 8 ; number of selectors
pop dx
endif; WOW
jmps just_free_it
use_limit:
lsl ecx, ebx
jnz short just_free_it ; Not present
Limit_To_Selectors ecx
just_free_it:
if KDEBUG
cmp cl,ch
jnz short skip_zero_inc
kerror 0, <Looping on cx=0 in FreeSelArray>
inc cl
skip_zero_inc:
endif
just_free_it2:
cCall free_sel,<bx> ; (preserves cx)
lea bx, [bx+DSC_LEN]
loop just_free_it2 ; Any left to free
pop ecx
cEnd
;-----------------------------------------------------------------------;
; GrowSelArray ;
; ;
; Entry: ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; AX = 0 ;
; ZF = 1 ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS,ES ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc GrowSelArray,<PUBLIC,NEAR>,<bx,di>
localV DscBuf,DSC_LEN
cBegin
push ecx
mov di, ds:[esi].pga_handle
mov bx, di
Handle_To_Sel di
lsl eax, edi
Limit_To_Selectors eax
if KDEBUG
cmp al, ds:[esi].pga_selcount
je short gsa_count_ok
int 3
int 3
gsa_count_ok:
endif
mov ecx, edx ; New size
add ecx, 0FFFFh
shr ecx, 16 ; new # selectors
cmp ax, cx ; Same # of selectors required?
je short gsa_done ; yes, just return!
push si
push es
push ds
push di ; Argument to FreeSelArray
cmp cx, 255 ; Max array is 255.
jae short gsa_nosels
call get_sel ; get a new selector array
jz short gsa_nosels
push bx
mov bx, di ; DI had original selector
push ds
mov ds,gdtdsc
mov es,gdtdsc
push si
mov di,si
and di, not 7
mov si,bx
and si, not 7
MovsDsc
pop si
pop ds
ifdef WOW
push cx
push bx
mov cx, 1
mov bx, si
or bx, SEG_RING_MASK
DPMICALL WOW_DPMIFUNC_0C
pop bx
pop cx
endif
mov di, si ; New selector in DI
pop bx
pop si
pop ds
cCall AssociateSelector32,<si,0,0>
pop es
pop si
mov ax, bx
and ax, SEG_RING_MASK ; Ring bits
or ax, di ; New handle
mov ds:[esi].pga_handle, ax
mov ds:[esi].pga_selcount, cl
cCall AssociateSelector32,<ax,esi>
jmps gsa_done
gsa_nosels:
pop di
pop ds
pop es
pop si
xor ax, ax ; Indicate failure
jmps gsa_ret
gsa_done:
mov ax, ds:[esi].pga_handle
or ax, ax ; Success
gsa_ret:
pop ecx
cEnd
;=======================================================================;
; ;
; SELECTOR ALIAS ROUTINES ;
; ;
;=======================================================================;
;-----------------------------------------------------------------------;
; PrestoChangoSel
;
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
;
; History:
; Thu 08-Dec-1988 14:17:38 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc IPrestoChangoSelector,<PUBLIC,FAR>,<di,si>
parmW sourcesel
parmW destsel
localV DscBuf,DSC_LEN
cBegin
ifdef WOW
smov es, ss
lea di, DscBuf
mov bx, sourcesel
DPMICALL 000Bh ; LATER change this to a single
xor DscBuf.dsc_access, DSC_CODE_BIT ; DPMI call, read from gdtdsc
mov bx, destsel
DPMICALL 000Ch
mov ax, bx
else
push bx
push ds
mov ds, gdtdsc
mov es, gdtdsc
mov si, sourcesel
and si, not 7
mov di, destsel
and di, not 7
MovsDsc
lea bx,[di-DSC_LEN]
xor ds:[bx].dsc_access,DSC_CODE_BIT ; Toggle CODE/DATA
pop ds
or bl, SEG_RING
mov ax, bx
pop bx
endif; WOW
smov es,0
cEnd
;-----------------------------------------------------------------------;
; AllocAlias ;
; AllocCStoDSAlias ;
; AllocDStoCSAlias ;
; All these routines return an alias selector for the ;
; given selector. ;
; ;
; Entry: ;
; ;
; Returns: ;
; AX is alias selector ;
; DX is original selector (compatibility thing) ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; BX,CX,DI,SI,DS ;
; ;
; Registers Destroyed: ;
; ES destroyed ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
labelFP <PUBLIC,IAllocDStoCSAlias>
;** AllocDStoCSAlias has an interesting hack. A fix was made to
;** not allow apps to GlobalAlloc fixed memory. This was done
;** for performance reasons. The only reason we can ascertain
;** for an app needing fixed GlobalAlloc'ed memory is in the case
;** of alias selectors. We assume that all apps needing alias
;** selectors will use this function to make the alias. So, if
;** we see a DStoCS alias being made, we make sure the DS is fixed.
push bp
mov bp, sp ;Create the stack frame
push WORD PTR [bp + 6] ;Get handle/selector
IF KDEBUG
call GlobalHandleNorip ;Make sure it's really a handle
ELSE
call IGlobalHandle ;Make sure it's really a handle
ENDIF
test ax, 1 ;Fixed blocks have low bit set
jnz SHORT ADCA_Already_Fixed ;It's already a fixed block!
;** If the block is not fixed, it may be locked so we must check this.
push ax ;Save returned selector
push ax ;Use as parameter
call IGlobalFlags ;Returns lock count if any
or al, al ;Non-zero lock count?
pop ax ;Get selector back
jnz SHORT ADCA_Already_Fixed ;Yes, don't mess with it
;** Fix the memory. Note that we're only doing this for the
;** apps that are calling this on non-fixed or -locked memory.
;** This will cause them to rip on the GlobalFree call to this
;** memory, but at least it won't move on them!
push ax ;Fix it
call IGlobalFix
ADCA_Already_Fixed:
pop bp ;Clear our stack frame
;** Flag which type of alias to make and jump to common routine
mov dl, 1
jmps aka
labelFP <PUBLIC,IAllocCStoDSAlias>
xor dl, dl
cProc aka,<FAR,PUBLIC>, <bx,cx,si,di,ds>
parmW sourceSel
localV DscBuf,DSC_LEN
localB flag ; 0 for data, !0 for code
cBegin
mov flag, dl
mov cx, 1
call get_sel
mov ax, si ; in case it failed
jz short aka_nope
or si, SEG_RING
ifdef WOW ; LATER Single DPMI call
push si ; save Target Selector
smov es,ss
lea di,DscBuf
mov bx,sourceSel
DPMICALL 000Bh ; Read the Selector into DscBuf
and es:[di].dsc_access,NOT DSC_CODE_BIT ; Toggle CODE/DATA
cmp flag, 0
jz @F
or es:[di].dsc_access,DSC_CODE_BIT
@@:
pop bx ; restore Target Selector
DPMICALL 0000Ch
else
mov ds, gdtdsc
mov es, gdtdsc
mov bx, si
mov di, si
and di, not 7
mov si, sourceSel
and si, not 7
MovsDsc
and es:[di][-DSC_LEN].dsc_access,NOT DSC_CODE_BIT ; Toggle CODE/DATA
cmp flag, 0
jz @F
or es:[di][-DSC_LEN].dsc_access,DSC_CODE_BIT
@@:
endif; WOW
mov ax, bx
smov es,0
aka_nope:
mov dx,sourceSel
cEnd
cProc AllocAlias,<FAR,PUBLIC>, <bx,cx,si,di,ds>
parmW selector
cBegin
ifdef WOW
push bx ; Whitewater tool ObjDraw needs this too
endif
mov cx, 1
call get_sel
jz short aca_nope
or si, SEG_RING
cCall IPrestoChangoSelector,<selector,si>
aca_nope:
; WhiteWater Resource Toolkit (shipped with Borland's Turbo
; Pascal) depends on dx being the data selector which was true
; in 3.0 but in 3.1 validation layer destroys it.
mov dx,selector
ifdef WOW
pop bx
endif
cEnd
;=======================================================================;
; ;
; SELECTOR MANPULATION ROUTINES ;
; ;
;=======================================================================;
;-----------------------------------------------------------------------;
; fill_in_selector_array ;
; ;
; Entry: ;
; AX = Limit for object ;
; DH = Discard bit for descriptors ;
; DL = Access bits ;
; BX:DI = 32 bit base address of object ;
; SI = index into LDT ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; SI, DI, DS, ES ;
; ;
; Registers Destroyed: ;
; AX,BX,CX,DX ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
cProc fill_in_selector_array,<PUBLIC,NEAR>
cBegin nogen
push ds
mov ds, gdtdsc
push bx
push cx
mov dh, es:[di].dsc_hlimit ; For granularity
next_sel:
;; DPMICALL 000Ch ; Set this descriptor
push bx ; Set Descriptor
and bl, not 7
mov ax, es:[di] ; This looks slow but it isn't...
mov ds:[bx], ax
mov ax, es:[di][2]
mov ds:[bx][2], ax
mov ax, es:[di][4]
mov ds:[bx][4], ax
mov ax, es:[di][6]
mov ds:[bx][6], ax
pop bx
lea bx, [bx+DSC_LEN] ; On to next selector
add es:[di].dsc_mbase, 1 ; Add 64kb to address
adc es:[di].dsc_hbase, 0
test dh, DSC_GRANULARITY ; Page granular?
jz short byte_granular
sub es:[di].dsc_limit, 16 ; 64K is 16 4K pages
sbb es:[di].dsc_hlimit, 0 ; Carry into hlimit
loop next_sel
jmps fisa_ret
byte_granular:
dec es:[di].dsc_hlimit ; subtract 64kb from limit
loop next_sel
fisa_ret:
pop cx
pop bx
DPMICALL WOW_DPMIFUNC_0C
pop ds
ret
cEnd nogen
;-----------------------------------------------------------------------;
; GetSelectorBase
; get_physical_address
;
;
; Entry:
;
; Returns:
; DX:AX 32 bit physical address
; Registers Destroyed:
;
; History:
; Sat 09-Jul-1988 16:40:59 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc GetSelectorBase,<PUBLIC,FAR>
parmW selector
cBegin
cCall get_physical_address, <selector>
cEnd
cProc get_physical_address,<PUBLIC,NEAR>
parmW selector
cBegin
push bx
push cx
mov bx, selector
push ds ; Get Segment Base Address
mov ds, gdtdsc
and bl, not 7
mov ax, ds:[bx].dsc_lbase
mov dl, ds:[bx].dsc_mbase
mov dh, ds:[bx].dsc_hbase
pop ds
pop cx
pop bx
cEnd
;-----------------------------------------------------------------------;
; get_selector_length16
;
;
; Entry:
;
; Returns:
; AX 16 bit segment length
; Registers Destroyed:
;
; History:
; Sat 09-Jul-1988 16:40:59 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc get_selector_length16,<PUBLIC,NEAR>
parmW selector
cBegin
mov ax, -1
lsl ax, selector
inc ax ; length is one bigger!
cEnd
;-----------------------------------------------------------------------;
; set_physical_address
;
;
; Entry:
; DX:AX 32 bit physical address
; Returns:
;
; Registers Destroyed:
;
; History:
; Sat 09-Jul-1988 16:40:59 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc far_set_physical_address,<PUBLIC,FAR>
parmW selector
cBegin
cCall set_physical_address,<selector>
cEnd
cProc set_physical_address,<PUBLIC,NEAR>,<bx,di>
parmW selector
cBegin
push ecx
mov bx, selector
CheckLDT bl
lsl ecx, ebx
if KDEBUG
jz short spa_ok
int 3
spa_ok:
endif
Limit_To_Selectors ecx
mov di, cx
mov cx, dx ; CX:DX has new address
mov dx, ax
push ds
push bx
ifdef WOW
set_bases:
DPMICALL 0007h ; Set selector base
else
mov ds, gdtdsc
set_bases:
and bl, not 7
mov ds:[bx].dsc_lbase, dx
mov ds:[bx].dsc_mbase, cl
mov ds:[bx].dsc_hbase, ch
endif; WOW
lea bx, [bx+DSC_LEN] ; On to next selector
inc cx ; Add 64k to base
dec di
jnz set_bases
pop bx
pop ds
mov ax, dx ; Restore AX and DX
mov dx, cx
pop ecx
cEnd
;-----------------------------------------------------------------------;
; set_selector_address32
;
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
;
; History:
; Sat 09-Jul-1988 16:40:59 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc set_selector_address32,<PUBLIC,NEAR>,<ax,dx>
parmW selector
parmD addr
cBegin
mov dx, addr.sel
mov ax, addr.off
cCall set_physical_address,<selector>
cEnd
;-----------------------------------------------------------------------;
; set_sel_limit
;
;
; Entry:
; CX:BX = length of segment
; Returns:
;
; Registers Destroyed:
; CX
;
; History:
; Fri 15-Jul-1988 19:41:44 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc set_sel_limit,<PUBLIC,NEAR>,<ax,dx,si,di,es,ds>
parmW selector
localV DscBuf,DSC_LEN
cBegin
push ebx
push ecx
push bx ; Get existing descriptor
smov es, ss
lea di, DscBuf
mov bx, selector
push ds ; Get Descriptor
mov ds, gdtdsc
push si
mov si, bx
and si, not 7
MovsDsc
lea di, [di-DSC_LEN] ; Restore DI
pop si
pop ds
pop bx
mov dx, word ptr [DscBuf.dsc_access]
and dh, 0F0h ; Zap hlimit bits
test dl, DSC_PRESENT
jz short ssl_set_limit1 ; Not present, just one to set
and dh, NOT DSC_GRANULARITY ; Byte granularity
shl ecx, 16
mov cx, bx ; DWORD length
mov ebx, ecx
cmp ecx, 100000h ; More than 1Mb?
jb short ssl_byte
add ecx, 0FFFh ; Round to 4k pages
and cx, not 0FFFh
mov ebx, ecx
shr ebx, 12 ; # 4k pages
or dh, DSC_GRANULARITY ; Set 4k granularity
ssl_byte:
add ecx, 0FFFFh
shr ecx, 16 ; # selectors in array
cmp cx, 1
je short ssl_set_limit1
dec ebx ; length to limit
mov ax, bx ; low 16 bits of limit
shr ebx, 16
or dh, bl ; Bits 19:16 of limit
mov word ptr DscBuf.dsc_access, dx
mov DscBuf.dsc_limit, ax
mov bx, Selector
call fill_in_selector_array
jmps ssl_done
ssl_set_limit1: ; Fast out for one only
dec bx ; Came in as length
mov DscBuf.dsc_limit, bx ; and limit
mov word ptr DscBuf.dsc_access, dx ; Access, Discard and hlimit
mov bx, Selector
DPMICALL 000Ch
ssl_done:
smov ss,ss ; It may be SS we're changing
pop ecx
pop ebx
cEnd
;-----------------------------------------------------------------------;
; set_selector_limit32
;
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
;
; History:
; Fri 15-Jul-1988 19:41:44 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc set_selector_limit32,<PUBLIC,NEAR>,<cx,bx>
parmW selector
parmD sel_len
cBegin
mov cx, sel_len.hi
mov bx, sel_len.lo
cCall set_sel_limit,<selector>
cEnd
;-----------------------------------------------------------------------;
; mark_sel_NP
;
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
; BX
;
; History:
; Fri 15-Jul-1988 21:37:22 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc mark_sel_NP,<PUBLIC,NEAR>,<ds>
parmW selector
parmW owner
localV DscBuf,DSC_LEN
cBegin
push ecx
mov bx, selector
Handle_To_Sel bl
lsl ecx, ebx ; How many selectors do we have now?
Limit_To_Selectors ecx
push ax
push es
push di
push ds
mov ds, gdtdsc
push bx
and bl, not 7
mov [bx].dsc_hbase, cl ; Save # selectors
mov [bx].dsc_hlimit, DSC_DISCARDABLE
and [bx].dsc_access, NOT DSC_PRESENT
mov cx, owner
mov [bx].dsc_owner, cx ; Set owner in descriptor
ifdef WOW
;
; Now the copy of the LDT has the correct info set VIA DPMI the real NT
; LDT Entry
smov es,ds
mov di,bx ; es:di->selector
or bx, SEG_RING ; BX = selector
DPMICALL 000Ch
endif; WOW
pop bx
pop ds
SetKernelDS
mov ds, pGlobalHeap
UnSetKernelDS
cCall AssociateSelector32,<bx,0,cx> ; Save owner in selector table
pop di
pop es
pop ax
pop ecx
cEnd
;-----------------------------------------------------------------------;
; mark_sel_PRESENT
;
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
;
; History:
; Fri 15-Jul-1988 21:37:22 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc mark_sel_PRESENT,<PUBLIC,NEAR>,<dx,di,es>
parmD arena_ptr
parmW selector
localV DscBuf,DSC_LEN
cBegin
push eax
push ebx
push ecx
smov es, ss
lea di, DscBuf
mov bx, selector
DPMICALL 000Bh ; Get existing descriptor
mov ax, word ptr DscBuf.dsc_access ; Access and hlimit
or al, DSC_PRESENT ; Mark it present
and ah, NOT DSC_GRANULARITY ; Assume byte granular
mov esi, arena_ptr
CheckDS
mov ecx, ds:[esi].pga_size
mov ebx, ecx
cmp ecx, 100000h ; New size more than 1Mb?
jb short msp_byte
add ebx, 0FFFh ; Round to 4k pages
and bx, not 0FFFh
shr ebx, 12 ; # 4k pages
or ah, DSC_GRANULARITY ; Set 4k granularity
msp_byte:
dec ebx
mov DscBuf.dsc_limit, bx ; Fill in new limit fields
shr ebx, 16
and bl, 0Fh
and ah, NOT 0Fh
or ah, bl
mov word ptr DscBuf.dsc_access, ax ; Fill in new hlimit and access
dec ecx
Limit_To_Selectors ecx ; New number of selectors
mov ds:[esi].pga_selcount, cl
mov bl, DscBuf.dsc_hbase ; Old number of selectors
sub bl, cl
je short go_ahead ; Same number, just fill in array
jb short get_big
; here to get small
xor bh, bh
xchg bx, cx
shl bx, 3 ; Offset of first selector
.errnz DSC_LEN - 8
add bx, selector ; First selector to free
@@: cCall free_sel,<bx>
lea bx, [bx+DSC_LEN]
loop @B
jmps go_ahead ; And fill in remaining selectors
get_big:
mov ax, word ptr DscBuf.dsc_access ; Access bits in ax
mov ebx, ds:[esi].pga_address ; Get base address
mov ecx, ds:[esi].pga_size
cCall alloc_sel,<ebx,ecx> ; Access bits in ax
mov si, ax
or ax, ax ; did we get a set?
jz short return_new_handle
or si, SEG_RING ; Set ring bits like old selector
test selector, IS_SELECTOR
jnz short @F
StoH si
HtoS selector
@@:
cCall AssociateSelector32,<selector,0,0>
cCall FreeSelArray,<selector> ; Zap old handle
jmps return_new_handle
go_ahead:
mov ebx, ds:[esi].pga_address ; Fill in selector array with
mov DscBuf.dsc_lbase, bx ; new base and limit
shr ebx, 16
mov DscBuf.dsc_mbase, bl
mov DscBuf.dsc_hbase, bh
mov bx, selector
movzx cx, ds:[esi].pga_selcount
call fill_in_selector_array
mov si, selector ; return old selector in SI
return_new_handle:
pop ecx
pop ebx
pop eax
cEnd
;-----------------------------------------------------------------------;
; cmp_sel_address
;
; Compares the physical addresses corresponding to two selectors
;
; Entry:
;
; Returns:
;
; Registers Destroyed:
;
; History:
; Sat 09-Jul-1988 19:10:14 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc cmp_sel_address,<PUBLIC,NEAR>
parmW sel1
parmW sel2
cBegin
push ax
push ebx
push edx
cCall get_physical_address,<sel1>
mov bx, dx
shl ebx, 16
mov bx, ax ; First address in EBX
cCall get_physical_address,<sel2>
shl edx, 16
mov dx, ax ; Second address in EDX
cmp ebx, edx
pop edx
pop ebx
pop ax
;;; mov ds,gdtdsc
;;; mov si,sel1
;;; mov di,sel2
;;; sel_check si
;;; sel_check di
;;; mov al,[si].dsc_hbase
;;; cmp al,[di].dsc_hbase
;;; jne short csa_done
;;; mov al,[si].dsc_mbase
;;; cmp al,[di].dsc_mbase
;;; jne short csa_done
;;; mov ax,[si].dsc_lbase
;;; cmp ax,[di].dsc_lbase
;;;csa_done:
cEnd
;-----------------------------------------------------------------------;
; pdref ;
; ;
; Dereferences the given global handle, i.e. gives back abs. address. ;
; ;
; Arguments: ;
; DX = selector ;
; DS:DI = BURGERMASTER ;
; ;
; Returns: ;
; ESI = address of arena header ;
; AX = address of client data ;
; CH = lock count or 0 for fixed objects ;
; CL = flags ;
; DX = handle, 0 for fixed objects ;
; ;
; Error Returns: ;
; ZF = 1 if invalid or discarded ;
; AX = 0 ;
; BX = owner of discarded object ;
; SI = handle of discarded object ;
; ;
; Registers Preserved: ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc pdref,<PUBLIC,NEAR>
cBegin nogen
mov si, dx
sel_check si
or si, si ; Null handle?
mov ax, si
jz short pd_exit ; yes, return 0
lar eax, edx
jnz short pd_totally_bogus
shr eax, 8
; We should beef up the check for a valid discarded sel.
xor cx,cx
test ah, DSC_DISCARDABLE
jz short pd_not_discardable
or cl, GA_DISCARDABLE
; Discardable, is it code?
test al, DSC_CODE_BIT
jz short pd_not_code
or cl,GA_DISCCODE
pd_not_code:
pd_not_discardable:
test al, DSC_PRESENT
jnz short pd_not_discarded
; object discarded
or cl,HE_DISCARDED
ifdef WOW
; On WOW we don't copy the owner to the real LDT since it is slow to call
; the NT Kernel, so we read our copy of it directly.
; see set_discarded_sel_owner mattfe mar 23 93
move ax,es ; save es
mov bx,dx
mov es,cs:gdtdsc
and bl, not 7
mov bx,es:[bx].dsc_owner
mov es,ax ; restore
else
lsl bx, dx ; get the owner
endif
or si, SEG_RING-1 ; Handles are RING 2
xor ax,ax
jmps pd_exit
pd_not_discarded:
cCall get_arena_pointer32,<dx>
mov esi, eax
mov ax, dx
or esi, esi ; Unknown selector
jz short pd_maybe_alias
mov dx, ds:[esi].pga_handle
cmp dx, ax ; Quick check - handle in header
je short pd_match ; matches what we were given?
test al, IS_SELECTOR ; NOW, we MUST have been given
jz short pd_totally_bogus ; a selector address.
push ax
StoH al ; Turn into handle
cmp dx, ax
pop ax
jne short pd_nomatch
pd_match:
or cl, ds:[esi].pga_flags
and cl, NOT HE_DISCARDED ; same as GA_NOTIFY!!
mov ax, dx ; Get address in AX
test dl, GA_FIXED ; DX contains handle
jnz short pd_fixed ; Does handle need derefencing?
mov ch, ds:[esi].pga_count
HtoS al ; Dereference moveable handle
jmps pd_exit
pd_totally_bogus:
xor ax,ax
pd_maybe_alias:
if 0
if KDEBUG
or dx,dx
jnz short dref_invalid
endif
endif
pd_nomatch: ; Handle did not match...
xor dx, dx
;;; mov dx, ax ; Must be an alias...
pd_fixed:
;;; xor si, si
;;; xor dx, dx
pd_exit:
or ax,ax
ret
if 0
if KDEBUG
dref_invalid:
push ax
kerror ERR_GMEMHANDLE,<gdref: invalid handle>,0,dx
pop ax
jmps pd_nomatch
endif
endif
cEnd nogen
cProc Far_pdref,<PUBLIC,FAR>
cBegin nogen
call pdref
ret
cEnd nogen
;-----------------------------------------------------------------------;
; get_rover_2 ;
; ;
; Entry: ;
; ES Selector to get rover for ;
; Returns: ;
; ES (kr2dsc) is rover DATA and PRESENT ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc get_rover_2,<PUBLIC,NEAR>,<di>
localV DscBuf,DSC_LEN
cBegin
push ax
push bx
mov bx, es ; Selector to get rover for
push ds
SetKernelDS ds
mov di, kr2dsc
mov es, gdtdsc
mov ds, gdtdsc
UnSetKernelDS ds
push si
mov si, bx
and si, not 7
and di, not 7
MovsDsc
lea bx, [di-DSC_LEN]
mov es:[bx].dsc_access, DSC_PRESENT+DSC_DATA
or bl, SEG_RING
pop si
ifdef WOW
push cx
mov cx, 1
DPMICALL WOW_DPMIFUNC_0C
pop cx
endif; WOW
pop ds
mov es, bx ; Return with ES containing rover
pop bx
pop ax
cEnd
;-----------------------------------------------------------------------;
; get_rover_232 ;
; ;
; Entry: ;
; ds:esi ;
; Returns: ;
; ES:0 ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; AX,BX,CX,DX,DI,SI,DS ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
;-----------------------------------------------------------------------;
ifndef WOW_x86
assumes ds,nothing
assumes es,nothing
cProc get_rover_232,<PUBLIC,NEAR>,<di>
localV DscBuf,DSC_LEN
cBegin
push eax
push bx
SetKernelDS es
mov bx, kr2dsc
or bl, SEG_RING
smov es, ss
UnSetKernelDS es
lea di, DscBuf ; ES:DI -> descriptor
mov eax, ds:[esi].pga_address
mov [DscBuf].dsc_lbase, ax ; Fill in base address
shr eax, 16
mov [DscBuf].dsc_mbase, al
mov [DscBuf].dsc_hbase, ah
mov [DscBuf].dsc_limit, 1000h ; Real big limit
mov [DscBuf].dsc_hlimit, DSC_GRANULARITY
mov [DscBuf].dsc_access,DSC_PRESENT+DSC_DATA
DPMICALL 000Ch ; Set descriptor
mov es, bx
pop bx
pop eax
cEnd
endif; WOW
cProc far_get_temp_sel,<FAR,PUBLIC>
cBegin
cCall get_temp_sel
cEnd
cProc get_temp_sel,<PUBLIC,NEAR>,<ax,cx,di,si>
localV DscBuf,DSC_LEN
cBegin
mov cx, 1
DPMICALL 0000h ; Get us a selector
push bx
mov si, ax ; New selector
mov bx, es ; Old selector
ifdef WOW ; LATER Make single dpmicall
smov es, ss
lea di, DscBuf
DPMICALL 000Bh ; Get existing descriptor
mov DscBuf.dsc_access,DSC_PRESENT+DSC_DATA
mov DscBuf.dsc_limit,0ffffh
or DscBuf.dsc_hlimit, 0Fh ; Max length
mov bx, si
or bl, SEG_RING
DPMICALL 000Ch ; Set new descriptor
else
push ds
mov ds, gdtdsc
mov es, gdtdsc
mov di, si
and di, not 7
mov si, bx
and si, not 7
MovsDsc
lea bx, [di-DSC_LEN]
mov [bx].dsc_access,DSC_PRESENT+DSC_DATA
mov [bx].dsc_limit,0ffffh
or [bx].dsc_hlimit, 0Fh ; Max length
or bl, SEG_RING
pop ds
endif; WOW
mov es, bx
pop bx
cEnd
cProc far_free_temp_sel,<PUBLIC,FAR>
parmW selector
cBegin
cCall free_sel,<selector>
cEnd
;-----------------------------------------------------------------------;
; get_blotto
;
;
; Entry:
; EAX = arena header
;
; Returns:
; BX = Selector points to pga_address (size pga_arena)
; Registers Destroyed:
;
; History:
; Sun 31-Jul-1988 16:20:53 -by- David N. Weise [davidw]
;
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
ifndef WOW_x86
;; On WOW_x86 we try to avoid setting selectors since it is slow, we use selector
;; 23h to write to anywhere in VDM memory.
cProc get_blotto,<PUBLIC,NEAR>,<di>
localV DscBuf,DSC_LEN
cBegin
push es
push bx
lea di, DscBuf
SetKernelDS es
mov bx, blotdsc
smov es, ss
UnSetKernelDS es
or bl, SEG_RING
push eax
mov eax, ds:[eax].pga_address
mov [DscBuf].dsc_lbase,ax
shr eax, 16
mov [DscBuf].dsc_mbase,al
mov [DscBuf].dsc_hbase,ah
; Convert pga_size to limit in page granularity
pop eax
mov eax, ds:[eax].pga_size ; Get Size in Bytes
add eax, 4096-1 ; Round up to 4k multiple
shr eax, 3*4
mov [DscBuf].dsc_limit,ax
shr eax,16
or al, DSC_GRANULARITY
mov [DscBuf].dsc_hlimit, al
mov [DscBuf].dsc_access,DSC_PRESENT+DSC_DATA
DPMICALL 000Ch ; Set up the descriptor
mov ax, bx
pop bx
pop es
cEnd
endif;
;-----------------------------------------------------------------------;
; LongPtrAdd
;
; Performs segment arithmetic on a long pointer and a DWORD offset
; The resulting pointer is normalized to a paragraph boundary.
; The offset cannot be greater than 16 megabytes (current Enh Mode
; limit on size of an object).
;
; Entry:
;
; Returns:
; DX:AX new segment:offset
;
; Error returns:
; DX:AX = 0
;
; Registers Destroyed:
; BX,CX
;
; History:
; Mon 19-Dec-1988 18:37:23 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
ifdef WOW
LPTRADDWOW_SETBASE equ 01h
;cProc LongPtrAddWOW,<PUBLIC,FAR>,<si,di>
; parmD long_ptr
; parmD delta
; parmW RefSelector
; parmW flBaseSetting
;
; effectively pops RefSelector and flBaseSetting into dx and ax.
; and jumps to longptrAddWorker.
;
; RefSelector is used only if the descriptor needs to be set.
;
labelFP <PUBLIC,LongPtrAddWOW>
pop ax
pop dx ; far return address
mov bx,sp
xchg ax, ss:[bx] ; replace the 'dword' with the return address
xchg dx, ss:[bx+2]
jmps LongPtrAddWorker ; ax = flags; dx = reference selector
labelFP <PUBLIC,LongPtrAdd>
mov ax, LPTRADDWOW_SETBASE
xor dx, dx
; fall through
cProc LongPtrAddWorker,<PUBLIC,FAR>,<si,di>
parmD long_ptr
parmD delta
localV DscBuf,DSC_LEN
localW flBaseSetting
localW RefSelector
cBegin
mov flBaseSetting, ax ; save in localvariables
mov RefSelector, dx
or dx, dx ; if RefSelector is nonzero
jz @F ; use it for querying descriptor info.
xchg dx, word ptr long_ptr[2] ; and store the selector to be set in
mov RefSelector, dx ; the localvariable
@@:
else
cProc LongPtrAdd,<PUBLIC,FAR>,<si,di>
parmD long_ptr
parmD delta
localV DscBuf,DSC_LEN
cBegin
endif
mov bx,word ptr long_ptr[2]
lea di, DscBuf
smov es, ss
DPMICALL 000Bh ; Pick up old descriptor
mov ax,word ptr long_ptr[0] ; get the pointer into SI:AX
and ax,0FFF0h
mov si, DscBuf.dsc_lbase ; DX:SI gets old base
mov dl, DscBuf.dsc_mbase
mov dh, DscBuf.dsc_hbase
add si, ax ; Add in old pointer offset
adc dx, 0
mov cx, word ptr delta[2] ; add the segment and MSW
test cx, 0FF00h ; bigger than 16Meg?
ifdef WOW
jz @F
test flBaseSetting, LPTRADDWOW_SETBASE
jnz lptr_mustset
jmp short lpa_too_big
@@:
else
jnz short lpa_too_big
endif
add si, word ptr delta[0] ; add the offset and LSW
adc dx, cx
ifdef WOW
lptr_mustset:
endif
mov cx, 1 ; Calculate # selectors now in array
lsl ecx, dword ptr long_ptr[2]
jnz short trash
Limit_to_Selectors ecx
trash:
ifdef WOW
test flBaseSetting, LPTRADDWOW_SETBASE
jz lptr_dontset
cmp RefSelector, 0
jz @F
mov bx, RefSelector ; get the actual selector to be set
mov word ptr long_ptr[2], bx
@@:
endif
mov DscBuf.dsc_lbase, si ; Put new base back in descriptor
mov DscBuf.dsc_mbase, dl
mov DscBuf.dsc_hbase, dh
call fill_in_selector_array
ifdef WOW
lptr_dontset:
test word ptr delta[2], 0ff00h
jz @F
mov cx, word ptr delta[2]
jmps lpa_too_big
@@:
endif
mov dx,word ptr long_ptr[2]
mov ax,word ptr long_ptr[0]
and ax, 0Fh
jnc short lpa_exit
lpa_too_big:
xor ax,ax
xor dx,dx
lpa_exit:
smov es,0
cEnd
;-----------------------------------------------------------------------;
; SetSelectorBase
;
; Sets the base and limit of the given selector.
;
; Entry:
; parmW selector
; parmD selbase
;
; Returns:
; AX = selector
;
; Error Returns:
; AX = 0
;
; History:
; Tue 23-May-1989 21:10:29 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc SetSelectorBase,<PUBLIC,FAR>
parmW selector
parmD selbase
cBegin
push bx
push cx
push dx
mov cx, selbase.hi
mov dx, selbase.lo
mov bx, selector
ifdef WOW
DPMICALL 0007h ; Set Segment Base Address
else
push ds
mov ds, gdtdsc
push bx
and bl, not 7
mov ds:[bx].dsc_lbase, dx
mov ds:[bx].dsc_mbase, cl
mov ds:[bx].dsc_hbase, ch
pop bx
pop ds
endif; WOW
pop dx
pop cx
pop bx
mov ax,selector
cEnd
;-----------------------------------------------------------------------;
; GetSelectorLimit
;
; Sets the limit of the given selector.
;
; Entry:
; parmW selector
;
; Returns:
; DX:AX = limit of selector
;
; Registers Destroyed:
;
; History:
; Tue 23-May-1989 21:10:29 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc GetSelectorLimit,<PUBLIC,FAR>
parmW selector
cBegin
xor eax, eax ; In case lsl fails
lsl eax, dword ptr selector
mov edx, eax
shr edx, 16
cEnd
;-----------------------------------------------------------------------;
; SetSelectorLimit
;
; Sets the limit of the given selector.
;
; Entry:
; parmW selector
; parmD sellimit
;
; Returns:
; AX = 0 success
;
; Registers Destroyed:
;
; History:
; Tue 23-May-1989 21:10:29 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc SetSelectorLimit,<PUBLIC,FAR>
parmW selector
parmD sellimit
localV DscBuf,DSC_LEN
cBegin
ifdef WOW
mov bx, selector
mov dx, word ptr sellimit[0]
mov cx, word ptr sellimit[2]
DPMICALL 0008h
else
push es
push di
mov bx,selector
push ds
mov ds, gdtdsc
and bl, not 7
mov ax,sellimit.lo
mov [bx].dsc_limit,ax
mov ax,sellimit.hi
and al,0Fh ; AND out flags
and [bx].dsc_hlimit,0F0h ; AND out hi limit
or [bx].dsc_hlimit,al
pop ds
pop di
pop es
endif; WOW
xor ax,ax ; for now always return success
cEnd
;-----------------------------------------------------------------------;
; SelectorAccessRights
;
; Sets the access and other bytes of the given selector.
;
; Entry:
; parmW selector
; parmW getsetflag
; parmD selrights
;
; Returns:
; AX = 0 success
;
; Registers Destroyed:
;
; History:
; Tue 23-May-1989 21:10:29 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc SelectorAccessRights,<PUBLIC,FAR>
parmW selector
parmW getsetflag
parmW selrights
cBegin
mov bx, selector
lar eax, ebx ; Get current access rights
shr eax, 8 ; in AX
cmp getsetflag,0
jnz short sar_set
and ax, 0D01Eh ; Hide bits they can't play with
jmps sar_exit
sar_set:
mov cx, selrights
and cx, 0D01Eh ; Zap bits they can't set and
and ax, NOT 0D01Eh ; get them from existing access rights
or cx, ax
DPMICALL 0009h ; Set new access rights
xor ax,ax ; for now always return success
sar_exit:
cEnd
cProc SetKernelCSDwordProc,<PUBLIC,NEAR>,<ax,bx,ds>
parmw addr
parmw hiword
parmw loword
cBegin
SetKernelDS
mov ds, MyCSAlias
UnSetKernelDS
mov bx, addr
mov ax, loword
mov [bx], ax
mov ax, hiword
mov [bx+2], ax
cEnd
cProc GetKernelDataSeg,<PUBLIC,NEAR>
cBegin nogen
mov ax, cs:MyCSDS
ret
cEnd nogen
cProc SetKernelDSProc,<PUBLIC,NEAR>
cBegin nogen
mov ds, cs:MyCSDS
ret
cEnd nogen
cProc SetKernelESProc,<PUBLIC,NEAR>
cBegin nogen
mov es, cs:MyCSDS
ret
cEnd nogen
assumes ds, nothing
assumes es, nothing
cProc PreallocArena,<PUBLIC,NEAR>
cBegin nogen
push ds
push eax
cCall alloc_arena_header,<eax>
call SetKernelDSProc
ReSetKernelDS
mov temp_arena, eax
or eax, eax ; Set flags for caller
pop eax
pop ds
UnSetKernelDS
ret
cEnd nogen
assumes ds, nothing
assumes es, nothing
cProc alloc_arena_header,<PUBLIC,NEAR>,<es>
parmD Address
localV DscBuf,DSC_LEN
cBegin
SetKernelDS es
push ebx
xor eax, eax
cmp temp_arena, eax ; Have one waiting?
je short aah_look ; no, get one
xchg temp_arena, eax ; Use the waiting selector
jmp aah_found
aah_look:
cmp FreeArenaCount, 0
jnz aah_ok
; Out of arenas, try to get
push ecx
push si
push di
xor bx, bx
mov cx, ARENA_INCR_BYTES
DPMICALL 0501h
jc short aah_no_memory
if 0
push si
push di
mov ax, 0600h ; Page lock it
mov di, ARENA_INCR_BYTES
xor si, si
int 31h
pop di
pop si
jnc short aah_got_memory
give_it_back:
DPMICALL 0502h ; No good, give it back
else
jmp short aah_got_memory
endif
aah_no_memory:
pop di
pop si
pop ecx
xor eax, eax ; We are REALLY out of arenas!
jmp aah_exit
aah_got_memory:
shl ebx, 16
mov bx, cx ; Address of our new arenas
cCall get_arena_pointer32,<ds>; Arena of burgermaster
sub ebx, [eax].pga_address ; Above present arenas?
lea ecx, [ebx+ARENA_INCR_BYTES+0FFFh]
shr ecx, 12 ; #pages selector must cover
dec ecx ; limit with page granularity
cmp ecx, HighestArena
jbe short aah_limitOK
mov HighestArena, ecx
push es
push bx
mov bx, ds
lea di, DscBuf
smov es, ss
DPMICALL 000Bh ; Get DS descriptor
mov [DscBuf].dsc_limit, cx ; Set the new limit in the descriptor
shr ecx, 16
and cl, 0fh ; hlimit bits
and [DscBuf].dsc_hlimit, not 0fh; Zap old ones
or cl, DSC_GRANULARITY ; Granularity bit
or [DscBuf].dsc_hlimit, cl
DPMICALL 000Ch ; Set new limit
pop bx
pop es
aah_limitOK:
mov cx, ARENA_INCR_BYTES
shr cx, 5 ; # arenas to add
aah_loop:
cCall free_arena_header,<ebx> ; Free up all our new arenas
add ebx, size GlobalArena32
loop aah_loop
pop di
pop si
pop ecx
aah_ok:
mov eax, FreeArenaList
if KDEBUG
inc eax
jnz short aah_ook
int 3
int 3
aah_ook:
dec eax
endif
mov ebx, ds:[eax.pga_next]
mov FreeArenaList, ebx
dec FreeArenaCount
aah_found:
mov ebx, Address
mov ds:[eax.pga_address], ebx
mov dword ptr ds:[eax.pga_count], 0
aah_exit:
pop ebx
cEnd
assumes ds, nothing
assumes es, nothing
cProc free_arena_header,<PUBLIC,NEAR>,<es>
parmD arena
cBegin
push eax
push ebx
SetKernelDS es
CheckDS
mov ebx, arena
mov eax, FreeArenaList
mov ds:[ebx.pga_next], eax
mov FreeArenaList, ebx
inc FreeArenaCount
pop ebx
pop eax
cEnd
assumes ds, nothing
assumes es, nothing
cProc FarAssociateSelector32,<PUBLIC,FAR>
parmW Selector
parmD ArenaPtr
cBegin
cCall AssociateSelector32,<Selector,ArenaPtr>
cEnd
cProc AssociateSelector32,<PUBLIC,NEAR>,<ds,es>
parmW Selector
parmD ArenaPtr
cBegin
CheckDS
SetKernelDS es
push eax
push ebx
movzx ebx, Selector
and bl, NOT SEG_RING_MASK
shr bx, 1
if KDEBUG
cmp bx, SelTableLen
jb short as_ok
INT3_NEVER
INT3_NEVER
as_ok:
endif
add ebx, SelTableStart
mov eax, ArenaPtr
mov ds:[ebx], eax
pop ebx
pop eax
cEnd
assumes ds, nothing
assumes es, nothing
cProc far_get_arena_pointer32,<PUBLIC,FAR>
parmW Selector
cBegin
cCall get_arena_pointer32,<Selector>
cEnd
cProc get_arena_pointer32,<PUBLIC,NEAR>
parmW Selector
cBegin
CheckDS
push es
SetKernelDS es
push ebx
movzx ebx, Selector
and bl, not SEG_RING_MASK
shr bx, 1
cmp bx, SelTableLen
jb short gap_ok
xor eax, eax ; Bogus, return null
jmps gap_exit
gap_ok:
add ebx, SelTableStart
mov eax, ds:[ebx]
if KDEBUG
or eax, eax
jz short gap_exit ; Bogus, return null
push si
mov si, ds:[eax].pga_handle
sel_check si
or si, si
jz short gap32_match ; Boot time...
sub ebx, SelTableStart
shl bx, 1
cmp bx, si
je short gap32_match
xor eax, eax ; put back in 5 feb 90, alias avoided
;;; xor eax, eax ; Removed - may be an alias!
gap32_match:
pop si
endif
gap_exit:
pop ebx
pop es
cEnd
assumes ds, nothing
assumes es, nothing
cProc FarGetOwner,<PUBLIC,FAR>,<bx>
parmW Selector
cBegin
cCall GetOwner,<Selector>
cEnd
cProc GetOwner,<PUBLIC,NEAR>,<bx,es>
parmW Selector
cBegin
GENTER32
;;;push eax ;; why??? ax gets trashed anyway.
cCall get_arena_pointer32,<Selector>
or eax, eax
jz go_solong
mov bx, ds:[eax].pga_owner
;;;pop eax
mov ax, bx
go_solong:
GLEAVE32
cEnd
assumes ds, nothing
assumes es, nothing
cProc FarSetOwner,<PUBLIC,FAR>
parmW Selector
parmW owner
cBegin
cCall SetOwner,<Selector,owner>
cEnd
assumes ds, nothing
assumes es, nothing
cProc SetOwner,<PUBLIC,NEAR>,<ds,es>
parmW Selector
parmW owner
cBegin
GENTER32 ; Assume ds not set!
push eax
cCall get_arena_pointer32,<Selector>
push owner
pop ds:[eax].pga_owner
pop eax
GLEAVE32
cEnd
assumes ds, nothing
assumes es, nothing
cProc PageLockLinear,<PUBLIC,NEAR>,<ax,bx,cx,si,di>
parmD address
parmD len
cBegin
mov bx, word ptr address+2
mov cx, word ptr address
mov si, word ptr len+2
mov di, word ptr len
DPMICALL 0600h
; Let it return with carry flag from int 31h
cEnd
assumes ds, nothing
assumes es, nothing
cProc FarValidatePointer,<PUBLIC,FAR>
parmD lpointer
cBegin
cCall ValidatePointer,<lpointer>
cEnd
cProc ValidatePointer,<PUBLIC,NEAR>
parmD lpointer
cBegin
lar ax, lpointer.sel
jnz short bad_p ; Really bad selector
test ah, DSC_PRESENT ; Must be present
jz short bad_p
lsl eax, dword ptr lpointer.sel
movzx ecx, lpointer.off
cmp eax, ecx ; Is the offset valid?
jae short good_p
bad_p:
xor ax, ax
jmps vp_done
good_p:
mov ax, 1
vp_done:
cEnd
assumes ds, nothing
assumes es, nothing
OneParaBytes dw 10h
cProc SelToSeg,<PUBLIC,NEAR>,<dx>
parmW selector
cBegin
cCall get_physical_address,<selector>
div cs:OneParaBytes ; Smaller than rotates
cEnd
cProc SegToSelector,<PUBLIC,NEAR>,<bx,cx,di,ds>
parmW smegma
cBegin
mov bx, smegma
DPMICALL 0002h ; Make win386 do it
cEnd
;-----------------------------------------------------------------------;
; set_discarded_sel_owner
;
; Sets the owner of a selector that points to a discarded object,
; which lives in the limit field.
;
; Entry:
; BX = selector to mark
; ES = owner
;
; Returns:
; nothing
;
; Registers Destroyed:
; BX
;
; History:
; Sun 03-Dec-1989 21:02:24 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc set_discarded_sel_owner,<PUBLIC,FAR>
localV DscBuf,DSC_LEN
cBegin
push cx
push di
mov cx, es
if KDEBUG
ifdef WOW
lea di, DscBuf
smov es, ss
DPMICALL 000Bh
push cx
xor cx,cx ; For debug build write 0 to LDT
mov DscBuf.dsc_owner, cx
DPMICALL 000Ch
pop cx
endif
endif
push ds
mov ds, gdtdsc
push bx
and bl, not 7
mov [bx].dsc_owner, cx
pop bx
pop ds
push ds
SetKernelDS
mov ds, pGlobalHeap
UnSetKernelDS
cCall AssociateSelector32,<bx,0,cx> ; And save in selector table
pop ds
mov es, cx
pop di
pop cx
cEnd
;-----------------------------------------------------------------------;
; SetResourceOwner
;
; Sets the owner of a selector that points to a not present resource
;
; Entry:
;
; Returns:
; nothing
;
; Registers Destroyed:
;
; History:
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc SetResourceOwner,<PUBLIC,NEAR>,<ax,bx,cx,di,ds,es>
parmW selector
parmW owner
parmW selCount
localV DscBuf,DSC_LEN
cBegin
mov bx, selector
mov cx, owner
ifdef WOW
smov es, ss
lea di, DscBuf
DPMICALL 000Bh ; Get current descriptor
mov DscBuf.dsc_owner, cx
mov word ptr DscBuf.dsc_access, (DSC_DISCARDABLE SHL 8) + DSC_DATA
mov cx,selCount
mov DscBuf.dsc_hbase, cl ; Save number of selectors here
DPMICALL 000Ch ; Set it with new owner
else
push ds
mov ds, gdtdsc
push bx
and bl, not 7
mov [bx].dsc_owner, cx
mov word ptr [bx].dsc_access, (DSC_DISCARDABLE SHL 8) + DSC_DATA
mov cx, selCount
mov [bx].dsc_hbase, cl ; Save number of selectors here
pop bx
pop ds
endif; WOW
SetKernelDS
mov ds, pGlobalHeap
UnSetKernelDS
cCall AssociateSelector32,<bx,0,owner> ; And save in selector table
cEnd
cProc GetAccessWord,<PUBLIC,NEAR>
parmW selector
cBegin
lar eax, dword ptr selector ; 386 or better, can use LAR
shr eax, 8
cEnd
;-----------------------------------------------------------------------;
; DPMIProc
;
; Called NEAR by the DPMICALL macro -
; this is better than intercepting int 31h
;
; By sheer fluke, all intercepts return with
; Carry clear ie no error.
;
;-----------------------------------------------------------------------;
cProc DPMIProc,<PUBLIC,NEAR>
cBegin nogen
if 0
cmp ax,WOW_DPMIFUNC_0C
jne @f
INT3_TEST
push ds
SetKernelDS ds
cmp high0c,cx
ja popit
mov high0c,cx
popit:
pop ds
@@:
endif
ifdef WOW
cmp ax,501h
jne normal
push eax
push edx
shl ebx,16 ; ebx = bx:cx
mov bx,cx
xor eax,eax
mov ecx,PAGE_READWRITE
mov edx,MEM_COMMIT_RESERVE
cCall VirtualAlloc,<eax,ebx,edx,ecx>
mov bx,dx ; DPMI returns BX:CX - linear Address
mov cx,ax
mov si,dx ; FAKE dpmi "handle" - linear Address
mov di,ax
or ax,dx ; NULL is Error
pop edx
pop eax
clc
jnz @f ; OK Jump
stc ; else set error
@@:
ret
normal:
endif ; WOW
or ah, ah
jz @F
ife KDEBUG
ifdef WOW_x86
;
; If it is the wow set selector call we will just set the selector
; directly using int 2a (only for the single selector case)
;
cmp ax,WOW_DPMIFUNC_0C
jne CallServer
cmp cx,1
jne CallServer
call WowSetSelector
jc CallServer
ret
endif
endif
CallServer:
ifndef WOW
int 31h ; Nope, call DPMI server
ret
else
test word ptr [prevInt31Proc + 2],0FFFFh
jz dp30
dp20:
pushf
call [prevInt31Proc]
ret
endif
@@:
ifdef WOW
cmp gdtdsc, 0 ; Can we party?
jz CallServer ; Nope
endif
push ds
mov ds, gdtdsc
ifdef WOW
or al, al
jnz @F
mov ax, WOW_DPMIFUNC_00
pop ds
jmp CallServer
@@:
endif
cmp al, 0Bh
jne short @F
push si ; Get Descriptor - used very often!
mov si, bx
and si, not 7
MovsDsc
lea di, [di-DSC_LEN] ; Restore DI
pop si
pop ds
ret
ifndef WOW
@@:
cmp al, 0Ch
jne @F
push bx ; Set Descriptor
and bl, not 7
mov ax, es:[di] ; This looks slow but it isn't...
mov ds:[bx], ax
mov ax, es:[di][2]
mov ds:[bx][2], ax
mov ax, es:[di][4]
mov ds:[bx][4], ax
mov ax, es:[di][6]
mov ds:[bx][6], ax
pop bx
pop ds
ret
@@:
cmp al, 07h ; Set Segment Base Address
jne @F
push bx
and bl, not 7
mov ds:[bx].dsc_lbase, dx
mov ds:[bx].dsc_mbase, cl
mov ds:[bx].dsc_hbase, ch
pop bx
pop ds
ret
endif
@@:
cmp al, 06h ; Get Segment Base Address
jne @F
push bx
and bl, not 7
mov dx, ds:[bx].dsc_lbase
mov cl, ds:[bx].dsc_mbase
mov ch, ds:[bx].dsc_hbase
pop bx
pop ds
ret
ifndef WOW
@@:
cmp al, 09h ; Set Descriptor Access Rights
jne @F
push bx
and bl, not 7
mov word ptr ds:[bx].dsc_access, cx
pop bx
pop ds
ret
endif
@@:
pop ds
jmp CallServer
ifdef WOW
dp30: int 31h
ret
endif
cEnd nogen
ife KDEBUG
ifdef WOW_x86
;-----------------------------------------------------------------------;
; WowSetSelector
;
; Entry
; BX contains selector #
;
; Exit
; CY clear for success
;
;
;-----------------------------------------------------------------------;
cProc WowSetSelector,<PUBLIC,NEAR>
cBegin nogen
push ds
push es
push eax
push ecx
push edx
push ebx
push ebp
SetKernelDS ds
;
; Check to see if we can do this
;
mov edx, FlatAddressArray
or edx, edx
stc
jz wss50
;
; put the base of the selector in the flat address array
;
mov es,gdtdsc
and bx, NOT SEG_RING
mov ax, FLAT_SEL
mov ds, ax
mov ah, es:[bx].dsc_hbase
mov al, es:[bx].dsc_mbase
shl eax,16
mov ax, es:[bx].dsc_lbase
movzx ecx,bx
shr ecx,1 ; dword index from selector index
add ecx, edx ; point to proper spot in array
mov [ecx], eax
;
; Form the limit of the selector
;
movzx dx, byte ptr es:[bx].dsc_hlimit
and dx,0fh ; remove gran etc.
shl edx, 16
mov dx, es:[bx].dsc_limit
;
; Adjust for granularity
;
test es:[bx].dsc_hlimit, DSC_GRANULARITY
jz wss10
shl edx,12
or edx,0fffh
;
; Verify that the base/limit combination is allowed
; duplicate of code in dpmi32/i386/dpmi386.c <DpmiSetDescriptorEntry>
;
wss10: cmp edx,07ffeffffh
ja wss30
mov ecx,eax
add ecx,edx
cmp ecx,07ffeffffh
jb wss40
;
; Limit is too high, so adjust it downward
;
wss30: mov edx,07ffeffffh
sub edx,eax
sub edx,0fffh
;
; fix for granularity
;
test es:[bx].dsc_hlimit, DSC_GRANULARITY
jz wss35
shr edx,12
;
; store the new limit in the descriptor table
;
wss35: mov es:[bx].dsc_limit,dx
shr edx,16
movzx ax,es:[bx].dsc_hlimit
and ax,0f0h ; mask for gran etc
and dx,00fh ; mask for limit bits
or dx,ax ; put back gran etc
mov es:[bx].dsc_hlimit,dl
;
; Call the system to set the selector
;
; int 2a special case for wow:
;
; eax = 0xf0f0f0f1
; ebp = 0xf0f0f0f1
; ebx = selector
; ecx = first dword of the descriptor (LODWORD)
; edx = second dword of the descriptor (HIDWORD)
wss40: mov eax, 0f0f0f0f1h
mov ebp, 0f0f0f0f1h
mov ecx, dword ptr es:[bx]
mov edx, dword ptr es:[bx+4]
movzx ebx,bx
or bl, 3
int 02ah
wss50:
pop ebp
pop ebx
pop edx
pop ecx
pop eax
pop es
pop ds
ret
cEnd nogen
endif ; WOW_x86
endif
ifdef WOW
;-----------------------------------------------------------------------------
; Grab the selector 0x47 so that we dont need to special case the biosdata
; selector (0x40) while converting seg:off address to flat 32bit address
;
; This, however should not be part of Krnl286 heap.
;
; - Nanduri Ramakrishna
;-----------------------------------------------------------------------------
cProc AllocSelector_0x47,<PUBLIC,FAR>, <ax, bx, cx, ds>
cBegin
; alloc the specific selector
mov bx, 047h
DPMICALL 0dh
jc as47_exit
; initialize the LDT
and bx, not SEG_RING
mov ds, gdtdsc
mov [bx].dsc_limit, 00h ; = 1 byte
mov [bx].dsc_lbase, 0400h
mov [bx].dsc_mbase, 00h
mov [bx].dsc_hbase, 00h
mov ax, DSC_DATA+DSC_PRESENT
and ah, not 0Fh ; Zero limit 19:16
mov word ptr [bx].dsc_access, ax
; set the LDT
mov cx,1
mov bx, 047h
DPMICALL WOW_DPMIFUNC_0C
as47_exit:
cEnd
endif
sEnd CODE
sBegin NRESCODE
assumes CS,NRESCODE
assumes DS,NOTHING
assumes ES,NOTHING
; All the code below is to support DIB.DRV and WING.
cProc get_sel_flags,<PUBLIC,FAR>
parmW selector
cBegin
SetKernelDSNRes
mov ds,pGlobalHeap
cCall far_get_arena_pointer32,<selector>
or eax,eax
jz gsf5
movzx ax, byte ptr ds:[eax].pga_flags
gsf5:
xor dx,dx
cEnd
cProc set_sel_for_dib,<PUBLIC,FAR>
parmW selector
parmW flags
parmW addressLo
parmW addressHi
parmW csel
cBegin
SetKernelDSNRes
push ecx
push ebx
push fs
push es
; if the selector has a value of -1, it means we either need to allocate
; or deallocate an array of selectors. If we are allocating, csel will have
; a count of 64k selectors. If csel is 0, we need to deallocate the selector
; array pointed to by address.
cmp selector,-1
jne ssfSetDIB
; see if we are actually deleting the selector array
cmp csel,0
jne ssfAllocSel
; free selector array at addressHi
cCall IFreeSelector,<addressHi>
mov ax,1
mov dx,0
jmp ssf5
ssfAllocSel:
; we need to have the selector array created
cCall AllocSelectorArray,<csel>
mov selector,ax
xor dx,dx
cmp ax,0
je ssf5
; we must set the limits in the selectors. Each selector
; must have a limit in bytes for the remainder of the buffer. If there are
; 3 selectors, the first will be 0x0002ffff, the second 0x0001ffff, the
; third 0x0000ffff.
mov cx,csel
mov bx,selector
ssfSetLimit:
sub cx,1 ; 1 less each time
cCall SetSelectorLimit,<bx,cx,-1>
add bx,DSC_LEN ; advance to the next selector
cmp cx,0 ; see if we have any more selector to set
jne ssfSetLimit
mov dx,addressHi
mov ax,addressLo
push selector
call far_set_physical_address
mov ax,0 ; return the first selector
mov dx,selector
jmp ssf5
ssfSetDIB:
push ds
mov ds,pGlobalHeap
cCall far_get_arena_pointer32,<selector>
or eax,eax
jz ssf5
pop fs
push eax ; save arena ptr
cCall GrowHeapDib,<eax,addressHi,addressLo>
or eax,eax
jnz ssf0
pop eax
xor eax,eax
jmp ssf5
ssf0:
pop esi ; ds:esi is arena ptr
push eax ; save the new arena
xor edi,edi ; ds:edi is global heap info
cCall Free_Object2
mov dx,addressHi
mov ax,addressLo
cCall far_set_physical_address,<selector>
pop eax
push eax
cCall FarAssociateSelector32, <selector, eax>
; now see that the GAH_PHANTOM flag is set in the arena
pop edx
or ds:[edx].pga_flags, GAH_PHANTOM
; Now check if we are operating on a local heap. If so we change the
; LocalNotifyDefault to LocalNotifyDib.
push es
push selector
pop es
xor edi,edi
mov di,word ptr es:[pLocalHeap]
or di,di
jz ssf4 ; Its not a local heap
cmp edi,ds:[edx].pga_size
jae ssf4 ; Its not a local heap
cmp word ptr es:[di].li_sig,LOCALHEAP_SIG ; es:li_sig == LH
jne ssf4
if KDEBUG
cmp word ptr es:[di].li_notify,codeOFFSET LocalNotifyDefault
jne ssf2
cmp word ptr es:[di].li_notify+2,codeBase
je ssf3
ssf2:
krDebugOut <DEB_TRACE OR DEB_KrMemMan>, "Set_Sel_For_Dib: App has hooked LocalNotifyDefault"
ssf3:
endif
mov word ptr es:[di].li_notify,codeOFFSET LocalNotifyDib
mov word ptr es:[di].li_notify+2,codeBase
ssf4:
pop es
mov eax,1
ssf5:
pop es
pop fs
pop ebx
pop ecx
cEnd
cProc RestoreDib,<PUBLIC,FAR>
parmW selector
parmW flags
parmD address
localw hNewDib
localw cSel
localD DibSize
localD NewArena
localD OldArena
cBegin
SetKernelDSNRes
push ecx
push ebx
push fs
push es
;; Allocate a new global block
xor eax, eax ; In case lsl fails
lsl eax, dword ptr selector
or eax,eax
jz rd_fail
inc eax
mov DibSize,eax
cCall IGlobalAlloc,<flags,eax>
or ax,ax
jz rd_fail
mov hNewDib,ax
push ds
pop fs
mov ds,pGlobalHeap
cCall far_get_arena_pointer32,<selector>
mov OldArena,eax
or eax,eax
jz rd2
movzx ax, word ptr [eax].pga_selcount
mov cSel,ax
cCall far_get_arena_pointer32,<hNewDib>
or eax,eax
jnz rd5
rd2:
cCall IGlobalFree,<hNewDib>
jmp rd_fail
rd5:
mov NewArena,eax
cld
push ds
mov ecx,DibSize
mov ax, hNewDib
or ax, 1
mov es, ax
mov ds, selector
xor esi, esi
xor edi, edi
mov eax,ecx
shr ecx,2 ; dwords
rep movs dword ptr es:[edi], dword ptr ds:[esi]
and eax,3
mov ecx,eax
rep movs byte ptr es:[edi], byte ptr ds:[esi]
pop ds
;; free the selector that came back with GlobalAlloc
xor eax,eax
cCall farAssociateSelector32, <hNewDib,eax>
cCall IFreeSelector, <hNewDib>
;; Map the original selector to this new block
mov eax,NewArena
mov edx,[eax].pga_address
mov ebx,[eax].pga_size
dec ebx
mov ax,dx
shr edx,16
cCall far_set_physical_address,<selector>
mov eax,NewArena
cCall farAssociateSelector32, <selector,eax>
mov cx,cSel
mov dx,selector
rd13:
dec cx
push bx
push cx
push dx
cCall SetSelectorLimit,<dx,cx,bx>
pop dx
pop cx
pop bx
add dx,DSC_LEN ; advance to the next selector
jcxz rd14
jmp short rd13
rd14:
;; Fix some values in the new arena from old arena
mov eax,NewArena
mov ebx,OldArena
mov ecx,dword ptr [ebx].pga_handle
mov dword ptr [eax].pga_handle,ecx
mov ecx,dword ptr [ebx].pga_count
dec ecx
mov dword ptr [eax].pga_count,ecx
and byte ptr [eax].pga_flags, NOT GAH_PHANTOM
;; Free the dib
cCall FreeHeapDib, <OldArena>
; Now check if we are operating on a local heap. If we so change the
; LocalNotifyDiB to LocalNotify.
mov edx, NewArena
push selector
pop es
xor edi,edi
mov di,word ptr es:[pLocalHeap]
or di,di
jz rd_15
cmp edi,ds:[edx].pga_size
jae rd_15 ; Its not a local heap
cmp word ptr es:[di].li_sig,LOCALHEAP_SIG ; es:li_sig == LH
jne rd_15
mov word ptr es:[di].li_notify,codeOFFSET LocalNotifyDefault
mov word ptr es:[di].li_notify+2,codeBase
rd_15:
mov eax,1
jmp short rd_exit
rd_fail:
xor eax,eax
rd_exit:
pop es
pop fs
pop ebx
pop ecx
cEnd
cProc DibRealloc,<PUBLIC,FAR>
parmW Selector
parmW NewSize
cBegin
SetKernelDSNRes
push ebx
mov ds,pGlobalHeap
cCall far_get_arena_pointer32,<Selector>
or eax,eax
jz dr20
movzx ebx,NewSize
mov ds:[eax].pga_size,bx
add ebx,ds:[eax].pga_address
mov eax,ds:[eax].pga_next
mov dword ptr ds:[eax].pga_address,ebx
mov bx,NewSize
dec bx
cCall SetSelectorLimit,<Selector,0,bx>
mov ax,Selector
jmp short drexit
dr20:
xor ax,ax
drexit:
pop ebx
cEnd
sEnd NRESCODE
end
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld a, 30
ldff(00), a
ld a, 01
ldff(4d), a
stop, 00
ld b, 97
call lwaitly_b
ld a, b1
ldff(40), a
ld a, 07
ldff(4b), a
ld c, 41
ld a, 99
ldff(45), a
ld a, 40
ldff(c), a
ld a, 02
ldff(ff), a
ei
.text@1000
lstatint:
nop
.text@10d8
ld a, ff
ldff(4a), a
.text@1159
ldff a, (c)
and a, 03
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
SECTION .text
GLOBAL square_p434
square_p434:
sub rsp, 0x440 ; last 0x30 (6) for Caller - save regs
mov [ rsp + 0x410 ], rbx; saving to stack
mov [ rsp + 0x418 ], rbp; saving to stack
mov [ rsp + 0x420 ], r12; saving to stack
mov [ rsp + 0x428 ], r13; saving to stack
mov [ rsp + 0x430 ], r14; saving to stack
mov [ rsp + 0x438 ], r15; saving to stack
mov rax, [ rsi + 0x0 ]; load m64 x7 to register64
mov rdx, rax; x7 to rdx
mulx rax, r10, [ rsi + 0x0 ]; x21, x20<- x7 * arg1[0]
mov r11, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r11; 0xffffffffffffffff, swapping with x7, which is currently in rdx
mulx rbx, rbp, r10; x48, x47<- x20 * 0xffffffffffffffff
xchg rdx, r11; x7, swapping with 0xffffffffffffffff, which is currently in rdx
mulx r12, r13, [ rsi + 0x8 ]; x19, x18<- x7 * arg1[1]
test al, al
adox rbp, r10
mov rbp, [ rsi + 0x8 ]; load m64 x1 to register64
xchg rdx, r11; 0xffffffffffffffff, swapping with x7, which is currently in rdx
mulx r14, r15, r10; x46, x45<- x20 * 0xffffffffffffffff
xchg rdx, rbp; x1, swapping with 0xffffffffffffffff, which is currently in rdx
mulx rcx, r8, [ rsi + 0x0 ]; x91, x90<- x1 * arg1[0]
adcx r13, rax
setc r9b; spill CF x23 to reg (r9)
clc;
adcx r15, rbx
adox r15, r13
setc al; spill CF x50 to reg (rax)
clc;
adcx r8, r15
xchg rdx, r8; x105, swapping with x1, which is currently in rdx
mulx rbx, r13, rbp; x134, x133<- x105 * 0xffffffffffffffff
setc r15b; spill CF x106 to reg (r15)
clc;
adcx r13, rdx
mov r13, rdx; preserving value of x105 into a new reg
mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx.
mov [ rsp + 0x0 ], rdi; spilling out1 to mem
mulx rbp, rdi, r11; x17, x16<- x7 * arg1[2]
seto dl; spill OF x65 to reg (rdx)
mov [ rsp + 0x8 ], rbp; spilling x17 to mem
mov rbp, 0x0 ; moving imm to reg
dec rbp; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r9, r9b
adox r9, rbp; loading flag
adox r12, rdi
mov r9, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r9; 0xffffffffffffffff, swapping with x65, which is currently in rdx
mulx rdi, rbp, r10; x44, x43<- x20 * 0xffffffffffffffff
setc dl; spill CF x149 to reg (rdx)
clc;
mov [ rsp + 0x10 ], rdi; spilling x44 to mem
mov rdi, -0x1 ; moving imm to reg
movzx rax, al
adcx rax, rdi; loading flag
adcx r14, rbp
seto al; spill OF x25 to reg (rax)
inc rdi; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rbp, -0x1 ; moving imm to reg
movzx r9, r9b
adox r9, rbp; loading flag
adox r12, r14
xchg rdx, r8; x1, swapping with x149, which is currently in rdx
mulx r9, r14, [ rsi + 0x8 ]; x89, x88<- x1 * arg1[1]
setc bpl; spill CF x52 to reg (rbp)
clc;
adcx r14, rcx
setc cl; spill CF x93 to reg (rcx)
clc;
mov rdi, -0x1 ; moving imm to reg
movzx r15, r15b
adcx r15, rdi; loading flag
adcx r12, r14
mov r15, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r13; x105, swapping with x1, which is currently in rdx
mulx r14, rdi, r15; x132, x131<- x105 * 0xffffffffffffffff
setc r15b; spill CF x108 to reg (r15)
clc;
adcx rdi, rbx
setc bl; spill CF x136 to reg (rbx)
clc;
mov [ rsp + 0x18 ], r14; spilling x132 to mem
mov r14, -0x1 ; moving imm to reg
movzx r8, r8b
adcx r8, r14; loading flag
adcx r12, rdi
mov r8, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, r10; x20, swapping with x105, which is currently in rdx
mulx rdi, r14, r8; x42, x41<- x20 * 0xfdc1767ae2ffffff
xchg rdx, r11; x7, swapping with x20, which is currently in rdx
mov [ rsp + 0x20 ], r12; spilling x150 to mem
mulx r8, r12, [ rsi + 0x18 ]; x15, x14<- x7 * arg1[3]
mov [ rsp + 0x28 ], rdi; spilling x42 to mem
seto dil; spill OF x67 to reg (rdi)
mov [ rsp + 0x30 ], r8; spilling x15 to mem
mov r8, -0x1 ; moving imm to reg
inc r8; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r8, -0x1 ; moving imm to reg
movzx rax, al
adox rax, r8; loading flag
adox r12, [ rsp + 0x8 ]
seto al; spill OF x27 to reg (rax)
inc r8; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r8, -0x1 ; moving imm to reg
movzx rbp, bpl
adox rbp, r8; loading flag
adox r14, [ rsp + 0x10 ]
xchg rdx, r13; x1, swapping with x7, which is currently in rdx
mulx rbp, r8, [ rsi + 0x10 ]; x87, x86<- x1 * arg1[2]
mov [ rsp + 0x38 ], rbp; spilling x87 to mem
seto bpl; spill OF x54 to reg (rbp)
mov byte [ rsp + 0x40 ], al; spilling byte x27 to mem
mov rax, 0x0 ; moving imm to reg
dec rax; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx rdi, dil
adox rdi, rax; loading flag
adox r12, r14
setc dil; spill CF x151 to reg (rdi)
clc;
movzx rcx, cl
adcx rcx, rax; loading flag
adcx r9, r8
setc cl; spill CF x95 to reg (rcx)
clc;
movzx r15, r15b
adcx r15, rax; loading flag
adcx r12, r9
mov r15, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r10; x105, swapping with x1, which is currently in rdx
mulx r14, r8, r15; x130, x129<- x105 * 0xffffffffffffffff
setc r9b; spill CF x110 to reg (r9)
clc;
movzx rbx, bl
adcx rbx, rax; loading flag
adcx r8, [ rsp + 0x18 ]
mov rbx, rdx; preserving value of x105 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mulx rax, r15, r13; x13, x12<- x7 * arg1[4]
setc dl; spill CF x138 to reg (rdx)
clc;
mov [ rsp + 0x48 ], rax; spilling x13 to mem
mov rax, -0x1 ; moving imm to reg
movzx rdi, dil
adcx rdi, rax; loading flag
adcx r12, r8
setc dil; spill CF x153 to reg (rdi)
movzx r8, byte [ rsp + 0x40 ]; load byte memx27 to register64
clc;
adcx r8, rax; loading flag
adcx r15, [ rsp + 0x30 ]
mov r8, 0x7bc65c783158aea3 ; moving imm to reg
xchg rdx, r8; 0x7bc65c783158aea3, swapping with x138, which is currently in rdx
mov [ rsp + 0x50 ], r12; spilling x152 to mem
mulx rax, r12, r11; x40, x39<- x20 * 0x7bc65c783158aea3
seto dl; spill OF x69 to reg (rdx)
mov [ rsp + 0x58 ], rax; spilling x40 to mem
mov rax, 0x0 ; moving imm to reg
dec rax; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx rbp, bpl
adox rbp, rax; loading flag
adox r12, [ rsp + 0x28 ]
seto bpl; spill OF x56 to reg (rbp)
inc rax; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rax, -0x1 ; moving imm to reg
movzx rdx, dl
adox rdx, rax; loading flag
adox r15, r12
mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx
mulx r12, rax, r10; x85, x84<- x1 * arg1[3]
setc dl; spill CF x29 to reg (rdx)
clc;
mov [ rsp + 0x60 ], r12; spilling x85 to mem
mov r12, -0x1 ; moving imm to reg
movzx rcx, cl
adcx rcx, r12; loading flag
adcx rax, [ rsp + 0x38 ]
seto cl; spill OF x71 to reg (rcx)
inc r12; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r12, -0x1 ; moving imm to reg
movzx r9, r9b
adox r9, r12; loading flag
adox r15, rax
mov r9, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, rbx; x105, swapping with x29, which is currently in rdx
mulx rax, r12, r9; x128, x127<- x105 * 0xfdc1767ae2ffffff
setc r9b; spill CF x97 to reg (r9)
clc;
mov [ rsp + 0x68 ], rax; spilling x128 to mem
mov rax, -0x1 ; moving imm to reg
movzx r8, r8b
adcx r8, rax; loading flag
adcx r14, r12
mov r8, rdx; preserving value of x105 into a new reg
mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx.
mulx r12, rax, r13; x11, x10<- x7 * arg1[5]
seto dl; spill OF x112 to reg (rdx)
mov [ rsp + 0x70 ], r12; spilling x11 to mem
mov r12, 0x0 ; moving imm to reg
dec r12; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx rdi, dil
adox rdi, r12; loading flag
adox r15, r14
mov rdi, 0x6cfc5fd681c52056 ; moving imm to reg
xchg rdx, rdi; 0x6cfc5fd681c52056, swapping with x112, which is currently in rdx
mulx r14, r12, r11; x38, x37<- x20 * 0x6cfc5fd681c52056
setc dl; spill CF x140 to reg (rdx)
clc;
mov [ rsp + 0x78 ], r15; spilling x154 to mem
mov r15, -0x1 ; moving imm to reg
movzx rbx, bl
adcx rbx, r15; loading flag
adcx rax, [ rsp + 0x48 ]
xchg rdx, r10; x1, swapping with x140, which is currently in rdx
mulx rbx, r15, [ rsi + 0x20 ]; x83, x82<- x1 * arg1[4]
mov [ rsp + 0x80 ], rbx; spilling x83 to mem
setc bl; spill CF x31 to reg (rbx)
clc;
mov [ rsp + 0x88 ], r14; spilling x38 to mem
mov r14, -0x1 ; moving imm to reg
movzx rbp, bpl
adcx rbp, r14; loading flag
adcx r12, [ rsp + 0x58 ]
setc bpl; spill CF x58 to reg (rbp)
clc;
movzx rcx, cl
adcx rcx, r14; loading flag
adcx rax, r12
mov rcx, rdx; preserving value of x1 into a new reg
mov rdx, [ rsi + 0x30 ]; saving arg1[6] in rdx.
mulx r13, r12, r13; x9, x8<- x7 * arg1[6]
setc dl; spill CF x73 to reg (rdx)
clc;
movzx r9, r9b
adcx r9, r14; loading flag
adcx r15, [ rsp + 0x60 ]
seto r9b; spill OF x155 to reg (r9)
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r14, -0x1 ; moving imm to reg
movzx rdi, dil
adox rdi, r14; loading flag
adox rax, r15
mov rdi, 0x7bc65c783158aea3 ; moving imm to reg
xchg rdx, rdi; 0x7bc65c783158aea3, swapping with x73, which is currently in rdx
mulx r15, r14, r8; x126, x125<- x105 * 0x7bc65c783158aea3
setc dl; spill CF x99 to reg (rdx)
clc;
mov [ rsp + 0x90 ], r13; spilling x9 to mem
mov r13, -0x1 ; moving imm to reg
movzx r10, r10b
adcx r10, r13; loading flag
adcx r14, [ rsp + 0x68 ]
seto r10b; spill OF x114 to reg (r10)
inc r13; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r13, -0x1 ; moving imm to reg
movzx r9, r9b
adox r9, r13; loading flag
adox rax, r14
seto r9b; spill OF x157 to reg (r9)
inc r13; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r14, -0x1 ; moving imm to reg
movzx rbx, bl
adox rbx, r14; loading flag
adox r12, [ rsp + 0x70 ]
mov rbx, 0x2341f27177344 ; moving imm to reg
xchg rdx, r11; x20, swapping with x99, which is currently in rdx
mulx rdx, r13, rbx; x36, x35<- x20 * 0x2341f27177344
seto r14b; spill OF x33 to reg (r14)
mov rbx, -0x1 ; moving imm to reg
inc rbx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov rbx, -0x1 ; moving imm to reg
movzx rbp, bpl
adox rbp, rbx; loading flag
adox r13, [ rsp + 0x88 ]
seto bpl; spill OF x60 to reg (rbp)
inc rbx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rbx, -0x1 ; moving imm to reg
movzx rdi, dil
adox rdi, rbx; loading flag
adox r12, r13
mov rdi, rdx; preserving value of x36 into a new reg
mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx.
mulx r13, rbx, rcx; x81, x80<- x1 * arg1[5]
setc dl; spill CF x142 to reg (rdx)
clc;
mov [ rsp + 0x98 ], rax; spilling x156 to mem
mov rax, -0x1 ; moving imm to reg
movzx r11, r11b
adcx r11, rax; loading flag
adcx rbx, [ rsp + 0x80 ]
setc r11b; spill CF x101 to reg (r11)
clc;
movzx r10, r10b
adcx r10, rax; loading flag
adcx r12, rbx
mov r10, 0x6cfc5fd681c52056 ; moving imm to reg
xchg rdx, r10; 0x6cfc5fd681c52056, swapping with x142, which is currently in rdx
mulx rbx, rax, r8; x124, x123<- x105 * 0x6cfc5fd681c52056
setc dl; spill CF x116 to reg (rdx)
clc;
mov [ rsp + 0xa0 ], r13; spilling x81 to mem
mov r13, -0x1 ; moving imm to reg
movzx r10, r10b
adcx r10, r13; loading flag
adcx r15, rax
movzx r10, r14b; x34, copying x33 here, cause x33 is needed in a reg for other than x34, namely all: , x34, size: 1
mov rax, [ rsp + 0x90 ]; load m64 x9 to register64
lea r10, [ r10 + rax ]; r8/64 + m8
setc al; spill CF x144 to reg (rax)
clc;
movzx r9, r9b
adcx r9, r13; loading flag
adcx r12, r15
movzx r9, bpl; x61, copying x60 here, cause x60 is needed in a reg for other than x61, namely all: , x61, size: 1
lea r9, [ r9 + rdi ]
mov r14, 0x2341f27177344 ; moving imm to reg
xchg rdx, r14; 0x2341f27177344, swapping with x116, which is currently in rdx
mulx r8, rdi, r8; x122, x121<- x105 * 0x2341f27177344
xchg rdx, rcx; x1, swapping with 0x2341f27177344, which is currently in rdx
mulx rdx, rbp, [ rsi + 0x30 ]; x79, x78<- x1 * arg1[6]
setc r15b; spill CF x159 to reg (r15)
clc;
movzx rax, al
adcx rax, r13; loading flag
adcx rbx, rdi
adox r9, r10
mov rax, [ rsi + 0x10 ]; load m64 x2 to register64
setc r10b; spill CF x146 to reg (r10)
clc;
movzx r11, r11b
adcx r11, r13; loading flag
adcx rbp, [ rsp + 0xa0 ]
setc r11b; spill CF x103 to reg (r11)
clc;
movzx r14, r14b
adcx r14, r13; loading flag
adcx r9, rbp
seto r14b; spill OF x77 to reg (r14)
inc r13; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rdi, -0x1 ; moving imm to reg
movzx r15, r15b
adox r15, rdi; loading flag
adox r9, rbx
movzx r15, r11b; x104, copying x103 here, cause x103 is needed in a reg for other than x104, namely all: , x104, size: 1
lea r15, [ r15 + rdx ]
movzx rdx, r14b; x119, copying x77 here, cause x77 is needed in a reg for other than x119, namely all: , x119--x120, size: 1
adcx rdx, r15
movzx rbx, r10b; x147, copying x146 here, cause x146 is needed in a reg for other than x147, namely all: , x147, size: 1
lea rbx, [ rbx + r8 ]
adox rbx, rdx
mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx
mulx r8, r10, rax; x178, x177<- x2 * arg1[0]
setc dl; spill CF x120 to reg (rdx)
clc;
adcx r10, [ rsp + 0x20 ]
movzx r14, dl; x164, copying x120 here, cause x120 is needed in a reg for other than x164, namely all: , x164, size: 1
adox r14, r13
mov rbp, 0xffffffffffffffff ; moving imm to reg
mov rdx, r10; x192 to rdx
mulx r10, r11, rbp; x221, x220<- x192 * 0xffffffffffffffff
mov r15, rdx; preserving value of x192 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mulx r13, rdi, rax; x176, x175<- x2 * arg1[1]
mov rdx, r15; x192 to rdx
mulx r15, rcx, rbp; x219, x218<- x192 * 0xffffffffffffffff
mov rbp, -0x2 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox r11, rdx
mov r11, [ rsi + 0x18 ]; load m64 x3 to register64
setc bpl; spill CF x193 to reg (rbp)
clc;
adcx rdi, r8
setc r8b; spill CF x180 to reg (r8)
clc;
adcx rcx, r10
setc r10b; spill CF x223 to reg (r10)
clc;
mov [ rsp + 0xa8 ], r14; spilling x164 to mem
mov r14, -0x1 ; moving imm to reg
movzx rbp, bpl
adcx rbp, r14; loading flag
adcx rdi, [ rsp + 0x50 ]
xchg rdx, r11; x3, swapping with x192, which is currently in rdx
mulx rbp, r14, [ rsi + 0x0 ]; x265, x264<- x3 * arg1[0]
adox rcx, rdi
setc dil; spill CF x195 to reg (rdi)
clc;
adcx r14, rcx
mov rcx, 0xffffffffffffffff ; moving imm to reg
xchg rdx, rcx; 0xffffffffffffffff, swapping with x3, which is currently in rdx
mov [ rsp + 0xb0 ], rbx; spilling x162 to mem
mov [ rsp + 0xb8 ], r9; spilling x160 to mem
mulx rbx, r9, r14; x308, x307<- x279 * 0xffffffffffffffff
mov [ rsp + 0xc0 ], r12; spilling x158 to mem
mov [ rsp + 0xc8 ], rbp; spilling x265 to mem
mulx r12, rbp, r14; x306, x305<- x279 * 0xffffffffffffffff
mov byte [ rsp + 0xd0 ], dil; spilling byte x195 to mem
mov [ rsp + 0xd8 ], r15; spilling x219 to mem
mulx rdi, r15, r14; x304, x303<- x279 * 0xffffffffffffffff
setc dl; spill CF x280 to reg (rdx)
clc;
adcx rbp, rbx
mov rbx, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, rbx; 0xfdc1767ae2ffffff, swapping with x280, which is currently in rdx
mov [ rsp + 0xe0 ], rbp; spilling x309 to mem
mov byte [ rsp + 0xe8 ], bl; spilling byte x280 to mem
mulx rbp, rbx, r14; x302, x301<- x279 * 0xfdc1767ae2ffffff
adcx r15, r12
mov r12, 0x7bc65c783158aea3 ; moving imm to reg
xchg rdx, r14; x279, swapping with 0xfdc1767ae2ffffff, which is currently in rdx
mov [ rsp + 0xf0 ], r15; spilling x311 to mem
mulx r14, r15, r12; x300, x299<- x279 * 0x7bc65c783158aea3
adcx rbx, rdi
adcx r15, rbp
mov rdi, 0x2341f27177344 ; moving imm to reg
mulx rbp, r12, rdi; x296, x295<- x279 * 0x2341f27177344
mov rdi, 0x6cfc5fd681c52056 ; moving imm to reg
mov [ rsp + 0xf8 ], r15; spilling x315 to mem
mov [ rsp + 0x100 ], rbx; spilling x313 to mem
mulx r15, rbx, rdi; x298, x297<- x279 * 0x6cfc5fd681c52056
adcx rbx, r14
adcx r12, r15
mov r14, 0x0 ; moving imm to reg
adcx rbp, r14
clc;
adcx r9, rdx
mov rdx, rax; x2 to rdx
mulx rax, r9, [ rsi + 0x10 ]; x174, x173<- x2 * arg1[2]
seto r15b; spill OF x238 to reg (r15)
dec r14; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1))
movzx r8, r8b
adox r8, r14; loading flag
adox r13, r9
mov r8, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r11; x192, swapping with x2, which is currently in rdx
mulx r9, r14, r8; x217, x216<- x192 * 0xffffffffffffffff
setc r8b; spill CF x323 to reg (r8)
clc;
mov rdi, -0x1 ; moving imm to reg
movzx r10, r10b
adcx r10, rdi; loading flag
adcx r14, [ rsp + 0xd8 ]
mov r10, rdx; preserving value of x192 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mov [ rsp + 0x108 ], rbp; spilling x321 to mem
mulx rdi, rbp, rcx; x263, x262<- x3 * arg1[1]
setc dl; spill CF x225 to reg (rdx)
mov [ rsp + 0x110 ], r12; spilling x319 to mem
movzx r12, byte [ rsp + 0xd0 ]; load byte memx195 to register64
clc;
mov [ rsp + 0x118 ], rbx; spilling x317 to mem
mov rbx, -0x1 ; moving imm to reg
adcx r12, rbx; loading flag
adcx r13, [ rsp + 0x78 ]
seto r12b; spill OF x182 to reg (r12)
inc rbx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rbx, -0x1 ; moving imm to reg
movzx r15, r15b
adox r15, rbx; loading flag
adox r13, r14
seto r15b; spill OF x240 to reg (r15)
inc rbx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
adox rbp, [ rsp + 0xc8 ]
setc r14b; spill CF x197 to reg (r14)
movzx rbx, byte [ rsp + 0xe8 ]; load byte memx280 to register64
clc;
mov [ rsp + 0x120 ], rdi; spilling x263 to mem
mov rdi, -0x1 ; moving imm to reg
adcx rbx, rdi; loading flag
adcx r13, rbp
setc bl; spill CF x282 to reg (rbx)
clc;
movzx r8, r8b
adcx r8, rdi; loading flag
adcx r13, [ rsp + 0xe0 ]
mov r8, [ rsi + 0x20 ]; load m64 x4 to register64
mov bpl, dl; preserving value of x225 into a new reg
mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx.
mov byte [ rsp + 0x128 ], bl; spilling byte x282 to mem
mulx rdi, rbx, r8; x352, x351<- x4 * arg1[0]
setc dl; spill CF x325 to reg (rdx)
clc;
adcx rbx, r13
xchg rdx, r11; x2, swapping with x325, which is currently in rdx
mov [ rsp + 0x130 ], rdi; spilling x352 to mem
mulx r13, rdi, [ rsi + 0x18 ]; x172, x171<- x2 * arg1[3]
mov [ rsp + 0x138 ], r13; spilling x172 to mem
mov r13, 0xffffffffffffffff ; moving imm to reg
xchg rdx, rbx; x366, swapping with x2, which is currently in rdx
mov byte [ rsp + 0x140 ], r11b; spilling byte x325 to mem
mov byte [ rsp + 0x148 ], r15b; spilling byte x240 to mem
mulx r11, r15, r13; x395, x394<- x366 * 0xffffffffffffffff
seto r13b; spill OF x267 to reg (r13)
mov [ rsp + 0x150 ], r11; spilling x395 to mem
mov r11, -0x1 ; moving imm to reg
inc r11; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r11, -0x1 ; moving imm to reg
movzx r12, r12b
adox r12, r11; loading flag
adox rax, rdi
mov r12, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, r10; x192, swapping with x366, which is currently in rdx
mulx rdi, r11, r12; x215, x214<- x192 * 0xfdc1767ae2ffffff
setc r12b; spill CF x367 to reg (r12)
clc;
mov [ rsp + 0x158 ], rdi; spilling x215 to mem
mov rdi, -0x1 ; moving imm to reg
movzx rbp, bpl
adcx rbp, rdi; loading flag
adcx r9, r11
setc bpl; spill CF x227 to reg (rbp)
clc;
adcx r15, r10
setc r15b; spill CF x410 to reg (r15)
clc;
movzx r14, r14b
adcx r14, rdi; loading flag
adcx rax, [ rsp + 0x98 ]
setc r14b; spill CF x199 to reg (r14)
movzx r11, byte [ rsp + 0x148 ]; load byte memx240 to register64
clc;
adcx r11, rdi; loading flag
adcx rax, r9
mov r11, rdx; preserving value of x192 into a new reg
mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx.
mulx r9, rdi, rcx; x261, x260<- x3 * arg1[2]
seto dl; spill OF x184 to reg (rdx)
mov [ rsp + 0x160 ], r9; spilling x261 to mem
mov r9, 0x0 ; moving imm to reg
dec r9; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r13, r13b
adox r13, r9; loading flag
adox rdi, [ rsp + 0x120 ]
setc r13b; spill CF x242 to reg (r13)
movzx r9, byte [ rsp + 0x128 ]; load byte memx282 to register64
clc;
mov byte [ rsp + 0x168 ], bpl; spilling byte x227 to mem
mov rbp, -0x1 ; moving imm to reg
adcx r9, rbp; loading flag
adcx rax, rdi
setc r9b; spill CF x284 to reg (r9)
movzx rdi, byte [ rsp + 0x140 ]; load byte memx325 to register64
clc;
adcx rdi, rbp; loading flag
adcx rax, [ rsp + 0xf0 ]
mov dil, dl; preserving value of x184 into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mov byte [ rsp + 0x170 ], r9b; spilling byte x284 to mem
mulx rbp, r9, r8; x350, x349<- x4 * arg1[1]
setc dl; spill CF x327 to reg (rdx)
clc;
adcx r9, [ rsp + 0x130 ]
mov byte [ rsp + 0x178 ], dl; spilling byte x327 to mem
seto dl; spill OF x269 to reg (rdx)
mov [ rsp + 0x180 ], rbp; spilling x350 to mem
mov rbp, 0x0 ; moving imm to reg
dec rbp; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r12, r12b
adox r12, rbp; loading flag
adox rax, r9
mov r12, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r12; 0xffffffffffffffff, swapping with x269, which is currently in rdx
mulx r9, rbp, r10; x393, x392<- x366 * 0xffffffffffffffff
setc dl; spill CF x354 to reg (rdx)
clc;
adcx rbp, [ rsp + 0x150 ]
mov [ rsp + 0x188 ], r9; spilling x393 to mem
setc r9b; spill CF x397 to reg (r9)
clc;
mov byte [ rsp + 0x190 ], dl; spilling byte x354 to mem
mov rdx, -0x1 ; moving imm to reg
movzx r15, r15b
adcx r15, rdx; loading flag
adcx rax, rbp
mov rdx, [ rsi + 0x20 ]; arg1[4] to rdx
mulx r15, rbp, rbx; x170, x169<- x2 * arg1[4]
setc dl; spill CF x412 to reg (rdx)
clc;
mov [ rsp + 0x198 ], rax; spilling x411 to mem
mov rax, -0x1 ; moving imm to reg
movzx rdi, dil
adcx rdi, rax; loading flag
adcx rbp, [ rsp + 0x138 ]
setc dil; spill CF x186 to reg (rdi)
clc;
movzx r14, r14b
adcx r14, rax; loading flag
adcx rbp, [ rsp + 0xc0 ]
mov r14, 0x7bc65c783158aea3 ; moving imm to reg
xchg rdx, r14; 0x7bc65c783158aea3, swapping with x412, which is currently in rdx
mov [ rsp + 0x1a0 ], r15; spilling x170 to mem
mulx rax, r15, r11; x213, x212<- x192 * 0x7bc65c783158aea3
seto dl; spill OF x369 to reg (rdx)
mov [ rsp + 0x1a8 ], rax; spilling x213 to mem
movzx rax, byte [ rsp + 0x168 ]; load byte memx227 to register64
mov byte [ rsp + 0x1b0 ], dil; spilling byte x186 to mem
mov rdi, 0x0 ; moving imm to reg
dec rdi; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rax, rdi; loading flag
adox r15, [ rsp + 0x158 ]
setc al; spill CF x201 to reg (rax)
clc;
movzx r13, r13b
adcx r13, rdi; loading flag
adcx rbp, r15
xchg rdx, rcx; x3, swapping with x369, which is currently in rdx
mulx r13, r15, [ rsi + 0x18 ]; x259, x258<- x3 * arg1[3]
seto dil; spill OF x229 to reg (rdi)
mov [ rsp + 0x1b8 ], r13; spilling x259 to mem
mov r13, 0x0 ; moving imm to reg
dec r13; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r12, r12b
adox r12, r13; loading flag
adox r15, [ rsp + 0x160 ]
setc r12b; spill CF x244 to reg (r12)
movzx r13, byte [ rsp + 0x170 ]; load byte memx284 to register64
clc;
mov byte [ rsp + 0x1c0 ], dil; spilling byte x229 to mem
mov rdi, -0x1 ; moving imm to reg
adcx r13, rdi; loading flag
adcx rbp, r15
mov r13, rdx; preserving value of x3 into a new reg
mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx.
mulx r15, rdi, r8; x348, x347<- x4 * arg1[2]
seto dl; spill OF x271 to reg (rdx)
mov [ rsp + 0x1c8 ], r15; spilling x348 to mem
movzx r15, byte [ rsp + 0x190 ]; load byte memx354 to register64
mov byte [ rsp + 0x1d0 ], r12b; spilling byte x244 to mem
mov r12, -0x1 ; moving imm to reg
inc r12; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r12, -0x1 ; moving imm to reg
adox r15, r12; loading flag
adox rdi, [ rsp + 0x180 ]
seto r15b; spill OF x356 to reg (r15)
movzx r12, byte [ rsp + 0x178 ]; load byte memx327 to register64
mov byte [ rsp + 0x1d8 ], dl; spilling byte x271 to mem
mov rdx, 0x0 ; moving imm to reg
dec rdx; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox r12, rdx; loading flag
adox rbp, [ rsp + 0x100 ]
seto r12b; spill OF x329 to reg (r12)
inc rdx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rdx, -0x1 ; moving imm to reg
movzx rcx, cl
adox rcx, rdx; loading flag
adox rbp, rdi
mov rcx, 0xffffffffffffffff ; moving imm to reg
mov rdx, r10; x366 to rdx
mulx r10, rdi, rcx; x391, x390<- x366 * 0xffffffffffffffff
seto cl; spill OF x371 to reg (rcx)
mov [ rsp + 0x1e0 ], r10; spilling x391 to mem
mov r10, -0x1 ; moving imm to reg
inc r10; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r10, -0x1 ; moving imm to reg
movzx r9, r9b
adox r9, r10; loading flag
adox rdi, [ rsp + 0x188 ]
setc r9b; spill CF x286 to reg (r9)
clc;
movzx r14, r14b
adcx r14, r10; loading flag
adcx rbp, rdi
xchg rdx, rbx; x2, swapping with x366, which is currently in rdx
mulx r14, rdi, [ rsi + 0x28 ]; x168, x167<- x2 * arg1[5]
seto r10b; spill OF x399 to reg (r10)
mov [ rsp + 0x1e8 ], rbp; spilling x413 to mem
movzx rbp, byte [ rsp + 0x1b0 ]; load byte memx186 to register64
mov [ rsp + 0x1f0 ], r14; spilling x168 to mem
mov r14, 0x0 ; moving imm to reg
dec r14; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rbp, r14; loading flag
adox rdi, [ rsp + 0x1a0 ]
mov rbp, 0x6cfc5fd681c52056 ; moving imm to reg
xchg rdx, r11; x192, swapping with x2, which is currently in rdx
mov byte [ rsp + 0x1f8 ], r10b; spilling byte x399 to mem
mulx r14, r10, rbp; x211, x210<- x192 * 0x6cfc5fd681c52056
seto bpl; spill OF x188 to reg (rbp)
mov [ rsp + 0x200 ], r14; spilling x211 to mem
mov r14, -0x1 ; moving imm to reg
inc r14; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r14, -0x1 ; moving imm to reg
movzx rax, al
adox rax, r14; loading flag
adox rdi, [ rsp + 0xb8 ]
setc al; spill CF x414 to reg (rax)
movzx r14, byte [ rsp + 0x1c0 ]; load byte memx229 to register64
clc;
mov byte [ rsp + 0x208 ], bpl; spilling byte x188 to mem
mov rbp, -0x1 ; moving imm to reg
adcx r14, rbp; loading flag
adcx r10, [ rsp + 0x1a8 ]
setc r14b; spill CF x231 to reg (r14)
movzx rbp, byte [ rsp + 0x1d0 ]; load byte memx244 to register64
clc;
mov byte [ rsp + 0x210 ], al; spilling byte x414 to mem
mov rax, -0x1 ; moving imm to reg
adcx rbp, rax; loading flag
adcx rdi, r10
mov rbp, rdx; preserving value of x192 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mulx r10, rax, r13; x257, x256<- x3 * arg1[4]
seto dl; spill OF x203 to reg (rdx)
mov [ rsp + 0x218 ], r10; spilling x257 to mem
movzx r10, byte [ rsp + 0x1d8 ]; load byte memx271 to register64
mov byte [ rsp + 0x220 ], r14b; spilling byte x231 to mem
mov r14, -0x1 ; moving imm to reg
inc r14; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov r14, -0x1 ; moving imm to reg
adox r10, r14; loading flag
adox rax, [ rsp + 0x1b8 ]
seto r10b; spill OF x273 to reg (r10)
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r14, -0x1 ; moving imm to reg
movzx r9, r9b
adox r9, r14; loading flag
adox rdi, rax
xchg rdx, r8; x4, swapping with x203, which is currently in rdx
mulx r9, rax, [ rsi + 0x18 ]; x346, x345<- x4 * arg1[3]
seto r14b; spill OF x288 to reg (r14)
mov [ rsp + 0x228 ], r9; spilling x346 to mem
mov r9, 0x0 ; moving imm to reg
dec r9; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r15, r15b
adox r15, r9; loading flag
adox rax, [ rsp + 0x1c8 ]
seto r15b; spill OF x358 to reg (r15)
inc r9; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r9, -0x1 ; moving imm to reg
movzx r12, r12b
adox r12, r9; loading flag
adox rdi, [ rsp + 0xf8 ]
setc r12b; spill CF x246 to reg (r12)
clc;
movzx rcx, cl
adcx rcx, r9; loading flag
adcx rdi, rax
mov rcx, 0x2341f27177344 ; moving imm to reg
xchg rdx, rcx; 0x2341f27177344, swapping with x4, which is currently in rdx
mulx rbp, rax, rbp; x209, x208<- x192 * 0x2341f27177344
mov r9, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, rbx; x366, swapping with 0x2341f27177344, which is currently in rdx
mov [ rsp + 0x230 ], rbp; spilling x209 to mem
mulx rbx, rbp, r9; x389, x388<- x366 * 0xfdc1767ae2ffffff
mov r9, rdx; preserving value of x366 into a new reg
mov rdx, [ rsi + 0x30 ]; saving arg1[6] in rdx.
mov [ rsp + 0x238 ], rbx; spilling x389 to mem
mulx r11, rbx, r11; x166, x165<- x2 * arg1[6]
seto dl; spill OF x331 to reg (rdx)
mov [ rsp + 0x240 ], r11; spilling x166 to mem
movzx r11, byte [ rsp + 0x1f8 ]; load byte memx399 to register64
mov byte [ rsp + 0x248 ], r15b; spilling byte x358 to mem
mov r15, 0x0 ; moving imm to reg
dec r15; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox r11, r15; loading flag
adox rbp, [ rsp + 0x1e0 ]
seto r11b; spill OF x401 to reg (r11)
movzx r15, byte [ rsp + 0x210 ]; load byte memx414 to register64
mov byte [ rsp + 0x250 ], dl; spilling byte x331 to mem
mov rdx, 0x0 ; moving imm to reg
dec rdx; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox r15, rdx; loading flag
adox rdi, rbp
setc r15b; spill CF x373 to reg (r15)
movzx rbp, byte [ rsp + 0x208 ]; load byte memx188 to register64
clc;
adcx rbp, rdx; loading flag
adcx rbx, [ rsp + 0x1f0 ]
setc bpl; spill CF x190 to reg (rbp)
movzx rdx, byte [ rsp + 0x220 ]; load byte memx231 to register64
clc;
mov [ rsp + 0x258 ], rdi; spilling x415 to mem
mov rdi, -0x1 ; moving imm to reg
adcx rdx, rdi; loading flag
adcx rax, [ rsp + 0x200 ]
setc dl; spill CF x233 to reg (rdx)
clc;
movzx r8, r8b
adcx r8, rdi; loading flag
adcx rbx, [ rsp + 0xb0 ]
setc r8b; spill CF x205 to reg (r8)
clc;
movzx r12, r12b
adcx r12, rdi; loading flag
adcx rbx, rax
mov r12b, dl; preserving value of x233 into a new reg
mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx.
mulx rax, rdi, r13; x255, x254<- x3 * arg1[5]
setc dl; spill CF x248 to reg (rdx)
clc;
mov [ rsp + 0x260 ], rax; spilling x255 to mem
mov rax, -0x1 ; moving imm to reg
movzx r10, r10b
adcx r10, rax; loading flag
adcx rdi, [ rsp + 0x218 ]
mov r10b, dl; preserving value of x248 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mov byte [ rsp + 0x268 ], r12b; spilling byte x233 to mem
mulx rax, r12, rcx; x344, x343<- x4 * arg1[4]
setc dl; spill CF x275 to reg (rdx)
clc;
mov byte [ rsp + 0x270 ], r10b; spilling byte x248 to mem
mov r10, -0x1 ; moving imm to reg
movzx r14, r14b
adcx r14, r10; loading flag
adcx rbx, rdi
seto r14b; spill OF x416 to reg (r14)
movzx rdi, byte [ rsp + 0x250 ]; load byte memx331 to register64
inc r10; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r10, -0x1 ; moving imm to reg
adox rdi, r10; loading flag
adox rbx, [ rsp + 0x118 ]
mov rdi, 0x7bc65c783158aea3 ; moving imm to reg
xchg rdx, rdi; 0x7bc65c783158aea3, swapping with x275, which is currently in rdx
mov byte [ rsp + 0x278 ], dil; spilling byte x275 to mem
mulx r10, rdi, r9; x387, x386<- x366 * 0x7bc65c783158aea3
setc dl; spill CF x290 to reg (rdx)
mov [ rsp + 0x280 ], r10; spilling x387 to mem
movzx r10, byte [ rsp + 0x248 ]; load byte memx358 to register64
clc;
mov [ rsp + 0x288 ], rax; spilling x344 to mem
mov rax, -0x1 ; moving imm to reg
adcx r10, rax; loading flag
adcx r12, [ rsp + 0x228 ]
movzx r10, bpl; x191, copying x190 here, cause x190 is needed in a reg for other than x191, namely all: , x191, size: 1
mov rax, [ rsp + 0x240 ]; load m64 x166 to register64
lea r10, [ r10 + rax ]; r8/64 + m8
setc al; spill CF x360 to reg (rax)
clc;
mov rbp, -0x1 ; moving imm to reg
movzx r8, r8b
adcx r8, rbp; loading flag
adcx r10, [ rsp + 0xa8 ]
setc r8b; spill CF x207 to reg (r8)
clc;
movzx r11, r11b
adcx r11, rbp; loading flag
adcx rdi, [ rsp + 0x238 ]
xchg rdx, r13; x3, swapping with x290, which is currently in rdx
mulx rdx, r11, [ rsi + 0x30 ]; x253, x252<- x3 * arg1[6]
seto bpl; spill OF x333 to reg (rbp)
mov [ rsp + 0x290 ], rdx; spilling x253 to mem
mov rdx, -0x1 ; moving imm to reg
inc rdx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov rdx, -0x1 ; moving imm to reg
movzx r15, r15b
adox r15, rdx; loading flag
adox rbx, r12
setc r15b; spill CF x403 to reg (r15)
clc;
movzx r14, r14b
adcx r14, rdx; loading flag
adcx rbx, rdi
mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx
mulx r14, r12, rcx; x342, x341<- x4 * arg1[5]
setc dl; spill CF x418 to reg (rdx)
clc;
mov rdi, -0x1 ; moving imm to reg
movzx rax, al
adcx rax, rdi; loading flag
adcx r12, [ rsp + 0x288 ]
movzx rax, byte [ rsp + 0x268 ]; x234, copying x233 here, cause x233 is needed in a reg for other than x234, namely all: , x234, size: 1
mov rdi, [ rsp + 0x230 ]; load m64 x209 to register64
lea rax, [ rax + rdi ]; r8/64 + m8
seto dil; spill OF x375 to reg (rdi)
mov [ rsp + 0x298 ], rbx; spilling x417 to mem
movzx rbx, byte [ rsp + 0x270 ]; load byte memx248 to register64
mov [ rsp + 0x2a0 ], r14; spilling x342 to mem
mov r14, 0x0 ; moving imm to reg
dec r14; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rbx, r14; loading flag
adox r10, rax
seto bl; spill OF x250 to reg (rbx)
movzx rax, byte [ rsp + 0x278 ]; load byte memx275 to register64
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r14, -0x1 ; moving imm to reg
adox rax, r14; loading flag
adox r11, [ rsp + 0x260 ]
seto al; spill OF x277 to reg (rax)
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r14, -0x1 ; moving imm to reg
movzx r13, r13b
adox r13, r14; loading flag
adox r10, r11
seto r13b; spill OF x292 to reg (r13)
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r11, -0x1 ; moving imm to reg
movzx rbp, bpl
adox rbp, r11; loading flag
adox r10, [ rsp + 0x110 ]
setc bpl; spill CF x362 to reg (rbp)
clc;
movzx rdi, dil
adcx rdi, r11; loading flag
adcx r10, r12
mov rdi, 0x6cfc5fd681c52056 ; moving imm to reg
xchg rdx, rdi; 0x6cfc5fd681c52056, swapping with x418, which is currently in rdx
mulx r12, r14, r9; x385, x384<- x366 * 0x6cfc5fd681c52056
seto r11b; spill OF x335 to reg (r11)
mov rdx, -0x1 ; moving imm to reg
inc rdx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov rdx, -0x1 ; moving imm to reg
movzx r15, r15b
adox r15, rdx; loading flag
adox r14, [ rsp + 0x280 ]
movzx r15, bl; x251, copying x250 here, cause x250 is needed in a reg for other than x251, namely all: , x251, size: 1
movzx r8, r8b
lea r15, [ r15 + r8 ]
movzx r8, al; x278, copying x277 here, cause x277 is needed in a reg for other than x278, namely all: , x278, size: 1
mov rbx, [ rsp + 0x290 ]; load m64 x253 to register64
lea r8, [ r8 + rbx ]; r8/64 + m8
setc bl; spill CF x377 to reg (rbx)
clc;
movzx rdi, dil
adcx rdi, rdx; loading flag
adcx r10, r14
seto dil; spill OF x405 to reg (rdi)
inc rdx; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rax, -0x1 ; moving imm to reg
movzx r13, r13b
adox r13, rax; loading flag
adox r15, r8
seto r13b; spill OF x294 to reg (r13)
inc rax; OF<-0x0, preserve CF (debug: state 1(-0x1) (thanks Paul))
mov rdx, -0x1 ; moving imm to reg
movzx r11, r11b
adox r11, rdx; loading flag
adox r15, [ rsp + 0x108 ]
movzx r11, r13b; x338, copying x294 here, cause x294 is needed in a reg for other than x338, namely all: , x338, size: 1
adox r11, rax
mov rdx, rcx; x4 to rdx
mulx rdx, rcx, [ rsi + 0x30 ]; x340, x339<- x4 * arg1[6]
mov r14, 0x2341f27177344 ; moving imm to reg
xchg rdx, r14; 0x2341f27177344, swapping with x340, which is currently in rdx
mulx r9, r8, r9; x383, x382<- x366 * 0x2341f27177344
dec rax; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1))
movzx rbp, bpl
adox rbp, rax; loading flag
adox rcx, [ rsp + 0x2a0 ]
seto bpl; spill OF x364 to reg (rbp)
inc rax; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r13, -0x1 ; moving imm to reg
movzx rdi, dil
adox rdi, r13; loading flag
adox r12, r8
mov rdi, [ rsi + 0x28 ]; load m64 x5 to register64
movzx r8, bpl; x365, copying x364 here, cause x364 is needed in a reg for other than x365, namely all: , x365, size: 1
lea r8, [ r8 + r14 ]
setc r14b; spill CF x420 to reg (r14)
clc;
movzx rbx, bl
adcx rbx, r13; loading flag
adcx r15, rcx
adcx r8, r11
seto bl; spill OF x407 to reg (rbx)
dec rax; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul))
movzx r14, r14b
adox r14, rax; loading flag
adox r15, r12
movzx r13, bl; x408, copying x407 here, cause x407 is needed in a reg for other than x408, namely all: , x408, size: 1
lea r13, [ r13 + r9 ]
adox r13, r8
seto r14b; spill OF x425 to reg (r14)
adc r14b, 0x0
movzx r14, r14b
xchg rdx, rdi; x5, swapping with 0x2341f27177344, which is currently in rdx
mulx r11, r9, [ rsi + 0x0 ]; x439, x438<- x5 * arg1[0]
adox r9, [ rsp + 0x198 ]
mov rcx, 0xffffffffffffffff ; moving imm to reg
xchg rdx, r9; x453, swapping with x5, which is currently in rdx
mulx rbp, r12, rcx; x478, x477<- x453 * 0xffffffffffffffff
mulx rbx, r8, rcx; x482, x481<- x453 * 0xffffffffffffffff
mulx rax, rdi, rcx; x480, x479<- x453 * 0xffffffffffffffff
mov rcx, 0xfdc1767ae2ffffff ; moving imm to reg
mov byte [ rsp + 0x2a8 ], r14b; spilling byte x425 to mem
mov [ rsp + 0x2b0 ], r13; spilling x423 to mem
mulx r14, r13, rcx; x476, x475<- x453 * 0xfdc1767ae2ffffff
adcx rdi, rbx
adcx r12, rax
mov rbx, 0x2341f27177344 ; moving imm to reg
mulx rax, rcx, rbx; x470, x469<- x453 * 0x2341f27177344
adcx r13, rbp
mov rbp, 0x7bc65c783158aea3 ; moving imm to reg
mov [ rsp + 0x2b8 ], r15; spilling x421 to mem
mulx rbx, r15, rbp; x474, x473<- x453 * 0x7bc65c783158aea3
mov rbp, 0x6cfc5fd681c52056 ; moving imm to reg
mov [ rsp + 0x2c0 ], r10; spilling x419 to mem
mov [ rsp + 0x2c8 ], r13; spilling x487 to mem
mulx r10, r13, rbp; x472, x471<- x453 * 0x6cfc5fd681c52056
adcx r15, r14
adcx r13, rbx
mov r14, [ rsi + 0x30 ]; load m64 x6 to register64
seto bl; spill OF x454 to reg (rbx)
mov rbp, -0x2 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1)
adox r8, rdx
adcx rcx, r10
mov rdx, r9; x5 to rdx
mulx r8, r9, [ rsi + 0x8 ]; x437, x436<- x5 * arg1[1]
xchg rdx, r14; x6, swapping with x5, which is currently in rdx
mulx r10, rbp, [ rsi + 0x0 ]; x526, x525<- x6 * arg1[0]
mov [ rsp + 0x2d0 ], rcx; spilling x493 to mem
mov rcx, 0x0 ; moving imm to reg
adcx rax, rcx
clc;
adcx r9, r11
setc r11b; spill CF x441 to reg (r11)
clc;
mov rcx, -0x1 ; moving imm to reg
movzx rbx, bl
adcx rbx, rcx; loading flag
adcx r9, [ rsp + 0x1e8 ]
adox rdi, r9
mov rbx, rdx; preserving value of x6 into a new reg
mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx.
mulx r9, rcx, r14; x435, x434<- x5 * arg1[2]
setc dl; spill CF x456 to reg (rdx)
clc;
mov [ rsp + 0x2d8 ], rax; spilling x495 to mem
mov rax, -0x1 ; moving imm to reg
movzx r11, r11b
adcx r11, rax; loading flag
adcx r8, rcx
setc r11b; spill CF x443 to reg (r11)
clc;
movzx rdx, dl
adcx rdx, rax; loading flag
adcx r8, [ rsp + 0x258 ]
setc dl; spill CF x458 to reg (rdx)
clc;
adcx rbp, rdi
adox r12, r8
mov rdi, 0xffffffffffffffff ; moving imm to reg
xchg rdx, rdi; 0xffffffffffffffff, swapping with x458, which is currently in rdx
mulx rcx, r8, rbp; x569, x568<- x540 * 0xffffffffffffffff
mov [ rsp + 0x2e0 ], r13; spilling x491 to mem
mulx rax, r13, rbp; x567, x566<- x540 * 0xffffffffffffffff
mov [ rsp + 0x2e8 ], r15; spilling x489 to mem
mov r15, rdx; preserving value of 0xffffffffffffffff into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mov [ rsp + 0x2f0 ], rax; spilling x567 to mem
mov byte [ rsp + 0x2f8 ], dil; spilling byte x458 to mem
mulx rax, rdi, rbx; x524, x523<- x6 * arg1[1]
setc dl; spill CF x541 to reg (rdx)
clc;
adcx rdi, r10
setc r10b; spill CF x528 to reg (r10)
clc;
adcx r8, rbp
mov r8b, dl; preserving value of x541 into a new reg
mov rdx, [ rsi + 0x18 ]; saving arg1[3] in rdx.
mov [ rsp + 0x300 ], rax; spilling x524 to mem
mulx r15, rax, r14; x433, x432<- x5 * arg1[3]
setc dl; spill CF x584 to reg (rdx)
clc;
adcx r13, rcx
seto cl; spill OF x501 to reg (rcx)
mov [ rsp + 0x308 ], r15; spilling x433 to mem
mov r15, 0x0 ; moving imm to reg
dec r15; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r11, r11b
adox r11, r15; loading flag
adox r9, rax
setc r11b; spill CF x571 to reg (r11)
clc;
movzx r8, r8b
adcx r8, r15; loading flag
adcx r12, rdi
setc r8b; spill CF x543 to reg (r8)
clc;
movzx rdx, dl
adcx rdx, r15; loading flag
adcx r12, r13
seto dil; spill OF x445 to reg (rdi)
movzx rdx, byte [ rsp + 0x2f8 ]; load byte memx458 to register64
inc r15; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rax, -0x1 ; moving imm to reg
adox rdx, rax; loading flag
adox r9, [ rsp + 0x298 ]
setc dl; spill CF x586 to reg (rdx)
clc;
movzx rcx, cl
adcx rcx, rax; loading flag
adcx r9, [ rsp + 0x2c8 ]
xchg rdx, rbx; x6, swapping with x586, which is currently in rdx
mulx rcx, r13, [ rsi + 0x10 ]; x522, x521<- x6 * arg1[2]
setc al; spill CF x503 to reg (rax)
mov [ rsp + 0x310 ], rcx; spilling x522 to mem
seto cl; spill OF x460 to reg (rcx)
mov byte [ rsp + 0x318 ], dil; spilling byte x445 to mem
mov rdi, r12; x600, copying x585 here, cause x585 is needed in a reg for other than x600, namely all: , x600--x601, x616, size: 2
mov byte [ rsp + 0x320 ], bl; spilling byte x586 to mem
mov rbx, 0xffffffffffffffff ; moving imm to reg
sub rdi, rbx
dec r15; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1))
movzx r10, r10b
adox r10, r15; loading flag
adox r13, [ rsp + 0x300 ]
setc r10b; spill CF x601 to reg (r10)
clc;
movzx r8, r8b
adcx r8, r15; loading flag
adcx r9, r13
xchg rdx, rbp; x540, swapping with x6, which is currently in rdx
mulx r8, r13, rbx; x565, x564<- x540 * 0xffffffffffffffff
seto r15b; spill OF x530 to reg (r15)
mov rbx, 0x0 ; moving imm to reg
dec rbx; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r11, r11b
adox r11, rbx; loading flag
adox r13, [ rsp + 0x2f0 ]
setc r11b; spill CF x545 to reg (r11)
movzx rbx, byte [ rsp + 0x320 ]; load byte memx586 to register64
clc;
mov [ rsp + 0x328 ], rdi; spilling x600 to mem
mov rdi, -0x1 ; moving imm to reg
adcx rbx, rdi; loading flag
adcx r9, r13
setc bl; spill CF x588 to reg (rbx)
seto r13b; spill OF x573 to reg (r13)
movzx rdi, r10b; x601, copying x601 here, cause x601 is needed in a reg for other than x601, namely all: , x602--x603, size: 1
add rdi, -0x1
mov r10, r9; x602, copying x587 here, cause x587 is needed in a reg for other than x602, namely all: , x602--x603, x617, size: 2
mov byte [ rsp + 0x330 ], r11b; spilling byte x545 to mem
mov r11, 0xffffffffffffffff ; moving imm to reg
sbb r10, r11
mov r11, rdx; preserving value of x540 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mov [ rsp + 0x338 ], r10; spilling x602 to mem
mov byte [ rsp + 0x340 ], bl; spilling byte x588 to mem
mulx r10, rbx, r14; x431, x430<- x5 * arg1[4]
movzx rdx, byte [ rsp + 0x318 ]; load byte memx445 to register64
mov [ rsp + 0x348 ], r10; spilling x431 to mem
mov r10, 0x0 ; moving imm to reg
dec r10; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rdx, r10; loading flag
adox rbx, [ rsp + 0x308 ]
setc dl; spill CF x603 to reg (rdx)
clc;
movzx rcx, cl
adcx rcx, r10; loading flag
adcx rbx, [ rsp + 0x2c0 ]
xchg rdx, rbp; x6, swapping with x603, which is currently in rdx
mulx rcx, r10, [ rsi + 0x18 ]; x520, x519<- x6 * arg1[3]
mov [ rsp + 0x350 ], rcx; spilling x520 to mem
seto cl; spill OF x447 to reg (rcx)
mov byte [ rsp + 0x358 ], bpl; spilling byte x603 to mem
mov rbp, -0x1 ; moving imm to reg
inc rbp; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov rbp, -0x1 ; moving imm to reg
movzx rax, al
adox rax, rbp; loading flag
adox rbx, [ rsp + 0x2e8 ]
setc al; spill CF x462 to reg (rax)
clc;
movzx r15, r15b
adcx r15, rbp; loading flag
adcx r10, [ rsp + 0x310 ]
mov r15, 0xfdc1767ae2ffffff ; moving imm to reg
xchg rdx, r15; 0xfdc1767ae2ffffff, swapping with x6, which is currently in rdx
mov byte [ rsp + 0x360 ], al; spilling byte x462 to mem
mulx rbp, rax, r11; x563, x562<- x540 * 0xfdc1767ae2ffffff
setc dl; spill CF x532 to reg (rdx)
clc;
mov [ rsp + 0x368 ], rbp; spilling x563 to mem
mov rbp, -0x1 ; moving imm to reg
movzx r13, r13b
adcx r13, rbp; loading flag
adcx r8, rax
seto r13b; spill OF x505 to reg (r13)
movzx rax, byte [ rsp + 0x330 ]; load byte memx545 to register64
inc rbp; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rbp, -0x1 ; moving imm to reg
adox rax, rbp; loading flag
adox rbx, r10
xchg rdx, r14; x5, swapping with x532, which is currently in rdx
mulx rax, r10, [ rsi + 0x28 ]; x429, x428<- x5 * arg1[5]
seto bpl; spill OF x547 to reg (rbp)
mov [ rsp + 0x370 ], rax; spilling x429 to mem
movzx rax, byte [ rsp + 0x340 ]; load byte memx588 to register64
mov byte [ rsp + 0x378 ], r13b; spilling byte x505 to mem
mov r13, 0x0 ; moving imm to reg
dec r13; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rax, r13; loading flag
adox rbx, r8
seto al; spill OF x590 to reg (rax)
inc r13; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r8, -0x1 ; moving imm to reg
movzx rcx, cl
adox rcx, r8; loading flag
adox r10, [ rsp + 0x348 ]
setc cl; spill CF x575 to reg (rcx)
seto r13b; spill OF x449 to reg (r13)
movzx r8, byte [ rsp + 0x358 ]; x603, copying x603 here, cause x603 is needed in a reg for other than x603, namely all: , x604--x605, size: 1
add r8, -0x1
mov r8, rbx; x604, copying x589 here, cause x589 is needed in a reg for other than x604, namely all: , x618, x604--x605, size: 2
mov byte [ rsp + 0x380 ], al; spilling byte x590 to mem
mov rax, 0xffffffffffffffff ; moving imm to reg
sbb r8, rax
movzx rax, byte [ rsp + 0x360 ]; load byte memx462 to register64
mov [ rsp + 0x388 ], r8; spilling x604 to mem
mov r8, 0x0 ; moving imm to reg
dec r8; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rax, r8; loading flag
adox r10, [ rsp + 0x2b8 ]
mov rax, rdx; preserving value of x5 into a new reg
mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx.
mov byte [ rsp + 0x390 ], r13b; spilling byte x449 to mem
mulx r8, r13, r15; x518, x517<- x6 * arg1[4]
setc dl; spill CF x605 to reg (rdx)
clc;
mov [ rsp + 0x398 ], r8; spilling x518 to mem
mov r8, -0x1 ; moving imm to reg
movzx r14, r14b
adcx r14, r8; loading flag
adcx r13, [ rsp + 0x350 ]
setc r14b; spill CF x534 to reg (r14)
movzx r8, byte [ rsp + 0x378 ]; load byte memx505 to register64
clc;
mov byte [ rsp + 0x3a0 ], dl; spilling byte x605 to mem
mov rdx, -0x1 ; moving imm to reg
adcx r8, rdx; loading flag
adcx r10, [ rsp + 0x2e0 ]
mov r8, 0x7bc65c783158aea3 ; moving imm to reg
mov rdx, r11; x540 to rdx
mov byte [ rsp + 0x3a8 ], r14b; spilling byte x534 to mem
mulx r11, r14, r8; x561, x560<- x540 * 0x7bc65c783158aea3
setc r8b; spill CF x507 to reg (r8)
clc;
mov [ rsp + 0x3b0 ], r11; spilling x561 to mem
mov r11, -0x1 ; moving imm to reg
movzx rcx, cl
adcx rcx, r11; loading flag
adcx r14, [ rsp + 0x368 ]
setc cl; spill CF x577 to reg (rcx)
clc;
movzx rbp, bpl
adcx rbp, r11; loading flag
adcx r10, r13
setc bpl; spill CF x549 to reg (rbp)
movzx r13, byte [ rsp + 0x380 ]; load byte memx590 to register64
clc;
adcx r13, r11; loading flag
adcx r10, r14
setc r13b; spill CF x592 to reg (r13)
seto r14b; spill OF x464 to reg (r14)
movzx r11, byte [ rsp + 0x3a0 ]; x605, copying x605 here, cause x605 is needed in a reg for other than x605, namely all: , x606--x607, size: 1
add r11, -0x1
mov r11, r10; x606, copying x591 here, cause x591 is needed in a reg for other than x606, namely all: , x606--x607, x619, size: 2
mov byte [ rsp + 0x3b8 ], bpl; spilling byte x549 to mem
mov rbp, 0xfdc1767ae2ffffff ; moving imm to reg
sbb r11, rbp
xchg rdx, r15; x6, swapping with x540, which is currently in rdx
mov [ rsp + 0x3c0 ], r11; spilling x606 to mem
mulx rbp, r11, [ rsi + 0x28 ]; x516, x515<- x6 * arg1[5]
xchg rdx, rax; x5, swapping with x6, which is currently in rdx
mov [ rsp + 0x3c8 ], rbp; spilling x516 to mem
mulx rdx, rbp, [ rsi + 0x30 ]; x427, x426<- x5 * arg1[6]
mov byte [ rsp + 0x3d0 ], r13b; spilling byte x592 to mem
movzx r13, byte [ rsp + 0x390 ]; load byte memx449 to register64
mov byte [ rsp + 0x3d8 ], cl; spilling byte x577 to mem
mov rcx, 0x0 ; moving imm to reg
dec rcx; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox r13, rcx; loading flag
adox rbp, [ rsp + 0x370 ]
setc r13b; spill CF x607 to reg (r13)
clc;
movzx r14, r14b
adcx r14, rcx; loading flag
adcx rbp, [ rsp + 0x2b0 ]
setc r14b; spill CF x466 to reg (r14)
clc;
movzx r8, r8b
adcx r8, rcx; loading flag
adcx rbp, [ rsp + 0x2d0 ]
mov r8, 0x6cfc5fd681c52056 ; moving imm to reg
xchg rdx, r8; 0x6cfc5fd681c52056, swapping with x427, which is currently in rdx
mov byte [ rsp + 0x3e0 ], r13b; spilling byte x607 to mem
mulx rcx, r13, r15; x559, x558<- x540 * 0x6cfc5fd681c52056
mov rdx, 0x0 ; moving imm to reg
adox r8, rdx
dec rdx; OF<-0x0, preserve CF (debug: state 3 (y: 0, n: -1))
mov [ rsp + 0x3e8 ], rcx; spilling x559 to mem
movzx rcx, byte [ rsp + 0x2a8 ]; load byte memx425 to register64
movzx r14, r14b
adox r14, rdx; loading flag
adox r8, rcx
mov rcx, [ rsp + 0x2d8 ]; x510, copying x495 here, cause x495 is needed in a reg for other than x510, namely all: , x510--x511, size: 1
adcx rcx, r8
setc r14b; spill CF x511 to reg (r14)
movzx r8, byte [ rsp + 0x3a8 ]; load byte memx534 to register64
clc;
adcx r8, rdx; loading flag
adcx r11, [ rsp + 0x398 ]
setc r8b; spill CF x536 to reg (r8)
movzx rdx, byte [ rsp + 0x3d8 ]; load byte memx577 to register64
clc;
mov [ rsp + 0x3f0 ], rcx; spilling x510 to mem
mov rcx, -0x1 ; moving imm to reg
adcx rdx, rcx; loading flag
adcx r13, [ rsp + 0x3b0 ]
seto dl; spill OF x468 to reg (rdx)
movzx rcx, byte [ rsp + 0x3b8 ]; load byte memx549 to register64
mov byte [ rsp + 0x3f8 ], r8b; spilling byte x536 to mem
mov r8, 0x0 ; moving imm to reg
dec r8; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
adox rcx, r8; loading flag
adox rbp, r11
setc cl; spill CF x579 to reg (rcx)
movzx r11, byte [ rsp + 0x3d0 ]; load byte memx592 to register64
clc;
adcx r11, r8; loading flag
adcx rbp, r13
xchg rdx, rax; x6, swapping with x468, which is currently in rdx
mulx rdx, r11, [ rsi + 0x30 ]; x514, x513<- x6 * arg1[6]
movzx r13, r14b; x512, copying x511 here, cause x511 is needed in a reg for other than x512, namely all: , x512, size: 1
movzx rax, al
lea r13, [ r13 + rax ]
setc al; spill CF x594 to reg (rax)
movzx r14, byte [ rsp + 0x3f8 ]; load byte memx536 to register64
clc;
adcx r14, r8; loading flag
adcx r11, [ rsp + 0x3c8 ]
mov r14, [ rsp + 0x3f0 ]; x552, copying x510 here, cause x510 is needed in a reg for other than x552, namely all: , x552--x553, size: 1
adox r14, r11
setc r11b; spill CF x538 to reg (r11)
seto r8b; spill OF x553 to reg (r8)
mov [ rsp + 0x400 ], r13; spilling x512 to mem
movzx r13, byte [ rsp + 0x3e0 ]; x607, copying x607 here, cause x607 is needed in a reg for other than x607, namely all: , x608--x609, size: 1
add r13, -0x1
mov r13, rbp; x608, copying x593 here, cause x593 is needed in a reg for other than x608, namely all: , x620, x608--x609, size: 2
mov [ rsp + 0x408 ], r14; spilling x552 to mem
mov r14, 0x7bc65c783158aea3 ; moving imm to reg
sbb r13, r14
movzx r14, r11b; x539, copying x538 here, cause x538 is needed in a reg for other than x539, namely all: , x539, size: 1
lea r14, [ r14 + rdx ]
mov rdx, 0x2341f27177344 ; moving imm to reg
mulx r15, r11, r15; x557, x556<- x540 * 0x2341f27177344
mov rdx, -0x1 ; moving imm to reg
inc rdx; OF<-0x0, preserve CF (debug: state 5 (thanks Paul))
mov rdx, -0x1 ; moving imm to reg
movzx rcx, cl
adox rcx, rdx; loading flag
adox r11, [ rsp + 0x3e8 ]
setc cl; spill CF x609 to reg (rcx)
clc;
movzx rax, al
adcx rax, rdx; loading flag
adcx r11, [ rsp + 0x408 ]
mov rax, 0x0 ; moving imm to reg
adox r15, rax
inc rdx; OF<-0x0, preserve CF (debug: state 1(-0x1) (thanks Paul))
mov rax, -0x1 ; moving imm to reg
movzx r8, r8b
adox r8, rax; loading flag
adox r14, [ rsp + 0x400 ]
adcx r15, r14
setc r8b; spill CF x598 to reg (r8)
seto r14b; spill OF x555 to reg (r14)
movzx rdx, cl; x609, copying x609 here, cause x609 is needed in a reg for other than x609, namely all: , x610--x611, size: 1
add rdx, -0x1
mov rdx, r11; x610, copying x595 here, cause x595 is needed in a reg for other than x610, namely all: , x610--x611, x621, size: 2
mov rcx, 0x6cfc5fd681c52056 ; moving imm to reg
sbb rdx, rcx
movzx rax, r8b; x599, copying x598 here, cause x598 is needed in a reg for other than x599, namely all: , x599, size: 1
movzx r14, r14b
lea rax, [ rax + r14 ]
mov r14, r15; x612, copying x597 here, cause x597 is needed in a reg for other than x612, namely all: , x612--x613, x622, size: 2
mov r8, 0x2341f27177344 ; moving imm to reg
sbb r14, r8
sbb rax, 0x00000000
mov rax, [ rsp + 0x388 ]; x618, copying x604 here, cause x604 is needed in a reg for other than x618, namely all: , x618, size: 1
cmovc rax, rbx; if CF, x618<- x589 (nzVar)
mov rbx, [ rsp + 0x328 ]; x616, copying x600 here, cause x600 is needed in a reg for other than x616, namely all: , x616, size: 1
cmovc rbx, r12; if CF, x616<- x585 (nzVar)
cmovc r14, r15; if CF, x622<- x597 (nzVar)
mov r12, [ rsp + 0x338 ]; x617, copying x602 here, cause x602 is needed in a reg for other than x617, namely all: , x617, size: 1
cmovc r12, r9; if CF, x617<- x587 (nzVar)
mov r9, [ rsp + 0x3c0 ]; x619, copying x606 here, cause x606 is needed in a reg for other than x619, namely all: , x619, size: 1
cmovc r9, r10; if CF, x619<- x591 (nzVar)
mov r10, [ rsp + 0x0 ]; load m64 out1 to register64
mov [ r10 + 0x18 ], r9; out1[3] = x619
cmovc rdx, r11; if CF, x621<- x595 (nzVar)
mov [ r10 + 0x28 ], rdx; out1[5] = x621
mov [ r10 + 0x8 ], r12; out1[1] = x617
mov [ r10 + 0x10 ], rax; out1[2] = x618
cmovc r13, rbp; if CF, x620<- x593 (nzVar)
mov [ r10 + 0x30 ], r14; out1[6] = x622
mov [ r10 + 0x20 ], r13; out1[4] = x620
mov [ r10 + 0x0 ], rbx; out1[0] = x616
mov rbx, [ rsp + 0x410 ]; restoring from stack
mov rbp, [ rsp + 0x418 ]; restoring from stack
mov r12, [ rsp + 0x420 ]; restoring from stack
mov r13, [ rsp + 0x428 ]; restoring from stack
mov r14, [ rsp + 0x430 ]; restoring from stack
mov r15, [ rsp + 0x438 ]; restoring from stack
add rsp, 0x440
ret
; cpu AMD Ryzen Threadripper 1900X 8-Core Processor
; clocked at 2200 MHz
; first cyclecount 504.07, best 463.23809523809524, lastGood 486.76190476190476
; seed 2513671278159213
; CC / CFLAGS clang / -march=native -mtune=native -O3
; time needed: 6982149 ms / 60000 runs=> 116.36915ms/run
; Time spent for assembling and measureing (initial batch_size=21, initial num_batches=101): 216805 ms
; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.031051328179905642
; number reverted permutation/ tried permutation: 25881 / 29935 =86.457%
; number reverted decision/ tried decision: 22485 / 30066 =74.785% |
SECTION code_fp_math48
PUBLIC atan
EXTERN cm48_sccz80_atan
defc atan = cm48_sccz80_atan
|
; A142292: Primes congruent to 1 mod 44.
; Submitted by Jon Maiga
; 89,353,397,617,661,881,1013,1277,1321,1409,1453,2069,2113,2333,2377,2729,2861,3037,3169,3257,3301,3389,3433,3697,3917,4049,4093,4357,4621,4973,5237,5281,5413,5501,5897,6029,6073,6337,6469,6689,6733,6997,7129,7349,7393,7481,7789,7877,8009,8053,8273,8317,8537,8581,8669,8713,8933,9109,9241,9461,9769,9857,9901,10253,10429,10781,10957,11177,11353,11617,11969,12101,12277,12409,12497,12541,12893,13421,13553,13597,13729,14081,14389,14653,14741,15137,15269,15313,15401,15797,15973,16061,16193,16369,16633
mov $2,$0
add $2,6
pow $2,2
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,44
lpe
mov $0,$4
add $0,1
|
; A022926: Number of powers of 7 between 2^n and 2^(n+1).
; 0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1
mov $4,2
mov $5,$0
lpb $4
sub $4,1
add $0,$4
sub $0,1
mov $2,$4
mov $3,1
add $3,$0
mul $3,26
div $3,73
mov $6,$3
lpb $2
mov $1,$6
sub $2,1
lpe
lpe
lpb $5
sub $1,$6
mov $5,0
lpe
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.