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 January 18th, 2005, 11:30 AM
    pablowablo pablowablo is offline
    Junior Member
     
    Join Date: May 2004
    Posts: 4
    pablowablo is an unknown quantity at this point (<10)
    beginner question specifying size

    Hello,

    How do I specify the size of my operands in an instruction?

    I use nasm and I get an operation not specified error with

    mov [data] , 10

    I'm guessing this is because the assembler does not know how big it should move to data...


    thanks!
    Reply With Quote
      #2    
    Old January 19th, 2005, 03:04 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: beginner question specifying size

    There is a small trick: Just will it up with nulls.

    Code:
    ; And so on
    mov eax, 000010h
    mov ax, 0010h
    mov ah, 10h
    __________________
    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 January 24th, 2005, 05:46 PM
    svenhag's Avatar
    svenhag svenhag is offline
    Member
     
    Join Date: Jan 2005
    Location: Gothenburg, Sweden
    Posts: 134
    svenhag is on a distinguished road (20+)
    Re: beginner question specifying size

    If data is a dword (4 bytes) then you just write

    mov dword [data], 10
    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 10:34 PM.



    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