how do i convert the ascii character function from this c++ program into pep8 assembly


how do i convert the ascii character function from this c++ program into pep8 assembly



I cant get the ascii character to convert when the input is given.
I need help converting this C++ into pep8 assembly language


#include <iostream>

using namespace std;

int main() {
int num;
char ch;

cout << "Enter a character: ";
cin.get(ch);

cout << "The ASCII equivalent of " << ch << " is " << (int)ch << endl;

return 0;
}



this is what i have so farVVVV


BR main
num: .EQUATE 0
ch: .EQUATE 2
main: STRO msg0,d
CHARI ch,d
LDA ch,d
STRO msg1,d
CHARO ch,d
STRO msg2,d
CHARO num,i
CHARO 'n',i
STOP
msg0: .ASCII "Enter a character: x00 "
msg1: .ASCII "The ASCII equivalent of x00 "
msg2: .ASCII " is x00"
.END





You're asking this the wrong way. This would be a better question if you asked "how do I read a character and print its ASCII code as a decimal number in PEP8?" because that's a specific question that focuses on the specific problem, not on the general problem of turning C++ into PEP8 asm. (That's what compilers are for.) It still wouldn't be a good question in an absolute sense, and probably a duplicate, but I'd remove my downvote.
– Peter Cordes
Jun 29 at 19:33






But see also idownvotedbecau.se/noattempt
– Peter Cordes
Jun 29 at 19:35





i thought i posted a picture but i guess it did not upload. Im not trying to get by the easy way everyone im honestly stuck. i cant get the output right. my output does not convert the input into the equivalent ascii character
– Jake Wheeler
Jun 29 at 19:37





Your post is on hold because it's a broad question. Usually, questions that start with "how do I" are too broad (because those require tutorials). Edit your question for a more specific issue.
– Thomas Matthews
Jun 29 at 20:07





Folks with sufficiently high reputation can vote to reopen. I was satisfied when you added the text version of your attempt, so one down and I believe 4 to go.
– user4581301
Jun 29 at 20:14









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift