Find Jobs
Hire Freelancers

Write some Software

$10-30 USD

Cerrado
Publicado hace alrededor de 8 años

$10-30 USD

Pagado a la entrega
This project involves the development of an interpreter for the assembly language of a virtual machine called CSU_VM. This virtual machine has the following features: Memory Addressing CSU_VM can address only 64 integer addresses. They are numbered from 0 – 63. Registers CSU_VM has 4 registers. They are numbered 0 – 3. Operations CSU_VM can perform the following operations: Memory LOAD [mem_address],[register] : Loads the content of [mem_address] into [register]. Example: let’s suppose that memory address 60 contains the number -3. Then LOAD 60, 3 puts the number -3 into the third register of the processor. Load only works from main memory to registers, not among registers STOR [mem_address],[register] : Loads the content of a register into the memory address. For example let’s say that register 1 contains the number -25. STOR 55, 1 puts the number -25 into the memory address 55. Arithmetic ADD [register1],[register2] :Adds the [register2] + [register1] and stores the result in [register1] SUB [register1],[register2] : Subtracts [register1] - [register2] and stores the result in [register1] MUL [register1],[register2] : Multiplies [register1] * [register2] and stores the result in [register1] DIV [register1],[register2]: Performs an integer division of [register1]/[register2] and saves the result on register1 MOD [register1],[register2]: Returns the modulus of dividing register1/register2 and saves the result on register1 Logic CMP [register1], [register2], line_number: Checks if register1 is equals to register2 and if true, it jumps to the line_number specified. GRT [register1], [register2], line_number: Checks if register1 is greater than register2 and if true, it jumps to the line_number specified. LSS [register1], [register2], line_number: Checks if register1 is smaller than register2 and if true, it jumps to the line_number specified. Other STOP: Finishes the execution of a program. How a program for CSU_VM looks like? A program in CSU_VM starts by setting up the initial values for the main memory. If no value is set, it is assumed to be 0. Initially, the values stored in the registers are set to 0. For example the following program calculates the sum of the numbers from 1 to 10, and stores the result of the sum in the memory address # 62. A line that starts with # denotes a comment and should not be interpreted as a statement (instruction). # sets the memory address 0 to store the value 1. M stands for memory. M:0=1,1=11 # All programs starts with an initial setup of values in memory such as the example shown above 0 LOAD 1,3 1 LOAD 0,2 2 ADD 1,2 3 ADD 0,1 4 LSS 1,3,2 5 STOR 62,1 6 STOP After the program stops your program should create a text file named CSU_VM_success_[date_in_millisecons].txt and dump the following data
ID del proyecto: 9885586

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos

Sobre este cliente

Bandera de UNITED STATES
United States
0,0
0
Miembro desde mar 8, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.