Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. assembly help

assembly help

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sirrius
    wrote on last edited by
    #1

    What does this syntax mean and how may I convert it to NASM?

    leal (%eax,%eax),%edx
    movw (%eax,edx),%ax

    ...Anybody? Thanks. B.

    Z 1 Reply Last reply
    0
    • S Sirrius

      What does this syntax mean and how may I convert it to NASM?

      leal (%eax,%eax),%edx
      movw (%eax,edx),%ax

      ...Anybody? Thanks. B.

      Z Offline
      Z Offline
      ZoogieZork
      wrote on last edited by
      #2

      (Note: I may be a little rusty): The full syntax for memory references in AT&T syntax is: displacement(base,index,scale) The above syntax translates to (in Intel syntax): [base+(index*scale)+disp] Most parts are optional; e.g. scale defaults to 1, displacement defaults to 0. The l, w, and b suffixes used in AT&T syntax instructions translate to the dword, word, and byte keywords in Intel syntax (respectively). Also, Intel syntax uses a reverse order of oprands. So, in leal (%eax,%eax),%edx, you've got a lea instruction that's operating on longwords (dwords), is referencing a memory address eax + eax, and stores the result in edx. In Intel syntax, that's: lea dword edx,[eax+eax] (the dword can probably be omitted). - Mike

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups