Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Nasm IDE

13»

Comments

  • descenteracedescenterace Member Posts: 93
    : [b][red]This message was edited by AsmGuru62 at 2004-2-12 12:33:16[/red][/b][hr]
    : [b][red]This message was edited by AsmGuru62 at 2004-2-12 12:31:43[/red][/b][hr]
    : : : : [italic]...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ... [/italic]
    : : : :
    : : : : [blue]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![/blue]
    : : : :
    : : :
    : : : [green] 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 ...
    : : :
    : : :
    : : :
    : : :
    : : [/green]
    : : 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[code] jmp your_label[/code] was the same as[code] jmp 15h[/code] (if it was that memory location it referenced)?
    : :
    : [blue]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!
    :
    @_SOME_LABEL - you press some hot key and Editor jumps to the referenced line:
    : [code]
    @_SOME_LABEL:
    : MOV ...
    : PUSH ...
    : CALL ...
    : [/code]
    : 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...[/blue]
    :
    :
    :
    :
    :
    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...
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : [b][red]This message was edited by AsmGuru62 at 2004-2-12 12:33:16[/red][/b][hr]
    : : [b][red]This message was edited by AsmGuru62 at 2004-2-12 12:31:43[/red][/b][hr]
    : : : : : [italic]...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ... [/italic]
    : : : : :
    : : : : : [blue]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![/blue]
    : : : : :
    : : : :
    : : : : [green] 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 ...
    : : : :
    : : : :
    : : : :
    : : : :
    : : : [/green]
    : : : 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[code] jmp your_label[/code] was the same as[code] jmp 15h[/code] (if it was that memory location it referenced)?
    : : :
    : : [blue]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!
    : :
    @_SOME_LABEL - you press some hot key and Editor jumps to the referenced line:
    : : [code]
    @_SOME_LABEL:
    : : MOV ...
    : : PUSH ...
    : : CALL ...
    : : [/code]
    : : 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...[/blue]
    : :
    : :
    : :
    : :
    : :
    : 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...
    :
    [blue]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'.[/blue]
  • descenteracedescenterace Member Posts: 93

    : : 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...
    : :
    : [blue]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'.[/blue]
    :
    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.
  • _kulhas_kulhas Member Posts: 45
    : : : [italic]...i think this is one of the big problems in assembly compilers they dont have any sofisticated system for making global and local symbols ... [/italic]
    : : :
    : : : [blue]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![/blue]
    : : :
    : :
    : : [green] 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 ...
    : :
    : :
    : :
    : :
    : [/green]
    : 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[code] jmp your_label[/code] was the same as[code] jmp 15h[/code] (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 ...






  • shaolin007shaolin007 Member Posts: 1,018
    [red]
    : 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 ...
    [/red]

    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.
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [red]
    : : 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 ...
    : [/red]
    :
    : 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.
    :
    [blue]If we talking about JMP instructions - it is called immediate operand and it is located right after the operation code:[/blue][code]
    @_LABEL
    [/code]
    [blue][b]74[/b] is code for JE
    [b]14[/b] is an offset in bytes where to jump.[/blue]
  • _kulhas_kulhas Member Posts: 45
    : [red]
    : : 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 ...
    : [/red]
    :
    : 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 ...






  • shaolin007shaolin007 Member Posts: 1,018
    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.
  • Temporary00934Temporary00934 Member Posts: 1
    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 [italic]prefer[/italic] a language that is close to the hardware, and meaningful. In most languages TIMTOWTDI, and [italic]I hate it.[/italic] 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 [italic]computers[/italic] 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?
  • Dman95Dman95 Member Posts: 1

    Try SASM - simple cross-platform IDE for NASM. It supports syntax highlighting, debugger and many other features. SASM is well suited for beginners.

13»
Sign In or Register to comment.