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 March 3rd, 2005, 12:08 AM
    abcd12321 abcd12321 is offline
    Junior Member
     
    Join Date: Feb 2005
    Posts: 6
    abcd12321 is an unknown quantity at this point (<10)
    DMA programming

    the following code was meant to do a memory to memory transfer of 11 bytes from the data segment offset 00h to the data segment offset 20h .i had expected the string "hello world" to be in the datasegment offset 20h.plz tell me where the code went wrong and how to correct it.

    thanks a lot.




    .MODEL SMALL
    .STACK 64
    .386
    .DATA


    ORG 00
    SOURCE DB 'HELLO WORLD'
    ORG 20
    DESTINATION DB 11 DUP(?)



    .CODE
    MAIN PROC FAR


    MOV AX,@DATA
    MOV DS,AX




    mov al,00000001b ;DISABLE DMA 1
    out 08h,al

    MOV AL,00b ;CLEAR BYTE POINTER
    OUT 0CH,AL



    MOV AX,ds:00 ;CHANEL 0 BASE ADDRESS
    OUT 00H,AL
    MOV AL,AH
    OUT 00H,AL

    MOV AL,0FH ;DMA PAGE 0
    OUT 87H,AL
    NOP
    OUT 87H,AL


    MOV AX,ds:20 ;CHANEL 1 BASE ADDRESS
    OUT 02H,AL
    MOV AL,AH
    OUT 02H,AL


    MOV AL,00H ;DMA PAGE 1
    OUT 83H,AL






    MOV AL,11 ;CHANEL 1 BASE COUNT
    OUT 02H,AL




    mov al,00010001b ;ENABLE DMA
    OUT 08H,AL


    MOV AL,0000000100b ;REQUEST REGISTER
    OUT 09H,AL



    WAIT1: IN AL,8H ;READ STATUS REGISTER
    AND AL,00000010b
    CMP AL,0
    JNZ WAIT1 ;WAIT UNTIL TERMINAL COUNT REACHED






    MOV AH,4CH
    INT 21H


    MAIN ENDP
    END MAIN
    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 02:04 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