为什么我在mov [edx],al?(Why do i get access violation at mov [edx], al?)
我在Visual Studio中编写此代码,但我不知道为什么它会在mov [edx]上获得访问冲突。 任何人都可以帮我解释一下吗?
int main() { char z[10] = "banana"; _asm { lea ecx, z; mov edx, [ecx]; inc edx; mov [ecx], edx; dec edx; mov al, 31; mov [edx], al; mov eax, 31; and eax, 0FFh } }
I write this code in Visual Studio, but i don't know why it get access violation at mov [edx], al. Can anyone help me to explain it?
int main() { char z[10] = "banana"; _asm { lea ecx, z; mov edx, [ecx]; inc edx; mov [ecx], edx; dec edx; mov al, 31; mov [edx], al; mov eax, 31; and eax, 0FFh } }
原文:https://stackoverflow.com/questions/27200770
更新时间:2021-11-30 17:11
最满意答案
你应该这样检查一下
if (typeof model != "undefined" && model.name != undefined && model.name.givenName != undefined ) { ... }
它与Javascript的奇怪语法有关。
you should check like this
if (typeof model != "undefined" && model.name != undefined && model.name.givenName != undefined ) { ... }
it has something to do with Javascript's weird grammar.
相关问答
更多-
你应该这样检查一下 if (typeof model != "undefined" && model.name != undefined && model.name.givenName != undefined ) { ... } 它与Javascript的奇怪语法有关。 you should check like this if (typeof model != "undefined" && model.name != undefined && model.name.givenName != u ...
-
您提供视图但未被识别为Backbone / Marionette选项的任何参数都将附加到视图中的this.options 。 因此,您应该可以通过访问this.options.variationView来访问this.options.variationView 。 如果需要在模板中访问该信息,则需要通过编写serializeData函数来传递它。 你可以在这里看到一个这样的例子: https : //github.com/davidsulc/marionette-gentle-introduction/bl ...
-
你做什么有一些问题: 当你这样做时: // Run code var collection = new App.Collection; var view = new App.View({model: collection.at(0)}); $('#container').html(view.render().el); collection.fetch(); 首先,您创建集合。 它还没有任何与之相关的模型。 所以当下一次你使用集合的第一个尚不存在的模型初始化视图时。 正确的方法是获取()集合以及何时完成创建 ...
-
你有一个共同的“我在另一个变量中有一个变量名”问题,解决方案与以往一样:在查找表(即JavaScript中的对象)中按名称查找需要的东西。 在你的情况下,我不会_.extend(attributes, {animalTypes:animalTypes}); 将所有内容混合成一堆,我会将attributes和animalTypes分开,以便您的_.template调用如下所示: var tmpl = _.template(template); var html = tmpl({ animalTypes ...
-
Marionettejs Routes(Marionettejs Routes)[2023-01-20]
看起来你错过了对路由器控制器的引用。 尝试更新路由器以包含对myController的引用: App.Router = Marionette.AppRouter.extend({ controller: myController, appRoutes: { "home": "home" } }); 有关更多信息,请参阅AppRouter文档: http ://marionettejs.com/docs/v2.4.1/marionette.approuter.h ... -
MarionetteJS和CompositeView - 如何呈现自定义表头(MarionetteJS & CompositeView - How to render custom table headers)[2024-01-08]
您可以在此compositeView中存储额外数据,然后在模板中使用它。 请允许我在下面使用CoffeeScript。 第1步:获取数据并将其存储在上下文变量中,例如this.headers initialize: -> @headers = @collection.last().attributes.keys 第2步:使用内置的templateHelpers在templateHelpers templateHelpers -> view = @ # Use this line because c ... -
您创建布局的建议完全有效。 这是另一种选择。 Marionette应用程序很像一个支持多个区域的布局,因此您可以像这样定义您的应用程序: App.addRegions({ header: "#header", main: "#main" }); 如果main非常复杂,它也可以是具有嵌套区域的布局。 例如,如果您有侧边栏,内容和页脚,则可以按以下方式排列: app -> Marionette.Application header -> M ...
-
你有两个问题,一个你知道,另一个你不知道。 第一个问题是,当您只想替换其中一个时,您将替换所有三个_.templateSettings 。 你要这个: _.templateSettings.interpolate = /\{\{(.+?)\}\}/g; 这将仅留下_.templateSettings的evaluate和escape部分。 你正在做的是: _.templateSettings = { interpolate : /\{\{(.+?)\}\}/g, evaluate : unde ...
-
简短回答:在拥有该元素的视图中访问DOM。 然后使用它的trigger方法手动触发事件,传递父视图所需的操作结果。 我不是木偶专家,但一般来说,从其他视图直接访问一个视图的元素并不是一个好主意。 在子视图本身中执行需要DOM访问的操作,如果要访问事件对象,请使用events属性。 执行操作,然后使用trigger()方法触发事件父视图正在侦听。 这是一个来自具有类似结构的官方文档的示例 。 如果你必须直接访问该元素,那么你可以将它的引用作为trigger()方法中的参数传递。 但不建议这样做。 Short ...
-
这是Marionette还没有完成的事情。 我已经看到其他一些人一般会为Backbone解决这个问题,并且考虑到他们的解决方案可能很容易。 但希望有人会为你找到答案。 我很乐意看到一个附加组件或插件,或者为此向项目提取请求。 This is something that hasn't been baked in to Marionette, yet. I've seen a number of other people solve this for Backbone in general, and it m ...