I have an Marie Assembly Language Project and need some help. For this project,
ID: 2084832 • Letter: I
Question
I have an Marie Assembly Language Project and need some help. For this project, I need to take in various capital letters A-Z, perform a 13 bit cyper, and then output the cypered values. The issue is that I am used to other programming languages and can't figure out how to make the application do what I want. I have been trying to figure this out for two days and its due tuesday. I am extremely frustrated with this so need help desperately.
My thought is to take the input, check for the "." (and end the loop if so), store the values to incrementing values each loop (aka 200, 201, etc), and then do an output loop.
So far, I have the below (most of it provided) but don't know where to go from here.
ORG 100 / Start the program at location 100 hexadecimal
/ -----
/ Input characters, transform, and store in memory until '.' is input
/ -----
Load Start / Initialize character pointer to start of block
Store Ptr / Give Ptr the value of 200.
/>>>>> Add code to accomplish the input and output phases. <<<<<
Input / Take the input value
Store InVal / Store input value to be transformed into InVal
Jns ROT13 / Jump to the ROT13 subroutine
/>>>>> Here's an example of how subroutine ROT13 is called. <<<<<
/>>>>> We'll just transform 'A' in this example then halt. <<<<<
Load ChA / Put 'A' in AC
Store InVal / Store value to be transformed into InVal
Jns ROT13 / Jump to the ROT13 subroutine
/ Upon return, the transformed character is in AC
Halt
/ -----
/ Rotate-13 subroutine: Apply ROT13 to input character in location InVal and return in AC
/ -----
/>>>>> WARNING: This subroutine *almost* works. You need to fix a bug.
ROT13, HEX 0
Load InVal / Get character
Add Val13 / Add 13
Store Hold / Save it
Subt ChZ / Check if modulo adjust is needed (past 'Z')
Skipcond 800 / No adjust needed if past 'Z'
Jump NoAdj
Add ChA / Add 'A' back to difference to perform modulo
Jump Done / Result is in AC
NoAdj, Load Hold / No adjust needed, get result
Done, JumpI ROT13 / Return with result in AC
/ -----
/ Constants (the program should not write to these locations)
/ -----
ChA, HEX 0041 / Constant value 'A' for modulo adjust in subroutine
ChZ, HEX 005A / Constant value 'Z' for modulo check in subroutine
ChPe, HEX 2E / Constant period character that marks end of input
Val13, DEC 13 / Constant rotate value of 13 for subroutine
One, HEX 1 / Constant value 1
Start, HEX 200 / Constant address for start of character block
/ -----
/ Data area (these locations are for reading and writing)
/ -----
InVal, HEX 0 / Reserved for subroutine input value
Hold, HEX 0 / Reserved for temporary variable for subroutine
Ptr, HEX 0 / Reserved for character pointer
Ctr, Dec 1
Explanation / Answer
once check this loop you have writtern you can understood the easy way.
/>>>>> Add code to accomplish the input and output phases. <<<<<
Input / Take the input value
Store InVal / Store input value to be transformed into InVal
Jns ROT13 / Jump to the ROT13 subroutine
/>>>>> Here's an example of how subroutine ROT13 is called. <<<<<
/>>>>> We'll just transform 'A' in this example then halt. <<<<<
Load ChA / Put 'A' in AC
Store InVal / Store value to be transformed into InVal
Jns ROT13 / Jump to the ROT13 subroutine
/ Upon return, the transformed character is in AC
Halt
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.