Posts

Showing posts with the label pep8-assembly

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 P...