Regarding For Assembly Language
-
- Posts: 1
- Joined: Thu Sep 24, 2020 1:51 am
Regarding For Assembly Language
Hello All, Can anyone help to find best assembly language tutorial in free or paid version? I am an intern and working on some online projects where i need to explore more about assembly language. Please suggest me.
-
- Posts: 8
- Joined: Fri Jan 31, 2020 7:28 pm
Re: Regarding For Assembly Language
Tutorialspoint has a good tutorial for x86 Linux assembly programming. It teaches basic NASM syntax and concepts. https://www.tutorialspoint.com/assembly_programming/
MikeOS (a real-mode x86 OS) has a tutorial for developing applications for it (maybe it's easier for you): http://mikeos.sourceforge.net/handbook-appdev-asm.html
MikeOS also has an introduction to make an real mode OS from scratch (again, in x86): http://mikeos.sourceforge.net/write-your-own-os.html
You might need a VM to follow the tutorialspoint tutorial, and it's a good idea to use VM for the MikeOS ones.
MikeOS (a real-mode x86 OS) has a tutorial for developing applications for it (maybe it's easier for you): http://mikeos.sourceforge.net/handbook-appdev-asm.html
MikeOS also has an introduction to make an real mode OS from scratch (again, in x86): http://mikeos.sourceforge.net/write-your-own-os.html
You might need a VM to follow the tutorialspoint tutorial, and it's a good idea to use VM for the MikeOS ones.
Re: Regarding For Assembly Language
Hi,
I'd strongly suggest to take a look at flatassembler. It is one of the best assemblers out there, and its documentation has many useful examples and tutorials.
It also has a very friendly and helpful community, and they post tutorials regularly on their forum. You can find examples for literally everything, starting from a boot sector to a complete SDL game engine.
Cheers,
bzt
I'd strongly suggest to take a look at flatassembler. It is one of the best assemblers out there, and its documentation has many useful examples and tutorials.
It also has a very friendly and helpful community, and they post tutorials regularly on their forum. You can find examples for literally everything, starting from a boot sector to a complete SDL game engine.
Cheers,
bzt
Re: Regarding For Assembly Language
The problem with these different syntaxes is that once you start to use them you cannot switch. So people get locked into assemblers, and when and if they are no longer developped, the code will become useless or hard to build.
I use the TASM ideal mode (actually WASM, but it is TASM compatible). I think memory references should use [] and that offset should be used to indicate that you will use the address rather than the data. In NASM, just using a variable will translate to using the address. I have kind of prepared for this problem by always using segment overrides on memory operations even when not necessary as this should trigger errors when expecting an address. This also overrides the assume directive in ideal mode which can give unpredicatable results.
So, I think all these assembler variants are quite unfortunate.
I use the TASM ideal mode (actually WASM, but it is TASM compatible). I think memory references should use [] and that offset should be used to indicate that you will use the address rather than the data. In NASM, just using a variable will translate to using the address. I have kind of prepared for this problem by always using segment overrides on memory operations even when not necessary as this should trigger errors when expecting an address. This also overrides the assume directive in ideal mode which can give unpredicatable results.
So, I think all these assembler variants are quite unfortunate.
Re: Regarding For Assembly Language
I'm not sure if I understand you right.rdos wrote:In NASM, just using a variable will translate to using the address.
I think
Code: Select all
mov rsi, label1
Code: Select all
mov rsi, [label1]
EDIT: Maybe you mean MASM/TASM?
Greetings
Peter
Re: Regarding For Assembly Language
I can only speak for myself, but for me this was never an issue.rdos wrote:The problem with these different syntaxes is that once you start to use them you cannot switch.
I've started Assembly for x86 with MASM, then I switched to TASM. I've used that for a long time. Then when I migrated to Linux, I've played a bit with NASM, but that wasn't for my liking really. These days I'm using FASM (Intel-like) and GAS (AT&T) regularly in parallel, and I have no issues whatsoever with the different syntax (except that FASM's syntax is far more superior, I miss a lot in GAS, but I can always manage).
Sounds more like GAS I think.PeterX wrote:EDIT: Maybe you mean MASM/TASM?
Cheers,
bzt
Re: Regarding For Assembly Language
I kind of agree with this. The only assembler I’ve ever really done is on the 68000, and the convention there is opcode.size source, destination (linguistically it’s the imperative in English: Verb subject object - Add D0 to D1 ) so over the past month where I’ve been doing a lot of x86 I’ve found AT&T syntax much easier than Intel syntax. I only use GAS which supports both styles, but I find it so much slower to parse Intel syntax.rdos wrote:The problem with these different syntaxes is that once you start to use them you cannot switch.
A good asm coder would have no problem reading either.
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Discord:https://discord.gg/zn2vV2Su
Re: Regarding For Assembly Language
I had a look at it and it is impressing. For example they have a gtk GUI example. And many other examples.bzt wrote:I'd strongly suggest to take a look at flatassembler. It is one of the best assemblers out there, and its documentation has many useful examples and tutorials.
It also has a very friendly and helpful community, and they post tutorials regularly on their forum. You can find examples for literally everything, starting from a boot sector to a complete SDL game engine.t
rdos is probably right, because I still won't shift from Nasm to Fasm.
But it is possible to understand different Assemblers and different syntaxes. I can read AT&T syntax despite being a Nasm user/fan. I can recommend the method I mentioned elsewhere: Try very hard to understand the different syntax (and fail) and then put it aside for two weeks or whatever. Then try to understand it again. You will probably notice that your brain is more ready for the topic than it was before. Maybe you need more than two tries, but in the end it works (for you, too, I hope). So I learned to read Lisp. And I must say first Lisp was a kind of parenthesis hell for me...!
Greetings
Peter
Re: Regarding For Assembly Language
I may very well do that myself. I like things about Nasm and it's very widely praised, but Nasm's forum is practially dead, probably because it requires completion of a painful captcha for every post. Besides, I've heard Fasm (the common name of flatassembler) has some technical advantages.bzt wrote:I'd strongly suggest to take a look at flatassembler. It is one of the best assemblers out there, and its documentation has many useful examples and tutorials.
It also has a very friendly and helpful community, and they post tutorials regularly on their forum. You can find examples for literally everything, starting from a boot sector to a complete SDL game engine.
Switching anything you use daily is an interesting topic with neurological and psychological aspects. I had trouble with keyboards. Occasionally I still do. To some extent it's possible to improve your switching skills, but mostly I think that's just a case of learning not to confuse the separate... muscle memories. We need a term for things which are exactly like muscle memory but not related to actual muscles.rdos wrote:The problem with these different syntaxes is that once you start to use them you cannot switch.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Regarding For Assembly Language
I could name it reflexes or instincts. But you probably mean the unconscious, the automatisms.eekee wrote:Switching anything you use daily is an interesting topic with neurological and psychological aspects. I had trouble with keyboards. Occasionally I still do. To some extent it's possible to improve your switching skills, but mostly I think that's just a case of learning not to confuse the separate... muscle memories. We need a term for things which are exactly like muscle memory but not related to actual muscles.rdos wrote:The problem with these different syntaxes is that once you start to use them you cannot switch.
All I can say is: The human mind can learn many things. And it seems to me that there are four rewards when you are programming:
(a) Learning new things and (b) achieving results. And maybe (c) the process of coding and (d) the process of planning and designing.
I suggest to every Asm coder trying to learn both Asm syntaxes.
Also note that someone implemented into Gas 99% compatibility with Nasm (including Intel syntax).
Greetings
Peter
Re: Regarding For Assembly Language
Indeed it has!eekee wrote:Besides, I've heard Fasm (the common name of flatassembler) has some technical advantages.
- It is written in fasm, compiles itself
- Being written in Assembly, extremely fast (I mean seriously, VERY VERY fast)
- Supports virtually all formats (ELF, PE, COFF, AOUT etc. etc. etc.)
- Easy to port (available for Win, Linux, MacOS, BSDs, and there's a special bootstrap version which only needs to be linked with your OS' libc)
- Comes with a powerful IDE (sadly Win only)
- Full instruction support, up to the latest CPU features
- It's macro system is one of the best I've ever seen, and I've seen a lot. I calculate BIOS ROM checksum with its macros on-the-fly for example
Cheers,
bzt
Re: Regarding For Assembly Language
It's not so much the psychological aspect of learning something new rather that the code you already wrote doesn't compile or even worse, compile but then doesn't work since the new assembler has different rules.eekee wrote:Switching anything you use daily is an interesting topic with neurological and psychological aspects. I had trouble with keyboards. Occasionally I still do. To some extent it's possible to improve your switching skills, but mostly I think that's just a case of learning not to confuse the separate... muscle memories. We need a term for things which are exactly like muscle memory but not related to actual muscles.rdos wrote:The problem with these different syntaxes is that once you start to use them you cannot switch.
An example is this:
mov eax,some_var
In TASM syntax this means load eax with the value of some_var while in nasm it means load eax with the address of some_var. Both of these assemble correctly in both TASM and NASM, but produce different code. So, if you have a large codebase in TASM syntax you cannot switch to NASM if you use this syntax since you would need to go through every line of code and check memory references.
FASM seems completely useless since it only produces flat binaries. Even if it didn't, letting the assembler rather than the linker produce the executable is generally a bad idea.
Re: Regarding For Assembly Language
So by "switching" you don't meant a programmer multiplexing between projects with different syntax, but actually converting codebases? I can assure you, that sucks with all languages and syntaxes, no matter what.rdos wrote:So, if you have a large codebase in TASM syntax you cannot switch to NASM if you use this syntax since you would need to go through every line of code and check memory references.
Now where did you get that? FASM can generate lot more kind of object files than NASM. Look up "format" directive in the documentation.rdos wrote:FASM seems completely useless since it only produces flat binaries.
First, why? Second you can produce linkable objects just as well as executables, DLLs and shared objects. Just a matter which options you use for the "format" directive.rdos wrote:Even if it didn't, letting the assembler rather than the linker produce the executable is generally a bad idea.
Here is an example which produces an .obj file then links it with an MSVC compiled .obj to produce the final executable.
Cheers,
bzt
Re: Regarding For Assembly Language
http://flatassembler.net/docs.php?artic ... _manual#14 says:bzt wrote:Now where did you get that? FASM can generate lot more kind of object files than NASM. Look up "format" directive in the documentation.
I hope this is outdated and false.Currently the only available choice is "format binary"
Greetings
Peter
Re: Regarding For Assembly Language
I think that manual you pointed to is for fasmg.PeterX wrote:http://flatassembler.net/docs.php?artic ... _manual#14 says:bzt wrote:Now where did you get that? FASM can generate lot more kind of object files than NASM. Look up "format" directive in the documentation.I hope this is outdated and false.Currently the only available choice is "format binary"
Greetings
Peter