From 8401e5bbb3a08e0bf9d33a869e4582ced721faa0 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Fri, 12 Aug 2022 11:50:59 +0300 Subject: [PATCH] minor persist fix --- README.md | 2 +- equi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48fab1c..814c8cb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Main features of an Equi machine: - Instruction ignore (II) flag; - 16-bit input buffer pointer; - 42752 bytes of main RAM (0x0000-0xa6ff), 41984 bytes of which are available for the program and data and 768 bytes hold the three stacks and necessary service registers listed above; -- Up to 2GB flat persistent storage (tape, disk, flash etc); +- Up to 4GB flat persistent storage (tape, disk, flash etc); - Serial terminal input and output; - Up to 65535 peripheral extension ports, including several virtual ports. diff --git a/equi.c b/equi.c index 789456e..71c479e 100644 --- a/equi.c +++ b/equi.c @@ -308,7 +308,7 @@ ushort crc16(const uchar* data_p, uchar length) { ushort persistOp(FILE *pfd, ushort maddr, ushort dataLen, ushort adl, ushort adh, uchar isWrite) { ushort status = 0, proc; if(pfd) { - fseek(pfd, ((adh&0x7fffu) << 15) | adl, SEEK_SET); + fseek(pfd, ((unsigned long) adh << 16) | adl, SEEK_SET); if(isWrite) /* writing to the persistent area from the memory */ proc = (ushort) fwrite(&flatram[maddr], 1, dataLen, pfd); else /* reading from the persistent area into the memory */