Dealing with source code

M

mistral

How to deal with source code? What format need be source files to
compile? I have source code on
html pages, or in .txt format (this is assembler, not c, but there is
no big difference, i think). What suitable editor to edit source code?
Notepad? What format source need be saved? I need compile Nasm source
into exe, parameters is:

nasmw -s -fbin -o filename.s filename.asm

should I run Nasm from MS-DOS window or from Run box?

m.
 
C

Cong Wang

How to deal with source code? What format need be source files to
compile? I have source code on
html pages, or in .txt format (this is assembler, not c, but there is
no big difference, i think). What suitable editor to edit source code?
Notepad? What format source need be saved? I need compile Nasm source
into exe, parameters is:

nasmw -s -fbin -o filename.s filename.asm

should I run Nasm from MS-DOS window or from Run box?

m.

It's off topic here.
It seems that you work in Microsoft Windows. You can, of course, run
that command in a MS-DOS window.
And you can edit the source code with UltraEdit.
 
P

pete

mistral said:
How to deal with source code? What format need be source files to
compile? I have source code on
html pages, or in .txt format (this is assembler, not c, but there is
no big difference, i think). What suitable editor to edit source code?
Notepad? What format source need be saved?

C programs are made of text files.
Some compilers expect the name of a C program file
to end in .c, that's specifically a dot followed by a lower case c.
There can also be other extensions on other filenames in a C program.
 
M

mistral

pete пиÑал(а):

mistral wrote:

How to deal with source code? What format need be source files to
compile? I have source code on html pages, or in .txt format (this is
assembler, not c, but there is no big difference, i think). What
suitable editor to edit source code? Notepad? What format source need
be saved?
C programs are made of text files.
Some compilers expect the name of a C program file
to end in .c, that's specifically a dot followed by a lower case c.
There can also be other extensions on other filenames in a C program.
-------

so, I just need save text file as with c extension, i.e. 'file.c'
(since this file type isn't registered in system, windows will save it
as file.c.txt) Same thing for nasm, i need save file as 'file.s'?

m.
 
P

pete

mistral said:
pete пиÑал(а):

mistral wrote:

How to deal with source code? What format need be source files to
compile? I have source code on html pages, or in .txt format (this is
assembler, not c, but there is no big difference, i think). What
suitable editor to edit source code? Notepad? What format source need
be saved?
so, I just need save text file as with c extension, i.e. 'file.c'
(since this file type isn't registered in system, windows will save it
as file.c.txt)

That won't work if the compiler is looking for file.c
You would need to find some way to end a file name with .c
Maybe you can register the file type
or maybe you can change the file name to file.c
after the editor saves the file as something else.
 
W

Walter Roberson

mistral said:
so, I just need save text file as with c extension, i.e. 'file.c'
(since this file type isn't registered in system, windows will save it
as file.c.txt)

Recently in one of the newsgroups someone suggested putting "" around
Windows filename to force Windows to accept it exactly as is.

Also, if you have windows show you the file extensions then
you can do a rename of the extension.
 
J

jussij

mistral said:
(since this file type isn't registered in system, windows will
save it as file.c.txt)

I suspect it is Notepad (or some other application) that is adding
the .txt extension to the file. Not Windows itself.

Jussi Jumppanen
Zeus For Windows - "The ultimate programmer's editor/IDE"
http://www.zeusedit.com
 
K

Keith Thompson

I suspect it is Notepad (or some other application) that is adding
the .txt extension to the file. Not Windows itself.

<OT>
Notepad doesn't add an extension if you specify a file name that
already has one. If you tell it to save to foo.c it will save to
foo.c . If you tell it to save to foo, it will save to foo.txt . If
you tell it to save to "foo" (with the quotation marks), it will save
to foo .

I would expect other Windows text editors and other program to behave
similarly.

I wouldn't use Notepad to edit C code, but I don't do Windows
programming, so I don't have an alternative to suggest.
</OT>
 
C

Coos Haak

Op 8 Oct 2006 18:53:44 -0700 schreef (e-mail address removed):
I suspect it is Notepad (or some other application) that is adding
the .txt extension to the file. Not Windows itself.

Jussi Jumppanen
Zeus For Windows - "The ultimate programmer's editor/IDE"
http://www.zeusedit.com

<OT>
No, it's really you, I'm sorry;-(
Tell Windows to show extensions and it will only add the .txt extension if
you didn't. If you tell it's file.c then it won't add a superfluous .txt.
As simple as that ;-)
</OT>
 
K

Keith Thompson

Coos Haak said:
Op 8 Oct 2006 18:53:44 -0700 schreef (e-mail address removed):

<OT>
No, it's really you, I'm sorry;-(
Tell Windows to show extensions and it will only add the .txt extension if
you didn't. If you tell it's file.c then it won't add a superfluous .txt.
As simple as that ;-)

Doesn't it do exactly the same thing whether you tell it to show
extensions or not?

I suspect the OP observed that Windows adds a ".txt" extension if
there's no '.' in the specified file name, and incorrectly assumed
that it would do so if there is a '.' in the specified file name.
 
M

mistral

(since this file type isn't registered in system, windows will
save it as file.c.txt)

I suspect it is Notepad (or some other application) that is adding
the .txt extension to the file. Not Windows itself.
<OT>
No, it's really you, I'm sorry;-(
Tell Windows to show extensions and it will only add the .txt extension if
you didn't. If you tell it's file.c then it won't add a superfluous .txt.
As simple as that ;-)
Doesn't it do exactly the same thing whether you tell it to show
extensions or not?
I suspect the OP observed that Windows adds a ".txt" extension if
there's no '.' in the specified file name, and incorrectly assumed
that it would do so if there is a '.' in the specified file name.

----------------------------

Just tried to test the issue again, windows provides c file:

File name: test.c
Save as type: Text Documents(*.txt)
Encoding: UTF-8

This c file have a text doc icon, though.

If selected option in 'Save as type' is 'All Files', this does not
affect on file type (importand when create html files). So probably
Save as type: Text Documents(*.txt) need be used.

m.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top