EASy68K
http://easy68k.com/EASy68Kforum/

Displaying a number on the screen
http://easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=1211
Page 1 of 1

Author:  engineerbball3000 [ Sat Sep 14, 2013 10:57 pm ]
Post subject:  Displaying a number on the screen

I am trying to display the number in D4 onto the screen. How do I go about doing this.
how do I display the number in a data register?
Code:
         ORG   $1000
NUMBER: DC.B    '8102'
   DC.B   0
TOKEN:    DS.L   1
   DC.B   0
   ORG   $2000
START:   MOVEA.L   #NUMBER,A3
   MOVEA.L   #TOKEN,A4
   CLR.L   D5
   CLR.L   D2
   MOVE.B   (A3)+,D0   
   ANDI.B   #$F,D0
   MOVE.B   D0,D1
   MOVE.B   D1,D4
LOOP:   MOVE.B   (A3)+,D0
   ANDI.B   #$F,D0
   MULU.W   #10,D4
   ADD.B   D0,D4
   ADD.B   #1,D2
   CLR.L   D0
   CMP.B   #3,D2
   
   BNE   LOOP
LOOP2:   
        MOVE.B     D4,(A4)+
   ADD.B   #1,D5
   CMP.B   #4,D5
   BNE   LOOP2

   MOVE.L   (A4),(A1)
   MOVE.B   #13,D0
   TRAP   #15

   MOVE.B   #9,D0
   TRAP   #15      

   END   START

Author:  profkelly [ Sun Sep 15, 2013 12:54 pm ]
Post subject:  Re: Displaying a number on the screen

Trap task 3 displays the contents of D1.L as a number. Move the number from D4 to D1 then use the trap task to display it.
Code:
    MOVE.L  D4,D1       number to display to D1
    MOVE    #3,D0       task number 3 into D0
* task number 3 is used to display the contents of D1.L as a number
    TRAP    #15         display number in D1.L

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/