RosettaCodeData/Task/Caesar-cipher/360-Assembly/caesar-cipher.360

31 lines
1.1 KiB
Plaintext

* Caesar cypher 04/01/2019
CAESARO PROLOG
XPRNT PHRASE,L'PHRASE print phrase
LH R3,OFFSET offset
BAL R14,CYPHER call cypher
LNR R3,R3 -offset
BAL R14,CYPHER call cypher
EPILOG
CYPHER LA R4,REF(R3) @ref+offset
MVC A,0(R4) for A to I
MVC J,9(R4) for J to R
MVC S,18(R4) for S to Z
TR PHRASE,TABLE translate
XPRNT PHRASE,L'PHRASE print phrase
BR R14 return
OFFSET DC H'22' between -25 and +25
PHRASE DC CL37'THE FIVE BOXING WIZARDS JUMP QUICKLY'
DC CL26'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
REF DC CL26'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
DC CL26'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
TABLE DC CL256' ' translate table for TR
ORG TABLE+C'A'
A DS CL9
ORG TABLE+C'J'
J DS CL9
ORG TABLE+C'S'
S DS CL8
ORG
YREGS
END CAESARO