Jump to content

Help Assembling Program

Featured Replies

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.

 

 

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.