Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Binary-digits/360-Assembly/binary-digits.360
Normal file
43
Task/Binary-digits/360-Assembly/binary-digits.360
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
* Binary digits 27/08/2015
|
||||
BINARY CSECT
|
||||
USING BINARY,R12
|
||||
LR R12,R15 set base register
|
||||
BEGIN LA R10,4
|
||||
LA R9,N
|
||||
LOOPN MVC W,0(R9)
|
||||
MVI FLAG,X'00'
|
||||
LA R8,32
|
||||
LA R2,CBIN
|
||||
LOOP TM W,B'10000000' test fist bit
|
||||
BZ ZERO zero
|
||||
MVI FLAG,X'01' one written
|
||||
MVI 0(R2),C'1' write 1
|
||||
B CONT
|
||||
ZERO CLI FLAG,X'01' is one written ?
|
||||
BNE BLANK
|
||||
MVI 0(R2),C'0' write 0
|
||||
B CONT
|
||||
BLANK BCTR R2,0 backspace
|
||||
CONT L R3,W
|
||||
SLL R3,1 shilf left
|
||||
ST R3,W
|
||||
LA R2,1(R2) next bit
|
||||
BCT R8,LOOP loop on bits
|
||||
PRINT CLI FLAG,X'00' is '0'
|
||||
BNE NOTZERO
|
||||
MVI 0(R2),C'0' then write 0
|
||||
NOTZERO L R1,0(R9)
|
||||
XDECO R1,CDEC
|
||||
XPRNT CDEC,45
|
||||
LA R9,4(R9)
|
||||
BCT R10,LOOPN loop on numbers
|
||||
RETURN XR R15,R15 set return code
|
||||
BR R14 return to caller
|
||||
N DC F'0',F'5',F'50',F'9000'
|
||||
W DS F work
|
||||
FLAG DS X flag for trailing blanks
|
||||
CDEC DS CL12 decimal value
|
||||
DC C' '
|
||||
CBIN DC CL32' ' binary value
|
||||
YREGS
|
||||
END BINARY
|
||||
Loading…
Add table
Add a link
Reference in a new issue