Jump to content

Help me

Liam-McShane

Right i have been given this task for college and none of us in our class have ever programmed before so we are total noobs. We where asked to:

 

"Create a low level (machine code) program to mimic an electronic stock control program which could be used on a fridge by enabling the following.

 

·       Entry of a number of items in the fridge (e.g. eggs) storing this in a specified location.

·       The continued deduction of eggs until either there are no eggs left or the end of the week is reached. This should be signalled by the user entering 0.

·       The output should then be the number of eggs which should be bought to make up the number."

 

Basically our teacher did one half for me and the other half for a friend and we merged our program to make the whole program. Now we took photos of us going through the program but we're not sure what the numbers entered mean and what the numbers in the register mean either. 

 

 

 

Thank you for your help (If it's even possible to help us)

Simple Stryker (Now Finished  ;) )


The Terrible HP


 

Link to comment
Share on other sites

Link to post
Share on other sites

So where is the actual program dude?

As far as i am aware we used a program called "Little Man Computer" to make the the program and run it. The Album is pictures of the program.

Simple Stryker (Now Finished  ;) )


The Terrible HP


 

Link to comment
Share on other sites

Link to post
Share on other sites

You can use arrays to store the information that is in use, but it's RAM hungry.

Link to comment
Share on other sites

Link to post
Share on other sites

Post the program in github or something.

Link to comment
Share on other sites

Link to post
Share on other sites

Post the program in github or something.

As bad as the photos are, the code is still fairly readable :P

 

Anyways Liam the number in the register is just a bit of extra memory in the CPU where the CPU is storing temporary numbers.  It is hard to see based on when you took pictures, but I am guessing after the READ if you enter say 11 the number will be 11 in the register (as READ reads into the register).  The store will then store the number in register to the memory address.

 

As for the numbers entered.  Well first is eggs you have, then eggs that you have used, and 0 being ending it.

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×