Any Assembly programmers?

Discussion in 'OT Technology' started by Rick, Jun 10, 2004.

  1. Rick

    Rick New Member

    Joined:
    Feb 20, 2002
    Messages:
    1,735
    Likes Received:
    0
    Location:
    Henderson, NV
    Code:
    ;    Calculate:   result5 = (B / D) + A * E
    
    	mov  ax, B
    	idiv D    ;HAVING A PROBLEM ON THIS LINE
    	mov  word ptr result5, ax
    	mov  word ptr result5+2, dx
    	mov  ax, A
    	imul E
    	add  ax, result5
    	mov  result5, ax
    
    I am using MASM for debugging and when I get to the second line it just exits out back to a DOS prompt. Any ideas?
     
  2. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    are you sure D is not zero?
     
  3. offtopic

    offtopic Guest

    The idiv function line is wrong i believe. I took assembly a few years ago and I believe using the idiv function is a bit more involded than that. I believe the divisor is stored in eax, also you didn't define what was in D, so that could be causing a problem also
     

Share This Page