Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
39
Task/Arithmetic-Integer/360-Assembly/arithmetic-integer.360
Normal file
39
Task/Arithmetic-Integer/360-Assembly/arithmetic-integer.360
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
* 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue