Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 21st, 2006, 05:52 AM
Balor Balor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Location: Melbourne Australia
Posts: 3 Balor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 1 m 22 sec
Reputation Power: 0
MARIE Help: Multiplication SubRoutine

G'day all, newbie programmer here whose touching on a variety of differnet languages at the moment. I've come across the MARIE Machine Simulator and encountered some problems.

First off, some info on Marie:

"*MarieSim is an environment within which you can write your own programs and watch how they would run on a real "von Neumann architecture" computer system...MarieSim was written in the Java language so that the system would be portable to any platform for which a Java Virtual Machine (JVM) is available."

*Taken from: A Guide to the MARIE Machine Simulator Environment Accompanying The Essentials of Computer Organization and Architecture by Linda Null and Julia Lobur.

Basically i can't fix some Logical Bugs in this Multiplication Sub Routine (And MARIE isn't working for me so i'm down to trying to fix it without the program itself) and am asking for some feedback and guidence on what can be done without changing the code structure. I've personally fixed most of the problems involved but still cannot get the thing to work 100% correctly. Code as follows:

PHP Code:
/Multiplication SubRoutine Program

/Global Variables

         ORG          0200          
/GLOBAL data areas
X
,       DEC          0000          /Multiplicand
Y
,       DEC          0000          /Multiplier (Used as counterterminate if 0)
M,       DEC          0000          /Product (Used as Sum and receives outputs)
One,     DEC          1             /Constant “1”

/Multiply Subroutine

MPY
,     HEX          0000          /Entry Point and Return Address (guessing problem is here)
Load     X                          /Initialise Multiplicand
Store    M

MPY1
,    Load         Y             /Decrement Multiplier
Subt     One
Skipcond 01                         
/Skip if zer0
JumpI    MPY                        
/Multiply Complete: RETURN
Load     M                          /Add value X to sum in M
Add      X
Store    M
Jump     MPY1                       
/loop for next Iteration
END 


Example Input for x and y as 5 and 3 (Set above to 0 and 0 for ease sake) so that the program does the following calculation:

(x)5 * (y)3 = (m)15 or rather 5 + 5 (loop 1) + 5 (loop 2)

Using the good old pen and paper and follwing the algorithm, this is what the above code should do:

....................X..........Y..........M..........ONE
Initialised:......5...........3..........5............1
LOOP1:..........5...........2..........10..........1
LOOP2:..........5...........1..........15..........1
LOOP3:..........5...........0..........Loop Terminates.

Once the Loop Terminates, it jumps to MPY which doesn't make sense at the moment. If i move the MPY line to just above the End line, this should make the program work right?

For those who are familiar with MARIE, the error i'm recieving is that once i've downloaded it and placed it in a folder named MARIE i am meant to type in command prompt:

"jar xvf MarieSim.jar" to uncompress the program
and
"jar xvf MarieSource.jar" to uncompress the Source

However, it comes up with an error that it does not recognise the jar command even though i have installed Java SDK 1.4.0 which is what it requires.

Many thanks to those who read this and even more so to those that help out and i hope this post is coherent and through enough to convey the problem.

Cheers

Balor

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > MARIE Help: Multiplication SubRoutine


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway