Core War is a programming game introduced to the public in the early 1980s [DEWD84], which was popular for a period of 15 years or so. Core War has four main components: a memory array of 8000 addresses, a simplified assembly language Redcode, an executive program called MARS (an acronym for Memory Array Redcode Simulator) and the set of contending battle programs. Two battle programs are entered into the memory array at randomly chosen positions; neither program knows where the other one is. MARS executes the programs in a simple version of time-sharing. The two programs take turns: a single instruction of the first program is executed, then a single instruction of the second, and so on. What a battle program does during the execution cycles allotted to it is entirely up to the programmer. The aim is to destroy the other program by ruining its instructions. In this problem and the next several, we use an even simpler language, called CodeBlue, to explore some Core War concepts. CodeBlue contains only five assembly language statements and uses three addressing modes (Table B.4). Addresses wrap around, so that for the last location in memory, the relative address + 1 of refers to the first location in memory. For example, ADD #4, 6 adds 4 to the contents of relative location 6 and stores the results in location 6; JUMP @5 transfers execution to the memory address contained in the location five slots past the location of the current JUMP instruction. a. The program Imp is the single instruction COPY 0, 1.What does it do? b. The program Dwarf is the following sequence of instructions: ADD #4, 3 COPY 2, @2 JUMP -2 DATA 0 What does it do? c. Rewrite Dwarf using symbols, so that it looks more like a typical assembly language program.
Students also viewed these Computer Sciences questions
Fill in the blanks in each of the following statements: a) Computers process data under the...... c)... two CPUs and a quad-core processor has four CPUs. h) Windows 10 introduced the_________for building Windows apps that run on desktop computers, notebook computers, tablets, phones, Xbox and even...
Valero Energy is North America\'s largest refiner. When they recently acquired some competing...... ... its systems rather than creating middleware? 2. What benefits does the SOA provide to businesses such as Valero? Critical Thinking Questions 1. Why is it important to maintain a reasonably sized...
Programming Exercise finds a convex hull for a set of points entered from the console. Write a...... ... used for the points. Implement the algorithm using the following method: Write a test program that prompts the user to enter the set size and the points and displays the points that form a...
Smith Die Company manufactures cutting dies for the shoe industry. Each set of dies is custom designed to a customers templates. During the first week of May, six orders were received from customers. They were assigned job numbers 1005 to 101 0.The following transactions occurred during the first...
Jaymes Corporation produces high-performance rotors. It expects to produce 50,000 rotors in the coming year. It has invested $10,000,000 to produce rotors. The company has a required return on investment of 12%. What is its ROI per unit?
The SAT scores of randomly selected applicants to colleges. Qualitative versus Quantitative Data. In Exercises, determine whether the data described are qualitative or quantitative,and explain why?
Prepare a cost of production report for the Cutting Department of Dalton Carpet Company for January 2014. Use the average cost method with the following data: Work in process, January 1, 3,400 units, 75% completed............$ 23,000Materials added during January from Weaving Department, 64,000...
I have to compare two plants from the same company, one is a plant in Canada and one is in the U.S. (ALL NUMBERS ARE ALREADY IN CANADIAN). Here is the data CANADA: Yearly Cost of Absenteeism $480,244 Total Salary $7,766,096 Percentage of Salary 6% Number of Working Days 251 Average Salary Per Day...
ATP synthase is a well conserved multimeric protein. All organisms studied to date contain homologs of 8 different subunits which are essential for the complexes function. However, you have just completed sequencing the genome of a novel organism, which despite having a functional ATP synthase, it...
Lickety Split sells ice cream cones in a variety of flavors. Data for a recent week appear here: The manager estimates that if she were to increase the price of cones from $1.75 to $1.93 each, weekly volume would be cut to 850 cones due to competition from other nearby ice cream...