commit 8401e5bbb3a08e0bf9d33a869e4582ced721faa0
parent d736ab301961c78647f12c36ad14dadf429f9400
Author: Luxferre <lux@ferre>
Date: Fri, 12 Aug 2022 11:50:59 +0300
minor persist fix
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git 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
@@ -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 */