Question

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
Was it helpful?

Solution

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. . .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top