一个非常简单的组装问题

编程入门 行业动态 更新时间:2024-10-11 03:15:59
本文介绍了一个非常简单的组装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嘿 我是汇编程序设计的新手,我对汇编程序编程一无所知,在这个阶段,我只是想熟悉ADD, MOV, SUB等声明,但我不知道该如何运行我的简单代码??? 在我正在学习的书中,写道我应该这样做: 在Windows CMD中执行此操作,例如C:/> masm prog1,其中"prog1"是我的汇编代码文件,但是我给出此错误,指示''masm'' is not recognized as an internal or external command, operable program or batch file. 任何人都可以指导我解决这个简单的问题吗? 就像我之前说过的,我对汇编程序和汇编程序一无所知:)

hey I am totally new in assembly programming, and I don''t know anything about assembly programing and in this stage I''m just trying to get familiar with ADD, MOV, SUB and etc statements but i don''t know how can I run my simple codes??? In book which I''m studying from it, wrote that i should do this: In windows CMD do this e.g C:/> masm prog1 where " prog1 " is my assembly codes file, but i give this error which indicate that ''masm'' is not recognized as an internal or external command, operable program or batch file. Can any one guide me in this simple problem??? Like i said before i don''t know any thing about assemblers and assembling :)

推荐答案

您已经安装了汇编程序吗?如果没有,那将是一个好的开始! 如果是这样,它是否经过路径处理,以便Windows可以找到它?在命令提示符下,键入"path",然后按Enter.文件夹汇编程序可执行文件在该列表中吗? 我想我已经被告知每个Windows都有一个汇编器!!我需要安装一个吗??如果可以,我在哪里可以找到一个汇编器? 谢谢" 那可能是您正在考虑的装配体"!确实有很大的不同. :laugh: 您可以直接从Microsoft获得免费的非商业用途的MASM v8.0副本: Masm V8.0 [ ^ ] Have you installed an assembler? If not, that would be a good start! If so, is it pathed so that Windows can find it? In you command prompt, type "path" and press enter. Is the folder assembler executable is in on that list? "i guess i''ve been told that every windows has an assembler!! do i need to install one?? if so where can i find an assembler? thank you" That may be "Assemblies" you are thinking of! Very different thing indeed. :laugh: You can get a copy of MASM v8.0 free for non-commercial use direct from Microsoft: Masm V8.0[^]

一种方法是使用 C ++ 编辑器,例如 Visual Studio C ++ (快速版是免费的). 通过使用__asm关键字,您可以在 C ++ 函数内部编写汇编代码,这还将为您提供诸如使用调试器和断点的简洁功能. 用 C ++ 编写的简单汇编程序可能看起来像这样: One approach is to use a C++ editor, like Visual Studio C++ for example (the express edition is free). By using the __asm keyword you can write assembly code inside your C++ function and this will also give you neat things like the ability to use the debugger and breakpoints. A simple assembly program written in C++ could look something like this: int main(int argc, char *argv[]) { __asm { mov ax, 0 add ax, 1 } return 0; }

请注意,这种方法对于学习汇编很方便,但可能不适用于您的情况,请参考此列表 [ ^ ],以获得一堆指向不同汇编器的链接. 希望这会有所帮助, 弗雷德里克·博纳德(Fredrik Bornander)

Note that this approach is convenient for learning assembly but might not be applicable to your scenario, refer to this list[^] for a bunch of links to different assemblers. Hope this helps, Fredrik Bornander

更多推荐

一个非常简单的组装问题

本文发布于:2023-11-10 07:13:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574708.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:简单

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!