Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *-----------------------------------------------------------
- * Title : my 2nd program
- * Written by : GW
- * Date : 21/05/2015
- * Description: mój pierwszy program wypisujący liczby od 1 do 100
- *-----------------------------------------------------------
- ORG $1000
- START: ; first instruction of program
- * Put program code here
- move.l #1,d3
- move.b #1,d2
- PETLA:
- add.b d3,d4
- bsr.w printnumber
- bsr.w printchar
- addi.b #1,d3
- * bsr newLine
- cmp.b #10+1,d3
- bne.s PETLA
- bsr.w printequalsign
- move.b d4,d1
- move.b #20,d0
- trap #15
- SIMHALT
- printnumber:
- move.b d3,d1
- move.b #20,d0
- trap #15
- rts
- printchar:
- move.b plus,d1
- move.b #6,d0
- trap #15
- rts
- printequalsign:
- move.b rowne,d1
- move.b #6,d0
- trap #15
- rts
- newLine:
- movem.l d0/a1,-(a7); push d0 & a1
- move #14,d0 ; task number into D0
- lea crlf,a1 ; address of string
- trap #15 ; display return, linefeed
- movem.l (a7)+,d0/a1; restore d0 & a1
- rts ; return
- * SIMHALT ; halt simulator
- * Put variables and constants here
- crlf dc.b $d,$a,0 carriage return & line feed, null
- plus dc.b '+'
- rowne dc.b '='
- END START ; last line of source
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement