
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses


Task

Get two integers from the user,   and then (for those two integers), display their:

   sum 
   difference 
   product 
   integer quotient
   remainder 
   exponentiation   (if the operator exists) 


Don't include error handling.

For quotient, indicate how it rounds   (e.g. towards zero, towards negative infinity, etc.).

For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.




*        Arithmetic/Integer        04/09/2015
ARITHINT CSECT
         USING  ARITHINT,R12
         LR     R12,R15
ADD      L      R1,A
         A      R1,B               r1=a+b
         XDECO  R1,BUF
         MVI    BUF,C'+'
         XPRNT  BUF,12
SUB      L      R1,A
         S      R1,B               r1=a-b
         XDECO  R1,BUF
         MVI    BUF,C'-'
         XPRNT  BUF,12
MUL      L      R1,A 
         M      R0,B               r0r1=a*b
         XDECO  R1,BUF             so r1 has the lower part
         MVI    BUF,C'*'
         XPRNT  BUF,12
DIV      L      R0,A
         SRDA   R0,32              to shift the sign
         D      R0,B               r1=a/b and r0 has the remainder
         XDECO  R1,BUF             so r1 has quotient
         MVI    BUF,C'/'
         XPRNT  BUF,12
MOD      L      R0,A
         SRDA   R0,32              to shift the sign
         D      R0,B               r1=a/b and r0 has the remainder
         XDECO  R0,BUF             so r0 has the remainder
         MVI    BUF,C'R'
         XPRNT  BUF,12
RETURN   XR     R15,R15
         BR     R14
         CNOP   0,4
A        DC     F'53'
B        DC     F'11'
BUF      DC     CL12' '
         YREGS
         END    ARITHINT