Assembly Language 8086:
I have make the program for addition it takes two values in console and gives us result.. it can only take value under 32 bits(8 digits) if we give higher value then it will give error of integer overflow in console
If i want to give more then 32bit value in input1 and input2 how will i do it?
I Want add value1 to value2 by using 32bit register and give value under 64bit(equals to 16 digits).. it is Possible to use the space of 2 reg (32+32 = 64bit)?...
How we can make 2 register of 32 bit to make it 64bit i know it is possible but i don't know how to do it...because i am new in Assembly language
I am using KIP.R.IRVINE Link Libraries in Assembly Language
how we will give 64bit value by using 2 32bit reg? or how we will enable 2 32bit reg to take 64bit value?
here is the code for 32-bit addition:
INCLUDE Irvine32.inc
.data
Addition BYTE "A: Add two Integer Numbers", 0
inputValue1st BYTE "Input the 1st integer = ",0
inputValue2nd BYTE "Input the 2nd integer = ",0
outputSumMsg BYTE "The sum of the two integers is = ",0
num1 DD ?
num2 DD ?
sum DD ?
.code
main PROC
;----Displays addition Text-----
mov edx, OFFSET Addition
call WriteString
call Crlf
;-------------------------------
; calling procedures here
call InputValues
call addValue
call outputValue
call Crlf
jmp exitLabel
main ENDP
; the PROCEDURES which i have made is here
InputValues PROC
;----------- For 1st Value--------
call Crlf
mov edx,OFFSET inputValue1st ; input text1
call WriteString
; here it is taking 1st value
call ReadInt ; read integer
mov num1, eax ; store the value
;-----------For 2nd Value----------
mov edx,OFFSET inputValue2nd ; input text2
call WriteString
; here it is taking 2nd value
call ReadInt ; read integer
mov num2, eax ; store the value
ret
InputValues ENDP
;---------Adding Sum----------------
addValue PROC
; compute the sum
mov eax, num2 ; moves num2 to eax
add eax, num1 ; adds num2 to num1
mov sum, eax ; the val is stored in eax
ret
addValue ENDP
;--------For Sum Output Result----------
outputValue PROC
; output result
mov edx, OFFSET outputSumMsg ; Output text
call WriteString
mov eax, sum
call WriteInt ; prints the value in eax
ret
outputValue ENDP
exitLabel:
exit
END main