Re: on goto

Discussion in 'C++' started by wolfgang kern, Apr 25, 2010.

  1. "io_x" wrote:
    > [Xpost to: alt.comp.programming, alt.lang.asm,
    > comp.lang.c, comp.lang.c++, comp.programming]


    > the people that speak not good about "goto"
    > are uttled wrong; their code bug full etc


    > more distant is your code from goto
    > more your code is bug full and incompresible


    > the "goto" is the key word for programming;
    > all the remain, other than goto or jmp or jc or jz,
    > and the easy cpu layout
    > is the wrong way for programming


    Except that GOTO is a HLL keyword and I'm Asmist and
    more machine-code oriented than concerned about needs
    within abstract structured HLL-compilers, I see nothing
    wrong with GOTO as long it does what a programmer want.

    I once checked PowerBasic's GOTO and found it always
    compiled a long (16:16) jump, even rare required.
    But its syntax checker cried aloud if you tried to
    jump out of a [FOR/IF/...]-struct with GOTO.

    I don't know C/C+-, but what I see by disassembling their
    resulting output seem to end up in heavy bloated code,
    perhaps from using BREAK and GOTO within nested blocks,
    which the compiler may grant with copying all required
    code-trails (stack recover/cleanup) to every added path.
    So in this aspect GOTO may be really not the best choice.

    see me happy for I don't need to care this in my world :)
    __
    wolfgang (ALA)
    wolfgang kern, Apr 25, 2010
    #1
    1. Advertising

  2. wolfgang kern

    hanukas Guest

    On Apr 26, 9:46 am, "io_x" <> wrote:
    > > Except that GOTO is a HLL keyword and I'm Asmist and
    > > more machine-code oriented than concerned about needs
    > > within abstract structured HLL-compilers, I see nothing
    > > wrong with GOTO as long it does what a programmer want.

    >
    > you see all jmp, je, jc etc etc for me they are all gotos


    A conditional jump is predicated instruction. I don't see anything
    predicative in a goto statement, which isn't to say that the
    similarity couldn't be deceiving without thinking about the
    differences.

    Hmmm.. so anything that changes the IP is a goto? By this defition
    "NOP" would be a goto. Actually, this whole thread is glorious waste
    of time, seriously guys.. this needs to be asked: WHAT THE ****!?!??
    hanukas, Apr 30, 2010
    #2
    1. Advertising

  3. wolfgang kern

    Lie Ryan Guest

    On 04/30/10 23:06, hanukas wrote:
    > On Apr 26, 9:46 am, "io_x" <> wrote:
    >>> Except that GOTO is a HLL keyword and I'm Asmist and
    >>> more machine-code oriented than concerned about needs
    >>> within abstract structured HLL-compilers, I see nothing
    >>> wrong with GOTO as long it does what a programmer want.

    >>
    >> you see all jmp, je, jc etc etc for me they are all gotos

    >
    > A conditional jump is predicated instruction. I don't see anything
    > predicative in a goto statement, which isn't to say that the
    > similarity couldn't be deceiving without thinking about the
    > differences.
    >
    > Hmmm.. so anything that changes the IP is a goto? By this defition
    > "NOP" would be a goto. Actually, this whole thread is glorious waste
    > of time, seriously guys.. this needs to be asked: WHAT THE ****!?!??
    >


    "mov eax, ebx" is a goto to the next machine instruction (ps: it has a
    side effect of moving some arbitrary bits around in the memory, but
    that's implementation detail, we don't care about that). So, ban mov!
    Lie Ryan, Apr 30, 2010
    #3
  4. wolfgang kern

    Frank Kotler Guest

    io_x wrote:

    ....
    > --------------------
    > yes "je .1" would it mean "if zero flag == 1 goto .1";
    > "je" is a 'conditional' goto;
    > jmp is a goto.


    Whereas "break", in my world, is an "OS thing" and has to do with
    memory, not flow-control. I wanna use 'em both!

    Best,
    Frank
    Frank Kotler, May 1, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. youngsun park
    Replies:
    2
    Views:
    605
    David Pursley
    Nov 18, 2003
  2. Skybuck Flying

    VHDL Goto statement ?

    Skybuck Flying, Aug 8, 2005, in forum: VHDL
    Replies:
    9
    Views:
    6,074
    ajahn
    Aug 26, 2005
  3. Skybuck Flying

    Re: VHDL Goto statement ?

    Skybuck Flying, Aug 8, 2005, in forum: VHDL
    Replies:
    0
    Views:
    721
    Skybuck Flying
    Aug 8, 2005
  4. Flip
    Replies:
    6
    Views:
    6,647
    Jeff Dillon
    Nov 18, 2004
  5. Flip
    Replies:
    1
    Views:
    622
    Brock Allen
    Apr 14, 2005
Loading...

Share This Page