EASy68K  
It is currently Wed Sep 19, 2018 4:43 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Mar 11, 2011 7:34 am 
Offline

Joined: Thu Mar 10, 2011 4:09 am
Posts: 8
how do i print a number from a data register to a textfile?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2011 5:25 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1080
Trap task 54 writes the contents of a memory buffer to a file. To save the contents of a register to a file it will be necessary to save the register to a memory buffer then save the buffer to file.

Code:
*-----------------------------------------------------------
* Write register D3 to text file.
*-----------------------------------------------------------
        ORG   $1000

start   lea     filename,a1
        move    #52,d0      open new file
        trap    #15

        lea     buffer,a1   buffer
        move.b  d3,(a1)     store d3 to buffer
        move    #1,d2       # bytes to write
        move    #54,d0      write buffer to file
        trap    #15

        move    #50,d0
        trap    #15         close all files

        move.b  #9,D0
        trap    #15         Halt Simulator

filename    dc.b    'test1.txt',0
buffer      ds.b    80

        END   start


_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group