Results 1 to 3 of 3

Thread: The instructor nor I can figure it out!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Location
    California
    Posts
    25

    The instructor nor I can figure it out!!

    FIRST SEMESTER ASSEMLY STUDENT
    This should be a very simply exercise but can't get the desired result.
    I define a string, then I want to grab that string, move it to a different location then display the string.
    I create the program in edit and save as an XXX.asm
    Next use MASM to create an LST and OBJ file.
    Run the program under debug and single step the instructions using the T, trace command.
    ALL THE INSTRUCTIONS EXECUTE, BUT THERE IS SOME ADDRESS OFFSET PROBLEM (I THINK). When I hit 'P' after getting to the first INT 21 I get a bunch of characters I don't want before and after I see the data I want displayed.
    I am willing to call anywhere in the US to talk to somebody live if needed to figure this one out.
    ; ET 488 - March 05, 2002

    page 60,132
    TITLE A06MOVE Segments for an .EXE Program
    ;-----------------------------------------------------------
    STACK Segment PARA STACK 'STACK'

    DW 32(0)

    STACK ENDS
    ;-----------------------------------------------------------
    DATASG SEGMENT PARA 'DATA'
    DTA DB 'KEN'
    DTB DB 3 DUP(0),'$'

    DATASG ENDS
    ;-----------------------------------------------------------
    CODESEG SEGMENT PARA 'CODE'
    MAIN PROC FAR
    ASSUME SS:STACK,DSATASG,CS:CODESEG
    MOV CX,03
    LEA SI,DTA
    LEA DI,DTB
    BACK: MOV AL,[SI]
    MOV [DI],AL
    INC SI
    INC DI
    LOOP BACK
    MOV AH,09
    LEA DX,DTB
    INT 21H

    MOV AX,4C00H
    INT 21H

    MAIN ENDP
    ;End of procedure
    CODESEG ENDS ;End of segment
    END MAIN ;End of program

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Do you still need help?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  3. #3
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    From what I can see, put in:

    Code:
     
    MOV AX, DATASG
    MOV DS, AX
    I don't have too much experience in MASM, so I might be wrong. (I have NASM instead.)
    Last edited by Darkwraith; Jul 11th, 2003 at 03:26 PM.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width