what do I need to start writing in machine language? [closed]
I want to start learning the machine language, you know the 0010011 type language. What program if any, can I use to write in machine language? please, I know you guys are going to tell me that "there are better languages out there or why would you want to learn that" kind of comments. I am aware of that so please don't post any of those comments. thanks.
Bravo! I'm an old-time, long-time ASM programmer and the last one to sneer at your very worthy project. I still know that the Z-80 opcode for CALL is really 0xC9 (or, as you might put it, 1100 1001). In my opinion, you will benefit from the exercise.
I propose, though, that instead of starting with bits you start with assembly code. Then, when you get comfortable, it's a quick shift to machine language. You can do this easily with any version of Visual Studio and, I'd think, with any reasonable IDE.
EDIT So sorry: I should have said "any version of Visual Studio that compiles your program into machine code," meaning at least VS for C/C++. I know less than nothing about C#, but I have the impression that the C# compiler emits a translated version of your code in something called "Intermediate Language" (IL). Therefore (as I read it) there's no clean way to include assembly-language source code in a C# source program. There's a discussion of how to call a DLL from a C# program here:
http://www.codeproject.com/KB/cs/unmanage.aspx
Your easiest and best bet (maybe your only bet) is to install Visual Studio Express for C/C++ and then to explore the use of the .asm
directive:
http://msdn.microsoft.com/en-us/library/aa258994%28v=vs.60%29.aspx .
Stick with the C language; ignore the C++ language for now. You'll have to learn enough C to input, compile, and run a small C-language demo program (by convention and history this is a program called hello.c
that you can find anyplace). Then you can insert a section of .asm and work with the debugger to experiment with that section.
Yes, I said you'd benefit from the exercise, but I didn't say it would be easy -- it's difficult: you have to learn a lot about what's under the hood. The subject could reasonably be a one-semester course.
But you can do it, with persistence over time. That is precisely where the benefit lies.
Go for it!
You don't write 00010010. You need to study assembler for a specific CPU, and then find an assembler for that cpu and if you don't own this cpu - an emulator to run your assembly code against it.
People don't (usually) write in machine language, they write in assembly mnemonics and have the assembler generate the corresponding machine code. If you really want to write machine language, pick up a developer's manual for your processor such as Intel developer manuals.
If you want to learn using assembly, pick up a book such as Professional Assembly Programming by Wrox. You'll learn when it'd be useful to pick assembly over a higher level language.
I think you meant assembly language. Get yourself a PSOC board and google for ARM Assembly Language tutorial. Assembly can be really fun once you got used to it but debugging it can be a pain in the butt especially if you have multiple inner loop.
精彩评论