;; This program encrypts 10 characters typed from the keyboard. Encrypted characters ;; will be stored in memory and displayed on the screen. ;; ;; Encryption Algorithm: Add 10 to the 1st character, 9 to the 2nd character,...1 to ;; the 10th character. ;; .ORIG x3000 LEA R1, BUFFER ; R1 will be pointer to buffer LD R2, TEN ; R2 will contain k, the encryption character NEXTIN BRnz OUTPUT TRAP x23 ; get a character to encrypt ADD R0, R0, R2 ; encrypt STR R0, R1, #0 ADD R1, R1, #1 ; increment pointer ADD R2, R2, #-1 ; decrement k BRnzp NEXTIN OUTPUT LEA R1, BUFFER LD R2, TEN NEXTOUT BRnz DONE LDR R0, R1, #0 TRAP x21 ; display character ADD R1, R1, #1 ADD R2, R2, #-1 BRnzp NEXTOUT DONE TRAP x25 BUFFER .BLKW #10 TEN .FILL #10 .END