CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old April 19th, 2005, 12:31 AM
    aznium aznium is offline
    Junior Member
     
    Join Date: Apr 2005
    Posts: 16
    aznium is an unknown quantity at this point (<10)
    ret

    sorry im a nub

    ret returns from the method rite? or does it exit?

    lets say i think somethign like this

    Code:
    __asm
    
    {
    main:
      jmp addsomething
      jmp subtractsomething
      ret
    
    addsomething:
      add eax, 12345
      ret
    
    subtractsomething:
      sub eax. 54321
      ret
    }
    my question is.,...would subtract something be called? thx
    Reply With Quote
      #2    
    Old April 19th, 2005, 01:54 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: ret

    No. It only returns to the call it correspondense. It jumps back to address that is on the stack. If your code should work properly it must be:

    Code:
    __asm
    
    {
    main:
      call addsomething
      call subtractsomething
      ret
    
    addsomething:
      add eax, 12345
      ret
    
    subtractsomething:
      sub eax, 54321
      ret
    }
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #3    
    Old April 19th, 2005, 06:19 PM
    aznium aznium is offline
    Junior Member
     
    Join Date: Apr 2005
    Posts: 16
    aznium is an unknown quantity at this point (<10)
    Re: ret

    thx
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:43 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009