x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4563
Number of posts: 16029

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Nasm IDE Posted by jim_giboney on 6 Feb 2004 at 4:35 PM
Can anyone recommend me an IDE for Nasm? I tried Nasmide, but I had problems with it. Are there any others out there?

Thanks!
Report
Re: Nasm IDE Posted by jgmorford on 6 Feb 2004 at 7:50 PM
: Can anyone recommend me an IDE for Nasm? I tried Nasmide, but I had problems with it. Are there any others out there?
:
: Thanks!
:

RADASM is the best IDE I've found to date, as far as visual appeal goes.
I do all my assembling through batch files, but use this while editing
my sources. See the link below:

http://radasm.visualassembler.com/download/radasm.html

BTW: This IDE runs under Windows, not DOS (if it matters).
Report
Re: Nasm IDE Posted by Bitdog on 6 Feb 2004 at 8:43 PM
: Can anyone recommend me an IDE for Nasm? I tried Nasmide, but I had problems with it. Are there any others out there?
: Thanks!


I don't know everything, but it appears that you're trying to take the hardest route from point A to point B.
Intel syntax is difficult and not standard in the programming world
like Masm, Tasm, Nasm, Fasm, & many other great FreeBee assemblers.
Then, sifting through a mountian of bloat ware info help .doc's
just to assemble one little .asm to an .obj so you can link or make
a library is just about the worst and that's what happens with IDE's

The idea being that: the perfect mariage between a programmer and their computer is: let the computer do the remembering by holding refereance files,
then you are free to concentrate on your goal.
The other way around is where the computer fills your head with a mountian of info that you are suspose to remember, and the result is,
one is quickly overwhelmed with data, rendering him useless.

GCC & many other assembler/compilers, (if I remember correctly)
are almost impossible to under stand considering the bloat ware sifting
one has to do to get it to do anything. Where others just work.
If you know the guys favorite color before you know how to get the
software to work, delete it. Because the rest of the program is going to be the same.

Using the FreeBee assemblers available on the internet,
(Fasm & Nasm have simple info help doc's)
you can assemble little .BIN .COM files ORG 0
from a blank template you copy,
a batch file assembles it, to .OBJ
and you link it in as an extern into the compiler your familuar with.
Grouping .OBJ files into a .LIB library, basicly makes them portable
to other compilers & assemblers.

Different programs are nothing more than a bunch of the same little program parts
put together & used in different ways.

I hope that helps some how.
I wrote this because it seems real easy to get caught up in the endless loop
of haveing to remember names that others make up. Click names?
There's a million of them, yet there are only a few asm instructions,
and that's all you need to create great programs.
Just learn the standard instructions & screw the rest.

Bitdog




Report
Re: Nasm IDE Posted by ASHLEY4 on 7 Feb 2004 at 4:37 AM
Bitdog.
I could not have put it better my self, Asm is all about simplicity,look what happen's when you put a simple 0 and a simple 1 in a certain order .
Bloat wares is for C programmers.

ASHLEY4.
Report
Re: Nasm IDE Posted by AsmGuru62 on 7 Feb 2004 at 5:55 AM
: Bitdog.
: I could not have put it better my self, Asm is all about simplicity,look what happen's when you put a simple 0 and a simple 1 in a certain order .
: Bloat wares is for C programmers.
:
: ASHLEY4.
:
I disagree, obviously, and not because I am coding such IDE right now, but just because everyone thinks that ASM is for small projects only. Like school stuff - enter ten numbers, sort them and print them out, or reverse text you entered. How about serious projects on ASM? Obviosly, we need something to remember all functions, labels, structures and their members, constants, etc. when we do a big project - thousands of lines! We need to navigate in all that chaos and we need auto-complete to type code without looking for function names or their parameters. We need to move our code forward, we need to extend our code and reuse it - in other words we need OOP here. We need classes and virtual methods, inheritance, etc. And we need an ability to do it all fast. So, definitely, the good IDE is a MUST for a big project. Again, I am not talking about the school projects, just to get a taste of ASM...

Report
Re: Nasm IDE Posted by ASHLEY4 on 7 Feb 2004 at 7:15 AM
: : Bitdog.
: : I could not have put it better my self, Asm is all about simplicity,look what happen's when you put a simple 0 and a simple 1 in a certain order .
: : Bloat wares is for C programmers.
: :
: : ASHLEY4.
: :
: I disagree, obviously, and not because I am coding such IDE right now, but just because everyone thinks that ASM is for small projects only. Like school stuff - enter ten numbers, sort them and print them out, or reverse text you entered. How about serious projects on ASM? Obviosly, we need something to remember all functions, labels, structures and their members, constants, etc. when we do a big project - thousands of lines! We need to navigate in all that chaos and we need auto-complete to type code without looking for function names or their parameters. We need to move our code forward, we need to extend our code and reuse it - in other words we need OOP here. We need classes and virtual methods, inheritance, etc. And we need an ability to do it all fast. So, definitely, the good IDE is a MUST for a big project. Again, I am not talking about the school projects, just to get a taste of ASM...
:


There is no need to write large program. This only helps big software and hardware companies.
If the japanese owned MS the programs would get smaller every new release.
Take XP compared to MenuetOs 1gb v 500k (i dont mean that there is not a differance but there is not a gb's worth of differance)
All my programs are broken down in to small inc files .

ASHLEY4.
Report
Re: Nasm IDE Posted by Bitdog on 7 Feb 2004 at 9:47 AM
Quote "small inc files"

Now that's the ticket,
it's something you can see......(alter,use,add to,etc)
a code picture is worth a thousand bloatware words (er more).

We're counting on Asmguru62 to make a simplified referance help.
String searchable text files. (as apposed to bloat.pdf & html's)
& have exposed commented code, etc, THEN I'll convert to an IDE
working in on a ramdisk (where you loose your code at every lock)
like Windoze being DOS with a GUI on a RAMDISK, har har har.....
As soon as you get familuar with a MS product er OS they come out
with another one to stay on top of the $ heap,
and yer so happy to get the new system, because the old one was so bad.
Then ya find out that they are all built by folks who don't use it
them selves, there just in it for the money.
Their programs never evolved down to user friendly.
But oh well, what's another hundred bucks.
Just think of the hours of fun you'll have rearanging icons on the desk top.
It's that warm fuzzy feeling ya get when ya finally get the damn thing configgured.
Then on next boot, it reconfiggures it's self.

Bitdog.

PS, I wrote my first Fasm .asm for MenuetOS today, n it feels gud.
(even though a mini boot.bin read/writer is quite laufable....)


Report
Re: Nasm IDE Posted by descenterace on 7 Feb 2004 at 11:05 AM
I had an idea for a machine-code IDE. Basically, it puts stuff in three columns: segment address, opcodes, and mnemonics. The programmer can alter the opcode (in which case the IDE updates the mnemonic display) or he can change the mnemonic (in which case the IDE updates the opcodes). The result is an environment perfect for writing small hand-optimised code in x86 Machine Code.

I do this kind of thing in text files anyway: a column of addresses with opcodes and mnemonics beside them, updated and formatted by hand. But the IDE would recognise labels and automatically update jumps and variable references for me. And it'd eliminate the need for my hacked-up OPCODES.EXE C module which strips away the addresses, comments and mnemonics from the opcodes, then converts them to binary.
Ultimately, it'd just be a glorified text editor which saves in .LST and .COM format. Making it save in .EXE format could be a problem, because the documentation for multisegment (non-Windows) .EXEs is, um, insufficient...

Finally, THERE'S NOTHING WRONG WITH PROGRAMMING IN C! Or C++. But I do object to Java: a 'safety net' programming language for people who can't be bothered to clean up memory after themselves, and are also terrified of core dumps. It doesn't even have pointers! C is far more interesting, especially with the ever-useful #DEFINE instruction.
Report
Re: Nasm IDE Posted by _kulhas on 7 Feb 2004 at 6:18 PM
: I had an idea for a machine-code IDE. Basically, it puts stuff in three columns: segment address, opcodes, and mnemonics. The programmer

This exists and is called debugger :) lol , well i think most of the new debugger make this ( OllyDbg i think it does )

I dont think a IDE inc the work of a programmer i think it does the inverse ...
remenber labels is easy i use java label sintax for labels , i use makefiles to automate the compiler process and macros to increse my work also i make all code in separeted file and i make all defs in a .h.asm files (this also makes oop very easy in nasm , since i export only importante symbols ) ... i think i am now coding faster in nasm than in C , or in any other hll language ...

Report
Re: Nasm IDE Posted by descenterace on 7 Feb 2004 at 9:46 PM
: : I had an idea for a machine-code IDE. Basically, it puts stuff in three columns: segment address, opcodes, and mnemonics. The programmer
:
: This exists and is called debugger :) lol , well i think most of the new debugger make this ( OllyDbg i think it does )

Yeah, I know. I have Borland Turbo Debugger, and it was there I got the idea. Thing is, the procedure for inserting code is a bit clunky, and it won't 'reassemble' stuff for you. Any new code you paste in will overwrite anything already there.

My IDE would've been much like a two-column Notepad: just click in a column to activate it, and then you can treat that column like a text editor window; freely modify data in it.
Report
Re: Nasm IDE Posted by Bitdog on 8 Feb 2004 at 12:45 PM

I like Descentance's idea of a .COM & a .LST file thingie.
I had had the idea the other day that a std .txt file could be written just like a WP doc
but it was saved in ASCII .TXT and had a .DOC of the same basename which held all the
address, colors, graphics, etc. So an editor/view could load it and it would look
just like a .pdf but one could use the .txt file for string search/copy/share/etc.

Kulhas's idea of, asm is a HI level language if you already have code parts made, is good.
I'm likeing Fasm lately because it self assembles, open source, etc.
It's code is almost identical to Nasm so I converted all my proc's in an evening.
fasmenv.zip comming soon........ :)

I started feeling bad about not recognizing the need to move .asm to a
higher level like Asmguru62 is working on.
(& rambling MS crap, when I should have been sleeping.)
It's true that I've had a hard time getting big projects done,
while dinking with trying to save a byte here and there.

So today I thought I would try to solve the .asm code size problem.
One can't see the forrest through the trees with .asm code.
It's so spread out that a screen full doesn't show the goal,
it only shows a lot of push pop meaningless move instuction type junk.
Yet you can look at & decypher a C code screen for quite a while,
& see the full function, from beginning to end.
So how does one compress .asm code ?
My editor allows any char 0-255 to be shown exactly like it is,
and it uses CRLF for EOL where a .doc editor only uses LF.
BUT, Fasm & Nasm allow .doc style code as input.
SO, I can group lines into one using CTRL+Q+J to make the LF char = 10
I try to get the rows of LF even, then add a comment & CRLF.
The lines are grouped according to their function as described by the comment.
I don't know the full implications of this yet?
One down side is the assembler line errors are different than my editor.
And it takes a bit of getting use to, to read fluently. I like it !
But will it stand the test of time ?

Bitdog
PS, 11 lines converted to 4.
The message board formatting doesn't allow LF=10 char,
so I substuted the | more char.
To try it, save as x?, then change the | to LF=10 with Ctrl+Q+J or Ctrl+J ?
With your Norton Commander editor :)
It almost looks like 3 instructions per line, makes 3 columns of code?

isNEAR: LODSW | CMP AX,0x3D00 | JZ doHDR | JB doSMAL	;chk mach code JMP size
doBIG:	CALL POPSTR | DB "The header is > 64 bytes.",13,10,36
doSMAL:	CALL POPSTR | DB "The header is < 64 bytes.",13,10,36
POPSTR: POP DX | MOV AH,9 | INT 21h	; print string adr on stack
doHDR:


Report
Re: Nasm IDE Posted by AsmGuru62 on 8 Feb 2004 at 9:56 PM
So how does one compress .asm code ?

In my opinion, a good use of functions and macros can make this possible. The code written that way is quite readable. Also, a good idea (which I decided to implement) is to collapse parts of code you do not want to look at right now, so you see a plus sign at this line and "..." beside it, just like in .NET editor.
Report
Re: Nasm IDE Posted by _kulhas on 11 Feb 2004 at 9:34 AM
This message was edited by _kulhas at 2004-2-11 9:44:55

: Kulhas's idea of, asm is a HI level language if you already have code parts made, is good.

I realy dont understand what you want to say with this !!!
If i want to use a linked list on my program i will make a general linked list 'lib' , so i have only to code this list only once ... and i make it easy to use and easy to understand ...
My code is very similiar to C program struc i have a header file and other files , when i want to use a lib i have only to include the header file , i think this make very easy to use a third party lib ... The other good thing about this is that i can use almost any assembly compiler , since i have only to convert the .h.asm file to other asm sintax and this can be made with macros ... the other part can be compiled in a obj file and then link all objects, like gcc does ...

I realy dont see how can a ide be used to increse a coders work ...

-> BUT THIS IS ONLY MY OPNION

- I am also trying to discover how to make things better in assembly language , i have made a compiler (for mips) , and i am now making one compiler compiler (in nasm :) ) ...

my first compiler was not very good , but it have ...

-> global and local labels
-> global and local macros

i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...

Well but assembly needs good ideas so keep the good work ...

Sorry about the english







Report
Re: Nasm IDE Posted by AsmGuru62 on 11 Feb 2004 at 2:46 PM
...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...

Can you explain more about this?
As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

Report
(new) Re: Nasm IDE Posted by Bitdog on 8 Feb 2004 at 11:46 PM
So how does one compress .asm code ?

collapse parts of code you do not want to look at right now,
so you see a plus sign at this line


I like it.....
Insight debugger puts a number on the right side of the disasm win
in color. Then pushing the key of the number jumps to it.
Your + plus could sit on the right side of the screen in a highlighted
color, indicateing that there is more code out there, like off screen ?
(thats an extension of the code for that line.) (er something)
The + could be a number if there is more than one code chunk ?

I'm thinking that an assembler & editor combination could use special
keys to act as CRLF to the assembler, but not the editor
(but show the CRLF char on the screen as ascii char)
It's my, group asm lines on one line thingie.
@ might be a good character for that,
& L:SHIFT+ENTER key could plant it.
Any way, I made KBD.ASM tsr.com the other day and I'm going to make
L:SHIFT+ENTER insert SPACE,LF=10,SPACE into the key board buffer
so multi instruction lines are easy to make in generic editors.
Then, I got Fasm to assemble and FC.EXE checked it against the original
with out any differences.
SO, I'm looking into adding the @ char as a CRLF
so the line errors are correct, might be in the works.

Then, Nasm has incbin "filename.ext"
dumps any file right into the assembled executable at the incbin line.
WHAT ABOUT "QUOTE" or some other key word that works like a Fasm macro

RAW {
#1 all these lines are dumped into the executable exactly like they are
starting with the #1 to #end.
No need to do the DB "STRING",13,10,36 thing
to AH=9 INT 21h print string.
#end} ;no crlf on this line

That would make message making soooooooo much easier.

Bitdog


Report
Re: (new) Re: Nasm IDE Posted by AsmGuru62 on 9 Feb 2004 at 7:14 AM
: So how does one compress .asm code ?
:
: collapse parts of code you do not want to look at right now,
: so you see a plus sign at this line

:
: I like it.....
: Insight debugger puts a number on the right side of the disasm win
: in color. Then pushing the key of the number jumps to it.
: Your + plus could sit on the right side of the screen in a highlighted
: color, indicateing that there is more code out there, like off screen ?
: (thats an extension of the code for that line.) (er something)
: The + could be a number if there is more than one code chunk ?
:
: I'm thinking that an assembler & editor combination could use special
: keys to act as CRLF to the assembler, but not the editor
: (but show the CRLF char on the screen as ascii char)
: It's my, group asm lines on one line thingie.
: @ might be a good character for that,
: & L:SHIFT+ENTER key could plant it.
: Any way, I made KBD.ASM tsr.com the other day and I'm going to make
: L:SHIFT+ENTER insert SPACE,LF=10,SPACE into the key board buffer
: so multi instruction lines are easy to make in generic editors.
: Then, I got Fasm to assemble and FC.EXE checked it against the original
: with out any differences.
: SO, I'm looking into adding the @ char as a CRLF
: so the line errors are correct, might be in the works.
:
: Then, Nasm has incbin "filename.ext"
: dumps any file right into the assembled executable at the incbin line.
: WHAT ABOUT "QUOTE" or some other key word that works like a Fasm macro
:
: RAW {
: #1 all these lines are dumped into the executable exactly like they are
: starting with the #1 to #end.
: No need to do the DB "STRING",13,10,36 thing
: to AH=9 INT 21h print string.
: #end} ;no crlf on this line
:
: That would make message making soooooooo much easier.
:
: Bitdog
:

:
:
Those all nice ideas... I need more of these. The Editor in my IDE will be able to collapse any chunk of code anywhere - only nested collapsable blocks are not supported yet - and most likely will not be, because I have to change the data structure for this.

As for keyboard interface - it is completely adjustable to the user - all menu actions (and all hot keys) will be configurable to be any key combination.

Report
Re: (new) Re: Nasm IDE Posted by Bitdog on 9 Feb 2004 at 8:04 AM

Can you import (kbd) config files that others make & share ?
Can you make it so opening an .ASM file configgures the IDE for the make ?
Like, "fasm INfile OUTfile" is all that's required to make.
The model/size & all is in the header defines
or something like that (saved in ASCII alterable form).
Hours of clicking to configure the IDE to assemble something doesn't make sence
since programmers bounce around, makeing a few programs at a time,
some times. Anyway, it's just some ideas....

Bitdog


Report
Re: (new) Re: Nasm IDE Posted by AsmGuru62 on 9 Feb 2004 at 8:40 AM
:
: Can you import (kbd) config files that others make & share ?
: Can you make it so opening an .ASM file configgures the IDE for the make ?
: Like, "fasm INfile OUTfile" is all that's required to make.
: The model/size & all is in the header defines
: or something like that (saved in ASCII alterable form).
: Hours of clicking to configure the IDE to assemble something doesn't make sence
: since programmers bounce around, makeing a few programs at a time,
: some times. Anyway, it's just some ideas....
:
: Bitdog
:

:
:
Great ideas!
Report
Re: (new) Re: Nasm IDE Posted by _kulhas on 12 Feb 2004 at 10:53 AM
: ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
:
: Can you explain more about this?
: As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

:

You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...

Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...

i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...

I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
if you want to see it is in my page ...

http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...

it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...

sorry about the english ...



Report
Re: (new) Re: Nasm IDE Posted by shaolin007 on 12 Feb 2004 at 12:11 PM
: : ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
: :
: : Can you explain more about this?
: : As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

: :
:
: You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
: well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...
:
: Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...
:
: i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...
:
: I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
: if you want to see it is in my page ...
:
: http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...
:
: it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...
:
: sorry about the english ...
:
:
:
:

Just curious and maybe you could clarify this for me, I thought labels were just a reference to a memory location and nothing more? Is there more to it than that but I thought like
 jmp your_label
was the same as
 jmp 15h
(if it was that memory location it referenced)?
Report
Re: (new) Re: Nasm IDE Posted by AsmGuru62 on 12 Feb 2004 at 12:28 PM
This message was edited by AsmGuru62 at 2004-2-12 12:33:16

This message was edited by AsmGuru62 at 2004-2-12 12:31:43

: : : ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
: : :
: : : Can you explain more about this?
: : : As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

: : :
: :
: : You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
: : well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...
: :
: : Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...
: :
: : i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...
: :
: : I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
: : if you want to see it is in my page ...
: :
: : http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...
: :
: : it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...
: :
: : sorry about the english ...
: :
: :
: :
: :
:

: Just curious and maybe you could clarify this for me, I thought labels were just a reference to a memory location and nothing more? Is there more to it than that but I thought like
 jmp your_label
was the same as
 jmp 15h
(if it was that memory location it referenced)?
:
Absolutely correct.
Labels are needed for compilation only - they simply replaced by a value when code is running. A good debugger (OLLYDBG) will point the line in the code where label is jumping - very handy!

By the way, good IDE should follow the JMPs too, say, you point your caret on a line which says: JMP @@_SOME_LABEL - you press some hot key and Editor jumps to the referenced line:
@@_SOME_LABEL:
  MOV   ...
  PUSH  ...
  CALL  ...

Same goes for CALLs - set caret on a CALL and with a same hot key jump to the correct line (load the source module if the function is in a different module.) - that will be COOL! Like links in the browser...





Report
Re: (new) Re: Nasm IDE Posted by descenterace on 12 Feb 2004 at 3:07 PM
: This message was edited by AsmGuru62 at 2004-2-12 12:33:16

: This message was edited by AsmGuru62 at 2004-2-12 12:31:43

: : : : ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
: : : :
: : : : Can you explain more about this?
: : : : As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

: : : :
: : :
: : : You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
: : : well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...
: : :
: : : Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...
: : :
: : : i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...
: : :
: : : I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
: : : if you want to see it is in my page ...
: : :
: : : http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...
: : :
: : : it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...
: : :
: : : sorry about the english ...
: : :
: : :
: : :
: : :
: :

: : Just curious and maybe you could clarify this for me, I thought labels were just a reference to a memory location and nothing more? Is there more to it than that but I thought like
 jmp your_label
was the same as
 jmp 15h
(if it was that memory location it referenced)?
: :
: Absolutely correct.
: Labels are needed for compilation only - they simply replaced by a value when code is running. A good debugger (OLLYDBG) will point the line in the code where label is jumping - very handy!
:
: By the way, good IDE should follow the JMPs too, say, you point your caret on a line which says: JMP @@_SOME_LABEL - you press some hot key and Editor jumps to the referenced line:
:
: @@_SOME_LABEL:
:   MOV   ...
:   PUSH  ...
:   CALL  ...
: 

: Same goes for CALLs - set caret on a CALL and with a same hot key jump to the correct line (load the source module if the function is in a different module.) - that will be COOL! Like links in the browser...

:
:
:
:
:
Near/Short JMP instructions would be so much easier to assemble by hand if the destination was relative to the segment base, instead of relative to the next instruction...
Report
Re: (new) Re: Nasm IDE Posted by AsmGuru62 on 12 Feb 2004 at 3:11 PM
: : This message was edited by AsmGuru62 at 2004-2-12 12:33:16

: : This message was edited by AsmGuru62 at 2004-2-12 12:31:43

: : : : : ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
: : : : :
: : : : : Can you explain more about this?
: : : : : As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

: : : : :
: : : :
: : : : You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
: : : : well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...
: : : :
: : : : Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...
: : : :
: : : : i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...
: : : :
: : : : I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
: : : : if you want to see it is in my page ...
: : : :
: : : : http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...
: : : :
: : : : it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...
: : : :
: : : : sorry about the english ...
: : : :
: : : :
: : : :
: : : :
: : :

: : : Just curious and maybe you could clarify this for me, I thought labels were just a reference to a memory location and nothing more? Is there more to it than that but I thought like
 jmp your_label
was the same as
 jmp 15h
(if it was that memory location it referenced)?
: : :
: : Absolutely correct.
: : Labels are needed for compilation only - they simply replaced by a value when code is running. A good debugger (OLLYDBG) will point the line in the code where label is jumping - very handy!
: :
: : By the way, good IDE should follow the JMPs too, say, you point your caret on a line which says: JMP @@_SOME_LABEL - you press some hot key and Editor jumps to the referenced line:
: :
: : @@_SOME_LABEL:
: :   MOV   ...
: :   PUSH  ...
: :   CALL  ...
: : 

: : Same goes for CALLs - set caret on a CALL and with a same hot key jump to the correct line (load the source module if the function is in a different module.) - that will be COOL! Like links in the browser...

: :
: :
: :
: :
: :
: Near/Short JMP instructions would be so much easier to assemble by hand if the destination was relative to the segment base, instead of relative to the next instruction...
:
Probably, but again, who codes the ASM by hand now?
Hardcore guys, and I mean REALLY hardcore!
Also, when jumping we talking about CPU - and how CPU can know the base address of a segment? It is rather logical then physical. The physical it will be AFTER the code put into EXE file. Obviously, for CPU it is much easier to say: 'JUMP minus 37 byte of your current location'.

Report
Re: (new) Re: Nasm IDE Posted by descenterace on 13 Feb 2004 at 5:07 AM

: : Near/Short JMP instructions would be so much easier to assemble by hand if the destination was relative to the segment base, instead of relative to the next instruction...
: :
: Probably, but again, who codes the ASM by hand now?
: Hardcore guys, and I mean REALLY hardcore!
: Also, when jumping we talking about CPU - and how CPU can know the base address of a segment? It is rather logical then physical. The physical it will be AFTER the code put into EXE file. Obviously, for CPU it is much easier to say: 'JUMP minus 37 byte of your current location'.

:
Er... the CPU knows where the base of the segment is because of the Instruction Pointer... When IP = 0, it's at the segment base. What I meant was, an absolute jump to IP = x is easier to code (and easier to execute; just load a value into IP) than setting IP = IP + x.

And I use Machine Code... but only for Real Mode programming at the moment, and only in .COM files, since .EXEs are a pain to construct by hand.
Report
Re: (new) Re: Nasm IDE Posted by _kulhas on 13 Feb 2004 at 7:36 AM
: : : ...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ...
: : :
: : : Can you explain more about this?
: : : As far as I know, good ASM compiler has both global and local variables and labels. I use TASM32 - perfect!

: : :
: :
: : You probably rigth ... i have programmed in tasm in the begin and never use fectures like label , public (and i realy dont no what they do )
: : well what i was talking about was a system that lets you make a part of your code totaly independent from the rest of the code , and only some parts of code will be public , the other will be local , like macros , and labels ... i think is something like java, private and public but for assembly ...
: :
: : Also i have a problem with nasm i am declaring global symbols in my .asm files and extern symbols in my .h.asm files , so i have to make a switch to not declare global and extern at same time ...
: :
: : i have made a compiler and implement a label system , the code is very bad , it was my first compiler have many bugs ...
: :
: : I know that label system is very far from being perfect in fact it have some realy problems , there are many things to work ...
: : if you want to see it is in my page ...
: :
: : http://alunos.di.uevora.pt/~l17438/ , the compiler is for mips ...
: :
: : it is on my download section ... well if you go there sign my guest book lol :) and posting a message in message board doesnt hurt ...
: :
: : sorry about the english ...
: :
: :
: :
: :
:

: Just curious and maybe you could clarify this for me, I thought labels were just a reference to a memory location and nothing more? Is there more to it than that but I thought like
 jmp your_label
was the same as
 jmp 15h
(if it was that memory location it referenced)?
:

If you are talking about my compiler , than labels are equal to numbers
they could be a memory adress or a real number defined with a equ ,
if that memory is valid it depends on your code i think ...Also not all memory adress are valid in mips processor

but to anwser to your question ,i see labels just as a numbers , so using labels or using numbers is the same thing ...






Report
Re: (new) Re: Nasm IDE Posted by shaolin007 on 13 Feb 2004 at 8:03 AM

: If you are talking about my compiler , than labels are equal to numbers
: they could be a memory adress or a real number defined with a equ ,
: if that memory is valid it depends on your code i think ...Also not all memory adress are valid in mips processor
:
: but to anwser to your question ,i see labels just as a numbers , so using labels or using numbers is the same thing ...


But ultimately even a number constant is still referenced to a memory location to where it is located, right? The CPU has to know where it can access it.
Report
Re: (new) Re: Nasm IDE Posted by AsmGuru62 on 13 Feb 2004 at 11:11 AM
:
: : If you are talking about my compiler , than labels are equal to numbers
: : they could be a memory adress or a real number defined with a equ ,
: : if that memory is valid it depends on your code i think ...Also not all memory adress are valid in mips processor
: :
: : but to anwser to your question ,i see labels just as a numbers , so using labels or using numbers is the same thing ...
:

:
: But ultimately even a number constant is still referenced to a memory location to where it is located, right? The CPU has to know where it can access it.
:
If we talking about JMP instructions - it is called immediate operand and it is located right after the operation code:
74 14      JE   @@_LABEL

74 is code for JE
14 is an offset in bytes where to jump.

Report
Re: (new) Re: Nasm IDE Posted by _kulhas on 13 Feb 2004 at 11:44 AM
:
: : If you are talking about my compiler , than labels are equal to numbers
: : they could be a memory adress or a real number defined with a equ ,
: : if that memory is valid it depends on your code i think ...Also not all memory adress are valid in mips processor
: :
: : but to anwser to your question ,i see labels just as a numbers , so using labels or using numbers is the same thing ...
:

:
: But ultimately even a number constant is still referenced to a memory location to where it is located, right? The CPU has to know where it can access it.
:
i think you can see jumps like
add eip , numberOfBytesToJump ; for jmps like jxx ( je , jz ...)

or you can see it like mov eip , [adress] , for jmp [xxx]

the jmp xxx dont know how is encoded ...

and you have to be carefull with physcal and phiscal adress

because if your program is loaded in 40 00 00h adress than a label to 0 adress should be referenced as 40 00 00h , ...

this is the way i see things but you can get OllyDbg and see who your code is converted to opcodes ...

I say OllyDbg because is a very good debugger for windows ...






Report
Re: (new) Re: Nasm IDE Posted by shaolin007 on 13 Feb 2004 at 12:43 PM
Thanks, sorry for my misunderstanding. Still trying to learn the basics of assembly. There is just so much to know! I don't know about you all but it seems overwhelming at times to me. Anyways, thanks for the info.
Report
Re: (new) Re: Nasm IDE Posted by Temporary00934 on 13 Jul 2009 at 5:37 PM
I've attempted to teach myself high-level languages for awhile now, Mainly C#, variations of Java, Perl, and Python. I hate all of them. Some people dislike low level coding, and I haven't had the opportunity to disagree with them because I haven't learned assembly yet. I'm a very analytical person and I prefer a language that is close to the hardware, and meaningful. In most languages TIMTOWTDI, and I hate it. I would imagine that it would be very difficult to program a very complicated program in an assembly language quickly, but I don't need to make fancy fuzzy-logic byte-signature heuristics OMFG this will m4k3 m3 g0d every day. But I don't like to juggle; I want to learn something that will persist, something that will be useful for as long as computers are useful. Though individual assembly languages differ in syntax, they are mere interpretations of the same thing, like an equation having an infinite number of equivalent forms. Even by arithmetic TIMTOWTDI, but there is only one best way, and only one expression replete with the fundamental building blocks- the primes. I like to assume that programing is no different, but it is very difficult to equivocate one piece of High level language code with another, there is no symmetry that persist because the languages are meant to be dynamic. Without symmetry there can be no simple way to equivocate one thing to another. That is why I dislike Higher level languages- it becomes an art of practice, and leaves the world of logic. Assembly will always persist, though the interpretation is malleable.
BTW does anyone know where I can find a NASM-IDE or equivalent?



 

Recent Jobs