Question

In: Computer Science

Write LMC assembly code that prints the minimum of two numbers. HINT: use and extend the...

Write LMC assembly code that prints the minimum of two numbers.

HINT: use and extend the table below for your solution.

Mailbox

Mnemonic

Code

Instruction description

Solutions

Expert Solution


Little Man Computer - LMC - is a simulator that mimics the modern computer architecture, known as von Neumann architecture.

Von Neumann Architecture

The Von Neumann architecture, illustrated in the following image, consists of five major components with machine equivalent of division of labour.
They are,

  1. Input-Output Unit
  2. Control Unit
  3. Logic Unit
  4. Memory
  5. BUS

Input-Output Unit
The unit allows a user interact with the computer while providing it with an input in anticipation of an output.
Control Unit
This unit deals with the handling of instructions, processing of the data, storing it in memory and reading it back from it at the right moment.
Logic Unit
This unit is responsible for carrying out basic mathematical operation such as addition, subtraction etc.
Memory
This section stores data and the instructions to deal with data.
BUS
This is the machine equivalent of umbilical chord - the connector of the other four parts to the motherboard.

LMC assembly code that prints the minimum of two numbers.

INP
STA first
INP
STA second

SUB second
BRP secondBig
LDA second
OUT
BRA endProgram
secondBig LDA second
OUT
endProgram HLT
first DAT
second DAT

Mailboxes:

First, there is a series of one hundred mailboxes, each numbered with an address ranging from 00 to 99. This numbering system is chosen because each mailbox address can be represented by two digits, and this is the maximum number of mailboxes that can be represented by two decimal digits.

Each mailbox is designed to hold a single slip of paper, upon which is written a three-digit decimal number. Note carefully that the contents of a mailbox are not the same as the address of a mailbox. This idea is consistent with what you already know about your post office box: your post office box number .

Mnemonic Code:

A code that can be remembered comparatively easily and that aids its user in recalling the information it represents. ... Mnemonic codes are widely used in computer programming and communications system operations to specify instructions.

Mailboxes: Mnemonic code Instruction specification
INP 901 Input data
SUB 1xx substract data
LDA 2xx load the data
OUT 3xx output data
BRA 4xx Branch to specified cell
HLT HLT Break Execution
DAT Treat code as data

Related Solutions

Write an Assembly code to input two integer numbers from keyboard, computes the division of two...
Write an Assembly code to input two integer numbers from keyboard, computes the division of two numbers WITHOUT using division operator and print out the reminder and quotient to the screen. Note: program using “division operator” will earn no credit for this task. You are ALLOWED to use the “print” and “read” macro
Write in assembly 8086. Write a program to input nine numbers in 4*4 array and prints...
Write in assembly 8086. Write a program to input nine numbers in 4*4 array and prints the maximum value of each row and then prints the minimum of each column.
use java Write a program that, given two binary numbers represented as strings, prints their sum...
use java Write a program that, given two binary numbers represented as strings, prints their sum in binary. The binary strings are comma separated, two per line. The final answer should not have any leading zeroes. In case the answer is zero, just print one zero i.e. 0 Input: Your program should read lines from standard input. Each line contains two binary strings, separated by a comma and no spaces. Output: For each pair of binary numbers print to standard...
in java Write an application that gets two numbers from the user and prints the sum,...
in java Write an application that gets two numbers from the user and prints the sum, product, difference and quotient of the two numbers in a GUI.
Write an assembly program (Data and Code) that uses loop to read 10 numbers and output...
Write an assembly program (Data and Code) that uses loop to read 10 numbers and output the largest of those numbers, you can assume any length for those numbers. 80x86 assembly language
Write an assembly code in MIPS program that can read 3 numbers from the user and...
Write an assembly code in MIPS program that can read 3 numbers from the user and print the following: a. The summation b. The average c. The minimum d. The maximum e. Print the values between the minimum and maximum f. Write comments to explain each line in your code -look at Fibonacci code- (no comments mean zero for the assignment ) use MARS MIPS .
Write an assembly language program that prints your first name in the output. Use immediate addressing...
Write an assembly language program that prints your first name in the output. Use immediate addressing with a hexadecimal constant to designate the operand of CHARO for each letter of your name. Comment each line except STOP and END. Cut and paste the Assembler Listing into your document and paste a screen shot of the Output area of the Pep8. Use the name "Kevin" as example Assembler Listing Screen Shot of Output area of the Pep8 program
Use cardinality to show that between any two rational numbers there is an irrational number. Hint:...
Use cardinality to show that between any two rational numbers there is an irrational number. Hint: Given rational numbers a < b, first show that [a, b] is uncountable. Now use a proof by contradiction
Write a Java method called printAvg that takes in two floating point numbers and prints out...
Write a Java method called printAvg that takes in two floating point numbers and prints out the average of them.
Write a C++ code to insert the following numbers in two Linked Lists. Insert numbers of...
Write a C++ code to insert the following numbers in two Linked Lists. Insert numbers of first list in Linked List#1, and numbers of second list in Linked List#2. Do not insert both lists in a single Linked List. List#1. 5, 78, 45, 23, 11, 89, 10, 78, 6, 99, 876, 5, 67, 13 List#2. 5, 89, 688, 52, 557, 953, 5, 7, 55, 35, 89, 99, 99, 6, 557, 89, 5, 99, 6, 2, 45, 12, 7, 6, 94,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT