Results 1 to 3 of 3

Thread: Assembly selection

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Assembly selection

    Is there a way that the program can be structured without jumping to a label? Or is assembly normally coded in this manner?
    I always thought the use of GOTO's lead to bad programming structure, or does that only apply to higher level languages?
    Code:
    cmp bl,'Y' 		; is al=Y?
    je Prompt_Again 	; if yes then display it again
    cmp bl,'y' 		; is al=y?
    je Prompt_Again 	; if yes then display it again
    Somthing like...
    Code:
      if(bl == 'y'){
        // execute code
        // instead of jumping to a label or calling a method
      }
    Thanks for the help!

  2. #2

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Ok i see that we can use functions and call them instead of jumping.
    Code:
    PROC AProcedure
    .
    . 		; some code to do something 
    .
    ret		; if this is not here then your computer will crash 
    ENDP AProcedure

  3. #3
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Well, that depends on what you are trying to accomplish.

    You need the jump statements for looping and condition testing (that is if you are going to strictly use the instruction set) because of the lack that there is no alternative.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width