Hi guys..i've been cracking my head for the past few days, i can't seem to print out the result of my multiplication..I'm using MASM615..Can anyone give me some pointers ?
.MODEL MEDIUM
.STACK
.DATA
;==================================
ONE DW 04DEH ; First signed number A = (-79H) = FF87H (2'Compliment form)
TWO DW 096CH ; Second signed number B = (-7CH) = FF84H (2'Compliment form)
THREE DW ? ; Variable C to store result
FOUR DW ?
MSGTWO db "enter first number:$"
MSGTRI db "enter second number:$"
;MSGFOUR db "Answer : $"
;MSGFIVE db "thank you for using the calculator! press any ;key...$"
;ERROR db "wrong operator!$"
;==================================
PARALIST LABEL BYTE
MAX DB 6
ACT DB ?
PARADATA DB 6 DUP (' ')
PARALIST2 LABEL BYTE
MAX2 DB 6
ACT2 DB ?
PARADATA2 DB 6 DUP (' ')
;===================================
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV SI,0000H ; Initialize SI to 0000H
;Prompt For Input
LEA DX,MSGTWO
MOV AH,09H
INT 21H
MOV AH,0AH
LEA DX,PARALIST
INT 21H
;New Line
MOV AH,02H
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
;Prompt For Input2
LEA DX,MSGTRI
MOV AH,09H
INT 21H
MOV AH,0AH
LEA DX,PARALIST2
INT 21H
;New Line
MOV AH,02H
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
;mov $ sign
MOV BL,ACT
MOV BH,00
MOV PARADATA[BX],'$'
;mov $ sign
MOV BL,ACT2
MOV BH,00
MOV PARADATA2[BX],'$'
; Perform Multiplication
LEA AX,PARADATA ;Take first number A in AX register
LEA CX,PARADATA2 ;Take second number B in CX register
MUL CX ; Performs unsigned Multiplication DX:AX = AX × CX
MOV SI,DX
MOV FOUR,SI ; Store higher 16-bit result
MOV AH,09H
MOV DX,FOUR
INT 21H
MOV AH,02H
MOV DL,0DH
INT 21H
MOV DL,0AH
INT 21H
MOV SI,AX
MOV THREE,SI ; Store lower 16-bit result
MOV AH,09H
MOV DX,THREE
INT 21H
MOV AX,4c00H
INT 21H
MAIN ENDP
END MAIN
The part in red color is probably where i've gone wrong..been reading lotsa books but i don't get it..=/