Question

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python. NO PYTHON...

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python.

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python.

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python.

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python.

NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python.

Write a program in Pep/8 or Pep/9 object code that will read an integer between 0 and 15 from the keyboard and display its equivalent in binary. Example: Input: 11 Output: 1011 Hint: you must take the remainder of the division of the integer by 2 and divide and again take the remainder of new quotient for a total of 4 times, each time saving the remainder and then display the four remainders in reverse order. For example, remainder of 11 over 2 is 1, remainder of 5 over 2 is 1, remainder of 2 over 2 is 0 and remainder of 1 over 2 is 1. Printing these remainders in reverse order produces 1011.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • 49 00 // read 1st char
  • 49 00 // read 2nd char
  • 49 00 // read 3rd char
  • 49 00 // read 4th char

// four characters are read because for 0-15 4 bits are required//

  • d1 00          // load 1st char to the accumulator
  • 80 00 30      // subtract it 30
  • 1c             // multiple by 2
  • e1 00            // store <-1st
  • c0 00 00      // make accum 0
  • d1 00          // load 2nd char
  • 80 00 30      // sub 30
  • 1c           // multiply by 2
  • e1 00           // store <-2nd
  • c0 00 00       // accum to 0
  • d1 00          // load 3rd
  • 80 00 30       // subtract 30
  • e1 00           // store <-3rd
  • c0 00 00       // accum to 0
  • d1 00          // load 4th
  • 80 00 30       // subtract 30
  • e1 00           // store <- 4th
  • c0 00 00       // accum to 0
  • c1 00        // load address for 1st
  • 71 00         // add 2nd
  • 71 00         // add 3rd
  • 71 00        // add 4th
  • e1 00       // save
  • 39 00       // displays the final output binary equivalent
  • 00
  • zz
Add a comment
Know the answer?
Add Answer to:
NO PYTHON 8 CODE PLEASE.! it's PEP/8 the assembler, nothing to do with python. NO PYTHON...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Assembly Language Please display results and write assembler code in (gcd.s) The Euclidean algorithm is...

    In Assembly Language Please display results and write assembler code in (gcd.s) The Euclidean algorithm is a way to find the greatest common divisor of two positive integers, a and b. First let me show the computations for a=210 and b=45. Divide 210 by 45, and get the result 4 with remainder 30, so 210=4·45+30. Divide 45 by 30, and get the result 1 with remainder 15, so 45=1·30+15. Divide 30 by 15, and get the result 2 with remainder...

  • Written in python programming for MyProLab :) Please use simple code Assume the availability of a...

    Written in python programming for MyProLab :) Please use simple code Assume the availability of a function called printStars. The function receives an integer value as an argument. If the argument is positive, the function prints (to standard output) the given number of asterisks. Thus, if printStars(8) is called, ******** (8 asterisks) will be printed. Assume further that the variable starCount has been declared and initialized with an integer value, possibly negative or zero. Write some code that does nothing...

  • Only do Q2 please!!! please Type the code in python!!!thanks Only do Q2 please!!! please Type...

    Only do Q2 please!!! please Type the code in python!!!thanks Only do Q2 please!!! please Type the code in python!!!thanks 1. (10 points) (Without Python) Unfortunately, Eddard is lost in the dark dungeon of the Red Keep. He knows there are three doors, and one of the doors will lead him to freedom. If Eddard takes Door A, he will wander around the dungeon for 3 days and return to where he started If he takes Door B, he will...

  • IN PYTHON! Radix Conversion(*UP TO BASE 37*) Constraints: • Use only basic arithmetic and comparison operations....

    IN PYTHON! Radix Conversion(*UP TO BASE 37*) Constraints: • Use only basic arithmetic and comparison operations. Do not make any function calls other than the recursive call to convertBase Write a recursive function: convertBase(n,base) that will convert the non-negative decimal number n (type integer) to the specified base and return it as a string. Note that decimal values can be converted to a different number base by repeatedly dividing the residual quotient of n // base until it is zero,...

  • python 3 please, for these questions you do not need to write the whole code just...

    python 3 please, for these questions you do not need to write the whole code just the expression 1)Write a loop that reads positive integers from standard input, printing out those values that are greater than 100, each on a separate line, The loop terminates when it reads an integer that is not positive. 2) Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop...

  • PLEASE DO IN PYTHON Program 2: Design (pseudocode) and implement (source code) a program (name it...

    PLEASE DO IN PYTHON Program 2: Design (pseudocode) and implement (source code) a program (name it FeetMeters) to display a conversion tables for feet and meter as show below. Document your code and properly. Feet Meter 1.0 0.305 2.0 0.610 3.0 0.915 . . . . . . 19.0 5.7.95 20.0 6.100 Meter Feet 1.0 3.279 2.0 6.558 3.0 9.837 . . . . . . 19.0 62.301 20.0 65.574 The program defines the following methods: Method feetToMeter() converts from...

  • This is for programming using Python with the JES software. Please write the code with the...

    This is for programming using Python with the JES software. Please write the code with the proper indentation. Thanks! Problem 1: Write a function that takes 2 arguments (integer or float) and computes the sum, difference, product, and quotient of the arguments. Once you calculate the values you should print out statements telling the user what arguments we used to compute the values and what the result of each calculation (your function should produce 5 lines of output in the...

  • 1. Please write the following code in Python 3. Also, please write code and not psedo-code....

    1. Please write the following code in Python 3. Also, please write code and not psedo-code. 2. Please also share your code and show all outputs. Write code that uses the string stored in org and creates an acronym which is assigned to the variable acro. Only the first letter of each word should be used, each letter in the acronym should be a capital letter, and there should be nothing to separate the letters of the acronym. Words that...

  • PLEASE DO NOT COPY CODE FROM OTHER QUESTIONS POSTED WITH THIS. THAT IS C++ NOT PYTHON...

    PLEASE DO NOT COPY CODE FROM OTHER QUESTIONS POSTED WITH THIS. THAT IS C++ NOT PYTHON Please follow the step below. 1. You need to develop a multithread program in PYTHON to simulate a checkout in supermarket. The process of simulation will last for T1 seconds. You do not need to consider thread safety. 2. An integer sequence t is used to record the remaining waiting time for each customer. 3. One thread which runs every one second is used...

  • (+30) Provide a python program which will Populate an array(list) of size 25 with integers in...

    (+30) Provide a python program which will Populate an array(list) of size 25 with integers in the range -100 (negative 100)   to +100 inclusive Display the array and its length (use the len function) Display the average of all the integers in the array Display the number of even integers (how many) Display the number of odd integers (how many) Display the number of integers > 0   (how many) Display the number of integers < 0   (how many) Display the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT