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 November 14th, 2004, 12:24 PM
    hkboy313 hkboy313 is offline
    Junior Member
     
    Join Date: Oct 2004
    Posts: 17
    hkboy313 is an unknown quantity at this point (<10)
    Question simple assembly program

    i programmed some instructions... i was wondering if it is right...that it would copy the value FF into memory locations 50 to 6F

    mov a, #ff
    mov r0,#50 ; load pointer
    mov r2,#32 ; load counter to go 32 times ( was more concerned about this)
    again: mov@r0, a
    inc r0
    djnz r2, again

    i think it will have to be 32 loops because from 50 to 5F it is 16 bits...and from 60 to 6F is another 16 bits..so it would have to go 32 bits or times to load up all in memory...right?
    Reply With Quote
      #2    
    Old January 23rd, 2005, 08:58 AM
    Lican Lican is offline
    Junior Member
     
    Join Date: Jan 2005
    Location: Gdansk, Poland
    Posts: 15
    Lican is an unknown quantity at this point (<10)
    Re: simple assembly program

    Hi!

    Maybe try using stosb or something like that. I'm not saying it's good, but I would try doing something like that:

    xor eax,eax
    dec eax
    mov ecx,(how many times)
    shr ecx,2
    mov edi,(address)
    rep stosd

    I'm not sure if it's correct. I was doing asm for some time 'till I discovered c++ :P but I still love asm anyway If you need something feel free to ask: lican@wp.pl
    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 06:51 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