Author Topic: nasm directives  (Read 14323 times)

Offline ialmiev1

  • Jr. Member
  • *
  • Posts: 5
nasm directives
« on: April 30, 2020, 11:31:27 PM »
Hello,

i make first steps in learning nasm. i am not proficient in Assembly-laguage (only, some fundamentals). unfortunately, i did not find comprehensive (detailed) manual, or textbook, about nasm assembly-language, and its syntacsis.

anyway ... i read a explanatory manual in nasm Internet-page, and have the questions:
1) what does the term (word) "directive" means, in the phrases "user directives", and "primitive directives" ?
2) what does the phrase "assembly direcitives" mean ? 

please, explain in simple (and, may be, some  detailed) words.

thanks.

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: nasm directives
« Reply #1 on: April 30, 2020, 11:56:21 PM »
Chapter 6 of the user manual explains directives.

https://nasm.us/doc/nasmdoc6.html
My graphics card database: www.gpuzoo.com

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: nasm directives
« Reply #2 on: May 01, 2020, 12:45:57 AM »
Hello  ialmiev1,

Welcome to the forum.

Hi Debs. Thanks, but I think Chap. 6 is what's confusing him. Maybe...

A "directive" is an instruction to the assembler, rather than to the CPU like "mov" or "add" or "cmp". An example might be "extern". It tells Nasm not to expect a symbol in this file, niy yp tell the linker to look elsewhere for it. The "primitive" form is in square brackets:
[extern printf]
it takes only one parameter
the "user" form needs no brackets:
extern printf, scanf
... and will take multiple parameters.

My advice is not to make too big a mystery of this. It may be less complicated than it sounds.

If this doesn't answer your question, ask again...

Best,
Frank



Offline ialmiev1

  • Jr. Member
  • *
  • Posts: 5
Re: nasm directives
« Reply #3 on: May 04, 2020, 05:23:40 PM »
Hello, Frank Kotler,

thank you for your message. as far as i understand, you are the person, who has developed NASM-assembler , that is the Assembler-program (or, one could say - the Assembler-compiler), in particular, the realization of the Assembler-program/compiler both for Windows, and for Linux.

1) does Windows NASM-Assembler (program/compiler) differ from Linux NASM-Assembler (program/compiler) ? - i guess, the answer is "yes".

2) how do you develop Windows NASM (program/compiler), and Linux NASM (program/compiler) ? that is, what compiler (software), or IDE have you used to write the codes, in order to produce Windows NASM, and Linux NASM ?

so far, those are my questions, at the moment.

Thank you.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: nasm directives
« Reply #4 on: May 05, 2020, 03:11:01 AM »
Hi ialmiev1,

No, I am not the author of Nasm. I made some minor contributions a long time ago. Debs is a Nasm Developer, too.

The executables of Nasm for Windows and Nasm for Linux are different. They are built from the   same source code.

A long time ago, I used Borland's Bcc and D.J. Delorie's port of GCC. These days on Linux I use GCC to build it, but I don't have anything to do with development.

Best,
Frank


Offline ialmiev1

  • Jr. Member
  • *
  • Posts: 5
Re: nasm directives
« Reply #5 on: May 16, 2020, 05:05:22 PM »
Hello, Frank Kotler, and Debs3759,

ok, i understand you, in terms of bcc-, and gcc-compilers used for compiling Windows-, and Linux-versions of NASM source codes.

in the near past, i was taught, a little bit, MASM assembler-language based on the use of MASM "compiler"-program, 16-bit for DOS, using the emulator in Windows 7, 64-bit. from that i discovered that, for example, interrupts (int ...) are different, and, also, require different set-ups of the registers (ax, bx, cx, dx), etc.

i managed to install MASM32 32-bit version for Windows 7 (64-bit) either, but i do not know the syntaxes (language itself, and numbers used for interrupts, registers etc) of MASM32 "compiler"-program, because i did not find any books, and comprehensive manuals in MASM32 too.

at present, i am limited with Windows 7 (64-bit), because, unfortunately, i broke the BIOS in my computer, by issuing not-good (wrong) commands to alter the downlaoding boot order that was set-up in BIOS.

this is why, i would appreciate if you could recommend me some comprehensive books, and the manuals to learn, for example, NASM (and/or, if you can, MASM32) language (syntaxes, numbers, commands, instructions) for Windows 7, 64-bit.

thank you.



Offline ialmiev1

  • Jr. Member
  • *
  • Posts: 5
Re: nasm directives
« Reply #6 on: May 16, 2020, 06:15:56 PM »
Hello, Frank Kotler, and Debs3759,

NASMs for Windows, and for Linux, and, also, MASM32, and MASM 6.11 are different "compilers"-translators.

as i mentioned in the previous message, writing NASM code to create Win64-, or command line executable (application) differs from task to task too - i mean syntaxes.

for this reason, it would be worth for me to concentrate on learning, at present, just one case, namely, NASM for Windows 7 64-bit (syntaxes, commands, instructions, numbers, that are put in registers, etc.).

thank you.