0

Im have trouble trying to calulate this 3a-4c. The program calculate only 3*a and produces no errors.

call getPos 
M1 dw ?
mov M1, AX  
call crlf
call getPos     
M2 dw ?
mov M2, AX 
call crlf
call getPos 
M3 dw ?
mov M3, AX  
call crlf
mov BX, 2   
mov CX, 3   
mov DX, 4   
mov AX, M1  
mul CX      
mov SI, AX  
mov AX, M3  
mul DX      
mov DI, AX  
sub SI, DI  
mov AX, SI       
call putPos     
mov ah, 04c
int 021
include ioSubs.inc
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by mathematician
0

Unless getPos does something special with return, lines 1-2, 5-6 and 9-10 will not work unless you did something like this.

    call    getPos
    jmp     $ + 4
    M1      dw  ?
    mov`    ax, M1

Show me the code for ioSubs.inc and I'll show you a much simpler way of doing this.

0

You seem to be mixing code and data, and you can't do that in assembly language. First you would need to have all the code, and then define the variables at the end

..............
..............
mov ah, 04c
int 021

M1 dw ?
m2 dw ?
M3 dw ?
M4 dw ?

However, it isn't clear what M1 and M2 are for, because they don't seem to be used in the calculation.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.