NO

Author Topic: Beginner inline asm and asm question in general  (Read 2541 times)

64kram

  • Guest
Beginner inline asm and asm question in general
« on: April 06, 2016, 04:48:25 PM »
Hello, I just downloaded the latest PellesC 32 bit. My goal is to become proficient in c programming and assembly language. I have just an exposure to asm though.

I would like to know if someone can provide me with some simple inline assembly code snippets, that I can test out and learn from. I understand PellesC has it's own assembler. If you can perhaps show me a 'Hello World' example using the assembler and also the same example as an inline assembly in C, it will give me somewhere to start.

As a side question, how can I compare the assembler that comes with PellesC to something like NASM, I am reading up on big-endian, little-endian notes and etc. and I would better like to familiarize myself.

Then a question about tutorials and books. The majority of the books I find on Amazon have MASM as a requirement. I like my Windows computer, but I am not interested in software that is bundled with Visual Studio. This is just a personal preference. I like the idea of open source as well as maximum portability.

I am not new to C and I have a little practice in C++ as well, but as I said, I am new to asm and I would like to focus on C and asm with the ultimate goal eventually being system programming.

...way ahead of myself, but can you guys maybe recommend something about DOS operating system design? not msdos programming in general, but about os development related to DOS in general.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Beginner inline asm and asm question in general
« Reply #1 on: April 09, 2016, 02:49:07 AM »
Hello, I just downloaded the latest PellesC 32 bit. My goal is to become proficient in c programming and assembly language. I have just an exposure to asm though.
To be honest, I am not sure if using Pelle's C is the best choice for that. First and foremost, Pelle's C is a environment that is not only hosted on but also targeted for Windows. While you can avoid a lot of Windows specifics by compiling for a console application, but due to still being a Windows specific execuable, some Windows specifics do still apply when using Pelle's C (POASM) assembler...
Quote
I would like to know if someone can provide me with some simple inline assembly code snippets, that I can test out and learn from. I understand PellesC has it's own assembler. If you can perhaps show me a 'Hello World' example using the assembler and also the same example as an inline assembly in C, it will give me somewhere to start.
Directly, beside maybe some snippets already posted somewhere here in the forum (I haven't checked to be honest), the basics can be found in the Pelle's C IDE online help...
Quote
As a side question, how can I compare the assembler that comes with PellesC to something like NASM, I am reading up on big-endian, little-endian notes and etc. and I would better like to familiarize myself.
Well, maybe someone else can elaborate more, as I haven't really used POASM and personally loath NASM ("growing up with MASM syntax for x86 assembler since 1982), but as mentioned before, POASM is a part of a Windows targeting environment.
Quote
Then a question about tutorials and books. The majority of the books I find on Amazon have MASM as a requirement. I like my Windows computer, but I am not interested in software that is bundled with Visual Studio. This is just a personal preference. I like the idea of open source as well as maximum portability.
Portability is not easily achieved across different assemblers (and target OS), as NASM is IMHO a perfect example for.
If you are really intended for such low level kind of C and assembler development, you might want to check out OpenWatcom, with it's OpenWatom C(++) compiler, and the WASM assembler, though the whole project has been a bit in hibernation in the last couple of years. There is also an enhanced version of WASM, called JWasm (http://wiki.osdev.org/JWasm), which was originally done by a guy called "Japhet" (who unfortunately vanished from the face of the earth  :'( ). But this is Open Source and for that, the best MASM alternative available...
Quote
I am not new to C and I have a little practice in C++ as well, but as I said, I am new to asm and I would like to focus on C and asm with the ultimate goal eventually being system programming.
Just to repeat myself, Pelle's C is both Windows hosted and targeted...
Quote
...way ahead of myself, but can you guys maybe recommend something about DOS operating system design? not msdos programming in general, but about os development related to DOS in general.
There is no direct forum, only a couple mailing lists, but a lot of those kind of questions can probably be answered over at www.freedos.org (which I am, to various levels, participating with since it's inception).

Ralf