text
stringlengths
1
1.05M
; A318274: Triangle read by rows: T(n,k) = n for 0 < k < n and T(n,0) = T(n,n) = 1. ; 1,1,1,1,2,1,1,3,3,1,1,4,4,4,1,1,5,5,5,5,1,1,6,6,6,6,6,1,1,7,7,7,7,7,7,1,1,8,8,8,8,8,8,8,1,1,9,9,9,9,9,9,9,9,1,1,10,10,10,10,10,10,10,10,10,1,1,11,11,11,11,11,11,11,11,11,11,1,1,12 mov $1,1 mov $2,$0 lpb $2,1 trn $3,$2 lpb $3,1 mov $1,$3 mov $3,$2 lpe sub $2,$3 add $3,$2 trn $2,1 lpe
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "channel_shuffle_op.h" namespace caffe2 { class GetChannelShuffleGradient : public GradientMakerBase { using GradientMakerBase::GradientMakerBase; vector<OperatorDef> GetGradientDefs() override { return SingleGradientDef( def_.type() + "Gradient", "", vector<string>{GO(0)}, vector<string>{GI(0)}); } }; REGISTER_CPU_OPERATOR(ChannelShuffle, ChannelShuffleOp<CPUContext>); REGISTER_CPU_OPERATOR( ChannelShuffleGradient, ChannelShuffleGradientOp<CPUContext>); REGISTER_GRADIENT(ChannelShuffle, GetChannelShuffleGradient); OPERATOR_SCHEMA(ChannelShuffle) .IdenticalTypeAndShape() .NumInputs(1) .NumOutputs(1); OPERATOR_SCHEMA(ChannelShuffleGradient) .IdenticalTypeAndShape() .NumInputs(1) .NumOutputs(1); }
// Copyright 2020 The Chromium 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 "content/browser/conversions/conversion_test_utils.h" #include <limits.h> #include <tuple> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" #include "base/run_loop.h" #include "base/task_runner_util.h" #include "base/test/bind_test_util.h" #include "content/browser/conversions/conversion_storage_context.h" #include "url/gurl.h" namespace content { namespace { const char kDefaultImpressionOrigin[] = "https://impression.test/"; const char kDefaultConversionOrigin[] = "https://conversion.test/"; const char kDefaultReportOrigin[] = "https://report.test/"; // Default expiry time for impressions for testing. const int64_t kExpiryTime = 30; } // namespace bool ConversionDisallowingContentBrowserClient::AllowConversionMeasurement( BrowserContext* context) { return false; } ConfigurableStorageDelegate::ConfigurableStorageDelegate() = default; ConfigurableStorageDelegate::~ConfigurableStorageDelegate() = default; void ConfigurableStorageDelegate::ProcessNewConversionReports( std::vector<ConversionReport>* reports) { // Note: reports are ordered by impression time, descending. for (auto& report : *reports) { report.report_time = report.impression.impression_time() + base::TimeDelta::FromMilliseconds(report_time_ms_); // If attribution credits were provided, associate them with reports // in order. if (!attribution_credits_.empty()) { report.attribution_credit = attribution_credits_.front(); attribution_credits_.pop_front(); } } } int ConfigurableStorageDelegate::GetMaxConversionsPerImpression() const { return max_conversions_per_impression_; } int ConfigurableStorageDelegate::GetMaxImpressionsPerOrigin() const { return max_impressions_per_origin_; } int ConfigurableStorageDelegate::GetMaxConversionsPerOrigin() const { return max_conversions_per_origin_; } ConversionManager* TestManagerProvider::GetManager( WebContents* web_contents) const { return manager_; } TestConversionManager::TestConversionManager() = default; TestConversionManager::~TestConversionManager() = default; void TestConversionManager::HandleImpression( const StorableImpression& impression) { num_impressions_++; } void TestConversionManager::HandleConversion( const StorableConversion& conversion) { num_conversions_++; } void TestConversionManager::GetActiveImpressionsForWebUI( base::OnceCallback<void(std::vector<StorableImpression>)> callback) { std::move(callback).Run(impressions_); } void TestConversionManager::GetReportsForWebUI( base::OnceCallback<void(std::vector<ConversionReport>)> callback, base::Time max_report_time) { std::move(callback).Run(reports_); } void TestConversionManager::SendReportsForWebUI(base::OnceClosure done) { reports_.clear(); std::move(done).Run(); } const ConversionPolicy& TestConversionManager::GetConversionPolicy() const { return policy_; } void TestConversionManager::ClearData( base::Time delete_begin, base::Time delete_end, base::RepeatingCallback<bool(const url::Origin&)> filter, base::OnceClosure done) { impressions_.clear(); reports_.clear(); std::move(done).Run(); } void TestConversionManager::SetActiveImpressionsForWebUI( std::vector<StorableImpression> impressions) { impressions_ = std::move(impressions); } void TestConversionManager::SetReportsForWebUI( std::vector<ConversionReport> reports) { reports_ = std::move(reports); } void TestConversionManager::Reset() { num_impressions_ = 0u; num_conversions_ = 0u; } // Builds an impression with default values. This is done as a builder because // all values needed to be provided at construction time. ImpressionBuilder::ImpressionBuilder(base::Time time) : impression_data_("123"), impression_time_(time), expiry_(base::TimeDelta::FromMilliseconds(kExpiryTime)), impression_origin_(url::Origin::Create(GURL(kDefaultImpressionOrigin))), conversion_origin_(url::Origin::Create(GURL(kDefaultConversionOrigin))), reporting_origin_(url::Origin::Create(GURL(kDefaultReportOrigin))) {} ImpressionBuilder::~ImpressionBuilder() = default; ImpressionBuilder& ImpressionBuilder::SetExpiry(base::TimeDelta delta) { expiry_ = delta; return *this; } ImpressionBuilder& ImpressionBuilder::SetData(const std::string& data) { impression_data_ = data; return *this; } ImpressionBuilder& ImpressionBuilder::SetImpressionOrigin( const url::Origin& origin) { impression_origin_ = origin; return *this; } ImpressionBuilder& ImpressionBuilder::SetConversionOrigin( const url::Origin& origin) { conversion_origin_ = origin; return *this; } ImpressionBuilder& ImpressionBuilder::SetReportingOrigin( const url::Origin& origin) { reporting_origin_ = origin; return *this; } StorableImpression ImpressionBuilder::Build() const { return StorableImpression(impression_data_, impression_origin_, conversion_origin_, reporting_origin_, impression_time_, impression_time_ + expiry_ /* expiry_time */, base::nullopt /* impression_id */); } StorableConversion DefaultConversion() { StorableConversion conversion( "111" /* conversion_data */, url::Origin::Create( GURL(kDefaultConversionOrigin)) /* conversion_origin */, url::Origin::Create(GURL(kDefaultReportOrigin)) /* reporting_origin */); return conversion; } // Custom comparator for StorableImpressions that does not take impression id's // into account. testing::AssertionResult ImpressionsEqual(const StorableImpression& expected, const StorableImpression& actual) { const auto tie = [](const StorableImpression& impression) { return std::make_tuple( impression.impression_data(), impression.impression_origin(), impression.conversion_origin(), impression.reporting_origin(), impression.impression_time(), impression.expiry_time()); }; if (tie(expected) != tie(actual)) { return testing::AssertionFailure(); } return testing::AssertionSuccess(); } // Custom comparator for comparing two vectors of conversion reports. Does not // compare impression and conversion id's as they are set by the underlying // sqlite db and should not be tested. testing::AssertionResult ReportsEqual( const std::vector<ConversionReport>& expected, const std::vector<ConversionReport>& actual) { const auto tie = [](const ConversionReport& conversion) { return std::make_tuple(conversion.impression.impression_data(), conversion.impression.impression_origin(), conversion.impression.conversion_origin(), conversion.impression.reporting_origin(), conversion.impression.impression_time(), conversion.impression.expiry_time(), conversion.conversion_data, conversion.report_time, conversion.attribution_credit); }; if (expected.size() != actual.size()) return testing::AssertionFailure() << "Expected length " << expected.size() << ", actual: " << actual.size(); for (size_t i = 0; i < expected.size(); i++) { if (tie(expected[i]) != tie(actual[i])) { return testing::AssertionFailure() << "Expected " << expected[i] << " at index " << i << ", actual: " << actual[i]; } } return testing::AssertionSuccess(); } std::vector<ConversionReport> GetConversionsToReportForTesting( ConversionManagerImpl* manager, base::Time max_report_time) { base::RunLoop run_loop; std::vector<ConversionReport> conversion_reports; manager->conversion_storage_context_->GetConversionsToReport( max_report_time, base::BindOnce(base::BindLambdaForTesting( [&](std::vector<ConversionReport> reports) { conversion_reports = std::move(reports); run_loop.Quit(); }))); run_loop.Run(); return conversion_reports; } } // namespace content
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2018 ArangoDB GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Jan Christoph Uhde //////////////////////////////////////////////////////////////////////////////// #include "OptimizerRules.h" #include "Aql/Collection.h" #include "Aql/Condition.h" #include "Aql/ExecutionNode.h" #include "Aql/ExecutionPlan.h" #include "Aql/Expression.h" #include "Aql/Function.h" #include "Aql/IndexHint.h" #include "Aql/IndexNode.h" #include "Aql/Optimizer.h" #include "Aql/Query.h" #include "Aql/SortNode.h" #include "Aql/Variable.h" #include "Basics/AttributeNameParser.h" #include "Basics/StaticStrings.h" #include "Basics/StringBuffer.h" #include "Basics/StringUtils.h" #include "Basics/VelocyPackHelper.h" #include "Containers/SmallVector.h" #include "Indexes/Index.h" #include "VocBase/Methods/Collections.h" using namespace arangodb; using namespace arangodb::aql; using EN = arangodb::aql::ExecutionNode; namespace { bool isValueTypeCollection(AstNode const* node) { return node->type == NODE_TYPE_COLLECTION || node->isStringValue(); } // NEAR(coll, 0 /*lat*/, 0 /*lon*/[, 10 /*limit*/]) struct NearOrWithinParams { std::string collection; AstNode* latitude = nullptr; AstNode* longitude = nullptr; AstNode* limit = nullptr; AstNode* radius = nullptr; AstNode* distanceName = nullptr; NearOrWithinParams(AstNode const* node, bool isNear) { TRI_ASSERT(node->type == AstNodeType::NODE_TYPE_FCALL); AstNode* arr = node->getMember(0); TRI_ASSERT(arr->type == AstNodeType::NODE_TYPE_ARRAY); if (arr->getMember(0)->isStringValue()) { collection = arr->getMember(0)->getString(); // otherwise the "" collection will not be found } latitude = arr->getMember(1); longitude = arr->getMember(2); if (arr->numMembers() > 4) { distanceName = arr->getMember(4); } if (arr->numMembers() > 3) { if (isNear) { limit = arr->getMember(3); } else { radius = arr->getMember(3); } } } }; // FULLTEXT(collection, "attribute", "search", 100 /*limit*/[, "distance name"]) struct FulltextParams { std::string collection; std::string attribute; AstNode* limit = nullptr; explicit FulltextParams(AstNode const* node) { TRI_ASSERT(node->type == AstNodeType::NODE_TYPE_FCALL); AstNode* arr = node->getMember(0); TRI_ASSERT(arr->type == AstNodeType::NODE_TYPE_ARRAY); if (arr->getMember(0)->isStringValue()) { collection = arr->getMember(0)->getString(); } if (arr->getMember(1)->isStringValue()) { attribute = arr->getMember(1)->getString(); } if (arr->numMembers() > 3) { limit = arr->getMember(3); } } }; AstNode* getAstNode(CalculationNode* c) { return c->expression()->nodeForModification(); } Function* getFunction(AstNode const* ast) { if (ast->type == AstNodeType::NODE_TYPE_FCALL) { return static_cast<Function*>(ast->getData()); } return nullptr; } AstNode* createSubqueryWithLimit(ExecutionPlan* plan, ExecutionNode* node, ExecutionNode* first, ExecutionNode* last, Variable* lastOutVariable, AstNode* limit) { // Creates a subquery of the following form: // // singleton // | // first // | // ... // | // last // | // [limit] // | // return // // The subquery is then injected into the plan before the given `node` // This function returns an `AstNode*` of type reference to the subquery's // `outVariable` that can be used to replace the expression (or only a // part) of a `CalculationNode`. // if (limit && !(limit->isIntValue() || limit->isNullValue())) { THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "limit parameter has wrong type"); } auto* ast = plan->getAst(); /// singleton ExecutionNode* eSingleton = plan->registerNode(new SingletonNode(plan, plan->nextId())); /// return ExecutionNode* eReturn = plan->registerNode( // link output of index with the return node new ReturnNode(plan, plan->nextId(), lastOutVariable)); /// link nodes together first->addDependency(eSingleton); eReturn->addDependency(last); /// add optional limit node if (limit && !limit->isNullValue()) { ExecutionNode* eLimit = plan->registerNode( new LimitNode(plan, plan->nextId(), 0 /*offset*/, limit->getIntValue())); plan->insertAfter(last, eLimit); // inject into plan } /// create subquery Variable* subqueryOutVariable = ast->variables()->createTemporaryVariable(); ExecutionNode* eSubquery = plan->registerSubquery( new SubqueryNode(plan, plan->nextId(), eReturn, subqueryOutVariable)); plan->insertBefore(node, eSubquery); // return reference to outVariable return ast->createNodeReference(subqueryOutVariable); } bool isGeoIndex(arangodb::Index::IndexType type) { return type == arangodb::Index::TRI_IDX_TYPE_GEO1_INDEX || type == arangodb::Index::TRI_IDX_TYPE_GEO2_INDEX || type == arangodb::Index::TRI_IDX_TYPE_GEO_INDEX; } std::pair<AstNode*, AstNode*> getAttributeAccessFromIndex(Ast* ast, AstNode* docRef, NearOrWithinParams& params) { AstNode* accessNodeLat = docRef; AstNode* accessNodeLon = docRef; bool indexFound = false; aql::Collection* coll = ast->query().collections().get(params.collection); if (!coll) { coll = aql::addCollectionToQuery(ast->query(), params.collection, "NEAR OR WITHIN"); } for (auto& idx : coll->indexes()) { if (::isGeoIndex(idx->type())) { // we take the first index that is found bool isGeo1 = idx->type() == Index::IndexType::TRI_IDX_TYPE_GEO1_INDEX; bool isGeo2 = idx->type() == Index::IndexType::TRI_IDX_TYPE_GEO2_INDEX; bool isGeo = idx->type() == Index::IndexType::TRI_IDX_TYPE_GEO_INDEX; auto fieldNum = idx->fields().size(); if ((isGeo2 || isGeo) && fieldNum == 2) { // individual fields auto accessLatitude = idx->fields()[0]; auto accessLongitude = idx->fields()[1]; accessNodeLat = ast->createNodeAttributeAccess(accessNodeLat, accessLatitude); accessNodeLon = ast->createNodeAttributeAccess(accessNodeLon, accessLongitude); indexFound = true; } else if ((isGeo1 || isGeo) && fieldNum == 1) { auto accessBase = idx->fields()[0]; AstNode* base = ast->createNodeAttributeAccess(accessNodeLon, accessBase); VPackBuilder builder; idx->toVelocyPack(builder, Index::makeFlags(Index::Serialize::Basics)); bool geoJson = basics::VelocyPackHelper::getBooleanValue(builder.slice(), "geoJson", false); accessNodeLat = ast->createNodeIndexedAccess(base, ast->createNodeValueInt(geoJson ? 1 : 0)); accessNodeLon = ast->createNodeIndexedAccess(base, ast->createNodeValueInt(geoJson ? 0 : 1)); indexFound = true; } break; } } // for index in collection if (!indexFound) { THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_GEO_INDEX_MISSING, params.collection.c_str()); } return std::pair<AstNode*, AstNode*>(accessNodeLat, accessNodeLon); } AstNode* replaceNearOrWithin(AstNode* funAstNode, ExecutionNode* calcNode, ExecutionPlan* plan, bool isNear) { auto* ast = plan->getAst(); QueryContext& query = ast->query(); NearOrWithinParams params(funAstNode, isNear); if (isNear && (!params.limit || params.limit->isNullValue())) { params.limit = ast->createNodeValueInt(100); } // RETURN ( // FOR d IN col // SORT DISTANCE(d.lat, d.long, param.lat, param.lon) // NEAR // // FILTER DISTANCE(d.lat, d.long, param.lat, param.lon) < param.radius // //WHITHIN MERGE(d, { param.distname : DISTANCE(d.lat, d.long, param.lat, // param.lon)}) LIMIT param.limit // NEAR RETURN d MERGE {param.distname : // calculated_distance} // ) //// enumerate collection auto* aqlCollection = aql::addCollectionToQuery(query, params.collection, "NEAR OR WITHIN"); Variable* enumerateOutVariable = ast->variables()->createTemporaryVariable(); ExecutionNode* eEnumerate = plan->registerNode( // link output of index with the return node new EnumerateCollectionNode(plan, plan->nextId(), aqlCollection, enumerateOutVariable, false, IndexHint())); //// build sort condition - DISTANCE(d.lat, d.long, param.lat, param.lon) auto* docRef = ast->createNodeReference(enumerateOutVariable); AstNode *accessNodeLat, *accessNodeLon; std::tie(accessNodeLat, accessNodeLon) = getAttributeAccessFromIndex(ast, docRef, params); auto* argsArray = ast->createNodeArray(); argsArray->addMember(accessNodeLat); argsArray->addMember(accessNodeLon); argsArray->addMember(params.latitude); argsArray->addMember(params.longitude); auto* funDist = ast->createNodeFunctionCall(TRI_CHAR_LENGTH_PAIR("DISTANCE"), argsArray); AstNode* expressionAst = funDist; //// build filter condition for if (!isNear) { // WITHIN(coll, lat, lon, radius, distName) if (!params.radius || !params.radius->isNumericValue()) { THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "radius argument is not a numeric value"); } expressionAst = ast->createNodeBinaryOperator(AstNodeType::NODE_TYPE_OPERATOR_BINARY_LE, funDist, params.radius); } //// create calculation node used in SORT or FILTER // Calculation Node will acquire ownership auto calcExpr = std::make_unique<Expression>(ast, expressionAst); // put condition into calculation node Variable* calcOutVariable = ast->variables()->createTemporaryVariable(); ExecutionNode* eCalc = plan->registerNode( new CalculationNode(plan, plan->nextId(), std::move(calcExpr), calcOutVariable)); eCalc->addDependency(eEnumerate); //// create SORT or FILTER ExecutionNode* eSortOrFilter = nullptr; if (isNear) { // use calculation node in sort node SortElementVector sortElements{SortElement{calcOutVariable, /*asc*/ true}}; eSortOrFilter = plan->registerNode(new SortNode(plan, plan->nextId(), sortElements, false)); } else { eSortOrFilter = plan->registerNode(new FilterNode(plan, plan->nextId(), calcOutVariable)); } eSortOrFilter->addDependency(eCalc); //// create MERGE(d, { param.distname : DISTANCE(d.lat, d.long, param.lat, /// param.lon)}) if (params.distanceName) { // return without merging the distance into the // result if (!params.distanceName->isStringValue()) { THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "distance argument is not a string"); } AstNode* elem = nullptr; AstNode* funDistMerge = nullptr; if (isNear) { funDistMerge = ast->createNodeReference(calcOutVariable); } else { // NOTE - recycling the Ast seems to work - tested with ASAN funDistMerge = funDist; } if (params.distanceName->isConstant()) { elem = ast->createNodeObjectElement(params.distanceName->getStringValue(), params.distanceName->getStringLength(), funDistMerge); } else { elem = ast->createNodeCalculatedObjectElement(params.distanceName, funDistMerge); } auto* obj = ast->createNodeObject(); obj->addMember(elem); auto* argsArrayMerge = ast->createNodeArray(); argsArrayMerge->addMember(docRef); argsArrayMerge->addMember(obj); auto* funMerge = ast->createNodeFunctionCall(TRI_CHAR_LENGTH_PAIR("MERGE"), argsArrayMerge); Variable* calcMergeOutVariable = ast->variables()->createTemporaryVariable(); auto calcMergeExpr = std::make_unique<Expression>(ast, funMerge); ExecutionNode* eCalcMerge = plan->registerNode(new CalculationNode(plan, plan->nextId(), std::move(calcMergeExpr), calcMergeOutVariable)); plan->insertAfter(eSortOrFilter, eCalcMerge); //// wrap plan part into subquery return createSubqueryWithLimit(plan, calcNode, eEnumerate, eCalcMerge, calcMergeOutVariable, params.limit); } // merge //// wrap plan part into subquery return createSubqueryWithLimit(plan, calcNode, eEnumerate /* first */, eSortOrFilter /* last */, enumerateOutVariable, params.limit); } /// @brief replace WITHIN_RECTANGLE AstNode* replaceWithinRectangle(AstNode* funAstNode, ExecutionNode* calcNode, ExecutionPlan* plan) { aql::Ast* ast = plan->getAst(); TRI_ASSERT(funAstNode->type == AstNodeType::NODE_TYPE_FCALL); AstNode* fargs = funAstNode->getMember(0); TRI_ASSERT(fargs->type == AstNodeType::NODE_TYPE_ARRAY); if (fargs->numMembers() < 5) { THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH, "WITHIN_RECTANGLE", 5, 5); } AstNode const* coll = fargs->getMemberUnchecked(0); AstNode const* lat1 = fargs->getMemberUnchecked(1); AstNode const* lng1 = fargs->getMemberUnchecked(2); AstNode const* lat2 = fargs->getMemberUnchecked(3); AstNode const* lng2 = fargs->getMemberUnchecked(4); if (!::isValueTypeCollection(coll)) { THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_ILLEGAL_NAME); } // check for suitable indexes std::string cname = coll->getString(); aql::Collection* collection = aql::addCollectionToQuery(ast->query(), cname, "WITHIN_RECTANGLE"); if (coll->type != NODE_TYPE_COLLECTION) { auto const& resolver = ast->query().resolver(); coll = ast->createNodeCollection(resolver, coll->getStringValue(), coll->getStringLength(), AccessMode::Type::READ); } std::shared_ptr<arangodb::Index> index; for (auto& idx : collection->indexes()) { if (::isGeoIndex(idx->type())) { index = idx; break; } } if (!index) { THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_GEO_INDEX_MISSING, cname.c_str()); } // FOR part Variable* collVar = ast->variables()->createTemporaryVariable(); AstNode* forNode = ast->createNodeFor(collVar, coll, nullptr); // Create GEO_CONTAINS function AstNode* loop = ast->createNodeArray(5); auto fn = [&](AstNode const* lat, AstNode const* lon) { AstNode* arr = ast->createNodeArray(2); arr->addMember(lon); arr->addMember(lat); loop->addMember(arr); }; fn(lat1, lng1); fn(lat1, lng2); fn(lat2, lng2); fn(lat2, lng1); fn(lat1, lng1); AstNode* polygon = ast->createNodeObject(); polygon->addMember( ast->createNodeObjectElement("type", 4, ast->createNodeValueString("Polygon", 7))); AstNode* coords = ast->createNodeArray(1); coords->addMember(loop); polygon->addMember(ast->createNodeObjectElement("coordinates", 11, coords)); fargs = ast->createNodeArray(2); fargs->addMember(polygon); // GEO_CONTAINS, needs GeoJson [Lon, Lat] ordering if (index->fields().size() == 2) { AstNode* arr = ast->createNodeArray(2); arr->addMember(ast->createNodeAccess(collVar, index->fields()[1])); arr->addMember(ast->createNodeAccess(collVar, index->fields()[0])); fargs->addMember(arr); } else { VPackBuilder builder; index->toVelocyPack(builder, Index::makeFlags(Index::Serialize::Basics)); bool geoJson = basics::VelocyPackHelper::getBooleanValue(builder.slice(), "geoJson", false); if (geoJson) { fargs->addMember(ast->createNodeAccess(collVar, index->fields()[0])); } else { // combined [lat, lon] field AstNode* arr = ast->createNodeArray(2); AstNode* access = ast->createNodeAccess(collVar, index->fields()[0]); arr->addMember(ast->createNodeIndexedAccess(access, ast->createNodeValueInt(1))); arr->addMember(ast->createNodeIndexedAccess(access, ast->createNodeValueInt(0))); fargs->addMember(arr); } } AstNode* fcall = ast->createNodeFunctionCall("GEO_CONTAINS", fargs); // FILTER part AstNode* filterNode = ast->createNodeFilter(fcall); // RETURN part AstNode* returnNode = ast->createNodeReturn(ast->createNodeReference(collVar)); // create an on-the-fly subquery for a full collection access AstNode* rootNode = ast->createNodeSubquery(); // add nodes to subquery rootNode->addMember(forNode); rootNode->addMember(filterNode); rootNode->addMember(returnNode); // produce the proper ExecutionNodes from the subquery AST ExecutionNode* subquery = plan->fromNode(rootNode); if (subquery == nullptr) { THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY); } // and register a reference to the subquery result in the expression Variable* v = ast->variables()->createTemporaryVariable(); SubqueryNode* sqn = plan->registerSubquery(new SubqueryNode(plan, plan->nextId(), subquery, v)); plan->insertDependency(calcNode, sqn); return ast->createNodeReference(v); } AstNode* replaceFullText(AstNode* funAstNode, ExecutionNode* calcNode, ExecutionPlan* plan) { auto* ast = plan->getAst(); QueryContext& query = ast->query(); FulltextParams params(funAstNode); // must be NODE_TYPE_FCALL /// index // we create this first as creation of this node is more // likely to fail than the creation of other nodes // index - part 1 - figure out index to use std::shared_ptr<arangodb::Index> index = nullptr; std::vector<basics::AttributeName> field; TRI_ParseAttributeString(params.attribute, field, false); aql::Collection* coll = query.collections().get(params.collection); if (!coll) { coll = addCollectionToQuery(query, params.collection, "FULLTEXT"); } for (auto& idx : coll->indexes()) { if (idx->type() == arangodb::Index::IndexType::TRI_IDX_TYPE_FULLTEXT_INDEX) { if (basics::AttributeName::isIdentical(idx->fields()[0], field, false /*ignore expansion in last?!*/)) { index = idx; break; } } } if (!index) { // not found or error THROW_ARANGO_EXCEPTION_PARAMS(TRI_ERROR_QUERY_FULLTEXT_INDEX_MISSING, params.collection.c_str()); } // index part 2 - get remaining vars required for index creation auto* aqlCollection = aql::addCollectionToQuery(query, params.collection, "FULLTEXT"); auto condition = std::make_unique<Condition>(ast); condition->andCombine(funAstNode); condition->normalize(plan); // create a fresh out variable Variable* indexOutVariable = ast->variables()->createTemporaryVariable(); ExecutionNode* eIndex = plan->registerNode( new IndexNode(plan, plan->nextId(), aqlCollection, indexOutVariable, std::vector<transaction::Methods::IndexHandle>{ transaction::Methods::IndexHandle{index}}, std::move(condition), IndexIteratorOptions())); //// wrap plan part into subquery return createSubqueryWithLimit(plan, calcNode, eIndex, eIndex, indexOutVariable, params.limit); } } // namespace //! @brief replace legacy JS Functions with pure AQL void arangodb::aql::replaceNearWithinFulltextRule(Optimizer* opt, std::unique_ptr<ExecutionPlan> plan, OptimizerRule const& rule) { bool modified = false; ::arangodb::containers::SmallVector<ExecutionNode*>::allocator_type::arena_type a; ::arangodb::containers::SmallVector<ExecutionNode*> nodes{a}; plan->findNodesOfType(nodes, ExecutionNode::CALCULATION, true); for (auto const& node : nodes) { auto visitor = [&modified, &node, &plan](AstNode* astnode) { auto* fun = getFunction(astnode); // if fun != nullptr -> astnode->type NODE_TYPE_FCALL if (fun) { AstNode* replacement = nullptr; if (fun->name == "NEAR") { replacement = replaceNearOrWithin(astnode, node, plan.get(), true /*isNear*/); TRI_ASSERT(replacement); } else if (fun->name == "WITHIN") { replacement = replaceNearOrWithin(astnode, node, plan.get(), false /*isNear*/); TRI_ASSERT(replacement); } else if (fun->name == "WITHIN_RECTANGLE") { replacement = replaceWithinRectangle(astnode, node, plan.get()); TRI_ASSERT(replacement); } else if (fun->name == "FULLTEXT") { replacement = replaceFullText(astnode, node, plan.get()); TRI_ASSERT(replacement); } if (replacement) { modified = true; return replacement; } } return astnode; }; CalculationNode* calc = ExecutionNode::castTo<CalculationNode*>(node); auto* original = getAstNode(calc); auto* replacement = Ast::traverseAndModify(original, visitor); // replace root node if it was modified // TraverseAndModify has no access to roots parent if (replacement != original) { calc->expression()->replaceNode(replacement); } } opt->addPlan(std::move(plan), rule, modified); } // replaceJSFunctions
.module errortest .title Tests errorModule .include 'error.def' .include '..\io\io.def' .include '..\program\program.def' STACK == 0xFFFF ;SYSTEM STACK .area BOOT (ABS) .org 0x0000 RST0: DI LXI SP,STACK ;INITALIZE STACK JMP START ;********************************************************* ;* MAIN PROGRAM ;********************************************************* .area _CODE START: MVI A,8 ;SET INTERRUPT MASK SIM EI ;ENABLE INTERRUPTS CALL IO_INIT LXI H,0 SHLD PRG_CURRLINE ; CURRENT LINE = 0 LXI H,RESTART1 SHLD ERR_RESTARTPTR ; RESTART POSITION JMP ERR_SYNTAX ; SYNTAX ERROR RESTART1: LXI H,123 SHLD PRG_CURRLINE ; CURRENT LINE = 123 LXI H,RESTART2 SHLD ERR_RESTARTPTR ; RESTART POSITION JMP ERR_NOENDSTR ; UNTERMINATED STR CONST RESTART2: LXI H,10 SHLD PRG_CURRLINE ; CURRENT LINE = 10 LXI H,RESTART3 SHLD ERR_RESTARTPTR ; RESTART POSITION JMP ERR_UNKNOWN ; UNKNOWN ERROR RESTART3: LOOP: JMP LOOP .area DATA (REL,CON)
SECTION code_fp PUBLIC frexp EXTERN fa EXTERN dload ; float frexpf (float x, int *pw2); frexp: ld hl,4 add hl,sp call dload pop bc ;Ret pop de ;pw2 push de push bc ld hl,fa+5 ld a,(hl) and a ld (hl),0 jr z,zero sub $80 ld (hl),128 zero: ld (de),a rlca sbc a inc de ld (de),a ret
;** Standard device IO for MSDOS (first 12 function calls) ; TITLE IBMCPMIO - device IO for MSDOS NAME IBMCPMIO ; ; Microsoft Confidential ; Copyright (C) Microsoft Corporation 1991 ; All Rights Reserved. ; ;** CPMIO.ASM - Standard device IO for MSDOS (first 12 function calls) ; ; ; Old style CP/M 1-12 system calls to talk to reserved devices ; ; $Std_Con_Input_No_Echo ; $Std_Con_String_Output ; $Std_Con_String_Input ; $RawConIO ; $RawConInput ; RAWOUT ; RAWOUT2 ; ; Revision history: ; ; A000 version 4.00 - Jan 1988 ; A002 PTM -- dir >lpt3 hangs .xlist .xcref include version.inc include dosseg.inc INCLUDE DOSSYM.INC include sf.inc include vector.inc INCLUDE DEVSYM.INC include doscntry.inc .list .cref ; The following routines form the console I/O group (funcs 1,2,6,7,8,9,10,11). ; They assume ES and DS NOTHING, while not strictly correct, this forces data ; references to be SS or CS relative which is desired. i_need CARPOS,BYTE i_need STARTPOS,BYTE i_need INBUF,128 i_need INSMODE,BYTE i_need user_SP,WORD EXTRN OUTCHA:NEAR ;AN000 char out with status check 2/11/KK i_need Printer_Flag,BYTE i_need SCAN_FLAG,BYTE i_need DATE_FLAG,WORD i_need Packet_Temp,WORD ; temporary packet used by readtime i_need DEVCALL,DWORD i_need InterChar,BYTE ;AN000;interim char flag ( 0 = regular char) i_need InterCon,BYTE ;AN000;console flag ( 1 = in interim mode ) i_need SaveCurFlg,BYTE ;AN000;console out ( 1 = print and do not advance) i_need COUNTRY_CDPG,byte ;AN000; 2/12/KK i_need TEMP_VAR,WORD ;AN000; 2/12/KK i_need DOS34_FLAG,WORD ;AN000; 2/12/KK DOSCODE SEGMENT ASSUME SS:DOSDATA,CS:DOSCODE EXTRN Get_IO_SFT:Near EXTRN IOFunc:near EXTRN EscChar:BYTE ; lead byte for function keys EXTRN CanChar:BYTE ; Cancel character Break IFDEF DBCS ;AN000; ; ;---------------------------------------------------------------------------- ; ; Procedure : $Std_Con_Input_No_Echo ; ;---------------------------------------------------------------------------- ; ;--- Start of Korean Support 2/11/KK procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8 ;AN000; StdCILop: ;AN000; invoke INTER_CON_INPUT_NO_ECHO ;AN000; jmp InterApRet ; go to return fuction ;AN000; EndProc $STD_CON_INPUT_NO_ECHO ;AN000; ; ;---------------------------------------------------------------------------- ; ; Procedure : Inter_Con_Input_No_Echo ; ; ;---------------------------------------------------------------------------- ; procedure INTER_CON_INPUT_NO_ECHO,NEAR ;AN000; ;--- End of Korean Support 2/11/KK ; Inputs: ; None ; Function: ; Same as $STD_CON_INPUT_NO_ECHO but uses interim character read from ; the device. ; Returns: ; AL = character ; Zero flag SET if interim character, RESET otherwise ELSE ;AN000; ; ; Inputs: ; None ; Function: ; Input character from console, no echo ; Returns: ; AL = character procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8 ENDIF PUSH DS PUSH SI INTEST: invoke STATCHK JNZ Get ;************************************************************************* ;hkn; SS override cmp [Printer_Flag],0 ; is printer idle? jnz no_sys_wait mov ah,5 ; get input status with system wait call IOFUNC no_sys_wait: ;************************************************************************** MOV AH,84h INT int_IBM ;;; 7/15/86 update the date in the idle loop ;;; Dec 19, 1986 D.C.L. changed following CMP to Byte Ptr from Word Ptr ;;;; to shorten loop in consideration of the PC Convertible ;hkn; SS override CMP byte ptr [DATE_FLAG],-1 ; date is updated may be every JNZ NoUpdate ; 65535 x ? ms if no one calls PUSH AX PUSH BX ; following is tricky, PUSH CX ; it may be called by critical handler PUSH DX ; at that time, DEVCALL is used by ; other's READ or WRITE PUSH DS ; save DS = SFT's sgement ;hkn; READTIME must use ds = DOSDATA ;hkn; PUSH CS ; READTIME must use DS=CS push ss POP DS MOV AX,0 ; therefore, we save DEVCALL CALL Save_Restore_Packet ; save DEVCALL packet invoke READTIME ; readtime MOV AX,1 CALL Save_Restore_Packet ; restore DEVCALL packet POP DS ; restore DS POP DX POP CX POP BX POP AX NoUpdate: ;hkn; SS override INC [DATE_FLAG] ;;; 7/15/86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JMP Intest Get: XOR AH,AH call IOFUNC POP SI POP DS ;;; 7/15/86 ;hkn; SS override MOV BYTE PTR [SCAN_FLAG],0 CMP AL,0 ; extended code ( AL ) JNZ noscan ;hkn; SS override MOV BYTE PTR [SCAN_FLAG],1 ; set this flag for ALT_Q key noscan: ;;; 7/15/86 IFDEF DBCS ;AN000; ;hkn; InterChar is in DOSDATA. use SS override. cmp [InterChar],1 ;AN000; set the zero flag if the character3/31/KK ;AN000; ENDIF ;AN000; return IFDEF DBCS ;AN000; EndProc INTER_CON_INPUT_NO_ECHO ;AN000; ;2/11/KK ;AN000; ELSE ;AN000; EndProc $STD_CON_INPUT_NO_ECHO ENDIF ;AN000; BREAK <$STD_CON_STRING_OUTPUT - Console String Output> ; ;---------------------------------------------------------------------------- ; ;** $STD_CON_STRING_OUTPUT - Console String Output ; ; ; ENTRY (DS:DX) Point to output string '$' terminated ; EXIT none ; USES ALL ; ;---------------------------------------------------------------------------- ; procedure $STD_CON_STRING_OUTPUT,NEAR ;System call 9 MOV SI,DX STRING_OUT1: LODSB ; IFDEF DBCS ;AN000; ; invoke TESTKANJ ;AN000; 2/11/KK ;AN000; ; jz SBCS00 ;AN000; 2/11/KK ;AN000; ; invoke OUTT ;AN000; 2/11/KK ;AN000; ; LODSB ;AN000; 2/11/KK ;AN000; ; JMP NEXT_STR1 ;AN000; 2/11/KK ;AN000; ;SBCS00: ;AN000; 2/11/KK ;AN000; ; ENDIF ;AN000; CMP AL,'$' retz NEXT_STR1: invoke OUTT JMP STRING_OUT1 EndProc $STD_CON_STRING_OUTPUT ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- IFDEF DBCS ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- include kstrin.asm ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ELSE ; Not double byte characters ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; SCCSID = @(#)strin.asm 1.2 85/04/18 BREAK <$STD_CON_STRING_INPUT - Input Line from Console> ;** $STD_CON_STRING_INPUT - Input Line from Console ; ; $STD_CON_STRING_INPUT Fills a buffer from console input until CR ; ; ENTRY (ds:dx) = input buffer ; EXIT none ; USES ALL ASSUME DS:NOTHING,ES:NOTHING procedure $STD_CON_STRING_INPUT,NEAR ;System call 10 MOV AX,SS MOV ES,AX MOV SI,DX XOR CH,CH LODSW ; (AL) = the buffer length ; (AH) = the template length OR AL,AL retz ;Buffer is 0 length!!? MOV BL,AH ;Init template counter MOV BH,CH ;Init template counter ; (BL) = the number of bytes in the template CMP AL,BL JBE NOEDIT ;If length of buffer inconsistent with contents CMP BYTE PTR [BX+SI],c_CR JZ EDITON ;If CR correctly placed EDIT is OK ; The number of chars in the template is >= the number of chars in buffer or ; there is no CR at the end of the template. This is an inconsistant state ; of affairs. Pretend that the template was empty: ; noedit: MOV BL,CH ;Reset buffer editon: MOV DL,AL DEC DX ;DL is # of bytes we can put in the buffer ; Top level. We begin to read a line in. ;hkn; SS override newlin: MOV AL,[CARPOS] MOV [STARTPOS],AL ;Remember position in raw buffer PUSH SI ;hkn; INBUF is in DOSDATA MOV DI,OFFSET DOSDATA:INBUF ;Build the new line here ;hkn; SS override MOV [INSMODE],CH ;Insert mode off MOV BH,CH ;No chars from template yet MOV DH,CH ;No chars to new line yet invoke $STD_CON_INPUT_NO_ECHO ;Get first char CMP AL,c_LF ;Linefeed JNZ GOTCH ;Filter out LF so < works ; This is the main loop of reading in a character and processing it. ; ; (BH) = the index of the next byte in the template ; (BL) = the length of the template ; (DH) = the number of bytes in the buffer ; (DL) = the length of the buffer entry GETCH invoke $STD_CON_INPUT_NO_ECHO GOTCH: ; ; Brain-damaged Tim Patterson ignored ^F in case his BIOS did not flush the ; input queue. ; CMP AL,"F"-"@" JZ GETCH ; If the leading char is the function-key lead byte ;hkn; ESCCHAR is in TABLE seg (DOSCODE) CMP AL,[ESCCHAR] JZ ESCape ;change reserved keyword DBM 5-7-87 ; Rubout and ^H are both destructive backspaces. CMP AL,c_DEL JZ BACKSPJ CMP AL,c_BS JZ BACKSPJ ; ^W deletes backward once and then backs up until a letter is before the ; cursor CMP AL,"W" - "@" ; The removal of the comment characters before the jump statement will ; cause ^W to backup a word. ;*** JZ WordDel NOP NOP CMP AL,"U" - "@" ; The removal of the comment characters before the jump statement will ; cause ^U to clear a line. ;*** JZ LineDel NOP NOP ; CR terminates the line. CMP AL,c_CR JZ ENDLIN ; LF goes to a new line and keeps on reading. CMP AL,c_LF JZ PHYCRLF ; ^X (or ESC) deletes the line and starts over ;hkn; CANCHAR is in TABLE seg (DOSCODE), so CS override CMP AL,[CANCHAR] JZ KILNEW ; Otherwise, we save the input character. savch: CMP DH,DL JAE BUFFUL ; buffer is full. STOSB INC DH ; increment count in buffer. invoke BUFOUT ;Print control chars nicely ;hkn; SS override CMP BYTE PTR [INSMODE],0 JNZ GETCH ; insertmode => don't advance template CMP BH,BL JAE GETCH ; no more characters in template INC SI ; Skip to next char in template INC BH ; remember position in template JMP SHORT GETCH BACKSPJ: JMP SHORT BACKSP bufful: MOV AL,7 ; Bell to signal full buffer invoke OUTT JMP SHORT GETCH ESCape: transfer OEMFunctionKey ; let the OEM's handle the key dispatch ENDLIN: STOSB ; Put the CR in the buffer invoke OUTT ; Echo it POP DI ; Get start of user buffer MOV [DI-1],DH ; Tell user how many bytes INC DH ; DH is length including CR COPYNEW: SAVE <DS,ES> RESTORE <DS,ES> ; XCHG ES,DS ;hkn; INBUF is in DOSDATA MOV SI,OFFSET DOSDATA:INBUF MOV CL,DH ; set up count REP MOVSB ; Copy final line to user buffer return ; Output a CRLF to the user screen and do NOT store it into the buffer PHYCRLF: invoke CRLF JMP GETCH ; ; Delete the previous line ; LineDel: OR DH,DH JZ GetCh Call BackSpace JMP LineDel ; ; delete the previous word. ; WordDel: WordLoop: Call BackSpace ; backspace the one spot OR DH,DH JZ GetChJ MOV AL,ES:[DI-1] cmp al,'0' jb GetChj cmp al,'9' jbe WordLoop OR AL,20h CMP AL,'a' JB GetChJ CMP AL,'z' JBE WordLoop getchj: JMP GetCh ; The user wants to throw away what he's typed in and wants to start over. We ; print the backslash and then go to the next line and tab to the correct spot ; to begin the buffered input. entry KILNEW MOV AL,"\" invoke OUTT ;Print the CANCEL indicator POP SI ;Remember start of edit buffer PUTNEW: invoke CRLF ;Go to next line on screen ;hkn; SS override MOV AL,[STARTPOS] invoke TAB ;Tab over JMP NEWLIN ;Start over again ; Destructively back up one character position entry BackSp Call BackSpace JMP GetCh BackSpace: OR DH,DH JZ OLDBAK ;No chars in line, do nothing to line CALL BACKUP ;Do the backup MOV AL,ES:[DI] ;Get the deleted char CMP AL," " JAE OLDBAK ;Was a normal char CMP AL,c_HT JZ BAKTAB ;Was a tab, fix up users display ;; 9/27/86 fix for ctrl-U backspace CMP AL,"U"-"@" ; ctrl-U is a section symbol not ^U JZ OLDBAK CMP AL,"T"-"@" ; ctrl-T is a paragraphs symbol not ^T JZ OLDBAK ;; 9/27/86 fix for ctrl-U backspace CALL BACKMES ;Was a control char, zap the '^' OLDBAK: ;hkn; SS override CMP BYTE PTR [INSMODE],0 retnz ;In insert mode, done OR BH,BH retz ;Not advanced in template, stay where we are DEC BH ;Go back in template DEC SI return BAKTAB: PUSH DI DEC DI ;Back up one char STD ;Go backward MOV CL,DH ;Number of chars currently in line MOV AL," " PUSH BX MOV BL,7 ;Max JCXZ FIGTAB ;At start, do nothing FNDPOS: SCASB ;Look back JNA CHKCNT CMP BYTE PTR ES:[DI+1],9 JZ HAVTAB ;Found a tab DEC BL ;Back one char if non tab control char CHKCNT: LOOP FNDPOS FIGTAB: ;hkn; SS override SUB BL,[STARTPOS] HAVTAB: SUB BL,DH ADD CL,BL AND CL,7 ;CX has correct number to erase CLD ;Back to normal POP BX POP DI JZ OLDBAK ;Nothing to erase TABBAK: invoke BACKMES LOOP TABBAK ;Erase correct number of chars JMP SHORT OLDBAK BACKUP: DEC DH ;Back up in line DEC DI BACKMES: MOV AL,c_BS ;Backspace invoke OUTT MOV AL," " ;Erase invoke OUTT MOV AL,c_BS ;Backspace JMP OUTT ;Done ;User really wants an ESC character in his line entry TwoEsc ;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override MOV AL,[ESCCHAR] JMP SAVCH ;Copy the rest of the template entry COPYLIN MOV CL,BL ;Total size of template SUB CL,BH ;Minus position in template, is number to move JMP SHORT COPYEACH entry CopyStr invoke FINDOLD ;Find the char JMP SHORT COPYEACH ;Copy up to it ;Copy one char from template to line entry COPYONE MOV CL,1 ;Copy CX chars from template to line COPYEACH: ;hkn; SS override MOV BYTE PTR [INSMODE],0 ;All copies turn off insert mode CMP DH,DL JZ GETCH2 ;At end of line, can't do anything CMP BH,BL JZ GETCH2 ;At end of template, can't do anything LODSB STOSB invoke BUFOUT INC BH ;Ahead in template INC DH ;Ahead in line LOOP COPYEACH GETCH2: JMP GETCH ;Skip one char in template entry SKIPONE CMP BH,BL JZ GETCH2 ;At end of template INC BH ;Ahead in template INC SI JMP GETCH entry SKIPSTR invoke FINDOLD ;Find out how far to go ADD SI,CX ;Go there ADD BH,CL JMP GETCH ;Get the next user char, and look ahead in template for a match ;CX indicates how many chars to skip to get there on output ;NOTE: WARNING: If the operation cannot be done, the return ; address is popped off and a jump to GETCH is taken. ; Make sure nothing extra on stack when this routine ; is called!!! (no PUSHes before calling it). FINDOLD: invoke $STD_CON_INPUT_NO_ECHO ;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override CMP AL,[ESCCHAR] ; did he type a function key? JNZ FindSetup ; no, set up for scan invoke $STD_CON_INPUT_NO_ECHO ; eat next char JMP short NotFnd ; go try again FindSetup: MOV CL,BL SUB CL,BH ;CX is number of chars to end of template JZ NOTFND ;At end of template DEC CX ;Cannot point past end, limit search JZ NOTFND ;If only one char in template, forget it PUSH ES PUSH DS POP ES PUSH DI MOV DI,SI ;Template to ES:DI INC DI REPNE SCASB ;Look POP DI POP ES JNZ NOTFND ;Didn't find the char NOT CL ;Turn how far to go into how far we went ADD CL,BL ;Add size of template SUB CL,BH ;Subtract current pos, result distance to skip return NOTFND: POP BP ;Chuck return address JMP GETCH entry REEDIT MOV AL,"@" ;Output re-edit character invoke OUTT POP DI PUSH DI PUSH ES PUSH DS invoke COPYNEW ;Copy current line into template POP DS POP ES POP SI MOV BL,DH ;Size of line is new size template JMP PUTNEW ;Start over again entry EXITINS entry ENTERINS ;hkn; SS override NOT BYTE PTR [INSMODE] JMP GETCH ;Put a real live ^Z in the buffer (embedded) entry CTRLZ MOV AL,"Z"-"@" JMP SAVCH ;Output a CRLF entry CRLF MOV AL,c_CR invoke OUTT MOV AL,c_LF JMP OUTT EndProc $STD_CON_STRING_INPUT ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ENDIF ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- BREAK <$RAW_CON_IO - Do Raw Console I/O> ; ;---------------------------------------------------------------------------- ; ;** $RAW_CON_IO - Do Raw Console I/O ; ; Input or output raw character from console, no echo ; ; ENTRY DL = -1 if input ; = output character if output ; EXIT (AL) = input character if input ; USES all ; ;---------------------------------------------------------------------------- ; procedure $RAW_CON_IO,NEAR ; System call 6 MOV AL,DL CMP AL,-1 LJNE RAWOUT ; is output ;hkn; SS override LES DI,DWORD PTR [user_SP] ; Get pointer to register save area XOR BX,BX call GET_IO_SFT retc IFDEF DBCS ;AN000; ;hkn; SS override push word ptr [Intercon] ;AN000; mov [Intercon],0 ;AN000; disable interim characters ENDIF ;AN000; MOV AH,1 call IOFUNC JNZ RESFLG IFDEF DBCS ;AN000; ;hkn; SS override pop word ptr [InterCon] ;AN000; restore interim flag ENDIF ;AN000; invoke SPOOLINT OR BYTE PTR ES:[DI.user_F],40H ; Set user's zero flag XOR AL,AL return RESFLG: AND BYTE PTR ES:[DI.user_F],0FFH-40H ; Reset user's zero flag IFDEF DBCS ;AN000; XOR AH,AH ;AN000; call IOFUNC ;AN000; get the character ;hkn; SS override pop word ptr [InterCon] ;AN000; return ;AN000; ENDIF ;AN000; ;AN000; ; ;---------------------------------------------------------------------------- ; ;** $Raw_CON_INPUT - Raw Console Input ; ; Input raw character from console, no echo ; ; ENTRY none ; EXIT (al) = character ; USES all ; ;---------------------------------------------------------------------------- ; rci0: invoke SPOOLINT entry $RAW_CON_INPUT ; System call 7 PUSH BX XOR BX,BX call GET_IO_SFT POP BX retc MOV AH,1 call IOFUNC JNZ rci5 MOV AH,84h INT int_IBM JMP rci0 rci5: XOR AH,AH call IOFUNC IFDEF DBCS ;AN000; ;hkn; SS override cmp [InterChar],1 ;AN000; 2/11/KK ; 2/11/KK ; Sets the application zero flag depending on the 2/11/KK ; zero flag upon entry to this routine. Then returns 2/11/KK ; from system call. 2/11/KK ; 2/11/KK entry InterApRet ;AN000; 2/11/KK ;AN000; pushf ;AN000; 3/16/KK ;hkn; push ds ;AN000; 3/16/KK push bx ;AN000; 3/16/KK ;hkn; SS is DOSDATA ;hkn; Context DS ;AN000; 3/16/KK ;hkn; COUNTRY_CDPG is in DOSCODE;smr;NO in DOSDATA MOV BX,offset DOSDATA:COUNTRY_CDPG.ccDosCodePage cmp word ptr ss:[bx],934 ;AN000; 3/16/KK korean code page ?; bug fix. use SS pop bx ;AN000; 3/16/KK ;hkn; pop ds ;AN000; 3/16/KK je do_koren ;AN000; 3/16/KK popf ;AN000; 3/16/KK return ;AN000; 3/16/KK do_koren: ;AN000; 3/16/KK popf ;AN000; ;hkn; SS override LES DI,DWORD PTR [user_SP] ;AN000; Get pointer to register save area KK jnz sj0 ;AN000; 2/11/KK OR BYTE PTR ES:[DI.user_F],40H ;AN000; Set user's zero flag 2/11/KK return ;AN000; 2/11/KK sj0: ;AN000; 2/11/KK AND BYTE PTR ES:[DI.user_F],0FFH-40H ;AN000; Reset user's zero flag 2/KK ENDIF ;AN000; return ;AN000; ; ; Output the character in AL to stdout ; entry RAWOUT PUSH BX MOV BX,1 call GET_IO_SFT JC RAWRET1 MOV BX,[SI.sf_flags] ;hkn; DS set up by get_io_sft ; ; If we are a network handle OR if we are not a local device then go do the ; output the hard way. ; AND BX,sf_isNet + devid_device CMP BX,devid_device JNZ RawNorm IFDEF DBCS ;AN000; ;hkn; SS override TEST [SaveCurFlg],01H ;AN000; print but no cursor adv? JNZ RAWNORM ;AN000; 2/11/KK ENDIF ;AN000; ; TEST BX,sf_isnet ; output to NET? ; JNZ RAWNORM ; if so, do normally ; TEST BX,devid_device ; output to file? ; JZ RAWNORM ; if so, do normally PUSH DS LDS BX,[SI.sf_devptr] ; output to special? TEST BYTE PTR [BX+SDEVATT],ISSPEC POP DS JZ RAWNORM ; if not, do normally INT int_fastcon ; quickly output the char RAWRET: CLC RAWRET1: POP BX return RAWNORM: CALL RAWOUT3 JMP RAWRET ; ; Output the character in AL to handle in BX ; entry RAWOUT2 call GET_IO_SFT retc RAWOUT3: PUSH AX JMP SHORT RAWOSTRT ROLP: invoke SPOOLINT ;hkn; SS override OR [DOS34_FLAG],CTRL_BREAK_FLAG ;AN002; set control break invoke DSKSTATCHK ;AN002; check control break RAWOSTRT: MOV AH,3 call IOFUNC JZ ROLP ;SR; ; IOFUNC now returns ax = 0ffffh if there was an I24 on a status call and ;the user failed. We do not send a char if this happens. We however return ;to the caller with carry clear because this DOS call does not return any ;status. ; inc ax ;fail on I24 if ax = -1 POP AX jz nosend ;yes, do not send char MOV AH,2 call IOFUNC nosend: CLC ; Clear carry indicating successful return EndProc $RAW_CON_IO ; ;---------------------------------------------------------------------------- ; ; Inputs: ; AX=0 save the DEVCALL request packet ; =1 restore the DEVCALL request packet ; Function: ; save or restore the DEVCALL packet ; Returns: ; none ; ;---------------------------------------------------------------------------- ; procedure Save_Restore_Packet,NEAR PUSH DS PUSH ES PUSH SI PUSH DI CMP AX,0 ; save packet JZ save_packet restore_packet: MOV SI,OFFSET DOSDATA:Packet_Temp ;sourec MOV DI,OFFSET DOSDATA:DEVCALL ;destination JMP short set_seg save_packet: MOV DI,OFFSET DOSDATA:Packet_Temp ;destination MOV SI,OFFSET DOSDATA:DEVCALL ;source set_seg: MOV AX,SS ; set DS,ES to DOSDATA MOV DS,AX MOV ES,AX MOV CX,11 ; 11 words to move REP MOVSW POP DI POP SI POP ES POP DS return EndProc Save_Restore_Packet DOSCODE ENDS END  
/* * Copyright (c) 2021, Oleg Sikorskiy <olegsik@gmail.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <AK/TestSuite.h> #include <LibGfx/Bitmap.h> #include <LibGfx/Painter.h> #include <stdio.h> BENCHMARK_CASE(diagonal_lines) { const int run_count = 50; const int bitmap_size = 2000; auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }); Gfx::Painter painter(*bitmap); for (int run = 0; run < run_count; run++) { for (int i = 0; i < bitmap_size; i++) { painter.draw_line({ 0, 0 }, { i, bitmap_size - 1 }, Color::Blue); painter.draw_line({ 0, 0 }, { bitmap_size - 1, i }, Color::Blue); } } } BENCHMARK_CASE(fill) { const int run_count = 1000; const int bitmap_size = 2000; auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }); Gfx::Painter painter(*bitmap); for (int run = 0; run < run_count; run++) { painter.fill_rect(bitmap->rect(), Color::Blue); } } BENCHMARK_CASE(fill_with_gradient) { const int run_count = 50; const int bitmap_size = 2000; auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { bitmap_size, bitmap_size }); Gfx::Painter painter(*bitmap); for (int run = 0; run < run_count; run++) { painter.fill_rect_with_gradient(bitmap->rect(), Color::Blue, Color::Red); } } TEST_MAIN(Painter)
; A020720: Pisot sequences E(7,9), P(7,9). ; 7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513,3329,4410,5842,7739,10252,13581,17991,23833,31572,41824,55405,73396,97229,128801,170625,226030,299426,396655,525456,696081,922111,1221537,1618192,2143648,2839729,3761840,4983377,6601569,8745217,11584946,15346786,20330163,26931732,35676949,47261895,62608681,82938844,109870576,145547525,192809420,255418101,338356945,448227521,593775046,786584466,1042002567,1380359512,1828587033,2422362079,3208946545,4250949112,5631308624,7459895657,9882257736,13091204281,17342153393,22973462017,30433357674,40315615410,53406819691,70748973084,93722435101,124155792775,164471408185,217878227876,288627200960,382349636061,506505428836,670976837021,888855064897,1177482265857,1559831901918,2066337330754,2737314167775,3626169232672,4803651498529,6363483400447,8429820731201 add $0,8 seq $0,134816 ; Padovan's spiral numbers.
/* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef OS_CPU_LINUX_AARCH64_GC_Z_ZSYSCALL_LINUX_AARCH64_HPP #define OS_CPU_LINUX_AARCH64_GC_Z_ZSYSCALL_LINUX_AARCH64_HPP #include <sys/syscall.h> // // Support for building on older Linux systems // #ifndef SYS_memfd_create #define SYS_memfd_create 279 #endif #ifndef SYS_fallocate #define SYS_fallocate 47 #endif #endif // OS_CPU_LINUX_AARCH64_GC_Z_ZSYSCALL_LINUX_AARCH64_HPP
/*========================================================================= Program: Visualization Toolkit Module: vtkPlaneWidget.cxx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkPlaneWidget.h" #include "vtkActor.h" #include "vtkAssemblyNode.h" #include "vtkAssemblyPath.h" #include "vtkCallbackCommand.h" #include "vtkCamera.h" #include "vtkCellArray.h" #include "vtkCellPicker.h" #include "vtkConeSource.h" #include "vtkDoubleArray.h" #include "vtkFloatArray.h" #include "vtkLineSource.h" #include "vtkMath.h" #include "vtkObjectFactory.h" #include "vtkPickingManager.h" #include "vtkPlane.h" #include "vtkPlaneSource.h" #include "vtkPlanes.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkProperty.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" #include "vtkSphereSource.h" #include "vtkTransform.h" vtkStandardNewMacro(vtkPlaneWidget); vtkCxxSetObjectMacro(vtkPlaneWidget,PlaneProperty,vtkProperty); vtkPlaneWidget::vtkPlaneWidget() : vtkPolyDataSourceWidget() { this->State = vtkPlaneWidget::Start; this->EventCallbackCommand->SetCallback(vtkPlaneWidget::ProcessEvents); this->NormalToXAxis = 0; this->NormalToYAxis = 0; this->NormalToZAxis = 0; this->Representation = VTK_PLANE_WIREFRAME; //Build the representation of the widget int i; // Represent the plane this->PlaneSource = vtkPlaneSource::New(); this->PlaneSource->SetXResolution(4); this->PlaneSource->SetYResolution(4); this->PlaneOutline = vtkPolyData::New(); vtkPoints *pts = vtkPoints::New(); pts->SetNumberOfPoints(4); vtkCellArray *outline = vtkCellArray::New(); outline->InsertNextCell(4); outline->InsertCellPoint(0); outline->InsertCellPoint(1); outline->InsertCellPoint(2); outline->InsertCellPoint(3); this->PlaneOutline->SetPoints(pts); pts->Delete(); this->PlaneOutline->SetPolys(outline); outline->Delete(); this->PlaneMapper = vtkPolyDataMapper::New(); this->PlaneMapper->SetInputConnection( this->PlaneSource->GetOutputPort()); this->PlaneActor = vtkActor::New(); this->PlaneActor->SetMapper(this->PlaneMapper); // Create the handles this->Handle = new vtkActor* [4]; this->HandleMapper = new vtkPolyDataMapper* [4]; this->HandleGeometry = new vtkSphereSource* [4]; for (i=0; i<4; i++) { this->HandleGeometry[i] = vtkSphereSource::New(); this->HandleGeometry[i]->SetThetaResolution(16); this->HandleGeometry[i]->SetPhiResolution(8); this->HandleMapper[i] = vtkPolyDataMapper::New(); this->HandleMapper[i]->SetInputConnection( this->HandleGeometry[i]->GetOutputPort()); this->Handle[i] = vtkActor::New(); this->Handle[i]->SetMapper(this->HandleMapper[i]); } // Create the + plane normal this->LineSource = vtkLineSource::New(); this->LineSource->SetResolution(1); this->LineMapper = vtkPolyDataMapper::New(); this->LineMapper->SetInputConnection( this->LineSource->GetOutputPort()); this->LineActor = vtkActor::New(); this->LineActor->SetMapper(this->LineMapper); this->ConeSource = vtkConeSource::New(); this->ConeSource->SetResolution(12); this->ConeSource->SetAngle(25.0); this->ConeMapper = vtkPolyDataMapper::New(); this->ConeMapper->SetInputConnection( this->ConeSource->GetOutputPort()); this->ConeActor = vtkActor::New(); this->ConeActor->SetMapper(this->ConeMapper); // Create the - plane normal this->LineSource2 = vtkLineSource::New(); this->LineSource2->SetResolution(1); this->LineMapper2 = vtkPolyDataMapper::New(); this->LineMapper2->SetInputConnection( this->LineSource2->GetOutputPort()); this->LineActor2 = vtkActor::New(); this->LineActor2->SetMapper(this->LineMapper2); this->ConeSource2 = vtkConeSource::New(); this->ConeSource2->SetResolution(12); this->ConeSource2->SetAngle(25.0); this->ConeMapper2 = vtkPolyDataMapper::New(); this->ConeMapper2->SetInputConnection( this->ConeSource2->GetOutputPort()); this->ConeActor2 = vtkActor::New(); this->ConeActor2->SetMapper(this->ConeMapper2); this->Transform = vtkTransform::New(); // Define the point coordinates double bounds[6]; bounds[0] = -0.5; bounds[1] = 0.5; bounds[2] = -0.5; bounds[3] = 0.5; bounds[4] = -0.5; bounds[5] = 0.5; //Manage the picking stuff this->HandlePicker = vtkCellPicker::New(); this->HandlePicker->SetTolerance(0.001); for (i=0; i<4; i++) { this->HandlePicker->AddPickList(this->Handle[i]); } this->HandlePicker->PickFromListOn(); this->PlanePicker = vtkCellPicker::New(); this->PlanePicker->SetTolerance(0.005); //need some fluff this->PlanePicker->AddPickList(this->PlaneActor); this->PlanePicker->AddPickList(this->ConeActor); this->PlanePicker->AddPickList(this->LineActor); this->PlanePicker->AddPickList(this->ConeActor2); this->PlanePicker->AddPickList(this->LineActor2); this->PlanePicker->PickFromListOn(); this->CurrentHandle = nullptr; this->LastPickValid = 0; this->HandleSizeFactor = 1.25; this->SetHandleSize( 0.05 ); // Set up the initial properties this->CreateDefaultProperties(); this->SelectRepresentation(); // Initial creation of the widget, serves to initialize it // Call PlaceWidget() LAST in the constructor as it depends on ivar // values. this->PlaceWidget(bounds); } vtkPlaneWidget::~vtkPlaneWidget() { this->PlaneActor->Delete(); this->PlaneMapper->Delete(); this->PlaneSource->Delete(); this->PlaneOutline->Delete(); for (int i=0; i<4; i++) { this->HandleGeometry[i]->Delete(); this->HandleMapper[i]->Delete(); this->Handle[i]->Delete(); } delete [] this->Handle; delete [] this->HandleMapper; delete [] this->HandleGeometry; this->ConeActor->Delete(); this->ConeMapper->Delete(); this->ConeSource->Delete(); this->LineActor->Delete(); this->LineMapper->Delete(); this->LineSource->Delete(); this->ConeActor2->Delete(); this->ConeMapper2->Delete(); this->ConeSource2->Delete(); this->LineActor2->Delete(); this->LineMapper2->Delete(); this->LineSource2->Delete(); this->HandlePicker->Delete(); this->PlanePicker->Delete(); if (this->HandleProperty) { this->HandleProperty->Delete(); this->HandleProperty = nullptr; } if (this->SelectedHandleProperty) { this->SelectedHandleProperty->Delete(); this->SelectedHandleProperty = nullptr; } if (this->PlaneProperty) { this->PlaneProperty->Delete(); this->PlaneProperty = nullptr; } if (this->SelectedPlaneProperty) { this->SelectedPlaneProperty->Delete(); this->SelectedPlaneProperty = nullptr; } this->Transform->Delete(); } void vtkPlaneWidget::SetEnabled(int enabling) { if ( ! this->Interactor ) { vtkErrorMacro(<<"The interactor must be set prior to enabling/disabling widget"); return; } if ( enabling ) //----------------------------------------------------------- { vtkDebugMacro(<<"Enabling plane widget"); if ( this->Enabled ) //already enabled, just return { return; } if ( ! this->CurrentRenderer ) { this->SetCurrentRenderer(this->Interactor->FindPokedRenderer( this->Interactor->GetLastEventPosition()[0], this->Interactor->GetLastEventPosition()[1])); if (this->CurrentRenderer == nullptr) { return; } } this->Enabled = 1; // listen for the following events vtkRenderWindowInteractor *i = this->Interactor; i->AddObserver(vtkCommand::MouseMoveEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::LeftButtonPressEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::LeftButtonReleaseEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::MiddleButtonPressEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::MiddleButtonReleaseEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::RightButtonPressEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::RightButtonReleaseEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::StartPinchEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::PinchEvent, this->EventCallbackCommand, this->Priority); i->AddObserver(vtkCommand::EndPinchEvent, this->EventCallbackCommand, this->Priority); // Add the plane this->CurrentRenderer->AddActor(this->PlaneActor); this->PlaneActor->SetProperty(this->PlaneProperty); // turn on the handles for (int j=0; j<4; j++) { this->CurrentRenderer->AddActor(this->Handle[j]); this->Handle[j]->SetProperty(this->HandleProperty); } // add the normal vector this->CurrentRenderer->AddActor(this->LineActor); this->LineActor->SetProperty(this->HandleProperty); this->CurrentRenderer->AddActor(this->ConeActor); this->ConeActor->SetProperty(this->HandleProperty); this->CurrentRenderer->AddActor(this->LineActor2); this->LineActor2->SetProperty(this->HandleProperty); this->CurrentRenderer->AddActor(this->ConeActor2); this->ConeActor2->SetProperty(this->HandleProperty); this->SelectRepresentation(); this->RegisterPickers(); this->InvokeEvent(vtkCommand::EnableEvent,nullptr); } else //disabling---------------------------------------------------------- { vtkDebugMacro(<<"Disabling plane widget"); if ( ! this->Enabled ) //already disabled, just return { return; } this->Enabled = 0; // don't listen for events any more this->Interactor->RemoveObserver(this->EventCallbackCommand); // turn off the plane this->CurrentRenderer->RemoveActor(this->PlaneActor); // turn off the handles for (int i=0; i<4; i++) { this->CurrentRenderer->RemoveActor(this->Handle[i]); } // turn off the normal vector this->CurrentRenderer->RemoveActor(this->LineActor); this->CurrentRenderer->RemoveActor(this->ConeActor); this->CurrentRenderer->RemoveActor(this->LineActor2); this->CurrentRenderer->RemoveActor(this->ConeActor2); this->CurrentHandle = nullptr; this->InvokeEvent(vtkCommand::DisableEvent,nullptr); this->SetCurrentRenderer(nullptr); this->UnRegisterPickers(); } this->Interactor->Render(); } //------------------------------------------------------------------------------ void vtkPlaneWidget::RegisterPickers() { vtkPickingManager* pm = this->GetPickingManager(); if (!pm) { return; } pm->AddPicker(this->HandlePicker, this); pm->AddPicker(this->PlanePicker, this); } void vtkPlaneWidget::ProcessEvents(vtkObject* vtkNotUsed(object), unsigned long event, void* clientdata, void* vtkNotUsed(calldata)) { vtkPlaneWidget* self = reinterpret_cast<vtkPlaneWidget *>( clientdata ); //okay, let's do the right thing switch(event) { case vtkCommand::LeftButtonPressEvent: self->OnLeftButtonDown(); break; case vtkCommand::LeftButtonReleaseEvent: self->OnLeftButtonUp(); break; case vtkCommand::MiddleButtonPressEvent: self->OnMiddleButtonDown(); break; case vtkCommand::MiddleButtonReleaseEvent: self->OnMiddleButtonUp(); break; case vtkCommand::RightButtonPressEvent: self->OnRightButtonDown(); break; case vtkCommand::RightButtonReleaseEvent: self->OnRightButtonUp(); break; case vtkCommand::MouseMoveEvent: self->OnMouseMove(); break; case vtkCommand::StartPinchEvent: self->OnStartPinch(); break; case vtkCommand::PinchEvent: self->OnPinch(); break; case vtkCommand::EndPinchEvent: self->OnEndPinch(); break; } } void vtkPlaneWidget::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); if ( this->HandleProperty ) { os << indent << "Handle Property: " << this->HandleProperty << "\n"; } else { os << indent << "Handle Property: (none)\n"; } if ( this->SelectedHandleProperty ) { os << indent << "Selected Handle Property: " << this->SelectedHandleProperty << "\n"; } else { os << indent << "SelectedHandle Property: (none)\n"; } if ( this->PlaneProperty ) { os << indent << "Plane Property: " << this->PlaneProperty << "\n"; } else { os << indent << "Plane Property: (none)\n"; } if ( this->SelectedPlaneProperty ) { os << indent << "Selected Plane Property: " << this->SelectedPlaneProperty << "\n"; } else { os << indent << "Selected Plane Property: (none)\n"; } os << indent << "Plane Representation: "; if ( this->Representation == VTK_PLANE_WIREFRAME ) { os << "Wireframe\n"; } else if ( this->Representation == VTK_PLANE_SURFACE ) { os << "Surface\n"; } else //( this->Representation == VTK_PLANE_OUTLINE ) { os << "Outline\n"; } os << indent << "Normal To X Axis: " << (this->NormalToXAxis ? "On" : "Off") << "\n"; os << indent << "Normal To Y Axis: " << (this->NormalToYAxis ? "On" : "Off") << "\n"; os << indent << "Normal To Z Axis: " << (this->NormalToZAxis ? "On" : "Off") << "\n"; int res = this->PlaneSource->GetXResolution(); double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); os << indent << "Resolution: " << res << "\n"; os << indent << "Origin: (" << o[0] << ", " << o[1] << ", " << o[2] << ")\n"; os << indent << "Point 1: (" << pt1[0] << ", " << pt1[1] << ", " << pt1[2] << ")\n"; os << indent << "Point 2: (" << pt2[0] << ", " << pt2[1] << ", " << pt2[2] << ")\n"; } void vtkPlaneWidget::PositionHandles() { double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); this->HandleGeometry[0]->SetCenter(o); this->HandleGeometry[1]->SetCenter(pt1); this->HandleGeometry[2]->SetCenter(pt2); double x[3]; x[0] = pt1[0] + pt2[0] - o[0]; x[1] = pt1[1] + pt2[1] - o[1]; x[2] = pt1[2] + pt2[2] - o[2]; this->HandleGeometry[3]->SetCenter(x); //far corner // set up the outline if ( this->Representation == VTK_PLANE_OUTLINE ) { this->PlaneOutline->GetPoints()->SetPoint(0,o); this->PlaneOutline->GetPoints()->SetPoint(1,pt1); this->PlaneOutline->GetPoints()->SetPoint(2,x); this->PlaneOutline->GetPoints()->SetPoint(3,pt2); this->PlaneOutline->GetPoints()->Modified(); } this->SelectRepresentation(); // Create the normal vector double center[3]; this->PlaneSource->GetCenter(center); this->LineSource->SetPoint1(center); this->LineSource2->SetPoint1(center); double p2[3]; this->PlaneSource->GetNormal(this->Normal); vtkMath::Normalize(this->Normal); double d = sqrt( vtkMath::Distance2BetweenPoints( this->PlaneSource->GetPoint1(),this->PlaneSource->GetPoint2()) ); p2[0] = center[0] + 0.35 * d * this->Normal[0]; p2[1] = center[1] + 0.35 * d * this->Normal[1]; p2[2] = center[2] + 0.35 * d * this->Normal[2]; this->LineSource->SetPoint2(p2); this->ConeSource->SetCenter(p2); this->ConeSource->SetDirection(this->Normal); p2[0] = center[0] - 0.35 * d * this->Normal[0]; p2[1] = center[1] - 0.35 * d * this->Normal[1]; p2[2] = center[2] - 0.35 * d * this->Normal[2]; this->LineSource2->SetPoint2(p2); this->ConeSource2->SetCenter(p2); this->ConeSource2->SetDirection(this->Normal); } int vtkPlaneWidget::HighlightHandle(vtkProp *prop) { // first unhighlight anything picked if ( this->CurrentHandle ) { this->CurrentHandle->SetProperty(this->HandleProperty); } this->CurrentHandle = static_cast<vtkActor *>(prop); if ( this->CurrentHandle ) { this->ValidPick = 1; this->HandlePicker->GetPickPosition(this->LastPickPosition); this->CurrentHandle->SetProperty(this->SelectedHandleProperty); for (int i=0; i<4; i++) //find handle { if ( this->CurrentHandle == this->Handle[i] ) { return i; } } } return -1; } void vtkPlaneWidget::HighlightNormal(int highlight) { if ( highlight ) { this->ValidPick = 1; this->PlanePicker->GetPickPosition(this->LastPickPosition); this->LineActor->SetProperty(this->SelectedHandleProperty); this->ConeActor->SetProperty(this->SelectedHandleProperty); this->LineActor2->SetProperty(this->SelectedHandleProperty); this->ConeActor2->SetProperty(this->SelectedHandleProperty); } else { this->LineActor->SetProperty(this->HandleProperty); this->ConeActor->SetProperty(this->HandleProperty); this->LineActor2->SetProperty(this->HandleProperty); this->ConeActor2->SetProperty(this->HandleProperty); } } void vtkPlaneWidget::HighlightPlane(int highlight) { if ( highlight ) { this->ValidPick = 1; this->PlanePicker->GetPickPosition(this->LastPickPosition); this->PlaneActor->SetProperty(this->SelectedPlaneProperty); } else { this->PlaneActor->SetProperty(this->PlaneProperty); } } void vtkPlaneWidget::OnStartPinch() { int X = this->Interactor->GetEventPosition()[0]; int Y = this->Interactor->GetEventPosition()[1]; // Okay, make sure that the pick is in the current renderer if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) { this->State = vtkPlaneWidget::Outside; return; } // Okay, we can process this. try to pick the plane. vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->PlanePicker); if ( path != nullptr ) { this->State = vtkPlaneWidget::Pinching; this->HighlightPlane(1); this->StartInteraction(); this->InvokeEvent(vtkCommand::StartInteractionEvent,nullptr); } } void vtkPlaneWidget::OnPinch() { if ( this->State != vtkPlaneWidget::Pinching) { return; } double sf = this->Interactor->GetScale()/this->Interactor->GetLastScale(); double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); double center[3]; center[0] = 0.5 * ( pt1[0] + pt2[0] ); center[1] = 0.5 * ( pt1[1] + pt2[1] ); center[2] = 0.5 * ( pt1[2] + pt2[2] ); // Move the corner points double origin[3], point1[3], point2[3]; for (int i=0; i<3; i++) { origin[i] = sf * (o[i] - center[i]) + center[i]; point1[i] = sf * (pt1[i] - center[i]) + center[i]; point2[i] = sf * (pt2[i] - center[i]) + center[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint1(point1); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); this->EventCallbackCommand->SetAbortFlag(1); this->InvokeEvent(vtkCommand::InteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnEndPinch() { if ( this->State != vtkPlaneWidget::Pinching) { return; } this->State = vtkPlaneWidget::Start; this->HighlightHandle(nullptr); this->HighlightPlane(0); this->HighlightNormal(0); this->SizeHandles(); this->EventCallbackCommand->SetAbortFlag(1); this->EndInteraction(); this->InvokeEvent(vtkCommand::EndInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnLeftButtonDown() { int X = this->Interactor->GetEventPosition()[0]; int Y = this->Interactor->GetEventPosition()[1]; // Okay, make sure that the pick is in the current renderer if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) { this->State = vtkPlaneWidget::Outside; return; } // Okay, we can process this. Try to pick handles first; // if no handles picked, then try to pick the plane. vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); if ( path != nullptr ) { this->State = vtkPlaneWidget::Moving; this->HighlightHandle(path->GetFirstNode()->GetViewProp()); } else { path = this->GetAssemblyPath(X, Y, 0., this->PlanePicker); if ( path != nullptr ) { vtkProp *prop = path->GetFirstNode()->GetViewProp(); if ( prop == this->ConeActor || prop == this->LineActor || prop == this->ConeActor2 || prop == this->LineActor2 ) { this->State = vtkPlaneWidget::Rotating; this->HighlightNormal(1); } else if (this->Interactor->GetControlKey()) { this->State = vtkPlaneWidget::Spinning; this->HighlightNormal(1); } else { this->State = vtkPlaneWidget::Moving; this->HighlightPlane(1); } } else { this->State = vtkPlaneWidget::Outside; this->HighlightHandle(nullptr); return; } } this->EventCallbackCommand->SetAbortFlag(1); this->StartInteraction(); this->InvokeEvent(vtkCommand::StartInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnLeftButtonUp() { if ( this->State == vtkPlaneWidget::Outside || this->State == vtkPlaneWidget::Start ) { return; } this->State = vtkPlaneWidget::Start; this->HighlightHandle(nullptr); this->HighlightPlane(0); this->HighlightNormal(0); this->SizeHandles(); this->EventCallbackCommand->SetAbortFlag(1); this->EndInteraction(); this->InvokeEvent(vtkCommand::EndInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnMiddleButtonDown() { int X = this->Interactor->GetEventPosition()[0]; int Y = this->Interactor->GetEventPosition()[1]; // Okay, make sure that the pick is in the current renderer if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) { this->State = vtkPlaneWidget::Outside; return; } // Okay, we can process this. If anything is picked, then we // can start pushing the plane. vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); if ( path != nullptr ) { this->State = vtkPlaneWidget::Pushing; this->HighlightPlane(1); this->HighlightNormal(1); this->HighlightHandle(path->GetFirstNode()->GetViewProp()); } else { path = this->GetAssemblyPath(X, Y, 0., this->PlanePicker); if ( path == nullptr ) //nothing picked { this->State = vtkPlaneWidget::Outside; return; } else { this->State = vtkPlaneWidget::Pushing; this->HighlightNormal(1); this->HighlightPlane(1); } } this->EventCallbackCommand->SetAbortFlag(1); this->StartInteraction(); this->InvokeEvent(vtkCommand::StartInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnMiddleButtonUp() { if ( this->State == vtkPlaneWidget::Outside || this->State == vtkPlaneWidget::Start ) { return; } this->State = vtkPlaneWidget::Start; this->HighlightPlane(0); this->HighlightNormal(0); this->HighlightHandle(nullptr); this->SizeHandles(); this->EventCallbackCommand->SetAbortFlag(1); this->EndInteraction(); this->InvokeEvent(vtkCommand::EndInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnRightButtonDown() { int X = this->Interactor->GetEventPosition()[0]; int Y = this->Interactor->GetEventPosition()[1]; // Okay, make sure that the pick is in the current renderer if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) { this->State = vtkPlaneWidget::Outside; return; } // Okay, we can process this. Try to pick handles first; // if no handles picked, then pick the bounding box. vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); if ( path != nullptr ) { this->State = vtkPlaneWidget::Scaling; this->HighlightPlane(1); this->HighlightHandle(path->GetFirstNode()->GetViewProp()); } else //see if we picked the plane or a normal { path = this->GetAssemblyPath(X, Y, 0., this->PlanePicker); if ( path == nullptr ) { this->State = vtkPlaneWidget::Outside; return; } else { this->State = vtkPlaneWidget::Scaling; this->HighlightPlane(1); } } this->EventCallbackCommand->SetAbortFlag(1); this->StartInteraction(); this->InvokeEvent(vtkCommand::StartInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnRightButtonUp() { if ( this->State == vtkPlaneWidget::Outside || this->State == vtkPlaneWidget::Start ) { return; } this->State = vtkPlaneWidget::Start; this->HighlightPlane(0); this->SizeHandles(); this->EventCallbackCommand->SetAbortFlag(1); this->EndInteraction(); this->InvokeEvent(vtkCommand::EndInteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::OnMouseMove() { // See whether we're active if ( this->State == vtkPlaneWidget::Outside || this->State == vtkPlaneWidget::Start ) { return; } int X = this->Interactor->GetEventPosition()[0]; int Y = this->Interactor->GetEventPosition()[1]; // Do different things depending on state // Calculations everybody does double focalPoint[4], pickPoint[4], prevPickPoint[4]; double z, vpn[3]; vtkCamera *camera = this->CurrentRenderer->GetActiveCamera(); if ( !camera ) { return; } // Compute the two points defining the motion vector this->ComputeWorldToDisplay(this->LastPickPosition[0], this->LastPickPosition[1], this->LastPickPosition[2], focalPoint); z = focalPoint[2]; this->ComputeDisplayToWorld( double(this->Interactor->GetLastEventPosition()[0]), double(this->Interactor->GetLastEventPosition()[1]), z, prevPickPoint); this->ComputeDisplayToWorld(double(X), double(Y), z, pickPoint); // Process the motion if ( this->State == vtkPlaneWidget::Moving ) { // Okay to process if ( this->CurrentHandle ) { if ( this->CurrentHandle == this->Handle[0] ) { this->MoveOrigin(prevPickPoint, pickPoint); } else if ( this->CurrentHandle == this->Handle[1] ) { this->MovePoint1(prevPickPoint, pickPoint); } else if ( this->CurrentHandle == this->Handle[2] ) { this->MovePoint2(prevPickPoint, pickPoint); } else if ( this->CurrentHandle == this->Handle[3] ) { this->MovePoint3(prevPickPoint, pickPoint); } } else //must be moving the plane { this->Translate(prevPickPoint, pickPoint); } } else if ( this->State == vtkPlaneWidget::Scaling ) { this->Scale(prevPickPoint, pickPoint, X, Y); } else if ( this->State == vtkPlaneWidget::Pushing ) { this->Push(prevPickPoint, pickPoint); } else if ( this->State == vtkPlaneWidget::Rotating ) { camera->GetViewPlaneNormal(vpn); this->Rotate(X, Y, prevPickPoint, pickPoint, vpn); } else if ( this->State == vtkPlaneWidget::Spinning ) { this->Spin(prevPickPoint, pickPoint); } // Interact, if desired this->EventCallbackCommand->SetAbortFlag(1); this->InvokeEvent(vtkCommand::InteractionEvent,nullptr); this->Interactor->Render(); } void vtkPlaneWidget::MoveOrigin(double *p1, double *p2) { //Get the plane definition double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); //Get the vector of motion double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // The point opposite the origin (pt3) stays fixed double pt3[3]; pt3[0] = o[0] + (pt1[0] - o[0]) + (pt2[0] - o[0]); pt3[1] = o[1] + (pt1[1] - o[1]) + (pt2[1] - o[1]); pt3[2] = o[2] + (pt1[2] - o[2]) + (pt2[2] - o[2]); // Define vectors from point pt3 double p13[3], p23[3]; p13[0] = pt1[0] - pt3[0]; p13[1] = pt1[1] - pt3[1]; p13[2] = pt1[2] - pt3[2]; p23[0] = pt2[0] - pt3[0]; p23[1] = pt2[1] - pt3[1]; p23[2] = pt2[2] - pt3[2]; double vN = vtkMath::Norm(v); double n13 = vtkMath::Norm(p13); double n23 = vtkMath::Norm(p23); // Project v onto these vector to determine the amount of motion // Scale it by the relative size of the motion to the vector length double d1 = (vN/n13) * vtkMath::Dot(v,p13) / (vN*n13); double d2 = (vN/n23) * vtkMath::Dot(v,p23) / (vN*n23); double point1[3], point2[3], origin[3]; for (int i=0; i<3; i++) { point1[i] = pt3[i] + (1.0+d1)*p13[i]; point2[i] = pt3[i] + (1.0+d2)*p23[i]; origin[i] = pt3[i] + (1.0+d1)*p13[i] + (1.0+d2)*p23[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint1(point1); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::MovePoint1(double *p1, double *p2) { //Get the plane definition double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); //Get the vector of motion double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // Need the point opposite the origin (pt3) double pt3[3]; pt3[0] = o[0] + (pt1[0] - o[0]) + (pt2[0] - o[0]); pt3[1] = o[1] + (pt1[1] - o[1]) + (pt2[1] - o[1]); pt3[2] = o[2] + (pt1[2] - o[2]) + (pt2[2] - o[2]); // Define vectors from point pt2 double p32[3], p02[3]; p02[0] = o[0] - pt2[0]; p02[1] = o[1] - pt2[1]; p02[2] = o[2] - pt2[2]; p32[0] = pt3[0] - pt2[0]; p32[1] = pt3[1] - pt2[1]; p32[2] = pt3[2] - pt2[2]; double vN = vtkMath::Norm(v); double n02 = vtkMath::Norm(p02); double n32 = vtkMath::Norm(p32); // if there is no motion then return if (vN == 0.0) { return; } // Project v onto these vector to determine the amount of motion // Scale it by the relative size of the motion to the vector length double d1 = (vN/n02) * vtkMath::Dot(v,p02) / (vN*n02); double d2 = (vN/n32) * vtkMath::Dot(v,p32) / (vN*n32); double point1[3], origin[3]; for (int i=0; i<3; i++) { origin[i] = pt2[i] + (1.0+d1)*p02[i]; point1[i] = pt2[i] + (1.0+d1)*p02[i] + (1.0+d2)*p32[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint1(point1); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::MovePoint2(double *p1, double *p2) { //Get the plane definition double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); //Get the vector of motion double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // The point opposite point2 (pt1) stays fixed double pt3[3]; pt3[0] = o[0] + (pt1[0] - o[0]) + (pt2[0] - o[0]); pt3[1] = o[1] + (pt1[1] - o[1]) + (pt2[1] - o[1]); pt3[2] = o[2] + (pt1[2] - o[2]) + (pt2[2] - o[2]); // Define vectors from point pt1 double p01[3], p31[3]; p31[0] = pt3[0] - pt1[0]; p31[1] = pt3[1] - pt1[1]; p31[2] = pt3[2] - pt1[2]; p01[0] = o[0] - pt1[0]; p01[1] = o[1] - pt1[1]; p01[2] = o[2] - pt1[2]; double vN = vtkMath::Norm(v); double n31 = vtkMath::Norm(p31); double n01 = vtkMath::Norm(p01); // if there is no motion then return if (vN == 0.0) { return; } // Project v onto these vector to determine the amount of motion // Scale it by the relative size of the motion to the vector length double d1 = (vN/n31) * vtkMath::Dot(v,p31) / (vN*n31); double d2 = (vN/n01) * vtkMath::Dot(v,p01) / (vN*n01); double point2[3], origin[3]; for (int i=0; i<3; i++) { point2[i] = pt1[i] + (1.0+d1)*p31[i] + (1.0+d2)*p01[i]; origin[i] = pt1[i] + (1.0+d2)*p01[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::MovePoint3(double *p1, double *p2) { //Get the plane definition double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); //Get the vector of motion double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // Define vectors from point pt3 double p10[3], p20[3]; p10[0] = pt1[0] - o[0]; p10[1] = pt1[1] - o[1]; p10[2] = pt1[2] - o[2]; p20[0] = pt2[0] - o[0]; p20[1] = pt2[1] - o[1]; p20[2] = pt2[2] - o[2]; double vN = vtkMath::Norm(v); double n10 = vtkMath::Norm(p10); double n20 = vtkMath::Norm(p20); // if there is no motion then return if (vN == 0.0) { return; } // Project v onto these vector to determine the amount of motion // Scale it by the relative size of the motion to the vector length double d1 = (vN/n10) * vtkMath::Dot(v,p10) / (vN*n10); double d2 = (vN/n20) * vtkMath::Dot(v,p20) / (vN*n20); double point1[3], point2[3]; for (int i=0; i<3; i++) { point1[i] = o[i] + (1.0+d1)*p10[i]; point2[i] = o[i] + (1.0+d2)*p20[i]; } this->PlaneSource->SetPoint1(point1); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::Rotate(int X, int Y, double *p1, double *p2, double *vpn) { double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); double *center = this->PlaneSource->GetCenter(); double v[3]; //vector of motion double axis[3]; //axis of rotation double theta; //rotation angle // mouse motion vector in world space v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // Create axis of rotation and angle of rotation vtkMath::Cross(vpn,v,axis); if ( vtkMath::Normalize(axis) == 0.0 ) { return; } int *size = this->CurrentRenderer->GetSize(); double l2 = (X-this->Interactor->GetLastEventPosition()[0])* (X-this->Interactor->GetLastEventPosition()[0]) + (Y-this->Interactor->GetLastEventPosition()[1])* (Y-this->Interactor->GetLastEventPosition()[1]); theta = 360.0 * sqrt(l2/(size[0]*size[0]+size[1]*size[1])); //Manipulate the transform to reflect the rotation this->Transform->Identity(); this->Transform->Translate(center[0],center[1],center[2]); this->Transform->RotateWXYZ(theta,axis); this->Transform->Translate(-center[0],-center[1],-center[2]); //Set the corners double oNew[3], pt1New[3], pt2New[3]; this->Transform->TransformPoint(o,oNew); this->Transform->TransformPoint(pt1,pt1New); this->Transform->TransformPoint(pt2,pt2New); this->PlaneSource->SetOrigin(oNew); this->PlaneSource->SetPoint1(pt1New); this->PlaneSource->SetPoint2(pt2New); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::Spin(double *p1, double *p2) { // Mouse motion vector in world space double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; double* normal = this->PlaneSource->GetNormal(); // Axis of rotation double axis[3] = { normal[0], normal[1], normal[2] }; vtkMath::Normalize(axis); double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); double *center = this->PlaneSource->GetCenter(); // Radius vector (from center to cursor position) double rv[3] = {p2[0] - center[0], p2[1] - center[1], p2[2] - center[2]}; // Distance between center and cursor location double rs = vtkMath::Normalize(rv); // Spin direction double ax_cross_rv[3]; vtkMath::Cross(axis,rv,ax_cross_rv); // Spin angle double theta = vtkMath::DegreesFromRadians( vtkMath::Dot( v, ax_cross_rv ) / rs ); // Manipulate the transform to reflect the rotation this->Transform->Identity(); this->Transform->Translate(center[0],center[1],center[2]); this->Transform->RotateWXYZ(theta,axis); this->Transform->Translate(-center[0],-center[1],-center[2]); //Set the corners double oNew[3], pt1New[3], pt2New[3]; this->Transform->TransformPoint(o,oNew); this->Transform->TransformPoint(pt1,pt1New); this->Transform->TransformPoint(pt2,pt2New); this->PlaneSource->SetOrigin(oNew); this->PlaneSource->SetPoint1(pt1New); this->PlaneSource->SetPoint2(pt2New); this->PlaneSource->Update(); this->PositionHandles(); } // Loop through all points and translate them void vtkPlaneWidget::Translate(double *p1, double *p2) { //Get the motion vector double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; //int res = this->PlaneSource->GetXResolution(); double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); double origin[3], point1[3], point2[3]; for (int i=0; i<3; i++) { origin[i] = o[i] + v[i]; point1[i] = pt1[i] + v[i]; point2[i] = pt2[i] + v[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint1(point1); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::Scale(double *p1, double *p2, int vtkNotUsed(X), int Y) { //Get the motion vector double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; //int res = this->PlaneSource->GetXResolution(); double *o = this->PlaneSource->GetOrigin(); double *pt1 = this->PlaneSource->GetPoint1(); double *pt2 = this->PlaneSource->GetPoint2(); double center[3]; center[0] = 0.5 * ( pt1[0] + pt2[0] ); center[1] = 0.5 * ( pt1[1] + pt2[1] ); center[2] = 0.5 * ( pt1[2] + pt2[2] ); // Compute the scale factor double sf = vtkMath::Norm(v) / sqrt(vtkMath::Distance2BetweenPoints(pt1,pt2)); if ( Y > this->Interactor->GetLastEventPosition()[1] ) { sf = 1.0 + sf; } else { sf = 1.0 - sf; } // Move the corner points double origin[3], point1[3], point2[3]; for (int i=0; i<3; i++) { origin[i] = sf * (o[i] - center[i]) + center[i]; point1[i] = sf * (pt1[i] - center[i]) + center[i]; point2[i] = sf * (pt2[i] - center[i]) + center[i]; } this->PlaneSource->SetOrigin(origin); this->PlaneSource->SetPoint1(point1); this->PlaneSource->SetPoint2(point2); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::Push(double *p1, double *p2) { //Get the motion vector double v[3]; v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; this->PlaneSource->Push( vtkMath::Dot(v,this->Normal) ); this->PlaneSource->Update(); this->PositionHandles(); } void vtkPlaneWidget::CreateDefaultProperties() { // Handle properties this->HandleProperty = vtkProperty::New(); this->HandleProperty->SetColor(1,1,1); this->SelectedHandleProperty = vtkProperty::New(); this->SelectedHandleProperty->SetColor(1,0,0); // Plane properties this->PlaneProperty = vtkProperty::New(); this->PlaneProperty->SetAmbient(1.0); this->PlaneProperty->SetAmbientColor(1.0,1.0,1.0); this->SelectedPlaneProperty = vtkProperty::New(); this->SelectRepresentation(); this->SelectedPlaneProperty->SetAmbient(1.0); this->SelectedPlaneProperty->SetAmbientColor(0.0,1.0,0.0); } void vtkPlaneWidget::PlaceWidget(double bds[6]) { int i; double bounds[6], center[3]; this->AdjustBounds(bds, bounds, center); if (this->GetInput() || this->Prop3D) { if ( this->NormalToYAxis ) { this->PlaneSource->SetOrigin(bounds[0],center[1],bounds[4]); this->PlaneSource->SetPoint1(bounds[1],center[1],bounds[4]); this->PlaneSource->SetPoint2(bounds[0],center[1],bounds[5]); } else if ( this->NormalToZAxis ) { this->PlaneSource->SetOrigin(bounds[0],bounds[2],center[2]); this->PlaneSource->SetPoint1(bounds[1],bounds[2],center[2]); this->PlaneSource->SetPoint2(bounds[0],bounds[3],center[2]); } else //default or x-normal { this->PlaneSource->SetOrigin(center[0],bounds[2],bounds[4]); this->PlaneSource->SetPoint1(center[0],bounds[3],bounds[4]); this->PlaneSource->SetPoint2(center[0],bounds[2],bounds[5]); } } this->PlaneSource->Update(); // Position the handles at the end of the planes this->PositionHandles(); for (i=0; i<6; i++) { this->InitialBounds[i] = bounds[i]; } if (this->GetInput() || this->Prop3D) { this->InitialLength = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); } else { // this means we have to make use of the PolyDataSource, so // we just calculate the magnitude of the longest diagonal on // the plane and use that as InitialLength double origin[3], point1[3], point2[3]; this->PlaneSource->GetOrigin(origin); this->PlaneSource->GetPoint1(point1); this->PlaneSource->GetPoint2(point2); double sqr1 = 0, sqr2 = 0; for (i = 0; i < 3; i++) { sqr1 += (point1[i] - origin[i]) * (point1[i] - origin[i]); sqr2 += (point2[i] - origin[i]) * (point2[i] - origin[i]); } this->InitialLength = sqrt(sqr1 + sqr2); } // Set the radius on the sphere handles this->SizeHandles(); } void vtkPlaneWidget::SizeHandles() { double radius = this->vtk3DWidget::SizeHandles(this->HandleSizeFactor); if (this->ValidPick && !this->LastPickValid) { // Adjust factor to preserve old radius. double oldradius = this->HandleGeometry[0]->GetRadius(); if (oldradius != 0 && radius != 0) { this->HandleSizeFactor = oldradius / radius; radius = oldradius; } } this->LastPickValid = this->ValidPick; for(int i=0; i<4; i++) { this->HandleGeometry[i]->SetRadius(radius); } // Set the height and radius of the cone this->ConeSource->SetHeight(2.0*radius); this->ConeSource->SetRadius(radius); this->ConeSource2->SetHeight(2.0*radius); this->ConeSource2->SetRadius(radius); } void vtkPlaneWidget::SelectRepresentation() { if ( ! this->CurrentRenderer ) { return; } if ( this->Representation == VTK_PLANE_OFF ) { this->CurrentRenderer->RemoveActor(this->PlaneActor); } else if ( this->Representation == VTK_PLANE_OUTLINE ) { this->CurrentRenderer->RemoveActor(this->PlaneActor); this->CurrentRenderer->AddActor(this->PlaneActor); this->PlaneMapper->SetInputData( this->PlaneOutline ); this->PlaneActor->GetProperty()->SetRepresentationToWireframe(); } else if ( this->Representation == VTK_PLANE_SURFACE ) { this->CurrentRenderer->RemoveActor(this->PlaneActor); this->CurrentRenderer->AddActor(this->PlaneActor); this->PlaneMapper->SetInputConnection( this->PlaneSource->GetOutputPort() ); this->PlaneActor->GetProperty()->SetRepresentationToSurface(); } else //( this->Representation == VTK_PLANE_WIREFRAME ) { this->CurrentRenderer->RemoveActor(this->PlaneActor); this->CurrentRenderer->AddActor(this->PlaneActor); this->PlaneMapper->SetInputConnection( this->PlaneSource->GetOutputPort() ); this->PlaneActor->GetProperty()->SetRepresentationToWireframe(); } } // Description: // Set/Get the resolution (number of subdivisions) of the plane. void vtkPlaneWidget::SetResolution(int r) { this->PlaneSource->SetXResolution(r); this->PlaneSource->SetYResolution(r); } int vtkPlaneWidget::GetResolution() { return this->PlaneSource->GetXResolution(); } // Description: // Set/Get the origin of the plane. void vtkPlaneWidget::SetOrigin(double x, double y, double z) { this->PlaneSource->SetOrigin(x,y,z); this->PositionHandles(); } void vtkPlaneWidget::SetOrigin(double x[3]) { this->SetOrigin(x[0], x[1], x[2]); } double* vtkPlaneWidget::GetOrigin() { return this->PlaneSource->GetOrigin(); } void vtkPlaneWidget::GetOrigin(double xyz[3]) { this->PlaneSource->GetOrigin(xyz); } // Description: // Set/Get the position of the point defining the first axis of the plane. void vtkPlaneWidget::SetPoint1(double x, double y, double z) { this->PlaneSource->SetPoint1(x,y,z); this->PositionHandles(); } void vtkPlaneWidget::SetPoint1(double x[3]) { this->SetPoint1(x[0], x[1], x[2]); } double* vtkPlaneWidget::GetPoint1() { return this->PlaneSource->GetPoint1(); } void vtkPlaneWidget::GetPoint1(double xyz[3]) { this->PlaneSource->GetPoint1(xyz); } // Description: // Set/Get the position of the point defining the second axis of the plane. void vtkPlaneWidget::SetPoint2(double x, double y, double z) { this->PlaneSource->SetPoint2(x,y,z); this->PositionHandles(); } void vtkPlaneWidget::SetPoint2(double x[3]) { this->SetPoint2(x[0], x[1], x[2]); } double* vtkPlaneWidget::GetPoint2() { return this->PlaneSource->GetPoint2(); } void vtkPlaneWidget::GetPoint2(double xyz[3]) { this->PlaneSource->GetPoint2(xyz); } // Description: // Set the center of the plane. void vtkPlaneWidget::SetCenter(double x, double y, double z) { this->PlaneSource->SetCenter(x, y, z); this->PositionHandles(); } // Description: // Set the center of the plane. void vtkPlaneWidget::SetCenter(double c[3]) { this->SetCenter(c[0], c[1], c[2]); } // Description: // Get the center of the plane. double* vtkPlaneWidget::GetCenter() { return this->PlaneSource->GetCenter(); } void vtkPlaneWidget::GetCenter(double xyz[3]) { this->PlaneSource->GetCenter(xyz); } // Description: // Set the normal to the plane. void vtkPlaneWidget::SetNormal(double x, double y, double z) { this->PlaneSource->SetNormal(x, y, z); this->PositionHandles(); } // Description: // Set the normal to the plane. void vtkPlaneWidget::SetNormal(double n[3]) { this->SetNormal(n[0], n[1], n[2]); } // Description: // Get the normal to the plane. double* vtkPlaneWidget::GetNormal() { return this->PlaneSource->GetNormal(); } void vtkPlaneWidget::GetNormal(double xyz[3]) { this->PlaneSource->GetNormal(xyz); } void vtkPlaneWidget::GetPolyData(vtkPolyData *pd) { pd->ShallowCopy(this->PlaneSource->GetOutput()); } vtkPolyDataAlgorithm *vtkPlaneWidget::GetPolyDataAlgorithm() { return this->PlaneSource; } void vtkPlaneWidget::GetPlane(vtkPlane *plane) { if ( plane == nullptr ) { return; } plane->SetNormal(this->GetNormal()); plane->SetOrigin(this->GetCenter()); } void vtkPlaneWidget::UpdatePlacement(void) { this->PlaneSource->Update(); this->PositionHandles(); }
// C++. #include <sstream> #include <cassert> // Qt. #include <QMouseEvent> #include <QToolTip> // Local. #include "radeon_gpu_analyzer_gui/qt/rg_check_box.h" #include "radeon_gpu_analyzer_gui/rg_data_types_opencl.h" RgCheckBox::RgCheckBox(QWidget* parent) : QCheckBox(parent) { } void RgCheckBox::focusInEvent(QFocusEvent* event) { emit CheckBoxFocusInEvent(); // Pass the event onto the base class. QCheckBox::focusInEvent(event); } void RgCheckBox::focusOutEvent(QFocusEvent* event) { emit CheckBoxFocusOutEvent(); // Pass the event onto the base class. QCheckBox::focusOutEvent(event); } void RgCheckBox::mouseMoveEvent(QMouseEvent* event) { // Get the widget name. QString widgetName = this->objectName(); // Set tooltip for the widget hovered over. QString tooltip = TOOLTIPS[widgetName]; // Display the tooltip. QToolTip::showText(event->globalPos(), tooltip); // Pass the event onto the base class. QCheckBox::mouseMoveEvent(event); }
; ;---------------------------------------------------------------- ; 32-bit x86 assembler code for Skein block functions ; ; Author: Doug Whiting, Hifn ; ; This code is released to the public domain. ;---------------------------------------------------------------- ; .386p .model flat .code ; _MASK_ALL_ equ (256+512+1024) ;all three algorithm bits ; ;;;;;;;;;;;;;;;;; ifndef SKEIN_USE_ASM _USE_ASM_ = _MASK_ALL_ elseif SKEIN_USE_ASM and _MASK_ALL_ _USE_ASM_ = SKEIN_USE_ASM else _USE_ASM_ = _MASK_ALL_ endif ;;;;;;;;;;;;;;;;; ifndef SKEIN_LOOP _SKEIN_LOOP = 0 ;default is all fully unrolled else _SKEIN_LOOP = SKEIN_LOOP endif ; the unroll counts (0 --> fully unrolled) SKEIN_UNROLL_256 = (_SKEIN_LOOP / 100) mod 10 SKEIN_UNROLL_512 = (_SKEIN_LOOP / 10) mod 10 SKEIN_UNROLL_1024 = (_SKEIN_LOOP ) mod 10 ; SKEIN_ASM_UNROLL = 0 irp _NN_,<256,512,1024> if (SKEIN_UNROLL_&_NN_) eq 0 SKEIN_ASM_UNROLL = SKEIN_ASM_UNROLL + _NN_ endif endm ;;;;;;;;;;;;;;;;; ; ifndef SKEIN_ROUNDS ROUNDS_256 = 72 ROUNDS_512 = 72 ROUNDS_1024 = 80 else ROUNDS_256 = 8*((((SKEIN_ROUNDS / 100) + 5) mod 10) + 5) ROUNDS_512 = 8*((((SKEIN_ROUNDS / 10) + 5) mod 10) + 5) ROUNDS_1024 = 8*((((SKEIN_ROUNDS ) + 5) mod 10) + 5) endif irp _NN_,<256,512,1024> if _USE_ASM_ and _NN_ irp _RR_,<%(ROUNDS_&_NN_)> if _NN_ eq 1024 %out +++ SKEIN_ROUNDS_&_NN_ = _RR_ else %out +++ SKEIN_ROUNDS_&_NN_ = _RR_ endif endm endif endm ;;;;;;;;;;;;;;;;; ; ifdef SKEIN_CODE_SIZE _SKEIN_CODE_SIZE equ (1) else ifdef SKEIN_PERF ;use code size if SKEIN_PERF is defined _SKEIN_CODE_SIZE equ (1) endif endif ; ;;;;;;;;;;;;;;;;; ; ifndef SKEIN_DEBUG _SKEIN_DEBUG = 0 else _SKEIN_DEBUG = 1 endif ;;;;;;;;;;;;;;;;; ; ; define offsets of fields in hash context structure ; HASH_BITS = 0 ;# bits of hash output BCNT = 4 + HASH_BITS ;number of bytes in BUFFER[] TWEAK = 4 + BCNT ;tweak values[0..1] X_VARS = 16 + TWEAK ;chaining vars ; ;(Note: buffer[] in context structure is NOT needed here :-) ; KW_PARITY_LO= 0A9FC1A22h ;overall parity of key schedule words (hi32/lo32) KW_PARITY_HI= 01BD11BDAh ;overall parity of key schedule words (hi32/lo32) FIRST_MASK = NOT (1 SHL 30) ;FIRST block flag bit ; ; rotation constants for Skein ; RC_256_0_0 = 14 RC_256_0_1 = 16 RC_256_1_0 = 52 RC_256_1_1 = 57 RC_256_2_0 = 23 RC_256_2_1 = 40 RC_256_3_0 = 5 RC_256_3_1 = 37 RC_256_4_0 = 25 RC_256_4_1 = 33 RC_256_5_0 = 46 RC_256_5_1 = 12 RC_256_6_0 = 58 RC_256_6_1 = 22 RC_256_7_0 = 32 RC_256_7_1 = 32 RC_512_0_0 = 46 RC_512_0_1 = 36 RC_512_0_2 = 19 RC_512_0_3 = 37 RC_512_1_0 = 33 RC_512_1_1 = 27 RC_512_1_2 = 14 RC_512_1_3 = 42 RC_512_2_0 = 17 RC_512_2_1 = 49 RC_512_2_2 = 36 RC_512_2_3 = 39 RC_512_3_0 = 44 RC_512_3_1 = 9 RC_512_3_2 = 54 RC_512_3_3 = 56 RC_512_4_0 = 39 RC_512_4_1 = 30 RC_512_4_2 = 34 RC_512_4_3 = 24 RC_512_5_0 = 13 RC_512_5_1 = 50 RC_512_5_2 = 10 RC_512_5_3 = 17 RC_512_6_0 = 25 RC_512_6_1 = 29 RC_512_6_2 = 39 RC_512_6_3 = 43 RC_512_7_0 = 8 RC_512_7_1 = 35 RC_512_7_2 = 56 RC_512_7_3 = 22 RC_1024_0_0 = 24 RC_1024_0_1 = 13 RC_1024_0_2 = 8 RC_1024_0_3 = 47 RC_1024_0_4 = 8 RC_1024_0_5 = 17 RC_1024_0_6 = 22 RC_1024_0_7 = 37 RC_1024_1_0 = 38 RC_1024_1_1 = 19 RC_1024_1_2 = 10 RC_1024_1_3 = 55 RC_1024_1_4 = 49 RC_1024_1_5 = 18 RC_1024_1_6 = 23 RC_1024_1_7 = 52 RC_1024_2_0 = 33 RC_1024_2_1 = 4 RC_1024_2_2 = 51 RC_1024_2_3 = 13 RC_1024_2_4 = 34 RC_1024_2_5 = 41 RC_1024_2_6 = 59 RC_1024_2_7 = 17 RC_1024_3_0 = 5 RC_1024_3_1 = 20 RC_1024_3_2 = 48 RC_1024_3_3 = 41 RC_1024_3_4 = 47 RC_1024_3_5 = 28 RC_1024_3_6 = 16 RC_1024_3_7 = 25 RC_1024_4_0 = 41 RC_1024_4_1 = 9 RC_1024_4_2 = 37 RC_1024_4_3 = 31 RC_1024_4_4 = 12 RC_1024_4_5 = 47 RC_1024_4_6 = 44 RC_1024_4_7 = 30 RC_1024_5_0 = 16 RC_1024_5_1 = 34 RC_1024_5_2 = 56 RC_1024_5_3 = 51 RC_1024_5_4 = 4 RC_1024_5_5 = 53 RC_1024_5_6 = 42 RC_1024_5_7 = 41 RC_1024_6_0 = 31 RC_1024_6_1 = 44 RC_1024_6_2 = 47 RC_1024_6_3 = 46 RC_1024_6_4 = 19 RC_1024_6_5 = 42 RC_1024_6_6 = 44 RC_1024_6_7 = 25 RC_1024_7_0 = 9 RC_1024_7_1 = 48 RC_1024_7_2 = 35 RC_1024_7_3 = 52 RC_1024_7_4 = 23 RC_1024_7_5 = 31 RC_1024_7_6 = 37 RC_1024_7_7 = 20 ; ; Input: rHi,rLo ; Output: <rHi,rLo> <<< _RCNT_ Rol64 macro rHi,rLo,tmp,_RCNT_ if _RCNT_ ;is there anything to do? if _RCNT_ lt 32 mov tmp,rLo shld rLo,rHi,_RCNT_ shld rHi,tmp,_RCNT_ elseif _RCNT_ gt 32 mov tmp,rLo shrd rLo,rHi,((64-_RCNT_) AND 63) shrd rHi,tmp,((64-_RCNT_) AND 63) else xchg rHi,rLo ;special case for _RCNT_ == 32 endif endif endm ; ; Input: rHi,rLo ; Output: <rHi,rLo> <<< rName&&rNum, and tmp trashed; RotL64 macro rHi,rLo,tmp,BLK_SIZE,ROUND_NUM,MIX_NUM _RCNT_ = ( RC_&BLK_SIZE&_&ROUND_NUM&_&MIX_NUM AND 63 ) Rol64 rHi,rLo,tmp,_RCNT_ endm ; ;---------------------------------------------------------------- ; declare allocated space on the stack StackVar macro localName,localSize localName = _STK_OFFS_ _STK_OFFS_ = _STK_OFFS_+(localSize) endm ;StackVar ; ;---------------------------------------------------------------- ; ; MACRO: Configure stack frame, allocate local vars ; Setup_Stack macro WCNT,KS_CNT _STK_OFFS_ = 0 ;starting offset from esp ;----- local variables ;<-- esp StackVar X_stk ,8*(WCNT) ;local context vars StackVar Wcopy ,8*(WCNT) ;copy of input block StackVar ksTwk ,8*3 ;key schedule: tweak words StackVar ksKey ,8*(WCNT)+8 ;key schedule: key words if WCNT le 8 FRAME_OFFS = _STK_OFFS_ ;<-- ebp else FRAME_OFFS = _STK_OFFS_-8*4 ;<-- ebp endif if (SKEIN_ASM_UNROLL and (WCNT*64)) eq 0 StackVar ksRot ,16*(KS_CNT+0);leave space for "rotation" to happen endif LOCAL_SIZE = _STK_OFFS_ ;size of local vars ;----- StackVar savRegs,8*4 ;pushad data StackVar retAddr,4 ;return address ;----- caller parameters StackVar ctxPtr ,4 ;context ptr StackVar blkPtr ,4 ;pointer to block data StackVar blkCnt ,4 ;number of full blocks to process StackVar bitAdd ,4 ;bit count to add to tweak ;----- caller's stack frame ; ; Notes on stack frame setup: ; * the most frequently used variable is X_stk[], based at [esp+0] ; * the next most used is the key schedule words ; so ebp is "centered" there, allowing short offsets to the key/tweak ; schedule even in 1024-bit Skein case ; * the Wcopy variables are infrequently accessed, but they have long ; offsets from both esp and ebp only in the 1024-bit case. ; * all other local vars and calling parameters can be accessed ; with short offsets, except in the 1024-bit case ; pushad ;save all regs sub esp,LOCAL_SIZE ;make room for the locals lea ebp,[esp+FRAME_OFFS] ;maximize use of short offsets mov edi,[FP_+ctxPtr ] ;edi --> context ; endm ;Setup_Stack ; FP_ equ <ebp-FRAME_OFFS> ;keep as many short offsets as possible ; ;---------------------------------------------------------------- ; Reset_Stack macro procStart add esp,LOCAL_SIZE ;get rid of locals (wipe??) popad ;restore all regs ;display code size in bytes to stdout irp _BCNT_,<%($+1-procStart)> ;account for return opcode if _BCNT_ ge 10000 ;(align it all pretty) %out procStart code size = _BCNT_ bytes elseif _BCNT_ ge 1000 %out procStart code size = _BCNT_ bytes else %out procStart code size = _BCNT_ bytes endif endm ;irp _BCNT_ endm ; Reset_Stack ; ;---------------------------------------------------------------- ; macros to help debug internals ; if _SKEIN_DEBUG extrn _Skein_Show_Block:near ;calls to C routines extrn _Skein_Show_Round:near ; SKEIN_RND_SPECIAL = 1000 SKEIN_RND_KEY_INITIAL = SKEIN_RND_SPECIAL+0 SKEIN_RND_KEY_INJECT = SKEIN_RND_SPECIAL+1 SKEIN_RND_FEED_FWD = SKEIN_RND_SPECIAL+2 ; Skein_Debug_Block macro BLK_BITS ; ;void Skein_Show_Block(uint_t bits,const Skein_Ctxt_Hdr_t *h,const u64b_t *X, ; const u08b_t *blkPtr, const u64b_t *wPtr, ; const u64b_t *ksPtr,const u64b_t *tsPtr); ; pushad ;save all regs lea eax,[FP_+ksTwk] lea ebx,[FP_+ksKey] lea ecx,[esp+32+Wcopy] mov edx,[FP_+ctxPtr] ;ctx_hdr_ptr lea edx,[edx+X_VARS] ;edx ==> cxt->X[] push eax ;tsPtr push ebx ;ksPtr push ecx ;wPtr push dword ptr [FP_+blkPtr] ;blkPtr push edx ;ctx->Xptr push dword ptr [FP_+ctxPtr] ;ctx_hdr_ptr mov eax,BLK_BITS push eax ;bits ifdef _MINGW_ call _Skein_Show_Block-4 ;strange linkage?? else call _Skein_Show_Block endif add esp,7*4 ;discard parameter space on stack popad ;restore regs endm ;Skein_Debug_Block ; Skein_Debug_Round macro BLK_SIZE,R,saveRegs ; ;void Skein_Show_Round(uint_t bits,const Skein_Ctxt_Hdr_t *h,int r,const u64b_t *X); ; ifnb <saveRegs> mov [esp+X_stk+ 0],eax ;save internal vars for debug dump mov [esp+X_stk+ 4],ebx mov [esp+X_stk+ 8],ecx mov [esp+X_stk+12],edx endif pushad ;save all regs if R ne SKEIN_RND_FEED_FWD lea eax,[esp+32+X_stk] else mov eax,[FP_+ctxPtr] add eax,X_VARS endif push eax ;Xptr if (SKEIN_ASM_UNROLL and BLK_SIZE) or (R ge SKEIN_RND_SPECIAL) mov eax,R else lea eax,[4*edi+1+(((R)-1) and 3)] ;compute round number using edi endif push eax ;round number push dword ptr [FP_+ctxPtr] ;ctx_hdr_ptr mov eax,BLK_SIZE push eax ;bits ifdef _MINGW_ call _Skein_Show_Round-4 ;strange linkage?? else call _Skein_Show_Round endif add esp,4*4 ;discard parameter space on stack popad ;restore regs endm ;Skein_Debug_Round endif ;ifdef SKEIN_DEBUG ; ;---------------------------------------------------------------- ; ; MACRO: a mix step ; MixStep macro BLK_SIZE,ld_A,ld_C,st_A,st_C,RotNum0,RotNum1,_debug_ ifnb <ld_A> mov eax,[esp+X_stk+8*(ld_A)+0] mov ebx,[esp+X_stk+8*(ld_A)+4] endif ifnb <ld_C> mov ecx,[esp+X_stk+8*(ld_C)+0] mov edx,[esp+X_stk+8*(ld_C)+4] endif add eax, ecx ;X[A] += X[C] adc ebx, edx ifnb <st_A> mov [esp+X_stk+8*(st_A)+0],eax mov [esp+X_stk+8*(st_A)+4],ebx endif __rNum0 = (RotNum0) AND 7 RotL64 ecx, edx, esi,%(BLK_SIZE),%(__rNum0),%(RotNum1) ;X[C] <<<= RC_<BLK_BITS,RotNum0,RotNum1> xor ecx, eax ;X[C] ^= X[A] xor edx, ebx if _SKEIN_DEBUG or (0 eq (_debug_ + 0)) ifb <st_C> mov [esp+X_stk+8*(ld_C)+0],ecx mov [esp+X_stk+8*(ld_C)+4],edx else mov [esp+X_stk+8*(st_C)+0],ecx mov [esp+X_stk+8*(st_C)+4],edx endif endif if _SKEIN_DEBUG and (0 ne (_debug_ + 0)) Skein_Debug_Round BLK_SIZE,%(RotNum0+1) endif endm ;MixStep ; ;;;;;;;;;;;;;;;;; ; ; MACRO: key schedule injection ; ks_Inject macro BLK_SIZE,X_load,X_stor,rLo,rHi,rndBase,keyIdx,twkIdx,ROUND_ADD ;are rLo,rHi values already loaded? if not, load them now ifnb <X_load> mov rLo,[esp+X_stk +8*(X_load) ] mov rHi,[esp+X_stk +8*(X_load)+4] endif ;inject the 64-bit key schedule value (and maybe the tweak as well) if SKEIN_ASM_UNROLL and BLK_SIZE _kOffs_ = ((rndBase)+(keyIdx)) mod ((BLK_SIZE/64)+1) add rLo,[FP_+ksKey+8*_kOffs_+ 0] adc rHi,[FP_+ksKey+8*_kOffs_+ 4] ifnb <twkIdx> _tOffs_ = ((rndBase)+(twkIdx)) mod 3 add rLo,[FP_+ksTwk+8*_tOffs_+ 0] adc rHi,[FP_+ksTwk+8*_tOffs_+ 4] endif ifnb <ROUND_ADD> add rLo,(ROUND_ADD) adc rHi,0 endif else add rLo,[FP_+ksKey+8*(keyIdx)+8*edi ] adc rHi,[FP_+ksKey+8*(keyIdx)+8*edi+4] ifnb <twkIdx> add rLo,[FP_+ksTwk+8*(twkIdx)+8*edi ] adc rHi,[FP_+ksTwk+8*(twkIdx)+8*edi+4] endif ifnb <ROUND_ADD> add rLo,edi ;edi is the round number adc rHi,0 endif endif ;do we need to store updated rLo,rHi values? if so, do it now ifnb <X_stor> mov [esp+X_stk +8*(X_stor) ],rLo mov [esp+X_stk +8*(X_stor)+4],rHi endif endm ;ks_Inject ; ;---------------------------------------------------------------- ; MACRO: key schedule rotation ; ks_Rotate macro rLo,rHi,WCNT mov rLo,[FP_+ksKey+8*edi+ 0] ;"rotate" the key schedule in memory mov rHi,[FP_+ksKey+8*edi+ 4] mov [FP_+ksKey+8*edi+8*(WCNT+1)+ 0],rLo mov [FP_+ksKey+8*edi+8*(WCNT+1)+ 4],rHi mov rLo,[FP_+ksTwk+8*edi+ 0] mov rHi,[FP_+ksTwk+8*edi+ 4] mov [FP_+ksTwk+8*edi+8*3+ 0],rLo mov [FP_+ksTwk+8*edi+8*3+ 4],rHi endm ; ;---------------------------------------------------------------- ; if _USE_ASM_ and 256 public _Skein_256_Process_Block ; ; void Skein_256_Process_Block(Skein_256_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd); ; ;;;;;;;;;;;;;;;;; ; ; MACRO: two rounds ; R_256_TwoRounds macro _RR_,ld_0 ; here with edx:ecx = X[1] ;--------- round _RR_ MixStep 256,ld_0, ,0,1,((_RR_)+0),0 MixStep 256, 2,3,2,3,((_RR_)+0),1,1 ; here with edx:ecx = X[3] ;--------- round _RR_ + 1 MixStep 256, 0, ,0,3,((_RR_)+1),0 MixStep 256, 2,1,2,1,((_RR_)+1),1,1 ; here with edx:ecx = X[1] endm ;R_256_TwoRounds ; ;;;;;;;;;;;;;;;;; ; ; code ; _Skein_256_Process_Block proc near WCNT = 4 ;WCNT=4 for Skein-256 Setup_Stack WCNT,(ROUNDS_256/8) ; main hash loop for Skein_256 Skein_256_block_loop: mov eax,[edi+TWEAK+ 0] ;ebx:eax = tweak word T0 mov ebx,[edi+TWEAK+ 4] mov ecx,[edi+TWEAK+ 8] ;edx:ecx = tweak word T1 mov edx,[edi+TWEAK+12] add eax,[FP_+bitAdd ] ;bump T0 by the bitAdd parameter adc ebx, 0 mov [edi+TWEAK ],eax ;save updated tweak value T0 mov [edi+TWEAK+ 4],ebx mov [FP_+ksTwk ],eax ;build the tweak schedule on the stack mov [FP_+ksTwk+ 4],ebx xor eax,ecx ;ebx:eax = T0 ^ T1 xor ebx,edx mov [FP_+ksTwk+ 8],ecx mov [FP_+ksTwk+12],edx mov [FP_+ksTwk+16],eax mov [FP_+ksTwk+20],ebx mov eax,KW_PARITY_LO ;init parity accumulator mov ebx,KW_PARITY_HI ; _NN_ = 0 rept WCNT ;copy in the chaining vars mov ecx,[edi+X_VARS+_NN_ ] mov edx,[edi+X_VARS+_NN_+ 4] xor eax,ecx ;compute overall parity along the way xor ebx,edx mov [FP_+ksKey +_NN_ ],ecx mov [FP_+ksKey +_NN_+ 4],edx _NN_ = _NN_+8 endm ; mov [FP_+ksKey +_NN_ ],eax ;save overall parity at the end of the array mov [FP_+ksKey +_NN_+ 4],ebx mov esi,[FP_+blkPtr ] ;esi --> input block ; _NN_ = WCNT*8-16 ;work down from the end rept WCNT/2 ;perform initial key injection mov eax,[esi+_NN_ + 0] mov ebx,[esi+_NN_ + 4] mov ecx,[esi+_NN_ + 8] mov edx,[esi+_NN_ +12] mov [esp+_NN_+Wcopy + 0],eax mov [esp+_NN_+Wcopy + 4],ebx mov [esp+_NN_+Wcopy + 8],ecx mov [esp+_NN_+Wcopy +12],edx add eax,[FP_+_NN_+ksKey + 0] adc ebx,[FP_+_NN_+ksKey + 4] add ecx,[FP_+_NN_+ksKey + 8] adc edx,[FP_+_NN_+ksKey +12] if _NN_ eq (WCNT*8-16) ;inject the tweak words add eax,[FP_+ ksTwk + 8]; (at the appropriate points) adc ebx,[FP_+ ksTwk +12] elseif _NN_ eq (WCNT*8-32) add ecx,[FP_+ ksTwk + 0] adc edx,[FP_+ ksTwk + 4] endif if _NN_ or _SKEIN_DEBUG mov [esp+_NN_+X_stk + 0],eax mov [esp+_NN_+X_stk + 4],ebx mov [esp+_NN_+X_stk + 8],ecx mov [esp+_NN_+X_stk +12],edx endif _NN_ = _NN_ - 16 ;end at X[0], so regs are already loaded for first MIX! endm ; if _SKEIN_DEBUG ;debug dump of state at this point Skein_Debug_Block WCNT*64 Skein_Debug_Round WCNT*64,SKEIN_RND_KEY_INITIAL endif add esi, WCNT*8 ;skip the block mov [FP_+blkPtr ],esi ;update block pointer ; ; now the key schedule is computed. Start the rounds ; if SKEIN_ASM_UNROLL and 256 _UNROLL_CNT = ROUNDS_256/8 else _UNROLL_CNT = SKEIN_UNROLL_256 ;unroll count if ((ROUNDS_256/8) mod _UNROLL_CNT) .err "Invalid SKEIN_UNROLL_256" endif xor edi,edi ;edi = iteration count Skein_256_round_loop: endif _Rbase_ = 0 rept _UNROLL_CNT*2 ; here with X[0], X[1] already loaded into eax..edx R_256_TwoRounds %(4*_Rbase_+00), R_256_TwoRounds %(4*_Rbase_+02),0 ;inject key schedule if _UNROLL_CNT ne (ROUNDS_256/8) ks_Rotate eax,ebx,WCNT inc edi ;edi = round number endif _Rbase_ = _Rbase_+1 ks_Inject 256,3,3,eax,ebx,_Rbase_,3, ,_Rbase_ ks_Inject 256,2,2,eax,ebx,_Rbase_,2,1 ks_Inject 256, , ,ecx,edx,_Rbase_,1,0 ks_Inject 256,0, ,eax,ebx,_Rbase_,0 if _SKEIN_DEBUG Skein_Debug_Round 256,SKEIN_RND_KEY_INJECT,saveRegs endif endm ;rept _UNROLL_CNT ; if _UNROLL_CNT ne (ROUNDS_256/8) cmp edi,2*(ROUNDS_256/8) jb Skein_256_round_loop mov edi,[FP_+ctxPtr ] ;restore edi --> context endif ;---------------------------- ; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..3} _NN_ = 0 rept WCNT/2 if _NN_ ;eax..edx already loaded the first time mov eax,[esp+X_stk + _NN_ + 0] mov ebx,[esp+X_stk + _NN_ + 4] mov ecx,[esp+X_stk + _NN_ + 8] mov edx,[esp+X_stk + _NN_ +12] endif if _NN_ eq 0 and dword ptr [edi +TWEAK +12],FIRST_MASK endif xor eax,[esp+Wcopy + _NN_ + 0] xor ebx,[esp+Wcopy + _NN_ + 4] xor ecx,[esp+Wcopy + _NN_ + 8] xor edx,[esp+Wcopy + _NN_ +12] mov [edi+X_VARS+ _NN_ + 0],eax mov [edi+X_VARS+ _NN_ + 4],ebx mov [edi+X_VARS+ _NN_ + 8],ecx mov [edi+X_VARS+ _NN_ +12],edx _NN_ = _NN_+16 endm if _SKEIN_DEBUG Skein_Debug_Round 256,SKEIN_RND_FEED_FWD endif ; go back for more blocks, if needed dec dword ptr [FP_+blkCnt] jnz Skein_256_block_loop Reset_Stack _Skein_256_Process_Block ret _Skein_256_Process_Block endp ; ifdef _SKEIN_CODE_SIZE public _Skein_256_Process_Block_CodeSize _Skein_256_Process_Block_CodeSize proc mov eax,_Skein_256_Process_Block_CodeSize - _Skein_256_Process_Block ret _Skein_256_Process_Block_CodeSize endp ; public _Skein_256_Unroll_Cnt _Skein_256_Unroll_Cnt proc if _UNROLL_CNT ne ROUNDS_256/8 mov eax,_UNROLL_CNT else xor eax,eax endif ret _Skein_256_Unroll_Cnt endp endif endif ;_USE_ASM_ and 256 ; ;---------------------------------------------------------------- ; if _USE_ASM_ and 512 public _Skein_512_Process_Block ; ; void Skein_512_Process_Block(Skein_512_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd); ; ;;;;;;;;;;;;;;;;; ; MACRO: four rounds ; R_512_FourRounds macro _RR_,ld_0 ; here with edx:ecx = X[1] ;--------- round _RR_ ; R512(0,1,2,3,4,5,6,7,R_0, 1); MixStep 512, ld_0, ,0,1,((_RR_)+0),0 MixStep 512, 2,3,2,3,((_RR_)+0),1 MixStep 512, 4,5,4,5,((_RR_)+0),2 MixStep 512, 6,7,6, ,((_RR_)+0),3,1 ; here with edx:ecx = X[7] ; R512(2,1,4,7,6,5,0,3,R_1, 2); MixStep 512, 4, ,4,7,((_RR_)+1),1 MixStep 512, 6,5,6,5,((_RR_)+1),2 MixStep 512, 0,3,0,3,((_RR_)+1),3 MixStep 512, 2,1,2, ,((_RR_)+1),0,1 ; here with edx:ecx = X[1] ; R512(4,1,6,3,0,5,2,7,R_2, 3); MixStep 512, 4, ,4,1,((_RR_)+2),0 MixStep 512, 6,3,6,3,((_RR_)+2),1 MixStep 512, 0,5,0,5,((_RR_)+2),2 MixStep 512, 2,7,2, ,((_RR_)+2),3,1 ; here with edx:ecx = X[7] ; R512(6,1,0,7,2,5,4,3,R_3, 4); MixStep 512, 0, ,0,7,((_RR_)+3),1 MixStep 512, 2,5,2,5,((_RR_)+3),2 MixStep 512, 4,3,4,3,((_RR_)+3),3 MixStep 512, 6,1,6, ,((_RR_)+3),0,1 endm ;R_512_FourRounds ; ;;;;;;;;;;;;;;;;; ; code ; _Skein_512_Process_Block proc near WCNT = 8 ;WCNT=8 for Skein-512 Setup_Stack WCNT,(ROUNDS_512/8) ; main hash loop for Skein_512 Skein_512_block_loop: mov eax,[edi+TWEAK+ 0] ;ebx:eax = tweak word T0 mov ebx,[edi+TWEAK+ 4] mov ecx,[edi+TWEAK+ 8] ;edx:ecx = tweak word T1 mov edx,[edi+TWEAK+12] add eax,[FP_+bitAdd ] ;bump T0 by the bitAdd parameter adc ebx, 0 mov [edi+TWEAK ],eax ;save updated tweak value T0 mov [edi+TWEAK+ 4],ebx mov [FP_+ksTwk ],eax ;build the tweak schedule on the stack mov [FP_+ksTwk+ 4],ebx xor eax,ecx ;ebx:eax = T0 ^ T1 xor ebx,edx mov [FP_+ksTwk+ 8],ecx mov [FP_+ksTwk+12],edx mov [FP_+ksTwk+16],eax mov [FP_+ksTwk+20],ebx mov eax,KW_PARITY_LO ;init parity accumulator mov ebx,KW_PARITY_HI ; _NN_ = 0 rept WCNT ;copy in the chaining vars mov ecx,[edi+X_VARS+_NN_ ] mov edx,[edi+X_VARS+_NN_+ 4] xor eax,ecx ;compute overall parity along the way xor ebx,edx mov [FP_+ksKey +_NN_ ],ecx mov [FP_+ksKey +_NN_+ 4],edx _NN_ = _NN_+8 endm ; mov [FP_+ksKey +_NN_ ],eax ;save overall parity at the end of the array mov [FP_+ksKey +_NN_+ 4],ebx mov esi,[FP_+blkPtr ] ;esi --> input block ; _NN_ = WCNT*8-16 ;work down from the end rept WCNT/2 ;perform initial key injection mov eax,[esi+_NN_ + 0] mov ebx,[esi+_NN_ + 4] mov ecx,[esi+_NN_ + 8] mov edx,[esi+_NN_ +12] mov [esp+_NN_+Wcopy + 0],eax mov [esp+_NN_+Wcopy + 4],ebx mov [esp+_NN_+Wcopy + 8],ecx mov [esp+_NN_+Wcopy +12],edx add eax,[FP_+_NN_+ksKey + 0] adc ebx,[FP_+_NN_+ksKey + 4] add ecx,[FP_+_NN_+ksKey + 8] adc edx,[FP_+_NN_+ksKey +12] if _NN_ eq (WCNT*8-16) ;inject the tweak words add eax,[FP_+ ksTwk + 8]; (at the appropriate points) adc ebx,[FP_+ ksTwk +12] elseif _NN_ eq (WCNT*8-32) add ecx,[FP_+ ksTwk + 0] adc edx,[FP_+ ksTwk + 4] endif if _NN_ or _SKEIN_DEBUG mov [esp+_NN_+X_stk + 0],eax mov [esp+_NN_+X_stk + 4],ebx mov [esp+_NN_+X_stk + 8],ecx mov [esp+_NN_+X_stk +12],edx endif _NN_ = _NN_ - 16 ;end at X[0], so regs are already loaded for first MIX! endm ; if _SKEIN_DEBUG ;debug dump of state at this point Skein_Debug_Block WCNT*64 Skein_Debug_Round WCNT*64,SKEIN_RND_KEY_INITIAL endif add esi, WCNT*8 ;skip the block mov [FP_+blkPtr ],esi ;update block pointer ; ; now the key schedule is computed. Start the rounds ; if SKEIN_ASM_UNROLL and 512 _UNROLL_CNT = ROUNDS_512/8 else _UNROLL_CNT = SKEIN_UNROLL_512 if ((ROUNDS_512/8) mod _UNROLL_CNT) .err "Invalid SKEIN_UNROLL_512" endif xor edi,edi ;edi = round counter Skein_512_round_loop: endif _Rbase_ = 0 rept _UNROLL_CNT*2 ; here with X[0], X[1] already loaded into eax..edx R_512_FourRounds %(4*_Rbase_+00), ;inject odd key schedule words if _UNROLL_CNT ne (ROUNDS_512/8) ks_Rotate eax,ebx,WCNT inc edi ;edi = round number endif _Rbase_ = _Rbase_+1 ks_Inject 512,7,7,eax,ebx,_Rbase_,7, ,_Rbase_ ks_Inject 512,6,6,eax,ebx,_Rbase_,6,1 ks_Inject 512,5,5,eax,ebx,_Rbase_,5,0 ks_Inject 512,4,4,eax,ebx,_Rbase_,4 ks_Inject 512,3,3,eax,ebx,_Rbase_,3 ks_Inject 512,2,2,eax,ebx,_Rbase_,2 ks_Inject 512, , ,ecx,edx,_Rbase_,1 ks_Inject 512,0, ,eax,ebx,_Rbase_,0 if _SKEIN_DEBUG Skein_Debug_Round 512,SKEIN_RND_KEY_INJECT ,saveRegs endif endm ;rept _UNROLL_CNT ; if (SKEIN_ASM_UNROLL and 512) eq 0 cmp edi,2*(ROUNDS_512/8) jb Skein_512_round_loop mov edi,[FP_+ctxPtr ] ;restore edi --> context endif ;---------------------------- ; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..7} _NN_ = 0 rept WCNT/2 if _NN_ ;eax..edx already loaded the first time mov eax,[esp+X_stk + _NN_ + 0] mov ebx,[esp+X_stk + _NN_ + 4] mov ecx,[esp+X_stk + _NN_ + 8] mov edx,[esp+X_stk + _NN_ +12] endif if _NN_ eq 0 and dword ptr [edi + TWEAK+12],FIRST_MASK endif xor eax,[esp+Wcopy + _NN_ + 0] xor ebx,[esp+Wcopy + _NN_ + 4] xor ecx,[esp+Wcopy + _NN_ + 8] xor edx,[esp+Wcopy + _NN_ +12] mov [edi+X_VARS+ _NN_ + 0],eax mov [edi+X_VARS+ _NN_ + 4],ebx mov [edi+X_VARS+ _NN_ + 8],ecx mov [edi+X_VARS+ _NN_ +12],edx _NN_ = _NN_+16 endm if _SKEIN_DEBUG Skein_Debug_Round 512,SKEIN_RND_FEED_FWD endif ; go back for more blocks, if needed dec dword ptr [FP_+blkCnt] jnz Skein_512_block_loop Reset_Stack _Skein_512_Process_Block ret _Skein_512_Process_Block endp ; ifdef _SKEIN_CODE_SIZE public _Skein_512_Process_Block_CodeSize _Skein_512_Process_Block_CodeSize proc mov eax,_Skein_512_Process_Block_CodeSize - _Skein_512_Process_Block ret _Skein_512_Process_Block_CodeSize endp ; public _Skein_512_Unroll_Cnt _Skein_512_Unroll_Cnt proc if _UNROLL_CNT ne ROUNDS_512/8 mov eax,_UNROLL_CNT else xor eax,eax endif ret _Skein_512_Unroll_Cnt endp endif ; endif ; _USE_ASM_ and 512 ; ;---------------------------------------------------------------- ; if _USE_ASM_ and 1024 public _Skein1024_Process_Block ; ; void Skein_1024_Process_Block(Skein_1024_Ctxt_t *ctx,const u08b_t *blkPtr,size_t blkCnt,size_t bitcntAdd); ; ;;;;;;;;;;;;;;;;; ; MACRO: four rounds ; R_1024_FourRounds macro _RR_,ld_0 ; here with edx:ecx = X[1] ;--------- round _RR_ MixStep 1024, ld_0, , 0, 1,((_RR_)+0),0 MixStep 1024, 2, 3, 2, 3,((_RR_)+0),1 MixStep 1024, 4, 5, 4, 5,((_RR_)+0),2 MixStep 1024, 6, 7, 6, 7,((_RR_)+0),3 MixStep 1024, 8, 9, 8, 9,((_RR_)+0),4 MixStep 1024, 10,11,10,11,((_RR_)+0),5 MixStep 1024, 12,13,12,13,((_RR_)+0),6 MixStep 1024, 14,15,14, ,((_RR_)+0),7,1 ; here with edx:ecx = X[15] ;--------- round _RR_+1 MixStep 1024, 4, , 4,15,((_RR_)+1),3 MixStep 1024, 0, 9, 0, 9,((_RR_)+1),0 MixStep 1024, 2,13, 2,13,((_RR_)+1),1 MixStep 1024, 6,11, 6,11,((_RR_)+1),2 MixStep 1024, 10, 7,10, 7,((_RR_)+1),4 MixStep 1024, 12, 3,12, 3,((_RR_)+1),5 MixStep 1024, 14, 5,14, 5,((_RR_)+1),6 MixStep 1024, 8, 1, 8, ,((_RR_)+1),7,1 ; here with edx:ecx = X[1] ;--------- round _RR_+2 MixStep 1024, 6, , 6, 1,((_RR_)+2),3 MixStep 1024, 0, 7, 0, 7,((_RR_)+2),0 MixStep 1024, 2, 5, 2, 5,((_RR_)+2),1 MixStep 1024, 4, 3, 4, 3,((_RR_)+2),2 MixStep 1024, 12,15,12,15,((_RR_)+2),4 MixStep 1024, 14,13,14,13,((_RR_)+2),5 MixStep 1024, 8,11, 8,11,((_RR_)+2),6 MixStep 1024, 10, 9,10, ,((_RR_)+2),7,1 ; here with edx:ecx = X[9] ;--------- round _RR_+3 MixStep 1024, 4, , 4, 9,((_RR_)+3),3 MixStep 1024, 0,15, 0,15,((_RR_)+3),0 MixStep 1024, 2,11, 2,11,((_RR_)+3),1 MixStep 1024, 6,13, 6,13,((_RR_)+3),2 MixStep 1024, 8, 5, 8, 5,((_RR_)+3),5 MixStep 1024, 10, 3,10, 3,((_RR_)+3),6 MixStep 1024, 12, 7,12, 7,((_RR_)+3),7 MixStep 1024, 14, 1,14, ,((_RR_)+3),4,1 ; here with edx:ecx = X[1] endm ;R_1024_FourRounds ; ;;;;;;;;;;;;;;;;; ; code ; _Skein1024_Process_Block proc near ; WCNT = 16 ;WCNT=16 for Skein-1024 Setup_Stack WCNT,(ROUNDS_1024/8) ; main hash loop for Skein1024 Skein1024_block_loop: mov eax,[edi+TWEAK+ 0] ;ebx:eax = tweak word T0 mov ebx,[edi+TWEAK+ 4] mov ecx,[edi+TWEAK+ 8] ;edx:ecx = tweak word T1 mov edx,[edi+TWEAK+12] add eax,[FP_+bitAdd ] ;bump T0 by the bitAdd parameter adc ebx, 0 mov [edi+TWEAK ],eax ;save updated tweak value T0 mov [edi+TWEAK+ 4],ebx mov [FP_+ksTwk ],eax ;build the tweak schedule on the stack mov [FP_+ksTwk+ 4],ebx xor eax,ecx ;ebx:eax = T0 ^ T1 xor ebx,edx mov [FP_+ksTwk+ 8],ecx mov [FP_+ksTwk+12],edx mov [FP_+ksTwk+16],eax mov [FP_+ksTwk+20],ebx mov eax,KW_PARITY_LO ;init parity accumulator mov ebx,KW_PARITY_HI EDI_BIAS equ 70h ;bias the edi offsets to make them short! add edi, EDI_BIAS CT_ equ <edi-EDI_BIAS> ; _NN_ = 0 rept WCNT ;copy in the chaining vars mov ecx,[CT_+X_VARS+_NN_ ] mov edx,[CT_+X_VARS+_NN_+ 4] xor eax,ecx ;compute overall parity along the way xor ebx,edx mov [FP_+ksKey +_NN_ ],ecx mov [FP_+ksKey +_NN_+ 4],edx _NN_ = _NN_+8 endm ; mov [FP_+ksKey +_NN_ ],eax ;save overall parity at the end of the array mov [FP_+ksKey +_NN_+ 4],ebx mov esi,[FP_+blkPtr ] ;esi --> input block lea edi,[esp+Wcopy] ; _NN_ = WCNT*8-16 ;work down from the end rept WCNT/2 ;perform initial key injection mov eax,[esi+_NN_ + 0] mov ebx,[esi+_NN_ + 4] mov ecx,[esi+_NN_ + 8] mov edx,[esi+_NN_ +12] mov [edi+_NN_+ + 0],eax mov [edi+_NN_+ + 4],ebx mov [edi+_NN_+ + 8],ecx mov [edi+_NN_+ +12],edx add eax,[FP_+_NN_+ksKey + 0] adc ebx,[FP_+_NN_+ksKey + 4] add ecx,[FP_+_NN_+ksKey + 8] adc edx,[FP_+_NN_+ksKey +12] if _NN_ eq (WCNT*8-16) ;inject the tweak words add eax,[FP_+ ksTwk + 8]; (at the appropriate points) adc ebx,[FP_+ ksTwk +12] elseif _NN_ eq (WCNT*8-32) add ecx,[FP_+ ksTwk + 0] adc edx,[FP_+ ksTwk + 4] endif if _NN_ or _SKEIN_DEBUG mov [esp+_NN_+X_stk + 0],eax mov [esp+_NN_+X_stk + 4],ebx mov [esp+_NN_+X_stk + 8],ecx mov [esp+_NN_+X_stk +12],edx endif _NN_ = _NN_ - 16 ;end at X[0], so regs are already loaded for first MIX! endm ; if _SKEIN_DEBUG ;debug dump of state at this point Skein_Debug_Block WCNT*64 Skein_Debug_Round WCNT*64,SKEIN_RND_KEY_INITIAL endif sub esi,-WCNT*8 ;skip the block (short immediate) mov [FP_+blkPtr ],esi ;update block pointer ; ; now the key schedule is computed. Start the rounds ; if SKEIN_ASM_UNROLL and 1024 _UNROLL_CNT = ROUNDS_1024/8 else _UNROLL_CNT = SKEIN_UNROLL_1024 if ((ROUNDS_1024/8) mod _UNROLL_CNT) .err "Invalid SKEIN_UNROLL_1024" endif xor edi,edi ;edi = round counter Skein_1024_round_loop: endif _Rbase_ = 0 rept _UNROLL_CNT*2 ; here with X[0], X[1] already loaded into eax..edx R_1024_FourRounds %(4*_Rbase_+00), ;inject odd key schedule words ;inject odd key schedule words if _UNROLL_CNT ne (ROUNDS_1024/8) ks_Rotate eax,ebx,WCNT inc edi ;edi = round number endif _Rbase_ = _Rbase_+1 ks_Inject 1024,15,15,eax,ebx,_Rbase_,15, ,_Rbase_ ks_Inject 1024,14,14,eax,ebx,_Rbase_,14,1 ks_Inject 1024,13,13,eax,ebx,_Rbase_,13,0 irp _w,<12,11,10,9,8,7,6,5,4,3,2> ks_Inject 1024,_w,_w,eax,ebx,_Rbase_,_w endm ks_Inject 1024, , ,ecx,edx,_Rbase_,1 ks_Inject 1024, 0, ,eax,ebx,_Rbase_,0 if _SKEIN_DEBUG Skein_Debug_Round 1024,SKEIN_RND_KEY_INJECT ,saveRegs endif endm ;rept _UNROLL_CNT ; if (SKEIN_ASM_UNROLL and 1024) eq 0 cmp edi,2*(ROUNDS_1024/8) jb Skein_1024_round_loop endif mov edi,[FP_+ctxPtr ] ;restore edi --> context add edi,EDI_BIAS ;and bias it for short offsets below ;---------------------------- ; feedforward: ctx->X[i] = X[i] ^ w[i], {i=0..15} lea esi,[esp+Wcopy] ;use short offsets below _NN_ = 0 rept WCNT/2 if _NN_ ;eax..edx already loaded the first time mov eax,[esp+X_stk + _NN_ + 0] mov ebx,[esp+X_stk + _NN_ + 4] mov ecx,[esp+X_stk + _NN_ + 8] mov edx,[esp+X_stk + _NN_ +12] endif if _NN_ eq 0 and dword ptr [CT_ + TWEAK+12],FIRST_MASK endif xor eax,[esi + _NN_ + 0] xor ebx,[esi + _NN_ + 4] xor ecx,[esi + _NN_ + 8] xor edx,[esi + _NN_ +12] mov [CT_+X_VARS+ _NN_ + 0],eax mov [CT_+X_VARS+ _NN_ + 4],ebx mov [CT_+X_VARS+ _NN_ + 8],ecx mov [CT_+X_VARS+ _NN_ +12],edx _NN_ = _NN_+16 endm sub edi,EDI_BIAS ;undo the bias for return if _SKEIN_DEBUG Skein_Debug_Round 1024,SKEIN_RND_FEED_FWD endif ; go back for more blocks, if needed dec dword ptr [FP_+blkCnt] jnz Skein1024_block_loop Reset_Stack _Skein1024_Process_Block ret _Skein1024_Process_Block endp ; ifdef _SKEIN_CODE_SIZE public _Skein1024_Process_Block_CodeSize _Skein1024_Process_Block_CodeSize proc mov eax,_Skein1024_Process_Block_CodeSize - _Skein1024_Process_Block ret _Skein1024_Process_Block_CodeSize endp ; public _Skein1024_Unroll_Cnt _Skein1024_Unroll_Cnt proc if _UNROLL_CNT ne ROUNDS_1024/8 mov eax,_UNROLL_CNT else xor eax,eax endif ret _Skein1024_Unroll_Cnt endp endif ; endif ; _USE_ASM_ and 1024 ;---------------------------------------------------------------- end
; A214971: Integers k for which the base-phi representation of k includes 1. ; 1,4,8,11,15,19,22,26,29,33,37,40,44,48,51,55,58,62,66,69,73,76,80,84,87,91,95,98,102,105,109,113,116,120,124,127,131,134,138,142,145,149,152,156,160,163,167,171,174,178,181,185,189,192,196,199,203,207,210,214,218,221,225,228,232,236,239,243,247,250,254,257,261,265,268,272,275,279,283,286,290,294,297,301,304,308,312,315,319,323,326,330,333,337,341,344,348,351,355,359 mov $1,$0 seq $1,26356 ; a(n) = floor((n-1)*phi) + n + 1, n > 0, where phi = (1+sqrt(5))/2. sub $1,1 add $0,$1
; A004158: Triangular numbers written backwards. ; 0,1,3,6,1,51,12,82,63,54,55,66,87,19,501,21,631,351,171,91,12,132,352,672,3,523,153,873,604,534,564,694,825,165,595,36,666,307,147,87,28,168,309,649,99,5301,1801,8211,6711,5221,5721,6231,8731,1341,5841,451,6951,3561,1171,771,381,1981,3591,6102,802,5412,1122,8722,6432,5142,5842,6552,8262,1072,5772,582,6292,3003,1803,613,423,1233,3043,6843,753,5563,1473,8283,6193,5004,5904,6814,8724,1734,5644,654,6564,3574,1584,594 add $0,1 bin $0,2 seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences).
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Simone Benatti // ============================================================================= // // Demo of the hexicopter UAV // // ============================================================================= #include "chrono/physics/ChSystemNSC.h" #include "chrono/physics/ChBodyEasy.h" #include "chrono/utils/ChUtilsGeometry.h" #include "chrono_irrlicht/ChIrrApp.h" #include "chrono_models/robot/copters/Little_Hexy.h" // Use the namespaces of Chrono using namespace chrono; using namespace chrono::irrlicht; using namespace chrono::copter; // Use the main namespaces of Irrlicht using namespace irr; using namespace irr::core; using namespace irr::video; using namespace irr::gui; /// Following class will be used to manage events from the user interface class MyEventReceiver : public IEventReceiver { public: MyEventReceiver(ChIrrAppInterface* myapp, Little_Hexy* mycopter) { // store pointer to physical system & other stuff so we can tweak them by user keyboard app = myapp; copter = mycopter; } bool OnEvent(const SEvent& event) { // check if user presses keys if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) { switch (event.KeyInput.Key) { case irr::KEY_KEY_W: copter->Pitch_Down(0.001); std::cout << "Pressing W\n"; return true; case irr::KEY_KEY_S: copter->Pitch_Up(0.001); std::cout << "Pressing S\n"; return true; case irr::KEY_KEY_A: copter->Roll_Left(0.001); std::cout << "Pressing A\n"; return true; case irr::KEY_KEY_D: copter->Roll_Right(0.001); std::cout << "Pressing D\n"; return true; case irr::KEY_NUMPAD4: copter->Yaw_Left(0.01); std::cout << "Pressing 4\n"; return true; case irr::KEY_NUMPAD6: copter->Yaw_Right(0.01); std::cout << "Pressing 6\n"; return true; case irr::KEY_NUMPAD8: copter->Throttle(0.01); std::cout << "Pressing 8\n"; return true; case irr::KEY_NUMPAD2: copter->Throttle(-0.01); std::cout << "Pressing 2\n"; return true; default: break; } } return false; } private: ChIrrAppInterface* app; Little_Hexy* copter; }; int main(int argc, char* argv[]) { GetLog() << "Copyright (c) 2017 projectchrono.org\nChrono version: " << CHRONO_VERSION << "\n\n"; // Create a ChronoENGINE physical system ChSystemNSC mphysicalSystem; mphysicalSystem.Set_G_acc(ChVector<>(0, 0, -9.81)); Little_Hexy myhexy(mphysicalSystem, VNULL); myhexy.AddVisualizationAssets(); auto mymat = chrono_types::make_shared<ChMaterialSurfaceNSC>(); myhexy.AddCollisionShapes(mymat); // Create the Irrlicht visualization. ChIrrApp application(&mphysicalSystem, L"HexaCopter Test", core::dimension2d<u32>(800, 600), VerticalDir::Z); application.AddTypicalLogo(); application.AddTypicalSky(); application.AddTypicalLights(); application.AddTypicalCamera(core::vector3df(5, 5, 2)); // create text with info application.GetIGUIEnvironment()->addStaticText( L"Keys: NUMPAD 8 up; NUMPAD 2 down; A Roll Left; D Roll Right; A Roll Left; W Pitch Down; S Pitch Up; NUMPAD 4 " L"Yaw_Left; NUMPAD 6 Yaw_Right", rect<s32>(150, 10, 430, 40), true); // This is for GUI tweaking of system parameters.. MyEventReceiver receiver(&application, &myhexy); // note how to add a custom event receiver to the default interface: application.SetUserEventReceiver(&receiver); // Create the ground for the collision auto ground_mat = chrono_types::make_shared<ChMaterialSurfaceNSC>(); ground_mat->SetFriction(0.5); auto ground = chrono_types::make_shared<ChBodyEasyBox>(200, 200, 1, // size 1000, // density true, // visualize true, // collide ground_mat); // contact material ground->SetPos(ChVector<>(0, 0, -3)); ground->SetBodyFixed(true); mphysicalSystem.Add(ground); auto mtexture = chrono_types::make_shared<ChTexture>(); mtexture->SetTextureFilename(GetChronoDataFile("textures/concrete.jpg")); mtexture->SetTextureScale(100, 100); ground->AddAsset(mtexture); application.AssetBindAll(); application.AssetUpdateAll(); // Prepare the physical system for the simulation mphysicalSystem.SetTimestepperType(ChTimestepper::Type::EULER_IMPLICIT_PROJECTED); mphysicalSystem.SetSolverType(ChSolver::Type::PSOR); mphysicalSystem.SetSolverMaxIterations(30); // Simulation loop application.SetTimestep(0.005); application.SetTryRealtime(true); double control[] = {.6, .6, .6, .6, .6, .6}; myhexy.ControlAbsolute(control); while (application.GetDevice()->run()) { ChVector<float> pos = myhexy.GetChassis()->GetPos(); core::vector3df ipos(pos.x(), pos.y(), pos.z()); core::vector3df offset(1, -1, 1); application.GetActiveCamera()->setPosition(ipos + offset); application.GetActiveCamera()->setTarget(ipos); application.BeginScene(true, true, SColor(255, 140, 161, 192)); application.DrawAll(); application.EndScene(); // ADVANCE THE SIMULATION FOR ONE TIMESTEP myhexy.Update(0.01); application.DoStep(); // change motor speeds depending on user setpoints from GUI } return 0; }
############################################################################### # Copyright 2019 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material ("Material") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # "License"), the following terms apply: # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### .section .note.GNU-stack,"",%progbits .text .p2align 4, 0x90 .p2align 4, 0x90 .globl n8_gf256_add .type n8_gf256_add, @function n8_gf256_add: push %r12 push %r13 push %r14 xor %r14, %r14 movq (%rsi), %r8 movq (8)(%rsi), %r9 movq (16)(%rsi), %r10 movq (24)(%rsi), %r11 addq (%rdx), %r8 adcq (8)(%rdx), %r9 adcq (16)(%rdx), %r10 adcq (24)(%rdx), %r11 adc $(0), %r14 mov %r8, %rax mov %r9, %rdx mov %r10, %r12 mov %r11, %r13 subq (%rcx), %rax sbbq (8)(%rcx), %rdx sbbq (16)(%rcx), %r12 sbbq (24)(%rcx), %r13 sbb $(0), %r14 cmove %rax, %r8 cmove %rdx, %r9 cmove %r12, %r10 cmove %r13, %r11 movq %r8, (%rdi) movq %r9, (8)(%rdi) movq %r10, (16)(%rdi) movq %r11, (24)(%rdi) mov %rdi, %rax pop %r14 pop %r13 pop %r12 ret .Lfe1: .size n8_gf256_add, .Lfe1-(n8_gf256_add) .p2align 4, 0x90 .globl n8_gf256_sub .type n8_gf256_sub, @function n8_gf256_sub: push %r12 push %r13 push %r14 xor %r14, %r14 movq (%rsi), %r8 movq (8)(%rsi), %r9 movq (16)(%rsi), %r10 movq (24)(%rsi), %r11 subq (%rdx), %r8 sbbq (8)(%rdx), %r9 sbbq (16)(%rdx), %r10 sbbq (24)(%rdx), %r11 sbb $(0), %r14 mov %r8, %rax mov %r9, %rdx mov %r10, %r12 mov %r11, %r13 addq (%rcx), %rax adcq (8)(%rcx), %rdx adcq (16)(%rcx), %r12 adcq (24)(%rcx), %r13 test %r14, %r14 cmovne %rax, %r8 cmovne %rdx, %r9 cmovne %r12, %r10 cmovne %r13, %r11 movq %r8, (%rdi) movq %r9, (8)(%rdi) movq %r10, (16)(%rdi) movq %r11, (24)(%rdi) mov %rdi, %rax pop %r14 pop %r13 pop %r12 ret .Lfe2: .size n8_gf256_sub, .Lfe2-(n8_gf256_sub) .p2align 4, 0x90 .globl n8_gf256_neg .type n8_gf256_neg, @function n8_gf256_neg: push %r12 push %r13 push %r14 xor %r14, %r14 xor %r8, %r8 xor %r9, %r9 xor %r10, %r10 xor %r11, %r11 subq (%rsi), %r8 sbbq (8)(%rsi), %r9 sbbq (16)(%rsi), %r10 sbbq (24)(%rsi), %r11 sbb $(0), %r14 mov %r8, %rax mov %r9, %rcx mov %r10, %r12 mov %r11, %r13 addq (%rdx), %rax adcq (8)(%rdx), %rcx adcq (16)(%rdx), %r12 adcq (24)(%rdx), %r13 test %r14, %r14 cmovne %rax, %r8 cmovne %rcx, %r9 cmovne %r12, %r10 cmovne %r13, %r11 movq %r8, (%rdi) movq %r9, (8)(%rdi) movq %r10, (16)(%rdi) movq %r11, (24)(%rdi) mov %rdi, %rax pop %r14 pop %r13 pop %r12 ret .Lfe3: .size n8_gf256_neg, .Lfe3-(n8_gf256_neg) .p2align 4, 0x90 .globl n8_gf256_div2 .type n8_gf256_div2, @function n8_gf256_div2: push %r12 push %r13 push %r14 movq (%rsi), %r8 movq (8)(%rsi), %r9 movq (16)(%rsi), %r10 movq (24)(%rsi), %r11 xor %r14, %r14 xor %rsi, %rsi mov %r8, %rax mov %r9, %rcx mov %r10, %r12 mov %r11, %r13 addq (%rdx), %rax adcq (8)(%rdx), %rcx adcq (16)(%rdx), %r12 adcq (24)(%rdx), %r13 adc $(0), %r14 test $(1), %r8 cmovne %rax, %r8 cmovne %rcx, %r9 cmovne %r12, %r10 cmovne %r13, %r11 cmovne %r14, %rsi shrd $(1), %r9, %r8 shrd $(1), %r10, %r9 shrd $(1), %r11, %r10 shrd $(1), %rsi, %r11 movq %r8, (%rdi) movq %r9, (8)(%rdi) movq %r10, (16)(%rdi) movq %r11, (24)(%rdi) mov %rdi, %rax pop %r14 pop %r13 pop %r12 ret .Lfe4: .size n8_gf256_div2, .Lfe4-(n8_gf256_div2) .p2align 4, 0x90 .globl n8_gf256_mulm .type n8_gf256_mulm, @function n8_gf256_mulm: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 sub $(24), %rsp movq %rdi, (%rsp) mov %rdx, %rbx mov %rcx, %rdi movq %r8, (8)(%rsp) movq (%rbx), %r14 movq (8)(%rsp), %r15 movq (%rsi), %rax mul %r14 mov %rax, %r8 mov %rdx, %r9 imul %r8, %r15 movq (8)(%rsi), %rax mul %r14 add %rax, %r9 adc $(0), %rdx mov %rdx, %r10 movq (16)(%rsi), %rax mul %r14 add %rax, %r10 adc $(0), %rdx mov %rdx, %r11 movq (24)(%rsi), %rax mul %r14 add %rax, %r11 adc $(0), %rdx mov %rdx, %r12 xor %r13, %r13 movq (%rdi), %rax mul %r15 add %rax, %r8 adc $(0), %rdx mov %rdx, %r8 movq (8)(%rdi), %rax mul %r15 add %r8, %r9 adc $(0), %rdx add %rax, %r9 adc $(0), %rdx mov %rdx, %r8 movq (16)(%rdi), %rax mul %r15 add %r8, %r10 adc $(0), %rdx add %rax, %r10 adc $(0), %rdx mov %rdx, %r8 movq (24)(%rdi), %rax mul %r15 add %r8, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx add %rdx, %r12 adc $(0), %r13 xor %r8, %r8 movq (8)(%rbx), %r14 movq (8)(%rsp), %r15 movq (%rsi), %rax mul %r14 add %rax, %r9 adc $(0), %rdx mov %rdx, %rcx imul %r9, %r15 movq (8)(%rsi), %rax mul %r14 add %rcx, %r10 adc $(0), %rdx add %rax, %r10 adc $(0), %rdx mov %rdx, %rcx movq (16)(%rsi), %rax mul %r14 add %rcx, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %rcx movq (24)(%rsi), %rax mul %r14 add %rcx, %r12 adc $(0), %rdx add %rax, %r12 adc %rdx, %r13 adc $(0), %r8 movq (%rdi), %rax mul %r15 add %rax, %r9 adc $(0), %rdx mov %rdx, %r9 movq (8)(%rdi), %rax mul %r15 add %r9, %r10 adc $(0), %rdx add %rax, %r10 adc $(0), %rdx mov %rdx, %r9 movq (16)(%rdi), %rax mul %r15 add %r9, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %r9 movq (24)(%rdi), %rax mul %r15 add %r9, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx add %rdx, %r13 adc $(0), %r8 xor %r9, %r9 movq (16)(%rbx), %r14 movq (8)(%rsp), %r15 movq (%rsi), %rax mul %r14 add %rax, %r10 adc $(0), %rdx mov %rdx, %rcx imul %r10, %r15 movq (8)(%rsi), %rax mul %r14 add %rcx, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %rcx movq (16)(%rsi), %rax mul %r14 add %rcx, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %rcx movq (24)(%rsi), %rax mul %r14 add %rcx, %r13 adc $(0), %rdx add %rax, %r13 adc %rdx, %r8 adc $(0), %r9 movq (%rdi), %rax mul %r15 add %rax, %r10 adc $(0), %rdx mov %rdx, %r10 movq (8)(%rdi), %rax mul %r15 add %r10, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %r10 movq (16)(%rdi), %rax mul %r15 add %r10, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %r10 movq (24)(%rdi), %rax mul %r15 add %r10, %r13 adc $(0), %rdx add %rax, %r13 adc $(0), %rdx add %rdx, %r8 adc $(0), %r9 xor %r10, %r10 movq (24)(%rbx), %r14 movq (8)(%rsp), %r15 movq (%rsi), %rax mul %r14 add %rax, %r11 adc $(0), %rdx mov %rdx, %rcx imul %r11, %r15 movq (8)(%rsi), %rax mul %r14 add %rcx, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %rcx movq (16)(%rsi), %rax mul %r14 add %rcx, %r13 adc $(0), %rdx add %rax, %r13 adc $(0), %rdx mov %rdx, %rcx movq (24)(%rsi), %rax mul %r14 add %rcx, %r8 adc $(0), %rdx add %rax, %r8 adc %rdx, %r9 adc $(0), %r10 movq (%rdi), %rax mul %r15 add %rax, %r11 adc $(0), %rdx mov %rdx, %r11 movq (8)(%rdi), %rax mul %r15 add %r11, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %r11 movq (16)(%rdi), %rax mul %r15 add %r11, %r13 adc $(0), %rdx add %rax, %r13 adc $(0), %rdx mov %rdx, %r11 movq (24)(%rdi), %rax mul %r15 add %r11, %r8 adc $(0), %rdx add %rax, %r8 adc $(0), %rdx add %rdx, %r9 adc $(0), %r10 xor %r11, %r11 movq (%rsp), %rsi mov %r12, %rax mov %r13, %rbx mov %r8, %rcx mov %r9, %rdx subq (%rdi), %rax sbbq (8)(%rdi), %rbx sbbq (16)(%rdi), %rcx sbbq (24)(%rdi), %rdx sbb $(0), %r10 cmovnc %rax, %r12 cmovnc %rbx, %r13 cmovnc %rcx, %r8 cmovnc %rdx, %r9 movq %r12, (%rsi) movq %r13, (8)(%rsi) movq %r8, (16)(%rsi) movq %r9, (24)(%rsi) mov %rsi, %rax add $(24), %rsp pop %r15 pop %r14 pop %r13 pop %r12 pop %rbp pop %rbx ret .Lfe5: .size n8_gf256_mulm, .Lfe5-(n8_gf256_mulm) .p2align 4, 0x90 .globl n8_gf256_sqrm .type n8_gf256_sqrm, @function n8_gf256_sqrm: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 sub $(24), %rsp movq %rdi, (%rsp) mov %rdx, %rdi movq %rcx, (8)(%rsp) movq (%rsi), %rbx movq (8)(%rsi), %rax mul %rbx mov %rax, %r9 mov %rdx, %r10 movq (16)(%rsi), %rax mul %rbx add %rax, %r10 adc $(0), %rdx mov %rdx, %r11 movq (24)(%rsi), %rax mul %rbx add %rax, %r11 adc $(0), %rdx mov %rdx, %r12 movq (8)(%rsi), %rbx movq (16)(%rsi), %rax mul %rbx add %rax, %r11 adc $(0), %rdx mov %rdx, %rbp movq (24)(%rsi), %rax mul %rbx add %rax, %r12 adc $(0), %rdx add %rbp, %r12 adc $(0), %rdx mov %rdx, %r13 movq (16)(%rsi), %rbx movq (24)(%rsi), %rax mul %rbx add %rax, %r13 adc $(0), %rdx mov %rdx, %r14 xor %r15, %r15 shld $(1), %r14, %r15 shld $(1), %r13, %r14 shld $(1), %r12, %r13 shld $(1), %r11, %r12 shld $(1), %r10, %r11 shld $(1), %r9, %r10 shl $(1), %r9 movq (%rsi), %rax mul %rax mov %rax, %r8 add %rdx, %r9 adc $(0), %r10 movq (8)(%rsi), %rax mul %rax add %rax, %r10 adc %rdx, %r11 adc $(0), %r12 movq (16)(%rsi), %rax mul %rax add %rax, %r12 adc %rdx, %r13 adc $(0), %r14 movq (24)(%rsi), %rax mul %rax add %rax, %r14 adc %rdx, %r15 movq (8)(%rsp), %rcx imul %r8, %rcx movq (%rdi), %rax mul %rcx add %rax, %r8 adc $(0), %rdx mov %rdx, %r8 movq (8)(%rdi), %rax mul %rcx add %r8, %r9 adc $(0), %rdx add %rax, %r9 adc $(0), %rdx mov %rdx, %r8 movq (16)(%rdi), %rax mul %rcx add %r8, %r10 adc $(0), %rdx add %rax, %r10 adc $(0), %rdx mov %rdx, %r8 movq (24)(%rdi), %rax mul %rcx add %r8, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx add %rdx, %r12 adc $(0), %r13 xor %r8, %r8 movq (8)(%rsp), %rcx imul %r9, %rcx movq (%rdi), %rax mul %rcx add %rax, %r9 adc $(0), %rdx mov %rdx, %r9 movq (8)(%rdi), %rax mul %rcx add %r9, %r10 adc $(0), %rdx add %rax, %r10 adc $(0), %rdx mov %rdx, %r9 movq (16)(%rdi), %rax mul %rcx add %r9, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %r9 movq (24)(%rdi), %rax mul %rcx add %r9, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx add %rdx, %r13 adc $(0), %r14 xor %r9, %r9 movq (8)(%rsp), %rcx imul %r10, %rcx movq (%rdi), %rax mul %rcx add %rax, %r10 adc $(0), %rdx mov %rdx, %r10 movq (8)(%rdi), %rax mul %rcx add %r10, %r11 adc $(0), %rdx add %rax, %r11 adc $(0), %rdx mov %rdx, %r10 movq (16)(%rdi), %rax mul %rcx add %r10, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %r10 movq (24)(%rdi), %rax mul %rcx add %r10, %r13 adc $(0), %rdx add %rax, %r13 adc $(0), %rdx add %rdx, %r14 adc $(0), %r15 xor %r10, %r10 movq (8)(%rsp), %rcx imul %r11, %rcx movq (%rdi), %rax mul %rcx add %rax, %r11 adc $(0), %rdx mov %rdx, %r11 movq (8)(%rdi), %rax mul %rcx add %r11, %r12 adc $(0), %rdx add %rax, %r12 adc $(0), %rdx mov %rdx, %r11 movq (16)(%rdi), %rax mul %rcx add %r11, %r13 adc $(0), %rdx add %rax, %r13 adc $(0), %rdx mov %rdx, %r11 movq (24)(%rdi), %rax mul %rcx add %r11, %r14 adc $(0), %rdx add %rax, %r14 adc $(0), %rdx add %rdx, %r15 adc $(0), %r8 xor %r11, %r11 movq (%rsp), %rsi mov %r12, %rax mov %r13, %rbx mov %r14, %rcx mov %r15, %rdx subq (%rdi), %rax sbbq (8)(%rdi), %rbx sbbq (16)(%rdi), %rcx sbbq (24)(%rdi), %rdx sbb $(0), %r8 cmovnc %rax, %r12 cmovnc %rbx, %r13 cmovnc %rcx, %r14 cmovnc %rdx, %r15 movq %r12, (%rsi) movq %r13, (8)(%rsi) movq %r14, (16)(%rsi) movq %r15, (24)(%rsi) mov %rsi, %rax add $(24), %rsp pop %r15 pop %r14 pop %r13 pop %r12 pop %rbp pop %rbx ret .Lfe6: .size n8_gf256_sqrm, .Lfe6-(n8_gf256_sqrm)
; ; ZX IF1 & Microdrive functions ; ; remove a given file in the given drive ; ; int if1_remove (int drive, char *filename); ; ; $Id: if1_remove_file.asm,v 1.2 2006/05/23 21:47:25 stefano Exp $ ; XLIB if1_remove_file LIB if1_setname LIB if1_rommap XREF ERASEM ; parameters and variables filename: defs 10 if1_remove_file: rst 8 defb 31h ; Create Interface 1 system vars if required pop af pop de ;filename pop bc ;driveno push bc push de push af ld a,c ld ($5cd6),a push de ld hl,filename ; filename location push hl call if1_setname ld ($5cda),hl ; length pop de ld ($5cdc),hl ; pointer to filename call if1_rommap call ERASEM call 1 ; unpage ei ld hl,0 ret
lc r4, 0x00000000 lc r5, 0x0000101f lc r6, 0x00000000 tlbse r6, r4 lc r8, 0x40000000 lc r9, 0x0000101f lc r10, 0x00000001 tlbse r10, r8 lc r11, 0xdeadbeef lc r12, 0x7fffffff lc r13, 0x7fffffff st1 r11, r13, 2 halt #@expected values #r4 = 0x00000000 #r5 = 0x0000101f #r6 = 0x00000000 #tlb 0: # vpn = 0x00000 # os = 0x000 # ppn = 0x00001 # at = 0x01f #r8 = 0x40000000 #r9 = 0x0000101f #r10 = 0x00000001 #tlb 1: # vpn = 0x40000 # os = 0x000 # ppn = 0x00001 # at = 0x01f #r11 = 0xdeadbeef #r12 = 0x7fffffff #r13 = 0x7fffffff #mem 0x00000001 = ef #pc = 0x80000044
; A092774: Prime(prime(n))^2+1 ; 10,26,122,290,962,1682,3482,4490,6890,11882,16130,24650,32042,36482,44522,58082,76730,80090,109562,124610,134690,160802,185762,212522,259082,299210,316970,344570,358802,380690,502682,546122,597530,635210 seq $0,40 ; The prime numbers. mov $2,$0 sub $2,1 mov $0,$2 seq $0,6005 ; The odd prime numbers together with 1. pow $0,2 add $0,1
#include <iostream> #include <Interpolators/_1D/CubicSplineInterpolator.hpp> int main() { _1D::CubicSplineInterpolator<double> interp; }
#include "Explosion.h" Explosion::Explosion(sf::Vector2f pos) : AnimatedSprite(pos) { AnimatedSprite::setTexture(GAME.getTexture("Resources/bigExplosion.png")); SetUpExplosionAnimation(); playAnimation("explosion", AnimationMode::OnceForwards); boom_.setBuffer(GAME.getSoundBuffer("Resources/boom.wav")); boom_.play(); } void Explosion::SetUpExplosionAnimation() { std::vector<sf::IntRect> frames; frames.push_back(sf::IntRect(50, 0, 100, 150)); // frame 2 frames.push_back(sf::IntRect(150, 0, 100, 150)); // frame 3 frames.push_back(sf::IntRect(250, 0, 100, 150)); // frame 4 frames.push_back(sf::IntRect(350, 0, 100, 150)); // frame 5 frames.push_back(sf::IntRect(450, 0, 100, 150)); // frame 6 frames.push_back(sf::IntRect(550, 0, 100, 150)); // frame 7 frames.push_back(sf::IntRect(650, 0, 100, 150)); // frame 8 frames.push_back(sf::IntRect(800, 0, 100, 150)); // frame 9 addAnimation("explosion", frames); } void Explosion::update(sf::Time& elapsed) { AnimatedSprite::update(elapsed); if (!isPlaying()) { makeDead(); } }
; LICENSE: ; This submission to NSS is to be made available under the terms of the ; Mozilla Public License, v. 2.0. You can obtain one at http: ; //mozilla.org/MPL/2.0/. ;############################################################################### ; Copyright(c) 2014, Intel Corp. ; Developers and authors: ; Shay Gueron and Vlad Krasnov ; Intel Corporation, Israel Development Centre, Haifa, Israel ; Please send feedback directly to crypto.feedback.alias@intel.com .DATA ALIGN 16 Lone dq 1,0 Ltwo dq 2,0 Lbswap_mask db 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 Lshuff_mask dq 0f0f0f0f0f0f0f0fh, 0f0f0f0f0f0f0f0fh Lpoly dq 01h, 0c200000000000000h .CODE GFMUL MACRO DST, SRC1, SRC2, TMP1, TMP2, TMP3, TMP4 vpclmulqdq TMP1, SRC2, SRC1, 0h vpclmulqdq TMP4, SRC2, SRC1, 011h vpshufd TMP2, SRC2, 78 vpshufd TMP3, SRC1, 78 vpxor TMP2, TMP2, SRC2 vpxor TMP3, TMP3, SRC1 vpclmulqdq TMP2, TMP2, TMP3, 0h vpxor TMP2, TMP2, TMP1 vpxor TMP2, TMP2, TMP4 vpslldq TMP3, TMP2, 8 vpsrldq TMP2, TMP2, 8 vpxor TMP1, TMP1, TMP3 vpxor TMP4, TMP4, TMP2 vpclmulqdq TMP2, TMP1, [Lpoly], 010h vpshufd TMP3, TMP1, 78 vpxor TMP1, TMP2, TMP3 vpclmulqdq TMP2, TMP1, [Lpoly], 010h vpshufd TMP3, TMP1, 78 vpxor TMP1, TMP2, TMP3 vpxor DST, TMP1, TMP4 ENDM ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Generates the final GCM tag ; void intel_aes_gcmTAG(unsigned char Htbl[16*16], ; unsigned char *Tp, ; unsigned int Mlen, ; unsigned int Alen, ; unsigned char *X0, ; unsigned char *TAG); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 intel_aes_gcmTAG PROC Htbl textequ <rcx> Tp textequ <rdx> Mlen textequ <r8> Alen textequ <r9> X0 textequ <r10> TAG textequ <r11> T textequ <xmm0> TMP0 textequ <xmm1> mov X0, [rsp + 1*8 + 4*8] mov TAG, [rsp + 1*8 + 5*8] vzeroupper vmovdqu T, XMMWORD PTR[Tp] vpxor TMP0, TMP0, TMP0 shl Mlen, 3 shl Alen, 3 ;vpinsrq TMP0, TMP0, Mlen, 0 ;vpinsrq TMP0, TMP0, Alen, 1 ; workaround the ml64.exe vpinsrq issue vpinsrd TMP0, TMP0, r8d, 0 vpinsrd TMP0, TMP0, r9d, 2 shr Mlen, 32 shr Alen, 32 vpinsrd TMP0, TMP0, r8d, 1 vpinsrd TMP0, TMP0, r9d, 3 vpxor T, T, TMP0 vmovdqu TMP0, XMMWORD PTR[Htbl] GFMUL T, T, TMP0, xmm2, xmm3, xmm4, xmm5 vpshufb T, T, [Lbswap_mask] vpxor T, T, [X0] vmovdqu XMMWORD PTR[TAG], T vzeroupper ret intel_aes_gcmTAG ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Generates the H table ; void intel_aes_gcmINIT(unsigned char Htbl[16*16], unsigned char *KS, int NR); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 intel_aes_gcmINIT PROC Htbl textequ <rcx> KS textequ <rdx> NR textequ <r8d> T textequ <xmm0> TMP0 textequ <xmm1> vzeroupper ; AES-ENC(0) vmovdqu T, XMMWORD PTR[KS] lea KS, [16 + KS] dec NR Lenc_loop: vaesenc T, T, [KS] lea KS, [16 + KS] dec NR jnz Lenc_loop vaesenclast T, T, [KS] vpshufb T, T, [Lbswap_mask] ;Calculate H` = GFMUL(H, 2) vpsrad xmm3, T, 31 vpshufd xmm3, xmm3, 0ffh vpand xmm5, xmm3, [Lpoly] vpsrld xmm3, T, 31 vpslld xmm4, T, 1 vpslldq xmm3, xmm3, 4 vpxor T, xmm4, xmm3 vpxor T, T, xmm5 vmovdqu TMP0, T vmovdqu XMMWORD PTR[Htbl + 0*16], T vpshufd xmm2, T, 78 vpxor xmm2, xmm2, T vmovdqu XMMWORD PTR[Htbl + 8*16 + 0*16], xmm2 i = 1 WHILE i LT 8 GFMUL T, T, TMP0, xmm2, xmm3, xmm4, xmm5 vmovdqu XMMWORD PTR[Htbl + i*16], T vpshufd xmm2, T, 78 vpxor xmm2, xmm2, T vmovdqu XMMWORD PTR[Htbl + 8*16 + i*16], xmm2 i = i+1 ENDM vzeroupper ret intel_aes_gcmINIT ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Authenticate only ; void intel_aes_gcmAAD(unsigned char Htbl[16*16], unsigned char *AAD, unsigned int Alen, unsigned char *Tp); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 intel_aes_gcmAAD PROC Htbl textequ <rcx> inp textequ <rdx> len textequ <r8> Tp textequ <r9> hlp0 textequ <r10> DATA textequ <xmm0> T textequ <xmm1> TMP0 textequ <xmm2> TMP1 textequ <xmm3> TMP2 textequ <xmm4> TMP3 textequ <xmm5> TMP4 textequ <xmm6> Xhi textequ <xmm7> KARATSUBA_AAD MACRO i vpclmulqdq TMP3, DATA, [Htbl + i*16], 0h vpxor TMP0, TMP0, TMP3 vpclmulqdq TMP3, DATA, [Htbl + i*16], 011h vpxor TMP1, TMP1, TMP3 vpshufd TMP3, DATA, 78 vpxor TMP3, TMP3, DATA vpclmulqdq TMP3, TMP3, [Htbl + 8*16 + i*16], 0h vpxor TMP2, TMP2, TMP3 ENDM test len, len jnz LbeginAAD ret LbeginAAD: vzeroupper sub rsp, 2*16 vmovdqu XMMWORD PTR[rsp + 0*16], xmm6 vmovdqu XMMWORD PTR[rsp + 1*16], xmm7 vpxor Xhi, Xhi, Xhi vmovdqu T, XMMWORD PTR[Tp] ;we hash 8 block each iteration, if the total amount of blocks is not a multiple of 8, we hash the first n%8 blocks first mov hlp0, len and hlp0, 128-1 jz Lmod_loop and len, -128 sub hlp0, 16 ; Prefix block vmovdqu DATA, XMMWORD PTR[inp] vpshufb DATA, DATA, [Lbswap_mask] vpxor DATA, DATA, T vpclmulqdq TMP0, DATA, [Htbl + hlp0], 0h vpclmulqdq TMP1, DATA, [Htbl + hlp0], 011h vpshufd TMP3, DATA, 78 vpxor TMP3, TMP3, DATA vpclmulqdq TMP2, TMP3, [Htbl + 8*16 + hlp0], 0h lea inp, [inp+16] test hlp0, hlp0 jnz Lpre_loop jmp Lred1 ;hash remaining prefix bocks (up to 7 total prefix blocks) Lpre_loop: sub hlp0, 16 vmovdqu DATA, XMMWORD PTR[inp] vpshufb DATA, DATA, [Lbswap_mask] vpclmulqdq TMP3, DATA, [Htbl + hlp0], 0h vpxor TMP0, TMP0, TMP3 vpclmulqdq TMP3, DATA, [Htbl + hlp0], 011h vpxor TMP1, TMP1, TMP3 vpshufd TMP3, DATA, 78 vpxor TMP3, TMP3, DATA vpclmulqdq TMP3, TMP3, [Htbl + 8*16 + hlp0], 0h vpxor TMP2, TMP2, TMP3 test hlp0, hlp0 lea inp, [inp+16] jnz Lpre_loop Lred1: vpxor TMP2, TMP2, TMP0 vpxor TMP2, TMP2, TMP1 vpsrldq TMP3, TMP2, 8 vpslldq TMP2, TMP2, 8 vpxor Xhi, TMP1, TMP3 vpxor T, TMP0, TMP2 Lmod_loop: sub len, 16*8 jb Ldone ; Block #0 vmovdqu DATA, XMMWORD PTR[inp + 16*7] vpshufb DATA, DATA, [Lbswap_mask] vpclmulqdq TMP0, DATA, [Htbl + 0*16], 0h vpclmulqdq TMP1, DATA, [Htbl + 0*16], 011h vpshufd TMP3, DATA, 78 vpxor TMP3, TMP3, DATA vpclmulqdq TMP2, TMP3, [Htbl + 8*16 + 0*16], 0h ; Block #1 vmovdqu DATA, XMMWORD PTR[inp + 16*6] vpshufb DATA, DATA, [Lbswap_mask] KARATSUBA_AAD 1 ; Block #2 vmovdqu DATA, XMMWORD PTR[inp + 16*5] vpshufb DATA, DATA, [Lbswap_mask] vpclmulqdq TMP4, T, [Lpoly], 010h ;reduction stage 1a vpalignr T, T, T, 8 KARATSUBA_AAD 2 vpxor T, T, TMP4 ;reduction stage 1b ; Block #3 vmovdqu DATA, XMMWORD PTR[inp + 16*4] vpshufb DATA, DATA, [Lbswap_mask] KARATSUBA_AAD 3 ; Block #4 vmovdqu DATA, XMMWORD PTR[inp + 16*3] vpshufb DATA, DATA, [Lbswap_mask] vpclmulqdq TMP4, T, [Lpoly], 010h ;reduction stage 2a vpalignr T, T, T, 8 KARATSUBA_AAD 4 vpxor T, T, TMP4 ;reduction stage 2b ; Block #5 vmovdqu DATA, XMMWORD PTR[inp + 16*2] vpshufb DATA, DATA, [Lbswap_mask] KARATSUBA_AAD 5 vpxor T, T, Xhi ;reduction finalize ; Block #6 vmovdqu DATA, XMMWORD PTR[inp + 16*1] vpshufb DATA, DATA, [Lbswap_mask] KARATSUBA_AAD 6 ; Block #7 vmovdqu DATA, XMMWORD PTR[inp + 16*0] vpshufb DATA, DATA, [Lbswap_mask] vpxor DATA, DATA, T KARATSUBA_AAD 7 ; Aggregated 8 blocks, now karatsuba fixup vpxor TMP2, TMP2, TMP0 vpxor TMP2, TMP2, TMP1 vpsrldq TMP3, TMP2, 8 vpslldq TMP2, TMP2, 8 vpxor Xhi, TMP1, TMP3 vpxor T, TMP0, TMP2 lea inp, [inp + 16*8] jmp Lmod_loop Ldone: vpclmulqdq TMP4, T, [Lpoly], 010h vpalignr T, T, T, 8 vpxor T, T, TMP4 vpclmulqdq TMP4, T, [Lpoly], 010h vpalignr T, T, T, 8 vpxor T, T, TMP4 vpxor T, T, Xhi vmovdqu XMMWORD PTR[Tp], T vzeroupper vmovdqu xmm6, XMMWORD PTR[rsp + 0*16] vmovdqu xmm7, XMMWORD PTR[rsp + 1*16] add rsp, 16*2 ret intel_aes_gcmAAD ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Encrypt and Authenticate ; void intel_aes_gcmENC(unsigned char* PT, unsigned char* CT, void *Gctx, unsigned int len); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 intel_aes_gcmENC PROC PT textequ <rcx> CT textequ <rdx> Htbl textequ <r8> Gctx textequ <r8> len textequ <r9> KS textequ <r10> NR textequ <eax> aluCTR textequ <r11d> aluKSl textequ <r12d> aluTMP textequ <r13d> T textequ <xmm0> TMP0 textequ <xmm1> TMP1 textequ <xmm2> TMP2 textequ <xmm3> TMP3 textequ <xmm4> TMP4 textequ <xmm5> TMP5 textequ <xmm6> CTR0 textequ <xmm7> CTR1 textequ <xmm8> CTR2 textequ <xmm9> CTR3 textequ <xmm10> CTR4 textequ <xmm11> CTR5 textequ <xmm12> CTR6 textequ <xmm13> CTR7 textequ <xmm14> BSWAPMASK textequ <xmm15> ROUND MACRO i vmovdqu TMP3, XMMWORD PTR[i*16 + KS] vaesenc CTR0, CTR0, TMP3 vaesenc CTR1, CTR1, TMP3 vaesenc CTR2, CTR2, TMP3 vaesenc CTR3, CTR3, TMP3 vaesenc CTR4, CTR4, TMP3 vaesenc CTR5, CTR5, TMP3 vaesenc CTR6, CTR6, TMP3 vaesenc CTR7, CTR7, TMP3 ENDM ROUNDMUL MACRO i vmovdqu TMP3, XMMWORD PTR[i*16 + KS] vaesenc CTR0, CTR0, TMP3 vaesenc CTR1, CTR1, TMP3 vaesenc CTR2, CTR2, TMP3 vaesenc CTR3, CTR3, TMP3 vpshufd TMP4, TMP5, 78 vpxor TMP4, TMP4, TMP5 vaesenc CTR4, CTR4, TMP3 vaesenc CTR5, CTR5, TMP3 vaesenc CTR6, CTR6, TMP3 vaesenc CTR7, CTR7, TMP3 vpclmulqdq TMP3, TMP4, XMMWORD PTR[i*16 + 8*16 + Htbl], 000h vpxor TMP0, TMP0, TMP3 vmovdqu TMP4, XMMWORD PTR[i*16 + Htbl] vpclmulqdq TMP3, TMP5, TMP4, 011h vpxor TMP1, TMP1, TMP3 vpclmulqdq TMP3, TMP5, TMP4, 000h vpxor TMP2, TMP2, TMP3 ENDM KARATSUBA MACRO i vpshufd TMP4, TMP5, 78 vpxor TMP4, TMP4, TMP5 vpclmulqdq TMP3, TMP4, XMMWORD PTR[i*16 + 8*16 + Htbl], 000h vpxor TMP0, TMP0, TMP3 vmovdqu TMP4, XMMWORD PTR[i*16 + Htbl] vpclmulqdq TMP3, TMP5, TMP4, 011h vpxor TMP1, TMP1, TMP3 vpclmulqdq TMP3, TMP5, TMP4, 000h vpxor TMP2, TMP2, TMP3 ENDM NEXTCTR MACRO i add aluCTR, 1 mov aluTMP, aluCTR xor aluTMP, aluKSl bswap aluTMP mov [3*4 + 8*16 + i*16 + rsp], aluTMP ENDM test len, len jnz LbeginENC ret LbeginENC: vzeroupper push r11 push r12 push r13 push rbp sub rsp, 10*16 vmovdqu XMMWORD PTR[rsp + 0*16], xmm6 vmovdqu XMMWORD PTR[rsp + 1*16], xmm7 vmovdqu XMMWORD PTR[rsp + 2*16], xmm8 vmovdqu XMMWORD PTR[rsp + 3*16], xmm9 vmovdqu XMMWORD PTR[rsp + 4*16], xmm10 vmovdqu XMMWORD PTR[rsp + 5*16], xmm11 vmovdqu XMMWORD PTR[rsp + 6*16], xmm12 vmovdqu XMMWORD PTR[rsp + 7*16], xmm13 vmovdqu XMMWORD PTR[rsp + 8*16], xmm14 vmovdqu XMMWORD PTR[rsp + 9*16], xmm15 mov rbp, rsp sub rsp, 16*16 and rsp, -16 vmovdqu T, XMMWORD PTR[16*16 + 1*16 + Gctx] vmovdqu CTR0, XMMWORD PTR[16*16 + 2*16 + Gctx] vmovdqu BSWAPMASK, XMMWORD PTR[Lbswap_mask] mov KS, [16*16 + 3*16 + Gctx] mov NR, [4 + KS] lea KS, [48 + KS] vpshufb CTR0, CTR0, BSWAPMASK mov aluCTR, [16*16 + 2*16 + 3*4 + Gctx] mov aluKSl, [3*4 + KS] bswap aluCTR bswap aluKSl vmovdqu TMP0, XMMWORD PTR[0*16 + KS] vpxor TMP0, TMP0, XMMWORD PTR[16*16 + 2*16 + Gctx] vmovdqu XMMWORD PTR[8*16 + 0*16 + rsp], TMP0 cmp len, 128 jb LEncDataSingles ; Prepare the "top" counters vmovdqu XMMWORD PTR[8*16 + 1*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 2*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 3*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 4*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 5*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 6*16 + rsp], TMP0 vmovdqu XMMWORD PTR[8*16 + 7*16 + rsp], TMP0 ; Encrypt the initial 8 blocks sub len, 128 vpaddd CTR1, CTR0, XMMWORD PTR[Lone] vpaddd CTR2, CTR0, XMMWORD PTR[Ltwo] vpaddd CTR3, CTR2, XMMWORD PTR[Lone] vpaddd CTR4, CTR2, XMMWORD PTR[Ltwo] vpaddd CTR5, CTR4, XMMWORD PTR[Lone] vpaddd CTR6, CTR4, XMMWORD PTR[Ltwo] vpaddd CTR7, CTR6, XMMWORD PTR[Lone] vpshufb CTR0, CTR0, BSWAPMASK vpshufb CTR1, CTR1, BSWAPMASK vpshufb CTR2, CTR2, BSWAPMASK vpshufb CTR3, CTR3, BSWAPMASK vpshufb CTR4, CTR4, BSWAPMASK vpshufb CTR5, CTR5, BSWAPMASK vpshufb CTR6, CTR6, BSWAPMASK vpshufb CTR7, CTR7, BSWAPMASK vmovdqu TMP3, XMMWORD PTR[0*16 + KS] vpxor CTR0, CTR0, TMP3 vpxor CTR1, CTR1, TMP3 vpxor CTR2, CTR2, TMP3 vpxor CTR3, CTR3, TMP3 vpxor CTR4, CTR4, TMP3 vpxor CTR5, CTR5, TMP3 vpxor CTR6, CTR6, TMP3 vpxor CTR7, CTR7, TMP3 ROUND 1 add aluCTR, 8 mov aluTMP, aluCTR xor aluTMP, aluKSl bswap aluTMP mov [8*16 + 0*16 + 3*4 + rsp], aluTMP ROUND 2 NEXTCTR 1 ROUND 3 NEXTCTR 2 ROUND 4 NEXTCTR 3 ROUND 5 NEXTCTR 4 ROUND 6 NEXTCTR 5 ROUND 7 NEXTCTR 6 ROUND 8 NEXTCTR 7 ROUND 9 vmovdqu TMP5, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f ROUND 10 ROUND 11 vmovdqu TMP5, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f ROUND 12 ROUND 13 vmovdqu TMP5, XMMWORD PTR[14*16 + KS] @@: vpxor TMP3, TMP5, XMMWORD PTR[0*16 + PT] vaesenclast CTR0, CTR0, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[1*16 + PT] vaesenclast CTR1, CTR1, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[2*16 + PT] vaesenclast CTR2, CTR2, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[3*16 + PT] vaesenclast CTR3, CTR3, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[4*16 + PT] vaesenclast CTR4, CTR4, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[5*16 + PT] vaesenclast CTR5, CTR5, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[6*16 + PT] vaesenclast CTR6, CTR6, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[7*16 + PT] vaesenclast CTR7, CTR7, TMP3 vmovdqu XMMWORD PTR[0*16 + CT], CTR0 vpshufb CTR0, CTR0, BSWAPMASK vmovdqu XMMWORD PTR[1*16 + CT], CTR1 vpshufb CTR1, CTR1, BSWAPMASK vmovdqu XMMWORD PTR[2*16 + CT], CTR2 vpshufb CTR2, CTR2, BSWAPMASK vmovdqu XMMWORD PTR[3*16 + CT], CTR3 vpshufb CTR3, CTR3, BSWAPMASK vmovdqu XMMWORD PTR[4*16 + CT], CTR4 vpshufb CTR4, CTR4, BSWAPMASK vmovdqu XMMWORD PTR[5*16 + CT], CTR5 vpshufb CTR5, CTR5, BSWAPMASK vmovdqu XMMWORD PTR[6*16 + CT], CTR6 vpshufb CTR6, CTR6, BSWAPMASK vmovdqu XMMWORD PTR[7*16 + CT], CTR7 vpshufb TMP5, CTR7, BSWAPMASK vmovdqa XMMWORD PTR[1*16 + rsp], CTR6 vmovdqa XMMWORD PTR[2*16 + rsp], CTR5 vmovdqa XMMWORD PTR[3*16 + rsp], CTR4 vmovdqa XMMWORD PTR[4*16 + rsp], CTR3 vmovdqa XMMWORD PTR[5*16 + rsp], CTR2 vmovdqa XMMWORD PTR[6*16 + rsp], CTR1 vmovdqa XMMWORD PTR[7*16 + rsp], CTR0 lea CT, [8*16 + CT] lea PT, [8*16 + PT] jmp LEncDataOctets LEncDataOctets: cmp len, 128 jb LEndEncOctets sub len, 128 vmovdqa CTR0, XMMWORD PTR[8*16 + 0*16 + rsp] vmovdqa CTR1, XMMWORD PTR[8*16 + 1*16 + rsp] vmovdqa CTR2, XMMWORD PTR[8*16 + 2*16 + rsp] vmovdqa CTR3, XMMWORD PTR[8*16 + 3*16 + rsp] vmovdqa CTR4, XMMWORD PTR[8*16 + 4*16 + rsp] vmovdqa CTR5, XMMWORD PTR[8*16 + 5*16 + rsp] vmovdqa CTR6, XMMWORD PTR[8*16 + 6*16 + rsp] vmovdqa CTR7, XMMWORD PTR[8*16 + 7*16 + rsp] vpshufd TMP4, TMP5, 78 vpxor TMP4, TMP4, TMP5 vpclmulqdq TMP0, TMP4, XMMWORD PTR[0*16 + 8*16 + Htbl], 000h vmovdqu TMP4, XMMWORD PTR[0*16 + Htbl] vpclmulqdq TMP1, TMP5, TMP4, 011h vpclmulqdq TMP2, TMP5, TMP4, 000h vmovdqu TMP5, XMMWORD PTR[1*16 + rsp] ROUNDMUL 1 NEXTCTR 0 vmovdqu TMP5, XMMWORD PTR[2*16 + rsp] ROUNDMUL 2 NEXTCTR 1 vmovdqu TMP5, XMMWORD PTR[3*16 + rsp] ROUNDMUL 3 NEXTCTR 2 vmovdqu TMP5, XMMWORD PTR[4*16 + rsp] ROUNDMUL 4 NEXTCTR 3 vmovdqu TMP5, XMMWORD PTR[5*16 + rsp] ROUNDMUL 5 NEXTCTR 4 vmovdqu TMP5, XMMWORD PTR[6*16 + rsp] ROUNDMUL 6 NEXTCTR 5 vpxor TMP5, T, XMMWORD PTR[7*16 + rsp] ROUNDMUL 7 NEXTCTR 6 ROUND 8 NEXTCTR 7 vpxor TMP0, TMP0, TMP1 vpxor TMP0, TMP0, TMP2 vpsrldq TMP3, TMP0, 8 vpxor TMP4, TMP1, TMP3 vpslldq TMP3, TMP0, 8 vpxor T, TMP2, TMP3 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 ROUND 9 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 vmovdqu TMP5, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f ROUND 10 ROUND 11 vmovdqu TMP5, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f ROUND 12 ROUND 13 vmovdqu TMP5, XMMWORD PTR[14*16 + KS] @@: vpxor TMP3, TMP5, XMMWORD PTR[0*16 + PT] vaesenclast CTR0, CTR0, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[1*16 + PT] vaesenclast CTR1, CTR1, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[2*16 + PT] vaesenclast CTR2, CTR2, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[3*16 + PT] vaesenclast CTR3, CTR3, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[4*16 + PT] vaesenclast CTR4, CTR4, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[5*16 + PT] vaesenclast CTR5, CTR5, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[6*16 + PT] vaesenclast CTR6, CTR6, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[7*16 + PT] vaesenclast CTR7, CTR7, TMP3 vmovdqu XMMWORD PTR[0*16 + CT], CTR0 vpshufb CTR0, CTR0, BSWAPMASK vmovdqu XMMWORD PTR[1*16 + CT], CTR1 vpshufb CTR1, CTR1, BSWAPMASK vmovdqu XMMWORD PTR[2*16 + CT], CTR2 vpshufb CTR2, CTR2, BSWAPMASK vmovdqu XMMWORD PTR[3*16 + CT], CTR3 vpshufb CTR3, CTR3, BSWAPMASK vmovdqu XMMWORD PTR[4*16 + CT], CTR4 vpshufb CTR4, CTR4, BSWAPMASK vmovdqu XMMWORD PTR[5*16 + CT], CTR5 vpshufb CTR5, CTR5, BSWAPMASK vmovdqu XMMWORD PTR[6*16 + CT], CTR6 vpshufb CTR6, CTR6, BSWAPMASK vmovdqu XMMWORD PTR[7*16 + CT], CTR7 vpshufb TMP5, CTR7, BSWAPMASK vmovdqa XMMWORD PTR[1*16 + rsp], CTR6 vmovdqa XMMWORD PTR[2*16 + rsp], CTR5 vmovdqa XMMWORD PTR[3*16 + rsp], CTR4 vmovdqa XMMWORD PTR[4*16 + rsp], CTR3 vmovdqa XMMWORD PTR[5*16 + rsp], CTR2 vmovdqa XMMWORD PTR[6*16 + rsp], CTR1 vmovdqa XMMWORD PTR[7*16 + rsp], CTR0 vpxor T, T, TMP4 lea CT, [8*16 + CT] lea PT, [8*16 + PT] jmp LEncDataOctets LEndEncOctets: vpshufd TMP4, TMP5, 78 vpxor TMP4, TMP4, TMP5 vpclmulqdq TMP0, TMP4, XMMWORD PTR[0*16 + 8*16 + Htbl], 000h vmovdqu TMP4, XMMWORD PTR[0*16 + Htbl] vpclmulqdq TMP1, TMP5, TMP4, 011h vpclmulqdq TMP2, TMP5, TMP4, 000h vmovdqu TMP5, XMMWORD PTR[1*16 + rsp] KARATSUBA 1 vmovdqu TMP5, XMMWORD PTR[2*16 + rsp] KARATSUBA 2 vmovdqu TMP5, XMMWORD PTR[3*16 + rsp] KARATSUBA 3 vmovdqu TMP5, XMMWORD PTR[4*16 + rsp] KARATSUBA 4 vmovdqu TMP5, XMMWORD PTR[5*16 + rsp] KARATSUBA 5 vmovdqu TMP5, XMMWORD PTR[6*16 + rsp] KARATSUBA 6 vpxor TMP5, T, XMMWORD PTR[7*16 + rsp] KARATSUBA 7 vpxor TMP0, TMP0, TMP1 vpxor TMP0, TMP0, TMP2 vpsrldq TMP3, TMP0, 8 vpxor TMP4, TMP1, TMP3 vpslldq TMP3, TMP0, 8 vpxor T, TMP2, TMP3 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 vpxor T, T, TMP4 sub aluCTR, 7 LEncDataSingles: cmp len, 16 jb LEncDataTail sub len, 16 vmovdqa TMP1, XMMWORD PTR[8*16 + 0*16 + rsp] NEXTCTR 0 vaesenc TMP1, TMP1, XMMWORD PTR[1*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[2*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[3*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[4*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[5*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[6*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[7*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[8*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[9*16 + KS] vmovdqu TMP2, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f vaesenc TMP1, TMP1, XMMWORD PTR[10*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[11*16 + KS] vmovdqu TMP2, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f vaesenc TMP1, TMP1, XMMWORD PTR[12*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[13*16 + KS] vmovdqu TMP2, XMMWORD PTR[14*16 + KS] @@: vaesenclast TMP1, TMP1, TMP2 vpxor TMP1, TMP1, XMMWORD PTR[PT] vmovdqu XMMWORD PTR[CT], TMP1 lea PT, [16+PT] lea CT, [16+CT] vpshufb TMP1, TMP1, BSWAPMASK vpxor T, T, TMP1 vmovdqu TMP0, XMMWORD PTR[Htbl] GFMUL T, T, TMP0, TMP1, TMP2, TMP3, TMP4 jmp LEncDataSingles LEncDataTail: test len, len jz LEncDataEnd vmovdqa TMP1, XMMWORD PTR[8*16 + 0*16 + rsp] vaesenc TMP1, TMP1, XMMWORD PTR[1*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[2*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[3*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[4*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[5*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[6*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[7*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[8*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[9*16 + KS] vmovdqu TMP2, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f vaesenc TMP1, TMP1, XMMWORD PTR[10*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[11*16 + KS] vmovdqu TMP2, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f vaesenc TMP1, TMP1, XMMWORD PTR[12*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[13*16 + KS] vmovdqu TMP2, XMMWORD PTR[14*16 + KS] @@: vaesenclast TMP1, TMP1, TMP2 ; zero a temp location vpxor TMP2, TMP2, TMP2 vmovdqa XMMWORD PTR[rsp], TMP2 ; copy as many bytes as needed xor KS, KS @@: cmp len, KS je @f mov al, [PT + KS] mov [rsp + KS], al inc KS jmp @b @@: vpxor TMP1, TMP1, XMMWORD PTR[rsp] vmovdqa XMMWORD PTR[rsp], TMP1 xor KS, KS @@: cmp len, KS je @f mov al, [rsp + KS] mov [CT + KS], al inc KS jmp @b @@: cmp KS, 16 je @f mov BYTE PTR[rsp + KS], 0 inc KS jmp @b @@: BAIL: vmovdqa TMP1, XMMWORD PTR[rsp] vpshufb TMP1, TMP1, BSWAPMASK vpxor T, T, TMP1 vmovdqu TMP0, XMMWORD PTR[Htbl] GFMUL T, T, TMP0, TMP1, TMP2, TMP3, TMP4 LEncDataEnd: vmovdqu XMMWORD PTR[16*16 + 1*16 + Gctx], T bswap aluCTR mov [16*16 + 2*16 + 3*4 + Gctx], aluCTR mov rsp, rbp vmovdqu xmm6, XMMWORD PTR[rsp + 0*16] vmovdqu xmm7, XMMWORD PTR[rsp + 1*16] vmovdqu xmm8, XMMWORD PTR[rsp + 2*16] vmovdqu xmm9, XMMWORD PTR[rsp + 3*16] vmovdqu xmm10, XMMWORD PTR[rsp + 4*16] vmovdqu xmm11, XMMWORD PTR[rsp + 5*16] vmovdqu xmm12, XMMWORD PTR[rsp + 6*16] vmovdqu xmm13, XMMWORD PTR[rsp + 7*16] vmovdqu xmm14, XMMWORD PTR[rsp + 8*16] vmovdqu xmm15, XMMWORD PTR[rsp + 9*16] add rsp, 10*16 pop rbp pop r13 pop r12 pop r11 vzeroupper ret intel_aes_gcmENC ENDP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Decrypt and Authenticate ; void intel_aes_gcmDEC(uint8_t* PT, uint8_t* CT, void *Gctx, unsigned int len); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 16 intel_aes_gcmDEC PROC NEXTCTR MACRO i add aluCTR, 1 mov aluTMP, aluCTR xor aluTMP, aluKSl bswap aluTMP mov [3*4 + i*16 + rsp], aluTMP ENDM PT textequ <rdx> CT textequ <rcx> test len, len jnz LbeginDEC ret LbeginDEC: vzeroupper push r11 push r12 push r13 push rbp sub rsp, 10*16 vmovdqu XMMWORD PTR[rsp + 0*16], xmm6 vmovdqu XMMWORD PTR[rsp + 1*16], xmm7 vmovdqu XMMWORD PTR[rsp + 2*16], xmm8 vmovdqu XMMWORD PTR[rsp + 3*16], xmm9 vmovdqu XMMWORD PTR[rsp + 4*16], xmm10 vmovdqu XMMWORD PTR[rsp + 5*16], xmm11 vmovdqu XMMWORD PTR[rsp + 6*16], xmm12 vmovdqu XMMWORD PTR[rsp + 7*16], xmm13 vmovdqu XMMWORD PTR[rsp + 8*16], xmm14 vmovdqu XMMWORD PTR[rsp + 9*16], xmm15 mov rbp, rsp sub rsp, 8*16 and rsp, -16 vmovdqu T, XMMWORD PTR[16*16 + 1*16 + Gctx] vmovdqu CTR0, XMMWORD PTR[16*16 + 2*16 + Gctx] vmovdqu BSWAPMASK, XMMWORD PTR[Lbswap_mask] mov KS, [16*16 + 3*16 + Gctx] mov NR, [4 + KS] lea KS, [48 + KS] vpshufb CTR0, CTR0, BSWAPMASK mov aluCTR, [16*16 + 2*16 + 3*4 + Gctx] mov aluKSl, [3*4 + KS] bswap aluCTR bswap aluKSl vmovdqu TMP0, XMMWORD PTR[0*16 + KS] vpxor TMP0, TMP0, XMMWORD PTR[16*16 + 2*16 + Gctx] vmovdqu XMMWORD PTR[0*16 + rsp], TMP0 cmp len, 128 jb LDecDataSingles ; Prepare the "top" counters vmovdqu XMMWORD PTR[1*16 + rsp], TMP0 vmovdqu XMMWORD PTR[2*16 + rsp], TMP0 vmovdqu XMMWORD PTR[3*16 + rsp], TMP0 vmovdqu XMMWORD PTR[4*16 + rsp], TMP0 vmovdqu XMMWORD PTR[5*16 + rsp], TMP0 vmovdqu XMMWORD PTR[6*16 + rsp], TMP0 vmovdqu XMMWORD PTR[7*16 + rsp], TMP0 NEXTCTR 1 NEXTCTR 2 NEXTCTR 3 NEXTCTR 4 NEXTCTR 5 NEXTCTR 6 NEXTCTR 7 LDecDataOctets: cmp len, 128 jb LEndDecOctets sub len, 128 vmovdqa CTR0, XMMWORD PTR[0*16 + rsp] vmovdqa CTR1, XMMWORD PTR[1*16 + rsp] vmovdqa CTR2, XMMWORD PTR[2*16 + rsp] vmovdqa CTR3, XMMWORD PTR[3*16 + rsp] vmovdqa CTR4, XMMWORD PTR[4*16 + rsp] vmovdqa CTR5, XMMWORD PTR[5*16 + rsp] vmovdqa CTR6, XMMWORD PTR[6*16 + rsp] vmovdqa CTR7, XMMWORD PTR[7*16 + rsp] vmovdqu TMP5, XMMWORD PTR[7*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK vpshufd TMP4, TMP5, 78 vpxor TMP4, TMP4, TMP5 vpclmulqdq TMP0, TMP4, XMMWORD PTR[0*16 + 8*16 + Htbl], 000h vmovdqu TMP4, XMMWORD PTR[0*16 + Htbl] vpclmulqdq TMP1, TMP5, TMP4, 011h vpclmulqdq TMP2, TMP5, TMP4, 000h vmovdqu TMP5, XMMWORD PTR[6*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 1 NEXTCTR 0 vmovdqu TMP5, XMMWORD PTR[5*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 2 NEXTCTR 1 vmovdqu TMP5, XMMWORD PTR[4*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 3 NEXTCTR 2 vmovdqu TMP5, XMMWORD PTR[3*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 4 NEXTCTR 3 vmovdqu TMP5, XMMWORD PTR[2*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 5 NEXTCTR 4 vmovdqu TMP5, XMMWORD PTR[1*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK ROUNDMUL 6 NEXTCTR 5 vmovdqu TMP5, XMMWORD PTR[0*16 + CT] vpshufb TMP5, TMP5, BSWAPMASK vpxor TMP5, TMP5, T ROUNDMUL 7 NEXTCTR 6 ROUND 8 NEXTCTR 7 vpxor TMP0, TMP0, TMP1 vpxor TMP0, TMP0, TMP2 vpsrldq TMP3, TMP0, 8 vpxor TMP4, TMP1, TMP3 vpslldq TMP3, TMP0, 8 vpxor T, TMP2, TMP3 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 ROUND 9 vpclmulqdq TMP1, T, XMMWORD PTR[Lpoly], 010h vpalignr T,T,T,8 vpxor T, T, TMP1 vmovdqu TMP5, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f ROUND 10 ROUND 11 vmovdqu TMP5, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f ROUND 12 ROUND 13 vmovdqu TMP5, XMMWORD PTR[14*16 + KS] @@: vpxor TMP3, TMP5, XMMWORD PTR[0*16 + CT] vaesenclast CTR0, CTR0, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[1*16 + CT] vaesenclast CTR1, CTR1, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[2*16 + CT] vaesenclast CTR2, CTR2, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[3*16 + CT] vaesenclast CTR3, CTR3, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[4*16 + CT] vaesenclast CTR4, CTR4, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[5*16 + CT] vaesenclast CTR5, CTR5, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[6*16 + CT] vaesenclast CTR6, CTR6, TMP3 vpxor TMP3, TMP5, XMMWORD PTR[7*16 + CT] vaesenclast CTR7, CTR7, TMP3 vmovdqu XMMWORD PTR[0*16 + PT], CTR0 vmovdqu XMMWORD PTR[1*16 + PT], CTR1 vmovdqu XMMWORD PTR[2*16 + PT], CTR2 vmovdqu XMMWORD PTR[3*16 + PT], CTR3 vmovdqu XMMWORD PTR[4*16 + PT], CTR4 vmovdqu XMMWORD PTR[5*16 + PT], CTR5 vmovdqu XMMWORD PTR[6*16 + PT], CTR6 vmovdqu XMMWORD PTR[7*16 + PT], CTR7 vpxor T, T, TMP4 lea CT, [8*16 + CT] lea PT, [8*16 + PT] jmp LDecDataOctets LEndDecOctets: sub aluCTR, 7 LDecDataSingles: cmp len, 16 jb LDecDataTail sub len, 16 vmovdqa TMP1, XMMWORD PTR[0*16 + rsp] NEXTCTR 0 vaesenc TMP1, TMP1, XMMWORD PTR[1*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[2*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[3*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[4*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[5*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[6*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[7*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[8*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[9*16 + KS] vmovdqu TMP2, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f vaesenc TMP1, TMP1, XMMWORD PTR[10*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[11*16 + KS] vmovdqu TMP2, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f vaesenc TMP1, TMP1, XMMWORD PTR[12*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[13*16 + KS] vmovdqu TMP2, XMMWORD PTR[14*16 + KS] @@: vaesenclast TMP1, TMP1, TMP2 vmovdqu TMP2, XMMWORD PTR[CT] vpxor TMP1, TMP1, TMP2 vmovdqu XMMWORD PTR[PT], TMP1 lea PT, [16+PT] lea CT, [16+CT] vpshufb TMP2, TMP2, BSWAPMASK vpxor T, T, TMP2 vmovdqu TMP0, XMMWORD PTR[Htbl] GFMUL T, T, TMP0, TMP1, TMP2, TMP3, TMP4 jmp LDecDataSingles LDecDataTail: test len, len jz LDecDataEnd vmovdqa TMP1, XMMWORD PTR[0*16 + rsp] inc aluCTR vaesenc TMP1, TMP1, XMMWORD PTR[1*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[2*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[3*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[4*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[5*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[6*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[7*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[8*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[9*16 + KS] vmovdqu TMP2, XMMWORD PTR[10*16 + KS] cmp NR, 10 je @f vaesenc TMP1, TMP1, XMMWORD PTR[10*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[11*16 + KS] vmovdqu TMP2, XMMWORD PTR[12*16 + KS] cmp NR, 12 je @f vaesenc TMP1, TMP1, XMMWORD PTR[12*16 + KS] vaesenc TMP1, TMP1, XMMWORD PTR[13*16 + KS] vmovdqu TMP2, XMMWORD PTR[14*16 + KS] @@: vaesenclast TMP1, TMP1, TMP2 ; copy as many bytes as needed xor KS, KS @@: cmp len, KS je @f mov al, [CT + KS] mov [rsp + KS], al inc KS jmp @b @@: cmp KS, 16 je @f mov BYTE PTR[rsp + KS], 0 inc KS jmp @b @@: vmovdqa TMP2, XMMWORD PTR[rsp] vpshufb TMP2, TMP2, BSWAPMASK vpxor T, T, TMP2 vmovdqu TMP0, XMMWORD PTR[Htbl] GFMUL T, T, TMP0, TMP5, TMP2, TMP3, TMP4 vpxor TMP1, TMP1, XMMWORD PTR[rsp] vmovdqa XMMWORD PTR[rsp], TMP1 xor KS, KS @@: cmp len, KS je @f mov al, [rsp + KS] mov [PT + KS], al inc KS jmp @b @@: cmp KS, 16 je @f mov BYTE PTR[rsp + KS], 0 inc KS jmp @b @@: LDecDataEnd: vmovdqu XMMWORD PTR[16*16 + 1*16 + Gctx], T bswap aluCTR mov [16*16 + 2*16 + 3*4 + Gctx], aluCTR mov rsp, rbp vmovdqu xmm6, XMMWORD PTR[rsp + 0*16] vmovdqu xmm7, XMMWORD PTR[rsp + 1*16] vmovdqu xmm8, XMMWORD PTR[rsp + 2*16] vmovdqu xmm9, XMMWORD PTR[rsp + 3*16] vmovdqu xmm10, XMMWORD PTR[rsp + 4*16] vmovdqu xmm11, XMMWORD PTR[rsp + 5*16] vmovdqu xmm12, XMMWORD PTR[rsp + 6*16] vmovdqu xmm13, XMMWORD PTR[rsp + 7*16] vmovdqu xmm14, XMMWORD PTR[rsp + 8*16] vmovdqu xmm15, XMMWORD PTR[rsp + 9*16] add rsp, 10*16 pop rbp pop r13 pop r12 pop r11 vzeroupper ret ret intel_aes_gcmDEC ENDP END
; Port IO - read/write to a port ; vi:filetype=nasm global read_port global write_port read_port: mov edx, [esp + 4] in al, dx ret write_port: mov edx, [esp + 4] mov al, [esp + 8] out dx, al ret
; int wv_stack_reserve(wv_stack_t *s, size_t n) SECTION code_adt_wv_stack PUBLIC _wv_stack_reserve EXTERN _w_vector_reserve defc _wv_stack_reserve = _w_vector_reserve
; A118538: a(n) = A000040(n+1) - 6. ; -3,-1,1,5,7,11,13,17,23,25,31,35,37,41,47,53,55,61,65,67,73,77,83,91,95,97,101,103,107,121,125,131,133,143,145,151,157,161,167,173,175,185,187,191,193,205,217,221,223,227,233,235,245,251,257,263,265,271,275,277,287,301,305,307,311,325,331,341,343,347 add $0,1 cal $0,40 ; The prime numbers. sub $0,6 mov $1,$0
%ifdef CONFIG { "RegData": { "MM7": ["0x8000000000000000", "0x4009"] }, "Mode": "32BIT" } %endif lea edx, [.data] fild dword [edx + 8 * 0] hlt .data: dq 1024
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.24241.7 TITLE C:\projects\gsl\tests\span_compile_only.cpp .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRT INCLUDELIB OLDNAMES PUBLIC ??0exception@std@@QAE@ABV01@@Z ; std::exception::exception PUBLIC ??1exception@std@@UAE@XZ ; std::exception::~exception PUBLIC ?what@exception@std@@UBEPBDXZ ; std::exception::what PUBLIC ??_Gexception@std@@UAEPAXI@Z ; std::exception::`scalar deleting destructor' PUBLIC ??0logic_error@std@@QAE@ABV01@@Z ; std::logic_error::logic_error PUBLIC ??_Glogic_error@std@@UAEPAXI@Z ; std::logic_error::`scalar deleting destructor' PUBLIC ??1fail_fast@gsl@@UAE@XZ ; gsl::fail_fast::~fail_fast PUBLIC ??0fail_fast@gsl@@QAE@ABU01@@Z ; gsl::fail_fast::fail_fast PUBLIC ??_Gfail_fast@gsl@@UAEPAXI@Z ; gsl::fail_fast::`scalar deleting destructor' PUBLIC ??1narrowing_error@gsl@@UAE@XZ ; gsl::narrowing_error::~narrowing_error PUBLIC ??0narrowing_error@gsl@@QAE@ABU01@@Z ; gsl::narrowing_error::narrowing_error PUBLIC ??_Gnarrowing_error@gsl@@UAEPAXI@Z ; gsl::narrowing_error::`scalar deleting destructor' PUBLIC ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ; gsl::details::extent_type<-1>::extent_type<-1> PUBLIC ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> PUBLIC ?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z ; test_span_unoptimizable_rangecheck PUBLIC ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan PUBLIC ?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z ; test_span_for PUBLIC ?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z ; test_span_iter PUBLIC ?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z ; test_span_rangeiter PUBLIC ?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z ; static_size_array_span PUBLIC ??A?$span@E$0?0@gsl@@QBEAAEH@Z ; gsl::span<unsigned char,-1>::operator[] PUBLIC ?test_convert_span_Joe@@YAEAAUIDE_DRIVE_STATE@@@Z ; test_convert_span_Joe PUBLIC ??$convert_span@EV?$span@G$0?0@gsl@@@@YA?AV?$span@E$0?0@gsl@@V?$span@G$0?0@1@@Z ; convert_span<unsigned char,gsl::span<unsigned short,-1> > PUBLIC ?mysubspan1@@YAHXZ ; mysubspan1 PUBLIC ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> PUBLIC ?mysubspan2@@YAHH@Z ; mysubspan2 PUBLIC ?mysubspan3@@YAHXZ ; mysubspan3 PUBLIC ?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ; mysubspan4 PUBLIC ?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ; mysubspan5 PUBLIC ?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z ; mysubspan6 PUBLIC ?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ; mysubspan7 PUBLIC ?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ; mysubspan8 PUBLIC ?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ; mysubspan9 PUBLIC ?doterminate@@YAXXZ ; doterminate PUBLIC ?copy_span@@YAXV?$span@H$0?0@gsl@@0@Z ; copy_span PUBLIC ?gsl_copy_span@@YAXV?$span@H$0?0@gsl@@0@Z ; gsl_copy_span PUBLIC ??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z ; gsl::copy<int,-1,int,-1> PUBLIC ?test_string_std_copy@@YAXXZ ; test_string_std_copy PUBLIC ??$ensure_z@$$CBD$0L@@gsl@@YA?AV?$span@$$CBD$0?0@0@AAY0L@$$CBD@Z ; gsl::ensure_z<char const ,11> PUBLIC ?test_string_gsl_copy@@YAXXZ ; test_string_gsl_copy PUBLIC ??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z ; gsl::copy<char const ,-1,unsigned char,-1> PUBLIC ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> PUBLIC ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> PUBLIC ??$narrow_cast@IAAH@gsl@@YAIAAH@Z ; gsl::narrow_cast<unsigned int,int &> PUBLIC ??$narrow_cast@HI@gsl@@YAH$$QAI@Z ; gsl::narrow_cast<int,unsigned int> PUBLIC ??$ensure_z@$$CBD@gsl@@YA?AV?$span@$$CBD$0?0@0@ABQBDH@Z ; gsl::ensure_z<char const > PUBLIC ??$narrow@HH@gsl@@YAHH@Z ; gsl::narrow<int,int> PUBLIC ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> PUBLIC ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> PUBLIC ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ; gsl::ensure_sentinel<char const ,0> PUBLIC ??$narrow_cast@HAAH@gsl@@YAHAAH@Z ; gsl::narrow_cast<int,int &> PUBLIC ??$throw_exception@Unarrowing_error@gsl@@@details@gsl@@YAX$$QAUnarrowing_error@1@@Z ; gsl::details::throw_exception<gsl::narrowing_error> PUBLIC ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > PUBLIC ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > PUBLIC ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > PUBLIC ??_7exception@std@@6B@ ; std::exception::`vftable' PUBLIC ??_C@_0BC@EOODALEL@Unknown?5exception?$AA@ ; `string' PUBLIC ??_7logic_error@std@@6B@ ; std::logic_error::`vftable' PUBLIC ??_7fail_fast@gsl@@6B@ ; gsl::fail_fast::`vftable' PUBLIC ??_R0?AVexception@std@@@8 ; std::exception `RTTI Type Descriptor' PUBLIC __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 PUBLIC ??_7narrowing_error@gsl@@6B@ ; gsl::narrowing_error::`vftable' PUBLIC ??_C@_0ED@HKMFEAN@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0L@CCAJJBND@iVtrau?5lDC?$AA@ ; `string' PUBLIC ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@HPDDDCPI@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@BLFPPHPM@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC __TI3?AUfail_fast@gsl@@ PUBLIC __CTA3?AUfail_fast@gsl@@ PUBLIC ??_R0?AUfail_fast@gsl@@@8 ; gsl::fail_fast `RTTI Type Descriptor' PUBLIC __CT??_R0?AUfail_fast@gsl@@@8??0fail_fast@gsl@@QAE@ABU01@@Z12 PUBLIC ??_R0?AVlogic_error@std@@@8 ; std::logic_error `RTTI Type Descriptor' PUBLIC __CT??_R0?AVlogic_error@std@@@8??0logic_error@std@@QAE@ABV01@@Z12 PUBLIC ??_C@_0EL@GNMGMEGC@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@ELDMELAD@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0ED@EJCPKIPN@GSL?3?5Precondition?5failure?5at?5C?3?2@ ; `string' PUBLIC ??_C@_0EL@CELLNNNE@GSL?3?5Postcondition?5failure?5at?5C?3@ ; `string' PUBLIC ??_C@_0EL@HAKHMEAL@GSL?3?5Postcondition?5failure?5at?5C?3@ ; `string' PUBLIC __TI2?AUnarrowing_error@gsl@@ PUBLIC __CTA2?AUnarrowing_error@gsl@@ PUBLIC ??_R0?AUnarrowing_error@gsl@@@8 ; gsl::narrowing_error `RTTI Type Descriptor' PUBLIC __CT??_R0?AUnarrowing_error@gsl@@@8??0narrowing_error@gsl@@QAE@ABU01@@Z12 PUBLIC ??_R4exception@std@@6B@ ; std::exception::`RTTI Complete Object Locator' PUBLIC ??_R3exception@std@@8 ; std::exception::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2exception@std@@8 ; std::exception::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@exception@std@@8 ; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4logic_error@std@@6B@ ; std::logic_error::`RTTI Complete Object Locator' PUBLIC ??_R3logic_error@std@@8 ; std::logic_error::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2logic_error@std@@8 ; std::logic_error::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@logic_error@std@@8 ; std::logic_error::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4fail_fast@gsl@@6B@ ; gsl::fail_fast::`RTTI Complete Object Locator' PUBLIC ??_R3fail_fast@gsl@@8 ; gsl::fail_fast::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2fail_fast@gsl@@8 ; gsl::fail_fast::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@fail_fast@gsl@@8 ; gsl::fail_fast::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4narrowing_error@gsl@@6B@ ; gsl::narrowing_error::`RTTI Complete Object Locator' PUBLIC ??_R3narrowing_error@gsl@@8 ; gsl::narrowing_error::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2narrowing_error@gsl@@8 ; gsl::narrowing_error::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@narrowing_error@gsl@@8 ; gsl::narrowing_error::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC __xmm@00000003000000020000000100000000 EXTRN ??3@YAXPAXI@Z:PROC ; operator delete EXTRN ___std_terminate:PROC EXTRN __imp__terminate:PROC EXTRN __imp____std_exception_copy:PROC EXTRN __imp____std_exception_destroy:PROC EXTRN ??_Eexception@std@@UAEPAXI@Z:PROC ; std::exception::`vector deleting destructor' EXTRN __imp__memmove:PROC EXTRN ??_Elogic_error@std@@UAEPAXI@Z:PROC ; std::logic_error::`vector deleting destructor' EXTRN ??_Efail_fast@gsl@@UAEPAXI@Z:PROC ; gsl::fail_fast::`vector deleting destructor' EXTRN ??_Enarrowing_error@gsl@@UAEPAXI@Z:PROC ; gsl::narrowing_error::`vector deleting destructor' EXTRN ?bar@@YAXV?$span@E$0?0@gsl@@@Z:PROC ; bar EXTRN @__security_check_cookie@4:PROC EXTRN __CxxThrowException@8:PROC EXTRN ___CxxFrameHandler3:PROC EXTRN ??_7type_info@@6B@:QWORD ; type_info::`vftable' EXTRN ___security_cookie:DWORD ; COMDAT __xmm@00000003000000020000000100000000 CONST SEGMENT __xmm@00000003000000020000000100000000 DB 00H, 00H, 00H, 00H, 01H, 00H, 00H DB 00H, 02H, 00H, 00H, 00H, 03H, 00H, 00H, 00H CONST ENDS ; COMDAT ??_R1A@?0A@EA@narrowing_error@gsl@@8 rdata$r SEGMENT ??_R1A@?0A@EA@narrowing_error@gsl@@8 DD FLAT:??_R0?AUnarrowing_error@gsl@@@8 ; gsl::narrowing_error::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 01H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3narrowing_error@gsl@@8 rdata$r ENDS ; COMDAT ??_R2narrowing_error@gsl@@8 rdata$r SEGMENT ??_R2narrowing_error@gsl@@8 DD FLAT:??_R1A@?0A@EA@narrowing_error@gsl@@8 ; gsl::narrowing_error::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3narrowing_error@gsl@@8 rdata$r SEGMENT ??_R3narrowing_error@gsl@@8 DD 00H ; gsl::narrowing_error::`RTTI Class Hierarchy Descriptor' DD 00H DD 02H DD FLAT:??_R2narrowing_error@gsl@@8 rdata$r ENDS ; COMDAT ??_R4narrowing_error@gsl@@6B@ rdata$r SEGMENT ??_R4narrowing_error@gsl@@6B@ DD 00H ; gsl::narrowing_error::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AUnarrowing_error@gsl@@@8 DD FLAT:??_R3narrowing_error@gsl@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@fail_fast@gsl@@8 rdata$r SEGMENT ??_R1A@?0A@EA@fail_fast@gsl@@8 DD FLAT:??_R0?AUfail_fast@gsl@@@8 ; gsl::fail_fast::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 02H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3fail_fast@gsl@@8 rdata$r ENDS ; COMDAT ??_R2fail_fast@gsl@@8 rdata$r SEGMENT ??_R2fail_fast@gsl@@8 DD FLAT:??_R1A@?0A@EA@fail_fast@gsl@@8 ; gsl::fail_fast::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@logic_error@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3fail_fast@gsl@@8 rdata$r SEGMENT ??_R3fail_fast@gsl@@8 DD 00H ; gsl::fail_fast::`RTTI Class Hierarchy Descriptor' DD 00H DD 03H DD FLAT:??_R2fail_fast@gsl@@8 rdata$r ENDS ; COMDAT ??_R4fail_fast@gsl@@6B@ rdata$r SEGMENT ??_R4fail_fast@gsl@@6B@ DD 00H ; gsl::fail_fast::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AUfail_fast@gsl@@@8 DD FLAT:??_R3fail_fast@gsl@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@logic_error@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@logic_error@std@@8 DD FLAT:??_R0?AVlogic_error@std@@@8 ; std::logic_error::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 01H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3logic_error@std@@8 rdata$r ENDS ; COMDAT ??_R2logic_error@std@@8 rdata$r SEGMENT ??_R2logic_error@std@@8 DD FLAT:??_R1A@?0A@EA@logic_error@std@@8 ; std::logic_error::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3logic_error@std@@8 rdata$r SEGMENT ??_R3logic_error@std@@8 DD 00H ; std::logic_error::`RTTI Class Hierarchy Descriptor' DD 00H DD 02H DD FLAT:??_R2logic_error@std@@8 rdata$r ENDS ; COMDAT ??_R4logic_error@std@@6B@ rdata$r SEGMENT ??_R4logic_error@std@@6B@ DD 00H ; std::logic_error::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVlogic_error@std@@@8 DD FLAT:??_R3logic_error@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@exception@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@exception@std@@8 DD FLAT:??_R0?AVexception@std@@@8 ; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 00H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3exception@std@@8 rdata$r ENDS ; COMDAT ??_R2exception@std@@8 rdata$r SEGMENT ??_R2exception@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 ; std::exception::`RTTI Base Class Array' rdata$r ENDS ; COMDAT ??_R3exception@std@@8 rdata$r SEGMENT ??_R3exception@std@@8 DD 00H ; std::exception::`RTTI Class Hierarchy Descriptor' DD 00H DD 01H DD FLAT:??_R2exception@std@@8 rdata$r ENDS ; COMDAT ??_R4exception@std@@6B@ rdata$r SEGMENT ??_R4exception@std@@6B@ DD 00H ; std::exception::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVexception@std@@@8 DD FLAT:??_R3exception@std@@8 rdata$r ENDS ; COMDAT __CT??_R0?AUnarrowing_error@gsl@@@8??0narrowing_error@gsl@@QAE@ABU01@@Z12 xdata$x SEGMENT __CT??_R0?AUnarrowing_error@gsl@@@8??0narrowing_error@gsl@@QAE@ABU01@@Z12 DD 00H DD FLAT:??_R0?AUnarrowing_error@gsl@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0narrowing_error@gsl@@QAE@ABU01@@Z xdata$x ENDS ; COMDAT ??_R0?AUnarrowing_error@gsl@@@8 data$r SEGMENT ??_R0?AUnarrowing_error@gsl@@@8 DD FLAT:??_7type_info@@6B@ ; gsl::narrowing_error `RTTI Type Descriptor' DD 00H DB '.?AUnarrowing_error@gsl@@', 00H data$r ENDS ; COMDAT __CTA2?AUnarrowing_error@gsl@@ xdata$x SEGMENT __CTA2?AUnarrowing_error@gsl@@ DD 02H DD FLAT:__CT??_R0?AUnarrowing_error@gsl@@@8??0narrowing_error@gsl@@QAE@ABU01@@Z12 DD FLAT:__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x ENDS ; COMDAT __TI2?AUnarrowing_error@gsl@@ xdata$x SEGMENT __TI2?AUnarrowing_error@gsl@@ DD 00H DD FLAT:??1narrowing_error@gsl@@UAE@XZ DD 00H DD FLAT:__CTA2?AUnarrowing_error@gsl@@ xdata$x ENDS ; COMDAT ??_C@_0EL@HAKHMEAL@GSL?3?5Postcondition?5failure?5at?5C?3@ CONST SEGMENT ??_C@_0EL@HAKHMEAL@GSL?3?5Postcondition?5failure?5at?5C?3@ DB 'GSL: Postc' DB 'ondition failure at C:\projects\gsl\include\gsl/string_span: ' DB '122', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0EL@CELLNNNE@GSL?3?5Postcondition?5failure?5at?5C?3@ CONST SEGMENT ??_C@_0EL@CELLNNNE@GSL?3?5Postcondition?5failure?5at?5C?3@ DB 'GSL: Postc' DB 'ondition failure at C:\projects\gsl\include\gsl/string_span: ' DB '114', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@EJCPKIPN@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@EJCPKIPN@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 321', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@ELDMELAD@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@ELDMELAD@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 592', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 599', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 598', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0EL@GNMGMEGC@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0EL@GNMGMEGC@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/gsl_algorithm' DB ': 50', 00H ; `string' CONST ENDS ; COMDAT __CT??_R0?AVlogic_error@std@@@8??0logic_error@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVlogic_error@std@@@8??0logic_error@std@@QAE@ABV01@@Z12 DD 00H DD FLAT:??_R0?AVlogic_error@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0logic_error@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVlogic_error@std@@@8 data$r SEGMENT ??_R0?AVlogic_error@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::logic_error `RTTI Type Descriptor' DD 00H DB '.?AVlogic_error@std@@', 00H data$r ENDS ; COMDAT __CT??_R0?AUfail_fast@gsl@@@8??0fail_fast@gsl@@QAE@ABU01@@Z12 xdata$x SEGMENT __CT??_R0?AUfail_fast@gsl@@@8??0fail_fast@gsl@@QAE@ABU01@@Z12 DD 00H DD FLAT:??_R0?AUfail_fast@gsl@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0fail_fast@gsl@@QAE@ABU01@@Z xdata$x ENDS ; COMDAT ??_R0?AUfail_fast@gsl@@@8 data$r SEGMENT ??_R0?AUfail_fast@gsl@@@8 DD FLAT:??_7type_info@@6B@ ; gsl::fail_fast `RTTI Type Descriptor' DD 00H DB '.?AUfail_fast@gsl@@', 00H data$r ENDS ; COMDAT __CTA3?AUfail_fast@gsl@@ xdata$x SEGMENT __CTA3?AUfail_fast@gsl@@ DD 03H DD FLAT:__CT??_R0?AUfail_fast@gsl@@@8??0fail_fast@gsl@@QAE@ABU01@@Z12 DD FLAT:__CT??_R0?AVlogic_error@std@@@8??0logic_error@std@@QAE@ABV01@@Z12 DD FLAT:__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x ENDS ; COMDAT __TI3?AUfail_fast@gsl@@ xdata$x SEGMENT __TI3?AUfail_fast@gsl@@ DD 00H DD FLAT:??1fail_fast@gsl@@UAE@XZ DD 00H DD FLAT:__CTA3?AUfail_fast@gsl@@ xdata$x ENDS ; COMDAT ??_C@_0ED@BLFPPHPM@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@BLFPPHPM@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 635', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@HPDDDCPI@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@HPDDDCPI@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 631', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 157', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 169', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Prec' DB 'ondition failure at C:\projects\gsl\include\gsl/span: 509', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0L@CCAJJBND@iVtrau?5lDC?$AA@ CONST SEGMENT ??_C@_0L@CCAJJBND@iVtrau?5lDC?$AA@ DB 'iVtrau lDC', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0ED@HKMFEAN@GSL?3?5Precondition?5failure?5at?5C?3?2@ CONST SEGMENT ??_C@_0ED@HKMFEAN@GSL?3?5Precondition?5failure?5at?5C?3?2@ DB 'GSL: Preco' DB 'ndition failure at C:\projects\gsl\include\gsl/span: 336', 00H ; `string' CONST ENDS ; COMDAT ??_7narrowing_error@gsl@@6B@ CONST SEGMENT ??_7narrowing_error@gsl@@6B@ DD FLAT:??_R4narrowing_error@gsl@@6B@ ; gsl::narrowing_error::`vftable' DD FLAT:??_Enarrowing_error@gsl@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 DD 00H DD FLAT:??_R0?AVexception@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0exception@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVexception@std@@@8 data$r SEGMENT ??_R0?AVexception@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::exception `RTTI Type Descriptor' DD 00H DB '.?AVexception@std@@', 00H data$r ENDS ; COMDAT ??_7fail_fast@gsl@@6B@ CONST SEGMENT ??_7fail_fast@gsl@@6B@ DD FLAT:??_R4fail_fast@gsl@@6B@ ; gsl::fail_fast::`vftable' DD FLAT:??_Efail_fast@gsl@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_7logic_error@std@@6B@ CONST SEGMENT ??_7logic_error@std@@6B@ DD FLAT:??_R4logic_error@std@@6B@ ; std::logic_error::`vftable' DD FLAT:??_Elogic_error@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_C@_0BC@EOODALEL@Unknown?5exception?$AA@ CONST SEGMENT ??_C@_0BC@EOODALEL@Unknown?5exception?$AA@ DB 'Unknown exception', 00H ; `string' CONST ENDS ; COMDAT ??_7exception@std@@6B@ CONST SEGMENT ??_7exception@std@@6B@ DD FLAT:??_R4exception@std@@6B@ ; std::exception::`vftable' DD FLAT:??_Eexception@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$5 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$12 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$19 __ehfuncinfo$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z DD 019930522H DD 04H DD FLAT:__unwindtable$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$5 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$12 DD 0ffffffffH DD FLAT:__unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$19 __ehfuncinfo$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z DD 019930522H DD 04H DD FLAT:__unwindtable$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z DD 0ffffffffH DD 00H DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z$1 __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z$0 DD 0ffffffffH DD 00H DD 0ffffffffH DD FLAT:__unwindfunclet$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z$2 __ehfuncinfo$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z DD 019930522H DD 03H DD FLAT:__unwindtable$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z$1 __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z$1 __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$narrow@HH@gsl@@YAHH@Z DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __ehfuncinfo$??$narrow@HH@gsl@@YAHH@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$narrow@HH@gsl@@YAHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z DD 0ffffffffH DD 00H __ehfuncinfo$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __ehfuncinfo$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 0ffffffffH DD 00H __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 0ffffffffH DD 00H __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z$0 __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z$1 __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z$0 __ehfuncinfo$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __ehfuncinfo$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_string_gsl_copy@@YAXXZ DD 0ffffffffH DD FLAT:__unwindfunclet$?test_string_gsl_copy@@YAXXZ$0 DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __ehfuncinfo$?test_string_gsl_copy@@YAXXZ DD 019930522H DD 03H DD FLAT:__unwindtable$?test_string_gsl_copy@@YAXXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 0ffffffffH DD FLAT:__unwindfunclet$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0 __ehfuncinfo$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 019930522H DD 01H DD FLAT:__unwindtable$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ DD 0ffffffffH DD FLAT:__unwindfunclet$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ$0 __ehfuncinfo$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ DD 019930522H DD 01H DD FLAT:__unwindtable$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 0ffffffffH DD FLAT:__unwindfunclet$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0 __ehfuncinfo$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 019930522H DD 01H DD FLAT:__unwindtable$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ DD 0ffffffffH DD FLAT:__unwindfunclet$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ$0 __ehfuncinfo$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ DD 019930522H DD 01H DD FLAT:__unwindtable$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __ehfuncinfo$??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z DD 019930522H DD 00H DD 00H DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 05H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_string_std_copy@@YAXXZ DD 0ffffffffH DD FLAT:__unwindfunclet$?test_string_std_copy@@YAXXZ$0 __ehfuncinfo$?test_string_std_copy@@YAXXZ DD 019930522H DD 01H DD FLAT:__unwindtable$?test_string_std_copy@@YAXXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z$0 __ehfuncinfo$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0 __ehfuncinfo$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0 __ehfuncinfo$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0 __ehfuncinfo$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z$2 __ehfuncinfo$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0 __ehfuncinfo$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __ehfuncinfo$??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ DD 019930522H DD 00H DD 00H DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 05H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$2 __ehfuncinfo$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan3@@YAHXZ DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan3@@YAHXZ$0 __ehfuncinfo$?mysubspan3@@YAHXZ DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan3@@YAHXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan2@@YAHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan2@@YAHH@Z$0 __ehfuncinfo$?mysubspan2@@YAHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan2@@YAHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __ehfuncinfo$??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z DD 019930522H DD 00H DD 00H DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 05H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??0?$extent_type@$05@details@gsl@@QAE@H@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??0?$extent_type@$05@details@gsl@@QAE@H@Z$0 __ehfuncinfo$??0?$extent_type@$05@details@gsl@@QAE@H@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??0?$extent_type@$05@details@gsl@@QAE@H@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?mysubspan1@@YAHXZ DD 0ffffffffH DD FLAT:__unwindfunclet$?mysubspan1@@YAHXZ$0 __ehfuncinfo$?mysubspan1@@YAHXZ DD 019930522H DD 01H DD FLAT:__unwindtable$?mysubspan1@@YAHXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __ehfuncinfo$??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z DD 019930522H DD 00H DD 00H DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 05H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??A?$span@E$0?0@gsl@@QBEAAEH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??A?$span@E$0?0@gsl@@QBEAAEH@Z$0 __ehfuncinfo$??A?$span@E$0?0@gsl@@QBEAAEH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??A?$span@E$0?0@gsl@@QBEAAEH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z$8 __ehfuncinfo$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z$6 DD 0ffffffffH DD FLAT:__unwindfunclet$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z$13 __ehfuncinfo$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 0ffffffffH DD FLAT:__unwindfunclet$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0 __ehfuncinfo$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 019930522H DD 01H DD FLAT:__unwindtable$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ DD 0ffffffffH DD FLAT:__unwindfunclet$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ$0 __ehfuncinfo$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ DD 019930522H DD 01H DD FLAT:__unwindtable$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z$2 DD 0ffffffffH DD 00H __ehfuncinfo$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z$2 __ehfuncinfo$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z$0 DD 0ffffffffH DD FLAT:__unwindfunclet$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z$1 __ehfuncinfo$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z DD 019930522H DD 02H DD FLAT:__unwindtable$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??A?$span@H$0?0@gsl@@QBEAAHH@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??A?$span@H$0?0@gsl@@QBEAAHH@Z$0 __ehfuncinfo$??A?$span@H$0?0@gsl@@QBEAAHH@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??A?$span@H$0?0@gsl@@QBEAAHH@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z DD 0ffffffffH DD FLAT:__unwindfunclet$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z$0 __ehfuncinfo$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z DD 019930522H DD 01H DD FLAT:__unwindtable$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __unwindtable$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z DD 0ffffffffH DD FLAT:__unwindfunclet$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z$0 __ehfuncinfo$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z DD 019930522H DD 01H DD FLAT:__unwindtable$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z DD 2 DUP(00H) DD 2 DUP(00H) DD 00H DD 01H xdata$x ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_memmove@PBDPAE@std@@YAPAEPBD0PAE@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Last$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$_Copy_memmove@PBDPAE@std@@YAPAEPBD0PAE@Z PROC ; std::_Copy_memmove<char const *,unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2301 push ebp mov ebp, esp ; Line 2305 mov eax, DWORD PTR __First$[ebp] push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] push edi mov edi, DWORD PTR __Last$[ebp] sub edi, eax push edi push eax push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop edi pop esi ; Line 2308 pop ebp ret 0 ??$_Copy_memmove@PBDPAE@std@@YAPAEPBD0PAE@Z ENDP ; std::_Copy_memmove<char const *,unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z _TEXT SEGMENT $T2 = -80 ; size = 12 $T3 = -68 ; size = 12 $T4 = -56 ; size = 12 $T5 = -44 ; size = 12 __InitData$6 = -32 ; size = 8 __InitData$7 = -24 ; size = 8 __InitData$8 = -24 ; size = 8 __InitData$9 = -24 ; size = 8 $T10 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ___formal$ = 36 ; size = 1 ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z PROC ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2314 push ebp mov ebp, esp push -1 push __ehhandler$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 68 ; 00000044H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx mov DWORD PTR $T10[ebp], ebx mov esi, DWORD PTR __imp____std_exception_destroy mov edx, DWORD PTR __Dest$[ebp+4] mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] npad 4 $LL35@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 231 cmp eax, DWORD PTR __Last$[ebp] jne SHORT $LN66@Copy_unche cmp ecx, DWORD PTR __Last$[ebp+4] je $LN3@Copy_unche $LN66@Copy_unche: ; Line 157 cmp ecx, DWORD PTR [eax] je $LN71@Copy_unche test bl, 4 je SHORT $LN92@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -5 ; fffffffbH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] $LN92@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 515 mov edi, DWORD PTR [eax+4] ; Line 498 mov eax, DWORD PTR __Dest$[ebp] ; Line 158 add edi, ecx ; Line 157 cmp edx, DWORD PTR [eax] je $LN104@Copy_unche test bl, 8 je SHORT $LN125@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -9 ; fffffff7H ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 $LN125@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR [eax+4] ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2316 mov al, BYTE PTR [edi] mov BYTE PTR [edx+ecx], al ; File c:\projects\gsl\include\gsl\span ; Line 169 mov edx, DWORD PTR __Dest$[ebp+4] test edx, edx js $LN8@Copy_unche ; Line 498 mov eax, DWORD PTR __Dest$[ebp] ; Line 169 cmp edx, DWORD PTR [eax] je $LN8@Copy_unche test bl, 1 je SHORT $LN29@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T4[ebp+4] mov DWORD PTR $T4[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 $LN29@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 169 mov ecx, DWORD PTR __First$[ebp+4] ; Line 170 inc edx mov DWORD PTR __Dest$[ebp+4], edx ; Line 169 test ecx, ecx js SHORT $LN36@Copy_unche ; Line 498 mov eax, DWORD PTR __First$[ebp] ; Line 169 cmp ecx, DWORD PTR [eax] je SHORT $LN36@Copy_unche mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 2 je SHORT $LN57@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T5[ebp+4] mov DWORD PTR $T5[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -3 ; fffffffdH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] $LN57@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 170 inc ecx mov DWORD PTR __First$[ebp+4], ecx jmp $LL35@Copy_unche $LN3@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2317 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov ecx, DWORD PTR __Dest$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], edx ; Line 2318 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN36@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T5[ebp+4] mov DWORD PTR $T5[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$8[ebp] mov DWORD PTR __InitData$8[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$8[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T5[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T5[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T5[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 or ebx, 2 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN142@Copy_unche: $LN8@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T4[ebp+4] mov DWORD PTR $T4[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$9[ebp] mov DWORD PTR __InitData$9[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$9[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T4[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T4[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T4[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN143@Copy_unche: $LN104@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$7[ebp] mov DWORD PTR __InitData$7[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$7[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 3 or ebx, 8 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN144@Copy_unche: $LN71@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$6[ebp] mov DWORD PTR __InitData$6[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$6[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 2 or ebx, 4 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN145@Copy_unche: $LN141@Copy_unche: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$5: mov eax, DWORD PTR $T10[ebp] and eax, 2 je $LN39@Copy_unche and DWORD PTR $T10[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T5[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN39@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$0: mov eax, DWORD PTR $T10[ebp] and eax, 1 je $LN11@Copy_unche and DWORD PTR $T10[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T4[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$19: mov eax, DWORD PTR $T10[ebp] and eax, 8 je $LN107@Copy_unche and DWORD PTR $T10[ebp], -9 ; fffffff7H lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN107@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z$12: mov eax, DWORD PTR $T10[ebp] and eax, 4 je $LN74@Copy_unche and DWORD PTR $T10[ebp], -5 ; fffffffbH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN74@Copy_unche: ret 0 __ehhandler$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-84] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ENDP ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > ; Function compile flags: /Ogtp ; COMDAT ??$_Ptr_copy_cat@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@ABV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@34@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??$_Ptr_copy_cat@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@ABV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@34@@Z PROC ; std::_Ptr_copy_cat<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 783 xor al, al ; Line 784 ret 0 ??$_Ptr_copy_cat@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@ABV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@34@@Z ENDP ; std::_Ptr_copy_cat<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_memmove@PAHPAH@std@@YAPAHPAH00@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Last$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$_Copy_memmove@PAHPAH@std@@YAPAHPAH00@Z PROC ; std::_Copy_memmove<int *,int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2301 push ebp mov ebp, esp ; Line 2305 mov eax, DWORD PTR __First$[ebp] push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] push edi mov edi, DWORD PTR __Last$[ebp] sub edi, eax push edi push eax push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop edi pop esi ; Line 2308 pop ebp ret 0 ??$_Copy_memmove@PAHPAH@std@@YAPAHPAH00@Z ENDP ; std::_Copy_memmove<int *,int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z _TEXT SEGMENT $T2 = -80 ; size = 12 $T3 = -68 ; size = 12 $T4 = -56 ; size = 12 $T5 = -44 ; size = 12 __InitData$6 = -32 ; size = 8 __InitData$7 = -24 ; size = 8 __InitData$8 = -24 ; size = 8 __InitData$9 = -24 ; size = 8 $T10 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ___formal$ = 36 ; size = 1 ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z PROC ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2314 push ebp mov ebp, esp push -1 push __ehhandler$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 68 ; 00000044H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx mov DWORD PTR $T10[ebp], ebx mov esi, DWORD PTR __imp____std_exception_destroy mov edx, DWORD PTR __Dest$[ebp+4] mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] npad 4 $LL35@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 231 cmp eax, DWORD PTR __Last$[ebp] jne SHORT $LN66@Copy_unche cmp ecx, DWORD PTR __Last$[ebp+4] je $LN3@Copy_unche $LN66@Copy_unche: ; Line 157 cmp ecx, DWORD PTR [eax] je $LN71@Copy_unche test bl, 4 je SHORT $LN92@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -5 ; fffffffbH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] $LN92@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [eax+4] ; Line 158 lea edi, DWORD PTR [eax+ecx*4] ; Line 498 mov eax, DWORD PTR __Dest$[ebp] ; Line 157 cmp edx, DWORD PTR [eax] je $LN104@Copy_unche test bl, 8 je SHORT $LN125@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -9 ; fffffff7H ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 $LN125@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR [eax+4] ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2316 mov eax, DWORD PTR [edi] mov DWORD PTR [ecx+edx*4], eax ; File c:\projects\gsl\include\gsl\span ; Line 169 mov edx, DWORD PTR __Dest$[ebp+4] test edx, edx js $LN8@Copy_unche ; Line 498 mov eax, DWORD PTR __Dest$[ebp] ; Line 169 cmp edx, DWORD PTR [eax] je $LN8@Copy_unche test bl, 1 je SHORT $LN29@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T4[ebp+4] mov DWORD PTR $T4[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 $LN29@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 169 mov ecx, DWORD PTR __First$[ebp+4] ; Line 170 inc edx mov DWORD PTR __Dest$[ebp+4], edx ; Line 169 test ecx, ecx js SHORT $LN36@Copy_unche ; Line 498 mov eax, DWORD PTR __First$[ebp] ; Line 169 cmp ecx, DWORD PTR [eax] je SHORT $LN36@Copy_unche mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 2 je SHORT $LN57@Copy_unche ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T5[ebp+4] mov DWORD PTR $T5[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -3 ; fffffffdH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call esi mov edx, DWORD PTR __Dest$[ebp+4] add esp, 4 mov ecx, DWORD PTR __First$[ebp+4] mov eax, DWORD PTR __First$[ebp] $LN57@Copy_unche: ; File c:\projects\gsl\include\gsl\span ; Line 170 inc ecx mov DWORD PTR __First$[ebp+4], ecx jmp $LL35@Copy_unche $LN3@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2317 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov ecx, DWORD PTR __Dest$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], edx ; Line 2318 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN36@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T5[ebp+4] mov DWORD PTR $T5[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$8[ebp] mov DWORD PTR __InitData$8[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$8[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T5[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T5[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T5[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 or ebx, 2 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN142@Copy_unche: $LN8@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T4[ebp+4] mov DWORD PTR $T4[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$9[ebp] mov DWORD PTR __InitData$9[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$9[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T4[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T4[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T4[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN143@Copy_unche: $LN104@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$7[ebp] mov DWORD PTR __InitData$7[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$7[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 3 or ebx, 8 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN144@Copy_unche: $LN71@Copy_unche: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$6[ebp] mov DWORD PTR __InitData$6[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$6[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 2 or ebx, 4 push eax mov DWORD PTR $T10[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN145@Copy_unche: $LN141@Copy_unche: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$5: mov eax, DWORD PTR $T10[ebp] and eax, 2 je $LN39@Copy_unche and DWORD PTR $T10[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T5[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN39@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$0: mov eax, DWORD PTR $T10[ebp] and eax, 1 je $LN11@Copy_unche and DWORD PTR $T10[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T4[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$19: mov eax, DWORD PTR $T10[ebp] and eax, 8 je $LN107@Copy_unche and DWORD PTR $T10[ebp], -9 ; fffffff7H lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN107@Copy_unche: ret 0 __unwindfunclet$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z$12: mov eax, DWORD PTR $T10[ebp] and eax, 4 je $LN74@Copy_unche and DWORD PTR $T10[ebp], -5 ; fffffffbH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN74@Copy_unche: ret 0 __ehhandler$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-84] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ENDP ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > ; Function compile flags: /Ogtp ; COMDAT ??$_Ptr_copy_cat@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@0@Z _TEXT SEGMENT ___formal$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??$_Ptr_copy_cat@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@0@Z PROC ; std::_Ptr_copy_cat<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 783 xor al, al ; Line 784 ret 0 ??$_Ptr_copy_cat@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AU_General_ptr_iterator_tag@0@ABV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@0@Z ENDP ; std::_Ptr_copy_cat<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_n_unchecked1@PBDHPAE@std@@YAPAEPBDHPAEU_Trivially_copyable_ptr_iterator_tag@0@@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ___formal$ = 20 ; size = 1 ??$_Copy_n_unchecked1@PBDHPAE@std@@YAPAEPBDHPAEU_Trivially_copyable_ptr_iterator_tag@0@@Z PROC ; std::_Copy_n_unchecked1<char const *,int,unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2435 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN2@Copy_n_unc push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2439 pop ebp ret 0 $LN2@Copy_n_unc: ; Line 2438 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2439 pop ebp ret 0 ??$_Copy_n_unchecked1@PBDHPAE@std@@YAPAEPBDHPAEU_Trivially_copyable_ptr_iterator_tag@0@@Z ENDP ; std::_Copy_n_unchecked1<char const *,int,unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Ptr_copy_cat@$$CBDE@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQBDABQAE@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ___formal$ = 16 ; size = 4 ??$_Ptr_copy_cat@$$CBDE@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQBDABQAE@Z PROC ; std::_Ptr_copy_cat<char const ,unsigned char>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 792 push ebp mov ebp, esp ; Line 793 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 794 pop ebp ret 0 ??$_Ptr_copy_cat@$$CBDE@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQBDABQAE@Z ENDP ; std::_Ptr_copy_cat<char const ,unsigned char> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$forward@Unarrowing_error@gsl@@@std@@YA$$QAUnarrowing_error@gsl@@AAU12@@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@Unarrowing_error@gsl@@@std@@YA$$QAUnarrowing_error@gsl@@AAU12@@Z PROC ; std::forward<gsl::narrowing_error>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits ; Line 1275 push ebp mov ebp, esp ; Line 1276 mov eax, DWORD PTR __Arg$[ebp] ; Line 1277 pop ebp ret 0 ??$forward@Unarrowing_error@gsl@@@std@@YA$$QAUnarrowing_error@gsl@@AAU12@@Z ENDP ; std::forward<gsl::narrowing_error> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Rechecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z _TEXT SEGMENT __Dest$ = 8 ; size = 4 __Src$ = 12 ; size = 8 ??$_Rechecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z PROC ; std::_Rechecked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 457 push ebp mov ebp, esp ; Line 458 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR __Src$[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 460 pop ebp ret 0 ??$_Rechecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z ENDP ; std::_Rechecked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z _TEXT SEGMENT $T1 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$_Copy_unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z PROC ; std::_Copy_unchecked<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2332 push ebp mov ebp, esp push ecx ; Line 783 mov BYTE PTR $T1[ebp], 0 ; Line 2334 push DWORD PTR $T1[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > mov eax, DWORD PTR ___$ReturnUdt$[ebp] add esp, 32 ; 00000020H ; Line 2336 mov esp, ebp pop ebp ret 0 ??$_Copy_unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z ENDP ; std::_Copy_unchecked<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 __Src$ = 12 ; size = 8 ??$_Unchecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@Z PROC ; std::_Unchecked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR __Src$[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 429 pop ebp ret 0 ??$_Unchecked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V123@@Z ENDP ; std::_Unchecked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_n_unchecked1@PAHHPAH@std@@YAPAHPAHH0U_Trivially_copyable_ptr_iterator_tag@0@@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ___formal$ = 20 ; size = 1 ??$_Copy_n_unchecked1@PAHHPAH@std@@YAPAHPAHH0U_Trivially_copyable_ptr_iterator_tag@0@@Z PROC ; std::_Copy_n_unchecked1<int *,int,int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2435 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN2@Copy_n_unc push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] ; Line 2437 shl edi, 2 ; Line 2306 push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2439 pop ebp ret 0 $LN2@Copy_n_unc: ; Line 2438 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2439 pop ebp ret 0 ??$_Copy_n_unchecked1@PAHHPAH@std@@YAPAHPAHH0U_Trivially_copyable_ptr_iterator_tag@0@@Z ENDP ; std::_Copy_n_unchecked1<int *,int,int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Ptr_copy_cat@HH@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQAH0@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ___formal$ = 16 ; size = 4 ??$_Ptr_copy_cat@HH@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQAH0@Z PROC ; std::_Ptr_copy_cat<int,int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 792 push ebp mov ebp, esp ; Line 793 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 794 pop ebp ret 0 ??$_Ptr_copy_cat@HH@std@@YA?AU_Really_trivial_ptr_iterator_tag@0@ABQAH0@Z ENDP ; std::_Ptr_copy_cat<int,int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Rechecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z _TEXT SEGMENT __Dest$ = 8 ; size = 4 __Src$ = 12 ; size = 8 ??$_Rechecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z PROC ; std::_Rechecked<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 457 push ebp mov ebp, esp ; Line 458 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR __Src$[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 460 pop ebp ret 0 ??$_Rechecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YAAAV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@AAV123@V123@@Z ENDP ; std::_Rechecked<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z _TEXT SEGMENT $T1 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$_Copy_unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z PROC ; std::_Copy_unchecked<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2332 push ebp mov ebp, esp push ecx ; Line 783 mov BYTE PTR $T1[ebp], 0 ; Line 2334 push DWORD PTR $T1[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > mov eax, DWORD PTR ___$ReturnUdt$[ebp] add esp, 32 ; 00000020H ; Line 2336 mov esp, ebp pop ebp ret 0 ??$_Copy_unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z ENDP ; std::_Copy_unchecked<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 1 ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z PROC ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> >, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 597 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 596 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR $T4[ebp], 0 ; Line 333 mov DWORD PTR [ecx], 6 ; Line 596 mov DWORD PTR [ecx+4], eax ; Line 598 mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 599 test eax, eax jne SHORT $LN5@extent_typ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 599 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 push eax mov DWORD PTR $T4[ebp], 2 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN54@extent_typ: $LN5@extent_typ: ; Line 600 mov eax, ecx mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 8 $LN53@extent_typ: _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z$1: mov eax, DWORD PTR $T4[ebp] and eax, 2 je $LN11@extent_typ and DWORD PTR $T4[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@extent_typ: ret 0 __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ENDP ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Function compile flags: /Ogtp ; COMDAT ??$_Rechecked@PAEPAE@std@@YAAAPAEAAPAEPAE@Z _TEXT SEGMENT __Dest$ = 8 ; size = 4 __Src$ = 12 ; size = 4 ??$_Rechecked@PAEPAE@std@@YAAAPAEAAPAEPAE@Z PROC ; std::_Rechecked<unsigned char *,unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 457 push ebp mov ebp, esp ; Line 458 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx ; Line 460 pop ebp ret 0 ??$_Rechecked@PAEPAE@std@@YAAAPAEAAPAEPAE@Z ENDP ; std::_Rechecked<unsigned char *,unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_n_unchecked@PBDHPAE@std@@YAPAEPBDHPAE@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$_Copy_n_unchecked@PBDHPAE@std@@YAPAEPBDHPAE@Z PROC ; std::_Copy_n_unchecked<char const *,int,unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2446 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN6@Copy_n_unc push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2449 pop ebp ret 0 $LN6@Copy_n_unc: ; Line 2447 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2449 pop ebp ret 0 ??$_Copy_n_unchecked@PBDHPAE@std@@YAPAEPBDHPAE@Z ENDP ; std::_Copy_n_unchecked<char const *,int,unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@PAE@std@@YAPAEPAE@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ??$_Unchecked@PAE@std@@YAPAEPAE@Z PROC ; std::_Unchecked<unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR __Src$[ebp] ; Line 429 pop ebp ret 0 ??$_Unchecked@PAE@std@@YAPAEPAE@Z ENDP ; std::_Unchecked<unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked_n@PAEH@std@@YAPAEPAEH@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??$_Unchecked_n@PAEH@std@@YAPAEPAEH@Z PROC ; std::_Unchecked_n<unsigned char *,int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 679 push ebp mov ebp, esp ; Line 680 mov eax, DWORD PTR __Src$[ebp] ; Line 681 pop ebp ret 0 ??$_Unchecked_n@PAEH@std@@YAPAEPAEH@Z ENDP ; std::_Unchecked_n<unsigned char *,int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@PBD@std@@YAPBDPBD@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ??$_Unchecked@PBD@std@@YAPBDPBD@Z PROC ; std::_Unchecked<char const *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR __Src$[ebp] ; Line 429 pop ebp ret 0 ??$_Unchecked@PBD@std@@YAPBDPBD@Z ENDP ; std::_Unchecked<char const *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked_n@PBDH@std@@YAPBDPBDH@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??$_Unchecked_n@PBDH@std@@YAPBDPBDH@Z PROC ; std::_Unchecked_n<char const *,int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 679 push ebp mov ebp, esp ; Line 680 mov eax, DWORD PTR __Src$[ebp] ; Line 681 pop ebp ret 0 ??$_Unchecked_n@PBDH@std@@YAPBDPBDH@Z ENDP ; std::_Unchecked_n<char const *,int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Is_checked@PAE@std@@YA?AU?$integral_constant@_N$0A@@0@PAE@Z _TEXT SEGMENT ___formal$ = 8 ; size = 4 ??$_Is_checked@PAE@std@@YA?AU?$integral_constant@_N$0A@@0@PAE@Z PROC ; std::_Is_checked<unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 421 xor al, al ; Line 422 ret 0 ??$_Is_checked@PAE@std@@YA?AU?$integral_constant@_N$0A@@0@PAE@Z ENDP ; std::_Is_checked<unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z@SAXU?$integral_constant@_N$0A@@2@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 1 ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z@SAXU?$integral_constant@_N$0A@@2@@Z PROC ; `std::copy_n<char const *,int,unsigned char *>'::`2'::_Unchecked_iterators::_Deprecate, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2458 ret 0 ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z@SAXU?$integral_constant@_N$0A@@2@@Z ENDP ; `std::copy_n<char const *,int,unsigned char *>'::`2'::_Unchecked_iterators::_Deprecate _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$throw_exception@Unarrowing_error@gsl@@@details@gsl@@YAX$$QAUnarrowing_error@1@@Z _TEXT SEGMENT $T1 = -12 ; size = 12 _exception$ = 8 ; size = 4 ??$throw_exception@Unarrowing_error@gsl@@@details@gsl@@YAX$$QAUnarrowing_error@1@@Z PROC ; gsl::details::throw_exception<gsl::narrowing_error>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 143 push ebp mov ebp, esp sub esp, 12 ; 0000000cH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 67 lea eax, DWORD PTR $T1[ebp+4] mov DWORD PTR $T1[ebp], OFFSET ??_7exception@std@@6B@ push eax mov eax, DWORD PTR _exception$[ebp] xorps xmm0, xmm0 add eax, 4 movq QWORD PTR $T1[ebp+4], xmm0 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR $T1[ebp], OFFSET ??_7narrowing_error@gsl@@6B@ ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 144 lea eax, DWORD PTR $T1[ebp] push OFFSET __TI2?AUnarrowing_error@gsl@@ push eax call __CxxThrowException@8 $LN12@throw_exce: $LN11@throw_exce: int 3 ??$throw_exception@Unarrowing_error@gsl@@@details@gsl@@YAX$$QAUnarrowing_error@1@@Z ENDP ; gsl::details::throw_exception<gsl::narrowing_error> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$narrow_cast@HAAH@gsl@@YAHAAH@Z _TEXT SEGMENT _u$ = 8 ; size = 4 ??$narrow_cast@HAAH@gsl@@YAHAAH@Z PROC ; gsl::narrow_cast<int,int &>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_util ; Line 99 push ebp mov ebp, esp ; Line 100 mov eax, DWORD PTR _u$[ebp] mov eax, DWORD PTR [eax] ; Line 101 pop ebp ret 0 ??$narrow_cast@HAAH@gsl@@YAHAAH@Z ENDP ; gsl::narrow_cast<int,int &> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@Urandom_access_iterator_tag@0@2@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ___formal$ = 36 ; size = 1 ___formal$ = 40 ; size = 1 ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@Urandom_access_iterator_tag@0@2@Z PROC ; std::_Copy_no_deprecate1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2351 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2355 mov esp, ebp pop ebp ret 0 ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@Urandom_access_iterator_tag@0@2@Z ENDP ; std::_Copy_no_deprecate1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V123@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 __Src$ = 12 ; size = 8 ??$_Unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V123@@Z PROC ; std::_Unchecked<gsl::details::span_iterator<gsl::span<char const ,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR __Src$[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 429 pop ebp ret 0 ??$_Unchecked@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V123@@Z ENDP ; std::_Unchecked<gsl::details::span_iterator<gsl::span<char const ,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 _seq$ = 12 ; size = 4 _max$ = 16 ; size = 4 ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z PROC ; gsl::ensure_sentinel<char const ,0>, COMDAT ; File c:\projects\gsl\include\gsl\string_span ; Line 113 push ebp mov ebp, esp push -1 push __ehhandler$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 114 mov esi, DWORD PTR _seq$[ebp] mov DWORD PTR $T6[ebp], 0 test esi, esi je $LN5@ensure_sen ; Line 121 mov edx, DWORD PTR _max$[ebp] mov eax, esi test edx, edx jle SHORT $LN3@ensure_sen ; Line 117 xor ecx, ecx $LL2@ensure_sen: ; Line 121 cmp BYTE PTR [eax], 0 je SHORT $LN68@ensure_sen inc ecx inc eax cmp ecx, edx jl SHORT $LL2@ensure_sen $LN3@ensure_sen: ; Line 122 cmp BYTE PTR [eax], 0 jne SHORT $LN9@ensure_sen $LN68@ensure_sen: ; File c:\projects\gsl\include\gsl\span ; Line 386 mov ecx, DWORD PTR ___$ReturnUdt$[ebp] ; File c:\projects\gsl\include\gsl\string_span ; Line 123 sub eax, esi ; File c:\projects\gsl\include\gsl\span ; Line 386 push eax push esi ; File c:\projects\gsl\include\gsl\string_span ; Line 122 mov DWORD PTR __$EHRec$[ebp+8], -1 ; File c:\projects\gsl\include\gsl\span ; Line 386 call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; File c:\projects\gsl\include\gsl\string_span ; Line 123 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 124 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 0 $LN9@ensure_sen: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0EL@HAKHMEAL@GSL?3?5Postcondition?5failure?5at?5C?3@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\string_span ; Line 122 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 2 push eax mov DWORD PTR $T6[ebp], 4 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN71@ensure_sen: $LN5@ensure_sen: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0EL@CELLNNNE@GSL?3?5Postcondition?5failure?5at?5C?3@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\string_span ; Line 114 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T6[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN72@ensure_sen: $LN70@ensure_sen: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z$2: mov eax, DWORD PTR $T6[ebp] and eax, 4 je $LN18@ensure_sen and DWORD PTR $T6[ebp], -5 ; fffffffbH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN18@ensure_sen: ret 0 __unwindfunclet$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z$0: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN12@ensure_sen and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN12@ensure_sen: ret 0 __ehhandler$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z jmp ___CxxFrameHandler3 text$x ENDS ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ENDP ; gsl::ensure_sentinel<char const ,0> ; Function compile flags: /Ogtp ; COMDAT ??$forward@I@std@@YA$$QAIAAI@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@I@std@@YA$$QAIAAI@Z PROC ; std::forward<unsigned int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits ; Line 1275 push ebp mov ebp, esp ; Line 1276 mov eax, DWORD PTR __Arg$[ebp] ; Line 1277 pop ebp ret 0 ??$forward@I@std@@YA$$QAIAAI@Z ENDP ; std::forward<unsigned int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0$09@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$09@12@@Z _TEXT SEGMENT _ext$ = 8 ; size = 1 ??$?0$09@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$09@12@@Z PROC ; gsl::details::extent_type<-1>::extent_type<-1><10>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 333 mov DWORD PTR [ecx], 10 ; 0000000aH ; Line 334 mov eax, ecx ret 4 ??$?0$09@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$09@12@@Z ENDP ; gsl::details::extent_type<-1>::extent_type<-1><10> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Rechecked@PAHPAH@std@@YAAAPAHAAPAHPAH@Z _TEXT SEGMENT __Dest$ = 8 ; size = 4 __Src$ = 12 ; size = 4 ??$_Rechecked@PAHPAH@std@@YAAAPAHAAPAHPAH@Z PROC ; std::_Rechecked<int *,int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 457 push ebp mov ebp, esp ; Line 458 mov eax, DWORD PTR __Dest$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx ; Line 460 pop ebp ret 0 ??$_Rechecked@PAHPAH@std@@YAAAPAHAAPAHPAH@Z ENDP ; std::_Rechecked<int *,int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_n_unchecked@PAHHPAH@std@@YAPAHPAHH0@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$_Copy_n_unchecked@PAHHPAH@std@@YAPAHPAHH0@Z PROC ; std::_Copy_n_unchecked<int *,int,int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2446 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN6@Copy_n_unc push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] ; Line 2437 shl edi, 2 ; Line 2306 push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2449 pop ebp ret 0 $LN6@Copy_n_unc: ; Line 2447 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2449 pop ebp ret 0 ??$_Copy_n_unchecked@PAHHPAH@std@@YAPAHPAHH0@Z ENDP ; std::_Copy_n_unchecked<int *,int,int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@PAH@std@@YAPAHPAH@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ??$_Unchecked@PAH@std@@YAPAHPAH@Z PROC ; std::_Unchecked<int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR __Src$[ebp] ; Line 429 pop ebp ret 0 ??$_Unchecked@PAH@std@@YAPAHPAH@Z ENDP ; std::_Unchecked<int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked_n@PAHH@std@@YAPAHPAHH@Z _TEXT SEGMENT __Src$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??$_Unchecked_n@PAHH@std@@YAPAHPAHH@Z PROC ; std::_Unchecked_n<int *,int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 679 push ebp mov ebp, esp ; Line 680 mov eax, DWORD PTR __Src$[ebp] ; Line 681 pop ebp ret 0 ??$_Unchecked_n@PAHH@std@@YAPAHPAHH@Z ENDP ; std::_Unchecked_n<int *,int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Is_checked@PAH@std@@YA?AU?$integral_constant@_N$0A@@0@PAH@Z _TEXT SEGMENT ___formal$ = 8 ; size = 4 ??$_Is_checked@PAH@std@@YA?AU?$integral_constant@_N$0A@@0@PAH@Z PROC ; std::_Is_checked<int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 421 xor al, al ; Line 422 ret 0 ??$_Is_checked@PAH@std@@YA?AU?$integral_constant@_N$0A@@0@PAH@Z ENDP ; std::_Is_checked<int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z@SAXU?$integral_constant@_N$0A@@2@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 1 ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z@SAXU?$integral_constant@_N$0A@@2@@Z PROC ; `std::copy_n<int *,int,int *>'::`2'::_Unchecked_iterators::_Deprecate, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2458 ret 0 ?_Deprecate@_Unchecked_iterators@?1???$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z@SAXU?$integral_constant@_N$0A@@2@@Z ENDP ; `std::copy_n<int *,int,int *>'::`2'::_Unchecked_iterators::_Deprecate _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00Urandom_access_iterator_tag@0@1@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ___formal$ = 36 ; size = 1 ___formal$ = 40 ; size = 1 ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00Urandom_access_iterator_tag@0@1@Z PROC ; std::_Copy_no_deprecate1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2351 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2355 mov esp, ebp pop ebp ret 0 ??$_Copy_no_deprecate1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00Urandom_access_iterator_tag@0@1@Z ENDP ; std::_Copy_no_deprecate1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 __Src$ = 12 ; size = 8 ??$_Unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@Z PROC ; std::_Unchecked<gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 427 push ebp mov ebp, esp ; Line 428 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov ecx, DWORD PTR __Src$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR __Src$[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 429 pop ebp ret 0 ??$_Unchecked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@Z ENDP ; std::_Unchecked<gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0$0A@@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$0A@@12@@Z _TEXT SEGMENT _ext$ = 8 ; size = 1 ??$?0$0A@@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$0A@@12@@Z PROC ; gsl::details::extent_type<-1>::extent_type<-1><0>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 333 mov DWORD PTR [ecx], 0 ; Line 334 mov eax, ecx ret 4 ??$?0$0A@@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$0A@@12@@Z ENDP ; gsl::details::extent_type<-1>::extent_type<-1><0> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0$05@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$05@12@@Z _TEXT SEGMENT _ext$ = 8 ; size = 1 ??$?0$05@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$05@12@@Z PROC ; gsl::details::extent_type<-1>::extent_type<-1><6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 333 mov DWORD PTR [ecx], 6 ; Line 334 mov eax, ecx ret 4 ??$?0$05@?$extent_type@$0?0@details@gsl@@QAE@V?$extent_type@$05@12@@Z ENDP ; gsl::details::extent_type<-1>::extent_type<-1><6> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 4 ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z PROC ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 597 push ebp mov ebp, esp push -1 push __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov esi, ecx ; Line 596 push DWORD PTR _ext$[ebp] mov DWORD PTR $T6[ebp], 0 call ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ; gsl::details::extent_type<-1>::extent_type<-1> ; Line 338 mov ecx, DWORD PTR [esi] ; Line 596 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [esi+4], eax ; Line 598 test ecx, ecx js SHORT $LN3@extent_typ mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 599 test eax, eax jne SHORT $LN5@extent_typ test ecx, ecx je SHORT $LN5@extent_typ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 599 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 push eax mov DWORD PTR $T6[ebp], 2 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN49@extent_typ: $LN5@extent_typ: ; Line 600 mov eax, esi mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 8 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 598 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T6[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN50@extent_typ: $LN48@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z$1: mov eax, DWORD PTR $T6[ebp] and eax, 2 je $LN11@extent_typ and DWORD PTR $T6[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@extent_typ: ret 0 __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z$0: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN8@extent_typ and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN8@extent_typ: ret 0 __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z ENDP ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Function compile flags: /Ogtp ; COMDAT ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 4 ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z PROC ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 597 push ebp mov ebp, esp push -1 push __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov esi, ecx ; Line 596 push DWORD PTR _ext$[ebp] mov DWORD PTR $T6[ebp], 0 call ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ; gsl::details::extent_type<-1>::extent_type<-1> ; Line 338 mov ecx, DWORD PTR [esi] ; Line 596 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [esi+4], eax ; Line 598 test ecx, ecx js SHORT $LN3@extent_typ mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 599 test eax, eax jne SHORT $LN5@extent_typ test ecx, ecx je SHORT $LN5@extent_typ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 599 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 push eax mov DWORD PTR $T6[ebp], 2 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN49@extent_typ: $LN5@extent_typ: ; Line 600 mov eax, esi mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 8 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 598 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T6[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN50@extent_typ: $LN48@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z$1: mov eax, DWORD PTR $T6[ebp] and eax, 2 je $LN11@extent_typ and DWORD PTR $T6[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@extent_typ: ret 0 __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z$0: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN8@extent_typ and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN8@extent_typ: ret 0 __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ENDP ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Function compile flags: /Ogtp ; COMDAT ??$forward@AAH@std@@YAAAHAAH@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@AAH@std@@YAAAHAAH@Z PROC ; std::forward<int &>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits ; Line 1275 push ebp mov ebp, esp ; Line 1276 mov eax, DWORD PTR __Arg$[ebp] ; Line 1277 pop ebp ret 0 ??$forward@AAH@std@@YAAAHAAH@Z ENDP ; std::forward<int &> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0H$05X@?$span@H$0?0@gsl@@QAE@ABV?$span@H$05@1@@Z _TEXT SEGMENT _other$ = 8 ; size = 4 $T1 = 11 ; size = 1 ??$?0H$05X@?$span@H$0?0@gsl@@QAE@ABV?$span@H$05@1@@Z PROC ; gsl::span<int,-1>::span<int,-1><int,6,void>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 448 push ebp mov ebp, esp ; Line 515 mov eax, DWORD PTR _other$[ebp] push esi push edi ; Line 448 mov edi, ecx lea ecx, DWORD PTR $T1[ebp] ; Line 515 mov esi, DWORD PTR [eax] ; Line 447 push 6 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> mov ecx, edi movzx eax, BYTE PTR [eax] push eax push esi call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 448 mov eax, edi pop edi pop esi pop ebp ret 4 ??$?0H$05X@?$span@H$0?0@gsl@@QAE@ABV?$span@H$05@1@@Z ENDP ; gsl::span<int,-1>::span<int,-1><int,6,void> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z PROC ; std::copy_n<char const *,int,unsigned char *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2456 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN20@copy_n push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2461 pop ebp ret 0 $LN20@copy_n: ; Line 2459 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2461 pop ebp ret 0 ??$copy_n@PBDHPAE@std@@YAPAEPBDHPAE@Z ENDP ; std::copy_n<char const *,int,unsigned char *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$narrow@HH@gsl@@YAHH@Z _TEXT SEGMENT __$EHRec$ = -12 ; size = 12 _u$ = 8 ; size = 4 ??$narrow@HH@gsl@@YAHH@Z PROC ; gsl::narrow<int,int>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_util ; Line 124 push ebp mov ebp, esp push -1 push __ehhandler$??$narrow@HH@gsl@@YAHH@Z mov eax, DWORD PTR fs:0 push eax mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 129 mov eax, DWORD PTR _u$[ebp] ; Line 130 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$narrow@HH@gsl@@YAHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$narrow@HH@gsl@@YAHH@Z jmp ___CxxFrameHandler3 text$x ENDS ??$narrow@HH@gsl@@YAHH@Z ENDP ; gsl::narrow<int,int> ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_no_deprecate@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$_Copy_no_deprecate@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z PROC ; std::_Copy_no_deprecate<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2361 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2365 mov esp, ebp pop ebp ret 0 ??$_Copy_no_deprecate@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z ENDP ; std::_Copy_no_deprecate<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Is_checked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 8 ??$_Is_checked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@Z PROC ; std::_Is_checked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 421 xor al, al ; Line 422 ret 0 ??$_Is_checked@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@@Z ENDP ; std::_Is_checked<gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@45@0V345@@Z@SAXU?$integral_constant@_N$00@2@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 1 ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@45@0V345@@Z@SAXU?$integral_constant@_N$00@2@@Z PROC ; `std::copy<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >'::`2'::_Unchecked_iterators::_Deprecate, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2372 ret 0 ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@45@0V345@@Z@SAXU?$integral_constant@_N$00@2@@Z ENDP ; `std::copy<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >'::`2'::_Unchecked_iterators::_Deprecate _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$ensure_z@$$CBD@gsl@@YA?AV?$span@$$CBD$0?0@0@ABQBDH@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 _sz$ = 12 ; size = 4 _max$ = 16 ; size = 4 ??$ensure_z@$$CBD@gsl@@YA?AV?$span@$$CBD$0?0@0@ABQBDH@Z PROC ; gsl::ensure_z<char const >, COMDAT ; File c:\projects\gsl\include\gsl\string_span ; Line 133 push ebp mov ebp, esp ; Line 134 mov eax, DWORD PTR _sz$[ebp] push DWORD PTR _max$[ebp] push DWORD PTR [eax] push DWORD PTR ___$ReturnUdt$[ebp] call ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ; gsl::ensure_sentinel<char const ,0> mov eax, DWORD PTR ___$ReturnUdt$[ebp] add esp, 12 ; 0000000cH ; Line 135 pop ebp ret 0 ??$ensure_z@$$CBD@gsl@@YA?AV?$span@$$CBD$0?0@0@ABQBDH@Z ENDP ; gsl::ensure_z<char const > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$narrow_cast@HI@gsl@@YAH$$QAI@Z _TEXT SEGMENT _u$ = 8 ; size = 4 ??$narrow_cast@HI@gsl@@YAH$$QAI@Z PROC ; gsl::narrow_cast<int,unsigned int>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_util ; Line 99 push ebp mov ebp, esp ; Line 100 mov eax, DWORD PTR _u$[ebp] mov eax, DWORD PTR [eax] ; Line 101 pop ebp ret 0 ??$narrow_cast@HI@gsl@@YAH$$QAI@Z ENDP ; gsl::narrow_cast<int,unsigned int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 1 ??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z PROC ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<10> >, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 591 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T2[ebp], 0 ; Line 590 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [ecx+4], eax ; Line 593 mov eax, ecx ; Line 333 mov DWORD PTR [ecx], 10 ; 0000000aH ; Line 593 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 8 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$extent_type@$09@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$09@details@2@@Z ENDP ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<10> > ; Function compile flags: /Ogtp ; COMDAT ?size@?$extent_type@$09@details@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$extent_type@$09@details@gsl@@QBEHXZ PROC ; gsl::details::extent_type<10>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 323 mov eax, 10 ; 0000000aH ret 0 ?size@?$extent_type@$09@details@gsl@@QBEHXZ ENDP ; gsl::details::extent_type<10>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$extent_type@$09@details@gsl@@QAE@XZ _TEXT SEGMENT ??0?$extent_type@$09@details@gsl@@QAE@XZ PROC ; gsl::details::extent_type<10>::extent_type<10>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 311 mov eax, ecx ret 0 ??0?$extent_type@$09@details@gsl@@QAE@XZ ENDP ; gsl::details::extent_type<10>::extent_type<10> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z _TEXT SEGMENT __First$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Dest$ = 16 ; size = 4 ??$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z PROC ; std::copy_n<int *,int,int *>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2456 push ebp mov ebp, esp push edi ; Line 2436 mov edi, DWORD PTR __Count$[ebp] test edi, edi jle SHORT $LN20@copy_n push esi ; Line 2306 mov esi, DWORD PTR __Dest$[ebp] ; Line 2437 shl edi, 2 ; Line 2306 push edi push DWORD PTR __First$[ebp] push esi call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH ; Line 2307 lea eax, DWORD PTR [edi+esi] pop esi pop edi ; Line 2461 pop ebp ret 0 $LN20@copy_n: ; Line 2459 mov eax, DWORD PTR __Dest$[ebp] pop edi ; Line 2461 pop ebp ret 0 ??$copy_n@PAHHPAH@std@@YAPAHPAHH0@Z ENDP ; std::copy_n<int *,int,int *> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Copy_no_deprecate@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$_Copy_no_deprecate@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z PROC ; std::_Copy_no_deprecate<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2361 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2365 mov esp, ebp pop ebp ret 0 ??$_Copy_no_deprecate@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z ENDP ; std::_Copy_no_deprecate<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$_Is_checked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 8 ??$_Is_checked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@Z PROC ; std::_Is_checked<gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 421 xor al, al ; Line 422 ret 0 ??$_Is_checked@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@std@@YA?AU?$integral_constant@_N$00@0@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@@Z ENDP ; std::_Is_checked<gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V345@00@Z@SAXU?$integral_constant@_N$00@2@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 1 ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V345@00@Z@SAXU?$integral_constant@_N$00@2@@Z PROC ; `std::copy<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >'::`2'::_Unchecked_iterators::_Deprecate, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2372 ret 0 ?_Deprecate@_Unchecked_iterators@?1???$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V345@00@Z@SAXU?$integral_constant@_N$00@2@@Z ENDP ; `std::copy<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >'::`2'::_Unchecked_iterators::_Deprecate _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 1 ??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z PROC ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<0> >, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 597 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 596 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR $T2[ebp], 0 mov DWORD PTR [ecx+4], eax ; Line 600 mov eax, ecx ; Line 333 mov DWORD PTR [ecx], 0 ; Line 600 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 8 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$extent_type@$0A@@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$0A@@details@2@@Z ENDP ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<0> > ; Function compile flags: /Ogtp ; COMDAT ?size@?$extent_type@$0A@@details@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$extent_type@$0A@@details@gsl@@QBEHXZ PROC ; gsl::details::extent_type<0>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 323 xor eax, eax ret 0 ?size@?$extent_type@$0A@@details@gsl@@QBEHXZ ENDP ; gsl::details::extent_type<0>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$extent_type@$0A@@details@gsl@@QAE@XZ _TEXT SEGMENT ??0?$extent_type@$0A@@details@gsl@@QAE@XZ PROC ; gsl::details::extent_type<0>::extent_type<0>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 311 mov eax, ecx ret 0 ??0?$extent_type@$0A@@details@gsl@@QAE@XZ ENDP ; gsl::details::extent_type<0>::extent_type<0> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 1 ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z PROC ; gsl::span<int,6>::storage_type<gsl::details::extent_type<6> >::storage_type<gsl::details::extent_type<6> ><gsl::details::extent_type<6> >, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 591 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T2[ebp], 0 ; Line 590 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [ecx], eax ; Line 593 mov eax, ecx mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 8 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z ENDP ; gsl::span<int,6>::storage_type<gsl::details::extent_type<6> >::storage_type<gsl::details::extent_type<6> ><gsl::details::extent_type<6> > ; Function compile flags: /Ogtp ; COMDAT ??$addressof@H@std@@YAPAHAAH@Z _TEXT SEGMENT __Val$ = 8 ; size = 4 ??$addressof@H@std@@YAPAHAAH@Z PROC ; std::addressof<int>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef ; Line 724 push ebp mov ebp, esp ; Line 725 mov eax, DWORD PTR __Val$[ebp] ; Line 726 pop ebp ret 0 ??$addressof@H@std@@YAPAHAAH@Z ENDP ; std::addressof<int> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 1 ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z PROC ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> >, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 591 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T2[ebp], 0 ; Line 590 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [ecx+4], eax ; Line 593 mov eax, ecx ; Line 333 mov DWORD PTR [ecx], 6 ; Line 593 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 8 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@UKnownNotNull@12@V?$extent_type@$05@details@2@@Z ENDP ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Function compile flags: /Ogtp ; COMDAT ??$addressof@E@std@@YAPAEAAE@Z _TEXT SEGMENT __Val$ = 8 ; size = 4 ??$addressof@E@std@@YAPAEAAE@Z PROC ; std::addressof<unsigned char>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef ; Line 724 push ebp mov ebp, esp ; Line 725 mov eax, DWORD PTR __Val$[ebp] ; Line 726 pop ebp ret 0 ??$addressof@E@std@@YAPAEAAE@Z ENDP ; std::addressof<unsigned char> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$forward@Ufail_fast@gsl@@@std@@YA$$QAUfail_fast@gsl@@AAU12@@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@Ufail_fast@gsl@@@std@@YA$$QAUfail_fast@gsl@@AAU12@@Z PROC ; std::forward<gsl::fail_fast>, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits ; Line 1275 push ebp mov ebp, esp ; Line 1276 mov eax, DWORD PTR __Arg$[ebp] ; Line 1277 pop ebp ret 0 ??$forward@Ufail_fast@gsl@@@std@@YA$$QAUfail_fast@gsl@@AAU12@@Z ENDP ; std::forward<gsl::fail_fast> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$narrow_cast@IAAH@gsl@@YAIAAH@Z _TEXT SEGMENT _u$ = 8 ; size = 4 ??$narrow_cast@IAAH@gsl@@YAIAAH@Z PROC ; gsl::narrow_cast<unsigned int,int &>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_util ; Line 99 push ebp mov ebp, esp ; Line 100 mov eax, DWORD PTR _u$[ebp] mov eax, DWORD PTR [eax] ; Line 101 pop ebp ret 0 ??$narrow_cast@IAAH@gsl@@YAIAAH@Z ENDP ; gsl::narrow_cast<unsigned int,int &> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 4 ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z PROC ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 591 push ebp mov ebp, esp push -1 push __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov esi, ecx ; Line 590 push DWORD PTR _ext$[ebp] mov DWORD PTR $T4[ebp], 0 call ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ; gsl::details::extent_type<-1>::extent_type<-1> ; Line 592 cmp DWORD PTR [esi], 0 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [esi+4], eax jl SHORT $LN3@extent_typ ; Line 593 mov eax, esi mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 8 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@ELDMELAD@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 592 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN27@extent_typ: $LN26@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@extent_typ and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@extent_typ: ret 0 __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z ENDP ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Function compile flags: /Ogtp ; COMDAT ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _data$ = 8 ; size = 4 _ext$ = 12 ; size = 4 ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z PROC ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 597 push ebp mov ebp, esp push -1 push __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov esi, ecx ; Line 596 push DWORD PTR _ext$[ebp] mov DWORD PTR $T6[ebp], 0 call ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ; gsl::details::extent_type<-1>::extent_type<-1> ; Line 338 mov ecx, DWORD PTR [esi] ; Line 596 mov eax, DWORD PTR _data$[ebp] mov DWORD PTR [esi+4], eax ; Line 598 test ecx, ecx js SHORT $LN3@extent_typ mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 599 test eax, eax jne SHORT $LN5@extent_typ test ecx, ecx je SHORT $LN5@extent_typ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@KIMIJCMI@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 599 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 push eax mov DWORD PTR $T6[ebp], 2 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN49@extent_typ: $LN5@extent_typ: ; Line 600 mov eax, esi mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 8 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0ED@LBNDKDIJ@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 598 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T6[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN50@extent_typ: $LN48@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z$1: mov eax, DWORD PTR $T6[ebp] and eax, 2 je $LN11@extent_typ and DWORD PTR $T6[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@extent_typ: ret 0 __unwindfunclet$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z$0: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN8@extent_typ and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN8@extent_typ: ret 0 __ehhandler$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ENDP ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Function compile flags: /Ogtp ; COMDAT ??$make_subspan@$05@?$span@H$05@gsl@@ABE?AV?$span@H$0?0@1@HHV?$subspan_selector@$05@01@@Z _TEXT SEGMENT _tmp$ = -16 ; size = 8 $T1 = -5 ; size = 1 $T2 = -1 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 _offset$ = 12 ; size = 4 _count$ = 16 ; size = 4 ___formal$ = 20 ; size = 1 ??$make_subspan@$05@?$span@H$05@gsl@@ABE?AV?$span@H$0?0@1@HHV?$subspan_selector@$05@01@@Z PROC ; gsl::span<int,6>::make_subspan<6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 622 push ebp mov ebp, esp sub esp, 16 ; 00000010H push esi ; Line 515 mov esi, DWORD PTR [ecx] ; Line 447 lea ecx, DWORD PTR $T2[ebp] push 6 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$[ebp] movzx eax, BYTE PTR [eax] push eax push esi call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov esi, DWORD PTR ___$ReturnUdt$[ebp] lea ecx, DWORD PTR _tmp$[ebp] mov BYTE PTR $T1[ebp], 0 push DWORD PTR $T1[ebp] push DWORD PTR _count$[ebp] push DWORD PTR _offset$[ebp] push esi call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; Line 624 mov eax, esi pop esi ; Line 625 mov esp, ebp pop ebp ret 16 ; 00000010H ??$make_subspan@$05@?$span@H$05@gsl@@ABE?AV?$span@H$0?0@1@HHV?$subspan_selector@$05@01@@Z ENDP ; gsl::span<int,6>::make_subspan<6> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _src$ = 8 ; size = 8 _dest$ = 16 ; size = 8 ??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z PROC ; gsl::copy<char const ,-1,unsigned char,-1>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 43 push ebp mov ebp, esp push -1 push __ehhandler$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 50 mov eax, DWORD PTR _src$[ebp] cmp DWORD PTR _dest$[ebp], eax jl SHORT $LN3@copy ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2436 test eax, eax jle SHORT $LN2@copy ; Line 2306 push eax push DWORD PTR _src$[ebp+4] push DWORD PTR _dest$[ebp+4] call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH $LN2@copy: ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 53 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@copy: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0EL@GNMGMEGC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 50 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN79@copy: $LN78@copy: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@copy and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@copy: ret 0 __ehhandler$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z ENDP ; gsl::copy<char const ,-1,unsigned char,-1> ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z _TEXT SEGMENT __$EHRec$ = -12 ; size = 12 _cont$ = 8 ; size = 4 ??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z PROC ; gsl::span<char const ,-1>::span<char const ,-1><gsl::basic_string_span<char const ,-1>,void>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 428 push ebp mov ebp, esp push -1 push __ehhandler$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z mov eax, DWORD PTR fs:0 push eax push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov esi, ecx ; Line 427 mov eax, DWORD PTR _cont$[ebp] ; Line 386 push DWORD PTR [eax] push DWORD PTR [eax+4] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 428 mov eax, esi mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 4 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0V?$basic_string_span@$$CBD$0?0@gsl@@X@?$span@$$CBD$0?0@gsl@@QAE@AAV?$basic_string_span@$$CBD$0?0@1@@Z ENDP ; gsl::span<char const ,-1>::span<char const ,-1><gsl::basic_string_span<char const ,-1>,void> ; Function compile flags: /Ogtp ; COMDAT ?test_string_gsl_copy@@YAXXZ _TEXT SEGMENT $T2 = -36 ; size = 8 $T3 = -36 ; size = 8 $T4 = -32 ; size = 4 _bytes$ = -28 ; size = 10 __$ArrayPad$ = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ?test_string_gsl_copy@@YAXXZ PROC ; test_string_gsl_copy, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 333 push ebp mov ebp, esp push -1 push __ehhandler$?test_string_gsl_copy@@YAXXZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax push esi push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; File c:\projects\gsl\include\gsl\string_span ; Line 134 push 11 ; 0000000bH lea eax, DWORD PTR $T3[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 395 mov DWORD PTR __$EHRec$[ebp+8], -1 ; File c:\projects\gsl\include\gsl\string_span ; Line 134 push OFFSET ??_C@_0L@CCAJJBND@iVtrau?5lDC?$AA@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 590 lea esi, DWORD PTR _bytes$[ebp] ; File c:\projects\gsl\include\gsl\string_span ; Line 134 call ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ; gsl::ensure_sentinel<char const ,0> add esp, 12 ; 0000000cH ; File c:\projects\gsl\include\gsl\span ; Line 386 lea ecx, DWORD PTR $T2[ebp] push DWORD PTR $T3[ebp] push DWORD PTR $T3[ebp+4] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 338 push esi push 10 ; 0000000aH push DWORD PTR $T2[ebp+4] push DWORD PTR $T2[ebp] call ??$copy@$$CBD$0?0E$0?0@gsl@@YAXV?$span@$$CBD$0?0@0@V?$span@E$0?0@0@@Z ; gsl::copy<char const ,-1,unsigned char,-1> ; Line 340 push esi push 10 ; 0000000aH call ?bar@@YAXV?$span@E$0?0@gsl@@@Z ; bar add esp, 24 ; 00000018H ; Line 341 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_string_gsl_copy@@YAXXZ$0: call ___std_terminate ret 0 __ehhandler$?test_string_gsl_copy@@YAXXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-32] xor ecx, eax call @__security_check_cookie@4 mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_string_gsl_copy@@YAXXZ jmp ___CxxFrameHandler3 text$x ENDS ?test_string_gsl_copy@@YAXXZ ENDP ; test_string_gsl_copy ; Function compile flags: /Ogtp ; COMDAT ??$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z PROC ; std::copy<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2371 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2374 mov esp, ebp pop ebp ret 0 ??$copy@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@@Z ENDP ; std::copy<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ PROC ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::operator++, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 168 push ebp mov ebp, esp push -1 push __ehhandler$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 169 mov edx, DWORD PTR [ecx+4] test edx, edx js SHORT $LN3@operator mov eax, DWORD PTR [ecx] cmp edx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 170 lea eax, DWORD PTR [edx+1] mov DWORD PTR [ecx+4], eax ; Line 171 mov eax, ecx ; Line 172 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN30@operator: $LN29@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ jmp ___CxxFrameHandler3 text$x ENDS ??E?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ ENDP ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::operator++ ; Function compile flags: /Ogtp ; COMDAT ??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ PROC ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::operator*, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 156 push ebp mov ebp, esp push -1 push __ehhandler$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 157 mov eax, DWORD PTR [ecx] mov ecx, DWORD PTR [ecx+4] cmp ecx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 158 mov eax, DWORD PTR [eax+4] add eax, ecx ; Line 159 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN36@operator: $LN35@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ jmp ___CxxFrameHandler3 text$x ENDS ??D?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QBEAAEXZ ENDP ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::operator* ; Function compile flags: /Ogtp ; COMDAT ??0?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@E$0?0@2@H@Z _TEXT SEGMENT _span$ = 8 ; size = 4 _idx$ = 12 ; size = 4 ??0?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@E$0?0@2@H@Z PROC ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::span_iterator<gsl::span<unsigned char,-1>,0>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 146 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR _span$[ebp] mov DWORD PTR [ecx], eax mov eax, DWORD PTR _idx$[ebp] mov DWORD PTR [ecx+4], eax ; Line 146 mov eax, ecx pop ebp ret 8 ??0?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@E$0?0@2@H@Z ENDP ; gsl::details::span_iterator<gsl::span<unsigned char,-1>,0>::span_iterator<gsl::span<unsigned char,-1>,0> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??9details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z _TEXT SEGMENT _lhs$ = 8 ; size = 8 _rhs$ = 16 ; size = 8 ??9details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z PROC ; gsl::details::operator!=, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 235 push ebp mov ebp, esp ; Line 231 mov eax, DWORD PTR _lhs$[ebp] cmp eax, DWORD PTR _rhs$[ebp] jne SHORT $LN5@operator mov eax, DWORD PTR _lhs$[ebp+4] cmp eax, DWORD PTR _rhs$[ebp+4] jne SHORT $LN5@operator ; Line 236 xor al, al ; Line 237 pop ebp ret 0 $LN5@operator: ; Line 236 mov al, 1 ; Line 237 pop ebp ret 0 ??9details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z ENDP ; gsl::details::operator!= _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??8details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z _TEXT SEGMENT _lhs$ = 8 ; size = 8 _rhs$ = 16 ; size = 8 ??8details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z PROC ; gsl::details::operator==, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 230 push ebp mov ebp, esp ; Line 231 mov eax, DWORD PTR _lhs$[ebp] cmp eax, DWORD PTR _rhs$[ebp] jne SHORT $LN3@operator mov eax, DWORD PTR _lhs$[ebp+4] cmp eax, DWORD PTR _rhs$[ebp+4] jne SHORT $LN3@operator mov al, 1 ; Line 232 pop ebp ret 0 $LN3@operator: ; Line 231 xor al, al ; Line 232 pop ebp ret 0 ??8details@gsl@@YA_NV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@01@0@Z ENDP ; gsl::details::operator== _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ PROC ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::operator++, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 168 push ebp mov ebp, esp push -1 push __ehhandler$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 169 mov edx, DWORD PTR [ecx+4] test edx, edx js SHORT $LN3@operator mov eax, DWORD PTR [ecx] cmp edx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 170 lea eax, DWORD PTR [edx+1] mov DWORD PTR [ecx+4], eax ; Line 171 mov eax, ecx ; Line 172 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN30@operator: $LN29@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ jmp ___CxxFrameHandler3 text$x ENDS ??E?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ ENDP ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::operator++ ; Function compile flags: /Ogtp ; COMDAT ??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ PROC ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::operator*, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 156 push ebp mov ebp, esp push -1 push __ehhandler$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 157 mov eax, DWORD PTR [ecx] mov ecx, DWORD PTR [ecx+4] cmp ecx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 158 mov eax, DWORD PTR [eax+4] add eax, ecx ; Line 159 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN36@operator: $LN35@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ jmp ___CxxFrameHandler3 text$x ENDS ??D?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QBEABDXZ ENDP ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::operator* ; Function compile flags: /Ogtp ; COMDAT ??0?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@$$CBD$0?0@2@H@Z _TEXT SEGMENT _span$ = 8 ; size = 4 _idx$ = 12 ; size = 4 ??0?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@$$CBD$0?0@2@H@Z PROC ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::span_iterator<gsl::span<char const ,-1>,0>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 146 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR _span$[ebp] mov DWORD PTR [ecx], eax mov eax, DWORD PTR _idx$[ebp] mov DWORD PTR [ecx+4], eax ; Line 146 mov eax, ecx pop ebp ret 8 ??0?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@$$CBD$0?0@2@H@Z ENDP ; gsl::details::span_iterator<gsl::span<char const ,-1>,0>::span_iterator<gsl::span<char const ,-1>,0> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0V?$span@$$CBD$0?0@gsl@@X@?$basic_string_span@$$CBD$0?0@gsl@@QAE@ABV?$span@$$CBD$0?0@1@@Z _TEXT SEGMENT _cont$ = 8 ; size = 4 ??$?0V?$span@$$CBD$0?0@gsl@@X@?$basic_string_span@$$CBD$0?0@gsl@@QAE@ABV?$span@$$CBD$0?0@1@@Z PROC ; gsl::basic_string_span<char const ,-1>::basic_string_span<char const ,-1><gsl::span<char const ,-1>,void>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 244 push ebp mov ebp, esp ; Line 243 mov edx, DWORD PTR _cont$[ebp] mov eax, DWORD PTR [edx] mov DWORD PTR [ecx], eax mov eax, DWORD PTR [edx+4] mov DWORD PTR [ecx+4], eax ; Line 244 mov eax, ecx pop ebp ret 4 ??$?0V?$span@$$CBD$0?0@gsl@@X@?$basic_string_span@$$CBD$0?0@gsl@@QAE@ABV?$span@$$CBD$0?0@1@@Z ENDP ; gsl::basic_string_span<char const ,-1>::basic_string_span<char const ,-1><gsl::span<char const ,-1>,void> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$ensure_z@$$CBD$0L@@gsl@@YA?AV?$span@$$CBD$0?0@0@AAY0L@$$CBD@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 _sz$ = 12 ; size = 4 ??$ensure_z@$$CBD$0L@@gsl@@YA?AV?$span@$$CBD$0?0@0@AAY0L@$$CBD@Z PROC ; gsl::ensure_z<char const ,11>, COMDAT ; File c:\projects\gsl\include\gsl\string_span ; Line 139 push ebp mov ebp, esp ; Line 134 push 11 ; 0000000bH push DWORD PTR _sz$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ; gsl::ensure_sentinel<char const ,0> ; Line 140 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 134 add esp, 12 ; 0000000cH ; Line 141 pop ebp ret 0 ??$ensure_z@$$CBD$0L@@gsl@@YA?AV?$span@$$CBD$0?0@0@AAY0L@$$CBD@Z ENDP ; gsl::ensure_z<char const ,11> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?end@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?end@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::basic_string_span<char const ,-1>::end, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 301 push ebp mov ebp, esp ; File c:\projects\gsl\include\gsl\span ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR [ecx] mov DWORD PTR [eax+4], ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 301 pop ebp ret 4 ?end@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::basic_string_span<char const ,-1>::end _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?begin@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?begin@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::basic_string_span<char const ,-1>::begin, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 300 push ebp mov ebp, esp ; File c:\projects\gsl\include\gsl\span ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\include\gsl\string_span ; Line 300 pop ebp ret 4 ?begin@?$basic_string_span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::basic_string_span<char const ,-1>::begin _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$basic_string_span@$$CBD$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$basic_string_span@$$CBD$0?0@gsl@@QBEHXZ PROC ; gsl::basic_string_span<char const ,-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 295 mov eax, DWORD PTR [ecx] ret 0 ?size@?$basic_string_span@$$CBD$0?0@gsl@@QBEHXZ ENDP ; gsl::basic_string_span<char const ,-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$basic_string_span@$$CBD$0?0@gsl@@QBEPBDXZ _TEXT SEGMENT ?data@?$basic_string_span@$$CBD$0?0@gsl@@QBEPBDXZ PROC ; gsl::basic_string_span<char const ,-1>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\string_span ; Line 292 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$basic_string_span@$$CBD$0?0@gsl@@QBEPBDXZ ENDP ; gsl::basic_string_span<char const ,-1>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QBEPBDXZ _TEXT SEGMENT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QBEPBDXZ PROC ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 602 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QBEPBDXZ ENDP ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?end@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?end@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::span<char const ,-1>::end, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 519 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR [ecx] mov DWORD PTR [eax+4], ecx ; Line 519 pop ebp ret 4 ?end@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::span<char const ,-1>::end _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?begin@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?begin@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::span<char const ,-1>::begin, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 518 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], 0 ; Line 518 pop ebp ret 4 ?begin@?$span@$$CBD$0?0@gsl@@QBE?AV?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::span<char const ,-1>::begin _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$span@$$CBD$0?0@gsl@@QBEPBDXZ _TEXT SEGMENT ?data@?$span@$$CBD$0?0@gsl@@QBEPBDXZ PROC ; gsl::span<char const ,-1>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$span@$$CBD$0?0@gsl@@QBEPBDXZ ENDP ; gsl::span<char const ,-1>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$span@$$CBD$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$span@$$CBD$0?0@gsl@@QBEHXZ PROC ; gsl::span<char const ,-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 498 mov eax, DWORD PTR [ecx] ret 0 ?size@?$span@$$CBD$0?0@gsl@@QBEHXZ ENDP ; gsl::span<char const ,-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z _TEXT SEGMENT _ptr$ = 8 ; size = 4 _count$ = 12 ; size = 4 ??0?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z PROC ; gsl::span<char const ,-1>::span<char const ,-1>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 386 push ebp mov ebp, esp push esi push DWORD PTR _count$[ebp] mov esi, ecx push DWORD PTR _ptr$[ebp] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ; gsl::span<char const ,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> mov eax, esi pop esi pop ebp ret 8 ??0?$span@$$CBD$0?0@gsl@@QAE@PBDH@Z ENDP ; gsl::span<char const ,-1>::span<char const ,-1> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _arr$ = 8 ; size = 4 ??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z PROC ; gsl::span<unsigned char,-1>::span<unsigned char,-1><10>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 395 push ebp mov ebp, esp push -1 push __ehhandler$??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 590 mov eax, DWORD PTR _arr$[ebp] mov DWORD PTR [ecx+4], eax ; Line 395 mov eax, ecx mov DWORD PTR $T2[ebp], 0 ; Line 333 mov DWORD PTR [ecx], 10 ; 0000000aH ; Line 395 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0$09@?$span@E$0?0@gsl@@QAE@AAY09E@Z ENDP ; gsl::span<unsigned char,-1>::span<unsigned char,-1><10> ; Function compile flags: /Ogtp ; COMDAT ?test_string_std_copy@@YAXXZ _TEXT SEGMENT _cdModelType$ = -52 ; size = 8 _byteSpan$ = -44 ; size = 8 $T2 = -36 ; size = 8 $T3 = -36 ; size = 8 $T4 = -32 ; size = 1 $T5 = -32 ; size = 4 _bytes$ = -28 ; size = 10 __$ArrayPad$ = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ?test_string_std_copy@@YAXXZ PROC ; test_string_std_copy, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 322 push ebp mov ebp, esp push -1 push __ehhandler$?test_string_std_copy@@YAXXZ mov eax, DWORD PTR fs:0 push eax sub esp, 40 ; 00000028H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax push esi push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T5[ebp], 0 ; File c:\projects\gsl\include\gsl\span ; Line 590 lea eax, DWORD PTR _bytes$[ebp] mov DWORD PTR _byteSpan$[ebp], 10 ; 0000000aH ; File c:\projects\gsl\include\gsl\string_span ; Line 134 push 11 ; 0000000bH ; File c:\projects\gsl\include\gsl\span ; Line 590 mov DWORD PTR _byteSpan$[ebp+4], eax ; File c:\projects\gsl\include\gsl\string_span ; Line 134 lea eax, DWORD PTR $T3[ebp] push OFFSET ??_C@_0L@CCAJJBND@iVtrau?5lDC?$AA@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 395 mov DWORD PTR __$EHRec$[ebp+8], -1 ; File c:\projects\gsl\include\gsl\string_span ; Line 134 call ??$ensure_sentinel@$$CBD$0A@@gsl@@YA?AV?$span@$$CBD$0?0@0@PBDH@Z ; gsl::ensure_sentinel<char const ,0> ; Line 243 mov eax, DWORD PTR $T3[ebp+4] ; File c:\projects\gsl\include\gsl\span ; Line 145 lea edx, DWORD PTR _cdModelType$[ebp] ; File c:\projects\gsl\include\gsl\string_span ; Line 243 mov ecx, DWORD PTR $T3[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 145 mov esi, edx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 783 mov BYTE PTR $T4[ebp], 0 ; Line 2334 push DWORD PTR $T4[ebp] ; File c:\projects\gsl\include\gsl\string_span ; Line 243 mov DWORD PTR _cdModelType$[ebp+4], eax ; File c:\projects\gsl\include\gsl\span ; Line 145 lea eax, DWORD PTR _byteSpan$[ebp] ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2334 push 0 push eax push ecx push edx push 0 lea eax, DWORD PTR $T2[ebp] ; File c:\projects\gsl\include\gsl\string_span ; Line 243 mov DWORD PTR _cdModelType$[ebp], ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2334 push esi push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@E$0?0@gsl@@$0A@@23@@std@@YA?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@gsl@@V?$span_iterator@V?$span@$$CBD$0?0@gsl@@$0A@@23@0V123@U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<char const ,-1>,0>,gsl::details::span_iterator<gsl::span<unsigned char,-1>,0> > ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 329 push DWORD PTR _byteSpan$[ebp+4] push DWORD PTR _byteSpan$[ebp] call ?bar@@YAXV?$span@E$0?0@gsl@@@Z ; bar add esp, 52 ; 00000034H ; Line 330 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_string_std_copy@@YAXXZ$0: call ___std_terminate ret 0 __ehhandler$?test_string_std_copy@@YAXXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-48] xor ecx, eax call @__security_check_cookie@4 mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_string_std_copy@@YAXXZ jmp ___CxxFrameHandler3 text$x ENDS ?test_string_std_copy@@YAXXZ ENDP ; test_string_std_copy ; Function compile flags: /Ogtp ; COMDAT ??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _src$ = 8 ; size = 8 _dest$ = 16 ; size = 8 ??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z PROC ; gsl::copy<int,-1,int,-1>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 43 push ebp mov ebp, esp push -1 push __ehhandler$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 50 mov eax, DWORD PTR _src$[ebp] cmp DWORD PTR _dest$[ebp], eax jl SHORT $LN3@copy ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2436 test eax, eax jle SHORT $LN2@copy ; Line 2437 shl eax, 2 ; Line 2306 push eax push DWORD PTR _src$[ebp+4] push DWORD PTR _dest$[ebp+4] call DWORD PTR __imp__memmove add esp, 12 ; 0000000cH $LN2@copy: ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 53 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@copy: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0EL@GNMGMEGC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\gsl_algorithm ; Line 50 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN79@copy: $LN78@copy: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@copy and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@copy: ret 0 __ehhandler$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z jmp ___CxxFrameHandler3 text$x ENDS ??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z ENDP ; gsl::copy<int,-1,int,-1> ; Function compile flags: /Ogtp ; COMDAT ?gsl_copy_span@@YAXV?$span@H$0?0@gsl@@0@Z _TEXT SEGMENT _x$ = 8 ; size = 8 _y$ = 16 ; size = 8 ?gsl_copy_span@@YAXV?$span@H$0?0@gsl@@0@Z PROC ; gsl_copy_span, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 317 push ebp mov ebp, esp ; Line 318 push DWORD PTR _y$[ebp+4] push DWORD PTR _y$[ebp] push DWORD PTR _x$[ebp+4] push DWORD PTR _x$[ebp] call ??$copy@H$0?0H$0?0@gsl@@YAXV?$span@H$0?0@0@0@Z ; gsl::copy<int,-1,int,-1> add esp, 16 ; 00000010H ; Line 319 pop ebp ret 0 ?gsl_copy_span@@YAXV?$span@H$0?0@gsl@@0@Z ENDP ; gsl_copy_span _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 __First$ = 12 ; size = 8 __Last$ = 20 ; size = 8 __Dest$ = 28 ; size = 8 ??$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z PROC ; std::copy<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> >, COMDAT ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2371 push ebp mov ebp, esp sub esp, 8 ; Line 783 mov BYTE PTR $T2[ebp], 0 ; Line 2334 lea eax, DWORD PTR $T1[ebp] push DWORD PTR $T2[ebp] push DWORD PTR __Dest$[ebp+4] push DWORD PTR __Dest$[ebp] push DWORD PTR __Last$[ebp+4] push DWORD PTR __Last$[ebp] push DWORD PTR __First$[ebp+4] push DWORD PTR __First$[ebp] push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > ; Line 2353 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 2334 add esp, 32 ; 00000020H ; Line 2353 mov ecx, DWORD PTR $T1[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR $T1[ebp+4] mov DWORD PTR [eax+4], ecx ; Line 2374 mov esp, ebp pop ebp ret 0 ??$copy@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00@Z ENDP ; std::copy<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?copy_span@@YAXV?$span@H$0?0@gsl@@0@Z _TEXT SEGMENT $T1 = -8 ; size = 8 $T2 = -4 ; size = 1 _x$ = 8 ; size = 8 _y$ = 16 ; size = 8 ?copy_span@@YAXV?$span@H$0?0@gsl@@0@Z PROC ; copy_span, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 312 push ebp mov ebp, esp sub esp, 8 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 783 mov BYTE PTR $T2[ebp], 0 ; File c:\projects\gsl\include\gsl\span ; Line 145 lea eax, DWORD PTR _y$[ebp] ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2334 push DWORD PTR $T2[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 145 lea ecx, DWORD PTR _x$[ebp] ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2334 push 0 push eax push DWORD PTR _x$[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 145 mov edx, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility ; Line 2334 lea eax, DWORD PTR $T1[ebp] push ecx push 0 push edx push eax call ??$_Copy_unchecked1@V?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@@std@@YA?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@V123@00U_General_ptr_iterator_tag@0@@Z ; std::_Copy_unchecked1<gsl::details::span_iterator<gsl::span<int,-1>,0>,gsl::details::span_iterator<gsl::span<int,-1>,0> > add esp, 32 ; 00000020H ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 314 mov esp, ebp pop ebp ret 0 ?copy_span@@YAXV?$span@H$0?0@gsl@@0@Z ENDP ; copy_span _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?doterminate@@YAXXZ _TEXT SEGMENT ?doterminate@@YAXXZ PROC ; doterminate, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 306 jmp DWORD PTR __imp__terminate ?doterminate@@YAXXZ ENDP ; doterminate _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 _i$ = 20 ; size = 4 ?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z PROC ; mysubspan9, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 246 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 247 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan9 ; File c:\projects\gsl\include\gsl\span ; Line 386 push DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 494 mov BYTE PTR $T4[ebp], 0 lea ecx, DWORD PTR _s$2[ebp] push DWORD PTR $T4[ebp] push DWORD PTR _i$[ebp] push 3 push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 250 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 254 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN2@mysubspan9: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 254 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0: call ___std_terminate ret 0 __ehhandler$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-12] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan9@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ENDP ; mysubspan9 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 _i$ = 20 ; size = 4 ?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z PROC ; mysubspan8, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 234 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 push esi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 235 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan8 ; File c:\projects\gsl\include\gsl\span ; Line 386 mov esi, DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push esi push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 238 mov eax, DWORD PTR _i$[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 494 lea ecx, DWORD PTR _s$2[ebp] mov BYTE PTR $T4[ebp], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 238 sub esi, eax ; File c:\projects\gsl\include\gsl\span ; Line 494 push DWORD PTR $T4[ebp] push esi mov esi, DWORD PTR ___$ReturnUdt$[ebp] push eax push esi call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 238 mov eax, esi ; Line 242 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 0 $LN2@mysubspan8: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 242 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop esi mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0: call ___std_terminate ret 0 __ehhandler$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-16] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan8@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ENDP ; mysubspan8 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 _i$ = 20 ; size = 4 ?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z PROC ; mysubspan7, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 223 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 224 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan7 ; File c:\projects\gsl\include\gsl\span ; Line 386 push DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 494 mov BYTE PTR $T4[ebp], 0 lea ecx, DWORD PTR _s$2[ebp] push DWORD PTR $T4[ebp] push 3 push DWORD PTR _i$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 227 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 231 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN2@mysubspan7: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 231 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0: call ___std_terminate ret 0 __ehhandler$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-12] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan7@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ENDP ; mysubspan7 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 ?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z PROC ; mysubspan6, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 211 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 212 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan6 ; File c:\projects\gsl\include\gsl\span ; Line 386 push DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 494 mov BYTE PTR $T4[ebp], 0 lea ecx, DWORD PTR _s$2[ebp] push DWORD PTR $T4[ebp] push -1 push 3 push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 215 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 219 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN2@mysubspan6: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 219 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z$2: call ___std_terminate ret 0 __ehhandler$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-12] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan6@@YA?AV?$span@H$0?0@gsl@@PAHH@Z ENDP ; mysubspan6 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 _i$ = 20 ; size = 4 ?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z PROC ; mysubspan5, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 199 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 200 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan5 ; File c:\projects\gsl\include\gsl\span ; Line 386 push DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 494 mov BYTE PTR $T4[ebp], 0 lea ecx, DWORD PTR _s$2[ebp] push DWORD PTR $T4[ebp] push -1 push DWORD PTR _i$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 203 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 207 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN2@mysubspan5: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 207 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$0: call ___std_terminate ret 0 __ehhandler$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-12] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan5@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ENDP ; mysubspan5 ; Function compile flags: /Ogtp ; COMDAT ??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ PROC ; gsl::span<int,-1>::span<int,-1><0,void>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 384 push ebp mov ebp, esp push -1 push __ehhandler$??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T2[ebp], 0 mov eax, ecx ; Line 333 mov DWORD PTR [ecx], 0 ; Line 596 mov DWORD PTR [ecx+4], 0 ; Line 384 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ jmp ___CxxFrameHandler3 text$x ENDS ??$?0$0A@X@?$span@H$0?0@gsl@@QAE@XZ ENDP ; gsl::span<int,-1>::span<int,-1><0,void> ; Function compile flags: /Ogtp ; COMDAT ?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z _TEXT SEGMENT _s$2 = -20 ; size = 8 $T3 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 $T4 = 12 ; size = 1 _p$ = 12 ; size = 4 _size$ = 16 ; size = 4 _i$ = 20 ; size = 4 ?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z PROC ; mysubspan4, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 188 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 8 mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T3[ebp], 0 ; Line 189 mov eax, DWORD PTR _p$[ebp] test eax, eax je SHORT $LN2@mysubspan4 ; File c:\projects\gsl\include\gsl\span ; Line 386 push DWORD PTR _size$[ebp] lea ecx, DWORD PTR _s$2[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 488 mov eax, DWORD PTR _s$2[ebp] lea ecx, DWORD PTR _s$2[ebp] sub eax, DWORD PTR _i$[ebp] mov BYTE PTR $T4[ebp], 0 push DWORD PTR $T4[ebp] push -1 push eax push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 192 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 196 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN2@mysubspan4: mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], 0 ; File c:\projects\gsl\include\gsl\span ; Line 596 mov DWORD PTR [eax+4], 0 ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 196 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z$2: call ___std_terminate ret 0 __ehhandler$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-12] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan4@@YA?AV?$span@H$0?0@gsl@@PAHHH@Z ENDP ; mysubspan4 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan3@@YAHXZ _TEXT SEGMENT _tmp$2 = -60 ; size = 8 _subspan$ = -52 ; size = 8 $T3 = -48 ; size = 1 $T4 = -48 ; size = 4 $T5 = -41 ; size = 1 _x$ = -40 ; size = 24 __$ArrayPad$ = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ?mysubspan3@@YAHXZ PROC ; mysubspan3, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 177 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan3@@YAHXZ mov eax, DWORD PTR fs:0 push eax sub esp, 48 ; 00000030H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 movaps xmm0, XMMWORD PTR __xmm@00000003000000020000000100000000 movups XMMWORD PTR _x$[ebp], xmm0 ; Line 178 mov DWORD PTR _x$[ebp+16], 4 mov DWORD PTR _x$[ebp+20], 5 ; File c:\projects\gsl\include\gsl\span ; Line 447 push 6 lea ecx, DWORD PTR $T5[ebp] ; Line 395 mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 447 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$2[ebp] movzx eax, BYTE PTR [eax] push eax lea eax, DWORD PTR _x$[ebp] push eax call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov BYTE PTR $T3[ebp], 0 lea eax, DWORD PTR _subspan$[ebp] push DWORD PTR $T3[ebp] lea ecx, DWORD PTR _tmp$2[ebp] push -1 push 3 push eax call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 183 mov eax, DWORD PTR _subspan$[ebp] ; Line 184 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan3@@YAHXZ$0: call ___std_terminate ret 0 __ehhandler$?mysubspan3@@YAHXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-52] xor ecx, eax call @__security_check_cookie@4 mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan3@@YAHXZ jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan3@@YAHXZ ENDP ; mysubspan3 ; Function compile flags: /Ogtp ; COMDAT ?mysubspan2@@YAHH@Z _TEXT SEGMENT _tmp$2 = -60 ; size = 8 _subspan$ = -52 ; size = 8 $T3 = -48 ; size = 1 $T4 = -48 ; size = 4 $T5 = -41 ; size = 1 _x$ = -40 ; size = 24 __$ArrayPad$ = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _i$ = 8 ; size = 4 ?mysubspan2@@YAHH@Z PROC ; mysubspan2, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 166 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan2@@YAHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 48 ; 00000030H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 movaps xmm0, XMMWORD PTR __xmm@00000003000000020000000100000000 movups XMMWORD PTR _x$[ebp], xmm0 ; Line 167 mov DWORD PTR _x$[ebp+16], 4 mov DWORD PTR _x$[ebp+20], 5 ; File c:\projects\gsl\include\gsl\span ; Line 447 push 6 lea ecx, DWORD PTR $T5[ebp] ; Line 395 mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 447 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$2[ebp] movzx eax, BYTE PTR [eax] push eax lea eax, DWORD PTR _x$[ebp] push eax call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov BYTE PTR $T3[ebp], 0 lea ecx, DWORD PTR _tmp$2[ebp] push DWORD PTR $T3[ebp] ; Line 488 mov eax, 6 sub eax, DWORD PTR _i$[ebp] ; Line 494 push -1 push eax lea eax, DWORD PTR _subspan$[ebp] push eax call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 172 mov eax, DWORD PTR _subspan$[ebp] ; Line 173 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan2@@YAHH@Z$0: call ___std_terminate ret 0 __ehhandler$?mysubspan2@@YAHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-52] xor ecx, eax call @__security_check_cookie@4 mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan2@@YAHH@Z jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan2@@YAHH@Z ENDP ; mysubspan2 ; Function compile flags: /Ogtp ; COMDAT ??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _arr$ = 8 ; size = 4 ??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z PROC ; gsl::span<int,6>::span<int,6><6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 395 push ebp mov ebp, esp push -1 push __ehhandler$??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 590 mov eax, DWORD PTR _arr$[ebp] mov DWORD PTR [ecx], eax ; Line 395 mov eax, ecx mov DWORD PTR $T2[ebp], 0 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0$05@?$span@H$05@gsl@@QAE@AAY05H@Z ENDP ; gsl::span<int,6>::span<int,6><6> ; Function compile flags: /Ogtp ; COMDAT ?data@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QBEPAHXZ _TEXT SEGMENT ?data@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QBEPAHXZ PROC ; gsl::span<int,6>::storage_type<gsl::details::extent_type<6> >::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 602 mov eax, DWORD PTR [ecx] ret 0 ?data@?$storage_type@V?$extent_type@$05@details@gsl@@@?$span@H$05@gsl@@QBEPAHXZ ENDP ; gsl::span<int,6>::storage_type<gsl::details::extent_type<6> >::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$extent_type@$05@details@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$extent_type@$05@details@gsl@@QBEHXZ PROC ; gsl::details::extent_type<6>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 323 mov eax, 6 ret 0 ?size@?$extent_type@$05@details@gsl@@QBEHXZ ENDP ; gsl::details::extent_type<6>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$extent_type@$05@details@gsl@@QAE@H@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _size$ = 8 ; size = 4 ??0?$extent_type@$05@details@gsl@@QAE@H@Z PROC ; gsl::details::extent_type<6>::extent_type<6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 321 push ebp mov ebp, esp push -1 push __ehhandler$??0?$extent_type@$05@details@gsl@@QAE@H@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax cmp DWORD PTR _size$[ebp], 6 mov DWORD PTR $T4[ebp], 0 jne SHORT $LN3@extent_typ mov eax, ecx mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@EJCPKIPN@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 321 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN24@extent_typ: $LN23@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??0?$extent_type@$05@details@gsl@@QAE@H@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@extent_typ and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@extent_typ: ret 0 __ehhandler$??0?$extent_type@$05@details@gsl@@QAE@H@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??0?$extent_type@$05@details@gsl@@QAE@H@Z jmp ___CxxFrameHandler3 text$x ENDS ??0?$extent_type@$05@details@gsl@@QAE@H@Z ENDP ; gsl::details::extent_type<6>::extent_type<6> ; Function compile flags: /Ogtp ; COMDAT ??0?$extent_type@$05@details@gsl@@QAE@XZ _TEXT SEGMENT ??0?$extent_type@$05@details@gsl@@QAE@XZ PROC ; gsl::details::extent_type<6>::extent_type<6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 311 mov eax, ecx ret 0 ??0?$extent_type@$05@details@gsl@@QAE@XZ ENDP ; gsl::details::extent_type<6>::extent_type<6> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$span@H$05@gsl@@QBEPAHXZ _TEXT SEGMENT ?data@?$span@H$05@gsl@@QBEPAHXZ PROC ; gsl::span<int,6>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [ecx] ret 0 ?data@?$span@H$05@gsl@@QBEPAHXZ ENDP ; gsl::span<int,6>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$span@H$05@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$span@H$05@gsl@@QBEHXZ PROC ; gsl::span<int,6>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 498 mov eax, 6 ret 0 ?size@?$span@H$05@gsl@@QBEHXZ ENDP ; gsl::span<int,6>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?subspan@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@HH@Z _TEXT SEGMENT _tmp$1 = -16 ; size = 8 $T2 = -5 ; size = 1 $T3 = -1 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 _offset$ = 12 ; size = 4 _count$ = 16 ; size = 4 ?subspan@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@HH@Z PROC ; gsl::span<int,6>::subspan, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 493 push ebp mov ebp, esp sub esp, 16 ; 00000010H push esi ; Line 515 mov esi, DWORD PTR [ecx] ; Line 447 lea ecx, DWORD PTR $T3[ebp] push 6 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$1[ebp] movzx eax, BYTE PTR [eax] push eax push esi call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov esi, DWORD PTR ___$ReturnUdt$[ebp] lea ecx, DWORD PTR _tmp$1[ebp] mov BYTE PTR $T2[ebp], 0 push DWORD PTR $T2[ebp] push DWORD PTR _count$[ebp] push DWORD PTR _offset$[ebp] push esi call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan mov eax, esi pop esi ; Line 495 mov esp, ebp pop ebp ret 12 ; 0000000cH ?subspan@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@HH@Z ENDP ; gsl::span<int,6>::subspan _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?last@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@H@Z _TEXT SEGMENT _tmp$1 = -16 ; size = 8 $T2 = -5 ; size = 1 $T3 = -1 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 _count$ = 12 ; size = 4 ?last@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@H@Z PROC ; gsl::span<int,6>::last, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 487 push ebp mov ebp, esp sub esp, 16 ; 00000010H push esi ; Line 515 mov esi, DWORD PTR [ecx] ; Line 447 lea ecx, DWORD PTR $T3[ebp] push 6 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$1[ebp] movzx eax, BYTE PTR [eax] push eax push esi call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov esi, DWORD PTR ___$ReturnUdt$[ebp] lea ecx, DWORD PTR _tmp$1[ebp] mov BYTE PTR $T2[ebp], 0 ; Line 488 mov eax, 6 ; Line 494 push DWORD PTR $T2[ebp] ; Line 488 sub eax, DWORD PTR _count$[ebp] ; Line 494 push -1 push eax push esi call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; Line 488 mov eax, esi pop esi ; Line 489 mov esp, ebp pop ebp ret 8 ?last@?$span@H$05@gsl@@QBE?AV?$span@H$0?0@2@H@Z ENDP ; gsl::span<int,6>::last _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?mysubspan1@@YAHXZ _TEXT SEGMENT _tmp$2 = -60 ; size = 8 _subspan$ = -52 ; size = 8 $T3 = -48 ; size = 1 $T4 = -48 ; size = 4 $T5 = -41 ; size = 1 _x$ = -40 ; size = 24 __$ArrayPad$ = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ?mysubspan1@@YAHXZ PROC ; mysubspan1, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 155 push ebp mov ebp, esp push -1 push __ehhandler$?mysubspan1@@YAHXZ mov eax, DWORD PTR fs:0 push eax sub esp, 48 ; 00000030H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 movaps xmm0, XMMWORD PTR __xmm@00000003000000020000000100000000 movups XMMWORD PTR _x$[ebp], xmm0 ; Line 156 mov DWORD PTR _x$[ebp+16], 4 mov DWORD PTR _x$[ebp+20], 5 ; File c:\projects\gsl\include\gsl\span ; Line 447 push 6 lea ecx, DWORD PTR $T5[ebp] ; Line 395 mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 447 call ??0?$extent_type@$05@details@gsl@@QAE@H@Z ; gsl::details::extent_type<6>::extent_type<6> lea ecx, DWORD PTR _tmp$2[ebp] movzx eax, BYTE PTR [eax] push eax lea eax, DWORD PTR _x$[ebp] push eax call ??$?0V?$extent_type@$05@details@gsl@@@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHV?$extent_type@$05@details@2@@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><gsl::details::extent_type<6> > ; Line 494 mov BYTE PTR $T3[ebp], 0 lea eax, DWORD PTR _subspan$[ebp] push DWORD PTR $T3[ebp] lea ecx, DWORD PTR _tmp$2[ebp] push -1 push 3 push eax call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 161 mov eax, DWORD PTR _subspan$[ebp] ; Line 162 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?mysubspan1@@YAHXZ$0: call ___std_terminate ret 0 __ehhandler$?mysubspan1@@YAHXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-52] xor ecx, eax call @__security_check_cookie@4 mov ecx, DWORD PTR [edx-4] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?mysubspan1@@YAHXZ jmp ___CxxFrameHandler3 text$x ENDS ?mysubspan1@@YAHXZ ENDP ; mysubspan1 ; Function compile flags: /Ogtp ; COMDAT ??$convert_span@EV?$span@G$0?0@gsl@@@@YA?AV?$span@E$0?0@gsl@@V?$span@G$0?0@1@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 _s$ = 12 ; size = 8 ??$convert_span@EV?$span@G$0?0@gsl@@@@YA?AV?$span@E$0?0@gsl@@V?$span@G$0?0@1@@Z PROC ; convert_span<unsigned char,gsl::span<unsigned short,-1> >, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 129 push ebp mov ebp, esp ; File c:\projects\gsl\include\gsl\span ; Line 501 mov eax, DWORD PTR _s$[ebp] ; Line 386 mov ecx, DWORD PTR ___$ReturnUdt$[ebp] ; Line 501 add eax, eax ; Line 386 push eax push DWORD PTR _s$[ebp+4] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 133 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 134 pop ebp ret 0 ??$convert_span@EV?$span@G$0?0@gsl@@@@YA?AV?$span@E$0?0@gsl@@V?$span@G$0?0@1@@Z ENDP ; convert_span<unsigned char,gsl::span<unsigned short,-1> > _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?test_convert_span_Joe@@YAEAAUIDE_DRIVE_STATE@@@Z _TEXT SEGMENT _curBuffer$ = -8 ; size = 8 _Drive$ = 8 ; size = 4 ?test_convert_span_Joe@@YAEAAUIDE_DRIVE_STATE@@@Z PROC ; test_convert_span_Joe, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 145 push ebp mov ebp, esp ; Line 146 mov eax, DWORD PTR _Drive$[ebp] sub esp, 8 mov ecx, DWORD PTR [eax+8] mov edx, DWORD PTR [eax+12] ; File c:\projects\gsl\include\gsl\span ; Line 501 lea eax, DWORD PTR [ecx+ecx] ; Line 386 push eax push edx lea ecx, DWORD PTR _curBuffer$[ebp] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 148 push 0 lea ecx, DWORD PTR _curBuffer$[ebp] call ??A?$span@E$0?0@gsl@@QBEAAEH@Z ; gsl::span<unsigned char,-1>::operator[] mov al, BYTE PTR [eax] ; Line 149 mov esp, ebp pop ebp ret 0 ?test_convert_span_Joe@@YAEAAUIDE_DRIVE_STATE@@@Z ENDP ; test_convert_span_Joe _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z _TEXT SEGMENT $T2 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _arr$ = 8 ; size = 4 ??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z PROC ; gsl::span<unsigned char,-1>::span<unsigned char,-1><6>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 395 push ebp mov ebp, esp push -1 push __ehhandler$??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z mov eax, DWORD PTR fs:0 push eax push ecx mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 590 mov eax, DWORD PTR _arr$[ebp] mov DWORD PTR [ecx+4], eax ; Line 395 mov eax, ecx mov DWORD PTR $T2[ebp], 0 ; Line 333 mov DWORD PTR [ecx], 6 ; Line 395 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-8] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?0$05@?$span@E$0?0@gsl@@QAE@AAY05E@Z ENDP ; gsl::span<unsigned char,-1>::span<unsigned char,-1><6> ; Function compile flags: /Ogtp ; COMDAT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QBEPAEXZ _TEXT SEGMENT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QBEPAEXZ PROC ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 602 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QBEPAEXZ ENDP ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?CheckRange@?$span@E$0?0@gsl@@CA_NHH@Z _TEXT SEGMENT _idx$ = 8 ; size = 4 _size$ = 12 ; size = 4 ?CheckRange@?$span@E$0?0@gsl@@CA_NHH@Z PROC ; gsl::span<unsigned char,-1>::CheckRange, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 548 push ebp mov ebp, esp ; Line 565 mov eax, DWORD PTR _idx$[ebp] cmp eax, DWORD PTR _size$[ebp] sbb eax, eax neg eax ; Line 571 pop ebp ret 0 ?CheckRange@?$span@E$0?0@gsl@@CA_NHH@Z ENDP ; gsl::span<unsigned char,-1>::CheckRange _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?begin@?$span@E$0?0@gsl@@QBE?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?begin@?$span@E$0?0@gsl@@QBE?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::span<unsigned char,-1>::begin, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 518 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], 0 ; Line 518 pop ebp ret 4 ?begin@?$span@E$0?0@gsl@@QBE?AV?$span_iterator@V?$span@E$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::span<unsigned char,-1>::begin _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$span@E$0?0@gsl@@QBEPAEXZ _TEXT SEGMENT ?data@?$span@E$0?0@gsl@@QBEPAEXZ PROC ; gsl::span<unsigned char,-1>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$span@E$0?0@gsl@@QBEPAEXZ ENDP ; gsl::span<unsigned char,-1>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??A?$span@E$0?0@gsl@@QBEAAEH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _idx$ = 8 ; size = 4 ??A?$span@E$0?0@gsl@@QBEAAEH@Z PROC ; gsl::span<unsigned char,-1>::operator[], COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 508 push ebp mov ebp, esp push -1 push __ehhandler$??A?$span@E$0?0@gsl@@QBEAAEH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov edx, DWORD PTR _idx$[ebp] mov DWORD PTR $T4[ebp], 0 cmp edx, DWORD PTR [ecx] ; Line 509 jae SHORT $LN3@operator ; Line 510 mov eax, DWORD PTR [ecx+4] add eax, edx ; Line 511 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 509 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN52@operator: $LN51@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??A?$span@E$0?0@gsl@@QBEAAEH@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??A?$span@E$0?0@gsl@@QBEAAEH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??A?$span@E$0?0@gsl@@QBEAAEH@Z jmp ___CxxFrameHandler3 text$x ENDS ??A?$span@E$0?0@gsl@@QBEAAEH@Z ENDP ; gsl::span<unsigned char,-1>::operator[] ; Function compile flags: /Ogtp ; COMDAT ?size@?$span@E$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$span@E$0?0@gsl@@QBEHXZ PROC ; gsl::span<unsigned char,-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 498 mov eax, DWORD PTR [ecx] ret 0 ?size@?$span@E$0?0@gsl@@QBEHXZ ENDP ; gsl::span<unsigned char,-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$span@E$0?0@gsl@@QAE@PAEH@Z _TEXT SEGMENT _ptr$ = 8 ; size = 4 _count$ = 12 ; size = 4 ??0?$span@E$0?0@gsl@@QAE@PAEH@Z PROC ; gsl::span<unsigned char,-1>::span<unsigned char,-1>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 386 push ebp mov ebp, esp push esi push DWORD PTR _count$[ebp] mov esi, ecx push DWORD PTR _ptr$[ebp] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@E$0?0@gsl@@QAE@PAEH@Z ; gsl::span<unsigned char,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> mov eax, esi pop esi pop ebp ret 8 ??0?$span@E$0?0@gsl@@QAE@PAEH@Z ENDP ; gsl::span<unsigned char,-1>::span<unsigned char,-1> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _Drive$ = 8 ; size = 4 ?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z PROC ; static_size_array_span, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 96 push ebp mov ebp, esp push -1 push __ehhandler$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx mov DWORD PTR $T4[ebp], ebx ; Line 99 mov edi, DWORD PTR _Drive$[ebp] xor esi, esi cmp esi, 6 $LN101@static_siz: ; File c:\projects\gsl\include\gsl\span ; Line 509 jae SHORT $LN48@static_siz mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 2 je SHORT $LN85@static_siz ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 509 and ebx, -3 ; fffffffdH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call DWORD PTR __imp____std_exception_destroy add esp, 4 $LN85@static_siz: ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 101 mov BYTE PTR [esi+edi], 1 inc esi cmp esi, 6 jl SHORT $LN101@static_siz ; Line 103 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN48@static_siz: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 509 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 or ebx, 2 push eax mov DWORD PTR $T4[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN102@static_siz: $LN100@static_siz: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z$0: call ___std_terminate ret 0 __unwindfunclet$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z$8: mov eax, DWORD PTR $T4[ebp] and eax, 2 je $LN51@static_siz and DWORD PTR $T4[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN51@static_siz: ret 0 __ehhandler$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-40] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z jmp ___CxxFrameHandler3 text$x ENDS ?static_size_array_span@@YAXAAUIDE_DRIVE_STATE@@@Z ENDP ; static_size_array_span ; Function compile flags: /Ogtp ; COMDAT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@G$0?0@gsl@@QBEPAGXZ _TEXT SEGMENT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@G$0?0@gsl@@QBEPAGXZ PROC ; gsl::span<unsigned short,-1>::storage_type<gsl::details::extent_type<-1> >::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 602 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@G$0?0@gsl@@QBEPAGXZ ENDP ; gsl::span<unsigned short,-1>::storage_type<gsl::details::extent_type<-1> >::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$span@G$0?0@gsl@@QBEPAGXZ _TEXT SEGMENT ?data@?$span@G$0?0@gsl@@QBEPAGXZ PROC ; gsl::span<unsigned short,-1>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$span@G$0?0@gsl@@QBEPAGXZ ENDP ; gsl::span<unsigned short,-1>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size_bytes@?$span@G$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size_bytes@?$span@G$0?0@gsl@@QBEHXZ PROC ; gsl::span<unsigned short,-1>::size_bytes, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 501 mov eax, DWORD PTR [ecx] add eax, eax ; Line 502 ret 0 ?size_bytes@?$span@G$0?0@gsl@@QBEHXZ ENDP ; gsl::span<unsigned short,-1>::size_bytes _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$span@G$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$span@G$0?0@gsl@@QBEHXZ PROC ; gsl::span<unsigned short,-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 498 mov eax, DWORD PTR [ecx] ret 0 ?size@?$span@G$0?0@gsl@@QBEHXZ ENDP ; gsl::span<unsigned short,-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z _TEXT SEGMENT $T2 = -48 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 _<end>$L0$1$ = -16 ; size = 4 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _s$ = 8 ; size = 8 ?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z PROC ; test_span_rangeiter, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 69 push ebp mov ebp, esp push -1 push __ehhandler$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 36 ; 00000024H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx ; File c:\projects\gsl\include\gsl\span ; Line 145 xor esi, esi mov DWORD PTR $T6[ebp], ebx xor edi, edi mov eax, DWORD PTR _s$[ebp] mov edx, eax mov DWORD PTR _<end>$L0$1$[ebp], edx $LN100@test_span_: mov ecx, DWORD PTR __imp____std_exception_destroy ; Line 231 cmp esi, edx je $LN3@test_span_ ; Line 157 cmp esi, eax je $LN62@test_span_ test bl, 2 je SHORT $LN83@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -3 ; fffffffdH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call ecx mov ecx, DWORD PTR __imp____std_exception_destroy add esp, 4 $LN83@test_span_: ; File c:\projects\gsl\include\gsl\span ; Line 158 mov eax, DWORD PTR _s$[ebp+4] ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 72 inc DWORD PTR [edi+eax] ; File c:\projects\gsl\include\gsl\span ; Line 169 test edi, edi js SHORT $LN26@test_span_ mov eax, DWORD PTR _s$[ebp] cmp esi, eax je SHORT $LN26@test_span_ mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 1 je SHORT $LN47@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call ecx mov eax, DWORD PTR _s$[ebp] add esp, 4 $LN47@test_span_: ; File c:\projects\gsl\include\gsl\span ; Line 170 mov edx, DWORD PTR _<end>$L0$1$[ebp] inc esi add edi, 4 jmp SHORT $LN100@test_span_ $LN26@test_span_: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T6[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN101@test_span_: $LN62@test_span_: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 or ebx, 2 push eax mov DWORD PTR $T6[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN102@test_span_: $LN3@test_span_: ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 74 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN99@test_span_: _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z$6: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN29@test_span_ and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN29@test_span_: ret 0 __unwindfunclet$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z$13: mov eax, DWORD PTR $T6[ebp] and eax, 2 je $LN65@test_span_ and DWORD PTR $T6[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN65@test_span_: ret 0 __ehhandler$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-52] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z jmp ___CxxFrameHandler3 text$x ENDS ?test_span_rangeiter@@YAXV?$span@H$0?0@gsl@@@Z ENDP ; test_span_rangeiter ; Function compile flags: /Ogtp ; COMDAT ??9details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z _TEXT SEGMENT _lhs$ = 8 ; size = 8 _rhs$ = 16 ; size = 8 ??9details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z PROC ; gsl::details::operator!=, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 235 push ebp mov ebp, esp ; Line 231 mov eax, DWORD PTR _lhs$[ebp] cmp eax, DWORD PTR _rhs$[ebp] jne SHORT $LN5@operator mov eax, DWORD PTR _lhs$[ebp+4] cmp eax, DWORD PTR _rhs$[ebp+4] jne SHORT $LN5@operator ; Line 236 xor al, al ; Line 237 pop ebp ret 0 $LN5@operator: ; Line 236 mov al, 1 ; Line 237 pop ebp ret 0 ??9details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z ENDP ; gsl::details::operator!= _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??8details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z _TEXT SEGMENT _lhs$ = 8 ; size = 8 _rhs$ = 16 ; size = 8 ??8details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z PROC ; gsl::details::operator==, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 230 push ebp mov ebp, esp ; Line 231 mov eax, DWORD PTR _lhs$[ebp] cmp eax, DWORD PTR _rhs$[ebp] jne SHORT $LN3@operator mov eax, DWORD PTR _lhs$[ebp+4] cmp eax, DWORD PTR _rhs$[ebp+4] jne SHORT $LN3@operator mov al, 1 ; Line 232 pop ebp ret 0 $LN3@operator: ; Line 231 xor al, al ; Line 232 pop ebp ret 0 ??8details@gsl@@YA_NV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@01@0@Z ENDP ; gsl::details::operator== _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ PROC ; gsl::details::span_iterator<gsl::span<int,-1>,0>::operator++, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 168 push ebp mov ebp, esp push -1 push __ehhandler$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 169 mov edx, DWORD PTR [ecx+4] test edx, edx js SHORT $LN3@operator mov eax, DWORD PTR [ecx] cmp edx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 170 lea eax, DWORD PTR [edx+1] mov DWORD PTR [ecx+4], eax ; Line 171 mov eax, ecx ; Line 172 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN30@operator: $LN29@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ jmp ___CxxFrameHandler3 text$x ENDS ??E?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAEAAV012@XZ ENDP ; gsl::details::span_iterator<gsl::span<int,-1>,0>::operator++ ; Function compile flags: /Ogtp ; COMDAT ??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ PROC ; gsl::details::span_iterator<gsl::span<int,-1>,0>::operator*, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 156 push ebp mov ebp, esp push -1 push __ehhandler$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov DWORD PTR $T4[ebp], 0 ; Line 157 mov eax, DWORD PTR [ecx] mov ecx, DWORD PTR [ecx+4] cmp ecx, DWORD PTR [eax] je SHORT $LN3@operator ; Line 158 mov eax, DWORD PTR [eax+4] lea eax, DWORD PTR [eax+ecx*4] ; Line 159 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 0 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@LADDNBHF@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 157 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN36@operator: $LN35@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ jmp ___CxxFrameHandler3 text$x ENDS ??D?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QBEAAHXZ ENDP ; gsl::details::span_iterator<gsl::span<int,-1>,0>::operator* ; Function compile flags: /Ogtp ; COMDAT ??0?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@H$0?0@2@H@Z _TEXT SEGMENT _span$ = 8 ; size = 4 _idx$ = 12 ; size = 4 ??0?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@H$0?0@2@H@Z PROC ; gsl::details::span_iterator<gsl::span<int,-1>,0>::span_iterator<gsl::span<int,-1>,0>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 146 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR _span$[ebp] mov DWORD PTR [ecx], eax mov eax, DWORD PTR _idx$[ebp] mov DWORD PTR [ecx+4], eax ; Line 146 mov eax, ecx pop ebp ret 8 ??0?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@gsl@@QAE@PBV?$span@H$0?0@2@H@Z ENDP ; gsl::details::span_iterator<gsl::span<int,-1>,0>::span_iterator<gsl::span<int,-1>,0> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z _TEXT SEGMENT $T2 = -40 ; size = 12 $T3 = -28 ; size = 12 __InitData$4 = -24 ; size = 8 $T5 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _s$ = 8 ; size = 8 ?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z PROC ; test_span_iter, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 60 push ebp mov ebp, esp push -1 push __ehhandler$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 28 ; 0000001cH push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx ; File c:\projects\gsl\include\gsl\span ; Line 145 xor esi, esi mov DWORD PTR $T5[ebp], ebx xor edi, edi $LN101@test_span_: mov ecx, DWORD PTR __imp____std_exception_destroy ; Line 231 cmp esi, DWORD PTR _s$[ebp] je $LN3@test_span_ ; Line 157 test bl, 2 je SHORT $LN83@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 157 and ebx, -3 ; fffffffdH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call ecx mov ecx, DWORD PTR __imp____std_exception_destroy add esp, 4 $LN83@test_span_: ; File c:\projects\gsl\include\gsl\span ; Line 158 mov eax, DWORD PTR _s$[ebp+4] ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 63 inc DWORD PTR [edi+eax] ; File c:\projects\gsl\include\gsl\span ; Line 169 test edi, edi js SHORT $LN14@test_span_ cmp esi, DWORD PTR _s$[ebp] je SHORT $LN14@test_span_ mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 1 je SHORT $LN35@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 169 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call ecx add esp, 4 $LN35@test_span_: ; File c:\projects\gsl\include\gsl\span ; Line 170 inc esi add edi, 4 jmp SHORT $LN101@test_span_ $LN14@test_span_: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@CMPGECKC@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 169 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T5[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN102@test_span_: $LN3@test_span_: ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 65 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN100@test_span_: _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z$2: mov eax, DWORD PTR $T5[ebp] and eax, 1 je $LN17@test_span_ and DWORD PTR $T5[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN17@test_span_: ret 0 __ehhandler$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-44] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z jmp ___CxxFrameHandler3 text$x ENDS ?test_span_iter@@YAXV?$span@H$0?0@gsl@@@Z ENDP ; test_span_iter ; Function compile flags: /Ogtp ; COMDAT ?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _s$ = 8 ; size = 8 ?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z PROC ; test_span_for, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 51 push ebp mov ebp, esp push -1 push __ehhandler$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax xor ebx, ebx ; Line 52 xor esi, esi mov DWORD PTR $T4[ebp], ebx mov eax, DWORD PTR _s$[ebp] test eax, eax jle SHORT $LN3@test_span_ mov edi, DWORD PTR __imp____std_exception_destroy cmp esi, eax $LN68@test_span_: ; File c:\projects\gsl\include\gsl\span ; Line 509 jae SHORT $LN14@test_span_ mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 1 je SHORT $LN51@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 509 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call edi add esp, 4 $LN51@test_span_: ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 52 mov eax, DWORD PTR _s$[ebp+4] ; Line 54 inc DWORD PTR [eax+esi*4] inc esi mov eax, DWORD PTR _s$[ebp] cmp esi, eax jl SHORT $LN68@test_span_ $LN3@test_span_: ; Line 56 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN14@test_span_: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 509 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T4[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN69@test_span_: $LN67@test_span_: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z$2: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN17@test_span_ and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN17@test_span_: ret 0 __ehhandler$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-40] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z jmp ___CxxFrameHandler3 text$x ENDS ?test_span_for@@YAXV?$span@H$0?0@gsl@@@Z ENDP ; test_span_for ; Function compile flags: /Ogtp ; COMDAT ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z _TEXT SEGMENT $T2 = -36 ; size = 12 $T3 = -36 ; size = 12 __InitData$4 = -24 ; size = 8 __InitData$5 = -24 ; size = 8 $T6 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 ___$ReturnUdt$ = 8 ; size = 4 _offset$ = 12 ; size = 4 _count$ = 16 ; size = 4 ___formal$ = 20 ; size = 1 ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z PROC ; gsl::span<int,-1>::make_subspan, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 630 push ebp mov ebp, esp push -1 push __ehhandler$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov edi, ecx ; Line 631 mov esi, DWORD PTR _offset$[ebp] mov DWORD PTR $T6[ebp], 0 test esi, esi js $LN4@make_subsp ; Line 498 mov edx, DWORD PTR [edi] ; Line 631 mov eax, edx sub eax, esi js $LN4@make_subsp ; Line 633 mov ecx, DWORD PTR _count$[ebp] mov DWORD PTR __$EHRec$[ebp+8], -1 cmp ecx, -1 jne SHORT $LN2@make_subsp mov eax, DWORD PTR [edi+4] sub edx, esi ; Line 612 push edx ; Line 633 lea eax, DWORD PTR [eax+esi*4] $LN78@make_subsp: ; Line 612 mov ecx, DWORD PTR ___$ReturnUdt$[ebp] push eax call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> ; Line 636 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 637 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi mov esp, ebp pop ebp ret 16 ; 00000010H $LN2@make_subsp: ; Line 635 test ecx, ecx js SHORT $LN6@make_subsp sub edx, esi cmp edx, ecx jl SHORT $LN6@make_subsp ; Line 636 mov eax, DWORD PTR [edi+4] mov DWORD PTR __$EHRec$[ebp+8], -1 ; Line 612 push ecx ; Line 636 lea eax, DWORD PTR [eax+esi*4] jmp SHORT $LN78@make_subsp $LN6@make_subsp: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$4[ebp] mov DWORD PTR __InitData$4[ebp], OFFSET ??_C@_0ED@BLFPPHPM@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$4[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 635 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 1 push eax mov DWORD PTR $T6[ebp], 2 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN79@make_subsp: $LN4@make_subsp: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T3[ebp+4] mov DWORD PTR $T3[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$5[ebp] mov DWORD PTR __InitData$5[ebp], OFFSET ??_C@_0ED@HPDDDCPI@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$5[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T3[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T3[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 631 lea eax, DWORD PTR $T3[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T6[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN80@make_subsp: $LN77@make_subsp: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z$1: mov eax, DWORD PTR $T6[ebp] and eax, 2 je $LN12@make_subsp and DWORD PTR $T6[ebp], -3 ; fffffffdH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN12@make_subsp: ret 0 __unwindfunclet$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z$0: mov eax, DWORD PTR $T6[ebp] and eax, 1 je $LN9@make_subsp and DWORD PTR $T6[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T3[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN9@make_subsp: ret 0 __ehhandler$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-36] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z jmp ___CxxFrameHandler3 text$x ENDS ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ENDP ; gsl::span<int,-1>::make_subspan ; Function compile flags: /Ogtp ; COMDAT ??0?$span@H$0?0@gsl@@AAE@UKnownNotNull@01@H@Z _TEXT SEGMENT _ptr$ = 8 ; size = 4 _count$ = 12 ; size = 4 ??0?$span@H$0?0@gsl@@AAE@UKnownNotNull@01@H@Z PROC ; gsl::span<int,-1>::span<int,-1>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 612 push ebp mov ebp, esp push esi push DWORD PTR _count$[ebp] mov esi, ecx push DWORD PTR _ptr$[ebp] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@UKnownNotNull@12@H@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> mov eax, esi pop esi pop ebp ret 8 ??0?$span@H$0?0@gsl@@AAE@UKnownNotNull@01@H@Z ENDP ; gsl::span<int,-1>::span<int,-1> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QBEPAHXZ _TEXT SEGMENT ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QBEPAHXZ PROC ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 602 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QBEPAHXZ ENDP ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?CheckRange@?$span@H$0?0@gsl@@CA_NHH@Z _TEXT SEGMENT _idx$ = 8 ; size = 4 _size$ = 12 ; size = 4 ?CheckRange@?$span@H$0?0@gsl@@CA_NHH@Z PROC ; gsl::span<int,-1>::CheckRange, COMDAT ; File c:\projects\gsl\include\gsl\span ; Line 548 push ebp mov ebp, esp ; Line 565 mov eax, DWORD PTR _idx$[ebp] cmp eax, DWORD PTR _size$[ebp] sbb eax, eax neg eax ; Line 571 pop ebp ret 0 ?CheckRange@?$span@H$0?0@gsl@@CA_NHH@Z ENDP ; gsl::span<int,-1>::CheckRange _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?end@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?end@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::span<int,-1>::end, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 519 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov ecx, DWORD PTR [ecx] mov DWORD PTR [eax+4], ecx ; Line 519 pop ebp ret 4 ?end@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::span<int,-1>::end _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?begin@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 ?begin@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ PROC ; gsl::span<int,-1>::begin, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 518 push ebp mov ebp, esp ; Line 145 mov eax, DWORD PTR ___$ReturnUdt$[ebp] mov DWORD PTR [eax], ecx mov DWORD PTR [eax+4], 0 ; Line 518 pop ebp ret 4 ?begin@?$span@H$0?0@gsl@@QBE?AV?$span_iterator@V?$span@H$0?0@gsl@@$0A@@details@2@XZ ENDP ; gsl::span<int,-1>::begin _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?data@?$span@H$0?0@gsl@@QBEPAHXZ _TEXT SEGMENT ?data@?$span@H$0?0@gsl@@QBEPAHXZ PROC ; gsl::span<int,-1>::data, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 515 mov eax, DWORD PTR [ecx+4] ret 0 ?data@?$span@H$0?0@gsl@@QBEPAHXZ ENDP ; gsl::span<int,-1>::data _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??A?$span@H$0?0@gsl@@QBEAAHH@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _idx$ = 8 ; size = 4 ??A?$span@H$0?0@gsl@@QBEAAHH@Z PROC ; gsl::span<int,-1>::operator[], COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 508 push ebp mov ebp, esp push -1 push __ehhandler$??A?$span@H$0?0@gsl@@QBEAAHH@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov edx, DWORD PTR _idx$[ebp] mov DWORD PTR $T4[ebp], 0 cmp edx, DWORD PTR [ecx] ; Line 509 jae SHORT $LN3@operator ; Line 510 mov eax, DWORD PTR [ecx+4] lea eax, DWORD PTR [eax+edx*4] ; Line 511 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 $LN3@operator: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 509 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN52@operator: $LN51@operator: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??A?$span@H$0?0@gsl@@QBEAAHH@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@operator and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@operator: ret 0 __ehhandler$??A?$span@H$0?0@gsl@@QBEAAHH@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??A?$span@H$0?0@gsl@@QBEAAHH@Z jmp ___CxxFrameHandler3 text$x ENDS ??A?$span@H$0?0@gsl@@QBEAAHH@Z ENDP ; gsl::span<int,-1>::operator[] ; Function compile flags: /Ogtp ; COMDAT ?size@?$span@H$0?0@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$span@H$0?0@gsl@@QBEHXZ PROC ; gsl::span<int,-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 498 mov eax, DWORD PTR [ecx] ret 0 ?size@?$span@H$0?0@gsl@@QBEHXZ ENDP ; gsl::span<int,-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?subspan@?$span@H$0?0@gsl@@QBE?AV12@HH@Z _TEXT SEGMENT $T1 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 _offset$ = 12 ; size = 4 _count$ = 16 ; size = 4 ?subspan@?$span@H$0?0@gsl@@QBE?AV12@HH@Z PROC ; gsl::span<int,-1>::subspan, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 493 push ebp mov ebp, esp push ecx ; Line 494 mov BYTE PTR $T1[ebp], 0 push DWORD PTR $T1[ebp] push DWORD PTR _count$[ebp] push DWORD PTR _offset$[ebp] push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 495 mov esp, ebp pop ebp ret 12 ; 0000000cH ?subspan@?$span@H$0?0@gsl@@QBE?AV12@HH@Z ENDP ; gsl::span<int,-1>::subspan _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?last@?$span@H$0?0@gsl@@QBE?AV12@H@Z _TEXT SEGMENT $T1 = -4 ; size = 1 ___$ReturnUdt$ = 8 ; size = 4 _count$ = 12 ; size = 4 ?last@?$span@H$0?0@gsl@@QBE?AV12@H@Z PROC ; gsl::span<int,-1>::last, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 487 push ebp mov ebp, esp push ecx ; Line 488 mov eax, DWORD PTR [ecx] sub eax, DWORD PTR _count$[ebp] mov BYTE PTR $T1[ebp], 0 push DWORD PTR $T1[ebp] push -1 push eax push DWORD PTR ___$ReturnUdt$[ebp] call ?make_subspan@?$span@H$0?0@gsl@@ABE?AV12@HHV?$subspan_selector@$0?0@12@@Z ; gsl::span<int,-1>::make_subspan mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 489 mov esp, ebp pop ebp ret 8 ?last@?$span@H$0?0@gsl@@QBE?AV12@H@Z ENDP ; gsl::span<int,-1>::last _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$span@H$0?0@gsl@@QAE@PAHH@Z _TEXT SEGMENT _ptr$ = 8 ; size = 4 _count$ = 12 ; size = 4 ??0?$span@H$0?0@gsl@@QAE@PAHH@Z PROC ; gsl::span<int,-1>::span<int,-1>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 386 push ebp mov ebp, esp push esi push DWORD PTR _count$[ebp] mov esi, ecx push DWORD PTR _ptr$[ebp] call ??$?0H@?$storage_type@V?$extent_type@$0?0@details@gsl@@@?$span@H$0?0@gsl@@QAE@PAHH@Z ; gsl::span<int,-1>::storage_type<gsl::details::extent_type<-1> >::storage_type<gsl::details::extent_type<-1> ><int> mov eax, esi pop esi pop ebp ret 8 ??0?$span@H$0?0@gsl@@QAE@PAHH@Z ENDP ; gsl::span<int,-1>::span<int,-1> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _s$ = 8 ; size = 8 _len$ = 16 ; size = 4 ?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z PROC ; test_span_unoptimizable_rangecheck, COMDAT ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 41 push ebp mov ebp, esp push -1 push __ehhandler$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax ; Line 42 mov edi, DWORD PTR _len$[ebp] xor ebx, ebx xor esi, esi mov DWORD PTR $T4[ebp], ebx test edi, edi jle SHORT $LN3@test_span_ $LL4@test_span_: cmp esi, DWORD PTR _s$[ebp] ; File c:\projects\gsl\include\gsl\span ; Line 509 jae SHORT $LN8@test_span_ mov DWORD PTR __$EHRec$[ebp+8], -1 test bl, 1 je SHORT $LN45@test_span_ ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax ; File c:\projects\gsl\include\gsl\span ; Line 509 and ebx, -2 ; fffffffeH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 call DWORD PTR __imp____std_exception_destroy add esp, 4 $LN45@test_span_: ; File c:\projects\gsl\tests\span_compile_only.cpp ; Line 42 mov eax, DWORD PTR _s$[ebp+4] ; Line 44 inc DWORD PTR [eax+esi*4] inc esi cmp esi, edi jl SHORT $LL4@test_span_ $LN3@test_span_: ; Line 46 mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 $LN8@test_span_: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@KHBJKJEH@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 509 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 or ebx, 1 push eax mov DWORD PTR $T4[ebp], ebx call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN62@test_span_: $LN61@test_span_: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN11@test_span_ and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN11@test_span_: ret 0 __ehhandler$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-40] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z jmp ___CxxFrameHandler3 text$x ENDS ?test_span_unoptimizable_rangecheck@@YAXV?$span@H$0?0@gsl@@H@Z ENDP ; test_span_unoptimizable_rangecheck ; Function compile flags: /Ogtp ; COMDAT ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z _TEXT SEGMENT $T1 = -12 ; size = 12 _exception$ = 8 ; size = 4 ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z PROC ; gsl::details::throw_exception<gsl::fail_fast>, COMDAT ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 143 push ebp mov ebp, esp sub esp, 12 ; 0000000cH ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 67 lea eax, DWORD PTR $T1[ebp+4] mov DWORD PTR $T1[ebp], OFFSET ??_7exception@std@@6B@ push eax mov eax, DWORD PTR _exception$[ebp] xorps xmm0, xmm0 add eax, 4 movq QWORD PTR $T1[ebp+4], xmm0 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR $T1[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 144 lea eax, DWORD PTR $T1[ebp] push OFFSET __TI3?AUfail_fast@gsl@@ push eax call __CxxThrowException@8 $LN15@throw_exce: $LN14@throw_exce: int 3 ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ENDP ; gsl::details::throw_exception<gsl::fail_fast> _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?size@?$extent_type@$0?0@details@gsl@@QBEHXZ _TEXT SEGMENT ?size@?$extent_type@$0?0@details@gsl@@QBEHXZ PROC ; gsl::details::extent_type<-1>::size, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 338 mov eax, DWORD PTR [ecx] ret 0 ?size@?$extent_type@$0?0@details@gsl@@QBEHXZ ENDP ; gsl::details::extent_type<-1>::size _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z _TEXT SEGMENT $T2 = -36 ; size = 12 __InitData$3 = -24 ; size = 8 $T4 = -16 ; size = 4 __$EHRec$ = -12 ; size = 12 _size$ = 8 ; size = 4 ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z PROC ; gsl::details::extent_type<-1>::extent_type<-1>, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\span ; Line 336 push ebp mov ebp, esp push -1 push __ehhandler$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z mov eax, DWORD PTR fs:0 push eax sub esp, 24 ; 00000018H mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, eax mov eax, DWORD PTR _size$[ebp] mov DWORD PTR $T4[ebp], 0 mov DWORD PTR [ecx], eax test eax, eax js SHORT $LN3@extent_typ mov eax, ecx mov ecx, DWORD PTR __$EHRec$[ebp] mov DWORD PTR fs:0, ecx pop ecx mov esp, ebp pop ebp ret 4 $LN3@extent_typ: ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 55 lea eax, DWORD PTR $T2[ebp+4] mov DWORD PTR $T2[ebp], OFFSET ??_7exception@std@@6B@ push eax lea eax, DWORD PTR __InitData$3[ebp] mov DWORD PTR __InitData$3[ebp], OFFSET ??_C@_0ED@HKMFEAN@GSL?3?5Precondition?5failure?5at?5C?3?2@ xorps xmm0, xmm0 ; Line 54 mov BYTE PTR __InitData$3[ebp+4], 1 ; Line 55 push eax movq QWORD PTR $T2[ebp+4], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR $T2[ebp], OFFSET ??_7fail_fast@gsl@@6B@ ; File c:\projects\gsl\include\gsl\span ; Line 336 lea eax, DWORD PTR $T2[ebp] mov DWORD PTR __$EHRec$[ebp+8], 0 push eax mov DWORD PTR $T4[ebp], 1 call ??$throw_exception@Ufail_fast@gsl@@@details@gsl@@YAX$$QAUfail_fast@1@@Z ; gsl::details::throw_exception<gsl::fail_fast> $LN24@extent_typ: $LN23@extent_typ: int 3 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __unwindfunclet$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z$0: mov eax, DWORD PTR $T4[ebp] and eax, 1 je $LN6@extent_typ and DWORD PTR $T4[ebp], -2 ; fffffffeH lea ecx, DWORD PTR $T2[ebp] jmp ??1fail_fast@gsl@@UAE@XZ $LN6@extent_typ: ret 0 __ehhandler$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-28] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??0?$extent_type@$0?0@details@gsl@@QAE@H@Z jmp ___CxxFrameHandler3 text$x ENDS ??0?$extent_type@$0?0@details@gsl@@QAE@H@Z ENDP ; gsl::details::extent_type<-1>::extent_type<-1> ; Function compile flags: /Ogtp ; COMDAT ??_Gnarrowing_error@gsl@@UAEPAXI@Z _TEXT SEGMENT ___flags$ = 8 ; size = 4 ??_Gnarrowing_error@gsl@@UAEPAXI@Z PROC ; gsl::narrowing_error::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [esi+4] mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy add esp, 4 test BYTE PTR ___flags$[ebp], 1 je SHORT $LN9@scalar push 12 ; 0000000cH push esi call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN9@scalar: mov eax, esi pop esi pop ebp ret 4 ??_Gnarrowing_error@gsl@@UAEPAXI@Z ENDP ; gsl::narrowing_error::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0narrowing_error@gsl@@QAE@$$QAU01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0narrowing_error@gsl@@QAE@$$QAU01@@Z PROC ; gsl::narrowing_error::narrowing_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7narrowing_error@gsl@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0narrowing_error@gsl@@QAE@$$QAU01@@Z ENDP ; gsl::narrowing_error::narrowing_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0narrowing_error@gsl@@QAE@ABU01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0narrowing_error@gsl@@QAE@ABU01@@Z PROC ; gsl::narrowing_error::narrowing_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7narrowing_error@gsl@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0narrowing_error@gsl@@QAE@ABU01@@Z ENDP ; gsl::narrowing_error::narrowing_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??1narrowing_error@gsl@@UAE@XZ _TEXT SEGMENT ??1narrowing_error@gsl@@UAE@XZ PROC ; gsl::narrowing_error::~narrowing_error, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [ecx+4] mov DWORD PTR [ecx], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy pop ecx ret 0 ??1narrowing_error@gsl@@UAE@XZ ENDP ; gsl::narrowing_error::~narrowing_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0narrowing_error@gsl@@QAE@XZ _TEXT SEGMENT ??0narrowing_error@gsl@@QAE@XZ PROC ; gsl::narrowing_error::narrowing_error, COMDAT ; _this$ = ecx xorps xmm0, xmm0 mov eax, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 47 movq QWORD PTR [ecx+4], xmm0 mov DWORD PTR [ecx], OFFSET ??_7narrowing_error@gsl@@6B@ ret 0 ??0narrowing_error@gsl@@QAE@XZ ENDP ; gsl::narrowing_error::narrowing_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??_Gfail_fast@gsl@@UAEPAXI@Z _TEXT SEGMENT ___flags$ = 8 ; size = 4 ??_Gfail_fast@gsl@@UAEPAXI@Z PROC ; gsl::fail_fast::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [esi+4] mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy add esp, 4 test BYTE PTR ___flags$[ebp], 1 je SHORT $LN12@scalar push 12 ; 0000000cH push esi call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN12@scalar: mov eax, esi pop esi pop ebp ret 4 ??_Gfail_fast@gsl@@UAEPAXI@Z ENDP ; gsl::fail_fast::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0fail_fast@gsl@@QAE@$$QAU01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0fail_fast@gsl@@QAE@$$QAU01@@Z PROC ; gsl::fail_fast::fail_fast, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7fail_fast@gsl@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0fail_fast@gsl@@QAE@$$QAU01@@Z ENDP ; gsl::fail_fast::fail_fast _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0fail_fast@gsl@@QAE@ABU01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0fail_fast@gsl@@QAE@ABU01@@Z PROC ; gsl::fail_fast::fail_fast, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7fail_fast@gsl@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0fail_fast@gsl@@QAE@ABU01@@Z ENDP ; gsl::fail_fast::fail_fast _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??1fail_fast@gsl@@UAE@XZ _TEXT SEGMENT ??1fail_fast@gsl@@UAE@XZ PROC ; gsl::fail_fast::~fail_fast, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [ecx+4] mov DWORD PTR [ecx], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy pop ecx ret 0 ??1fail_fast@gsl@@UAE@XZ ENDP ; gsl::fail_fast::~fail_fast _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0fail_fast@gsl@@QAE@QBD@Z _TEXT SEGMENT __InitData$1 = -8 ; size = 8 _this$ = -4 ; size = 4 _message$ = 8 ; size = 4 ??0fail_fast@gsl@@QAE@QBD@Z PROC ; gsl::fail_fast::fail_fast, COMDAT ; _this$ = ecx ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 push ebp mov ebp, esp sub esp, 8 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 54 mov eax, DWORD PTR _message$[ebp] xorps xmm0, xmm0 push esi ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov esi, ecx mov DWORD PTR _this$[ebp], esi ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 52 lea edx, DWORD PTR [esi+4] ; Line 54 mov DWORD PTR __InitData$1[ebp], eax ; Line 55 lea eax, DWORD PTR __InitData$1[ebp] push edx mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax movq QWORD PTR [edx], xmm0 mov BYTE PTR __InitData$1[ebp+4], 1 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\projects\gsl\include\gsl\gsl_assert ; Line 99 mov DWORD PTR [esi], OFFSET ??_7fail_fast@gsl@@6B@ mov eax, esi pop esi mov esp, ebp pop ebp ret 4 ??0fail_fast@gsl@@QAE@QBD@Z ENDP ; gsl::fail_fast::fail_fast _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??_Glogic_error@std@@UAEPAXI@Z _TEXT SEGMENT ___flags$ = 8 ; size = 4 ??_Glogic_error@std@@UAEPAXI@Z PROC ; std::logic_error::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [esi+4] mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy add esp, 4 test BYTE PTR ___flags$[ebp], 1 je SHORT $LN9@scalar push 12 ; 0000000cH push esi call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN9@scalar: mov eax, esi pop esi pop ebp ret 4 ??_Glogic_error@std@@UAEPAXI@Z ENDP ; std::logic_error::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0logic_error@std@@QAE@$$QAV01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0logic_error@std@@QAE@$$QAV01@@Z PROC ; std::logic_error::logic_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7logic_error@std@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0logic_error@std@@QAE@$$QAV01@@Z ENDP ; std::logic_error::logic_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0logic_error@std@@QAE@ABV01@@Z _TEXT SEGMENT ___that$ = 8 ; size = 4 ??0logic_error@std@@QAE@ABV01@@Z PROC ; std::logic_error::logic_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 65 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR ___that$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 mov DWORD PTR [esi], OFFSET ??_7logic_error@std@@6B@ mov eax, esi pop esi pop ebp ret 4 ??0logic_error@std@@QAE@ABV01@@Z ENDP ; std::logic_error::logic_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??1logic_error@std@@UAE@XZ _TEXT SEGMENT ??1logic_error@std@@UAE@XZ PROC ; std::logic_error::~logic_error, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [ecx+4] mov DWORD PTR [ecx], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy pop ecx ret 0 ??1logic_error@std@@UAE@XZ ENDP ; std::logic_error::~logic_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0logic_error@std@@QAE@PBD@Z _TEXT SEGMENT __InitData$1 = -8 ; size = 8 _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 ??0logic_error@std@@QAE@PBD@Z PROC ; std::logic_error::logic_error, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdexcept ; Line 28 push ebp mov ebp, esp sub esp, 8 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 54 mov eax, DWORD PTR __Message$[ebp] xorps xmm0, xmm0 push esi ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdexcept ; Line 28 mov esi, ecx mov DWORD PTR _this$[ebp], esi ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 52 lea edx, DWORD PTR [esi+4] ; Line 54 mov DWORD PTR __InitData$1[ebp], eax ; Line 55 lea eax, DWORD PTR __InitData$1[ebp] push edx mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax movq QWORD PTR [edx], xmm0 mov BYTE PTR __InitData$1[ebp+4], 1 call DWORD PTR __imp____std_exception_copy add esp, 8 ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\stdexcept ; Line 28 mov DWORD PTR [esi], OFFSET ??_7logic_error@std@@6B@ ; Line 29 mov eax, esi pop esi mov esp, ebp pop ebp ret 4 ??0logic_error@std@@QAE@PBD@Z ENDP ; std::logic_error::logic_error _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??_Gexception@std@@UAEPAXI@Z _TEXT SEGMENT ___flags$ = 8 ; size = 4 ??_Gexception@std@@UAEPAXI@Z PROC ; std::exception::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push esi mov esi, ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [esi+4] mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy add esp, 4 test BYTE PTR ___flags$[ebp], 1 je SHORT $LN6@scalar push 12 ; 0000000cH push esi call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN6@scalar: mov eax, esi pop esi pop ebp ret 4 ??_Gexception@std@@UAEPAXI@Z ENDP ; std::exception::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ?what@exception@std@@UBEPBDXZ _TEXT SEGMENT ?what@exception@std@@UBEPBDXZ PROC ; std::exception::what, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 89 mov ecx, DWORD PTR [ecx+4] mov eax, OFFSET ??_C@_0BC@EOODALEL@Unknown?5exception?$AA@ test ecx, ecx cmovne eax, ecx ; Line 90 ret 0 ?what@exception@std@@UBEPBDXZ ENDP ; std::exception::what _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??1exception@std@@UAE@XZ _TEXT SEGMENT ??1exception@std@@UAE@XZ PROC ; std::exception::~exception, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 84 lea eax, DWORD PTR [ecx+4] mov DWORD PTR [ecx], OFFSET ??_7exception@std@@6B@ push eax call DWORD PTR __imp____std_exception_destroy pop ecx ; Line 85 ret 0 ??1exception@std@@UAE@XZ ENDP ; std::exception::~exception _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0exception@std@@QAE@ABV01@@Z _TEXT SEGMENT __Other$ = 8 ; size = 4 ??0exception@std@@QAE@ABV01@@Z PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 66 push ebp mov ebp, esp push esi mov esi, ecx xorps xmm0, xmm0 lea eax, DWORD PTR [esi+4] ; Line 67 push eax mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [eax], xmm0 mov eax, DWORD PTR __Other$[ebp] add eax, 4 push eax call DWORD PTR __imp____std_exception_copy add esp, 8 ; Line 68 mov eax, esi pop esi pop ebp ret 4 ??0exception@std@@QAE@ABV01@@Z ENDP ; std::exception::exception _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0exception@std@@QAE@QBD@Z _TEXT SEGMENT __InitData$ = -8 ; size = 8 __Message$ = 8 ; size = 4 ??0exception@std@@QAE@QBD@Z PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 53 push ebp mov ebp, esp sub esp, 8 ; Line 54 mov eax, DWORD PTR __Message$[ebp] xorps xmm0, xmm0 push esi mov esi, ecx mov DWORD PTR __InitData$[ebp], eax lea edx, DWORD PTR [esi+4] mov BYTE PTR __InitData$[ebp+4], 1 ; Line 55 push edx lea eax, DWORD PTR __InitData$[ebp] mov DWORD PTR [esi], OFFSET ??_7exception@std@@6B@ push eax movq QWORD PTR [edx], xmm0 call DWORD PTR __imp____std_exception_copy add esp, 8 ; Line 56 mov eax, esi pop esi mov esp, ebp pop ebp ret 4 ??0exception@std@@QAE@QBD@Z ENDP ; std::exception::exception _TEXT ENDS ; Function compile flags: /Ogtp ; COMDAT ??0exception@std@@QAE@XZ _TEXT SEGMENT ??0exception@std@@QAE@XZ PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h ; Line 48 xorps xmm0, xmm0 mov DWORD PTR [ecx], OFFSET ??_7exception@std@@6B@ movq QWORD PTR [ecx+4], xmm0 ; Line 49 mov eax, ecx ret 0 ??0exception@std@@QAE@XZ ENDP ; std::exception::exception _TEXT ENDS END
/*============================================================================== Copyright (c) Laboratory for Percutaneous Surgery (PerkLab) Queen's University, Kingston, ON, Canada. All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. 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. This file was originally developed by Adam Rankin and Csaba Pinter, PerkLab, Queen's University and was supported through the Applied Cancer Research Unit program of Cancer Care Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care ==============================================================================*/ // Segmentations includes #include "vtkMRMLSegmentationStorageNode.h" #include "vtkSegmentation.h" #include "vtkOrientedImageData.h" #include "vtkOrientedImageDataResample.h" // MRML includes #include <vtkMRMLScalarVolumeNode.h> #include <vtkMRMLScene.h> #include "vtkMRMLSegmentationNode.h" #include "vtkMRMLSegmentationDisplayNode.h" // VTK includes #include <vtkDataObject.h> #include <vtkDoubleArray.h> #include <vtkErrorCode.h> #include <vtkFieldData.h> #include <vtkImageAccumulate.h> #include <vtkImageAppendComponents.h> #include <vtkImageCast.h> #include <vtkImageConstantPad.h> #include <vtkImageExtractComponents.h> #include <vtkInformation.h> #include <vtkInformationIntegerVectorKey.h> #include <vtkInformationStringKey.h> #include <vtkITKArchetypeImageSeriesVectorReaderFile.h> #include <vtkMultiBlockDataSet.h> #include <vtkNew.h> #include <vtkTeemNRRDWriter.h> #include <vtkObjectFactory.h> #include <vtkPointData.h> #include <vtkPolyData.h> #include <vtkStringArray.h> #include <vtkTransform.h> #include <vtkXMLMultiBlockDataWriter.h> #include <vtkXMLMultiBlockDataReader.h> #include <vtksys/SystemTools.hxx> #ifdef SUPPORT_4D_SPATIAL_NRRD // ITK includes #include <itkMacro.h> #include <itkImageFileWriter.h> #include <itkImageFileReader.h> #include <itkMetaDataDictionary.h> #include <itkMetaDataObject.h> #include <itkNrrdImageIO.h> #endif // STL & C++ includes #include <iterator> #include <sstream> //---------------------------------------------------------------------------- static const std::string SERIALIZATION_SEPARATOR = "|"; static const std::string KEY_SEGMENT_ID = "ID"; static const std::string KEY_SEGMENT_NAME = "Name"; static const std::string KEY_SEGMENT_COLOR = "Color"; static const std::string KEY_SEGMENT_TAGS = "Tags"; static const std::string KEY_SEGMENT_EXTENT = "Extent"; static const std::string KEY_SEGMENT_LABEL_VALUE = "LabelValue"; static const std::string KEY_SEGMENT_LAYER = "Layer"; static const std::string KEY_SEGMENT_NAME_AUTO_GENERATED = "NameAutoGenerated"; static const std::string KEY_SEGMENT_COLOR_AUTO_GENERATED = "ColorAutoGenerated"; static const std::string KEY_SEGMENTATION_MASTER_REPRESENTATION = "MasterRepresentation"; static const std::string KEY_SEGMENTATION_CONVERSION_PARAMETERS = "ConversionParameters"; static const std::string KEY_SEGMENTATION_EXTENT = "Extent"; // Deprecated, kept only for being able to read legacy files. static const std::string KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET = "ReferenceImageExtentOffset"; static const std::string KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES = "ContainedRepresentationNames"; static const int SINGLE_SEGMENT_INDEX = -1; // used as segment index when there is only a single segment //---------------------------------------------------------------------------- vtkMRMLNodeNewMacro(vtkMRMLSegmentationStorageNode); //---------------------------------------------------------------------------- vtkMRMLSegmentationStorageNode::vtkMRMLSegmentationStorageNode() = default; //---------------------------------------------------------------------------- vtkMRMLSegmentationStorageNode::~vtkMRMLSegmentationStorageNode() = default; //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::PrintSelf(ostream& os, vtkIndent indent) { Superclass::PrintSelf(os,indent); vtkMRMLPrintBeginMacro(os, indent); vtkMRMLPrintBooleanMacro(CropToMinimumExtent); vtkMRMLPrintEndMacro(); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::ReadXMLAttributes(const char** atts) { MRMLNodeModifyBlocker blocker(this); Superclass::ReadXMLAttributes(atts); vtkMRMLReadXMLBeginMacro(atts); vtkMRMLReadXMLBooleanMacro(CropToMinimumExtent, CropToMinimumExtent); vtkMRMLReadXMLEndMacro(); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::WriteXML(ostream& of, int nIndent) { Superclass::WriteXML(of, nIndent); vtkMRMLWriteXMLBeginMacro(of); vtkMRMLWriteXMLBooleanMacro(CropToMinimumExtent, CropToMinimumExtent); vtkMRMLWriteXMLEndMacro(); } //---------------------------------------------------------------------------- // Copy the node's attributes to this object. // Does NOT copy: ID, FilePrefix, Name, StorageID void vtkMRMLSegmentationStorageNode::Copy(vtkMRMLNode *anode) { MRMLNodeModifyBlocker blocker(anode); Superclass::Copy(anode); vtkMRMLCopyBeginMacro(anode); vtkMRMLCopyBooleanMacro(CropToMinimumExtent); vtkMRMLCopyEndMacro(); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::InitializeSupportedReadFileTypes() { this->SupportedReadFileTypes->InsertNextValue("Segmentation (.seg.nrrd)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.seg.vtm)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.nrrd)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.vtm)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.nii.gz)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.hdr)"); this->SupportedReadFileTypes->InsertNextValue("Segmentation (.nii)"); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::InitializeSupportedWriteFileTypes() { Superclass::InitializeSupportedWriteFileTypes(); vtkMRMLSegmentationNode* segmentationNode = this->GetAssociatedDataNode(); bool masterIsImage = true; bool masterIsPolyData = true; if (segmentationNode) { // restrict write file types to those that are suitable for current master representation masterIsImage = segmentationNode->GetSegmentation()->IsMasterRepresentationImageData(); masterIsPolyData = segmentationNode->GetSegmentation()->IsMasterRepresentationPolyData(); if (!masterIsImage && !masterIsPolyData) { // if contains unknown representation then enable all formats masterIsImage = true; masterIsPolyData = true; } } if (masterIsImage) { this->SupportedWriteFileTypes->InsertNextValue("Segmentation (.seg.nrrd)"); this->SupportedWriteFileTypes->InsertNextValue("Segmentation (.nrrd)"); } if (masterIsPolyData) { this->SupportedWriteFileTypes->InsertNextValue("Segmentation (.seg.vtm)"); this->SupportedWriteFileTypes->InsertNextValue("Segmentation (.vtm)"); } } //---------------------------------------------------------------------------- vtkMRMLSegmentationNode* vtkMRMLSegmentationStorageNode::GetAssociatedDataNode() { if (!this->GetScene()) { return nullptr; } std::vector<vtkMRMLNode*> segmentationNodes; unsigned int numberOfNodes = this->GetScene()->GetNodesByClass("vtkMRMLSegmentationNode", segmentationNodes); for (unsigned int nodeIndex=0; nodeIndex<numberOfNodes; nodeIndex++) { vtkMRMLSegmentationNode* node = vtkMRMLSegmentationNode::SafeDownCast(segmentationNodes[nodeIndex]); if (node) { const char* storageNodeID = node->GetStorageNodeID(); if (storageNodeID && !strcmp(storageNodeID, this->ID)) { return vtkMRMLSegmentationNode::SafeDownCast(node); } } } return nullptr; } //---------------------------------------------------------------------------- const char* vtkMRMLSegmentationStorageNode::GetDefaultWriteFileExtension() { vtkMRMLSegmentationNode* segmentationNode = this->GetAssociatedDataNode(); if (!segmentationNode) { return nullptr; } if (segmentationNode->GetSegmentation()->IsMasterRepresentationImageData()) { return "seg.nrrd"; } else if (segmentationNode->GetSegmentation()->IsMasterRepresentationPolyData()) { return "seg.vtm"; } // Master representation is not supported for writing to file return nullptr; } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::ResetSupportedWriteFileTypes() { this->InitializeSupportedWriteFileTypes(); } //---------------------------------------------------------------------------- bool vtkMRMLSegmentationStorageNode::CanReadInReferenceNode(vtkMRMLNode *refNode) { return refNode->IsA("vtkMRMLSegmentationNode"); } //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::ReadDataInternal(vtkMRMLNode *refNode) { vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast(refNode); if (!segmentationNode) { vtkErrorMacro("ReadDataInternal: Reference node is not a segmentation node"); return 0; } MRMLNodeModifyBlocker blocker(segmentationNode); std::string fullName = this->GetFullNameFromFileName(); if (fullName.empty()) { vtkErrorMacro("ReadDataInternal: File name not specified"); return 0; } // Check that the file exists if (vtksys::SystemTools::FileExists(fullName.c_str()) == false) { vtkErrorMacro("ReadDataInternal: segmentation file '" << fullName.c_str() << "' not found."); return 0; } bool success = false; // Try to read as labelmap first then as poly data if (this->ReadBinaryLabelmapRepresentation(segmentationNode, fullName)) { success = true; } #ifdef SUPPORT_4D_SPATIAL_NRRD else if (this->ReadBinaryLabelmapRepresentation4DSpatial(segmentationNode, fullName)) { success = true; } #endif else if (this->ReadPolyDataRepresentation(segmentationNode, fullName)) { success = true; } // Create display node if segmentation there is none if (success && !segmentationNode->GetDisplayNode()) { segmentationNode->CreateDefaultDisplayNodes(); } if (!success) { // Failed to read vtkErrorMacro("ReadDataInternal: File " << fullName << " could not be read neither as labelmap nor poly data"); return 0; } return 1; } #ifdef SUPPORT_4D_SPATIAL_NRRD //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::ReadBinaryLabelmapRepresentation4DSpatial(vtkMRMLSegmentationNode* segmentationNode, std::string path) { if (!vtksys::SystemTools::FileExists(path.c_str())) { vtkErrorMacro("ReadBinaryLabelmapRepresentation: Input file " << path << " does not exist!"); return 0; } // Set up output segmentation if (!segmentationNode || segmentationNode->GetSegmentation()->GetNumberOfSegments() > 0) { vtkErrorMacro("ReadBinaryLabelmapRepresentation: Output segmentation must exist and must be empty!"); return 0; } vtkSegmentation* segmentation = segmentationNode->GetSegmentation(); // Read 4D NRRD image file typedef itk::ImageFileReader<BinaryLabelmap4DImageType> FileReaderType; FileReaderType::Pointer reader = FileReaderType::New(); reader->SetFileName(path); try { reader->Update(); } catch (itk::ImageFileReaderException &error) { // Do not report error as the file might contain poly data in which case ReadPolyDataRepresentation will read it alright vtkDebugMacro("ReadBinaryLabelmapRepresentation: Failed to load file " << path << " as segmentation. Exception:\n" << error); return 0; } BinaryLabelmap4DImageType::Pointer allSegmentLabelmapsImage = reader->GetOutput(); // Read succeeded, set master representation segmentation->SetMasterRepresentationName(vtkSegmentationConverter::GetSegmentationBinaryLabelmapRepresentationName()); // Get metadata dictionary from image itk::MetaDataDictionary metadata = allSegmentLabelmapsImage->GetMetaDataDictionary(); // Read common geometry extent std::string commonExtent; itk::ExposeMetaData<std::string>(metadata, GetSegmentationMetaDataKey(KEY_SEGMENTATION_EXTENT).c_str(), commonExtent); int commonGeometryExtent[6] = {0,-1,0,-1,0,-1}; GetImageExtentFromString(commonGeometryExtent, commonExtent); // Read conversion parameters std::string conversionParameters; itk::ExposeMetaData<std::string>(metadata, GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONVERSION_PARAMETERS).c_str(), conversionParameters); segmentation->DeserializeConversionParameters(conversionParameters); // Read contained representation names std::string containedRepresentationNames; itk::ExposeMetaData<std::string>(metadata, GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES).c_str(), containedRepresentationNames); // Get image properties BinaryLabelmap4DImageType::RegionType itkRegion = allSegmentLabelmapsImage->GetLargestPossibleRegion(); BinaryLabelmap4DImageType::PointType itkOrigin = allSegmentLabelmapsImage->GetOrigin(); BinaryLabelmap4DImageType::SpacingType itkSpacing = allSegmentLabelmapsImage->GetSpacing(); BinaryLabelmap4DImageType::DirectionType itkDirections = allSegmentLabelmapsImage->GetDirection(); // Make image properties accessible for VTK double origin[3] = {itkOrigin[0], itkOrigin[1], itkOrigin[2]}; double spacing[3] = {itkSpacing[0], itkSpacing[1], itkSpacing[2]}; double directions[3][3] = {{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}}; for (unsigned int col=0; col<3; col++) { for (unsigned int row=0; row<3; row++) { directions[row][col] = itkDirections[row][col]; } } // Read segment binary labelmaps for (unsigned int segmentIndex = itkRegion.GetIndex()[3]; segmentIndex < itkRegion.GetIndex()[3]+itkRegion.GetSize()[3]; ++segmentIndex) { // Create segment vtkSmartPointer<vtkSegment> currentSegment = vtkSmartPointer<vtkSegment>::New(); // Get metadata for current segment // ID std::string currentSegmentID; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_ID), currentSegmentID); // Name std::string currentSegmentName; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_NAME), currentSegmentName); currentSegment->SetName(currentSegmentName.c_str()); // Color std::string colorString; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_COLOR), colorString); if (colorString.empty()) { // Backwards compatibility itk::ExposeMetaData<std::string>(metadata, GetSegmentMetaDataKey(segmentIndex, "DefaultColor"), colorString); } double currentSegmentColor[3] = {0.0,0.0,0.0}; GetSegmentColorFromString(currentSegmentColor, colorString); // Extent std::string extentValue; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_EXTENT), extentValue); int currentSegmentExtent[6] = {0,-1,0,-1,0,-1}; GetImageExtentFromString(currentSegmentExtent, extentValue); // Tags std::string tagsValue; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_TAGS), tagsValue); SetSegmentTagsFromString(currentSegment, tagsValue); // NameAutoGenerated std::string currentSegmentNameAutoGenerated; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_NAME_AUTO_GENERATED), currentSegmentNameAutoGenerated); currentSegment->SetNameAutoGenerated(!currentSegmentNameAutoGenerated.compare("1")); // ColorAutoGenerated std::string currentSegmentColorAutoGenerated; itk::ExposeMetaData<std::string>( metadata, GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_COLOR_AUTO_GENERATED), currentSegmentColorAutoGenerated); currentSegment->SetColorAutoGenerated(!currentSegmentColorAutoGenerated.compare("1")); // Create binary labelmap volume vtkSmartPointer<vtkOrientedImageData> currentBinaryLabelmap = vtkSmartPointer<vtkOrientedImageData>::New(); currentBinaryLabelmap->SetOrigin(origin); currentBinaryLabelmap->SetSpacing(spacing); currentBinaryLabelmap->SetDirections(directions); currentBinaryLabelmap->SetExtent(currentSegmentExtent); currentBinaryLabelmap->AllocateScalars(VTK_UNSIGNED_CHAR, 1); unsigned char* labelmapPtr = (unsigned char*)currentBinaryLabelmap->GetScalarPointerForExtent(currentSegmentExtent); // Define ITK region for current segment BinaryLabelmap4DImageType::RegionType segmentRegion; BinaryLabelmap4DImageType::SizeType segmentRegionSize; BinaryLabelmap4DImageType::IndexType segmentRegionIndex; segmentRegionIndex[0] = segmentRegionIndex[1] = segmentRegionIndex[2] = 0; segmentRegionIndex[3] = segmentIndex; segmentRegionSize = itkRegion.GetSize(); segmentRegionSize[3] = 1; segmentRegion.SetIndex(segmentRegionIndex); segmentRegion.SetSize(segmentRegionSize); // Iterate through current segment's region and read voxel values into segment labelmap BinaryLabelmap4DIteratorType segmentLabelmapIterator(allSegmentLabelmapsImage, segmentRegion); for (segmentLabelmapIterator.GoToBegin(); !segmentLabelmapIterator.IsAtEnd(); ++segmentLabelmapIterator) { // Skip region outside extent of current segment (consider common extent boundaries) BinaryLabelmap4DImageType::IndexType segmentIndex = segmentLabelmapIterator.GetIndex(); if ( segmentIndex[0] + commonGeometryExtent[0] < currentSegmentExtent[0] || segmentIndex[0] + commonGeometryExtent[0] > currentSegmentExtent[1] || segmentIndex[1] + commonGeometryExtent[2] < currentSegmentExtent[2] || segmentIndex[1] + commonGeometryExtent[2] > currentSegmentExtent[3] || segmentIndex[2] + commonGeometryExtent[4] < currentSegmentExtent[4] || segmentIndex[2] + commonGeometryExtent[4] > currentSegmentExtent[5] ) { continue; } // Get voxel value unsigned char voxelValue = segmentLabelmapIterator.Get(); // Set voxel value in current segment labelmap (*labelmapPtr) = voxelValue; ++labelmapPtr; } // Set loaded binary labelmap to segment currentSegment->AddRepresentation(vtkSegmentationConverter::GetSegmentationBinaryLabelmapRepresentationName(), currentBinaryLabelmap); // Add segment to segmentation segmentation->AddSegment(currentSegment, currentSegmentID); } // Create contained representations now that all the data is loaded this->CreateRepresentationsBySerializedNames(segmentation, containedRepresentationNames); return 1; } #endif // SUPPORT_4D_SPATIAL_NRRD //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::ReadBinaryLabelmapRepresentation(vtkMRMLSegmentationNode* segmentationNode, std::string path) { if (!vtksys::SystemTools::FileExists(path.c_str())) { vtkErrorMacro("ReadBinaryLabelmapRepresentation: Input file " << path << " does not exist!"); return 0; } // Set up output segmentation if (!segmentationNode || segmentationNode->GetSegmentation()->GetNumberOfSegments() > 0) { vtkErrorMacro("ReadBinaryLabelmapRepresentation: Output segmentation must exist and must be empty!"); return 0; } vtkSegmentation* segmentation = segmentationNode->GetSegmentation(); vtkSmartPointer<vtkImageData> imageData = nullptr; vtkNew<vtkITKArchetypeImageSeriesVectorReaderFile> archetypeImageReader; archetypeImageReader->SetSingleFile(1); archetypeImageReader->SetUseOrientationFromFile(1); archetypeImageReader->ResetFileNames(); archetypeImageReader->SetArchetype(path.c_str()); archetypeImageReader->SetOutputScalarTypeToNative(); archetypeImageReader->SetDesiredCoordinateOrientationToNative(); archetypeImageReader->SetUseNativeOriginOn(); int numberOfSegments = 0; std::map<int, std::vector<int> > segmentIndexInLayer; std::string containedRepresentationNames; vtkMatrix4x4* rasToFileIjk = nullptr; int imageExtentInFile[6] = { 0, -1, 0, -1, 0, -1 }; int commonGeometryExtent[6] = { 0, -1, 0, -1, 0, -1 }; int referenceImageExtentOffset[3] = { 0, 0, 0 }; if (archetypeImageReader->CanReadFile(path.c_str())) { // Read the volume archetypeImageReader->Update(); if (archetypeImageReader->GetErrorCode() != vtkErrorCode::NoError) { vtkErrorMacro("ReadBinaryLabelmapRepresentation: Error reading image!"); return 0; } // Copy image data to sequence of volume nodes imageData = archetypeImageReader->GetOutput(); rasToFileIjk = archetypeImageReader->GetRasToIjkMatrix(); imageData->GetExtent(imageExtentInFile); imageData->GetExtent(commonGeometryExtent); // Get metadata dictionary from image itk::MetaDataDictionary dictionary = archetypeImageReader->GetMetaDataDictionary(); std::string segmentationExtentString; if (this->GetSegmentationMetaDataFromDicitionary(segmentationExtentString, dictionary, KEY_SEGMENTATION_EXTENT)) { // Legacy format. Return and read using ReadBinaryLabelmapRepresentation4DSpatial if availiable. return 0; } // Read common geometry std::string referenceImageExtentOffsetStr; if (this->GetSegmentationMetaDataFromDicitionary(referenceImageExtentOffsetStr, dictionary, KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET)) { // Common geometry extent is specified by an offset (extent[0], extent[2], extent[4]) and the size of the image // NRRD file cannot store start extent, so we store that in KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET and from imageExtentInFile we // only use the extent size. std::stringstream ssExtentValue(referenceImageExtentOffsetStr); ssExtentValue >> referenceImageExtentOffset[0] >> referenceImageExtentOffset[1] >> referenceImageExtentOffset[2]; commonGeometryExtent[0] = referenceImageExtentOffset[0]; commonGeometryExtent[1] = referenceImageExtentOffset[0] + imageExtentInFile[1] - imageExtentInFile[0]; commonGeometryExtent[2] = referenceImageExtentOffset[1]; commonGeometryExtent[3] = referenceImageExtentOffset[1] + imageExtentInFile[3] - imageExtentInFile[2]; commonGeometryExtent[4] = referenceImageExtentOffset[2]; commonGeometryExtent[5] = referenceImageExtentOffset[2] + imageExtentInFile[5] - imageExtentInFile[4]; } else { // KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET is not specified, // which means that this is probably a regular NRRD file that should be imported as a segmentation. // Use the image extent as common geometry extent. vtkInfoMacro(<< KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET << " attribute was not found in NRRD segmentation file. Assume no offset."); imageData->GetExtent(commonGeometryExtent); } // Read conversion parameters std::string conversionParameters; if (this->GetSegmentationMetaDataFromDicitionary(conversionParameters, dictionary, KEY_SEGMENTATION_CONVERSION_PARAMETERS)) { segmentation->DeserializeConversionParameters(conversionParameters); } // Read contained representation names this->GetSegmentationMetaDataFromDicitionary(containedRepresentationNames, dictionary, KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES); // Read contained segment layer numbers while (dictionary.HasKey(GetSegmentMetaDataKey(numberOfSegments, KEY_SEGMENT_ID))) { int segmentIndex = numberOfSegments; std::string layerValue; if (this->GetSegmentMetaDataFromDicitionary(layerValue, dictionary, segmentIndex, KEY_SEGMENT_LAYER)) { segmentIndexInLayer[vtkVariant(layerValue).ToInt()].push_back(segmentIndex); } else { segmentIndexInLayer[segmentIndex].push_back(segmentIndex); } ++numberOfSegments; } } else { vtkDebugMacro("ReadBinaryLabelmapRepresentation: File is not using a supported format!"); return 0; } if (imageData == nullptr) { vtkErrorMacro("vtkMRMLVolumeSequenceStorageNode::ReadDataInternal: invalid image data"); return 0; } int numberOfFrames = imageData->GetNumberOfScalarComponents(); // Read succeeded, set master representation segmentation->SetMasterRepresentationName(vtkSegmentationConverter::GetSegmentationBinaryLabelmapRepresentationName()); MRMLNodeModifyBlocker blocker(segmentationNode); // Compensate for the extent shift in the image origin. // We change the origin so that if a reader ignores private fields, such as // referenceImageExtentOffset, the image is placed correctly in physical coordinate system. vtkNew<vtkMatrix4x4> fileIjkToIjk; fileIjkToIjk->SetElement(0, 3, referenceImageExtentOffset[0]); fileIjkToIjk->SetElement(1, 3, referenceImageExtentOffset[1]); fileIjkToIjk->SetElement(2, 3, referenceImageExtentOffset[2]); vtkNew<vtkMatrix4x4> rasToIjk; vtkMatrix4x4::Multiply4x4(fileIjkToIjk.GetPointer(), rasToFileIjk, rasToIjk.GetPointer()); vtkNew<vtkMatrix4x4> imageToWorldMatrix; // = ijkToRas; vtkMatrix4x4::Invert(rasToIjk.GetPointer(), imageToWorldMatrix.GetPointer()); imageData->SetExtent(commonGeometryExtent); vtkNew<vtkImageExtractComponents> extractComponents; extractComponents->SetInputData(imageData); vtkNew<vtkImageConstantPad> padder; padder->SetInputConnection(extractComponents->GetOutputPort()); // Get metadata for current segment itk::MetaDataDictionary dictionary = archetypeImageReader->GetMetaDataDictionary(); std::vector<vtkSmartPointer<vtkSegment> > segments(numberOfSegments); std::map<int, vtkSmartPointer<vtkOrientedImageData> > layerToImage; for (int frameIndex = 0; frameIndex < numberOfFrames; ++frameIndex) { // Create binary labelmap volume vtkSmartPointer<vtkOrientedImageData> currentBinaryLabelmap = nullptr; if (numberOfSegments == 0) { currentBinaryLabelmap = vtkSmartPointer<vtkOrientedImageData>::New(); extractComponents->SetComponents(frameIndex); padder->SetOutputWholeExtent(imageExtentInFile); padder->Update(); currentBinaryLabelmap->ShallowCopy(padder->GetOutput()); double scalarRange[2] = { 0 }; currentBinaryLabelmap->GetScalarRange(scalarRange); vtkIdType lowLabel = (vtkIdType)(floor(scalarRange[0])); vtkIdType highLabel = (vtkIdType)(ceil(scalarRange[1])); vtkSmartPointer<vtkImageAccumulate> imageAccumulate = vtkSmartPointer<vtkImageAccumulate>::New(); imageAccumulate->SetInputData(currentBinaryLabelmap); imageAccumulate->IgnoreZeroOn(); // Ignore background value imageAccumulate->SetComponentExtent(lowLabel, highLabel, 0, 0, 0, 0); imageAccumulate->SetComponentOrigin(0, 0, 0); imageAccumulate->SetComponentSpacing(1, 1, 1); imageAccumulate->Update(); std::vector<vtkIdType> labelValues; for (vtkIdType labelValue = lowLabel; labelValue <= highLabel; ++labelValue) { if (labelValue == 0) { continue; } double frequency = imageAccumulate->GetOutput()->GetPointData()->GetScalars()->GetTuple1(labelValue - lowLabel); if (frequency == 0.0) { continue; } vtkSmartPointer<vtkSegment> currentSegment = vtkSmartPointer<vtkSegment>::New(); currentSegment->SetLabelValue(labelValue); currentBinaryLabelmap->SetImageToWorldMatrix(imageToWorldMatrix.GetPointer()); currentSegment->AddRepresentation(vtkSegmentationConverter::GetBinaryLabelmapRepresentationName(), currentBinaryLabelmap); segments.push_back(currentSegment); } } else { for (int segmentIndex : segmentIndexInLayer[frameIndex]) { // Create segment vtkSmartPointer<vtkSegment> currentSegment = vtkSmartPointer<vtkSegment>::New(); std::string segmentColor; if (this->GetSegmentMetaDataFromDicitionary(segmentColor, dictionary, segmentIndex, KEY_SEGMENT_COLOR)) { double currentSegmentColor[3] = { 0.0, 0.0, 0.0 }; this->GetSegmentColorFromString(currentSegmentColor, segmentColor); currentSegment->SetColor(currentSegmentColor); } else if (this->GetSegmentMetaDataFromDicitionary(segmentColor, dictionary, segmentIndex, "DefaultColor")) { double defaultSegmentColor[3] = { 0.0, 0.0, 0.0 }; this->GetSegmentColorFromString(defaultSegmentColor, segmentColor); currentSegment->SetColor(defaultSegmentColor); } // Tags std::string segmentTags; if (this->GetSegmentMetaDataFromDicitionary(segmentTags, dictionary, segmentIndex, KEY_SEGMENT_TAGS)) { this->SetSegmentTagsFromString(currentSegment, segmentTags); } // NameAutoGenerated std::string nameAutoGenerated; if (this->GetSegmentMetaDataFromDicitionary(nameAutoGenerated, dictionary, segmentIndex, KEY_SEGMENT_NAME_AUTO_GENERATED)) { currentSegment->SetNameAutoGenerated(!strcmp(nameAutoGenerated.c_str(), "1")); } // ColorAutoGenerated std::string colorAutoGenerated; if (this->GetSegmentMetaDataFromDicitionary(colorAutoGenerated, dictionary, segmentIndex, KEY_SEGMENT_COLOR_AUTO_GENERATED)) { currentSegment->SetColorAutoGenerated(!strcmp(colorAutoGenerated.c_str(),"1")); } // Label value std::string labelValue; if (this->GetSegmentMetaDataFromDicitionary(labelValue, dictionary, segmentIndex, KEY_SEGMENT_LABEL_VALUE)) { currentSegment->SetLabelValue(vtkVariant(labelValue).ToInt()); } if (currentBinaryLabelmap == nullptr) { currentBinaryLabelmap = vtkSmartPointer<vtkOrientedImageData>::New(); // Extent int currentSegmentExtent[6] = { 0, -1, 0, -1, 0, -1 }; std::string currentExtentString; if (this->GetSegmentMetaDataFromDicitionary(currentExtentString, dictionary, segmentIndex, KEY_SEGMENT_EXTENT)) { GetImageExtentFromString(currentSegmentExtent, currentExtentString); } else { vtkWarningMacro("Segment extent is missing for segment " << segmentIndex); for (int i = 0; i < 6; i++) { currentSegmentExtent[i] = imageExtentInFile[i]; } } for (int i = 0; i < 3; i++) { currentSegmentExtent[i * 2] += referenceImageExtentOffset[i]; currentSegmentExtent[i * 2 + 1] += referenceImageExtentOffset[i]; } // Copy with clipping to specified extent if (currentSegmentExtent[0] <= currentSegmentExtent[1] && currentSegmentExtent[2] <= currentSegmentExtent[3] && currentSegmentExtent[4] <= currentSegmentExtent[5]) { // non-empty segment extractComponents->SetComponents(frameIndex); padder->SetOutputWholeExtent(currentSegmentExtent); padder->Update(); currentBinaryLabelmap->DeepCopy(padder->GetOutput()); } else { // empty segment for (int i = 0; i < 3; ++i) { currentSegmentExtent[2 * i] = 0; currentSegmentExtent[2 * i + 1] = -1; } currentBinaryLabelmap->SetExtent(currentSegmentExtent); currentBinaryLabelmap->AllocateScalars(VTK_UNSIGNED_CHAR, 1); } currentBinaryLabelmap->SetImageToWorldMatrix(imageToWorldMatrix.GetPointer()); } // Set loaded binary labelmap to segment currentSegment->AddRepresentation(vtkSegmentationConverter::GetSegmentationBinaryLabelmapRepresentationName(), currentBinaryLabelmap); segments[segmentIndex] = currentSegment; } } } // Add the created segments to the segmentation for (int segmentIndex = 0; segmentIndex < static_cast<int>(segments.size()); ++segmentIndex) { vtkSegment* currentSegment = segments[segmentIndex]; if (!currentSegment) { vtkErrorMacro("Could not find segment" << segmentIndex); continue; } std::string currentSegmentID; if (numberOfSegments != 0) { // ID if (!this->GetSegmentMetaDataFromDicitionary(currentSegmentID, dictionary, segmentIndex, KEY_SEGMENT_ID)) { // No segment ID is specified, which may mean that it is an empty segmentation. // We consider a segmentation empty if it has only one scalar component that is empty. if (numberOfFrames == 1) { extractComponents->SetComponents(segmentIndex); extractComponents->Update(); vtkImageData* labelmap = extractComponents->GetOutput(); double* scalarRange = labelmap->GetScalarRange(); if (scalarRange[0] >= scalarRange[1]) { // Segmentation contains a single blank segment without segment ID, // which means that it is an empty segmentation. // It may still contain valuable metadata, but we don't create any segments. break; } } currentSegmentID = segmentation->GenerateUniqueSegmentID("Segment"); vtkWarningMacro("Segment ID is missing for segment " << segmentIndex << " adding segment with ID: " << currentSegmentID); } // Name std::string segmentName; if (this->GetSegmentMetaDataFromDicitionary(segmentName, dictionary, segmentIndex, KEY_SEGMENT_NAME)) { currentSegment->SetName(segmentName.c_str()); } else { vtkWarningMacro("Segment name is missing for segment " << segmentIndex); currentSegment->SetName(currentSegmentID.c_str()); } } else { std::stringstream segmentNameSS; segmentNameSS << "Segment_" << currentSegment->GetLabelValue(); currentSegmentID = segmentation->GenerateUniqueSegmentID(segmentNameSS.str()); currentSegment->SetName(currentSegmentID.c_str()); } segmentation->AddSegment(currentSegment, currentSegmentID); } // Create contained representations now that all the data is loaded this->CreateRepresentationsBySerializedNames(segmentation, containedRepresentationNames); return 1; } //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::ReadPolyDataRepresentation(vtkMRMLSegmentationNode* segmentationNode, std::string path) { if (!vtksys::SystemTools::FileExists(path.c_str())) { vtkErrorMacro("ReadPolyDataRepresentation: Input file " << path << " does not exist!"); return 0; } // Set up output segmentation if (!segmentationNode || segmentationNode->GetSegmentation()->GetNumberOfSegments() > 0) { vtkErrorMacro("ReadPolyDataRepresentation: Output segmentation must exist and must be empty!"); return 0; } vtkSegmentation* segmentation = segmentationNode->GetSegmentation(); // Add all files to storage node (multiblock dataset writes segments to individual files in a separate folder) this->AddPolyDataFileNames(path, segmentation); // Read multiblock dataset from disk vtkSmartPointer<vtkXMLMultiBlockDataReader> reader = vtkSmartPointer<vtkXMLMultiBlockDataReader>::New(); reader->SetFileName(path.c_str()); reader->Update(); vtkMultiBlockDataSet* multiBlockDataset = vtkMultiBlockDataSet::SafeDownCast(reader->GetOutput()); if (!multiBlockDataset || multiBlockDataset->GetNumberOfBlocks()==0) { vtkErrorMacro("ReadPolyDataRepresentation: Failed to read file " << path); return 0; } MRMLNodeModifyBlocker blocker(segmentationNode); // Read segment poly datas std::string masterRepresentationName; std::string containedRepresentationNames; std::string conversionParameters; for (unsigned int blockIndex = 0; blockIndex<multiBlockDataset->GetNumberOfBlocks(); ++blockIndex) { // Get poly data representation vtkPolyData* currentPolyData = vtkPolyData::SafeDownCast(multiBlockDataset->GetBlock(blockIndex)); // Set master representation if it has not been set yet // (there is no global place to store it, but every segment field data contains a copy of it) if (masterRepresentationName.empty()) { vtkStringArray* masterRepresentationArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentationMetaDataKey(KEY_SEGMENTATION_MASTER_REPRESENTATION).c_str())); if (!masterRepresentationArray) { vtkErrorMacro("ReadPolyDataRepresentation: Unable to find master representation for segmentation in file " << path); return 0; } masterRepresentationName = masterRepresentationArray->GetValue(0); segmentation->SetMasterRepresentationName(masterRepresentationName.c_str()); } // Read conversion parameters (stored in each segment file, but need to set only once) if ( conversionParameters.empty() && currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONVERSION_PARAMETERS).c_str()) ) { vtkStringArray* conversionParametersArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONVERSION_PARAMETERS).c_str()) ); conversionParameters = conversionParametersArray->GetValue(0); segmentation->DeserializeConversionParameters(conversionParameters); } // Read contained representation names if ( containedRepresentationNames.empty() && currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES).c_str()) ) { containedRepresentationNames = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES).c_str()) )->GetValue(0); } // Create segment vtkSmartPointer<vtkSegment> currentSegment = vtkSmartPointer<vtkSegment>::New(); currentSegment->AddRepresentation(segmentation->GetMasterRepresentationName(), currentPolyData); // Set segment properties std::string currentSegmentID; vtkStringArray* idArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_ID).c_str()) ); if (idArray && idArray->GetNumberOfValues()>0) { currentSegmentID = idArray->GetValue(0); } else { vtkWarningMacro("ReadPolyDataRepresentation: Segment ID property not found when reading segment " << blockIndex << " from file " << path); } std::string currentSegmentName; vtkStringArray* nameArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_NAME).c_str()) ); if (nameArray && nameArray->GetNumberOfValues()>0) { currentSegmentName = nameArray->GetValue(0); } else { vtkWarningMacro("ReadPolyDataRepresentation: Segment Name property not found when reading segment " << blockIndex << " from file " << path); std::stringstream ssCurrentSegmentName; ssCurrentSegmentName << "Segment " << blockIndex; currentSegmentName = ssCurrentSegmentName.str(); } currentSegment->SetName(currentSegmentName.c_str()); double color[3]={1.0, 0.0, 0.0}; vtkDoubleArray* colorArray = vtkDoubleArray::SafeDownCast( currentPolyData->GetFieldData()->GetArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_COLOR).c_str()) ); if (!colorArray || colorArray->GetNumberOfTuples() == 0) { // Backwards compatibility colorArray = vtkDoubleArray::SafeDownCast( currentPolyData->GetFieldData()->GetArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, "DefaultColor").c_str()) ); } if (colorArray && colorArray->GetNumberOfTuples() > 0 && colorArray->GetNumberOfComponents() == 3) { colorArray->GetTuple(0, color); } else { vtkWarningMacro("ReadPolyDataRepresentation: Segment color property not found when reading segment " << blockIndex << " from file " << path); } currentSegment->SetColor(color); // Tags vtkStringArray* tagsArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_TAGS).c_str()) ); if (tagsArray) { std::string tags(tagsArray->GetValue(0).c_str()); std::string separatorCharacter("|"); size_t separatorPosition = tags.find(separatorCharacter); while (separatorPosition != std::string::npos) { std::string mapPairStr = tags.substr(0, separatorPosition); size_t colonPosition = mapPairStr.find(":"); if (colonPosition == std::string::npos) { continue; } currentSegment->SetTag(mapPairStr.substr(0, colonPosition), mapPairStr.substr(colonPosition+1)); tags = tags.substr(separatorPosition+1); separatorPosition = tags.find(separatorCharacter); } } // NameAutoGenerated vtkStringArray* nameAutoGeneratedArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_NAME_AUTO_GENERATED).c_str()) ); if (nameAutoGeneratedArray && nameAutoGeneratedArray->GetNumberOfValues()>0) { currentSegment->SetNameAutoGenerated(!nameAutoGeneratedArray->GetValue(0).compare("1")); } // ColorAutoGenerated vtkStringArray* colorAutoGeneratedArray = vtkStringArray::SafeDownCast( currentPolyData->GetFieldData()->GetAbstractArray(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_COLOR_AUTO_GENERATED).c_str()) ); if (colorAutoGeneratedArray && colorAutoGeneratedArray->GetNumberOfValues()>0) { currentSegment->SetColorAutoGenerated(!colorAutoGeneratedArray->GetValue(0).compare("1")); } // Add segment to segmentation segmentation->AddSegment(currentSegment, currentSegmentID); } // Create contained representations now that all the data is loaded this->CreateRepresentationsBySerializedNames(segmentation, containedRepresentationNames); return 1; } //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::WriteDataInternal(vtkMRMLNode *refNode) { std::string fullName = this->GetFullNameFromFileName(); if (fullName.empty()) { vtkErrorMacro("vtkMRMLModelNode: File name not specified"); return 0; } vtkMRMLSegmentationNode *segmentationNode = vtkMRMLSegmentationNode::SafeDownCast(refNode); if (segmentationNode == nullptr) { vtkErrorMacro("Segmentation node expected. Unable to write node to file."); return 0; } if (segmentationNode->GetSegmentation() == nullptr) { vtkErrorMacro("Segmentation node does not contain segmentation object. Unable to write node to file."); return 0; } // Write only master representation if (segmentationNode->GetSegmentation()->IsMasterRepresentationImageData()) { return this->WriteBinaryLabelmapRepresentation(segmentationNode, fullName); } else if (segmentationNode->GetSegmentation()->IsMasterRepresentationPolyData()) { return this->WritePolyDataRepresentation(segmentationNode, fullName); } vtkErrorMacro("Segmentation master representation " << segmentationNode->GetSegmentation()->GetMasterRepresentationName() << " cannot be written to file"); return 0; } //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::WriteBinaryLabelmapRepresentation(vtkMRMLSegmentationNode* segmentationNode, std::string fullName) { if (!segmentationNode) { vtkErrorMacro("WriteBinaryLabelmapRepresentation: Invalid segmentation to write to disk"); return 0; } vtkSegmentation* segmentation = segmentationNode->GetSegmentation(); segmentation->CollapseBinaryLabelmaps(false); // Get and check master representation if (!segmentationNode->GetSegmentation()->IsMasterRepresentationImageData()) { vtkErrorMacro("WriteBinaryLabelmapRepresentation: Invalid master representation to write as image data"); return 0; } vtkIdType scalarType = VTK_UNSIGNED_CHAR; vtkIdType scalarSize = 0; std::vector< std::string > segmentIDs; segmentation->GetSegmentIDs(segmentIDs); for (std::vector< std::string >::const_iterator segmentIdIt = segmentIDs.begin(); segmentIdIt != segmentIDs.end(); ++segmentIdIt) { std::string currentSegmentID = *segmentIdIt; vtkSegment* currentSegment = segmentation->GetSegment(*segmentIdIt); vtkSmartPointer<vtkOrientedImageData> currentBinaryLabelmap = vtkOrientedImageData::SafeDownCast( currentSegment->GetRepresentation(segmentationNode->GetSegmentation()->GetMasterRepresentationName())); if (currentBinaryLabelmap->GetScalarSize() > scalarSize) { scalarSize = currentBinaryLabelmap->GetScalarSize(); scalarType = currentBinaryLabelmap->GetScalarType(); } } // Determine shared labelmap dimensions and properties vtkSmartPointer<vtkOrientedImageData> commonGeometryImage = vtkSmartPointer<vtkOrientedImageData>::New(); int commonGeometryExtent[6] = { 0, -1, 0, -1, 0, -1 }; if (segmentation->GetNumberOfSegments() > 0) { std::string commonGeometryString = segmentation->DetermineCommonLabelmapGeometry( this->CropToMinimumExtent ? vtkSegmentation::EXTENT_UNION_OF_EFFECTIVE_SEGMENTS : vtkSegmentation::EXTENT_REFERENCE_GEOMETRY); vtkSegmentationConverter::DeserializeImageGeometry(commonGeometryString, commonGeometryImage, true, scalarType, 1); commonGeometryImage->GetExtent(commonGeometryExtent); } if (commonGeometryExtent[0] > commonGeometryExtent[1] || commonGeometryExtent[2] > commonGeometryExtent[3] || commonGeometryExtent[4] > commonGeometryExtent[5]) { // common image is empty, which cannot be written to image file // change it to a 1x1x1 image instead commonGeometryExtent[0] = 0; commonGeometryExtent[1] = 0; commonGeometryExtent[2] = 0; commonGeometryExtent[3] = 0; commonGeometryExtent[4] = 0; commonGeometryExtent[5] = 0; commonGeometryImage->SetExtent(commonGeometryExtent); commonGeometryImage->AllocateScalars(scalarType, 1); } vtkOrientedImageDataResample::FillImage(commonGeometryImage, 0); vtkNew<vtkTeemNRRDWriter> writer; writer->SetFileName(fullName.c_str()); writer->SetUseCompression(this->GetUseCompression()); writer->SetSpace(nrrdSpaceLeftPosteriorSuperior); writer->SetMeasurementFrameMatrix(nullptr); // Create metadata dictionary // Save extent start of common geometry image so that we can restore original extents when reading from file //writer->SetAttribute(GetSegmentationMetaDataKey(KEY_SEGMENTATION_EXTENT).c_str(), GetImageExtentAsString(commonGeometryImage)); int referenceImageExtentOffset[3] = { commonGeometryExtent[0], commonGeometryExtent[2], commonGeometryExtent[4] }; std::stringstream ssReferenceImageExtentOffset; ssReferenceImageExtentOffset << referenceImageExtentOffset[0] << " " << referenceImageExtentOffset[1] << " " << referenceImageExtentOffset[2]; writer->SetAttribute(GetSegmentationMetaDataKey(KEY_SEGMENTATION_REFERENCE_IMAGE_EXTENT_OFFSET).c_str(), ssReferenceImageExtentOffset.str()); vtkNew<vtkMatrix4x4> rasToIjk; commonGeometryImage->GetWorldToImageMatrix(rasToIjk.GetPointer()); // Compensate for the extent shift in the image origin: vtkNew<vtkMatrix4x4> ijkToFileIjk; ijkToFileIjk->SetElement(0, 3, -referenceImageExtentOffset[0]); ijkToFileIjk->SetElement(1, 3, -referenceImageExtentOffset[1]); ijkToFileIjk->SetElement(2, 3, -referenceImageExtentOffset[2]); vtkNew<vtkMatrix4x4> rasToFileIjk; vtkMatrix4x4::Multiply4x4(ijkToFileIjk.GetPointer(), rasToIjk.GetPointer(), rasToFileIjk.GetPointer()); vtkNew<vtkMatrix4x4> fileIjkToRas; vtkMatrix4x4::Invert(rasToFileIjk.GetPointer(), fileIjkToRas.GetPointer()); writer->SetIJKToRASMatrix(fileIjkToRas.GetPointer()); // Save master representation name writer->SetAttribute(GetSegmentationMetaDataKey(KEY_SEGMENTATION_MASTER_REPRESENTATION).c_str(), segmentationNode->GetSegmentation()->GetMasterRepresentationName()); // Save conversion parameters std::string conversionParameters = segmentation->SerializeAllConversionParameters(); writer->SetAttribute(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONVERSION_PARAMETERS).c_str(), conversionParameters); // Save created representation names so that they are re-created when loading std::string containedRepresentationNames = this->SerializeContainedRepresentationNames(segmentation); writer->SetAttribute(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES).c_str(), containedRepresentationNames); vtkNew<vtkImageAppendComponents> appender; unsigned int layerIndex = 0; std::map<vtkDataObject*, int> labelmapLayers; // Dimensions of the output 4D NRRD file: (i, j, k, segment) unsigned int segmentIndex = 0; for (std::vector< std::string >::const_iterator segmentIdIt = segmentIDs.begin(); segmentIdIt != segmentIDs.end(); ++segmentIdIt, ++segmentIndex) { std::string currentSegmentID = *segmentIdIt; vtkSegment* currentSegment = segmentation->GetSegment(*segmentIdIt); // Get master representation from segment vtkSmartPointer<vtkOrientedImageData> currentBinaryLabelmap = vtkOrientedImageData::SafeDownCast( currentSegment->GetRepresentation(segmentationNode->GetSegmentation()->GetMasterRepresentationName())); if (!currentBinaryLabelmap) { vtkErrorMacro("WriteBinaryLabelmapRepresentation: Failed to retrieve master representation from segment " << currentSegmentID); continue; } int currentBinaryLabelmapExtent[6] = { 0, -1, 0, -1, 0, -1 }; currentBinaryLabelmap->GetExtent(currentBinaryLabelmapExtent); if (currentBinaryLabelmapExtent[0] <= currentBinaryLabelmapExtent[1] && currentBinaryLabelmapExtent[2] <= currentBinaryLabelmapExtent[3] && currentBinaryLabelmapExtent[4] <= currentBinaryLabelmapExtent[5]) { // There is a valid labelmap // Get transformed extents of the segment in the common labelmap geometry vtkNew<vtkTransform> currentBinaryLabelmapToCommonGeometryImageTransform; vtkOrientedImageDataResample::GetTransformBetweenOrientedImages(currentBinaryLabelmap, commonGeometryImage, currentBinaryLabelmapToCommonGeometryImageTransform.GetPointer()); int currentBinaryLabelmapExtentInCommonGeometryImageFrame[6] = { 0, -1, 0, -1, 0, -1 }; vtkOrientedImageDataResample::TransformExtent(currentBinaryLabelmapExtent, currentBinaryLabelmapToCommonGeometryImageTransform.GetPointer(), currentBinaryLabelmapExtentInCommonGeometryImageFrame); for (int i = 0; i < 3; i++) { currentBinaryLabelmapExtent[i * 2] = std::max(currentBinaryLabelmapExtentInCommonGeometryImageFrame[i * 2], commonGeometryExtent[i * 2]); currentBinaryLabelmapExtent[i * 2 + 1] = std::min(currentBinaryLabelmapExtentInCommonGeometryImageFrame[i * 2 + 1], commonGeometryExtent[i * 2 + 1]); } // TODO: maybe calculate effective extent to make sure the data is as compact as possible? (saving may be a good time to make segments more compact) // Pad/resample current binary labelmap representation to common geometry vtkSmartPointer<vtkOrientedImageData> resampledCurrentBinaryLabelmap = vtkSmartPointer<vtkOrientedImageData>::New(); bool success = vtkOrientedImageDataResample::ResampleOrientedImageToReferenceOrientedImage( currentBinaryLabelmap, commonGeometryImage, resampledCurrentBinaryLabelmap); if (!success) { vtkWarningMacro("WriteBinaryLabelmapRepresentation: Segment " << currentSegmentID << " cannot be resampled to common geometry!"); continue; } // currentBinaryLabelmap smart pointer will keep the temporary labelmap valid until it is needed currentBinaryLabelmap = resampledCurrentBinaryLabelmap; if (currentBinaryLabelmap->GetScalarType() != scalarType) { vtkNew<vtkImageCast> castFilter; castFilter->SetInputData(resampledCurrentBinaryLabelmap); castFilter->SetOutputScalarType(scalarType); castFilter->Update(); currentBinaryLabelmap->ShallowCopy(castFilter->GetOutput()); } } else { // empty segment, use the commonGeometryImage (filled with 0) currentBinaryLabelmap = commonGeometryImage; } // Set metadata for current segment writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_ID).c_str(), currentSegmentID); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_NAME).c_str(), currentSegment->GetName()); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_COLOR).c_str(), GetSegmentColorAsString(segmentationNode, currentSegmentID)); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_NAME_AUTO_GENERATED).c_str(), (currentSegment->GetNameAutoGenerated() ? "1" : "0") ); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_COLOR_AUTO_GENERATED).c_str(), (currentSegment->GetColorAutoGenerated() ? "1" : "0") ); // Save the geometry relative to the current image (so that the extent in the file describe the extent of the segment in the // saved image buffer) for (int i = 0; i < 3; i++) { currentBinaryLabelmapExtent[i * 2] -= referenceImageExtentOffset[i]; currentBinaryLabelmapExtent[i * 2 + 1] -= referenceImageExtentOffset[i]; } writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_EXTENT).c_str(), GetImageExtentAsString(currentBinaryLabelmapExtent)); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_TAGS).c_str(), GetSegmentTagsAsString(currentSegment)); std::stringstream labelValueSS; labelValueSS << currentSegment->GetLabelValue(); writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_LABEL_VALUE).c_str(), labelValueSS.str()); vtkDataObject* originalRepresentation = currentSegment->GetRepresentation(segmentationNode->GetSegmentation()->GetMasterRepresentationName()); if (labelmapLayers.find(originalRepresentation) == labelmapLayers.end()) { labelmapLayers[originalRepresentation] = layerIndex; appender->AddInputData(currentBinaryLabelmap); ++layerIndex; } unsigned int layer = labelmapLayers[originalRepresentation]; std::stringstream layerIndexSS; layerIndexSS << layer; writer->SetAttribute(GetSegmentMetaDataKey(segmentIndex, KEY_SEGMENT_LAYER).c_str(), layerIndexSS.str()); } // For each segment if (segmentationNode->GetSegmentation()->GetNumberOfSegments() > 0) { appender->Update(); writer->SetInputConnection(appender->GetOutputPort()); writer->SetVectorAxisKind(nrrdKindList); } else { // If there are no segments, we still write the data so that we can store // various metadata fields. writer->SetInputData(commonGeometryImage); } writer->Write(); int writeFlag = 1; if (writer->GetWriteError()) { vtkErrorMacro("ERROR writing NRRD file " << (writer->GetFileName() == nullptr ? "null" : writer->GetFileName())); writeFlag = 0; } return writeFlag; } //---------------------------------------------------------------------------- int vtkMRMLSegmentationStorageNode::WritePolyDataRepresentation(vtkMRMLSegmentationNode* segmentationNode, std::string path) { if (!segmentationNode || segmentationNode->GetSegmentation()->GetNumberOfSegments() == 0) { vtkErrorMacro("WritePolyDataRepresentation: Invalid segmentation to write to disk"); return 0; } vtkSegmentation* segmentation = segmentationNode->GetSegmentation(); // Get and check master representation if (!segmentationNode->GetSegmentation()->IsMasterRepresentationPolyData()) { vtkErrorMacro("WritePolyDataRepresentation: Invalid master representation to write as poly data"); return 0; } // Initialize dataset to write vtkSmartPointer<vtkMultiBlockDataSet> multiBlockDataset = vtkSmartPointer<vtkMultiBlockDataSet>::New(); multiBlockDataset->SetNumberOfBlocks(segmentation->GetNumberOfSegments()); // Add segment polydata objects to dataset std::vector< std::string > segmentIDs; segmentation->GetSegmentIDs(segmentIDs); unsigned int segmentIndex = 0; for (std::vector< std::string >::const_iterator segmentIdIt = segmentIDs.begin(); segmentIdIt != segmentIDs.end(); ++segmentIdIt, ++segmentIndex) { std::string currentSegmentID = *segmentIdIt; vtkSegment* currentSegment = segmentation->GetSegment(*segmentIdIt); // Get master representation from segment vtkPolyData* currentPolyData = vtkPolyData::SafeDownCast(currentSegment->GetRepresentation( segmentationNode->GetSegmentation()->GetMasterRepresentationName())); if (!currentPolyData) { vtkErrorMacro("WritePolyDataRepresentation: Failed to retrieve master representation from segment " << currentSegmentID); continue; } // Make temporary duplicate of the poly data so that adding the metadata does not cause invalidating the other // representations (which is done when the master representation is modified) vtkSmartPointer<vtkPolyData> currentPolyDataCopy = vtkSmartPointer<vtkPolyData>::New(); currentPolyDataCopy->ShallowCopy(currentPolyData); // Set metadata for current segment // MasterRepresentation vtkSmartPointer<vtkStringArray> masterRepresentationArray = vtkSmartPointer<vtkStringArray>::New(); masterRepresentationArray->SetNumberOfValues(1); masterRepresentationArray->SetValue(0, segmentationNode->GetSegmentation()->GetMasterRepresentationName()); masterRepresentationArray->SetName(GetSegmentationMetaDataKey(KEY_SEGMENTATION_MASTER_REPRESENTATION).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(masterRepresentationArray); // ID vtkSmartPointer<vtkStringArray> idArray = vtkSmartPointer<vtkStringArray>::New(); idArray->SetNumberOfValues(1); idArray->SetValue(0,currentSegmentID.c_str()); idArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_ID).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(idArray); // Name vtkSmartPointer<vtkStringArray> nameArray = vtkSmartPointer<vtkStringArray>::New(); nameArray->SetNumberOfValues(1); nameArray->SetValue(0,currentSegment->GetName()); nameArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_NAME).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(nameArray); // Color vtkSmartPointer<vtkDoubleArray> colorArray = vtkSmartPointer<vtkDoubleArray>::New(); colorArray->SetNumberOfComponents(3); colorArray->SetNumberOfTuples(1); colorArray->SetTuple(0, currentSegment->GetColor()); colorArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_COLOR).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(colorArray); // Tags std::map<std::string,std::string> tags; currentSegment->GetTags(tags); std::stringstream ssTags; std::map<std::string,std::string>::iterator tagIt; for (tagIt=tags.begin(); tagIt!=tags.end(); ++tagIt) { ssTags << tagIt->first << ":" << tagIt->second << "|"; } vtkSmartPointer<vtkStringArray> tagsArray = vtkSmartPointer<vtkStringArray>::New(); tagsArray->SetNumberOfValues(1); tagsArray->SetValue(0,ssTags.str().c_str()); tagsArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_TAGS).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(tagsArray); // NameAutoGenerated vtkSmartPointer<vtkStringArray> nameAutoGeneratedArray = vtkSmartPointer<vtkStringArray>::New(); nameAutoGeneratedArray->SetNumberOfValues(1); nameAutoGeneratedArray->SetValue(0, (currentSegment->GetNameAutoGenerated() ? "1" : "0") ); nameAutoGeneratedArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_NAME_AUTO_GENERATED).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(nameAutoGeneratedArray); // ColorAutoGenerated vtkSmartPointer<vtkStringArray> colorAutoGeneratedArray = vtkSmartPointer<vtkStringArray>::New(); colorAutoGeneratedArray->SetNumberOfValues(1); colorAutoGeneratedArray->SetValue(0, (currentSegment->GetColorAutoGenerated() ? "1" : "0") ); colorAutoGeneratedArray->SetName(GetSegmentMetaDataKey(SINGLE_SEGMENT_INDEX, KEY_SEGMENT_COLOR_AUTO_GENERATED).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(colorAutoGeneratedArray); // Save conversion parameters as metadata (save in each segment file) std::string conversionParameters = segmentation->SerializeAllConversionParameters(); vtkSmartPointer<vtkStringArray> conversionParametersArray = vtkSmartPointer<vtkStringArray>::New(); conversionParametersArray->SetNumberOfValues(1); conversionParametersArray->SetValue(0,conversionParameters); conversionParametersArray->SetName(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONVERSION_PARAMETERS).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(conversionParametersArray); // Save contained representation names as metadata (save in each segment file) std::string containedRepresentationNames = this->SerializeContainedRepresentationNames(segmentation); vtkSmartPointer<vtkStringArray> containedRepresentationNamesArray = vtkSmartPointer<vtkStringArray>::New(); containedRepresentationNamesArray->SetNumberOfValues(1); containedRepresentationNamesArray->SetValue(0,containedRepresentationNames); containedRepresentationNamesArray->SetName(GetSegmentationMetaDataKey(KEY_SEGMENTATION_CONTAINED_REPRESENTATION_NAMES).c_str()); currentPolyDataCopy->GetFieldData()->AddArray(containedRepresentationNamesArray); // Set segment poly data to dataset multiBlockDataset->SetBlock(segmentIndex, currentPolyDataCopy); } // Write multiblock dataset to disk vtkSmartPointer<vtkXMLMultiBlockDataWriter> writer = vtkSmartPointer<vtkXMLMultiBlockDataWriter>::New(); writer->SetInputData(multiBlockDataset); writer->SetFileName(path.c_str()); if (this->UseCompression) { writer->SetDataModeToBinary(); writer->SetCompressorTypeToZLib(); } else { writer->SetDataModeToAscii(); writer->SetCompressorTypeToNone(); } writer->Write(); // Add all files to storage node (multiblock dataset writes segments to individual files in a separate folder) this->AddPolyDataFileNames(path, segmentation); return 1; } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::AddPolyDataFileNames(std::string path, vtkSegmentation* segmentation) { if (!segmentation) { vtkErrorMacro("AddPolyDataFileNames: Invalid segmentation!"); return; } this->AddFileName(path.c_str()); std::string fileNameWithoutExtension = vtksys::SystemTools::GetFilenameWithoutLastExtension(path); std::string parentDirectory = vtksys::SystemTools::GetParentDirectory(path); std::string multiBlockDirectory = parentDirectory + "/" + fileNameWithoutExtension; for (int segmentIndex = 0; segmentIndex < segmentation->GetNumberOfSegments(); ++segmentIndex) { std::stringstream ssSegmentFilePath; ssSegmentFilePath << multiBlockDirectory << "/" << fileNameWithoutExtension << "_" << segmentIndex << ".vtp"; std::string segmentFilePath = ssSegmentFilePath.str(); this->AddFileName(segmentFilePath.c_str()); } } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::SerializeContainedRepresentationNames(vtkSegmentation* segmentation) { if (!segmentation) { vtkErrorMacro("SerializeContainedRepresentationNames: Invalid segmentation!"); return ""; } std::stringstream ssRepresentationNames; std::vector<std::string> containedRepresentationNames; segmentation->GetContainedRepresentationNames(containedRepresentationNames); for (std::vector<std::string>::iterator reprIt = containedRepresentationNames.begin(); reprIt != containedRepresentationNames.end(); ++reprIt) { ssRepresentationNames << (*reprIt) << SERIALIZATION_SEPARATOR; } return ssRepresentationNames.str(); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::CreateRepresentationsBySerializedNames(vtkSegmentation* segmentation, std::string representationNames) { if (!segmentation) { vtkErrorMacro("CreateRepresentationsBySerializedNames: Invalid segmentation!"); return; } if (segmentation->GetNumberOfSegments() == 0) { vtkDebugMacro("CreateRepresentationsBySerializedNames: Segmentation is empty, nothing to do"); return; } if (representationNames.empty()) { vtkDebugMacro("CreateRepresentationsBySerializedNames: Empty representation names list, nothing to create"); return; } std::string masterRepresentation(segmentation->GetMasterRepresentationName()); size_t separatorPosition = representationNames.find(SERIALIZATION_SEPARATOR); while (separatorPosition != std::string::npos) { std::string representationName = representationNames.substr(0, separatorPosition); // Only create non-master representations if (representationName.compare(masterRepresentation)) { segmentation->CreateRepresentation(representationName); } representationNames = representationNames.substr(separatorPosition+1); separatorPosition = representationNames.find(SERIALIZATION_SEPARATOR); } } //---------------------------------------------------------------------------- bool vtkMRMLSegmentationStorageNode::GetSegmentMetaDataFromDicitionary(std::string& headerValue, itk::MetaDataDictionary dictionary, int segmentIndex, std::string keyName) { if (!dictionary.HasKey(GetSegmentMetaDataKey(segmentIndex, keyName))) { return false; } itk::ExposeMetaData<std::string>(dictionary, GetSegmentMetaDataKey(segmentIndex, keyName), headerValue); return true; } //---------------------------------------------------------------------------- bool vtkMRMLSegmentationStorageNode::GetSegmentationMetaDataFromDicitionary(std::string& headerValue, itk::MetaDataDictionary dictionary, std::string keyName) { if (!dictionary.HasKey(GetSegmentationMetaDataKey(keyName))) { return false; } itk::ExposeMetaData<std::string>(dictionary, GetSegmentationMetaDataKey(keyName), headerValue); return true; } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetSegmentMetaDataKey(int segmentIndex, const std::string& keyName) { std::stringstream key; key << "Segment"; if (segmentIndex != SINGLE_SEGMENT_INDEX) { key << segmentIndex; } key << "_" << keyName; return key.str(); } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetSegmentationMetaDataKey(const std::string& keyName) { std::stringstream key; key << "Segmentation" << "_" << keyName; return key.str(); } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetSegmentTagsAsString(vtkSegment* segment) { std::map<std::string, std::string> tags; if (segment) { segment->GetTags(tags); } std::stringstream ssTagsValue; std::map<std::string, std::string>::iterator tagIt; for (tagIt = tags.begin(); tagIt != tags.end(); ++tagIt) { ssTagsValue << tagIt->first << ":" << tagIt->second << "|"; } std::string tagsValue = ssTagsValue.str(); return tagsValue; } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::SetSegmentTagsFromString(vtkSegment* segment, std::string tagsValue) { std::string separatorCharacter("|"); size_t separatorPosition = tagsValue.find(separatorCharacter); while (separatorPosition != std::string::npos) { std::string mapPairStr = tagsValue.substr(0, separatorPosition); size_t colonPosition = mapPairStr.find(":"); if (colonPosition == std::string::npos) { tagsValue = tagsValue.substr(separatorPosition + 1); separatorPosition = tagsValue.find(separatorCharacter); continue; } segment->SetTag(mapPairStr.substr(0, colonPosition), mapPairStr.substr(colonPosition + 1)); tagsValue = tagsValue.substr(separatorPosition + 1); separatorPosition = tagsValue.find(separatorCharacter); } } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetImageExtentAsString(vtkOrientedImageData* image) { int extent[6] = { 0, -1, 0, -1, 0, -1 }; if (image) { image->GetExtent(extent); } return GetImageExtentAsString(extent); } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetImageExtentAsString(int extent[6]) { std::stringstream ssExtentValue; ssExtentValue << extent[0] << " " << extent[1] << " " << extent[2] << " " << extent[3] << " " << extent[4] << " " << extent[5]; std::string extentValue = ssExtentValue.str(); return extentValue; } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::GetImageExtentFromString(int extent[6], std::string extentValue) { std::stringstream ssExtentValue(extentValue); extent[0] = 0; extent[1] = -1; extent[2] = 0; extent[3] = -1; extent[4] = 0; extent[5] = -1; ssExtentValue >> extent[0] >> extent[1] >> extent[2] >> extent[3] >> extent[4] >> extent[5]; } //---------------------------------------------------------------------------- std::string vtkMRMLSegmentationStorageNode::GetSegmentColorAsString(vtkMRMLSegmentationNode* segmentationNode, const std::string& segmentId) { double color[3] = { vtkSegment::SEGMENT_COLOR_INVALID[0], vtkSegment::SEGMENT_COLOR_INVALID[1], vtkSegment::SEGMENT_COLOR_INVALID[2] }; vtkSegment* segment = segmentationNode->GetSegmentation()->GetSegment(segmentId); if (segment) { segment->GetColor(color); } std::stringstream colorStream; colorStream << color[0] << " " << color[1] << " " << color[2]; return colorStream.str(); } //---------------------------------------------------------------------------- void vtkMRMLSegmentationStorageNode::GetSegmentColorFromString(double color[3], std::string colorString) { std::stringstream colorStream(colorString); color[0] = 0.5; color[1] = 0.5; color[2] = 0.5; colorStream >> color[0] >> color[1] >> color[2]; }
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // // Copyright (C) 2021 Intel Corporation #ifdef HAVE_ONEVPL #include "../perf_precomp.hpp" #include "../../test/common/gapi_tests_common.hpp" #include <opencv2/gapi/streaming/onevpl/source.hpp> #include <opencv2/gapi/streaming/cap.hpp> namespace opencv_test { using namespace perf; const std::string files[] = { "highgui/video/big_buck_bunny.h265", "highgui/video/big_buck_bunny.h264", }; const std::string codec[] = { "MFX_CODEC_HEVC", "MFX_CODEC_AVC" }; using source_t = std::string; using codec_t = std::string; using source_description_t = std::tuple<source_t, codec_t>; class OneVPLSourcePerfTest : public TestPerfParams<source_description_t> {}; class VideoCapSourcePerfTest : public TestPerfParams<source_t> {}; PERF_TEST_P_(OneVPLSourcePerfTest, TestPerformance) { using namespace cv::gapi::wip::onevpl; const auto params = GetParam(); source_t src = findDataFile(get<0>(params)); codec_t type = get<1>(params); std::vector<CfgParam> cfg_params { CfgParam::create<std::string>("mfxImplDescription.Impl", "MFX_IMPL_TYPE_HARDWARE"), CfgParam::create("mfxImplDescription.mfxDecoderDescription.decoder.CodecID", type), }; auto source_ptr = cv::gapi::wip::make_onevpl_src(src, cfg_params); cv::gapi::wip::Data out; TEST_CYCLE() { source_ptr->pull(out); } SANITY_CHECK_NOTHING(); } PERF_TEST_P_(VideoCapSourcePerfTest, TestPerformance) { using namespace cv::gapi::wip; source_t src = findDataFile(GetParam()); auto source_ptr = make_src<GCaptureSource>(src); Data out; TEST_CYCLE() { source_ptr->pull(out); } SANITY_CHECK_NOTHING(); } INSTANTIATE_TEST_CASE_P(Streaming, OneVPLSourcePerfTest, Values(source_description_t(files[0], codec[0]), source_description_t(files[1], codec[1]))); INSTANTIATE_TEST_CASE_P(Streaming, VideoCapSourcePerfTest, Values(files[0], files[1])); } // namespace opencv_test #endif // HAVE_ONEVPL
StartTest: di ; Turn off interrupts in case they interfere. ; clear ULA screen to: BORDER 7 : PAPER 7 : INK 0 : CLS ; - this removes any ULA artefacts left by SNA loaders and majority of tests expects ; this "BASIC" state of screen, so let's make sure it is like that. ld a,WHITE out (ULA_P_FE),a ; BORDER 7 ld hl,MEM_ZX_SCREEN_4000 ld de,MEM_ZX_SCREEN_4000+1 ld bc,32*24*8 ; 6144 bytes of pixel data, also C = 0 (!) ld (hl),c ldir ; HL==MEM_ZX_ATTRIB_5800, DE==HL+1 ld (hl),P_WHITE|BLACK ld bc,32*24-1 ; and overwrite remaining 767 bytes ldir ; detect if the test is running at TBBlue machine (ZX Next) call DetectTBBlue ret nc ; if running at TBBlue, enable all Next specific HW in the NextRegisters $82-$85 ld a,$FF ld b,INTERNAL_PORT_DECODING_0_NR_82 call WriteNextRegByIo inc b ; INTERNAL_PORT_DECODING_1_NR_83 call WriteNextRegByIo inc b ; INTERNAL_PORT_DECODING_2_NR_84 call WriteNextRegByIo inc b ; INTERNAL_PORT_DECODING_3_NR_85 jr WriteNextRegByIo EndTest jr EndTest ; Loop forever so we can take a screengrab. StartTiming ; Set the border to green. ld a,GREEN out (ULA_P_FE),a ret EndTiming ; Set the border to black. ld a,BLACK out (ULA_P_FE),a ret ReadNextReg: ; reads nextreg in A into A (does modify currently selected NextReg on I/O port) push bc ld bc,TBBLUE_REGISTER_SELECT_P_243B out (c),a inc b ; bc = TBBLUE_REGISTER_ACCESS_P_253B in a,(c) ; read desired NextReg state pop bc ret ; Read NextReg into A (does modify A, and NextReg selected on the I/O port) ; is not optimized for speed + restores BC MACRO NEXTREG2A register? ld a,register? call ReadNextReg ENDM WriteNextRegByIo: ; writes value A into nextreg B (does modify currently selected NextReg on I/O port) push bc push af ld a,b ld bc,TBBLUE_REGISTER_SELECT_P_243B out (c),a inc b ; bc = TBBLUE_REGISTER_ACCESS_P_253B pop af out (c),a ; write value pop bc ret DetectTBBlue: ; check if the TBBlue board (or emulator) is running the code: CF=1 TBBlue, CF=0 not NEXTREG2A MACHINE_ID_NR_00 cp 8 jr z,.emulatorOrTBBlue and $0F cp %1010 jr z,.emulatorOrTBBlue ; any ID with "10" in bottom nibble is accepted "tbblue" ; not TBBlue, emulator or ZX-DOS or a ; CF=0 ret .emulatorOrTBBlue: NEXTREG2A NEXT_VERSION_NR_01 dec a ; convert version $00 to $FF, and $FF to $FE cp $FE ; CF=0 for version numbers $00 and $FF ($01..$FE versions = CF=1) ret
; Test case: ONE: equ 1 ld ix,list ld a,(ix+ONE) ; this should be optimized to use hl ld (var),a ld ix,list2 ld a,(ix) ; this should be optimized to use hl too ld (var),a ld hl,#ffff ld ix,list ld a,(ix) ; this should not be optimized, as we would modify hl ld (var),a ld a,(hl) ld (var),a end: jp end var: db 0 list: db 1,2,3,4 list2: db 5,6,7,8
/**************************************************************************** * * Copyright (c) 2019 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 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. * ****************************************************************************/ /** * @file InvenSense_ICM20608G_registers.hpp * * Invensense ICM-20608-G registers. * */ #pragma once #include <cstdint> // TODO: move to a central header static constexpr uint8_t Bit0 = (1 << 0); static constexpr uint8_t Bit1 = (1 << 1); static constexpr uint8_t Bit2 = (1 << 2); static constexpr uint8_t Bit3 = (1 << 3); static constexpr uint8_t Bit4 = (1 << 4); static constexpr uint8_t Bit5 = (1 << 5); static constexpr uint8_t Bit6 = (1 << 6); static constexpr uint8_t Bit7 = (1 << 7); namespace InvenSense_ICM20608G { static constexpr uint32_t SPI_SPEED = 8 * 1000 * 1000; // 8MHz SPI serial interface static constexpr uint8_t DIR_READ = 0x80; static constexpr uint8_t WHOAMI = 0xAF; static constexpr float TEMPERATURE_SENSITIVITY = 326.8f; // LSB/C static constexpr float ROOM_TEMPERATURE_OFFSET = 25.f; // C enum class Register : uint8_t { CONFIG = 0x1A, GYRO_CONFIG = 0x1B, ACCEL_CONFIG = 0x1C, ACCEL_CONFIG2 = 0x1D, FIFO_EN = 0x23, INT_PIN_CFG = 0x37, INT_ENABLE = 0x38, TEMP_OUT_H = 0x41, TEMP_OUT_L = 0x42, USER_CTRL = 0x6A, PWR_MGMT_1 = 0x6B, FIFO_COUNTH = 0x72, FIFO_COUNTL = 0x73, FIFO_R_W = 0x74, WHO_AM_I = 0x75, }; // CONFIG enum CONFIG_BIT : uint8_t { FIFO_MODE = Bit6, // when the FIFO is full, additional writes will not be written to FIFO DLPF_CFG_BYPASS_DLPF_8KHZ = 7, // Rate 8 kHz [2:0] }; // GYRO_CONFIG enum GYRO_CONFIG_BIT : uint8_t { // FS_SEL [4:3] FS_SEL_250_DPS = 0, // 0b00000 FS_SEL_500_DPS = Bit3, // 0b01000 FS_SEL_1000_DPS = Bit4, // 0b10000 FS_SEL_2000_DPS = Bit4 | Bit3, // 0b11000 // FCHOICE_B [1:0] FCHOICE_B_8KHZ_BYPASS_DLPF = Bit1 | Bit0, // 0b00 - 3-dB BW: 3281 Noise BW (Hz): 3451.0 8 kHz }; // ACCEL_CONFIG enum ACCEL_CONFIG_BIT : uint8_t { // ACCEL_FS_SEL [4:3] ACCEL_FS_SEL_2G = 0, // 0b00000 ACCEL_FS_SEL_4G = Bit3, // 0b01000 ACCEL_FS_SEL_8G = Bit4, // 0b10000 ACCEL_FS_SEL_16G = Bit4 | Bit3, // 0b11000 }; // ACCEL_CONFIG2 enum ACCEL_CONFIG2_BIT : uint8_t { ACCEL_FCHOICE_B_BYPASS_DLPF = Bit3, }; // FIFO_EN enum FIFO_EN_BIT : uint8_t { TEMP_FIFO_EN = Bit7, XG_FIFO_EN = Bit6, YG_FIFO_EN = Bit5, ZG_FIFO_EN = Bit4, ACCEL_FIFO_EN = Bit3, }; // INT_PIN_CFG enum INT_PIN_CFG_BIT : uint8_t { INT_LEVEL = Bit7, }; // INT_ENABLE enum INT_ENABLE_BIT : uint8_t { DATA_RDY_INT_EN = Bit0 }; // USER_CTRL enum USER_CTRL_BIT : uint8_t { FIFO_EN = Bit6, I2C_IF_DIS = Bit4, FIFO_RST = Bit2, SIG_COND_RST = Bit0, }; // PWR_MGMT_1 enum PWR_MGMT_1_BIT : uint8_t { DEVICE_RESET = Bit7, SLEEP = Bit6, CLKSEL_2 = Bit2, CLKSEL_1 = Bit1, CLKSEL_0 = Bit0, }; namespace FIFO { static constexpr size_t SIZE = 512; // FIFO_DATA layout when FIFO_EN has both {X, Y, Z}G_FIFO_EN and ACCEL_FIFO_EN set struct DATA { uint8_t ACCEL_XOUT_H; uint8_t ACCEL_XOUT_L; uint8_t ACCEL_YOUT_H; uint8_t ACCEL_YOUT_L; uint8_t ACCEL_ZOUT_H; uint8_t ACCEL_ZOUT_L; uint8_t GYRO_XOUT_H; uint8_t GYRO_XOUT_L; uint8_t GYRO_YOUT_H; uint8_t GYRO_YOUT_L; uint8_t GYRO_ZOUT_H; uint8_t GYRO_ZOUT_L; }; } } // namespace InvenSense_ICM20608G
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r15 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x1dad7, %rsi lea addresses_WC_ht+0x13964, %rdi clflush (%rsi) cmp $39726, %rdx mov $105, %rcx rep movsl nop dec %r10 lea addresses_D_ht+0xf57, %r15 nop nop xor $28290, %r12 mov (%r15), %dx nop nop nop xor %rsi, %rsi lea addresses_WC_ht+0x1d557, %r12 nop nop nop nop and $18169, %rdx vmovups (%r12), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %r10 nop nop nop nop nop and $12128, %r15 lea addresses_normal_ht+0xeb57, %r15 nop nop nop nop nop add %rcx, %rcx movw $0x6162, (%r15) dec %r15 lea addresses_A_ht+0xb357, %rsi lea addresses_normal_ht+0x3197, %rdi nop nop nop nop nop inc %rdx mov $52, %rcx rep movsl nop nop nop nop nop inc %rdx lea addresses_A_ht+0x6155, %r12 xor %r15, %r15 vmovups (%r12), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r10 nop nop xor %rsi, %rsi lea addresses_D_ht+0x18557, %r15 nop nop and %r10, %r10 mov $0x6162636465666768, %rsi movq %rsi, (%r15) nop nop dec %rsi lea addresses_WT_ht+0x5857, %r12 nop and %r10, %r10 mov (%r12), %rcx nop nop add %rdi, %rdi lea addresses_D_ht+0x7266, %r15 nop nop add %rsi, %rsi mov $0x6162636465666768, %rdi movq %rdi, %xmm1 and $0xffffffffffffffc0, %r15 movntdq %xmm1, (%r15) nop add $12216, %r15 lea addresses_normal_ht+0x2e53, %rsi lea addresses_WC_ht+0x13f57, %rdi nop nop nop sub $27234, %rbp mov $12, %rcx rep movsq nop nop nop nop xor $28645, %rsi lea addresses_D_ht+0x1d17, %r15 nop nop nop add $19376, %rdi mov $0x6162636465666768, %r10 movq %r10, %xmm3 and $0xffffffffffffffc0, %r15 movaps %xmm3, (%r15) nop nop xor $9174, %rcx lea addresses_A_ht+0x17357, %rdi add %r15, %r15 mov $0x6162636465666768, %r10 movq %r10, (%rdi) xor $61577, %rsi lea addresses_normal_ht+0x18246, %rsi lea addresses_normal_ht+0x8c57, %rdi nop add $61567, %rdx mov $14, %rcx rep movsq nop nop nop cmp $49229, %rsi lea addresses_D_ht+0xa357, %rdx nop nop nop nop nop xor %rcx, %rcx movb (%rdx), %r10b nop nop nop nop cmp $53811, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi // Store lea addresses_normal+0x1f8b7, %rbx and %rsi, %rsi movw $0x5152, (%rbx) add %r10, %r10 // REPMOV lea addresses_UC+0x357, %rsi lea addresses_normal+0x1db57, %rdi nop nop nop nop inc %r10 mov $69, %rcx rep movsq nop inc %rcx // Store lea addresses_WC+0x14497, %r14 nop nop nop dec %rbp mov $0x5152535455565758, %r15 movq %r15, (%r14) nop nop nop add $3744, %rbp // Store lea addresses_WC+0x17f57, %rcx xor $54297, %rbx mov $0x5152535455565758, %rdi movq %rdi, (%rcx) nop nop nop nop nop add %r10, %r10 // Faulty Load lea addresses_UC+0x14357, %rsi nop nop nop xor %rdi, %rdi vmovups (%rsi), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %r14 lea oracles, %rbp and $0xff, %r14 shlq $12, %r14 mov (%rbp,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 5}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
/* * Copyright (c) 2016, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** * @file * This file implements mesh forwarding of IPv6/6LoWPAN messages. */ #include "mesh_forwarder.hpp" #include "common/code_utils.hpp" #include "common/debug.hpp" #include "common/encoding.hpp" #include "common/instance.hpp" #include "common/locator_getters.hpp" #include "common/logging.hpp" #include "common/message.hpp" #include "common/random.hpp" #include "common/time_ticker.hpp" #include "net/ip6.hpp" #include "net/ip6_filter.hpp" #include "net/netif.hpp" #include "net/tcp6.hpp" #include "net/udp6.hpp" #include "radio/radio.hpp" #include "thread/mle.hpp" #include "thread/mle_router.hpp" #include "thread/thread_netif.hpp" namespace ot { void ThreadLinkInfo::SetFrom(const Mac::RxFrame &aFrame) { Clear(); if (kErrorNone != aFrame.GetSrcPanId(mPanId)) { IgnoreError(aFrame.GetDstPanId(mPanId)); } mChannel = aFrame.GetChannel(); mRss = aFrame.GetRssi(); mLqi = aFrame.GetLqi(); mLinkSecurity = aFrame.GetSecurityEnabled(); #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE if (aFrame.GetTimeIe() != nullptr) { mNetworkTimeOffset = aFrame.ComputeNetworkTimeOffset(); mTimeSyncSeq = aFrame.ReadTimeSyncSeq(); } #endif #if OPENTHREAD_CONFIG_MULTI_RADIO mRadioType = static_cast<uint8_t>(aFrame.GetRadioType()); #endif } MeshForwarder::MeshForwarder(Instance &aInstance) : InstanceLocator(aInstance) , mMessageNextOffset(0) , mSendMessage(nullptr) , mMeshSource() , mMeshDest() , mAddMeshHeader(false) , mEnabled(false) , mTxPaused(false) , mSendBusy(false) , mScheduleTransmissionTask(aInstance, MeshForwarder::ScheduleTransmissionTask) #if OPENTHREAD_FTD , mIndirectSender(aInstance) #endif , mDataPollSender(aInstance) { mFragTag = Random::NonCrypto::GetUint16(); ResetCounters(); #if OPENTHREAD_FTD mFragmentPriorityList.Clear(); #endif } void MeshForwarder::Start(void) { if (!mEnabled) { Get<Mac::Mac>().SetRxOnWhenIdle(true); #if OPENTHREAD_FTD mIndirectSender.Start(); #endif mEnabled = true; } } void MeshForwarder::Stop(void) { VerifyOrExit(mEnabled); mDataPollSender.StopPolling(); Get<TimeTicker>().UnregisterReceiver(TimeTicker::kMeshForwarder); Get<Mle::DiscoverScanner>().Stop(); mSendQueue.DequeueAndFreeAll(); mReassemblyList.DequeueAndFreeAll(); #if OPENTHREAD_FTD mIndirectSender.Stop(); mFragmentPriorityList.Clear(); #endif mEnabled = false; mSendMessage = nullptr; Get<Mac::Mac>().SetRxOnWhenIdle(false); exit: return; } void MeshForwarder::PrepareEmptyFrame(Mac::TxFrame &aFrame, const Mac::Address &aMacDest, bool aAckRequest) { uint16_t fcf = 0; bool iePresent = CalcIePresent(nullptr); Mac::Address macSource; macSource.SetShort(Get<Mac::Mac>().GetShortAddress()); if (macSource.IsShortAddrInvalid() || aMacDest.IsExtended()) { macSource.SetExtended(Get<Mac::Mac>().GetExtAddress()); } fcf = Mac::Frame::kFcfFrameData | Mac::Frame::kFcfPanidCompression | Mac::Frame::kFcfSecurityEnabled; if (iePresent) { fcf |= Mac::Frame::kFcfIePresent; } fcf |= CalcFrameVersion(Get<NeighborTable>().FindNeighbor(aMacDest), iePresent); if (aAckRequest) { fcf |= Mac::Frame::kFcfAckRequest; } fcf |= (aMacDest.IsShort()) ? Mac::Frame::kFcfDstAddrShort : Mac::Frame::kFcfDstAddrExt; fcf |= (macSource.IsShort()) ? Mac::Frame::kFcfSrcAddrShort : Mac::Frame::kFcfSrcAddrExt; aFrame.InitMacHeader(fcf, Mac::Frame::kKeyIdMode1 | Mac::Frame::kSecEncMic32); if (aFrame.IsDstPanIdPresent()) { aFrame.SetDstPanId(Get<Mac::Mac>().GetPanId()); } IgnoreError(aFrame.SetSrcPanId(Get<Mac::Mac>().GetPanId())); aFrame.SetDstAddr(aMacDest); aFrame.SetSrcAddr(macSource); aFrame.SetFramePending(false); #if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT if (iePresent) { AppendHeaderIe(nullptr, aFrame); } #endif aFrame.SetPayloadLength(0); } void MeshForwarder::RemoveMessage(Message &aMessage) { PriorityQueue *queue = aMessage.GetPriorityQueue(); OT_ASSERT(queue != nullptr); if (queue == &mSendQueue) { #if OPENTHREAD_FTD for (Child &child : Get<ChildTable>().Iterate(Child::kInStateAnyExceptInvalid)) { IgnoreError(mIndirectSender.RemoveMessageFromSleepyChild(aMessage, child)); } #endif if (mSendMessage == &aMessage) { mSendMessage = nullptr; } } LogMessage(kMessageEvict, aMessage, nullptr, kErrorNoBufs); queue->DequeueAndFree(aMessage); } void MeshForwarder::ResumeMessageTransmissions(void) { if (mTxPaused) { mTxPaused = false; mScheduleTransmissionTask.Post(); } } void MeshForwarder::ScheduleTransmissionTask(Tasklet &aTasklet) { aTasklet.Get<MeshForwarder>().ScheduleTransmissionTask(); } void MeshForwarder::ScheduleTransmissionTask(void) { VerifyOrExit(!mSendBusy && !mTxPaused); mSendMessage = GetDirectTransmission(); VerifyOrExit(mSendMessage != nullptr); if (mSendMessage->GetOffset() == 0) { mSendMessage->SetTxSuccess(true); } Get<Mac::Mac>().RequestDirectFrameTransmission(); exit: return; } Message *MeshForwarder::GetDirectTransmission(void) { Message *curMessage, *nextMessage; Error error = kErrorNone; for (curMessage = mSendQueue.GetHead(); curMessage; curMessage = nextMessage) { if (!curMessage->GetDirectTransmission()) { nextMessage = curMessage->GetNext(); continue; } curMessage->SetDoNotEvict(true); switch (curMessage->GetType()) { case Message::kTypeIp6: error = UpdateIp6Route(*curMessage); break; #if OPENTHREAD_FTD case Message::kType6lowpan: error = UpdateMeshRoute(*curMessage); break; #endif #if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE case Message::kTypeMacEmptyData: error = kErrorNone; break; #endif default: error = kErrorDrop; break; } curMessage->SetDoNotEvict(false); // the next message may have been evicted during processing (e.g. due to Address Solicit) nextMessage = curMessage->GetNext(); switch (error) { case kErrorNone: ExitNow(); #if OPENTHREAD_FTD case kErrorAddressQuery: mSendQueue.Dequeue(*curMessage); mResolvingQueue.Enqueue(*curMessage); continue; #endif default: LogMessage(kMessageDrop, *curMessage, nullptr, error); mSendQueue.DequeueAndFree(*curMessage); continue; } } exit: return curMessage; } Error MeshForwarder::UpdateIp6Route(Message &aMessage) { Mle::MleRouter &mle = Get<Mle::MleRouter>(); Error error = kErrorNone; Ip6::Header ip6Header; mAddMeshHeader = false; IgnoreError(aMessage.Read(0, ip6Header)); VerifyOrExit(!ip6Header.GetSource().IsMulticast(), error = kErrorDrop); GetMacSourceAddress(ip6Header.GetSource(), mMacSource); if (mle.IsDisabled() || mle.IsDetached()) { if (ip6Header.GetDestination().IsLinkLocal() || ip6Header.GetDestination().IsLinkLocalMulticast()) { GetMacDestinationAddress(ip6Header.GetDestination(), mMacDest); } else { error = kErrorDrop; } ExitNow(); } if (ip6Header.GetDestination().IsMulticast()) { // With the exception of MLE multicasts and any other message // with link security disabled, an End Device transmits // multicasts, as IEEE 802.15.4 unicasts to its parent. if (mle.IsChild() && aMessage.IsLinkSecurityEnabled() && !aMessage.IsSubTypeMle()) { mMacDest.SetShort(mle.GetNextHop(Mac::kShortAddrBroadcast)); } else { mMacDest.SetShort(Mac::kShortAddrBroadcast); } } else if (ip6Header.GetDestination().IsLinkLocal()) { GetMacDestinationAddress(ip6Header.GetDestination(), mMacDest); } else if (mle.IsMinimalEndDevice()) { mMacDest.SetShort(mle.GetNextHop(Mac::kShortAddrBroadcast)); } else { #if OPENTHREAD_FTD error = UpdateIp6RouteFtd(ip6Header, aMessage); #else OT_ASSERT(false); #endif } exit: return error; } bool MeshForwarder::GetRxOnWhenIdle(void) const { return Get<Mac::Mac>().GetRxOnWhenIdle(); } void MeshForwarder::SetRxOnWhenIdle(bool aRxOnWhenIdle) { Get<Mac::Mac>().SetRxOnWhenIdle(aRxOnWhenIdle); if (aRxOnWhenIdle) { mDataPollSender.StopPolling(); #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE Get<Utils::SupervisionListener>().Stop(); #endif } else { mDataPollSender.StartPolling(); #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE Get<Utils::SupervisionListener>().Start(); #endif } } void MeshForwarder::GetMacSourceAddress(const Ip6::Address &aIp6Addr, Mac::Address &aMacAddr) { aIp6Addr.GetIid().ConvertToMacAddress(aMacAddr); if (aMacAddr.GetExtended() != Get<Mac::Mac>().GetExtAddress()) { aMacAddr.SetShort(Get<Mac::Mac>().GetShortAddress()); } } void MeshForwarder::GetMacDestinationAddress(const Ip6::Address &aIp6Addr, Mac::Address &aMacAddr) { if (aIp6Addr.IsMulticast()) { aMacAddr.SetShort(Mac::kShortAddrBroadcast); } else if (Get<Mle::MleRouter>().IsRoutingLocator(aIp6Addr)) { aMacAddr.SetShort(aIp6Addr.GetIid().GetLocator()); } else { aIp6Addr.GetIid().ConvertToMacAddress(aMacAddr); } } Error MeshForwarder::DecompressIp6Header(const uint8_t * aFrame, uint16_t aFrameLength, const Mac::Address &aMacSource, const Mac::Address &aMacDest, Ip6::Header & aIp6Header, uint8_t & aHeaderLength, bool & aNextHeaderCompressed) { Error error = kErrorNone; const uint8_t * start = aFrame; Lowpan::FragmentHeader fragmentHeader; uint16_t fragmentHeaderLength; int headerLength; if (fragmentHeader.ParseFrom(aFrame, aFrameLength, fragmentHeaderLength) == kErrorNone) { // Only the first fragment header is followed by a LOWPAN_IPHC header VerifyOrExit(fragmentHeader.GetDatagramOffset() == 0, error = kErrorNotFound); aFrame += fragmentHeaderLength; aFrameLength -= fragmentHeaderLength; } VerifyOrExit(aFrameLength >= 1 && Lowpan::Lowpan::IsLowpanHc(aFrame), error = kErrorNotFound); headerLength = Get<Lowpan::Lowpan>().DecompressBaseHeader(aIp6Header, aNextHeaderCompressed, aMacSource, aMacDest, aFrame, aFrameLength); VerifyOrExit(headerLength > 0, error = kErrorParse); aHeaderLength = static_cast<uint8_t>(aFrame - start) + static_cast<uint8_t>(headerLength); exit: return error; } Mac::TxFrame *MeshForwarder::HandleFrameRequest(Mac::TxFrames &aTxFrames) { Mac::TxFrame *frame = nullptr; bool addFragHeader = false; VerifyOrExit(mEnabled && (mSendMessage != nullptr)); #if OPENTHREAD_CONFIG_MULTI_RADIO frame = &Get<RadioSelector>().SelectRadio(*mSendMessage, mMacDest, aTxFrames); // If multi-radio link is supported, when sending frame with link // security enabled, Fragment Header is always included (even if // the message is small and does not require 6LoWPAN fragmentation). // This allows the Fragment Header's tag to be used to detect and // suppress duplicate received frames over different radio links. if (mSendMessage->IsLinkSecurityEnabled()) { addFragHeader = true; } #else frame = &aTxFrames.GetTxFrame(); #endif mSendBusy = true; switch (mSendMessage->GetType()) { case Message::kTypeIp6: if (mSendMessage->GetSubType() == Message::kSubTypeMleDiscoverRequest) { frame = Get<Mle::DiscoverScanner>().PrepareDiscoveryRequestFrame(*frame); VerifyOrExit(frame != nullptr); } #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE if (Get<Mac::Mac>().IsCslEnabled() && mSendMessage->IsSubTypeMle()) { mSendMessage->SetLinkSecurityEnabled(true); } #endif mMessageNextOffset = PrepareDataFrame(*frame, *mSendMessage, mMacSource, mMacDest, mAddMeshHeader, mMeshSource, mMeshDest, addFragHeader); if ((mSendMessage->GetSubType() == Message::kSubTypeMleChildIdRequest) && mSendMessage->IsLinkSecurityEnabled()) { otLogNoteMac("Child ID Request requires fragmentation, aborting tx"); mMessageNextOffset = mSendMessage->GetLength(); ExitNow(frame = nullptr); } OT_ASSERT(frame->GetLength() != 7); break; #if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE case Message::kTypeMacEmptyData: { Mac::Address macDestAddr; macDestAddr.SetShort(Get<Mle::MleRouter>().GetParent().GetRloc16()); PrepareEmptyFrame(*frame, macDestAddr, /* aAckRequest */ true); } break; #endif #if OPENTHREAD_FTD case Message::kType6lowpan: SendMesh(*mSendMessage, *frame); break; case Message::kTypeSupervision: // A direct supervision message is possible in the case where // a sleepy child switches its mode (becomes non-sleepy) while // there is a pending indirect supervision message in the send // queue for it. The message would be then converted to a // direct tx. OT_FALL_THROUGH; #endif default: mMessageNextOffset = mSendMessage->GetLength(); ExitNow(frame = nullptr); } frame->SetIsARetransmission(false); exit: return frame; } // This method constructs a MAC data from from a given IPv6 message. // // This method handles generation of MAC header, mesh header (if // requested), lowpan compression of IPv6 header, lowpan fragmentation // header (if message requires fragmentation or if it is explicitly // requested by setting `aAddFragHeader` to `true`) It uses the // message offset to construct next fragments. This method enables // link security when message is MLE type and requires fragmentation. // It returns the next offset into the message after the prepared // frame. // uint16_t MeshForwarder::PrepareDataFrame(Mac::TxFrame & aFrame, Message & aMessage, const Mac::Address &aMacSource, const Mac::Address &aMacDest, bool aAddMeshHeader, uint16_t aMeshSource, uint16_t aMeshDest, bool aAddFragHeader) { uint16_t fcf; uint8_t *payload; uint8_t headerLength; uint16_t maxPayloadLength; uint16_t payloadLength; uint16_t fragmentLength; uint16_t dstpan; uint8_t secCtl; uint16_t nextOffset; bool iePresent = CalcIePresent(&aMessage); start: // Initialize MAC header fcf = Mac::Frame::kFcfFrameData; fcf |= (aMacDest.IsShort()) ? Mac::Frame::kFcfDstAddrShort : Mac::Frame::kFcfDstAddrExt; fcf |= (aMacSource.IsShort()) ? Mac::Frame::kFcfSrcAddrShort : Mac::Frame::kFcfSrcAddrExt; if (iePresent) { fcf |= Mac::Frame::kFcfIePresent; } fcf |= CalcFrameVersion(Get<NeighborTable>().FindNeighbor(aMacDest), iePresent); // All unicast frames request ACK if (aMacDest.IsExtended() || !aMacDest.IsBroadcast()) { fcf |= Mac::Frame::kFcfAckRequest; } if (aMessage.IsLinkSecurityEnabled()) { fcf |= Mac::Frame::kFcfSecurityEnabled; switch (aMessage.GetSubType()) { case Message::kSubTypeJoinerEntrust: secCtl = static_cast<uint8_t>(Mac::Frame::kKeyIdMode0); break; case Message::kSubTypeMleAnnounce: secCtl = static_cast<uint8_t>(Mac::Frame::kKeyIdMode2); break; default: secCtl = static_cast<uint8_t>(Mac::Frame::kKeyIdMode1); break; } secCtl |= Mac::Frame::kSecEncMic32; } else { secCtl = Mac::Frame::kSecNone; } dstpan = Get<Mac::Mac>().GetPanId(); switch (aMessage.GetSubType()) { case Message::kSubTypeMleAnnounce: aFrame.SetChannel(aMessage.GetChannel()); dstpan = Mac::kPanIdBroadcast; break; case Message::kSubTypeMleDiscoverRequest: case Message::kSubTypeMleDiscoverResponse: dstpan = aMessage.GetPanId(); break; default: break; } // Handle special case in 15.4-2015: // Dest Address: Extended // Source Address: Extended // Dest PanId: Present // Src Panid: Not Present // Pan ID Compression: 0 if (dstpan == Get<Mac::Mac>().GetPanId() && ((fcf & Mac::Frame::kFcfFrameVersionMask) == Mac::Frame::kFcfFrameVersion2006 || (fcf & Mac::Frame::kFcfDstAddrMask) != Mac::Frame::kFcfDstAddrExt || (fcf & Mac::Frame::kFcfSrcAddrMask) != Mac::Frame::kFcfSrcAddrExt)) { #if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT // Handle a special case in IEEE 802.15.4-2015, when Pan ID Compression is 0, but Src Pan ID is not present: // Dest Address: Extended // Src Address: Extended // Dest Pan ID: Present // Src Pan ID: Not Present // Pan ID Compression: 0 if ((fcf & Mac::Frame::kFcfFrameVersionMask) != Mac::Frame::kFcfFrameVersion2015 || (fcf & Mac::Frame::kFcfDstAddrMask) != Mac::Frame::kFcfDstAddrExt || (fcf & Mac::Frame::kFcfSrcAddrMask) != Mac::Frame::kFcfSrcAddrExt) #endif { fcf |= Mac::Frame::kFcfPanidCompression; } } aFrame.InitMacHeader(fcf, secCtl); if (aFrame.IsDstPanIdPresent()) { aFrame.SetDstPanId(dstpan); } IgnoreError(aFrame.SetSrcPanId(Get<Mac::Mac>().GetPanId())); aFrame.SetDstAddr(aMacDest); aFrame.SetSrcAddr(aMacSource); #if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT if (iePresent) { AppendHeaderIe(&aMessage, aFrame); } #endif payload = aFrame.GetPayload(); maxPayloadLength = aFrame.GetMaxPayloadLength(); headerLength = 0; #if OPENTHREAD_FTD // Initialize Mesh header if (aAddMeshHeader) { Mle::MleRouter & mle = Get<Mle::MleRouter>(); Lowpan::MeshHeader meshHeader; uint16_t meshHeaderLength; uint8_t hopsLeft; // Mesh Header frames are forwarded by routers over multiple // hops to reach a final destination. The forwarding path can // have routers supporting different radio links with varying // MTU sizes. Since the originator of the frame does not know the // path and the MTU sizes of supported radio links by the routers // in the path, we limit the max payload length of a Mesh Header // frame to a fixed minimum value (derived from 15.4 radio) // ensuring it can be handled by any radio link. // // Maximum payload length is calculated by subtracting the frame // header and footer lengths from the MTU size. The footer // length is derived by removing the `aFrame.GetFcsSize()` and // then adding the fixed `kMeshHeaderFrameFcsSize` instead // (updating the FCS size in the calculation of footer length). maxPayloadLength = kMeshHeaderFrameMtu - aFrame.GetHeaderLength() - (aFrame.GetFooterLength() - aFrame.GetFcsSize() + kMeshHeaderFrameFcsSize); if (mle.IsChild()) { // REED sets hopsLeft to max (16) + 1. It does not know the route cost. hopsLeft = Mle::kMaxRouteCost + 1; } else { // Calculate the number of predicted hops. hopsLeft = mle.GetRouteCost(aMeshDest); if (hopsLeft != Mle::kMaxRouteCost) { hopsLeft += mle.GetLinkCost(Mle::Mle::RouterIdFromRloc16(mle.GetNextHop(aMeshDest))); } else { // In case there is no route to the destination router (only link). hopsLeft = mle.GetLinkCost(Mle::Mle::RouterIdFromRloc16(aMeshDest)); } } // The hopsLft field MUST be incremented by one if the // destination RLOC16 is not that of an active Router. if (!Mle::Mle::IsActiveRouter(aMeshDest)) { hopsLeft += 1; } meshHeader.Init(aMeshSource, aMeshDest, hopsLeft + Lowpan::MeshHeader::kAdditionalHopsLeft); meshHeaderLength = meshHeader.WriteTo(payload); payload += meshHeaderLength; headerLength += meshHeaderLength; } #endif // Compress IPv6 Header if (aMessage.GetOffset() == 0) { Lowpan::BufferWriter buffer(payload, maxPayloadLength - headerLength - Lowpan::FragmentHeader::kFirstFragmentHeaderSize); uint8_t hcLength; Mac::Address meshSource, meshDest; if (aAddMeshHeader) { meshSource.SetShort(aMeshSource); meshDest.SetShort(aMeshDest); } else { meshSource = aMacSource; meshDest = aMacDest; } SuccessOrAssert(Get<Lowpan::Lowpan>().Compress(aMessage, meshSource, meshDest, buffer)); hcLength = static_cast<uint8_t>(buffer.GetWritePointer() - payload); headerLength += hcLength; payloadLength = aMessage.GetLength() - aMessage.GetOffset(); fragmentLength = maxPayloadLength - headerLength; if ((payloadLength > fragmentLength) || aAddFragHeader) { Lowpan::FragmentHeader fragmentHeader; if ((!aMessage.IsLinkSecurityEnabled()) && aMessage.IsSubTypeMle()) { // Enable security and try again. aMessage.SetOffset(0); aMessage.SetLinkSecurityEnabled(true); goto start; } // Write Fragment header if (aMessage.GetDatagramTag() == 0) { // Avoid using datagram tag value 0, which indicates the tag has not been set if (mFragTag == 0) { mFragTag++; } aMessage.SetDatagramTag(mFragTag++); } memmove(payload + Lowpan::FragmentHeader::kFirstFragmentHeaderSize, payload, hcLength); fragmentHeader.InitFirstFragment(aMessage.GetLength(), static_cast<uint16_t>(aMessage.GetDatagramTag())); fragmentHeader.WriteTo(payload); payload += Lowpan::FragmentHeader::kFirstFragmentHeaderSize; headerLength += Lowpan::FragmentHeader::kFirstFragmentHeaderSize; fragmentLength = maxPayloadLength - headerLength; if (payloadLength > fragmentLength) { payloadLength = fragmentLength & ~0x7; } } payload += hcLength; // copy IPv6 Payload aMessage.ReadBytes(aMessage.GetOffset(), payload, payloadLength); aFrame.SetPayloadLength(headerLength + payloadLength); nextOffset = aMessage.GetOffset() + payloadLength; aMessage.SetOffset(0); } else { Lowpan::FragmentHeader fragmentHeader; uint16_t fragmentHeaderLength; payloadLength = aMessage.GetLength() - aMessage.GetOffset(); // Write Fragment header fragmentHeader.Init(aMessage.GetLength(), static_cast<uint16_t>(aMessage.GetDatagramTag()), aMessage.GetOffset()); fragmentHeaderLength = fragmentHeader.WriteTo(payload); payload += fragmentHeaderLength; headerLength += fragmentHeaderLength; fragmentLength = maxPayloadLength - headerLength; if (payloadLength > fragmentLength) { payloadLength = (fragmentLength & ~0x7); } // Copy IPv6 Payload aMessage.ReadBytes(aMessage.GetOffset(), payload, payloadLength); aFrame.SetPayloadLength(headerLength + payloadLength); nextOffset = aMessage.GetOffset() + payloadLength; } if (nextOffset < aMessage.GetLength()) { aFrame.SetFramePending(true); #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE aMessage.SetTimeSync(false); #endif } return nextOffset; } Neighbor *MeshForwarder::UpdateNeighborOnSentFrame(Mac::TxFrame &aFrame, Error aError, const Mac::Address &aMacDest) { Neighbor *neighbor = nullptr; VerifyOrExit(mEnabled); neighbor = Get<NeighborTable>().FindNeighbor(aMacDest); VerifyOrExit(neighbor != nullptr); VerifyOrExit(aFrame.GetAckRequest()); #if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE // TREL radio link uses deferred ack model. We ignore // `SendDone` event from `Mac` layer with success status and // wait for deferred ack callback instead. #if OPENTHREAD_CONFIG_MULTI_RADIO if (aFrame.GetRadioType() == Mac::kRadioTypeTrel) #endif { VerifyOrExit(aError != kErrorNone); } #endif // OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE if ((aFrame.GetHeaderIe(Mac::CslIe::kHeaderIeId) != nullptr) && aFrame.IsDataRequestCommand()) { UpdateNeighborLinkFailures(*neighbor, aError, /* aAllowNeighborRemove */ true, /* aFailLimit */ Mle::kFailedCslDataPollTransmissions); } else #endif { UpdateNeighborLinkFailures(*neighbor, aError, /* aAllowNeighborRemove */ true); } exit: return neighbor; } void MeshForwarder::UpdateNeighborLinkFailures(Neighbor &aNeighbor, Error aError, bool aAllowNeighborRemove, uint8_t aFailLimit) { // Update neighbor `LinkFailures` counter on ack error. if (aError == kErrorNone) { aNeighbor.ResetLinkFailures(); } else if (aError == kErrorNoAck) { aNeighbor.IncrementLinkFailures(); if (aAllowNeighborRemove && (Mle::Mle::IsActiveRouter(aNeighbor.GetRloc16())) && (aNeighbor.GetLinkFailures() >= aFailLimit)) { Get<Mle::MleRouter>().RemoveRouterLink(static_cast<Router &>(aNeighbor)); } } } #if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE void MeshForwarder::HandleDeferredAck(Neighbor &aNeighbor, Error aError) { bool allowNeighborRemove = true; VerifyOrExit(mEnabled); if (aError == kErrorNoAck) { otLogInfoMac("Deferred ack timeout on trel for neighbor %s rloc16:0x%04x", aNeighbor.GetExtAddress().ToString().AsCString(), aNeighbor.GetRloc16()); } #if OPENTHREAD_CONFIG_MULTI_RADIO // In multi radio mode, `RadioSelector` will update the neighbor's // link failure counter and removes the neighbor if required. Get<RadioSelector>().UpdateOnDeferredAck(aNeighbor, aError, allowNeighborRemove); #else UpdateNeighborLinkFailures(aNeighbor, aError, allowNeighborRemove); #endif exit: return; } #endif // #if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE void MeshForwarder::HandleSentFrame(Mac::TxFrame &aFrame, Error aError) { Neighbor * neighbor = nullptr; Mac::Address macDest; OT_ASSERT((aError == kErrorNone) || (aError == kErrorChannelAccessFailure) || (aError == kErrorAbort) || (aError == kErrorNoAck)); mSendBusy = false; VerifyOrExit(mEnabled); if (!aFrame.IsEmpty()) { IgnoreError(aFrame.GetDstAddr(macDest)); neighbor = UpdateNeighborOnSentFrame(aFrame, aError, macDest); } UpdateSendMessage(aError, macDest, neighbor); exit: return; } void MeshForwarder::UpdateSendMessage(Error aFrameTxError, Mac::Address &aMacDest, Neighbor *aNeighbor) { Error txError = aFrameTxError; VerifyOrExit(mSendMessage != nullptr); OT_ASSERT(mSendMessage->GetDirectTransmission()); if (aFrameTxError != kErrorNone) { // If the transmission of any fragment frame fails, // the overall message transmission is considered // as failed mSendMessage->SetTxSuccess(false); #if OPENTHREAD_CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE // We set the NextOffset to end of message to avoid sending // any remaining fragments in the message. mMessageNextOffset = mSendMessage->GetLength(); #endif } if (mMessageNextOffset < mSendMessage->GetLength()) { mSendMessage->SetOffset(mMessageNextOffset); ExitNow(); } txError = aFrameTxError; mSendMessage->ClearDirectTransmission(); mSendMessage->SetOffset(0); if (aNeighbor != nullptr) { aNeighbor->GetLinkInfo().AddMessageTxStatus(mSendMessage->GetTxSuccess()); } #if !OPENTHREAD_CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE // When `CONFIG_DROP_MESSAGE_ON_FRAGMENT_TX_FAILURE` is // disabled, all fragment frames of a larger message are // sent even if the transmission of an earlier fragment fail. // Note that `GetTxSuccess() tracks the tx success of the // entire message, while `aFrameTxError` represents the error // status of the last fragment frame transmission. if (!mSendMessage->GetTxSuccess() && (txError == kErrorNone)) { txError = kErrorFailed; } #endif #if OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE Get<Utils::HistoryTracker>().RecordTxMessage(*mSendMessage, aMacDest); #endif LogMessage(kMessageTransmit, *mSendMessage, &aMacDest, txError); if (mSendMessage->GetType() == Message::kTypeIp6) { if (mSendMessage->GetTxSuccess()) { mIpCounters.mTxSuccess++; } else { mIpCounters.mTxFailure++; } } switch (mSendMessage->GetSubType()) { case Message::kSubTypeMleDiscoverRequest: // Note that `HandleDiscoveryRequestFrameTxDone()` may update // `mSendMessage` and mark it again for direct transmission. Get<Mle::DiscoverScanner>().HandleDiscoveryRequestFrameTxDone(*mSendMessage); break; case Message::kSubTypeMleChildIdRequest: if (mSendMessage->IsLinkSecurityEnabled()) { // If the Child ID Request requires fragmentation and therefore // link layer security, the frame transmission will be aborted. // When the message is being freed, we signal to MLE to prepare a // shorter Child ID Request message (by only including mesh-local // address in the Address Registration TLV). otLogInfoMac("Requesting shorter `Child ID Request`"); Get<Mle::Mle>().RequestShorterChildIdRequest(); } break; default: break; } RemoveMessageIfNoPendingTx(*mSendMessage); exit: mScheduleTransmissionTask.Post(); } void MeshForwarder::RemoveMessageIfNoPendingTx(Message &aMessage) { VerifyOrExit(!aMessage.GetDirectTransmission() && !aMessage.IsChildPending()); if (mSendMessage == &aMessage) { mSendMessage = nullptr; mMessageNextOffset = 0; } mSendQueue.DequeueAndFree(aMessage); exit: return; } void MeshForwarder::HandleReceivedFrame(Mac::RxFrame &aFrame) { ThreadLinkInfo linkInfo; Mac::Address macDest; Mac::Address macSource; uint8_t * payload; uint16_t payloadLength; Error error = kErrorNone; VerifyOrExit(mEnabled, error = kErrorInvalidState); SuccessOrExit(error = aFrame.GetSrcAddr(macSource)); SuccessOrExit(error = aFrame.GetDstAddr(macDest)); linkInfo.SetFrom(aFrame); payload = aFrame.GetPayload(); payloadLength = aFrame.GetPayloadLength(); #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE Get<Utils::SupervisionListener>().UpdateOnReceive(macSource, linkInfo.IsLinkSecurityEnabled()); #endif switch (aFrame.GetType()) { case Mac::Frame::kFcfFrameData: if (Lowpan::MeshHeader::IsMeshHeader(payload, payloadLength)) { #if OPENTHREAD_FTD HandleMesh(payload, payloadLength, macSource, linkInfo); #endif } else if (Lowpan::FragmentHeader::IsFragmentHeader(payload, payloadLength)) { HandleFragment(payload, payloadLength, macSource, macDest, linkInfo); } else if (payloadLength >= 1 && Lowpan::Lowpan::IsLowpanHc(payload)) { HandleLowpanHC(payload, payloadLength, macSource, macDest, linkInfo); } else { VerifyOrExit(payloadLength == 0, error = kErrorNotLowpanDataFrame); LogFrame("Received empty payload frame", aFrame, kErrorNone); } break; case Mac::Frame::kFcfFrameBeacon: break; default: error = kErrorDrop; break; } exit: if (error != kErrorNone) { LogFrame("Dropping rx frame", aFrame, error); } } void MeshForwarder::HandleFragment(const uint8_t * aFrame, uint16_t aFrameLength, const Mac::Address & aMacSource, const Mac::Address & aMacDest, const ThreadLinkInfo &aLinkInfo) { Error error = kErrorNone; Lowpan::FragmentHeader fragmentHeader; uint16_t fragmentHeaderLength; Message * message = nullptr; // Check the fragment header SuccessOrExit(error = fragmentHeader.ParseFrom(aFrame, aFrameLength, fragmentHeaderLength)); aFrame += fragmentHeaderLength; aFrameLength -= fragmentHeaderLength; #if OPENTHREAD_CONFIG_MULTI_RADIO if (aLinkInfo.mLinkSecurity) { Neighbor *neighbor = Get<NeighborTable>().FindNeighbor(aMacSource, Neighbor::kInStateAnyExceptInvalid); if (neighbor != nullptr) { uint16_t tag = fragmentHeader.GetDatagramTag(); if (neighbor->IsLastRxFragmentTagSet()) { VerifyOrExit(!neighbor->IsLastRxFragmentTagAfter(tag), error = kErrorDuplicated); if (neighbor->GetLastRxFragmentTag() == tag) { VerifyOrExit(fragmentHeader.GetDatagramOffset() != 0, error = kErrorDuplicated); // Duplication suppression for a "next fragment" is handled // by the code below where the the datagram offset is // checked against the offset of the corresponding message // (same datagram tag and size) in Reassembly List. Note // that if there is no matching message in the Reassembly // List (e.g., in case the message is already fully // assembled) the received "next fragment" frame would be // dropped. } } neighbor->SetLastRxFragmentTag(tag); } } #endif // OPENTHREAD_CONFIG_MULTI_RADIO if (fragmentHeader.GetDatagramOffset() == 0) { uint16_t datagramSize = fragmentHeader.GetDatagramSize(); #if OPENTHREAD_FTD UpdateRoutes(aFrame, aFrameLength, aMacSource, aMacDest); #endif error = FrameToMessage(aFrame, aFrameLength, datagramSize, aMacSource, aMacDest, message); SuccessOrExit(error); VerifyOrExit(datagramSize >= message->GetLength(), error = kErrorParse); error = message->SetLength(datagramSize); SuccessOrExit(error); message->SetDatagramTag(fragmentHeader.GetDatagramTag()); message->SetTimeout(kReassemblyTimeout); message->SetLinkInfo(aLinkInfo); VerifyOrExit(Get<Ip6::Filter>().Accept(*message), error = kErrorDrop); #if OPENTHREAD_FTD SendIcmpErrorIfDstUnreach(*message, aMacSource, aMacDest); #endif // Allow re-assembly of only one message at a time on a SED by clearing // any remaining fragments in reassembly list upon receiving of a new // (secure) first fragment. if (!GetRxOnWhenIdle() && message->IsLinkSecurityEnabled()) { ClearReassemblyList(); } mReassemblyList.Enqueue(*message); Get<TimeTicker>().RegisterReceiver(TimeTicker::kMeshForwarder); } else // Received frame is a "next fragment". { for (message = mReassemblyList.GetHead(); message; message = message->GetNext()) { // Security Check: only consider reassembly buffers that had the same Security Enabled setting. if (message->GetLength() == fragmentHeader.GetDatagramSize() && message->GetDatagramTag() == fragmentHeader.GetDatagramTag() && message->GetOffset() == fragmentHeader.GetDatagramOffset() && message->GetOffset() + aFrameLength <= fragmentHeader.GetDatagramSize() && message->IsLinkSecurityEnabled() == aLinkInfo.IsLinkSecurityEnabled()) { break; } } // For a sleepy-end-device, if we receive a new (secure) next fragment // with a non-matching fragmentation offset or tag, it indicates that // we have either missed a fragment, or the parent has moved to a new // message with a new tag. In either case, we can safely clear any // remaining fragments stored in the reassembly list. if (!GetRxOnWhenIdle() && (message == nullptr) && aLinkInfo.IsLinkSecurityEnabled()) { ClearReassemblyList(); } VerifyOrExit(message != nullptr, error = kErrorDrop); message->WriteBytes(message->GetOffset(), aFrame, aFrameLength); message->MoveOffset(aFrameLength); message->AddRss(aLinkInfo.GetRss()); #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE message->AddLqi(aLinkInfo.GetLqi()); #endif message->SetTimeout(kReassemblyTimeout); } exit: if (error == kErrorNone) { if (message->GetOffset() >= message->GetLength()) { mReassemblyList.Dequeue(*message); IgnoreError(HandleDatagram(*message, aLinkInfo, aMacSource)); } } else { LogFragmentFrameDrop(error, aFrameLength, aMacSource, aMacDest, fragmentHeader, aLinkInfo.IsLinkSecurityEnabled()); FreeMessage(message); } } void MeshForwarder::ClearReassemblyList(void) { for (const Message *message = mReassemblyList.GetHead(); message != nullptr; message = message->GetNext()) { LogMessage(kMessageReassemblyDrop, *message, nullptr, kErrorNoFrameReceived); if (message->GetType() == Message::kTypeIp6) { mIpCounters.mRxFailure++; } } mReassemblyList.DequeueAndFreeAll(); } void MeshForwarder::HandleTimeTick(void) { bool contineRxingTicks = false; #if OPENTHREAD_FTD contineRxingTicks = mFragmentPriorityList.UpdateOnTimeTick(); #endif contineRxingTicks = UpdateReassemblyList() || contineRxingTicks; if (!contineRxingTicks) { Get<TimeTicker>().UnregisterReceiver(TimeTicker::kMeshForwarder); } } bool MeshForwarder::UpdateReassemblyList(void) { Message *next = nullptr; for (Message *message = mReassemblyList.GetHead(); message; message = next) { next = message->GetNext(); if (message->GetTimeout() > 0) { message->DecrementTimeout(); } else { LogMessage(kMessageReassemblyDrop, *message, nullptr, kErrorReassemblyTimeout); if (message->GetType() == Message::kTypeIp6) { mIpCounters.mRxFailure++; } mReassemblyList.DequeueAndFree(*message); } } return mReassemblyList.GetHead() != nullptr; } Error MeshForwarder::FrameToMessage(const uint8_t * aFrame, uint16_t aFrameLength, uint16_t aDatagramSize, const Mac::Address &aMacSource, const Mac::Address &aMacDest, Message *& aMessage) { Error error = kErrorNone; int headerLength; Message::Priority priority; error = GetFramePriority(aFrame, aFrameLength, aMacSource, aMacDest, priority); SuccessOrExit(error); aMessage = Get<MessagePool>().New(Message::kTypeIp6, 0, priority); VerifyOrExit(aMessage, error = kErrorNoBufs); headerLength = Get<Lowpan::Lowpan>().Decompress(*aMessage, aMacSource, aMacDest, aFrame, aFrameLength, aDatagramSize); VerifyOrExit(headerLength > 0, error = kErrorParse); aFrame += headerLength; aFrameLength -= static_cast<uint16_t>(headerLength); SuccessOrExit(error = aMessage->SetLength(aMessage->GetLength() + aFrameLength)); aMessage->WriteBytes(aMessage->GetOffset(), aFrame, aFrameLength); aMessage->MoveOffset(aFrameLength); exit: return error; } void MeshForwarder::HandleLowpanHC(const uint8_t * aFrame, uint16_t aFrameLength, const Mac::Address & aMacSource, const Mac::Address & aMacDest, const ThreadLinkInfo &aLinkInfo) { Error error = kErrorNone; Message *message = nullptr; #if OPENTHREAD_FTD UpdateRoutes(aFrame, aFrameLength, aMacSource, aMacDest); #endif SuccessOrExit(error = FrameToMessage(aFrame, aFrameLength, 0, aMacSource, aMacDest, message)); message->SetLinkInfo(aLinkInfo); VerifyOrExit(Get<Ip6::Filter>().Accept(*message), error = kErrorDrop); #if OPENTHREAD_FTD SendIcmpErrorIfDstUnreach(*message, aMacSource, aMacDest); #endif exit: if (error == kErrorNone) { IgnoreError(HandleDatagram(*message, aLinkInfo, aMacSource)); } else { LogLowpanHcFrameDrop(error, aFrameLength, aMacSource, aMacDest, aLinkInfo.IsLinkSecurityEnabled()); FreeMessage(message); } } Error MeshForwarder::HandleDatagram(Message &aMessage, const ThreadLinkInfo &aLinkInfo, const Mac::Address &aMacSource) { ThreadNetif &netif = Get<ThreadNetif>(); #if OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE Get<Utils::HistoryTracker>().RecordRxMessage(aMessage, aMacSource); #endif LogMessage(kMessageReceive, aMessage, &aMacSource, kErrorNone); if (aMessage.GetType() == Message::kTypeIp6) { mIpCounters.mRxSuccess++; } return Get<Ip6::Ip6>().HandleDatagram(aMessage, &netif, &aLinkInfo, false); } Error MeshForwarder::GetFramePriority(const uint8_t * aFrame, uint16_t aFrameLength, const Mac::Address &aMacSource, const Mac::Address &aMacDest, Message::Priority & aPriority) { Error error = kErrorNone; Ip6::Header ip6Header; uint16_t dstPort; uint8_t headerLength; bool nextHeaderCompressed; SuccessOrExit(error = DecompressIp6Header(aFrame, aFrameLength, aMacSource, aMacDest, ip6Header, headerLength, nextHeaderCompressed)); aPriority = Ip6::Ip6::DscpToPriority(ip6Header.GetDscp()); aFrame += headerLength; aFrameLength -= headerLength; switch (ip6Header.GetNextHeader()) { case Ip6::kProtoIcmp6: VerifyOrExit(aFrameLength >= sizeof(Ip6::Icmp::Header), error = kErrorParse); // Only ICMPv6 error messages are prioritized. if (reinterpret_cast<const Ip6::Icmp::Header *>(aFrame)->IsError()) { aPriority = Message::kPriorityNet; } break; case Ip6::kProtoUdp: if (nextHeaderCompressed) { Ip6::Udp::Header udpHeader; VerifyOrExit(Get<Lowpan::Lowpan>().DecompressUdpHeader(udpHeader, aFrame, aFrameLength) >= 0, error = kErrorParse); dstPort = udpHeader.GetDestinationPort(); } else { VerifyOrExit(aFrameLength >= sizeof(Ip6::Udp::Header), error = kErrorParse); dstPort = reinterpret_cast<const Ip6::Udp::Header *>(aFrame)->GetDestinationPort(); } if ((dstPort == Mle::kUdpPort) || (dstPort == Tmf::kUdpPort)) { aPriority = Message::kPriorityNet; } break; default: break; } exit: return error; } #if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE Error MeshForwarder::SendEmptyMessage(void) { Error error = kErrorNone; Message *message = nullptr; VerifyOrExit(mEnabled && !Get<Mac::Mac>().GetRxOnWhenIdle() && Get<Mle::MleRouter>().GetParent().IsStateValidOrRestoring(), error = kErrorInvalidState); message = Get<MessagePool>().New(Message::kTypeMacEmptyData, 0); VerifyOrExit(message != nullptr, error = kErrorNoBufs); SuccessOrExit(error = SendMessage(*message)); exit: FreeMessageOnError(message, error); otLogDebgMac("Send empty message, error:%s", ErrorToString(error)); return error; } #endif // OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE bool MeshForwarder::CalcIePresent(const Message *aMessage) { bool iePresent = false; OT_UNUSED_VARIABLE(aMessage); #if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE iePresent |= (aMessage != nullptr && aMessage->IsTimeSync()); #endif #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE iePresent |= Get<Mac::Mac>().IsCslEnabled(); #endif #endif return iePresent; } #if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT void MeshForwarder::AppendHeaderIe(const Message *aMessage, Mac::TxFrame &aFrame) { uint8_t index = 0; bool iePresent = false; bool payloadPresent = (aFrame.GetType() == Mac::Frame::kFcfFrameMacCmd) || (aMessage != nullptr && aMessage->GetLength() != 0); #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE if (aMessage != nullptr && aMessage->IsTimeSync()) { IgnoreError(aFrame.AppendHeaderIeAt<Mac::TimeIe>(index)); iePresent = true; } #endif #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE if (Get<Mac::Mac>().IsCslEnabled()) { IgnoreError(aFrame.AppendHeaderIeAt<Mac::CslIe>(index)); aFrame.mInfo.mTxInfo.mCslPresent = true; iePresent = true; } else { aFrame.mInfo.mTxInfo.mCslPresent = false; } #endif if (iePresent && payloadPresent) { // Assume no Payload IE in current implementation IgnoreError(aFrame.AppendHeaderIeAt<Mac::Termination2Ie>(index)); } } #endif uint16_t MeshForwarder::CalcFrameVersion(const Neighbor *aNeighbor, bool aIePresent) { uint16_t version = Mac::Frame::kFcfFrameVersion2006; OT_UNUSED_VARIABLE(aNeighbor); if (aIePresent) { version = Mac::Frame::kFcfFrameVersion2015; } #if OPENTHREAD_FTD && OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE else if (aNeighbor != nullptr && !Mle::MleRouter::IsActiveRouter(aNeighbor->GetRloc16()) && static_cast<const Child *>(aNeighbor)->IsCslSynchronized()) { version = Mac::Frame::kFcfFrameVersion2015; } #endif #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE else if (aNeighbor != nullptr && aNeighbor->IsEnhAckProbingActive()) { version = Mac::Frame::kFcfFrameVersion2015; ///< Set version to 2015 to fetch Link Metrics data in Enh-ACK. } #endif return version; } // LCOV_EXCL_START Error MeshForwarder::ParseIp6UdpTcpHeader(const Message &aMessage, Ip6::Header & aIp6Header, uint16_t & aChecksum, uint16_t & aSourcePort, uint16_t & aDestPort) { Error error = kErrorParse; union { Ip6::Udp::Header udp; Ip6::Tcp::Header tcp; } header; aChecksum = 0; aSourcePort = 0; aDestPort = 0; SuccessOrExit(aMessage.Read(0, aIp6Header)); VerifyOrExit(aIp6Header.IsVersion6()); switch (aIp6Header.GetNextHeader()) { case Ip6::kProtoUdp: SuccessOrExit(aMessage.Read(sizeof(Ip6::Header), header.udp)); aChecksum = header.udp.GetChecksum(); aSourcePort = header.udp.GetSourcePort(); aDestPort = header.udp.GetDestinationPort(); break; case Ip6::kProtoTcp: SuccessOrExit(aMessage.Read(sizeof(Ip6::Header), header.tcp)); aChecksum = header.tcp.GetChecksum(); aSourcePort = header.tcp.GetSourcePort(); aDestPort = header.tcp.GetDestinationPort(); break; default: break; } error = kErrorNone; exit: return error; } #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1) const char *MeshForwarder::MessageActionToString(MessageAction aAction, Error aError) { static const char *const kMessageActionStrings[] = { "Received", // (0) kMessageReceive "Sent", // (1) kMessageTransmit "Prepping indir tx", // (2) kMessagePrepareIndirect "Dropping", // (3) kMessageDrop "Dropping (reassembly queue)", // (4) kMessageReassemblyDrop "Evicting", // (5) kMessageEvict }; static_assert(kMessageReceive == 0, "kMessageReceive value is incorrect"); static_assert(kMessageTransmit == 1, "kMessageTransmit value is incorrect"); static_assert(kMessagePrepareIndirect == 2, "kMessagePrepareIndirect value is incorrect"); static_assert(kMessageDrop == 3, "kMessageDrop value is incorrect"); static_assert(kMessageReassemblyDrop == 4, "kMessageReassemblyDrop value is incorrect"); static_assert(kMessageEvict == 5, "kMessageEvict value is incorrect"); return (aError == kErrorNone) ? kMessageActionStrings[aAction] : "Failed to send"; } const char *MeshForwarder::MessagePriorityToString(const Message &aMessage) { return Message::PriorityToString(aMessage.GetPriority()); } #if OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES void MeshForwarder::LogIp6SourceDestAddresses(Ip6::Header &aIp6Header, uint16_t aSourcePort, uint16_t aDestPort, otLogLevel aLogLevel) { if (aSourcePort != 0) { otLogMac(aLogLevel, " src:[%s]:%d", aIp6Header.GetSource().ToString().AsCString(), aSourcePort); } else { otLogMac(aLogLevel, " src:[%s]", aIp6Header.GetSource().ToString().AsCString()); } if (aDestPort != 0) { otLogMac(aLogLevel, " dst:[%s]:%d", aIp6Header.GetDestination().ToString().AsCString(), aDestPort); } else { otLogMac(aLogLevel, " dst:[%s]", aIp6Header.GetDestination().ToString().AsCString()); } } #else void MeshForwarder::LogIp6SourceDestAddresses(Ip6::Header &, uint16_t, uint16_t, otLogLevel) { } #endif void MeshForwarder::LogIp6Message(MessageAction aAction, const Message & aMessage, const Mac::Address *aMacAddress, Error aError, otLogLevel aLogLevel) { Ip6::Header ip6Header; uint16_t checksum; uint16_t sourcePort; uint16_t destPort; bool shouldLogRss; bool shouldLogRadio = false; const char *radioString = ""; SuccessOrExit(ParseIp6UdpTcpHeader(aMessage, ip6Header, checksum, sourcePort, destPort)); shouldLogRss = (aAction == kMessageReceive) || (aAction == kMessageReassemblyDrop); #if OPENTHREAD_CONFIG_MULTI_RADIO shouldLogRadio = true; radioString = aMessage.IsRadioTypeSet() ? RadioTypeToString(aMessage.GetRadioType()) : "all"; #endif otLogMac(aLogLevel, "%s IPv6 %s msg, len:%d, chksum:%04x%s%s, sec:%s%s%s, prio:%s%s%s%s%s", MessageActionToString(aAction, aError), Ip6::Ip6::IpProtoToString(ip6Header.GetNextHeader()), aMessage.GetLength(), checksum, (aMacAddress == nullptr) ? "" : ((aAction == kMessageReceive) ? ", from:" : ", to:"), (aMacAddress == nullptr) ? "" : aMacAddress->ToString().AsCString(), aMessage.IsLinkSecurityEnabled() ? "yes" : "no", (aError == kErrorNone) ? "" : ", error:", (aError == kErrorNone) ? "" : ErrorToString(aError), MessagePriorityToString(aMessage), shouldLogRss ? ", rss:" : "", shouldLogRss ? aMessage.GetRssAverager().ToString().AsCString() : "", shouldLogRadio ? ", radio:" : "", radioString); if (aAction != kMessagePrepareIndirect) { LogIp6SourceDestAddresses(ip6Header, sourcePort, destPort, aLogLevel); } exit: return; } void MeshForwarder::LogMessage(MessageAction aAction, const Message & aMessage, const Mac::Address *aMacAddress, Error aError) { otLogLevel logLevel = OT_LOG_LEVEL_INFO; switch (aAction) { case kMessageReceive: case kMessageTransmit: case kMessagePrepareIndirect: logLevel = (aError == kErrorNone) ? OT_LOG_LEVEL_INFO : OT_LOG_LEVEL_NOTE; break; case kMessageDrop: case kMessageReassemblyDrop: case kMessageEvict: logLevel = OT_LOG_LEVEL_NOTE; break; } VerifyOrExit(Instance::GetLogLevel() >= logLevel); switch (aMessage.GetType()) { case Message::kTypeIp6: LogIp6Message(aAction, aMessage, aMacAddress, aError, logLevel); break; #if OPENTHREAD_FTD case Message::kType6lowpan: LogMeshMessage(aAction, aMessage, aMacAddress, aError, logLevel); break; #endif default: break; } exit: return; } void MeshForwarder::LogFrame(const char *aActionText, const Mac::Frame &aFrame, Error aError) { if (aError != kErrorNone) { otLogNoteMac("%s, aError:%s, %s", aActionText, ErrorToString(aError), aFrame.ToInfoString().AsCString()); } else { otLogInfoMac("%s, %s", aActionText, aFrame.ToInfoString().AsCString()); } } void MeshForwarder::LogFragmentFrameDrop(Error aError, uint16_t aFrameLength, const Mac::Address & aMacSource, const Mac::Address & aMacDest, const Lowpan::FragmentHeader &aFragmentHeader, bool aIsSecure) { otLogNoteMac("Dropping rx frag frame, error:%s, len:%d, src:%s, dst:%s, tag:%d, offset:%d, dglen:%d, sec:%s", ErrorToString(aError), aFrameLength, aMacSource.ToString().AsCString(), aMacDest.ToString().AsCString(), aFragmentHeader.GetDatagramTag(), aFragmentHeader.GetDatagramOffset(), aFragmentHeader.GetDatagramSize(), aIsSecure ? "yes" : "no"); } void MeshForwarder::LogLowpanHcFrameDrop(Error aError, uint16_t aFrameLength, const Mac::Address &aMacSource, const Mac::Address &aMacDest, bool aIsSecure) { otLogNoteMac("Dropping rx lowpan HC frame, error:%s, len:%d, src:%s, dst:%s, sec:%s", ErrorToString(aError), aFrameLength, aMacSource.ToString().AsCString(), aMacDest.ToString().AsCString(), aIsSecure ? "yes" : "no"); } #else // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1) void MeshForwarder::LogMessage(MessageAction, const Message &, const Mac::Address *, Error) { } void MeshForwarder::LogFrame(const char *, const Mac::Frame &, Error) { } void MeshForwarder::LogFragmentFrameDrop(Error, uint16_t, const Mac::Address &, const Mac::Address &, const Lowpan::FragmentHeader &, bool) { } void MeshForwarder::LogLowpanHcFrameDrop(Error, uint16_t, const Mac::Address &, const Mac::Address &, bool) { } #endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1) // LCOV_EXCL_STOP } // namespace ot
#ifndef BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP #define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // text_woarchive.hpp // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #include <boost/config.hpp> #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else #include <ostream> #include <cstddef> // size_t #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::size_t; } // namespace std #endif #include <boost/archive/detail/auto_link_warchive.hpp> #include <boost/archive/basic_text_oprimitive.hpp> #include <boost/archive/basic_text_oarchive.hpp> #include <boost/archive/detail/register_archive.hpp> #include <boost/archive/detail/abi_prefix.hpp> // must be the last header #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif namespace boost { namespace archive { template<class Archive> class text_woarchive_impl : public basic_text_oprimitive<std::wostream>, public basic_text_oarchive<Archive> { #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else friend class detail::interface_oarchive<Archive>; friend class basic_text_oarchive<Archive>; friend class save_access; protected: #endif template<class T> void save(const T & t){ this->newtoken(); basic_text_oprimitive<std::wostream>::save(t); } BOOST_WARCHIVE_DECL(void) save(const char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T BOOST_WARCHIVE_DECL(void) save(const wchar_t * t); #endif BOOST_WARCHIVE_DECL(void) save(const std::string &s); #ifndef BOOST_NO_STD_WSTRING BOOST_WARCHIVE_DECL(void) save(const std::wstring &ws); #endif text_woarchive_impl(std::wostream & os, unsigned int flags) : basic_text_oprimitive<std::wostream>( os, 0 != (flags & no_codecvt) ), basic_text_oarchive<Archive>(flags) { if(0 == (flags & no_header)) basic_text_oarchive<Archive>::init(); } public: void save_binary(const void *address, std::size_t count){ put(static_cast<wchar_t>('\n')); this->end_preamble(); #if ! defined(__MWERKS__) this->basic_text_oprimitive<std::wostream>::save_binary( #else this->basic_text_oprimitive::save_binary( #endif address, count ); put(static_cast<wchar_t>('\n')); this->delimiter = this->none; } }; // we use the following because we can't use // typedef text_oarchive_impl<text_oarchive_impl<...> > text_oarchive; // do not derive from this class. If you want to extend this functionality // via inhertance, derived from text_oarchive_impl instead. This will // preserve correct static polymorphism. class text_woarchive : public text_woarchive_impl<text_woarchive> { public: text_woarchive(std::wostream & os, unsigned int flags = 0) : text_woarchive_impl<text_woarchive>(os, flags) {} ~text_woarchive(){} }; typedef text_woarchive naked_text_woarchive; } // namespace archive } // namespace boost // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_woarchive) #ifdef BOOST_MSVC #pragma warning(pop) #endif #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #endif // BOOST_NO_STD_WSTREAMBUF #endif // BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP
; void fzx_state_init(struct fzx_state *fs, struct fzx_font *ff, struct r_Rect16 *window) SECTION code_font_fzx PUBLIC fzx_state_init_callee EXTERN asm_fzx_state_init fzx_state_init_callee: pop hl pop de pop bc ex (sp),hl jp asm_fzx_state_init
; char __CALLEE__ *strchrnul_callee(char *s, char c) ; return ptr to first occurrence of c in s ; 04.2001 dom, 04.2012 stefano PUBLIC strchrnul_callee PUBLIC ASMDISP_STRCHRNUL_CALLEE .strchrnul_callee pop hl pop bc ex (sp),hl ; enter : c = char c ; hl = char *s ; exit : found : hl = ptr, NC flag set ; else : hl = 0, C flag set ; uses : af, hl .asmentry .loop ld a,(hl) cp c ret z inc hl or a jp nz, loop dec hl ; ld l,a ; ld h,a scf ret DEFC ASMDISP_STRCHRNUL_CALLEE = # asmentry - strchrnul_callee
; A296716: Numbers congruent to {7, 11, 13, 29} mod 30. ; Submitted by Christian Krause ; 7,11,13,29,37,41,43,59,67,71,73,89,97,101,103,119,127,131,133,149,157,161,163,179,187,191,193,209,217,221,223,239,247,251,253,269,277,281,283,299,307,311,313,329,337,341,343,359,367,371,373,389,397,401,403,419,427,431,433,449,457,461,463,479,487,491,493,509,517,521,523,539,547,551,553,569,577,581,583,599,607,611,613,629,637,641,643,659,667,671,673,689,697,701,703,719,727,731,733,749 mov $3,1 lpb $0 sub $0,1 add $3,1 mov $2,$3 add $3,$1 mov $1,11 mul $1,$2 mod $1,15 lpe mov $0,$2 mul $0,2 add $0,7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; File: OS.ASM ;;; Purpose: provide PennSim with an OS to handle I/O ;;; PennSim will load the contents of this file in x8200 ;;; author: Amir Roth; modified by CJT 10/17/10; by TJF 3/17/14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; OS - TRAP VECTOR TABLE ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; when user calls a trap, PC jumps here ; then the "JMP" below jumps to trap implementation .OS .CODE .ADDR x8000 ; TRAP vector table JMP TRAP_GETC ; x00 JMP TRAP_PUTC ; x01 JMP TRAP_PUTS ; x02 JMP TRAP_VIDEO_COLOR ; x03 JMP TRAP_DRAW_PIXEL ; x04 JMP TRAP_DRAW_CIRCLE ; x05 JMP TRAP_DRAW_SPRITE ; x06 JMP TRAP_TIMER ; x07 JMP TRAP_GETC_TIMER ; x08 JMP TRAP_LFSR_SET_SEED ; x09 JMP TRAP_LFSR ; x0A JMP TRAP_HALT ; x0B JMP TRAP_RESET_VMEM ; x0C JMP TRAP_BLT_VMEM ; x0D ; this table can go up to xFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; OS - MEMORY ADDRESS CONSTANTS ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; these handy alias' will be used in the TRAPs that follow USER_CODE_ADDR .UCONST x0000 ; start of USER code OS_CODE_ADDR .UCONST x8000 ; start of OS code OS_GLOBALS_ADDR .UCONST xA000 ; start of OS global mem OS_STACK_ADDR .UCONST xBFFF ; start of OS stack mem OS_VIDEO_ADDR .UCONST xC000 ; start of OS video mem OS_VIDEO_NUM_COLS .UCONST #128 ; columns in video mem OS_VIDEO_NUM_ROWS .UCONST #124 ; rows in video mem OS_KBSR_ADDR .UCONST xFE00 ; keyboard status register OS_KBDR_ADDR .UCONST xFE02 ; keyboard data register OS_ADSR_ADDR .UCONST xFE04 ; display status register OS_ADDR_ADDR .UCONST xFE06 ; display data register OS_TSR_ADDR .UCONST xFE08 ; timer register OS_TIR_ADDR .UCONST xFE0A ; timer interval register OS_VDCR_ADDR .UCONST xFE0C ; video display control register OS_MCR_ADDR .UCONST xFFEE ; machine control register TIM_INIT .UCONST #320 ; default value for timer MASK_L15 .UCONST x7FFF ; handy masks to clear regs MASK_H4 .UCONST xF000 MASK_H1 .UCONST x8000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; OS RESERVE VIDEO MEMORY ;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .DATA .ADDR xC000 OS_VIDEO_MEM .BLKW x3E00 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; OS RESERVE GLOBAL MEMORY ;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .DATA .ADDR xA000 OS_GLOBALS_MEM .BLKW x1000 ;;; LFSR value used by lfsr code LFSR .FILL 0x0001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;; OS & TRAP SUBROUTINES START HERE ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; OS_START ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Initalize Timer and return to user memory: x0000 ;;; Inputs - none ;;; Outputs - none .CODE .ADDR x8200 OS_START ;; initialize timer LC R0, TIM_INIT LC R1, OS_TIR_ADDR STR R0, R1, #0 ;; R7 <- User code address (x0000) LC R7, USER_CODE_ADDR RTI ; RTI removes the privilege bit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_HALT ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: halts the program and jumps to OS_START ;;; Inputs - none ;;; Outputs - none .CODE TRAP_HALT ; clear run bit in MCR LC R3, OS_MCR_ADDR LDR R0, R3, #0 LC R1, MASK_L15 AND R0,R0, R1 STR R0, R3, #0 JMP OS_START ; restart machine ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_RESET_VMEM ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; In double-buffered video mode, resets the video display ;;; Inputs - none ;;; Outputs - none .CODE TRAP_RESET_VMEM LC R4, OS_VDCR_ADDR CONST R5, #1 STR R5, R4, #0 RTI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_BLT_VMEM ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; TRAP_BLT_VMEM - In double-buffered video mode, copies the contents ;;; of video memory to the video display. ;;; Inputs - none ;;; Outputs - none .CODE TRAP_BLT_VMEM LC R4, OS_VDCR_ADDR CONST R5, #2 STR R5, R4, #0 RTI ;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_GETC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Get a single character from keyboard ;;; Inputs - none ;;; Outputs - R0 = ASCII character from ASCII keyboard .CODE TRAP_GETC LC R0, OS_KBSR_ADDR ; R0 = address of keyboard status reg LDR R0, R0, #0 ; R0 = value of keyboard status reg BRzp TRAP_GETC ; if R0[15]=1, data is waiting! ; else, loop and check again... ; reaching here, means data is waiting in keyboard data reg LC R0, OS_KBDR_ADDR ; R0 = address of keyboard data reg LDR R0, R0, #0 ; R0 = value of keyboard data reg RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_PUTC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Put a single character out to ASCII display ;;; Inputs - R0 = ASCII character to write to ASCII display ;;; Outputs - none .CODE TRAP_PUTC LC R1, OS_ADSR_ADDR ; R1 = address of display status reg LDR R1, R1, #0 ; R1 = value of display status reg BRzp TRAP_PUTC ; if R1[15]=1, display is ready to write! ; else, loop and check again... ; reaching here, means console is ready to display next char LC R1, OS_ADDR_ADDR ; R1 = address of display data reg STR R0, R1, #0 ; R1 = value of keyboard data reg (R0) RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_PUTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Put a string of characters out to ASCII display ;;; Inputs - R0 = Address for first character ;;; Outputs - none .CODE TRAP_PUTS LC R4, OS_ADSR_ADDR LDR R1, R4, #0 BRzp TRAP_PUTS ; Loop while the MSB is zero LOOP LC R4, OS_ADDR_ADDR LDR R1, R0, #0 ; load character to R1 CMPI R1, #0 BRz FINISH ; if 0, end the loop STR R1, R4, #0 ; Write out the character ADD R0, R0, #1 ; update the data memory address JMP LOOP FINISH RTI ;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_VIDEO_COLOR ;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Set all pixels of VIDEO display to a certain color ;;; Inputs - R0 = color to set all pixels to ;;; Outputs - none .CODE TRAP_VIDEO_COLOR LC R1, OS_VIDEO_NUM_ROWS ; loads num of rows into R1 LC R2, OS_VIDEO_NUM_COLS ; loads num of columns into R2 MUL R2, R1, R2 ; R2 = R1 * R2 (R2 = total pixel in screen) LEA R1, OS_VIDEO_MEM ; loads addr of first pixel into R1 VIDEO_COLOR_LOOP STR R0, R1, #0 ; Stores the color at the address of the pixel ADD R1, R1, #1 ; increments current pixel address ADD R2, R2, #-1 ; decrements loop counter BRp VIDEO_COLOR_LOOP ; if loop counter > 0, loop again RTI ; PC = R7 ; PSR[15]=0 RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_DRAW_PIXEL ;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Draw point on video display ;;; Inputs - R0 = row to draw on (y) ;;; - R1 = column to draw on (x) ;;; - R2 = color to draw with ;;; Outputs - none .CODE TRAP_DRAW_PIXEL LEA R3, OS_VIDEO_MEM ; R3=start address of video memory LC R4, OS_VIDEO_NUM_COLS ; R4=number of columns CMPIU R1, #0 ; Checks if x coord from input is > 0 BRn END_PIXEL CMPIU R1, #127 ; Checks if x coord from input is < 127 BRp END_PIXEL CMPIU R0, #0 ; Checks if y coord from input is > 0 BRn END_PIXEL CMPIU R0, #123 ; Checks if y coord from input is < 123 BRp END_PIXEL MUL R4, R0, R4 ; R4= (row * NUM_COLS) ADD R4, R4, R1 ; R4= (row * NUM_COLS) + col ADD R4, R4, R3 ; Add the offset to the start of video memory STR R2, R4, #0 ; Fill in the pixel with color from user (R2) END_PIXEL RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_DRAW_CIRCLE ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Draws the outline of a circle with a specific center col. and rad. ;;; Inputs - R0 = x coordinate of center ;;; Inputs - R1 = y coordinate of center ;;; Inputs - R2 = radius of circle ;;; Inputs - R3 = color of circle ;;; Outputs - none .CODE TRAP_DRAW_CIRCLE DRAW_CIRCLE_TEMPS .UCONST x5000 ; Reserved for temp variables LC R6 DRAW_CIRCLE_TEMPS ; loads temp array addr into R6 STR R0 R6 #0 ; Store CX in Temp[0] STR R1 R6 #1 ; Store CY in Temp[1] STR R2 R6 #2 ; Store R in Temp[2] STR R3 R6 #3 ; Store Color in Temp [3] STR R2 R6 #4 ; Store X (= R) in Temp[4] CONST R5 #0 ; Const 0 into R5 STR R5 R6 #5 ; Temp[5] is Y which is 0 STR R7 R6 #11 ; Store Return Address in Temp[11] CONST R4 #2 ; put 2 in R4 MUL R2 R2 R4 ; R = R*2 CONST R4 #1 ; put 1 in R4 SUB R5 R4 R2 ; XChange = 1 - 2*R STR R5 R6 #6 ; Store XChange (= 1-2*R) in Temp[6] STR R4 R6 #7 ; Store YChange (= 1) in Temp[7] CONST R0 #0 ; Load a 0 into R0 STR R0 R6 #8 ; Temp[8] is RadiusError which is 0 DRAW_CIRCLE_WHILE LDR R0 R6 #4 ; Load X into R0 LDR R1 R6 #5 ; Load Y into R1 CMP R0 R1; X - Y BRn DRAW_CIRCLE_END ; While (X >= Y) ;;;;;;;;;;; Plot8CirclePoints ;;;;;;;;;;;;; LDR R2 R6 #3 ; Load Color into R2 LDR R3 R6 #4 ; Load X into R3 LDR R4 R6 #5 ; Load Y into R4 LDR R5 R6 #0 ; Load CX into R5 LDR R6 R6 #1 ; Load CY into R6 ;; Point 1 ADD R0 R5 R3 ; R0 = CX+X ADD R1 R6 R4 ; R1 = CY+Y ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 2 SUB R0 R5 R3 ; R0 = CX-X ADD R1 R6 R4 ; R1 = CY+Y ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 3 SUB R0 R5 R3 ; R0 = CX-X SUB R1 R6 R4 ; R1 = CY-Y ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 4 ADD R0 R5 R3 ; R0 = CX+X SUB R1 R6 R4 ; R1 = CY-Y ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 5 ADD R0 R5 R4 ; R0 = CX+Y ADD R1 R6 R3 ; R1 = CY+X ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 6 SUB R0 R5 R4 ; R0 = CX-Y ADD R1 R6 R3 ; R1 = CY+X ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 7 SUB R0 R5 R4 ; R0 = CX-Y SUB R1 R6 R3 ; R1 = CY-X ; Draw Pixel JSR DRAW_CIRCLE_POINT ;; Point 8 ADD R0 R5 R4 ; R0 = CX+Y SUB R1 R6 R3 ; R1 = CY-X ; Draw Pixel JSR DRAW_CIRCLE_POINT ;;;;;; Plot8CirclePoints Done ;;;;;;;;; LC R6 DRAW_CIRCLE_TEMPS ; Load temp array back into R6 LDR R1 R6 #5 ; Load Y into R1 ADD R1 R1 #1 ; Y = Y + 1 STR R1 R6 #5 ; Store Y LDR R2 R6 #8 ; Load RadiusError into R2 LDR R3 R6 #7 ; Load YChange into R3 ADD R2 R2 R3 ; RadiusError += YChange STR R2 R6 #8 ; Store RadiusError ADD R3 R3 #2 ; YChange += 2 STR R3 R6 #7 ; Store YChange LDR R4 R6 #6 ; Load XChange CONST R0 #2 ; Put 2 into R0 MUL R2 R2 R0 ; Now R2 = 2*RE ADD R2 R2 R4 ; R2 = 2*RE + XC BRnz DRAW_CIRCLE_AFTER_IF ; if (2*RE + XC > 0) LDR R0 R6 #4 ; Load X into R0 ADD R0 R0 #-1 ; X -= 1 STR R0 R6 #4 ; Store X LDR R1 R6 #6 ; Load XChange into R1 LDR R2 R6 #8 ; Load RadiusError into R2 ADD R2 R2 R1 ; RE += XC ADD R1 R1 #2 ; XC += 2 STR R2 R6 #8 ; Store RE STR R1 R6 #6 ; Store XC DRAW_CIRCLE_AFTER_IF JMP DRAW_CIRCLE_WHILE DRAW_CIRCLE_END LC R6 DRAW_CIRCLE_TEMPS ; Get address of temps LDR R7 R6 #11 ; load correct return address back into R7 RTI .FALIGN DRAW_CIRCLE_POINT ; Draw Pixel LC R6 DRAW_CIRCLE_TEMPS ; Reload Temp array addr into R6 STR R3 R6 #9 ; Store R3 in Temp[9] STR R4 R6 #10 ; Store R4 in Temp[10] LEA R3 OS_VIDEO_MEM ; R3=start address of video memory LC R4 OS_VIDEO_NUM_COLS ; R4=number of columns CMPIU R1 #0 ; Checks if y coord from input is > 0 BRn DRAW_CIRCLE_POINT_END CMPIU R1 #123 ; Checks if y coord from input is < 127 BRp DRAW_CIRCLE_POINT_END CMPIU R0 #0 ; Checks if x coord from input is > 0 BRn DRAW_CIRCLE_POINT_END CMPIU R0 #127 ; Checks if x coord from input is < 123 BRp DRAW_CIRCLE_POINT_END MUL R4 R1 R4 ; R4= (row * NUM_COLS) ADD R4 R4 R0 ; R4= (row * NUM_COLS) + col ADD R4 R4 R3 ; Add the offset to the start of video memory STR R2 R4 #0 ; Fill in the pixel with color from user (R2) DRAW_CIRCLE_POINT_END LDR R2 R6 #3 ; Load Color into R2 LDR R3 R6 #4 ; Load X into R3 LDR R4 R6 #5 ; Load Y into R4 LDR R5 R6 #0 ; Load CX into R5 LDR R6 R6 #1 ; Load CY into R6 RET RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_DRAW_SPRITE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: draws an 8x8 sprite on the screen. ;;; Inputs: R0 - video column (left) ;;; R1 - video row (upper) ;;; R2 - color ;;; R3 - Address of sprite bitmap - an array of 8 words ;;; ;;; Outputs: video memory will be updated to include sprite of approriate color .CODE TRAP_DRAW_SPRITE ;; STORE R0, R1 and R7 LEA R6, OS_GLOBALS_MEM STR R0, R6, #0 STR R1, R6, #1 STR R7, R6, #2 ;;; for (i=0; i < 8; ++i, ++ptr) { ;;; temp = i + start_row; ;;; if (temp < 0) continue; ;;; if (temp >= NUM_ROWS) end; ;;; byte = *ptr & 0xFF; ;;; col = start_col + 7; ;;; temp = VIDEO_MEM + (temp * 128) + col ;;; do { ;;; if (col >= 0 && col < NUM_COLS && byte & 0x1) ;;; *temp = color ;;; --col; ;;; --temp; ;;; byte >>= 1; ;;; } while (byte) ;;; } ;;; ;;; Register Allocation ;;; R0 - i ;;; R1 - temp ;;; R2 - color ;;; R3 - ptr ;;; R4 - byte ;;; R5 - col ;;; R6 - scratch ;;; R7 - scratch CONST R0, #0 ; i = 0 JMP TRAP_DRAW_SPRITE_F12 TRAP_DRAW_SPRITE_F11 LEA R6, OS_GLOBALS_MEM LDR R1, R6, #1 ; load start_row ADD R1, R1, R0 ; temp = i + start_row BRn TRAP_DRAW_SPRITE_F13 ; temp < 0 continue LC R7 OS_VIDEO_NUM_ROWS CMP R1, R7 BRzp TRAP_DRAW_SPRITE_END ; (temp >= NUM_ROWS) end LDR R4, R3, #0 ; byte = *ptr CONST R7, 0xFF AND R4, R4, R7 ; byte = byte & xFF LEA R6, OS_GLOBALS_MEM LDR R5, R6, #0 ; load start_col ADD R5, R5, #7 ; col = start_col + 7 SLL R1, R1, #7 ; temp = temp * 128 ADD R1, R1, R5 ; temp = temp + col LEA R7, OS_VIDEO_MEM ADD R1, R1, R7 ; temp = temp + OS_VIDEO_MEM LC R7, OS_VIDEO_NUM_COLS TRAP_DRAW_SPRITE_W1 CMPI R5, #0 BRn TRAP_DRAW_SPRITE_W2 ; col < 0 continue CMP R5, R7 BRzp TRAP_DRAW_SPRITE_W2 ; col >= NUM_COLS continue AND R6, R4, 0x01 BRz TRAP_DRAW_SPRITE_W2 ; byte & 0x1 == 0 continue STR R2, R1, 0 ; *temp = color TRAP_DRAW_SPRITE_W2 ADD R5, R5, #-1 ; --col ADD R1, R1, #-1 ; --temp SRL R4, R4, #1 ; byte >>= 1 BRnp TRAP_DRAW_SPRITE_W1 TRAP_DRAW_SPRITE_F13 ADD R0, R0, #1 ; ++i ADD R3, R3, #1 ; ++ptr TRAP_DRAW_SPRITE_F12 CMPI R0, #8 BRn TRAP_DRAW_SPRITE_F11 TRAP_DRAW_SPRITE_END LEA R6, OS_GLOBALS_MEM LDR R7, R6, #2 RTI ;;;;;;;;;;;;;;;;;;;;;;;;; TRAP_TIMER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: ;;; Inputs - R0 = time to wait in milliseconds ;;; Outputs - none .CODE TRAP_TIMER LC R1, OS_TIR_ADDR ; R1 = address of timer interval reg STR R0, R1, #0 ; Store R0 in timer interval register COUNT LC R1, OS_TSR_ADDR ; Save timer status register in R1 LDR R1, R1, #0 ; Load the contents of TSR in R1 BRzp COUNT ; If R1[15]=1, timer has gone off! ; reaching this line means we've finished counting R0 RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;; TRAP_GETC_TIMER ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Get a single character from keyboard ;;; Inputs - R0 = time to wait ;;; Outputs - R0 = ASCII character from keyboard (or NULL) .CODE TRAP_GETC_TIMER LC R1, OS_TIR_ADDR ; R1 = address of timer interval reg STR R0, R1, #0 ; Store R0 in timer interval register GETC_COUNT LC R1, OS_TSR_ADDR ; Save timer status register in R1 LDR R1, R1, #0 ; Load the contents of TSR in R1 BRzp GETC ; If R1[15]=1, timer has gone off! ; reaching this line means we've finished counting R1 CONST R0 #0 RTI GETC LC R0, OS_KBSR_ADDR ; R0 = address of keyboard status reg LDR R0, R0, #0 ; R0 = value of keyboard status reg BRzp GETC_COUNT ; if R0[15]=1, data is waiting! ; else, loop and check again... LC R2, OS_KBDR_ADDR ; R2 = address of keyboard data reg LDR R0, R2, #0 ; R0 = value of keyboard data reg RTI ; PC = R7 ; PSR[15]=0 ;;;;;;;;;;;;;;;;;;;;;;; TRAP_LFSR_SET_SEED ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: set a seed value for the TRAP_LFSR trap ;;; Inputs - R0 = 16-bit seed ;;; Outputs - none .CODE TRAP_LFSR_SET_SEED LEA R1, LFSR ; Save LFSR address in R1 STR R0, R1, #0 ; Store the contents of R0 in LFSR ;;;;;;;;;;;;;;;;;;;;;;; TRAP_LFSR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Function: Performs the LFSR algorithm on a 16-bit sequence ;;; Inputs - None ;;; Outputs - shifted bit pattern in R0 .CODE TRAP_LFSR INIT LEA R0 LFSR ; Store address of the LFSR label into R0 LDR R0 R0 #0 ; Load value CONST R4 #1 ; R4 = 1 SRL R1 R0 15 ;; Shifts the register to the right 15 bits SRL R2 R0 13 XOR R3 R1 R2 ; XOR the 15th and 13th bits SRL R1 R0 12 SRL R2 R0 10 XOR R3 R3 R1 XOR R3 R3 R2 ; XOR the previous XOR value with the 12th and 10th bits AND R3 R3 R4 ; Isolate the LSB of the XOR result SLL R0 R0 1 ;; Shifts R0 to the left once ADD R0 R0 R3 ; Insert the LSB of the XOR result into the shifted RO sequence LEA R1, LFSR ; R1 = address of LFSR STR R0, R1, #0 ; R0 = value of keyboard data reg RTI
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.40629.0 TITLE C:\Users\cex123\Desktop\XXXXX\osdev\osdev-211\Source\Applications\Fire\Fire.c .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRT INCLUDELIB OLDNAMES _DATA SEGMENT COMM _lookup:DWORD COMM _heatmap:DWORD COMM _coolmap:DWORD _DATA ENDS _DATA SEGMENT ?seed@?1??DemoEffect@@9@9 DD 0bc614eH ; `DemoEffect'::`2'::seed _DATA ENDS PUBLIC _frand PUBLIC _rgb PUBLIC _DemoSetup PUBLIC _DemoEffect PUBLIC ??_C@_06NPEBFFAN@Plasma?$AA@ ; `string' PUBLIC __real@3f800000 PUBLIC __real@43800000 EXTRN _stosd:PROC EXTRN __imp__Memory:DWORD EXTRN __fltused:DWORD ; COMDAT __real@43800000 CONST SEGMENT __real@43800000 DD 043800000r ; 256 CONST ENDS ; COMDAT __real@3f800000 CONST SEGMENT __real@3f800000 DD 03f800000r ; 1 CONST ENDS ; COMDAT ??_C@_06NPEBFFAN@Plasma?$AA@ CONST SEGMENT ??_C@_06NPEBFFAN@Plasma?$AA@ DB 'Plasma', 00H ; `string' CONST ENDS ; Function compile flags: /Ogtpy ; File c:\users\cex123\desktop\xxxxx\osdev\osdev-211\source\applications\fire\fire.c _TEXT SEGMENT _wide$1$ = -32 ; size = 4 tv1233 = -28 ; size = 4 _y$1$ = -28 ; size = 4 tv1243 = -24 ; size = 4 tv1231 = -24 ; size = 4 _resy$1$ = -24 ; size = 4 tv1240 = -20 ; size = 4 tv1236 = -20 ; size = 4 _canvas$1$ = -20 ; size = 4 tv1253 = -16 ; size = 4 _y$1$ = -16 ; size = 4 _res$1 = -16 ; size = 4 _res$2 = -16 ; size = 4 _high$1$ = -12 ; size = 4 tv1242 = -8 ; size = 4 tv1250 = -4 ; size = 4 _image$1$ = -4 ; size = 4 _resx$1$ = 8 ; size = 4 _window$ = 8 ; size = 4 _t$ = 12 ; size = 4 _DemoEffect PROC ; 64 : void DemoEffect(CWindow *window, int t) { sub esp, 32 ; 00000020H ; 65 : CCanvas *canvas = window->Canvas; mov ecx, DWORD PTR _window$[esp+28] push ebx push ebp push esi mov ebx, DWORD PTR [ecx+36] ; 66 : static int seed = 12345678; ; 67 : int resx = canvas->ResX/SIZE; ; 68 : int resy = canvas->ResY/SIZE; ; 69 : int wide = window->Wide/SIZE; ; 70 : int high = window->High/SIZE; ; 71 : char *image = &canvas->Draw[window->PosY*canvas->ScanLine]; ; 72 : image += window->PosX*sizeof(int); ; 73 : ; 74 : for (int x = 0; x < resx; x++) { xor esi, esi push edi mov DWORD PTR _canvas$1$[esp+48], ebx mov eax, DWORD PTR [ebx+48] cdq sub eax, edx sar eax, 1 mov DWORD PTR _resx$1$[esp+44], eax mov eax, DWORD PTR [ebx+52] cdq sub eax, edx mov edi, eax movsx eax, WORD PTR [ecx+20] cdq sub eax, edx sar edi, 1 sar eax, 1 mov DWORD PTR _wide$1$[esp+48], eax movsx eax, WORD PTR [ecx+22] cdq sub eax, edx mov DWORD PTR _resy$1$[esp+48], edi movsx edx, WORD PTR [ecx+18] imul edx, DWORD PTR [ebx+36] movsx ecx, WORD PTR [ecx+16] sar eax, 1 mov DWORD PTR _high$1$[esp+48], eax lea ebp, DWORD PTR [edx+ecx*4] add ebp, DWORD PTR [ebx+32] mov DWORD PTR _image$1$[esp+48], ebp cmp DWORD PTR _resx$1$[esp+44], esi jle $LN31@DemoEffect mov ebx, DWORD PTR _resx$1$[esp+44] dec edi movss xmm1, DWORD PTR __real@3f800000 movss xmm2, DWORD PTR __real@43800000 imul edi, ebx $LL33@DemoEffect: ; 75 : int y1 = 0; ; 76 : int y2 = resy-1; ; 77 : u8 v1 = (u8)(256*frand(&seed)); imul ecx, DWORD PTR ?seed@?1??DemoEffect@@9@9, 65505 mov eax, ecx shr eax, 9 or eax, 1065353216 ; 3f800000H mov DWORD PTR _res$2[esp+48], eax movss xmm0, DWORD PTR _res$2[esp+48] subss xmm0, xmm1 ; 78 : u8 v2 = (u8)(256*frand(&seed)); imul eax, ecx, 65505 mov DWORD PTR ?seed@?1??DemoEffect@@9@9, eax shr eax, 9 or eax, 1065353216 ; 3f800000H mulss xmm0, xmm2 mov DWORD PTR _res$1[esp+48], eax ; 79 : heatmap[x + y1*resx] = v1; mov eax, DWORD PTR _heatmap cvttss2si edx, xmm0 movss xmm0, DWORD PTR _res$1[esp+48] mov BYTE PTR [eax+esi], dl subss xmm0, xmm1 ; 80 : heatmap[x + v1*resx] = v1; movzx eax, dl imul eax, ebx mulss xmm0, xmm2 add eax, DWORD PTR _heatmap cvttss2si ecx, xmm0 mov BYTE PTR [eax+esi], dl ; 81 : coolmap[x + y2*resx] = v2; mov eax, DWORD PTR _coolmap add eax, edi mov BYTE PTR [eax+esi], cl ; 82 : coolmap[x + v2*resx] = v2; movzx eax, cl imul eax, ebx add eax, DWORD PTR _coolmap mov BYTE PTR [eax+esi], cl inc esi cmp esi, ebx jl $LL33@DemoEffect mov ebx, DWORD PTR _canvas$1$[esp+48] mov edi, DWORD PTR _resy$1$[esp+48] $LN31@DemoEffect: ; 83 : } ; 84 : for (int y = resy-1; y > 0; y--) { lea esi, DWORD PTR [edi-1] mov DWORD PTR _y$1$[esp+48], esi test esi, esi jle $LN28@DemoEffect mov ebp, DWORD PTR _resx$1$[esp+44] mov ecx, esi imul ecx, ebp lea eax, DWORD PTR [ebp-2] mov DWORD PTR tv1253[esp+48], eax lea ebx, DWORD PTR [ebp-1] mov eax, ebp mov DWORD PTR tv1243[esp+48], ecx neg eax mov DWORD PTR tv1242[esp+48], eax jmp SHORT $LN30@DemoEffect $LL88@DemoEffect: mov ebp, DWORD PTR _resx$1$[esp+44] $LN30@DemoEffect: ; 85 : u8 *heat = &heatmap[y*resx]; mov edx, DWORD PTR _heatmap add edx, ecx ; 86 : for (int x = 1; x < resx-1; x++) { cmp ebx, 1 jle SHORT $LN25@DemoEffect mov edi, 1 sub edi, ebp lea ebp, DWORD PTR [ebx-1] npad 1 $LL27@DemoEffect: ; 87 : heat[x] = (heat[x-1] + heat[x]*2 + heat[x+1] + heat[x - resx]*4)/8; movzx ecx, BYTE PTR [edi+edx] lea esi, DWORD PTR [edx+1] movzx eax, BYTE PTR [esi] lea ecx, DWORD PTR [eax+ecx*2] movzx eax, BYTE PTR [edx+2] lea eax, DWORD PTR [eax+ecx*2] movzx ecx, BYTE PTR [edx] add eax, ecx cdq and edx, 7 add eax, edx lea edx, DWORD PTR [esi] sar eax, 3 mov BYTE PTR [esi], al dec ebp jne SHORT $LL27@DemoEffect mov ecx, DWORD PTR tv1243[esp+48] mov esi, DWORD PTR _y$1$[esp+48] $LN25@DemoEffect: ; 88 : } ; 89 : u8 *cool = &coolmap[y*resx]; mov eax, DWORD PTR _coolmap ; 90 : for (int x = resx-2; x > 0; x--) { mov edi, DWORD PTR tv1253[esp+48] add eax, ecx test edi, edi jle SHORT $LN29@DemoEffect lea esi, DWORD PTR [edi-1] mov ebp, 1 add esi, eax sub ebp, DWORD PTR _resx$1$[esp+44] npad 2 $LL24@DemoEffect: ; 91 : cool[x] = (cool[x-1] + cool[x]*2 + cool[x+1] + cool[x - resx]*4)/8; movzx eax, BYTE PTR [esi+1] lea esi, DWORD PTR [esi-1] movzx ecx, BYTE PTR [esi+ebp+1] dec edi lea ecx, DWORD PTR [eax+ecx*2] movzx eax, BYTE PTR [esi+3] lea eax, DWORD PTR [eax+ecx*2] movzx ecx, BYTE PTR [esi+1] add eax, ecx cdq and edx, 7 add eax, edx sar eax, 3 mov BYTE PTR [esi+2], al test edi, edi jg SHORT $LL24@DemoEffect mov ecx, DWORD PTR tv1243[esp+48] mov esi, DWORD PTR _y$1$[esp+48] $LN29@DemoEffect: ; 83 : } ; 84 : for (int y = resy-1; y > 0; y--) { add ecx, DWORD PTR tv1242[esp+48] dec esi mov DWORD PTR _y$1$[esp+48], esi mov DWORD PTR tv1243[esp+48], ecx test esi, esi jg $LL88@DemoEffect mov ebx, DWORD PTR _canvas$1$[esp+48] mov ebp, DWORD PTR _image$1$[esp+48] $LN28@DemoEffect: ; 92 : } ; 93 : } ; 94 : ; 95 : for (int y = 0; y < high; y++) { mov edi, DWORD PTR _high$1$[esp+48] xor edx, edx mov DWORD PTR _y$1$[esp+48], edx test edi, edi jle $LN19@DemoEffect mov eax, DWORD PTR _resx$1$[esp+44] xor ecx, ecx shl eax, 4 mov esi, 16 ; 00000010H sub esi, eax mov DWORD PTR tv1233[esp+48], ecx mov DWORD PTR tv1231[esp+48], esi npad 4 $LL21@DemoEffect: ; 96 : if (y < 16 || y >= high-16) { cmp edx, 16 ; 00000010H jl $LN17@DemoEffect lea eax, DWORD PTR [edi-16] cmp edx, eax jge $LN17@DemoEffect ; 100 : } ; 101 : } else { ; 102 : for (int v = 0; v < SIZE; v++) { mov edi, ecx mov DWORD PTR tv1240[esp+48], 2 npad 2 $LL12@DemoEffect: ; 103 : int *pixel = (int*)&image[(y*SIZE+v)*canvas->ScanLine]; mov esi, DWORD PTR [ebx+36] imul esi, edi ; 104 : stosd(pixel, 0x001E1E1E, 16*SIZE); push 32 ; 00000020H push 1973790 ; 001e1e1eH add esi, ebp push esi call _stosd ; 105 : pixel += wide*SIZE - 16*SIZE; mov eax, DWORD PTR _wide$1$[esp+60] add eax, -16 ; fffffff0H ; 106 : stosd(pixel, 0x001E1E1E, 16*SIZE); push 32 ; 00000020H push 1973790 ; 001e1e1eH lea eax, DWORD PTR [esi+eax*8] push eax call _stosd add esp, 24 ; 00000018H inc edi dec DWORD PTR tv1240[esp+48] jne SHORT $LL12@DemoEffect ; 107 : } ; 108 : for (int x = 16; x < wide-16; x++) { mov ecx, DWORD PTR _wide$1$[esp+48] mov edx, 16 ; 00000010H lea eax, DWORD PTR [ecx-16] cmp eax, edx jle $LN20@DemoEffect mov esi, DWORD PTR tv1231[esp+48] mov DWORD PTR tv1236[esp+48], esi $LL9@DemoEffect: ; 109 : int i = (y-16)*resx + x; ; 110 : u8 heat = heatmap[i]; ; 111 : u8 cool = coolmap[i]; ; 112 : char fire = heat - cool; mov eax, DWORD PTR _heatmap mov cl, BYTE PTR [esi+eax] mov eax, DWORD PTR _coolmap sub cl, BYTE PTR [esi+eax] ; 113 : fire = MIN(MAX(0, fire), 127); js SHORT $LN87@DemoEffect cmp cl, 127 ; 0000007fH jl SHORT $LN41@DemoEffect mov cl, 127 ; 0000007fH jmp SHORT $LN41@DemoEffect $LN87@DemoEffect: xor cl, cl $LN41@DemoEffect: ; 114 : u8 c = fire; ; 115 : u32 color = lookup[c]; mov eax, DWORD PTR _lookup mov edi, 2 movzx ecx, cl mov esi, DWORD PTR [eax+ecx*4] mov ecx, DWORD PTR tv1233[esp+48] $LL6@DemoEffect: ; 116 : for (int v = 0; v < SIZE; v++) { ; 117 : int *pixel = (int*)&image[(y*SIZE + v)*canvas->ScanLine]; mov eax, DWORD PTR [ebx+36] imul eax, ecx inc ecx add eax, ebp ; 118 : for (int u = 0; u < SIZE; u++) { ; 119 : pixel[x*SIZE + u] = color; mov DWORD PTR [eax+edx*8], esi mov DWORD PTR [eax+edx*8+4], esi dec edi jne SHORT $LL6@DemoEffect ; 107 : } ; 108 : for (int x = 16; x < wide-16; x++) { mov ecx, DWORD PTR _wide$1$[esp+48] inc edx mov esi, DWORD PTR tv1236[esp+48] inc esi mov DWORD PTR tv1236[esp+48], esi lea eax, DWORD PTR [ecx-16] cmp edx, eax jl SHORT $LL9@DemoEffect ; 66 : static int seed = 12345678; ; 67 : int resx = canvas->ResX/SIZE; ; 68 : int resy = canvas->ResY/SIZE; ; 69 : int wide = window->Wide/SIZE; ; 70 : int high = window->High/SIZE; ; 71 : char *image = &canvas->Draw[window->PosY*canvas->ScanLine]; ; 72 : image += window->PosX*sizeof(int); ; 73 : ; 74 : for (int x = 0; x < resx; x++) { jmp SHORT $LN20@DemoEffect $LN17@DemoEffect: mov eax, DWORD PTR _wide$1$[esp+48] ; 97 : for (int v = 0; v < SIZE; v++) { mov esi, ecx add eax, eax mov edi, 2 mov DWORD PTR tv1250[esp+48], eax npad 2 $LL16@DemoEffect: ; 98 : int *pixel = (int*)&image[(y*SIZE+v)*canvas->ScanLine]; ; 99 : stosd(pixel, 0x001E1E1E, wide*SIZE); push eax mov eax, DWORD PTR [ebx+36] imul eax, esi push 1973790 ; 001e1e1eH add eax, ebp push eax call _stosd mov eax, DWORD PTR tv1250[esp+60] add esp, 12 ; 0000000cH inc esi dec edi jne SHORT $LL16@DemoEffect $LN20@DemoEffect: ; 92 : } ; 93 : } ; 94 : ; 95 : for (int y = 0; y < high; y++) { mov edx, DWORD PTR _y$1$[esp+48] mov esi, DWORD PTR tv1231[esp+48] inc edx mov ecx, DWORD PTR tv1233[esp+48] add esi, DWORD PTR _resx$1$[esp+44] add ecx, 2 mov edi, DWORD PTR _high$1$[esp+48] mov DWORD PTR _y$1$[esp+48], edx mov DWORD PTR tv1231[esp+48], esi mov DWORD PTR tv1233[esp+48], ecx cmp edx, edi jl $LL21@DemoEffect $LN19@DemoEffect: pop edi pop esi pop ebp pop ebx ; 120 : } ; 121 : } ; 122 : } ; 123 : } ; 124 : } ; 125 : } add esp, 32 ; 00000020H ret 0 _DemoEffect ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\users\cex123\desktop\xxxxx\osdev\osdev-211\source\applications\fire\fire.c _TEXT SEGMENT _window$ = 8 ; size = 4 _DemoSetup PROC ; 36 : CCanvas *canvas = window->Canvas; mov eax, DWORD PTR _window$[esp-4] push esi mov esi, DWORD PTR [eax+36] ; 37 : CWindow *frame = canvas->BtmMost; ; 38 : frame->Title = "Plasma"; mov ecx, DWORD PTR [esi+12] mov DWORD PTR [ecx+52], OFFSET ??_C@_06NPEBFFAN@Plasma?$AA@ ; 39 : int resx = canvas->ResX/SIZE; mov eax, DWORD PTR [esi+48] cdq sub eax, edx mov ecx, eax ; 40 : int resy = canvas->ResY/SIZE; mov eax, DWORD PTR [esi+52] cdq sub eax, edx sar ecx, 1 mov esi, eax sar esi, 1 ; 41 : heatmap = Memory->Alloc(resx*resy); imul esi, ecx mov ecx, DWORD PTR __imp__Memory mov ecx, DWORD PTR [ecx] push esi mov ecx, DWORD PTR [ecx] call ecx add esp, 4 mov DWORD PTR _heatmap, eax ; 42 : if (!heatmap) return false; test eax, eax jne SHORT $LN9@DemoSetup $LN35@DemoSetup: xor eax, eax pop esi ; 62 : } ret 0 $LN9@DemoSetup: ; 43 : coolmap = Memory->Alloc(resx*resy); mov eax, DWORD PTR __imp__Memory push esi mov eax, DWORD PTR [eax] mov eax, DWORD PTR [eax] call eax add esp, 4 mov DWORD PTR _coolmap, eax ; 44 : if (!coolmap) return false; test eax, eax je SHORT $LN35@DemoSetup ; 45 : lookup = Memory->Alloc(4*256); mov eax, DWORD PTR __imp__Memory push 1024 ; 00000400H mov eax, DWORD PTR [eax] mov eax, DWORD PTR [eax] call eax mov edx, eax add esp, 4 mov DWORD PTR _lookup, edx ; 46 : if (!lookup) return false; test edx, edx je SHORT $LN35@DemoSetup ; 47 : ; 48 : for (int c = 0; c < 32; c++) { push ebx xor ebx, ebx mov esi, 256 ; 00000100H npad 11 $LL6@DemoSetup: ; 49 : u8 cold = 0; ; 50 : u8 norm = 255; ; 51 : u8 heat = (31-c)*8; ; 52 : lookup[c + 0] = rgb(norm, norm, norm); mov DWORD PTR [esi+edx-256], 16777215 ; 00ffffffH mov al, bl shl al, 3 mov cl, 248 ; 000000f8H sub cl, al inc ebx ; 53 : lookup[c + 32] = rgb(norm, norm, heat); mov eax, DWORD PTR _lookup movzx edx, cl mov ecx, edx or ecx, 16776960 ; 00ffff00H mov DWORD PTR [esi+eax-128], ecx ; 54 : lookup[c + 64] = rgb(norm, heat, cold); mov ecx, edx mov eax, DWORD PTR _lookup or ecx, 65280 ; 0000ff00H shl ecx, 8 ; 55 : lookup[c + 96] = rgb(heat, cold, cold); shl edx, 16 ; 00000010H mov DWORD PTR [esi+eax], ecx mov eax, DWORD PTR _lookup mov DWORD PTR [esi+eax+128], edx add esi, 4 cmp esi, 384 ; 00000180H jge SHORT $LN34@DemoSetup ; 47 : ; 48 : for (int c = 0; c < 32; c++) { mov edx, DWORD PTR _lookup jmp SHORT $LL6@DemoSetup $LN34@DemoSetup: ; 56 : } ; 57 : for (int c = 0; c < 128; c++) { xor esi, esi mov eax, 1020 ; 000003fcH pop ebx npad 10 $LL3@DemoSetup: ; 58 : lookup[255-c] = lookup[c]; mov edx, DWORD PTR _lookup lea esi, DWORD PTR [esi+4] mov ecx, DWORD PTR [esi+edx-4] mov DWORD PTR [eax+edx], ecx sub eax, 4 cmp eax, 508 ; 000001fcH jg SHORT $LL3@DemoSetup ; 59 : } ; 60 : lookup[0] = rgb(0, 0, 0); mov eax, DWORD PTR _lookup pop esi mov DWORD PTR [eax], 0 ; 61 : return true; mov eax, 1 ; 62 : } ret 0 _DemoSetup ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\users\cex123\desktop\xxxxx\osdev\osdev-211\source\applications\fire\fire.c _TEXT SEGMENT _r$ = 8 ; size = 1 _g$ = 12 ; size = 1 _b$ = 16 ; size = 1 _rgb PROC ; 32 : return (r<<16) | (g<<8) | (b); mov eax, DWORD PTR _r$[esp-4] mov ecx, DWORD PTR _g$[esp-4] movzx eax, al shl eax, 8 movzx ecx, cl or eax, ecx mov ecx, DWORD PTR _b$[esp-4] shl eax, 8 movzx ecx, cl or eax, ecx ; 33 : } ret 0 _rgb ENDP _TEXT ENDS ; Function compile flags: /Ogtpy ; File c:\users\cex123\desktop\xxxxx\osdev\osdev-211\source\applications\fire\fire.c _TEXT SEGMENT _res$ = 8 ; size = 4 _seed$ = 8 ; size = 4 _frand PROC ; 25 : float res; ; 26 : seed[0] *= 0xFFE1; mov eax, DWORD PTR _seed$[esp-4] imul ecx, DWORD PTR [eax], 65505 mov DWORD PTR [eax], ecx ; 27 : *((u32*)&res) = (((u32)seed[0]) >> 9) | 0x3F800000; shr ecx, 9 or ecx, 1065353216 ; 3f800000H mov DWORD PTR _res$[esp-4], ecx ; 28 : return (res - 1.0f); fld DWORD PTR _res$[esp-4] fsub DWORD PTR __real@3f800000 ; 29 : } ret 0 _frand ENDP _TEXT ENDS END
; Read From the Console (ReadConsole.asm) ; Read a line of input from standard input. INCLUDE Irvine32.inc BufSize = 80 .data buffer BYTE BufSize DUP(?) stdInHandle HANDLE ? bytesRead DWORD ? .code main PROC ; Get handle to standard input INVOKE GetStdHandle, STD_INPUT_HANDLE mov stdInHandle,eax ; Wait for user input INVOKE ReadConsole, stdInHandle, ADDR buffer, BufSize, ADDR bytesRead, 0 ; Display the buffer mov esi,OFFSET buffer mov ecx,bytesRead mov ebx,TYPE buffer call DumpMem exit main ENDP END main
############################################################################### # Copyright 2018 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material ("Material") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # "License"), the following terms apply: # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### .text p192r1_data: _prime192r1: .long 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF .p2align 5, 0x90 .globl _g9_add_192 _g9_add_192: movl (%esi), %eax addl (%ebx), %eax movl %eax, (%edi) movl (4)(%esi), %eax adcl (4)(%ebx), %eax movl %eax, (4)(%edi) movl (8)(%esi), %eax adcl (8)(%ebx), %eax movl %eax, (8)(%edi) movl (12)(%esi), %eax adcl (12)(%ebx), %eax movl %eax, (12)(%edi) movl (16)(%esi), %eax adcl (16)(%ebx), %eax movl %eax, (16)(%edi) movl (20)(%esi), %eax adcl (20)(%ebx), %eax movl %eax, (20)(%edi) mov $(0), %eax adc $(0), %eax ret .p2align 5, 0x90 .globl _g9_sub_192 _g9_sub_192: movl (%esi), %eax subl (%ebx), %eax movl %eax, (%edi) movl (4)(%esi), %eax sbbl (4)(%ebx), %eax movl %eax, (4)(%edi) movl (8)(%esi), %eax sbbl (8)(%ebx), %eax movl %eax, (8)(%edi) movl (12)(%esi), %eax sbbl (12)(%ebx), %eax movl %eax, (12)(%edi) movl (16)(%esi), %eax sbbl (16)(%ebx), %eax movl %eax, (16)(%edi) movl (20)(%esi), %eax sbbl (20)(%ebx), %eax movl %eax, (20)(%edi) mov $(0), %eax adc $(0), %eax ret .p2align 5, 0x90 .globl _g9_shl_192 _g9_shl_192: movl (20)(%esi), %eax movq (16)(%esi), %xmm2 movdqu (%esi), %xmm1 movdqa %xmm2, %xmm3 palignr $(8), %xmm1, %xmm3 psllq $(1), %xmm2 psrlq $(63), %xmm3 por %xmm3, %xmm2 movq %xmm2, (16)(%edi) movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psllq $(1), %xmm1 psrlq $(63), %xmm3 por %xmm3, %xmm1 movdqu %xmm1, (%edi) shr $(31), %eax ret .p2align 5, 0x90 .globl _g9_shr_192 _g9_shr_192: movdqu (%esi), %xmm2 movq (16)(%esi), %xmm1 movdqa %xmm1, %xmm3 palignr $(8), %xmm2, %xmm3 psrlq $(1), %xmm2 psllq $(63), %xmm3 por %xmm3, %xmm2 movdqu %xmm2, (%edi) movdqa %xmm0, %xmm3 psrlq $(1), %xmm1 psllq $(63), %xmm3 por %xmm3, %xmm1 movq %xmm1, (16)(%edi) ret .p2align 5, 0x90 .globl _g9_p192r1_add _g9_p192r1_add: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(28), %esp and $(-16), %esp movl %eax, (24)(%esp) movl (8)(%ebp), %edi movl (12)(%ebp), %esi movl (16)(%ebp), %ebx call _g9_add_192 mov %eax, %edx lea (%esp), %edi movl (8)(%ebp), %esi call .L__0000gas_5 .L__0000gas_5: pop %ebx sub $(.L__0000gas_5-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_sub_192 lea (%esp), %esi movl (8)(%ebp), %edi sub %eax, %edx cmovne %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (24)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_sub _g9_p192r1_sub: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(28), %esp and $(-16), %esp movl %eax, (24)(%esp) movl (8)(%ebp), %edi movl (12)(%ebp), %esi movl (16)(%ebp), %ebx call _g9_sub_192 mov %eax, %edx lea (%esp), %edi movl (8)(%ebp), %esi call .L__0001gas_6 .L__0001gas_6: pop %ebx sub $(.L__0001gas_6-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_add_192 lea (%esp), %esi movl (8)(%ebp), %edi test %edx, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (24)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_neg _g9_p192r1_neg: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(28), %esp and $(-16), %esp movl %eax, (24)(%esp) movl (8)(%ebp), %edi movl (12)(%ebp), %esi mov $(0), %eax subl (%esi), %eax movl %eax, (%edi) mov $(0), %eax sbbl (4)(%esi), %eax movl %eax, (4)(%edi) mov $(0), %eax sbbl (8)(%esi), %eax movl %eax, (8)(%edi) mov $(0), %eax sbbl (12)(%esi), %eax movl %eax, (12)(%edi) mov $(0), %eax sbbl (16)(%esi), %eax movl %eax, (16)(%edi) mov $(0), %eax sbbl (20)(%esi), %eax movl %eax, (20)(%edi) sbb %edx, %edx lea (%esp), %edi movl (8)(%ebp), %esi call .L__0002gas_7 .L__0002gas_7: pop %ebx sub $(.L__0002gas_7-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_add_192 lea (%esp), %esi movl (8)(%ebp), %edi test %edx, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (24)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_mul_by_2 _g9_p192r1_mul_by_2: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(28), %esp and $(-16), %esp movl %eax, (24)(%esp) lea (%esp), %edi movl (12)(%ebp), %esi call _g9_shl_192 mov %eax, %edx mov %edi, %esi movl (8)(%ebp), %edi call .L__0003gas_8 .L__0003gas_8: pop %ebx sub $(.L__0003gas_8-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_sub_192 sub %eax, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (24)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_mul_by_3 _g9_p192r1_mul_by_3: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(56), %esp and $(-16), %esp movl %eax, (52)(%esp) call .L__0004gas_9 .L__0004gas_9: pop %eax sub $(.L__0004gas_9-p192r1_data), %eax lea ((_prime192r1-p192r1_data))(%eax), %eax movl %eax, (48)(%esp) lea (%esp), %edi movl (12)(%ebp), %esi call _g9_shl_192 mov %eax, %edx mov %edi, %esi lea (24)(%esp), %edi mov (48)(%esp), %ebx call _g9_sub_192 sub %eax, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov %edi, %esi movl (12)(%ebp), %ebx call _g9_add_192 mov %eax, %edx movl (8)(%ebp), %edi mov (48)(%esp), %ebx call _g9_sub_192 sub %eax, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (52)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_div_by_2 _g9_p192r1_div_by_2: push %ebp mov %esp, %ebp push %ebx push %esi push %edi mov %esp, %eax sub $(28), %esp and $(-16), %esp movl %eax, (24)(%esp) lea (%esp), %edi movl (12)(%ebp), %esi call .L__0005gas_10 .L__0005gas_10: pop %ebx sub $(.L__0005gas_10-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_add_192 mov $(0), %edx movl (%esi), %ecx and $(1), %ecx cmovne %edi, %esi cmove %edx, %eax movd %eax, %xmm0 movl (8)(%ebp), %edi call _g9_shr_192 mov (24)(%esp), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_mul_mont_slm _g9_p192r1_mul_mont_slm: push %ebp mov %esp, %ebp push %ebx push %esi push %edi push %ebp mov %esp, %eax sub $(44), %esp and $(-16), %esp movl %eax, (40)(%esp) pxor %mm0, %mm0 movq %mm0, (%esp) movq %mm0, (8)(%esp) movq %mm0, (16)(%esp) movq %mm0, (24)(%esp) movl (8)(%ebp), %edi movl (12)(%ebp), %esi movl (16)(%ebp), %ebp movl %edi, (28)(%esp) movl %esi, (32)(%esp) movl %ebp, (36)(%esp) mov $(6), %edi movd (4)(%esi), %mm1 movd (8)(%esi), %mm2 .p2align 5, 0x90 .Lmmul_loopgas_11: movd %edi, %mm7 movl (%ebp), %edx movl (%esi), %eax movd %edx, %mm0 add $(4), %ebp movl %ebp, (36)(%esp) pmuludq %mm0, %mm1 mul %edx addl (%esp), %eax adc $(0), %edx pmuludq %mm0, %mm2 movd %mm1, %ecx psrlq $(32), %mm1 add %edx, %ecx movd %mm1, %edx adc $(0), %edx addl (4)(%esp), %ecx movd (12)(%esi), %mm1 adc $(0), %edx movd %mm2, %ebx psrlq $(32), %mm2 add %edx, %ebx movd %mm2, %edx adc $(0), %edx addl (8)(%esp), %ebx movd (16)(%esi), %mm2 movd (20)(%esi), %mm3 adc $(0), %edx pmuludq %mm0, %mm1 pmuludq %mm0, %mm2 pmuludq %mm0, %mm3 movl %ecx, (%esp) sub %eax, %ebx mov $(0), %edi movl %ebx, (4)(%esp) adc $(0), %edi movd %mm1, %ecx psrlq $(32), %mm1 add %edx, %ecx movd %mm1, %edx adc $(0), %edx addl (12)(%esp), %ecx adc $(0), %edx movd %mm2, %ebx psrlq $(32), %mm2 add %edx, %ebx movd %mm2, %edx adc $(0), %edx addl (16)(%esp), %ebx adc $(0), %edx movd %mm3, %ebp psrlq $(32), %mm3 add %edx, %ebp movd %mm3, %edx adc $(0), %edx addl (20)(%esp), %ebp adc $(0), %edx sub %edi, %ecx movl %ecx, (8)(%esp) sbb $(0), %ebx movl %ebx, (12)(%esp) sbb $(0), %ebp movl %ebp, (16)(%esp) movd %mm7, %edi sbb $(0), %eax mov $(0), %ebx addl (24)(%esp), %edx adc $(0), %ebx add %eax, %edx adc $(0), %ebx movl %edx, (20)(%esp) movl %ebx, (24)(%esp) sub $(1), %edi movd (4)(%esi), %mm1 movd (8)(%esi), %mm2 jz .Lexit_mmul_loopgas_11 movl (36)(%esp), %ebp jmp .Lmmul_loopgas_11 .Lexit_mmul_loopgas_11: emms mov (28)(%esp), %edi lea (%esp), %esi call .L__0006gas_11 .L__0006gas_11: pop %ebx sub $(.L__0006gas_11-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_sub_192 movl (24)(%esp), %edx sub %eax, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) mov (40)(%esp), %esp pop %ebp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_sqr_mont_slm _g9_p192r1_sqr_mont_slm: push %ebp mov %esp, %ebp push %esi push %edi movl (12)(%ebp), %esi movl (8)(%ebp), %edi push %esi push %esi push %edi call _g9_p192r1_mul_mont_slm add $(12), %esp pop %edi pop %esi pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_mred _g9_p192r1_mred: push %ebp mov %esp, %ebp push %ebx push %esi push %edi movl (12)(%ebp), %esi mov $(6), %ecx xor %edx, %edx .p2align 5, 0x90 .Lmred_loopgas_13: movl (%esi), %eax mov $(0), %ebx movl %ebx, (%esi) movl (4)(%esi), %ebx movl %ebx, (4)(%esi) movl (8)(%esi), %ebx sub %eax, %ebx movl %ebx, (8)(%esi) movl (12)(%esi), %ebx sbb $(0), %ebx movl %ebx, (12)(%esi) movl (16)(%esi), %ebx sbb $(0), %ebx movl %ebx, (16)(%esi) movl (20)(%esi), %ebx sbb $(0), %ebx movl %ebx, (20)(%esi) movl (24)(%esi), %ebx sbb $(0), %eax add %edx, %eax mov $(0), %edx adc $(0), %edx add %eax, %ebx movl %ebx, (24)(%esi) adc $(0), %edx lea (4)(%esi), %esi sub $(1), %ecx jnz .Lmred_loopgas_13 movl (8)(%ebp), %edi call .L__0007gas_13 .L__0007gas_13: pop %ebx sub $(.L__0007gas_13-p192r1_data), %ebx lea ((_prime192r1-p192r1_data))(%ebx), %ebx call _g9_sub_192 sub %eax, %edx cmove %edi, %esi movdqu (%esi), %xmm0 movq (16)(%esi), %xmm1 movdqu %xmm0, (%edi) movq %xmm1, (16)(%edi) pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _g9_p192r1_select_pp_w5 _g9_p192r1_select_pp_w5: push %ebp mov %esp, %ebp push %esi push %edi pxor %xmm0, %xmm0 movl (8)(%ebp), %edi movl (12)(%ebp), %esi movl (16)(%ebp), %eax movd %eax, %xmm7 pshufd $(0), %xmm7, %xmm7 mov $(1), %edx movd %edx, %xmm6 pshufd $(0), %xmm6, %xmm6 movdqa %xmm0, (%edi) movdqa %xmm0, (16)(%edi) movdqa %xmm0, (32)(%edi) movdqa %xmm0, (48)(%edi) movq %xmm0, (64)(%edi) movdqa %xmm6, %xmm5 mov $(16), %ecx .p2align 5, 0x90 .Lselect_loopgas_14: movdqa %xmm5, %xmm4 pcmpeqd %xmm7, %xmm4 movdqu (%esi), %xmm0 pand %xmm4, %xmm0 por (%edi), %xmm0 movdqa %xmm0, (%edi) movdqu (16)(%esi), %xmm1 pand %xmm4, %xmm1 por (16)(%edi), %xmm1 movdqa %xmm1, (16)(%edi) movdqu (32)(%esi), %xmm2 pand %xmm4, %xmm2 por (32)(%edi), %xmm2 movdqa %xmm2, (32)(%edi) movdqu (48)(%esi), %xmm3 pand %xmm4, %xmm3 por (48)(%edi), %xmm3 movdqa %xmm3, (48)(%edi) movq (64)(%esi), %xmm0 movq (64)(%edi), %xmm1 pand %xmm4, %xmm0 por %xmm1, %xmm0 movq %xmm0, (64)(%edi) paddd %xmm6, %xmm5 add $(72), %esi sub $(1), %ecx jnz .Lselect_loopgas_14 pop %edi pop %esi pop %ebp ret
; A194112: a(n) = Sum_{j=1..n} floor(j*sqrt(8)); n-th partial sum of Beatty sequence for sqrt(8). ; 2,7,15,26,40,56,75,97,122,150,181,214,250,289,331,376,424,474,527,583,642,704,769,836,906,979,1055,1134,1216,1300,1387,1477,1570,1666,1764,1865,1969,2076,2186,2299,2414,2532,2653,2777,2904,3034,3166 lpb $0 mov $2,$0 sub $0,1 seq $2,22842 ; Beatty sequence for sqrt(8). add $1,$2 lpe add $1,2 mov $0,$1
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" // Including type: HMUI.FlowCoordinator #include "HMUI/FlowCoordinator.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "extern/beatsaber-hook/shared/utils/utils.h" // Completed includes // Begin forward declares // Forward declaring namespace: System namespace System { // Forward declaring type: Action class Action; } // Forward declaring namespace: HMUI namespace HMUI { // Forward declaring type: NavigationController class NavigationController; } // Completed forward declares // Type namespace: HMUI namespace HMUI { // Size: 0x30 #pragma pack(push, 1) // Autogenerated type: HMUI.FlowCoordinator/<>c__DisplayClass45_0 // [CompilerGeneratedAttribute] Offset: DF5D84 class FlowCoordinator::$$c__DisplayClass45_0 : public ::Il2CppObject { public: // public System.Boolean immediately // Size: 0x1 // Offset: 0x10 bool immediately; // Field size check static_assert(sizeof(bool) == 0x1); // Padding between fields: immediately and: $$4__this char __padding0[0x7] = {}; // public HMUI.FlowCoordinator <>4__this // Size: 0x8 // Offset: 0x18 HMUI::FlowCoordinator* $$4__this; // Field size check static_assert(sizeof(HMUI::FlowCoordinator*) == 0x8); // public System.Action finishedCallback // Size: 0x8 // Offset: 0x20 System::Action* finishedCallback; // Field size check static_assert(sizeof(System::Action*) == 0x8); // public HMUI.NavigationController navigationController // Size: 0x8 // Offset: 0x28 HMUI::NavigationController* navigationController; // Field size check static_assert(sizeof(HMUI::NavigationController*) == 0x8); // Creating value type constructor for type: $$c__DisplayClass45_0 $$c__DisplayClass45_0(bool immediately_ = {}, HMUI::FlowCoordinator* $$4__this_ = {}, System::Action* finishedCallback_ = {}, HMUI::NavigationController* navigationController_ = {}) noexcept : immediately{immediately_}, $$4__this{$$4__this_}, finishedCallback{finishedCallback_}, navigationController{navigationController_} {} // System.Void <PopViewControllerFromNavigationController>b__0() // Offset: 0x12F9814 void $PopViewControllerFromNavigationController$b__0(); // public System.Void .ctor() // Offset: 0x12F8C14 // Implemented from: System.Object // Base method: System.Void Object::.ctor() template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static FlowCoordinator::$$c__DisplayClass45_0* New_ctor() { static auto ___internal__logger = ::Logger::get().WithContext("HMUI::FlowCoordinator::$$c__DisplayClass45_0::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<FlowCoordinator::$$c__DisplayClass45_0*, creationType>())); } }; // HMUI.FlowCoordinator/<>c__DisplayClass45_0 #pragma pack(pop) static check_size<sizeof(FlowCoordinator::$$c__DisplayClass45_0), 40 + sizeof(HMUI::NavigationController*)> __HMUI_FlowCoordinator_$$c__DisplayClass45_0SizeCheck; static_assert(sizeof(FlowCoordinator::$$c__DisplayClass45_0) == 0x30); } DEFINE_IL2CPP_ARG_TYPE(HMUI::FlowCoordinator::$$c__DisplayClass45_0*, "HMUI", "FlowCoordinator/<>c__DisplayClass45_0");
;------------------------------------------------------------------------------ ; ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: ; ; CpuIdEx.Asm ; ; Abstract: ; ; AsmCpuidEx function ; ; Notes: ; ;------------------------------------------------------------------------------ DEFAULT REL SECTION .text ;------------------------------------------------------------------------------ ; UINT32 ; EFIAPI ; AsmCpuidEx ( ; IN UINT32 RegisterInEax, ; IN UINT32 RegisterInEcx, ; OUT UINT32 *RegisterOutEax OPTIONAL, ; OUT UINT32 *RegisterOutEbx OPTIONAL, ; OUT UINT32 *RegisterOutEcx OPTIONAL, ; OUT UINT32 *RegisterOutEdx OPTIONAL ; ) ;------------------------------------------------------------------------------ global ASM_PFX(AsmCpuidEx) ASM_PFX(AsmCpuidEx): push rbx mov eax, ecx mov ecx, edx push rax ; save Index on stack cpuid mov r10, [rsp + 0x38] test r10, r10 jz .0 mov [r10], ecx .0: mov rcx, r8 jrcxz .1 mov [rcx], eax .1: mov rcx, r9 jrcxz .2 mov [rcx], ebx .2: mov rcx, [rsp + 0x40] jrcxz .3 mov [rcx], edx .3: pop rax ; restore Index to rax as return value pop rbx ret
MACRO someMacro2 .macro2: someMacro1 jr .skip db CSPECT_EASY+2 ; WPMEM .skip ENDM INCLUDE "../sld_example.i.asm" MMU 7 n, 30, $E000 mmu7p30: docolor %000'101'00 ; green someMacro1 nextreg $56,21 jp mmu6p21 ALIGN $2000 mmu7p31: docolor %101'101'00 ; yellow someMacro1 nextreg $56,22 ret
; A332164: a(n) = 6*(10^(2*n+1)-1)/9 - 2*10^n. ; 4,646,66466,6664666,666646666,66666466666,6666664666666,666666646666666,66666666466666666,6666666664666666666,666666666646666666666,66666666666466666666666,6666666666664666666666666,666666666666646666666666666,66666666666666466666666666666,6666666666666664666666666666666 add $0,1 mov $1,10 pow $1,$0 sub $1,1 bin $1,2 div $1,45 mul $1,6 add $1,4 mov $0,$1
; A015221: Odd square pyramidal numbers. ; 1,5,55,91,285,385,819,1015,1785,2109,3311,3795,5525,6201,8555,9455,12529,13685,17575,19019,23821,25585,31395,33511,40425,42925,51039,53955,63365,66729,77531,81375,93665,98021,111895,116795,132349,137825 mov $2,$0 mul $0,2 gcd $0,4 mov $1,4 mul $1,$2 add $1,$0 bin $1,3 div $1,8 mul $1,2 add $1,1
; A157367: a(n) = 4802*n^2 + 196*n + 1. ; 4999,19601,43807,77617,121031,174049,236671,308897,390727,482161,583199,693841,814087,943937,1083391,1232449,1391111,1559377,1737247,1924721,2121799,2328481,2544767,2770657,3006151,3251249,3505951,3770257,4044167,4327681,4620799,4923521,5235847,5557777,5889311,6230449,6581191,6941537,7311487,7691041,8080199,8478961,8887327,9305297,9732871,10170049,10616831,11073217,11539207,12014801,12499999,12994801,13499207,14013217,14536831,15070049,15612871,16165297,16727327,17298961,17880199,18471041 add $0,1 mul $0,196 add $0,4 pow $0,2 sub $0,40000 div $0,784 mul $0,98 add $0,4999
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #ifndef KAGOME_OFFCHAIN_OFFCHAINWORKER #define KAGOME_OFFCHAIN_OFFCHAINWORKER #include <boost/optional.hpp> #include <libp2p/multi/multiaddress.hpp> #include <libp2p/peer/peer_id.hpp> #include "common/buffer.hpp" #include "offchain/types.hpp" #include "outcome/outcome.hpp" #include "primitives/common.hpp" #include "primitives/extrinsic.hpp" namespace kagome::offchain { /** * * The offchain workers allow the execution of long-running and possibly * non-deterministic tasks (e.g. web requests, encryption/decryption and * signing of data, random number generation, CPU-intensive computations, * enumeration/aggregation of on-chain data, etc.) which could otherwise * require longer than the block execution time. Offchain workers have their * own execution environment. This separation of concerns is to make sure that * the block production is not impacted by the long-running tasks. */ class OffchainWorker { public: static const std::optional<std::reference_wrapper<OffchainWorker>> &worker_of_this_thread() { return worker_of_this_thread_opt(); } virtual ~OffchainWorker() = default; virtual outcome::result<void> run() = 0; // ------------------------- Off-Chain API methods ------------------------- virtual bool isValidator() const = 0; virtual Result<Success, Failure> submitTransaction( const primitives::Extrinsic &ext) = 0; virtual Result<OpaqueNetworkState, Failure> networkState() = 0; virtual Timestamp timestamp() = 0; virtual void sleepUntil(Timestamp) = 0; virtual RandomSeed randomSeed() = 0; virtual void localStorageSet(StorageType storage_type, const common::Buffer &key, common::Buffer value) = 0; virtual void localStorageClear(StorageType storage_type, const common::Buffer &key) = 0; virtual bool localStorageCompareAndSet( StorageType storage_type, const common::Buffer &key, std::optional<std::reference_wrapper<const common::Buffer>> expected, common::Buffer value) = 0; virtual outcome::result<common::Buffer> localStorageGet( StorageType storage_type, const common::Buffer &key) = 0; virtual Result<RequestId, Failure> httpRequestStart( HttpMethod method, std::string_view uri, common::Buffer meta) = 0; virtual Result<Success, Failure> httpRequestAddHeader( RequestId id, std::string_view name, std::string_view value) = 0; virtual Result<Success, HttpError> httpRequestWriteBody( RequestId id, common::Buffer chunk, std::optional<Timestamp> deadline) = 0; virtual std::vector<HttpStatus> httpResponseWait( const std::vector<RequestId> &ids, std::optional<Timestamp> deadline) = 0; virtual std::vector<std::pair<std::string, std::string>> httpResponseHeaders(RequestId id) = 0; virtual Result<uint32_t, HttpError> httpResponseReadBody( RequestId id, common::Buffer &chunk, std::optional<Timestamp> deadline) = 0; virtual void setAuthorizedNodes(std::vector<libp2p::peer::PeerId> nodes, bool authorized_only) = 0; protected: static void worker_of_this_thread( std::optional<std::reference_wrapper<OffchainWorker>> worker) { worker_of_this_thread_opt() = std::move(worker); } private: static std::optional<std::reference_wrapper<OffchainWorker>> &worker_of_this_thread_opt() { static thread_local std::optional<std::reference_wrapper<OffchainWorker>> worker_of_this_thread_opt = std::nullopt; return worker_of_this_thread_opt; } }; } // namespace kagome::offchain #endif // KAGOME_OFFCHAIN_OFFCHAINWORKER
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/lightsail/model/SendContactMethodVerificationRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Lightsail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; SendContactMethodVerificationRequest::SendContactMethodVerificationRequest() : m_protocol(ContactMethodVerificationProtocol::NOT_SET), m_protocolHasBeenSet(false) { } Aws::String SendContactMethodVerificationRequest::SerializePayload() const { JsonValue payload; if(m_protocolHasBeenSet) { payload.WithString("protocol", ContactMethodVerificationProtocolMapper::GetNameForContactMethodVerificationProtocol(m_protocol)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection SendContactMethodVerificationRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Lightsail_20161128.SendContactMethodVerification")); return headers; }
; Disassembly of the file "002.rom" ; ; Created with dZ80 v1.31 ; ; on Saturday, 20 of April 2002 at 07:05 PM ; 4000 00 01 02 03 04 05 06 07 Main Back Print F1 F2 F3 F4 F5 4008 00 00 00 08 09 0a 48 19 Main Main Main @ Size Spell Email PgUp 4010 0b 0c 0d 0e 0f 10 11 12 ` 1 2 3 4 5 6 7 4018 13 14 15 16 17 18 27 28 8 9 0 - = Delet | PgDn 4020 1a 1b 1c 1d 1e 1f 20 21 Tab Q W E R T Y U 4028 22 23 24 25 26 33 34 35 I O P [ ] ; ' Enter 4030 29 2a 2b 2c 2d 2e 2f 30 Caps A S D F G H J 4038 31 32 3e 3f 40 42 47 46 K L , . / Up Down Right 4040 36 37 38 39 3a 3b 3c 3d Shift Z X C V B N M 4048 43 00 00 44 00 00 41 45 Fn Main Main Space Main Main Shift Left 4050 49 00 00 00 00 00 00 00 On/Of Main Main Main Main Main Main Main ' char *KeyNames[74] = { "Main", "Back", ...etc... ); 4058 ec40 405a f140 405c f640 405e fc40 4060 ff40 4062 0241 4064 0541 4066 0841 4068 0b41 406a 0d41 406c 1241 406e 1b41 4070 1d41 4072 1f41 4074 2141 4076 2341 4078 2541 407a 2741 407c 2941 407e 2b41 4080 2d41 4082 2f41 4084 3141 4086 3341 4088 3541 408a 3841 408c 3d41 408e 4141 4090 4341 4092 4541 4094 4741 4096 4941 4098 4b41 409a 4d41 409c 4f41 409e 5141 40a0 5341 40a2 5541 40a4 5741 40a6 5941 40a8 5b41 40aa 6041 40ac 6541 40ae 6741 40b0 6941 40b2 6b41 40b4 6d41 40b6 6f41 40b8 7141 40ba 7341 40bc 7541 40be 7741 40c0 7941 40c2 7b41 40c4 8141 40c6 8741 40c8 8941 40ca 8b41 40cc 8d41 40ce 8f41 40d0 9141 40d2 9341 40d4 9541 40d6 9741 40d8 9941 40da 9b41 40dc a141 40de a441 40e0 a741 40e2 a941 40e4 ae41 40e6 b441 40e8 b941 40ea c041 40ec Main\0 40f1 Back\0 40f6 Print\0 40fc F1\0 40ff F2\0 4102 F3\0 4105 F4\0 4108 F5\0 410b @\0 410d Size\0 4112 Spelling\0 411b `\0 411d 1\0 411f 2\0 4121 3\0 4123 4\0 4125 5\0 4127 6\0 4129 7\0 412b 8\0 412d 9\0 412f 0\0 4131 -\0 4133 =\0 4135 <-\0 4138 PgUp\0 413d TAB\0 4141 Q\0 4143 W\0 4145 E\0 4147 R\0 4149 T\0 414b Y\0 414d U\0 414f I\0 4151 O\0 4153 P\0 4155 [\0 4157 ]\0 4159 |\0 415b PgDn 4160 CAPS\0 4165 A\0 4167 S\0 4169 D\0 416b F\0 416d G\0 416f H\0 4171 J\0 4173 K\0 4175 L\0 4177 ;\0 4179 '\0 417b ENTER\0 4181 Shift\0 4187 Z\0 4189 X\0 418b C\0 418d V\0 418f B\0 4191 N\0 4193 M\0 4195 ,\0 4197 .\0 4199 /\0 419b Shift\0 41a1 up\0 41a4 Fn\0 41a7 \0 'Space Null 41a9 left\0 41ae right\0 41b4 down\0 41b9 E-mail\0 41c0 On/Off\0 ' ' X = 0 - 319 left to right ' Y = 0 - 127 Top to Bottom ' Outline of key is 14 pixels high ' Struct { Xs, Y, Xe } KeyLocation [74]; 2, 36, 32 33, 36, 67 68, 36, 102 103, 36, 123 124, 36, 144 41c7 0200 41c9 2400 41cb 2000 41cd 2100 41cf 2400 41d1 4300 41d3 4400 41d5 2400 41d7 6600 41d9 6700 41db 2400 41dd 7b00 41df 7c00 41e1 2400 41e3 9000 41e5 9100 41e7 2400 41e9 a500 41eb a600 41ed 2400 41ef ba00 41f1 bb00 41f3 2400 41f5 cf00 41f7 d000 41f9 2400 41fb df00 41fd e000 41ff 2400 4201 fe00 4203 ff00 4205 2400 4207 3d01 4209 0200 420b 3300 420d 1300 420f 1400 4211 3300 4213 2500 4215 2600 4217 3300 4219 3700 421b 3800 421d 3300 421f 4900 4221 4a00 4223 3300 4225 5b00 4227 5c00 4229 3300 422b 6d00 422d 6e00 422f 3300 4231 7f00 4233 8000 4235 3300 4237 9100 4239 9200 423b 3300 423d a300 423f a400 4241 3300 4243 b500 4245 b600 4247 3300 4249 c700 424b c800 424d 3300 424f d900 4251 da00 4253 3300 4255 eb00 4257 ec00 4259 3300 425b 0601 425d 07 rlca 425e 013300 ld bc,#0033 4261 3d dec a 4262 010200 ld bc,#0002 4265 42 ld b,d 4266 00 nop 4267 23 inc hl 4268 00 nop 4269 24 inc h 426a 00 nop 426b 42 ld b,d 426c 00 nop 426d 35 dec (hl) 426e 00 nop 426f 3600 ld (hl),#00 4271 42 ld b,d 4272 00 nop 4273 47 ld b,a 4274 00 nop 4275 48 ld c,b 4276 00 nop 4277 42 ld b,d 4278 00 nop 4279 59 ld e,c 427a 00 nop 427b 5a ld e,d 427c 00 nop 427d 42 ld b,d 427e 00 nop 427f 6b ld l,e 4280 00 nop 4281 6c ld l,h 4282 00 nop 4283 42 ld b,d 4284 00 nop 4285 7d ld a,l 4286 00 nop 4287 7e ld a,(hl) 4288 00 nop 4289 42 ld b,d 428a 00 nop 428b 8f adc a,a 428c 00 nop 428d 90 sub b 428e 00 nop 428f 42 ld b,d 4290 00 nop 4291 a1 and c 4292 00 nop 4293 a2 and d 4294 00 nop 4295 42 ld b,d 4296 00 nop 4297 b3 or e 4298 00 nop 4299 b4 or h 429a 00 nop 429b 42 ld b,d 429c 00 nop 429d c5 push bc 429e 00 nop 429f c600 add a,#00 42a1 42 ld b,d 42a2 00 nop 42a3 d7 rst #10 42a4 00 nop 42a5 d8 ret c 42a6 00 nop 42a7 42 ld b,d 42a8 00 nop 42a9 e9 jp (hl) 42aa 00 nop 42ab ea0042 jp pe,#4200 42ae 00 nop 42af fb ei 42b0 00 nop 42b1 fc0042 call m,#4200 42b4 00 nop 42b5 0d dec c 42b6 010e01 ld bc,#010e 42b9 42 ld b,d 42ba 00 nop 42bb 3d dec a 42bc 010200 ld bc,#0002 42bf 51 ld d,c 42c0 00 nop 42c1 29 add hl,hl 42c2 00 nop 42c3 2a0051 ld hl,(#5100) 42c6 00 nop 42c7 3b dec sp 42c8 00 nop 42c9 3c inc a 42ca 00 nop 42cb 51 ld d,c 42cc 00 nop 42cd 4d ld c,l 42ce 00 nop 42cf 4e ld c,(hl) 42d0 00 nop 42d1 51 ld d,c 42d2 00 nop 42d3 5f ld e,a 42d4 00 nop 42d5 60 ld h,b 42d6 00 nop 42d7 51 ld d,c 42d8 00 nop 42d9 71 ld (hl),c 42da 00 nop 42db 72 ld (hl),d 42dc 00 nop 42dd 51 ld d,c 42de 00 nop 42df 83 add a,e 42e0 00 nop 42e1 84 add a,h 42e2 00 nop 42e3 51 ld d,c 42e4 00 nop 42e5 95 sub l 42e6 00 nop 42e7 96 sub (hl) 42e8 00 nop 42e9 51 ld d,c 42ea 00 nop 42eb a7 and a 42ec 00 nop 42ed a8 xor b 42ee 00 nop 42ef 51 ld d,c 42f0 00 nop 42f1 ba cp d 42f2 00 nop 42f3 bb cp e 42f4 00 nop 42f5 51 ld d,c 42f6 00 nop 42f7 cc00cd call z,#cd00 42fa 00 nop 42fb 51 ld d,c 42fc 00 nop 42fd de00 sbc a,#00 42ff df rst #18 4300 00 nop 4301 51 ld d,c 4302 00 nop 4303 f1 pop af 4304 00 nop 4305 f20051 jp p,#5100 4308 00 nop 4309 3d dec a 430a 010200 ld bc,#0002 430d 60 ld h,b 430e 00 nop 430f 2e00 ld l,#00 4311 2f cpl 4312 00 nop 4313 60 ld h,b 4314 00 nop 4315 40 ld b,b 4316 00 nop 4317 41 ld b,c 4318 00 nop 4319 60 ld h,b 431a 00 nop 431b 52 ld d,d 431c 00 nop 431d 53 ld d,e 431e 00 nop 431f 60 ld h,b 4320 00 nop 4321 64 ld h,h 4322 00 nop 4323 65 ld h,l 4324 00 nop 4325 60 ld h,b 4326 00 nop 4327 76 halt 4328 00 nop 4329 77 ld (hl),a 432a 00 nop 432b 60 ld h,b 432c 00 nop 432d 88 adc a,b 432e 00 nop 432f 89 adc a,c 4330 00 nop 4331 60 ld h,b 4332 00 nop 4333 9a sbc a,d 4334 00 nop 4335 9b sbc a,e 4336 00 nop 4337 60 ld h,b 4338 00 nop 4339 ac xor h 433a 00 nop 433b ad xor l 433c 00 nop 433d 60 ld h,b 433e 00 nop 433f be cp (hl) 4340 00 nop 4341 bf cp a 4342 00 nop 4343 60 ld h,b 4344 00 nop 4345 d0 ret nc 4346 00 nop 4347 d1 pop de 4348 00 nop 4349 60 ld h,b 434a 00 nop 434b e200e3 jp po,#e300 434e 00 nop 434f 60 ld h,b 4350 00 nop 4351 0f rrca 4352 011001 ld bc,#0110 4355 60 ld h,b 4356 00 nop 4357 3d dec a 4358 010200 ld bc,#0002 435b 6f ld l,a 435c 00 nop 435d 2e00 ld l,#00 435f 2f cpl 4360 00 nop 4361 6f ld l,a 4362 00 nop 4363 e200e3 jp po,#e300 4366 00 nop 4367 6f ld l,a 4368 00 nop 4369 fc00fd call m,#fd00 436c 00 nop 436d 6f ld l,a 436e 00 nop 436f 1d 4370 011e01 4373 6f 4374 00 4375 3d 4376 010101 4379 0a 437a 00 437b 3d 437c 01ca00 437f 0a 4380 00 4381 f7 4382 00 4383 8543 4385 RAM TESTING\0 4392 9443 4394 ROM TESTING\0 43a1 a343 43a3 Rom Checksum:\0 ' DisplayKeyboard() 43b1 11feff ld de,#fffe 43b4 cd6b05 call #056b ' Clear Display Buffer 43b7 cd6424 call #2464 ' v9 = 0 43ba 210900 ld hl,#0009 43bd 39 add hl,sp 43be 3600 ld (hl),#00 43c0 182b jr #43ed ; (43) ' v8 = 0 43c2 2b dec hl 43c3 3600 ld (hl),#00 43c5 1813 jr #43da ; (19) ' DrawKey(v9, v8) 43c7 d5 push de 43c8 23 inc hl 43c9 5e ld e,(hl) 43ca d5 push de 43cb cdf943 call #43f9 43ce d1 pop de 43cf d1 pop de ' v8 = v8 + 1 43d0 210800 ld hl,#0008 43d3 39 add hl,sp 43d4 e5 push hl 43d5 6e ld l,(hl) 43d6 23 inc hl 43d7 eb ex de,hl 43d8 e1 pop hl 43d9 73 ld (hl),e ' if v8 < 8 goto 43c7 43da 210800 ld hl,#0008 43dd 39 add hl,sp 43de 5e ld e,(hl) 43df 1600 ld d,#00 43e1 7e ld a,(hl) 43e2 fe08 cp #08 43e4 38e1 jr c,#43c7 ; (-31) ' v9 = v9 + 1 43e6 23 inc hl 43e7 e5 push hl 43e8 6e ld l,(hl) 43e9 23 inc hl 43ea eb ex de,hl 43eb e1 pop hl 43ec 73 ld (hl),e ' if v9 >= 11 goto 2473 43ed 210900 ld hl,#0009 43f0 39 add hl,sp 43f1 7e ld a,(hl) 43f2 fe0b cp #0b ' When Done Write Display Buffer to LCD 43f4 d27324 jp nc,#2473 43f7 18c9 jr #43c2 ; (-55) ' DrawKey(b1, b2) b1=0-10 b2=0-7 43f9 11f6ff ld de,#fff6 43fc cd6b05 call #056b ' v10 = 0 43ff 211000 ld hl,#0010 4402 39 add hl,sp 4403 3600 ld (hl),#00 ' v18 = b2 4405 211800 ld hl,#0018 4408 39 add hl,sp 4409 5e ld e,(hl) 440a 1600 ld d,#00 440c d5 push de ' v16 * 8 440d 2b dec hl 440e 2b dec hl 440f 5e ld e,(hl) 4410 eb ex de,hl 4411 29 add hl,hl 4412 29 add hl,hl 4413 29 add hl,hl ' + v18 4414 d1 pop de 4415 19 add hl,de ' v11 = table(b1, b2) b1 * 8 + b2 4416 110040 ld de,#4000 4419 19 add hl,de 441a 5e ld e,(hl) 441b 211100 ld hl,#0011 441e 39 add hl,sp 441f 73 ld (hl),e ' HL = HL * DE 4420 1600 ld d,#00 4422 210600 ld hl,#0006 4425 cdfb04 call #04fb ' v8 = Xs 4428 11c741 ld de,#41c7 442b 19 add hl,de 442c 5e ld e,(hl) 442d 23 inc hl 442e 56 ld d,(hl) 442f 210800 ld hl,#0008 4432 39 add hl,sp 4433 73 ld (hl),e 4434 23 inc hl 4435 72 ld (hl),d 4436 211100 ld hl,#0011 4439 39 add hl,sp 443a 5e ld e,(hl) 443b 1600 ld d,#00 443d 210600 ld hl,#0006 4440 cdfb04 call #04fb 4443 11c941 ld de,#41c9 4446 19 add hl,de 4447 5e ld e,(hl) 4448 23 inc hl 4449 56 ld d,(hl) ' Va = Y 444a 210a00 ld hl,#000a 444d 39 add hl,sp 444e 73 ld (hl),e 444f 23 inc hl 4450 72 ld (hl),d 4451 211100 ld hl,#0011 4454 39 add hl,sp 4455 5e ld e,(hl) 4456 1600 ld d,#00 4458 210600 ld hl,#0006 445b cdfb04 call #04fb 445e 11cb41 ld de,#41cb 4461 19 add hl,de 4462 5e ld e,(hl) 4463 23 inc hl 4464 56 ld d,(hl) ' Vc = Xe 4465 210c00 ld hl,#000c 4468 39 add hl,sp 4469 73 ld (hl),e 446a 23 inc hl 446b 72 ld (hl),d 446c 211100 ld hl,#0011 446f 39 add hl,sp 4470 5e ld e,(hl) 4471 1600 ld d,#00 4473 210600 ld hl,#0006 4476 cdfb04 call #04fb 4479 11c941 ld de,#41c9 447c 19 add hl,de 447d 5e ld e,(hl) 447e 23 inc hl 447f 56 ld d,(hl) 4480 210e00 ld hl,#000e 4483 19 add hl,de 4484 eb ex de,hl ' Ve = Y + 14 4485 210e00 ld hl,#000e 4488 39 add hl,sp 4489 73 ld (hl),e 448a 23 inc hl 448b 72 ld (hl),d 448c 2b dec hl 448d 5e ld e,(hl) 448e d5 push de 448f 2b dec hl 4490 56 ld d,(hl) 4491 2b dec hl 4492 5e ld e,(hl) 4493 d5 push de 4494 2b dec hl 4495 56 ld d,(hl) 4496 2b dec hl 4497 5e ld e,(hl) 4498 d5 push de 4499 2b dec hl 449a 56 ld d,(hl) 449b 2b dec hl 449c 5e ld e,(hl) 449d d5 push de 449e 21be77 ld hl,#77be 44a1 e5 push hl 44a2 210100 ld hl,#0001 44a5 e5 push hl ' Func05ed(1, 77beH, Xs, Xe, Ys, Ye) - Draw Square 44a6 cded05 call #05ed 44a9 210c00 ld hl,#000c 44ac 39 add hl,sp 44ad f9 ld sp,hl ' v8 = v8 + 4 44ae 210800 ld hl,#0008 44b1 39 add hl,sp 44b2 5e ld e,(hl) 44b3 23 inc hl 44b4 56 ld d,(hl) 44b5 210400 ld hl,#0004 44b8 19 add hl,de 44b9 eb ex de,hl 44ba 210800 ld hl,#0008 44bd 39 add hl,sp 44be 73 ld (hl),e 44bf 23 inc hl 44c0 72 ld (hl),d ' va = va + 4 44c1 23 inc hl 44c2 5e ld e,(hl) 44c3 23 inc hl 44c4 56 ld d,(hl) 44c5 210400 ld hl,#0004 44c8 19 add hl,de 44c9 eb ex de,hl 44ca 210a00 ld hl,#000a 44cd 39 add hl,sp 44ce 73 ld (hl),e 44cf 23 inc hl 44d0 72 ld (hl),d ' DisplayText(KeyName, x, y, 0) 44d1 210000 ld hl,#0000 44d4 e5 push hl 44d5 210c00 ld hl,#000c 44d8 39 add hl,sp 44d9 5e ld e,(hl) 44da 23 inc hl 44db 56 ld d,(hl) 44dc d5 push de 44dd 2b dec hl 44de 2b dec hl 44df 56 ld d,(hl) 44e0 2b dec hl 44e1 5e ld e,(hl) 44e2 d5 push de 44e3 211700 ld hl,#0017 44e6 39 add hl,sp 44e7 5e ld e,(hl) 44e8 1600 ld d,#00 44ea eb ex de,hl 44eb 29 add hl,hl 44ec 115840 ld de,#4058 44ef 19 add hl,de 44f0 5e ld e,(hl) 44f1 23 inc hl 44f2 56 ld d,(hl) 44f3 d5 push de 44f4 cd8d4c call #4c8d 44f7 210800 ld hl,#0008 44fa 39 add hl,sp 44fb f9 ld sp,hl 44fc c9 ret ' EraseKey(b1, b2) b1=0-10 b2=0-7 44fd 11f6ff ld de,#fff6 4500 cd6b05 call #056b 4503 211800 ld hl,#0018 4506 39 add hl,sp 4507 5e ld e,(hl) 4508 1600 ld d,#00 450a d5 push de 450b 2b dec hl 450c 2b dec hl 450d 5e ld e,(hl) 450e eb ex de,hl 450f 29 add hl,hl 4510 29 add hl,hl 4511 29 add hl,hl 4512 d1 pop de 4513 19 add hl,de 4514 110040 ld de,#4000 4517 19 add hl,de 4518 5e ld e,(hl) 4519 211100 ld hl,#0011 451c 39 add hl,sp 451d 73 ld (hl),e 451e 1600 ld d,#00 4520 210600 ld hl,#0006 4523 cdfb04 call #04fb 4526 11c741 ld de,#41c7 4529 19 add hl,de 452a 5e ld e,(hl) 452b 23 inc hl 452c 56 ld d,(hl) 452d 210800 ld hl,#0008 4530 39 add hl,sp 4531 73 ld (hl),e 4532 23 inc hl 4533 72 ld (hl),d 4534 211100 ld hl,#0011 4537 39 add hl,sp 4538 5e ld e,(hl) 4539 1600 ld d,#00 453b 210600 ld hl,#0006 453e cdfb04 call #04fb 4541 11c941 ld de,#41c9 4544 19 add hl,de 4545 5e ld e,(hl) 4546 23 inc hl 4547 56 ld d,(hl) 4548 210a00 ld hl,#000a 454b 39 add hl,sp 454c 73 ld (hl),e 454d 23 inc hl 454e 72 ld (hl),d 454f 211100 ld hl,#0011 4552 39 add hl,sp 4553 5e ld e,(hl) 4554 1600 ld d,#00 4556 210600 ld hl,#0006 4559 cdfb04 call #04fb 455c 11cb41 ld de,#41cb 455f 19 add hl,de 4560 5e ld e,(hl) 4561 23 inc hl 4562 56 ld d,(hl) 4563 210c00 ld hl,#000c 4566 39 add hl,sp 4567 73 ld (hl),e 4568 23 inc hl 4569 72 ld (hl),d 456a 211100 ld hl,#0011 456d 39 add hl,sp 456e 5e ld e,(hl) 456f 1600 ld d,#00 4571 210600 ld hl,#0006 4574 cdfb04 call #04fb 4577 11c941 ld de,#41c9 457a 19 add hl,de 457b 5e ld e,(hl) 457c 23 inc hl 457d 56 ld d,(hl) 457e 210e00 ld hl,#000e 4581 19 add hl,de 4582 eb ex de,hl 4583 210e00 ld hl,#000e 4586 39 add hl,sp 4587 73 ld (hl),e 4588 23 inc hl 4589 72 ld (hl),d 458a 2b dec hl 458b 5e ld e,(hl) 458c eb ex de,hl 458d 23 inc hl 458e e5 push hl 458f eb ex de,hl 4590 2b dec hl 4591 56 ld d,(hl) 4592 2b dec hl 4593 5e ld e,(hl) 4594 d5 push de 4595 2b dec hl 4596 56 ld d,(hl) 4597 2b dec hl 4598 5e ld e,(hl) 4599 d5 push de 459a 2b dec hl 459b 56 ld d,(hl) 459c 2b dec hl 459d 5e ld e,(hl) 459e d5 push de ' Call ClearSquare 459f cd8a20 call #208a 45a2 210800 ld hl,#0008 45a5 39 add hl,sp 45a6 f9 ld sp,hl ' When Done Write Display Buffer to LCD 45a7 cd7324 call #2473 45aa c9 ret ' Keyboard Test 45ab 11f5ff ld de,#fff5 45ae cd6b05 call #056b ' ve = 255 45b1 210e00 ld hl,#000e 45b4 39 add hl,sp 45b5 36ff ld (hl),#ff 45b7 23 inc hl 45b8 3600 ld (hl),#00 ; Led(on) 45ba 210100 ld hl,#0001 45bd e5 push hl 45be cd770a call #0a77 45c1 d1 pop de ' Display Keyboard 45c2 cdb143 call #43b1 ' v11 = 0 45c5 211100 ld hl,#0011 45c8 39 add hl,sp 45c9 3600 ld (hl),#00 45cb 23 inc hl 45cc 3600 ld (hl),#00 ' v10 = 1 45ce 2b dec hl 45cf 2b dec hl 45d0 3601 ld (hl),#01 ' v11 = v11 + 1 45d2 211100 ld hl,#0011 45d5 39 add hl,sp 45d6 5e ld e,(hl) 45d7 23 inc hl 45d8 56 ld d,(hl) 45d9 13 inc de 45da 72 ld (hl),d 45db 2b dec hl 45dc 73 ld (hl),e 45dd 23 inc hl ' ??? 45de 56 ld d,(hl) 45df 213cf6 ld hl,#f63c 45e2 19 add hl,de 45e3 3022 jr nc,#4607 ; (34) ' v11 = 0 45e5 211100 ld hl,#0011 45e8 39 add hl,sp 45e9 3600 ld (hl),#00 45eb 23 inc hl 45ec 3600 ld (hl),#00 ' v10 = 1 - v10 45ee 2b dec hl 45ef 2b dec hl 45f0 7e ld a,(hl) 45f1 b7 or a 45f2 2804 jr z,#45f8 ; (4) 45f4 2e00 ld l,#00 45f6 1802 jr #45fa ; (2) 45f8 2e01 ld l,#01 45fa eb ex de,hl 45fb 211000 ld hl,#0010 45fe 39 add hl,sp 45ff 73 ld (hl),e 4600 1600 ld d,#00 ' Led(v10) 4602 d5 push de 4603 cd770a call #0a77 4606 d1 pop de ' Call func05ed(1, 55f4, &ve) - Get Keyboard input ? 4607 210e00 ld hl,#000e 460a 39 add hl,sp 460b e5 push hl 460c 21f455 ld hl,#55f4 460f e5 push hl 4610 210100 ld hl,#0001 4613 e5 push hl 4614 cded05 call #05ed 4617 d1 pop de 4618 d1 pop de 4619 d1 pop de 461a 2b dec hl 461b 7c ld a,h 461c b5 or l 461d 202a jr nz,#4649 ; (42) ' Delay(30) 461f 211e00 ld hl,#001e 4622 e5 push hl 4623 cd5c0a call #0a5c 4626 d1 pop de ' Call func05ed(1, 79a4) 4627 21a479 ld hl,#79a4 462a e5 push hl 462b 210100 ld hl,#0001 462e e5 push hl 462f cded05 call #05ed 4632 d1 pop de 4633 d1 pop de 4634 11feff ld de,#fffe 4637 7c ld a,h 4638 aa xor d 4639 07 rlca 463a 19 add hl,de 463b ce00 adc a,#00 463d 0f rrca 463e 3809 jr c,#4649 ; (9) ' ve = 255 4640 210e00 ld hl,#000e 4643 39 add hl,sp 4644 36ff ld (hl),#ff 4646 23 inc hl 4647 3600 ld (hl),#00 ' if ve <> 15 goto 4672 - power key 4649 210e00 ld hl,#000e 464c 39 add hl,sp 464d 5e ld e,(hl) 464e 23 inc hl 464f 56 ld d,(hl) 4650 21f1ff ld hl,#fff1 4653 19 add hl,de 4654 7c ld a,h 4655 b5 or l 4656 201a jr nz,#4672 ; (26) ' Led(Off) 4658 210000 ld hl,#0000 465b e5 push hl 465c cd770a call #0a77 465f d1 pop de ' Clear Display and bit map buffer 4660 cd850a call #0a85 ' Delay(100) 4663 216400 ld hl,#0064 4666 e5 push hl 4667 cd5c0a call #0a5c 466a d1 pop de 466b cd9d0a call #0a9d 466e 210100 ld hl,#0001 4671 c9 ret ' if ve = 255 goto 45d2 - no key 4672 210e00 ld hl,#000e 4675 39 add hl,sp 4676 5e ld e,(hl) 4677 23 inc hl 4678 56 ld d,(hl) 4679 2101ff ld hl,#ff01 467c 19 add hl,de 467d 7c ld a,h 467e b5 or l 467f cad245 jp z,#45d2 4682 eb ex de,hl 4683 7d ld a,l 4684 e6f0 and #f0 4686 1f rra 4687 1f rra 4688 1f rra 4689 1f rra 468a e60f and #0f 468c 210b00 ld hl,#000b 468f 39 add hl,sp 4690 77 ld (hl),a 4691 23 inc hl 4692 23 inc hl 4693 23 inc hl 4694 7e ld a,(hl) 4695 e60f and #0f 4697 5f ld e,a 4698 2b dec hl 4699 2b dec hl 469a 77 ld (hl),a 469b 1600 ld d,#00 469d d5 push de 469e 2b dec hl 469f 5e ld e,(hl) 46a0 d5 push de 46a1 cdfd44 call #44fd - erase key 46a4 d1 pop de 46a5 d1 pop de 46a6 c3d245 jp #45d2 46a9 ab46 46ab FLASH TESTING\0 46b9 11ecff ld de,#ffec 46bc cd6b05 call #056b 46bf 212000 ld hl,#0020 46c2 39 add hl,sp 46c3 7e ld a,(hl) 46c4 fe02 cp #02 46c6 2010 jr nz,#46d8 ; (16) 46c8 3a59f6 ld a,(#f659) 46cb fe01 cp #01 46cd 2004 jr nz,#46d3 ; (4) 46cf 210100 ld hl,#0001 46d2 c9 ret 46d3 3e01 ld a,#01 46d5 3259f6 ld (#f659),a 46d8 3a32d6 ld a,(#d632) 46db 210900 ld hl,#0009 46de 39 add hl,sp 46df 77 ld (hl),a 46e0 23 inc hl 46e1 3600 ld (hl),#00 46e3 3e08 ld a,#08 46e5 3232d6 ld (#d632),a 46e8 3e00 ld a,#00 46ea 3250f6 ld (#f650),a ' DisplayText("FLASH TESTING", 110, 40, 1) 46ed 210100 ld hl,#0001 46f0 e5 push hl 46f1 2e28 ld l,#28 46f3 e5 push hl 46f4 2e6e ld l,#6e 46f6 e5 push hl 46f7 2aa946 ld hl,(#46a9) 46fa e5 push hl 46fb cd8d4c call #4c8d 46fe 210800 ld hl,#0008 4701 39 add hl,sp 4702 f9 ld sp,hl 4703 216400 ld hl,#0064 4706 e5 push hl 4707 210801 ld hl,#0108 470a e5 push hl 470b 215a00 ld hl,#005a 470e e5 push hl 470f 2e46 ld l,#46 4711 e5 push hl 4712 21be77 ld hl,#77be 4715 e5 push hl 4716 210100 ld hl,#0001 4719 e5 push hl 471a cded05 call #05ed 471d 210c00 ld hl,#000c 4720 39 add hl,sp 4721 f9 ld sp,hl 4722 cd7324 call #2473 4725 211600 ld hl,#0016 4728 39 add hl,sp 4729 36fe ld (hl),#fe 472b 23 inc hl 472c 3607 ld (hl),#07 472e 2168e8 ld hl,#e868 4731 e5 push hl 4732 210001 ld hl,#0100 4735 e5 push hl 4736 25 dec h 4737 e5 push hl 4738 211c00 ld hl,#001c 473b 39 add hl,sp 473c 5e ld e,(hl) 473d 23 inc hl 473e 56 ld d,(hl) 473f d5 push de 4740 cd0537 call #3705 4743 210800 ld hl,#0008 4746 39 add hl,sp 4747 f9 ld sp,hl 4748 1600 ld d,#00 474a 211a00 ld hl,#001a 474d 39 add hl,sp 474e 3600 ld (hl),#00 4750 23 inc hl 4751 3600 ld (hl),#00 4753 210800 ld hl,#0008 4756 39 add hl,sp 4757 5e ld e,(hl) 4758 d5 push de 4759 211c00 ld hl,#001c 475c 39 add hl,sp 475d 5e ld e,(hl) 475e 23 inc hl 475f 56 ld d,(hl) 4760 2168e7 ld hl,#e768 4763 19 add hl,de 4764 d1 pop de 4765 73 ld (hl),e 4766 210800 ld hl,#0008 4769 39 add hl,sp 476a e5 push hl 476b 6e ld l,(hl) 476c 23 inc hl 476d eb ex de,hl 476e e1 pop hl 476f 73 ld (hl),e 4770 211a00 ld hl,#001a 4773 39 add hl,sp 4774 5e ld e,(hl) 4775 23 inc hl 4776 56 ld d,(hl) 4777 13 inc de 4778 72 ld (hl),d 4779 2b dec hl 477a 73 ld (hl),e 477b 23 inc hl 477c 56 ld d,(hl) 477d 2100ff ld hl,#ff00 4780 19 add hl,de 4781 30d0 jr nc,#4753 ; (-48) 4783 2168e7 ld hl,#e768 4786 e5 push hl 4787 210001 ld hl,#0100 478a e5 push hl 478b 25 dec h 478c e5 push hl 478d 211c00 ld hl,#001c 4790 39 add hl,sp 4791 5e ld e,(hl) 4792 23 inc hl 4793 56 ld d,(hl) 4794 d5 push de 4795 cd0c36 call #360c 4798 210800 ld hl,#0008 479b 39 add hl,sp 479c f9 ld sp,hl 479d 2168e7 ld hl,#e768 47a0 e5 push hl 47a1 210001 ld hl,#0100 47a4 e5 push hl 47a5 25 dec h 47a6 e5 push hl 47a7 211c00 ld hl,#001c 47aa 39 add hl,sp 47ab 5e ld e,(hl) 47ac 23 inc hl 47ad 56 ld d,(hl) 47ae d5 push de 47af cd0537 call #3705 47b2 210800 ld hl,#0008 47b5 39 add hl,sp 47b6 f9 ld sp,hl 47b7 211a00 ld hl,#001a 47ba 39 add hl,sp 47bb 3600 ld (hl),#00 47bd 23 inc hl 47be 3600 ld (hl),#00 47c0 210800 ld hl,#0008 47c3 39 add hl,sp 47c4 5e ld e,(hl) 47c5 1600 ld d,#00 47c7 d5 push de 47c8 211c00 ld hl,#001c 47cb 39 add hl,sp 47cc 5e ld e,(hl) 47cd 23 inc hl 47ce 56 ld d,(hl) 47cf 2168e7 ld hl,#e768 47d2 19 add hl,de 47d3 5e ld e,(hl) 47d4 e1 pop hl 47d5 7d ld a,l 47d6 bb cp e 47d7 280c jr z,#47e5 ; (12) 47d9 211800 ld hl,#0018 47dc 39 add hl,sp 47dd 3601 ld (hl),#01 47df 23 inc hl 47e0 3600 ld (hl),#00 47e2 c3564a jp #4a56 47e5 210800 ld hl,#0008 47e8 39 add hl,sp 47e9 e5 push hl 47ea 6e ld l,(hl) 47eb 23 inc hl 47ec eb ex de,hl 47ed e1 pop hl 47ee 73 ld (hl),e 47ef 211a00 ld hl,#001a 47f2 39 add hl,sp 47f3 5e ld e,(hl) 47f4 23 inc hl 47f5 56 ld d,(hl) 47f6 13 inc de 47f7 72 ld (hl),d 47f8 2b dec hl 47f9 73 ld (hl),e 47fa 23 inc hl 47fb 56 ld d,(hl) 47fc 2100ff ld hl,#ff00 47ff 19 add hl,de 4800 30be jr nc,#47c0 ; (-66) 4802 211600 ld hl,#0016 4805 39 add hl,sp 4806 5e ld e,(hl) 4807 23 inc hl 4808 56 ld d,(hl) 4809 2102f8 ld hl,#f802 480c 19 add hl,de 480d 7c ld a,h 480e b5 or l 480f 202a jr nz,#483b ; (42) 4811 211a00 ld hl,#001a 4814 39 add hl,sp 4815 3600 ld (hl),#00 4817 23 inc hl 4818 3600 ld (hl),#00 481a 211a00 ld hl,#001a 481d 39 add hl,sp 481e 5e ld e,(hl) 481f 23 inc hl 4820 56 ld d,(hl) 4821 2168e8 ld hl,#e868 4824 19 add hl,de 4825 1e00 ld e,#00 4827 73 ld (hl),e 4828 211a00 ld hl,#001a 482b 39 add hl,sp 482c 5e ld e,(hl) 482d 23 inc hl 482e 56 ld d,(hl) 482f 13 inc de 4830 72 ld (hl),d 4831 2b dec hl 4832 73 ld (hl),e 4833 23 inc hl 4834 56 ld d,(hl) 4835 21faff ld hl,#fffa 4838 19 add hl,de 4839 30df jr nc,#481a ; (-33) 483b 2168e8 ld hl,#e868 483e e5 push hl 483f 210001 ld hl,#0100 4842 e5 push hl 4843 25 dec h 4844 e5 push hl 4845 211c00 ld hl,#001c 4848 39 add hl,sp 4849 5e ld e,(hl) 484a 23 inc hl 484b 56 ld d,(hl) 484c d5 push de 484d cd0c36 call #360c 4850 210800 ld hl,#0008 4853 39 add hl,sp 4854 f9 ld sp,hl 4855 211600 ld hl,#0016 4858 39 add hl,sp 4859 5e ld e,(hl) 485a 23 inc hl 485b 56 ld d,(hl) 485c 13 inc de 485d 72 ld (hl),d 485e 2b dec hl 485f 73 ld (hl),e 4860 23 inc hl 4861 56 ld d,(hl) 4862 2100f8 ld hl,#f800 4865 19 add hl,de 4866 d22e47 jp nc,#472e 4869 211800 ld hl,#0018 486c 39 add hl,sp 486d 3634 ld (hl),#34 486f 23 inc hl 4870 3600 ld (hl),#00 4872 2b dec hl 4873 2b dec hl 4874 3600 ld (hl),#00 4876 2b dec hl 4877 3600 ld (hl),#00 4879 211600 ld hl,#0016 487c 39 add hl,sp 487d 5e ld e,(hl) 487e 23 inc hl 487f eb ex de,hl 4880 7d ld a,l 4881 e67f and #7f 4883 eb ex de,hl 4884 23 inc hl 4885 23 inc hl 4886 23 inc hl 4887 77 ld (hl),a 4888 23 inc hl 4889 3600 ld (hl),#00 488b 2b dec hl 488c 7e ld a,(hl) 488d 23 inc hl 488e b6 or (hl) 488f 203e jr nz,#48cf ; (62) 4891 216200 ld hl,#0062 4894 e5 push hl 4895 211a00 ld hl,#001a 4898 39 add hl,sp 4899 5e ld e,(hl) 489a 23 inc hl 489b 56 ld d,(hl) 489c 211800 ld hl,#0018 489f 19 add hl,de 48a0 e5 push hl 48a1 215c00 ld hl,#005c 48a4 e5 push hl 48a5 211e00 ld hl,#001e 48a8 39 add hl,sp 48a9 5e ld e,(hl) 48aa 23 inc hl 48ab 56 ld d,(hl) 48ac 211400 ld hl,#0014 48af 19 add hl,de 48b0 e5 push hl 48b1 cd3c21 call #213c 48b4 210800 ld hl,#0008 48b7 39 add hl,sp 48b8 f9 ld sp,hl 48b9 cd7324 call #2473 48bc 211800 ld hl,#0018 48bf 39 add hl,sp 48c0 5e ld e,(hl) 48c1 23 inc hl 48c2 56 ld d,(hl) 48c3 210600 ld hl,#0006 48c6 19 add hl,de 48c7 eb ex de,hl 48c8 211800 ld hl,#0018 48cb 39 add hl,sp 48cc 73 ld (hl),e 48cd 23 inc hl 48ce 72 ld (hl),d 48cf 211600 ld hl,#0016 48d2 39 add hl,sp 48d3 5e ld e,(hl) 48d4 210800 ld hl,#0008 48d7 39 add hl,sp 48d8 73 ld (hl),e 48d9 1600 ld d,#00 48db 211a00 ld hl,#001a 48de 39 add hl,sp 48df 3600 ld (hl),#00 48e1 23 inc hl 48e2 3600 ld (hl),#00 48e4 210800 ld hl,#0008 48e7 39 add hl,sp 48e8 5e ld e,(hl) 48e9 d5 push de 48ea 211c00 ld hl,#001c 48ed 39 add hl,sp 48ee 5e ld e,(hl) 48ef 23 inc hl 48f0 56 ld d,(hl) 48f1 2168e7 ld hl,#e768 48f4 19 add hl,de 48f5 d1 pop de 48f6 73 ld (hl),e 48f7 210800 ld hl,#0008 48fa 39 add hl,sp 48fb e5 push hl 48fc 6e ld l,(hl) 48fd 23 inc hl 48fe eb ex de,hl 48ff e1 pop hl 4900 73 ld (hl),e 4901 211a00 ld hl,#001a 4904 39 add hl,sp 4905 5e ld e,(hl) 4906 23 inc hl 4907 56 ld d,(hl) 4908 13 inc de 4909 72 ld (hl),d 490a 2b dec hl 490b 73 ld (hl),e 490c 23 inc hl 490d 56 ld d,(hl) 490e 2100ff ld hl,#ff00 4911 19 add hl,de 4912 30d0 jr nc,#48e4 ; (-48) 4914 2168e7 ld hl,#e768 4917 e5 push hl 4918 210001 ld hl,#0100 491b e5 push hl 491c 25 dec h 491d e5 push hl 491e 211c00 ld hl,#001c 4921 39 add hl,sp 4922 5e ld e,(hl) 4923 23 inc hl 4924 56 ld d,(hl) 4925 d5 push de 4926 cd0c36 call #360c 4929 210800 ld hl,#0008 492c 39 add hl,sp 492d f9 ld sp,hl 492e 211600 ld hl,#0016 4931 39 add hl,sp 4932 5e ld e,(hl) 4933 23 inc hl 4934 56 ld d,(hl) 4935 13 inc de 4936 72 ld (hl),d 4937 2b dec hl 4938 73 ld (hl),e 4939 23 inc hl 493a 56 ld d,(hl) 493b 2102f8 ld hl,#f802 493e 19 add hl,de 493f d27948 jp nc,#4879 4942 211600 ld hl,#0016 4945 39 add hl,sp 4946 3600 ld (hl),#00 4948 23 inc hl 4949 3600 ld (hl),#00 494b 211600 ld hl,#0016 494e 39 add hl,sp 494f 5e ld e,(hl) 4950 23 inc hl 4951 eb ex de,hl 4952 7d ld a,l 4953 e67f and #7f 4955 eb ex de,hl 4956 23 inc hl 4957 23 inc hl 4958 23 inc hl 4959 77 ld (hl),a 495a 23 inc hl 495b 3600 ld (hl),#00 495d 2b dec hl 495e 7e ld a,(hl) 495f 23 inc hl 4960 b6 or (hl) 4961 203e jr nz,#49a1 ; (62) 4963 216200 ld hl,#0062 4966 e5 push hl 4967 211a00 ld hl,#001a 496a 39 add hl,sp 496b 5e ld e,(hl) 496c 23 inc hl 496d 56 ld d,(hl) 496e 211800 ld hl,#0018 4971 19 add hl,de 4972 e5 push hl 4973 215c00 ld hl,#005c 4976 e5 push hl 4977 211e00 ld hl,#001e 497a 39 add hl,sp 497b 5e ld e,(hl) 497c 23 inc hl 497d 56 ld d,(hl) 497e 211400 ld hl,#0014 4981 19 add hl,de 4982 e5 push hl 4983 cd3c21 call #213c 4986 210800 ld hl,#0008 4989 39 add hl,sp 498a f9 ld sp,hl 498b cd7324 call #2473 498e 211800 ld hl,#0018 4991 39 add hl,sp 4992 5e ld e,(hl) 4993 23 inc hl 4994 56 ld d,(hl) 4995 210600 ld hl,#0006 4998 19 add hl,de 4999 eb ex de,hl 499a 211800 ld hl,#0018 499d 39 add hl,sp 499e 73 ld (hl),e 499f 23 inc hl 49a0 72 ld (hl),d 49a1 2168e7 ld hl,#e768 49a4 e5 push hl 49a5 210001 ld hl,#0100 49a8 e5 push hl 49a9 25 dec h 49aa e5 push hl 49ab 211c00 ld hl,#001c 49ae 39 add hl,sp 49af 5e ld e,(hl) 49b0 23 inc hl 49b1 56 ld d,(hl) 49b2 d5 push de 49b3 cd0537 call #3705 49b6 210800 ld hl,#0008 49b9 39 add hl,sp 49ba f9 ld sp,hl 49bb 211600 ld hl,#0016 49be 39 add hl,sp 49bf 5e ld e,(hl) 49c0 210800 ld hl,#0008 49c3 39 add hl,sp 49c4 73 ld (hl),e 49c5 211a00 ld hl,#001a 49c8 39 add hl,sp 49c9 3600 ld (hl),#00 49cb 23 inc hl 49cc 3600 ld (hl),#00 49ce 210800 ld hl,#0008 49d1 39 add hl,sp 49d2 5e ld e,(hl) 49d3 1600 ld d,#00 49d5 d5 push de 49d6 211c00 ld hl,#001c 49d9 39 add hl,sp 49da 5e ld e,(hl) 49db 23 inc hl 49dc 56 ld d,(hl) 49dd 2168e7 ld hl,#e768 49e0 19 add hl,de 49e1 5e ld e,(hl) 49e2 e1 pop hl 49e3 7d ld a,l 49e4 bb cp e 49e5 280b jr z,#49f2 ; (11) 49e7 211800 ld hl,#0018 49ea 39 add hl,sp 49eb 3601 ld (hl),#01 49ed 23 inc hl 49ee 3600 ld (hl),#00 49f0 1864 jr #4a56 ; (100) 49f2 210800 ld hl,#0008 49f5 39 add hl,sp 49f6 e5 push hl 49f7 6e ld l,(hl) 49f8 23 inc hl 49f9 eb ex de,hl 49fa e1 pop hl 49fb 73 ld (hl),e 49fc 211a00 ld hl,#001a 49ff 39 add hl,sp 4a00 5e ld e,(hl) 4a01 23 inc hl 4a02 56 ld d,(hl) 4a03 13 inc de 4a04 72 ld (hl),d 4a05 2b dec hl 4a06 73 ld (hl),e 4a07 23 inc hl 4a08 56 ld d,(hl) 4a09 2100ff ld hl,#ff00 4a0c 19 add hl,de 4a0d 30bf jr nc,#49ce ; (-65) 4a0f 210001 ld hl,#0100 4a12 e5 push hl 4a13 25 dec h 4a14 e5 push hl 4a15 2168e7 ld hl,#e768 4a18 e5 push hl 4a19 cda805 call #05a8 4a1c d1 pop de 4a1d d1 pop de 4a1e d1 pop de 4a1f 2168e7 ld hl,#e768 4a22 e5 push hl 4a23 210001 ld hl,#0100 4a26 e5 push hl 4a27 25 dec h 4a28 e5 push hl 4a29 211c00 ld hl,#001c 4a2c 39 add hl,sp 4a2d 5e ld e,(hl) 4a2e 23 inc hl 4a2f 56 ld d,(hl) 4a30 d5 push de 4a31 cd0c36 call #360c 4a34 210800 ld hl,#0008 4a37 39 add hl,sp 4a38 f9 ld sp,hl 4a39 211600 ld hl,#0016 4a3c 39 add hl,sp 4a3d 5e ld e,(hl) 4a3e 23 inc hl 4a3f 56 ld d,(hl) 4a40 13 inc de 4a41 72 ld (hl),d 4a42 2b dec hl 4a43 73 ld (hl),e 4a44 23 inc hl 4a45 56 ld d,(hl) 4a46 2102f8 ld hl,#f802 4a49 19 add hl,de 4a4a d24b49 jp nc,#494b 4a4d 211800 ld hl,#0018 4a50 39 add hl,sp 4a51 3600 ld (hl),#00 4a53 23 inc hl 4a54 3600 ld (hl),#00 4a56 217800 ld hl,#0078 4a59 e5 push hl 4a5a 214001 ld hl,#0140 4a5d e5 push hl 4a5e 214600 ld hl,#0046 4a61 e5 push hl 4a62 6c ld l,h 4a63 e5 push hl 4a64 cd8a20 call #208a 4a67 210800 ld hl,#0008 4a6a 39 add hl,sp 4a6b f9 ld sp,hl 4a6c 211800 ld hl,#0018 4a6f 39 add hl,sp 4a70 5e ld e,(hl) 4a71 23 inc hl 4a72 56 ld d,(hl) 4a73 1b dec de 4a74 7a ld a,d 4a75 b3 or e 4a76 2038 jr nz,#4ab0 ; (56) 4a78 3a50f6 ld a,(#f650) 4a7b e6fd and #fd 4a7d 3250f6 ld (#f650),a 4a80 210a00 ld hl,#000a 4a83 e5 push hl 4a84 210d00 ld hl,#000d 4a87 39 add hl,sp 4a88 e5 push hl 4a89 211a00 ld hl,#001a 4a8c 39 add hl,sp 4a8d 5e ld e,(hl) 4a8e 23 inc hl 4a8f 56 ld d,(hl) 4a90 d5 push de 4a91 cdb507 call #07b5 4a94 d1 pop de 4a95 d1 pop de 4a96 d1 pop de 'DisplayText(???, 200, 90, 0) 4a97 210000 ld hl,#0000 4a9a e5 push hl 4a9b 2e5a ld l,#5a 4a9d e5 push hl 4a9e 2ec8 ld l,#c8 4aa0 e5 push hl 4aa1 211100 ld hl,#0011 4aa4 39 add hl,sp 4aa5 e5 push hl 4aa6 cd8d4c call #4c8d 4aa9 210800 ld hl,#0008 4aac 39 add hl,sp 4aad f9 ld sp,hl 4aae 1808 jr #4ab8 ; (8) 4ab0 3a50f6 ld a,(#f650) 4ab3 f602 or #02 4ab5 3250f6 ld (#f650),a 4ab8 3a50f6 ld a,(#f650) 4abb f601 or #01 4abd 3250f6 ld (#f650),a 4ac0 cd7324 call #2473 4ac3 210900 ld hl,#0009 4ac6 39 add hl,sp 4ac7 7e ld a,(hl) 4ac8 3232d6 ld (#d632),a 4acb 211800 ld hl,#0018 4ace 39 add hl,sp 4acf 7e ld a,(hl) 4ad0 23 inc hl 4ad1 b6 or (hl) 4ad2 2804 jr z,#4ad8 ; (4) 4ad4 2e00 ld l,#00 4ad6 1802 jr #4ada ; (2) 4ad8 2e01 ld l,#01 4ada 2600 ld h,#00 4adc c9 ret 4add 55 ld d,l 4ade aa xor d 4adf 07 rlca 4ae0 0655 ld b,#55 4ae2 aa xor d 4ae3 cd04c9 call #c904 4ae6 04 inc b 4ae7 4d ld c,l 4ae8 04 inc b 4ae9 cd008d call #8d00 4aec 04 inc b 4aed cc04c5 call z,#c504 4af0 04 inc b 4af1 320322 ld (#2203),a 4af4 03 inc bc 4af5 320232 ld (#3202),a 4af8 011203 ld bc,#0312 4afb 3003 jr nc,#4b00 ; (3) 4afd 00 nop 4afe 00 nop 4aff 11fbff ld de,#fffb 4b02 cd6b05 call #056b 4b05 210001 ld hl,#0100 4b08 e5 push hl 4b09 25 dec h 4b0a e5 push hl 4b0b 2168e7 ld hl,#e768 4b0e e5 push hl 4b0f cda805 call #05a8 4b12 d1 pop de 4b13 d1 pop de 4b14 d1 pop de 4b15 2168e7 ld hl,#e768 4b18 e5 push hl 4b19 210600 ld hl,#0006 4b1c e5 push hl 4b1d 6c ld l,h 4b1e e5 push hl 4b1f 21fe07 ld hl,#07fe 4b22 e5 push hl 4b23 cd0c36 call #360c 4b26 210800 ld hl,#0008 4b29 39 add hl,sp 4b2a f9 ld sp,hl 4b2b 210a00 ld hl,#000a 4b2e 39 add hl,sp 4b2f 3600 ld (hl),#00 4b31 c3764c jp #4c76 4b34 2b dec hl 4b35 3600 ld (hl),#00 4b37 1847 jr #4b80 ; (71) 4b39 210900 ld hl,#0009 4b3c 39 add hl,sp 4b3d 5e ld e,(hl) 4b3e eb ex de,hl 4b3f 29 add hl,hl 4b40 e5 push hl 4b41 eb ex de,hl 4b42 23 inc hl 4b43 5e ld e,(hl) 4b44 1600 ld d,#00 4b46 210e00 ld hl,#000e 4b49 cdfb04 call #04fb 4b4c d1 pop de 4b4d 19 add hl,de 4b4e 11e34a ld de,#4ae3 4b51 19 add hl,de 4b52 5e ld e,(hl) 4b53 23 inc hl 4b54 56 ld d,(hl) 4b55 210b00 ld hl,#000b 4b58 39 add hl,sp 4b59 73 ld (hl),e 4b5a 23 inc hl 4b5b 72 ld (hl),d 4b5c 2168e7 ld hl,#e768 4b5f e5 push hl 4b60 210001 ld hl,#0100 4b63 e5 push hl 4b64 25 dec h 4b65 e5 push hl 4b66 211100 ld hl,#0011 4b69 39 add hl,sp 4b6a 5e ld e,(hl) 4b6b 23 inc hl 4b6c 56 ld d,(hl) 4b6d d5 push de 4b6e cd0c36 call #360c 4b71 210800 ld hl,#0008 4b74 39 add hl,sp 4b75 f9 ld sp,hl 4b76 210900 ld hl,#0009 4b79 39 add hl,sp 4b7a e5 push hl 4b7b 6e ld l,(hl) 4b7c 23 inc hl 4b7d eb ex de,hl 4b7e e1 pop hl 4b7f 73 ld (hl),e 4b80 210a00 ld hl,#000a 4b83 39 add hl,sp 4b84 5e ld e,(hl) 4b85 1600 ld d,#00 4b87 21df4a ld hl,#4adf 4b8a 19 add hl,de 4b8b 5e ld e,(hl) 4b8c d5 push de 4b8d 210b00 ld hl,#000b 4b90 39 add hl,sp 4b91 5e ld e,(hl) 4b92 e1 pop hl 4b93 7d ld a,l 4b94 1c inc e 4b95 2803 jr z,#4b9a ; (3) 4b97 bb cp e 4b98 309f jr nc,#4b39 ; (-97) 4b9a 210a00 ld hl,#000a 4b9d 39 add hl,sp 4b9e 5e ld e,(hl) 4b9f 21dd4a ld hl,#4add 4ba2 19 add hl,de 4ba3 5e ld e,(hl) 4ba4 210800 ld hl,#0008 4ba7 39 add hl,sp 4ba8 73 ld (hl),e 4ba9 e5 push hl 4baa 210100 ld hl,#0001 4bad e5 push hl 4bae 210e00 ld hl,#000e 4bb1 39 add hl,sp 4bb2 5e ld e,(hl) 4bb3 21e14a ld hl,#4ae1 4bb6 19 add hl,de 4bb7 5e ld e,(hl) 4bb8 d5 push de 4bb9 211000 ld hl,#0010 4bbc 39 add hl,sp 4bbd 5e ld e,(hl) 4bbe 210e00 ld hl,#000e 4bc1 cdfb04 call #04fb 4bc4 11e34a ld de,#4ae3 4bc7 19 add hl,de 4bc8 5e ld e,(hl) 4bc9 23 inc hl 4bca 56 ld d,(hl) 4bcb d5 push de 4bcc cd0c36 call #360c 4bcf 210800 ld hl,#0008 4bd2 39 add hl,sp 4bd3 f9 ld sp,hl 4bd4 210900 ld hl,#0009 4bd7 39 add hl,sp 4bd8 3601 ld (hl),#01 4bda 1875 jr #4c51 ; (117) 4bdc 210800 ld hl,#0008 4bdf 39 add hl,sp 4be0 3600 ld (hl),#00 4be2 23 inc hl 4be3 5e ld e,(hl) 4be4 eb ex de,hl 4be5 29 add hl,hl 4be6 e5 push hl 4be7 eb ex de,hl 4be8 23 inc hl 4be9 5e ld e,(hl) 4bea 1600 ld d,#00 4bec 210e00 ld hl,#000e 4bef cdfb04 call #04fb 4bf2 d1 pop de 4bf3 19 add hl,de 4bf4 11e34a ld de,#4ae3 4bf7 19 add hl,de 4bf8 5e ld e,(hl) 4bf9 23 inc hl 4bfa 56 ld d,(hl) 4bfb 210b00 ld hl,#000b 4bfe 39 add hl,sp 4bff 73 ld (hl),e 4c00 23 inc hl 4c01 72 ld (hl),d 4c02 210800 ld hl,#0008 4c05 39 add hl,sp 4c06 e5 push hl 4c07 210100 ld hl,#0001 4c0a e5 push hl 4c0b 210e00 ld hl,#000e 4c0e 39 add hl,sp 4c0f 5e ld e,(hl) 4c10 1600 ld d,#00 4c12 21e14a ld hl,#4ae1 4c15 19 add hl,de 4c16 5e ld e,(hl) 4c17 d5 push de 4c18 211100 ld hl,#0011 4c1b 39 add hl,sp 4c1c 5e ld e,(hl) 4c1d 23 inc hl 4c1e 56 ld d,(hl) 4c1f d5 push de 4c20 cd0537 call #3705 4c23 210800 ld hl,#0008 4c26 39 add hl,sp 4c27 f9 ld sp,hl 4c28 210a00 ld hl,#000a 4c2b 39 add hl,sp 4c2c 5e ld e,(hl) 4c2d 1600 ld d,#00 4c2f 21dd4a ld hl,#4add 4c32 19 add hl,de 4c33 5e ld e,(hl) 4c34 d5 push de 4c35 210a00 ld hl,#000a 4c38 39 add hl,sp 4c39 5e ld e,(hl) 4c3a e1 pop hl 4c3b 7d ld a,l 4c3c bb cp e 4c3d 2008 jr nz,#4c47 ; (8) 4c3f 210800 ld hl,#0008 4c42 39 add hl,sp 4c43 3600 ld (hl),#00 4c45 183d jr #4c84 ; (61) 4c47 210900 ld hl,#0009 4c4a 39 add hl,sp 4c4b e5 push hl 4c4c 6e ld l,(hl) 4c4d 23 inc hl 4c4e eb ex de,hl 4c4f e1 pop hl 4c50 73 ld (hl),e 4c51 210a00 ld hl,#000a 4c54 39 add hl,sp 4c55 5e ld e,(hl) 4c56 1600 ld d,#00 4c58 21df4a ld hl,#4adf 4c5b 19 add hl,de 4c5c 5e ld e,(hl) 4c5d d5 push de 4c5e 210b00 ld hl,#000b 4c61 39 add hl,sp 4c62 5e ld e,(hl) 4c63 e1 pop hl 4c64 7d ld a,l 4c65 1c inc e 4c66 2804 jr z,#4c6c ; (4) 4c68 bb cp e 4c69 d2dc4b jp nc,#4bdc 4c6c 210a00 ld hl,#000a 4c6f 39 add hl,sp 4c70 e5 push hl 4c71 6e ld l,(hl) 4c72 23 inc hl 4c73 eb ex de,hl 4c74 e1 pop hl 4c75 73 ld (hl),e 4c76 210a00 ld hl,#000a 4c79 39 add hl,sp 4c7a 7e ld a,(hl) 4c7b fe02 cp #02 4c7d da344b jp c,#4b34 4c80 2b dec hl 4c81 2b dec hl 4c82 3601 ld (hl),#01 4c84 210800 ld hl,#0008 4c87 39 add hl,sp 4c88 5e ld e,(hl) 4c89 1600 ld d,#00 4c8b eb ex de,hl 4c8c c9 ret ' DisplayText(s, x, y, size) 4c8d 1193ff ld de,#ff93 4c90 cd6b05 call #056b 4c93 217b00 ld hl,#007b 4c96 39 add hl,sp 4c97 5e ld e,(hl) 4c98 23 inc hl 4c99 56 ld d,(hl) 4c9a 216c00 ld hl,#006c 4c9d 39 add hl,sp 4c9e 73 ld (hl),e 4c9f 23 inc hl 4ca0 72 ld (hl),d 4ca1 217d00 ld hl,#007d 4ca4 39 add hl,sp 4ca5 5e ld e,(hl) 4ca6 23 inc hl 4ca7 56 ld d,(hl) 4ca8 216e00 ld hl,#006e 4cab 39 add hl,sp 4cac 73 ld (hl),e 4cad 23 inc hl 4cae 72 ld (hl),d 4caf 23 inc hl 4cb0 363f ld (hl),#3f 4cb2 23 inc hl 4cb3 3601 ld (hl),#01 4cb5 23 inc hl 4cb6 367f ld (hl),#7f 4cb8 23 inc hl 4cb9 3600 ld (hl),#00 4cbb 217f00 ld hl,#007f 4cbe 39 add hl,sp 4cbf 5e ld e,(hl) 4cc0 217400 ld hl,#0074 4cc3 39 add hl,sp 4cc4 73 ld (hl),e 4cc5 217900 ld hl,#0079 4cc8 39 add hl,sp 4cc9 5e ld e,(hl) 4cca 23 inc hl 4ccb 56 ld d,(hl) 4ccc d5 push de 4ccd 210a00 ld hl,#000a 4cd0 39 add hl,sp 4cd1 e5 push hl 4cd2 cdc605 call #05c6 4cd5 d1 pop de 4cd6 d1 pop de 4cd7 217900 ld hl,#0079 4cda 39 add hl,sp 4cdb 5e ld e,(hl) 4cdc 23 inc hl 4cdd 56 ld d,(hl) 4cde d5 push de 4cdf cdcc05 call #05cc 4ce2 d1 pop de 4ce3 2600 ld h,#00 4ce5 e5 push hl 4ce6 210a00 ld hl,#000a 4ce9 39 add hl,sp 4cea e5 push hl 4ceb 217000 ld hl,#0070 4cee 39 add hl,sp 4cef e5 push hl 4cf0 cd7a1e call #1e7a 4cf3 d1 pop de 4cf4 d1 pop de 4cf5 d1 pop de 4cf6 c9 ret 4cf7 f94c 4cf9 LCD TEST\0 4d02 11f5ff ld de,#fff5 4d05 cd6b05 call #056b 4d08 210a00 ld hl,#000a 4d0b 39 add hl,sp 4d0c 3601 ld (hl),#01 4d0e cd850a call #0a85 4d11 210a00 ld hl,#000a 4d14 39 add hl,sp 4d15 5e ld e,(hl) 4d16 1600 ld d,#00 4d18 21f5ff ld hl,#fff5 4d1b 19 add hl,de 4d1c daf44e jp c,#4ef4 4d1f 21294d ld hl,#4d29 4d22 19 add hl,de 4d23 19 add hl,de 4d24 5e ld e,(hl) 4d25 23 inc hl 4d26 56 ld d,(hl) 4d27 eb ex de,hl 4d28 e9 jp (hl) 4d29 f44e 4d2b 3f4d 4d2d 5f4d 4d2f 9d4d 4d31 db4d 4d33 1a4e 4d35 594e 4d37 694e 4d39 784e 4d3b d94e 4d3d f04e 4d3f 218000 ld hl,#0080 4d42 e5 push hl 4d43 214001 ld hl,#0140 4d46 e5 push hl 4d47 210000 ld hl,#0000 4d4a e5 push hl 4d4b e5 push hl 4d4c 21be77 ld hl,#77be 4d4f e5 push hl 4d50 210100 ld hl,#0001 4d53 e5 push hl 4d54 cded05 call #05ed 4d57 210c00 ld hl,#000c 4d5a 39 add hl,sp 4d5b f9 ld sp,hl 4d5c c3f44e jp #4ef4 4d5f 210f00 ld hl,#000f 4d62 39 add hl,sp 4d63 3600 ld (hl),#00 4d65 23 inc hl 4d66 3600 ld (hl),#00 4d68 23 inc hl 4d69 3600 ld (hl),#00 4d6b 23 inc hl 4d6c 3600 ld (hl),#00 4d6e 218000 ld hl,#0080 4d71 e5 push hl 4d72 211100 ld hl,#0011 4d75 39 add hl,sp 4d76 5e ld e,(hl) 4d77 23 inc hl 4d78 56 ld d,(hl) 4d79 d5 push de 4d7a 23 inc hl 4d7b 5e ld e,(hl) 4d7c 23 inc hl 4d7d 56 ld d,(hl) 4d7e d5 push de 4d7f cd8823 call #2388 4d82 d1 pop de 4d83 d1 pop de 4d84 d1 pop de 4d85 211100 ld hl,#0011 4d88 39 add hl,sp 4d89 5e ld e,(hl) 4d8a 23 inc hl 4d8b 56 ld d,(hl) 4d8c 13 inc de 4d8d 13 inc de 4d8e 2b dec hl 4d8f 73 ld (hl),e 4d90 23 inc hl 4d91 72 ld (hl),d 4d92 2b dec hl 4d93 5e ld e,(hl) 4d94 21c0fe ld hl,#fec0 4d97 19 add hl,de 4d98 30d4 jr nc,#4d6e ; (-44) 4d9a c3f44e jp #4ef4 4d9d 210f00 ld hl,#000f 4da0 39 add hl,sp 4da1 3600 ld (hl),#00 4da3 23 inc hl 4da4 3600 ld (hl),#00 4da6 23 inc hl 4da7 3601 ld (hl),#01 4da9 23 inc hl 4daa 3600 ld (hl),#00 4dac 218000 ld hl,#0080 4daf e5 push hl 4db0 211100 ld hl,#0011 4db3 39 add hl,sp 4db4 5e ld e,(hl) 4db5 23 inc hl 4db6 56 ld d,(hl) 4db7 d5 push de 4db8 23 inc hl 4db9 5e ld e,(hl) 4dba 23 inc hl 4dbb 56 ld d,(hl) 4dbc d5 push de 4dbd cd8823 call #2388 4dc0 d1 pop de 4dc1 d1 pop de 4dc2 d1 pop de 4dc3 211100 ld hl,#0011 4dc6 39 add hl,sp 4dc7 5e ld e,(hl) 4dc8 23 inc hl 4dc9 56 ld d,(hl) 4dca 13 inc de 4dcb 13 inc de 4dcc 2b dec hl 4dcd 73 ld (hl),e 4dce 23 inc hl 4dcf 72 ld (hl),d 4dd0 2b dec hl 4dd1 5e ld e,(hl) 4dd2 21c0fe ld hl,#fec0 4dd5 19 add hl,de 4dd6 30d4 jr nc,#4dac ; (-44) 4dd8 c3f44e jp #4ef4 4ddb 211100 ld hl,#0011 4dde 39 add hl,sp 4ddf 3600 ld (hl),#00 4de1 23 inc hl 4de2 3600 ld (hl),#00 4de4 2b dec hl 4de5 2b dec hl 4de6 3600 ld (hl),#00 4de8 2b dec hl 4de9 3600 ld (hl),#00 4deb 214001 ld hl,#0140 4dee e5 push hl 4def 211100 ld hl,#0011 4df2 39 add hl,sp 4df3 5e ld e,(hl) 4df4 23 inc hl 4df5 56 ld d,(hl) 4df6 d5 push de 4df7 23 inc hl 4df8 5e ld e,(hl) 4df9 23 inc hl 4dfa 56 ld d,(hl) 4dfb d5 push de 4dfc cdd123 call #23d1 4dff d1 pop de 4e00 d1 pop de 4e01 d1 pop de 4e02 210f00 ld hl,#000f 4e05 39 add hl,sp 4e06 5e ld e,(hl) 4e07 23 inc hl 4e08 56 ld d,(hl) 4e09 13 inc de 4e0a 13 inc de 4e0b 2b dec hl 4e0c 73 ld (hl),e 4e0d 23 inc hl 4e0e 72 ld (hl),d 4e0f 2b dec hl 4e10 5e ld e,(hl) 4e11 2180ff ld hl,#ff80 4e14 19 add hl,de 4e15 30d4 jr nc,#4deb ; (-44) 4e17 c3f44e jp #4ef4 4e1a 211100 ld hl,#0011 4e1d 39 add hl,sp 4e1e 3600 ld (hl),#00 4e20 23 inc hl 4e21 3600 ld (hl),#00 4e23 2b dec hl 4e24 2b dec hl 4e25 3600 ld (hl),#00 4e27 2b dec hl 4e28 3601 ld (hl),#01 4e2a 214001 ld hl,#0140 4e2d e5 push hl 4e2e 211100 ld hl,#0011 4e31 39 add hl,sp 4e32 5e ld e,(hl) 4e33 23 inc hl 4e34 56 ld d,(hl) 4e35 d5 push de 4e36 23 inc hl 4e37 5e ld e,(hl) 4e38 23 inc hl 4e39 56 ld d,(hl) 4e3a d5 push de 4e3b cdd123 call #23d1 4e3e d1 pop de 4e3f d1 pop de 4e40 d1 pop de 4e41 210f00 ld hl,#000f 4e44 39 add hl,sp 4e45 5e ld e,(hl) 4e46 23 inc hl 4e47 56 ld d,(hl) 4e48 13 inc de 4e49 13 inc de 4e4a 2b dec hl 4e4b 73 ld (hl),e 4e4c 23 inc hl 4e4d 72 ld (hl),d 4e4e 2b dec hl 4e4f 5e ld e,(hl) 4e50 2180ff ld hl,#ff80 4e53 19 add hl,de 4e54 30d4 jr nc,#4e2a ; (-44) 4e56 c3f44e jp #4ef4 4e59 219477 ld hl,#7794 4e5c e5 push hl 4e5d 210100 ld hl,#0001 4e60 e5 push hl 4e61 cded05 call #05ed 4e64 d1 pop de 4e65 d1 pop de 4e66 c3f44e jp #4ef4 4e69 21a977 ld hl,#77a9 4e6c e5 push hl 4e6d 210100 ld hl,#0001 4e70 e5 push hl 4e71 cded05 call #05ed 4e74 d1 pop de 4e75 d1 pop de 4e76 187c jr #4ef4 ; (124) 4e78 210f00 ld hl,#000f 4e7b 39 add hl,sp 4e7c 360a ld (hl),#0a 4e7e 23 inc hl 4e7f 3600 ld (hl),#00 4e81 211100 ld hl,#0011 4e84 39 add hl,sp 4e85 3624 ld (hl),#24 4e87 23 inc hl 4e88 3600 ld (hl),#00 4e8a 212800 ld hl,#0028 4e8d e5 push hl 4e8e 211100 ld hl,#0011 4e91 39 add hl,sp 4e92 5e ld e,(hl) 4e93 23 inc hl 4e94 56 ld d,(hl) 4e95 d5 push de 4e96 23 inc hl 4e97 5e ld e,(hl) 4e98 23 inc hl 4e99 56 ld d,(hl) 4e9a d5 push de 4e9b cdd123 call #23d1 4e9e d1 pop de 4e9f d1 pop de 4ea0 d1 pop de 4ea1 211100 ld hl,#0011 4ea4 39 add hl,sp 4ea5 5e ld e,(hl) 4ea6 23 inc hl 4ea7 56 ld d,(hl) 4ea8 214800 ld hl,#0048 4eab 19 add hl,de 4eac eb ex de,hl 4ead 211100 ld hl,#0011 4eb0 39 add hl,sp 4eb1 73 ld (hl),e 4eb2 23 inc hl 4eb3 72 ld (hl),d 4eb4 2b dec hl 4eb5 5e ld e,(hl) 4eb6 21c0fe ld hl,#fec0 4eb9 19 add hl,de 4eba 30ce jr nc,#4e8a ; (-50) 4ebc 210f00 ld hl,#000f 4ebf 39 add hl,sp 4ec0 5e ld e,(hl) 4ec1 23 inc hl 4ec2 56 ld d,(hl) 4ec3 210a00 ld hl,#000a 4ec6 19 add hl,de 4ec7 eb ex de,hl 4ec8 210f00 ld hl,#000f 4ecb 39 add hl,sp 4ecc 73 ld (hl),e 4ecd 23 inc hl 4ece 72 ld (hl),d 4ecf 2b dec hl 4ed0 5e ld e,(hl) 4ed1 2180ff ld hl,#ff80 4ed4 19 add hl,de 4ed5 30aa jr nc,#4e81 ; (-86) 4ed7 181b jr #4ef4 ; (27) 4ed9 218000 ld hl,#0080 4edc e5 push hl 4edd 214001 ld hl,#0140 4ee0 e5 push hl 4ee1 210000 ld hl,#0000 4ee4 e5 push hl 4ee5 e5 push hl 4ee6 cd3c21 call #213c 4ee9 210800 ld hl,#0008 4eec 39 add hl,sp 4eed f9 ld sp,hl 4eee 1804 jr #4ef4 ; (4) 4ef0 210100 ld hl,#0001 4ef3 c9 ret 4ef4 cd7324 call #2473 4ef7 211700 ld hl,#0017 4efa 39 add hl,sp 4efb 7e ld a,(hl) 4efc b7 or a 4efd 2804 jr z,#4f03 ; (4) 4eff fe02 cp #02 4f01 204f jr nz,#4f52 ; (79) 4f03 210d00 ld hl,#000d 4f06 39 add hl,sp 4f07 3600 ld (hl),#00 4f09 23 inc hl 4f0a 3600 ld (hl),#00 4f0c 210800 ld hl,#0008 4f0f 39 add hl,sp 4f10 e5 push hl 4f11 21f455 ld hl,#55f4 4f14 e5 push hl 4f15 210100 ld hl,#0001 4f18 e5 push hl 4f19 cded05 call #05ed 4f1c d1 pop de 4f1d d1 pop de 4f1e d1 pop de 4f1f 210800 ld hl,#0008 4f22 39 add hl,sp 4f23 5e ld e,(hl) 4f24 23 inc hl 4f25 56 ld d,(hl) 4f26 21aeff ld hl,#ffae 4f29 19 add hl,de 4f2a 7c ld a,h 4f2b b5 or l 4f2c 2004 jr nz,#4f32 ; (4) 4f2e 21ff00 ld hl,#00ff 4f31 c9 ret 4f32 210d00 ld hl,#000d 4f35 39 add hl,sp 4f36 5e ld e,(hl) 4f37 23 inc hl 4f38 56 ld d,(hl) 4f39 13 inc de 4f3a 72 ld (hl),d 4f3b 2b dec hl 4f3c 73 ld (hl),e 4f3d 23 inc hl 4f3e 56 ld d,(hl) 4f3f 21f0d8 ld hl,#d8f0 4f42 19 add hl,de 4f43 30c7 jr nc,#4f0c ; (-57) 4f45 cd850a call #0a85 4f48 216400 ld hl,#0064 4f4b e5 push hl 4f4c cd5c0a call #0a5c 4f4f d1 pop de 4f50 184c jr #4f9e ; (76) 4f52 210a00 ld hl,#000a 4f55 39 add hl,sp 4f56 7e ld a,(hl) 4f57 fe0a cp #0a 4f59 2827 jr z,#4f82 ; (39) 4f5b 3e00 ld a,#00 4f5d 3252f6 ld (#f652),a 4f60 210800 ld hl,#0008 4f63 39 add hl,sp 4f64 e5 push hl 4f65 21f455 ld hl,#55f4 4f68 e5 push hl 4f69 210100 ld hl,#0001 4f6c e5 push hl 4f6d cded05 call #05ed 4f70 d1 pop de 4f71 d1 pop de 4f72 d1 pop de 4f73 28eb jr z,#4f60 ; (-21) 4f75 210800 ld hl,#0008 4f78 39 add hl,sp 4f79 7e ld a,(hl) 4f7a fe01 cp #01 4f7c 2004 jr nz,#4f82 ; (4) 4f7e 210000 ld hl,#0000 4f81 c9 ret 4f82 210a00 ld hl,#000a 4f85 39 add hl,sp 4f86 7e ld a,(hl) 4f87 fe09 cp #09 4f89 2013 jr nz,#4f9e ; (19) 4f8b 211700 ld hl,#0017 4f8e 39 add hl,sp 4f8f 7e ld a,(hl) 4f90 fe01 cp #01 4f92 200a jr nz,#4f9e ; (10) 4f94 210a00 ld hl,#000a 4f97 39 add hl,sp 4f98 e5 push hl 4f99 6e ld l,(hl) 4f9a 23 inc hl 4f9b eb ex de,hl 4f9c e1 pop hl 4f9d 73 ld (hl),e 4f9e 210a00 ld hl,#000a 4fa1 39 add hl,sp 4fa2 e5 push hl 4fa3 6e ld l,(hl) 4fa4 23 inc hl 4fa5 eb ex de,hl 4fa6 e1 pop hl 4fa7 73 ld (hl),e 4fa8 210a00 ld hl,#000a 4fab 39 add hl,sp 4fac 7e ld a,(hl) 4fad fe0b cp #0b 4faf da0e4d jp c,#4d0e 4fb2 3601 ld (hl),#01 4fb4 c30e4d jp #4d0e ' Data ??? 4fb7 02 ld (bc),a 4fb8 00 nop 4fb9 0a ld a,(bc) 4fba 05 dec b 4fbb 0607 ld b,#07 4fbd 010304 ld bc,#0403 4fc0 08 ex af,af' 4fc1 05 dec b 4fc2 0607 ld b,#07 4fc4 09 add hl,bc 4fc5 010002 ld bc,#0200 4fc8 03 inc bc 4fc9 04 inc b 4fca 08 ex af,af' 4fcb 11fcff ld de,#fffc 4fce cd6b05 call #056b 4fd1 cd6424 call #2464 4fd4 211000 ld hl,#0010 4fd7 39 add hl,sp 4fd8 5e ld e,(hl) 4fd9 210b00 ld hl,#000b 4fdc 39 add hl,sp 4fdd 73 ld (hl),e 4fde 211200 ld hl,#0012 4fe1 39 add hl,sp 4fe2 7e ld a,(hl) 4fe3 b7 or a 4fe4 281b jr z,#5001 ; (27) 4fe6 2b dec hl 4fe7 2b dec hl 4fe8 5e ld e,(hl) 4fe9 1600 ld d,#00 4feb d5 push de 4fec 23 inc hl 4fed 23 inc hl 4fee 5e ld e,(hl) 4fef 210a00 ld hl,#000a 4ff2 cdfb04 call #04fb 4ff5 d1 pop de 4ff6 19 add hl,de 4ff7 11ad4f ld de,#4fad 4ffa 19 add hl,de 4ffb 5e ld e,(hl) 4ffc 210b00 ld hl,#000b 4fff 39 add hl,sp 5000 73 ld (hl),e 5001 210b00 ld hl,#000b 5004 39 add hl,sp 5005 5e ld e,(hl) 5006 1600 ld d,#00 5008 21f4ff ld hl,#fff4 500b 19 add hl,de 500c da2751 jp c,#5127 500f 211950 ld hl,#5019 5012 19 add hl,de 5013 19 add hl,de 5014 5e ld e,(hl) 5015 23 inc hl 5016 56 ld d,(hl) 5017 eb ex de,hl 5018 e9 jp (hl) ' Data??? 5019 3150 501b 5050 501d 6550 501f 8450 5021 9050 5023 a550 5025 b050 5027 c450 5029 d850 502b f650 502d 0a51 - Keyboard Test 502f 1551 5031 211200 ld hl,#0012 5034 39 add hl,sp 5035 5e ld e,(hl) 5036 1600 ld d,#00 5038 d5 push de 5039 213d73 ld hl,#733d 503c e5 push hl 503d 210100 ld hl,#0001 5040 e5 push hl 5041 cded05 call #05ed 5044 d1 pop de 5045 d1 pop de 5046 d1 pop de 5047 eb ex de,hl 5048 210a00 ld hl,#000a 504b 39 add hl,sp 504c 73 ld (hl),e 504d c32751 jp #5127 5050 211200 ld hl,#0012 5053 39 add hl,sp 5054 5e ld e,(hl) 5055 1600 ld d,#00 5057 d5 push de 5058 cd0862 call #6208 505b d1 pop de 505c eb ex de,hl 505d 210a00 ld hl,#000a 5060 39 add hl,sp 5061 73 ld (hl),e 5062 c32751 jp #5127 5065 211200 ld hl,#0012 5068 39 add hl,sp 5069 5e ld e,(hl) 506a 1600 ld d,#00 506c d5 push de 506d 21c171 ld hl,#71c1 5070 e5 push hl 5071 210100 ld hl,#0001 5074 e5 push hl 5075 cded05 call #05ed 5078 d1 pop de 5079 d1 pop de 507a d1 pop de 507b eb ex de,hl 507c 210a00 ld hl,#000a 507f 39 add hl,sp 5080 73 ld (hl),e 5081 c32751 jp #5127 5084 cd4661 call #6146 5087 eb ex de,hl 5088 210a00 ld hl,#000a 508b 39 add hl,sp 508c 73 ld (hl),e 508d c32751 jp #5127 5090 211200 ld hl,#0012 5093 39 add hl,sp 5094 5e ld e,(hl) 5095 1600 ld d,#00 5097 d5 push de 5098 cde85b call #5be8 509b d1 pop de 509c eb ex de,hl 509d 210a00 ld hl,#000a 50a0 39 add hl,sp 50a1 73 ld (hl),e 50a2 c32751 jp #5127 50a5 cd865f call #5f86 50a8 eb ex de,hl 50a9 210a00 ld hl,#000a 50ac 39 add hl,sp 50ad 73 ld (hl),e 50ae 1877 jr #5127 ; (119) 50b0 211200 ld hl,#0012 50b3 39 add hl,sp 50b4 5e ld e,(hl) 50b5 1600 ld d,#00 50b7 d5 push de 50b8 cdf25f call #5ff2 50bb d1 pop de 50bc eb ex de,hl 50bd 210a00 ld hl,#000a 50c0 39 add hl,sp 50c1 73 ld (hl),e 50c2 1863 jr #5127 ; (99) 50c4 211200 ld hl,#0012 50c7 39 add hl,sp 50c8 5e ld e,(hl) 50c9 1600 ld d,#00 50cb d5 push de 50cc cdb946 call #46b9 50cf d1 pop de 50d0 eb ex de,hl 50d1 210a00 ld hl,#000a 50d4 39 add hl,sp 50d5 73 ld (hl),e 50d6 184f jr #5127 ; (79) 50d8 211200 ld hl,#0012 50db 39 add hl,sp 50dc 5e ld e,(hl) 50dd 1600 ld d,#00 50df d5 push de 50e0 215770 ld hl,#7057 50e3 e5 push hl 50e4 210100 ld hl,#0001 50e7 e5 push hl 50e8 cded05 call #05ed 50eb d1 pop de 50ec d1 pop de 50ed d1 pop de 50ee eb ex de,hl 50ef 210a00 ld hl,#000a 50f2 39 add hl,sp 50f3 73 ld (hl),e 50f4 1831 jr #5127 ; (49) 50f6 211200 ld hl,#0012 50f9 39 add hl,sp 50fa 5e ld e,(hl) 50fb 1600 ld d,#00 50fd d5 push de 50fe cd024d call #4d02 5101 d1 pop de 5102 eb ex de,hl 5103 210a00 ld hl,#000a 5106 39 add hl,sp 5107 73 ld (hl),e 5108 181d jr #5127 ; (29) ' Do Keyboard Test 510a cdab45 call #45ab 510d eb ex de,hl 510e 210a00 ld hl,#000a 5111 39 add hl,sp 5112 73 ld (hl),e 5113 1812 jr #5127 ; (18) 5115 211200 ld hl,#0012 5118 39 add hl,sp 5119 5e ld e,(hl) 511a 1600 ld d,#00 511c d5 push de 511d cdfd67 call #67fd 5120 d1 pop de 5121 eb ex de,hl 5122 210a00 ld hl,#000a 5125 39 add hl,sp 5126 73 ld (hl),e 5127 210a00 ld hl,#000a 512a 39 add hl,sp 512b 5e ld e,(hl) 512c 1600 ld d,#00 512e eb ex de,hl 512f c9 ret 5130 3251 5132 ATH1\r\0 5138 3a51 513a ATH0\r\0 5140 4251 5142 AT#CLS=8\r\0 514c 4e51 514e AT#VTS={9,40}\r\0 515d 5f51 515f ATA\r\0 ' ModemOut(s) 5164 11ecff ld de,#ffec 5167 cd6b05 call #056b 516a 212000 ld hl,#0020 516d 39 add hl,sp 516e 5e ld e,(hl) 516f 23 inc hl 5170 56 ld d,(hl) 5171 d5 push de 5172 210a00 ld hl,#000a 5175 39 add hl,sp 5176 e5 push hl 5177 cdc605 call #05c6 517a d1 pop de 517b d1 pop de 517c 210800 ld hl,#0008 517f 39 add hl,sp 5180 e5 push hl 5181 cdcc05 call #05cc 5184 d1 pop de 5185 e5 push hl 5186 210a00 ld hl,#000a 5189 39 add hl,sp 518a e5 push hl 518b cd8108 call #0881 518e d1 pop de 518f d1 pop de 5190 c9 ret 5191 2a3051 ld hl,(#5130) 5194 e5 push hl 5195 cd6451 call #5164 5198 d1 pop de 5199 c9 ret 519a 2a3851 ld hl,(#5138) 519d e5 push hl 519e cd6451 call #5164 51a1 d1 pop de 51a2 c9 ret 51a3 2a4051 ld hl,(#5140) 51a6 e5 push hl 51a7 cd6451 call #5164 51aa d1 pop de 51ab 218813 ld hl,#1388 51ae e5 push hl 51af cd5c0a call #0a5c 51b2 d1 pop de 51b3 2a3051 ld hl,(#5130) 51b6 e5 push hl 51b7 cd6451 call #5164 51ba d1 pop de 51bb 218813 ld hl,#1388 51be e5 push hl 51bf cd5c0a call #0a5c 51c2 d1 pop de 51c3 2a4c51 ld hl,(#514c) 51c6 e5 push hl 51c7 cd6451 call #5164 51ca d1 pop de 51cb 217017 ld hl,#1770 51ce e5 push hl 51cf cd5c0a call #0a5c 51d2 d1 pop de 51d3 2a3851 ld hl,(#5138) 51d6 e5 push hl 51d7 cd6451 call #5164 51da d1 pop de 51db c9 ret 51dc f451 51de fd51 51e0 0852 51e2 1552 51e4 1e52 51e6 2952 51e8 3852 51ea 4152 51ec 5152 51ee 5f52 51f0 6852 51f2 7652 51f4 EMI TEST\0 51fd MODEM PORT\0 5208 PRINTER PORT\0 5215 LCD PORT\0 521e Waiting...\0 5229 Connect Failed\0 5238 Time Out\0 5241 NORMAL RUN TEST\0 5251 MTBF RUN TEST\0 525f RUN IDLE\0 5268 RUN MODEM OFF\0 5276 RUN MODEM ON\0 5283 02 ld (bc),a 5284 03 inc bc 5285 010021 ld bc,#2100 5288 02 ld (bc),a 5289 00 nop 528a 39 add hl,sp 528b 7e ld a,(hl) 528c fe07 cp #07 528e 3819 jr c,#52a9 ; (25) 5290 213e00 ld hl,#003e 5293 e5 push hl 5294 212c01 ld hl,#012c 5297 e5 push hl 5298 213000 ld hl,#0030 529b e5 push hl 529c 2e64 ld l,#64 529e e5 push hl 529f cd8a20 call #208a 52a2 210800 ld hl,#0008 52a5 39 add hl,sp 52a6 f9 ld sp,hl 52a7 1815 jr #52be ; (21) 52a9 216e00 ld hl,#006e 52ac e5 push hl 52ad 214001 ld hl,#0140 52b0 e5 push hl 52b1 210000 ld hl,#0000 52b4 e5 push hl 52b5 e5 push hl 52b6 cd8a20 call #208a 52b9 210800 ld hl,#0008 52bc 39 add hl,sp 52bd f9 ld sp,hl ' DisplayText(???, 0x6e, 0x32, 1) 52be 210100 ld hl,#0001 52c1 e5 push hl 52c2 2e32 ld l,#32 52c4 e5 push hl 52c5 2e6e ld l,#6e 52c7 e5 push hl 52c8 210800 ld hl,#0008 52cb 39 add hl,sp 52cc 5e ld e,(hl) 52cd 1600 ld d,#00 52cf eb ex de,hl 52d0 29 add hl,hl 52d1 11dc51 ld de,#51dc 52d4 19 add hl,de 52d5 5e ld e,(hl) 52d6 23 inc hl 52d7 56 ld d,(hl) 52d8 d5 push de 52d9 cd8d4c call #4c8d 52dc 210800 ld hl,#0008 52df 39 add hl,sp 52e0 f9 ld sp,hl 52e1 cd7324 call #2473 52e4 c9 ret 52e5 e752 52e7 ATDT123\r\0 52f0 f852 52f2 0353 52f4 0a53 52f6 1353 52f8 1. PRINTER\0 5303 2. LCD\0 530a 3. MODEM\0 5313 4. MODEM-PTR-LCD\0 5324 02 5325 03 5326 01 5327 04 5328 2a53 532a Please check peripheral installation.\0 5350 5253 5352 Put the paper into printer\0 536d 6f53 536f H\0 'EMI Test 5371 11eaff ld de,#ffea 5374 cd6b05 call #056b 5377 cd6424 call #2464 537a 211a00 ld hl,#001a 537d 39 add hl,sp 537e 361e ld (hl),#1e 5380 23 inc hl 5381 3600 ld (hl),#00 5383 210a00 ld hl,#000a 5386 39 add hl,sp 5387 3600 ld (hl),#00 5389 1846 jr #53d1 ; (70) ' DisplayText("1.PRINTER" or "2.LCD", , , 1) 538b 210100 ld hl,#0001 538e e5 push hl 538f 211c00 ld hl,#001c 5392 39 add hl,sp 5393 5e ld e,(hl) 5394 23 inc hl 5395 56 ld d,(hl) 5396 d5 push de 5397 216e00 ld hl,#006e 539a e5 push hl 539b 211000 ld hl,#0010 539e 39 add hl,sp 539f 5e ld e,(hl) 53a0 1600 ld d,#00 53a2 eb ex de,hl 53a3 29 add hl,hl 53a4 11f052 ld de,#52f0 53a7 19 add hl,de 53a8 5e ld e,(hl) 53a9 23 inc hl 53aa 56 ld d,(hl) 53ab d5 push de 53ac cd8d4c call #4c8d 53af 210800 ld hl,#0008 53b2 39 add hl,sp 53b3 f9 ld sp,hl 53b4 211a00 ld hl,#001a 53b7 39 add hl,sp 53b8 5e ld e,(hl) 53b9 23 inc hl 53ba 56 ld d,(hl) 53bb 210f00 ld hl,#000f 53be 19 add hl,de 53bf eb ex de,hl 53c0 211a00 ld hl,#001a 53c3 39 add hl,sp 53c4 73 ld (hl),e 53c5 23 inc hl 53c6 72 ld (hl),d 53c7 210a00 ld hl,#000a 53ca 39 add hl,sp 53cb e5 push hl 53cc 6e ld l,(hl) 53cd 23 inc hl 53ce eb ex de,hl 53cf e1 pop hl 53d0 73 ld (hl),e 53d1 210a00 ld hl,#000a 53d4 39 add hl,sp 53d5 7e ld a,(hl) 53d6 fe04 cp #04 53d8 38b1 jr c,#538b ; (-79) ' DisplayText("Please check peripheral installation.", 10, 105, 0) 53da 210000 ld hl,#0000 53dd e5 push hl 53de 2e69 ld l,#69 53e0 e5 push hl 53e1 2e0a ld l,#0a 53e3 e5 push hl 53e4 2a2853 ld hl,(#5328) 53e7 e5 push hl 53e8 cd8d4c call #4c8d 53eb 210800 ld hl,#0008 53ee 39 add hl,sp 53ef f9 ld sp,hl ' DisplayText("Put the paper into printer", 10, 115, 0) 53f0 210000 ld hl,#0000 53f3 e5 push hl 53f4 2e73 ld l,#73 53f6 e5 push hl 53f7 2e0a ld l,#0a 53f9 e5 push hl 53fa 2a5053 ld hl,(#5350) 53fd e5 push hl 53fe cd8d4c call #4c8d 5401 210800 ld hl,#0008 5404 39 add hl,sp 5405 f9 ld sp,hl 5406 cd7324 call #2473 5409 211c00 ld hl,#001c 540c 39 add hl,sp 540d e5 push hl 540e 21f455 ld hl,#55f4 5411 e5 push hl 5412 210100 ld hl,#0001 5415 e5 push hl 5416 cded05 call #05ed 5419 d1 pop de 541a d1 pop de 541b d1 pop de 541c 211c00 ld hl,#001c 541f 39 add hl,sp 5420 5e ld e,(hl) 5421 23 inc hl 5422 56 ld d,(hl) 5423 1b dec de 5424 7a ld a,d 5425 b3 or e 5426 c8 ret z 5427 210400 ld hl,#0004 542a e5 push hl 542b 211e00 ld hl,#001e 542e 39 add hl,sp 542f 5e ld e,(hl) 5430 23 inc hl 5431 56 ld d,(hl) 5432 d5 push de 5433 212f51 ld hl,#512f 5436 e5 push hl 5437 210100 ld hl,#0001 543a e5 push hl 543b cded05 call #05ed 543e eb ex de,hl 543f 210800 ld hl,#0008 5442 39 add hl,sp 5443 f9 ld sp,hl 5444 211c00 ld hl,#001c 5447 39 add hl,sp 5448 73 ld (hl),e 5449 23 inc hl 544a 72 ld (hl),d 544b 2b dec hl 544c 5e ld e,(hl) 544d 2101ff ld hl,#ff01 5450 19 add hl,de 5451 7c ld a,h 5452 b5 or l 5453 28b4 jr z,#5409 ; (-76) 5455 211c00 ld hl,#001c 5458 39 add hl,sp 5459 5e ld e,(hl) 545a 23 inc hl 545b 56 ld d,(hl) 545c 1b dec de 545d 72 ld (hl),d 545e 2b dec hl 545f 73 ld (hl),e 5460 23 inc hl 5461 56 ld d,(hl) 5462 212453 ld hl,#5324 5465 19 add hl,de 5466 5e ld e,(hl) 5467 210800 ld hl,#0008 546a 39 add hl,sp 546b 73 ld (hl),e 546c 7b ld a,e 546d fe04 cp #04 546f 2806 jr z,#5477 ; (6) 5471 7e ld a,(hl) 5472 fe01 cp #01 5474 c23c55 jp nz,#553c 5477 cd0561 call #6105 547a 211600 ld hl,#0016 547d 39 add hl,sp 547e 3601 ld (hl),#01 5480 210400 ld hl,#0004 5483 e5 push hl 5484 cd8752 call #5287 5487 d1 pop de 5488 2ae552 ld hl,(#52e5) 548b e5 push hl 548c 210e00 ld hl,#000e 548f 39 add hl,sp 5490 e5 push hl 5491 cdc605 call #05c6 5494 d1 pop de 5495 d1 pop de 5496 210c00 ld hl,#000c 5499 39 add hl,sp 549a e5 push hl 549b cdcc05 call #05cc 549e d1 pop de 549f e5 push hl 54a0 210e00 ld hl,#000e 54a3 39 add hl,sp 54a4 e5 push hl 54a5 cd8108 call #0881 54a8 d1 pop de 54a9 d1 pop de 54aa 211a00 ld hl,#001a 54ad 39 add hl,sp 54ae 3600 ld (hl),#00 54b0 23 inc hl 54b1 3600 ld (hl),#00 54b3 210a00 ld hl,#000a 54b6 39 add hl,sp 54b7 3600 ld (hl),#00 54b9 216971 ld hl,#7169 54bc e5 push hl 54bd 210600 ld hl,#0006 54c0 e5 push hl 54c1 cded05 call #05ed 54c4 d1 pop de 54c5 d1 pop de 54c6 eb ex de,hl 54c7 210900 ld hl,#0009 54ca 39 add hl,sp 54cb 73 ld (hl),e 54cc 7b ld a,e 54cd b7 or a 54ce 281d jr z,#54ed ; (29) 54d0 7e ld a,(hl) 54d1 fe01 cp #01 54d3 2867 jr z,#553c ; (103) 54d5 210500 ld hl,#0005 54d8 e5 push hl 54d9 cd8752 call #5287 54dc d1 pop de 54dd 21b80b ld hl,#0bb8 54e0 e5 push hl 54e1 cd5c0a call #0a5c 54e4 d1 pop de 54e5 211600 ld hl,#0016 54e8 39 add hl,sp 54e9 3600 ld (hl),#00 54eb 184f jr #553c ; (79) 54ed 211a00 ld hl,#001a 54f0 39 add hl,sp 54f1 5e ld e,(hl) 54f2 23 inc hl 54f3 56 ld d,(hl) 54f4 13 inc de 54f5 72 ld (hl),d 54f6 2b dec hl 54f7 73 ld (hl),e 54f8 23 inc hl 54f9 56 ld d,(hl) 54fa eb ex de,hl 54fb cdde04 call #04de 54fe cd1102 call #0211 5501 60 ld h,b 5502 ea0000 jp pe,#0000 5505 cda804 call #04a8 5508 2813 jr z,#551d ; (19) 550a 210a00 ld hl,#000a 550d 39 add hl,sp 550e e5 push hl 550f 6e ld l,(hl) 5510 23 inc hl 5511 eb ex de,hl 5512 e1 pop hl 5513 73 ld (hl),e 5514 211a00 ld hl,#001a 5517 39 add hl,sp 5518 3600 ld (hl),#00 551a 23 inc hl 551b 3600 ld (hl),#00 551d 210a00 ld hl,#000a 5520 39 add hl,sp 5521 7e ld a,(hl) 5522 fe04 cp #04 5524 3893 jr c,#54b9 ; (-109) 5526 210600 ld hl,#0006 5529 e5 push hl 552a cd8752 call #5287 552d d1 pop de 552e 21b80b ld hl,#0bb8 5531 e5 push hl 5532 cd5c0a call #0a5c 5535 d1 pop de 5536 211600 ld hl,#0016 5539 39 add hl,sp 553a 3600 ld (hl),#00 553c 210800 ld hl,#0008 553f 39 add hl,sp 5540 7e ld a,(hl) 5541 fe01 cp #01 5543 2009 jr nz,#554e ; (9) 5545 211600 ld hl,#0016 5548 39 add hl,sp 5549 7e ld a,(hl) 554a b7 or a 554b ca7753 jp z,#5377 554e 211a00 ld hl,#001a 5551 39 add hl,sp 5552 3600 ld (hl),#00 5554 23 inc hl 5555 3600 ld (hl),#00 5557 2b dec hl 5558 2b dec hl 5559 3600 ld (hl),#00 555b 2b dec hl 555c 3600 ld (hl),#00 555e 210b00 ld hl,#000b 5561 39 add hl,sp 5562 3600 ld (hl),#00 5564 211700 ld hl,#0017 5567 39 add hl,sp 5568 3604 ld (hl),#04 556a cd6424 call #2464 556d 211c00 ld hl,#001c 5570 39 add hl,sp 5571 5e ld e,(hl) 5572 23 inc hl 5573 56 ld d,(hl) 5574 218352 ld hl,#5283 5577 19 add hl,de 5578 5e ld e,(hl) 5579 1600 ld d,#00 557b d5 push de 557c cd8752 call #5287 557f d1 pop de 5580 cd7324 call #2473 5583 211c00 ld hl,#001c 5586 39 add hl,sp 5587 e5 push hl 5588 21f455 ld hl,#55f4 558b e5 push hl 558c 210100 ld hl,#0001 558f e5 push hl 5590 cded05 call #05ed 5593 d1 pop de 5594 d1 pop de 5595 d1 pop de 5596 211c00 ld hl,#001c 5599 39 add hl,sp 559a 5e ld e,(hl) 559b 23 inc hl 559c 56 ld d,(hl) 559d 1b dec de 559e 7a ld a,d 559f b3 or e 55a0 2006 jr nz,#55a8 ; (6) 55a2 cd6608 call #0866 55a5 c37753 jp #5377 55a8 211700 ld hl,#0017 55ab 39 add hl,sp 55ac 7e ld a,(hl) 55ad eb ex de,hl 55ae 3d dec a 55af 2831 jr z,#55e2 ; (49) 55b1 3d dec a 55b2 286b jr z,#561f ; (107) 55b4 3d dec a 55b5 ca8156 jp z,#5681 55b8 3d dec a 55b9 c21b57 jp nz,#571b 55bc 210800 ld hl,#0008 55bf 39 add hl,sp 55c0 7e ld a,(hl) 55c1 fe04 cp #04 55c3 2014 jr nz,#55d9 ; (20) 55c5 211600 ld hl,#0016 55c8 39 add hl,sp 55c9 7e ld a,(hl) 55ca b7 or a 55cb 2806 jr z,#55d3 ; (6) 55cd 23 inc hl 55ce 3601 ld (hl),#01 55d0 c31b57 jp #571b 55d3 23 inc hl 55d4 3602 ld (hl),#02 55d6 c31b57 jp #571b 55d9 5e ld e,(hl) 55da 211700 ld hl,#0017 55dd 39 add hl,sp 55de 73 ld (hl),e 55df c31b57 jp #571b 55e2 212657 ld hl,#5726 55e5 e5 push hl 55e6 210e00 ld hl,#000e 55e9 39 add hl,sp 55ea e5 push hl 55eb cdc605 call #05c6 55ee d1 pop de 55ef d1 pop de 55f0 210c00 ld hl,#000c 55f3 39 add hl,sp 55f4 e5 push hl 55f5 cdcc05 call #05cc 55f8 d1 pop de 55f9 e5 push hl 55fa 210e00 ld hl,#000e 55fd 39 add hl,sp 55fe e5 push hl 55ff cd8108 call #0881 5602 d1 pop de 5603 d1 pop de 5604 210800 ld hl,#0008 5607 39 add hl,sp 5608 7e ld a,(hl) 5609 fe04 cp #04 560b 2009 jr nz,#5616 ; (9) 560d 211700 ld hl,#0017 5610 39 add hl,sp 5611 3602 ld (hl),#02 5613 c31b57 jp #571b 5616 211700 ld hl,#0017 5619 39 add hl,sp 561a 3601 ld (hl),#01 561c c31b57 jp #571b 561f 210a00 ld hl,#000a 5622 39 add hl,sp 5623 3648 ld (hl),#48 5625 5e ld e,(hl) 5626 1600 ld d,#00 5628 d5 push de 5629 cd505b call #5b50 562c d1 pop de 562d 210100 ld hl,#0001 5630 e5 push hl 5631 cd5c0a call #0a5c 5634 d1 pop de 5635 210a00 ld hl,#000a 5638 39 add hl,sp 5639 5e ld e,(hl) 563a 1600 ld d,#00 563c d5 push de 563d cd505b call #5b50 5640 d1 pop de 5641 210b00 ld hl,#000b 5644 39 add hl,sp 5645 5e ld e,(hl) 5646 1600 ld d,#00 5648 13 inc de 5649 13 inc de 564a 73 ld (hl),e 564b 7b ld a,e 564c fe50 cp #50 564e 3816 jr c,#5666 ; (22) 5650 210d00 ld hl,#000d 5653 e5 push hl 5654 cd505b call #5b50 5657 d1 pop de 5658 210a00 ld hl,#000a 565b e5 push hl 565c cd505b call #5b50 565f d1 pop de 5660 210b00 ld hl,#000b 5663 39 add hl,sp 5664 3600 ld (hl),#00 5666 210800 ld hl,#0008 5669 39 add hl,sp 566a 7e ld a,(hl) 566b fe04 cp #04 566d 2009 jr nz,#5678 ; (9) 566f 211700 ld hl,#0017 5672 39 add hl,sp 5673 3603 ld (hl),#03 5675 c31b57 jp #571b 5678 211700 ld hl,#0017 567b 39 add hl,sp 567c 3602 ld (hl),#02 567e c31b57 jp #571b ' DisplayText("H", ?, ?, 0) 5681 210000 ld hl,#0000 5684 e5 push hl 5685 eb ex de,hl 5686 23 inc hl 5687 5e ld e,(hl) 5688 23 inc hl 5689 56 ld d,(hl) 568a d5 push de 568b 23 inc hl 568c 5e ld e,(hl) 568d 23 inc hl 568e 56 ld d,(hl) 568f d5 push de 5690 2a6d53 ld hl,(#536d) 5693 e5 push hl 5694 cd8d4c call #4c8d 5697 210800 ld hl,#0008 569a 39 add hl,sp 569b f9 ld sp,hl 569c 210a00 ld hl,#000a 569f e5 push hl 56a0 211a00 ld hl,#001a 56a3 39 add hl,sp 56a4 5e ld e,(hl) 56a5 23 inc hl 56a6 56 ld d,(hl) 56a7 d5 push de 56a8 23 inc hl 56a9 5e ld e,(hl) 56aa 23 inc hl 56ab 56 ld d,(hl) 56ac d5 push de 56ad cdb724 call #24b7 56b0 d1 pop de 56b1 d1 pop de 56b2 d1 pop de 56b3 211a00 ld hl,#001a 56b6 39 add hl,sp 56b7 5e ld e,(hl) 56b8 23 inc hl 56b9 56 ld d,(hl) 56ba 210600 ld hl,#0006 56bd 19 add hl,de 56be eb ex de,hl 56bf 211a00 ld hl,#001a 56c2 39 add hl,sp 56c3 73 ld (hl),e 56c4 23 inc hl 56c5 72 ld (hl),d 56c6 2b dec hl 56c7 5e ld e,(hl) 56c8 21c0fe ld hl,#fec0 56cb 19 add hl,de 56cc 301a jr nc,#56e8 ; (26) 56ce 211a00 ld hl,#001a 56d1 39 add hl,sp 56d2 3600 ld (hl),#00 56d4 23 inc hl 56d5 3600 ld (hl),#00 56d7 2b dec hl 56d8 2b dec hl 56d9 56 ld d,(hl) 56da 2b dec hl 56db 5e ld e,(hl) 56dc 210a00 ld hl,#000a 56df 19 add hl,de 56e0 eb ex de,hl 56e1 211800 ld hl,#0018 56e4 39 add hl,sp 56e5 73 ld (hl),e 56e6 23 inc hl 56e7 72 ld (hl),d 56e8 211800 ld hl,#0018 56eb 39 add hl,sp 56ec 5e ld e,(hl) 56ed 23 inc hl 56ee 56 ld d,(hl) 56ef 2188ff ld hl,#ff88 56f2 19 add hl,de 56f3 300f jr nc,#5704 ; (15) 56f5 cd6424 call #2464 56f8 cd7324 call #2473 56fb 211800 ld hl,#0018 56fe 39 add hl,sp 56ff 3600 ld (hl),#00 5701 23 inc hl 5702 3600 ld (hl),#00 5704 210800 ld hl,#0008 5707 39 add hl,sp 5708 7e ld a,(hl) 5709 fe04 cp #04 570b 2008 jr nz,#5715 ; (8) 570d 211700 ld hl,#0017 5710 39 add hl,sp 5711 3604 ld (hl),#04 5713 1806 jr #571b ; (6) 5715 211700 ld hl,#0017 5718 39 add hl,sp 5719 3603 ld (hl),#03 571b 210a00 ld hl,#000a 571e e5 push hl 571f cd5c0a call #0a5c 5722 d1 pop de 5723 c38355 jp #5583 5726 48 ld c,b 5727 48 ld c,b 5728 00 nop 5729 11ceff ld de,#ffce 572c cd6b05 call #056b 572f 3e00 ld a,#00 5731 322ae6 ld (#e62a),a 5734 3229e6 ld (#e629),a 5737 cdea35 call #35ea 573a 3e00 ld a,#00 573c 3228e6 ld (#e628),a 573f 214000 ld hl,#0040 5742 39 add hl,sp 5743 7e ld a,(hl) 5744 b7 or a 5745 2010 jr nz,#5757 ; (16) 5747 21af57 ld hl,#57af 574a e5 push hl 574b 210a00 ld hl,#000a 574e 39 add hl,sp 574f e5 push hl 5750 cdc605 call #05c6 5753 d1 pop de 5754 d1 pop de 5755 180e jr #5765 ; (14) 5757 21b657 ld hl,#57b6 575a e5 push hl 575b 210a00 ld hl,#000a 575e 39 add hl,sp 575f e5 push hl 5760 cdc605 call #05c6 5763 d1 pop de 5764 d1 pop de 5765 213e00 ld hl,#003e 5768 39 add hl,sp 5769 5e ld e,(hl) 576a 23 inc hl 576b 56 ld d,(hl) 576c d5 push de 576d 210a00 ld hl,#000a 5770 39 add hl,sp 5771 e5 push hl 5772 cdba05 call #05ba 5775 d1 pop de 5776 d1 pop de 5777 21bb57 ld hl,#57bb 577a e5 push hl 577b 210a00 ld hl,#000a 577e 39 add hl,sp 577f e5 push hl 5780 cdba05 call #05ba 5783 d1 pop de 5784 d1 pop de 5785 210800 ld hl,#0008 5788 39 add hl,sp 5789 e5 push hl 578a cdcc05 call #05cc 578d d1 pop de 578e e5 push hl 578f 210a00 ld hl,#000a 5792 39 add hl,sp 5793 e5 push hl 5794 cd8108 call #0881 5797 d1 pop de 5798 d1 pop de 5799 210100 ld hl,#0001 579c e5 push hl 579d e5 push hl 579e 217d6b ld hl,#6b7d 57a1 e5 push hl 57a2 210600 ld hl,#0006 57a5 e5 push hl 57a6 cded05 call #05ed 57a9 210800 ld hl,#0008 57ac 39 add hl,sp 57ad f9 ld sp,hl 57ae c9 ret 57af ATX0DT\0 57b6 ATDT\0 57bb \r\0 57bd bf57 57bf Dial:\0 57c5 c757 57c7 T: DTMF\0 57cf d157 57d1 D: DTMF9\0 57da dc57 57dc 123456789*0#123456789*0#123456789*0#1234\0 5805 11d2ff ld de,#ffd2 5808 cd6b05 call #056b 580b cd0561 call #6105 ' DisplayText("Dial:", 0x28, 0x32, 1) 580e 210100 ld hl,#0001 5811 e5 push hl 5812 2e32 ld l,#32 5814 e5 push hl 5815 2e28 ld l,#28 5817 e5 push hl 5818 2abd57 ld hl,(#57bd) 581b e5 push hl 581c cd8d4c call #4c8d 581f 210800 ld hl,#0008 5822 39 add hl,sp 5823 f9 ld sp,hl 5824 210000 ld hl,#0000 5827 e5 push hl 5828 210166 ld hl,#6601 582b e5 push hl 582c 210100 ld hl,#0001 582f e5 push hl 5830 cded05 call #05ed 5833 d1 pop de 5834 d1 pop de 5835 d1 pop de 5836 217f00 ld hl,#007f 5839 e5 push hl 583a 2eb4 ld l,#b4 583c e5 push hl 583d 2e6f ld l,#6f 583f e5 push hl 5840 2e78 ld l,#78 5842 e5 push hl 5843 cd8a20 call #208a 5846 210800 ld hl,#0008 5849 39 add hl,sp 584a f9 ld sp,hl ' DisplayText("T: DTMF", 128, 116, 0) 584b 210000 ld hl,#0000 584e e5 push hl 584f 2e74 ld l,#74 5851 e5 push hl 5852 2e80 ld l,#80 5854 e5 push hl 5855 2ac557 ld hl,(#57c5) 5858 e5 push hl 5859 cd8d4c call #4c8d 585c 210800 ld hl,#0008 585f 39 add hl,sp 5860 f9 ld sp,hl 5861 217e00 ld hl,#007e 5864 e5 push hl 5865 2ea6 ld l,#a6 5867 e5 push hl 5868 2e71 ld l,#71 586a e5 push hl 586b 2e7d ld l,#7d 586d e5 push hl 586e cdee21 call #21ee 5871 210800 ld hl,#0008 5874 39 add hl,sp 5875 f9 ld sp,hl ' DisplayText("D: DTMF9", 178, 116, 0) 5876 210000 ld hl,#0000 5879 e5 push hl 587a 2e74 ld l,#74 587c e5 push hl 587d 2eb2 ld l,#b2 587f e5 push hl 5880 2acf57 ld hl,(#57cf) 5883 e5 push hl 5884 cd8d4c call #4c8d 5887 210800 ld hl,#0008 588a 39 add hl,sp 588b f9 ld sp,hl 588c 217e00 ld hl,#007e 588f e5 push hl 5890 2ede ld l,#de 5892 e5 push hl 5893 2e71 ld l,#71 5895 e5 push hl 5896 2eb0 ld l,#b0 5898 e5 push hl 5899 cdee21 call #21ee 589c 210800 ld hl,#0008 589f 39 add hl,sp 58a0 f9 ld sp,hl 58a1 cd7324 call #2473 58a4 210a00 ld hl,#000a 58a7 39 add hl,sp 58a8 36ff ld (hl),#ff 58aa 210800 ld hl,#0008 58ad 39 add hl,sp 58ae e5 push hl 58af 21f455 ld hl,#55f4 58b2 e5 push hl 58b3 210100 ld hl,#0001 58b6 e5 push hl 58b7 cded05 call #05ed 58ba d1 pop de 58bb d1 pop de 58bc d1 pop de 58bd 3a58f6 ld a,(#f658) 58c0 b7 or a 58c1 2831 jr z,#58f4 ; (49) 58c3 210800 ld hl,#0008 58c6 39 add hl,sp 58c7 5e ld e,(hl) 58c8 23 inc hl 58c9 56 ld d,(hl) 58ca 21ddff ld hl,#ffdd 58cd 19 add hl,de 58ce 7c ld a,h 58cf b5 or l 58d0 2009 jr nz,#58db ; (9) 58d2 210a00 ld hl,#000a 58d5 39 add hl,sp 58d6 3623 ld (hl),#23 58d8 c39959 jp #5999 58db 210800 ld hl,#0008 58de 39 add hl,sp 58df 5e ld e,(hl) 58e0 23 inc hl 58e1 56 ld d,(hl) 58e2 21d0ff ld hl,#ffd0 58e5 19 add hl,de 58e6 7c ld a,h 58e7 b5 or l 58e8 c29959 jp nz,#5999 58eb 210a00 ld hl,#000a 58ee 39 add hl,sp 58ef 362a ld (hl),#2a 58f1 c39959 jp #5999 58f4 210800 ld hl,#0008 58f7 39 add hl,sp 58f8 5e ld e,(hl) 58f9 23 inc hl 58fa 56 ld d,(hl) 58fb 1b dec de 58fc 7a ld a,d 58fd b3 or e 58fe ca6608 jp z,#0866 5901 56 ld d,(hl) 5902 2b dec hl 5903 5e ld e,(hl) 5904 21afff ld hl,#ffaf 5907 19 add hl,de 5908 7c ld a,h 5909 b5 or l 590a 200c jr nz,#5918 ; (12) 590c cd9151 call #5191 590f 210a00 ld hl,#000a 5912 39 add hl,sp 5913 36ff ld (hl),#ff 5915 c39959 jp #5999 5918 210800 ld hl,#0008 591b 39 add hl,sp 591c 5e ld e,(hl) 591d 23 inc hl 591e 56 ld d,(hl) 591f 219cff ld hl,#ff9c 5922 19 add hl,de 5923 7c ld a,h 5924 b5 or l 5925 200b jr nz,#5932 ; (11) 5927 cd9a51 call #519a 592a 210a00 ld hl,#000a 592d 39 add hl,sp 592e 36ff ld (hl),#ff 5930 1867 jr #5999 ; (103) 5932 210800 ld hl,#0008 5935 39 add hl,sp 5936 5e ld e,(hl) 5937 23 inc hl 5938 56 ld d,(hl) 5939 219dff ld hl,#ff9d 593c 19 add hl,de 593d 7c ld a,h 593e b5 or l 593f 200e jr nz,#594f ; (14) 5941 cda351 call #51a3 5944 cd9d0a call #0a9d 5947 210a00 ld hl,#000a 594a 39 add hl,sp 594b 36ff ld (hl),#ff 594d 184a jr #5999 ; (74) 594f 210800 ld hl,#0008 5952 39 add hl,sp 5953 5e ld e,(hl) 5954 23 inc hl 5955 56 ld d,(hl) 5956 21bbff ld hl,#ffbb 5959 19 add hl,de 595a 7c ld a,h 595b b5 or l 595c 2008 jr nz,#5966 ; (8) 595e 210a00 ld hl,#000a 5961 39 add hl,sp 5962 3600 ld (hl),#00 5964 1833 jr #5999 ; (51) 5966 210a00 ld hl,#000a 5969 e5 push hl 596a 39 add hl,sp 596b 5e ld e,(hl) 596c 23 inc hl 596d 56 ld d,(hl) 596e d5 push de 596f 212f51 ld hl,#512f 5972 e5 push hl 5973 210100 ld hl,#0001 5976 e5 push hl 5977 cded05 call #05ed 597a eb ex de,hl 597b 210800 ld hl,#0008 597e 39 add hl,sp 597f f9 ld sp,hl 5980 210a00 ld hl,#000a 5983 39 add hl,sp 5984 73 ld (hl),e 5985 7b ld a,e 5986 feff cp #ff 5988 280f jr z,#5999 ; (15) 598a 7e ld a,(hl) 598b fe0a cp #0a 598d 2002 jr nz,#5991 ; (2) 598f 3600 ld (hl),#00 5991 210a00 ld hl,#000a 5994 39 add hl,sp 5995 7e ld a,(hl) 5996 c630 add a,#30 5998 77 ld (hl),a 5999 210a00 ld hl,#000a 599c 39 add hl,sp 599d 7e ld a,(hl) 599e feff cp #ff 59a0 caaa58 jp z,#58aa 59a3 b7 or a 59a4 2010 jr nz,#59b6 ; (16) 59a6 2ada57 ld hl,(#57da) 59a9 e5 push hl 59aa 210e00 ld hl,#000e 59ad 39 add hl,sp 59ae e5 push hl 59af cdc605 call #05c6 59b2 d1 pop de 59b3 d1 pop de 59b4 1816 jr #59cc ; (22) 59b6 21565a ld hl,#5a56 59b9 e5 push hl 59ba 210e00 ld hl,#000e 59bd 39 add hl,sp 59be e5 push hl 59bf cdc605 call #05c6 59c2 d1 pop de 59c3 d1 pop de 59c4 210a00 ld hl,#000a 59c7 39 add hl,sp 59c8 5e ld e,(hl) 59c9 23 inc hl 59ca 23 inc hl 59cb 73 ld (hl),e 59cc 213c00 ld hl,#003c 59cf e5 push hl 59d0 214001 ld hl,#0140 59d3 e5 push hl 59d4 213000 ld hl,#0030 59d7 e5 push hl 59d8 2e3f ld l,#3f 59da e5 push hl 59db cd8a20 call #208a 59de 210800 ld hl,#0008 59e1 39 add hl,sp 59e2 f9 ld sp,hl ' DisplayText(???, 65, 50, 1) 59e3 210100 ld hl,#0001 59e6 e5 push hl 59e7 2e32 ld l,#32 59e9 e5 push hl 59ea 2e41 ld l,#41 59ec e5 push hl 59ed 211200 ld hl,#0012 59f0 39 add hl,sp 59f1 e5 push hl 59f2 cd8d4c call #4c8d 59f5 210800 ld hl,#0008 59f8 39 add hl,sp 59f9 f9 ld sp,hl 59fa cd7324 call #2473 59fd 210000 ld hl,#0000 5a00 e5 push hl 5a01 210e00 ld hl,#000e 5a04 39 add hl,sp 5a05 e5 push hl 5a06 cd2957 call #5729 5a09 d1 pop de 5a0a d1 pop de 5a0b 210a00 ld hl,#000a 5a0e 39 add hl,sp 5a0f 7e ld a,(hl) 5a10 b7 or a 5a11 200a jr nz,#5a1d ; (10) 5a13 213075 ld hl,#7530 5a16 e5 push hl 5a17 cd5c0a call #0a5c 5a1a d1 pop de 5a1b 1808 jr #5a25 ; (8) 5a1d 21983a ld hl,#3a98 5a20 e5 push hl 5a21 cd5c0a call #0a5c 5a24 d1 pop de 5a25 cd9a51 call #519a 5a28 210a00 ld hl,#000a 5a2b 39 add hl,sp 5a2c 36ff ld (hl),#ff 5a2e 216400 ld hl,#0064 5a31 e5 push hl 5a32 cd5c0a call #0a5c 5a35 d1 pop de 5a36 cd9d0a call #0a9d 5a39 213c00 ld hl,#003c 5a3c e5 push hl 5a3d 214001 ld hl,#0140 5a40 e5 push hl 5a41 213000 ld hl,#0030 5a44 e5 push hl 5a45 2e3f ld l,#3f 5a47 e5 push hl 5a48 cd8a20 call #208a 5a4b 210800 ld hl,#0008 5a4e 39 add hl,sp 5a4f f9 ld sp,hl 5a50 cd7324 call #2473 5a53 c3aa58 jp #58aa 5a56 \0 'Space Null 5a58 5a5a 5a5a QA TEST MENU\0 5a67 11feff ld de,#fffe 5a6a cd6b05 call #056b 5a6d cd6424 call #2464 ' DisplayText("QA TEST MENU", 120, 5, 1) 5a70 210100 ld hl,#0001 5a73 e5 push hl 5a74 2e05 ld l,#05 5a76 e5 push hl 5a77 2e78 ld l,#78 5a79 e5 push hl 5a7a 2a585a ld hl,(#5a58) 5a7d e5 push hl 5a7e cd8d4c call #4c8d 5a81 210800 ld hl,#0008 5a84 39 add hl,sp 5a85 f9 ld sp,hl 5a86 211200 ld hl,#0012 5a89 e5 push hl 5a8a 214001 ld hl,#0140 5a8d e5 push hl 5a8e 210000 ld hl,#0000 5a91 e5 push hl 5a92 e5 push hl 5a93 cdee21 call #21ee 5a96 210800 ld hl,#0008 5a99 39 add hl,sp 5a9a f9 ld sp,hl 5a9b 210100 ld hl,#0001 5a9e e5 push hl 5a9f 2e19 ld l,#19 5aa1 e5 push hl 5aa2 2e28 ld l,#28 5aa4 e5 push hl 5aa5 2e64 ld l,#64 5aa7 e5 push hl 5aa8 2e0a ld l,#0a 5aaa e5 push hl 5aab 21fa5a ld hl,#5afa 5aae e5 push hl 5aaf 210100 ld hl,#0001 5ab2 e5 push hl 5ab3 cded05 call #05ed 5ab6 210e00 ld hl,#000e 5ab9 39 add hl,sp 5aba f9 ld sp,hl 5abb cd7324 call #2473 5abe 210800 ld hl,#0008 5ac1 39 add hl,sp 5ac2 e5 push hl 5ac3 21f455 ld hl,#55f4 5ac6 e5 push hl 5ac7 210100 ld hl,#0001 5aca e5 push hl 5acb cded05 call #05ed 5ace d1 pop de 5acf d1 pop de 5ad0 d1 pop de 5ad1 210800 ld hl,#0008 5ad4 39 add hl,sp 5ad5 5e ld e,(hl) 5ad6 23 inc hl 5ad7 56 ld d,(hl) 5ad8 1b dec de 5ad9 7a ld a,d 5ada b3 or e 5adb c8 ret z 5adc 210500 ld hl,#0005 5adf e5 push hl 5ae0 210a00 ld hl,#000a 5ae3 39 add hl,sp 5ae4 5e ld e,(hl) 5ae5 23 inc hl 5ae6 56 ld d,(hl) 5ae7 d5 push de 5ae8 212f51 ld hl,#512f 5aeb e5 push hl 5aec 210100 ld hl,#0001 5aef e5 push hl 5af0 cded05 call #05ed 5af3 eb ex de,hl 5af4 210800 ld hl,#0008 5af7 39 add hl,sp 5af8 f9 ld sp,hl 5af9 210800 ld hl,#0008 5afc 39 add hl,sp 5afd 73 ld (hl),e 5afe 23 inc hl 5aff 72 ld (hl),d 5b00 2b dec hl 5b01 5e ld e,(hl) 5b02 2101ff ld hl,#ff01 5b05 19 add hl,de 5b06 7c ld a,h 5b07 b5 or l 5b08 28b4 jr z,#5abe ; (-76) 5b0a 210800 ld hl,#0008 5b0d 39 add hl,sp 5b0e 7e ld a,(hl) 5b0f 23 inc hl 5b10 b6 or (hl) 5b11 28ab jr z,#5abe ; (-85) 5b13 56 ld d,(hl) 5b14 2b dec hl 5b15 5e ld e,(hl) 5b16 23 inc hl 5b17 1b dec de 5b18 72 ld (hl),d 5b19 2b dec hl 5b1a 73 ld (hl),e 5b1b cd6424 call #2464 5b1e 210800 ld hl,#0008 5b21 39 add hl,sp 5b22 5e ld e,(hl) 5b23 23 inc hl 5b24 56 ld d,(hl) 5b25 eb ex de,hl 5b26 cd6901 call #0169 5b29 0300 5b2b 0000 5b2d 395b 5b2f 0100 5b31 3f5b 5b33 0200 5b35 455b 5b37 6d5a 'EMI 5b39 cd7153 call #5371 5b3c c36d5a jp #5a6d 'DTMF 5b3f cd0558 call #5805 5b42 c36d5a jp #5a6d 'MODEM TEST 5b45 210500 ld hl,#0005 5b48 e5 push hl 5b49 cdfd67 call #67fd 5b4c d1 pop de 5b4d c36d5a jp #5a6d 5b50 11fdff ld de,#fffd 5b53 cd6b05 call #056b 5b56 cd1f1a call #1a1f 5b59 eb ex de,hl 5b5a 210a00 ld hl,#000a 5b5d 39 add hl,sp 5b5e 73 ld (hl),e 5b5f 7b ld a,e 5b60 e620 and #20 5b62 2005 jr nz,#5b69 ; (5) 5b64 7e ld a,(hl) 5b65 e608 and #08 5b67 2004 jr nz,#5b6d ; (4) 5b69 210000 ld hl,#0000 5b6c c9 ret 5b6d 210f00 ld hl,#000f 5b70 39 add hl,sp 5b71 5e ld e,(hl) 5b72 1600 ld d,#00 5b74 d5 push de 5b75 cd131a call #1a13 5b78 d1 pop de 5b79 210800 ld hl,#0008 5b7c 39 add hl,sp 5b7d 3600 ld (hl),#00 5b7f 23 inc hl 5b80 3600 ld (hl),#00 5b82 cd1f1a call #1a1f 5b85 7d ld a,l 5b86 e680 and #80 5b88 2817 jr z,#5ba1 ; (23) 5b8a 210800 ld hl,#0008 5b8d 39 add hl,sp 5b8e 5e ld e,(hl) 5b8f 23 inc hl 5b90 56 ld d,(hl) 5b91 13 inc de 5b92 72 ld (hl),d 5b93 2b dec hl 5b94 73 ld (hl),e 5b95 23 inc hl 5b96 56 ld d,(hl) 5b97 21dfb1 ld hl,#b1df 5b9a 19 add hl,de 5b9b 30e5 jr nc,#5b82 ; (-27) 5b9d 210000 ld hl,#0000 5ba0 c9 ret 5ba1 210e00 ld hl,#000e 5ba4 e5 push hl 5ba5 cd281a call #1a28 5ba8 d1 pop de 5ba9 210100 ld hl,#0001 5bac e5 push hl 5bad cd5c0a call #0a5c 5bb0 d1 pop de 5bb1 210f00 ld hl,#000f 5bb4 e5 push hl 5bb5 cd281a call #1a28 5bb8 d1 pop de 5bb9 210100 ld hl,#0001 5bbc c9 ret 5bbd bf5b 5bbf PRINTER TESTING\0 5bcf d15b 5bd1 Maybe have some error!\0 5be8 11f5ff ld de,#fff5 5beb cd6b05 call #056b 5bee 3e00 ld a,#00 5bf0 324df6 ld (#f64d),a 5bf3 cd6424 call #2464 ' DisplayText("PRINTER TESTING", 90, 50, 1) 5bf6 210100 ld hl,#0001 5bf9 e5 push hl 5bfa 2e32 ld l,#32 5bfc e5 push hl 5bfd 2e5a ld l,#5a 5bff e5 push hl 5c00 2abd5b ld hl,(#5bbd) 5c03 e5 push hl 5c04 cd8d4c call #4c8d 5c07 210800 ld hl,#0008 5c0a 39 add hl,sp 5c0b f9 ld sp,hl 5c0c cd7324 call #2473 5c0f 212179 ld hl,#7921 5c12 e5 push hl 5c13 210100 ld hl,#0001 5c16 e5 push hl 5c17 cded05 call #05ed 5c1a d1 pop de 5c1b d1 pop de 5c1c eb ex de,hl 5c1d 211000 ld hl,#0010 5c20 39 add hl,sp 5c21 73 ld (hl),e 5c22 7b ld a,e 5c23 b7 or a 5c24 200a jr nz,#5c30 ; (10) 5c26 3a4df6 ld a,(#f64d) 5c29 f602 or #02 5c2b 324df6 ld (#f64d),a 5c2e 184c jr #5c7c ; (76) ' DisplayText("Maybe have some error!", 90, 80, 1) 5c30 210100 ld hl,#0001 5c33 e5 push hl 5c34 2e50 ld l,#50 5c36 e5 push hl 5c37 2e5a ld l,#5a 5c39 e5 push hl 5c3a 2acf5b ld hl,(#5bcf) 5c3d e5 push hl 5c3e cd8d4c call #4c8d 5c41 210800 ld hl,#0008 5c44 39 add hl,sp 5c45 f9 ld sp,hl 5c46 210a00 ld hl,#000a 5c49 e5 push hl 5c4a 39 add hl,sp 5c4b e5 push hl 5c4c 211400 ld hl,#0014 5c4f 39 add hl,sp 5c50 5e ld e,(hl) 5c51 1600 ld d,#00 5c53 d5 push de 5c54 cdb507 call #07b5 5c57 d1 pop de 5c58 d1 pop de 5c59 d1 pop de ' DisplayText(???, 230, 80, 1) 5c5a 210100 ld hl,#0001 5c5d e5 push hl 5c5e 2e50 ld l,#50 5c60 e5 push hl 5c61 2ee6 ld l,#e6 5c63 e5 push hl 5c64 210e00 ld hl,#000e 5c67 39 add hl,sp 5c68 e5 push hl 5c69 cd8d4c call #4c8d 5c6c 210800 ld hl,#0008 5c6f 39 add hl,sp 5c70 f9 ld sp,hl 5c71 cd7324 call #2473 5c74 218813 ld hl,#1388 5c77 e5 push hl 5c78 cd5c0a call #0a5c 5c7b d1 pop de 5c7c 3a4df6 ld a,(#f64d) 5c7f f601 or #01 5c81 324df6 ld (#f64d),a 5c84 211000 ld hl,#0010 5c87 39 add hl,sp 5c88 7e ld a,(hl) 5c89 b7 or a 5c8a 2804 jr z,#5c90 ; (4) 5c8c 2e00 ld l,#00 5c8e 1802 jr #5c92 ; (2) 5c90 2e01 ld l,#01 5c92 2600 ld h,#00 5c94 c9 ret 5c95 11faff ld de,#fffa 5c98 cd6b05 call #056b 5c9b cd6424 call #2464 ' DisplayText("PRINTER TESTING", 90, 50, 1) 5c9e 210100 ld hl,#0001 5ca1 e5 push hl 5ca2 2e32 ld l,#32 5ca4 e5 push hl 5ca5 2e5a ld l,#5a 5ca7 e5 push hl 5ca8 2abd5b ld hl,(#5bbd) 5cab e5 push hl 5cac cd8d4c call #4c8d 5caf 210800 ld hl,#0008 5cb2 39 add hl,sp 5cb3 f9 ld sp,hl 5cb4 cd7324 call #2473 5cb7 210d00 ld hl,#000d 5cba e5 push hl 5cbb cd505b call #5b50 5cbe d1 pop de 5cbf 210a00 ld hl,#000a 5cc2 e5 push hl 5cc3 cd505b call #5b50 5cc6 d1 pop de 5cc7 210a00 ld hl,#000a 5cca 39 add hl,sp 5ccb 3600 ld (hl),#00 5ccd 23 inc hl 5cce 3621 ld (hl),#21 5cd0 1874 jr #5d46 ; (116) 5cd2 23 inc hl 5cd3 e5 push hl 5cd4 21f455 ld hl,#55f4 5cd7 e5 push hl 5cd8 210100 ld hl,#0001 5cdb e5 push hl 5cdc cded05 call #05ed 5cdf d1 pop de 5ce0 d1 pop de 5ce1 d1 pop de 5ce2 210c00 ld hl,#000c 5ce5 39 add hl,sp 5ce6 5e ld e,(hl) 5ce7 23 inc hl 5ce8 56 ld d,(hl) 5ce9 21aeff ld hl,#ffae 5cec 19 add hl,de 5ced 7c ld a,h 5cee b5 or l 5cef 2004 jr nz,#5cf5 ; (4) 5cf1 21ff00 ld hl,#00ff 5cf4 c9 ret 5cf5 210b00 ld hl,#000b 5cf8 39 add hl,sp 5cf9 5e ld e,(hl) 5cfa 1600 ld d,#00 5cfc d5 push de 5cfd cd505b call #5b50 5d00 d1 pop de 5d01 eb ex de,hl 5d02 210c00 ld hl,#000c 5d05 39 add hl,sp 5d06 73 ld (hl),e 5d07 23 inc hl 5d08 3600 ld (hl),#00 5d0a 2b dec hl 5d0b 7e ld a,(hl) 5d0c 23 inc hl 5d0d b6 or (hl) 5d0e 2004 jr nz,#5d14 ; (4) 5d10 210000 ld hl,#0000 5d13 c9 ret 5d14 2b dec hl 5d15 2b dec hl 5d16 2b dec hl 5d17 e5 push hl 5d18 6e ld l,(hl) 5d19 23 inc hl 5d1a eb ex de,hl 5d1b e1 pop hl 5d1c 73 ld (hl),e 5d1d 210a00 ld hl,#000a 5d20 39 add hl,sp 5d21 7e ld a,(hl) 5d22 fe46 cp #46 5d24 2016 jr nz,#5d3c ; (22) 5d26 210d00 ld hl,#000d 5d29 e5 push hl 5d2a cd505b call #5b50 5d2d d1 pop de 5d2e 210a00 ld hl,#000a 5d31 e5 push hl 5d32 cd505b call #5b50 5d35 d1 pop de 5d36 210a00 ld hl,#000a 5d39 39 add hl,sp 5d3a 3600 ld (hl),#00 5d3c 210b00 ld hl,#000b 5d3f 39 add hl,sp 5d40 e5 push hl 5d41 6e ld l,(hl) 5d42 23 inc hl 5d43 eb ex de,hl 5d44 e1 pop hl 5d45 73 ld (hl),e 5d46 210b00 ld hl,#000b 5d49 39 add hl,sp 5d4a 7e ld a,(hl) 5d4b fe7f cp #7f 5d4d 3883 jr c,#5cd2 ; (-125) 5d4f 210d00 ld hl,#000d 5d52 e5 push hl 5d53 cd505b call #5b50 5d56 d1 pop de 5d57 210a00 ld hl,#000a 5d5a e5 push hl 5d5b cd505b call #5b50 5d5e d1 pop de 5d5f 211200 ld hl,#0012 5d62 39 add hl,sp 5d63 7e ld a,(hl) 5d64 fe01 cp #01 5d66 2076 jr nz,#5dde ; (118) 5d68 210a00 ld hl,#000a 5d6b 39 add hl,sp 5d6c 3600 ld (hl),#00 5d6e 181a jr #5d8a ; (26) 5d70 210d00 ld hl,#000d 5d73 e5 push hl 5d74 cd505b call #5b50 5d77 d1 pop de 5d78 210a00 ld hl,#000a 5d7b e5 push hl 5d7c cd505b call #5b50 5d7f d1 pop de 5d80 210a00 ld hl,#000a 5d83 39 add hl,sp 5d84 e5 push hl 5d85 6e ld l,(hl) 5d86 23 inc hl 5d87 eb ex de,hl 5d88 e1 pop hl 5d89 73 ld (hl),e 5d8a 210a00 ld hl,#000a 5d8d 39 add hl,sp 5d8e 7e ld a,(hl) 5d8f fe09 cp #09 5d91 38dd jr c,#5d70 ; (-35) 5d93 3600 ld (hl),#00 5d95 183e jr #5dd5 ; (62) 5d97 210a00 ld hl,#000a 5d9a e5 push hl 5d9b cd5c0a call #0a5c 5d9e d1 pop de 5d9f 210800 ld hl,#0008 5da2 39 add hl,sp 5da3 e5 push hl 5da4 21f455 ld hl,#55f4 5da7 e5 push hl 5da8 210100 ld hl,#0001 5dab e5 push hl 5dac cded05 call #05ed 5daf d1 pop de 5db0 d1 pop de 5db1 d1 pop de 5db2 210800 ld hl,#0008 5db5 39 add hl,sp 5db6 5e ld e,(hl) 5db7 23 inc hl 5db8 56 ld d,(hl) 5db9 21a9ff ld hl,#ffa9 5dbc 19 add hl,de 5dbd 7c ld a,h 5dbe b5 or l 5dbf 200a jr nz,#5dcb ; (10) 5dc1 210c00 ld hl,#000c 5dc4 e5 push hl 5dc5 cd505b call #5b50 5dc8 d1 pop de 5dc9 1813 jr #5dde ; (19) 5dcb 210a00 ld hl,#000a 5dce 39 add hl,sp 5dcf e5 push hl 5dd0 6e ld l,(hl) 5dd1 23 inc hl 5dd2 eb ex de,hl 5dd3 e1 pop hl 5dd4 73 ld (hl),e 5dd5 210a00 ld hl,#000a 5dd8 39 add hl,sp 5dd9 7e ld a,(hl) 5dda fefb cp #fb 5ddc 38b9 jr c,#5d97 ; (-71) 5dde 210100 ld hl,#0001 5de1 c9 ret 5de2 11f3ff ld de,#fff3 5de5 cd6b05 call #056b 5de8 210d00 ld hl,#000d 5deb 39 add hl,sp 5dec 3600 ld (hl),#00 5dee 23 inc hl 5def 3600 ld (hl),#00 5df1 2b dec hl 5df2 2b dec hl 5df3 3600 ld (hl),#00 5df5 2b dec hl 5df6 3600 ld (hl),#00 5df8 2b dec hl 5df9 2b dec hl 5dfa 2b dec hl 5dfb 3601 ld (hl),#01 5dfd 210f00 ld hl,#000f 5e00 39 add hl,sp 5e01 3600 ld (hl),#00 5e03 c3b75e jp #5eb7 5e06 210900 ld hl,#0009 5e09 39 add hl,sp 5e0a e5 push hl 5e0b 21f455 ld hl,#55f4 5e0e e5 push hl 5e0f 210100 ld hl,#0001 5e12 e5 push hl 5e13 cded05 call #05ed 5e16 d1 pop de 5e17 d1 pop de 5e18 d1 pop de 5e19 210900 ld hl,#0009 5e1c 39 add hl,sp 5e1d 5e ld e,(hl) 5e1e 23 inc hl 5e1f 56 ld d,(hl) 5e20 21aeff ld hl,#ffae 5e23 19 add hl,de 5e24 7c ld a,h 5e25 b5 or l 5e26 2004 jr nz,#5e2c ; (4) 5e28 21ff00 ld hl,#00ff 5e2b c9 ret 5e2c 210f00 ld hl,#000f 5e2f 39 add hl,sp 5e30 5e ld e,(hl) 5e31 1600 ld d,#00 5e33 d5 push de 5e34 cd3127 call #2731 5e37 d1 pop de 5e38 eb ex de,hl 5e39 210900 ld hl,#0009 5e3c 39 add hl,sp 5e3d 73 ld (hl),e 5e3e 23 inc hl 5e3f 72 ld (hl),d 5e40 210f00 ld hl,#000f 5e43 39 add hl,sp 5e44 5e ld e,(hl) 5e45 1600 ld d,#00 5e47 d5 push de 5e48 cd3127 call #2731 5e4b d1 pop de 5e4c eb ex de,hl 5e4d 210b00 ld hl,#000b 5e50 39 add hl,sp 5e51 73 ld (hl),e 5e52 23 inc hl 5e53 72 ld (hl),d 5e54 2b dec hl 5e55 2b dec hl 5e56 56 ld d,(hl) 5e57 2b dec hl 5e58 5e ld e,(hl) 5e59 23 inc hl 5e5a 23 inc hl 5e5b 7e ld a,(hl) 5e5c 23 inc hl 5e5d 66 ld h,(hl) 5e5e 6f ld l,a 5e5f a7 and a 5e60 ed52 sbc hl,de 5e62 2806 jr z,#5e6a ; (6) 5e64 210800 ld hl,#0008 5e67 39 add hl,sp 5e68 3600 ld (hl),#00 5e6a 210d00 ld hl,#000d 5e6d 39 add hl,sp 5e6e 5e ld e,(hl) 5e6f 23 inc hl 5e70 56 ld d,(hl) 5e71 210900 ld hl,#0009 5e74 39 add hl,sp 5e75 7e ld a,(hl) 5e76 23 inc hl 5e77 66 ld h,(hl) 5e78 6f ld l,a 5e79 19 add hl,de 5e7a eb ex de,hl 5e7b 210d00 ld hl,#000d 5e7e 39 add hl,sp 5e7f 73 ld (hl),e 5e80 23 inc hl 5e81 72 ld (hl),d 5e82 211900 ld hl,#0019 5e85 39 add hl,sp 5e86 7e ld a,(hl) 5e87 b7 or a 5e88 2023 jr nz,#5ead ; (35) 5e8a 213f00 ld hl,#003f 5e8d e5 push hl 5e8e 211100 ld hl,#0011 5e91 39 add hl,sp 5e92 5e ld e,(hl) 5e93 1600 ld d,#00 5e95 d5 push de 5e96 213400 ld hl,#0034 5e99 e5 push hl 5e9a 2ebe ld l,#be 5e9c e5 push hl 5e9d 21f854 ld hl,#54f8 5ea0 e5 push hl 5ea1 210100 ld hl,#0001 5ea4 e5 push hl 5ea5 cded05 call #05ed 5ea8 210c00 ld hl,#000c 5eab 39 add hl,sp 5eac f9 ld sp,hl 5ead 210f00 ld hl,#000f 5eb0 39 add hl,sp 5eb1 e5 push hl 5eb2 6e ld l,(hl) 5eb3 23 inc hl 5eb4 eb ex de,hl 5eb5 e1 pop hl 5eb6 73 ld (hl),e 5eb7 210f00 ld hl,#000f 5eba 39 add hl,sp 5ebb 7e ld a,(hl) 5ebc fe40 cp #40 5ebe da065e jp c,#5e06 5ec1 211400 ld hl,#0014 5ec4 39 add hl,sp 5ec5 3600 ld (hl),#00 5ec7 210f00 ld hl,#000f 5eca 39 add hl,sp 5ecb 3604 ld (hl),#04 5ecd 1862 jr #5f31 ; (98) 5ecf 2b dec hl 5ed0 2b dec hl 5ed1 7e ld a,(hl) 5ed2 e60f and #0f 5ed4 210900 ld hl,#0009 5ed7 39 add hl,sp 5ed8 77 ld (hl),a 5ed9 23 inc hl 5eda 3600 ld (hl),#00 5edc 2b dec hl 5edd 7e ld a,(hl) 5ede fe0a cp #0a 5ee0 381d jr c,#5eff ; (29) 5ee2 5e ld e,(hl) 5ee3 23 inc hl 5ee4 56 ld d,(hl) 5ee5 21f6ff ld hl,#fff6 5ee8 19 add hl,de 5ee9 eb ex de,hl 5eea 210900 ld hl,#0009 5eed 39 add hl,sp 5eee 73 ld (hl),e 5eef 23 inc hl 5ef0 72 ld (hl),d 5ef1 2b dec hl 5ef2 5e ld e,(hl) 5ef3 211100 ld hl,#0011 5ef6 19 add hl,de 5ef7 eb ex de,hl 5ef8 210900 ld hl,#0009 5efb 39 add hl,sp 5efc 73 ld (hl),e 5efd 23 inc hl 5efe 72 ld (hl),d 5eff 210900 ld hl,#0009 5f02 39 add hl,sp 5f03 5e ld e,(hl) 5f04 23 inc hl 5f05 56 ld d,(hl) 5f06 213000 ld hl,#0030 5f09 19 add hl,de 5f0a e5 push hl 5f0b 211100 ld hl,#0011 5f0e 39 add hl,sp 5f0f 5e ld e,(hl) 5f10 1600 ld d,#00 5f12 19 add hl,de 5f13 d1 pop de 5f14 73 ld (hl),e 5f15 210d00 ld hl,#000d 5f18 39 add hl,sp 5f19 5e ld e,(hl) 5f1a 23 inc hl 5f1b 56 ld d,(hl) 5f1c 210400 ld hl,#0004 5f1f cd3705 call #0537 5f22 eb ex de,hl 5f23 210d00 ld hl,#000d 5f26 39 add hl,sp 5f27 73 ld (hl),e 5f28 23 inc hl 5f29 72 ld (hl),d 5f2a 23 inc hl 5f2b e5 push hl 5f2c 6e ld l,(hl) 5f2d 2b dec hl 5f2e eb ex de,hl 5f2f e1 pop hl 5f30 73 ld (hl),e 5f31 210f00 ld hl,#000f 5f34 39 add hl,sp 5f35 7e ld a,(hl) 5f36 b7 or a 5f37 2096 jr nz,#5ecf ; (-106) 5f39 211900 ld hl,#0019 5f3c 39 add hl,sp 5f3d 7e ld a,(hl) 5f3e fe06 cp #06 5f40 2019 jr nz,#5f5b ; (25) ' DisplayText(???, 100, 94, 1) 5f42 210100 ld hl,#0001 5f45 e5 push hl 5f46 2e5e ld l,#5e 5f48 e5 push hl 5f49 2e64 ld l,#64 5f4b e5 push hl 5f4c 211600 ld hl,#0016 5f4f 39 add hl,sp 5f50 e5 push hl 5f51 cd8d4c call #4c8d 5f54 210800 ld hl,#0008 5f57 39 add hl,sp 5f58 f9 ld sp,hl 5f59 1817 jr #5f72 ; (23) ' DisplayText(???, 190, 80, 0) 5f5b 210000 ld hl,#0000 5f5e e5 push hl 5f5f 2e50 ld l,#50 5f61 e5 push hl 5f62 2ebe ld l,#be 5f64 e5 push hl 5f65 211600 ld hl,#0016 5f68 39 add hl,sp 5f69 e5 push hl 5f6a cd8d4c call #4c8d 5f6d 210800 ld hl,#0008 5f70 39 add hl,sp 5f71 f9 ld sp,hl 5f72 cd7324 call #2473 5f75 218813 ld hl,#1388 5f78 e5 push hl 5f79 cd5c0a call #0a5c 5f7c d1 pop de 5f7d 210800 ld hl,#0008 5f80 39 add hl,sp 5f81 5e ld e,(hl) 5f82 1600 ld d,#00 5f84 eb ex de,hl 5f85 c9 ret 5f86 11ffff ld de,#ffff 5f89 cd6b05 call #056b 5f8c 3e00 ld a,#00 5f8e 324ef6 ld (#f64e),a ' DisplayText("ROM Testing", 90, 50, 1) 5f91 210100 ld hl,#0001 5f94 e5 push hl 5f95 2e32 ld l,#32 5f97 e5 push hl 5f98 2e5a ld l,#5a 5f9a e5 push hl 5f9b 2a9243 ld hl,(#4392) 5f9e e5 push hl 5f9f cd8d4c call #4c8d 5fa2 210800 ld hl,#0008 5fa5 39 add hl,sp 5fa6 f9 ld sp,hl ' DisplayText("Rom Checksum", 100, 80, 0) 5fa7 210000 ld hl,#0000 5faa e5 push hl 5fab 2e50 ld l,#50 5fad e5 push hl 5fae 2e64 ld l,#64 5fb0 e5 push hl 5fb1 2aa143 ld hl,(#43a1) 5fb4 e5 push hl 5fb5 cd8d4c call #4c8d 5fb8 210800 ld hl,#0008 5fbb 39 add hl,sp 5fbc f9 ld sp,hl 5fbd 210000 ld hl,#0000 5fc0 e5 push hl 5fc1 cde25d call #5de2 5fc4 d1 pop de 5fc5 eb ex de,hl 5fc6 210800 ld hl,#0008 5fc9 39 add hl,sp 5fca 73 ld (hl),e 5fcb 7b ld a,e 5fcc fe01 cp #01 5fce 2008 jr nz,#5fd8 ; (8) 5fd0 3a4ef6 ld a,(#f64e) 5fd3 f602 or #02 5fd5 324ef6 ld (#f64e),a 5fd8 210800 ld hl,#0008 5fdb 39 add hl,sp 5fdc 7e ld a,(hl) 5fdd feff cp #ff 5fdf 2808 jr z,#5fe9 ; (8) 5fe1 3a4ef6 ld a,(#f64e) 5fe4 f601 or #01 5fe6 324ef6 ld (#f64e),a 5fe9 210800 ld hl,#0008 5fec 39 add hl,sp 5fed 5e ld e,(hl) 5fee 1600 ld d,#00 5ff0 eb ex de,hl 5ff1 c9 ret 5ff2 11f8ff ld de,#fff8 5ff5 cd6b05 call #056b 5ff8 3e00 ld a,#00 5ffa 324ff6 ld (#f64f),a 5ffd 211400 ld hl,#0014 6000 39 add hl,sp 6001 7e ld a,(hl) 6002 fe06 cp #06 6004 2816 jr z,#601c ; (22) ' DisplayText("RAM Testing", 90, 50, 1) 6006 210100 ld hl,#0001 6009 e5 push hl 600a 2e32 ld l,#32 600c e5 push hl 600d 2e5a ld l,#5a 600f e5 push hl 6010 2a8343 ld hl,(#4383) 6013 e5 push hl 6014 cd8d4c call #4c8d 6017 210800 ld hl,#0008 601a 39 add hl,sp 601b f9 ld sp,hl 601c cd7324 call #2473 601f 210e00 ld hl,#000e 6022 39 add hl,sp 6023 36b6 ld (hl),#b6 6025 23 inc hl 6026 3600 ld (hl),#00 6028 2b dec hl 6029 2b dec hl 602a 3600 ld (hl),#00 602c 2b dec hl 602d 3634 ld (hl),#34 602f f3 di 6030 2b dec hl 6031 3600 ld (hl),#00 6033 2b dec hl 6034 3601 ld (hl),#01 6036 210a00 ld hl,#000a 6039 39 add hl,sp 603a 5e ld e,(hl) 603b 23 inc hl 603c 56 ld d,(hl) 603d d5 push de 603e 210077 ld hl,#7700 6041 e5 push hl 6042 210100 ld hl,#0001 6045 e5 push hl 6046 cded05 call #05ed 6049 d1 pop de 604a d1 pop de 604b d1 pop de 604c 210a00 ld hl,#000a 604f 39 add hl,sp 6050 5e ld e,(hl) 6051 23 inc hl 6052 56 ld d,(hl) 6053 13 inc de 6054 72 ld (hl),d 6055 2b dec hl 6056 73 ld (hl),e 6057 23 inc hl 6058 56 ld d,(hl) 6059 21f8ff ld hl,#fff8 605c 7a ld a,d 605d ac xor h 605e 07 rlca 605f 19 add hl,de 6060 ce00 adc a,#00 6062 0f rrca 6063 38d1 jr c,#6036 ; (-47) 6065 210a00 ld hl,#000a 6068 39 add hl,sp 6069 3601 ld (hl),#01 606b 23 inc hl 606c 3600 ld (hl),#00 606e 210a00 ld hl,#000a 6071 39 add hl,sp 6072 5e ld e,(hl) 6073 23 inc hl 6074 56 ld d,(hl) 6075 d5 push de 6076 211d77 ld hl,#771d 6079 e5 push hl 607a 210100 ld hl,#0001 607d e5 push hl 607e cded05 call #05ed 6081 d1 pop de 6082 d1 pop de 6083 d1 pop de 6084 eb ex de,hl 6085 210800 ld hl,#0008 6088 39 add hl,sp 6089 73 ld (hl),e 608a 23 inc hl 608b 72 ld (hl),d 608c 2b dec hl 608d 5e ld e,(hl) 608e 1b dec de 608f 7a ld a,d 6090 b3 or e 6091 2817 jr z,#60aa ; (23) 6093 23 inc hl 6094 23 inc hl 6095 5e ld e,(hl) 6096 23 inc hl 6097 56 ld d,(hl) 6098 13 inc de 6099 72 ld (hl),d 609a 2b dec hl 609b 73 ld (hl),e 609c 23 inc hl 609d 56 ld d,(hl) 609e 21f8ff ld hl,#fff8 60a1 7a ld a,d 60a2 ac xor h 60a3 07 rlca 60a4 19 add hl,de 60a5 ce00 adc a,#00 60a7 0f rrca 60a8 38c4 jr c,#606e ; (-60) 60aa 210800 ld hl,#0008 60ad 39 add hl,sp 60ae 7e ld a,(hl) 60af 23 inc hl 60b0 b6 or (hl) 60b1 2015 jr nz,#60c8 ; (21) 60b3 214577 ld hl,#7745 60b6 e5 push hl 60b7 210100 ld hl,#0001 60ba e5 push hl 60bb cded05 call #05ed 60be d1 pop de 60bf d1 pop de 60c0 eb ex de,hl 60c1 210800 ld hl,#0008 60c4 39 add hl,sp 60c5 73 ld (hl),e 60c6 23 inc hl 60c7 72 ld (hl),d 60c8 210800 ld hl,#0008 60cb 39 add hl,sp 60cc 7e ld a,(hl) 60cd 23 inc hl 60ce b6 or (hl) 60cf 2008 jr nz,#60d9 ; (8) 60d1 3a4ff6 ld a,(#f64f) 60d4 f602 or #02 60d6 324ff6 ld (#f64f),a 60d9 3a4ff6 ld a,(#f64f) 60dc f601 or #01 60de 324ff6 ld (#f64f),a 60e1 fb ei 60e2 210800 ld hl,#0008 60e5 39 add hl,sp 60e6 7e ld a,(hl) 60e7 23 inc hl 60e8 b6 or (hl) 60e9 2804 jr z,#60ef ; (4) 60eb 2e00 ld l,#00 60ed 1802 jr #60f1 ; (2) 60ef 2e01 ld l,#01 60f1 2600 ld h,#00 60f3 c9 ret 60f4 f660 60f6 Please Wait...\0 6105 cd6424 call #2464 ' DisplayText("Please Wait...", 120, 50, 1) 6108 210100 ld hl,#0001 610b e5 push hl 610c 2e32 ld l,#32 610e e5 push hl 610f 2e78 ld l,#78 6111 e5 push hl 6112 2af460 ld hl,(#60f4) 6115 e5 push hl 6116 cd8d4c call #4c8d 6119 210800 ld hl,#0008 611c 39 add hl,sp 611d f9 ld sp,hl 611e cd7324 call #2473 6121 cd6308 call #0863 6124 21b80b ld hl,#0bb8 6127 e5 push hl 6128 cd5c0a call #0a5c 612b d1 pop de 612c cd6424 call #2464 612f c9 ret 6130 3a321\0 6136 3861 6138 Email TESTING\0 6146 11ebff ld de,#ffeb 6149 cd6b05 call #056b 614c cd0561 call #6105 ' DisplayText("Email TESTING", 90, 50, 1) 614f 210100 ld hl,#0001 6152 e5 push hl 6153 2e32 ld l,#32 6155 e5 push hl 6156 2e5a ld l,#5a 6158 e5 push hl 6159 2a3661 ld hl,(#6136) 615c e5 push hl 615d cd8d4c call #4c8d 6160 210800 ld hl,#0008 6163 39 add hl,sp 6164 f9 ld sp,hl 6165 cd7324 call #2473 6168 2a3061 ld hl,(#6130) 616b e5 push hl 616c 210a00 ld hl,#000a 616f 39 add hl,sp 6170 e5 push hl 6171 cdc605 call #05c6 6174 d1 pop de 6175 d1 pop de 6176 210000 ld hl,#0000 6179 e5 push hl 617a 2c inc l 617b e5 push hl 617c 210c00 ld hl,#000c 617f 39 add hl,sp 6180 e5 push hl 6181 cd6b6f call #6f6b 6184 d1 pop de 6185 d1 pop de 6186 d1 pop de 6187 eb ex de,hl 6188 211c00 ld hl,#001c 618b 39 add hl,sp 618c 73 ld (hl),e 618d 7b ld a,e 618e fe01 cp #01 6190 2008 jr nz,#619a ; (8) 6192 3a4cf6 ld a,(#f64c) 6195 f602 or #02 6197 324cf6 ld (#f64c),a 619a 3a4cf6 ld a,(#f64c) 619d f601 or #01 619f 324cf6 ld (#f64c),a 61a2 cd6608 call #0866 61a5 211c00 ld hl,#001c 61a8 39 add hl,sp 61a9 5e ld e,(hl) 61aa 1600 ld d,#00 61ac eb ex de,hl 61ad c9 ret 61ae b061 61b0 Dialling :\0 61bb bd61 61bd 123456789*0#\0 61ca cc61 61cc DTMF TESTING\0 61d9 db61 61db The Modem Reset Error!\0 61f2 f461 61f4 The Modem Reset OK!\0 6208 11e5ff ld de,#ffe5 620b cd6b05 call #056b 620e 212700 ld hl,#0027 6211 39 add hl,sp 6212 7e ld a,(hl) 6213 fe06 cp #06 6215 ca1863 jp z,#6318 6218 cd0561 call #6105 621b 3e00 ld a,#00 621d 324af6 ld (#f64a),a 6220 210300 ld hl,#0003 6223 e5 push hl 6224 cda233 call #33a2 6227 d1 pop de 6228 210e00 ld hl,#000e 622b 39 add hl,sp 622c 3600 ld (hl),#00 622e 187b jr #62ab ; (123) 6230 2b dec hl 6231 3600 ld (hl),#00 6233 2b dec hl 6234 3600 ld (hl),#00 6236 cd7d33 call #337d 6239 eb ex de,hl 623a 210900 ld hl,#0009 623d 39 add hl,sp 623e 73 ld (hl),e 623f cd5b33 call #335b 6242 eb ex de,hl 6243 210800 ld hl,#0008 6246 39 add hl,sp 6247 73 ld (hl),e 6248 23 inc hl 6249 7e ld a,(hl) 624a b7 or a 624b 2804 jr z,#6251 ; (4) 624d 2e00 ld l,#00 624f 1802 jr #6253 ; (2) 6251 2e01 ld l,#01 6253 7d ld a,l 6254 e620 and #20 6256 2009 jr nz,#6261 ; (9) 6258 210800 ld hl,#0008 625b 39 add hl,sp 625c 7e ld a,(hl) 625d fe03 cp #03 625f 282d jr z,#628e ; (45) ' DisplayText("The Modem Reset Error!", 100, 95, 0) 6261 210000 ld hl,#0000 6264 e5 push hl 6265 2e5f ld l,#5f 6267 e5 push hl 6268 2e64 ld l,#64 626a e5 push hl 626b 2ad961 ld hl,(#61d9) 626e e5 push hl 626f cd8d4c call #4c8d 6272 210800 ld hl,#0008 6275 39 add hl,sp 6276 f9 ld sp,hl 6277 cd7324 call #2473 627a 218813 ld hl,#1388 627d e5 push hl 627e cd5c0a call #0a5c 6281 d1 pop de 6282 3a4af6 ld a,(#f64a) 6285 f601 or #01 6287 324af6 ld (#f64a),a 628a 210000 ld hl,#0000 628d c9 ret 628e 210c00 ld hl,#000c 6291 39 add hl,sp 6292 5e ld e,(hl) 6293 23 inc hl 6294 56 ld d,(hl) 6295 13 inc de 6296 72 ld (hl),d 6297 2b dec hl 6298 73 ld (hl),e 6299 23 inc hl 629a 56 ld d,(hl) 629b 21f0d8 ld hl,#d8f0 629e 19 add hl,de 629f 3095 jr nc,#6236 ; (-107) 62a1 210e00 ld hl,#000e 62a4 39 add hl,sp 62a5 e5 push hl 62a6 6e ld l,(hl) 62a7 23 inc hl 62a8 eb ex de,hl 62a9 e1 pop hl 62aa 73 ld (hl),e 62ab 210e00 ld hl,#000e 62ae 39 add hl,sp 62af 7e ld a,(hl) 62b0 fe14 cp #14 62b2 da3062 jp c,#6230 62b5 210f00 ld hl,#000f 62b8 e5 push hl 62b9 cda233 call #33a2 62bc d1 pop de ' DisplayText("The Modem Reset OK!", 100, 95, 0) 62bd 210000 ld hl,#0000 62c0 e5 push hl 62c1 2e5f ld l,#5f 62c3 e5 push hl 62c4 2e64 ld l,#64 62c6 e5 push hl 62c7 2af261 ld hl,(#61f2) 62ca e5 push hl 62cb cd8d4c call #4c8d 62ce 210800 ld hl,#0008 62d1 39 add hl,sp 62d2 f9 ld sp,hl ' DisplayText("DTMF TESTING", 110, 45, 1) 62d3 210100 ld hl,#0001 62d6 e5 push hl 62d7 2e2d ld l,#2d 62d9 e5 push hl 62da 2e6e ld l,#6e 62dc e5 push hl 62dd 2aca61 ld hl,(#61ca) 62e0 e5 push hl 62e1 cd8d4c call #4c8d 62e4 210800 ld hl,#0008 62e7 39 add hl,sp 62e8 f9 ld sp,hl ' DisplayText("Dialling :", 100, 80, 0) 62e9 210000 ld hl,#0000 62ec e5 push hl 62ed 2e50 ld l,#50 62ef e5 push hl 62f0 2e64 ld l,#64 62f2 e5 push hl 62f3 2aae61 ld hl,(#61ae) 62f6 e5 push hl 62f7 cd8d4c call #4c8d 62fa 210800 ld hl,#0008 62fd 39 add hl,sp 62fe f9 ld sp,hl ' DisplayText("123456789*0#", 140, 80, 0) 62ff 210000 ld hl,#0000 6302 e5 push hl 6303 2e50 ld l,#50 6305 e5 push hl 6306 2e8c ld l,#8c 6308 e5 push hl 6309 2abb61 ld hl,(#61bb) 630c e5 push hl 630d cd8d4c call #4c8d 6310 210800 ld hl,#0008 6313 39 add hl,sp 6314 f9 ld sp,hl 6315 cd7324 call #2473 6318 2abb61 ld hl,(#61bb) 631b e5 push hl 631c 211100 ld hl,#0011 631f 39 add hl,sp 6320 e5 push hl 6321 cdc605 call #05c6 6324 d1 pop de 6325 d1 pop de 6326 212700 ld hl,#0027 6329 39 add hl,sp 632a 7e ld a,(hl) 632b fe02 cp #02 632d 2010 jr nz,#633f ; (16) 632f 210000 ld hl,#0000 6332 e5 push hl 6333 211100 ld hl,#0011 6336 39 add hl,sp 6337 e5 push hl 6338 cd2957 call #5729 633b d1 pop de 633c d1 pop de 633d 180e jr #634d ; (14) 633f 210100 ld hl,#0001 6342 e5 push hl 6343 211100 ld hl,#0011 6346 39 add hl,sp 6347 e5 push hl 6348 cd2957 call #5729 634b d1 pop de 634c d1 pop de 634d 212700 ld hl,#0027 6350 39 add hl,sp 6351 7e ld a,(hl) 6352 fe06 cp #06 6354 200c jr nz,#6362 ; (12) 6356 21d007 ld hl,#07d0 6359 e5 push hl 635a cd5c0a call #0a5c 635d d1 pop de 635e 21ff00 ld hl,#00ff 6361 c9 ret 6362 210c00 ld hl,#000c 6365 39 add hl,sp 6366 3600 ld (hl),#00 6368 23 inc hl 6369 3600 ld (hl),#00 636b 1834 jr #63a1 ; (52) 636d 210a00 ld hl,#000a 6370 39 add hl,sp 6371 e5 push hl 6372 21f455 ld hl,#55f4 6375 e5 push hl 6376 210100 ld hl,#0001 6379 e5 push hl 637a cded05 call #05ed 637d d1 pop de 637e d1 pop de 637f d1 pop de 6380 210a00 ld hl,#000a 6383 39 add hl,sp 6384 5e ld e,(hl) 6385 23 inc hl 6386 56 ld d,(hl) 6387 21aeff ld hl,#ffae 638a 19 add hl,de 638b 7c ld a,h 638c b5 or l 638d 2007 jr nz,#6396 ; (7) 638f cd6608 call #0866 6392 21ff00 ld hl,#00ff 6395 c9 ret 6396 210c00 ld hl,#000c 6399 39 add hl,sp 639a 5e ld e,(hl) 639b 23 inc hl 639c 56 ld d,(hl) 639d 13 inc de 639e 72 ld (hl),d 639f 2b dec hl 63a0 73 ld (hl),e 63a1 210c00 ld hl,#000c 63a4 39 add hl,sp 63a5 5e ld e,(hl) 63a6 23 inc hl 63a7 56 ld d,(hl) 63a8 eb ex de,hl 63a9 cdde04 call #04de 63ac cd1102 call #0211 63af 60 ld h,b 63b0 ea0000 jp pe,#0000 63b3 cd9604 call #0496 63b6 20b5 jr nz,#636d ; (-75) 63b8 cd6608 call #0866 63bb 210100 ld hl,#0001 63be c9 ret 63bf 00 nop 63c0 00 nop 63c1 00 nop 63c2 00 nop 63c3 48 ld c,b 63c4 1b dec de 63c5 00 nop 63c6 00 nop 63c7 11feff ld de,#fffe 63ca cd6b05 call #056b 63cd 210e00 ld hl,#000e 63d0 39 add hl,sp 63d1 5e ld e,(hl) 63d2 1600 ld d,#00 63d4 eb ex de,hl 63d5 29 add hl,hl 63d6 29 add hl,hl 63d7 11bf63 ld de,#63bf 63da 19 add hl,de 63db cd2402 call #0224 63de cd3c02 call #023c 63e1 211200 ld hl,#0012 63e4 39 add hl,sp 63e5 5e ld e,(hl) 63e6 1600 ld d,#00 63e8 d5 push de 63e9 210100 ld hl,#0001 63ec e5 push hl 63ed 21b25f ld hl,#5fb2 63f0 e5 push hl 63f1 212e00 ld hl,#002e 63f4 e5 push hl 63f5 cded05 call #05ed 63f8 210c00 ld hl,#000c 63fb 39 add hl,sp 63fc f9 ld sp,hl 63fd 210800 ld hl,#0008 6400 39 add hl,sp 6401 e5 push hl 6402 21f455 ld hl,#55f4 6405 e5 push hl 6406 210100 ld hl,#0001 6409 e5 push hl 640a cded05 call #05ed 640d d1 pop de 640e d1 pop de 640f d1 pop de 6410 28eb jr z,#63fd ; (-21) 6412 210000 ld hl,#0000 6415 e5 push hl 6416 210a00 ld hl,#000a 6419 39 add hl,sp 641a 5e ld e,(hl) 641b 23 inc hl 641c 56 ld d,(hl) 641d d5 push de 641e 210800 ld hl,#0008 6421 e5 push hl 6422 21b25f ld hl,#5fb2 6425 e5 push hl 6426 212e00 ld hl,#002e 6429 e5 push hl 642a cded05 call #05ed 642d 210a00 ld hl,#000a 6430 39 add hl,sp 6431 f9 ld sp,hl 6432 20c9 jr nz,#63fd ; (-55) 6434 c9 ret 6435 3764 6437 Don't press any key!\0 644c 4e64 644e Please put down equipment.\0 6469 6b64 646b Skip: [S]\0 6475 7764 6477 Please plug in\0 6486 8864 6488 Press [enter].\0 6497 a164 6499 a964 649b af64 649d be64 649f c464 64a1 1.Flash\0 64a9 2.Key\0 64af 3.Printer Port\0 64be 4.RAM\0 64c4 5.ROM\0 64ca d064 64cc d664 64ce db64 64d0 FALSE\0 64d6 PASS\0 64db SKIP\0 64e0 e264 64e2 Error!\0 64e9 11faff ld de,#fffa 64ec cd6b05 call #056b 64ef cd9d0a call #0a9d 64f2 210a00 ld hl,#000a 64f5 39 add hl,sp 64f6 3600 ld (hl),#00 64f8 2b dec hl 64f9 361e ld (hl),#1e ' DisplayText("1.Flash" or "2.Key" etc..., , , 1) 64fb 210100 ld hl,#0001 64fe e5 push hl 64ff 210b00 ld hl,#000b 6502 39 add hl,sp 6503 5e ld e,(hl) 6504 1600 ld d,#00 6506 d5 push de 6507 210f00 ld hl,#000f 650a e5 push hl 650b 211000 ld hl,#0010 650e 39 add hl,sp 650f 5e ld e,(hl) 6510 eb ex de,hl 6511 29 add hl,hl 6512 119764 ld de,#6497 6515 19 add hl,de 6516 5e ld e,(hl) 6517 23 inc hl 6518 56 ld d,(hl) 6519 d5 push de 651a cd8d4c call #4c8d 651d 210800 ld hl,#0008 6520 39 add hl,sp 6521 f9 ld sp,hl 6522 cd7324 call #2473 6525 217600 ld hl,#0076 6528 e5 push hl 6529 212c01 ld hl,#012c 652c e5 push hl 652d 211e00 ld hl,#001e 6530 e5 push hl 6531 2e8c ld l,#8c 6533 e5 push hl 6534 21be77 ld hl,#77be 6537 e5 push hl 6538 210100 ld hl,#0001 653b e5 push hl 653c cded05 call #05ed 653f 210c00 ld hl,#000c 6542 39 add hl,sp 6543 f9 ld sp,hl 6544 210a00 ld hl,#000a 6547 39 add hl,sp 6548 7e ld a,(hl) 6549 eb ex de,hl 654a b7 or a 654b 2812 jr z,#655f ; (18) 654d 3d dec a 654e 282b jr z,#657b ; (43) 6550 3d dec a 6551 cad565 jp z,#65d5 6554 3d dec a 6555 cadd65 jp z,#65dd 6558 3d dec a 6559 caed65 jp z,#65ed 655c c3fb65 jp #65fb ' Led(On) 655f 210100 ld hl,#0001 6562 e5 push hl 6563 cd770a call #0a77 6566 d1 pop de 6567 cdff4a call #4aff 656a eb ex de,hl 656b 210d00 ld hl,#000d 656e 39 add hl,sp 656f 73 ld (hl),e ' Led(Off) 6570 210000 ld hl,#0000 6573 e5 push hl 6574 cd770a call #0a77 6577 d1 pop de 6578 c3fb65 jp #65fb ' DisplayText("Don't press any key!", 150, 40, 1) 657b 210100 ld hl,#0001 657e e5 push hl 657f 2e28 ld l,#28 6581 e5 push hl 6582 2e96 ld l,#96 6584 e5 push hl 6585 2a3564 ld hl,(#6435) 6588 e5 push hl 6589 cd8d4c call #4c8d 658c 210800 ld hl,#0008 658f 39 add hl,sp 6590 f9 ld sp,hl ' DisplayText("Please put down equipment.", 150, 60, 1) 6591 210100 ld hl,#0001 6594 e5 push hl 6595 2e3c ld l,#3c 6597 e5 push hl 6598 2e96 ld l,#96 659a e5 push hl 659b 2a4c64 ld hl,(#644c) 659e e5 push hl 659f cd8d4c call #4c8d 65a2 210800 ld hl,#0008 65a5 39 add hl,sp 65a6 f9 ld sp,hl ' DisplayText("Skip: [S]", 150, 80, 1) 65a7 210100 ld hl,#0001 65aa e5 push hl 65ab 2e50 ld l,#50 65ad e5 push hl 65ae 2e96 ld l,#96 65b0 e5 push hl 65b1 2a6964 ld hl,(#6469) 65b4 e5 push hl 65b5 cd8d4c call #4c8d 65b8 210800 ld hl,#0008 65bb 39 add hl,sp 65bc f9 ld sp,hl 65bd cd7324 call #2473 65c0 216878 ld hl,#7868 65c3 e5 push hl 65c4 210100 ld hl,#0001 65c7 e5 push hl 65c8 cded05 call #05ed 65cb d1 pop de 65cc d1 pop de 65cd eb ex de,hl 65ce 210d00 ld hl,#000d 65d1 39 add hl,sp 65d2 73 ld (hl),e 65d3 1826 jr #65fb ; (38) 65d5 eb ex de,hl 65d6 23 inc hl 65d7 23 inc hl 65d8 23 inc hl 65d9 3602 ld (hl),#02 65db 181e jr #65fb ; (30) 65dd 210600 ld hl,#0006 65e0 e5 push hl 65e1 cdf25f call #5ff2 65e4 d1 pop de 65e5 eb ex de,hl 65e6 210d00 ld hl,#000d 65e9 39 add hl,sp 65ea 73 ld (hl),e 65eb 180e jr #65fb ; (14) 65ed 210600 ld hl,#0006 65f0 e5 push hl 65f1 cde25d call #5de2 65f4 d1 pop de 65f5 eb ex de,hl 65f6 210d00 ld hl,#000d 65f9 39 add hl,sp 65fa 73 ld (hl),e 65fb 210a00 ld hl,#000a 65fe 39 add hl,sp 65ff e5 push hl 6600 6e ld l,(hl) 6601 23 inc hl 6602 eb ex de,hl 6603 e1 pop hl 6604 73 ld (hl),e 6605 210a00 ld hl,#000a 6608 39 add hl,sp 6609 7e ld a,(hl) 660a fe05 cp #05 660c 3844 jr c,#6652 ; (68) 660e 210100 ld hl,#0001 6611 e5 push hl 6612 21c171 ld hl,#71c1 6615 e5 push hl 6616 210100 ld hl,#0001 6619 e5 push hl 661a cded05 call #05ed 661d d1 pop de 661e d1 pop de 661f d1 pop de 6620 eb ex de,hl 6621 210d00 ld hl,#000d 6624 39 add hl,sp 6625 73 ld (hl),e ' DisplayText("FALSE" or "PASS", or "SKIP", 140, 100, 1) 6626 210100 ld hl,#0001 6629 e5 push hl 662a 2e64 ld l,#64 662c e5 push hl 662d 2e8c ld l,#8c 662f e5 push hl 6630 211300 ld hl,#0013 6633 39 add hl,sp 6634 5e ld e,(hl) 6635 1600 ld d,#00 6637 eb ex de,hl 6638 29 add hl,hl 6639 11ca64 ld de,#64ca 663c 19 add hl,de 663d 5e ld e,(hl) 663e 23 inc hl 663f 56 ld d,(hl) 6640 d5 push de 6641 cd8d4c call #4c8d 6644 210800 ld hl,#0008 6647 39 add hl,sp 6648 f9 ld sp,hl 6649 210d00 ld hl,#000d 664c 39 add hl,sp 664d 7e ld a,(hl) 664e b7 or a 664f 2869 jr z,#66ba ; (105) 6651 c9 ret 6652 217500 ld hl,#0075 6655 e5 push hl 6656 212b01 ld hl,#012b 6659 e5 push hl 665a 211f00 ld hl,#001f 665d e5 push hl 665e 2e8d ld l,#8d 6660 e5 push hl 6661 cd8a20 call #208a 6664 210800 ld hl,#0008 6667 39 add hl,sp 6668 f9 ld sp,hl ' DisplayText("FALSE" or "PASS" or "SKIP", 100, ?, 1) 6669 210100 ld hl,#0001 666c e5 push hl 666d 210b00 ld hl,#000b 6670 39 add hl,sp 6671 5e ld e,(hl) 6672 1600 ld d,#00 6674 d5 push de 6675 216400 ld hl,#0064 6678 e5 push hl 6679 211300 ld hl,#0013 667c 39 add hl,sp 667d 5e ld e,(hl) 667e eb ex de,hl 667f 29 add hl,hl 6680 11ca64 ld de,#64ca 6683 19 add hl,de 6684 5e ld e,(hl) 6685 23 inc hl 6686 56 ld d,(hl) 6687 d5 push de 6688 cd8d4c call #4c8d 668b 210800 ld hl,#0008 668e 39 add hl,sp 668f f9 ld sp,hl 6690 cd7324 call #2473 6693 210900 ld hl,#0009 6696 39 add hl,sp 6697 7e ld a,(hl) 6698 c610 add a,#10 669a 77 ld (hl),a 669b 210d00 ld hl,#000d 669e 39 add hl,sp 669f 7e ld a,(hl) 66a0 b7 or a 66a1 c2fb64 jp nz,#64fb ' DisplayText("Error!", 180, 60, 1) 66a4 210100 ld hl,#0001 66a7 e5 push hl 66a8 2e3c ld l,#3c 66aa e5 push hl 66ab 2eb4 ld l,#b4 66ad e5 push hl 66ae 2ae064 ld hl,(#64e0) 66b1 e5 push hl 66b2 cd8d4c call #4c8d 66b5 210800 ld hl,#0008 66b8 39 add hl,sp 66b9 f9 ld sp,hl 66ba cd7324 call #2473 66bd 210b00 ld hl,#000b 66c0 39 add hl,sp 66c1 e5 push hl 66c2 21f455 ld hl,#55f4 66c5 e5 push hl 66c6 210100 ld hl,#0001 66c9 e5 push hl 66ca cded05 call #05ed 66cd d1 pop de 66ce d1 pop de 66cf d1 pop de 66d0 210b00 ld hl,#000b 66d3 39 add hl,sp 66d4 5e ld e,(hl) 66d5 23 inc hl 66d6 56 ld d,(hl) 66d7 1b dec de 66d8 7a ld a,d 66d9 b3 or e 66da c8 ret z 66db 56 ld d,(hl) 66dc 2b dec hl 66dd 5e ld e,(hl) 66de 21a9ff ld hl,#ffa9 66e1 19 add hl,de 66e2 7c ld a,h 66e3 b5 or l 66e4 c8 ret z 66e5 18d6 jr #66bd ; (-42) 66e7 00 nop 66e8 00 nop 66e9 00 nop 66ea 00 nop 66eb 00 nop 66ec 00 nop 66ed 00 nop 66ee 00 nop 66ef 00 nop 66f0 00 nop 66f1 00 nop 66f2 40 ld b,b 66f3 00 nop 66f4 00 nop 66f5 00 nop 66f6 00 nop 66f7 60 ld h,b 66f8 313233 ld sp,#3332 66fb 34 inc (hl) 66fc 35 dec (hl) 66fd 3637 ld (hl),#37 66ff 3839 jr c,#673a ; (57) 6701 302d jr nc,#6730 ; (45) 6703 3d dec a 6704 00 nop 6705 5c ld e,h 6706 00 nop 6707 00 nop 6708 51 ld d,c 6709 57 ld d,a 670a 45 ld b,l 670b 52 ld d,d 670c 54 ld d,h 670d 59 ld e,c 670e 55 ld d,l 670f 49 ld c,c 6710 4f ld c,a 6711 50 ld d,b 6712 5b ld e,e 6713 5d ld e,l 6714 3b dec sp 6715 27 daa 6716 00 nop 6717 00 nop 6718 41 ld b,c 6719 53 ld d,e 671a 44 ld b,h 671b 46 ld b,(hl) 671c 47 ld b,a 671d 48 ld c,b 671e 4a ld c,d 671f 4b ld c,e 6720 4c ld c,h 6721 2c inc l 6722 2e2f ld l,#2f 6724 00 nop 6725 00 nop 6726 00 nop 6727 00 nop 6728 5a ld e,d 6729 58 ld e,b 672a 43 ld b,e 672b 56 ld d,(hl) 672c 42 ld b,d 672d 4e ld c,(hl) 672e 4d ld c,l 672f 00 nop 6730 00 nop 6731 00 nop 6732 2000 jr nz,#6734 ; (0) 6734 00 nop 6735 00 nop 6736 00 nop 6737 00 nop 6738 00 nop 6739 00 nop 673a 00 nop 673b 00 nop 673c 00 nop 673d 00 nop 673e 00 nop 673f 00 nop 6740 00 nop 6741 00 nop 6742 40 ld b,b 6743 00 nop 6744 00 nop 6745 00 nop 6746 00 nop 6747 7e ld a,(hl) 6748 214023 ld hl,#2340 674b 24 inc h 674c 25 dec h 674d 5e ld e,(hl) 674e 262a ld h,#2a 6750 2829 jr z,#677b ; (41) 6752 5f ld e,a 6753 2b dec hl 6754 00 nop 6755 7c ld a,h 6756 00 nop 6757 00 nop 6758 71 ld (hl),c 6759 77 ld (hl),a 675a 65 ld h,l 675b 72 ld (hl),d 675c 74 ld (hl),h 675d 79 ld a,c 675e 75 ld (hl),l 675f 69 ld l,c 6760 6f ld l,a 6761 70 ld (hl),b 6762 7b ld a,e 6763 7d ld a,l 6764 3a2200 ld a,(#0022) 6767 00 nop 6768 61 ld h,c 6769 73 ld (hl),e 676a 64 ld h,h 676b 66 ld h,(hl) 676c 67 ld h,a 676d 68 ld l,b 676e 6a ld l,d 676f 6b ld l,e 6770 6c ld l,h 6771 3c inc a 6772 3e3f ld a,#3f 6774 00 nop 6775 00 nop 6776 00 nop 6777 00 nop 6778 7a ld a,d 6779 78 ld a,b 677a 63 ld h,e 677b 76 halt 677c 62 ld h,d 677d 6e ld l,(hl) 677e 6d ld l,l 677f 00 nop 6780 00 nop 6781 00 nop 6782 2000 jr nz,#6784 ; (0) 6784 00 nop 6785 00 nop 6786 00 nop 6787 8967 6789 Modem Reset .....\0 679d a967 679f af67 67a1 b567 67a3 ba67 67a5 bf67 67a7 c467 67a9 38400\0 67af 19200\0 67b5 9600\0 67ba 7200\0 67bf 4800\0 67c4 2400\0 67c9 114cff ld de,#ff4c 67cc cd6b05 call #056b 67cf 21c200 ld hl,#00c2 67d2 39 add hl,sp 67d3 5e ld e,(hl) 67d4 23 inc hl 67d5 56 ld d,(hl) 67d6 d5 push de 67d7 210a00 ld hl,#000a 67da 39 add hl,sp 67db e5 push hl 67dc cdc605 call #05c6 67df d1 pop de 67e0 d1 pop de 67e1 21c400 ld hl,#00c4 67e4 39 add hl,sp 67e5 5e ld e,(hl) 67e6 1600 ld d,#00 67e8 d5 push de 67e9 210a00 ld hl,#000a 67ec 39 add hl,sp 67ed e5 push hl 67ee 21c400 ld hl,#00c4 67f1 39 add hl,sp 67f2 5e ld e,(hl) 67f3 23 inc hl 67f4 56 ld d,(hl) 67f5 d5 push de 67f6 cd7a1e call #1e7a 67f9 d1 pop de 67fa d1 pop de 67fb d1 pop de 67fc c9 ret 67fd 112cff ld de,#ff2c 6800 cd6b05 call #056b 6803 21b300 ld hl,#00b3 6806 39 add hl,sp 6807 3600 ld (hl),#00 6809 2b dec hl 680a 3601 ld (hl),#01 680c 21ae00 ld hl,#00ae 680f 39 add hl,sp 6810 3601 ld (hl),#01 6812 cd850a call #0a85 6815 215e00 ld hl,#005e 6818 39 add hl,sp 6819 3600 ld (hl),#00 681b 2b dec hl 681c 3600 ld (hl),#00 681e 21bd00 ld hl,#00bd 6821 39 add hl,sp 6822 3631 ld (hl),#31 6824 23 inc hl 6825 3632 ld (hl),#32 6827 23 inc hl 6828 3600 ld (hl),#00 682a 210900 ld hl,#0009 682d 39 add hl,sp 682e 3600 ld (hl),#00 6830 23 inc hl 6831 3600 ld (hl),#00 6833 210000 ld hl,#0000 6836 e5 push hl 6837 21b800 ld hl,#00b8 683a 39 add hl,sp 683b e5 push hl 683c 21c100 ld hl,#00c1 683f 39 add hl,sp 6840 e5 push hl 6841 210000 ld hl,#0000 6844 e5 push hl 6845 cde06d call #6de0 6848 210800 ld hl,#0008 684b 39 add hl,sp 684c f9 ld sp,hl 684d 21d600 ld hl,#00d6 6850 39 add hl,sp 6851 3640 ld (hl),#40 6853 23 inc hl 6854 3601 ld (hl),#01 6856 23 inc hl 6857 3680 ld (hl),#80 6859 23 inc hl 685a 3600 ld (hl),#00 685c 23 inc hl 685d 3600 ld (hl),#00 685f cdea35 call #35ea 6862 cdf435 call #35f4 6865 c22c69 jp nz,#692c 6868 21b100 ld hl,#00b1 686b 39 add hl,sp 686c e5 push hl 686d cdce35 call #35ce 6870 d1 pop de 6871 21b100 ld hl,#00b1 6874 39 add hl,sp 6875 7e ld a,(hl) 6876 fe20 cp #20 6878 3804 jr c,#687e ; (4) 687a fe80 cp #80 687c 3806 jr c,#6884 ; (6) 687e 21b100 ld hl,#00b1 6881 39 add hl,sp 6882 362e ld (hl),#2e 6884 210900 ld hl,#0009 6887 39 add hl,sp 6888 1600 ld d,#00 688a 7e ld a,(hl) 688b fe29 cp #29 688d 3849 jr c,#68d8 ; (73) 688f 216400 ld hl,#0064 6892 e5 push hl 6893 214001 ld hl,#0140 6896 e5 push hl 6897 215000 ld hl,#0050 689a e5 push hl 689b 6c ld l,h 689c e5 push hl 689d cd8a20 call #208a 68a0 210800 ld hl,#0008 68a3 39 add hl,sp 68a4 f9 ld sp,hl 68a5 21d200 ld hl,#00d2 68a8 39 add hl,sp 68a9 3600 ld (hl),#00 68ab 23 inc hl 68ac 3600 ld (hl),#00 68ae 23 inc hl 68af 3650 ld (hl),#50 68b1 23 inc hl 68b2 3600 ld (hl),#00 68b4 210a00 ld hl,#000a 68b7 39 add hl,sp 68b8 e5 push hl 68b9 cdcc05 call #05cc 68bc d1 pop de 68bd 2600 ld h,#00 68bf e5 push hl 68c0 210c00 ld hl,#000c 68c3 39 add hl,sp 68c4 e5 push hl 68c5 21d600 ld hl,#00d6 68c8 39 add hl,sp 68c9 e5 push hl 68ca cdc967 call #67c9 68cd d1 pop de 68ce d1 pop de 68cf d1 pop de 68d0 110000 ld de,#0000 68d3 210900 ld hl,#0009 68d6 39 add hl,sp 68d7 73 ld (hl),e 68d8 21b100 ld hl,#00b1 68db 39 add hl,sp 68dc 5e ld e,(hl) 68dd d5 push de 68de 210b00 ld hl,#000b 68e1 39 add hl,sp 68e2 5e ld e,(hl) 68e3 23 inc hl 68e4 19 add hl,de 68e5 d1 pop de 68e6 73 ld (hl),e 68e7 210900 ld hl,#0009 68ea 39 add hl,sp 68eb e5 push hl 68ec 6e ld l,(hl) 68ed 23 inc hl 68ee eb ex de,hl 68ef e1 pop hl 68f0 73 ld (hl),e 68f1 210900 ld hl,#0009 68f4 39 add hl,sp 68f5 5e ld e,(hl) 68f6 1600 ld d,#00 68f8 23 inc hl 68f9 19 add hl,de 68fa 72 ld (hl),d 68fb 21d200 ld hl,#00d2 68fe 39 add hl,sp 68ff 3600 ld (hl),#00 6901 23 inc hl 6902 3600 ld (hl),#00 6904 23 inc hl 6905 365a ld (hl),#5a 6907 23 inc hl 6908 3600 ld (hl),#00 690a 210a00 ld hl,#000a 690d 39 add hl,sp 690e e5 push hl 690f cdcc05 call #05cc 6912 d1 pop de 6913 2600 ld h,#00 6915 e5 push hl 6916 210c00 ld hl,#000c 6919 39 add hl,sp 691a e5 push hl 691b 21d600 ld hl,#00d6 691e 39 add hl,sp 691f e5 push hl 6920 cdc967 call #67c9 6923 d1 pop de 6924 d1 pop de 6925 d1 pop de 6926 cd7324 call #2473 6929 c36268 jp #6862 692c 21b200 ld hl,#00b2 692f 39 add hl,sp 6930 7e ld a,(hl) 6931 b7 or a 6932 cafa69 jp z,#69fa 6935 3d dec a 6936 2807 jr z,#693f ; (7) 6938 d604 sub #04 693a 285a jr z,#6996 ; (90) 693c c3f469 jp #69f4 693f 21d200 ld hl,#00d2 6942 39 add hl,sp 6943 3650 ld (hl),#50 6945 23 inc hl 6946 3600 ld (hl),#00 6948 23 inc hl 6949 3632 ld (hl),#32 694b 23 inc hl 694c 3600 ld (hl),#00 694e 210100 ld hl,#0001 6951 e5 push hl 6952 cd0d6d call #6d0d 6955 d1 pop de 6956 cdc26e call #6ec2 6959 2a8767 ld hl,(#6787) 695c e5 push hl 695d cdcc05 call #05cc 6960 d1 pop de 6961 2600 ld h,#00 6963 e5 push hl 6964 2a8767 ld hl,(#6787) 6967 e5 push hl 6968 21d600 ld hl,#00d6 696b 39 add hl,sp 696c e5 push hl 696d cdc967 call #67c9 6970 d1 pop de 6971 d1 pop de 6972 d1 pop de 6973 cd7324 call #2473 6976 cd6308 call #0863 6979 cdc26e call #6ec2 697c 21b300 ld hl,#00b3 697f 39 add hl,sp 6980 5e ld e,(hl) 6981 1600 ld d,#00 6983 d5 push de 6984 cd0d6d call #6d0d 6987 d1 pop de 6988 215d00 ld hl,#005d 698b 39 add hl,sp 698c 3600 ld (hl),#00 698e 210900 ld hl,#0009 6991 39 add hl,sp 6992 3600 ld (hl),#00 6994 185e jr #69f4 ; (94) 6996 210500 ld hl,#0005 6999 e5 push hl 699a cd0d6d call #6d0d 699d d1 pop de 699e cdc26e call #6ec2 69a1 213200 ld hl,#0032 69a4 e5 push hl 69a5 2e50 ld l,#50 69a7 e5 push hl 69a8 cd1c78 call #781c 69ab d1 pop de 69ac d1 pop de 69ad eb ex de,hl 69ae 21b400 ld hl,#00b4 69b1 39 add hl,sp 69b2 73 ld (hl),e 69b3 23 inc hl 69b4 72 ld (hl),d 69b5 2b dec hl 69b6 5e ld e,(hl) 69b7 eb ex de,hl 69b8 7e ld a,(hl) 69b9 b7 or a 69ba 280e jr z,#69ca ; (14) 69bc eb ex de,hl 69bd 23 inc hl 69be 56 ld d,(hl) 69bf d5 push de 69c0 21bf00 ld hl,#00bf 69c3 39 add hl,sp 69c4 e5 push hl 69c5 cdc605 call #05c6 69c8 d1 pop de 69c9 d1 pop de 69ca 210000 ld hl,#0000 69cd e5 push hl 69ce 21b800 ld hl,#00b8 69d1 39 add hl,sp 69d2 e5 push hl 69d3 21c100 ld hl,#00c1 69d6 39 add hl,sp 69d7 e5 push hl 69d8 21b900 ld hl,#00b9 69db 39 add hl,sp 69dc 5e ld e,(hl) 69dd 1600 ld d,#00 69df d5 push de 69e0 cde06d call #6de0 69e3 210800 ld hl,#0008 69e6 39 add hl,sp 69e7 f9 ld sp,hl 69e8 215d00 ld hl,#005d 69eb 39 add hl,sp 69ec 3600 ld (hl),#00 69ee 210900 ld hl,#0009 69f1 39 add hl,sp 69f2 3600 ld (hl),#00 69f4 21b200 ld hl,#00b2 69f7 39 add hl,sp 69f8 3600 ld (hl),#00 69fa cd0d7a call #7a0d 69fd eb ex de,hl 69fe 21db00 ld hl,#00db 6a01 39 add hl,sp 6a02 73 ld (hl),e 6a03 7b ld a,e 6a04 feff cp #ff 6a06 ca6268 jp z,#6862 6a09 21b300 ld hl,#00b3 6a0c 39 add hl,sp 6a0d 7e ld a,(hl) 6a0e b7 or a 6a0f c26268 jp nz,#6862 6a12 21db00 ld hl,#00db 6a15 39 add hl,sp 6a16 7e ld a,(hl) 6a17 3d dec a 6a18 cad46a jp z,#6ad4 6a1b d602 sub #02 6a1d 280e jr z,#6a2d ; (14) 6a1f 3d dec a 6a20 2814 jr z,#6a36 ; (20) 6a22 3d dec a 6a23 285b jr z,#6a80 ; (91) 6a25 d602 sub #02 6a27 cacb6a jp z,#6acb 6a2a c3d86a jp #6ad8 6a2d 21b200 ld hl,#00b2 6a30 39 add hl,sp 6a31 3601 ld (hl),#01 6a33 c36268 jp #6862 6a36 210200 ld hl,#0002 6a39 e5 push hl 6a3a cd0d6d call #6d0d 6a3d d1 pop de 6a3e cdc26e call #6ec2 6a41 21e000 ld hl,#00e0 6a44 39 add hl,sp 6a45 5e ld e,(hl) 6a46 1600 ld d,#00 6a48 d5 push de 6a49 62 ld h,d 6a4a 6a ld l,d 6a4b e5 push hl 6a4c 21c100 ld hl,#00c1 6a4f 39 add hl,sp 6a50 e5 push hl 6a51 cd6b6f call #6f6b 6a54 d1 pop de 6a55 d1 pop de 6a56 d1 pop de 6a57 eb ex de,hl 6a58 21b100 ld hl,#00b1 6a5b 39 add hl,sp 6a5c 73 ld (hl),e 6a5d 7b ld a,e 6a5e fe03 cp #03 6a60 2003 jr nz,#6a65 ; (3) 6a62 23 inc hl 6a63 3601 ld (hl),#01 6a65 21b300 ld hl,#00b3 6a68 39 add hl,sp 6a69 5e ld e,(hl) 6a6a 1600 ld d,#00 6a6c d5 push de 6a6d cd0d6d call #6d0d 6a70 d1 pop de 6a71 215d00 ld hl,#005d 6a74 39 add hl,sp 6a75 3600 ld (hl),#00 6a77 210900 ld hl,#0009 6a7a 39 add hl,sp 6a7b 3600 ld (hl),#00 6a7d c36268 jp #6862 6a80 210300 ld hl,#0003 6a83 e5 push hl 6a84 cd0d6d call #6d0d 6a87 d1 pop de 6a88 cdc26e call #6ec2 6a8b 21e000 ld hl,#00e0 6a8e 39 add hl,sp 6a8f 5e ld e,(hl) 6a90 1600 ld d,#00 6a92 d5 push de 6a93 210100 ld hl,#0001 6a96 e5 push hl 6a97 21c100 ld hl,#00c1 6a9a 39 add hl,sp 6a9b e5 push hl 6a9c cd6b6f call #6f6b 6a9f d1 pop de 6aa0 d1 pop de 6aa1 d1 pop de 6aa2 eb ex de,hl 6aa3 21b100 ld hl,#00b1 6aa6 39 add hl,sp 6aa7 73 ld (hl),e 6aa8 7b ld a,e 6aa9 fe03 cp #03 6aab 2003 jr nz,#6ab0 ; (3) 6aad 23 inc hl 6aae 3601 ld (hl),#01 6ab0 21b300 ld hl,#00b3 6ab3 39 add hl,sp 6ab4 5e ld e,(hl) 6ab5 1600 ld d,#00 6ab7 d5 push de 6ab8 cd0d6d call #6d0d 6abb d1 pop de 6abc 215d00 ld hl,#005d 6abf 39 add hl,sp 6ac0 3600 ld (hl),#00 6ac2 210900 ld hl,#0009 6ac5 39 add hl,sp 6ac6 3600 ld (hl),#00 6ac8 c36268 jp #6862 6acb 21b200 ld hl,#00b2 6ace 39 add hl,sp 6acf 3605 ld (hl),#05 6ad1 c36268 jp #6862 6ad4 210100 ld hl,#0001 6ad7 c9 ret 6ad8 21db00 ld hl,#00db 6adb 39 add hl,sp 6adc 7e ld a,(hl) 6add fe57 cp #57 6adf c26e6b jp nz,#6b6e 6ae2 215d00 ld hl,#005d 6ae5 39 add hl,sp 6ae6 7e ld a,(hl) 6ae7 b7 or a 6ae8 ca6268 jp z,#6862 6aeb 21d200 ld hl,#00d2 6aee 39 add hl,sp 6aef 3600 ld (hl),#00 6af1 23 inc hl 6af2 3600 ld (hl),#00 6af4 23 inc hl 6af5 361e ld (hl),#1e 6af7 23 inc hl 6af8 3600 ld (hl),#00 6afa 213200 ld hl,#0032 6afd e5 push hl 6afe 214001 ld hl,#0140 6b01 e5 push hl 6b02 211e00 ld hl,#001e 6b05 e5 push hl 6b06 6c ld l,h 6b07 e5 push hl 6b08 cd8a20 call #208a 6b0b 210800 ld hl,#0008 6b0e 39 add hl,sp 6b0f f9 ld sp,hl 6b10 215d00 ld hl,#005d 6b13 39 add hl,sp 6b14 5e ld e,(hl) 6b15 1600 ld d,#00 6b17 d5 push de 6b18 23 inc hl 6b19 e5 push hl 6b1a 21d600 ld hl,#00d6 6b1d 39 add hl,sp 6b1e e5 push hl 6b1f cdc967 call #67c9 6b22 d1 pop de 6b23 d1 pop de 6b24 d1 pop de 6b25 cd7324 call #2473 6b28 21956c ld hl,#6c95 6b2b e5 push hl 6b2c 216000 ld hl,#0060 6b2f 39 add hl,sp 6b30 e5 push hl 6b31 cdcf05 call #05cf 6b34 d1 pop de 6b35 d1 pop de 6b36 2816 jr z,#6b4e ; (22) 6b38 215d00 ld hl,#005d 6b3b 39 add hl,sp 6b3c 5e ld e,(hl) 6b3d 1600 ld d,#00 6b3f 23 inc hl 6b40 19 add hl,de 6b41 1e0d ld e,#0d 6b43 73 ld (hl),e 6b44 215d00 ld hl,#005d 6b47 39 add hl,sp 6b48 e5 push hl 6b49 6e ld l,(hl) 6b4a 23 inc hl 6b4b eb ex de,hl 6b4c e1 pop hl 6b4d 73 ld (hl),e 6b4e 215d00 ld hl,#005d 6b51 39 add hl,sp 6b52 5e ld e,(hl) 6b53 1600 ld d,#00 6b55 23 inc hl 6b56 19 add hl,de 6b57 72 ld (hl),d 6b58 215d00 ld hl,#005d 6b5b 39 add hl,sp 6b5c 5e ld e,(hl) 6b5d d5 push de 6b5e 23 inc hl 6b5f e5 push hl 6b60 cd8108 call #0881 6b63 d1 pop de 6b64 d1 pop de 6b65 215d00 ld hl,#005d 6b68 39 add hl,sp 6b69 3600 ld (hl),#00 6b6b c36268 jp #6862 6b6e fe35 cp #35 6b70 2058 jr nz,#6bca ; (88) 6b72 215d00 ld hl,#005d 6b75 39 add hl,sp 6b76 7e ld a,(hl) 6b77 b7 or a 6b78 2806 jr z,#6b80 ; (6) 6b7a e5 push hl 6b7b 6e ld l,(hl) 6b7c 2b dec hl 6b7d eb ex de,hl 6b7e e1 pop hl 6b7f 73 ld (hl),e 6b80 215d00 ld hl,#005d 6b83 39 add hl,sp 6b84 5e ld e,(hl) 6b85 1600 ld d,#00 6b87 23 inc hl 6b88 19 add hl,de 6b89 72 ld (hl),d 6b8a 213200 ld hl,#0032 6b8d e5 push hl 6b8e 214001 ld hl,#0140 6b91 e5 push hl 6b92 212800 ld hl,#0028 6b95 e5 push hl 6b96 6c ld l,h 6b97 e5 push hl 6b98 cd8a20 call #208a 6b9b 210800 ld hl,#0008 6b9e 39 add hl,sp 6b9f f9 ld sp,hl 6ba0 21d200 ld hl,#00d2 6ba3 39 add hl,sp 6ba4 3600 ld (hl),#00 6ba6 23 inc hl 6ba7 3600 ld (hl),#00 6ba9 23 inc hl 6baa 3628 ld (hl),#28 6bac 23 inc hl 6bad 3600 ld (hl),#00 6baf 215d00 ld hl,#005d 6bb2 39 add hl,sp 6bb3 5e ld e,(hl) 6bb4 1600 ld d,#00 6bb6 d5 push de 6bb7 23 inc hl 6bb8 e5 push hl 6bb9 21d600 ld hl,#00d6 6bbc 39 add hl,sp 6bbd e5 push hl 6bbe cdc967 call #67c9 6bc1 d1 pop de 6bc2 d1 pop de 6bc3 d1 pop de 6bc4 cd7324 call #2473 6bc7 c36268 jp #6862 6bca e6f0 and #f0 6bcc 1f rra 6bcd 1f rra 6bce 1f rra 6bcf 1f rra 6bd0 e60f and #0f 6bd2 215c00 ld hl,#005c 6bd5 39 add hl,sp 6bd6 77 ld (hl),a 6bd7 21db00 ld hl,#00db 6bda 39 add hl,sp 6bdb 7e ld a,(hl) 6bdc e60f and #0f 6bde 215b00 ld hl,#005b 6be1 39 add hl,sp 6be2 77 ld (hl),a 6be3 3a58f6 ld a,(#f658) 6be6 b7 or a 6be7 2818 jr z,#6c01 ; (24) 6be9 5e ld e,(hl) 6bea 1600 ld d,#00 6bec d5 push de 6bed 23 inc hl 6bee 5e ld e,(hl) 6bef eb ex de,hl 6bf0 29 add hl,hl 6bf1 29 add hl,hl 6bf2 29 add hl,hl 6bf3 d1 pop de 6bf4 19 add hl,de 6bf5 113767 ld de,#6737 6bf8 19 add hl,de 6bf9 5e ld e,(hl) 6bfa 21db00 ld hl,#00db 6bfd 39 add hl,sp 6bfe 73 ld (hl),e 6bff 1816 jr #6c17 ; (22) 6c01 5e ld e,(hl) 6c02 1600 ld d,#00 6c04 d5 push de 6c05 23 inc hl 6c06 5e ld e,(hl) 6c07 eb ex de,hl 6c08 29 add hl,hl 6c09 29 add hl,hl 6c0a 29 add hl,hl 6c0b d1 pop de 6c0c 19 add hl,de 6c0d 11e766 ld de,#66e7 6c10 19 add hl,de 6c11 5e ld e,(hl) 6c12 21db00 ld hl,#00db 6c15 39 add hl,sp 6c16 73 ld (hl),e 6c17 21db00 ld hl,#00db 6c1a 39 add hl,sp 6c1b 7e ld a,(hl) 6c1c fe20 cp #20 6c1e da6268 jp c,#6862 6c21 fe80 cp #80 6c23 d26268 jp nc,#6862 6c26 215d00 ld hl,#005d 6c29 39 add hl,sp 6c2a 1600 ld d,#00 6c2c 7e ld a,(hl) 6c2d fe4b cp #4b 6c2f ca6268 jp z,#6862 6c32 21db00 ld hl,#00db 6c35 39 add hl,sp 6c36 5e ld e,(hl) 6c37 d5 push de 6c38 215f00 ld hl,#005f 6c3b 39 add hl,sp 6c3c 5e ld e,(hl) 6c3d 23 inc hl 6c3e 19 add hl,de 6c3f d1 pop de 6c40 73 ld (hl),e 6c41 215d00 ld hl,#005d 6c44 39 add hl,sp 6c45 e5 push hl 6c46 6e ld l,(hl) 6c47 23 inc hl 6c48 eb ex de,hl 6c49 e1 pop hl 6c4a 73 ld (hl),e 6c4b 215d00 ld hl,#005d 6c4e 39 add hl,sp 6c4f 5e ld e,(hl) 6c50 1600 ld d,#00 6c52 23 inc hl 6c53 19 add hl,de 6c54 72 ld (hl),d 6c55 213200 ld hl,#0032 6c58 e5 push hl 6c59 214001 ld hl,#0140 6c5c e5 push hl 6c5d 212800 ld hl,#0028 6c60 e5 push hl 6c61 6c ld l,h 6c62 e5 push hl 6c63 cd8a20 call #208a 6c66 210800 ld hl,#0008 6c69 39 add hl,sp 6c6a f9 ld sp,hl 6c6b 21d200 ld hl,#00d2 6c6e 39 add hl,sp 6c6f 3600 ld (hl),#00 6c71 23 inc hl 6c72 3600 ld (hl),#00 6c74 23 inc hl 6c75 3628 ld (hl),#28 6c77 23 inc hl 6c78 3600 ld (hl),#00 6c7a 215d00 ld hl,#005d 6c7d 39 add hl,sp 6c7e 5e ld e,(hl) 6c7f 1600 ld d,#00 6c81 d5 push de 6c82 23 inc hl 6c83 e5 push hl 6c84 21d600 ld hl,#00d6 6c87 39 add hl,sp 6c88 e5 push hl 6c89 cdc967 call #67c9 6c8c d1 pop de 6c8d d1 pop de 6c8e d1 pop de 6c8f cd7324 call #2473 6c92 c36268 jp #6862 6c95 +++\0 6c99 a76c 6c9b a96c 6c9d b46c 6c9f c26c 6ca1 d16c 6ca3 df6c 6ca5 f06c 6ca7 \0 'Space Null 6ca9 - Reset\0 6cb4 - EMI Test\0 6cc2 - Loop Test\0 6cd1 - TAS Test\0 6cdf - Edit Number\0 6cf0 - Baud Rate\0 6cff 016d 6d01 Modem Test\0 6d0d 11b0ff ld de,#ffb0 6d10 cd6b05 call #056b 6d13 210b00 ld hl,#000b 6d16 e5 push hl 6d17 214001 ld hl,#0140 6d1a e5 push hl 6d1b 210000 ld hl,#0000 6d1e e5 push hl 6d1f e5 push hl 6d20 cd8a20 call #208a 6d23 210800 ld hl,#0008 6d26 39 add hl,sp 6d27 f9 ld sp,hl 6d28 2aff6c ld hl,(#6cff) 6d2b e5 push hl 6d2c 210a00 ld hl,#000a 6d2f 39 add hl,sp 6d30 e5 push hl 6d31 cdc605 call #05c6 6d34 d1 pop de 6d35 d1 pop de 6d36 215c00 ld hl,#005c 6d39 39 add hl,sp 6d3a 5e ld e,(hl) 6d3b 1600 ld d,#00 6d3d eb ex de,hl 6d3e 29 add hl,hl 6d3f 11996c ld de,#6c99 6d42 19 add hl,de 6d43 5e ld e,(hl) 6d44 23 inc hl 6d45 56 ld d,(hl) 6d46 d5 push de 6d47 210a00 ld hl,#000a 6d4a 39 add hl,sp 6d4b e5 push hl 6d4c cdba05 call #05ba 6d4f d1 pop de 6d50 d1 pop de ' DisplayText(???, 100, 2, 0) 6d51 210000 ld hl,#0000 6d54 e5 push hl 6d55 2e02 ld l,#02 6d57 e5 push hl 6d58 2e64 ld l,#64 6d5a e5 push hl 6d5b 210e00 ld hl,#000e 6d5e 39 add hl,sp 6d5f e5 push hl 6d60 cd8d4c call #4c8d 6d63 210800 ld hl,#0008 6d66 39 add hl,sp 6d67 f9 ld sp,hl 6d68 210b00 ld hl,#000b 6d6b e5 push hl 6d6c 214001 ld hl,#0140 6d6f e5 push hl 6d70 210000 ld hl,#0000 6d73 e5 push hl 6d74 e5 push hl 6d75 cdee21 call #21ee 6d78 210800 ld hl,#0008 6d7b 39 add hl,sp 6d7c f9 ld sp,hl 6d7d cd7324 call #2473 6d80 c9 ret 6d81 836d 6d83 F1- Reset\0 6d8d 8f6d 6d8f F2- EMI Test\0 6d9c 9e6d 6d9e F3- Loop Test\0 6dac ae6d 6dae F4- TAS Baud Rate : \0 6dc3 c56d 6dc5 F5- Number : \0 6dd3 d56d 6dd5 Back- Exit\0 6de0 11a7ff ld de,#ffa7 6de3 cd6b05 call #056b 6de6 216500 ld hl,#0065 6de9 39 add hl,sp 6dea 5e ld e,(hl) 6deb 1600 ld d,#00 6ded d5 push de 6dee cd0d6d call #6d0d 6df1 d1 pop de 6df2 218000 ld hl,#0080 6df5 e5 push hl 6df6 214001 ld hl,#0140 6df9 e5 push hl 6dfa 216800 ld hl,#0068 6dfd e5 push hl 6dfe 6c ld l,h 6dff e5 push hl 6e00 cd8a20 call #208a 6e03 210800 ld hl,#0008 6e06 39 add hl,sp 6e07 f9 ld sp,hl 6e08 214001 ld hl,#0140 6e0b e5 push hl 6e0c 216800 ld hl,#0068 6e0f e5 push hl 6e10 6c ld l,h 6e11 e5 push hl 6e12 cdd123 call #23d1 6e15 d1 pop de 6e16 d1 pop de 6e17 d1 pop de ' DisplayText("F1- Reset", 6, 108, 0) 6e18 210000 ld hl,#0000 6e1b e5 push hl 6e1c 2e6c ld l,#6c 6e1e e5 push hl 6e1f 2e06 ld l,#06 6e21 e5 push hl 6e22 2a816d ld hl,(#6d81) 6e25 e5 push hl 6e26 cd8d4c call #4c8d 6e29 210800 ld hl,#0008 6e2c 39 add hl,sp 6e2d f9 ld sp,hl ' DisplayText("Back- Exit", 4, 118, 0) 6e2e 210000 ld hl,#0000 6e31 e5 push hl 6e32 2e76 ld l,#76 6e34 e5 push hl 6e35 2e04 ld l,#04 6e37 e5 push hl 6e38 2ad36d ld hl,(#6dd3) 6e3b e5 push hl 6e3c cd8d4c call #4c8d 6e3f 210800 ld hl,#0008 6e42 39 add hl,sp 6e43 f9 ld sp,hl ' DisplayText("F2- EMI Test", 80, 108, 0) 6e44 210000 ld hl,#0000 6e47 e5 push hl 6e48 2e6c ld l,#6c 6e4a e5 push hl 6e4b 2e50 ld l,#50 6e4d e5 push hl 6e4e 2a8d6d ld hl,(#6d8d) 6e51 e5 push hl 6e52 cd8d4c call #4c8d 6e55 210800 ld hl,#0008 6e58 39 add hl,sp 6e59 f9 ld sp,hl ' DisplayText("F3- Loop Test", 80, 118, 0) 6e5a 210000 ld hl,#0000 6e5d e5 push hl 6e5e 2e76 ld l,#76 6e60 e5 push hl 6e61 2e50 ld l,#50 6e63 e5 push hl 6e64 2a9c6d ld hl,(#6d9c) 6e67 e5 push hl 6e68 cd8d4c call #4c8d 6e6b 210800 ld hl,#0008 6e6e 39 add hl,sp 6e6f f9 ld sp,hl ' "F5- Number : " 6e70 2ac36d ld hl,(#6dc3) 6e73 e5 push hl 6e74 211300 ld hl,#0013 6e77 39 add hl,sp 6e78 e5 push hl 6e79 cdc605 call #05c6 6e7c d1 pop de 6e7d d1 pop de 6e7e 216700 ld hl,#0067 6e81 39 add hl,sp 6e82 5e ld e,(hl) 6e83 23 inc hl 6e84 56 ld d,(hl) 6e85 d5 push de 6e86 211300 ld hl,#0013 6e89 39 add hl,sp 6e8a e5 push hl 6e8b cdba05 call #05ba 6e8e d1 pop de 6e8f d1 pop de 6e90 217f00 ld hl,#007f 6e93 e5 push hl 6e94 213f01 ld hl,#013f 6e97 e5 push hl 6e98 217600 ld hl,#0076 6e9b e5 push hl 6e9c 2ea0 ld l,#a0 6e9e e5 push hl 6e9f cd8a20 call #208a 6ea2 210800 ld hl,#0008 6ea5 39 add hl,sp 6ea6 f9 ld sp,hl ' DisplayText(?, 23, 118, 0) 6ea7 210000 ld hl,#0000 6eaa e5 push hl 6eab 2e76 ld l,#76 6ead e5 push hl 6eae 2ea0 ld l,#a0 6eb0 e5 push hl 6eb1 211700 ld hl,#0017 6eb4 39 add hl,sp 6eb5 e5 push hl 6eb6 cd8d4c call #4c8d 6eb9 210800 ld hl,#0008 6ebc 39 add hl,sp 6ebd f9 ld sp,hl 6ebe cd7324 call #2473 6ec1 c9 ret 6ec2 216700 ld hl,#0067 6ec5 e5 push hl 6ec6 214001 ld hl,#0140 6ec9 e5 push hl 6eca 210c00 ld hl,#000c 6ecd e5 push hl 6ece 6c ld l,h 6ecf e5 push hl 6ed0 cd8a20 call #208a 6ed3 210800 ld hl,#0008 6ed6 39 add hl,sp 6ed7 f9 ld sp,hl 6ed8 cd7324 call #2473 6edb c9 ret 6edc de6e 6ede > Dialling\0 6ee9 eb6e 6eeb > Connect Ok\0 6ef8 fa6e 6efa > Disconnect\0 6f07 096f 6f09 Send\0 6f0e 106f 6f10 Receive\0 6f18 1a6f 6f1a > Sending\0 6f24 266f 6f26 >> Checksum Error !!!\0 6f3d 3f6f 6f3f >> Overtime !!!\0 6f50 526f 6f52 > User Break\0 6f5f 616f 6f61 > Hang Up\0 6f6b 11a0ff ld de,#ffa0 6f6e cd6b05 call #056b 6f71 215000 ld hl,#0050 6f74 39 add hl,sp 6f75 3600 ld (hl),#00 6f77 23 inc hl 6f78 3600 ld (hl),#00 6f7a 2b dec hl 6f7b 2b dec hl 6f7c 3600 ld (hl),#00 6f7e 2b dec hl 6f7f 3600 ld (hl),#00 6f81 216300 ld hl,#0063 6f84 39 add hl,sp 6f85 3640 ld (hl),#40 6f87 23 inc hl 6f88 3601 ld (hl),#01 6f8a 23 inc hl 6f8b 3680 ld (hl),#80 6f8d 23 inc hl 6f8e 3600 ld (hl),#00 6f90 23 inc hl 6f91 3600 ld (hl),#00 ' DisplayText("> Dialling", 0, 20, 0) 6f93 210000 ld hl,#0000 6f96 e5 push hl 6f97 2e14 ld l,#14 6f99 e5 push hl 6f9a 6c ld l,h 6f9b e5 push hl 6f9c 2adc6e ld hl,(#6edc) 6f9f e5 push hl 6fa0 cd8d4c call #4c8d 6fa3 210800 ld hl,#0008 6fa6 39 add hl,sp 6fa7 f9 ld sp,hl ' DisplayText(?, 43, 20, 0) 6fa8 210000 ld hl,#0000 6fab e5 push hl 6fac 2e14 ld l,#14 6fae e5 push hl 6faf 2e2b ld l,#2b 6fb1 e5 push hl 6fb2 217200 ld hl,#0072 6fb5 39 add hl,sp 6fb6 5e ld e,(hl) 6fb7 23 inc hl 6fb8 56 ld d,(hl) 6fb9 d5 push de 6fba cd8d4c call #4c8d 6fbd 210800 ld hl,#0008 6fc0 39 add hl,sp 6fc1 f9 ld sp,hl 6fc2 cd7324 call #2473 6fc5 210000 ld hl,#0000 6fc8 222de6 ld (#e62d),hl 6fcb 222fe6 ld (#e62f),hl 6fce 212475 ld hl,#7524 6fd1 e5 push hl 6fd2 211400 ld hl,#0014 6fd5 39 add hl,sp 6fd6 e5 push hl 6fd7 cdc605 call #05c6 6fda d1 pop de 6fdb d1 pop de 6fdc 211200 ld hl,#0012 6fdf 39 add hl,sp 6fe0 e5 push hl 6fe1 cdcc05 call #05cc 6fe4 d1 pop de 6fe5 e5 push hl 6fe6 211400 ld hl,#0014 6fe9 39 add hl,sp 6fea e5 push hl 6feb cd8108 call #0881 6fee d1 pop de 6fef d1 pop de 6ff0 210a00 ld hl,#000a 6ff3 39 add hl,sp 6ff4 e5 push hl 6ff5 215ed4 ld hl,#d45e 6ff8 cd2402 call #0224 6ffb e1 pop hl 6ffc cd2f02 call #022f 6fff 210800 ld hl,#0008 7002 39 add hl,sp 7003 3600 ld (hl),#00 7005 23 inc hl 7006 3600 ld (hl),#00 7008 cd6908 call #0869 700b 201e jr nz,#702b ; (30) 700d cd6f08 call #086f 7010 e5 push hl 7011 210a00 ld hl,#000a 7014 39 add hl,sp 7015 5e ld e,(hl) 7016 1600 ld d,#00 7018 211400 ld hl,#0014 701b 39 add hl,sp 701c 19 add hl,de 701d d1 pop de 701e 73 ld (hl),e 701f 210800 ld hl,#0008 7022 39 add hl,sp 7023 e5 push hl 7024 6e ld l,(hl) 7025 23 inc hl 7026 eb ex de,hl 7027 e1 pop hl 7028 73 ld (hl),e 7029 18dd jr #7008 ; (-35) 702b 210800 ld hl,#0008 702e 39 add hl,sp 702f 7e ld a,(hl) 7030 fe1d cp #1d 7032 3066 jr nc,#709a ; (102) 7034 23 inc hl 7035 7e ld a,(hl) 7036 fe03 cp #03 7038 3060 jr nc,#709a ; (96) 703a 215ed4 ld hl,#d45e 703d cd2402 call #0224 7040 210a00 ld hl,#000a 7043 39 add hl,sp 7044 cd1802 call #0218 7047 cdd602 call #02d6 704a cd1102 call #0211 704d 88 adc a,b 704e 13 inc de 704f 00 nop 7050 00 nop 7051 cdd404 call #04d4 7054 28b2 jr z,#7008 ; (-78) 7056 cd6308 call #0863 7059 212a75 ld hl,#752a 705c e5 push hl 705d 211400 ld hl,#0014 7060 39 add hl,sp 7061 e5 push hl 7062 cdc605 call #05c6 7065 d1 pop de 7066 d1 pop de 7067 211200 ld hl,#0012 706a 39 add hl,sp 706b e5 push hl 706c cdcc05 call #05cc 706f d1 pop de 7070 e5 push hl 7071 211400 ld hl,#0014 7074 39 add hl,sp 7075 e5 push hl 7076 cd8108 call #0881 7079 d1 pop de 707a d1 pop de 707b 210a00 ld hl,#000a 707e 39 add hl,sp 707f e5 push hl 7080 215ed4 ld hl,#d45e 7083 cd2402 call #0224 7086 e1 pop hl 7087 cd2f02 call #022f 708a 210800 ld hl,#0008 708d 39 add hl,sp 708e 3600 ld (hl),#00 7090 23 inc hl 7091 e5 push hl 7092 6e ld l,(hl) 7093 23 inc hl 7094 eb ex de,hl 7095 e1 pop hl 7096 73 ld (hl),e 7097 c30870 jp #7008 709a 213075 ld hl,#7530 709d e5 push hl 709e 211400 ld hl,#0014 70a1 39 add hl,sp 70a2 e5 push hl 70a3 cdc305 call #05c3 70a6 d1 pop de 70a7 d1 pop de 70a8 2810 jr z,#70ba ; (16) 70aa 213475 ld hl,#7534 70ad e5 push hl 70ae 211400 ld hl,#0014 70b1 39 add hl,sp 70b2 e5 push hl 70b3 cdc605 call #05c6 70b6 d1 pop de 70b7 d1 pop de 70b8 180e jr #70c8 ; (14) 70ba 216975 ld hl,#7569 70bd e5 push hl 70be 211400 ld hl,#0014 70c1 39 add hl,sp 70c2 e5 push hl 70c3 cdc605 call #05c6 70c6 d1 pop de 70c7 d1 pop de 70c8 216c00 ld hl,#006c 70cb 39 add hl,sp 70cc 5e ld e,(hl) 70cd 23 inc hl 70ce 56 ld d,(hl) 70cf d5 push de 70d0 211400 ld hl,#0014 70d3 39 add hl,sp 70d4 e5 push hl 70d5 cdba05 call #05ba 70d8 d1 pop de 70d9 d1 pop de 70da 218c75 ld hl,#758c 70dd e5 push hl 70de 211400 ld hl,#0014 70e1 39 add hl,sp 70e2 e5 push hl 70e3 cdba05 call #05ba 70e6 d1 pop de 70e7 d1 pop de 70e8 211200 ld hl,#0012 70eb 39 add hl,sp 70ec e5 push hl 70ed cdcc05 call #05cc 70f0 d1 pop de 70f1 e5 push hl 70f2 211400 ld hl,#0014 70f5 39 add hl,sp 70f6 e5 push hl 70f7 cd8108 call #0881 70fa d1 pop de 70fb d1 pop de 70fc 215f00 ld hl,#005f 70ff 39 add hl,sp 7100 3600 ld (hl),#00 7102 23 inc hl 7103 3600 ld (hl),#00 7105 23 inc hl 7106 361e ld (hl),#1e 7108 23 inc hl 7109 3600 ld (hl),#00 710b 216971 ld hl,#7169 710e e5 push hl 710f 210600 ld hl,#0006 7112 e5 push hl 7113 cded05 call #05ed 7116 d1 pop de 7117 d1 pop de 7118 eb ex de,hl 7119 215e00 ld hl,#005e 711c 39 add hl,sp 711d 73 ld (hl),e 711e 7b ld a,e 711f b7 or a 7120 201c jr nz,#713e ; (28) 7122 cd0d7a call #7a0d 7125 eb ex de,hl 7126 215300 ld hl,#0053 7129 39 add hl,sp 712a 73 ld (hl),e 712b 7b ld a,e 712c fe03 cp #03 712e 2005 jr nz,#7135 ; (5) 7130 5e ld e,(hl) 7131 1600 ld d,#00 7133 eb ex de,hl 7134 c9 ret 7135 7e ld a,(hl) 7136 fe01 cp #01 7138 20d1 jr nz,#710b ; (-47) 713a 21ff00 ld hl,#00ff 713d c9 ret 713e 216971 ld hl,#7169 7141 e5 push hl 7142 210600 ld hl,#0006 7145 e5 push hl 7146 cded05 call #05ed 7149 d1 pop de 714a d1 pop de 714b eb ex de,hl 714c 215300 ld hl,#0053 714f 39 add hl,sp 7150 73 ld (hl),e 7151 7b ld a,e 7152 b7 or a 7153 280c jr z,#7161 ; (12) 7155 cd0d7a call #7a0d 7158 7d ld a,l 7159 fe01 cp #01 715b 20e1 jr nz,#713e ; (-31) 715d 21ff00 ld hl,#00ff 7160 c9 ret 7161 217000 ld hl,#0070 7164 39 add hl,sp 7165 7e ld a,(hl) 7166 fe05 cp #05 7168 2816 jr z,#7180 ; (22) 716a 214100 ld hl,#0041 716d e5 push hl 716e 24 inc h 716f 2d dec l 7170 e5 push hl 7171 212d00 ld hl,#002d 7174 e5 push hl 7175 2e55 ld l,#55 7177 e5 push hl 7178 cd8a20 call #208a 717b 210800 ld hl,#0008 717e 39 add hl,sp 717f f9 ld sp,hl 7180 215e00 ld hl,#005e 7183 39 add hl,sp 7184 7e ld a,(hl) 7185 fe01 cp #01 7187 201f jr nz,#71a8 ; (31) 7189 2ae96e ld hl,(#6ee9) 718c e5 push hl 718d cdcc05 call #05cc 7190 d1 pop de 7191 2600 ld h,#00 7193 e5 push hl 7194 2ae96e ld hl,(#6ee9) 7197 e5 push hl 7198 216300 ld hl,#0063 719b 39 add hl,sp 719c e5 push hl 719d cdc967 call #67c9 71a0 d1 pop de 71a1 d1 pop de 71a2 d1 pop de 71a3 cd7324 call #2473 71a6 1821 jr #71c9 ; (33) 71a8 2af86e ld hl,(#6ef8) 71ab e5 push hl 71ac cdcc05 call #05cc 71af d1 pop de 71b0 2600 ld h,#00 71b2 e5 push hl 71b3 2af86e ld hl,(#6ef8) 71b6 e5 push hl 71b7 216300 ld hl,#0063 71ba 39 add hl,sp 71bb e5 push hl 71bc cdc967 call #67c9 71bf d1 pop de 71c0 d1 pop de 71c1 d1 pop de 71c2 cd7324 call #2473 71c5 210000 ld hl,#0000 71c8 c9 ret 71c9 216e00 ld hl,#006e 71cc 39 add hl,sp 71cd 7e ld a,(hl) 71ce fe01 cp #01 71d0 2060 jr nz,#7232 ; (96) 71d2 215f00 ld hl,#005f 71d5 39 add hl,sp 71d6 3614 ld (hl),#14 71d8 23 inc hl 71d9 3600 ld (hl),#00 71db 23 inc hl 71dc 362d ld (hl),#2d 71de 23 inc hl 71df 3600 ld (hl),#00 71e1 2a076f ld hl,(#6f07) 71e4 e5 push hl 71e5 cdcc05 call #05cc 71e8 d1 pop de 71e9 2600 ld h,#00 71eb e5 push hl 71ec 2a076f ld hl,(#6f07) 71ef e5 push hl 71f0 216300 ld hl,#0063 71f3 39 add hl,sp 71f4 e5 push hl 71f5 cdc967 call #67c9 71f8 d1 pop de 71f9 d1 pop de 71fa d1 pop de 71fb 215f00 ld hl,#005f 71fe 39 add hl,sp 71ff 3646 ld (hl),#46 7201 23 inc hl 7202 3600 ld (hl),#00 7204 2a0e6f ld hl,(#6f0e) 7207 e5 push hl 7208 cdcc05 call #05cc 720b d1 pop de 720c 2600 ld h,#00 720e e5 push hl 720f 2a0e6f ld hl,(#6f0e) 7212 e5 push hl 7213 216300 ld hl,#0063 7216 39 add hl,sp 7217 e5 push hl 7218 cdc967 call #67c9 721b d1 pop de 721c d1 pop de 721d d1 pop de 721e 218200 ld hl,#0082 7221 e5 push hl 7222 2e37 ld l,#37 7224 e5 push hl 7225 6c ld l,h 7226 e5 push hl 7227 cdd123 call #23d1 722a d1 pop de 722b d1 pop de 722c d1 pop de 722d cd7324 call #2473 7230 1826 jr #7258 ; (38) 7232 216100 ld hl,#0061 7235 39 add hl,sp 7236 3632 ld (hl),#32 7238 23 inc hl 7239 3600 ld (hl),#00 723b 2a186f ld hl,(#6f18) 723e e5 push hl 723f cdcc05 call #05cc 7242 d1 pop de 7243 2600 ld h,#00 7245 e5 push hl 7246 2a186f ld hl,(#6f18) 7249 e5 push hl 724a 216300 ld hl,#0063 724d 39 add hl,sp 724e e5 push hl 724f cdc967 call #67c9 7252 d1 pop de 7253 d1 pop de 7254 d1 pop de 7255 cd7324 call #2473 7258 cd0d7a call #7a0d 725b eb ex de,hl 725c 215300 ld hl,#0053 725f 39 add hl,sp 7260 73 ld (hl),e 7261 7b ld a,e 7262 fe01 cp #01 7264 ca0a74 jp z,#740a 7267 216e00 ld hl,#006e 726a 39 add hl,sp 726b 7e ld a,(hl) 726c fe01 cp #01 726e c2db73 jp nz,#73db 7271 215a00 ld hl,#005a 7274 e5 push hl 7275 2e46 ld l,#46 7277 e5 push hl 7278 2e3c ld l,#3c 727a e5 push hl 727b 6c ld l,h 727c e5 push hl 727d cd8a20 call #208a 7280 210800 ld hl,#0008 7283 39 add hl,sp 7284 f9 ld sp,hl 7285 215f00 ld hl,#005f 7288 39 add hl,sp 7289 3614 ld (hl),#14 728b 23 inc hl 728c 3600 ld (hl),#00 728e 23 inc hl 728f 363c ld (hl),#3c 7291 23 inc hl 7292 3600 ld (hl),#00 7294 215000 ld hl,#0050 7297 39 add hl,sp 7298 5e ld e,(hl) 7299 23 inc hl 729a 56 ld d,(hl) 729b 13 inc de 729c 2b dec hl 729d 73 ld (hl),e 729e 23 inc hl 729f 72 ld (hl),d 72a0 210a00 ld hl,#000a 72a3 e5 push hl 72a4 211400 ld hl,#0014 72a7 39 add hl,sp 72a8 e5 push hl 72a9 215400 ld hl,#0054 72ac 39 add hl,sp 72ad 5e ld e,(hl) 72ae 23 inc hl 72af 56 ld d,(hl) 72b0 d5 push de 72b1 cdb507 call #07b5 72b4 d1 pop de 72b5 d1 pop de 72b6 d1 pop de 72b7 211200 ld hl,#0012 72ba 39 add hl,sp 72bb e5 push hl 72bc cdcc05 call #05cc 72bf d1 pop de 72c0 2600 ld h,#00 72c2 e5 push hl 72c3 211400 ld hl,#0014 72c6 39 add hl,sp 72c7 e5 push hl 72c8 216300 ld hl,#0063 72cb 39 add hl,sp 72cc e5 push hl 72cd cdc967 call #67c9 72d0 d1 pop de 72d1 d1 pop de 72d2 d1 pop de 72d3 cd7324 call #2473 72d6 cd9375 call #7593 72d9 cd6f76 call #766f 72dc eb ex de,hl 72dd 215200 ld hl,#0052 72e0 39 add hl,sp 72e1 73 ld (hl),e 72e2 217000 ld hl,#0070 72e5 39 add hl,sp 72e6 7e ld a,(hl) 72e7 fe05 cp #05 72e9 2811 jr z,#72fc ; (17) 72eb 215300 ld hl,#0053 72ee 39 add hl,sp 72ef 3601 ld (hl),#01 72f1 2b dec hl 72f2 7e ld a,(hl) 72f3 b7 or a 72f4 2004 jr nz,#72fa ; (4) 72f6 3601 ld (hl),#01 72f8 1802 jr #72fc ; (2) 72fa 3600 ld (hl),#00 72fc 215200 ld hl,#0052 72ff 39 add hl,sp 7300 7e ld a,(hl) 7301 feff cp #ff 7303 2006 jr nz,#730b ; (6) 7305 23 inc hl 7306 3601 ld (hl),#01 7308 c30a74 jp #740a 730b b7 or a 730c 2063 jr nz,#7371 ; (99) 730e 215a00 ld hl,#005a 7311 e5 push hl 7312 2e82 ld l,#82 7314 e5 push hl 7315 2e3c ld l,#3c 7317 e5 push hl 7318 2e46 ld l,#46 731a e5 push hl 731b cd8a20 call #208a 731e 210800 ld hl,#0008 7321 39 add hl,sp 7322 f9 ld sp,hl 7323 215f00 ld hl,#005f 7326 39 add hl,sp 7327 3646 ld (hl),#46 7329 23 inc hl 732a 3600 ld (hl),#00 732c 214e00 ld hl,#004e 732f 39 add hl,sp 7330 5e ld e,(hl) 7331 23 inc hl 7332 56 ld d,(hl) 7333 13 inc de 7334 2b dec hl 7335 73 ld (hl),e 7336 23 inc hl 7337 72 ld (hl),d 7338 210a00 ld hl,#000a 733b e5 push hl 733c 211400 ld hl,#0014 733f 39 add hl,sp 7340 e5 push hl 7341 215200 ld hl,#0052 7344 39 add hl,sp 7345 5e ld e,(hl) 7346 23 inc hl 7347 56 ld d,(hl) 7348 d5 push de 7349 cdb507 call #07b5 734c d1 pop de 734d d1 pop de 734e d1 pop de 734f 211200 ld hl,#0012 7352 39 add hl,sp 7353 e5 push hl 7354 cdcc05 call #05cc 7357 d1 pop de 7358 2600 ld h,#00 735a e5 push hl 735b 211400 ld hl,#0014 735e 39 add hl,sp 735f e5 push hl 7360 216300 ld hl,#0063 7363 39 add hl,sp 7364 e5 push hl 7365 cdc967 call #67c9 7368 d1 pop de 7369 d1 pop de 736a d1 pop de 736b cd7324 call #2473 736e c30a74 jp #740a 7371 215f00 ld hl,#005f 7374 39 add hl,sp 7375 3687 ld (hl),#87 7377 23 inc hl 7378 3600 ld (hl),#00 737a 23 inc hl 737b 363c ld (hl),#3c 737d 23 inc hl 737e 3600 ld (hl),#00 7380 215a00 ld hl,#005a 7383 e5 push hl 7384 212c01 ld hl,#012c 7387 e5 push hl 7388 213c00 ld hl,#003c 738b e5 push hl 738c 2e87 ld l,#87 738e e5 push hl 738f cd8a20 call #208a 7392 210800 ld hl,#0008 7395 39 add hl,sp 7396 f9 ld sp,hl 7397 215200 ld hl,#0052 739a 39 add hl,sp 739b 7e ld a,(hl) 739c fe02 cp #02 739e 201c jr nz,#73bc ; (28) 73a0 2a246f ld hl,(#6f24) 73a3 e5 push hl 73a4 cdcc05 call #05cc 73a7 d1 pop de 73a8 2600 ld h,#00 73aa e5 push hl 73ab 2a246f ld hl,(#6f24) 73ae e5 push hl 73af 216300 ld hl,#0063 73b2 39 add hl,sp 73b3 e5 push hl 73b4 cdc967 call #67c9 73b7 d1 pop de 73b8 d1 pop de 73b9 d1 pop de 73ba 181a jr #73d6 ; (26) 73bc 2a3d6f ld hl,(#6f3d) 73bf e5 push hl 73c0 cdcc05 call #05cc 73c3 d1 pop de 73c4 2600 ld h,#00 73c6 e5 push hl 73c7 2a3d6f ld hl,(#6f3d) 73ca e5 push hl 73cb 216300 ld hl,#0063 73ce 39 add hl,sp 73cf e5 push hl 73d0 cdc967 call #67c9 73d3 d1 pop de 73d4 d1 pop de 73d5 d1 pop de 73d6 cd7324 call #2473 73d9 182f jr #740a ; (47) 73db 215400 ld hl,#0054 73de 39 add hl,sp 73df 3655 ld (hl),#55 73e1 23 inc hl 73e2 3600 ld (hl),#00 73e4 210e00 ld hl,#000e 73e7 39 add hl,sp 73e8 3601 ld (hl),#01 73ea 23 inc hl 73eb 3600 ld (hl),#00 73ed 210100 ld hl,#0001 73f0 e5 push hl 73f1 215600 ld hl,#0056 73f4 39 add hl,sp 73f5 e5 push hl 73f6 cd8108 call #0881 73f9 d1 pop de 73fa d1 pop de 73fb eb ex de,hl 73fc 211000 ld hl,#0010 73ff 39 add hl,sp 7400 73 ld (hl),e 7401 23 inc hl 7402 72 ld (hl),d 7403 2b dec hl 7404 5e ld e,(hl) 7405 1b dec de 7406 7a ld a,d 7407 b3 or e 7408 20e3 jr nz,#73ed ; (-29) 740a 215300 ld hl,#0053 740d 39 add hl,sp 740e 7e ld a,(hl) 740f fe01 cp #01 7411 c25872 jp nz,#7258 7414 215f00 ld hl,#005f 7417 39 add hl,sp 7418 3600 ld (hl),#00 741a 23 inc hl 741b 3600 ld (hl),#00 741d 23 inc hl 741e 3646 ld (hl),#46 7420 23 inc hl 7421 3600 ld (hl),#00 7423 217000 ld hl,#0070 7426 39 add hl,sp 7427 7e ld a,(hl) 7428 fe05 cp #05 742a 201d jr nz,#7449 ; (29) 742c 2a506f ld hl,(#6f50) 742f e5 push hl 7430 cdcc05 call #05cc 7433 d1 pop de 7434 2600 ld h,#00 7436 e5 push hl 7437 2a506f ld hl,(#6f50) 743a e5 push hl 743b 216300 ld hl,#0063 743e 39 add hl,sp 743f e5 push hl 7440 cdc967 call #67c9 7443 d1 pop de 7444 d1 pop de 7445 d1 pop de 7446 cd7324 call #2473 7449 218e75 ld hl,#758e 744c e5 push hl 744d 215600 ld hl,#0056 7450 39 add hl,sp 7451 e5 push hl 7452 cdc605 call #05c6 7455 d1 pop de 7456 d1 pop de 7457 210e00 ld hl,#000e 745a 39 add hl,sp 745b 3603 ld (hl),#03 745d 23 inc hl 745e 3600 ld (hl),#00 7460 110300 ld de,#0003 7463 210e00 ld hl,#000e 7466 39 add hl,sp 7467 7e ld a,(hl) 7468 23 inc hl 7469 66 ld h,(hl) 746a 6f ld l,a 746b a7 and a 746c eb ex de,hl 746d ed52 sbc hl,de 746f eb ex de,hl 7470 211000 ld hl,#0010 7473 39 add hl,sp 7474 73 ld (hl),e 7475 23 inc hl 7476 72 ld (hl),d 7477 2b dec hl 7478 2b dec hl 7479 56 ld d,(hl) 747a 2b dec hl 747b 5e ld e,(hl) 747c d5 push de 747d 216000 ld hl,#0060 7480 39 add hl,sp 7481 5e ld e,(hl) 7482 1600 ld d,#00 7484 215600 ld hl,#0056 7487 39 add hl,sp 7488 19 add hl,de 7489 e5 push hl 748a cd8108 call #0881 748d d1 pop de 748e d1 pop de 748f eb ex de,hl 7490 211000 ld hl,#0010 7493 39 add hl,sp 7494 73 ld (hl),e 7495 23 inc hl 7496 72 ld (hl),d 7497 2b dec hl 7498 5e ld e,(hl) 7499 2b dec hl 749a 2b dec hl 749b 7e ld a,(hl) 749c 23 inc hl 749d 66 ld h,(hl) 749e 6f ld l,a 749f a7 and a 74a0 ed52 sbc hl,de 74a2 281a jr z,#74be ; (26) 74a4 210e00 ld hl,#000e 74a7 39 add hl,sp 74a8 5e ld e,(hl) 74a9 23 inc hl 74aa 56 ld d,(hl) 74ab 23 inc hl 74ac 7e ld a,(hl) 74ad 23 inc hl 74ae 66 ld h,(hl) 74af 6f ld l,a 74b0 a7 and a 74b1 eb ex de,hl 74b2 ed52 sbc hl,de 74b4 eb ex de,hl 74b5 210e00 ld hl,#000e 74b8 39 add hl,sp 74b9 73 ld (hl),e 74ba 23 inc hl 74bb 72 ld (hl),d 74bc 18a2 jr #7460 ; (-94) 74be 21e803 ld hl,#03e8 74c1 e5 push hl 74c2 cd5c0a call #0a5c 74c5 d1 pop de 74c6 216100 ld hl,#0061 74c9 39 add hl,sp 74ca 3650 ld (hl),#50 74cc 23 inc hl 74cd 3600 ld (hl),#00 74cf 2a5f6f ld hl,(#6f5f) 74d2 e5 push hl 74d3 cdcc05 call #05cc 74d6 d1 pop de 74d7 2600 ld h,#00 74d9 e5 push hl 74da 2a5f6f ld hl,(#6f5f) 74dd e5 push hl 74de 216300 ld hl,#0063 74e1 39 add hl,sp 74e2 e5 push hl 74e3 cdc967 call #67c9 74e6 d1 pop de 74e7 d1 pop de 74e8 d1 pop de 74e9 21e803 ld hl,#03e8 74ec e5 push hl 74ed cd5c0a call #0a5c 74f0 d1 pop de 74f1 cd7b08 call #087b 74f4 cd7324 call #2473 74f7 216971 ld hl,#7169 74fa e5 push hl 74fb 210600 ld hl,#0006 74fe e5 push hl 74ff cded05 call #05ed 7502 d1 pop de 7503 d1 pop de 7504 eb ex de,hl 7505 215300 ld hl,#0053 7508 39 add hl,sp 7509 73 ld (hl),e 750a 7b ld a,e 750b b7 or a 750c 20e9 jr nz,#74f7 ; (-23) 750e 217000 ld hl,#0070 7511 39 add hl,sp 7512 7e ld a,(hl) 7513 fe05 cp #05 7515 2809 jr z,#7520 ; (9) 7517 215200 ld hl,#0052 751a 39 add hl,sp 751b 5e ld e,(hl) 751c 1600 ld d,#00 751e eb ex de,hl 751f c9 ret 7520 210000 ld hl,#0000 7523 c9 ret 7524 ATI3\r\0 752a ATI3\r\0 7530 V34\0 7534 AT&F0+MS=11,1,300,14400E0M1Q0S6=7S11=95S91=10S95=0DT\0 7569 AT&F0E0M1Q0S6=7S11=95S91=10S95=0DT\0 758c \r\0 758e ++++\0 7593 11fbfb ld de,#fbfb 7596 cd6b05 call #056b 7599 210d00 ld hl,#000d 759c 39 add hl,sp 759d 361b ld (hl),#1b 759f 210800 ld hl,#0008 75a2 39 add hl,sp 75a3 361b ld (hl),#1b 75a5 210e00 ld hl,#000e 75a8 39 add hl,sp 75a9 3603 ld (hl),#03 75ab 210800 ld hl,#0008 75ae 39 add hl,sp 75af 5e ld e,(hl) 75b0 1600 ld d,#00 75b2 13 inc de 75b3 13 inc de 75b4 13 inc de 75b5 73 ld (hl),e 75b6 210f00 ld hl,#000f 75b9 39 add hl,sp 75ba 36fc ld (hl),#fc 75bc 210800 ld hl,#0008 75bf 39 add hl,sp 75c0 7e ld a,(hl) 75c1 c6fc add a,#fc 75c3 77 ld (hl),a 75c4 23 inc hl 75c5 23 inc hl 75c6 23 inc hl 75c7 3600 ld (hl),#00 75c9 23 inc hl 75ca 3600 ld (hl),#00 75cc 210b00 ld hl,#000b 75cf 39 add hl,sp 75d0 5e ld e,(hl) 75d1 23 inc hl 75d2 56 ld d,(hl) 75d3 211000 ld hl,#0010 75d6 39 add hl,sp 75d7 19 add hl,de 75d8 1e55 ld e,#55 75da 73 ld (hl),e 75db 210800 ld hl,#0008 75de 39 add hl,sp 75df 7e ld a,(hl) 75e0 c655 add a,#55 75e2 77 ld (hl),a 75e3 23 inc hl 75e4 23 inc hl 75e5 23 inc hl 75e6 5e ld e,(hl) 75e7 23 inc hl 75e8 56 ld d,(hl) 75e9 13 inc de 75ea 72 ld (hl),d 75eb 2b dec hl 75ec 73 ld (hl),e 75ed 23 inc hl 75ee 56 ld d,(hl) 75ef 2104fc ld hl,#fc04 75f2 19 add hl,de 75f3 30d7 jr nc,#75cc ; (-41) 75f5 210800 ld hl,#0008 75f8 39 add hl,sp 75f9 5e ld e,(hl) 75fa 1600 ld d,#00 75fc 21ff00 ld hl,#00ff 75ff a7 and a 7600 ed52 sbc hl,de 7602 23 inc hl 7603 eb ex de,hl 7604 210800 ld hl,#0008 7607 39 add hl,sp 7608 73 ld (hl),e 7609 210c04 ld hl,#040c 760c 39 add hl,sp 760d 73 ld (hl),e 760e 210900 ld hl,#0009 7611 39 add hl,sp 7612 3600 ld (hl),#00 7614 23 inc hl 7615 3604 ld (hl),#04 7617 110004 ld de,#0400 761a 210900 ld hl,#0009 761d 39 add hl,sp 761e 7e ld a,(hl) 761f 23 inc hl 7620 66 ld h,(hl) 7621 6f ld l,a 7622 a7 and a 7623 eb ex de,hl 7624 ed52 sbc hl,de 7626 eb ex de,hl 7627 210b00 ld hl,#000b 762a 39 add hl,sp 762b 73 ld (hl),e 762c 23 inc hl 762d 72 ld (hl),d 762e 2b dec hl 762f 2b dec hl 7630 56 ld d,(hl) 7631 2b dec hl 7632 5e ld e,(hl) 7633 d5 push de 7634 23 inc hl 7635 23 inc hl 7636 5e ld e,(hl) 7637 23 inc hl 7638 56 ld d,(hl) 7639 23 inc hl 763a 19 add hl,de 763b e5 push hl 763c cd8108 call #0881 763f d1 pop de 7640 d1 pop de 7641 eb ex de,hl 7642 210b00 ld hl,#000b 7645 39 add hl,sp 7646 73 ld (hl),e 7647 23 inc hl 7648 72 ld (hl),d 7649 2b dec hl 764a 5e ld e,(hl) 764b 2b dec hl 764c 2b dec hl 764d 7e ld a,(hl) 764e 23 inc hl 764f 66 ld h,(hl) 7650 6f ld l,a 7651 a7 and a 7652 ed52 sbc hl,de 7654 c8 ret z 7655 210900 ld hl,#0009 7658 39 add hl,sp 7659 5e ld e,(hl) 765a 23 inc hl 765b 56 ld d,(hl) 765c 23 inc hl 765d 7e ld a,(hl) 765e 23 inc hl 765f 66 ld h,(hl) 7660 6f ld l,a 7661 a7 and a 7662 eb ex de,hl 7663 ed52 sbc hl,de 7665 eb ex de,hl 7666 210900 ld hl,#0009 7669 39 add hl,sp 766a 73 ld (hl),e 766b 23 inc hl 766c 72 ld (hl),d 766d 18a8 jr #7617 ; (-88) 766f 11ecff ld de,#ffec 7672 cd6b05 call #056b 7675 211600 ld hl,#0016 7678 39 add hl,sp 7679 3600 ld (hl),#00 767b 2b dec hl 767c 2b dec hl 767d 3600 ld (hl),#00 767f 2b dec hl 7680 3600 ld (hl),#00 7682 210900 ld hl,#0009 7685 39 add hl,sp 7686 3600 ld (hl),#00 7688 23 inc hl 7689 3600 ld (hl),#00 768b 23 inc hl 768c 3600 ld (hl),#00 768e 23 inc hl 768f 3600 ld (hl),#00 7691 23 inc hl 7692 3640 ld (hl),#40 7694 23 inc hl 7695 3601 ld (hl),#01 7697 23 inc hl 7698 3680 ld (hl),#80 769a 23 inc hl 769b 3600 ld (hl),#00 769d 23 inc hl 769e 3600 ld (hl),#00 76a0 211800 ld hl,#0018 76a3 39 add hl,sp 76a4 e5 push hl 76a5 215ed4 ld hl,#d45e 76a8 cd2402 call #0224 76ab e1 pop hl 76ac cd2f02 call #022f 76af cd6908 call #0869 76b2 c2cb77 jp nz,#77cb 76b5 cd6f08 call #086f 76b8 eb ex de,hl 76b9 211700 ld hl,#0017 76bc 39 add hl,sp 76bd 73 ld (hl),e 76be 2b dec hl 76bf 7e ld a,(hl) 76c0 eb ex de,hl 76c1 b7 or a 76c2 2811 jr z,#76d5 ; (17) 76c4 3d dec a 76c5 281f jr z,#76e6 ; (31) 76c7 3d dec a 76c8 2852 jr z,#771c ; (82) 76ca 3d dec a 76cb ca5677 jp z,#7756 76ce 3d dec a 76cf ca9077 jp z,#7790 76d2 c3b977 jp #77b9 76d5 eb ex de,hl 76d6 23 inc hl 76d7 7e ld a,(hl) 76d8 fe1b cp #1b 76da c2b977 jp nz,#77b9 76dd 2b dec hl 76de 3601 ld (hl),#01 76e0 2b dec hl 76e1 361b ld (hl),#1b 76e3 c3b977 jp #77b9 76e6 eb ex de,hl 76e7 23 inc hl 76e8 5e ld e,(hl) 76e9 1600 ld d,#00 76eb 210800 ld hl,#0008 76ee cd2905 call #0529 76f1 eb ex de,hl 76f2 211300 ld hl,#0013 76f5 39 add hl,sp 76f6 73 ld (hl),e 76f7 23 inc hl 76f8 72 ld (hl),d 76f9 211700 ld hl,#0017 76fc 39 add hl,sp 76fd 5e ld e,(hl) 76fe 1600 ld d,#00 7700 d5 push de 7701 211700 ld hl,#0017 7704 39 add hl,sp 7705 5e ld e,(hl) 7706 1600 ld d,#00 7708 e1 pop hl 7709 19 add hl,de 770a eb ex de,hl 770b 211500 ld hl,#0015 770e 39 add hl,sp 770f 73 ld (hl),e 7710 210200 ld hl,#0002 7713 eb ex de,hl 7714 211600 ld hl,#0016 7717 39 add hl,sp 7718 73 ld (hl),e 7719 c3b977 jp #77b9 771c 211700 ld hl,#0017 771f 39 add hl,sp 7720 5e ld e,(hl) 7721 1600 ld d,#00 7723 211300 ld hl,#0013 7726 39 add hl,sp 7727 7e ld a,(hl) 7728 23 inc hl 7729 66 ld h,(hl) 772a 6f ld l,a 772b 19 add hl,de 772c eb ex de,hl 772d 211300 ld hl,#0013 7730 39 add hl,sp 7731 73 ld (hl),e 7732 23 inc hl 7733 72 ld (hl),d 7734 211700 ld hl,#0017 7737 39 add hl,sp 7738 5e ld e,(hl) 7739 1600 ld d,#00 773b d5 push de 773c 211700 ld hl,#0017 773f 39 add hl,sp 7740 5e ld e,(hl) 7741 1600 ld d,#00 7743 e1 pop hl 7744 19 add hl,de 7745 eb ex de,hl 7746 211500 ld hl,#0015 7749 39 add hl,sp 774a 73 ld (hl),e 774b 210300 ld hl,#0003 774e eb ex de,hl 774f 211600 ld hl,#0016 7752 39 add hl,sp 7753 73 ld (hl),e 7754 1863 jr #77b9 ; (99) 7756 211700 ld hl,#0017 7759 39 add hl,sp 775a 5e ld e,(hl) 775b 1600 ld d,#00 775d d5 push de 775e 211700 ld hl,#0017 7761 39 add hl,sp 7762 5e ld e,(hl) 7763 1600 ld d,#00 7765 e1 pop hl 7766 19 add hl,de 7767 eb ex de,hl 7768 211500 ld hl,#0015 776b 39 add hl,sp 776c 73 ld (hl),e 776d 211300 ld hl,#0013 7770 39 add hl,sp 7771 e5 push hl 7772 7e ld a,(hl) 7773 23 inc hl 7774 66 ld h,(hl) 7775 6f ld l,a 7776 2b dec hl 7777 eb ex de,hl 7778 e1 pop hl 7779 73 ld (hl),e 777a 23 inc hl 777b 72 ld (hl),d 777c 211300 ld hl,#0013 777f 39 add hl,sp 7780 7e ld a,(hl) 7781 23 inc hl 7782 b6 or (hl) 7783 2009 jr nz,#778e ; (9) 7785 210400 ld hl,#0004 7788 eb ex de,hl 7789 211600 ld hl,#0016 778c 39 add hl,sp 778d 73 ld (hl),e 778e 1829 jr #77b9 ; (41) 7790 211700 ld hl,#0017 7793 39 add hl,sp 7794 5e ld e,(hl) 7795 1600 ld d,#00 7797 d5 push de 7798 211700 ld hl,#0017 779b 39 add hl,sp 779c 5e ld e,(hl) 779d 1600 ld d,#00 779f e1 pop hl 77a0 19 add hl,de 77a1 eb ex de,hl 77a2 211500 ld hl,#0015 77a5 39 add hl,sp 77a6 73 ld (hl),e 77a7 211500 ld hl,#0015 77aa 39 add hl,sp 77ab 7e ld a,(hl) 77ac b7 or a 77ad 2004 jr nz,#77b3 ; (4) 77af 210000 ld hl,#0000 77b2 c9 ret 77b3 210200 ld hl,#0002 77b6 c9 ret 77b7 1800 jr #77b9 ; (0) 77b9 211800 ld hl,#0018 77bc 39 add hl,sp 77bd e5 push hl 77be 215ed4 ld hl,#d45e 77c1 cd2402 call #0224 77c4 e1 pop hl 77c5 cd2f02 call #022f 77c8 c3af76 jp #76af 77cb 215ed4 ld hl,#d45e 77ce cd2402 call #0224 77d1 211800 ld hl,#0018 77d4 39 add hl,sp 77d5 cd1802 call #0218 77d8 cdd602 call #02d6 77db cd1102 call #0211 77de 88 adc a,b 77df 13 inc de 77e0 00 nop 77e1 00 nop 77e2 cdcc04 call #04cc 77e5 2804 jr z,#77eb ; (4) 77e7 210100 ld hl,#0001 77ea c9 ret 77eb cd0d7a call #7a0d 77ee eb ex de,hl 77ef 211200 ld hl,#0012 77f2 39 add hl,sp 77f3 73 ld (hl),e 77f4 211200 ld hl,#0012 77f7 39 add hl,sp 77f8 5e ld e,(hl) 77f9 1600 ld d,#00 77fb 210100 ld hl,#0001 77fe cd0601 call #0106 7801 2804 jr z,#7807 ; (4) 7803 21ff00 ld hl,#00ff 7806 c9 ret 7807 c3af76 jp #76af 780a c9 ret 780b 0d78 780d Edit Number : \0 781c 11deff ld de,#ffde 781f cd6b05 call #056b 7822 210a00 ld hl,#000a 7825 39 add hl,sp 7826 3600 ld (hl),#00 7828 23 inc hl 7829 3600 ld (hl),#00 782b 212e00 ld hl,#002e 782e 39 add hl,sp 782f 5e ld e,(hl) 7830 23 inc hl 7831 56 ld d,(hl) 7832 212000 ld hl,#0020 7835 39 add hl,sp 7836 73 ld (hl),e 7837 23 inc hl 7838 72 ld (hl),d 7839 213000 ld hl,#0030 783c 39 add hl,sp 783d 5e ld e,(hl) 783e 23 inc hl 783f 56 ld d,(hl) 7840 212200 ld hl,#0022 7843 39 add hl,sp 7844 73 ld (hl),e 7845 23 inc hl 7846 72 ld (hl),d 7847 23 inc hl 7848 3640 ld (hl),#40 784a 23 inc hl 784b 3601 ld (hl),#01 784d 23 inc hl 784e 3680 ld (hl),#80 7850 23 inc hl 7851 3600 ld (hl),#00 7853 23 inc hl 7854 3600 ld (hl),#00 7856 2a0b78 ld hl,(#780b) 7859 e5 push hl 785a cdcc05 call #05cc 785d d1 pop de 785e 2600 ld h,#00 7860 e5 push hl 7861 2a0b78 ld hl,(#780b) 7864 e5 push hl 7865 212400 ld hl,#0024 7868 39 add hl,sp 7869 e5 push hl 786a cdc967 call #67c9 786d d1 pop de 786e d1 pop de 786f d1 pop de 7870 cd7324 call #2473 7873 212e00 ld hl,#002e 7876 39 add hl,sp 7877 5e ld e,(hl) 7878 23 inc hl 7879 56 ld d,(hl) 787a 214100 ld hl,#0041 787d 19 add hl,de 787e eb ex de,hl 787f 212000 ld hl,#0020 7882 39 add hl,sp 7883 73 ld (hl),e 7884 23 inc hl 7885 72 ld (hl),d 7886 cd0d7a call #7a0d 7889 eb ex de,hl 788a 212900 ld hl,#0029 788d 39 add hl,sp 788e 73 ld (hl),e 788f 7b ld a,e 7890 feff cp #ff 7892 28f2 jr z,#7886 ; (-14) 7894 7e ld a,(hl) 7895 fe57 cp #57 7897 2033 jr nz,#78cc ; (51) 7899 210b00 ld hl,#000b 789c 39 add hl,sp 789d 7e ld a,(hl) 789e b7 or a 789f 28e5 jr z,#7886 ; (-27) 78a1 213000 ld hl,#0030 78a4 39 add hl,sp 78a5 5e ld e,(hl) 78a6 23 inc hl 78a7 56 ld d,(hl) 78a8 210a00 ld hl,#000a 78ab 19 add hl,de 78ac e5 push hl 78ad 214001 ld hl,#0140 78b0 e5 push hl 78b1 213400 ld hl,#0034 78b4 39 add hl,sp 78b5 5e ld e,(hl) 78b6 23 inc hl 78b7 56 ld d,(hl) 78b8 d5 push de 78b9 2b dec hl 78ba 2b dec hl 78bb 56 ld d,(hl) 78bc 2b dec hl 78bd 5e ld e,(hl) 78be d5 push de 78bf cd8a20 call #208a 78c2 210800 ld hl,#0008 78c5 39 add hl,sp 78c6 f9 ld sp,hl 78c7 210b00 ld hl,#000b 78ca 39 add hl,sp 78cb c9 ret 78cc fe01 cp #01 78ce 202d jr nz,#78fd ; (45) 78d0 213000 ld hl,#0030 78d3 39 add hl,sp 78d4 5e ld e,(hl) 78d5 23 inc hl 78d6 56 ld d,(hl) 78d7 210a00 ld hl,#000a 78da 19 add hl,de 78db e5 push hl 78dc 214001 ld hl,#0140 78df e5 push hl 78e0 213400 ld hl,#0034 78e3 39 add hl,sp 78e4 5e ld e,(hl) 78e5 23 inc hl 78e6 56 ld d,(hl) 78e7 d5 push de 78e8 2b dec hl 78e9 2b dec hl 78ea 56 ld d,(hl) 78eb 2b dec hl 78ec 5e ld e,(hl) 78ed d5 push de 78ee cd8a20 call #208a 78f1 210800 ld hl,#0008 78f4 39 add hl,sp 78f5 f9 ld sp,hl 78f6 210b00 ld hl,#000b 78f9 39 add hl,sp 78fa 3600 ld (hl),#00 78fc c9 ret 78fd fe35 cp #35 78ff 2059 jr nz,#795a ; (89) 7901 210a00 ld hl,#000a 7904 39 add hl,sp 7905 7e ld a,(hl) 7906 b7 or a 7907 2806 jr z,#790f ; (6) 7909 e5 push hl 790a 6e ld l,(hl) 790b 2b dec hl 790c eb ex de,hl 790d e1 pop hl 790e 73 ld (hl),e 790f 210a00 ld hl,#000a 7912 39 add hl,sp 7913 5e ld e,(hl) 7914 1600 ld d,#00 7916 23 inc hl 7917 19 add hl,de 7918 72 ld (hl),d 7919 212200 ld hl,#0022 791c 39 add hl,sp 791d 5e ld e,(hl) 791e 23 inc hl 791f 56 ld d,(hl) 7920 210a00 ld hl,#000a 7923 19 add hl,de 7924 e5 push hl 7925 214001 ld hl,#0140 7928 e5 push hl 7929 212600 ld hl,#0026 792c 39 add hl,sp 792d 5e ld e,(hl) 792e 23 inc hl 792f 56 ld d,(hl) 7930 d5 push de 7931 2b dec hl 7932 2b dec hl 7933 56 ld d,(hl) 7934 2b dec hl 7935 5e ld e,(hl) 7936 d5 push de 7937 cd8a20 call #208a 793a 210800 ld hl,#0008 793d 39 add hl,sp 793e f9 ld sp,hl 793f 210a00 ld hl,#000a 7942 39 add hl,sp 7943 5e ld e,(hl) 7944 1600 ld d,#00 7946 d5 push de 7947 23 inc hl 7948 e5 push hl 7949 212400 ld hl,#0024 794c 39 add hl,sp 794d e5 push hl 794e cdc967 call #67c9 7951 d1 pop de 7952 d1 pop de 7953 d1 pop de 7954 cd7324 call #2473 7957 c38678 jp #7886 795a e6f0 and #f0 795c 1f rra 795d 1f rra 795e 1f rra 795f 1f rra 7960 e60f and #0f 7962 210900 ld hl,#0009 7965 39 add hl,sp 7966 77 ld (hl),a 7967 212900 ld hl,#0029 796a 39 add hl,sp 796b 7e ld a,(hl) 796c e60f and #0f 796e 5f ld e,a 796f 210800 ld hl,#0008 7972 39 add hl,sp 7973 77 ld (hl),a 7974 1600 ld d,#00 7976 d5 push de 7977 23 inc hl 7978 5e ld e,(hl) 7979 eb ex de,hl 797a 29 add hl,hl 797b 29 add hl,hl 797c 29 add hl,hl 797d d1 pop de 797e 19 add hl,de 797f 11e766 ld de,#66e7 7982 19 add hl,de 7983 5e ld e,(hl) 7984 212900 ld hl,#0029 7987 39 add hl,sp 7988 73 ld (hl),e 7989 7b ld a,e 798a fe30 cp #30 798c 3805 jr c,#7993 ; (5) 798e 7e ld a,(hl) 798f fe3a cp #3a 7991 380a jr c,#799d ; (10) 7993 212900 ld hl,#0029 7996 39 add hl,sp 7997 7e ld a,(hl) 7998 fe2c cp #2c 799a c28678 jp nz,#7886 799d 210a00 ld hl,#000a 79a0 39 add hl,sp 79a1 1600 ld d,#00 79a3 7e ld a,(hl) 79a4 fe14 cp #14 79a6 ca8678 jp z,#7886 79a9 212900 ld hl,#0029 79ac 39 add hl,sp 79ad 5e ld e,(hl) 79ae d5 push de 79af 210c00 ld hl,#000c 79b2 39 add hl,sp 79b3 5e ld e,(hl) 79b4 23 inc hl 79b5 19 add hl,de 79b6 d1 pop de 79b7 73 ld (hl),e 79b8 210a00 ld hl,#000a 79bb 39 add hl,sp 79bc e5 push hl 79bd 6e ld l,(hl) 79be 23 inc hl 79bf eb ex de,hl 79c0 e1 pop hl 79c1 73 ld (hl),e 79c2 210a00 ld hl,#000a 79c5 39 add hl,sp 79c6 5e ld e,(hl) 79c7 1600 ld d,#00 79c9 23 inc hl 79ca 19 add hl,de 79cb 72 ld (hl),d 79cc 212200 ld hl,#0022 79cf 39 add hl,sp 79d0 5e ld e,(hl) 79d1 23 inc hl 79d2 56 ld d,(hl) 79d3 210a00 ld hl,#000a 79d6 19 add hl,de 79d7 e5 push hl 79d8 214001 ld hl,#0140 79db e5 push hl 79dc 212600 ld hl,#0026 79df 39 add hl,sp 79e0 5e ld e,(hl) 79e1 23 inc hl 79e2 56 ld d,(hl) 79e3 d5 push de 79e4 2b dec hl 79e5 2b dec hl 79e6 56 ld d,(hl) 79e7 2b dec hl 79e8 5e ld e,(hl) 79e9 d5 push de 79ea cd8a20 call #208a 79ed 210800 ld hl,#0008 79f0 39 add hl,sp 79f1 f9 ld sp,hl 79f2 210a00 ld hl,#000a 79f5 39 add hl,sp 79f6 5e ld e,(hl) 79f7 1600 ld d,#00 79f9 d5 push de 79fa 23 inc hl 79fb e5 push hl 79fc 212400 ld hl,#0024 79ff 39 add hl,sp 7a00 e5 push hl 7a01 cdc967 call #67c9 7a04 d1 pop de 7a05 d1 pop de 7a06 d1 pop de 7a07 cd7324 call #2473 7a0a c38678 jp #7886 7a0d 11fbff ld de,#fffb 7a10 cd6b05 call #056b 7a13 3e00 ld a,#00 7a15 3258f6 ld (#f658),a 7a18 210b00 ld hl,#000b 7a1b 39 add hl,sp 7a1c e5 push hl 7a1d cd9a0a call #0a9a 7a20 d1 pop de 7a21 2831 jr z,#7a54 ; (49) 7a23 210b00 ld hl,#000b 7a26 39 add hl,sp 7a27 5e ld e,(hl) 7a28 23 inc hl 7a29 56 ld d,(hl) 7a2a 2b dec hl 7a2b 2b dec hl 7a2c 2b dec hl 7a2d 73 ld (hl),e 7a2e 23 inc hl 7a2f 72 ld (hl),d 7a30 7a ld a,d 7a31 e640 and #40 7a33 2805 jr z,#7a3a ; (5) 7a35 3e01 ld a,#01 7a37 3258f6 ld (#f658),a 7a3a 210b00 ld hl,#000b 7a3d 39 add hl,sp 7a3e 5e ld e,(hl) 7a3f 23 inc hl 7a40 7e ld a,(hl) 7a41 e601 and #01 7a43 2807 jr z,#7a4c ; (7) 7a45 210800 ld hl,#0008 7a48 39 add hl,sp 7a49 73 ld (hl),e 7a4a 180e jr #7a5a ; (14) 7a4c 210800 ld hl,#0008 7a4f 39 add hl,sp 7a50 36ff ld (hl),#ff 7a52 1806 jr #7a5a ; (6) 7a54 210800 ld hl,#0008 7a57 39 add hl,sp 7a58 36ff ld (hl),#ff 7a5a 210800 ld hl,#0008 7a5d 39 add hl,sp 7a5e 5e ld e,(hl) 7a5f 1600 ld d,#00 7a61 eb ex de,hl 7a62 c9 ret 7a63 00 nop 7a64 00 nop 7a65 00 nop 7a66 00 nop 7a67 00 nop 7a68 00 nop 7a69 00 nop 7a6a 00 nop 7a6b 00 nop 7a6c 00 nop 7a6d 00 nop 7a6e 00 nop 7a6f 00 nop 7a70 00 nop 7a71 00 nop 7a72 00 nop 7a73 00 nop 7a74 00 nop 7a75 00 nop 7a76 00 nop 7a77 00 nop 7a78 00 nop 7a79 00 nop 7a7a 00 nop 7a7b 00 nop 7a7c 00 nop 7a7d 00 nop 7a7e 00 nop 7a7f 00 nop 7a80 00 nop 7a81 00 nop 7a82 00 nop 7a83 00 nop 7a84 00 nop 7a85 00 nop 7a86 00 nop 7a87 00 nop 7a88 00 nop 7a89 00 nop 7a8a 00 nop 7a8b 00 nop 7a8c 00 nop 7a8d 00 nop 7a8e 00 nop 7a8f 00 nop 7a90 00 nop 7a91 00 nop 7a92 00 nop 7a93 00 nop 7a94 00 nop 7a95 00 nop 7a96 00 nop 7a97 00 nop 7a98 00 nop 7a99 00 nop 7a9a 00 nop 7a9b 00 nop 7a9c 00 nop 7a9d 00 nop 7a9e 00 nop 7a9f 00 nop 7aa0 00 nop 7aa1 00 nop 7aa2 00 nop 7aa3 00 nop 7aa4 00 nop 7aa5 00 nop 7aa6 00 nop 7aa7 00 nop 7aa8 00 nop 7aa9 00 nop 7aaa 00 nop 7aab 00 nop 7aac 00 nop 7aad 00 nop 7aae 00 nop 7aaf 00 nop 7ab0 00 nop 7ab1 00 nop 7ab2 00 nop 7ab3 00 nop 7ab4 00 nop 7ab5 00 nop 7ab6 00 nop 7ab7 00 nop 7ab8 00 nop 7ab9 00 nop 7aba 00 nop 7abb 00 nop 7abc 00 nop 7abd 00 nop 7abe 00 nop 7abf 00 nop 7ac0 00 nop 7ac1 00 nop 7ac2 00 nop 7ac3 00 nop 7ac4 00 nop 7ac5 00 nop 7ac6 00 nop 7ac7 00 nop 7ac8 00 nop 7ac9 00 nop 7aca 00 nop 7acb 00 nop 7acc 00 nop 7acd 00 nop 7ace 00 nop 7acf 00 nop 7ad0 00 nop 7ad1 00 nop 7ad2 00 nop 7ad3 00 nop 7ad4 00 nop 7ad5 00 nop 7ad6 00 nop 7ad7 00 nop 7ad8 00 nop 7ad9 00 nop 7ada 00 nop 7adb 00 nop 7adc 00 nop 7add 00 nop 7ade 00 nop 7adf 00 nop 7ae0 00 nop 7ae1 00 nop 7ae2 00 nop 7ae3 00 nop 7ae4 00 nop 7ae5 00 nop 7ae6 00 nop 7ae7 00 nop 7ae8 00 nop 7ae9 00 nop 7aea 00 nop 7aeb 00 nop 7aec 00 nop 7aed 00 nop 7aee 00 nop 7aef 00 nop 7af0 00 nop 7af1 00 nop 7af2 00 nop 7af3 00 nop 7af4 00 nop 7af5 00 nop 7af6 00 nop 7af7 00 nop 7af8 00 nop 7af9 00 nop 7afa 00 nop 7afb 00 nop 7afc 00 nop 7afd 00 nop 7afe 00 nop 7aff 00 nop 7b00 00 nop 7b01 00 nop 7b02 00 nop 7b03 00 nop 7b04 00 nop 7b05 00 nop 7b06 00 nop 7b07 00 nop 7b08 00 nop 7b09 00 nop 7b0a 00 nop 7b0b 00 nop 7b0c 00 nop 7b0d 00 nop 7b0e 00 nop 7b0f 00 nop 7b10 00 nop 7b11 00 nop 7b12 00 nop 7b13 00 nop 7b14 00 nop 7b15 00 nop 7b16 00 nop 7b17 00 nop 7b18 00 nop 7b19 00 nop 7b1a 00 nop 7b1b 00 nop 7b1c 00 nop 7b1d 00 nop 7b1e 00 nop 7b1f 00 nop 7b20 00 nop 7b21 00 nop 7b22 00 nop 7b23 00 nop 7b24 00 nop 7b25 00 nop 7b26 00 nop 7b27 00 nop 7b28 00 nop 7b29 00 nop 7b2a 00 nop 7b2b 00 nop 7b2c 00 nop 7b2d 00 nop 7b2e 00 nop 7b2f 00 nop 7b30 00 nop 7b31 00 nop 7b32 00 nop 7b33 00 nop 7b34 00 nop 7b35 00 nop 7b36 00 nop 7b37 00 nop 7b38 00 nop 7b39 00 nop 7b3a 00 nop 7b3b 00 nop 7b3c 00 nop 7b3d 00 nop 7b3e 00 nop 7b3f 00 nop 7b40 00 nop 7b41 00 nop 7b42 00 nop 7b43 00 nop 7b44 00 nop 7b45 00 nop 7b46 00 nop 7b47 00 nop 7b48 00 nop 7b49 00 nop 7b4a 00 nop 7b4b 00 nop 7b4c 00 nop 7b4d 00 nop 7b4e 00 nop 7b4f 00 nop 7b50 00 nop 7b51 00 nop 7b52 00 nop 7b53 00 nop 7b54 00 nop 7b55 00 nop 7b56 00 nop 7b57 00 nop 7b58 00 nop 7b59 00 nop 7b5a 00 nop 7b5b 00 nop 7b5c 00 nop 7b5d 00 nop 7b5e 00 nop 7b5f 00 nop 7b60 00 nop 7b61 00 nop 7b62 00 nop 7b63 00 nop 7b64 00 nop 7b65 00 nop 7b66 00 nop 7b67 00 nop 7b68 00 nop 7b69 00 nop 7b6a 00 nop 7b6b 00 nop 7b6c 00 nop 7b6d 00 nop 7b6e 00 nop 7b6f 00 nop 7b70 00 nop 7b71 00 nop 7b72 00 nop 7b73 00 nop 7b74 00 nop 7b75 00 nop 7b76 00 nop 7b77 00 nop 7b78 00 nop 7b79 00 nop 7b7a 00 nop 7b7b 00 nop 7b7c 00 nop 7b7d 00 nop 7b7e 00 nop 7b7f 00 nop 7b80 00 nop 7b81 00 nop 7b82 00 nop 7b83 00 nop 7b84 00 nop 7b85 00 nop 7b86 00 nop 7b87 00 nop 7b88 00 nop 7b89 00 nop 7b8a 00 nop 7b8b 00 nop 7b8c 00 nop 7b8d 00 nop 7b8e 00 nop 7b8f 00 nop 7b90 00 nop 7b91 00 nop 7b92 00 nop 7b93 00 nop 7b94 00 nop 7b95 00 nop 7b96 00 nop 7b97 00 nop 7b98 00 nop 7b99 00 nop 7b9a 00 nop 7b9b 00 nop 7b9c 00 nop 7b9d 00 nop 7b9e 00 nop 7b9f 00 nop 7ba0 00 nop 7ba1 00 nop 7ba2 00 nop 7ba3 00 nop 7ba4 00 nop 7ba5 00 nop 7ba6 00 nop 7ba7 00 nop 7ba8 00 nop 7ba9 00 nop 7baa 00 nop 7bab 00 nop 7bac 00 nop 7bad 00 nop 7bae 00 nop 7baf 00 nop 7bb0 00 nop 7bb1 00 nop 7bb2 00 nop 7bb3 00 nop 7bb4 00 nop 7bb5 00 nop 7bb6 00 nop 7bb7 00 nop 7bb8 00 nop 7bb9 00 nop 7bba 00 nop 7bbb 00 nop 7bbc 00 nop 7bbd 00 nop 7bbe 00 nop 7bbf 00 nop 7bc0 00 nop 7bc1 00 nop 7bc2 00 nop 7bc3 00 nop 7bc4 00 nop 7bc5 00 nop 7bc6 00 nop 7bc7 00 nop 7bc8 00 nop 7bc9 00 nop 7bca 00 nop 7bcb 00 nop 7bcc 00 nop 7bcd 00 nop 7bce 00 nop 7bcf 00 nop 7bd0 00 nop 7bd1 00 nop 7bd2 00 nop 7bd3 00 nop 7bd4 00 nop 7bd5 00 nop 7bd6 00 nop 7bd7 00 nop 7bd8 00 nop 7bd9 00 nop 7bda 00 nop 7bdb 00 nop 7bdc 00 nop 7bdd 00 nop 7bde 00 nop 7bdf 00 nop 7be0 00 nop 7be1 00 nop 7be2 00 nop 7be3 00 nop 7be4 00 nop 7be5 00 nop 7be6 00 nop 7be7 00 nop 7be8 00 nop 7be9 00 nop 7bea 00 nop 7beb 00 nop 7bec 00 nop 7bed 00 nop 7bee 00 nop 7bef 00 nop 7bf0 00 nop 7bf1 00 nop 7bf2 00 nop 7bf3 00 nop 7bf4 00 nop 7bf5 00 nop 7bf6 00 nop 7bf7 00 nop 7bf8 00 nop 7bf9 00 nop 7bfa 00 nop 7bfb 00 nop 7bfc 00 nop 7bfd 00 nop 7bfe 00 nop 7bff 00 nop 7c00 00 nop 7c01 00 nop 7c02 00 nop 7c03 00 nop 7c04 00 nop 7c05 00 nop 7c06 00 nop 7c07 00 nop 7c08 00 nop 7c09 00 nop 7c0a 00 nop 7c0b 00 nop 7c0c 00 nop 7c0d 00 nop 7c0e 00 nop 7c0f 00 nop 7c10 00 nop 7c11 00 nop 7c12 00 nop 7c13 00 nop 7c14 00 nop 7c15 00 nop 7c16 00 nop 7c17 00 nop 7c18 00 nop 7c19 00 nop 7c1a 00 nop 7c1b 00 nop 7c1c 00 nop 7c1d 00 nop 7c1e 00 nop 7c1f 00 nop 7c20 00 nop 7c21 00 nop 7c22 00 nop 7c23 00 nop 7c24 00 nop 7c25 00 nop 7c26 00 nop 7c27 00 nop 7c28 00 nop 7c29 00 nop 7c2a 00 nop 7c2b 00 nop 7c2c 00 nop 7c2d 00 nop 7c2e 00 nop 7c2f 00 nop 7c30 00 nop 7c31 00 nop 7c32 00 nop 7c33 00 nop 7c34 00 nop 7c35 00 nop 7c36 00 nop 7c37 00 nop 7c38 00 nop 7c39 00 nop 7c3a 00 nop 7c3b 00 nop 7c3c 00 nop 7c3d 00 nop 7c3e 00 nop 7c3f 00 nop 7c40 00 nop 7c41 00 nop 7c42 00 nop 7c43 00 nop 7c44 00 nop 7c45 00 nop 7c46 00 nop 7c47 00 nop 7c48 00 nop 7c49 00 nop 7c4a 00 nop 7c4b 00 nop 7c4c 00 nop 7c4d 00 nop 7c4e 00 nop 7c4f 00 nop 7c50 00 nop 7c51 00 nop 7c52 00 nop 7c53 00 nop 7c54 00 nop 7c55 00 nop 7c56 00 nop 7c57 00 nop 7c58 00 nop 7c59 00 nop 7c5a 00 nop 7c5b 00 nop 7c5c 00 nop 7c5d 00 nop 7c5e 00 nop 7c5f 00 nop 7c60 00 nop 7c61 00 nop 7c62 00 nop 7c63 00 nop 7c64 00 nop 7c65 00 nop 7c66 00 nop 7c67 00 nop 7c68 00 nop 7c69 00 nop 7c6a 00 nop 7c6b 00 nop 7c6c 00 nop 7c6d 00 nop 7c6e 00 nop 7c6f 00 nop 7c70 00 nop 7c71 00 nop 7c72 00 nop 7c73 00 nop 7c74 00 nop 7c75 00 nop 7c76 00 nop 7c77 00 nop 7c78 00 nop 7c79 00 nop 7c7a 00 nop 7c7b 00 nop 7c7c 00 nop 7c7d 00 nop 7c7e 00 nop 7c7f 00 nop 7c80 00 nop 7c81 00 nop 7c82 00 nop 7c83 00 nop 7c84 00 nop 7c85 00 nop 7c86 00 nop 7c87 00 nop 7c88 00 nop 7c89 00 nop 7c8a 00 nop 7c8b 00 nop 7c8c 00 nop 7c8d 00 nop 7c8e 00 nop 7c8f 00 nop 7c90 00 nop 7c91 00 nop 7c92 00 nop 7c93 00 nop 7c94 00 nop 7c95 00 nop 7c96 00 nop 7c97 00 nop 7c98 00 nop 7c99 00 nop 7c9a 00 nop 7c9b 00 nop 7c9c 00 nop 7c9d 00 nop 7c9e 00 nop 7c9f 00 nop 7ca0 00 nop 7ca1 00 nop 7ca2 00 nop 7ca3 00 nop 7ca4 00 nop 7ca5 00 nop 7ca6 00 nop 7ca7 00 nop 7ca8 00 nop 7ca9 00 nop 7caa 00 nop 7cab 00 nop 7cac 00 nop 7cad 00 nop 7cae 00 nop 7caf 00 nop 7cb0 00 nop 7cb1 00 nop 7cb2 00 nop 7cb3 00 nop 7cb4 00 nop 7cb5 00 nop 7cb6 00 nop 7cb7 00 nop 7cb8 00 nop 7cb9 00 nop 7cba 00 nop 7cbb 00 nop 7cbc 00 nop 7cbd 00 nop 7cbe 00 nop 7cbf 00 nop 7cc0 00 nop 7cc1 00 nop 7cc2 00 nop 7cc3 00 nop 7cc4 00 nop 7cc5 00 nop 7cc6 00 nop 7cc7 00 nop 7cc8 00 nop 7cc9 00 nop 7cca 00 nop 7ccb 00 nop 7ccc 00 nop 7ccd 00 nop 7cce 00 nop 7ccf 00 nop 7cd0 00 nop 7cd1 00 nop 7cd2 00 nop 7cd3 00 nop 7cd4 00 nop 7cd5 00 nop 7cd6 00 nop 7cd7 00 nop 7cd8 00 nop 7cd9 00 nop 7cda 00 nop 7cdb 00 nop 7cdc 00 nop 7cdd 00 nop 7cde 00 nop 7cdf 00 nop 7ce0 00 nop 7ce1 00 nop 7ce2 00 nop 7ce3 00 nop 7ce4 00 nop 7ce5 00 nop 7ce6 00 nop 7ce7 00 nop 7ce8 00 nop 7ce9 00 nop 7cea 00 nop 7ceb 00 nop 7cec 00 nop 7ced 00 nop 7cee 00 nop 7cef 00 nop 7cf0 00 nop 7cf1 00 nop 7cf2 00 nop 7cf3 00 nop 7cf4 00 nop 7cf5 00 nop 7cf6 00 nop 7cf7 00 nop 7cf8 00 nop 7cf9 00 nop 7cfa 00 nop 7cfb 00 nop 7cfc 00 nop 7cfd 00 nop 7cfe 00 nop 7cff 00 nop 7d00 00 nop 7d01 00 nop 7d02 00 nop 7d03 00 nop 7d04 00 nop 7d05 00 nop 7d06 00 nop 7d07 00 nop 7d08 00 nop 7d09 00 nop 7d0a 00 nop 7d0b 00 nop 7d0c 00 nop 7d0d 00 nop 7d0e 00 nop 7d0f 00 nop 7d10 00 nop 7d11 00 nop 7d12 00 nop 7d13 00 nop 7d14 00 nop 7d15 00 nop 7d16 00 nop 7d17 00 nop 7d18 00 nop 7d19 00 nop 7d1a 00 nop 7d1b 00 nop 7d1c 00 nop 7d1d 00 nop 7d1e 00 nop 7d1f 00 nop 7d20 00 nop 7d21 00 nop 7d22 00 nop 7d23 00 nop 7d24 00 nop 7d25 00 nop 7d26 00 nop 7d27 00 nop 7d28 00 nop 7d29 00 nop 7d2a 00 nop 7d2b 00 nop 7d2c 00 nop 7d2d 00 nop 7d2e 00 nop 7d2f 00 nop 7d30 00 nop 7d31 00 nop 7d32 00 nop 7d33 00 nop 7d34 00 nop 7d35 00 nop 7d36 00 nop 7d37 00 nop 7d38 00 nop 7d39 00 nop 7d3a 00 nop 7d3b 00 nop 7d3c 00 nop 7d3d 00 nop 7d3e 00 nop 7d3f 00 nop 7d40 00 nop 7d41 00 nop 7d42 00 nop 7d43 00 nop 7d44 00 nop 7d45 00 nop 7d46 00 nop 7d47 00 nop 7d48 00 nop 7d49 00 nop 7d4a 00 nop 7d4b 00 nop 7d4c 00 nop 7d4d 00 nop 7d4e 00 nop 7d4f 00 nop 7d50 00 nop 7d51 00 nop 7d52 00 nop 7d53 00 nop 7d54 00 nop 7d55 00 nop 7d56 00 nop 7d57 00 nop 7d58 00 nop 7d59 00 nop 7d5a 00 nop 7d5b 00 nop 7d5c 00 nop 7d5d 00 nop 7d5e 00 nop 7d5f 00 nop 7d60 00 nop 7d61 00 nop 7d62 00 nop 7d63 00 nop 7d64 00 nop 7d65 00 nop 7d66 00 nop 7d67 00 nop 7d68 00 nop 7d69 00 nop 7d6a 00 nop 7d6b 00 nop 7d6c 00 nop 7d6d 00 nop 7d6e 00 nop 7d6f 00 nop 7d70 00 nop 7d71 00 nop 7d72 00 nop 7d73 00 nop 7d74 00 nop 7d75 00 nop 7d76 00 nop 7d77 00 nop 7d78 00 nop 7d79 00 nop 7d7a 00 nop 7d7b 00 nop 7d7c 00 nop 7d7d 00 nop 7d7e 00 nop 7d7f 00 nop 7d80 00 nop 7d81 00 nop 7d82 00 nop 7d83 00 nop 7d84 00 nop 7d85 00 nop 7d86 00 nop 7d87 00 nop 7d88 00 nop 7d89 00 nop 7d8a 00 nop 7d8b 00 nop 7d8c 00 nop 7d8d 00 nop 7d8e 00 nop 7d8f 00 nop 7d90 00 nop 7d91 00 nop 7d92 00 nop 7d93 00 nop 7d94 00 nop 7d95 00 nop 7d96 00 nop 7d97 00 nop 7d98 00 nop 7d99 00 nop 7d9a 00 nop 7d9b 00 nop 7d9c 00 nop 7d9d 00 nop 7d9e 00 nop 7d9f 00 nop 7da0 00 nop 7da1 00 nop 7da2 00 nop 7da3 00 nop 7da4 00 nop 7da5 00 nop 7da6 00 nop 7da7 00 nop 7da8 00 nop 7da9 00 nop 7daa 00 nop 7dab 00 nop 7dac 00 nop 7dad 00 nop 7dae 00 nop 7daf 00 nop 7db0 00 nop 7db1 00 nop 7db2 00 nop 7db3 00 nop 7db4 00 nop 7db5 00 nop 7db6 00 nop 7db7 00 nop 7db8 00 nop 7db9 00 nop 7dba 00 nop 7dbb 00 nop 7dbc 00 nop 7dbd 00 nop 7dbe 00 nop 7dbf 00 nop 7dc0 00 nop 7dc1 00 nop 7dc2 00 nop 7dc3 00 nop 7dc4 00 nop 7dc5 00 nop 7dc6 00 nop 7dc7 00 nop 7dc8 00 nop 7dc9 00 nop 7dca 00 nop 7dcb 00 nop 7dcc 00 nop 7dcd 00 nop 7dce 00 nop 7dcf 00 nop 7dd0 00 nop 7dd1 00 nop 7dd2 00 nop 7dd3 00 nop 7dd4 00 nop 7dd5 00 nop 7dd6 00 nop 7dd7 00 nop 7dd8 00 nop 7dd9 00 nop 7dda 00 nop 7ddb 00 nop 7ddc 00 nop 7ddd 00 nop 7dde 00 nop 7ddf 00 nop 7de0 00 nop 7de1 00 nop 7de2 00 nop 7de3 00 nop 7de4 00 nop 7de5 00 nop 7de6 00 nop 7de7 00 nop 7de8 00 nop 7de9 00 nop 7dea 00 nop 7deb 00 nop 7dec 00 nop 7ded 00 nop 7dee 00 nop 7def 00 nop 7df0 00 nop 7df1 00 nop 7df2 00 nop 7df3 00 nop 7df4 00 nop 7df5 00 nop 7df6 00 nop 7df7 00 nop 7df8 00 nop 7df9 00 nop 7dfa 00 nop 7dfb 00 nop 7dfc 00 nop 7dfd 00 nop 7dfe 00 nop 7dff 00 nop 7e00 00 nop 7e01 00 nop 7e02 00 nop 7e03 00 nop 7e04 00 nop 7e05 00 nop 7e06 00 nop 7e07 00 nop 7e08 00 nop 7e09 00 nop 7e0a 00 nop 7e0b 00 nop 7e0c 00 nop 7e0d 00 nop 7e0e 00 nop 7e0f 00 nop 7e10 00 nop 7e11 00 nop 7e12 00 nop 7e13 00 nop 7e14 00 nop 7e15 00 nop 7e16 00 nop 7e17 00 nop 7e18 00 nop 7e19 00 nop 7e1a 00 nop 7e1b 00 nop 7e1c 00 nop 7e1d 00 nop 7e1e 00 nop 7e1f 00 nop 7e20 00 nop 7e21 00 nop 7e22 00 nop 7e23 00 nop 7e24 00 nop 7e25 00 nop 7e26 00 nop 7e27 00 nop 7e28 00 nop 7e29 00 nop 7e2a 00 nop 7e2b 00 nop 7e2c 00 nop 7e2d 00 nop 7e2e 00 nop 7e2f 00 nop 7e30 00 nop 7e31 00 nop 7e32 00 nop 7e33 00 nop 7e34 00 nop 7e35 00 nop 7e36 00 nop 7e37 00 nop 7e38 00 nop 7e39 00 nop 7e3a 00 nop 7e3b 00 nop 7e3c 00 nop 7e3d 00 nop 7e3e 00 nop 7e3f 00 nop 7e40 00 nop 7e41 00 nop 7e42 00 nop 7e43 00 nop 7e44 00 nop 7e45 00 nop 7e46 00 nop 7e47 00 nop 7e48 00 nop 7e49 00 nop 7e4a 00 nop 7e4b 00 nop 7e4c 00 nop 7e4d 00 nop 7e4e 00 nop 7e4f 00 nop 7e50 00 nop 7e51 00 nop 7e52 00 nop 7e53 00 nop 7e54 00 nop 7e55 00 nop 7e56 00 nop 7e57 00 nop 7e58 00 nop 7e59 00 nop 7e5a 00 nop 7e5b 00 nop 7e5c 00 nop 7e5d 00 nop 7e5e 00 nop 7e5f 00 nop 7e60 00 nop 7e61 00 nop 7e62 00 nop 7e63 00 nop 7e64 00 nop 7e65 00 nop 7e66 00 nop 7e67 00 nop 7e68 00 nop 7e69 00 nop 7e6a 00 nop 7e6b 00 nop 7e6c 00 nop 7e6d 00 nop 7e6e 00 nop 7e6f 00 nop 7e70 00 nop 7e71 00 nop 7e72 00 nop 7e73 00 nop 7e74 00 nop 7e75 00 nop 7e76 00 nop 7e77 00 nop 7e78 00 nop 7e79 00 nop 7e7a 00 nop 7e7b 00 nop 7e7c 00 nop 7e7d 00 nop 7e7e 00 nop 7e7f 00 nop 7e80 00 nop 7e81 00 nop 7e82 00 nop 7e83 00 nop 7e84 00 nop 7e85 00 nop 7e86 00 nop 7e87 00 nop 7e88 00 nop 7e89 00 nop 7e8a 00 nop 7e8b 00 nop 7e8c 00 nop 7e8d 00 nop 7e8e 00 nop 7e8f 00 nop 7e90 00 nop 7e91 00 nop 7e92 00 nop 7e93 00 nop 7e94 00 nop 7e95 00 nop 7e96 00 nop 7e97 00 nop 7e98 00 nop 7e99 00 nop 7e9a 00 nop 7e9b 00 nop 7e9c 00 nop 7e9d 00 nop 7e9e 00 nop 7e9f 00 nop 7ea0 00 nop 7ea1 00 nop 7ea2 00 nop 7ea3 00 nop 7ea4 00 nop 7ea5 00 nop 7ea6 00 nop 7ea7 00 nop 7ea8 00 nop 7ea9 00 nop 7eaa 00 nop 7eab 00 nop 7eac 00 nop 7ead 00 nop 7eae 00 nop 7eaf 00 nop 7eb0 00 nop 7eb1 00 nop 7eb2 00 nop 7eb3 00 nop 7eb4 00 nop 7eb5 00 nop 7eb6 00 nop 7eb7 00 nop 7eb8 00 nop 7eb9 00 nop 7eba 00 nop 7ebb 00 nop 7ebc 00 nop 7ebd 00 nop 7ebe 00 nop 7ebf 00 nop 7ec0 00 nop 7ec1 00 nop 7ec2 00 nop 7ec3 00 nop 7ec4 00 nop 7ec5 00 nop 7ec6 00 nop 7ec7 00 nop 7ec8 00 nop 7ec9 00 nop 7eca 00 nop 7ecb 00 nop 7ecc 00 nop 7ecd 00 nop 7ece 00 nop 7ecf 00 nop 7ed0 00 nop 7ed1 00 nop 7ed2 00 nop 7ed3 00 nop 7ed4 00 nop 7ed5 00 nop 7ed6 00 nop 7ed7 00 nop 7ed8 00 nop 7ed9 00 nop 7eda 00 nop 7edb 00 nop 7edc 00 nop 7edd 00 nop 7ede 00 nop 7edf 00 nop 7ee0 00 nop 7ee1 00 nop 7ee2 00 nop 7ee3 00 nop 7ee4 00 nop 7ee5 00 nop 7ee6 00 nop 7ee7 00 nop 7ee8 00 nop 7ee9 00 nop 7eea 00 nop 7eeb 00 nop 7eec 00 nop 7eed 00 nop 7eee 00 nop 7eef 00 nop 7ef0 00 nop 7ef1 00 nop 7ef2 00 nop 7ef3 00 nop 7ef4 00 nop 7ef5 00 nop 7ef6 00 nop 7ef7 00 nop 7ef8 00 nop 7ef9 00 nop 7efa 00 nop 7efb 00 nop 7efc 00 nop 7efd 00 nop 7efe 00 nop 7eff 00 nop 7f00 00 nop 7f01 00 nop 7f02 00 nop 7f03 00 nop 7f04 00 nop 7f05 00 nop 7f06 00 nop 7f07 00 nop 7f08 00 nop 7f09 00 nop 7f0a 00 nop 7f0b 00 nop 7f0c 00 nop 7f0d 00 nop 7f0e 00 nop 7f0f 00 nop 7f10 00 nop 7f11 00 nop 7f12 00 nop 7f13 00 nop 7f14 00 nop 7f15 00 nop 7f16 00 nop 7f17 00 nop 7f18 00 nop 7f19 00 nop 7f1a 00 nop 7f1b 00 nop 7f1c 00 nop 7f1d 00 nop 7f1e 00 nop 7f1f 00 nop 7f20 00 nop 7f21 00 nop 7f22 00 nop 7f23 00 nop 7f24 00 nop 7f25 00 nop 7f26 00 nop 7f27 00 nop 7f28 00 nop 7f29 00 nop 7f2a 00 nop 7f2b 00 nop 7f2c 00 nop 7f2d 00 nop 7f2e 00 nop 7f2f 00 nop 7f30 00 nop 7f31 00 nop 7f32 00 nop 7f33 00 nop 7f34 00 nop 7f35 00 nop 7f36 00 nop 7f37 00 nop 7f38 00 nop 7f39 00 nop 7f3a 00 nop 7f3b 00 nop 7f3c 00 nop 7f3d 00 nop 7f3e 00 nop 7f3f 00 nop 7f40 00 nop 7f41 00 nop 7f42 00 nop 7f43 00 nop 7f44 00 nop 7f45 00 nop 7f46 00 nop 7f47 00 nop 7f48 00 nop 7f49 00 nop 7f4a 00 nop 7f4b 00 nop 7f4c 00 nop 7f4d 00 nop 7f4e 00 nop 7f4f 00 nop 7f50 00 nop 7f51 00 nop 7f52 00 nop 7f53 00 nop 7f54 00 nop 7f55 00 nop 7f56 00 nop 7f57 00 nop 7f58 00 nop 7f59 00 nop 7f5a 00 nop 7f5b 00 nop 7f5c 00 nop 7f5d 00 nop 7f5e 00 nop 7f5f 00 nop 7f60 00 nop 7f61 00 nop 7f62 00 nop 7f63 00 nop 7f64 00 nop 7f65 00 nop 7f66 00 nop 7f67 00 nop 7f68 00 nop 7f69 00 nop 7f6a 00 nop 7f6b 00 nop 7f6c 00 nop 7f6d 00 nop 7f6e 00 nop 7f6f 00 nop 7f70 00 nop 7f71 00 nop 7f72 00 nop 7f73 00 nop 7f74 00 nop 7f75 00 nop 7f76 00 nop 7f77 00 nop 7f78 00 nop 7f79 00 nop 7f7a 00 nop 7f7b 00 nop 7f7c 00 nop 7f7d 00 nop 7f7e 00 nop 7f7f 00 nop 7f80 00 nop 7f81 00 nop 7f82 00 nop 7f83 00 nop 7f84 00 nop 7f85 00 nop 7f86 00 nop 7f87 00 nop 7f88 00 nop 7f89 00 nop 7f8a 00 nop 7f8b 00 nop 7f8c 00 nop 7f8d 00 nop 7f8e 00 nop 7f8f 00 nop 7f90 00 nop 7f91 00 nop 7f92 00 nop 7f93 00 nop 7f94 00 nop 7f95 00 nop 7f96 00 nop 7f97 00 nop 7f98 00 nop 7f99 00 nop 7f9a 00 nop 7f9b 00 nop 7f9c 00 nop 7f9d 00 nop 7f9e 00 nop 7f9f 00 nop 7fa0 00 nop 7fa1 00 nop 7fa2 00 nop 7fa3 00 nop 7fa4 00 nop 7fa5 00 nop 7fa6 00 nop 7fa7 00 nop 7fa8 00 nop 7fa9 00 nop 7faa 00 nop 7fab 00 nop 7fac 00 nop 7fad 00 nop 7fae 00 nop 7faf 00 nop 7fb0 00 nop 7fb1 00 nop 7fb2 00 nop 7fb3 00 nop 7fb4 00 nop 7fb5 00 nop 7fb6 00 nop 7fb7 00 nop 7fb8 00 nop 7fb9 00 nop 7fba 00 nop 7fbb 00 nop 7fbc 00 nop 7fbd 00 nop 7fbe 00 nop 7fbf 00 nop 7fc0 00 nop 7fc1 00 nop 7fc2 00 nop 7fc3 00 nop 7fc4 00 nop 7fc5 00 nop 7fc6 00 nop 7fc7 00 nop 7fc8 00 nop 7fc9 00 nop 7fca 00 nop 7fcb 00 nop 7fcc 00 nop 7fcd 00 nop 7fce 00 nop 7fcf 00 nop 7fd0 00 nop 7fd1 00 nop 7fd2 00 nop 7fd3 00 nop 7fd4 00 nop 7fd5 00 nop 7fd6 00 nop 7fd7 00 nop 7fd8 00 nop 7fd9 00 nop 7fda 00 nop 7fdb 00 nop 7fdc 00 nop 7fdd 00 nop 7fde 00 nop 7fdf 00 nop 7fe0 00 nop 7fe1 00 nop 7fe2 00 nop 7fe3 00 nop 7fe4 00 nop 7fe5 00 nop 7fe6 00 nop 7fe7 00 nop 7fe8 00 nop 7fe9 00 nop 7fea 00 nop 7feb 00 nop 7fec 00 nop 7fed 00 nop 7fee 00 nop 7fef 00 nop 7ff0 00 nop 7ff1 00 nop 7ff2 00 nop 7ff3 00 nop 7ff4 00 nop 7ff5 00 nop 7ff6 00 nop 7ff7 00 nop 7ff8 00 nop 7ff9 00 nop 7ffa 00 nop 7ffb 00 nop 7ffc 00 nop 7ffd 00 nop 7ffe 00 nop 7fff 00 nop
; A250761: Number of (6+1) X (n+1) 0..2 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing x(i,j)+x(i-1,j) in the j direction. ; 9585,22197,40023,63063,91317,124785,163467,207363,256473,310797,370335,435087,505053,580233,660627,746235,837057,933093,1034343,1140807,1252485,1369377,1491483,1618803,1751337,1889085,2032047,2180223,2333613,2492217,2656035,2825067,2999313,3178773,3363447,3553335,3748437,3948753,4154283,4365027,4580985,4802157,5028543,5260143,5496957,5738985,5986227,6238683,6496353,6759237,7027335,7300647,7579173,7862913,8151867,8446035,8745417,9050013,9359823,9674847,9995085,10320537,10651203,10987083,11328177 mov $2,$0 add $2,1 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $5,$0 add $5,1 mov $6,0 mov $11,$0 lpb $5 mov $0,$11 sub $5,1 sub $0,$5 mov $7,$0 mov $9,2 lpb $9 sub $9,1 add $0,$9 sub $0,1 mov $3,2 add $3,$0 trn $3,3 add $3,3 mul $3,729 sub $3,1 mov $10,$9 lpb $10 mov $8,$3 sub $10,1 lpe lpe lpb $7 mov $7,0 sub $8,$3 lpe mov $3,$8 mul $3,3 add $3,3027 add $6,$3 lpe add $1,$6 lpe mov $0,$1
/* * Copyright 2020 Justas Masiulis * * 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. */ #pragma once #include "../sid.hpp" namespace ntw::se { template<std::size_t NSA> template<class... SubAuths> NTW_INLINE constexpr static_sid<NSA>::static_sid(SID_IDENTIFIER_AUTHORITY authority, SubAuths... subauthorities) noexcept : _sub_auth_count(sizeof...(SubAuths)) , _identifier_authority(authority) , _sub_authorities{ subauthorities... } {} template<std::size_t NSA> NTW_INLINE constexpr std::uint8_t static_sid<NSA>::size() const { return _sub_auth_count; } template<std::size_t NSA> NTW_INLINE constexpr std::uint8_t static_sid<NSA>::max_size() const { return NSA; } template<std::size_t NSA> NTW_INLINE constexpr const SID_IDENTIFIER_AUTHORITY& static_sid<NSA>::identifier_authority() const { return _identifier_authority; } template<std::size_t NSA> NTW_INLINE constexpr SID_IDENTIFIER_AUTHORITY& static_sid<NSA>::identifier_authority() { return _identifier_authority; } template<std::size_t NSA> NTW_INLINE constexpr std::span<const std::uint32_t> static_sid<NSA>::sub_authorities() const { return { _sub_authorities.data(), _sub_auth_count }; } template<std::size_t NSA> NTW_INLINE constexpr std::span<std::uint32_t> static_sid<NSA>::sub_authorities() { return { _sub_authorities.data(), _sub_auth_count }; } template<std::size_t NSA> NTW_INLINE constexpr void static_sid<NSA>::resize(std::size_t new_size) { _sub_auth_count = new_size; } template<std::size_t NSA> NTW_INLINE constexpr void static_sid<NSA>::push_back(std::uint32_t new_sub_auth) { _sub_authorities[_sub_auth_count++] = new_sub_auth; } } // namespace ntw::se
; A273781: Partial sums of the number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 929", based on the 5-celled von Neumann neighborhood. ; 1,5,26,74,155,276,445,670,959,1320,1761,2290,2915,3644,4485,5446,6535,7760,9129,10650,12331,14180,16205,18414,20815,23416,26225,29250,32499,35980,39701,43670,47895,52384,57145,62186,67515,73140,79069,85310,91871,98760,105985,113554,121475,129756,138405,147430,156839,166640,176841,187450,198475,209924,221805,234126,246895,260120,273809,287970,302611,317740,333365,349494,366135,383296,400985,419210,437979,457300,477181,497630,518655,540264,562465,585266,608675,632700,657349,682630,708551,735120,762345,790234,818795,848036,877965,908590,939919,971960,1004721,1038210,1072435,1107404,1143125,1179606,1216855,1254880,1293689,1333290,1373691,1414900,1456925,1499774,1543455,1587976,1633345,1679570,1726659,1774620,1823461,1873190,1923815,1975344,2027785,2081146,2135435,2190660,2246829,2303950,2362031,2421080,2481105,2542114,2604115,2667116,2731125,2796150,2862199 mov $2,$0 add $2,1 mov $8,$0 lpb $2,1 mov $0,$8 sub $2,1 sub $0,$2 mov $3,$0 mov $5,$0 mov $9,$0 mul $0,4 sub $3,4 mov $4,$9 pow $9,2 add $9,$4 lpb $0,1 add $3,$9 mov $0,$3 lpe add $0,1 mov $6,$5 mul $6,$5 mov $7,$6 mul $7,4 mov $9,$0 add $9,$7 add $1,$9 lpe
/** * @file introduction_to_pca.cpp * @brief This program demonstrates how to use OpenCV PCA to extract the orientation of an object * @author OpenCV team */ #include "opencv2/core.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include <iostream> using namespace std; using namespace cv; // Function declarations void drawAxis(Mat&, Point, Point, Scalar, const float); double getOrientation(const vector<Point> &, Mat&); /** * @function drawAxis */ void drawAxis(Mat& img, Point p, Point q, Scalar colour, const float scale = 0.2) { //! [visualization1] double angle = atan2( (double) p.y - q.y, (double) p.x - q.x ); // angle in radians double hypotenuse = sqrt( (double) (p.y - q.y) * (p.y - q.y) + (p.x - q.x) * (p.x - q.x)); // Here we lengthen the arrow by a factor of scale q.x = (int) (p.x - scale * hypotenuse * cos(angle)); q.y = (int) (p.y - scale * hypotenuse * sin(angle)); line(img, p, q, colour, 1, LINE_AA); // create the arrow hooks p.x = (int) (q.x + 9 * cos(angle + CV_PI / 4)); p.y = (int) (q.y + 9 * sin(angle + CV_PI / 4)); line(img, p, q, colour, 1, LINE_AA); p.x = (int) (q.x + 9 * cos(angle - CV_PI / 4)); p.y = (int) (q.y + 9 * sin(angle - CV_PI / 4)); line(img, p, q, colour, 1, LINE_AA); //! [visualization1] } /** * @function getOrientation */ double getOrientation(const vector<Point> &pts, Mat &img) { //! [pca] //Construct a buffer used by the pca analysis int sz = static_cast<int>(pts.size()); Mat data_pts = Mat(sz, 2, CV_64F); for (int i = 0; i < data_pts.rows; i++) { data_pts.at<double>(i, 0) = pts[i].x; data_pts.at<double>(i, 1) = pts[i].y; } //Perform PCA analysis PCA pca_analysis(data_pts, Mat(), PCA::DATA_AS_ROW); //Store the center of the object Point cntr = Point(static_cast<int>(pca_analysis.mean.at<double>(0, 0)), static_cast<int>(pca_analysis.mean.at<double>(0, 1))); //Store the eigenvalues and eigenvectors vector<Point2d> eigen_vecs(2); vector<double> eigen_val(2); for (int i = 0; i < 2; i++) { eigen_vecs[i] = Point2d(pca_analysis.eigenvectors.at<double>(i, 0), pca_analysis.eigenvectors.at<double>(i, 1)); eigen_val[i] = pca_analysis.eigenvalues.at<double>(i); } //! [pca] //! [visualization] // Draw the principal components circle(img, cntr, 3, Scalar(255, 0, 255), 2); Point p1 = cntr + 0.02 * Point(static_cast<int>(eigen_vecs[0].x * eigen_val[0]), static_cast<int>(eigen_vecs[0].y * eigen_val[0])); Point p2 = cntr - 0.02 * Point(static_cast<int>(eigen_vecs[1].x * eigen_val[1]), static_cast<int>(eigen_vecs[1].y * eigen_val[1])); drawAxis(img, cntr, p1, Scalar(0, 255, 0), 1); drawAxis(img, cntr, p2, Scalar(255, 255, 0), 5); double angle = atan2(eigen_vecs[0].y, eigen_vecs[0].x); // orientation in radians //! [visualization] return angle; } /** * @function main */ int main(int argc, char** argv) { //! [pre-process] // Load image CommandLineParser parser(argc, argv, "{@input | pca_test1.jpg | input image}"); parser.about( "This program demonstrates how to use OpenCV PCA to extract the orientation of an object.\n" ); parser.printMessage(); Mat src = imread( samples::findFile( parser.get<String>("@input") ) ); // Check if image is loaded successfully if(src.empty()) { cout << "Problem loading image!!!" << endl; return EXIT_FAILURE; } imshow("src", src); // Convert image to grayscale Mat gray; cvtColor(src, gray, COLOR_BGR2GRAY); // Convert image to binary Mat bw; threshold(gray, bw, 50, 255, THRESH_BINARY | THRESH_OTSU); //! [pre-process] //! [contours] // Find all the contours in the thresholded image vector<vector<Point> > contours; findContours(bw, contours, RETR_LIST, CHAIN_APPROX_NONE); for (size_t i = 0; i < contours.size(); i++) { // Calculate the area of each contour double area = contourArea(contours[i]); // Ignore contours that are too small or too large if (area < 1e2 || 1e5 < area) continue; // Draw each contour only for visualisation purposes drawContours(src, contours, static_cast<int>(i), Scalar(0, 0, 255), 2); // Find the orientation of each shape getOrientation(contours[i], src); } //! [contours] imshow("output", src); waitKey(); return EXIT_SUCCESS; }
// Copyright (c) 2019 The PIVX developers // Copyright (c) 2021 The INFINCOIN developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addressbook.h" #include <string> namespace AddressBook { namespace AddressBookPurpose { const std::string UNKNOWN{"unknown"}; const std::string RECEIVE{"receive"}; const std::string SEND{"send"}; const std::string DELEGABLE{"delegable"}; const std::string DELEGATOR{"delegator"}; const std::string COLD_STAKING{"coldstaking"}; const std::string COLD_STAKING_SEND{"coldstaking_send"}; const std::string SHIELDED_RECEIVE{"shielded_receive"}; const std::string SHIELDED_SEND{"shielded_spend"}; } bool IsColdStakingPurpose(const std::string& purpose) { return purpose == AddressBookPurpose::COLD_STAKING || purpose == AddressBookPurpose::COLD_STAKING_SEND; } bool IsShieldedPurpose(const std::string& purpose) { return purpose == AddressBookPurpose::SHIELDED_RECEIVE || purpose == AddressBookPurpose::SHIELDED_SEND; } bool CAddressBookData::isSendColdStakingPurpose() const { return purpose == AddressBookPurpose::COLD_STAKING_SEND; } bool CAddressBookData::isSendPurpose() const { return purpose == AddressBookPurpose::SEND; } bool CAddressBookData::isReceivePurpose() const { return purpose == AddressBookPurpose::RECEIVE; } bool CAddressBookData::isShieldedReceivePurpose() const { return purpose == AddressBookPurpose::SHIELDED_RECEIVE; } bool CAddressBookData::isShielded() const { return IsShieldedPurpose(purpose); } }
// dear imgui, v1.69 WIP // (demo code) // Message to the person tempted to delete this file when integrating Dear ImGui into their code base: // Do NOT remove this file from your project! Think again! It is the most useful reference code that you and other coders // will want to refer to and call. Have the ImGui::ShowDemoWindow() function wired in an always-available debug menu of // your game/app! Removing this file from your project is hindering access to documentation for everyone in your team, // likely leading you to poorer usage of the library. // Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow(). // If you want to link core Dear ImGui in your shipped builds but want an easy guarantee that the demo will not be linked, // you can setup your imconfig.h with #define IMGUI_DISABLE_DEMO_WINDOWS and those functions will be empty. // In other situation, whenever you have Dear ImGui available you probably want this to be available for reference. // Thank you, // -Your beloved friend, imgui_demo.cpp (that you won't delete) // Message to beginner C/C++ programmers about the meaning of the 'static' keyword: // In this demo code, we frequently we use 'static' variables inside functions. A static variable persist across calls, so it is // essentially like a global variable but declared inside the scope of the function. We do this as a way to gather code and data // in the same place, to make the demo source code faster to read, faster to write, and smaller in size. // It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be reentrant // or used in threads. This might be a pattern you will want to use in your code, but most of the real data you would be editing is // likely going to be stored outside your functions. /* Index of this file: // [SECTION] Forward Declarations, Helpers // [SECTION] Demo Window / ShowDemoWindow() // [SECTION] About Window / ShowAboutWindow() // [SECTION] Style Editor / ShowStyleEditor() // [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() // [SECTION] Example App: Debug Console / ShowExampleAppConsole() // [SECTION] Example App: Debug Log / ShowExampleAppLog() // [SECTION] Example App: Simple Layout / ShowExampleAppLayout() // [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() // [SECTION] Example App: Long Text / ShowExampleAppLongText() // [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() // [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include "imgui.h" #include <ctype.h> // toupper, isprint #include <limits.h> // INT_MIN, INT_MAX #include <math.h> // sqrtf, powf, cosf, sinf, floorf, ceilf #include <stdio.h> // vsnprintf, sscanf, printf #include <stdlib.h> // NULL, malloc, free, atoi #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier #include <stddef.h> // intptr_t #else #include <stdint.h> // intptr_t #endif #ifdef _MSC_VER #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif #ifdef __clang__ #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. #pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code) #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' #pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. #pragma clang diagnostic ignored "-Wunused-macros" // warning : warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used. #if __has_warning("-Wzero-as-null-pointer-constant") #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 #endif #if __has_warning("-Wdouble-promotion") #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #endif #if __has_warning("-Wreserved-id-macro") #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // #endif #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size #pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure) #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value #if (__GNUC__ >= 6) #pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub. #endif #endif // Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n. #ifdef _WIN32 #define IM_NEWLINE "\r\n" #define snprintf _snprintf #define vsnprintf _vsnprintf #else #define IM_NEWLINE "\n" #endif #define IM_MAX(_A,_B) (((_A) >= (_B)) ? (_A) : (_B)) //----------------------------------------------------------------------------- // [SECTION] Forward Declarations, Helpers //----------------------------------------------------------------------------- #if !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && defined(IMGUI_DISABLE_TEST_WINDOWS) && !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Obsolete name since 1.53, TEST->DEMO #define IMGUI_DISABLE_DEMO_WINDOWS #endif #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Forward Declarations static void ShowExampleAppDocuments(bool* p_open); static void ShowExampleAppMainMenuBar(); static void ShowExampleAppConsole(bool* p_open); static void ShowExampleAppLog(bool* p_open); static void ShowExampleAppLayout(bool* p_open); static void ShowExampleAppPropertyEditor(bool* p_open); static void ShowExampleAppLongText(bool* p_open); static void ShowExampleAppAutoResize(bool* p_open); static void ShowExampleAppConstrainedResize(bool* p_open); static void ShowExampleAppSimpleOverlay(bool* p_open); static void ShowExampleAppWindowTitles(bool* p_open); static void ShowExampleAppCustomRendering(bool* p_open); static void ShowExampleMenuFile(); // Helper to display a little (?) mark which shows a tooltip when hovered. static void ShowHelpMarker(const char* desc) { ImGui::TextDisabled("(?)"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); ImGui::TextUnformatted(desc); ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } } // Helper to display basic user controls. void ImGui::ShowUserGuide() { ImGui::BulletText("Double-click on title bar to collapse window."); ImGui::BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents)."); ImGui::BulletText("Click and drag on any empty space to move window."); ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields."); ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text."); if (ImGui::GetIO().FontAllowUserScaling) ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents."); ImGui::BulletText("Mouse Wheel to scroll."); ImGui::BulletText("While editing text:\n"); ImGui::Indent(); ImGui::BulletText("Hold SHIFT or use mouse to select text."); ImGui::BulletText("CTRL+Left/Right to word jump."); ImGui::BulletText("CTRL+A or double-click to select all."); ImGui::BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard."); ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo."); ImGui::BulletText("ESCAPE to revert."); ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract."); ImGui::Unindent(); } //----------------------------------------------------------------------------- // [SECTION] Demo Window / ShowDemoWindow() //----------------------------------------------------------------------------- // We split the contents of the big ShowDemoWindow() function into smaller functions (because the link time of very large functions grow non-linearly) static void ShowDemoWindowWidgets(); static void ShowDemoWindowLayout(); static void ShowDemoWindowPopups(); static void ShowDemoWindowColumns(); static void ShowDemoWindowMisc(); // Demonstrate most Dear ImGui features (this is big function!) // You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature. void ImGui::ShowDemoWindow(bool* p_open) { // Examples Apps (accessible from the "Examples" menu) static bool show_app_documents = false; static bool show_app_main_menu_bar = false; static bool show_app_console = false; static bool show_app_log = false; static bool show_app_layout = false; static bool show_app_property_editor = false; static bool show_app_long_text = false; static bool show_app_auto_resize = false; static bool show_app_constrained_resize = false; static bool show_app_simple_overlay = false; static bool show_app_window_titles = false; static bool show_app_custom_rendering = false; if (show_app_documents) ShowExampleAppDocuments(&show_app_documents); // Process the Document app next, as it may also use a DockSpace() if (show_app_main_menu_bar) ShowExampleAppMainMenuBar(); if (show_app_console) ShowExampleAppConsole(&show_app_console); if (show_app_log) ShowExampleAppLog(&show_app_log); if (show_app_layout) ShowExampleAppLayout(&show_app_layout); if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor); if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text); if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize); if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize); if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay); if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles); if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering); // Dear ImGui Apps (accessible from the "Help" menu) static bool show_app_metrics = false; static bool show_app_style_editor = false; static bool show_app_about = false; if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); } if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); } if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); } // Demonstrate the various window flags. Typically you would just use the default! static bool no_titlebar = false; static bool no_scrollbar = false; static bool no_menu = false; static bool no_move = false; static bool no_resize = false; static bool no_collapse = false; static bool no_close = false; static bool no_nav = false; static bool no_background = false; static bool no_bring_to_front = false; ImGuiWindowFlags window_flags = 0; if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar; if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar; if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar; if (no_move) window_flags |= ImGuiWindowFlags_NoMove; if (no_resize) window_flags |= ImGuiWindowFlags_NoResize; if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse; if (no_nav) window_flags |= ImGuiWindowFlags_NoNav; if (no_background) window_flags |= ImGuiWindowFlags_NoBackground; if (no_bring_to_front) window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus; if (no_close) p_open = NULL; // Don't pass our bool* to Begin // We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming. ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver); // Main body of the Demo window starts here. if (!ImGui::Begin("ImGui Demo", p_open, window_flags)) { // Early out if the window is collapsed, as an optimization. ImGui::End(); return; } ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION); // Most "big" widgets share a common width settings by default. //ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // Use 2/3 of the space for widgets and 1/3 for labels (default) ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size. // Menu if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("Menu")) { ShowExampleMenuFile(); ImGui::EndMenu(); } if (ImGui::BeginMenu("Examples")) { ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar); ImGui::MenuItem("Console", NULL, &show_app_console); ImGui::MenuItem("Log", NULL, &show_app_log); ImGui::MenuItem("Simple layout", NULL, &show_app_layout); ImGui::MenuItem("Property editor", NULL, &show_app_property_editor); ImGui::MenuItem("Long text display", NULL, &show_app_long_text); ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize); ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize); ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay); ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles); ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering); ImGui::MenuItem("Documents", NULL, &show_app_documents); ImGui::EndMenu(); } if (ImGui::BeginMenu("Help")) { ImGui::MenuItem("Metrics", NULL, &show_app_metrics); ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor); ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about); ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Spacing(); if (ImGui::CollapsingHeader("Help")) { ImGui::Text("PROGRAMMER GUIDE:"); ImGui::BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!"); ImGui::BulletText("Please see the comments in imgui.cpp."); ImGui::BulletText("Please see the examples/ in application."); ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls."); ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls."); ImGui::Separator(); ImGui::Text("USER GUIDE:"); ImGui::ShowUserGuide(); } if (ImGui::CollapsingHeader("Configuration")) { ImGuiIO& io = ImGui::GetIO(); if (ImGui::TreeNode("Configuration##2")) { ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad); ImGui::SameLine(); ShowHelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details."); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos); ImGui::SameLine(); ShowHelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos."); ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouse); if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) // Create a way to restore this flag otherwise we could be stuck completely! { if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f) { ImGui::SameLine(); ImGui::Text("<<PRESS SPACE TO DISABLE>>"); } if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse; } ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange); ImGui::SameLine(); ShowHelpMarker("Instruct back-end to not alter mouse cursor shape and visibility."); ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink); ImGui::SameLine(); ShowHelpMarker("Set to false to disable blinking cursor, for users who consider it distracting"); ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges); ImGui::SameLine(); ShowHelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); ImGui::SameLine(); ShowHelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Backend Flags")) { ShowHelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities."); ImGuiBackendFlags backend_flags = io.BackendFlags; // Make a local copy to avoid modifying the back-end flags. ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad); ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors); ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasSetMousePos); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Style")) { ImGui::ShowStyleEditor(); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Capture/Logging")) { ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded."); ShowHelpMarker("Try opening any of the contents below in this window and then click one of the \"Log To\" button."); ImGui::LogButtons(); ImGui::TextWrapped("You can also call ImGui::LogText() to output directly to the log without a visual output."); if (ImGui::Button("Copy \"Hello, world!\" to clipboard")) { ImGui::LogToClipboard(); ImGui::LogText("Hello, world!"); ImGui::LogFinish(); } ImGui::TreePop(); } } if (ImGui::CollapsingHeader("Window options")) { ImGui::Checkbox("No titlebar", &no_titlebar); ImGui::SameLine(150); ImGui::Checkbox("No scrollbar", &no_scrollbar); ImGui::SameLine(300); ImGui::Checkbox("No menu", &no_menu); ImGui::Checkbox("No move", &no_move); ImGui::SameLine(150); ImGui::Checkbox("No resize", &no_resize); ImGui::SameLine(300); ImGui::Checkbox("No collapse", &no_collapse); ImGui::Checkbox("No close", &no_close); ImGui::SameLine(150); ImGui::Checkbox("No nav", &no_nav); ImGui::SameLine(300); ImGui::Checkbox("No background", &no_background); ImGui::Checkbox("No bring to front", &no_bring_to_front); } // All demo contents ShowDemoWindowWidgets(); ShowDemoWindowLayout(); ShowDemoWindowPopups(); ShowDemoWindowColumns(); ShowDemoWindowMisc(); // End of ShowDemoWindow() ImGui::End(); } static void ShowDemoWindowWidgets() { if (!ImGui::CollapsingHeader("Widgets")) return; if (ImGui::TreeNode("Basic")) { static int clicked = 0; if (ImGui::Button("Button")) clicked++; if (clicked & 1) { ImGui::SameLine(); ImGui::Text("Thanks for clicking me!"); } static bool check = true; ImGui::Checkbox("checkbox", &check); static int e = 0; ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine(); ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine(); ImGui::RadioButton("radio c", &e, 2); // Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style. for (int i = 0; i < 7; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.6f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i/7.0f, 0.8f, 0.8f)); ImGui::Button("Click"); ImGui::PopStyleColor(3); ImGui::PopID(); } // Use AlignTextToFramePadding() to align text baseline to the baseline of framed elements (otherwise a Text+SameLine+Button sequence will have the text a little too high by default) ImGui::AlignTextToFramePadding(); ImGui::Text("Hold to repeat:"); ImGui::SameLine(); // Arrow buttons with Repeater static int counter = 0; float spacing = ImGui::GetStyle().ItemInnerSpacing.x; ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; } ImGui::SameLine(0.0f, spacing); if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; } ImGui::PopButtonRepeat(); ImGui::SameLine(); ImGui::Text("%d", counter); ImGui::Text("Hover over me"); if (ImGui::IsItemHovered()) ImGui::SetTooltip("I am a tooltip"); ImGui::SameLine(); ImGui::Text("- or me"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::Text("I am a fancy tooltip"); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); ImGui::EndTooltip(); } ImGui::Separator(); ImGui::LabelText("label", "Value"); { // Using the _simplified_ one-liner Combo() api here // See "Combo" section for examples of how to use the more complete BeginCombo()/EndCombo() api. const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; static int item_current = 0; ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); ShowHelpMarker("Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n"); } { static char str0[128] = "Hello, world!"; static int i0 = 123; ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0)); ImGui::SameLine(); ShowHelpMarker("USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp)."); ImGui::InputInt("input int", &i0); ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n"); static float f0 = 0.001f; ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f"); static double d0 = 999999.00000001; ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f"); static float f1 = 1.e10f; ImGui::InputFloat("input scientific", &f1, 0.0f, 0.0f, "%e"); ImGui::SameLine(); ShowHelpMarker("You can input value using the scientific notation,\n e.g. \"1e+8\" becomes \"100000000\".\n"); static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; ImGui::InputFloat3("input float3", vec4a); } { static int i1 = 50, i2 = 42; ImGui::DragInt("drag int", &i1, 1); ImGui::SameLine(); ShowHelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value."); ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%"); static float f1=1.00f, f2=0.0067f; ImGui::DragFloat("drag float", &f1, 0.005f); ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns"); } { static int i1=0; ImGui::SliderInt("slider int", &i1, -1, 3); ImGui::SameLine(); ShowHelpMarker("CTRL+click to input value."); static float f1=0.123f, f2=0.0f; ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f"); ImGui::SliderFloat("slider float (curve)", &f2, -10.0f, 10.0f, "%.4f", 2.0f); static float angle = 0.0f; ImGui::SliderAngle("slider angle", &angle); } { static float col1[3] = { 1.0f,0.0f,0.2f }; static float col2[4] = { 0.4f,0.7f,0.0f,0.5f }; ImGui::ColorEdit3("color 1", col1); ImGui::SameLine(); ShowHelpMarker("Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n"); ImGui::ColorEdit4("color 2", col2); } { // List box const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" }; static int listbox_item_current = 1; ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4); //static int listbox_item_current2 = 2; //ImGui::PushItemWidth(-1); //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4); //ImGui::PopItemWidth(); } ImGui::TreePop(); } // Testing ImGuiOnceUponAFrame helper. //static ImGuiOnceUponAFrame once; //for (int i = 0; i < 5; i++) // if (once) // ImGui::Text("This will be displayed only once."); if (ImGui::TreeNode("Trees")) { if (ImGui::TreeNode("Basic trees")) { for (int i = 0; i < 5; i++) if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i)) { ImGui::Text("blah blah"); ImGui::SameLine(); if (ImGui::SmallButton("button")) { }; ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Advanced, with Selectable nodes")) { ShowHelpMarker("This is a more standard looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open."); static bool align_label_with_current_x_position = false; ImGui::Checkbox("Align label with current X position)", &align_label_with_current_x_position); ImGui::Text("Hello!"); if (align_label_with_current_x_position) ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing()); static int selection_mask = (1 << 2); // Dumb representation of what may be user-side selection state. You may carry selection state inside or outside your objects in whatever format you see fit. int node_clicked = -1; // Temporary storage of what node we have clicked to process selection at the end of the loop. May be a pointer to your own node type, etc. ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, ImGui::GetFontSize()*3); // Increase spacing to differentiate leaves from expanded contents. for (int i = 0; i < 6; i++) { // Disable the default open on single-click behavior and pass in Selected flag according to our selection state. ImGuiTreeNodeFlags node_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ((selection_mask & (1 << i)) ? ImGuiTreeNodeFlags_Selected : 0); if (i < 3) { // Node bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i); if (ImGui::IsItemClicked()) node_clicked = i; if (node_open) { ImGui::Text("Blah blah\nBlah Blah"); ImGui::TreePop(); } } else { // Leaf: The only reason we have a TreeNode at all is to allow selection of the leaf. Otherwise we can use BulletText() or TreeAdvanceToLabelPos()+Text(). node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i); if (ImGui::IsItemClicked()) node_clicked = i; } } if (node_clicked != -1) { // Update selection state. Process outside of tree loop to avoid visual inconsistencies during the clicking-frame. if (ImGui::GetIO().KeyCtrl) selection_mask ^= (1 << node_clicked); // CTRL+click to toggle else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, this commented bit preserve selection when clicking on item that is part of the selection selection_mask = (1 << node_clicked); // Click to single-select } ImGui::PopStyleVar(); if (align_label_with_current_x_position) ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing()); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Collapsing Headers")) { static bool closable_group = true; ImGui::Checkbox("Enable extra group", &closable_group); if (ImGui::CollapsingHeader("Header")) { ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); for (int i = 0; i < 5; i++) ImGui::Text("Some content %d", i); } if (ImGui::CollapsingHeader("Header with a close button", &closable_group)) { ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); for (int i = 0; i < 5; i++) ImGui::Text("More content %d", i); } ImGui::TreePop(); } if (ImGui::TreeNode("Bullets")) { ImGui::BulletText("Bullet point 1"); ImGui::BulletText("Bullet point 2\nOn multiple lines"); ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)"); ImGui::Bullet(); ImGui::SmallButton("Button"); ImGui::TreePop(); } if (ImGui::TreeNode("Text")) { if (ImGui::TreeNode("Colored Text")) { // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility. ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink"); ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow"); ImGui::TextDisabled("Disabled"); ImGui::SameLine(); ShowHelpMarker("The TextDisabled color is stored in ImGuiStyle."); ImGui::TreePop(); } if (ImGui::TreeNode("Word Wrapping")) { // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility. ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages."); ImGui::Spacing(); static float wrap_width = 200.0f; ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f"); ImGui::Text("Test paragraph 1:"); ImVec2 pos = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width); ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); ImGui::PopTextWrapPos(); ImGui::Text("Test paragraph 2:"); pos = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh"); ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); ImGui::PopTextWrapPos(); ImGui::TreePop(); } if (ImGui::TreeNode("UTF-8 Text")) { // UTF-8 test with Japanese characters // (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read misc/fonts/README.txt for details.) // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8 // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature') // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE. // Instead we are encoding a few strings with hexadecimal constants. Don't do this in your application! // Please use u8"text in any language" in your application! // Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application. ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read misc/fonts/README.txt for details."); ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string. ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)"); static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e"; //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Images")) { ImGuiIO& io = ImGui::GetIO(); ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!"); // Here we are grabbing the font texture because that's the only one we have access to inside the demo code. // Remember that ImTextureID is just storage for whatever you want it to be, it is essentially a value that will be passed to the render function inside the ImDrawCmd structure. // If you use one of the default imgui_impl_XXXX.cpp renderer, they all have comments at the top of their file to specify what they expect to be stored in ImTextureID. // (for example, the imgui_impl_dx11.cpp renderer expect a 'ID3D11ShaderResourceView*' pointer. The imgui_impl_glfw_gl3.cpp renderer expect a GLuint OpenGL texture identifier etc.) // If you decided that ImTextureID = MyEngineTexture*, then you can pass your MyEngineTexture* pointers to ImGui::Image(), and gather width/height through your own functions, etc. // Using ShowMetricsWindow() as a "debugger" to inspect the draw data that are being passed to your render will help you debug issues if you are confused about this. // Consider using the lower-level ImDrawList::AddImage() API, via ImGui::GetWindowDrawList()->AddImage(). ImTextureID my_tex_id = io.Fonts->TexID; float my_tex_w = (float)io.Fonts->TexWidth; float my_tex_h = (float)io.Fonts->TexHeight; ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h); ImVec2 pos = ImGui::GetCursorScreenPos(); ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128)); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); float region_sz = 32.0f; float region_x = io.MousePos.x - pos.x - region_sz * 0.5f; if (region_x < 0.0f) region_x = 0.0f; else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz; float region_y = io.MousePos.y - pos.y - region_sz * 0.5f; if (region_y < 0.0f) region_y = 0.0f; else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz; float zoom = 4.0f; ImGui::Text("Min: (%.2f, %.2f)", region_x, region_y); ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz); ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h); ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h); ImGui::Image(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImColor(255,255,255,255), ImColor(255,255,255,128)); ImGui::EndTooltip(); } ImGui::TextWrapped("And now some textured buttons.."); static int pressed_count = 0; for (int i = 0; i < 8; i++) { ImGui::PushID(i); int frame_padding = -1 + i; // -1 = uses default padding if (ImGui::ImageButton(my_tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/my_tex_w,32/my_tex_h), frame_padding, ImColor(0,0,0,255))) pressed_count += 1; ImGui::PopID(); ImGui::SameLine(); } ImGui::NewLine(); ImGui::Text("Pressed %d times.", pressed_count); ImGui::TreePop(); } if (ImGui::TreeNode("Combo")) { // Expose flags as checkbox for the demo static ImGuiComboFlags flags = 0; ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", (unsigned int*)&flags, ImGuiComboFlags_PopupAlignLeft); if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", (unsigned int*)&flags, ImGuiComboFlags_NoArrowButton)) flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", (unsigned int*)&flags, ImGuiComboFlags_NoPreview)) flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both // General BeginCombo() API, you have full control over your selection data and display type. // (your selection data could be an index, a pointer to the object, an id for the object, a flag stored in the object itself, etc.) const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; static const char* item_current = items[0]; // Here our selection is a single pointer stored outside the object. if (ImGui::BeginCombo("combo 1", item_current, flags)) // The second parameter is the label previewed before opening the combo. { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { bool is_selected = (item_current == items[n]); if (ImGui::Selectable(items[n], is_selected)) item_current = items[n]; if (is_selected) ImGui::SetItemDefaultFocus(); // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch) } ImGui::EndCombo(); } // Simplified one-liner Combo() API, using values packed in a single constant string static int item_current_2 = 0; ImGui::Combo("combo 2 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); // Simplified one-liner Combo() using an array of const char* static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items)); // Simplified one-liner Combo() using an accessor function struct FuncHolder { static bool ItemGetter(void* data, int idx, const char** out_str) { *out_str = ((const char**)data)[idx]; return true; } }; static int item_current_4 = 0; ImGui::Combo("combo 4 (function)", &item_current_4, &FuncHolder::ItemGetter, items, IM_ARRAYSIZE(items)); ImGui::TreePop(); } if (ImGui::TreeNode("Selectables")) { // Selectable() has 2 overloads: // - The one taking "bool selected" as a read-only selection information. When Selectable() has been clicked is returns true and you can alter selection state accordingly. // - The one taking "bool* p_selected" as a read-write selection information (convenient in some cases) // The earlier is more flexible, as in real application your selection may be stored in a different manner (in flags within objects, as an external list, etc). if (ImGui::TreeNode("Basic")) { static bool selection[5] = { false, true, false, false, false }; ImGui::Selectable("1. I am selectable", &selection[0]); ImGui::Selectable("2. I am selectable", &selection[1]); ImGui::Text("3. I am not selectable"); ImGui::Selectable("4. I am selectable", &selection[3]); if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick)) if (ImGui::IsMouseDoubleClicked(0)) selection[4] = !selection[4]; ImGui::TreePop(); } if (ImGui::TreeNode("Selection State: Single Selection")) { static int selected = -1; for (int n = 0; n < 5; n++) { char buf[32]; sprintf(buf, "Object %d", n); if (ImGui::Selectable(buf, selected == n)) selected = n; } ImGui::TreePop(); } if (ImGui::TreeNode("Selection State: Multiple Selection")) { ShowHelpMarker("Hold CTRL and click to select multiple items."); static bool selection[5] = { false, false, false, false, false }; for (int n = 0; n < 5; n++) { char buf[32]; sprintf(buf, "Object %d", n); if (ImGui::Selectable(buf, selection[n])) { if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held memset(selection, 0, sizeof(selection)); selection[n] ^= 1; } } ImGui::TreePop(); } if (ImGui::TreeNode("Rendering more text into the same line")) { // Using the Selectable() override that takes "bool* p_selected" parameter and toggle your booleans automatically. static bool selected[3] = { false, false, false }; ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes"); ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::TreePop(); } if (ImGui::TreeNode("In columns")) { ImGui::Columns(3, NULL, false); static bool selected[16] = { 0 }; for (int i = 0; i < 16; i++) { char label[32]; sprintf(label, "Item %d", i); if (ImGui::Selectable(label, &selected[i])) {} ImGui::NextColumn(); } ImGui::Columns(1); ImGui::TreePop(); } if (ImGui::TreeNode("Grid")) { static bool selected[4*4] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true }; for (int i = 0; i < 4*4; i++) { ImGui::PushID(i); if (ImGui::Selectable("Sailor", &selected[i], 0, ImVec2(50,50))) { // Note: We _unnecessarily_ test for both x/y and i here only to silence some static analyzer. The second part of each test is unnecessary. int x = i % 4; int y = i / 4; if (x > 0) { selected[i - 1] ^= 1; } if (x < 3 && i < 15) { selected[i + 1] ^= 1; } if (y > 0 && i > 3) { selected[i - 4] ^= 1; } if (y < 3 && i < 12) { selected[i + 4] ^= 1; } } if ((i % 4) < 3) ImGui::SameLine(); ImGui::PopID(); } ImGui::TreePop(); } if (ImGui::TreeNode("Alignment")) { ShowHelpMarker("Alignment applies when a selectable is larger than its text content.\nBy default, Selectables uses style.SelectableTextAlign but it can be overriden on a per-item basis using PushStyleVar()."); static bool selected[3*3] = { true, false, true, false, true, false, true, false, true }; for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { ImVec2 alignment = ImVec2((float)x / 2.0f, (float)y / 2.0f); char name[32]; sprintf(name, "(%.1f,%.1f)", alignment.x, alignment.y); if (x > 0) ImGui::SameLine(); ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, alignment); ImGui::Selectable(name, &selected[3*y+x], ImGuiSelectableFlags_None, ImVec2(80,80)); ImGui::PopStyleVar(); } } ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Filtered Text Input")) { static char buf1[64] = ""; ImGui::InputText("default", buf1, 64); static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal); static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase); static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase); static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank); struct TextFilters { static int FilterImGuiLetters(ImGuiInputTextCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } }; static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters); ImGui::Text("Password input"); static char bufpass[64] = "password123"; ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank); ImGui::SameLine(); ShowHelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n"); ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank); ImGui::TreePop(); } if (ImGui::TreeNode("Multi-line Text Input")) { // Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize // and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings. static bool read_only = false; static char text[1024*16] = "/*\n" " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n" " the hexadecimal encoding of one offending instruction,\n" " more formally, the invalid operand with locked CMPXCHG8B\n" " instruction bug, is a design flaw in the majority of\n" " Intel Pentium, Pentium MMX, and Pentium OverDrive\n" " processors (all in the P5 microarchitecture).\n" "*/\n\n" "label:\n" "\tlock cmpxchg8b eax\n"; ShowHelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp)"); ImGui::Checkbox("Read-only", &read_only); ImGuiInputTextFlags flags = ImGuiInputTextFlags_AllowTabInput | (read_only ? ImGuiInputTextFlags_ReadOnly : 0); ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), flags); ImGui::TreePop(); } if (ImGui::TreeNode("Plots Widgets")) { static bool animate = true; ImGui::Checkbox("Animate", &animate); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr)); // Create a dummy array of contiguous float values to plot // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter. static float values[90] = { 0 }; static int values_offset = 0; static double refresh_time = 0.0; if (!animate || refresh_time == 0.0) refresh_time = ImGui::GetTime(); while (refresh_time < ImGui::GetTime()) // Create dummy data at fixed 60 hz rate for the demo { static float phase = 0.0f; values[values_offset] = cosf(phase); values_offset = (values_offset+1) % IM_ARRAYSIZE(values); phase += 0.10f*values_offset; refresh_time += 1.0f/60.0f; } ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80)); ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80)); // Use functions to generate output // FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count. struct Funcs { static float Sin(void*, int i) { return sinf(i * 0.1f); } static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; } }; static int func_type = 0, display_count = 70; ImGui::Separator(); ImGui::PushItemWidth(100); ImGui::Combo("func", &func_type, "Sin\0Saw\0"); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::SliderInt("Sample count", &display_count, 1, 400); float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw; ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); ImGui::Separator(); // Animate a simple progress bar static float progress = 0.0f, progress_dir = 1.0f; if (animate) { progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime; if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; } if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; } } // Typically we would use ImVec2(-1.0f,0.0f) to use all available width, or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth. ImGui::ProgressBar(progress, ImVec2(0.0f,0.0f)); ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); ImGui::Text("Progress Bar"); float progress_saturated = (progress < 0.0f) ? 0.0f : (progress > 1.0f) ? 1.0f : progress; char buf[32]; sprintf(buf, "%d/%d", (int)(progress_saturated*1753), 1753); ImGui::ProgressBar(progress, ImVec2(0.f,0.f), buf); ImGui::TreePop(); } if (ImGui::TreeNode("Color/Picker Widgets")) { static ImVec4 color = ImVec4(114.0f/255.0f, 144.0f/255.0f, 154.0f/255.0f, 200.0f/255.0f); static bool alpha_preview = true; static bool alpha_half_preview = false; static bool drag_and_drop = true; static bool options_menu = true; static bool hdr = false; ImGui::Checkbox("With Alpha Preview", &alpha_preview); ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview); ImGui::Checkbox("With Drag and Drop", &drag_and_drop); ImGui::Checkbox("With Options Menu", &options_menu); ImGui::SameLine(); ShowHelpMarker("Right-click on the individual color widget to show options."); ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); ShowHelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets."); int misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions); ImGui::Text("Color widget:"); ImGui::SameLine(); ShowHelpMarker("Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n"); ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags); ImGui::Text("Color widget HSV with Alpha:"); ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | misc_flags); ImGui::Text("Color widget with Float Display:"); ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags); ImGui::Text("Color button with Picker:"); ImGui::SameLine(); ShowHelpMarker("With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup."); ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags); ImGui::Text("Color button with Custom Picker Popup:"); // Generate a dummy default palette. The palette will persist and can be edited. static bool saved_palette_init = true; static ImVec4 saved_palette[32] = { }; if (saved_palette_init) { for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) { ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f, saved_palette[n].x, saved_palette[n].y, saved_palette[n].z); saved_palette[n].w = 1.0f; // Alpha } saved_palette_init = false; } static ImVec4 backup_color; bool open_popup = ImGui::ColorButton("MyColor##3b", color, misc_flags); ImGui::SameLine(); open_popup |= ImGui::Button("Palette"); if (open_popup) { ImGui::OpenPopup("mypicker"); backup_color = color; } if (ImGui::BeginPopup("mypicker")) { ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!"); ImGui::Separator(); ImGui::ColorPicker4("##picker", (float*)&color, misc_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview); ImGui::SameLine(); ImGui::BeginGroup(); // Lock X position ImGui::Text("Current"); ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40)); ImGui::Text("Previous"); if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40))) color = backup_color; ImGui::Separator(); ImGui::Text("Palette"); for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) { ImGui::PushID(n); if ((n % 8) != 0) ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y); if (ImGui::ColorButton("##palette", saved_palette[n], ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip, ImVec2(20,20))) color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha! // Allow user to drop colors into each palette entry // (Note that ColorButton is already a drag source by default, unless using ImGuiColorEditFlags_NoDragDrop) if (ImGui::BeginDragDropTarget()) { if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3); if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F)) memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4); ImGui::EndDragDropTarget(); } ImGui::PopID(); } ImGui::EndGroup(); ImGui::EndPopup(); } ImGui::Text("Color button only:"); ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags, ImVec2(80,80)); ImGui::Text("Color picker:"); static bool alpha = true; static bool alpha_bar = true; static bool side_preview = true; static bool ref_color = false; static ImVec4 ref_color_v(1.0f,0.0f,1.0f,0.5f); static int display_mode = 0; static int picker_mode = 0; ImGui::Checkbox("With Alpha", &alpha); ImGui::Checkbox("With Alpha Bar", &alpha_bar); ImGui::Checkbox("With Side Preview", &side_preview); if (side_preview) { ImGui::SameLine(); ImGui::Checkbox("With Ref Color", &ref_color); if (ref_color) { ImGui::SameLine(); ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | misc_flags); } } ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0"); ImGui::SameLine(); ShowHelpMarker("ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions()."); ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0"); ImGui::SameLine(); ShowHelpMarker("User can right-click the picker to change mode."); ImGuiColorEditFlags flags = misc_flags; if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4() if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar; if (!side_preview) flags |= ImGuiColorEditFlags_NoSidePreview; if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar; if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel; if (display_mode == 1) flags |= ImGuiColorEditFlags_NoInputs; // Disable all RGB/HSV/Hex displays if (display_mode == 2) flags |= ImGuiColorEditFlags_DisplayRGB; // Override display mode if (display_mode == 3) flags |= ImGuiColorEditFlags_DisplayHSV; if (display_mode == 4) flags |= ImGuiColorEditFlags_DisplayHex; ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL); ImGui::Text("Programmatically set defaults:"); ImGui::SameLine(); ShowHelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible."); if (ImGui::Button("Default: Uint8 + HSV + Hue Bar")) ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar); if (ImGui::Button("Default: Float + HDR + Hue Wheel")) ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel); ImGui::TreePop(); } if (ImGui::TreeNode("Range Widgets")) { static float begin = 10, end = 90; static int begin_i = 100, end_i = 1000; ImGui::DragFloatRange2("range", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%"); ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units"); ImGui::TreePop(); } if (ImGui::TreeNode("Data Types")) { // The DragScalar/InputScalar/SliderScalar functions allow various data types: signed/unsigned int/long long and float/double // To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum to pass the type, // and passing all arguments by address. // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types. // In practice, if you frequently use a given type that is not covered by the normal API entry points, you can wrap it // yourself inside a 1 line function which can take typed argument as value instead of void*, and then pass their address // to the generic function. For example: // bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld") // { // return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format); // } // Limits (as helper variables that we can take the address of) // Note that the SliderScalar function has a maximum usable range of half the natural type maximum, hence the /2 below. #ifndef LLONG_MIN ImS64 LLONG_MIN = -9223372036854775807LL - 1; ImS64 LLONG_MAX = 9223372036854775807LL; ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1); #endif const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127; const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255; const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767; const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535; const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2; const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2; const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2; const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2; const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f; const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0; // State static char s8_v = 127; static ImU8 u8_v = 255; static short s16_v = 32767; static ImU16 u16_v = 65535; static ImS32 s32_v = -1; static ImU32 u32_v = (ImU32)-1; static ImS64 s64_v = -1; static ImU64 u64_v = (ImU64)-1; static float f32_v = 0.123f; static double f64_v = 90000.01234567890123456789; const float drag_speed = 0.2f; static bool drag_clamp = false; ImGui::Text("Drags:"); ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp); ImGui::SameLine(); ShowHelpMarker("As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value."); ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL); ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL); ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL); ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL); ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL); ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 1.0f); ImGui::DragScalar("drag float ^2", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 2.0f); ImGui::SameLine(); ShowHelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range."); ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams", 1.0f); ImGui::DragScalar("drag double ^2", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", 2.0f); ImGui::Text("Sliders"); ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d"); ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u"); ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d"); ImGui::SliderScalar("slider u16 full", ImGuiDataType_U16, &u16_v, &u16_min, &u16_max, "%u"); ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d"); ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d"); ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d"); ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u"); ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u"); ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u"); ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%I64d"); ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%I64d"); ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%I64d"); ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%I64u ms"); ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%I64u ms"); ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%I64u ms"); ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one); ImGui::SliderScalar("slider float low^2", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", 2.0f); ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e"); ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams", 1.0f); ImGui::SliderScalar("slider double low^2",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", 2.0f); ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams", 1.0f); static bool inputs_step = true; ImGui::Text("Inputs"); ImGui::Checkbox("Show step buttons", &inputs_step); ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d"); ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u"); ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d"); ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u"); ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d"); ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u"); ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL); ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL); ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL); ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL); ImGui::TreePop(); } if (ImGui::TreeNode("Multi-component Widgets")) { static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; static int vec4i[4] = { 1, 5, 100, 255 }; ImGui::InputFloat2("input float2", vec4f); ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f); ImGui::InputInt2("input int2", vec4i); ImGui::DragInt2("drag int2", vec4i, 1, 0, 255); ImGui::SliderInt2("slider int2", vec4i, 0, 255); ImGui::Spacing(); ImGui::InputFloat3("input float3", vec4f); ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f); ImGui::InputInt3("input int3", vec4i); ImGui::DragInt3("drag int3", vec4i, 1, 0, 255); ImGui::SliderInt3("slider int3", vec4i, 0, 255); ImGui::Spacing(); ImGui::InputFloat4("input float4", vec4f); ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f); ImGui::InputInt4("input int4", vec4i); ImGui::DragInt4("drag int4", vec4i, 1, 0, 255); ImGui::SliderInt4("slider int4", vec4i, 0, 255); ImGui::TreePop(); } if (ImGui::TreeNode("Vertical Sliders")) { const float spacing = 4; ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing)); static int int_value = 0; ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5); ImGui::SameLine(); static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f }; ImGui::PushID("set1"); for (int i = 0; i < 7; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleColor(ImGuiCol_FrameBg, (ImVec4)ImColor::HSV(i/7.0f, 0.5f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_SliderGrab, (ImVec4)ImColor::HSV(i/7.0f, 0.9f, 0.9f)); ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, ""); if (ImGui::IsItemActive() || ImGui::IsItemHovered()) ImGui::SetTooltip("%.3f", values[i]); ImGui::PopStyleColor(4); ImGui::PopID(); } ImGui::PopID(); ImGui::SameLine(); ImGui::PushID("set2"); static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f }; const int rows = 3; const ImVec2 small_slider_size(18, (160.0f-(rows-1)*spacing)/rows); for (int nx = 0; nx < 4; nx++) { if (nx > 0) ImGui::SameLine(); ImGui::BeginGroup(); for (int ny = 0; ny < rows; ny++) { ImGui::PushID(nx*rows+ny); ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, ""); if (ImGui::IsItemActive() || ImGui::IsItemHovered()) ImGui::SetTooltip("%.3f", values2[nx]); ImGui::PopID(); } ImGui::EndGroup(); } ImGui::PopID(); ImGui::SameLine(); ImGui::PushID("set3"); for (int i = 0; i < 4; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40); ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f\nsec"); ImGui::PopStyleVar(); ImGui::PopID(); } ImGui::PopID(); ImGui::PopStyleVar(); ImGui::TreePop(); } if (ImGui::TreeNode("Drag and Drop")) { { // ColorEdit widgets automatically act as drag source and drag target. // They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets // to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo. ImGui::BulletText("Drag and drop in standard widgets"); ImGui::Indent(); static float col1[3] = { 1.0f,0.0f,0.2f }; static float col2[4] = { 0.4f,0.7f,0.0f,0.5f }; ImGui::ColorEdit3("color 1", col1); ImGui::ColorEdit4("color 2", col2); ImGui::Unindent(); } { ImGui::BulletText("Drag and drop to copy/swap items"); ImGui::Indent(); enum Mode { Mode_Copy, Mode_Move, Mode_Swap }; static int mode = 0; if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine(); if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine(); if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; } static const char* names[9] = { "Bobby", "Beatrice", "Betty", "Brianna", "Barry", "Bernard", "Bibi", "Blaine", "Bryn" }; for (int n = 0; n < IM_ARRAYSIZE(names); n++) { ImGui::PushID(n); if ((n % 3) != 0) ImGui::SameLine(); ImGui::Button(names[n], ImVec2(60,60)); // Our buttons are both drag sources and drag targets here! if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) { ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything) if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.) if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); } if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); } ImGui::EndDragDropSource(); } if (ImGui::BeginDragDropTarget()) { if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL")) { IM_ASSERT(payload->DataSize == sizeof(int)); int payload_n = *(const int*)payload->Data; if (mode == Mode_Copy) { names[n] = names[payload_n]; } if (mode == Mode_Move) { names[n] = names[payload_n]; names[payload_n] = ""; } if (mode == Mode_Swap) { const char* tmp = names[n]; names[n] = names[payload_n]; names[payload_n] = tmp; } } ImGui::EndDragDropTarget(); } ImGui::PopID(); } ImGui::Unindent(); } ImGui::TreePop(); } if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)")) { // Display the value of IsItemHovered() and other common item state functions. Note that the flags can be combined. // (because BulletText is an item itself and that would affect the output of IsItemHovered() we pass all state in a single call to simplify the code). static int item_type = 1; static bool b = false; static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f }; static char str[16] = {}; ImGui::RadioButton("Text", &item_type, 0); ImGui::RadioButton("Button", &item_type, 1); ImGui::RadioButton("Checkbox", &item_type, 2); ImGui::RadioButton("SliderFloat", &item_type, 3); ImGui::RadioButton("InputText", &item_type, 4); ImGui::RadioButton("ColorEdit4", &item_type, 5); ImGui::RadioButton("ListBox", &item_type, 6); ImGui::Separator(); bool ret = false; if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button if (item_type == 2) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox if (item_type == 3) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item if (item_type == 4) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing) if (item_type == 5) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged) if (item_type == 6) { const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); } ImGui::BulletText( "Return value = %d\n" "IsItemFocused() = %d\n" "IsItemHovered() = %d\n" "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n" "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n" "IsItemHovered(_AllowWhenOverlapped) = %d\n" "IsItemHovered(_RectOnly) = %d\n" "IsItemActive() = %d\n" "IsItemEdited() = %d\n" "IsItemActivated() = %d\n" "IsItemDeactivated() = %d\n" "IsItemDeactivatedEdit() = %d\n" "IsItemVisible() = %d\n" "GetItemRectMin() = (%.1f, %.1f)\n" "GetItemRectMax() = (%.1f, %.1f)\n" "GetItemRectSize() = (%.1f, %.1f)", ret, ImGui::IsItemFocused(), ImGui::IsItemHovered(), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped), ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly), ImGui::IsItemActive(), ImGui::IsItemEdited(), ImGui::IsItemActivated(), ImGui::IsItemDeactivated(), ImGui::IsItemDeactivatedAfterEdit(), ImGui::IsItemVisible(), ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y, ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y, ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y ); static bool embed_all_inside_a_child_window = false; ImGui::Checkbox("Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window); if (embed_all_inside_a_child_window) ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true); // Testing IsWindowFocused() function with its various flags. Note that the flags can be combined. ImGui::BulletText( "IsWindowFocused() = %d\n" "IsWindowFocused(_ChildWindows) = %d\n" "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n" "IsWindowFocused(_RootWindow) = %d\n" "IsWindowFocused(_AnyWindow) = %d\n", ImGui::IsWindowFocused(), ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows), ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow), ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow), ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)); // Testing IsWindowHovered() function with its various flags. Note that the flags can be combined. ImGui::BulletText( "IsWindowHovered() = %d\n" "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n" "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n" "IsWindowHovered(_ChildWindows) = %d\n" "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n" "IsWindowHovered(_RootWindow) = %d\n" "IsWindowHovered(_AnyWindow) = %d\n", ImGui::IsWindowHovered(), ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)); ImGui::BeginChild("child", ImVec2(0, 50), true); ImGui::Text("This is another child window for testing the _ChildWindows flag."); ImGui::EndChild(); if (embed_all_inside_a_child_window) ImGui::EndChild(); // Calling IsItemHovered() after begin returns the hovered status of the title bar. // This is useful in particular if you want to create a context menu (with BeginPopupContextItem) associated to the title bar of a window. static bool test_window = false; ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window); if (test_window) { ImGui::Begin("Title bar Hovered/Active tests", &test_window); if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered() { if (ImGui::MenuItem("Close")) { test_window = false; } ImGui::EndPopup(); } ImGui::Text( "IsItemHovered() after begin = %d (== is title bar hovered)\n" "IsItemActive() after begin = %d (== is window being clicked/moved)\n", ImGui::IsItemHovered(), ImGui::IsItemActive()); ImGui::End(); } ImGui::TreePop(); } } static void ShowDemoWindowLayout() { if (!ImGui::CollapsingHeader("Layout")) return; if (ImGui::TreeNode("Child windows")) { ShowHelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); static bool disable_mouse_wheel = false; static bool disable_menu = false; ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel); ImGui::Checkbox("Disable Menu", &disable_menu); static int line = 50; bool goto_line = ImGui::Button("Goto"); ImGui::SameLine(); ImGui::PushItemWidth(100); goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue); ImGui::PopItemWidth(); // Child 1: no border, enable horizontal scrollbar { ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0); ImGui::BeginChild("Child1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 260), false, window_flags); for (int i = 0; i < 100; i++) { ImGui::Text("%04d: scrollable region", i); if (goto_line && line == i) ImGui::SetScrollHereY(); } if (goto_line && line >= 100) ImGui::SetScrollHereY(); ImGui::EndChild(); } ImGui::SameLine(); // Child 2: rounded border { ImGuiWindowFlags window_flags = (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0) | (disable_menu ? 0 : ImGuiWindowFlags_MenuBar); ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); ImGui::BeginChild("Child2", ImVec2(0, 260), true, window_flags); if (!disable_menu && ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("Menu")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Columns(2); for (int i = 0; i < 100; i++) { char buf[32]; sprintf(buf, "%03d", i); ImGui::Button(buf, ImVec2(-1.0f, 0.0f)); ImGui::NextColumn(); } ImGui::EndChild(); ImGui::PopStyleVar(); } ImGui::Separator(); // Demonstrate a few extra things // - Changing ImGuiCol_ChildBg (which is transparent black in default styles) // - Using SetCursorPos() to position the child window (because the child window is an item from the POV of the parent window) // You can also call SetNextWindowPos() to position the child window. The parent window will effectively layout from this position. // - Using ImGui::GetItemRectMin/Max() to query the "item" state (because the child window is an item from the POV of the parent window) // See "Widgets" -> "Querying Status (Active/Focused/Hovered etc.)" section for more details about this. { ImGui::SetCursorPosX(50); ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100)); ImGui::BeginChild("blah", ImVec2(200, 100), true, ImGuiWindowFlags_None); for (int n = 0; n < 50; n++) ImGui::Text("Some test %d", n); ImGui::EndChild(); ImVec2 child_rect_min = ImGui::GetItemRectMin(); ImVec2 child_rect_max = ImGui::GetItemRectMax(); ImGui::PopStyleColor(); ImGui::Text("Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.x, child_rect_min.y, child_rect_max.x, child_rect_max.y); } ImGui::TreePop(); } if (ImGui::TreeNode("Widgets Width")) { static float f = 0.0f; ImGui::Text("PushItemWidth(100)"); ImGui::SameLine(); ShowHelpMarker("Fixed width."); ImGui::PushItemWidth(100); ImGui::DragFloat("float##1", &f); ImGui::PopItemWidth(); ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f)"); ImGui::SameLine(); ShowHelpMarker("Half of window width."); ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f); ImGui::DragFloat("float##2", &f); ImGui::PopItemWidth(); ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f)"); ImGui::SameLine(); ShowHelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)"); ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f); ImGui::DragFloat("float##3", &f); ImGui::PopItemWidth(); ImGui::Text("PushItemWidth(-100)"); ImGui::SameLine(); ShowHelpMarker("Align to right edge minus 100"); ImGui::PushItemWidth(-100); ImGui::DragFloat("float##4", &f); ImGui::PopItemWidth(); ImGui::Text("PushItemWidth(-1)"); ImGui::SameLine(); ShowHelpMarker("Align to right edge"); ImGui::PushItemWidth(-1); ImGui::DragFloat("float##5", &f); ImGui::PopItemWidth(); ImGui::TreePop(); } if (ImGui::TreeNode("Basic Horizontal Layout")) { ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceding item)"); // Text ImGui::Text("Two items: Hello"); ImGui::SameLine(); ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); // Adjust spacing ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20); ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); // Button ImGui::AlignTextToFramePadding(); ImGui::Text("Normal buttons"); ImGui::SameLine(); ImGui::Button("Banana"); ImGui::SameLine(); ImGui::Button("Apple"); ImGui::SameLine(); ImGui::Button("Corniflower"); // Button ImGui::Text("Small buttons"); ImGui::SameLine(); ImGui::SmallButton("Like this one"); ImGui::SameLine(); ImGui::Text("can fit within a text block."); // Aligned to arbitrary position. Easy/cheap column. ImGui::Text("Aligned"); ImGui::SameLine(150); ImGui::Text("x=150"); ImGui::SameLine(300); ImGui::Text("x=300"); ImGui::Text("Aligned"); ImGui::SameLine(150); ImGui::SmallButton("x=150"); ImGui::SameLine(300); ImGui::SmallButton("x=300"); // Checkbox static bool c1 = false, c2 = false, c3 = false, c4 = false; ImGui::Checkbox("My", &c1); ImGui::SameLine(); ImGui::Checkbox("Tailor", &c2); ImGui::SameLine(); ImGui::Checkbox("Is", &c3); ImGui::SameLine(); ImGui::Checkbox("Rich", &c4); // Various static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f; ImGui::PushItemWidth(80); const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" }; static int item = -1; ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); ImGui::SliderFloat("X", &f0, 0.0f, 5.0f); ImGui::SameLine(); ImGui::SliderFloat("Y", &f1, 0.0f, 5.0f); ImGui::SameLine(); ImGui::SliderFloat("Z", &f2, 0.0f, 5.0f); ImGui::PopItemWidth(); ImGui::PushItemWidth(80); ImGui::Text("Lists:"); static int selection[4] = { 0, 1, 2, 3 }; for (int i = 0; i < 4; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items)); ImGui::PopID(); //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i); } ImGui::PopItemWidth(); // Dummy ImVec2 button_sz(40, 40); ImGui::Button("A", button_sz); ImGui::SameLine(); ImGui::Dummy(button_sz); ImGui::SameLine(); ImGui::Button("B", button_sz); // Manually wrapping (we should eventually provide this as an automatic layout feature, but for now you can do it manually) ImGui::Text("Manually wrapping:"); ImGuiStyle& style = ImGui::GetStyle(); int buttons_count = 20; float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x; for (int n = 0; n < buttons_count; n++) { ImGui::PushID(n); ImGui::Button("Box", button_sz); float last_button_x2 = ImGui::GetItemRectMax().x; float next_button_x2 = last_button_x2 + style.ItemSpacing.x + button_sz.x; // Expected position if next button was on same line if (n + 1 < buttons_count && next_button_x2 < window_visible_x2) ImGui::SameLine(); ImGui::PopID(); } ImGui::TreePop(); } if (ImGui::TreeNode("Tabs")) { if (ImGui::TreeNode("Basic")) { ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None; if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) { if (ImGui::BeginTabItem("Avocado")) { ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Broccoli")) { ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Cucumber")) { ImGui::Text("This is the Cucumber tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::Separator(); ImGui::TreePop(); } if (ImGui::TreeNode("Advanced & Close Button")) { // Expose a couple of the available flags. In most cases you may just call BeginTabBar() with no flags (0). static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable; ImGui::CheckboxFlags("ImGuiTabBarFlags_Reorderable", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_Reorderable); ImGui::CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_AutoSelectNewTabs); ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton); ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton); if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0) tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_; if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown)) tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyResizeDown); if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyScroll)) tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll); // Tab Bar const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" }; static bool opened[4] = { true, true, true, true }; // Persistent user state for (int n = 0; n < IM_ARRAYSIZE(opened); n++) { if (n > 0) { ImGui::SameLine(); } ImGui::Checkbox(names[n], &opened[n]); } // Passing a bool* to BeginTabItem() is similar to passing one to Begin(): the underlying bool will be set to false when the tab is closed. if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) { for (int n = 0; n < IM_ARRAYSIZE(opened); n++) if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n])) { ImGui::Text("This is the %s tab!", names[n]); if (n & 1) ImGui::Text("I am an odd tab."); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::Separator(); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Groups")) { ShowHelpMarker("Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it."); ImGui::BeginGroup(); { ImGui::BeginGroup(); ImGui::Button("AAA"); ImGui::SameLine(); ImGui::Button("BBB"); ImGui::SameLine(); ImGui::BeginGroup(); ImGui::Button("CCC"); ImGui::Button("DDD"); ImGui::EndGroup(); ImGui::SameLine(); ImGui::Button("EEE"); ImGui::EndGroup(); if (ImGui::IsItemHovered()) ImGui::SetTooltip("First group hovered"); } // Capture the group size and create widgets using the same size ImVec2 size = ImGui::GetItemRectSize(); const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f }; ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size); ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); ImGui::SameLine(); ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); ImGui::EndGroup(); ImGui::SameLine(); ImGui::Button("LEVERAGE\nBUZZWORD", size); ImGui::SameLine(); if (ImGui::ListBoxHeader("List", size)) { ImGui::Selectable("Selected", true); ImGui::Selectable("Not Selected", false); ImGui::ListBoxFooter(); } ImGui::TreePop(); } if (ImGui::TreeNode("Text Baseline Alignment")) { ShowHelpMarker("This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets."); ImGui::Text("One\nTwo\nThree"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Text("Banana"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("One\nTwo\nThree"); ImGui::Button("HOP##1"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Button("HOP##2"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Button("TEST##1"); ImGui::SameLine(); ImGui::Text("TEST"); ImGui::SameLine(); ImGui::SmallButton("TEST##2"); ImGui::AlignTextToFramePadding(); // If your line starts with text, call this to align it to upcoming widgets. ImGui::Text("Text aligned to Widget"); ImGui::SameLine(); ImGui::Button("Widget##1"); ImGui::SameLine(); ImGui::Text("Widget"); ImGui::SameLine(); ImGui::SmallButton("Widget##2"); ImGui::SameLine(); ImGui::Button("Widget##3"); // Tree const float spacing = ImGui::GetStyle().ItemInnerSpacing.x; ImGui::Button("Button##1"); ImGui::SameLine(0.0f, spacing); if (ImGui::TreeNode("Node##1")) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data ImGui::AlignTextToFramePadding(); // Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit). bool node_open = ImGui::TreeNode("Node##2"); // Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content. ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##2"); if (node_open) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data // Bullet ImGui::Button("Button##3"); ImGui::SameLine(0.0f, spacing); ImGui::BulletText("Bullet text"); ImGui::AlignTextToFramePadding(); ImGui::BulletText("Node"); ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##4"); ImGui::TreePop(); } if (ImGui::TreeNode("Scrolling")) { ShowHelpMarker("Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given position."); static bool track = true; static int track_line = 50, scroll_to_px = 200; ImGui::Checkbox("Track", &track); ImGui::PushItemWidth(100); ImGui::SameLine(130); track |= ImGui::DragInt("##line", &track_line, 0.25f, 0, 99, "Line = %d"); bool scroll_to = ImGui::Button("Scroll To Pos"); ImGui::SameLine(130); scroll_to |= ImGui::DragInt("##pos_y", &scroll_to_px, 1.00f, 0, 9999, "Y = %d px"); ImGui::PopItemWidth(); if (scroll_to) track = false; for (int i = 0; i < 5; i++) { if (i > 0) ImGui::SameLine(); ImGui::BeginGroup(); ImGui::Text("%s", i == 0 ? "Top" : i == 1 ? "25%" : i == 2 ? "Center" : i == 3 ? "75%" : "Bottom"); ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true); if (scroll_to) ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_px, i * 0.25f); for (int line = 0; line < 100; line++) { if (track && line == track_line) { ImGui::TextColored(ImVec4(1,1,0,1), "Line %d", line); ImGui::SetScrollHereY(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom } else { ImGui::Text("Line %d", line); } } float scroll_y = ImGui::GetScrollY(), scroll_max_y = ImGui::GetScrollMaxY(); ImGui::EndChild(); ImGui::Text("%.0f/%0.f", scroll_y, scroll_max_y); ImGui::EndGroup(); } ImGui::TreePop(); } if (ImGui::TreeNode("Horizontal Scrolling")) { ShowHelpMarker("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\nYou may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin()."); static int lines = 7; ImGui::SliderInt("Lines", &lines, 1, 15); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f)); ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar); for (int line = 0; line < lines; line++) { // Display random stuff (for the sake of this trivial demo we are using basic Button+SameLine. If you want to create your own time line for a real application you may be better off // manipulating the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets yourself. You may also want to use the lower-level ImDrawList API) int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3); for (int n = 0; n < num_buttons; n++) { if (n > 0) ImGui::SameLine(); ImGui::PushID(n + line * 1000); char num_buf[16]; sprintf(num_buf, "%d", n); const char* label = (!(n%15)) ? "FizzBuzz" : (!(n%3)) ? "Fizz" : (!(n%5)) ? "Buzz" : num_buf; float hue = n*0.05f; ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f)); ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f)); ImGui::PopStyleColor(3); ImGui::PopID(); } } float scroll_x = ImGui::GetScrollX(), scroll_max_x = ImGui::GetScrollMaxX(); ImGui::EndChild(); ImGui::PopStyleVar(2); float scroll_x_delta = 0.0f; ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) { scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); ImGui::Text("Scroll from code"); ImGui::SameLine(); ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) { scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); ImGui::Text("%.0f/%.0f", scroll_x, scroll_max_x); if (scroll_x_delta != 0.0f) { ImGui::BeginChild("scrolling"); // Demonstrate a trick: you can use Begin to set yourself in the context of another window (here we are already out of your child window) ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta); ImGui::EndChild(); } ImGui::TreePop(); } if (ImGui::TreeNode("Clipping")) { static ImVec2 size(100, 100), offset(50, 20); ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost."); ImGui::DragFloat2("size", (float*)&size, 0.5f, 1.0f, 200.0f, "%.0f"); ImGui::TextWrapped("(Click and drag)"); ImVec2 pos = ImGui::GetCursorScreenPos(); ImVec4 clip_rect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); ImGui::InvisibleButton("##dummy", size); if (ImGui::IsItemActive() && ImGui::IsMouseDragging()) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; } ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x + size.x, pos.y + size.y), IM_COL32(90, 90, 120, 255)); ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect); ImGui::TreePop(); } } static void ShowDemoWindowPopups() { if (!ImGui::CollapsingHeader("Popups & Modal windows")) return; // The properties of popups windows are: // - They block normal mouse hovering detection outside them. (*) // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE. // - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls. // User can manipulate the visibility state by calling OpenPopup(). // (*) One can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup. // Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time. // Typical use for regular windows: // bool my_tool_is_active = false; if (ImGui::Button("Open")) my_tool_is_active = true; [...] if (my_tool_is_active) Begin("My Tool", &my_tool_is_active) { [...] } End(); // Typical use for popups: // if (ImGui::Button("Open")) ImGui::OpenPopup("MyPopup"); if (ImGui::BeginPopup("MyPopup") { [...] EndPopup(); } // With popups we have to go through a library call (here OpenPopup) to manipulate the visibility state. // This may be a bit confusing at first but it should quickly make sense. Follow on the examples below. if (ImGui::TreeNode("Popups")) { ImGui::TextWrapped("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it."); static int selected_fish = -1; const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" }; static bool toggles[] = { true, false, false, false, false }; // Simple selection popup // (If you want to show the current selection inside the Button itself, you may want to build a string using the "###" operator to preserve a constant ID with a variable label) if (ImGui::Button("Select..")) ImGui::OpenPopup("my_select_popup"); ImGui::SameLine(); ImGui::TextUnformatted(selected_fish == -1 ? "<None>" : names[selected_fish]); if (ImGui::BeginPopup("my_select_popup")) { ImGui::Text("Aquarium"); ImGui::Separator(); for (int i = 0; i < IM_ARRAYSIZE(names); i++) if (ImGui::Selectable(names[i])) selected_fish = i; ImGui::EndPopup(); } // Showing a menu with toggles if (ImGui::Button("Toggle..")) ImGui::OpenPopup("my_toggle_popup"); if (ImGui::BeginPopup("my_toggle_popup")) { for (int i = 0; i < IM_ARRAYSIZE(names); i++) ImGui::MenuItem(names[i], "", &toggles[i]); if (ImGui::BeginMenu("Sub-menu")) { ImGui::MenuItem("Click me"); ImGui::EndMenu(); } ImGui::Separator(); ImGui::Text("Tooltip here"); if (ImGui::IsItemHovered()) ImGui::SetTooltip("I am a tooltip over a popup"); if (ImGui::Button("Stacked Popup")) ImGui::OpenPopup("another popup"); if (ImGui::BeginPopup("another popup")) { for (int i = 0; i < IM_ARRAYSIZE(names); i++) ImGui::MenuItem(names[i], "", &toggles[i]); if (ImGui::BeginMenu("Sub-menu")) { ImGui::MenuItem("Click me"); ImGui::EndMenu(); } ImGui::EndPopup(); } ImGui::EndPopup(); } // Call the more complete ShowExampleMenuFile which we use in various places of this demo if (ImGui::Button("File Menu..")) ImGui::OpenPopup("my_file_popup"); if (ImGui::BeginPopup("my_file_popup")) { ShowExampleMenuFile(); ImGui::EndPopup(); } ImGui::TreePop(); } if (ImGui::TreeNode("Context menus")) { // BeginPopupContextItem() is a helper to provide common/simple popup behavior of essentially doing: // if (IsItemHovered() && IsMouseReleased(0)) // OpenPopup(id); // return BeginPopup(id); // For more advanced uses you may want to replicate and cuztomize this code. This the comments inside BeginPopupContextItem() implementation. static float value = 0.5f; ImGui::Text("Value = %.3f (<-- right-click here)", value); if (ImGui::BeginPopupContextItem("item context menu")) { if (ImGui::Selectable("Set to zero")) value = 0.0f; if (ImGui::Selectable("Set to PI")) value = 3.1415f; ImGui::PushItemWidth(-1); ImGui::DragFloat("##Value", &value, 0.1f, 0.0f, 0.0f); ImGui::PopItemWidth(); ImGui::EndPopup(); } // We can also use OpenPopupOnItemClick() which is the same as BeginPopupContextItem() but without the Begin call. // So here we will make it that clicking on the text field with the right mouse button (1) will toggle the visibility of the popup above. ImGui::Text("(You can also right-click me to the same popup as above.)"); ImGui::OpenPopupOnItemClick("item context menu", 1); // When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem(). // BeginPopupContextItem() will use the last item ID as the popup ID. // In addition here, we want to include your editable label inside the button label. We use the ### operator to override the ID (read FAQ about ID for details) static char name[32] = "Label1"; char buf[64]; sprintf(buf, "Button: %s###Button", name); // ### operator override ID ignoring the preceding label ImGui::Button(buf); if (ImGui::BeginPopupContextItem()) { ImGui::Text("Edit name:"); ImGui::InputText("##edit", name, IM_ARRAYSIZE(name)); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } ImGui::SameLine(); ImGui::Text("(<-- right-click here)"); ImGui::TreePop(); } if (ImGui::TreeNode("Modals")) { ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window."); if (ImGui::Button("Delete..")) ImGui::OpenPopup("Delete?"); if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n"); ImGui::Separator(); //static int dummy_i = 0; //ImGui::Combo("Combo", &dummy_i, "Delete\0Delete harder\0"); static bool dont_ask_me_next_time = false; ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time); ImGui::PopStyleVar(); if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } ImGui::SetItemDefaultFocus(); ImGui::SameLine(); if (ImGui::Button("Cancel", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); } if (ImGui::Button("Stacked modals..")) ImGui::OpenPopup("Stacked 1"); if (ImGui::BeginPopupModal("Stacked 1", NULL, ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Dummy menu item")) {} ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it."); // Testing behavior of widgets stacking their own regular popups over the modal. static int item = 1; static float color[4] = { 0.4f,0.7f,0.0f,0.5f }; ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); ImGui::ColorEdit4("color", color); if (ImGui::Button("Add another modal..")) ImGui::OpenPopup("Stacked 2"); // Also demonstrate passing a bool* to BeginPopupModal(), this will create a regular close button which will close the popup. // Note that the visibility state of popups is owned by imgui, so the input value of the bool actually doesn't matter here. bool dummy_open = true; if (ImGui::BeginPopupModal("Stacked 2", &dummy_open)) { ImGui::Text("Hello from Stacked The Second!"); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } ImGui::TreePop(); } if (ImGui::TreeNode("Menus inside a regular window")) { ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!"); ImGui::Separator(); // NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above. // To do so we are encloding the items in a PushID()/PopID() block to make them two different menusets. If we don't, opening any popup above and hovering our menu here // would open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it, which is the desired behavior for regular menus. ImGui::PushID("foo"); ImGui::MenuItem("Menu item", "CTRL+M"); if (ImGui::BeginMenu("Menu inside a regular window")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::PopID(); ImGui::Separator(); ImGui::TreePop(); } } static void ShowDemoWindowColumns() { if (!ImGui::CollapsingHeader("Columns")) return; ImGui::PushID("Columns"); // Basic columns if (ImGui::TreeNode("Basic")) { ImGui::Text("Without border:"); ImGui::Columns(3, "mycolumns3", false); // 3-ways, no border ImGui::Separator(); for (int n = 0; n < 14; n++) { char label[32]; sprintf(label, "Item %d", n); if (ImGui::Selectable(label)) {} //if (ImGui::Button(label, ImVec2(-1,0))) {} ImGui::NextColumn(); } ImGui::Columns(1); ImGui::Separator(); ImGui::Text("With border:"); ImGui::Columns(4, "mycolumns"); // 4-ways, with border ImGui::Separator(); ImGui::Text("ID"); ImGui::NextColumn(); ImGui::Text("Name"); ImGui::NextColumn(); ImGui::Text("Path"); ImGui::NextColumn(); ImGui::Text("Hovered"); ImGui::NextColumn(); ImGui::Separator(); const char* names[3] = { "One", "Two", "Three" }; const char* paths[3] = { "/path/one", "/path/two", "/path/three" }; static int selected = -1; for (int i = 0; i < 3; i++) { char label[32]; sprintf(label, "%04d", i); if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SpanAllColumns)) selected = i; bool hovered = ImGui::IsItemHovered(); ImGui::NextColumn(); ImGui::Text(names[i]); ImGui::NextColumn(); ImGui::Text(paths[i]); ImGui::NextColumn(); ImGui::Text("%d", hovered); ImGui::NextColumn(); } ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } // Create multiple items in a same cell before switching to next column if (ImGui::TreeNode("Mixed items")) { ImGui::Columns(3, "mixed"); ImGui::Separator(); ImGui::Text("Hello"); ImGui::Button("Banana"); ImGui::NextColumn(); ImGui::Text("ImGui"); ImGui::Button("Apple"); static float foo = 1.0f; ImGui::InputFloat("red", &foo, 0.05f, 0, "%.3f"); ImGui::Text("An extra line here."); ImGui::NextColumn(); ImGui::Text("Sailor"); ImGui::Button("Corniflower"); static float bar = 1.0f; ImGui::InputFloat("blue", &bar, 0.05f, 0, "%.3f"); ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category A")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category B")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category C")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } // Word wrapping if (ImGui::TreeNode("Word-wrapping")) { ImGui::Columns(2, "word-wrapping"); ImGui::Separator(); ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); ImGui::TextWrapped("Hello Left"); ImGui::NextColumn(); ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); ImGui::TextWrapped("Hello Right"); ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } if (ImGui::TreeNode("Borders")) { // NB: Future columns API should allow automatic horizontal borders. static bool h_borders = true; static bool v_borders = true; ImGui::Checkbox("horizontal", &h_borders); ImGui::SameLine(); ImGui::Checkbox("vertical", &v_borders); ImGui::Columns(4, NULL, v_borders); for (int i = 0; i < 4*3; i++) { if (h_borders && ImGui::GetColumnIndex() == 0) ImGui::Separator(); ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i); ImGui::Text("Width %.2f\nOffset %.2f", ImGui::GetColumnWidth(), ImGui::GetColumnOffset()); ImGui::NextColumn(); } ImGui::Columns(1); if (h_borders) ImGui::Separator(); ImGui::TreePop(); } // Scrolling columns /* if (ImGui::TreeNode("Vertical Scrolling")) { ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y)); ImGui::Columns(3); ImGui::Text("ID"); ImGui::NextColumn(); ImGui::Text("Name"); ImGui::NextColumn(); ImGui::Text("Path"); ImGui::NextColumn(); ImGui::Columns(1); ImGui::Separator(); ImGui::EndChild(); ImGui::BeginChild("##scrollingregion", ImVec2(0, 60)); ImGui::Columns(3); for (int i = 0; i < 10; i++) { ImGui::Text("%04d", i); ImGui::NextColumn(); ImGui::Text("Foobar"); ImGui::NextColumn(); ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn(); } ImGui::Columns(1); ImGui::EndChild(); ImGui::TreePop(); } */ if (ImGui::TreeNode("Horizontal Scrolling")) { ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f)); ImGui::BeginChild("##ScrollingRegion", ImVec2(0, ImGui::GetFontSize() * 20), false, ImGuiWindowFlags_HorizontalScrollbar); ImGui::Columns(10); int ITEMS_COUNT = 2000; ImGuiListClipper clipper(ITEMS_COUNT); // Also demonstrate using the clipper for large list while (clipper.Step()) { for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) for (int j = 0; j < 10; j++) { ImGui::Text("Line %d Column %d...", i, j); ImGui::NextColumn(); } } ImGui::Columns(1); ImGui::EndChild(); ImGui::TreePop(); } bool node_open = ImGui::TreeNode("Tree within single cell"); ImGui::SameLine(); ShowHelpMarker("NB: Tree node must be poped before ending the cell. There's no storage of state per-cell."); if (node_open) { ImGui::Columns(2, "tree items"); ImGui::Separator(); if (ImGui::TreeNode("Hello")) { ImGui::BulletText("Sailor"); ImGui::TreePop(); } ImGui::NextColumn(); if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Marin"); ImGui::TreePop(); } ImGui::NextColumn(); ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } ImGui::PopID(); } static void ShowDemoWindowMisc() { if (ImGui::CollapsingHeader("Filtering")) { static ImGuiTextFilter filter; ImGui::Text("Filter usage:\n" " \"\" display all lines\n" " \"xxx\" display lines containing \"xxx\"\n" " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n" " \"-xxx\" hide lines containing \"xxx\""); filter.Draw(); const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" }; for (int i = 0; i < IM_ARRAYSIZE(lines); i++) if (filter.PassFilter(lines[i])) ImGui::BulletText("%s", lines[i]); } if (ImGui::CollapsingHeader("Inputs, Navigation & Focus")) { ImGuiIO& io = ImGui::GetIO(); ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse); ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard); ImGui::Text("WantTextInput: %d", io.WantTextInput); ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos); ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible); if (ImGui::TreeNode("Keyboard, Mouse & Navigation State")) { if (ImGui::IsMousePosValid()) ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); else ImGui::Text("Mouse pos: <INVALID>"); ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); ImGui::Text("Mouse down:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } ImGui::Text("Mouse clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse dbl-clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (io.KeysDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("%d (%.02f secs)", i, io.KeysDownDuration[i]); } ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d", i); } ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d", i); } ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); ImGui::Text("NavInputs down:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputs[i] > 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputs[i]); } ImGui::Text("NavInputs pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] == 0.0f) { ImGui::SameLine(); ImGui::Text("[%d]", i); } ImGui::Text("NavInputs duration:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputsDownDuration[i]); } ImGui::Button("Hovering me sets the\nkeyboard capture flag"); if (ImGui::IsItemHovered()) ImGui::CaptureKeyboardFromApp(true); ImGui::SameLine(); ImGui::Button("Holding me clears the\nthe keyboard capture flag"); if (ImGui::IsItemActive()) ImGui::CaptureKeyboardFromApp(false); ImGui::TreePop(); } if (ImGui::TreeNode("Tabbing")) { ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields."); static char buf[32] = "dummy"; ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("3", buf, IM_ARRAYSIZE(buf)); ImGui::PushAllowKeyboardFocus(false); ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf)); //ImGui::SameLine(); ShowHelperMarker("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets."); ImGui::PopAllowKeyboardFocus(); ImGui::InputText("5", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } if (ImGui::TreeNode("Focus from code")) { bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine(); bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine(); bool focus_3 = ImGui::Button("Focus on 3"); int has_focus = 0; static char buf[128] = "click on a button to set focus"; if (focus_1) ImGui::SetKeyboardFocusHere(); ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 1; if (focus_2) ImGui::SetKeyboardFocusHere(); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 2; ImGui::PushAllowKeyboardFocus(false); if (focus_3) ImGui::SetKeyboardFocusHere(); ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 3; ImGui::PopAllowKeyboardFocus(); if (has_focus) ImGui::Text("Item with focus: %d", has_focus); else ImGui::Text("Item with focus: <none>"); // Use >= 0 parameter to SetKeyboardFocusHere() to focus an upcoming item static float f3[3] = { 0.0f, 0.0f, 0.0f }; int focus_ahead = -1; if (ImGui::Button("Focus on X")) { focus_ahead = 0; } ImGui::SameLine(); if (ImGui::Button("Focus on Y")) { focus_ahead = 1; } ImGui::SameLine(); if (ImGui::Button("Focus on Z")) { focus_ahead = 2; } if (focus_ahead != -1) ImGui::SetKeyboardFocusHere(focus_ahead); ImGui::SliderFloat3("Float3", &f3[0], 0.0f, 1.0f); ImGui::TextWrapped("NB: Cursor & selection are preserved when refocusing last used item in code."); ImGui::TreePop(); } if (ImGui::TreeNode("Dragging")) { ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget."); for (int button = 0; button < 3; button++) ImGui::Text("IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d", button, ImGui::IsMouseDragging(button), ImGui::IsMouseDragging(button, 0.0f), ImGui::IsMouseDragging(button, 20.0f)); ImGui::Button("Drag Me"); if (ImGui::IsItemActive()) { // Draw a line between the button and the mouse cursor ImDrawList* draw_list = ImGui::GetWindowDrawList(); draw_list->PushClipRectFullScreen(); draw_list->AddLine(io.MouseClickedPos[0], io.MousePos, ImGui::GetColorU32(ImGuiCol_Button), 4.0f); draw_list->PopClipRect(); // Drag operations gets "unlocked" when the mouse has moved past a certain threshold (the default threshold is stored in io.MouseDragThreshold) // You can request a lower or higher threshold using the second parameter of IsMouseDragging() and GetMouseDragDelta() ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f); ImVec2 value_with_lock_threshold = ImGui::GetMouseDragDelta(0); ImVec2 mouse_delta = io.MouseDelta; ImGui::SameLine(); ImGui::Text("Raw (%.1f, %.1f), WithLockThresold (%.1f, %.1f), MouseDelta (%.1f, %.1f)", value_raw.x, value_raw.y, value_with_lock_threshold.x, value_with_lock_threshold.y, mouse_delta.x, mouse_delta.y); } ImGui::TreePop(); } if (ImGui::TreeNode("Mouse cursors")) { const char* mouse_cursors_names[] = { "Arrow", "TextInput", "Move", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand" }; IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT); ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]); ImGui::Text("Hover to see mouse cursors:"); ImGui::SameLine(); ShowHelpMarker("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it."); for (int i = 0; i < ImGuiMouseCursor_COUNT; i++) { char label[32]; sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]); ImGui::Bullet(); ImGui::Selectable(label, false); if (ImGui::IsItemHovered() || ImGui::IsItemFocused()) ImGui::SetMouseCursor(i); } ImGui::TreePop(); } } } //----------------------------------------------------------------------------- // [SECTION] About Window / ShowAboutWindow() // Access from ImGui Demo -> Help -> About //----------------------------------------------------------------------------- void ImGui::ShowAboutWindow(bool* p_open) { if (!ImGui::Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::End(); return; } ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); ImGui::Separator(); ImGui::Text("By Omar Cornut and all dear imgui contributors."); ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information."); static bool show_config_info = false; ImGui::Checkbox("Config/Build Information", &show_config_info); if (show_config_info) { ImGuiIO& io = ImGui::GetIO(); ImGuiStyle& style = ImGui::GetStyle(); bool copy_to_clipboard = ImGui::Button("Copy to clipboard"); ImGui::BeginChildFrame(ImGui::GetID("cfginfos"), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove); if (copy_to_clipboard) ImGui::LogToClipboard(); ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); ImGui::Separator(); ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert)); ImGui::Text("define: __cplusplus=%d", (int)__cplusplus); #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_MATH_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_MATH_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS ImGui::Text("define: IMGUI_DISABLE_DEFAULT_ALLOCATORS"); #endif #ifdef IMGUI_USE_BGRA_PACKED_COLOR ImGui::Text("define: IMGUI_USE_BGRA_PACKED_COLOR"); #endif #ifdef _WIN32 ImGui::Text("define: _WIN32"); #endif #ifdef _WIN64 ImGui::Text("define: _WIN64"); #endif #ifdef __linux__ ImGui::Text("define: __linux__"); #endif #ifdef __APPLE__ ImGui::Text("define: __APPLE__"); #endif #ifdef _MSC_VER ImGui::Text("define: _MSC_VER=%d", _MSC_VER); #endif #ifdef __MINGW32__ ImGui::Text("define: __MINGW32__"); #endif #ifdef __MINGW64__ ImGui::Text("define: __MINGW64__"); #endif #ifdef __GNUC__ ImGui::Text("define: __GNUC__=%d", (int)__GNUC__); #endif #ifdef __clang_version__ ImGui::Text("define: __clang_version__=%s", __clang_version__); #endif ImGui::Separator(); ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL"); ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL"); ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad"); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos"); if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange"); if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor"); if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors"); if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink"); if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges"); if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly"); ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags); if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad"); if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors"); if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) ImGui::Text(" HasSetMousePos"); ImGui::Separator(); ImGui::Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight); ImGui::Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y); ImGui::Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); ImGui::Separator(); ImGui::Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y); ImGui::Text("style.WindowBorderSize: %.2f", style.WindowBorderSize); ImGui::Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y); ImGui::Text("style.FrameRounding: %.2f", style.FrameRounding); ImGui::Text("style.FrameBorderSize: %.2f", style.FrameBorderSize); ImGui::Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y); ImGui::Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y); if (copy_to_clipboard) ImGui::LogFinish(); ImGui::EndChildFrame(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Style Editor / ShowStyleEditor() //----------------------------------------------------------------------------- // Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options. // Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally. bool ImGui::ShowStyleSelector(const char* label) { static int style_idx = -1; if (ImGui::Combo(label, &style_idx, "Classic\0Dark\0Light\0")) { switch (style_idx) { case 0: ImGui::StyleColorsClassic(); break; case 1: ImGui::StyleColorsDark(); break; case 2: ImGui::StyleColorsLight(); break; } return true; } return false; } // Demo helper function to select among loaded fonts. // Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one. void ImGui::ShowFontSelector(const char* label) { ImGuiIO& io = ImGui::GetIO(); ImFont* font_current = ImGui::GetFont(); if (ImGui::BeginCombo(label, font_current->GetDebugName())) { for (int n = 0; n < io.Fonts->Fonts.Size; n++) { ImFont* font = io.Fonts->Fonts[n]; ImGui::PushID((void*)font); if (ImGui::Selectable(font->GetDebugName(), font == font_current)) io.FontDefault = font; ImGui::PopID(); } ImGui::EndCombo(); } ImGui::SameLine(); ShowHelpMarker( "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n" "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n" "- Read FAQ and documentation in misc/fonts/ for more details.\n" "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame()."); } void ImGui::ShowStyleEditor(ImGuiStyle* ref) { // You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to an internally stored reference) ImGuiStyle& style = ImGui::GetStyle(); static ImGuiStyle ref_saved_style; // Default to using internal storage as reference static bool init = true; if (init && ref == NULL) ref_saved_style = style; init = false; if (ref == NULL) ref = &ref_saved_style; ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f); if (ImGui::ShowStyleSelector("Colors##Selector")) ref_saved_style = style; ImGui::ShowFontSelector("Fonts##Selector"); // Simplified Settings if (ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f")) style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding { bool window_border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; } ImGui::SameLine(); { bool frame_border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; } ImGui::SameLine(); { bool popup_border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; } // Save/Revert button if (ImGui::Button("Save Ref")) *ref = ref_saved_style = style; ImGui::SameLine(); if (ImGui::Button("Revert Ref")) style = *ref; ImGui::SameLine(); ShowHelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export Colors\" below to save them somewhere."); ImGui::Separator(); if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) { if (ImGui::BeginTabItem("Sizes")) { ImGui::Text("Main"); ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); ImGui::Text("Borders"); ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::Text("Rounding"); ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); ImGui::Text("Alignment"); ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); ShowHelpMarker("Alignment applies when a button is larger than its text content."); ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); ShowHelpMarker("Alignment applies when a selectable is larger than its text content."); ImGui::Text("Safe Area Padding"); ImGui::SameLine(); ShowHelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Colors")) { static int output_dest = 0; static bool output_only_modified = true; if (ImGui::Button("Export Unsaved")) { if (output_dest == 0) ImGui::LogToClipboard(); else ImGui::LogToTTY(); ImGui::LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE); for (int i = 0; i < ImGuiCol_COUNT; i++) { const ImVec4& col = style.Colors[i]; const char* name = ImGui::GetStyleColorName(i); if (!output_only_modified || memcmp(&col, &ref->Colors[i], sizeof(ImVec4)) != 0) ImGui::LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (int)strlen(name), "", col.x, col.y, col.z, col.w); } ImGui::LogFinish(); } ImGui::SameLine(); ImGui::PushItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0"); ImGui::PopItemWidth(); ImGui::SameLine(); ImGui::Checkbox("Only Modified Colors", &output_only_modified); static ImGuiTextFilter filter; filter.Draw("Filter colors", ImGui::GetFontSize() * 16); static ImGuiColorEditFlags alpha_flags = 0; ImGui::RadioButton("Opaque", &alpha_flags, 0); ImGui::SameLine(); ImGui::RadioButton("Alpha", &alpha_flags, ImGuiColorEditFlags_AlphaPreview); ImGui::SameLine(); ImGui::RadioButton("Both", &alpha_flags, ImGuiColorEditFlags_AlphaPreviewHalf); ImGui::SameLine(); ShowHelpMarker("In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu."); ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); ImGui::PushItemWidth(-160); for (int i = 0; i < ImGuiCol_COUNT; i++) { const char* name = ImGui::GetStyleColorName(i); if (!filter.PassFilter(name)) continue; ImGui::PushID(i); ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags); if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0) { // Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons. // Read the FAQ and misc/fonts/README.txt about using icon fonts. It's really easy and super convenient! ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i]; ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i]; } ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); ImGui::TextUnformatted(name); ImGui::PopID(); } ImGui::PopItemWidth(); ImGui::EndChild(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Fonts")) { ImGuiIO& io = ImGui::GetIO(); ImFontAtlas* atlas = io.Fonts; ShowHelpMarker("Read FAQ and misc/fonts/README.txt for details on font loading."); ImGui::PushItemWidth(120); for (int i = 0; i < atlas->Fonts.Size; i++) { ImFont* font = atlas->Fonts[i]; ImGui::PushID(font); bool font_details_opened = ImGui::TreeNode(font, "Font %d: \"%s\"\n%.2f px, %d glyphs, %d file(s)", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount); ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { io.FontDefault = font; } if (font_details_opened) { ImGui::PushFont(font); ImGui::Text("The quick brown fox jumps over the lazy dog"); ImGui::PopFont(); ImGui::DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font ImGui::SameLine(); ShowHelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)"); ImGui::InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f"); ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent); ImGui::Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar); const float surface_sqrt = sqrtf((float)font->MetricsTotalSurface); ImGui::Text("Texture surface: %d pixels (approx) ~ %dx%d", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt); for (int config_i = 0; config_i < font->ConfigDataCount; config_i++) if (const ImFontConfig* cfg = &font->ConfigData[config_i]) ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH); if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size)) { // Display all glyphs of the fonts in separate pages of 256 characters for (int base = 0; base < 0x10000; base += 256) { int count = 0; for (int n = 0; n < 256; n++) count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0; if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph")) { float cell_size = font->FontSize * 1; float cell_spacing = style.ItemSpacing.y; ImVec2 base_pos = ImGui::GetCursorScreenPos(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); for (int n = 0; n < 256; n++) { ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing)); ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size); const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n)); draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50)); if (glyph) font->RenderChar(draw_list, cell_size, cell_p1, ImGui::GetColorU32(ImGuiCol_Text), (ImWchar)(base + n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string. if (glyph && ImGui::IsMouseHoveringRect(cell_p1, cell_p2)) { ImGui::BeginTooltip(); ImGui::Text("Codepoint: U+%04X", base + n); ImGui::Separator(); ImGui::Text("AdvanceX: %.1f", glyph->AdvanceX); ImGui::Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1); ImGui::Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1); ImGui::EndTooltip(); } } ImGui::Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16)); ImGui::TreePop(); } } ImGui::TreePop(); } ImGui::TreePop(); } ImGui::PopID(); } if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) { ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), ImColor(255, 255, 255, 255), ImColor(255, 255, 255, 128)); ImGui::TreePop(); } static float window_scale = 1.0f; if (ImGui::DragFloat("this window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.2f")) // scale only this window ImGui::SetWindowFontScale(window_scale); ImGui::DragFloat("global scale", &io.FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.2f"); // scale everything ImGui::PopItemWidth(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Rendering")) { ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); ShowHelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well."); ImGui::Checkbox("Anti-aliased fill", &style.AntiAliasedFill); ImGui::PushItemWidth(100); ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, "%.2f", 2.0f); if (style.CurveTessellationTol < 0.10f) style.CurveTessellationTol = 0.10f; ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero. ImGui::PopItemWidth(); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::PopItemWidth(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() //----------------------------------------------------------------------------- // Demonstrate creating a fullscreen menu bar and populating it. static void ShowExampleAppMainMenuBar() { if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu("File")) { ShowExampleMenuFile(); ImGui::EndMenu(); } if (ImGui::BeginMenu("Edit")) { if (ImGui::MenuItem("Undo", "CTRL+Z")) {} if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item ImGui::Separator(); if (ImGui::MenuItem("Cut", "CTRL+X")) {} if (ImGui::MenuItem("Copy", "CTRL+C")) {} if (ImGui::MenuItem("Paste", "CTRL+V")) {} ImGui::EndMenu(); } ImGui::EndMainMenuBar(); } } static void ShowExampleMenuFile() { ImGui::MenuItem("(dummy menu)", NULL, false, false); if (ImGui::MenuItem("New")) {} if (ImGui::MenuItem("Open", "Ctrl+O")) {} if (ImGui::BeginMenu("Open Recent")) { ImGui::MenuItem("fish_hat.c"); ImGui::MenuItem("fish_hat.inl"); ImGui::MenuItem("fish_hat.h"); if (ImGui::BeginMenu("More..")) { ImGui::MenuItem("Hello"); ImGui::MenuItem("Sailor"); if (ImGui::BeginMenu("Recurse..")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::EndMenu(); } ImGui::EndMenu(); } if (ImGui::MenuItem("Save", "Ctrl+S")) {} if (ImGui::MenuItem("Save As..")) {} ImGui::Separator(); if (ImGui::BeginMenu("Options")) { static bool enabled = true; ImGui::MenuItem("Enabled", "", &enabled); ImGui::BeginChild("child", ImVec2(0, 60), true); for (int i = 0; i < 10; i++) ImGui::Text("Scrolling Text %d", i); ImGui::EndChild(); static float f = 0.5f; static int n = 0; static bool b = true; ImGui::SliderFloat("Value", &f, 0.0f, 1.0f); ImGui::InputFloat("Input", &f, 0.1f); ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0"); ImGui::Checkbox("Check", &b); ImGui::EndMenu(); } if (ImGui::BeginMenu("Colors")) { float sz = ImGui::GetTextLineHeight(); for (int i = 0; i < ImGuiCol_COUNT; i++) { const char* name = ImGui::GetStyleColorName((ImGuiCol)i); ImVec2 p = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x+sz, p.y+sz), ImGui::GetColorU32((ImGuiCol)i)); ImGui::Dummy(ImVec2(sz, sz)); ImGui::SameLine(); ImGui::MenuItem(name); } ImGui::EndMenu(); } if (ImGui::BeginMenu("Disabled", false)) // Disabled { IM_ASSERT(0); } if (ImGui::MenuItem("Checked", NULL, true)) {} if (ImGui::MenuItem("Quit", "Alt+F4")) {} } //----------------------------------------------------------------------------- // [SECTION] Example App: Debug Console / ShowExampleAppConsole() //----------------------------------------------------------------------------- // Demonstrate creating a simple console window, with scrolling, filtering, completion and history. // For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions. struct ExampleAppConsole { char InputBuf[256]; ImVector<char*> Items; ImVector<const char*> Commands; ImVector<char*> History; int HistoryPos; // -1: new line, 0..History.Size-1 browsing history. ImGuiTextFilter Filter; bool AutoScroll; bool ScrollToBottom; ExampleAppConsole() { ClearLog(); memset(InputBuf, 0, sizeof(InputBuf)); HistoryPos = -1; Commands.push_back("HELP"); Commands.push_back("HISTORY"); Commands.push_back("CLEAR"); Commands.push_back("CLASSIFY"); // "classify" is only here to provide an example of "C"+[tab] completing to "CL" and displaying matches. AutoScroll = true; ScrollToBottom = true; AddLog("Welcome to Dear ImGui!"); } ~ExampleAppConsole() { ClearLog(); for (int i = 0; i < History.Size; i++) free(History[i]); } // Portable helpers static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } static int Strnicmp(const char* str1, const char* str2, int n) { int d = 0; while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; } return d; } static char* Strdup(const char *str) { size_t len = strlen(str) + 1; void* buf = malloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)str, len); } static void Strtrim(char* str) { char* str_end = str + strlen(str); while (str_end > str && str_end[-1] == ' ') str_end--; *str_end = 0; } void ClearLog() { for (int i = 0; i < Items.Size; i++) free(Items[i]); Items.clear(); ScrollToBottom = true; } void AddLog(const char* fmt, ...) IM_FMTARGS(2) { // FIXME-OPT char buf[1024]; va_list args; va_start(args, fmt); vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); buf[IM_ARRAYSIZE(buf)-1] = 0; va_end(args); Items.push_back(Strdup(buf)); if (AutoScroll) ScrollToBottom = true; } void Draw(const char* title, bool* p_open) { ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); if (!ImGui::Begin(title, p_open)) { ImGui::End(); return; } // As a specific feature guaranteed by the library, after calling Begin() the last Item represent the title bar. So e.g. IsItemHovered() will return true when hovering the title bar. // Here we create a context menu only available from the title bar. if (ImGui::BeginPopupContextItem()) { if (ImGui::MenuItem("Close Console")) *p_open = false; ImGui::EndPopup(); } ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc."); ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion."); // TODO: display items starting from the bottom if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine(); if (ImGui::SmallButton("Add Dummy Error")) { AddLog("[error] something went wrong"); } ImGui::SameLine(); if (ImGui::SmallButton("Clear")) { ClearLog(); } ImGui::SameLine(); bool copy_to_clipboard = ImGui::SmallButton("Copy"); ImGui::SameLine(); if (ImGui::SmallButton("Scroll to bottom")) ScrollToBottom = true; //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); } ImGui::Separator(); // Options menu if (ImGui::BeginPopup("Options")) { if (ImGui::Checkbox("Auto-scroll", &AutoScroll)) if (AutoScroll) ScrollToBottom = true; ImGui::EndPopup(); } // Options, Filter if (ImGui::Button("Options")) ImGui::OpenPopup("Options"); ImGui::SameLine(); Filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180); ImGui::Separator(); const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing(); // 1 separator, 1 input text ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar); // Leave room for 1 separator + 1 InputText if (ImGui::BeginPopupContextWindow()) { if (ImGui::Selectable("Clear")) ClearLog(); ImGui::EndPopup(); } // Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end()); // NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping to only process visible items. // You can seek and display only the lines that are visible using the ImGuiListClipper helper, if your elements are evenly spaced and you have cheap random access to the elements. // To use the clipper we could replace the 'for (int i = 0; i < Items.Size; i++)' loop with: // ImGuiListClipper clipper(Items.Size); // while (clipper.Step()) // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) // However, note that you can not use this code as is if a filter is active because it breaks the 'cheap random-access' property. We would need random-access on the post-filtered list. // A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices that passed the filtering test, recomputing this array when user changes the filter, // and appending newly elements as they are inserted. This is left as a task to the user until we can manage to improve this example code! // If your items are of variable size you may want to implement code similar to what ImGuiListClipper does. Or split your data into fixed height items to allow random-seeking into your list. ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing if (copy_to_clipboard) ImGui::LogToClipboard(); for (int i = 0; i < Items.Size; i++) { const char* item = Items[i]; if (!Filter.PassFilter(item)) continue; // Normally you would store more information in your item (e.g. make Items[] an array of structure, store color/type etc.) bool pop_color = false; if (strstr(item, "[error]")) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f)); pop_color = true; } else if (strncmp(item, "# ", 2) == 0) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.8f, 0.6f, 1.0f)); pop_color = true; } ImGui::TextUnformatted(item); if (pop_color) ImGui::PopStyleColor(); } if (copy_to_clipboard) ImGui::LogFinish(); if (ScrollToBottom) ImGui::SetScrollHereY(1.0f); ScrollToBottom = false; ImGui::PopStyleVar(); ImGui::EndChild(); ImGui::Separator(); // Command-line bool reclaim_focus = false; if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this)) { char* s = InputBuf; Strtrim(s); if (s[0]) ExecCommand(s); strcpy(s, ""); reclaim_focus = true; } // Auto-focus on window apparition ImGui::SetItemDefaultFocus(); if (reclaim_focus) ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget ImGui::End(); } void ExecCommand(const char* command_line) { AddLog("# %s\n", command_line); // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal. HistoryPos = -1; for (int i = History.Size-1; i >= 0; i--) if (Stricmp(History[i], command_line) == 0) { free(History[i]); History.erase(History.begin() + i); break; } History.push_back(Strdup(command_line)); // Process command if (Stricmp(command_line, "CLEAR") == 0) { ClearLog(); } else if (Stricmp(command_line, "HELP") == 0) { AddLog("Commands:"); for (int i = 0; i < Commands.Size; i++) AddLog("- %s", Commands[i]); } else if (Stricmp(command_line, "HISTORY") == 0) { int first = History.Size - 10; for (int i = first > 0 ? first : 0; i < History.Size; i++) AddLog("%3d: %s\n", i, History[i]); } else { AddLog("Unknown command: '%s'\n", command_line); } // On commad input, we scroll to bottom even if AutoScroll==false ScrollToBottom = true; } static int TextEditCallbackStub(ImGuiInputTextCallbackData* data) // In C++11 you are better off using lambdas for this sort of forwarding callbacks { ExampleAppConsole* console = (ExampleAppConsole*)data->UserData; return console->TextEditCallback(data); } int TextEditCallback(ImGuiInputTextCallbackData* data) { //AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd); switch (data->EventFlag) { case ImGuiInputTextFlags_CallbackCompletion: { // Example of TEXT COMPLETION // Locate beginning of current word const char* word_end = data->Buf + data->CursorPos; const char* word_start = word_end; while (word_start > data->Buf) { const char c = word_start[-1]; if (c == ' ' || c == '\t' || c == ',' || c == ';') break; word_start--; } // Build a list of candidates ImVector<const char*> candidates; for (int i = 0; i < Commands.Size; i++) if (Strnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0) candidates.push_back(Commands[i]); if (candidates.Size == 0) { // No match AddLog("No match for \"%.*s\"!\n", (int)(word_end-word_start), word_start); } else if (candidates.Size == 1) { // Single match. Delete the beginning of the word and replace it entirely so we've got nice casing data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start)); data->InsertChars(data->CursorPos, candidates[0]); data->InsertChars(data->CursorPos, " "); } else { // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY" int match_len = (int)(word_end - word_start); for (;;) { int c = 0; bool all_candidates_matches = true; for (int i = 0; i < candidates.Size && all_candidates_matches; i++) if (i == 0) c = toupper(candidates[i][match_len]); else if (c == 0 || c != toupper(candidates[i][match_len])) all_candidates_matches = false; if (!all_candidates_matches) break; match_len++; } if (match_len > 0) { data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start)); data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len); } // List matches AddLog("Possible matches:\n"); for (int i = 0; i < candidates.Size; i++) AddLog("- %s\n", candidates[i]); } break; } case ImGuiInputTextFlags_CallbackHistory: { // Example of HISTORY const int prev_history_pos = HistoryPos; if (data->EventKey == ImGuiKey_UpArrow) { if (HistoryPos == -1) HistoryPos = History.Size - 1; else if (HistoryPos > 0) HistoryPos--; } else if (data->EventKey == ImGuiKey_DownArrow) { if (HistoryPos != -1) if (++HistoryPos >= History.Size) HistoryPos = -1; } // A better implementation would preserve the data on the current input line along with cursor position. if (prev_history_pos != HistoryPos) { const char* history_str = (HistoryPos >= 0) ? History[HistoryPos] : ""; data->DeleteChars(0, data->BufTextLen); data->InsertChars(0, history_str); } } } return 0; } }; static void ShowExampleAppConsole(bool* p_open) { static ExampleAppConsole console; console.Draw("Example: Console", p_open); } //----------------------------------------------------------------------------- // [SECTION] Example App: Debug Log / ShowExampleAppLog() //----------------------------------------------------------------------------- // Usage: // static ExampleAppLog my_log; // my_log.AddLog("Hello %d world\n", 123); // my_log.Draw("title"); struct ExampleAppLog { ImGuiTextBuffer Buf; ImGuiTextFilter Filter; ImVector<int> LineOffsets; // Index to lines offset. We maintain this with AddLog() calls, allowing us to have a random access on lines bool AutoScroll; bool ScrollToBottom; ExampleAppLog() { AutoScroll = true; ScrollToBottom = false; Clear(); } void Clear() { Buf.clear(); LineOffsets.clear(); LineOffsets.push_back(0); } void AddLog(const char* fmt, ...) IM_FMTARGS(2) { int old_size = Buf.size(); va_list args; va_start(args, fmt); Buf.appendfv(fmt, args); va_end(args); for (int new_size = Buf.size(); old_size < new_size; old_size++) if (Buf[old_size] == '\n') LineOffsets.push_back(old_size + 1); if (AutoScroll) ScrollToBottom = true; } void Draw(const char* title, bool* p_open = NULL) { if (!ImGui::Begin(title, p_open)) { ImGui::End(); return; } // Options menu if (ImGui::BeginPopup("Options")) { if (ImGui::Checkbox("Auto-scroll", &AutoScroll)) if (AutoScroll) ScrollToBottom = true; ImGui::EndPopup(); } // Main window if (ImGui::Button("Options")) ImGui::OpenPopup("Options"); ImGui::SameLine(); bool clear = ImGui::Button("Clear"); ImGui::SameLine(); bool copy = ImGui::Button("Copy"); ImGui::SameLine(); Filter.Draw("Filter", -100.0f); ImGui::Separator(); ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar); if (clear) Clear(); if (copy) ImGui::LogToClipboard(); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); const char* buf = Buf.begin(); const char* buf_end = Buf.end(); if (Filter.IsActive()) { // In this example we don't use the clipper when Filter is enabled. // This is because we don't have a random access on the result on our filter. // A real application processing logs with ten of thousands of entries may want to store the result of search/filter. // especially if the filtering function is not trivial (e.g. reg-exp). for (int line_no = 0; line_no < LineOffsets.Size; line_no++) { const char* line_start = buf + LineOffsets[line_no]; const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; if (Filter.PassFilter(line_start, line_end)) ImGui::TextUnformatted(line_start, line_end); } } else { // The simplest and easy way to display the entire buffer: // ImGui::TextUnformatted(buf_begin, buf_end); // And it'll just work. TextUnformatted() has specialization for large blob of text and will fast-forward to skip non-visible lines. // Here we instead demonstrate using the clipper to only process lines that are within the visible area. // If you have tens of thousands of items and their processing cost is non-negligible, coarse clipping them on your side is recommended. // Using ImGuiListClipper requires A) random access into your data, and B) items all being the same height, // both of which we can handle since we an array pointing to the beginning of each line of text. // When using the filter (in the block of code above) we don't have random access into the data to display anymore, which is why we don't use the clipper. // Storing or skimming through the search result would make it possible (and would be recommended if you want to search through tens of thousands of entries) ImGuiListClipper clipper; clipper.Begin(LineOffsets.Size); while (clipper.Step()) { for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++) { const char* line_start = buf + LineOffsets[line_no]; const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; ImGui::TextUnformatted(line_start, line_end); } } clipper.End(); } ImGui::PopStyleVar(); if (ScrollToBottom) ImGui::SetScrollHereY(1.0f); ScrollToBottom = false; ImGui::EndChild(); ImGui::End(); } }; // Demonstrate creating a simple log window with basic filtering. static void ShowExampleAppLog(bool* p_open) { static ExampleAppLog log; // For the demo: add a debug button _BEFORE_ the normal log window contents // We take advantage of the fact that multiple calls to Begin()/End() are appending to the same window. // Most of the contents of the window will be added by the log.Draw() call. ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver); ImGui::Begin("Example: Log", p_open); if (ImGui::SmallButton("[Debug] Add 5 entries")) { static int counter = 0; for (int n = 0; n < 5; n++) { const char* categories[3] = { "info", "warn", "error" }; const char* words[] = { "Bumfuzzled", "Cattywampus", "Snickersnee", "Abibliophobia", "Absquatulate", "Nincompoop", "Pauciloquent" }; log.AddLog("[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n", ImGui::GetFrameCount(), categories[counter % IM_ARRAYSIZE(categories)], ImGui::GetTime(), words[counter % IM_ARRAYSIZE(words)]); counter++; } } ImGui::End(); log.Draw("Example: Log", p_open); } //----------------------------------------------------------------------------- // [SECTION] Example App: Simple Layout / ShowExampleAppLayout() //----------------------------------------------------------------------------- // Demonstrate create a window with multiple child windows. static void ShowExampleAppLayout(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiCond_FirstUseEver); if (ImGui::Begin("Example: Simple layout", p_open, ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Close")) *p_open = false; ImGui::EndMenu(); } ImGui::EndMenuBar(); } // left static int selected = 0; ImGui::BeginChild("left pane", ImVec2(150, 0), true); for (int i = 0; i < 100; i++) { char label[128]; sprintf(label, "MyObject %d", i); if (ImGui::Selectable(label, selected == i)) selected = i; } ImGui::EndChild(); ImGui::SameLine(); // right ImGui::BeginGroup(); ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us ImGui::Text("MyObject: %d", selected); ImGui::Separator(); if (ImGui::BeginTabBar("##Tabs", ImGuiTabBarFlags_None)) { if (ImGui::BeginTabItem("Description")) { ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Details")) { ImGui::Text("ID: 0123456789"); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::EndChild(); if (ImGui::Button("Revert")) {} ImGui::SameLine(); if (ImGui::Button("Save")) {} ImGui::EndGroup(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() //----------------------------------------------------------------------------- // Demonstrate create a simple property editor. static void ShowExampleAppPropertyEditor(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(430,450), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Property editor", p_open)) { ImGui::End(); return; } ShowHelpMarker("This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API."); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2,2)); ImGui::Columns(2); ImGui::Separator(); struct funcs { static void ShowDummyObject(const char* prefix, int uid) { ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID. ImGui::AlignTextToFramePadding(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high. bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid); ImGui::NextColumn(); ImGui::AlignTextToFramePadding(); ImGui::Text("my sailor is rich"); ImGui::NextColumn(); if (node_open) { static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f }; for (int i = 0; i < 8; i++) { ImGui::PushID(i); // Use field index as identifier. if (i < 2) { ShowDummyObject("Child", 424242); } else { // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well) ImGui::AlignTextToFramePadding(); ImGui::TreeNodeEx("Field", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet, "Field_%d", i); ImGui::NextColumn(); ImGui::PushItemWidth(-1); if (i >= 5) ImGui::InputFloat("##value", &dummy_members[i], 1.0f); else ImGui::DragFloat("##value", &dummy_members[i], 0.01f); ImGui::PopItemWidth(); ImGui::NextColumn(); } ImGui::PopID(); } ImGui::TreePop(); } ImGui::PopID(); } }; // Iterate dummy objects with dummy members (all the same data) for (int obj_i = 0; obj_i < 3; obj_i++) funcs::ShowDummyObject("Object", obj_i); ImGui::Columns(1); ImGui::Separator(); ImGui::PopStyleVar(); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Long Text / ShowExampleAppLongText() //----------------------------------------------------------------------------- // Demonstrate/test rendering huge amount of text, and the incidence of clipping. static void ShowExampleAppLongText(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Long text display", p_open)) { ImGui::End(); return; } static int test_type = 0; static ImGuiTextBuffer log; static int lines = 0; ImGui::Text("Printing unusually long amount of text."); ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped (slow)\0"); ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size()); if (ImGui::Button("Clear")) { log.clear(); lines = 0; } ImGui::SameLine(); if (ImGui::Button("Add 1000 lines")) { for (int i = 0; i < 1000; i++) log.appendf("%i The quick brown fox jumps over the lazy dog\n", lines+i); lines += 1000; } ImGui::BeginChild("Log"); switch (test_type) { case 0: // Single call to TextUnformatted() with a big buffer ImGui::TextUnformatted(log.begin(), log.end()); break; case 1: { // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper. ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); ImGuiListClipper clipper(lines); while (clipper.Step()) for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); ImGui::PopStyleVar(); break; } case 2: // Multiple calls to Text(), not clipped (slow) ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); for (int i = 0; i < lines; i++) ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); ImGui::PopStyleVar(); break; } ImGui::EndChild(); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() //----------------------------------------------------------------------------- // Demonstrate creating a window which gets auto-resized according to its content. static void ShowExampleAppAutoResize(bool* p_open) { if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::End(); return; } static int lines = 10; ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop."); ImGui::SliderInt("Number of lines", &lines, 1, 20); for (int i = 0; i < lines; i++) ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() //----------------------------------------------------------------------------- // Demonstrate creating a window with custom resize constraints. static void ShowExampleAppConstrainedResize(bool* p_open) { struct CustomConstraints // Helper functions to demonstrate programmatic constraints { static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize = ImVec2(IM_MAX(data->DesiredSize.x, data->DesiredSize.y), IM_MAX(data->DesiredSize.x, data->DesiredSize.y)); } static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); } }; static bool auto_resize = false; static int type = 0; static int display_lines = 10; if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100 if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width 400-500 if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, 500)); // Height 400-500 if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)(intptr_t)100); // Fixed Step ImGuiWindowFlags flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0; if (ImGui::Begin("Example: Constrained Resize", p_open, flags)) { const char* desc[] = { "Resize vertical only", "Resize horizontal only", "Width > 100, Height > 100", "Width 400-500", "Height 400-500", "Custom: Always Square", "Custom: Fixed Steps (100)", }; if (ImGui::Button("200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine(); if (ImGui::Button("500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine(); if (ImGui::Button("800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); } ImGui::PushItemWidth(200); ImGui::Combo("Constraint", &type, desc, IM_ARRAYSIZE(desc)); ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100); ImGui::PopItemWidth(); ImGui::Checkbox("Auto-resize", &auto_resize); for (int i = 0; i < display_lines; i++) ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, ""); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() //----------------------------------------------------------------------------- // Demonstrate creating a simple static window with no decoration + a context-menu to choose which corner of the screen to use. static void ShowExampleAppSimpleOverlay(bool* p_open) { const float DISTANCE = 10.0f; static int corner = 0; ImGuiIO& io = ImGui::GetIO(); if (corner != -1) { ImVec2 window_pos = ImVec2((corner & 1) ? io.DisplaySize.x - DISTANCE : DISTANCE, (corner & 2) ? io.DisplaySize.y - DISTANCE : DISTANCE); ImVec2 window_pos_pivot = ImVec2((corner & 1) ? 1.0f : 0.0f, (corner & 2) ? 1.0f : 0.0f); ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot); } ImGui::SetNextWindowBgAlpha(0.3f); // Transparent background if (ImGui::Begin("Example: Simple overlay", p_open, (corner != -1 ? ImGuiWindowFlags_NoMove : 0) | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav)) { ImGui::Text("Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)"); ImGui::Separator(); if (ImGui::IsMousePosValid()) ImGui::Text("Mouse Position: (%.1f,%.1f)", io.MousePos.x, io.MousePos.y); else ImGui::Text("Mouse Position: <invalid>"); if (ImGui::BeginPopupContextWindow()) { if (ImGui::MenuItem("Custom", NULL, corner == -1)) corner = -1; if (ImGui::MenuItem("Top-left", NULL, corner == 0)) corner = 0; if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1; if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2; if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3; if (p_open && ImGui::MenuItem("Close")) *p_open = false; ImGui::EndPopup(); } } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() //----------------------------------------------------------------------------- // Demonstrate using "##" and "###" in identifiers to manipulate ID generation. // This apply to all regular items as well. Read FAQ section "How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on the purpose of labels/IDs." for details. static void ShowExampleAppWindowTitles(bool*) { // By default, Windows are uniquely identified by their title. // You can use the "##" and "###" markers to manipulate the display/ID. // Using "##" to display same title but have unique identifier. ImGui::SetNextWindowPos(ImVec2(100, 100), ImGuiCond_FirstUseEver); ImGui::Begin("Same title as another window##1"); ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique."); ImGui::End(); ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_FirstUseEver); ImGui::Begin("Same title as another window##2"); ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique."); ImGui::End(); // Using "###" to display a changing title but keep a static identifier "AnimatedTitle" char buf[128]; sprintf(buf, "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime() / 0.25f) & 3], ImGui::GetFrameCount()); ImGui::SetNextWindowPos(ImVec2(100, 300), ImGuiCond_FirstUseEver); ImGui::Begin(buf); ImGui::Text("This window has a changing title."); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() //----------------------------------------------------------------------------- // Demonstrate using the low-level ImDrawList to draw custom shapes. static void ShowExampleAppCustomRendering(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(350, 560), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Custom rendering", p_open)) { ImGui::End(); return; } // Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc. // Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4. // ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types) // In this example we are not using the maths operators! ImDrawList* draw_list = ImGui::GetWindowDrawList(); if (ImGui::BeginTabBar("##TabBar")) { // Primitives if (ImGui::BeginTabItem("Primitives")) { static float sz = 36.0f; static float thickness = 4.0f; static ImVec4 col = ImVec4(1.0f, 1.0f, 0.4f, 1.0f); ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f"); ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f"); ImGui::ColorEdit4("Color", &col.x); const ImVec2 p = ImGui::GetCursorScreenPos(); const ImU32 col32 = ImColor(col); float x = p.x + 4.0f, y = p.y + 4.0f, spacing = 8.0f; for (int n = 0; n < 2; n++) { // First line uses a thickness of 1.0, second line uses the configurable thickness float th = (n == 0) ? 1.0f : thickness; draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col32, 6, th); x += sz + spacing; // Hexagon draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col32, 20, th); x += sz + spacing; // Circle draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, 0.0f, ImDrawCornerFlags_All, th); x += sz + spacing; draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, 10.0f, ImDrawCornerFlags_All, th); x += sz + spacing; draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, 10.0f, ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotRight, th); x += sz + spacing; draw_list->AddTriangle(ImVec2(x + sz*0.5f, y), ImVec2(x + sz, y + sz - 0.5f), ImVec2(x, y + sz - 0.5f), col32, th); x += sz + spacing; draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col32, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col32, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, th); x += sz + spacing; // Diagonal line draw_list->AddBezierCurve(ImVec2(x, y), ImVec2(x + sz*1.3f, y + sz*0.3f), ImVec2(x + sz - sz*1.3f, y + sz - sz*0.3f), ImVec2(x + sz, y + sz), col32, th); x = p.x + 4; y += sz + spacing; } draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col32, 6); x += sz + spacing; // Hexagon draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col32, 32); x += sz + spacing; // Circle draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col32); x += sz + spacing; draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, 10.0f); x += sz + spacing; draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col32, 10.0f, ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotRight); x += sz + spacing; draw_list->AddTriangleFilled(ImVec2(x + sz*0.5f, y), ImVec2(x + sz, y + sz - 0.5f), ImVec2(x, y + sz - 0.5f), col32); x += sz + spacing; draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + thickness), col32); x += sz + spacing; // Horizontal line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + thickness, y + sz), col32); x += spacing + spacing; // Vertical line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + 1, y + 1), col32); x += sz; // Pixel (faster than AddLine) draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x + sz, y + sz), IM_COL32(0, 0, 0, 255), IM_COL32(255, 0, 0, 255), IM_COL32(255, 255, 0, 255), IM_COL32(0, 255, 0, 255)); ImGui::Dummy(ImVec2((sz + spacing) * 8, (sz + spacing) * 3)); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Canvas")) { static ImVector<ImVec2> points; static bool adding_line = false; if (ImGui::Button("Clear")) points.clear(); if (points.Size >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } } ImGui::Text("Left-click and drag to add lines,\nRight-click to undo"); // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered() // But you can also draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos(). // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max). ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates! ImVec2 canvas_size = ImGui::GetContentRegionAvail(); // Resize canvas to what's available if (canvas_size.x < 50.0f) canvas_size.x = 50.0f; if (canvas_size.y < 50.0f) canvas_size.y = 50.0f; draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(50, 50, 50, 255), IM_COL32(50, 50, 60, 255), IM_COL32(60, 60, 70, 255), IM_COL32(50, 50, 60, 255)); draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(255, 255, 255, 255)); bool adding_preview = false; ImGui::InvisibleButton("canvas", canvas_size); ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y); if (adding_line) { adding_preview = true; points.push_back(mouse_pos_in_canvas); if (!ImGui::IsMouseDown(0)) adding_line = adding_preview = false; } if (ImGui::IsItemHovered()) { if (!adding_line && ImGui::IsMouseClicked(0)) { points.push_back(mouse_pos_in_canvas); adding_line = true; } if (ImGui::IsMouseClicked(1) && !points.empty()) { adding_line = adding_preview = false; points.pop_back(); points.pop_back(); } } draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), true); // clip lines within the canvas (if we resize it, etc.) for (int i = 0; i < points.Size - 1; i += 2) draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i + 1].x, canvas_pos.y + points[i + 1].y), IM_COL32(255, 255, 0, 255), 2.0f); draw_list->PopClipRect(); if (adding_preview) points.pop_back(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("BG/FG draw lists")) { static bool draw_bg = true; static bool draw_fg = true; ImGui::Checkbox("Draw in Background draw list", &draw_bg); ImGui::Checkbox("Draw in Foreground draw list", &draw_fg); ImVec2 window_pos = ImGui::GetWindowPos(); ImVec2 window_size = ImGui::GetWindowSize(); ImVec2 window_center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f); if (draw_bg) ImGui::GetBackgroundDrawList()->AddCircle(window_center, window_size.x * 0.6f, IM_COL32(255, 0, 0, 200), 32, 10); if (draw_fg) ImGui::GetForegroundDrawList()->AddCircle(window_center, window_size.y * 0.6f, IM_COL32(0, 255, 0, 200), 32, 10); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() //----------------------------------------------------------------------------- // Simplified structure to mimic a Document model struct MyDocument { const char* Name; // Document title bool Open; // Set when the document is open (in this demo, we keep an array of all available documents to simplify the demo) bool OpenPrev; // Copy of Open from last update. bool Dirty; // Set when the document has been modified bool WantClose; // Set when the document ImVec4 Color; // An arbitrary variable associated to the document MyDocument(const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f,1.0f,1.0f,1.0f)) { Name = name; Open = OpenPrev = open; Dirty = false; WantClose = false; Color = color; } void DoOpen() { Open = true; } void DoQueueClose() { WantClose = true; } void DoForceClose() { Open = false; Dirty = false; } void DoSave() { Dirty = false; } // Display dummy contents for the Document static void DisplayContents(MyDocument* doc) { ImGui::PushID(doc); ImGui::Text("Document \"%s\"", doc->Name); ImGui::PushStyleColor(ImGuiCol_Text, doc->Color); ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); ImGui::PopStyleColor(); if (ImGui::Button("Modify", ImVec2(100, 0))) doc->Dirty = true; ImGui::SameLine(); if (ImGui::Button("Save", ImVec2(100, 0))) doc->DoSave(); ImGui::ColorEdit3("color", &doc->Color.x); // Useful to test drag and drop and hold-dragged-to-open-tab behavior. ImGui::PopID(); } // Display context menu for the Document static void DisplayContextMenu(MyDocument* doc) { if (!ImGui::BeginPopupContextItem()) return; char buf[256]; sprintf(buf, "Save %s", doc->Name); if (ImGui::MenuItem(buf, "CTRL+S", false, doc->Open)) doc->DoSave(); if (ImGui::MenuItem("Close", "CTRL+W", false, doc->Open)) doc->DoQueueClose(); ImGui::EndPopup(); } }; struct ExampleAppDocuments { ImVector<MyDocument> Documents; ExampleAppDocuments() { Documents.push_back(MyDocument("Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f))); Documents.push_back(MyDocument("Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f))); Documents.push_back(MyDocument("Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f))); Documents.push_back(MyDocument("Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f))); Documents.push_back(MyDocument("A Rather Long Title", false)); Documents.push_back(MyDocument("Some Document", false)); } }; // [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. // If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, as opposed // to clicking on the regular tab closing button) and stops being submitted, it will take a frame for the tab bar to notice its absence. // During this frame there will be a gap in the tab bar, and if the tab that has disappeared was the selected one, the tab bar // will report no selected tab during the frame. This will effectively give the impression of a flicker for one frame. // We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch. // Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag. static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app) { for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open && doc->OpenPrev) ImGui::SetTabItemClosed(doc->Name); doc->OpenPrev = doc->Open; } } void ShowExampleAppDocuments(bool* p_open) { static ExampleAppDocuments app; if (!ImGui::Begin("Example: Documents", p_open, ImGuiWindowFlags_MenuBar)) { ImGui::End(); return; } // Options static bool opt_reorderable = true; static ImGuiTabBarFlags opt_fitting_flags = ImGuiTabBarFlags_FittingPolicyDefault_; // Menu if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { int open_count = 0; for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) open_count += app.Documents[doc_n].Open ? 1 : 0; if (ImGui::BeginMenu("Open", open_count < app.Documents.Size)) { for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open) if (ImGui::MenuItem(doc->Name)) doc->DoOpen(); } ImGui::EndMenu(); } if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0)) for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) app.Documents[doc_n].DoQueueClose(); if (ImGui::MenuItem("Exit", "Alt+F4")) {} ImGui::EndMenu(); } ImGui::EndMenuBar(); } // [Debug] List documents with one checkbox for each for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (doc_n > 0) ImGui::SameLine(); ImGui::PushID(doc); if (ImGui::Checkbox(doc->Name, &doc->Open)) if (!doc->Open) doc->DoForceClose(); ImGui::PopID(); } ImGui::Separator(); // Submit Tab Bar and Tabs { ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0); if (ImGui::BeginTabBar("##tabs", tab_bar_flags)) { if (opt_reorderable) NotifyOfDocumentsClosedElsewhere(app); // [DEBUG] Stress tests //if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on. //if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway.. // Submit Tabs for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open) continue; ImGuiTabItemFlags tab_flags = (doc->Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0); bool visible = ImGui::BeginTabItem(doc->Name, &doc->Open, tab_flags); // Cancel attempt to close when unsaved add to save queue so we can display a popup. if (!doc->Open && doc->Dirty) { doc->Open = true; doc->DoQueueClose(); } MyDocument::DisplayContextMenu(doc); if (visible) { MyDocument::DisplayContents(doc); ImGui::EndTabItem(); } } ImGui::EndTabBar(); } } // Update closing queue static ImVector<MyDocument*> close_queue; if (close_queue.empty()) { // Close queue is locked once we started a popup for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (doc->WantClose) { doc->WantClose = false; close_queue.push_back(doc); } } } // Display closing confirmation UI if (!close_queue.empty()) { int close_queue_unsaved_documents = 0; for (int n = 0; n < close_queue.Size; n++) if (close_queue[n]->Dirty) close_queue_unsaved_documents++; if (close_queue_unsaved_documents == 0) { // Close documents when all are unsaved for (int n = 0; n < close_queue.Size; n++) close_queue[n]->DoForceClose(); close_queue.clear(); } else { if (!ImGui::IsPopupOpen("Save?")) ImGui::OpenPopup("Save?"); if (ImGui::BeginPopupModal("Save?")) { ImGui::Text("Save change to the following items?"); ImGui::PushItemWidth(-1.0f); ImGui::ListBoxHeader("##", close_queue_unsaved_documents, 6); for (int n = 0; n < close_queue.Size; n++) if (close_queue[n]->Dirty) ImGui::Text("%s", close_queue[n]->Name); ImGui::ListBoxFooter(); if (ImGui::Button("Yes", ImVec2(80, 0))) { for (int n = 0; n < close_queue.Size; n++) { if (close_queue[n]->Dirty) close_queue[n]->DoSave(); close_queue[n]->DoForceClose(); } close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("No", ImVec2(80, 0))) { for (int n = 0; n < close_queue.Size; n++) close_queue[n]->DoForceClose(); close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("Cancel", ImVec2(80, 0))) { close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); } } } ImGui::End(); } // End of Demo code #else void ImGui::ShowAboutWindow(bool*) {} void ImGui::ShowDemoWindow(bool*) {} void ImGui::ShowUserGuide() {} void ImGui::ShowStyleEditor(ImGuiStyle*) {} #endif
;****************************************************************************** .define dir_reg, 0x00 .define port_reg, 0x01 .define pin_reg, 0x02 .define prescaler_l, 0x03 .define prescaler_h, 0x04 .define count_ctrl, 0x05 .define counter_val, 0x08 .define uart_baud, 0x0A .define uart_ctrl, 0x0B .define uart_buffer, 0x0C .define motor_control, 0x0D .define motor_enable, 0x0E .define motor_pwm0, 0x0F .define motor_pwm1, 0x10 .define servo, 0x11 .define gpu_addr, 0x2000 .define gpu_ctrl_reg, 0x80 .define top_isr_vec_reg_l, 0x16 .define top_isr_vec_reg_h, 0x17 ;****************************************************************************** .code ldi r14, 0xff ; set stack pointer ldi r15, 0x00 ldi r0, isr[l] ; setup the top isr vector out r0, top_isr_vec_reg_l ldi r0, isr[h] out r0, top_isr_vec_reg_h ldi r0, 128 ; center the servo out r0, servo ldi r0, 0b00011111 ; set gpio to output out r0, dir_reg ldi r0, 0x18 out r0, prescaler_h ; set MSPs of prescaler ldi r0, 0x6A out r0, prescaler_l ; set LSBs of prescaler ssr 8 ; enable all interrupts main: in r0, port_reg xoi r0, 1 out r0, port_reg ldi r0, 10 call delay br main ;****************************************************************************** ; r0 holds the delay in tenths of a second delay: push r0 push r1 ldi r1, 0x00 out r1, counter_val ; clear the counter ldi r1, 0b00010010 out r1, count_ctrl ; set pwm mode and enable top interrupt loop: cpi r0, 0 bnz loop ; wait for delay to be over pop r1 pop r0 ret ;****************************************************************************** isr: adi r0, -1 ; decrement the delay counter ssr 8 rnz ; If delay counter not zero, return ldi r1, 0 ; else, stop the counter and interrupts out r1, count_ctrl ret ;******************************************************************************
; Licensed to the .NET Foundation under one or more agreements. ; The .NET Foundation licenses this file to you under the MIT license. include <AsmMacros.inc> include AsmConstants.inc extern TheUMEntryPrestubWorker:proc extern UMEntryPrestubUnwindFrameChainHandler:proc ; ; METHODDESC_REGISTER: UMEntryThunk* ; NESTED_ENTRY TheUMEntryPrestub, _TEXT, UMEntryPrestubUnwindFrameChainHandler TheUMEntryPrestub_STACK_FRAME_SIZE = SIZEOF_MAX_OUTGOING_ARGUMENT_HOMES ; XMM save area TheUMEntryPrestub_XMM_SAVE_OFFSET = TheUMEntryPrestub_STACK_FRAME_SIZE TheUMEntryPrestub_STACK_FRAME_SIZE = TheUMEntryPrestub_STACK_FRAME_SIZE + SIZEOF_MAX_FP_ARG_SPILL ; Ensure that the new rsp will be 16-byte aligned. Note that the caller has ; already pushed the return address. if ((TheUMEntryPrestub_STACK_FRAME_SIZE + 8) MOD 16) ne 0 TheUMEntryPrestub_STACK_FRAME_SIZE = TheUMEntryPrestub_STACK_FRAME_SIZE + 8 endif alloc_stack TheUMEntryPrestub_STACK_FRAME_SIZE save_reg_postrsp rcx, TheUMEntryPrestub_STACK_FRAME_SIZE + 8h save_reg_postrsp rdx, TheUMEntryPrestub_STACK_FRAME_SIZE + 10h save_reg_postrsp r8, TheUMEntryPrestub_STACK_FRAME_SIZE + 18h save_reg_postrsp r9, TheUMEntryPrestub_STACK_FRAME_SIZE + 20h save_xmm128_postrsp xmm0, TheUMEntryPrestub_XMM_SAVE_OFFSET save_xmm128_postrsp xmm1, TheUMEntryPrestub_XMM_SAVE_OFFSET + 10h save_xmm128_postrsp xmm2, TheUMEntryPrestub_XMM_SAVE_OFFSET + 20h save_xmm128_postrsp xmm3, TheUMEntryPrestub_XMM_SAVE_OFFSET + 30h END_PROLOGUE ; ; Do prestub-specific stuff ; mov rcx, METHODDESC_REGISTER call TheUMEntryPrestubWorker ; ; we're going to tail call to the exec stub that we just setup ; mov rcx, [rsp + TheUMEntryPrestub_STACK_FRAME_SIZE + 8h] mov rdx, [rsp + TheUMEntryPrestub_STACK_FRAME_SIZE + 10h] mov r8, [rsp + TheUMEntryPrestub_STACK_FRAME_SIZE + 18h] mov r9, [rsp + TheUMEntryPrestub_STACK_FRAME_SIZE + 20h] movdqa xmm0, xmmword ptr [rsp + TheUMEntryPrestub_XMM_SAVE_OFFSET] movdqa xmm1, xmmword ptr [rsp + TheUMEntryPrestub_XMM_SAVE_OFFSET + 10h] movdqa xmm2, xmmword ptr [rsp + TheUMEntryPrestub_XMM_SAVE_OFFSET + 20h] movdqa xmm3, xmmword ptr [rsp + TheUMEntryPrestub_XMM_SAVE_OFFSET + 30h] ; ; epilogue ; add rsp, TheUMEntryPrestub_STACK_FRAME_SIZE TAILJMP_RAX NESTED_END TheUMEntryPrestub, _TEXT end
; lzo1y_s1.asm -- lzo1y_decompress_asm ; ; This file is part of the LZO real-time data compression library. ; ; Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer ; All Rights Reserved. ; ; The LZO library is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of ; the License, or (at your option) any later version. ; ; The LZO library is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with the LZO library; see the file COPYING. ; If not, write to the Free Software Foundation, Inc., ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; ; Markus F.X.J. Oberhumer ; <markus@oberhumer.com> ; http://www.oberhumer.com/opensource/lzo/ ; ; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ %include "asminit.def" %ifdef NAME1 globalf(NAME1(lzo1y_decompress_asm)) %endif %ifdef NAME2 globalf(NAME2(lzo1y_decompress_asm)) %endif %ifdef NAME1 NAME1(lzo1y_decompress_asm): %endif %ifdef NAME2 NAME2(lzo1y_decompress_asm): %endif db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 %ifdef NAME1 globalf_end(NAME1(lzo1y_decompress_asm)) %endif %ifdef NAME2 globalf_end(NAME2(lzo1y_decompress_asm)) %endif
; A128961: a(n) = (n^3 - n)*3^n. ; 0,54,648,4860,29160,153090,734832,3306744,14171760,58458510,233834040,911952756,3482001432,13057505370,48212327520,175630621680,632270238048,2252462723046,7949868434280,27824539519980,96653663595720,333455139405234,1143274763675088,3897527603437800,13217702307310800,44609745287173950,149888744164904472,501550797782564964,1671835992608549880,5552883832592683530,18381960273410262720,60660468902253866976,199592510581609497792,654912925345906164630,2143351392041147447880,6997411897546099021020,22791570180578722525608,74072603086880848208226,240235469470964913107760,777604282761281166111960,2512259990459523767438640,8102038469231964149989614,26084611657039494336551928,83843394611912660367488340,269078801312649933272404440,862275249660991831622932410,2759280798915173861193383712,8817701683489794730335378384,28141601117520621479793760800,89701353562096980966842612550,285579819503818959812805052200,908143826022144292204720065996,2884692153246811281120875503752,9153350101648535795864316502290,29014392775036868183117078724240,91878910454283415913204082626760,290671462164460261252682006855568,918729442912669040030798485954206,2901250872355796968518311008276440,9153946717950186986876739905423940,28858204907436182704391078345912760,90903345458423975518831896789625194,286122005377334480321569248911607168,899899855622261671979129089318764480 add $0,2 mov $1,3 pow $1,$0 bin $0,3 mul $0,$1 div $0,27 mul $0,54
INCLUDE "config_private.inc" SECTION code_clib SECTION code_math PUBLIC l_fast_mulu_16_16x16 EXTERN l_fast_mulu_24_16x8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_IMATH_FAST & $80 EXTERN error_mulu_overflow_mc ELSE EXTERN l_fast_mulu_32_24x16 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; l_fast_mulu_16_16x16: ; unsigned multiplication of two 16-bit ; multiplicands into a 16-bit product ; ; error reported on overflow ; ; enter : de = 16-bit multiplicand ; hl = 16-bit multiplicand ; ; exit : success ; ; a = 0 (LIA-1 enabled only) ; hl = 16-bit product ; carry reset ; ; unsigned overflow (LIA-1 enabled only) ; ; hl = $ffff = UINT_MAX ; carry set, errno = ERANGE ; ; uses : af, bc, de, hl ; try to reduce the multiplication inc d dec d ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_IMATH_FAST & $80 jr z, reduce_0 ELSE jp z, l_fast_mulu_24_16x8 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; inc h dec h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_IMATH_FAST & $80 jp nz, error_mulu_overflow_mc ; if both de and hl > 255 ELSE jr nz, mulu_32_16x16 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ex de,hl reduce_0: ; e = 8-bit multiplicand ; hl = 16-bit multiplicand ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_IMATH_FAST & $80 call l_fast_mulu_24_16x8 or a ret z ; if result confined to hl jp error_mulu_overflow_mc ELSE jp l_fast_mulu_24_16x8 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF (__CLIB_OPT_IMATH_FAST & $80) = 0 mulu_32_16x16: ld c,e ld b,d ld e,0 IF __CLIB_OPT_IMATH_FAST & $04 jp l_fast_mulu_32_24x16 ELSE push ix call l_fast_mulu_32_24x16 pop ix ret ENDIF ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include "kernel.inc" .db "KEXC" .db KEXC_ENTRY_POINT .dw start start: pcall(getLcdLock) pcall(allocScreenBuffer) pcall(clearScreen) kld(hl, message) ld de, 0 pcall(drawStr) jr $ ; Loop forever message: .db "Hello world!", 0
; void *balloc_firstfit(unsigned int queue, unsigned char num) SECTION code_clib SECTION code_alloc_balloc PUBLIC _balloc_firstfit EXTERN l0_balloc_firstfit_callee _balloc_firstfit: pop af pop hl pop bc push bc push hl push af jp l0_balloc_firstfit_callee
; A102678: Number of digits >= 6 in the decimal representations of all integers from 0 to n. ; 0,0,0,0,0,0,1,2,3,4,4,4,4,4,4,4,5,6,7,8,8,8,8,8,8,8,9,10,11,12,12,12,12,12,12,12,13,14,15,16,16,16,16,16,16,16,17,18,19,20,20,20,20,20,20,20,21,22,23,24,25,26,27,28,29,30,32,34,36,38,39,40,41,42,43,44,46,48,50,52,53,54,55,56,57,58,60,62,64,66,67,68,69,70,71,72,74,76,78,80,80,80,80,80,80,80,81,82,83,84,84,84,84,84,84,84,85,86,87,88,88,88,88,88,88,88,89,90,91,92,92,92,92,92,92,92,93,94,95,96,96,96,96,96,96,96,97,98,99,100,100,100,100,100,100,100,101,102,103,104,105,106,107,108,109,110,112,114,116,118,119,120,121,122,123,124,126,128,130,132,133,134,135,136,137,138,140,142,144,146,147,148,149,150,151,152,154,156,158,160,160,160,160,160,160,160,161,162,163,164,164,164,164,164,164,164,165,166,167,168,168,168,168,168,168,168,169,170,171,172,172,172,172,172,172,172,173,174,175,176,176,176,176,176,176,176,177,178,179,180 mov $2,$0 mov $3,$0 lpb $2,1 mov $0,$3 sub $2,1 sub $0,$2 cal $0,102677 ; Number of digits >= 6 in decimal representation of n. add $1,$0 lpe
; A236967: Expansion of (1+3*x)^2/(1-3*x)^2. ; 1,12,72,324,1296,4860,17496,61236,209952,708588,2361960,7794468,25509168,82904796,267846264,860934420,2754990144,8781531084,27894275208,88331871492,278942752080,878669669052,2761533245592,8661172452084,27113235502176,84728860944300 add $0,1 mov $3,$0 mov $5,3 lpb $0 sub $0,1 add $1,5 mov $2,$3 add $2,$5 sub $2,1 add $2,$0 sub $3,1 mov $4,$0 add $4,$3 add $2,$4 sub $2,1 add $3,1 add $3,$2 sub $2,1 trn $5,$1 mov $1,$5 lpe add $1,$2
SECTION code_fp_math48 PUBLIC ___schar2fs_callee EXTERN cm48_sdccixp_schar2ds_callee defc ___schar2fs_callee = cm48_sdccixp_schar2ds_callee
/* * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "app/src/invites/cached_receiver.h" #include <assert.h> namespace firebase { namespace invites { namespace internal { CachedReceiver::CachedReceiver() : match_strength_(kLinkMatchStrengthNoMatch), result_code_(0), has_pending_invite_(false), receiver_(nullptr) {} CachedReceiver::~CachedReceiver() { SetReceiver(nullptr); } ReceiverInterface* CachedReceiver::SetReceiver(ReceiverInterface* receiver) { MutexLock lock(lock_); ReceiverInterface* prev_receiver = receiver_; receiver_ = receiver; SendCachedInvite(); return prev_receiver; } void CachedReceiver::SendCachedInvite() { MutexLock lock(lock_); if (receiver_) { NotifyReceiver(receiver_); has_pending_invite_ = false; } } void CachedReceiver::NotifyReceiver(ReceiverInterface* receiver) { MutexLock lock(lock_); if (has_pending_invite_ && receiver) { receiver->ReceivedInviteCallback(invitation_id_, deep_link_url_, match_strength_, result_code_, error_message_); } } void CachedReceiver::ReceivedInviteCallback( const std::string& invitation_id, const std::string& deep_link_url, InternalLinkMatchStrength match_strength, int result_code, const std::string& error_message) { MutexLock lock(lock_); // If there is already a pending invite, don't override it with an empty // invite. if (has_pending_invite_ && invitation_id.empty() && deep_link_url.empty() && result_code == 0) { return; } has_pending_invite_ = true; invitation_id_ = invitation_id; deep_link_url_ = deep_link_url; match_strength_ = match_strength; result_code_ = result_code; error_message_ = error_message; SendCachedInvite(); } } // namespace internal } // namespace invites } // namespace firebase
; =============================================================== ; Mar 2014 ; =============================================================== ; ; void *wa_priority_queue_top(wa_priority_queue_t *q) ; ; Return word stored at front of queue. ; ; =============================================================== SECTION code_clib SECTION code_adt_wa_priority_queue PUBLIC asm_wa_priority_queue_top EXTERN asm_w_array_front asm_wa_priority_queue_top: inc hl inc hl jp asm_w_array_front ; enter : hl = priority_queue * ; ; exit : de = priority_queue.data ; bc = priority_queue.size in bytes ; ; success ; ; hl = word at front of priority_queue ; carry reset ; ; fail if priority_queue is empty ; ; hl = -1 ; carry set ; ; uses : af, bc, de, hl
db 0 ; species ID placeholder db 60, 60, 40, 35, 65, 45 ; hp atk def spd sat sdf db FIRE, GROUND ; type db 255 ; catch rate db 88 ; base exp db ICE_BERRY, ICE_BERRY ; items db GENDER_F50 ; gender ratio db 20 ; step cycles to hatch INCBIN "gfx/pokemon/numel/front.dimensions" db GROWTH_MEDIUM_FAST ; growth rate dn EGG_GROUND, EGG_GROUND ; egg groups db 70 ; happiness ; tm/hm learnset tmhm TOXIC, HIDDEN_POWER, SUNNY_DAY, PROTECT, FRUSTRATION, EARTHQUAKE, RETURN, DIG, DOUBLE_TEAM, FLAMETHROWER, SANDSTORM, FIRE_BLAST, ROCK_TOMB, FACADE, SECRET_POWER, REST, ATTRACT, OVERHEAT, ENDURE, WILL_O_WISP, STEALTH_ROCK, CAPTIVATE, ROCK_SLIDE, SLEEP_TALK, NATURAL_GIFT, SWAGGER, SUBSTITUTE, STRENGTH, ROCK_SMASH, EARTH_POWER, HEAT_WAVE, MUD_SLAP, ROLLOUT, SNORE ; end
; ; System Call for REX6000 ; ; $Id: syscall5.asm,v 1.5 2015/01/19 01:33:06 pauloscustodio Exp $ ; PUBLIC syscall5 .syscall5 ld ix,2 add ix,sp ld l,(ix+0) ;par 5 ld h,(ix+1) ld ($c00a),hl ld l,(ix+2) ;par 4 ld h,(ix+3) ld ($c008),hl ld l,(ix+4) ;par 3 ld h,(ix+5) ld ($c006),hl ld l,(ix+6) ;par 2 ld h,(ix+7) ld ($c004),hl ld l,(ix+8) ;par 1 ld h,(ix+9) ld ($c002),hl ld l,(ix+10) ;call ld h,(ix+11) ld ($c000),hl rst $10 ld hl,($c00e) ret
/********************************************************************** * Software License Agreement (BSD License) * * Copyright (c) 2016, Gabriel Hottiger, Christian Gehring * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Autonomous Systems Lab nor ETH Zurich * 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. */ /*! * @file SharedModulePlugin.hpp * @author Gabriel Hottiger * @date Aug, 2017 */ #pragma once // pluginlib #include <pluginlib/class_list_macros.h> // roco #include "rocoma_plugin/interfaces/SharedModulePluginInterface.hpp" /*! * Export your shared module as a SharedModulePlugin in order to load it as a plugin. * This macro is a wrapper to PLUGINLIB_EXPORT_CLASS. * Protects typedefs in internal namespace. */ #define ROCOMA_EXPORT_SHARED_MODULE(name, module) \ namespace plugin_##name_internal { \ using name = module; \ PLUGINLIB_EXPORT_CLASS(name, rocoma_plugin::SharedModulePlugin) \ } namespace rocoma_plugin { using SharedModulePlugin = rocoma_plugin::SharedModulePluginInterface; } /* namespace rocoma_plugin */
/* * Copyright (c) 2017, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ L0: mov (1|M0) r14.0<1>:uw a0.3<0;1,0>:uw cmp (1|M0) (eq)f0.0 null.0<1>:w r[a0.3]<0;1,0>:uw 0x0:uw (W&f0.0) jmpi L400 L48: cmp (16|M0) (ne)f0.0 null.0<1>:w r[a0.7]<16;16,1>:uw 0x0:uw and (1|M0) f0.0<1>:uw f0.0<0;1,0>:uw r[a0.3]<0;1,0>:uw mov (8|M0) a0.0<1>:uw r17.0<8;8,1>:uw (f0.0) if (16|M0) L384 L384 L112: add (16|M0) (sat)r16.0<1>:uw -r[a0.7]<16;16,1>:uw 0xFF00:uw mul (16|M0) acc0.0<1>:w r[a0.4]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.0]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.0]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.5]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.1]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.1]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.6]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.2]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.2]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.7]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.3]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.3]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x1:uw L384: endif (16|M0) L400 L400: mov (1|M0) a0.3<1>:uw r14.0<0;1,0>:uw cmp (1|M0) (eq)f0.0 null.0<1>:w r[a0.3,2]<0;1,0>:uw 0x0:uw (W&f0.0) jmpi L800 L448: cmp (16|M0) (ne)f0.0 null.0<1>:w r[a0.7,32]<16;16,1>:uw 0x0:uw and (1|M0) f0.0<1>:uw f0.0<0;1,0>:uw r[a0.3,2]<0;1,0>:uw mov (8|M0) a0.0<1>:uw r17.0<8;8,1>:uw (f0.0) if (16|M0) L784 L784 L512: add (16|M0) (sat)r16.0<1>:uw -r[a0.7,32]<16;16,1>:uw 0xFF00:uw mul (16|M0) acc0.0<1>:w r[a0.4,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.0,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.0,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.5,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.1,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.1,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.6,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.2,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.2,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.7,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.3,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.3,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x1:uw L784: endif (16|M0) L800 L800: add (4|M0) r17.0<1>:ud r17.0<4;4,1>:ud r22.4<1;2,0>:ud mov (8|M0) a0.0<1>:uw r17.0<8;8,1>:uw mov (1|M0) a0.3<1>:uw r14.0<0;1,0>:uw cmp (1|M0) (eq)f0.0 null.0<1>:w r[a0.3,4]<0;1,0>:uw 0x0:uw (W&f0.0) jmpi L1232 L880: cmp (16|M0) (ne)f0.0 null.0<1>:w r[a0.7]<16;16,1>:uw 0x0:uw and (1|M0) f0.0<1>:uw f0.0<0;1,0>:uw r[a0.3,4]<0;1,0>:uw mov (8|M0) a0.0<1>:uw r17.0<8;8,1>:uw (f0.0) if (16|M0) L1216 L1216 L944: add (16|M0) (sat)r16.0<1>:uw -r[a0.7]<16;16,1>:uw 0xFF00:uw mul (16|M0) acc0.0<1>:w r[a0.4]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.0]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.0]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.5]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.1]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.1]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.6]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.2]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.2]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.7]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.3]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.3]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x1:uw L1216: endif (16|M0) L1232 L1232: mov (1|M0) a0.3<1>:uw r14.0<0;1,0>:uw cmp (1|M0) (eq)f0.0 null.0<1>:w r[a0.3,6]<0;1,0>:uw 0x0:uw (W&f0.0) jmpi L1632 L1280: cmp (16|M0) (ne)f0.0 null.0<1>:w r[a0.7,32]<16;16,1>:uw 0x0:uw and (1|M0) f0.0<1>:uw f0.0<0;1,0>:uw r[a0.3,6]<0;1,0>:uw mov (8|M0) a0.0<1>:uw r17.0<8;8,1>:uw (f0.0) if (16|M0) L1616 L1616 L1344: add (16|M0) (sat)r16.0<1>:uw -r[a0.7,32]<16;16,1>:uw 0xFF00:uw mul (16|M0) acc0.0<1>:w r[a0.4,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.0,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.0,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.5,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.1,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.1,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.6,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.2,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.2,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x1:uw mul (16|M0) acc0.0<1>:w r[a0.7,32]<16;16,1>:uw 0xFFFF:uw mac (16|M0) acc0.0<1>:w r[a0.3,32]<16;16,1>:uw r16.0<16;16,1>:uw shr (16|M0) r[a0.3,32]<1>:uw acc0.0<16;16,1>:w 0x11:uw shl (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x1:uw L1616: endif (16|M0) L1632 L1632: mov (1|M0) a0.3<1>:uw r14.0<0;1,0>:uw nop
; ; Automatically generated ; .include "detokenise/detokenise.asm" .include "detokenise/dtprint.asm" .include "detokenise/identifier.asm" .include "detokenise/token.asm" .include "tokenise/search.asm" .include "tokenise/test.asm" .include "tokenise/tokenise.asm" .include "tokenise/tokident.asm" .include "tokenise/tokinteger.asm" .include "tokenise/tokpunct.asm" .include "tokenise/tokstring.asm" .include "tokentext.asm" .section code tokeniserHandler: dispatch tokeniserVectors tokeniserVectors: .word _DummyControlHandler ; index 0 .word Detokenise ; index 2 .word ListLine ; index 4 .word TokTest ; index 6 .word Tokenise ; index 8 .word TokeniseASCIIZ ; index 10 _DummyControlHandler: rts .send code
; A195180: a(n) = 5*n - floor(3*n*sqrt(2)). ; 0,1,2,3,4,4,5,6,7,7,8,9,10,10,11,12,13,13,14,15,16,16,17,18,19,19,20,21,22,22,23,24,25,25,26,27,28,29,29,30,31,32,32,33,34,35,35,36,37,38,38,39,40,41,41,42,43,44,44,45,46,47,47,48,49,50,50,51,52,53,54,54,55,56,57,57,58,59,60,60,61,62,63,63,64,65,66,66,67,68,69,69,70,71,72,72,73,74,75,75,76,77,78,79,79,80,81,82,82,83,84,85,85,86,87,88,88,89,90,91,91,92,93,94,94,95,96,97,97,98,99,100,100,101,102,103,104,104,105,106,107,107,108,109,110,110,111,112,113,113,114,115,116,116,117,118,119,119,120,121,122,122,123,124,125,125,126,127,128,128,129,130,131,132,132,133,134,135,135,136,137,138,138,139,140,141,141,142,143,144,144,145,146,147,147,148,149,150,150,151,152,153,153,154,155,156,157,157,158,159,160,160,161,162,163,163,164,165,166,166,167,168,169,169,170,171,172,172,173,174,175,175,176,177,178,178,179,180,181,182,182,183,184,185,185,186,187,188,188,189 lpb $0 mov $2,1 mul $2,$0 div $2,34 add $2,$0 mul $0,2 add $0,$2 mov $3,$0 div $3,4 clr $0,1 add $3,1 trn $0,$3 mov $2,$3 lpe mov $1,$2
; A056121: a(n) = n*(n + 15)/2. ; 0,8,17,27,38,50,63,77,92,108,125,143,162,182,203,225,248,272,297,323,350,378,407,437,468,500,533,567,602,638,675,713,752,792,833,875,918,962,1007,1053,1100,1148,1197,1247,1298,1350,1403,1457,1512,1568,1625 mov $1,$0 add $0,15 mul $1,$0 div $1,2
; A179741: a(n) = (2*n+1)*(6*n-1). ; -1,15,55,119,207,319,455,615,799,1007,1239,1495,1775,2079,2407,2759,3135,3535,3959,4407,4879,5375,5895,6439,7007,7599,8215,8855,9519,10207,10919,11655,12415,13199,14007,14839,15695,16575,17479,18407,19359,20335,21335,22359,23407,24479,25575,26695,27839,29007,30199,31415,32655,33919,35207,36519,37855,39215,40599,42007,43439,44895,46375,47879,49407,50959,52535,54135,55759,57407,59079,60775,62495,64239,66007,67799,69615,71455,73319,75207,77119,79055,81015,82999,85007,87039,89095,91175,93279,95407,97559,99735,101935,104159,106407,108679,110975,113295,115639,118007,120399,122815,125255,127719,130207,132719,135255,137815,140399,143007,145639,148295,150975,153679,156407,159159,161935,164735,167559,170407,173279,176175,179095,182039,185007,187999,191015,194055,197119,200207,203319,206455,209615,212799,216007,219239,222495,225775,229079,232407,235759,239135,242535,245959,249407,252879,256375,259895,263439,267007,270599,274215,277855,281519,285207,288919,292655,296415,300199,304007,307839,311695,315575,319479,323407,327359,331335,335335,339359,343407,347479,351575,355695,359839,364007,368199,372415,376655,380919,385207,389519,393855,398215,402599,407007,411439,415895,420375,424879,429407,433959,438535,443135,447759,452407,457079,461775,466495,471239,476007,480799,485615,490455,495319,500207,505119,510055,515015,519999,525007,530039,535095,540175,545279,550407,555559,560735,565935,571159,576407,581679,586975,592295,597639,603007,608399,613815,619255,624719,630207,635719,641255,646815,652399,658007,663639,669295,674975,680679,686407,692159,697935,703735,709559,715407,721279,727175,733095,739039,745007 mul $0,6 add $0,1 pow $0,2 sub $0,4 mov $1,$0 div $1,3
ORG 0000H MOV R0,#40H MOV R2,#10H MOV DPTR,#9000H LOOP: MOV A,@R0 CJNE A,B,Z INC R1 Z: INC R0 DJNZ R2,LOOP MOV A,R1 MOVX @DPTR,A JMP $ RET END
#include "Platform.inc" #include "TestDoubles.inc" radix decimal udata global calledEnableAdcCount global calledDisableAdcCount calledEnableAdcCount res 1 calledDisableAdcCount res 1 EnableDisableAdcMocks code global initialiseEnableAndDisableAdcMocks global enableAdc global disableAdc initialiseEnableAndDisableAdcMocks: banksel calledEnableAdcCount clrf calledEnableAdcCount clrf calledDisableAdcCount return enableAdc: mockIncrementCallCounter calledEnableAdcCount return disableAdc: mockIncrementCallCounter calledDisableAdcCount return end
main: main.loop: CAL getc CMP $20, $0, #10 CAL putc BRA main.loop, !NE $20 main.end: RET
#include "daScript/misc/platform.h" #include "daScript/ast/ast.h" #include "daScript/ast/ast_match.h" #include "daScript/ast/ast_expressions.h" #include "daScript/simulate/runtime_array.h" #include "daScript/simulate/runtime_table_nodes.h" #include "daScript/simulate/runtime_range.h" #include "daScript/simulate/runtime_string_delete.h" #include "daScript/simulate/hash.h" #include "daScript/simulate/simulate_nodes.h" #include "daScript/misc/lookup1.h" namespace das { // common for move and copy SimNode * makeLocalCMResMove (const LineInfo & at, Context & context, uint32_t offset, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset); return right; } } // now, to the regular move auto left = context.code->makeNode<SimNode_GetCMResOfs>(at, offset); auto right = rE->simulate(context); if ( rightType.isRef() ) { return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf()); } else { DAS_ASSERTF(0, "we are calling makeLocalCMResMove where expression on a right is not a referece." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); return nullptr; } } SimNode * makeLocalCMResCopy(const LineInfo & at, Context & context, uint32_t offset, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; assert ( rightType.canCopy() && "we are calling makeLocalCMResCopy on a type, which can't be copied." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); auto right = rE->simulate(context); // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * rightC = (SimNode_CallBase *) right; rightC->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset); return rightC; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * rightC = (SimNode_CallBase *) right; rightC->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset); return rightC; } } // wo standard path auto left = context.code->makeNode<SimNode_GetCMResOfs>(rE->at, offset); if ( rightType.isHandle() ) { auto resN = rightType.annotation->simulateCopy(context, at, left, (!rightType.isRefType() && rightType.ref) ? rightType.annotation->simulateRef2Value(context, at, right) : right); if ( !resN ) { context.thisProgram->error("integration error, simulateCopy returned null", at, CompilationError::missing_node ); } return resN; } else if ( rightType.isRef() ) { return context.code->makeNode<SimNode_CopyRefValue>(at, left, right, rightType.getSizeOf()); } else { return context.code->makeValueNode<SimNode_Set>(rightType.baseType, at, left, right); } } SimNode * makeLocalRefMove (const LineInfo & at, Context & context, uint32_t stackTop, uint32_t offset, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset); return right; } } // now, to the regular move auto left = context.code->makeNode<SimNode_GetLocalRefOff>(at, stackTop, offset); auto right = rE->simulate(context); if ( rightType.isRef() ) { return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf()); } else { DAS_ASSERTF(0, "we are calling makeLocalRefMove where expression on a right is not a referece." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); return nullptr; } } SimNode * makeLocalRefCopy(const LineInfo & at, Context & context, uint32_t stackTop, uint32_t offset, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; assert ( rightType.canCopy() && "we are calling makeLocalRefCopy on a type, which can't be copied." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); auto right = rE->simulate(context); // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * rightC = (SimNode_CallBase *) right; rightC->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset); return rightC; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * rightC = (SimNode_CallBase *) right; rightC->cmresEval = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset); return rightC; } } // wo standard path auto left = context.code->makeNode<SimNode_GetLocalRefOff>(rE->at, stackTop, offset); if ( rightType.isHandle() ) { auto resN = rightType.annotation->simulateCopy(context, at, left, (!rightType.isRefType() && rightType.ref) ? rightType.annotation->simulateRef2Value(context, at, right) : right); if ( !resN ) { context.thisProgram->error("integration error, simulateCopy returned null", at, CompilationError::missing_node ); } return resN; } else if ( rightType.isRef() ) { return context.code->makeNode<SimNode_CopyRefValue>(at, left, right, rightType.getSizeOf()); } else { return context.code->makeValueNode<SimNode_Set>(rightType.baseType, at, left, right); } } SimNode * makeLocalMove (const LineInfo & at, Context & context, uint32_t stackTop, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocal>(rE->at, stackTop); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocal>(rE->at, stackTop); return right; } } // now, to the regular move auto left = context.code->makeNode<SimNode_GetLocal>(at, stackTop); auto right = rE->simulate(context); if ( rightType.isRef() ) { return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf()); } else { DAS_ASSERTF(0, "we are calling makeLocalMove where expression on a right is not a referece." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); return nullptr; } } SimNode * makeLocalCopy(const LineInfo & at, Context & context, uint32_t stackTop, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; assert ( rightType.canCopy() && "we are calling makeLocalCopy on a type, which can't be copied." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocal>(rE->at, stackTop); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = context.code->makeNode<SimNode_GetLocal>(rE->at, stackTop); return right; } } // now, to the regular copy auto left = context.code->makeNode<SimNode_GetLocal>(rE->at, stackTop); auto right = rE->simulate(context); if ( rightType.isHandle() ) { auto resN = rightType.annotation->simulateCopy(context, at, left, (!rightType.isRefType() && rightType.ref) ? rightType.annotation->simulateRef2Value(context, at, right) : right); if ( !resN ) { context.thisProgram->error("integration error, simulateCopy returned null", at, CompilationError::missing_node ); } return resN; } else if ( rightType.isRef() ) { return context.code->makeNode<SimNode_CopyRefValue>(at, left, right, rightType.getSizeOf()); } else { return context.code->makeValueNode<SimNode_Set>(rightType.baseType, at, left, right); } } SimNode * makeCopy(const LineInfo & at, Context & context, const ExpressionPtr & lE, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; assert ( rightType.canCopy() && "we are calling makeCopy on a type, which can't be copied." "we should not be here, script compiler should have caught this during compilation." "compiler later will likely report internal compilation error."); // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = lE->simulate(context); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = lE->simulate(context); return right; } } // now, to the regular copy auto left = lE->simulate(context); auto right = rE->simulate(context); if ( rightType.isHandle() ) { auto resN = rightType.annotation->simulateCopy(context, at, left, (!rightType.isRefType() && rightType.ref) ? rightType.annotation->simulateRef2Value(context, at, right) : right); if ( !resN ) { context.thisProgram->error("integration error, simulateCopy returned null", at, CompilationError::missing_node ); } return resN; } else if ( rightType.isRef() ) { return context.code->makeNode<SimNode_CopyRefValue>(at, left, right, rightType.getSizeOf()); } else { return context.code->makeValueNode<SimNode_Set>(rightType.baseType, at, left, right); } } SimNode * makeMove (const LineInfo & at, Context & context, const ExpressionPtr & lE, const ExpressionPtr & rE ) { const auto & rightType = *rE->type; // now, call with CMRES if ( rE->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(rE); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = lE->simulate(context); return right; } } // now, invoke with CMRES if ( rE->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(rE); if ( cll->isCopyOrMove() ) { SimNode_CallBase * right = (SimNode_CallBase *) rE->simulate(context); right->cmresEval = lE->simulate(context); return right; } } // now to the regular one if ( rightType.isRef() ) { auto left = lE->simulate(context); auto right = rE->simulate(context); return context.code->makeNode<SimNode_MoveRefValue>(at, left, right, rightType.getSizeOf()); } else { // this here might happen during initialization, by moving value types // like var t <- 5 // its ok to generate simplified set here auto left = lE->simulate(context); auto right = rE->simulate(context); return context.code->makeValueNode<SimNode_Set>(rightType.baseType, at, left, right); } } SimNode * Function::makeSimNode ( Context & context ) { if ( copyOnReturn || moveOnReturn ) { return context.code->makeNodeUnroll<SimNode_CallAndCopyOrMove>(int(arguments.size()), at); } else if ( fastCall ) { return context.code->makeNodeUnroll<SimNode_FastCall>(int(arguments.size()), at); } else { return context.code->makeNodeUnroll<SimNode_Call>(int(arguments.size()), at); } } SimNode * Function::simulate (Context & context) const { if ( builtIn ) { DAS_ASSERTF(0, "can only simulate non built-in function"); return nullptr; } if ( fastCall ) { assert(totalStackSize == sizeof(Prologue) && "function can't allocate stack"); assert((result->isWorkhorseType() || result->isVoid()) && "fastcall can only return a workhorse type"); assert(body->rtti_isBlock() && "function must contain a block"); auto block = static_pointer_cast<ExprBlock>(body); assert(block->list.size()==1 && "fastcall is only one expr in a function body"); if ( block->list.back()->rtti_isReturn() ) { assert(block->list.back()->rtti_isReturn() && "fastcall body expr is return"); auto retE = static_pointer_cast<ExprReturn>(block->list.back()); assert(retE->subexpr && "fastcall must return a value"); return retE->subexpr->simulate(context); } else { return block->list.back()->simulate(context); } } else { return body->simulate(context); } } SimNode * Expression::trySimulate (Context &, uint32_t, Type ) const { return nullptr; } void ExprMakeLocal::setRefSp ( bool ref, bool cmres, uint32_t sp, uint32_t off ) { useStackRef = ref; useCMRES = cmres; doesNotNeedSp = true; doesNotNeedInit = true; stackTop = sp; extraOffset = off; } vector<SimNode *> ExprMakeLocal::simulateLocal ( Context & /*context*/ ) const { return vector<SimNode *>(); } void ExprMakeStructure::setRefSp ( bool ref, bool cmres, uint32_t sp, uint32_t off ) { ExprMakeLocal::setRefSp(ref, cmres, sp, off); int total = int(structs.size()); int stride = makeType->getStride(); // we go through all fields, and if its [[ ]] field // we tell it to piggy-back on our current sp, with appropriate offset for ( int index=0; index != total; ++index ) { auto & fields = structs[index]; for ( const auto & decl : *fields ) { auto field = makeType->structType->findField(decl->name); assert(field && "should have failed in type infer otherwise"); if ( decl->value->rtti_isMakeLocal() ) { uint32_t offset = extraOffset + index*stride + field->offset; auto mkl = static_pointer_cast<ExprMakeLocal>(decl->value); mkl->setRefSp(ref, cmres, sp, offset); } else if ( decl->value->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(decl->value); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { cll->doesNotNeedSp = true; } } else if ( decl->value->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(decl->value); if ( cll->isCopyOrMove() ) { cll->doesNotNeedSp = true; } } } } } vector<SimNode *> ExprMakeStructure::simulateLocal (Context & context) const { vector<SimNode *> simlist; // init with 0 int total = int(structs.size()); int stride = makeType->getStride(); if ( !doesNotNeedInit && !initAllFields ) { int bytes = total * stride; SimNode * init0; if ( useCMRES ) { if ( bytes <= 32 ) { init0 = context.code->makeNodeUnroll<SimNode_InitLocalCMResN>(bytes, at,extraOffset); } else { init0 = context.code->makeNode<SimNode_InitLocalCMRes>(at,extraOffset,bytes); } } else if ( useStackRef ) { init0 = context.code->makeNode<SimNode_InitLocalRef>(at,stackTop,extraOffset,bytes); } else { init0 = context.code->makeNode<SimNode_InitLocal>(at,stackTop + extraOffset,bytes); } simlist.push_back(init0); } for ( int index=0; index != total; ++index ) { auto & fields = structs[index]; for ( const auto & decl : *fields ) { auto field = makeType->structType->findField(decl->name); assert(field && "should have failed in type infer otherwise"); uint32_t offset = extraOffset + index*stride + field->offset; SimNode * cpy; if ( decl->value->rtti_isMakeLocal() ) { // so what happens here, is we ask it for the generated commands and append it to this list only auto mkl = static_pointer_cast<ExprMakeLocal>(decl->value); auto lsim = mkl->simulateLocal(context); simlist.insert(simlist.end(), lsim.begin(), lsim.end()); continue; } else if ( useCMRES ) { if ( decl->moveSemantic ){ cpy = makeLocalCMResMove(at,context,offset,decl->value); } else { cpy = makeLocalCMResCopy(at,context,offset,decl->value); } } else if ( useStackRef ) { if ( decl->moveSemantic ){ cpy = makeLocalRefMove(at,context,stackTop,offset,decl->value); } else { cpy = makeLocalRefCopy(at,context,stackTop,offset,decl->value); } } else { if ( decl->moveSemantic ){ cpy = makeLocalMove(at,context,stackTop+offset,decl->value); } else { cpy = makeLocalCopy(at,context,stackTop+offset,decl->value); } } if ( !cpy ) { context.thisProgram->error("internal compilation error, can't generate structure initialization", at); } simlist.push_back(cpy); } } return simlist; } SimNode * ExprMakeStructure::simulate (Context & context) const { SimNode_Block * block; if ( useCMRES ) { block = context.code->makeNode<SimNode_MakeLocalCMRes>(at); } else { block = context.code->makeNode<SimNode_MakeLocal>(at, stackTop); } auto simlist = simulateLocal(context); block->total = int(simlist.size()); block->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->total); for ( uint32_t i = 0; i != block->total; ++i ) block->list[i] = simlist[i]; return block; } // make array void ExprMakeArray::setRefSp ( bool ref, bool cmres, uint32_t sp, uint32_t off ) { ExprMakeLocal::setRefSp(ref, cmres, sp, off); int total = int(values.size()); uint32_t stride = recordType->getSizeOf(); for ( int index=0; index != total; ++index ) { auto & val = values[index]; if ( val->rtti_isMakeLocal() ) { uint32_t offset = extraOffset + index*stride; auto mkl = static_pointer_cast<ExprMakeLocal>(val); mkl->setRefSp(ref, cmres, sp, offset); } else if ( val->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(val); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { cll->doesNotNeedSp = true; } } else if ( val->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(val); if ( cll->isCopyOrMove() ) { cll->doesNotNeedSp = true; } } } } vector<SimNode *> ExprMakeArray::simulateLocal (Context & context) const { vector<SimNode *> simlist; // init with 0 int total = int(values.size()); uint32_t stride = recordType->getSizeOf(); if ( !doesNotNeedInit && !initAllFields ) { int bytes = total * stride; SimNode * init0; if ( useCMRES ) { if ( bytes <= 32 ) { init0 = context.code->makeNodeUnroll<SimNode_InitLocalCMResN>(bytes, at,extraOffset); } else { init0 = context.code->makeNode<SimNode_InitLocalCMRes>(at,extraOffset,bytes); } } else if ( useStackRef ) { init0 = context.code->makeNode<SimNode_InitLocalRef>(at,stackTop,extraOffset,stride * total); } else { init0 = context.code->makeNode<SimNode_InitLocal>(at,stackTop + extraOffset,stride * total); } simlist.push_back(init0); } for ( int index=0; index != total; ++index ) { auto & val = values[index]; uint32_t offset = extraOffset + index*stride; SimNode * cpy; if ( val->rtti_isMakeLocal() ) { // so what happens here, is we ask it for the generated commands and append it to this list only auto mkl = static_pointer_cast<ExprMakeLocal>(val); auto lsim = mkl->simulateLocal(context); simlist.insert(simlist.end(), lsim.begin(), lsim.end()); continue; } else if ( useCMRES ) { if (val->type->canCopy()) { cpy = makeLocalCMResCopy(at, context, offset, val); } else { cpy = makeLocalCMResMove(at, context, offset, val); } } else if ( useStackRef ) { if (val->type->canCopy()) { cpy = makeLocalRefCopy(at, context, stackTop, offset, val); } else { cpy = makeLocalRefMove(at, context, stackTop, offset, val); } } else { if (val->type->canCopy()) { cpy = makeLocalCopy(at, context, stackTop + offset, val); } else { cpy = makeLocalMove(at, context, stackTop + offset, val); } } if ( !cpy ) { context.thisProgram->error("internal compilation error, can't generate array initialization", at); } simlist.push_back(cpy); } return simlist; } SimNode * ExprMakeArray::simulate (Context & context) const { SimNode_Block * block; if ( useCMRES ) { block = context.code->makeNode<SimNode_MakeLocalCMRes>(at); } else { block = context.code->makeNode<SimNode_MakeLocal>(at, stackTop); } auto simlist = simulateLocal(context); block->total = int(simlist.size()); block->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->total); for ( uint32_t i = 0; i != block->total; ++i ) block->list[i] = simlist[i]; return block; } // make tuple void ExprMakeTuple::setRefSp ( bool ref, bool cmres, uint32_t sp, uint32_t off ) { ExprMakeLocal::setRefSp(ref, cmres, sp, off); int total = int(values.size()); for ( int index=0; index != total; ++index ) { auto & val = values[index]; if ( val->rtti_isMakeLocal() ) { uint32_t offset = extraOffset + makeType->getTupleFieldOffset(index); auto mkl = static_pointer_cast<ExprMakeLocal>(val); mkl->setRefSp(ref, cmres, sp, offset); } else if ( val->rtti_isCall() ) { auto cll = static_pointer_cast<ExprCall>(val); if ( cll->func->copyOnReturn || cll->func->moveOnReturn ) { cll->doesNotNeedSp = true; } } else if ( val->rtti_isInvoke() ) { auto cll = static_pointer_cast<ExprInvoke>(val); if ( cll->isCopyOrMove() ) { cll->doesNotNeedSp = true; } } } } vector<SimNode *> ExprMakeTuple::simulateLocal (Context & context) const { vector<SimNode *> simlist; // init with 0 int total = int(values.size()); if ( !doesNotNeedInit && !initAllFields ) { uint32_t sizeOf = makeType->getSizeOf(); SimNode * init0; if ( useCMRES ) { if ( sizeOf <= 32 ) { init0 = context.code->makeNodeUnroll<SimNode_InitLocalCMResN>(sizeOf, at,extraOffset); } else { init0 = context.code->makeNode<SimNode_InitLocalCMRes>(at,extraOffset,sizeOf); } } else if ( useStackRef ) { init0 = context.code->makeNode<SimNode_InitLocalRef>(at,stackTop,extraOffset,sizeOf); } else { init0 = context.code->makeNode<SimNode_InitLocal>(at,stackTop + extraOffset,sizeOf); } simlist.push_back(init0); } for ( int index=0; index != total; ++index ) { auto & val = values[index]; uint32_t offset = extraOffset + makeType->getTupleFieldOffset(index); SimNode * cpy; if ( val->rtti_isMakeLocal() ) { // so what happens here, is we ask it for the generated commands and append it to this list only auto mkl = static_pointer_cast<ExprMakeLocal>(val); auto lsim = mkl->simulateLocal(context); simlist.insert(simlist.end(), lsim.begin(), lsim.end()); continue; } else if ( useCMRES ) { if (val->type->canCopy()) { cpy = makeLocalCMResCopy(at, context, offset, val); } else { cpy = makeLocalCMResMove(at, context, offset, val); } } else if ( useStackRef ) { if (val->type->canCopy()) { cpy = makeLocalRefCopy(at, context, stackTop, offset, val); } else { cpy = makeLocalRefMove(at, context, stackTop, offset, val); } } else { if (val->type->canCopy()) { cpy = makeLocalCopy(at, context, stackTop + offset, val); } else { cpy = makeLocalMove(at, context, stackTop + offset, val); } } if ( !cpy ) { context.thisProgram->error("internal compilation error, can't generate array initialization", at); } simlist.push_back(cpy); } return simlist; } SimNode * ExprMakeTuple::simulate (Context & context) const { SimNode_Block * block; if ( useCMRES ) { block = context.code->makeNode<SimNode_MakeLocalCMRes>(at); } else { block = context.code->makeNode<SimNode_MakeLocal>(at, stackTop); } auto simlist = simulateLocal(context); block->total = int(simlist.size()); block->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->total); for ( uint32_t i = 0; i != block->total; ++i ) block->list[i] = simlist[i]; return block; } // label SimNode * ExprLabel::simulate (Context & context) const { context.thisProgram->error("internal compilation error, calling 'simulate' on label", at); return nullptr; } // goto SimNode * ExprGoto::simulate (Context & context) const { if ( subexpr ) { return context.code->makeNode<SimNode_Goto>(at, subexpr->simulate(context)); } else { return context.code->makeNode<SimNode_GotoLabel>(at,label); } } // r2v SimNode * ExprRef2Value::GetR2V ( Context & context, const LineInfo & at, const TypeDeclPtr & type, SimNode * expr ) { if ( type->isHandle() ) { auto resN = type->annotation->simulateRef2Value(context, at, expr); if ( !resN ) { context.thisProgram->error("integration error, simulateRef2Value returned null", at, CompilationError::missing_node ); } return resN; } else { if ( type->isRefType() ) { return expr; } else { return context.code->makeValueNode<SimNode_Ref2Value>(type->baseType, at, expr); } } } SimNode * ExprRef2Value::simulate (Context & context) const { return GetR2V(context, at, type, subexpr->simulate(context)); } SimNode * ExprAddr::simulate (Context & context) const { assert(func->index>=0 && "how, we specified in the unused"); Func fn; fn.index = func->index + 1; vec4f cval = v_zero(); *(Func *)&cval = fn; return context.code->makeNode<SimNode_ConstValue>(at,cval); } SimNode * ExprPtr2Ref::simulate (Context & context) const { return context.code->makeNode<SimNode_Ptr2Ref>(at,subexpr->simulate(context)); } SimNode * ExprRef2Ptr::simulate (Context & context) const { return subexpr->simulate(context); } SimNode * ExprNullCoalescing::simulate (Context & context) const { if ( type->ref ) { return context.code->makeNode<SimNode_NullCoalescingRef>(at,subexpr->simulate(context),defaultValue->simulate(context)); } else { return context.code->makeValueNode<SimNode_NullCoalescing>(type->baseType,at,subexpr->simulate(context),defaultValue->simulate(context)); } } SimNode * ExprConst::simulate (Context & context) const { return context.code->makeNode<SimNode_ConstValue>(at,value); } SimNode * ExprConstString::simulate (Context & context) const { char * str = context.constStringHeap->allocateString(text); return context.code->makeNode<SimNode_ConstString>(at,str); } SimNode * ExprStaticAssert::simulate (Context &) const { return nullptr; } SimNode * ExprAssert::simulate (Context & context) const { string message; if ( arguments.size()==2 && arguments[1]->rtti_isStringConstant() ) message = static_pointer_cast<ExprConstString>(arguments[1])->getValue(); return context.code->makeNode<SimNode_Assert>(at,arguments[0]->simulate(context),context.constStringHeap->allocateString(message)); } SimNode * ExprDebug::simulate (Context & context) const { TypeInfo * pTypeInfo = context.thisHelper->makeTypeInfo(nullptr, arguments[0]->type); string message; if ( arguments.size()==2 && arguments[1]->rtti_isStringConstant() ) message = static_pointer_cast<ExprConstString>(arguments[1])->getValue(); return context.code->makeNode<SimNode_Debug>(at, arguments[0]->simulate(context), pTypeInfo, context.constStringHeap->allocateString(message)); } SimNode * ExprMakeLambda::simulate (Context & context) const { DAS_ASSERTF(0, "we should not be here ever, ExprMakeLambda should completly fold during type inference."); context.thisProgram->error("internal compilation error, generating node for ExprMakeLambda", at); return nullptr; } SimNode * ExprArrayComprehension::simulate (Context & context) const { DAS_ASSERTF(0, "we should not be here ever, ExprArrayComprehension should completly fold during type inference."); context.thisProgram->error("internal compilation error, generating node for ExprArrayComprehension", at); return nullptr; } SimNode * ExprMakeBlock::simulate (Context & context) const { uint32_t argSp = static_pointer_cast<ExprBlock>(block)->stackTop; return context.code->makeNode<SimNode_MakeBlock>(at,block->simulate(context),argSp,stackTop); } bool ExprInvoke::isCopyOrMove() const { auto blockT = arguments[0]->type; return blockT->firstType && blockT->firstType->isRefType() && !blockT->firstType->ref; } SimNode * ExprInvoke::simulate (Context & context) const { auto blockT = arguments[0]->type; SimNode_CallBase * pInvoke; if ( isCopyOrMove() ) { auto getSp = context.code->makeNode<SimNode_GetLocal>(at,stackTop); if ( blockT->baseType==Type::tBlock ) { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_InvokeAndCopyOrMove>( int(arguments.size()), at, getSp); } else if ( blockT->baseType==Type::tFunction ) { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_InvokeAndCopyOrMoveFn>( int(arguments.size()), at, getSp); } else { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_InvokeAndCopyOrMoveLambda>( int(arguments.size()), at, getSp); } } else { if ( blockT->baseType==Type::tBlock ) { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_Invoke>(int(arguments.size()),at); } else if ( blockT->baseType==Type::tFunction ) { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_InvokeFn>(int(arguments.size()),at); } else { pInvoke = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_InvokeLambda>(int(arguments.size()),at); } } pInvoke->debugInfo = at; if ( int nArg = (int) arguments.size() ) { pInvoke->arguments = (SimNode **) context.code->allocate(nArg * sizeof(SimNode *)); pInvoke->nArguments = nArg; for ( int a=0; a!=nArg; ++a ) { pInvoke->arguments[a] = arguments[a]->simulate(context); } } else { pInvoke->arguments = nullptr; pInvoke->nArguments = 0; } return pInvoke; } SimNode * ExprErase::simulate (Context & context) const { auto cont = arguments[0]->simulate(context); auto val = arguments[1]->simulate(context); if ( arguments[0]->type->isGoodTableType() ) { uint32_t valueTypeSize = arguments[0]->type->secondType->getSizeOf(); return context.code->makeValueNode<SimNode_TableErase>(arguments[0]->type->firstType->baseType, at, cont, val, valueTypeSize); } else { DAS_ASSERTF(0, "we should not even be here. erase can only accept tables. infer type should have failed."); context.thisProgram->error("internal compilation error, generating erase for non-table type", at); return nullptr; } } SimNode * ExprFind::simulate (Context & context) const { auto cont = arguments[0]->simulate(context); auto val = arguments[1]->simulate(context); if ( arguments[0]->type->isGoodTableType() ) { uint32_t valueTypeSize = arguments[0]->type->secondType->getSizeOf(); return context.code->makeValueNode<SimNode_TableFind>(arguments[0]->type->firstType->baseType, at, cont, val, valueTypeSize); } else { DAS_ASSERTF(0, "we should not even be here. find can only accept tables. infer type should have failed."); context.thisProgram->error("internal compilation error, generating find for non-table type", at); return nullptr; } } SimNode * ExprKeyExists::simulate (Context & context) const { auto cont = arguments[0]->simulate(context); auto val = arguments[1]->simulate(context); if ( arguments[0]->type->isGoodTableType() ) { uint32_t valueTypeSize = arguments[0]->type->secondType->getSizeOf(); return context.code->makeValueNode<SimNode_KeyExists>(arguments[0]->type->firstType->baseType, at, cont, val, valueTypeSize); } else { DAS_ASSERTF(0, "we should not even be here. find can only accept tables. infer type should have failed."); context.thisProgram->error("internal compilation error, generating find for non-table type", at); return nullptr; } } SimNode * ExprTypeInfo::simulate (Context & context) const { DAS_ASSERTF(0, "we should not even be here. typeinfo should resolve to const during infer pass."); context.thisProgram->error("internal compilation error, generating typeinfo(...)", at); return nullptr; } SimNode * ExprDelete::simulate (Context & context) const { uint32_t total = uint32_t(subexpr->type->getCountOf()); auto sube = subexpr->simulate(context); if ( subexpr->type->baseType==Type::tArray ) { auto stride = subexpr->type->firstType->getSizeOf(); return context.code->makeNode<SimNode_DeleteArray>(at, sube, total, stride); } else if ( subexpr->type->baseType==Type::tTable ) { auto vts_add_kts = subexpr->type->firstType->getSizeOf() + subexpr->type->secondType->getSizeOf(); return context.code->makeNode<SimNode_DeleteTable>(at, sube, total, vts_add_kts); } else if ( subexpr->type->baseType==Type::tPointer ) { if ( subexpr->type->firstType->baseType==Type::tStructure ) { auto structSize = subexpr->type->firstType->getSizeOf(); return context.code->makeNode<SimNode_DeleteStructPtr>(at, sube, total, structSize); } else if ( subexpr->type->firstType->baseType==Type::tTuple ) { auto structSize = subexpr->type->firstType->getSizeOf(); return context.code->makeNode<SimNode_DeleteStructPtr>(at, sube, total, structSize); } else { auto ann = subexpr->type->firstType->annotation; assert(ann->canDeletePtr() && "has to be able to delete ptr"); auto resN = ann->simulateDeletePtr(context, at, sube, total); if ( !resN ) { context.thisProgram->error("integration error, simulateDelete returned null", at, CompilationError::missing_node ); } return resN; } } else if ( subexpr->type->baseType==Type::tHandle ) { auto ann = subexpr->type->annotation; assert(ann->canDelete() && "has to be able to delete"); auto resN = ann->simulateDelete(context, at, sube, total); if ( !resN ) { context.thisProgram->error("integration error, simulateDelete returned null", at, CompilationError::missing_node ); } return resN; } else if ( subexpr->type->baseType==Type::tString ) { return context.code->makeNode<SimNode_DeleteString>(at, sube, total); } else { DAS_ASSERTF(0, "we should not be here. this is delete for unsupported type. infer types should have failed."); context.thisProgram->error("internal compilation error, generating node for unsupported ExprDelete", at); return nullptr; } } SimNode * ExprCast::trySimulate (Context & context, uint32_t extraOffset, Type r2vType ) const { return subexpr->trySimulate(context, extraOffset, r2vType); } SimNode * ExprCast::simulate (Context & context) const { return subexpr->simulate(context); } SimNode * ExprAscend::simulate (Context & context) const { auto se = subexpr->simulate(context); auto bytes = subexpr->type->getSizeOf(); TypeInfo * typeInfo = nullptr; if ( needTypeInfo ) { typeInfo = context.thisHelper->makeTypeInfo(nullptr, subexpr->type); } if ( useStackRef ) { return context.code->makeNode<SimNode_AscendAndRef<false>>(at, se, bytes, stackTop, typeInfo); } else { return context.code->makeNode<SimNode_Ascend<false>>(at, se, bytes, typeInfo); } } SimNode * ExprNew::simulate (Context & context) const { SimNode * newNode; if ( typeexpr->baseType == Type::tHandle ) { assert(typeexpr->annotation->canNew() && "how???"); newNode = typeexpr->annotation->simulateGetNew(context, at); if ( !newNode ) { context.thisProgram->error("integration error, simulateGetNew returned null", at, CompilationError::missing_node ); } } else { int32_t bytes = type->firstType->getSizeOf(); if ( initializer ) { auto pCall = (SimNode_CallBase *) context.code->makeNodeUnroll<SimNode_NewWithInitializer>(int(arguments.size()),at,bytes); pCall->cmresEval = nullptr; newNode = ExprCall::simulateCall(func->shared_from_this(), this, context, pCall); } else { newNode = context.code->makeNode<SimNode_New>(at,bytes); } } if ( type->dim.size() ) { uint32_t count = type->getCountOf(); return context.code->makeNode<SimNode_NewArray>(at,newNode,stackTop,count); } else { return newNode; } } SimNode * ExprAt::trySimulate (Context & context, uint32_t extraOffset, Type r2vType ) const { if ( subexpr->type->isVectorType() ) { return nullptr; } else if ( subexpr->type->isGoodTableType() ) { return nullptr; } else if ( subexpr->type->isHandle() ) { SimNode * result; if ( r2vType!=Type::none ) { result = subexpr->type->annotation->simulateGetAtR2V(context, at, index->type, subexpr, index, extraOffset); if ( !result ) { context.thisProgram->error("integration error, simulateGetAtR2V returned null", at, CompilationError::missing_node ); } } else { result = subexpr->type->annotation->simulateGetAt(context, at, index->type, subexpr, index, extraOffset); if ( !result ) { context.thisProgram->error("integration error, simulateGetAt returned null", at, CompilationError::missing_node ); } } return result; } else if ( subexpr->type->isGoodArrayType() ) { auto prv = subexpr->simulate(context); auto pidx = index->simulate(context); uint32_t stride = subexpr->type->firstType->getSizeOf(); if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_ArrayAtR2V>(r2vType, at, prv, pidx, stride, extraOffset); } else { return context.code->makeNode<SimNode_ArrayAt>(at, prv, pidx, stride, extraOffset); } } else if ( subexpr->type->isPointer() ) { uint32_t range = 0xffffffff; uint32_t stride = subexpr->type->firstType->getSizeOf(); auto prv = subexpr->simulate(context); auto pidx = index->simulate(context); if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_AtR2V>(r2vType, at, prv, pidx, stride, extraOffset, range); } else { return context.code->makeNode<SimNode_At>(at, prv, pidx, stride, extraOffset, range); } } else { uint32_t range = subexpr->type->dim.back(); uint32_t stride = subexpr->type->getStride(); if ( index->rtti_isConstant() ) { // if its constant index, like a[3]..., we try to let node bellow simulate auto idxCE = static_pointer_cast<ExprConst>(index); uint32_t idxC = cast<uint32_t>::to(idxCE->value); if ( idxC >= range ) { context.thisProgram->error("index out of range", at, CompilationError::index_out_of_range); return nullptr; } auto tnode = subexpr->trySimulate(context, extraOffset + idxC*stride, r2vType); if ( tnode ) { return tnode; } } // regular scenario auto prv = subexpr->simulate(context); auto pidx = index->simulate(context); if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_AtR2V>(r2vType, at, prv, pidx, stride, extraOffset, range); } else { return context.code->makeNode<SimNode_At>(at, prv, pidx, stride, extraOffset, range); } } } SimNode * ExprAt::simulate (Context & context) const { if ( subexpr->type->isVectorType() ) { auto prv = subexpr->simulate(context); auto pidx = index->simulate(context); uint32_t range = subexpr->type->getVectorDim(); uint32_t stride = type->getSizeOf(); if ( subexpr->type->ref ) { auto res = context.code->makeNode<SimNode_At>(at, prv, pidx, stride, 0, range); if ( r2v ) { return ExprRef2Value::GetR2V(context, at, type, res); } else { return res; } } else { switch ( type->baseType ) { case tInt: return context.code->makeNode<SimNode_AtVector<int32_t>>(at, prv, pidx, range); case tUInt: return context.code->makeNode<SimNode_AtVector<uint32_t>>(at, prv, pidx, range); case tFloat: return context.code->makeNode<SimNode_AtVector<float>>(at, prv, pidx, range); default: DAS_ASSERTF(0, "we should not even be here. infer type should have failed on unsupported_vector[blah]"); context.thisProgram->error("internal compilation error, generating vector at for unsupported vector type.", at); return nullptr; } } } else if ( subexpr->type->isGoodTableType() ) { auto prv = subexpr->simulate(context); auto pidx = index->simulate(context); uint32_t valueTypeSize = subexpr->type->secondType->getSizeOf(); auto res = context.code->makeValueNode<SimNode_TableIndex>(subexpr->type->firstType->baseType, at, prv, pidx, valueTypeSize, 0); if ( r2v ) { return ExprRef2Value::GetR2V(context, at, type, res); } else { return res; } } else { if ( r2v ) { return trySimulate(context, 0, type->baseType); } else { return trySimulate(context, 0, Type::none); } } } vector<SimNode *> ExprBlock::collectExpressions ( Context & context, const vector<ExpressionPtr> & lis, map<int32_t,uint32_t> * ofsmap ) const { vector<SimNode *> simlist; for ( auto & node : lis ) { if ( node->rtti_isLet()) { auto pLet = static_pointer_cast<ExprLet>(node); auto letInit = ExprLet::simulateInit(context, pLet.get()); simlist.insert(simlist.end(), letInit.begin(), letInit.end()); continue; } if ( node->rtti_isLabel() ) { if ( ofsmap ) { auto lnode = static_pointer_cast<ExprLabel>(node); (*ofsmap)[lnode->label] = uint32_t(simlist.size()); } continue; } if ( auto simE = node->simulate(context) ) { simlist.push_back(simE); } } return simlist; } void ExprBlock::simulateFinal ( Context & context, SimNode_Final * block ) const { vector<SimNode *> simFList = collectExpressions(context, finalList); block->totalFinal = int(simFList.size()); if ( block->totalFinal ) { block->finalList = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->totalFinal); for ( uint32_t i = 0; i != block->totalFinal; ++i ) block->finalList[i] = simFList[i]; } } void ExprBlock::simulateBlock ( Context & context, SimNode_Block * block ) const { map<int32_t,uint32_t> ofsmap; vector<SimNode *> simlist = collectExpressions(context, list, &ofsmap); block->total = int(simlist.size()); if ( block->total ) { block->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->total); for ( uint32_t i = 0; i != block->total; ++i ) block->list[i] = simlist[i]; } simulateLabels(context, block, ofsmap); } void ExprBlock::simulateLabels ( Context & context, SimNode_Block * block, const map<int32_t,uint32_t> & ofsmap ) const { if ( maxLabelIndex!=-1 ) { block->totalLabels = maxLabelIndex + 1; block->labels = (uint32_t *) context.code->allocate(block->totalLabels * sizeof(uint32_t)); for ( uint32_t i=0; i!=block->totalLabels; ++i ) { block->labels[i] = -1U; } for ( auto & it : ofsmap ) { block->labels[it.first] = it.second; } } } SimNode * ExprBlock::simulate (Context & context) const { map<int32_t,uint32_t> ofsmap; vector<SimNode *> simlist = collectExpressions(context, list, &ofsmap); // TODO: what if list size is 0? if ( simlist.size()!=1 || isClosure || finalList.size() ) { SimNode_Block * block; if ( isClosure ) { bool needResult = type!=nullptr && type->baseType!=Type::tVoid; bool C0 = !needResult && simlist.size()==1 && finalList.size()==0; block = context.code->makeNode<SimNode_ClosureBlock>(at, needResult, C0, annotationData); } else { if ( maxLabelIndex!=-1 ) { block = context.code->makeNode<SimNode_BlockWithLabels>(at); simulateLabels(context, block, ofsmap); } else { if ( finalList.size()==0 ) { block = context.code->makeNode<SimNode_BlockNF>(at); } else { block = context.code->makeNode<SimNode_Block>(at); } } } block->annotationDataSid = annotationDataSid; block->total = int(simlist.size()); if ( block->total ) { block->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*block->total); for ( uint32_t i = 0; i != block->total; ++i ) block->list[i] = simlist[i]; } if ( !inTheLoop ) { simulateFinal(context, block); } return block; } else { return simlist[0]; } } SimNode * ExprSwizzle::trySimulate (Context & context, uint32_t extraOffset, Type r2vType ) const { if ( !value->type->ref ) { return nullptr; } uint32_t offset = fields[0] * sizeof(float); if ( auto chain = value->trySimulate(context, extraOffset + offset, r2vType) ) { return chain; } auto simV = value->simulate(context); if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_FieldDerefR2V>(r2vType,at,simV,offset + extraOffset); } else { return context.code->makeNode<SimNode_FieldDeref>(at,simV,offset + extraOffset); } } SimNode * ExprSwizzle::simulate (Context & context) const { if ( !type->ref ) { bool seq = TypeDecl::isSequencialMask(fields); if (seq && value->type->ref) { return trySimulate(context, 0, type->baseType); } else { auto fsz = fields.size(); uint8_t fs[4]; fs[0] = fields[0]; fs[1] = fsz >= 2 ? fields[1] : fields[0]; fs[2] = fsz >= 3 ? fields[2] : fields[0]; fs[3] = fsz >= 4 ? fields[3] : fields[0]; auto simV = value->simulate(context); return context.code->makeNode<SimNode_Swizzle>(at, simV, fs); } } else { return trySimulate(context, 0, r2v ? type->baseType : Type::none); } } SimNode * ExprField::simulate (Context & context) const { if ( !field && tupleIndex==-1 ) { if ( r2v ) { auto resN = annotation->simulateGetFieldR2V(name, context, at, value); if ( !resN ) { context.thisProgram->error("integration error, simulateGetFieldR2V returned null", at, CompilationError::missing_node ); } return resN; } else { auto resN = annotation->simulateGetField(name, context, at, value); if ( !resN ) { context.thisProgram->error("integration error, simulateGetField returned null", at, CompilationError::missing_node ); } return resN; } } else { return trySimulate(context, 0, r2v ? type->baseType : Type::none); } } SimNode * ExprField::trySimulate (Context & context, uint32_t extraOffset, Type r2vType ) const { if ( !field && tupleIndex==-1 ) { return nullptr; } int fieldOffset = -1; if ( tupleIndex != - 1 ) { if ( value->type->isPointer() ) { fieldOffset = value->type->firstType->getTupleFieldOffset(tupleIndex); } else { fieldOffset = value->type->getTupleFieldOffset(tupleIndex); } } else { fieldOffset = field->offset; } DAS_ASSERTF(fieldOffset>=0,"field offset is somehow not there"); if (value->type->isPointer()) { if ( unsafeDeref ) { if ( auto chain = value->trySimulate(context, extraOffset + fieldOffset, r2vType) ) { return chain; } auto simV = value->simulate(context); if (r2vType != Type::none) { return context.code->makeValueNode<SimNode_FieldDerefR2V>(r2vType, at, simV, fieldOffset + extraOffset); } else { return context.code->makeNode<SimNode_FieldDeref>(at, simV, fieldOffset + extraOffset); } } else { auto simV = value->simulate(context); if (r2vType != Type::none) { return context.code->makeValueNode<SimNode_PtrFieldDerefR2V>(r2vType, at, simV, fieldOffset + extraOffset); } else { return context.code->makeNode<SimNode_PtrFieldDeref>(at, simV, fieldOffset + extraOffset); } } } else { if ( auto chain = value->trySimulate(context, extraOffset + fieldOffset, r2vType) ) { return chain; } auto simV = value->simulate(context); if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_FieldDerefR2V>(r2vType, at, simV, extraOffset + fieldOffset); } else { return context.code->makeNode<SimNode_FieldDeref>(at, simV, extraOffset + fieldOffset); } } } SimNode * ExprSafeField::simulate (Context & context) const { int fieldOffset = -1; if ( !annotation ) { if ( tupleIndex != - 1 ) { fieldOffset = value->type->firstType->getTupleFieldOffset(tupleIndex); } else { fieldOffset = field->offset; } DAS_ASSERTF(fieldOffset>=0,"field offset is somehow not there"); } if ( skipQQ ) { if ( annotation ) { auto resN = annotation->simulateSafeGetFieldPtr(name, context, at, value); if ( !resN ) { context.thisProgram->error("integration error, simulateSafeGetFieldPtr returned null", at, CompilationError::missing_node ); } return resN; } else { auto resN = context.code->makeNode<SimNode_SafeFieldDerefPtr>(at,value->simulate(context),fieldOffset); if ( !resN ) { context.thisProgram->error("integration error, simulateSafeFieldDerefPtr returned null", at, CompilationError::missing_node ); } return resN; } } else { if ( annotation ) { auto resN = annotation->simulateSafeGetField(name, context, at, value); if ( !resN ) { context.thisProgram->error("integration error, simulateSafeGetField returned null", at, CompilationError::missing_node ); } return resN; } else { return context.code->makeNode<SimNode_SafeFieldDeref>(at,value->simulate(context),fieldOffset); } } } SimNode * ExprStringBuilder::simulate (Context & context) const { SimNode_StringBuilder * pSB = context.code->makeNode<SimNode_StringBuilder>(at); if ( int nArg = (int) elements.size() ) { pSB->arguments = (SimNode **) context.code->allocate(nArg * sizeof(SimNode *)); pSB->types = (TypeInfo **) context.code->allocate(nArg * sizeof(TypeInfo *)); pSB->nArguments = nArg; for ( int a=0; a!=nArg; ++a ) { pSB->arguments[a] = elements[a]->simulate(context); pSB->types[a] = context.thisHelper->makeTypeInfo(nullptr, elements[a]->type); } } else { pSB->arguments = nullptr; pSB->types = nullptr; pSB->nArguments = 0; } return pSB; } SimNode * ExprVar::trySimulate (Context & context, uint32_t extraOffset, Type r2vType ) const { if ( block ) { } else if ( local ) { if ( variable->type->ref ) { if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_GetLocalRefOffR2V>(r2vType, at, variable->stackTop, extraOffset); } else { return context.code->makeNode<SimNode_GetLocalRefOff>(at, variable->stackTop, extraOffset); } } else if ( variable->aliasCMRES ) { if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_GetCMResOfsR2V>(r2vType, at,extraOffset); } else { return context.code->makeNode<SimNode_GetCMResOfs>(at, extraOffset); } } else { if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_GetLocalR2V>(r2vType, at, variable->stackTop + extraOffset); } else { return context.code->makeNode<SimNode_GetLocal>(at, variable->stackTop + extraOffset); } } } else if ( argument ) { if ( variable->type->isPointer() && variable->type->isRef() ) { return nullptr; } else if ( variable->type->isPointer() ) { if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_GetArgumentRefOffR2V>(r2vType, at, argumentIndex, extraOffset); } else { return context.code->makeNode<SimNode_GetArgumentRefOff>(at, argumentIndex, extraOffset); } } else if (variable->type->isRef()) { if ( r2vType!=Type::none ) { return context.code->makeValueNode<SimNode_GetArgumentRefOffR2V>(r2vType, at, argumentIndex, extraOffset); } else { return context.code->makeNode<SimNode_GetArgumentRefOff>(at, argumentIndex, extraOffset); } } } else { // global } return nullptr; } SimNode * ExprVar::simulate (Context & context) const { if ( block ) { auto blk = pBlock.lock(); if (variable->type->isRef()) { if (r2v && !type->isRefType()) { if ( thisBlock ) { return context.code->makeValueNode<SimNode_GetThisBlockArgumentR2V>(type->baseType, at, argumentIndex); } else { return context.code->makeValueNode<SimNode_GetBlockArgumentR2V>(type->baseType, at, argumentIndex, blk->stackTop); } } else { if ( thisBlock ) { return context.code->makeNode<SimNode_GetThisBlockArgument>(at, argumentIndex); } else { return context.code->makeNode<SimNode_GetBlockArgument>(at, argumentIndex, blk->stackTop); } } } else { if (r2v && !type->isRefType()) { if ( thisBlock ) { return context.code->makeNode<SimNode_GetThisBlockArgument>(at, argumentIndex); } else { return context.code->makeNode<SimNode_GetBlockArgument>(at, argumentIndex, blk->stackTop); } } else { if ( thisBlock ) { return context.code->makeNode<SimNode_GetThisBlockArgumentRef>(at, argumentIndex); } else { return context.code->makeNode<SimNode_GetBlockArgumentRef>(at, argumentIndex, blk->stackTop); } } } } else if ( local ) { if ( r2v ) { return trySimulate(context, 0, type->baseType); } else { return trySimulate(context, 0, Type::none); } } else if ( argument) { if (variable->type->isRef()) { if (r2v && !type->isRefType()) { return context.code->makeValueNode<SimNode_GetArgumentR2V>(type->baseType, at, argumentIndex); } else { return context.code->makeNode<SimNode_GetArgument>(at, argumentIndex); } } else { if (r2v && !type->isRefType()) { return context.code->makeNode<SimNode_GetArgument>(at, argumentIndex); } else { return context.code->makeNode<SimNode_GetArgumentRef>(at, argumentIndex); } } } else { assert(variable->index >= 0 && "using variable which is not used. how?"); if ( r2v ) { return context.code->makeValueNode<SimNode_GetGlobalR2V>(type->baseType, at, variable->stackTop); } else { return context.code->makeNode<SimNode_GetGlobal>(at, variable->stackTop); } } } SimNode * ExprOp1::simulate (Context & context) const { if ( func->builtIn && !func->callBased ) { auto pSimOp1 = static_cast<SimNode_Op1 *>(func->makeSimNode(context)); pSimOp1->x = subexpr->simulate(context); return pSimOp1; } else { auto pCall = static_cast<SimNode_CallBase *>(func->makeSimNode(context)); pCall->debugInfo = at; pCall->fnPtr = context.getFunction(func->index); pCall->fnIndex = func->index; pCall->arguments = (SimNode **) context.code->allocate(1 * sizeof(SimNode *)); pCall->nArguments = 1; pCall->arguments[0] = subexpr->simulate(context); pCall->cmresEval = context.code->makeNode<SimNode_GetLocal>(at,stackTop); return pCall; } } SimNode * ExprOp2::simulate (Context & context) const { if ( func->builtIn && !func->callBased ) { auto pSimOp2 = static_cast<SimNode_Op2 *>(func->makeSimNode(context)); pSimOp2->l = left->simulate(context); pSimOp2->r = right->simulate(context); return pSimOp2; } else { auto pCall = static_cast<SimNode_CallBase *>(func->makeSimNode(context)); pCall->debugInfo = at; pCall->fnPtr = context.getFunction(func->index); pCall->fnIndex = func->index; pCall->arguments = (SimNode **) context.code->allocate(2 * sizeof(SimNode *)); pCall->nArguments = 2; pCall->arguments[0] = left->simulate(context); pCall->arguments[1] = right->simulate(context); pCall->cmresEval = context.code->makeNode<SimNode_GetLocal>(at,stackTop); return pCall; } } SimNode * ExprOp3::simulate (Context & context) const { return context.code->makeNode<SimNode_IfThenElse>(at, subexpr->simulate(context), left->simulate(context), right->simulate(context)); } SimNode * ExprMove::simulate (Context & context) const { auto retN = makeMove(at,context,left,right); if ( !retN ) { context.thisProgram->error("internal compilation error, can't generate move", at); } return retN; } SimNode * ExprClone::simulate (Context & context) const { SimNode * retN = nullptr; if ( left->type->isHandle() ) { auto lN = left->simulate(context); auto rN = right->simulate(context); retN = left->type->annotation->simulateClone(context, at, lN, rN); } else if ( left->type->canCopy() ) { retN = makeCopy(at, context, left, right ); } else { retN = nullptr; } if ( !retN ) { context.thisProgram->error("internal compilation error, can't generate clone", at); } return retN; } SimNode * ExprCopy::simulate (Context & context) const { if ( takeOverRightStack ) { auto sl = left->simulate(context); auto sr = right->simulate(context); return context.code->makeNode<SimNode_SetLocalRefAndEval>(at, sl, sr, stackTop); } else { auto retN = makeCopy(at, context, left, right); if ( !retN ) { context.thisProgram->error("internal compilation error, can't generate copy", at); } return retN; } } SimNode * ExprTryCatch::simulate (Context & context) const { return context.code->makeNode<SimNode_TryCatch>(at, try_block->simulate(context), catch_block->simulate(context)); } SimNode * ExprReturn::simulate (Context & context) const { // return string is its own thing if (subexpr && subexpr->type && subexpr->rtti_isConstant()) { if (subexpr->type->isSimpleType(Type::tString)) { auto cVal = static_pointer_cast<ExprConstString>(subexpr); char * str = context.constStringHeap->allocateString(cVal->text); return context.code->makeNode<SimNode_ReturnConstString>(at, str); } } // now, lets do the standard everything bool skipIt = false; if ( subexpr && subexpr->rtti_isMakeLocal() ) { if ( static_pointer_cast<ExprMakeLocal>(subexpr)->useCMRES ) { skipIt = true; } } SimNode * simSubE = (subexpr && !skipIt) ? subexpr->simulate(context) : nullptr; if (!subexpr) { return context.code->makeNode<SimNode_ReturnNothing>(at); } else if ( subexpr->rtti_isConstant() ) { auto cVal = static_pointer_cast<ExprConst>(subexpr); return context.code->makeNode<SimNode_ReturnConst>(at, cVal->value); } if ( returnReference ) { if ( returnInBlock ) { return context.code->makeNode<SimNode_ReturnReferenceFromBlock>(at, simSubE); } else { return context.code->makeNode<SimNode_ReturnReference>(at, simSubE); } } else if ( returnInBlock ) { if ( returnCallCMRES ) { SimNode_CallBase * simRet = (SimNode_CallBase *) simSubE; simRet->cmresEval = context.code->makeNode<SimNode_GetBlockCMResOfs>(at,0,stackTop); return context.code->makeNode<SimNode_Return>(at, simSubE); } else if ( takeOverRightStack ) { return context.code->makeNode<SimNode_ReturnRefAndEvalFromBlock>(at, simSubE, refStackTop, stackTop); } else if ( block->copyOnReturn ) { return context.code->makeNode<SimNode_ReturnAndCopyFromBlock>(at, simSubE, subexpr->type->getSizeOf(), stackTop); } else if ( block->moveOnReturn ) { return context.code->makeNode<SimNode_ReturnAndMoveFromBlock>(at, simSubE, subexpr->type->getSizeOf(), stackTop); } } else if ( subexpr ) { if ( returnCallCMRES ) { SimNode_CallBase * simRet = (SimNode_CallBase *) simSubE; simRet->cmresEval = context.code->makeNode<SimNode_GetCMResOfs>(at,0); return context.code->makeNode<SimNode_Return>(at, simSubE); } else if ( returnCMRES ) { // ReturnLocalCMRes if ( subexpr->rtti_isMakeLocal() ) { auto mkl = static_pointer_cast<ExprMakeLocal>(subexpr); if ( mkl->useCMRES ) { SimNode_Block * blockT = context.code->makeNode<SimNode_ReturnLocalCMRes>(at); auto simlist = mkl->simulateLocal(context); blockT->total = int(simlist.size()); blockT->list = (SimNode **) context.code->allocate(sizeof(SimNode *)*blockT->total); for ( uint32_t i = 0; i != blockT->total; ++i ) blockT->list[i] = simlist[i]; return blockT; } } return context.code->makeNode<SimNode_Return>(at, simSubE); } else if ( takeOverRightStack ) { return context.code->makeNode<SimNode_ReturnRefAndEval>(at, simSubE, refStackTop); } else if ( func && func->copyOnReturn ) { return context.code->makeNode<SimNode_ReturnAndCopy>(at, simSubE, subexpr->type->getSizeOf()); } else if ( func && func->moveOnReturn ) { return context.code->makeNode<SimNode_ReturnAndMove>(at, simSubE, subexpr->type->getSizeOf()); } } return context.code->makeNode<SimNode_Return>(at, simSubE); } SimNode * ExprBreak::simulate (Context & context) const { return context.code->makeNode<SimNode_Break>(at); } SimNode * ExprContinue::simulate (Context & context) const { return context.code->makeNode<SimNode_Continue>(at); } SimNode * ExprIfThenElse::simulate (Context & context) const { ExpressionPtr zeroCond; bool condIfZero = false; if ( matchEquNequZero(cond, zeroCond, condIfZero) ) { if ( condIfZero ) { if ( if_false ) { return context.code->makeNumericValueNode<SimNode_IfZeroThenElse>(zeroCond->type->baseType, at, zeroCond->simulate(context), if_true->simulate(context), if_false->simulate(context)); } else { return context.code->makeNumericValueNode<SimNode_IfZeroThen>(zeroCond->type->baseType, at, zeroCond->simulate(context), if_true->simulate(context)); } } else { if ( if_false ) { return context.code->makeNumericValueNode<SimNode_IfNotZeroThenElse>(zeroCond->type->baseType, at, zeroCond->simulate(context), if_true->simulate(context), if_false->simulate(context)); } else { return context.code->makeNumericValueNode<SimNode_IfNotZeroThen>(zeroCond->type->baseType, at, zeroCond->simulate(context), if_true->simulate(context)); } } } else { // good old if if ( if_false ) { return context.code->makeNode<SimNode_IfThenElse>(at, cond->simulate(context), if_true->simulate(context), if_false->simulate(context)); } else { return context.code->makeNode<SimNode_IfThen>(at, cond->simulate(context), if_true->simulate(context)); } } } SimNode * ExprWith::simulate (Context & context) const { return body->simulate(context); } void ExprWhile::simulateFinal ( Context & context, const ExpressionPtr & bod, SimNode_Block * blk ) { if ( bod->rtti_isBlock() ) { auto pBlock = static_pointer_cast<ExprBlock>(bod); pBlock->simulateBlock(context, blk); pBlock->simulateFinal(context, blk); } else { context.thisProgram->error("internal error, expecting block", bod->at); } } SimNode * ExprWhile::simulate (Context & context) const { auto node = context.code->makeNode<SimNode_While>(at, cond->simulate(context)); simulateFinal(context, body, node); return node; } SimNode * ExprFor::simulate (Context & context) const { // determine iteration types bool nativeIterators = false; bool fixedArrays = false; bool dynamicArrays = false; bool stringChars = false; bool rangeBase = false; int32_t fixedSize = INT32_MAX; for ( auto & src : sources ) { if ( !src->type ) continue; if ( src->type->isArray() ) { fixedSize = das::min(fixedSize, src->type->dim.back()); fixedArrays = true; } else if ( src->type->isGoodArrayType() ) { dynamicArrays = true; } else if ( src->type->isGoodIteratorType() ) { nativeIterators = true; } else if ( src->type->isHandle() ) { nativeIterators = true; } else if ( src->type->isRange() ) { rangeBase = true; } else if ( src->type->isString() ) { stringChars = true; } } // create loops based on int total = int(sources.size()); int sourceTypes = int(dynamicArrays) + int(fixedArrays) + int(rangeBase) + int(stringChars); bool hybridRange = rangeBase && (total>1); if ( (sourceTypes>1) || hybridRange || nativeIterators || stringChars ) { SimNode_ForWithIteratorBase * result = (SimNode_ForWithIteratorBase *) context.code->makeNodeUnroll<SimNode_ForWithIterator>(total, at); for ( int t=0; t!=total; ++t ) { if ( sources[t]->type->isGoodIteratorType() ) { result->source_iterators[t] = sources[t]->simulate(context); } else if ( sources[t]->type->isGoodArrayType() ) { result->source_iterators[t] = context.code->makeNode<SimNode_GoodArrayIterator>( sources[t]->at, sources[t]->simulate(context), sources[t]->type->firstType->getStride()); } else if ( sources[t]->type->isRange() ) { result->source_iterators[t] = context.code->makeNode<SimNode_RangeIterator>( sources[t]->at, sources[t]->simulate(context)); } else if ( sources[t]->type->isString() ) { result->source_iterators[t] = context.code->makeNode<SimNode_StringIterator>( sources[t]->at, sources[t]->simulate(context)); } else if ( sources[t]->type->isHandle() ) { result->source_iterators[t] = sources[t]->type->annotation->simulateGetIterator( context, sources[t]->at, sources[t] ); if ( !result ) { context.thisProgram->error("integration error, simulateGetIterator returned null", at, CompilationError::missing_node ); return nullptr; } } else if ( sources[t]->type->dim.size() ) { result->source_iterators[t] = context.code->makeNode<SimNode_FixedArrayIterator>( sources[t]->at, sources[t]->simulate(context), sources[t]->type->dim.back(), sources[t]->type->getStride()); } else { DAS_ASSERTF(0, "we should not be here. we are doing iterator for on an unsupported type."); context.thisProgram->error("internal compilation error, generating for-with-iterator", at); return nullptr; } result->stackTop[t] = iteratorVariables[t]->stackTop; } ExprWhile::simulateFinal(context, subexpr, result); return result; } else { auto flagsE = subexpr->getEvalFlags(); bool NF = flagsE == 0; SimNode_ForBase * result; assert(subexpr->rtti_isBlock() && "there would be internal error otherwise"); auto subB = static_pointer_cast<ExprBlock>(subexpr); bool loop1 = (subB->list.size() == 1); if ( dynamicArrays ) { if (loop1) { result = (SimNode_ForBase *) context.code->makeNodeUnroll<SimNode_ForGoodArray1>(total, at); } else { result = (SimNode_ForBase *) context.code->makeNodeUnroll<SimNode_ForGoodArray>(total, at); } } else if ( fixedArrays ) { if (loop1) { result = (SimNode_ForBase *)context.code->makeNodeUnroll<SimNode_ForFixedArray1>(total, at); } else { result = (SimNode_ForBase *)context.code->makeNodeUnroll<SimNode_ForFixedArray>(total, at); } } else if ( rangeBase ) { assert(total==1 && "simple range on 1 loop only"); if ( NF ) { if (loop1) { result = context.code->makeNode<SimNode_ForRangeNF1>(at); } else { result = context.code->makeNode<SimNode_ForRangeNF>(at); } } else { if (loop1) { result = context.code->makeNode<SimNode_ForRange1>(at); } else { result = context.code->makeNode<SimNode_ForRange>(at); } } } else { DAS_ASSERTF(0, "we should not be here yet. logic above assumes optimized for path of some kind."); context.thisProgram->error("internal compilation error, generating for", at); return nullptr; } for ( int t=0; t!=total; ++t ) { result->sources[t] = sources[t]->simulate(context); if ( sources[t]->type->isGoodArrayType() ) { result->strides[t] = sources[t]->type->firstType->getStride(); } else { result->strides[t] = sources[t]->type->getStride(); } result->stackTop[t] = iteratorVariables[t]->stackTop; } result->size = fixedSize; ExprWhile::simulateFinal(context, subexpr, result); return result; } } vector<SimNode *> ExprLet::simulateInit(Context & context, const ExprLet * pLet) { vector<SimNode *> simlist; simlist.reserve(pLet->variables.size()); for (auto & var : pLet->variables) { SimNode * init; if (var->init) { init = ExprLet::simulateInit(context, var, true); } else if (var->aliasCMRES ) { int bytes = var->type->getSizeOf(); if ( bytes <= 32 ) { init = context.code->makeNodeUnroll<SimNode_InitLocalCMResN>(bytes, pLet->at,0); } else { init = context.code->makeNode<SimNode_InitLocalCMRes>(pLet->at,0,bytes); } } else { init = context.code->makeNode<SimNode_InitLocal>(pLet->at, var->stackTop, var->type->getSizeOf()); } if (init) simlist.push_back(init); } return simlist; } SimNode * ExprLet::simulateInit(Context & context, const VariablePtr & var, bool local) { SimNode * get; if ( local ) { if ( var->init && var->init->rtti_isMakeLocal() ) { return var->init->simulate(context); } else { get = context.code->makeNode<SimNode_GetLocal>(var->init->at, var->stackTop); } } else { if ( var->init && var->init->rtti_isMakeLocal() ) { return var->init->simulate(context); } else { get = context.code->makeNode<SimNode_GetGlobal>(var->init->at, var->index); } } if ( var->type->ref ) { return context.code->makeNode<SimNode_CopyReference>(var->init->at, get, var->init->simulate(context)); } else if ( var->init_via_move && var->type->canMove() ) { auto varExpr = make_shared<ExprVar>(var->at, var->name); varExpr->variable = var; varExpr->local = local; varExpr->type = make_shared<TypeDecl>(*var->type); auto retN = makeMove(var->init->at, context, varExpr, var->init); if ( !retN ) { context.thisProgram->error("internal compilation error, can't generate move", var->at); } return retN; } else if ( !var->init_via_move && var->type->canCopy() ) { auto varExpr = make_shared<ExprVar>(var->at, var->name); varExpr->variable = var; varExpr->local = local; varExpr->type = make_shared<TypeDecl>(*var->type); auto retN = makeCopy(var->init->at, context, varExpr, var->init); if ( !retN ) { context.thisProgram->error("internal compilation error, can't generate copy", var->at); } return retN; } else { context.thisProgram->error("internal compilation error, initializing variable which can't be copied or moved", var->at); return nullptr; } } SimNode * ExprLet::simulate (Context & context) const { auto let = context.code->makeNode<SimNode_Let>(at); let->total = (uint32_t) variables.size(); let->list = (SimNode **) context.code->allocate(let->total * sizeof(SimNode*)); auto simList = ExprLet::simulateInit(context, this); copy(simList.data(), simList.data() + simList.size(), let->list); return let; } SimNode_CallBase * ExprCall::simulateCall (const FunctionPtr & func, const ExprLooksLikeCall * expr, Context & context, SimNode_CallBase * pCall) { bool needTypeInfo = false; for ( auto & arg : func->arguments ) { if ( arg->type->baseType==Type::anyArgument ) needTypeInfo = true; } pCall->debugInfo = expr->at; DAS_ASSERTF((func->builtIn || func->index>=0), "calling function which is not used. how?"); pCall->fnPtr = context.getFunction(func->index); pCall->fnIndex = func->index; if ( int nArg = (int) expr->arguments.size() ) { pCall->arguments = (SimNode **) context.code->allocate(nArg * sizeof(SimNode *)); if ( needTypeInfo ) { pCall->types = (TypeInfo **) context.code->allocate(nArg * sizeof(TypeInfo *)); } else { pCall->types = nullptr; } pCall->nArguments = nArg; for ( int a=0; a!=nArg; ++a ) { pCall->arguments[a] = expr->arguments[a]->simulate(context); if ( pCall->types ) { if ( func->arguments[a]->type->baseType==Type::anyArgument ) { pCall->types[a] = context.thisHelper->makeTypeInfo(nullptr, expr->arguments[a]->type); } else { pCall->types[a] = nullptr; } } } } else { pCall->arguments = nullptr; pCall->nArguments = 0; } return pCall; } SimNode * ExprCall::simulate (Context & context) const { auto pCall = static_cast<SimNode_CallBase *>(func->makeSimNode(context)); simulateCall(func->shared_from_this(), this, context, pCall); if ( !doesNotNeedSp && stackTop ) { pCall->cmresEval = context.code->makeNode<SimNode_GetLocal>(at,stackTop); } return pCall; } SimNode * ExprNamedCall::simulate (Context &) const { DAS_ASSERTF(false, "we should not be here. named call should be promoted to regular call"); return nullptr; } void Program::buildMNLookup ( Context & context, TextWriter & logs ) { map<uint32_t, uint32_t> htab; for ( int i=0; i!=context.totalFunctions; ++i ) { auto mnh = context.functions[i].mangledNameHash; if ( htab[mnh] ) { error("internal compiler error. mangled name hash collision " + string(context.functions[i].mangledName), LineInfo()); return; } htab[mnh] = i + 1; } auto tab = buildLookup(htab, context.tabMnMask, context.tabMnRot); context.tabMnSize = uint32_t(tab.size()); if ( options.getBoolOption("logMNHash",false) ) { logs << "totalFunctions: " << context.totalFunctions << "\n" << "tabMnLookup:" << context.tabMnSize << "\n" << "tabMnMask:" << context.tabMnMask << "\n" << "tabMnRot:" << context.tabMnRot << "\n"; } context.tabMnLookup = (uint32_t *) context.code->allocate(context.tabMnSize * sizeof(uint32_t)); memcpy ( context.tabMnLookup, tab.data(), context.tabMnSize * sizeof(uint32_t)); } void Program::buildADLookup ( Context & context, TextWriter & logs ) { map<uint32_t,uint64_t> tabAd; for (auto & pm : library.modules ) { for(auto s2d : pm->annotationData ) { tabAd[s2d.first] = s2d.second; } } if ( tabAd.size() ) { auto tab = buildLookup(tabAd, context.tabAdMask, context.tabAdRot); context.tabAdSize = uint32_t(tab.size()); context.tabAdLookup = (uint64_t *) context.code->allocate(context.tabAdSize * sizeof(uint64_t)); memcpy ( context.tabAdLookup, tab.data(), context.tabAdSize * sizeof(uint64_t)); if ( options.getBoolOption("logAdHash",false) ) { logs << "tabAdLookup:" << context.tabAdSize << "\n" << "tabAdMask:" << context.tabAdMask << "\n" << "tabAdRot:" << context.tabAdRot << "\n"; } } } bool Program::simulate ( Context & context, TextWriter & logs ) { context.thisProgram = this; context.constStringHeap = make_shared<StringAllocator>(); if ( globalStringHeapSize ) { context.constStringHeap->setInitialSize(globalStringHeapSize); } if ( auto optHeap = options.getIntOption("heap",policies.heap) ) { context.heap.setInitialSize( uint32_t(optHeap) ); } if ( auto optStringHeap = options.getIntOption("string_heap",policies.string_heap) ) { context.stringHeap.setInitialSize( uint32_t(optStringHeap) ); } DebugInfoHelper helper(context.debugInfo); helper.rtti = options.getBoolOption("rtti",policies.rtti); context.thisHelper = &helper; context.globalVariables = (GlobalVariable *) context.code->allocate( totalVariables*sizeof(GlobalVariable) ); context.globalsSize = 0; for (auto & pm : library.modules ) { for (auto & pvar : pm->globalsInOrder) { if (!pvar->used) continue; DAS_ASSERTF(pvar->index >= 0, "we are simulating variable, which is not used"); auto & gvar = context.globalVariables[pvar->index]; gvar.name = context.code->allocateName(pvar->name); gvar.size = pvar->type->getSizeOf(); gvar.debugInfo = helper.makeVariableDebugInfo(*pvar); gvar.offset = pvar->stackTop = context.globalsSize; context.globalsSize = (context.globalsSize + gvar.size + 0xf) & ~0xf; } } context.globals = (char *) das_aligned_alloc16(context.globalsSize); context.totalVariables = totalVariables; context.functions = (SimFunction *) context.code->allocate( totalFunctions*sizeof(SimFunction) ); context.totalFunctions = totalFunctions; for (auto & pm : library.modules) { for (auto & it : pm->functions) { auto pfun = it.second; if (pfun->index < 0 || !pfun->used) continue; auto & gfun = context.functions[pfun->index]; auto mangledName = pfun->getMangledName(); gfun.name = context.code->allocateName(pfun->name); gfun.mangledName = context.code->allocateName(mangledName); gfun.code = pfun->simulate(context); gfun.debugInfo = helper.makeFunctionDebugInfo(*pfun); gfun.stackSize = pfun->totalStackSize; gfun.mangledNameHash = hash_blockz32((uint8_t *)mangledName.c_str()); gfun.flags = 0; gfun.fastcall = pfun->fastCall; } } for (auto & pm : library.modules ) { for (auto & pvar : pm->globalsInOrder) { if (!pvar->used) continue; auto & gvar = context.globalVariables[pvar->index]; if ( pvar->init ) { if ( pvar->init->rtti_isMakeLocal() ) { auto sl = context.code->makeNode<SimNode_GetGlobal>(pvar->init->at, pvar->stackTop); auto sr = ExprLet::simulateInit(context, pvar, false); gvar.init = context.code->makeNode<SimNode_SetLocalRefAndEval>(pvar->init->at, sl, sr, uint32_t(sizeof(Prologue))); } else { gvar.init = ExprLet::simulateInit(context, pvar, false); } } else { gvar.init = nullptr; } } } // context.globalInitStackSize = globalInitStackSize; buildMNLookup(context, logs); buildADLookup(context, logs); context.simEnd(); fusion(context, logs); context.relocateCode(); context.restart(); // verify code and string heaps DAS_ASSERTF(context.code->pagesAllocated()<=1, "code must come in one page"); DAS_ASSERTF(context.constStringHeap->pagesAllocated()<=1, "strings must come in one page"); // log all functions if ( options.getBoolOption("log_nodes",false) ) { for ( int i=0; i!=context.totalVariables; ++i ) { auto & pv = context.globalVariables[i]; if ( pv.init ) { logs << "// init " << pv.name << "\n"; printSimNode(logs, pv.init); logs << "\n\n"; } } for ( int i=0; i!=context.totalFunctions; ++i ) { SimFunction * fn = context.getFunction(i); logs << "// " << fn->name << "\n"; printSimNode(logs, fn->code); logs << "\n\n"; } } // run init script and restart if ( context.stack.size() ) { context.runInitScript(); } else { StackAllocator stack(16*1024); context.stack.acquire(stack); context.runInitScript(); context.stack.release(); } context.restart(); if (options.getBoolOption("log_mem",false)) { logs << "globals " << context.getGlobalSize() << "\n"; logs << "stack " << context.stack.size() << "\n"; logs << "code " << context.code->bytesAllocated() << " in "<< context.code->pagesAllocated() << " pages (" << context.code->totalAlignedMemoryAllocated() << ")\n"; logs << "const strings " << context.constStringHeap->bytesAllocated() << " in "<< context.constStringHeap->pagesAllocated() << " pages (" << context.constStringHeap->totalAlignedMemoryAllocated() << ")\n"; logs << "debug " << context.debugInfo->bytesAllocated() << " (" << context.debugInfo->totalAlignedMemoryAllocated() << ")\n"; logs << "heap " << context.heap.bytesAllocated() << " in "<< context.heap.pagesAllocated() << " pages (" << context.heap.totalAlignedMemoryAllocated() << ")\n"; logs << "string " << context.stringHeap.bytesAllocated() << " in "<< context.stringHeap.pagesAllocated() << " pages(" << context.stringHeap.totalAlignedMemoryAllocated() << ")\n"; logs << "shared " << context.getSharedMemorySize() << "\n"; logs << "unique " << context.getUniqueMemorySize() << "\n"; } // log CPP if (options.getBoolOption("log_cpp")) { aotCpp(context,logs); registerAotCpp(logs,context); } return errors.size() == 0; } void Program::linkCppAot ( Context & context, AotLibrary & aotLib, TextWriter & logs ) { bool logIt = options.getBoolOption("log_aot",false); // make list of functions vector<Function *> fnn; fnn.reserve(totalFunctions); for (auto & pm : library.modules) { for (auto & it : pm->functions) { auto pfun = it.second; if (pfun->index < 0 || !pfun->used) continue; fnn.push_back(pfun.get()); } } for ( int fni=0; fni!=context.totalFunctions; ++fni ) { if ( !fnn[fni]->noAot ) { SimFunction & fn = context.functions[fni]; uint64_t semHash = getFunctionHash(fnn[fni], fn.code); auto it = aotLib.find(semHash); if ( it != aotLib.end() ) { fn.code = (it->second)(context); fn.aot = true; if ( logIt ) logs << fn.name << " AOT=0x" << HEX << semHash << DEC << "\n"; } else { if ( logIt ) logs << "NOT FOUND " << fn.name << " AOT=0x" << HEX << semHash << DEC << "\n"; } } } if ( context.totalVariables ) { uint64_t semHash = context.getInitSemanticHash(); auto it = aotLib.find(semHash); if ( it != aotLib.end() ) { context.aotInitScript = (it->second)(context); if ( logIt ) logs << "INIT SCRIPT AOT=0x" << HEX << semHash << DEC << "\n"; } else { if ( logIt ) logs << "INIT SCRIPT NOT FOUND, AOT=0x" << HEX << semHash << DEC << "\n"; } } } }
/*-------------------------------------------------------- * xsubgraph.cc * Random extraction of a (possibly) connected subgraph * See: argraph.h, xsubgraph.h * * Author: P. Foggia --------------------------------------------------------*/ #include <assert.h> #include <stdlib.h> #include <math.h> #include "argraph.h" #include "argedit.h" #include "xsubgraph.h" #include "error.h" inline int irand(int from, int to) { return (int)floor(rand()/(double)(RAND_MAX+1.0)*(to-from))+from; } struct visit_param { ARGEdit *ed; node_id *map; }; typedef Graph::param_type param_type; static void edge_insert_visitor(Graph *g, node_id n1, node_id n2, void *attr, param_type param); /*---------------------------------------------------------------- * Extract a random subgraph from a graph 'g' with a given * number of nodes ('nodes'). If 'connected' is true, the * subgraph will be connected. Attributes of the subgraph are * shared with the original graph. * The subgraph will not inherit the node/edge destroy functions * nor the node/edge compatibility predicates. * * IMPORTANT * You have to init the random seed by calling srand() before * invoking this function. ----------------------------------------------------------------*/ Graph* ExtractSubgraph(Graph *g, int nodes, bool connected) { assert(g!=NULL); assert(nodes>=0); assert(nodes<=g->NodeCount()); int i,j; int n=g->NodeCount(); node_id *map=(node_id*)calloc(n, sizeof(node_id)); if (n>0 && map==NULL) OUT_OF_MEMORY(); for(i=0; i<n; i++) map[i]=NULL_NODE; ARGEdit ed; visit_param param; for(i=0; i<nodes; i++) { // Choose a node which has not yet been used node_id id=irand(0, n-1); node_id id0=id; bool found=false; do { while (map[id]!=NULL_NODE) { if (++id == n) id=0; if (id==id0) { if (i==0 || !connected) CANT_HAPPEN(); else FAIL("Cannot extract a connected subgraph"); } } // check for the connectedness of the new node if (i>0 && connected) { for(j=0; j<g->OutEdgeCount(id) && !found; j++) { if (map[g->GetOutEdge(id, j)]!=NULL_NODE) found=true; } for(j=0; j<g->InEdgeCount(id) && !found; j++) { if (map[g->GetInEdge(id, j)]!=NULL_NODE) found=true; } if (!found) { if (++id == n) id=0; if (id==id0) FAIL("Cannot extract a connected subgraph"); } } else { found=true; } } while (!found); // now add the node to the ARGEdit map[id]=i; ed.InsertNode(g->GetNodeAttr(id)); } // Now add the edges to the new graph param.ed=&ed; param.map=map; for(i=0; i<n; i++) { if (map[i]!=NULL_NODE) g->VisitOutEdges(i, edge_insert_visitor, &param); } // Construct the graph and return it Graph *sub=new Graph(&ed); return sub; } /*--------------------------------------------------------- * STATIC FUNCTIONS --------------------------------------------------------*/ static void edge_insert_visitor(Graph *g, node_id n1, node_id n2, void *attr, param_type param) { visit_param *p=(visit_param *)param; ARGEdit *ed=p->ed; node_id *map=p->map; if (map[n1]!=NULL_NODE && map[n2]!=NULL_NODE) ed->InsertEdge(map[n1], map[n2], attr); }
// Copyright 2014 The Chromium 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 "sandbox/linux/bpf_dsl/bpf_dsl.h" #include <errno.h> #include <limits> #include "base/logging.h" #include "base/memory/ref_counted.h" #include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h" #include "sandbox/linux/bpf_dsl/policy_compiler.h" #include "sandbox/linux/seccomp-bpf/errorcode.h" namespace sandbox { namespace bpf_dsl { namespace { class AllowResultExprImpl : public internal::ResultExprImpl { public: AllowResultExprImpl() {} virtual ErrorCode Compile(PolicyCompiler* pc) const override { return ErrorCode(ErrorCode::ERR_ALLOWED); } private: virtual ~AllowResultExprImpl() {} DISALLOW_COPY_AND_ASSIGN(AllowResultExprImpl); }; class ErrorResultExprImpl : public internal::ResultExprImpl { public: explicit ErrorResultExprImpl(int err) : err_(err) { CHECK(err_ >= ErrorCode::ERR_MIN_ERRNO && err_ <= ErrorCode::ERR_MAX_ERRNO); } virtual ErrorCode Compile(PolicyCompiler* pc) const override { return pc->Error(err_); } private: virtual ~ErrorResultExprImpl() {} int err_; DISALLOW_COPY_AND_ASSIGN(ErrorResultExprImpl); }; class KillResultExprImpl : public internal::ResultExprImpl { public: explicit KillResultExprImpl(const char* msg) : msg_(msg) { DCHECK(msg_); } virtual ErrorCode Compile(PolicyCompiler* pc) const override { return pc->Kill(msg_); } private: virtual ~KillResultExprImpl() {} const char* msg_; DISALLOW_COPY_AND_ASSIGN(KillResultExprImpl); }; class TraceResultExprImpl : public internal::ResultExprImpl { public: TraceResultExprImpl(uint16_t aux) : aux_(aux) {} virtual ErrorCode Compile(PolicyCompiler* pc) const override { return ErrorCode(ErrorCode::ERR_TRACE + aux_); } private: virtual ~TraceResultExprImpl() {} uint16_t aux_; DISALLOW_COPY_AND_ASSIGN(TraceResultExprImpl); }; class TrapResultExprImpl : public internal::ResultExprImpl { public: TrapResultExprImpl(TrapRegistry::TrapFnc func, const void* arg) : func_(func), arg_(arg) { DCHECK(func_); } virtual ErrorCode Compile(PolicyCompiler* pc) const override { return pc->Trap(func_, arg_); } private: virtual ~TrapResultExprImpl() {} TrapRegistry::TrapFnc func_; const void* arg_; DISALLOW_COPY_AND_ASSIGN(TrapResultExprImpl); }; class UnsafeTrapResultExprImpl : public internal::ResultExprImpl { public: UnsafeTrapResultExprImpl(TrapRegistry::TrapFnc func, const void* arg) : func_(func), arg_(arg) { DCHECK(func_); } virtual ErrorCode Compile(PolicyCompiler* pc) const override { return pc->UnsafeTrap(func_, arg_); } virtual bool HasUnsafeTraps() const override { return true; } private: virtual ~UnsafeTrapResultExprImpl() {} TrapRegistry::TrapFnc func_; const void* arg_; DISALLOW_COPY_AND_ASSIGN(UnsafeTrapResultExprImpl); }; class IfThenResultExprImpl : public internal::ResultExprImpl { public: IfThenResultExprImpl(const BoolExpr& cond, const ResultExpr& then_result, const ResultExpr& else_result) : cond_(cond), then_result_(then_result), else_result_(else_result) {} virtual ErrorCode Compile(PolicyCompiler* pc) const override { return cond_->Compile( pc, then_result_->Compile(pc), else_result_->Compile(pc)); } virtual bool HasUnsafeTraps() const override { return then_result_->HasUnsafeTraps() || else_result_->HasUnsafeTraps(); } private: virtual ~IfThenResultExprImpl() {} BoolExpr cond_; ResultExpr then_result_; ResultExpr else_result_; DISALLOW_COPY_AND_ASSIGN(IfThenResultExprImpl); }; class ConstBoolExprImpl : public internal::BoolExprImpl { public: ConstBoolExprImpl(bool value) : value_(value) {} virtual ErrorCode Compile(PolicyCompiler* pc, ErrorCode true_ec, ErrorCode false_ec) const override { return value_ ? true_ec : false_ec; } private: virtual ~ConstBoolExprImpl() {} bool value_; DISALLOW_COPY_AND_ASSIGN(ConstBoolExprImpl); }; class PrimitiveBoolExprImpl : public internal::BoolExprImpl { public: PrimitiveBoolExprImpl(int argno, ErrorCode::ArgType is_32bit, uint64_t mask, uint64_t value) : argno_(argno), is_32bit_(is_32bit), mask_(mask), value_(value) {} virtual ErrorCode Compile(PolicyCompiler* pc, ErrorCode true_ec, ErrorCode false_ec) const override { return pc->CondMaskedEqual( argno_, is_32bit_, mask_, value_, true_ec, false_ec); } private: virtual ~PrimitiveBoolExprImpl() {} int argno_; ErrorCode::ArgType is_32bit_; uint64_t mask_; uint64_t value_; DISALLOW_COPY_AND_ASSIGN(PrimitiveBoolExprImpl); }; class NegateBoolExprImpl : public internal::BoolExprImpl { public: explicit NegateBoolExprImpl(const BoolExpr& cond) : cond_(cond) {} virtual ErrorCode Compile(PolicyCompiler* pc, ErrorCode true_ec, ErrorCode false_ec) const override { return cond_->Compile(pc, false_ec, true_ec); } private: virtual ~NegateBoolExprImpl() {} BoolExpr cond_; DISALLOW_COPY_AND_ASSIGN(NegateBoolExprImpl); }; class AndBoolExprImpl : public internal::BoolExprImpl { public: AndBoolExprImpl(const BoolExpr& lhs, const BoolExpr& rhs) : lhs_(lhs), rhs_(rhs) {} virtual ErrorCode Compile(PolicyCompiler* pc, ErrorCode true_ec, ErrorCode false_ec) const override { return lhs_->Compile(pc, rhs_->Compile(pc, true_ec, false_ec), false_ec); } private: virtual ~AndBoolExprImpl() {} BoolExpr lhs_; BoolExpr rhs_; DISALLOW_COPY_AND_ASSIGN(AndBoolExprImpl); }; class OrBoolExprImpl : public internal::BoolExprImpl { public: OrBoolExprImpl(const BoolExpr& lhs, const BoolExpr& rhs) : lhs_(lhs), rhs_(rhs) {} virtual ErrorCode Compile(PolicyCompiler* pc, ErrorCode true_ec, ErrorCode false_ec) const override { return lhs_->Compile(pc, true_ec, rhs_->Compile(pc, true_ec, false_ec)); } private: virtual ~OrBoolExprImpl() {} BoolExpr lhs_; BoolExpr rhs_; DISALLOW_COPY_AND_ASSIGN(OrBoolExprImpl); }; } // namespace namespace internal { bool ResultExprImpl::HasUnsafeTraps() const { return false; } uint64_t DefaultMask(size_t size) { switch (size) { case 4: return std::numeric_limits<uint32_t>::max(); case 8: return std::numeric_limits<uint64_t>::max(); default: CHECK(false) << "Unimplemented DefaultMask case"; return 0; } } BoolExpr ArgEq(int num, size_t size, uint64_t mask, uint64_t val) { CHECK(size == 4 || size == 8); // TODO(mdempsky): Should we just always use TP_64BIT? const ErrorCode::ArgType arg_type = (size == 4) ? ErrorCode::TP_32BIT : ErrorCode::TP_64BIT; return BoolExpr(new const PrimitiveBoolExprImpl(num, arg_type, mask, val)); } } // namespace internal ResultExpr Allow() { return ResultExpr(new const AllowResultExprImpl()); } ResultExpr Error(int err) { return ResultExpr(new const ErrorResultExprImpl(err)); } ResultExpr Kill(const char* msg) { return ResultExpr(new const KillResultExprImpl(msg)); } ResultExpr Trace(uint16_t aux) { return ResultExpr(new const TraceResultExprImpl(aux)); } ResultExpr Trap(TrapRegistry::TrapFnc trap_func, const void* aux) { return ResultExpr(new const TrapResultExprImpl(trap_func, aux)); } ResultExpr UnsafeTrap(TrapRegistry::TrapFnc trap_func, const void* aux) { return ResultExpr(new const UnsafeTrapResultExprImpl(trap_func, aux)); } BoolExpr BoolConst(bool value) { return BoolExpr(new const ConstBoolExprImpl(value)); } BoolExpr operator!(const BoolExpr& cond) { return BoolExpr(new const NegateBoolExprImpl(cond)); } BoolExpr operator&&(const BoolExpr& lhs, const BoolExpr& rhs) { return BoolExpr(new const AndBoolExprImpl(lhs, rhs)); } BoolExpr operator||(const BoolExpr& lhs, const BoolExpr& rhs) { return BoolExpr(new const OrBoolExprImpl(lhs, rhs)); } Elser If(const BoolExpr& cond, const ResultExpr& then_result) { return Elser(nullptr).ElseIf(cond, then_result); } Elser::Elser(cons::List<Clause> clause_list) : clause_list_(clause_list) { } Elser::Elser(const Elser& elser) : clause_list_(elser.clause_list_) { } Elser::~Elser() { } Elser Elser::ElseIf(const BoolExpr& cond, const ResultExpr& then_result) const { return Elser(Cons(std::make_pair(cond, then_result), clause_list_)); } ResultExpr Elser::Else(const ResultExpr& else_result) const { // We finally have the default result expression for this // if/then/else sequence. Also, we've already accumulated all // if/then pairs into a list of reverse order (i.e., lower priority // conditions are listed before higher priority ones). E.g., an // expression like // // If(b1, e1).ElseIf(b2, e2).ElseIf(b3, e3).Else(e4) // // will have built up a list like // // [(b3, e3), (b2, e2), (b1, e1)]. // // Now that we have e4, we can walk the list and create a ResultExpr // tree like: // // expr = e4 // expr = (b3 ? e3 : expr) = (b3 ? e3 : e4) // expr = (b2 ? e2 : expr) = (b2 ? e2 : (b3 ? e3 : e4)) // expr = (b1 ? e1 : expr) = (b1 ? e1 : (b2 ? e2 : (b3 ? e3 : e4))) // // and end up with an appropriately chained tree. ResultExpr expr = else_result; for (const Clause& clause : clause_list_) { expr = ResultExpr( new const IfThenResultExprImpl(clause.first, clause.second, expr)); } return expr; } ResultExpr SandboxBPFDSLPolicy::InvalidSyscall() const { return Error(ENOSYS); } ResultExpr SandboxBPFDSLPolicy::Trap(TrapRegistry::TrapFnc trap_func, const void* aux) { return bpf_dsl::Trap(trap_func, aux); } } // namespace bpf_dsl } // namespace sandbox template class scoped_refptr<const sandbox::bpf_dsl::internal::BoolExprImpl>; template class scoped_refptr<const sandbox::bpf_dsl::internal::ResultExprImpl>;
;================================================= ; Name: Adrian Harminto ; Email: aharm002@ucr.edu ; ; Lab: lab 4 ; Lab section: 24 ; TA: Bryan Marsh ; ;================================================= .orig x3000 ;------------ ;Instruction ;------------ LEA R0, intro ;exercise 2 PUTS LD R6, size LD R3, ptr Loop ; scanning 10 characters GETC OUT STR R0, R3, #0 ADD R3, R3, #1 ADD R6, R6, #-1 BRp Loop LD R6, size ;resetting R3 and R6 LD R3, ptr ;Continuation on exercise 3 HALT ;------------ ;Local data ;------------ intro .STRINGZ "Enter exactly 10 characters:\n" size .FILL #10 ptr .FILL x4000 .orig x4000 new_ptr .BLKW #10 .end
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/assign/list_of.hpp> #include "base58.h" #include "bitcoinrpc.h" #include "db.h" #include "init.h" #include "main.h" #include "net.h" #include "wallet.h" using namespace std; using namespace boost; using namespace boost::assign; using namespace json_spirit; // // Utilities: convert hex-encoded Values // (throws error if not hex). // uint256 ParseHashV(const Value& v, string strName) { string strHex; if (v.type() == str_type) strHex = v.get_str(); if (!IsHex(strHex)) // Note: IsHex("") is false throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')"); uint256 result; result.SetHex(strHex); return result; } uint256 ParseHashO(const Object& o, string strKey) { return ParseHashV(find_value(o, strKey), strKey); } vector<unsigned char> ParseHexV(const Value& v, string strName) { string strHex; if (v.type() == str_type) strHex = v.get_str(); if (!IsHex(strHex)) throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')"); return ParseHex(strHex); } vector<unsigned char> ParseHexO(const Object& o, string strKey) { return ParseHexV(find_value(o, strKey), strKey); } void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out) { txnouttype type; vector<CTxDestination> addresses; int nRequired; out.push_back(Pair("asm", scriptPubKey.ToString())); out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { out.push_back(Pair("type", GetTxnOutputType(TX_NONSTANDARD))); return; } out.push_back(Pair("reqSigs", nRequired)); out.push_back(Pair("type", GetTxnOutputType(type))); Array a; BOOST_FOREACH(const CTxDestination& addr, addresses) a.push_back(CBitcoinAddress(addr).ToString()); out.push_back(Pair("addresses", a)); } void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) { entry.push_back(Pair("txid", tx.GetHash().GetHex())); entry.push_back(Pair("version", tx.nVersion)); entry.push_back(Pair("locktime", (boost::int64_t)tx.nLockTime)); Array vin; BOOST_FOREACH(const CTxIn& txin, tx.vin) { Object in; if (tx.IsCoinBase()) in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); in.push_back(Pair("vout", (boost::int64_t)txin.prevout.n)); Object o; o.push_back(Pair("asm", txin.scriptSig.ToString())); o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); in.push_back(Pair("scriptSig", o)); } in.push_back(Pair("sequence", (boost::int64_t)txin.nSequence)); vin.push_back(in); } entry.push_back(Pair("vin", vin)); Array vout; for (unsigned int i = 0; i < tx.vout.size(); i++) { const CTxOut& txout = tx.vout[i]; Object out; out.push_back(Pair("value", ValueFromAmount(txout.nValue))); out.push_back(Pair("n", (boost::int64_t)i)); Object o; ScriptPubKeyToJSON(txout.scriptPubKey, o); out.push_back(Pair("scriptPubKey", o)); vout.push_back(out); } entry.push_back(Pair("vout", vout)); if (hashBlock != 0) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock); if (mi != mapBlockIndex.end() && (*mi).second) { CBlockIndex* pindex = (*mi).second; if (pindex->IsInMainChain()) { entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight)); entry.push_back(Pair("time", (boost::int64_t)pindex->nTime)); entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime)); } else entry.push_back(Pair("confirmations", 0)); } } } Value getrawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getrawtransaction <txid> [verbose=0]\n" "If verbose=0, returns a string that is\n" "serialized, hex-encoded data for <txid>.\n" "If verbose is non-zero, returns an Object\n" "with information about <txid>."); uint256 hash = ParseHashV(params[0], "parameter 1"); bool fVerbose = false; if (params.size() > 1) fVerbose = (params[1].get_int() != 0); CTransaction tx; uint256 hashBlock = 0; if (!GetTransaction(hash, tx, hashBlock, true)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction"); CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << tx; string strHex = HexStr(ssTx.begin(), ssTx.end()); if (!fVerbose) return strHex; Object result; result.push_back(Pair("hex", strHex)); TxToJSON(tx, hashBlock, result); return result; } Value listunspent(const Array& params, bool fHelp) { if (fHelp || params.size() > 3) throw runtime_error( "listunspent [minconf=1] [maxconf=9999999] [\"address\",...]\n" "Returns array of unspent transaction outputs\n" "with between minconf and maxconf (inclusive) confirmations.\n" "Optionally filtered to only include txouts paid to specified addresses.\n" "Results are an array of Objects, each of which has:\n" "{txid, vout, scriptPubKey, amount, confirmations}"); RPCTypeCheck(params, list_of(int_type)(int_type)(array_type)); int nMinDepth = 1; if (params.size() > 0) nMinDepth = params[0].get_int(); int nMaxDepth = 9999999; if (params.size() > 1) nMaxDepth = params[1].get_int(); set<CBitcoinAddress> setAddress; if (params.size() > 2) { Array inputs = params[2].get_array(); BOOST_FOREACH(Value& input, inputs) { CBitcoinAddress address(input.get_str()); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Flappycoin address: ")+input.get_str()); if (setAddress.count(address)) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str()); setAddress.insert(address); } } Array results; vector<COutput> vecOutputs; assert(pwalletMain != NULL); pwalletMain->AvailableCoins(vecOutputs, false); BOOST_FOREACH(const COutput& out, vecOutputs) { if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth) continue; if (setAddress.size()) { CTxDestination address; if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) continue; if (!setAddress.count(address)) continue; } int64 nValue = out.tx->vout[out.i].nValue; const CScript& pk = out.tx->vout[out.i].scriptPubKey; Object entry; entry.push_back(Pair("txid", out.tx->GetHash().GetHex())); entry.push_back(Pair("vout", out.i)); CTxDestination address; if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) { entry.push_back(Pair("address", CBitcoinAddress(address).ToString())); if (pwalletMain->mapAddressBook.count(address)) entry.push_back(Pair("account", pwalletMain->mapAddressBook[address])); } entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end()))); if (pk.IsPayToScriptHash()) { CTxDestination address; if (ExtractDestination(pk, address)) { const CScriptID& hash = boost::get<const CScriptID>(address); CScript redeemScript; if (pwalletMain->GetCScript(hash, redeemScript)) entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end()))); } } entry.push_back(Pair("amount",ValueFromAmount(nValue))); entry.push_back(Pair("confirmations",out.nDepth)); results.push_back(entry); } return results; } Value createrawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() != 2) throw runtime_error( "createrawtransaction [{\"txid\":txid,\"vout\":n},...] {address:amount,...}\n" "Create a transaction spending given inputs\n" "(array of objects containing transaction id and output number),\n" "sending to given address(es).\n" "Returns hex-encoded raw transaction.\n" "Note that the transaction's inputs are not signed, and\n" "it is not stored in the wallet or transmitted to the network."); RPCTypeCheck(params, list_of(array_type)(obj_type)); Array inputs = params[0].get_array(); Object sendTo = params[1].get_obj(); CTransaction rawTx; BOOST_FOREACH(const Value& input, inputs) { const Object& o = input.get_obj(); uint256 txid = ParseHashO(o, "txid"); const Value& vout_v = find_value(o, "vout"); if (vout_v.type() != int_type) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key"); int nOutput = vout_v.get_int(); if (nOutput < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive"); CTxIn in(COutPoint(txid, nOutput)); rawTx.vin.push_back(in); } set<CBitcoinAddress> setAddress; BOOST_FOREACH(const Pair& s, sendTo) { CBitcoinAddress address(s.name_); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Flappycoin address: ")+s.name_); if (setAddress.count(address)) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_); setAddress.insert(address); CScript scriptPubKey; scriptPubKey.SetDestination(address.Get()); int64 nAmount = AmountFromValue(s.value_); CTxOut out(nAmount, scriptPubKey); rawTx.vout.push_back(out); } CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss << rawTx; return HexStr(ss.begin(), ss.end()); } Value decoderawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "decoderawtransaction <hex string>\n" "Return a JSON object representing the serialized, hex-encoded transaction."); vector<unsigned char> txData(ParseHexV(params[0], "argument")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); CTransaction tx; try { ssData >> tx; } catch (std::exception &e) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } Object result; TxToJSON(tx, 0, result); return result; } Value signrawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 4) throw runtime_error( "signrawtransaction <hex string> [{\"txid\":txid,\"vout\":n,\"scriptPubKey\":hex,\"redeemScript\":hex},...] [<privatekey1>,...] [sighashtype=\"ALL\"]\n" "Sign inputs for raw transaction (serialized, hex-encoded).\n" "Second optional argument (may be null) is an array of previous transaction outputs that\n" "this transaction depends on but may not yet be in the block chain.\n" "Third optional argument (may be null) is an array of base58-encoded private\n" "keys that, if given, will be the only keys used to sign the transaction.\n" "Fourth optional argument is a string that is one of six values; ALL, NONE, SINGLE or\n" "ALL|ANYONECANPAY, NONE|ANYONECANPAY, SINGLE|ANYONECANPAY.\n" "Returns json object with keys:\n" " hex : raw transaction with signature(s) (hex-encoded string)\n" " complete : 1 if transaction has a complete set of signature (0 if not)" + HelpRequiringPassphrase()); RPCTypeCheck(params, list_of(str_type)(array_type)(array_type)(str_type), true); vector<unsigned char> txData(ParseHexV(params[0], "argument 1")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); vector<CTransaction> txVariants; while (!ssData.empty()) { try { CTransaction tx; ssData >> tx; txVariants.push_back(tx); } catch (std::exception &e) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } } if (txVariants.empty()) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transaction"); // mergedTx will end up with all the signatures; it // starts as a clone of the rawtx: CTransaction mergedTx(txVariants[0]); bool fComplete = true; // Fetch previous transactions (inputs): CCoinsView viewDummy; CCoinsViewCache view(viewDummy); { LOCK(mempool.cs); CCoinsViewCache &viewChain = *pcoinsTip; CCoinsViewMemPool viewMempool(viewChain, mempool); view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) { const uint256& prevHash = txin.prevout.hash; CCoins coins; view.GetCoins(prevHash, coins); // this is certainly allowed to fail } view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long } bool fGivenKeys = false; CBasicKeyStore tempKeystore; if (params.size() > 2 && params[2].type() != null_type) { fGivenKeys = true; Array keys = params[2].get_array(); BOOST_FOREACH(Value k, keys) { CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(k.get_str()); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key = vchSecret.GetKey(); tempKeystore.AddKey(key); } } else EnsureWalletIsUnlocked(); // Add previous txouts given in the RPC call: if (params.size() > 1 && params[1].type() != null_type) { Array prevTxs = params[1].get_array(); BOOST_FOREACH(Value& p, prevTxs) { if (p.type() != obj_type) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}"); Object prevOut = p.get_obj(); RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)); uint256 txid = ParseHashO(prevOut, "txid"); int nOut = find_value(prevOut, "vout").get_int(); if (nOut < 0) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "vout must be positive"); vector<unsigned char> pkData(ParseHexO(prevOut, "scriptPubKey")); CScript scriptPubKey(pkData.begin(), pkData.end()); CCoins coins; if (view.GetCoins(txid, coins)) { if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) { string err("Previous output scriptPubKey mismatch:\n"); err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+ scriptPubKey.ToString(); throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err); } // what todo if txid is known, but the actual output isn't? } if ((unsigned int)nOut >= coins.vout.size()) coins.vout.resize(nOut+1); coins.vout[nOut].scriptPubKey = scriptPubKey; coins.vout[nOut].nValue = 0; // we don't know the actual output value view.SetCoins(txid, coins); // if redeemScript given and not using the local wallet (private keys // given), add redeemScript to the tempKeystore so it can be signed: if (fGivenKeys && scriptPubKey.IsPayToScriptHash()) { RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type)); Value v = find_value(prevOut, "redeemScript"); if (!(v == Value::null)) { vector<unsigned char> rsData(ParseHexV(v, "redeemScript")); CScript redeemScript(rsData.begin(), rsData.end()); tempKeystore.AddCScript(redeemScript); } } } } const CKeyStore& keystore = ((fGivenKeys || !pwalletMain) ? tempKeystore : *pwalletMain); int nHashType = SIGHASH_ALL; if (params.size() > 3 && params[3].type() != null_type) { static map<string, int> mapSigHashValues = boost::assign::map_list_of (string("ALL"), int(SIGHASH_ALL)) (string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY)) (string("NONE"), int(SIGHASH_NONE)) (string("NONE|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY)) (string("SINGLE"), int(SIGHASH_SINGLE)) (string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY)) ; string strHashType = params[3].get_str(); if (mapSigHashValues.count(strHashType)) nHashType = mapSigHashValues[strHashType]; else throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid sighash param"); } bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; CCoins coins; if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { fComplete = false; continue; } const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey; txin.scriptSig.clear(); // Only sign SIGHASH_SINGLE if there's a corresponding output: if (!fHashSingle || (i < mergedTx.vout.size())) SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); // ... and merge in other signatures: BOOST_FOREACH(const CTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0)) fComplete = false; } Object result; CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << mergedTx; result.push_back(Pair("hex", HexStr(ssTx.begin(), ssTx.end()))); result.push_back(Pair("complete", fComplete)); return result; } Value sendrawtransaction(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 1) throw runtime_error( "sendrawtransaction <hex string>\n" "Submits raw transaction (serialized, hex-encoded) to local node and network."); // parse hex string from parameter vector<unsigned char> txData(ParseHexV(params[0], "parameter")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); CTransaction tx; // deserialize binary data stream try { ssData >> tx; } catch (std::exception &e) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } uint256 hashTx = tx.GetHash(); bool fHave = false; CCoinsViewCache &view = *pcoinsTip; CCoins existingCoins; { fHave = view.GetCoins(hashTx, existingCoins); if (!fHave) { // push to local node CValidationState state; if (!tx.AcceptToMemoryPool(state, true, false)) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX rejected"); // TODO: report validation state } } if (fHave) { if (existingCoins.nHeight < 1000000000) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "transaction already in block chain"); // Not in block, but already in the memory pool; will drop // through to re-relay it. } else { SyncWithWallets(hashTx, tx, NULL, true); } RelayTransaction(tx, hashTx); return hashTx.GetHex(); }
/* * Unit tests for XmlRpc++ * * Copyright (C) 2017, Zoox Inc * * This library 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. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Austin Hendrix <austin@zoox.com> * */ #define xmlrpcpp_EXPORTS // we are mocking XmlRpcSocket, define the symbol in order to export XmlRpcSocket class # include "xmlrpcpp/XmlRpcSocket.h" #undef xmlrpcpp_EXPORTS #include "xmlrpcpp/XmlRpcUtil.h" #include "mock_socket.h" #include <deque> #include <string.h> #include <errno.h> #include <gtest/gtest.h> using namespace XmlRpc; bool XmlRpcSocket::s_use_ipv6_ = false; // Returns message corresponding to last errno. // NOTE(austin): this matches the default implementation. std::string XmlRpcSocket::getErrorMsg() { return getErrorMsg(getError()); } // Returns message corresponding to errno // NOTE(austin): this matches the default implementation. std::string XmlRpcSocket::getErrorMsg(int error) { char err[60]; std::snprintf(err, sizeof(err), "%s", strerror(error)); return std::string(err); } #define EXPECT_PROLOGUE(name) \ EXPECT_EQ(0, name##_calls) \ << "Test error; cannont expect " #name " more than once"; std::deque<int> close_calls; void XmlRpcSocket::close(int fd) { EXPECT_LE(1u, close_calls.size()); if (close_calls.size() > 0) { int close_fd = close_calls.front(); close_calls.pop_front(); EXPECT_EQ(close_fd, fd); } } void MockSocketTest::Expect_close(int fd) { close_calls.push_back(fd); } int socket_ret = 0; int socket_calls = 0; int XmlRpcSocket::socket() { EXPECT_EQ(1, socket_calls); socket_calls--; return socket_ret; } void MockSocketTest::Expect_socket(int ret) { EXPECT_PROLOGUE(socket); socket_calls = 1; socket_ret = ret; } bool setNonBlocking_ret = true; int setNonBlocking_fd = 0; int setNonBlocking_calls = 0; bool XmlRpcSocket::setNonBlocking(int fd) { EXPECT_EQ(1, setNonBlocking_calls); setNonBlocking_calls--; EXPECT_EQ(setNonBlocking_fd, fd); return setNonBlocking_ret; } void MockSocketTest::Expect_setNonBlocking(int fd, bool ret) { EXPECT_PROLOGUE(setNonBlocking); setNonBlocking_calls = 1; setNonBlocking_fd = fd; setNonBlocking_ret = ret; } bool setReuseAddr_ret = true; int setReuseAddr_fd = 0; int setReuseAddr_calls = 0; bool XmlRpcSocket::setReuseAddr(int fd) { EXPECT_EQ(1, setReuseAddr_calls); setReuseAddr_calls--; EXPECT_EQ(setReuseAddr_fd, fd); return setReuseAddr_ret; } void MockSocketTest::Expect_setReuseAddr(int fd, bool ret) { EXPECT_PROLOGUE(setReuseAddr); setReuseAddr_calls = 1; setReuseAddr_fd = fd; setReuseAddr_ret = ret; } bool bind_ret = true; int bind_fd = 0; int bind_port = 0; int bind_calls = 0; bool XmlRpcSocket::bind(int fd, int port) { bind_calls--; EXPECT_EQ(bind_fd, fd); EXPECT_EQ(bind_port, port); return bind_ret; } void MockSocketTest::Expect_bind(int fd, int port, bool ret) { EXPECT_PROLOGUE(bind); bind_calls = 1; bind_fd = fd; bind_port = port; bind_ret = ret; } bool listen_ret = true; int listen_fd = 0; int listen_backlog = 0; int listen_calls = 0; bool XmlRpcSocket::listen(int fd, int backlog) { listen_calls--; EXPECT_EQ(listen_fd, fd); EXPECT_EQ(listen_backlog, backlog); return listen_ret; } void MockSocketTest::Expect_listen(int fd, int backlog, bool ret) { EXPECT_PROLOGUE(listen); listen_calls = 1; listen_fd = fd; listen_backlog = backlog; listen_ret = ret; } int accept_ret = 0; int accept_fd = 0; int accept_calls = 0; int XmlRpcSocket::accept(int fd) { accept_calls--; EXPECT_EQ(accept_fd, fd); return accept_ret; } void MockSocketTest::Expect_accept(int fd, int ret) { EXPECT_PROLOGUE(accept); accept_calls = 1; accept_fd = fd; accept_ret = ret; } bool connect_ret = true; int connect_fd = 0; std::string connect_host = ""; int connect_port = 0; int connect_calls = 0; bool XmlRpcSocket::connect(int fd, const std::string& host, int port) { connect_calls--; EXPECT_EQ(connect_fd, fd); EXPECT_EQ(connect_host, host); EXPECT_EQ(connect_port, port); return connect_ret; } void MockSocketTest::Expect_connect(int fd, const std::string& host, int port, bool ret) { EXPECT_PROLOGUE(connect); connect_calls = 1; connect_fd = fd; connect_host = host; connect_port = port; connect_ret = ret; } bool nbRead_ret = true; int nbRead_fd = 0; std::string nbRead_s = ""; bool nbRead_eof = false; int nbRead_calls = 0; bool XmlRpcSocket::nbRead(int fd, std::string& s, bool* eof) { nbRead_calls--; EXPECT_EQ(nbRead_fd, fd); s = nbRead_s; *eof = nbRead_eof; return nbRead_ret; } void MockSocketTest::Expect_nbRead(int fd, const std::string& s, bool eof, bool ret) { EXPECT_PROLOGUE(nbRead); nbRead_calls = 1; nbRead_fd = fd; nbRead_s = s; nbRead_eof = eof; nbRead_ret = ret; } bool nbWrite_ret = true; int nbWrite_fd = 0; std::string nbWrite_s = ""; int nbWrite_bytes = 0; int nbWrite_calls = 0; bool XmlRpcSocket::nbWrite(int fd, const std::string& s, int* bytesSoFar) { nbWrite_calls--; EXPECT_EQ(nbWrite_fd, fd); EXPECT_EQ(nbWrite_s, s); *bytesSoFar = nbWrite_bytes; return nbWrite_ret; } void MockSocketTest::Expect_nbWrite(int fd, const std::string& s, int bytes, bool ret) { EXPECT_PROLOGUE(nbWrite); nbWrite_calls = 1; nbWrite_fd = fd; nbWrite_s = s; nbWrite_bytes = bytes; nbWrite_ret = ret; } int getError_ret = 0; int getError_calls = 0; int XmlRpcSocket::getError() { getError_calls--; return getError_ret; } void MockSocketTest::Expect_getError(int ret) { EXPECT_PROLOGUE(getError); getError_calls = 1; getError_ret = ret; } int get_port_ret = 0; int get_port_socket = 0; int get_port_calls = 0; int XmlRpcSocket::get_port(int socket) { get_port_calls--; EXPECT_EQ(get_port_socket, socket); return get_port_ret; } void MockSocketTest::Expect_get_port(int socket, int ret) { EXPECT_PROLOGUE(get_port); get_port_calls = 1; get_port_socket = socket; get_port_ret = ret; } void MockSocketTest::SetUp() { socket_calls = 0; close_calls.clear(); setNonBlocking_calls = 0; setReuseAddr_calls = 0; bind_calls = 0; listen_calls = 0; accept_calls = 0; connect_calls = 0; nbRead_calls = 0; nbWrite_calls = 0; getError_calls = 0; get_port_calls = 0; } void MockSocketTest::TearDown() { CheckCalls(); } void MockSocketTest::CheckCalls() { // Check that call counters and queues are empty. EXPECT_EQ(0, socket_calls); EXPECT_EQ(0u, close_calls.size()); EXPECT_EQ(0, setNonBlocking_calls); EXPECT_EQ(0, setReuseAddr_calls); EXPECT_EQ(0, bind_calls); EXPECT_EQ(0, listen_calls); EXPECT_EQ(0, accept_calls); EXPECT_EQ(0, connect_calls); EXPECT_EQ(0, nbRead_calls); EXPECT_EQ(0, nbWrite_calls); EXPECT_EQ(0, getError_calls); EXPECT_EQ(0, get_port_calls); // Reset call counters and queues so we don't get leakage between different // parts of the test. socket_calls = 0; close_calls.clear(); setNonBlocking_calls = 0; setReuseAddr_calls = 0; bind_calls = 0; listen_calls = 0; accept_calls = 0; connect_calls = 0; nbRead_calls = 0; nbWrite_calls = 0; getError_calls = 0; get_port_calls = 0; }
// // buffered_stream.hpp // ~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_BUFFERED_STREAM_HPP #define BOOST_ASIO_BUFFERED_STREAM_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <cstddef> #include <boost/asio/async_result.hpp> #include <boost/asio/buffered_read_stream.hpp> #include <boost/asio/buffered_write_stream.hpp> #include <boost/asio/buffered_stream_fwd.hpp> #include <boost/asio/detail/noncopyable.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { /// Adds buffering to the read- and write-related operations of a stream. /** * The buffered_stream class template can be used to add buffering to the * synchronous and asynchronous read and write operations of a stream. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. * * @par Concepts: * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template <typename Stream> class buffered_stream : private noncopyable { public: /// The type of the next layer. typedef typename remove_reference<Stream>::type next_layer_type; /// The type of the lowest layer. typedef typename next_layer_type::lowest_layer_type lowest_layer_type; /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> explicit buffered_stream(Arg& a) : inner_stream_impl_(a), stream_impl_(inner_stream_impl_) { } /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> explicit buffered_stream(Arg& a, std::size_t read_buffer_size, std::size_t write_buffer_size) : inner_stream_impl_(a, write_buffer_size), stream_impl_(inner_stream_impl_, read_buffer_size) { } /// Get a reference to the next layer. next_layer_type& next_layer() { return stream_impl_.next_layer().next_layer(); } /// Get a reference to the lowest layer. lowest_layer_type& lowest_layer() { return stream_impl_.lowest_layer(); } /// Get a const reference to the lowest layer. const lowest_layer_type& lowest_layer() const { return stream_impl_.lowest_layer(); } /// Get the io_service associated with the object. boost::asio::io_service& get_io_service() { return stream_impl_.get_io_service(); } /// Close the stream. void close() { stream_impl_.close(); } /// Close the stream. boost::system::error_code close(boost::system::error_code& ec) { return stream_impl_.close(ec); } /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation. Throws an /// exception on failure. std::size_t flush() { return stream_impl_.next_layer().flush(); } /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation, or 0 if an /// error occurred. std::size_t flush(boost::system::error_code& ec) { return stream_impl_.next_layer().flush(ec); } /// Start an asynchronous flush. template <typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_flush(BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { return stream_impl_.next_layer().async_flush( BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers) { return stream_impl_.write_some(buffers); } /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers, boost::system::error_code& ec) { return stream_impl_.write_some(buffers, ec); } /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { return stream_impl_.async_write_some(buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Fill the buffer with some data. Returns the number of bytes placed in the /// buffer as a result of the operation. Throws an exception on failure. std::size_t fill() { return stream_impl_.fill(); } /// Fill the buffer with some data. Returns the number of bytes placed in the /// buffer as a result of the operation, or 0 if an error occurred. std::size_t fill(boost::system::error_code& ec) { return stream_impl_.fill(ec); } /// Start an asynchronous fill. template <typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_fill(BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { return stream_impl_.async_fill(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { return stream_impl_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers, boost::system::error_code& ec) { return stream_impl_.read_some(buffers, ec); } /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { return stream_impl_.async_read_some(buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers) { return stream_impl_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers, boost::system::error_code& ec) { return stream_impl_.peek(buffers, ec); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail() { return stream_impl_.in_avail(); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail(boost::system::error_code& ec) { return stream_impl_.in_avail(ec); } private: // The buffered write stream. typedef buffered_write_stream<Stream> write_stream_type; write_stream_type inner_stream_impl_; // The buffered read stream. typedef buffered_read_stream<write_stream_type&> read_stream_type; read_stream_type stream_impl_; }; } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BUFFERED_STREAM_HPP
; A112557: Smallest number of stones in Tchoukaillon (or Mancala, or Kalahari) solitaire which make use of (2*n-1)-th hole for n>=1; a bisection of A002491. ; 1,4,10,18,30,42,58,78,102,118,150,174,210,240,274,322,360,402,442,498,540,612,648,718,780,840,918,990,1054,1122,1200,1278,1392,1428,1548,1632,1714,1834,1882,2040,2118,2242,2314,2434,2580,2662,2760,2922,3054 mov $1,1 mov $2,$0 mov $3,3 lpb $2 mov $4,$1 lpb $4 add $0,1 trn $4,$3 lpe mov $1,$0 add $1,2 sub $2,1 mov $3,$2 lpe
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_WC_ht+0xa6bc, %r15 xor $29680, %r9 movb (%r15), %r12b nop nop nop nop xor %r13, %r13 lea addresses_WT_ht+0x6abc, %r15 nop dec %r14 movb $0x61, (%r15) xor %r13, %r13 lea addresses_A_ht+0x207c, %rsi lea addresses_D_ht+0x18c9c, %rdi nop cmp %r15, %r15 mov $115, %rcx rep movsl nop nop inc %r15 lea addresses_D_ht+0xd0bc, %r12 nop nop nop cmp $10037, %rdi movw $0x6162, (%r12) sub %rcx, %rcx lea addresses_A_ht+0xc7bc, %rdi nop cmp %r12, %r12 mov $0x6162636465666768, %r15 movq %r15, %xmm2 and $0xffffffffffffffc0, %rdi movntdq %xmm2, (%rdi) nop nop nop nop nop and $11832, %r12 pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r8 push %rbp push %rbx // Store lea addresses_D+0x36bc, %rbx nop nop nop nop dec %r13 mov $0x5152535455565758, %r12 movq %r12, %xmm1 movups %xmm1, (%rbx) nop nop nop add %rbp, %rbp // Store lea addresses_WT+0x102bc, %r15 clflush (%r15) xor $10041, %r8 mov $0x5152535455565758, %r13 movq %r13, %xmm0 movups %xmm0, (%r15) nop and $31272, %r13 // Store lea addresses_WT+0xb6bc, %r13 nop and $42460, %rbp movw $0x5152, (%r13) // Exception!!! mov (0), %r15 cmp $63100, %r15 // Store lea addresses_UC+0x31bc, %rbx nop nop nop sub $13928, %r13 movl $0x51525354, (%rbx) nop sub $43894, %r8 // Store lea addresses_PSE+0x14c3c, %rbp nop and $33296, %r13 movl $0x51525354, (%rbp) nop nop nop nop add $59170, %rbp // Faulty Load lea addresses_WC+0x6ebc, %rbx nop nop nop nop nop and $13601, %r8 mov (%rbx), %bp lea oracles, %rbx and $0xff, %rbp shlq $12, %rbp mov (%rbx,%rbp,1), %rbp pop %rbx pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_PSE'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': True, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_A_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
; A110556: a(n) = binomial(2*n-1,n)*(-1)^n for n>0; a(0) = 1. ; 1,-1,3,-10,35,-126,462,-1716,6435,-24310,92378,-352716,1352078,-5200300,20058300,-77558760,300540195,-1166803110,4537567650,-17672631900,68923264410,-269128937220,1052049481860,-4116715363800,16123801841550,-63205303218876,247959266474052,-973469712824056,3824345300380220,-15033633249770520,59132290782430712,-232714176627630544,916312070471295267,-3609714217008132870,14226520737620288370,-56093138908331422716,221256270138418389602,-873065282167813104916,3446310324346630677300 sub $1,$0 bin $1,$0 mov $0,$1
; int __FASTCALL__ fgetc(FILE *stream) ; 05.2008 aralbrec PUBLIC fgetc PUBLIC ASMDISP_FGETC EXTERN l_jpix, stdio_error_mc, stdio_error_eacces_mc INCLUDE "../stdio.def" .fgetc push hl pop ix .asmentry ; enter : ix = FILE * ; exit : a = hl = char and carry reset for success ; hl = -1 and carry set for fail ; uses : af, bc, de, hl bit 2,(ix+3) ; open for input? jp z, stdio_error_eacces_mc bit 0,(ix+3) ; is an unget char available? jr z, readfromstream ld l,(ix+4) ld h,0 ; hl = unget char res 0,(ix+3) ; unget char no longer available ld a,l or a ret .readfromstream ld a,STDIO_MSG_GETC call l_jpix jp c, stdio_error_mc ld l,a ld h,0 ret defc ASMDISP_FGETC = # asmentry - fgetc
; void __CALLEE__ sp1_Initialize_callee(uchar iflag, uchar colour, uchar tile) ; 03.2006 aralbrec, Sprite Pack v3.0 ; sinclair zx version SECTION code_temp_sp1 PUBLIC sp1_Initialize_callee sp1_Initialize_callee: pop bc pop hl pop de ld h,e pop de ld a,e push bc INCLUDE "temp/sp1/zx/updater/asm_sp1_Initialize.asm"
aci -128 ; CE 80 aci 127 ; CE 7F aci 255 ; CE FF adc (hl) ; 8E adc (hl+) ; 8E 23 adc (hl-) ; 8E 2B adc (ix) ; FD 8E 00 adc (ix+127) ; FD 8E 7F adc (ix-128) ; FD 8E 80 adc (iy) ; DD 8E 00 adc (iy+127) ; DD 8E 7F adc (iy-128) ; DD 8E 80 adc -128 ; CE 80 adc 127 ; CE 7F adc 255 ; CE FF adc a ; 8F adc a, (hl) ; 8E adc a, (hl+) ; 8E 23 adc a, (hl-) ; 8E 2B adc a, (ix) ; FD 8E 00 adc a, (ix+127) ; FD 8E 7F adc a, (ix-128) ; FD 8E 80 adc a, (iy) ; DD 8E 00 adc a, (iy+127) ; DD 8E 7F adc a, (iy-128) ; DD 8E 80 adc a, -128 ; CE 80 adc a, 127 ; CE 7F adc a, 255 ; CE FF adc a, a ; 8F adc a, b ; 88 adc a, c ; 89 adc a, d ; 8A adc a, e ; 8B adc a, h ; 8C adc a, l ; 8D adc b ; 88 adc c ; 89 adc d ; 8A adc e ; 8B adc h ; 8C adc hl, bc ; ED 4A adc hl, de ; ED 5A adc hl, hl ; ED 6A adc hl, sp ; ED 7A adc l ; 8D adc m ; 8E add (hl) ; 86 add (hl+) ; 86 23 add (hl-) ; 86 2B add (ix) ; FD 86 00 add (ix+127) ; FD 86 7F add (ix-128) ; FD 86 80 add (iy) ; DD 86 00 add (iy+127) ; DD 86 7F add (iy-128) ; DD 86 80 add -128 ; C6 80 add 127 ; C6 7F add 255 ; C6 FF add a ; 87 add a, (hl) ; 86 add a, (hl+) ; 86 23 add a, (hl-) ; 86 2B add a, (ix) ; FD 86 00 add a, (ix+127) ; FD 86 7F add a, (ix-128) ; FD 86 80 add a, (iy) ; DD 86 00 add a, (iy+127) ; DD 86 7F add a, (iy-128) ; DD 86 80 add a, -128 ; C6 80 add a, 127 ; C6 7F add a, 255 ; C6 FF add a, a ; 87 add a, b ; 80 add a, c ; 81 add a, d ; 82 add a, e ; 83 add a, h ; 84 add a, l ; 85 add b ; 80 add bc, -32768 ; E5 21 00 80 09 44 4D E1 add bc, 32767 ; E5 21 FF 7F 09 44 4D E1 add bc, 65535 ; E5 21 FF FF 09 44 4D E1 add bc, a ; CD @__z80asm__add_bc_a add c ; 81 add d ; 82 add de, -32768 ; E5 21 00 80 19 54 5D E1 add de, 32767 ; E5 21 FF 7F 19 54 5D E1 add de, 65535 ; E5 21 FF FF 19 54 5D E1 add de, a ; CD @__z80asm__add_de_a add e ; 83 add h ; 84 add hl, -32768 ; D5 11 00 80 19 D1 add hl, 32767 ; D5 11 FF 7F 19 D1 add hl, 65535 ; D5 11 FF FF 19 D1 add hl, a ; CD @__z80asm__add_hl_a add hl, bc ; 09 add hl, de ; 19 add hl, hl ; 29 add hl, sp ; 39 add ix, bc ; FD 09 add ix, de ; FD 19 add ix, ix ; FD 29 add ix, sp ; FD 39 add iy, bc ; DD 09 add iy, de ; DD 19 add iy, iy ; DD 29 add iy, sp ; DD 39 add l ; 85 add m ; 86 adi -128 ; C6 80 adi 127 ; C6 7F adi 255 ; C6 FF ana a ; A7 ana b ; A0 ana c ; A1 ana d ; A2 ana e ; A3 ana h ; A4 ana l ; A5 ana m ; A6 and (hl) ; A6 and (hl+) ; A6 23 and (hl-) ; A6 2B and (ix) ; FD A6 00 and (ix+127) ; FD A6 7F and (ix-128) ; FD A6 80 and (iy) ; DD A6 00 and (iy+127) ; DD A6 7F and (iy-128) ; DD A6 80 and -128 ; E6 80 and 127 ; E6 7F and 255 ; E6 FF and a ; A7 and a, (hl) ; A6 and a, (hl+) ; A6 23 and a, (hl-) ; A6 2B and a, (ix) ; FD A6 00 and a, (ix+127) ; FD A6 7F and a, (ix-128) ; FD A6 80 and a, (iy) ; DD A6 00 and a, (iy+127) ; DD A6 7F and a, (iy-128) ; DD A6 80 and a, -128 ; E6 80 and a, 127 ; E6 7F and a, 255 ; E6 FF and a, a ; A7 and a, b ; A0 and a, c ; A1 and a, d ; A2 and a, e ; A3 and a, h ; A4 and a, l ; A5 and b ; A0 and c ; A1 and d ; A2 and e ; A3 and h ; A4 and l ; A5 ani -128 ; E6 80 ani 127 ; E6 7F ani 255 ; E6 FF arhl ; CB 2C CB 1D bit 0, (hl) ; CB 46 bit 0, (ix) ; FD CB 00 46 bit 0, (ix+127) ; FD CB 7F 46 bit 0, (ix-128) ; FD CB 80 46 bit 0, (iy) ; DD CB 00 46 bit 0, (iy+127) ; DD CB 7F 46 bit 0, (iy-128) ; DD CB 80 46 bit 0, a ; CB 47 bit 0, b ; CB 40 bit 0, c ; CB 41 bit 0, d ; CB 42 bit 0, e ; CB 43 bit 0, h ; CB 44 bit 0, l ; CB 45 bit 1, (hl) ; CB 4E bit 1, (ix) ; FD CB 00 4E bit 1, (ix+127) ; FD CB 7F 4E bit 1, (ix-128) ; FD CB 80 4E bit 1, (iy) ; DD CB 00 4E bit 1, (iy+127) ; DD CB 7F 4E bit 1, (iy-128) ; DD CB 80 4E bit 1, a ; CB 4F bit 1, b ; CB 48 bit 1, c ; CB 49 bit 1, d ; CB 4A bit 1, e ; CB 4B bit 1, h ; CB 4C bit 1, l ; CB 4D bit 2, (hl) ; CB 56 bit 2, (ix) ; FD CB 00 56 bit 2, (ix+127) ; FD CB 7F 56 bit 2, (ix-128) ; FD CB 80 56 bit 2, (iy) ; DD CB 00 56 bit 2, (iy+127) ; DD CB 7F 56 bit 2, (iy-128) ; DD CB 80 56 bit 2, a ; CB 57 bit 2, b ; CB 50 bit 2, c ; CB 51 bit 2, d ; CB 52 bit 2, e ; CB 53 bit 2, h ; CB 54 bit 2, l ; CB 55 bit 3, (hl) ; CB 5E bit 3, (ix) ; FD CB 00 5E bit 3, (ix+127) ; FD CB 7F 5E bit 3, (ix-128) ; FD CB 80 5E bit 3, (iy) ; DD CB 00 5E bit 3, (iy+127) ; DD CB 7F 5E bit 3, (iy-128) ; DD CB 80 5E bit 3, a ; CB 5F bit 3, b ; CB 58 bit 3, c ; CB 59 bit 3, d ; CB 5A bit 3, e ; CB 5B bit 3, h ; CB 5C bit 3, l ; CB 5D bit 4, (hl) ; CB 66 bit 4, (ix) ; FD CB 00 66 bit 4, (ix+127) ; FD CB 7F 66 bit 4, (ix-128) ; FD CB 80 66 bit 4, (iy) ; DD CB 00 66 bit 4, (iy+127) ; DD CB 7F 66 bit 4, (iy-128) ; DD CB 80 66 bit 4, a ; CB 67 bit 4, b ; CB 60 bit 4, c ; CB 61 bit 4, d ; CB 62 bit 4, e ; CB 63 bit 4, h ; CB 64 bit 4, l ; CB 65 bit 5, (hl) ; CB 6E bit 5, (ix) ; FD CB 00 6E bit 5, (ix+127) ; FD CB 7F 6E bit 5, (ix-128) ; FD CB 80 6E bit 5, (iy) ; DD CB 00 6E bit 5, (iy+127) ; DD CB 7F 6E bit 5, (iy-128) ; DD CB 80 6E bit 5, a ; CB 6F bit 5, b ; CB 68 bit 5, c ; CB 69 bit 5, d ; CB 6A bit 5, e ; CB 6B bit 5, h ; CB 6C bit 5, l ; CB 6D bit 6, (hl) ; CB 76 bit 6, (ix) ; FD CB 00 76 bit 6, (ix+127) ; FD CB 7F 76 bit 6, (ix-128) ; FD CB 80 76 bit 6, (iy) ; DD CB 00 76 bit 6, (iy+127) ; DD CB 7F 76 bit 6, (iy-128) ; DD CB 80 76 bit 6, a ; CB 77 bit 6, b ; CB 70 bit 6, c ; CB 71 bit 6, d ; CB 72 bit 6, e ; CB 73 bit 6, h ; CB 74 bit 6, l ; CB 75 bit 7, (hl) ; CB 7E bit 7, (ix) ; FD CB 00 7E bit 7, (ix+127) ; FD CB 7F 7E bit 7, (ix-128) ; FD CB 80 7E bit 7, (iy) ; DD CB 00 7E bit 7, (iy+127) ; DD CB 7F 7E bit 7, (iy-128) ; DD CB 80 7E bit 7, a ; CB 7F bit 7, b ; CB 78 bit 7, c ; CB 79 bit 7, d ; CB 7A bit 7, e ; CB 7B bit 7, h ; CB 7C bit 7, l ; CB 7D call -32768 ; CD 00 80 call 32767 ; CD FF 7F call 65535 ; CD FF FF call c, -32768 ; DC 00 80 call c, 32767 ; DC FF 7F call c, 65535 ; DC FF FF call m, -32768 ; FC 00 80 call m, 32767 ; FC FF 7F call m, 65535 ; FC FF FF call nc, -32768 ; D4 00 80 call nc, 32767 ; D4 FF 7F call nc, 65535 ; D4 FF FF call nv, -32768 ; E4 00 80 call nv, 32767 ; E4 FF 7F call nv, 65535 ; E4 FF FF call nz, -32768 ; C4 00 80 call nz, 32767 ; C4 FF 7F call nz, 65535 ; C4 FF FF call p, -32768 ; F4 00 80 call p, 32767 ; F4 FF 7F call p, 65535 ; F4 FF FF call pe, -32768 ; EC 00 80 call pe, 32767 ; EC FF 7F call pe, 65535 ; EC FF FF call po, -32768 ; E4 00 80 call po, 32767 ; E4 FF 7F call po, 65535 ; E4 FF FF call v, -32768 ; EC 00 80 call v, 32767 ; EC FF 7F call v, 65535 ; EC FF FF call z, -32768 ; CC 00 80 call z, 32767 ; CC FF 7F call z, 65535 ; CC FF FF cc -32768 ; DC 00 80 cc 32767 ; DC FF 7F cc 65535 ; DC FF FF ccf ; 3F cm -32768 ; FC 00 80 cm 32767 ; FC FF 7F cm 65535 ; FC FF FF cma ; 2F cmc ; 3F cmp (hl) ; BE cmp (hl+) ; BE 23 cmp (hl-) ; BE 2B cmp (ix) ; FD BE 00 cmp (ix+127) ; FD BE 7F cmp (ix-128) ; FD BE 80 cmp (iy) ; DD BE 00 cmp (iy+127) ; DD BE 7F cmp (iy-128) ; DD BE 80 cmp -128 ; FE 80 cmp 127 ; FE 7F cmp 255 ; FE FF cmp a ; BF cmp a, (hl) ; BE cmp a, (hl+) ; BE 23 cmp a, (hl-) ; BE 2B cmp a, (ix) ; FD BE 00 cmp a, (ix+127) ; FD BE 7F cmp a, (ix-128) ; FD BE 80 cmp a, (iy) ; DD BE 00 cmp a, (iy+127) ; DD BE 7F cmp a, (iy-128) ; DD BE 80 cmp a, -128 ; FE 80 cmp a, 127 ; FE 7F cmp a, 255 ; FE FF cmp a, a ; BF cmp a, b ; B8 cmp a, c ; B9 cmp a, d ; BA cmp a, e ; BB cmp a, h ; BC cmp a, l ; BD cmp b ; B8 cmp c ; B9 cmp d ; BA cmp e ; BB cmp h ; BC cmp l ; BD cmp m ; BE cnc -32768 ; D4 00 80 cnc 32767 ; D4 FF 7F cnc 65535 ; D4 FF FF cnv -32768 ; E4 00 80 cnv 32767 ; E4 FF 7F cnv 65535 ; E4 FF FF cnz -32768 ; C4 00 80 cnz 32767 ; C4 FF 7F cnz 65535 ; C4 FF FF cp (hl) ; BE cp (hl+) ; BE 23 cp (hl-) ; BE 2B cp (ix) ; FD BE 00 cp (ix+127) ; FD BE 7F cp (ix-128) ; FD BE 80 cp (iy) ; DD BE 00 cp (iy+127) ; DD BE 7F cp (iy-128) ; DD BE 80 cp -128 ; FE 80 cp 127 ; FE 7F cp 255 ; FE FF cp a ; BF cp a, (hl) ; BE cp a, (hl+) ; BE 23 cp a, (hl-) ; BE 2B cp a, (ix) ; FD BE 00 cp a, (ix+127) ; FD BE 7F cp a, (ix-128) ; FD BE 80 cp a, (iy) ; DD BE 00 cp a, (iy+127) ; DD BE 7F cp a, (iy-128) ; DD BE 80 cp a, -128 ; FE 80 cp a, 127 ; FE 7F cp a, 255 ; FE FF cp a, a ; BF cp a, b ; B8 cp a, c ; B9 cp a, d ; BA cp a, e ; BB cp a, h ; BC cp a, l ; BD cp b ; B8 cp c ; B9 cp d ; BA cp e ; BB cp h ; BC cp l ; BD cpd ; ED A9 cpdr ; ED B9 cpe -32768 ; EC 00 80 cpe 32767 ; EC FF 7F cpe 65535 ; EC FF FF cpi ; ED A1 cpi -128 ; FE 80 cpi 127 ; FE 7F cpi 255 ; FE FF cpir ; ED B1 cpl ; 2F cpl a ; 2F cpo -32768 ; E4 00 80 cpo 32767 ; E4 FF 7F cpo 65535 ; E4 FF FF cv -32768 ; EC 00 80 cv 32767 ; EC FF 7F cv 65535 ; EC FF FF cz -32768 ; CC 00 80 cz 32767 ; CC FF 7F cz 65535 ; CC FF FF daa ; 27 dad b ; 09 dad bc ; 09 dad d ; 19 dad de ; 19 dad h ; 29 dad hl ; 29 dad sp ; 39 dcr a ; 3D dcr b ; 05 dcr c ; 0D dcr d ; 15 dcr e ; 1D dcr h ; 25 dcr l ; 2D dcr m ; 35 dcx b ; 0B dcx bc ; 0B dcx d ; 1B dcx de ; 1B dcx h ; 2B dcx hl ; 2B dcx sp ; 3B dec (hl) ; 35 dec (hl+) ; 35 23 dec (hl-) ; 35 2B dec (ix) ; FD 35 00 dec (ix+127) ; FD 35 7F dec (ix-128) ; FD 35 80 dec (iy) ; DD 35 00 dec (iy+127) ; DD 35 7F dec (iy-128) ; DD 35 80 dec a ; 3D dec b ; 05 dec bc ; 0B dec c ; 0D dec d ; 15 dec de ; 1B dec e ; 1D dec h ; 25 dec hl ; 2B dec ix ; FD 2B dec iy ; DD 2B dec l ; 2D dec sp ; 3B di ; F3 djnz ASMPC ; 10 FE djnz b, ASMPC ; 10 FE dsub ; CD @__z80asm__sub_hl_bc ei ; FB ex (sp), hl ; E3 ex (sp), ix ; FD E3 ex (sp), iy ; DD E3 ex af, af ; 08 ex af, af' ; 08 ex de, hl ; EB exx ; D9 halt ; 76 hlt ; 76 im 0 ; ED 46 im 1 ; ED 56 im 2 ; ED 5E in (c) ; ED 70 in -128 ; DB 80 in 127 ; DB 7F in 255 ; DB FF in a, (-128) ; DB 80 in a, (127) ; DB 7F in a, (255) ; DB FF in a, (c) ; ED 78 in b, (c) ; ED 40 in c, (c) ; ED 48 in d, (c) ; ED 50 in e, (c) ; ED 58 in f, (c) ; ED 70 in h, (c) ; ED 60 in l, (c) ; ED 68 in0 (-128) ; ED 30 80 in0 (127) ; ED 30 7F in0 (255) ; ED 30 FF in0 a, (-128) ; ED 38 80 in0 a, (127) ; ED 38 7F in0 a, (255) ; ED 38 FF in0 b, (-128) ; ED 00 80 in0 b, (127) ; ED 00 7F in0 b, (255) ; ED 00 FF in0 c, (-128) ; ED 08 80 in0 c, (127) ; ED 08 7F in0 c, (255) ; ED 08 FF in0 d, (-128) ; ED 10 80 in0 d, (127) ; ED 10 7F in0 d, (255) ; ED 10 FF in0 e, (-128) ; ED 18 80 in0 e, (127) ; ED 18 7F in0 e, (255) ; ED 18 FF in0 f, (-128) ; ED 30 80 in0 f, (127) ; ED 30 7F in0 f, (255) ; ED 30 FF in0 h, (-128) ; ED 20 80 in0 h, (127) ; ED 20 7F in0 h, (255) ; ED 20 FF in0 l, (-128) ; ED 28 80 in0 l, (127) ; ED 28 7F in0 l, (255) ; ED 28 FF inc (hl) ; 34 inc (hl+) ; 34 23 inc (hl-) ; 34 2B inc (ix) ; FD 34 00 inc (ix+127) ; FD 34 7F inc (ix-128) ; FD 34 80 inc (iy) ; DD 34 00 inc (iy+127) ; DD 34 7F inc (iy-128) ; DD 34 80 inc a ; 3C inc b ; 04 inc bc ; 03 inc c ; 0C inc d ; 14 inc de ; 13 inc e ; 1C inc h ; 24 inc hl ; 23 inc ix ; FD 23 inc iy ; DD 23 inc l ; 2C inc sp ; 33 ind ; ED AA indr ; ED BA ini ; ED A2 inir ; ED B2 inr a ; 3C inr b ; 04 inr c ; 0C inr d ; 14 inr e ; 1C inr h ; 24 inr l ; 2C inr m ; 34 inx b ; 03 inx bc ; 03 inx d ; 13 inx de ; 13 inx h ; 23 inx hl ; 23 inx sp ; 33 jc -32768 ; DA 00 80 jc 32767 ; DA FF 7F jc 65535 ; DA FF FF jm -32768 ; FA 00 80 jm 32767 ; FA FF 7F jm 65535 ; FA FF FF jmp -32768 ; C3 00 80 jmp 32767 ; C3 FF 7F jmp 65535 ; C3 FF FF jnc -32768 ; D2 00 80 jnc 32767 ; D2 FF 7F jnc 65535 ; D2 FF FF jnv -32768 ; E2 00 80 jnv 32767 ; E2 FF 7F jnv 65535 ; E2 FF FF jnz -32768 ; C2 00 80 jnz 32767 ; C2 FF 7F jnz 65535 ; C2 FF FF jp (bc) ; C5 C9 jp (de) ; D5 C9 jp (hl) ; E9 jp (ix) ; FD E9 jp (iy) ; DD E9 jp -32768 ; C3 00 80 jp 32767 ; C3 FF 7F jp 65535 ; C3 FF FF jp c, -32768 ; DA 00 80 jp c, 32767 ; DA FF 7F jp c, 65535 ; DA FF FF jp m, -32768 ; FA 00 80 jp m, 32767 ; FA FF 7F jp m, 65535 ; FA FF FF jp nc, -32768 ; D2 00 80 jp nc, 32767 ; D2 FF 7F jp nc, 65535 ; D2 FF FF jp nv, -32768 ; E2 00 80 jp nv, 32767 ; E2 FF 7F jp nv, 65535 ; E2 FF FF jp nz, -32768 ; C2 00 80 jp nz, 32767 ; C2 FF 7F jp nz, 65535 ; C2 FF FF jp p, -32768 ; F2 00 80 jp p, 32767 ; F2 FF 7F jp p, 65535 ; F2 FF FF jp pe, -32768 ; EA 00 80 jp pe, 32767 ; EA FF 7F jp pe, 65535 ; EA FF FF jp po, -32768 ; E2 00 80 jp po, 32767 ; E2 FF 7F jp po, 65535 ; E2 FF FF jp v, -32768 ; EA 00 80 jp v, 32767 ; EA FF 7F jp v, 65535 ; EA FF FF jp z, -32768 ; CA 00 80 jp z, 32767 ; CA FF 7F jp z, 65535 ; CA FF FF jpe -32768 ; EA 00 80 jpe 32767 ; EA FF 7F jpe 65535 ; EA FF FF jpo -32768 ; E2 00 80 jpo 32767 ; E2 FF 7F jpo 65535 ; E2 FF FF jr ASMPC ; 18 FE jr c, ASMPC ; 38 FE jr nc, ASMPC ; 30 FE jr nz, ASMPC ; 20 FE jr z, ASMPC ; 28 FE jv -32768 ; EA 00 80 jv 32767 ; EA FF 7F jv 65535 ; EA FF FF jz -32768 ; CA 00 80 jz 32767 ; CA FF 7F jz 65535 ; CA FF FF ld (-32768), a ; 32 00 80 ld (-32768), bc ; ED 43 00 80 ld (-32768), de ; ED 53 00 80 ld (-32768), hl ; 22 00 80 ld (-32768), ix ; FD 22 00 80 ld (-32768), iy ; DD 22 00 80 ld (-32768), sp ; ED 73 00 80 ld (32767), a ; 32 FF 7F ld (32767), bc ; ED 43 FF 7F ld (32767), de ; ED 53 FF 7F ld (32767), hl ; 22 FF 7F ld (32767), ix ; FD 22 FF 7F ld (32767), iy ; DD 22 FF 7F ld (32767), sp ; ED 73 FF 7F ld (65535), a ; 32 FF FF ld (65535), bc ; ED 43 FF FF ld (65535), de ; ED 53 FF FF ld (65535), hl ; 22 FF FF ld (65535), ix ; FD 22 FF FF ld (65535), iy ; DD 22 FF FF ld (65535), sp ; ED 73 FF FF ld (bc), a ; 02 ld (bc+), a ; 02 03 ld (bc-), a ; 02 0B ld (de), -128 ; EB 36 80 EB ld (de), 127 ; EB 36 7F EB ld (de), 255 ; EB 36 FF EB ld (de), a ; 12 ld (de), b ; EB 70 EB ld (de), c ; EB 71 EB ld (de), d ; EB 74 EB ld (de), e ; EB 75 EB ld (de), h ; EB 72 EB ld (de), l ; EB 73 EB ld (de+), -128 ; EB 36 80 EB 13 ld (de+), 127 ; EB 36 7F EB 13 ld (de+), 255 ; EB 36 FF EB 13 ld (de+), a ; 12 13 ld (de+), b ; EB 70 EB 13 ld (de+), c ; EB 71 EB 13 ld (de+), d ; EB 74 EB 13 ld (de+), e ; EB 75 EB 13 ld (de+), h ; EB 72 EB 13 ld (de+), l ; EB 73 EB 13 ld (de-), -128 ; EB 36 80 EB 1B ld (de-), 127 ; EB 36 7F EB 1B ld (de-), 255 ; EB 36 FF EB 1B ld (de-), a ; 12 1B ld (de-), b ; EB 70 EB 1B ld (de-), c ; EB 71 EB 1B ld (de-), d ; EB 74 EB 1B ld (de-), e ; EB 75 EB 1B ld (de-), h ; EB 72 EB 1B ld (de-), l ; EB 73 EB 1B ld (hl), -128 ; 36 80 ld (hl), 127 ; 36 7F ld (hl), 255 ; 36 FF ld (hl), a ; 77 ld (hl), b ; 70 ld (hl), bc ; 71 23 70 2B ld (hl), c ; 71 ld (hl), d ; 72 ld (hl), de ; 73 23 72 2B ld (hl), e ; 73 ld (hl), h ; 74 ld (hl), l ; 75 ld (hl+), -128 ; 36 80 23 ld (hl+), 127 ; 36 7F 23 ld (hl+), 255 ; 36 FF 23 ld (hl+), a ; 77 23 ld (hl+), bc ; 71 23 70 23 ld (hl+), de ; 73 23 72 23 ld (hl-), -128 ; 36 80 2B ld (hl-), 127 ; 36 7F 2B ld (hl-), 255 ; 36 FF 2B ld (hl-), a ; 77 2B ld (hld), a ; 77 2B ld (hli), a ; 77 23 ld (ix), -128 ; FD 36 00 80 ld (ix), 127 ; FD 36 00 7F ld (ix), 255 ; FD 36 00 FF ld (ix), a ; FD 77 00 ld (ix), b ; FD 70 00 ld (ix), c ; FD 71 00 ld (ix), d ; FD 72 00 ld (ix), e ; FD 73 00 ld (ix), h ; FD 74 00 ld (ix), l ; FD 75 00 ld (ix+127), -128 ; FD 36 7F 80 ld (ix+127), 127 ; FD 36 7F 7F ld (ix+127), 255 ; FD 36 7F FF ld (ix+127), a ; FD 77 7F ld (ix+127), b ; FD 70 7F ld (ix+127), c ; FD 71 7F ld (ix+127), d ; FD 72 7F ld (ix+127), e ; FD 73 7F ld (ix+127), h ; FD 74 7F ld (ix+127), l ; FD 75 7F ld (ix-128), -128 ; FD 36 80 80 ld (ix-128), 127 ; FD 36 80 7F ld (ix-128), 255 ; FD 36 80 FF ld (ix-128), a ; FD 77 80 ld (ix-128), b ; FD 70 80 ld (ix-128), c ; FD 71 80 ld (ix-128), d ; FD 72 80 ld (ix-128), e ; FD 73 80 ld (ix-128), h ; FD 74 80 ld (ix-128), l ; FD 75 80 ld (iy), -128 ; DD 36 00 80 ld (iy), 127 ; DD 36 00 7F ld (iy), 255 ; DD 36 00 FF ld (iy), a ; DD 77 00 ld (iy), b ; DD 70 00 ld (iy), c ; DD 71 00 ld (iy), d ; DD 72 00 ld (iy), e ; DD 73 00 ld (iy), h ; DD 74 00 ld (iy), l ; DD 75 00 ld (iy+127), -128 ; DD 36 7F 80 ld (iy+127), 127 ; DD 36 7F 7F ld (iy+127), 255 ; DD 36 7F FF ld (iy+127), a ; DD 77 7F ld (iy+127), b ; DD 70 7F ld (iy+127), c ; DD 71 7F ld (iy+127), d ; DD 72 7F ld (iy+127), e ; DD 73 7F ld (iy+127), h ; DD 74 7F ld (iy+127), l ; DD 75 7F ld (iy-128), -128 ; DD 36 80 80 ld (iy-128), 127 ; DD 36 80 7F ld (iy-128), 255 ; DD 36 80 FF ld (iy-128), a ; DD 77 80 ld (iy-128), b ; DD 70 80 ld (iy-128), c ; DD 71 80 ld (iy-128), d ; DD 72 80 ld (iy-128), e ; DD 73 80 ld (iy-128), h ; DD 74 80 ld (iy-128), l ; DD 75 80 ld a, (-32768) ; 3A 00 80 ld a, (32767) ; 3A FF 7F ld a, (65535) ; 3A FF FF ld a, (bc) ; 0A ld a, (bc+) ; 0A 03 ld a, (bc-) ; 0A 0B ld a, (de) ; 1A ld a, (de+) ; 1A 13 ld a, (de-) ; 1A 1B ld a, (hl) ; 7E ld a, (hl+) ; 7E 23 ld a, (hl-) ; 7E 2B ld a, (hld) ; 7E 2B ld a, (hli) ; 7E 23 ld a, (ix) ; FD 7E 00 ld a, (ix+127) ; FD 7E 7F ld a, (ix-128) ; FD 7E 80 ld a, (iy) ; DD 7E 00 ld a, (iy+127) ; DD 7E 7F ld a, (iy-128) ; DD 7E 80 ld a, -128 ; 3E 80 ld a, 127 ; 3E 7F ld a, 255 ; 3E FF ld a, a ; 7F ld a, b ; 78 ld a, c ; 79 ld a, d ; 7A ld a, e ; 7B ld a, h ; 7C ld a, i ; ED 57 ld a, l ; 7D ld a, r ; ED 5F ld b, (de) ; EB 46 EB ld b, (de+) ; EB 46 EB 13 ld b, (de-) ; EB 46 EB 1B ld b, (hl) ; 46 ld b, (ix) ; FD 46 00 ld b, (ix+127) ; FD 46 7F ld b, (ix-128) ; FD 46 80 ld b, (iy) ; DD 46 00 ld b, (iy+127) ; DD 46 7F ld b, (iy-128) ; DD 46 80 ld b, -128 ; 06 80 ld b, 127 ; 06 7F ld b, 255 ; 06 FF ld b, a ; 47 ld b, b ; 40 ld b, c ; 41 ld b, d ; 42 ld b, e ; 43 ld b, h ; 44 ld b, l ; 45 ld bc, (-32768) ; ED 4B 00 80 ld bc, (32767) ; ED 4B FF 7F ld bc, (65535) ; ED 4B FF FF ld bc, -32768 ; 01 00 80 ld bc, 32767 ; 01 FF 7F ld bc, 65535 ; 01 FF FF ld bc, de ; 42 4B ld bc, hl ; 44 4D ld c, (de) ; EB 4E EB ld c, (de+) ; EB 4E EB 13 ld c, (de-) ; EB 4E EB 1B ld c, (hl) ; 4E ld c, (ix) ; FD 4E 00 ld c, (ix+127) ; FD 4E 7F ld c, (ix-128) ; FD 4E 80 ld c, (iy) ; DD 4E 00 ld c, (iy+127) ; DD 4E 7F ld c, (iy-128) ; DD 4E 80 ld c, -128 ; 0E 80 ld c, 127 ; 0E 7F ld c, 255 ; 0E FF ld c, a ; 4F ld c, b ; 48 ld c, c ; 49 ld c, d ; 4A ld c, e ; 4B ld c, h ; 4C ld c, l ; 4D ld d, (de) ; EB 66 EB ld d, (de+) ; EB 66 EB 13 ld d, (de-) ; EB 66 EB 1B ld d, (hl) ; 56 ld d, (ix) ; FD 56 00 ld d, (ix+127) ; FD 56 7F ld d, (ix-128) ; FD 56 80 ld d, (iy) ; DD 56 00 ld d, (iy+127) ; DD 56 7F ld d, (iy-128) ; DD 56 80 ld d, -128 ; 16 80 ld d, 127 ; 16 7F ld d, 255 ; 16 FF ld d, a ; 57 ld d, b ; 50 ld d, c ; 51 ld d, d ; 52 ld d, e ; 53 ld d, h ; 54 ld d, l ; 55 ld de, (-32768) ; ED 5B 00 80 ld de, (32767) ; ED 5B FF 7F ld de, (65535) ; ED 5B FF FF ld de, -32768 ; 11 00 80 ld de, 32767 ; 11 FF 7F ld de, 65535 ; 11 FF FF ld de, bc ; 50 59 ld de, hl ; 54 5D ld de, sp ; EB 21 00 00 39 EB ld de, sp+0 ; EB 21 00 00 39 EB ld de, sp+255 ; EB 21 FF 00 39 EB ld e, (de) ; EB 6E EB ld e, (de+) ; EB 6E EB 13 ld e, (de-) ; EB 6E EB 1B ld e, (hl) ; 5E ld e, (ix) ; FD 5E 00 ld e, (ix+127) ; FD 5E 7F ld e, (ix-128) ; FD 5E 80 ld e, (iy) ; DD 5E 00 ld e, (iy+127) ; DD 5E 7F ld e, (iy-128) ; DD 5E 80 ld e, -128 ; 1E 80 ld e, 127 ; 1E 7F ld e, 255 ; 1E FF ld e, a ; 5F ld e, b ; 58 ld e, c ; 59 ld e, d ; 5A ld e, e ; 5B ld e, h ; 5C ld e, l ; 5D ld h, (de) ; EB 56 EB ld h, (de+) ; EB 56 EB 13 ld h, (de-) ; EB 56 EB 1B ld h, (hl) ; 66 ld h, (ix) ; FD 66 00 ld h, (ix+127) ; FD 66 7F ld h, (ix-128) ; FD 66 80 ld h, (iy) ; DD 66 00 ld h, (iy+127) ; DD 66 7F ld h, (iy-128) ; DD 66 80 ld h, -128 ; 26 80 ld h, 127 ; 26 7F ld h, 255 ; 26 FF ld h, a ; 67 ld h, b ; 60 ld h, c ; 61 ld h, d ; 62 ld h, e ; 63 ld h, h ; 64 ld h, l ; 65 ld hl, (-32768) ; 2A 00 80 ld hl, (32767) ; 2A FF 7F ld hl, (65535) ; 2A FF FF ld hl, -32768 ; 21 00 80 ld hl, 32767 ; 21 FF 7F ld hl, 65535 ; 21 FF FF ld hl, bc ; 60 69 ld hl, de ; 62 6B ld hl, sp ; 21 00 00 39 ld hl, sp+-128 ; 21 80 FF 39 ld hl, sp+127 ; 21 7F 00 39 ld i, a ; ED 47 ld ix, (-32768) ; FD 2A 00 80 ld ix, (32767) ; FD 2A FF 7F ld ix, (65535) ; FD 2A FF FF ld ix, -32768 ; FD 21 00 80 ld ix, 32767 ; FD 21 FF 7F ld ix, 65535 ; FD 21 FF FF ld iy, (-32768) ; DD 2A 00 80 ld iy, (32767) ; DD 2A FF 7F ld iy, (65535) ; DD 2A FF FF ld iy, -32768 ; DD 21 00 80 ld iy, 32767 ; DD 21 FF 7F ld iy, 65535 ; DD 21 FF FF ld l, (de) ; EB 5E EB ld l, (de+) ; EB 5E EB 13 ld l, (de-) ; EB 5E EB 1B ld l, (hl) ; 6E ld l, (ix) ; FD 6E 00 ld l, (ix+127) ; FD 6E 7F ld l, (ix-128) ; FD 6E 80 ld l, (iy) ; DD 6E 00 ld l, (iy+127) ; DD 6E 7F ld l, (iy-128) ; DD 6E 80 ld l, -128 ; 2E 80 ld l, 127 ; 2E 7F ld l, 255 ; 2E FF ld l, a ; 6F ld l, b ; 68 ld l, c ; 69 ld l, d ; 6A ld l, e ; 6B ld l, h ; 6C ld l, l ; 6D ld r, a ; ED 4F ld sp, (-32768) ; ED 7B 00 80 ld sp, (32767) ; ED 7B FF 7F ld sp, (65535) ; ED 7B FF FF ld sp, -32768 ; 31 00 80 ld sp, 32767 ; 31 FF 7F ld sp, 65535 ; 31 FF FF ld sp, hl ; F9 ld sp, ix ; FD F9 ld sp, iy ; DD F9 lda -32768 ; 3A 00 80 lda 32767 ; 3A FF 7F lda 65535 ; 3A FF FF ldax b ; 0A ldax bc ; 0A ldax d ; 1A ldax de ; 1A ldd ; ED A8 ldd (bc), a ; 02 0B ldd (de), -128 ; EB 36 80 EB 1B ldd (de), 127 ; EB 36 7F EB 1B ldd (de), 255 ; EB 36 FF EB 1B ldd (de), a ; 12 1B ldd (de), b ; EB 70 EB 1B ldd (de), c ; EB 71 EB 1B ldd (de), d ; EB 74 EB 1B ldd (de), e ; EB 75 EB 1B ldd (de), h ; EB 72 EB 1B ldd (de), l ; EB 73 EB 1B ldd (hl), -128 ; 36 80 2B ldd (hl), 127 ; 36 7F 2B ldd (hl), 255 ; 36 FF 2B ldd (hl), a ; 77 2B ldd a, (bc) ; 0A 0B ldd a, (de) ; 1A 1B ldd a, (hl) ; 7E 2B ldd b, (de) ; EB 46 EB 1B ldd c, (de) ; EB 4E EB 1B ldd d, (de) ; EB 66 EB 1B ldd e, (de) ; EB 6E EB 1B ldd h, (de) ; EB 56 EB 1B ldd l, (de) ; EB 5E EB 1B lddr ; ED B8 ldi ; ED A0 ldi (bc), a ; 02 03 ldi (de), -128 ; EB 36 80 EB 13 ldi (de), 127 ; EB 36 7F EB 13 ldi (de), 255 ; EB 36 FF EB 13 ldi (de), a ; 12 13 ldi (de), b ; EB 70 EB 13 ldi (de), c ; EB 71 EB 13 ldi (de), d ; EB 74 EB 13 ldi (de), e ; EB 75 EB 13 ldi (de), h ; EB 72 EB 13 ldi (de), l ; EB 73 EB 13 ldi (hl), -128 ; 36 80 23 ldi (hl), 127 ; 36 7F 23 ldi (hl), 255 ; 36 FF 23 ldi (hl), a ; 77 23 ldi (hl), bc ; 71 23 70 23 ldi (hl), de ; 73 23 72 23 ldi a, (bc) ; 0A 03 ldi a, (de) ; 1A 13 ldi a, (hl) ; 7E 23 ldi b, (de) ; EB 46 EB 13 ldi c, (de) ; EB 4E EB 13 ldi d, (de) ; EB 66 EB 13 ldi e, (de) ; EB 6E EB 13 ldi h, (de) ; EB 56 EB 13 ldi l, (de) ; EB 5E EB 13 ldir ; ED B0 lhld -32768 ; 2A 00 80 lhld 32767 ; 2A FF 7F lhld 65535 ; 2A FF FF lxi b, -32768 ; 01 00 80 lxi b, 32767 ; 01 FF 7F lxi b, 65535 ; 01 FF FF lxi bc, -32768 ; 01 00 80 lxi bc, 32767 ; 01 FF 7F lxi bc, 65535 ; 01 FF FF lxi d, -32768 ; 11 00 80 lxi d, 32767 ; 11 FF 7F lxi d, 65535 ; 11 FF FF lxi de, -32768 ; 11 00 80 lxi de, 32767 ; 11 FF 7F lxi de, 65535 ; 11 FF FF lxi h, -32768 ; 21 00 80 lxi h, 32767 ; 21 FF 7F lxi h, 65535 ; 21 FF FF lxi hl, -32768 ; 21 00 80 lxi hl, 32767 ; 21 FF 7F lxi hl, 65535 ; 21 FF FF lxi sp, -32768 ; 31 00 80 lxi sp, 32767 ; 31 FF 7F lxi sp, 65535 ; 31 FF FF mlt bc ; ED 4C mlt de ; ED 5C mlt hl ; ED 6C mlt sp ; ED 7C mov a, a ; 7F mov a, b ; 78 mov a, c ; 79 mov a, d ; 7A mov a, e ; 7B mov a, h ; 7C mov a, l ; 7D mov a, m ; 7E mov b, a ; 47 mov b, b ; 40 mov b, c ; 41 mov b, d ; 42 mov b, e ; 43 mov b, h ; 44 mov b, l ; 45 mov b, m ; 46 mov c, a ; 4F mov c, b ; 48 mov c, c ; 49 mov c, d ; 4A mov c, e ; 4B mov c, h ; 4C mov c, l ; 4D mov c, m ; 4E mov d, a ; 57 mov d, b ; 50 mov d, c ; 51 mov d, d ; 52 mov d, e ; 53 mov d, h ; 54 mov d, l ; 55 mov d, m ; 56 mov e, a ; 5F mov e, b ; 58 mov e, c ; 59 mov e, d ; 5A mov e, e ; 5B mov e, h ; 5C mov e, l ; 5D mov e, m ; 5E mov h, a ; 67 mov h, b ; 60 mov h, c ; 61 mov h, d ; 62 mov h, e ; 63 mov h, h ; 64 mov h, l ; 65 mov h, m ; 66 mov l, a ; 6F mov l, b ; 68 mov l, c ; 69 mov l, d ; 6A mov l, e ; 6B mov l, h ; 6C mov l, l ; 6D mov l, m ; 6E mov m, a ; 77 mov m, b ; 70 mov m, c ; 71 mov m, d ; 72 mov m, e ; 73 mov m, h ; 74 mov m, l ; 75 mvi a, -128 ; 3E 80 mvi a, 127 ; 3E 7F mvi a, 255 ; 3E FF mvi b, -128 ; 06 80 mvi b, 127 ; 06 7F mvi b, 255 ; 06 FF mvi c, -128 ; 0E 80 mvi c, 127 ; 0E 7F mvi c, 255 ; 0E FF mvi d, -128 ; 16 80 mvi d, 127 ; 16 7F mvi d, 255 ; 16 FF mvi e, -128 ; 1E 80 mvi e, 127 ; 1E 7F mvi e, 255 ; 1E FF mvi h, -128 ; 26 80 mvi h, 127 ; 26 7F mvi h, 255 ; 26 FF mvi l, -128 ; 2E 80 mvi l, 127 ; 2E 7F mvi l, 255 ; 2E FF mvi m, -128 ; 36 80 mvi m, 127 ; 36 7F mvi m, 255 ; 36 FF neg ; ED 44 neg a ; ED 44 nop ; 00 or (hl) ; B6 or (hl+) ; B6 23 or (hl-) ; B6 2B or (ix) ; FD B6 00 or (ix+127) ; FD B6 7F or (ix-128) ; FD B6 80 or (iy) ; DD B6 00 or (iy+127) ; DD B6 7F or (iy-128) ; DD B6 80 or -128 ; F6 80 or 127 ; F6 7F or 255 ; F6 FF or a ; B7 or a, (hl) ; B6 or a, (hl+) ; B6 23 or a, (hl-) ; B6 2B or a, (ix) ; FD B6 00 or a, (ix+127) ; FD B6 7F or a, (ix-128) ; FD B6 80 or a, (iy) ; DD B6 00 or a, (iy+127) ; DD B6 7F or a, (iy-128) ; DD B6 80 or a, -128 ; F6 80 or a, 127 ; F6 7F or a, 255 ; F6 FF or a, a ; B7 or a, b ; B0 or a, c ; B1 or a, d ; B2 or a, e ; B3 or a, h ; B4 or a, l ; B5 or b ; B0 or c ; B1 or d ; B2 or e ; B3 or h ; B4 or l ; B5 ora a ; B7 ora b ; B0 ora c ; B1 ora d ; B2 ora e ; B3 ora h ; B4 ora l ; B5 ora m ; B6 ori -128 ; F6 80 ori 127 ; F6 7F ori 255 ; F6 FF otdm ; ED 8B otdmr ; ED 9B otdr ; ED BB otim ; ED 83 otimr ; ED 93 otir ; ED B3 out (-128), a ; D3 80 out (127), a ; D3 7F out (255), a ; D3 FF out (c), 0 ; ED 71 out (c), a ; ED 79 out (c), b ; ED 41 out (c), c ; ED 49 out (c), d ; ED 51 out (c), e ; ED 59 out (c), f ; ED 71 out (c), h ; ED 61 out (c), l ; ED 69 out -128 ; D3 80 out 127 ; D3 7F out 255 ; D3 FF out0 (-128), a ; ED 39 80 out0 (-128), b ; ED 01 80 out0 (-128), c ; ED 09 80 out0 (-128), d ; ED 11 80 out0 (-128), e ; ED 19 80 out0 (-128), h ; ED 21 80 out0 (-128), l ; ED 29 80 out0 (127), a ; ED 39 7F out0 (127), b ; ED 01 7F out0 (127), c ; ED 09 7F out0 (127), d ; ED 11 7F out0 (127), e ; ED 19 7F out0 (127), h ; ED 21 7F out0 (127), l ; ED 29 7F out0 (255), a ; ED 39 FF out0 (255), b ; ED 01 FF out0 (255), c ; ED 09 FF out0 (255), d ; ED 11 FF out0 (255), e ; ED 19 FF out0 (255), h ; ED 21 FF out0 (255), l ; ED 29 FF outd ; ED AB outi ; ED A3 pchl ; E9 pop af ; F1 pop b ; C1 pop bc ; C1 pop d ; D1 pop de ; D1 pop h ; E1 pop hl ; E1 pop ix ; FD E1 pop iy ; DD E1 pop psw ; F1 push af ; F5 push b ; C5 push bc ; C5 push d ; D5 push de ; D5 push h ; E5 push hl ; E5 push ix ; FD E5 push iy ; DD E5 push psw ; F5 ral ; 17 rar ; 1F rc ; D8 rdel ; CB 13 CB 12 res 0, (hl) ; CB 86 res 0, (ix) ; FD CB 00 86 res 0, (ix+127) ; FD CB 7F 86 res 0, (ix-128) ; FD CB 80 86 res 0, (iy) ; DD CB 00 86 res 0, (iy+127) ; DD CB 7F 86 res 0, (iy-128) ; DD CB 80 86 res 0, a ; CB 87 res 0, b ; CB 80 res 0, c ; CB 81 res 0, d ; CB 82 res 0, e ; CB 83 res 0, h ; CB 84 res 0, l ; CB 85 res 1, (hl) ; CB 8E res 1, (ix) ; FD CB 00 8E res 1, (ix+127) ; FD CB 7F 8E res 1, (ix-128) ; FD CB 80 8E res 1, (iy) ; DD CB 00 8E res 1, (iy+127) ; DD CB 7F 8E res 1, (iy-128) ; DD CB 80 8E res 1, a ; CB 8F res 1, b ; CB 88 res 1, c ; CB 89 res 1, d ; CB 8A res 1, e ; CB 8B res 1, h ; CB 8C res 1, l ; CB 8D res 2, (hl) ; CB 96 res 2, (ix) ; FD CB 00 96 res 2, (ix+127) ; FD CB 7F 96 res 2, (ix-128) ; FD CB 80 96 res 2, (iy) ; DD CB 00 96 res 2, (iy+127) ; DD CB 7F 96 res 2, (iy-128) ; DD CB 80 96 res 2, a ; CB 97 res 2, b ; CB 90 res 2, c ; CB 91 res 2, d ; CB 92 res 2, e ; CB 93 res 2, h ; CB 94 res 2, l ; CB 95 res 3, (hl) ; CB 9E res 3, (ix) ; FD CB 00 9E res 3, (ix+127) ; FD CB 7F 9E res 3, (ix-128) ; FD CB 80 9E res 3, (iy) ; DD CB 00 9E res 3, (iy+127) ; DD CB 7F 9E res 3, (iy-128) ; DD CB 80 9E res 3, a ; CB 9F res 3, b ; CB 98 res 3, c ; CB 99 res 3, d ; CB 9A res 3, e ; CB 9B res 3, h ; CB 9C res 3, l ; CB 9D res 4, (hl) ; CB A6 res 4, (ix) ; FD CB 00 A6 res 4, (ix+127) ; FD CB 7F A6 res 4, (ix-128) ; FD CB 80 A6 res 4, (iy) ; DD CB 00 A6 res 4, (iy+127) ; DD CB 7F A6 res 4, (iy-128) ; DD CB 80 A6 res 4, a ; CB A7 res 4, b ; CB A0 res 4, c ; CB A1 res 4, d ; CB A2 res 4, e ; CB A3 res 4, h ; CB A4 res 4, l ; CB A5 res 5, (hl) ; CB AE res 5, (ix) ; FD CB 00 AE res 5, (ix+127) ; FD CB 7F AE res 5, (ix-128) ; FD CB 80 AE res 5, (iy) ; DD CB 00 AE res 5, (iy+127) ; DD CB 7F AE res 5, (iy-128) ; DD CB 80 AE res 5, a ; CB AF res 5, b ; CB A8 res 5, c ; CB A9 res 5, d ; CB AA res 5, e ; CB AB res 5, h ; CB AC res 5, l ; CB AD res 6, (hl) ; CB B6 res 6, (ix) ; FD CB 00 B6 res 6, (ix+127) ; FD CB 7F B6 res 6, (ix-128) ; FD CB 80 B6 res 6, (iy) ; DD CB 00 B6 res 6, (iy+127) ; DD CB 7F B6 res 6, (iy-128) ; DD CB 80 B6 res 6, a ; CB B7 res 6, b ; CB B0 res 6, c ; CB B1 res 6, d ; CB B2 res 6, e ; CB B3 res 6, h ; CB B4 res 6, l ; CB B5 res 7, (hl) ; CB BE res 7, (ix) ; FD CB 00 BE res 7, (ix+127) ; FD CB 7F BE res 7, (ix-128) ; FD CB 80 BE res 7, (iy) ; DD CB 00 BE res 7, (iy+127) ; DD CB 7F BE res 7, (iy-128) ; DD CB 80 BE res 7, a ; CB BF res 7, b ; CB B8 res 7, c ; CB B9 res 7, d ; CB BA res 7, e ; CB BB res 7, h ; CB BC res 7, l ; CB BD ret ; C9 ret c ; D8 ret m ; F8 ret nc ; D0 ret nv ; E0 ret nz ; C0 ret p ; F0 ret pe ; E8 ret po ; E0 ret v ; E8 ret z ; C8 reti ; ED 4D retn ; ED 45 rl (hl) ; CB 16 rl (ix) ; FD CB 00 16 rl (ix+127) ; FD CB 7F 16 rl (ix-128) ; FD CB 80 16 rl (iy) ; DD CB 00 16 rl (iy+127) ; DD CB 7F 16 rl (iy-128) ; DD CB 80 16 rl a ; CB 17 rl b ; CB 10 rl bc ; CB 11 CB 10 rl c ; CB 11 rl d ; CB 12 rl de ; CB 13 CB 12 rl e ; CB 13 rl h ; CB 14 rl hl ; CB 15 CB 14 rl l ; CB 15 rla ; 17 rlc ; 07 rlc (hl) ; CB 06 rlc (ix) ; FD CB 00 06 rlc (ix+127) ; FD CB 7F 06 rlc (ix-128) ; FD CB 80 06 rlc (iy) ; DD CB 00 06 rlc (iy+127) ; DD CB 7F 06 rlc (iy-128) ; DD CB 80 06 rlc a ; CB 07 rlc b ; CB 00 rlc c ; CB 01 rlc d ; CB 02 rlc e ; CB 03 rlc h ; CB 04 rlc l ; CB 05 rlca ; 07 rld ; ED 6F rlde ; CB 13 CB 12 rm ; F8 rnc ; D0 rnv ; E0 rnz ; C0 rp ; F0 rpe ; E8 rpo ; E0 rr (hl) ; CB 1E rr (ix) ; FD CB 00 1E rr (ix+127) ; FD CB 7F 1E rr (ix-128) ; FD CB 80 1E rr (iy) ; DD CB 00 1E rr (iy+127) ; DD CB 7F 1E rr (iy-128) ; DD CB 80 1E rr a ; CB 1F rr b ; CB 18 rr bc ; CB 18 CB 19 rr c ; CB 19 rr d ; CB 1A rr de ; CB 1A CB 1B rr e ; CB 1B rr h ; CB 1C rr hl ; CB 1C CB 1D rr l ; CB 1D rra ; 1F rrc ; 0F rrc (hl) ; CB 0E rrc (ix) ; FD CB 00 0E rrc (ix+127) ; FD CB 7F 0E rrc (ix-128) ; FD CB 80 0E rrc (iy) ; DD CB 00 0E rrc (iy+127) ; DD CB 7F 0E rrc (iy-128) ; DD CB 80 0E rrc a ; CB 0F rrc b ; CB 08 rrc c ; CB 09 rrc d ; CB 0A rrc e ; CB 0B rrc h ; CB 0C rrc l ; CB 0D rrca ; 0F rrd ; ED 67 rrhl ; CB 2C CB 1D rst 0 ; C7 rst 1 ; CF rst 16 ; D7 rst 2 ; D7 rst 24 ; DF rst 3 ; DF rst 32 ; E7 rst 4 ; E7 rst 40 ; EF rst 48 ; F7 rst 5 ; EF rst 56 ; FF rst 6 ; F7 rst 7 ; FF rst 8 ; CF rv ; E8 rz ; C8 sbb a ; 9F sbb b ; 98 sbb c ; 99 sbb d ; 9A sbb e ; 9B sbb h ; 9C sbb l ; 9D sbb m ; 9E sbc (hl) ; 9E sbc (hl+) ; 9E 23 sbc (hl-) ; 9E 2B sbc (ix) ; FD 9E 00 sbc (ix+127) ; FD 9E 7F sbc (ix-128) ; FD 9E 80 sbc (iy) ; DD 9E 00 sbc (iy+127) ; DD 9E 7F sbc (iy-128) ; DD 9E 80 sbc -128 ; DE 80 sbc 127 ; DE 7F sbc 255 ; DE FF sbc a ; 9F sbc a, (hl) ; 9E sbc a, (hl+) ; 9E 23 sbc a, (hl-) ; 9E 2B sbc a, (ix) ; FD 9E 00 sbc a, (ix+127) ; FD 9E 7F sbc a, (ix-128) ; FD 9E 80 sbc a, (iy) ; DD 9E 00 sbc a, (iy+127) ; DD 9E 7F sbc a, (iy-128) ; DD 9E 80 sbc a, -128 ; DE 80 sbc a, 127 ; DE 7F sbc a, 255 ; DE FF sbc a, a ; 9F sbc a, b ; 98 sbc a, c ; 99 sbc a, d ; 9A sbc a, e ; 9B sbc a, h ; 9C sbc a, l ; 9D sbc b ; 98 sbc c ; 99 sbc d ; 9A sbc e ; 9B sbc h ; 9C sbc hl, bc ; ED 42 sbc hl, de ; ED 52 sbc hl, hl ; ED 62 sbc hl, sp ; ED 72 sbc l ; 9D sbi -128 ; DE 80 sbi 127 ; DE 7F sbi 255 ; DE FF scf ; 37 set 0, (hl) ; CB C6 set 0, (ix) ; FD CB 00 C6 set 0, (ix+127) ; FD CB 7F C6 set 0, (ix-128) ; FD CB 80 C6 set 0, (iy) ; DD CB 00 C6 set 0, (iy+127) ; DD CB 7F C6 set 0, (iy-128) ; DD CB 80 C6 set 0, a ; CB C7 set 0, b ; CB C0 set 0, c ; CB C1 set 0, d ; CB C2 set 0, e ; CB C3 set 0, h ; CB C4 set 0, l ; CB C5 set 1, (hl) ; CB CE set 1, (ix) ; FD CB 00 CE set 1, (ix+127) ; FD CB 7F CE set 1, (ix-128) ; FD CB 80 CE set 1, (iy) ; DD CB 00 CE set 1, (iy+127) ; DD CB 7F CE set 1, (iy-128) ; DD CB 80 CE set 1, a ; CB CF set 1, b ; CB C8 set 1, c ; CB C9 set 1, d ; CB CA set 1, e ; CB CB set 1, h ; CB CC set 1, l ; CB CD set 2, (hl) ; CB D6 set 2, (ix) ; FD CB 00 D6 set 2, (ix+127) ; FD CB 7F D6 set 2, (ix-128) ; FD CB 80 D6 set 2, (iy) ; DD CB 00 D6 set 2, (iy+127) ; DD CB 7F D6 set 2, (iy-128) ; DD CB 80 D6 set 2, a ; CB D7 set 2, b ; CB D0 set 2, c ; CB D1 set 2, d ; CB D2 set 2, e ; CB D3 set 2, h ; CB D4 set 2, l ; CB D5 set 3, (hl) ; CB DE set 3, (ix) ; FD CB 00 DE set 3, (ix+127) ; FD CB 7F DE set 3, (ix-128) ; FD CB 80 DE set 3, (iy) ; DD CB 00 DE set 3, (iy+127) ; DD CB 7F DE set 3, (iy-128) ; DD CB 80 DE set 3, a ; CB DF set 3, b ; CB D8 set 3, c ; CB D9 set 3, d ; CB DA set 3, e ; CB DB set 3, h ; CB DC set 3, l ; CB DD set 4, (hl) ; CB E6 set 4, (ix) ; FD CB 00 E6 set 4, (ix+127) ; FD CB 7F E6 set 4, (ix-128) ; FD CB 80 E6 set 4, (iy) ; DD CB 00 E6 set 4, (iy+127) ; DD CB 7F E6 set 4, (iy-128) ; DD CB 80 E6 set 4, a ; CB E7 set 4, b ; CB E0 set 4, c ; CB E1 set 4, d ; CB E2 set 4, e ; CB E3 set 4, h ; CB E4 set 4, l ; CB E5 set 5, (hl) ; CB EE set 5, (ix) ; FD CB 00 EE set 5, (ix+127) ; FD CB 7F EE set 5, (ix-128) ; FD CB 80 EE set 5, (iy) ; DD CB 00 EE set 5, (iy+127) ; DD CB 7F EE set 5, (iy-128) ; DD CB 80 EE set 5, a ; CB EF set 5, b ; CB E8 set 5, c ; CB E9 set 5, d ; CB EA set 5, e ; CB EB set 5, h ; CB EC set 5, l ; CB ED set 6, (hl) ; CB F6 set 6, (ix) ; FD CB 00 F6 set 6, (ix+127) ; FD CB 7F F6 set 6, (ix-128) ; FD CB 80 F6 set 6, (iy) ; DD CB 00 F6 set 6, (iy+127) ; DD CB 7F F6 set 6, (iy-128) ; DD CB 80 F6 set 6, a ; CB F7 set 6, b ; CB F0 set 6, c ; CB F1 set 6, d ; CB F2 set 6, e ; CB F3 set 6, h ; CB F4 set 6, l ; CB F5 set 7, (hl) ; CB FE set 7, (ix) ; FD CB 00 FE set 7, (ix+127) ; FD CB 7F FE set 7, (ix-128) ; FD CB 80 FE set 7, (iy) ; DD CB 00 FE set 7, (iy+127) ; DD CB 7F FE set 7, (iy-128) ; DD CB 80 FE set 7, a ; CB FF set 7, b ; CB F8 set 7, c ; CB F9 set 7, d ; CB FA set 7, e ; CB FB set 7, h ; CB FC set 7, l ; CB FD shld -32768 ; 22 00 80 shld 32767 ; 22 FF 7F shld 65535 ; 22 FF FF sla (hl) ; CB 26 sla (ix) ; FD CB 00 26 sla (ix+127) ; FD CB 7F 26 sla (ix-128) ; FD CB 80 26 sla (iy) ; DD CB 00 26 sla (iy+127) ; DD CB 7F 26 sla (iy-128) ; DD CB 80 26 sla a ; CB 27 sla b ; CB 20 sla c ; CB 21 sla d ; CB 22 sla e ; CB 23 sla h ; CB 24 sla l ; CB 25 sli (hl) ; CB 36 sli (ix) ; FD CB 00 36 sli (ix+127) ; FD CB 7F 36 sli (ix-128) ; FD CB 80 36 sli (iy) ; DD CB 00 36 sli (iy+127) ; DD CB 7F 36 sli (iy-128) ; DD CB 80 36 sli a ; CB 37 sli b ; CB 30 sli c ; CB 31 sli d ; CB 32 sli e ; CB 33 sli h ; CB 34 sli l ; CB 35 sll (hl) ; CB 36 sll (ix) ; FD CB 00 36 sll (ix+127) ; FD CB 7F 36 sll (ix-128) ; FD CB 80 36 sll (iy) ; DD CB 00 36 sll (iy+127) ; DD CB 7F 36 sll (iy-128) ; DD CB 80 36 sll a ; CB 37 sll b ; CB 30 sll c ; CB 31 sll d ; CB 32 sll e ; CB 33 sll h ; CB 34 sll l ; CB 35 slp ; ED 76 sls (hl) ; CB 36 sls (ix) ; FD CB 00 36 sls (ix+127) ; FD CB 7F 36 sls (ix-128) ; FD CB 80 36 sls (iy) ; DD CB 00 36 sls (iy+127) ; DD CB 7F 36 sls (iy-128) ; DD CB 80 36 sls a ; CB 37 sls b ; CB 30 sls c ; CB 31 sls d ; CB 32 sls e ; CB 33 sls h ; CB 34 sls l ; CB 35 sphl ; F9 sra (hl) ; CB 2E sra (ix) ; FD CB 00 2E sra (ix+127) ; FD CB 7F 2E sra (ix-128) ; FD CB 80 2E sra (iy) ; DD CB 00 2E sra (iy+127) ; DD CB 7F 2E sra (iy-128) ; DD CB 80 2E sra a ; CB 2F sra b ; CB 28 sra bc ; CB 28 CB 19 sra c ; CB 29 sra d ; CB 2A sra de ; CB 2A CB 1B sra e ; CB 2B sra h ; CB 2C sra hl ; CB 2C CB 1D sra l ; CB 2D srl (hl) ; CB 3E srl (ix) ; FD CB 00 3E srl (ix+127) ; FD CB 7F 3E srl (ix-128) ; FD CB 80 3E srl (iy) ; DD CB 00 3E srl (iy+127) ; DD CB 7F 3E srl (iy-128) ; DD CB 80 3E srl a ; CB 3F srl b ; CB 38 srl c ; CB 39 srl d ; CB 3A srl e ; CB 3B srl h ; CB 3C srl l ; CB 3D sta -32768 ; 32 00 80 sta 32767 ; 32 FF 7F sta 65535 ; 32 FF FF stax b ; 02 stax bc ; 02 stax d ; 12 stax de ; 12 stc ; 37 sub (hl) ; 96 sub (hl+) ; 96 23 sub (hl-) ; 96 2B sub (ix) ; FD 96 00 sub (ix+127) ; FD 96 7F sub (ix-128) ; FD 96 80 sub (iy) ; DD 96 00 sub (iy+127) ; DD 96 7F sub (iy-128) ; DD 96 80 sub -128 ; D6 80 sub 127 ; D6 7F sub 255 ; D6 FF sub a ; 97 sub a, (hl) ; 96 sub a, (hl+) ; 96 23 sub a, (hl-) ; 96 2B sub a, (ix) ; FD 96 00 sub a, (ix+127) ; FD 96 7F sub a, (ix-128) ; FD 96 80 sub a, (iy) ; DD 96 00 sub a, (iy+127) ; DD 96 7F sub a, (iy-128) ; DD 96 80 sub a, -128 ; D6 80 sub a, 127 ; D6 7F sub a, 255 ; D6 FF sub a, a ; 97 sub a, b ; 90 sub a, c ; 91 sub a, d ; 92 sub a, e ; 93 sub a, h ; 94 sub a, l ; 95 sub b ; 90 sub c ; 91 sub d ; 92 sub e ; 93 sub h ; 94 sub hl, bc ; CD @__z80asm__sub_hl_bc sub hl, de ; CD @__z80asm__sub_hl_de sub hl, hl ; CD @__z80asm__sub_hl_hl sub hl, sp ; CD @__z80asm__sub_hl_sp sub l ; 95 sub m ; 96 sui -128 ; D6 80 sui 127 ; D6 7F sui 255 ; D6 FF test (hl) ; ED 34 test (ix) ; FD ED 00 34 test (ix+127) ; FD ED 7F 34 test (ix-128) ; FD ED 80 34 test (iy) ; DD ED 00 34 test (iy+127) ; DD ED 7F 34 test (iy-128) ; DD ED 80 34 test -128 ; ED 64 80 test 127 ; ED 64 7F test 255 ; ED 64 FF test a ; ED 3C test a, (hl) ; ED 34 test a, (ix) ; FD ED 00 34 test a, (ix+127) ; FD ED 7F 34 test a, (ix-128) ; FD ED 80 34 test a, (iy) ; DD ED 00 34 test a, (iy+127) ; DD ED 7F 34 test a, (iy-128) ; DD ED 80 34 test a, -128 ; ED 64 80 test a, 127 ; ED 64 7F test a, 255 ; ED 64 FF test a, a ; ED 3C test a, b ; ED 04 test a, c ; ED 0C test a, d ; ED 14 test a, e ; ED 1C test a, h ; ED 24 test a, l ; ED 2C test b ; ED 04 test c ; ED 0C test d ; ED 14 test e ; ED 1C test h ; ED 24 test l ; ED 2C tst (hl) ; ED 34 tst (ix) ; FD ED 00 34 tst (ix+127) ; FD ED 7F 34 tst (ix-128) ; FD ED 80 34 tst (iy) ; DD ED 00 34 tst (iy+127) ; DD ED 7F 34 tst (iy-128) ; DD ED 80 34 tst -128 ; ED 64 80 tst 127 ; ED 64 7F tst 255 ; ED 64 FF tst a ; ED 3C tst a, (hl) ; ED 34 tst a, (ix) ; FD ED 00 34 tst a, (ix+127) ; FD ED 7F 34 tst a, (ix-128) ; FD ED 80 34 tst a, (iy) ; DD ED 00 34 tst a, (iy+127) ; DD ED 7F 34 tst a, (iy-128) ; DD ED 80 34 tst a, -128 ; ED 64 80 tst a, 127 ; ED 64 7F tst a, 255 ; ED 64 FF tst a, a ; ED 3C tst a, b ; ED 04 tst a, c ; ED 0C tst a, d ; ED 14 tst a, e ; ED 1C tst a, h ; ED 24 tst a, l ; ED 2C tst b ; ED 04 tst c ; ED 0C tst d ; ED 14 tst e ; ED 1C tst h ; ED 24 tst l ; ED 2C tstio -128 ; ED 74 80 tstio 127 ; ED 74 7F tstio 255 ; ED 74 FF xchg ; EB xor (hl) ; AE xor (hl+) ; AE 23 xor (hl-) ; AE 2B xor (ix) ; FD AE 00 xor (ix+127) ; FD AE 7F xor (ix-128) ; FD AE 80 xor (iy) ; DD AE 00 xor (iy+127) ; DD AE 7F xor (iy-128) ; DD AE 80 xor -128 ; EE 80 xor 127 ; EE 7F xor 255 ; EE FF xor a ; AF xor a, (hl) ; AE xor a, (hl+) ; AE 23 xor a, (hl-) ; AE 2B xor a, (ix) ; FD AE 00 xor a, (ix+127) ; FD AE 7F xor a, (ix-128) ; FD AE 80 xor a, (iy) ; DD AE 00 xor a, (iy+127) ; DD AE 7F xor a, (iy-128) ; DD AE 80 xor a, -128 ; EE 80 xor a, 127 ; EE 7F xor a, 255 ; EE FF xor a, a ; AF xor a, b ; A8 xor a, c ; A9 xor a, d ; AA xor a, e ; AB xor a, h ; AC xor a, l ; AD xor b ; A8 xor c ; A9 xor d ; AA xor e ; AB xor h ; AC xor l ; AD xra a ; AF xra b ; A8 xra c ; A9 xra d ; AA xra e ; AB xra h ; AC xra l ; AD xra m ; AE xri -128 ; EE 80 xri 127 ; EE 7F xri 255 ; EE FF xthl ; E3
; A024019: 2^n-n^9. ; 1,1,-508,-19675,-262128,-1953093,-10077632,-40353479,-134217472,-387419977,-999998976,-2357945643,-5159776256,-10604491181,-20661030400,-38443326607,-68719411200,-118587745425,-198359028224,-322687173491,-511998951424,-794277949429,-1207265023488,-1801144272855,-2641790763008,-3814663711193,-5429436570112,-7625463267259,-10578187517952,-14506609104957,-19681926258176,-26437474677023,-35180077121536,-46402894467361,-60699812897280,-78781278933507,-101491237191680,-129824300841605,-164941223355904,-208178605344871,-261044488372224,-325182911138409,-402273337338368,-493796518914635,-600529653465088,-721496270489293,-851821418491392,-978392984747439,-1071130483884032,-1065463644489137,-827225093157376,-82365359405203,1723693743734784,5707435662938859 mov $1,2 pow $1,$0 pow $0,9 add $0,1 sub $1,$0 add $1,1
#include "pch.h" #include "AssimpWrapper.h" #include "Mesh.h" #include "VertSignature.h" #include "SkeletalModel.h" #include "AnimChannel.h" const aiScene* AssimpWrapper::loadScene(Assimp::Importer& importer, const std::string& path, UINT pFlags) { assert(FileUtils::fileExists(path) && "File not accessible!"); const aiScene* scene = importer.ReadFile(path, pFlags); if (!scene || scene->mFlags == AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) { std::string errString("Assimp error: " + std::string(importer.GetErrorString())); OutputDebugStringA(errString.c_str()); return nullptr; } return scene; } std::vector<std::string> AssimpWrapper::loadTextureNames(const aiScene * scene) { std::vector<std::string> result; for (UINT i = 0; i < scene->mNumMaterials; ++i) { const aiMaterial* aiMat = scene->mMaterials[i]; for (TEX_TYPE_ROLE ttr : ASSIMP_TEX_TYPES) { UINT numTexThisType = aiMat->GetTextureCount(ttr.first); for (UINT i = 0; i < numTexThisType; ++i) { aiString str; aiMat->GetTexture(ttr.first, i, &str); result.push_back(std::string(str.C_Str())); } } } return result; } bool AssimpWrapper::loadEmbeddedTexture(Texture& texture, const aiScene* scene, const char* str) { const aiTexture* aiTex = scene->GetEmbeddedTexture(str); if (!aiTex) return false; UINT texSize = aiTex->mWidth; if (aiTex->mHeight != 0) //compressed textures could have height value of 0 texSize *= aiTex->mHeight; texture.loadFromMemory(nullptr, reinterpret_cast<unsigned char*>(aiTex->pcData), texSize); return true; } void AssimpWrapper::ImportAnimations(const aiScene* scene, std::vector<Animation>& outAnims) { if (!scene->HasAnimations()) return; for (int i = 0; i < scene->mNumAnimations; ++i) { auto sceneAnimation = scene->mAnimations[i]; int numChannels = sceneAnimation->mNumChannels; Animation anim(std::string(sceneAnimation->mName.data), sceneAnimation->mDuration, sceneAnimation->mTicksPerSecond, numChannels); for (int j = 0; j < numChannels; ++j) { aiNodeAnim* channel = sceneAnimation->mChannels[j]; AnimChannel ac(channel->mNumPositionKeys, channel->mNumRotationKeys, channel->mNumScalingKeys); ac._boneName = std::string(channel->mNodeName.C_Str()); for (uint32_t c = 0; c < channel->mNumScalingKeys; c++) ac._sKeys.emplace_back(SVec3(&channel->mScalingKeys[c].mValue.x), channel->mScalingKeys[c].mTime); for (uint32_t a = 0; a < channel->mNumPositionKeys; a++) ac._pKeys.emplace_back(SVec3(&channel->mPositionKeys[a].mValue.x), channel->mPositionKeys[a].mTime); for (uint32_t b = 0; b < channel->mNumRotationKeys; b++) { SQuat quat = aiQuatToSQuat(channel->mRotationKeys[b].mValue); quat = quat.w >= 0.f ? quat : -quat; ac._rKeys.emplace_back(quat, channel->mRotationKeys[b].mTime); } anim.addChannel(ac); } outAnims.push_back(anim); } } void AssimpWrapper::loadAllBoneNames(const aiScene* scene, aiNode* node, std::set<std::string>& boneNames) { for (UINT i = 0; i < node->mNumMeshes; ++i) { aiMesh* mesh = scene->mMeshes[node->mMeshes[i]]; for (UINT i = 0; i < mesh->mNumBones; ++i) { aiBone* bone = mesh->mBones[i]; boneNames.insert(std::string(bone->mName.C_Str())); } } for (UINT i = 0; i < node->mNumChildren; ++i) { loadAllBoneNames(scene, node->mChildren[i], boneNames); } } // Helpers void AssimpWrapper::correctAxes(const aiScene* aiScene) { int upAxis = 0; aiScene->mMetaData->Get<int>("UpAxis", upAxis); int upAxisSign = 1; aiScene->mMetaData->Get<int>("UpAxisSign", upAxisSign); int frontAxis = 0; aiScene->mMetaData->Get<int>("FrontAxis", frontAxis); int frontAxisSign = 1; aiScene->mMetaData->Get<int>("FrontAxisSign", frontAxisSign); int coordAxis = 0; aiScene->mMetaData->Get<int>("RightAxis", coordAxis); int coordAxisSign = 1; aiScene->mMetaData->Get<int>("RightAxisSign", coordAxisSign); aiVector3D upVec = upAxis == 0 ? aiVector3D(upAxisSign, 0, 0) : upAxis == 1 ? aiVector3D(0, upAxisSign, 0) : aiVector3D(0, 0, upAxisSign); aiVector3D forwardVec = frontAxis == 0 ? aiVector3D(frontAxisSign, 0, 0) : frontAxis == 1 ? aiVector3D(0, frontAxisSign, 0) : aiVector3D(0, 0, frontAxisSign); aiVector3D rightVec = coordAxis == 0 ? aiVector3D(coordAxisSign, 0, 0) : coordAxis == 1 ? aiVector3D(0, coordAxisSign, 0) : aiVector3D(0, 0, coordAxisSign); aiMatrix4x4 mat(rightVec.x, rightVec.y, rightVec.z, 0.0f, upVec.x, upVec.y, upVec.z, 0.0f, forwardVec.x, forwardVec.y, forwardVec.z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); aiScene->mRootNode->mTransformation = mat * aiScene->mRootNode->mTransformation; } std::vector<aiString> AssimpWrapper::getExtTextureNames(const aiScene* scene) { std::vector<aiString> result; for (UINT i = 0; i < scene->mNumMaterials; ++i) { aiMaterial* mat = scene->mMaterials[i]; result.push_back(aiString(std::string("Mat: ") + mat->GetName().C_Str())); for (int j = aiTextureType::aiTextureType_NONE; j <= aiTextureType_UNKNOWN; ++j) { aiTextureType curType = static_cast<aiTextureType>(j); UINT numTexturesOfType = mat->GetTextureCount(curType); for (UINT k = 0; k < numTexturesOfType; ++k) { aiString texPath; mat->GetTexture(curType, k, &texPath); const aiTexture* aiTex = scene->GetEmbeddedTexture(texPath.C_Str()); if (!aiTex) // Only interested in external for this function result.push_back(texPath); } } } return result; } SVec3 AssimpWrapper::calcFaceTangent(const std::vector<Vert3D>& vertices, const aiFace& face) { if (face.mNumIndices < 3) return SVec3(0, 0, 0); SVec3 tangent; SVec3 edge1, edge2; SVec2 duv1, duv2; //Find first texture coordinate edge 2d vector Vert3D v0 = vertices[face.mIndices[0]]; Vert3D v1 = vertices[face.mIndices[1]]; Vert3D v2 = vertices[face.mIndices[2]]; edge1 = v0.pos - v2.pos; edge2 = v2.pos - v1.pos; duv1 = v0.texCoords - v2.texCoords; duv2 = v2.texCoords - v1.texCoords; float f = 1.0f / (duv1.x * duv2.y - duv2.x * duv1.y); //Find tangent using both tex coord edges and position edges tangent.x = (duv1.y * edge1.x - duv2.y * edge2.x) * f; tangent.y = (duv1.y * edge1.y - duv2.y * edge2.y) * f; tangent.z = (duv1.y * edge1.z - duv2.y * edge2.z) * f; tangent.Normalize(); return tangent; } aiNode* AssimpWrapper::findModelNode(aiNode* node, SMatrix& meshRootTransform) { SMatrix locTrfm = aiMatToSMat(node->mTransformation); meshRootTransform = locTrfm * meshRootTransform; if (node->mNumMeshes > 0) return node; for (int i = 0; i < node->mNumChildren; ++i) { findModelNode(node->mChildren[i], meshRootTransform); } } SMatrix AssimpWrapper::getNodeGlobalTransform(const aiNode* node) { const aiNode* current = node; SMatrix concat = SMatrix::Identity; // c * p * pp * ppp * pppp... while (current) { SMatrix localTransform = aiMatToSMat(current->mTransformation); concat *= localTransform; current = current->mParent; } return concat; } bool AssimpWrapper::containsRiggedMeshes(const aiScene* scene) { for (int i = 0; i < scene->mNumMeshes; ++i) if (scene->mMeshes[i]->HasBones()) return true; return false; } UINT AssimpWrapper::countChildren(const aiNode* node) { UINT numChildren = node->mNumChildren; UINT result = numChildren; for (UINT i = 0; i < numChildren; ++i) result += countChildren(node->mChildren[i]); return result; }
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r9 push %rax push %rbx push %rcx push %rdx push %rsi lea addresses_normal_ht+0x12b19, %rdx nop nop nop nop xor $41577, %rax mov $0x6162636465666768, %rbx movq %rbx, (%rdx) and %rax, %rax lea addresses_A_ht+0xf719, %rcx nop sub %rsi, %rsi mov $0x6162636465666768, %r14 movq %r14, %xmm2 and $0xffffffffffffffc0, %rcx movaps %xmm2, (%rcx) nop nop nop nop nop xor %r14, %r14 lea addresses_A_ht+0x3f19, %rbx nop nop nop nop nop sub %r9, %r9 mov (%rbx), %ax nop nop nop nop nop and %rdx, %rdx lea addresses_WC_ht+0x9719, %rax nop nop nop nop nop xor $26816, %r14 vmovups (%rax), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rdx nop nop nop nop nop cmp %r14, %r14 lea addresses_normal_ht+0x1e999, %r14 nop nop nop nop nop xor %rdx, %rdx mov (%r14), %esi nop nop nop inc %r9 lea addresses_UC_ht+0xb31d, %r14 nop inc %rbx vmovups (%r14), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %rax nop nop dec %rbx lea addresses_WC_ht+0x13b19, %rbx nop nop nop nop nop xor $61687, %rax mov (%rbx), %r14d nop nop nop xor $51943, %rax lea addresses_WC_ht+0x11399, %rdx nop nop xor %rax, %rax movb $0x61, (%rdx) nop nop nop nop nop and %r14, %r14 lea addresses_WC_ht+0xb245, %rdx cmp $25183, %rcx movw $0x6162, (%rdx) nop nop nop nop cmp %rsi, %rsi lea addresses_A_ht+0x5b1, %r14 nop nop and $46878, %rcx mov $0x6162636465666768, %rax movq %rax, (%r14) nop nop sub $10080, %rdx lea addresses_normal_ht+0x3421, %rcx clflush (%rcx) nop nop nop nop nop cmp %rax, %rax movb $0x61, (%rcx) sub $26608, %rax pop %rsi pop %rdx pop %rcx pop %rbx pop %rax pop %r9 pop %r14 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %rax push %rbx push %rdi push %rsi // Store lea addresses_normal+0x11559, %r14 nop nop xor %rbx, %rbx movl $0x51525354, (%r14) nop inc %r15 // Store lea addresses_A+0x13cad, %rbx nop nop add %rsi, %rsi movl $0x51525354, (%rbx) nop nop inc %rsi // Store lea addresses_UC+0xc399, %rax nop nop nop nop xor $56430, %rdi mov $0x5152535455565758, %r13 movq %r13, %xmm6 vmovaps %ymm6, (%rax) nop nop nop nop inc %rdi // Store mov $0x7db, %r15 clflush (%r15) nop nop nop nop cmp %rdi, %rdi mov $0x5152535455565758, %rax movq %rax, %xmm6 vmovups %ymm6, (%r15) nop sub %r14, %r14 // Faulty Load lea addresses_RW+0x4719, %r14 nop nop nop nop dec %rsi mov (%r14), %bx lea oracles, %r14 and $0xff, %rbx shlq $12, %rbx mov (%r14,%rbx,1), %rbx pop %rsi pop %rdi pop %rbx pop %rax pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, '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 */
; Initialize the stack pointer MOV XL, 0xFF MOV XH, 0xFA MOV SP, X ; The offset value is stored in a register MOV G, 1 ; ================================================================= ; Indirect Memory Addressing with a register based positive offset ; ================================================================= MOV E, 10101010b MOV [SP + G], E MOV F, [SP + G] ; Write register F to the Output Port OUTB F ; ================================================================= ; Indirect Memory Addressing with a register based negative offset ; ================================================================= MOV D, 01010101b MOV [SP - G], D MOV H, [SP - G] ; Write register H to the Output Port OUTB H HLT
aLine 0 gNew currentPtr gMoveNext currentPtr, Root aLine 1 sInit i, 0 sBge i, {1:D}, 10 aLine 2 gBne currentPtr, null, 3 aLine 3 Exception NOT_FOUND aLine 5 gMoveNext currentPtr, currentPtr aLine 1 sInc i, 1 Jmp -9 aLine 7 gBne currentPtr, null, 3 aLine 8 Exception NOT_FOUND aLine 10 nNew newNodePtr, {0:D} gNewVPtr temp gMoveNext temp, currentPtr aLine 11 nMoveRel newNodePtr, currentPtr, 95, -164.545 pSetNext newNodePtr, temp aLine 12 pSetNext currentPtr, newNodePtr aLine 13 gDelete currentPtr gDelete temp gDelete newNodePtr aStd Halt