ţţĹčX;SAVE #D9:FMSRAMIO.M65ň3AŹ Simulated Sector I/O to RAMDISK (130XE)AüX;!‡RAMDISK;; only if asked for!X;X;$/X; first, some equates unique to RAMDISK I/O.X;8 ‡ZSECPTR2;; share with SIO!B0‡ZRAMPTR†ZTEMP1;; share with error exit ptr!LX;V"ŠMAINMEMORY;; per Atari spec`X;jX;tX; do RAMDISK sector I/O!~X;ˆ …RAMIO’ Q†DCBSECœ P†ZTEMP1;; must be preserved!Ś6;; save read/write flag°+Q†DCBSEC;; high byte of sector numberş/X; (ramdisk sector # is 1 through 511, $1FF)ÄX;Î+T†ZTEMP1;; 128 sectors=16K bytes, a bankŘU?;; so A has bank numberâX; (safety check)ě(R>;; A must have a value of 0 to 3!öD†:SECOK;; phew!8;; clean up stack .%>…E.NAK;; "disk" didn't like sector number"H‡:RAMRTS;; return with boo-booX;( †:SECOK2, ‡RAMSYNC;; synchronize with VBLANK, etc.<;(also sets up bank select)F%Q†ZTEMP1;; because of ASL above...P.;...A has sector remainder (0-127) times 2Z;;; this is sneaky:dW?;; high bit of A is setn,V?;; A=01xx xxxx, where xxxxxx is senum/2x6P‡ZSECPTR;; forces address to $4000-$7FFF range!‚Q>ŒW?;; A gets $00 or $80–'P‡ZSECPTR;; neat? a perfect pointer +X; address of RAMDISK "sector" is set upŞ Q†DCBBUF´ P‡ZRAMPTRžQ†DCBBUFČ/P‡ZRAMPTR;; set up pointer to data bufferŇX;Ü%>;; 128 bytes in a sectorć8;; read or write?đDˆ:READRAM;; read requestúX;X; write sector to RAMDISKX; ‰:WRITERAM""Q@‡ZRAMPTR7;; move 128 bytes...,P@‡ZSECPTR7;; ...to RAMDISK61@I‰:WRITERAMJG†:RAMJN;; all bytes writtenTX;^X; read sector from RAMDISKhX;r ˆ:READRAM|Q@‡ZSECPTR7†P@‡ZRAMPTR7;; move 128 bytes1š Iˆ:READRAM¤X;ŽX; clean up RAMDISK I/O¸X; †:RAMJNĚ9Q>ŠMAINMEMORY;; deselect RAMDISK, select normal memoryÖ ‡SETBANK;; thuslyŕX;ęX; reenable interrupts, etc.ôX;ţ%>Ŕ#'…NMIEN;; enable VBI's and DLI's%>$'†CRITIC;; no longer critical I/O&.;; and IRQ's are now legal0$3;; now Y=1...a good return value:X;D ‡:RAMRTSN:X