0

I want to read numbers from a file, but when I do is everything read from the file put into the buffer? Or only 1 number? File would contain 5 6 7 10 9

This would be what I'm using to read from the file: (EASy68K program)

    ORG    $1000
START:                  ; first instruction of program

    lea     filename,a1
    move #52,d0
    trap #15

    lea     buffer,a1
    move    #datasize,d2    # bytes to read
    move    #53,d0          read from file
    trap    #15

    SIMHALT             ; halt simulator

filename    dc.b    'test1.txt',0

    END    START        ; last line of source
emanyalpsid
  • 329
  • 1
  • 5
  • 19

1 Answers1

0

That should read datasize bytes into memory starting at buffer. How many numbers that loads will depend on how large the numbers are and how big datasize is. If datasize is 1, then it will only load one number. If datasize is 3, then it will load 5 6.

Assuming I'm reading the code correctly ... it's been a few years. . .

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351
  • Does it work so that If i read 1 datasize, then loop back and read the next it will read 6? – emanyalpsid Mar 18 '13 at 02:27
  • It reads 1 character at a time. So the first time through it would read `5`. The second time, it would read the space. Third time it would read `6`. – Jim Mischel Mar 18 '13 at 03:09