1 Replies - 747 Views - Last Post: 11 November 2018 - 08:08 AM

#1 mecke   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 23-September 18

[TASM] Read from text file ending

Posted 31 October 2018 - 11:39 AM

Hello everyone, first of all I would like to apologize for my language, it's hard for me to explain.

I've written a program in TASM to take two files with decimal numbers in it, XOR them and put the answer in the third text file. The problem is with the BUFFER and reading from the end. I will give some examples.
If BUFF equals 5 and I have files with 1010 and 001 in them the answer is 1011 - and it's correct.
However if BUFF=5, and I have 1010000 and 001, the answer is 1010100. I don't know if assembly has some kind on INT to read files from the end, it would help me even if it would be backwards.

If anyone has some kind of idea what to do, please give me your opinion. Thank you

Is This A Good Question/Topic? 0
  • +

Replies To: [TASM] Read from text file ending

#2 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 172
  • View blog
  • Posts: 1,114
  • Joined: 03-April 12

Re: [TASM] Read from text file ending

Posted 11 November 2018 - 08:08 AM

Sorry, but you just need to buffer the whole files, or use seek. You should read at least 512 bytes at once, if you read from a disk, because that's the disk block size. You end up reading that anyway, whether you use it all or not. If not, you end up reading stuff multiple times.
For seeking, you need to know the size of the file, or determine that yourself.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1