Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

you might have to email the file noel.jillian@yahoo.com Write a machine-language

ID: 3544334 • Letter: Y

Question

you might have to email the file noel.jillian@yahoo.com

Write a machine-language program to input two one-digit numbers, add them, and output the one-digit sum. Write it in a format suitable for the loader and execute it on the Pep/8 simulator.

Use a document editor and create a hexadecimal listing for your program similar to the listing shown in. DO NOT create a binary machine language listing.

Turn in your machine code file that you saved from the Pep/8 (it should have a .pepo file extension) and your listing.

Explanation / Answer

CHARI 0xFE,d ; read 1st char CHARI 0xFF,d ; read 2nd char LDBYTEA 0xFE,d ; load 1st char ADDA 0xFE,d ; add 2nd char to low byte (big endian!) ANDA 0x0F,i ; keep low 4 bits ORA 0x30,i ; convert to ascii STBYTEA 0xFD,d ; store for output CHARO 0xFD,d ; write result STOP .END