Jump to content

Recommended Posts

Posted

I'm sorry for this noob topic but I really need help. I'm not asking anyone to do the program for me but I need some guidance and my professor did not help me at all when I went to visit him.

 

Assignment: This assignment is designed to help you get more familiar with basic assembly language instructions, the IO macros, and the bsvc system. For this assignment, you will write a program in Motorola M68000 assembler that takes as input a four digit year, and prints the day of the week for Christmas of that year.

 

 

 

 

Here is the formula to solve the problem:

 

 

 

Input:

 

Month Hardcoded, month = 12

 

Day Hardcoded, day = 25

 

Year Input from keyboard.

 

 

 

The Formula:

 

 

 

a = (14 - month) / 12

 

y = year - a

 

m = month + 12 * a - 2

 

d = (day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12) ) % 7

 

 

 

Here is what I have so far but I am stuck

 

 

 

Prompt: dc.b "Enter the year"0

 

buffer: ds.b 82

 

 

 

Start: InitIO

 

SetEVT

 

lineout prompt

 

linein buffer

 

Cvta2 buffer,#4

 

moveq #12,D1

 

moveq #25, D2

 

moveq #14,D7

 

sub.w D1,D7

 

ext.l D7

 

divu #12,D7

 

 

 

 

So my next step is to do the y = year - a part of the formula right? Could someone please explain what to do just for this one step?

 

Here is the full link to the assignment http://pindar.sdsu.edu/cs237/prog2.html

 

Again I'm sorry I'm such a beginner and I feel bad just asking what to do but if you could just help me with this one step it will give me a better idea of what to do moving forward. Thanks.

 

 

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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.