Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *
- start: initIO * Initialize (required for I/O)
- setEVT * Error handling routines
- * initF * For floating point macros only
- lineout title
- lineout prompt1
- linein buffer
- cvta2 buffer,#2 *<location>,<length>
- subq.l #1,D0
- move.l D0,D1 *copy (month-1) to D1
- muls #10,D0 *(n-1)(10) OR (Month - 1)*10
- lea months,A0
- adda.l D0,A0 *Index A0 is at first letter of month
- move.l (A0)+,date
- move.l (A0)+,date+4
- move.w (A0),date+8 *move word word long 4 + 4 + 2 = 10 (ex: May
- muls #4,D1 *(index-1)*4 = D1
- lea date,A0
- lea length,A1
- adda.l D1,A1 *moves pointer of A1 to the number needed
- adda.l (A1),A0 *uses the value where A0 is pointing to in order to move the cursor to A1
- move.b buffer+3,(A0)
- move.b buffer+4,1(A0) *adds the bytes to the
- stripp (A0),#2
- adda.l D0,A0
- move.b #',',(A0)
- adda.l #1,A0
- move.b buffer+6,(A0)
- move.b buffer+7,(A0)
- move.b buffer+8,(A0)
- move.b buffer+9,(A0)
- adda.l #1,A0
- move.b #'.',(A0)
- adda.l #1,A0
- clr.b
- lineout answer
- break * Terminate execution
- *
- *----------------------------------------------------------------------
- * Storage declarations
- months: dc.b 'January '
- dc.b 'Feburary '
- dc.b 'March '
- dc.b 'April '
- dc.b 'May '
- dc.b 'June '
- dc.b 'July '
- dc.b 'August '
- dc.b 'September '
- dc.b 'October '
- dc.b 'November '
- dc.b 'December '
- length dc.l 7,8,5,5,3,4,4,6,9,7,8,8
- title: dc.b 'Program #1, masc0270, Sinjin Ly',0
- prompt1: dc.b 'Enter a date in the form MM/DD/YYYY',0
- buffer: ds.b 80
- answer: dc.b 'The date entered is '
- date: ds.b 25
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement