NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

First:
move #14,D0 Display string
lea prompt1,A1
trap #15
move #4,D0 Input num1 to D1
trap #15
move.l D1,-(SP) push num1 to stack
move.l D1,D4 move num1 to keep

move.l #300,D2 Upper limit
cmp D1, D2 Compare user input to upper lim
bhi Second
blo Error1

Second:
move #14,D0 Display string
lea prompt2,A1
trap #15
move #4,D0 Input num2
trap #15
move.l D1,-(SP) push num2
move.l #0,-(SP) make room for sum on the stack
move.l D1,D5 move num2 to keep

move.l #300,D2 Upper limit
cmp D1, D2 Compare user input to upper lim
bhi MoveOn
blo Error2

MoveOn:
*add
bsr Adder
move.l (SP)+,D1 pull sum, D1 = sum
lea (8,SP),SP clean up stack
move #14,D0 Display string
lea result1,A1
trap #15
move #3,D0
trap #15

bsr newLine

move.l D4,-(SP) push num1 to stack
move.l D5,-(SP) push num2 to stack

*multiply
bsr Multiplier
move.l (SP)+,D1 pull product, D1 = prod
lea (8,SP),SP clean up stack
move #14,D0 Display string
lea result2,A1
trap #15
move #3,D0
trap #15

SIMHALT ; halt simulator

Error1:
move #14,D0
lea error,A1
trap #15
move (SP)+,D3 Pull incorrect num1 from stack
bsr newLine
bra First

Error2:
move #14,D0
lea error,A1
trap #15
move (SP)+,D3 Pull incorrect num2 from stack
bsr newLine
bra Second



*----------------------------
offset 4+4
sum ds.l 1
num2 ds.l 1
num1 ds.l 1
org *

Adder
link A0,#0 create stack frame
move.l (num1,A0),D0
add.l (num2,A0),D0
move.l D0,(sum,A0)
move.l (SP)+,D0
unlk A0
rts

*----------------------------
offset 4+4
prod ds.l 1
num4 ds.l 1
num3 ds.l 1
org *

Multiplier
link A0,#0 create stack frame
move.l (num3,A0),D0
mulu (num4,A0),D0
move.l D0,(prod,A0)
move.l (SP)+,D0
unlk A0
rts

newLine
movem.l d0/a1,-(SP) push d0 & a1
move #14,d0 task number into D0
lea crlf,a1 address of string
trap #15 display return, linefeed
movem.l (SP)+,d0/a1 restore d0 & a1
rts return

* Put variables and constants here
prompt1 dc.b 'Sláðu inn fyrri tölu: ',0
prompt2 dc.b 'Sláðu inn seinni tölu: ',0
error dc.b '** Tala er ekki á réttu bili, reyndu aftur **',0
result1 dc.b 'Summa talnanna er: ',0
result2 dc.b 'Margfeldi talnanna er: ',0
crlf dc.b $d,$a,0
END START ; last line of source
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.