TRS-80 DOS - LS-DOS 6.3 and 6.3.1 (Model 4)
Page Index
Background
LS-DOS 6.3 and 6.3.1 are the last releases of the Model 4 operating system that Logical Systems, Inc. (LSI) wrote for Tandy as TRSDOS 6. The system runs the Model 4 in its native mode. Its boot sector sends 86H to the Operation Register at port 84H, which takes the ROM out of the memory map, so all 64K is RAM: the resident system sits at 0000H-1DFFH, its overlays run at 1E00H-23FFH, drivers and filters load at 2400H and programs at 2600H or 3000H. Programs reach the system through numbered supervisor calls (SVCs), a value in register A followed by RST 28H, rather than through fixed addresses.
From TRSDOS 6 to LS-DOS 6.3 (1983-1987)
TRSDOS 6.0 came with the Model 4 in April 1983 and was followed by 6.1, 6.2 (late 1984) and 6.2.1 (1985); their history is on the TRSDOS page, and how they grew out of LSI's RAM-based LDOS 6.0 is on the LDOS page. Every TRSDOS 6 through 6.2.1 refused dates after December 31, 1987. LSI's answer, sold under its own name as LS-DOS 6.3 for $29.95 from early 1987, accepted dates from 1980 through 1999, put a time stamp as well as a date on every file, added a full-screen text editor (TED), a one-pass format and copy program (DISKCOPY), a cross reference utility for BASIC programs (BREF) and DATECONV for older disks, and changed BASIC a good deal. To make room for the time stamp, LSI took the user password out of the directory entry (80 Micro, May 1987). Each 6.3 master disk carried an encoded customer service number and serial number, and LSI gave support only to owners whose disks carried one.
MISOSYS and LS-DOS 6.3.1 (1988-1990)
LSI turned the distribution and support of LS-DOS over to MISOSYS, Inc. in July 1988. MISOSYS's 6.3.1 of 1990 moved the copyrights and the sign-on message to MISOSYS and extended the date range to December 31, 2011 (the years 2000-2011 are typed as 00-11 and stored as 100-111, the year being kept as an offset from 1900). The update sheet lists the other changes: SYSTEM gained AMPM (12 or 24 hour times in DIR), PRTIME (printer time-out on or off) and DRIVE=d1,SWAP=d2 (exchange two logical drives); LIST pauses after every 23 lines unless told NS; MEMORY shows the memory banks and the modules in the driver and high memory areas; RESET gained LRL= and DATE=; SPOOL accepts BANK numbers 0-30; CREATE gained SHRINK; DO writes its SYSTEM/JCL file to the first drive that is not write protected; TED can print and show a directory. The owner password of the system files changed from LSIDOS to SYSTEM6, and SVC 71 (@SEEKSC) now returns without doing anything. A 6.3.1 disk carries no customer service number, and MISOSYS dropped the protection scheme of 6.3.0: its advertisement says that 6.3.1 "has no anti-piracy protection". A 6.3.1 disk replaced a 6.3.0 master for $15, and the 6.3.1 Upgrade Kit for owners of TRSDOS 6.2 cost $39.95.
MISOSYS also published fixes for 6.3.1 in The MISOSYS Quarterly, each one raising the level letter that the system shows after its version number. The disk disassembled on these pages is level 1H, the last level that the 6.3.1 source code builds.
Versions
The level is the letter after the version, kept in the system's name string (PAKNAM$ at 0410H, which reads LS-DOS63Level-1H on the disk disassembled here). The 6.3.1 levels below are the patch switches of the LS-DOS 6.3.1 Source Code Restoration Project, whose build file names what each level changed and where it was published.
| Version | Notes |
|---|---|
| TRSDOS 6.0 - 6.2.1 | 1983-1985. Tandy's releases, written by LSI. See the TRSDOS page. |
| LS-DOS 6.3.0 | January 1987, LSI. Dates through 1999, time stamps, user password removed, TED, DISKCOPY, BREF, DATECONV. Each master disk carries an encoded customer service number and serial number. |
| 6.3.0 levels H to L | LSI's revisions of 6.3.0. The update of February 2, 1987 takes level H to I; a recut disk at level J fixed DISKCOPY, DEBUG, MODELA/III for the 4P, TED, DATECONV, BASIC and BOOT; MISOSYS supplied JCL files that make level K from I or J; the archive also has level L disks. |
| 6.3.1 levels 1A and 1B | 1990, MISOSYS. Dates through 2011, no protection scheme. Level 1B is the one the source code's build calls the 6.3.1 distribution; level 1A disks are also in the archive. |
| 6.3.1 levels 1C to 1F | Patches to SETKI (1C), DIR (1D), DIR and MEMDISK/DCT (1E) and SPOOL (1F), published in The MISOSYS Quarterly Volume IV, Number iv, page 32. |
| 6.3.1 levels 1G and 1H | Patches to the @KEYIN line input, DIR and DO (1G) and to MEMORY (1H), published in The MISOSYS Quarterly Volume V, Number i, pages 10 and 18-19. Level 1H is the version disassembled here. |
Downloads
Disk images of the LS-DOS 6.3.1 system disk, for real hardware or an emulator.
LS-DOS 6.3.1 is also on Tim Mann's MISOSYS page.
Manuals
LS-DOS 6.3 came as an update to TRSDOS 6.2, whose manual and the Model 4 Technical Reference Manual stayed the main documentation until MISOSYS published one book for LDOS 5.3.1 and LS-DOS 6.3.1 in 1992. Each title below is a download link.
Source Code
In 1984 LSI published the commented source code of TRSDOS 6.2 as The Source, three volumes of assembled listings: the system and its overlays in volume 1, the library commands in volume 2 and the utilities, drivers and filters in volume 3. Several source sets for later versions are in the archive:
Disassembly
The LS-DOS 6.3.1 Model 4 disassembly pages take the level 1H system disk apart file by file: BOOT/SYS, SYS0/SYS to SYS13/SYS, then BASIC and the utilities, drivers and filters. Every row is written from the bytes of the release file.
LS-DOS 6.3.1 Bugs Found in the Disassembly
These are the bugs found so far while disassembling the files of the LS-DOS 6.3.1 level 1H system diskette, 194 in all. Each comes from the bytes themselves, and the address links to the row of the disassembly where it happens; the page of each file explains it in full. The files done so far are BOOT/SYS, SYS0/SYS, SYS1/SYS, SYS2/SYS, SYS3/SYS, SYS4/SYS, SYS5/SYS, SYS6/SYS, SYS7/SYS and members 1 (SYSTEM), 2 (SYSGEN), 3 (FORMS), 4 (SETCOM) and 5 (SETKI) of SYS8/SYS, so the list grows as the work goes on. Under each one, How it happens says what a user would do to set it off and what he would see. They have not been tried on an emulator.
Bugs Found in the Code
Each of these 157 gives a wrong result in a case that can happen.
| File | Where | Bug |
|---|---|---|
| BOOT/SYS B2 | 076AH | After midnight those bytes keep the values of the day the system was started: anything that reads the day of the week or the day of the year gets the boot day's. How it happens: Leave the computer on past midnight and look at the day of the week or the day of the year with a program that reads them: it still gives the day the system was started. Rebooting sets them right. In the code: The clock task's midnight roll-over steps the day, month and year in DATE$ (0033H-0035H) but not DATE$+3 and DATE$+4 (0036H-0037H: the day of the year, the day of the week, the leap year flag), which only the start-up of SYS0/SYS sets. |
| BOOT/SYS B3 | 0785H | A system left running from New Year's Eve into a leap year skips 29 February (28 February is followed by 1 March); one started in a leap year and left running into the next year shows a 29 February. How it happens: Leave the computer running from 31 December into a new year and on to the end of February without rebooting: in a leap year 29 February is skipped, after a leap year a 29 February appears. Rebooting sets February right. In the code: The roll-over into a new year increments the year but leaves February's length at 0403H (MAXDAY$+2), which the start-up set for the year the system was started. |
| SYS0/SYS B5 | 1C8EH | The BREAK handler runs with the all RAM map of bank 0 and LBANK$ 0 even if the program had another bank switched in; @VDCTL acts as if called from a task until the next clock interrupt clears the bit. How it happens: Only a program that has set a BREAK vector with @BREAK and runs with memory bank 1 or 2 switched in: when BREAK is pressed, its BREAK routine finds bank 0 in the upper 32K. In the code: EXITBRK goes to the debugger or the BREAK vector by popping the saved Operation Register value and logical bank without restoring them, and leaves NFLAG$ bit 6 (in the task processor) set. |
| SYS0/SYS B7 | 1EE7H | After a reset with memory kept, a bit set for the old date stays: a leap year flag for a common year, or a day of the year 256 too high. How it happens: Run the system on a date in a leap year (or late in the year), then press RESET and enter, or keep, a date in a common year (or early in the year): the leap year flag (or the high bit of the day of the year) is still set. The bits stay until the contents of memory are lost. In the code: The start-up sets bit 7 (leap year) and ORs bit 0 (day of the year above 255) into DATE$+4 (0037H), which SYS0/SYS does not load, and never clears either bit. |
| SYS0/SYS B8 | 2002H | Bit 4 of row 6 is the down arrow and bit 0 of row 0 is @: holding the down arrow at boot starts the debugger as D does, and holding @ skips the AUTO command as ENTER does. How it happens: At power-on or reset, hold the down arrow key until the date prompt passes: the system debugger starts instead of the command level, as with D. Hold @ instead and the AUTO command is not run, as with ENTER. In the code: GETKB17 reads F441H, keyboard rows 0 and 6 at once; CKDCR takes bit 4 as the D key and bit 0 as ENTER. |
| SYS0/SYS B9 | 2050H | Holding SPACE (row 6 bit 7), 9 (row 5 bit 1) or / (row 5 bit 7) at boot skips the SYSGEN configuration as CLEAR does. How it happens: On a system disk with a SYSGEN configuration, hold the space bar (or 9, or /) while it boots: the configuration is not loaded, as if CLEAR were held. In the code: AND 82H of the SYSGEN flag ORed with F460H, keyboard rows 5 and 6 at once (bit 7 of the mask is for the flag's C9H). |
| SYS0/SYS B10 | 212BH | A time reply of only the hours is completed from the rest of the date reply still in the buffer: after the date 01/23/05, the time 10 is taken as 10:23:05; when what is left does not give valid minutes and seconds (a year from 1980 to 1999 makes seconds above 59), the prompt comes back. How it happens: At boot, enter a date such as 01/23/05, then at the time prompt type just 10 and ENTER: the time is set to 10:23:05, the minutes and seconds coming from the date typed before. In the code: When the reply ends (0DH) with more than one field missing, PRSD1 goes on parsing the bytes after the 0DH in the reply buffer at 1E00H, which nothing clears. |
| SYS1/SYS B11 | 21B2H | A word that starts with a whole name that fills its field (a six letter name of an old table, any name of an enhanced one) matches it: a command name of 7 or 8 letters whose first six are a six letter library command (APPENDIX, SETCOMM, SYSTEMS, MEMORYX) runs the library command instead of the program; a parameter word longer than a name in a program's table is taken as that parameter. How it happens: Have a program called APPENDIX/CMD (or SETCOMM/CMD, SYSTEMS/CMD) on a disk and type its name at LS-DOS Ready: APPEND (SETCOM, SYSTEM) runs instead. Typing !APPENDIX or RUN APPENDIX runs the program. In the code: @FNDPRM compares the word with a table name only for the length of the name (DJNZ to FND4, then FND5 with no test of the word's next character). |
| SYS1/SYS B12 | 208DH | The character after the exclamation mark is skipped: when the mark is the last character of the line, @FSPEC returns Register Pair HL one byte past the 0DH and the caller reads its next parameters from whatever is left in the buffer after the line; when a parameter list follows at once (FILE!(X=1)) its opening parenthesis is lost and @PARAM finds no list. How it happens: Type a command whose file specification ends the line with an exclamation mark, as LIST REPORT/TXT! and ENTER: @FSPEC gives the command a pointer one byte past the ENTER, so the command reads its next parameters from whatever an earlier, longer command line left in the buffer. Or type a parameter list right after the mark, as in a command line with REPORT/TXT!(X=1): the parameters are ignored. A space after the exclamation mark avoids both. In the code: FSP3 stores the exclamation mark and then increments Register Pair HL, although @PARSER already left it after the mark. |
| SYS1/SYS B15 | 22C7H | The signs : ; < = > ? @ and [ \ ] ^ _ ` and the letters W X Y Z inside X'...' are taken as hexadecimal digits (3 to 9, and 0 to 3 for W to Z) instead of ending the value with an error: a mistyped X'1:00' is read as 1300H, X'1Z' as 13H. How it happens: Give a hexadecimal parameter with a mistyped sign or letter, as (ADDR=X'1:00') or (ADDR=X'1Z'): it is accepted as X'1300' or X'13' instead of giving Parameter error. In the code: HEXVAL turns a character into a digit by subtracting 30H, clearing bit 5 and subtracting 07H, and takes any result below 10H. |
| SYS2/SYS B17 | 21C3H | @OPEN, @INIT and @RENAME take a specification whose extension or password starts with a digit (which @FSPEC accepts) as having none, without an error: REPORT/1A:1 opens REPORT with no extension on any drive, and @INIT creates it on the first drive with room; a password such as .1234 is ignored (XSPEC8 has already set protection NO ACCESS for a new file, harmless as the blank password matches). How it happens: Type LIST REPORT/1A:1 with a file REPORT/1A on drive 1: LIST looks for REPORT with no extension on every drive, so it shows another file or says the file is not in the directory. A password that starts with a digit, as in NAME.1PW, is ignored as if none were typed. In the code: XSPEC8A requires the first character of an extension or a password to be a letter; a digit ends the field at once with nothing copied, and XFRSPEC then takes that digit as the separator, so no later part (the password, the drive, the exclamation mark) is looked at. |
| SYS3/SYS B21 | 1E61H | When the last buffer is written in byte I/O and the granule is found or allocated in an extended directory entry (FXDE) that lies in another directory sector, SBUFF$ holds that sector afterwards: CLOSE changes the bytes at the file's place in it (open bit, EOF offset, ERN, MOD flag, date), writes the whole sector over the sector of the file's own entry (1F18H), counts and frees granules by the extents of whatever entry sits at that place, and puts that entry's name into the FCB; the file's own entry and the others of its sector are replaced by copies of the FXDE's sector. How it happens: Write a file with a program that writes it a byte at a time or in records shorter than 256 bytes (@PUT, @WRITE with a short LRL) on a diskette whose free space is broken up, so that the file gets more than four extents and its extended directory entry lands in another directory sector than its own entry. When the sector that CLOSE writes last is the first sector of a new granule (one close in six on the release diskette, whose granules have six sectors), DIR afterwards shows the files of the other directory sector twice, and the file itself and the other files whose entries shared its sector are gone; REPAIR or a backup is needed. Files of four extents or fewer, and files whose extended entry happens to share the sector, are not affected. In the code: CLOSE reads the file's directory sector into SBUFF$ (1E58H) before RWRIT@ writes the last buffer, and keeps Register Pair HL pointing into SBUFF$ across the call; RWRIT@'s IOREC reads the file's directory entries through SBUFF$ (CYL_GRN, and NEWHIT when a new FXDE is needed) whenever the granule of that sector is not among the FCB's five extent records; only the exclamation mark option (FCB+1 bit 3, WEOF1) reads the FPDE's sector again inside RWRIT@. |
| SYS4/SYS B25 | 1F61H | The long display of an extended error is the same one line as the short one, Extended error, HL = X'xxxx': the error number and the return address of the program's call never show. (Leaving out the file and Last SVC lines is the source's design: Do extended error only, JR ERR6A.). How it happens: Only a program can meet it: call @ERROR with Register C = 3FH (63) and bit 6 clear, or with SFLAG$ bit 6 set: the screen shows only the line Extended error, HL = X'xxxx', without the Error code = 63, Returns to X'dddd' line the other errors get. In the code: For error 63 in the long form the header (Error code = 63, Returns to X'dddd' and the two asterisk signs of the next line) is built in SBUFF$ and the extended line copied after it, but @LOGOT is called with Register Pair HL at 20A3H, the line in SYS4. |
| SYS4/SYS B29 | 1FCBH | The long display of error 41 or 42 always says Unknown FCB/DCB instead of naming the file, which is open and could be named by its drive and DEC. How it happens: Only a program that shows the long display can meet it: open a file that is already open with the open bit written to the disk (NFLAG$ bit 0), or with the wrong LRL, and call @ERROR for the error 41 or 42 with bit 6 clear: the third line reads Unknown FCB/DCB. The library commands show only the short message and never meet it. In the code: The sentences of errors 41 (File already open) and 42 (Logical record length open fault) have bit 6 of the last byte set, so DSPSPEC reads the FCB as the text of a specification; SYS2 returns both errors with the FCB built and open (FCB+0 80H or A0H), which CHKASC refuses. |
| SYS4/SYS B30 | 1FDBH | The long display of an error flagged 80H whose FCB is a closed one (SYS3's RCVNAM leaves the specification text) or a specification not opened (an @INIT that fails with error 15, say) reads Open DCB, Device= and the seventh and eighth characters of the text: PAYROLLS/DAT:1 gives LS, PROGRAM:1 gives M:. How it happens: Only a program that shows the long display can meet it: create a file with @INIT as PAYROLLS/DAT:1 on a write protected diskette and call @ERROR for the error 15 with bit 6 clear: the third line reads Open DCB, Device=*LS. The same happens for an error such as 43 after the program's last file SVC was the @CLOSE of a file with an eight letter name. In the code: On the 80H path DSPSPEC takes every FCB whose FCB+0 bit 7 is clear as a device FCB (10H) without testing for 10H, and shows FCB+6 and FCB+7 as the device name when the first is A-Z and the second 30H-5AH. |
| SYS5/SYS B31 | 210EH | Single stepping (I or C) a JP (IX) puts the target breakpoint at the address in the program's Index Register IY instead of IX: the program jumps to IX's address and runs on without stopping (the breakpoint after the JP is never reached), and an F7H stays over the byte at IY's address (often a system table, such as the flag table @FLAGS points IY at) until the next entry to the debugger, which may never come. How it happens: Only someone single stepping a program can meet it: in the debugger, with the pc line on a JP (IX) and Register Pairs IX and IY holding different addresses, press I (or C): the program does not stop after the jump, and the byte at the address in IY has become F7H. In the code: CMD_CI tells JP (IX) from JP (IY) with BIT 5,C, but Register C holds the instruction's second byte (E9H, bit 5 set), not the DDH or FDH prefix, so 2112H always takes IYREG. |
| SYS5/SYS B32 | 1E32H | After G with no breakpoint the next entry takes the modification address and the address made of the A or H letter and the display mode (0061H, 0068H, 7300H, 7361H or 7368H) as breakpoints, and after G, I or C with one breakpoint the second of these: an F7H there is replaced by a stale byte. An RST 30H planted with H as the last byte changed is removed this way when the program reaches it, and the instruction there becomes whatever NXTBYT held. Each entry also sets the display back to the register display and the modification address to 0000H. How it happens: In the debugger type H, an address in the program and a space, then F7 and ENTER to plant an RST 30H by hand, and G and ENTER: when the program gets there the debugger comes up at that address, but the byte there is no longer F7H nor what it was before, and G runs that stale byte as an instruction. In the code: The two breakpoint save areas (00A0H-00A2H, 00A3H-00A5H) are the same bytes as SAVONE, SAVTWO, SAVTWO+1, NXTADR and NXTBYT; G, I and C fill only the areas they use, and every entry puts the saved byte back at the address of each area that is not zero and holds F7H. |
| SYS5/SYS B33 | 1E2BH | When BREAK stops a program just after an instruction whose last byte is F7H (AND 0F7H, OR 0F7H, LD A,0F7H, SET 6,A), or @RUN starts one whose transfer address follows an F7H byte, the pc line shows one byte less, inside that instruction; G then runs the F7H as RST 30H and the debugger comes back at once, every time, until J moves the Program Counter on. How it happens: Turn DEBUG on and press BREAK while a program runs a loop in which an instruction such as AND 0F7H comes just before the place where BREAK stops it: the pc line points into the AND, and every G enters the debugger again at once; J and then G go on. In the code: The entry takes every F7H in the byte before the return address as a breakpoint and moves the Program Counter back by one, whatever the way in. |
| SYS5/SYS B34 | 22A3H | F first,last,byte fills first to last as the manual says when first is below last, but nothing when they are the same address, and with last FFFFH it never stops: the address wraps to 0000H and the fill runs over the whole memory, the system and SYS5 with it. How it happens: In the debugger type F7000,7000,FF and ENTER: the byte at 7000H is not changed. Type F8000,FFFF,0 and ENTER: the computer stops responding and must be reset. In the code: FILL clears Carry only before the first SBC HL,BC; every later compare also subtracts the borrow of the one before, so the first compare stops when the address is not below the last and the later ones only when it is above it. |
| SYS5/SYS B35 | 1ED5H | After a program has sent 15H, each tab code of the display shows as one special character instead of 6 or 61 spaces: the rows no longer fill 80 characters and run into each other, so the register display and the memory lines are scrambled until 15H is sent again. How it happens: In BASIC type PRINT CHR$(21); and ENTER (the special characters on), then, with DEBUG on, press BREAK: the debugger's register display is jumbled. PRINT CHR$(21); again after leaving puts the tabs back. In the code: WRREGS lays out the display with the video driver's tab codes (C6H, FDH) and resets 80 characters a line and normal video with 1CH, but not DODATA$ bit 3, which 15H toggles to show C0H-FFH as special characters. |
| SYS5/SYS B36 | 21B8H | When the modification address is the last byte of a memory line (an address ending in FH in the full screen display), its closing bar is missing, and a lone bar shows in front of the first byte of any line that starts at the next address (the next memory line, or a register line whose register pair holds that address). How it happens: In the debugger type D7000 and ENTER, S and ENTER, then H700F and a space: the byte at 700FH has a bar on its left only, and the line of 7010H starts with a bar. In the code: GRPHIC writes the bar after the framed byte as the separator in front of the next byte, and the separator of a line's first byte at the start of that line. |
| SYS5/SYS B37 | 2335H | A read, a write or a directory write with the address left out uses that number as its buffer: the sector or cylinder number typed (0,0,0,R, reads into 0000H, over the RST vectors, the SVC table and DBGSV$), or 124CH on a drive of 18 sectors a track when neither was typed, where a read clears and fills memory over the resident file routines from 1300H on and a whole cylinder reaches @RDSEC and SYS5 itself; the system stops. A write copies that memory onto the sectors, the whole directory cylinder when the cylinder and sector are left out. How it happens: In the debugger type 0,,,R, and ENTER, a comma after the R but no address: the read runs over the resident system and over SYS5 itself, and the computer stops responding. With W instead of R the whole directory cylinder of drive 0 is written over with that memory. In the code: DISKIO reads the buffer address with HEXIN@, which leaves Register Pair HL unchanged when no address is typed; Register Pair HL then holds the last number HEXIN@ read, the sector, else the cylinder, else the sectors of a track times 256 plus 4CH, built at 22F9H from the 1E4CH of the command loop. |
| SYS5/SYS B38 | 20F6H | While a single stepped instruction runs (a CALL or RST run in full by C, an RST 28H to 38H by I, or any step whose breakpoints are never reached, as with B31), BREAK does not enter the debugger: a routine that loops or never returns can only be stopped by the program itself or by a reset. How it happens: In the debugger, with the pc line on a CALL of a routine that loops for ever, press C: the screen stays as the routine leaves it and BREAK does nothing; only RESET gets out. In the code: I and C go on through JP 1F9FH, past the XOR A / LD (199FH),A at 1F9BH-1F9CH by which G turns DEBUG on; @DBGHK keeps the C9H that RST28 stored when it loaded SYS5. |
| SYS5/SYS B39 | 211AH | G's RET runs the F7H at once, the entry puts the byte back and the Program Counter has not moved: DJNZ $ never counts down and I or C stays on the same instruction for ever; only G with a breakpoint after it gets past. How it happens: Stop a program in the debugger on a DJNZ $ delay loop (bytes 10H FEH) and press I: the debugger comes back with the pc line on the same DJNZ and Register B unchanged, every time. In the code: For a branch whose target is the instruction itself (DJNZ $, JR $, JR cc,$, JP cc,$) the second breakpoint goes over the instruction's own first byte. |
| SYS6/SYS B40 | 2531H (member 1, MEMORY) | MEMORY (HIGH=n) with n from 0 to 9 wraps round: HIGH$ is set to FFF6H-FFFFH, above everything in high memory, which is no longer protected, and the ten byte header is written across FFF7H-0009H, over START$ at 0000H. How it happens: Type MEMORY (HIGH=5): the High line shows X'FFFB' instead of a lower HIGH$, and anything loaded into high memory afterwards goes over what was there; the bytes at 0000H-0005H are overwritten. In the code: HIGH sets HIGH$ to the value given less 10 (LD HL,FFF6H / ADD HL,BC) with no test for a value below 10; the result is only checked against the present HIGH$ (from above) and LOW$. |
| SYS6/SYS B41 | 25A0H (member 1, MEMORY) | Run through @CMNDR by a program whose stack is in the upper 32K, MEMORY shows 32K Banks avail = 01/01 on a 128K machine. How it happens: Only a program can meet it: with its Stack Pointer at 8000H or above, send MEMORY through @CMNDR on a 128K Model 4: the bank line reads 32K Banks avail = 01/01, In use = <->. In the code: The banks are counted by selecting banks 1, 2 and 3 with @BANK function 0 until one is refused, and @BANK refuses any select while the Stack Pointer is at 7FFBH or above. |
| SYS6/SYS B42 | 2701H (member 1, MEMORY) | Most LS-DOS driver and filter names start with a dollar sign (24H: $KSM, $FF, $MD) and MEMORY's own reserved blocks with an ampersand sign (&nnnn): after a block without a header in high memory such a module is not found and is listed as part of the |
| SYS6/SYS B43 | 265BH (member 1, MEMORY) | A header whose last-byte word is below its own address (a stray 18H in high memory with such a word, accepted by the search) makes the map show the same line, length 0, for ever; only BREAK at the end of a screen gets out. How it happens: Put the bytes 18H, 00H, then the word of the 18H's address less 1, a length and a name, in high memory after a block with no header, and type MEMORY: the map repeats one line of length 0 screen after screen until BREAK. In the code: The walk goes on at the last byte + 1 of each header with no test that the last byte is at or above the header's address; the search (26EFH) even accepts a header whose last byte is the byte in front of its 18H. |
| SYS6/SYS B44 | 2B39H (member 2, DIR) | The entries themselves are checked one by one against MAXMEM, but the table after them is not (so the NOMEM jump at 2B3BH can never be taken): with N = 18 or more files selected and HIGH$ between 3000H + 32N + 33 and 3000H + 34N - 2 (an overrun of up to 2N - 34 bytes) and HIGH$ set low enough that the entries come near MAXMEM, the table is written past HIGH$ over whatever is in high memory (drivers, filters, a MEMORY (HIGH) block); with HIGH$ below 3020H even the first entry is copied above HIGH$ before the test. How it happens: Lower HIGH$ to a little above 3000H (MEMORY (HIGH=X'3400')) with a driver or filter loaded above it, and type DIR :0 (S,I) on a diskette with about twenty files: the sort table goes over the bytes above HIGH$ and the driver or filter can crash the system. In the code: Before sorting, SORTIT tests the room for its address table (2 bytes an entry, written from DIRPTR, the end of the entries kept) by subtracting the table's size alone from MAXMEM (HIGH$ less 33), not DIRPTR plus the size. |
| SYS6/SYS B45 | 2AC9H (member 2, DIR) | When the title of a drive with nothing selected is the 22nd line, the title is shown a second time after the key (with A also the column heading and its 79 minus signs). How it happens: Type DIR (A) for several drives so that the title of a drive with no matching file is the last line of a screen: after you press a key the title and the heading appear again before the next drive. In the code: After a screen pause CKPAGE shows the drive's title again when FILFLAG is set (no file shown yet); for a drive with no file selected, 25CBH shows the title itself without clearing FILFLAG and then calls CKPAGE. The No Disk line guards against this with NOTITLE, this path does not. |
| SYS6/SYS B46 | 27F9H (member 2, DIR) | Register C left = 17 - the characters of the file specification (with the slash) - the letters of ? * S I P C; at 0 (12 characters and 5 letters, or 11 and 6) 256 spaces are shown, at FFH (12 and 6) 255, which breaks the layout of the CAT or DIR (A=N) display. How it happens: Have a file with an eight character name and a three character extension that is invisible, password protected, created with CREATE and left open (with S, or a PDS, for one letter more), and type CAT (I): after its name the screen fills with spaces. In the code: The brief format fills each name out to 19 columns with a loop that shows a space and then decrements Register C, the columns left, until zero; Register C is not tested before the first pass. |
| SYS6/SYS B47 | 2F65H (member 2, DIR) | In a range DATE="M1/D1/Y1-M2/D2/Y2" whose first year is a leap year, the second date is checked with 29 or 30 days in February: 02/29/89 or 02/30/92 is taken without Bad date format. How it happens: Type DIR (DATE="01/01/88-02/29/89"): 1989 has no 29 February, but the date is accepted instead of Bad date format. In the code: PAKDAT raises February's days in MAXDAYS (2D40H) for a leap year with INC (HL) and does not set them back for the second date of the same command. |
| SYS6/SYS B48 | 29E0H (member 2, DIR) | DIR (A) of several drives: when a file of a later drive has its extended entry (FXDE) in a directory sector of the same number as the last one read for an earlier drive, the extents of the earlier drive's sector are counted, so that its File Size, Ext and the Space of the totals line are wrong. How it happens: Type DIR (A) :0-1 with two disks that each have fragmented files (more than four extents): a file on drive 1 can show the size and extents of the wrong extended entry. In the code: The sector of an extended entry read into 2F00H is kept as the operand of ALL16 (29E1H) and not forgotten when DIR4 starts the next drive. |
| SYS6/SYS B49 | 2EE5H (member 2, DIR) | DIR -8 (no colon) shows drive 0 alone instead of Illegal drive number; the rest of the line (partspec, more drives) is ignored. How it happens: Type DIR -8: instead of Illegal drive number you get the directory of drive 0. In the code: CKDSPEC's -d2 path returns on the Carry flag of LEGDRV without setting NZ; for the digit 8, LEGDRV1's CP 08H leaves the Z flag set under the CCF, so -8 returns Z, and CKITOUT (2E19H) takes it as a drive range with Registers B and C as the LDIR at 2DF4H left them, 00H. |
| SYS6/SYS B50 | 2871H (member 2, DIR) | A file of 65535 whole records and a partial one (for example LRL 2, ERN 512, EOF 255: 131071 bytes) shows 0 records and EOF 0 in the full format instead of 65536 or the asterisks. How it happens: Make a file of LRL 2 with 131071 bytes and type DIR (A): it shows 0 records and EOF 0. In the code: The record count is rounded up with INC HL after the overflow test looks only at the high byte of the first quotient, so FFFFH + 1 wraps to 0000H, and EOFBYTE then takes it as an empty file. |
| SYS6/SYS B51 | 2872H (member 3, APPEND) | APPEND to a file on a write protected diskette, or to one whose password allows it only to be read, goes on to the first write, which fails with error 37, Illegal access attempted to protected file, instead of Write protected disk or File access denied (nothing is written). How it happens: Type APPEND NEW/TXT TO OLD/TXT:1 with a write protect tab on the diskette in drive 1: the message is Illegal access attempted to protected file, not Write protected disk. In the code: APPEND opens its destination with @OPEN (2481H), and DOSVC's access check after an @OPEN refuses only a level of EXEC or less; the write protect test with @CKDRV is made only after an @INIT, and SYS2 gives a file on a write protected diskette READ access. |
| SYS6/SYS B52 | 25B7H (member 3, COPY) | LRL=0, LRL=N and any multiple of 256 give 256, any other value from 257 to 65279 its low byte (LRL=300 gives 44); between two files LRL alone, LRL=Y and values from 65280 (FF00H) up are ignored. The manual allows 1 to 256; no error is given. How it happens: Type COPY DATA/DAT TO DATA2/DAT (LRL=300): the copy gets an LRL of 44, with no error. In the code: LPARM takes any value of LRL that @PARAM stores: FFH in the high byte means not given, otherwise only the low byte is used as the record length, with no range test; BYTEIO (2715H) takes the low byte with no test at all. |
| SYS6/SYS B53 | 2689H (member 3, COPY) | COPY (X) on drive 1 to 7 of an empty file or of a file whose sector count is an exact multiple of the pages of memory used, and every COPY (X) on drive 1 to 7 sent through @CMNDR (one page), closes the destination with the source diskette in the drive. CLOSE and the @DIRRD and @DIRWR after it work on the entry of the destination's DEC on the source diskette, whatever file (or extended entry) it holds: it gets the destination's end of file, its date when sectors were written, the LRL and with CLONE the source's attributes and password, and CLOSE gives back its granules past that end of file; a free entry gets the LRL, and with CLONE attributes that mark it in use. The destination's own entry keeps ERN 0 with the granules WRERN took, so it looks empty. A write protected source diskette is safe: the close fails with error 15. How it happens: Type COPY EMPTY/DAT:1 (X) for an empty file and follow the prompts: the last one asks for the source diskette, and the close is made on it, so the directory of the source diskette is changed and the copy on the destination diskette is left as it was created. A program that sends any COPY (X) for drive 1 through @CMNDR meets it every time. In the code: At the end of COPY (X) the destination diskette is asked for again before the close only for drive 0 (2689H); on another drive the code counts on GEOF5 having asked for it, but GEOF5 asks only when pages are left to write (2945H), and the last prompt was for the source. |
| SYS6/SYS B54 | 279BH (member 3, COPY and APPEND) | COPY FILE/TXT:1 (LRL=1) does not give Destination spec required: FILE/TXT is looked for on every drive from 0, and a file of that name on a drive below the source's is overwritten by the source (only when the first one found is the source itself does the same file test give the message). APPEND FILE/TXT:1 (STRIP) appends the file to such a file, or to itself, as APPEND has no same file test. Without the blank, COPY DATA/TXT(LRL=1) copies to T/TXT. How it happens: Type COPY REPORT/TXT:1 (C=N) and forget the destination, with another REPORT/TXT on drive 0: drive 0's file is replaced by drive 1's. Type APPEND REPORT/TXT (STRIP) with no destination: REPORT/TXT is appended to itself. In the code: With no destination before a parameter list, @FSPEC stops at the parenthesis and CVRT steps back one character (277AH), onto the blank before it (or, with no blank, onto the source's last character): FCB2 holds that character and 0DH, which PRSPC does not refuse (it refuses only 0DH and a digit); a blank is filled in with the source's name, extension and password, but not its drive. |
| SYS6/SYS B56 | 29D2H (member 3, COPY) | A BREAK pressed while COPY (X) reads or writes its sectors, or before its first prompt, makes the next prompt wait for ever without being shown, and the computer must be reset (unless DEBUG is on, when BREAK enters the debugger, or a program that sent the command through @CMNDR has a BREAK vector). How it happens: Start COPY BIG/DAT:1 (X) and press BREAK while the drive reads or writes: the next prompt never appears and the keyboard does nothing until a reset. In the code: FLASH first waits until neither BREAK nor ENTER is noted in KFLAG$ (bits 0 and 2), clearing only bits 1 and 2 (RESKFLG) while it waits; the BREAK bit stays set until @CKBRKC clears it, which this loop never calls. |
| SYS6/SYS B57 | 29F0H (member 3, COPY) | BREAK at an Insert SOURCE or Insert DESTINATION prompt of COPY (X) on drive 0 ends the command with that diskette in drive 0 and no Insert SYSTEM disk prompt; the system then reads its next overlay (SYS1/SYS for LS-DOS Ready, unless it is resident) from a diskette that may not hold it. After the destination is open it is left unclosed, an entry of ERN 0 holding the granules WRERN took. BREAK at the Insert SYSTEM disk prompt also goes to ABORT: after IOERR no message is shown and FFFFH is returned, after a good copy (GOHOME) FFFFH is returned. How it happens: Type COPY FILE/DAT (X) for drive 0 and press BREAK at the Insert SOURCE disk prompt, with the source diskette in drive 0: no Insert SYSTEM disk prompt comes, and LS-DOS Ready needs SYS1/SYS from that diskette. In the code: FLS2 jumps to ABORT when BREAK is pressed at a prompt; STOP (2A28H), which shows Transfer aborted and asks for the system diskette, is called by nothing (also in the 6.2 and 6.3.0 sources). |
| SYS6/SYS B58 | 2547H (member 3, COPY) | COPY FILE/DAT (X), which the manual allows without a drive: when the destination diskette in drive 0 has no FILE/DAT, a FILE/DAT on drive 1 to 7 is opened and overwritten instead of a new file being made, and a full or write protected destination diskette makes @INIT create the file on another drive. How it happens: With FILE/DAT on the diskette in drive 1, type COPY FILE/DAT (X) and give a destination diskette without FILE/DAT in drive 0: drive 1's FILE/DAT is overwritten. In the code: When the source of COPY (X) names no drive, XFER takes drive 0 for the prompts and the GAT checks, but FCB1 and FCB2 name no drive, so @OPEN and @INIT look for the file on every drive from 0, and X skips the same file test. |
| SYS6/SYS B60 | 2878H (member 3, COPY) | COPY (X) on drive 0 of an execute only file, or to a destination whose password gives READ or less, makes the system read SYS3/SYS from a diskette that does not hold it, instead of asking for the system diskette and showing File access denied. How it happens: Type COPY RUNONLY/CMD (X) for an execute only file on drive 0: the system tries to read SYS3/SYS from the source diskette. In the code: ILLACC closes the refused file with @CLOSE before IOERR calls PMTSYS; in COPY (X) on drive 0 the source or destination diskette is then in drive 0, and SYS3/SYS is not in memory (GETSYS2 read SYS2). |
| SYS6/SYS B61 | 2880H (member 3, COPY) | COPY to an existing file whose password gives only UPDATE access writes a sector of E5H over one of its sectors and then stops with Illegal access attempted to protected file; the FCB is left open. How it happens: Copy onto an existing file whose password gives UPDATE access, typing that password: one sector of the old file becomes E5H bytes and the copy stops with Illegal access attempted to protected file. In the code: CHKPROT lets a destination opened with UPDATE access through; WRERN writes its E5H sector at record ERN less 1 (inside the old file when the source is not longer), then COPY sets the ERN to 0 (2634H), so that every sector write is at the end of file, which UPDATE access may not write. |
| SYS6/SYS B62 | 2A46H (member 3, COPY) | COPY (X) between a one sided and a two sided diskette reads the source with the destination's number of sides: wherever an extent of the source crosses a cylinder, the wrong cylinder or side is read, so wrong data is copied or the read fails. How it happens: Use COPY (X) in a two sided drive for a file of several cylinders, from a one sided diskette to a two sided one or the other way: the copy holds wrong data or stops with a read error. In the code: At each swap of COPY (X), PMTSRC and PMTDST read only the GAT (RDGAT, @RDSSC), which corrects DCT+9; @CKDRV, which sets DCT+4 bit 5 (two sided) and DCT+6 from the GAT, last ran for the destination (@INIT, DOSVC). |
| SYS6/SYS B63 | 246BH (member 4, LIB) | A library whose number of commands is a multiple of 7 ends its list with a line of 2 spaces: after Library <A> (21 commands) two blank lines come before the next heading, after Library <B> one. How it happens: Type LIB: two blank lines separate the last line of Library <A> from the heading Library <B>, and only one comes before Library <C>. In the code: After the 7th command of a line LIB shows a carriage return and jumps to LIB1, which shows the 2 spaces of the next line, before LIB2 tests for the 00H that ends LIBTBL$; LIB4 then shows another carriage return. |
| SYS6/SYS B64 | 24E4H (member 5, REMOVE) | REMOVE of a NIL device to which another device is routed never ends: the computer hangs in the scan and only a reset gets it back; the removed DCB is already cleared and the routed device already NIL. How it happens: Type ROUTE *XX (NIL), then ROUTE *YY *XX, then REMOVE *XX: the computer hangs at once and must be reset. In the code: After clearing the removed DCB, SCNDCB looks through the 31 DCBs for one routed (type bit 4) to a DCB whose type byte is 00H; it ORs the NIL bit into that DCB's type but leaves bit 4 and the vector at +1/+2, and jumps back to SCNDCB, which starts again at KI and finds the same DCB, still routed to the cleared one, every time; BREAK is not tested in the scan. |
| SYS6/SYS B65 | 24D3H (member 5, REMOVE) | After REMOVE of a NIL device that another device is linked to, the next output to the linked device jumps to 0000H; when the video is the linked device this happens at once, on the first character of the Removing: line; input through the link goes the same way when its first device gives no character. How it happens: Type ROUTE *XX (NIL), then LINK *DO *XX, then REMOVE *XX: the Removing: line sends its first character through the link to the cleared DCB, and the computer jumps to 0000H. In the code: SCNDCB tests only the route bit; a device linked to the removed one (LINK, type bit 5, its link DCB's +4/+5 holding the removed DCB's address) is not looked at, and a NIL link DCB can itself be removed with its source still linked to it. @CHNIO (0689H) follows the link to the cleared DCB, whose type 00H passes all its tests, and jumps to its vector, 0000H (DI, 01H to port 9CH, which on a Model 4P brings in the boot ROM; on a machine where that port does nothing the code runs on to the RET at 0008H, which returns to @CHNIO's caller with interrupts off). |
| SYS6/SYS B66 | 2483H (member 5, REMOVE) | REMOVE of a file with an 8 character name and a 3 character extension typed with an exclamation mark fails: with a drive, @OPEN finds no name in the FCB and the command stops with Illegal file name; with no drive (and no password), it shows Removing: NAME/EXT!:d, then @REMOVE finds the FCB's open bit gone and the command stops with File not open; the file is not removed. How it happens: Type REMOVE LONGNAME/EXT! (no password) for a file whose name has 8 characters and whose extension has 3: Removing: LONGNAME/EXT!:0 is shown and the command stops with File not open; typed as REMOVE LONGNAME/EXT:0! it stops with Illegal file name. A password typed before the mark of the first form, or leaving out the mark, avoids it. In the code: FILESPC (2543H-2551H) has 15 bytes and the FCB follows at 2552H; with the password left out the longest name, 8 + / + 3 + : + drive + exclamation mark, is 15 characters and its 0DH (2455H) lands on FCB+0 before the open; with no drive and no password (SKIPPW passes over a mark after a password), 13 characters, FLOOP's colon, digit and 0DH (2479H-2483H) put the 0DH on FCB+0 of the open FCB, and SYS10 takes the FCB for a device (bit 7 clear) and returns error 38 from CLOSDCB (0DH is not 10H). |
| SYS6/SYS B67 | 24A6H (member 6, RENAME) | With no old password the new name runs on into the bytes of NEWFCB after it, which RENAME's file does not load (2600H-261EH): the Renaming: line shows after the drive whatever printable bytes the last program or library member left there, up to the first byte below 20H (none in cleared memory; after a DIR from none to eight characters, as the name's length decides), and MOVSPC copies them on into TEMPFCB, which is no longer used. With an old password the line shows its letters after the drive, against the 6.2 change that strips passwords from the line (RENAME PWF/DAT.PW TO NEW: shows Renaming: PWF/DAT:0 to NEW/DAT:0PW, also in the job log). Either way the duplicate check and the rename use the right name, as @FSPEC and SYS2's RENAME stop at the drive. How it happens: Type RENAME TEST/DAT TO NEW: (a colon and nothing after it): the file is renamed NEW/DAT, but the Renaming: line may end with stray characters, whatever a program or command run before (a DIR, for one) left in memory there. If the old file has a password, RENAME PWF/DAT.PW TO NEW: shows the password after the drive, NEW/DAT:0PW. Typing the drive, or no colon, avoids it. In the code: F2LOOP writes the old drive digit into the byte after the first colon of the new name; when the new name was typed with a colon and no drive after it (NEW: or /OLD:), that byte is what MATCH left after the colon: the name's end mark (the 03H @FSPEC stored, or the 0DH CVRTUC copied) when the old name has no password, or the full stop of the old password that MATCH inserted there when it has one. |
| SYS6/SYS B68 | 2557H (member 6, RENAME) | RENAME TEST/DAT TO /OLD(X), RENAME TEST/DAT (X), or a partial new name of 32 characters, when 2604H-261EH hold no 03H or 0DH (so after a DIR, and in cleared memory): the old name's first letter fills memory from 25FFH up, wraps past FFFFH and overwrites the system and the stack, and the computer hangs or crashes until it is reset. With an end mark among those bytes the rename is right and the Renaming: line shows the stale bytes, or, when the end mark lies within the bytes the inserts push into OLDFCB, the old name loses its front and the command fails (Illegal file name, File not in directory); a partial new name that begins with a letter and has no end mark ends with a garbled new name. How it happens: Right after a DIR, type RENAME TEST/DAT (X), or RENAME TEST/DAT TO /OLD(X): the computer hangs and must be reset. A partial new name of 32 characters or more does the same. Leaving out the parenthesis avoids it; RENAME takes no parameters. In the code: CVRTUC copies a partial new name to NEWFCB up to the 0DH, an opening parenthesis or 32 characters, and stores an end mark only in the first case; MATCH10 (25AEH), which inserts each default, moves the bytes along until it meets a 03H or 0DH, so after a parenthesis or 32 characters it runs on through the unloaded rest of NEWFCB and, when no end mark is there, into OLDFCB (261FH) up to OLDFCB's own end mark, moving the old name one byte along. For a new name that does not begin with a letter MATCH7 is copying the old filename at that moment: Register Pair HL then points at the letter it has just inserted, so it inserts that letter for ever. |
| SYS6/SYS B69 | 24DDH (member 6, RENAME) | RENAME TESTFIL/DAT TO 23 shows Renaming: TESTFIL/DAT:0 to TESTFIL23/DAT:0, checks TESTFIL2/DAT:0 for a duplicate and renames the file TESTFIL2 with no extension; RENAME TEST/DAT TO /TEXT renames it TEST/TEX, or gives Illegal file name after the Renaming: line when a TEST/TEX exists on any drive (SYS2 looks on every drive); RENAME TESTFILE/DAT TO 2 gives Duplicate file name. How it happens: Type RENAME TESTFIL/DAT TO 23 (an old name of 7 or 8 letters and a new one that begins with a digit): the file becomes TESTFIL2 with no extension. Or type a partial extension of 4 letters, RENAME TEST/DAT TO /TEXT: the file becomes TEST/TEX. In the code: Nothing cuts a field of the completed new name to its length: MATCH7 puts the old filename in front of a new name that begins with a digit (7 or 8 letters + digits make more than 8), and CVRTUC copies a partial extension as long as it was typed (/TEXT). The duplicate check's @FSPEC (24B4H) passes over the extra characters, but SYS2's XFRSPEC, which @RENAME runs on the NEWFCB text, takes the character after the 8th of a filename or the 3rd of an extension as its separator (2207H), so the parts after it, the extension and the drive, are lost. |
| SYS6/SYS B70 | 25B4H (member 7, DEVICE) | DEVICE (B) after two devices were routed to each other never ends: the line grows by 8 bytes a step from 2A00H up through high memory, wraps past FFFFH and overwrites the system (0038H soon after the wrap, with interrupts on), and the computer crashes; two devices routed to each other hang the system at the first character sent to either of them, so DEVICE meets the loop whenever neither has been used since (phantom devices, or the printer), and also when one of the pair was made NIL before the cycle was closed (B74). How it happens: Type ROUTE *XX (NIL), ROUTE *YY (NIL), ROUTE *XX *YY, ROUTE *YY *XX, then DEVICE (B): the computer crashes and must be reset. Routing a device back to one routed to it is the cause; once the two are routed to each other, ROUTE of either of them hangs too. In the code: LOGRTE follows a route from DCB to DCB for as long as the device routed to has its route bit set, adding its I/O symbol and name to the line in STRBUF each time; nothing counts the steps or the length of the line, and BREAK is tested only after a line. ROUTE refuses only a device routed to itself, so two devices can be routed to each other. |
| SYS6/SYS B71 | 269BH (member 7, DEVICE) | For a filter module that starts where its DCB word falls on an address nnFFH (KSM/FLT, whose word is at +9, at a start ending in F6H; CLICK/FLT, at +10, at one ending in F5H; FORMS/FLT, at +8, at one ending in F7H), DEVICE (B) shows for the filtered device (or, before FILTER, for the filter's own DCB, in place of Inactive) a false name in brackets, made of whatever two bytes lie 6 bytes on from the wrong address (a line cut short when one is 03H or 0DH), in place of the filter's DCB or Inactive; FILTER, which reads the word with INC HL, works. How it happens: Only a filter installed at an unlucky address meets it: after SET *CL CLICK/FLT and FILTER *KI *CL, DEVICE (B) may show *KI with a false name in brackets, about once in 256 load addresses; the filter itself works. In the code: GETPTR2 reads a word with INC L between its two bytes, a 6.3.1 change (6.3.0 had INC HL there); DVRA0 uses it at 25FCH for the DCB word after the name in a filter module's header, which can lie anywhere: on the last byte of a page its high byte is read from the first byte of that page. |
| SYS6/SYS B72 | 26AAH (member 7, DEVICE) | DEVICE (B) shows a device with a one letter name (ROUTE *X (NIL), for one) as its name alone, with no symbol, address or carriage return, so that the next device's line follows on the same screen line (and in the printout); a device routed or linked to it shows its line only up to that name, with the same run on. How it happens: Type ROUTE *X (NIL), then DEVICE (B): *X is shown alone and the next device's line follows it on the same line. Two letter device names avoid it. In the code: MOVNAM leaves out a name's second letter only when it is 00H; SET, ROUTE and RENAME store a one letter device name as @FSPEC left it, the letter and 03H, so MOVNAM puts the 03H into the line, and LINOUT's @DSPLY ends the line at it, before the rest and the carriage return. |
| SYS6/SYS B73 | 275AH (member 7, DEVICE) | DEVICE (P=256), or any PRINT value whose low byte is 00H, prints the single characters DEVICE shows one at a time (the colons, drive digits, WP, brackets, size and step digits, commas) but none of the strings: the printout is a jumble while the screen is right. How it happens: Type DEVICE (P=256): the screen is right, but the printer gets only scattered characters. DEVICE (P) or (P=Y) prints the display as shown. In the code: LINOUT decides whether to print a string from the low byte of the PRINT value (276FH) alone, while BYTOUT tests the whole word (2771H); @PARAM takes any value for PRINT, as it does not check the type byte. |
| SYS6/SYS B74 | 25B2H (member 7, DEVICE) | DEVICE (B) shows routes no I/O takes: after ROUTE *SI (NIL) and ROUTE *AA *SI the line of AA reads *AA <= *SI <= *KI while SI is shown Nil; and a cycle closed through a NIL device (ROUTE *XX *YY, ROUTE *XX (NIL), ROUTE *YY *XX), where all I/O stops at XX and nothing hangs, makes DEVICE (B) loop and crash as in B70 (with a real device too: ROUTE *XX (NIL), ROUTE *PR *XX, ROUTE *PR (NIL), ROUTE *XX *PR). How it happens: Type ROUTE *XX (NIL), ROUTE *YY (NIL), ROUTE *XX *YY, ROUTE *XX (NIL), ROUTE *YY *XX, then DEVICE (B): XX is shown Nil, then the computer crashes on the line of YY. Or type ROUTE *SI (NIL) and ROUTE *AA *SI: DEVICE (B) shows AA routed on through SI to KI, though SI is NIL. In the code: LOGRTE follows the device routed to whenever its route bit (type bit 4) is set and never tests its NIL bit (bit 3), which @CHNIO tests first (0696H, before the route test at 069AH); ROUTE (NIL) only ORs 08H into the type (NILDCB), so a routed device made NIL keeps its route bit and vector. |
| SYS6/SYS B75 | 24B5H (member 8, ROUTE) | Routing a device that is routed to a file to another file, or to the same file again, loses what was routed to the first one: its directory entry keeps the end of file it had when its route began (none for a new file), and the bytes still in the buffer are never written; only a file given the EOF maintenance option (!) keeps the sectors written before. Only a device with a two letter name meets it: a one letter name never finds its module (@GTMOD counts RTEx and its 03H as 4 characters), so each of its routes takes a new module and the old file is closed. The manual says ROUTE uses again an unused module of an earlier ROUTE of the device, one whose device was RESET. How it happens: Type ROUTE *PR TO LOG1/TXT, print something (LIST a file with P), then ROUTE *PR TO LOG2/TXT: LOG1/TXT keeps none of what was printed. A RESET *PR before the second ROUTE avoids it. In the code: INITFCB uses again any route module @GTMOD finds by its name (RTE and the device's two letters), also one whose device is still routed to its file: @INIT opens the new file into FCBDST with the module's buffer, the LDIR at 2503H copies the new FCB over the module's FCB, and only then does CKSRC run CLSFILS, which follows the device's route to that FCB, now the new file's, and closes a copy of it. The old file's FCB is gone without a close. |
| SYS6/SYS B76 | 251FH (member 8, ROUTE) | ROUTE of a new device name to a file when all 31 DCBs are in use shows No device space available, but the file has been created if it was new and stays open, and the 302 bytes of the module, FCB and buffer stay below HIGH$; the same happens with the error of a failed close of the device's old file. A later ROUTE of the same two letter name uses the module again, and its LDIR then writes over the FCB of the file left open, which can then never be closed. How it happens: Only after 25 devices besides the six of the system have been made (31 DCBs in all): ROUTE *NEW TO FILE/TXT then says No device space available, but FILE/TXT is left open and 302 bytes of memory are taken. In the code: For a file destination INITFCB opens or creates the file, copies the module and FCB into high memory and, for a new module, lowers HIGH$, all before CKSRC looks for the source's DCB; when the source is a new name and no DCB is spare, CKSRC returns error 33, and when the @CLOSE of the file at the end of the source's old route fails it returns that error; IOERR then ends ROUTE without closing the new file or giving the memory back, the source not routed. |
| SYS6/SYS B77 | 252BH (member 8, ROUTE) | ROUTE *XX (NIL) for a new name when all 31 DCBs are in use returns without a message, makes no device, and leaves DVRHI$ holding the two letters of the name (5858H for XX): a later SYSGEN saves the memory from DVREND$ (0FF4H) up to that address into CONFIG/SYS, about 18K for XX, and SYS12's @GTMOD and MEMORY's memory map take the driver zone to end there. Bit 3 of BUR$ is already set once SYS0 has started (FEH or F8H), so that part changes nothing. How it happens: Only after 25 devices besides the six of the system have been made: ROUTE *XX (NIL) then seems to work but makes no device, and a later SYSGEN writes a CONFIG/SYS of about 18K. In the code: NILDCB does not test the result of CKSRC, so an error of the @CLOSE of the file the device was routed to is not shown and the device is made NIL all the same; when the source is a new name and no DCB is spare, @GTDCB has left Register Pair HL = 0200H, so NILDCB ORs 08H into 0200H (BUR$) and writes the device's name into 0206H-0207H (DVRHI$, the next free byte of the low memory driver zone), then returns 0000H. |
| SYS6/SYS B78 | 2542H (member 8, ROUTE) | Once a chain of routes closes on itself, a ROUTE of any device on the cycle or routed into it, to a device, to a file or (NIL), hangs the computer in CLSFILS: nothing tests BREAK there, and only a reset gets out. How it happens: Type ROUTE *XX (NIL), ROUTE *YY (NIL), ROUTE *XX *YY, ROUTE *YY *XX, then ROUTE *XX (NIL) to undo the cycle: the computer hangs and must be reset. A device routed into the cycle (ROUTE *ZZ *XX) hangs the same way at its next ROUTE. In the code: CLSFILS follows the route vector for as long as the route bit is set, with no count and no test of the NIL bit; ROUTE refuses only a device routed to itself, so a chain of routes can close on itself (two devices routed to each other, or more) (B70, B74), and every ROUTE of a device, (NIL) too, runs CLSFILS on it first. RESET (member 10, `lbreset.asm`) has the same routine. |
| SYS6/SYS B79 | 2423H (member 9, LINK) | After LINK *DO *JL, LINK *JL *DO (or any chain of links and routes that comes back to its start, such as ROUTE *XX *DO and LINK *DO *XX), the next character sent to a device on the cycle goes round it for ever (the line feed of LS-DOS Ready, straight after the LINK, so the screen scrolls blank lines) and only a reset gets out; with the printer on the cycle and off line its driver's error ends each round. The manual warns that multiple links can make endless loops; nothing stops one. How it happens: Type LINK *DO *JL, then LINK *JL *DO: the line feed that begins LS-DOS Ready goes round for ever, the screen scrolls blank lines and the prompt never comes back until the computer is reset. Linking the printer and the video both ways (LINK *DO *PR, LINK *PR *DO) does the same, and the printer feeds paper for ever while it is on line. In the code: LINK refuses only a destination whose name is the source's own; it does not look at where the destination's chain of links and routes leads, so a device can be linked to one that is already linked or routed back to it. @CHNIO (0689H) runs a linked device's request through its link DCB with a CALL and then goes on to the destination with a JR, so a cycle is followed with no end and no BREAK test. |
| SYS6/SYS B81 | 24F5H (member 10, RESET) | Once a chain of routes closes on itself (two devices routed to each other, B70), RESET of any device on the cycle or routed into it hangs the computer in CLSFILS: the command the manual gives for undoing routes cannot undo this one, and only a reset gets out. How it happens: Type ROUTE *XX (NIL), ROUTE *YY (NIL), ROUTE *XX *YY, ROUTE *YY *XX, then RESET *XX to undo the cycle: the computer hangs and must be reset. In the code: CLSFILS, the same routine as ROUTE's (B78), follows the route vector for as long as the route bit is set, with no count, no NIL test and no BREAK test, and RESET runs it on the device first. |
| SYS6/SYS B82 | 24F9H (member 10, RESET) | RESET of a device that was routed to a file and then linked (ROUTE *PR TO LOG/TXT, LINK *PR *DO, RESET *PR) leaves the file open: its last bytes stay in the buffer and its directory entry keeps the end of file it had before the route, so a new file shows none of what was routed to it; the route module stays below HIGH$, and a later ROUTE of the device uses it again. How it happens: Type ROUTE *PR TO LOG/TXT, LINK *PR *DO (or SET *FF FORMS and FILTER *PR *FF), print something (LIST a file with P), then RESET *PR: LOG/TXT is never closed and shows none of what was printed. A RESET *PR before the LINK closes the file as it should. In the code: CLSFILS follows only the route bit. LINK moves a device's old type and vector into its link DCB and gives the device the link bit, so for a device routed to a file and then linked, CLSFILS finds no route and closes nothing (FILTER does the same: its swap leaves the device the filter's type, 47H for FORMS, and the route in the filter's DCB, found by the member 11 check); FIXDCB then brings the route back from the link DCB (FIX1) and takes it off from DCB+3 to +5 (FIX0). |
| SYS6/SYS B83 | 2533H (member 10, RESET) | The other device's link or route then leads to a DCB of type 00H, whose vector 0000H @CHNIO jumps to, as in B65: after LINK *DO *JL, ROUTE *PR *L0 and RESET *DO, the next output to the printer jumps to 0000H. How it happens: Only when a link DCB (L0, L1 ...) is named as a destination: LINK *DO *JL, ROUTE *PR *L0, then RESET *DO; the next output to the printer jumps to 0000H. In the code: FIX1 clears the 8 bytes of the link DCB when it unlinks the device, without looking whether another device is linked or routed to that DCB (a link DCB can be named as a destination: LINK *XX *L0, ROUTE *XX *L0). |
| SYS6/SYS B84 | 24E4H (member 10, RESET) | RESET filespec (LRL=n,DATE=ON) sets the date and the MOD flag but leaves the record length as it was, with no message; LRL=n alone works. How it happens: Type RESET MYDATA/DAT (LRL=128,DATE=ON): DIR shows the new date but the old LRL. Give the two parameters in two RESET commands. In the code: With DATE=ON, RESFIL writes the new LRL (24C6H) and 4296H (24D3H-24D7H) into the entry in SBUFF$ and then closes the file through L24A5; @CLOSE reads the entry from the disk again (SAWBLK, @DIRRD) before it writes the date, the time and the MOD flag, and the @DIRWR at 24EAH writes the entry as @CLOSE left it. |
| SYS6/SYS B85 | 2536H (member 10, RESET) | After ROUTE *PR *DO, LINK *PR *XX, ROUTE *PR *YY and RESET *PR the printer's DCB holds 00H and 0000H; SYSDVC keeps it, as the vector is 0000H, and printer output is dropped until a reboot. SO, routed at start-up, meets it with LINK *SO *XX, ROUTE *SO *YY, RESET *SO (independent check of member 9). How it happens: Only when a device is routed, then linked, then routed again before its RESET: ROUTE *PR *DO, LINK *PR *XX, ROUTE *PR *YY, RESET *PR leaves the printer dead until the next boot. In the code: After FIX1 brings back from a link DCB a type with the route bit, FIXDCB goes round again and FIX0 brings back DCB+3 to +5, which hold the device's state before that route only if no ROUTE ran after the LINK: LINK leaves the source's +3 to +5 as they were, and a ROUTE of the linked source (CKDCB1, its type 2xH has no route bit) writes its type 2xH and the link DCB's address there. FIXDCB then goes back into the link DCB it has just cleared and ends with type 00H and vector 0000H. |
| SYS6/SYS B86 | 2471H (member 10, RESET) | The device that leads to that DCB loses its I/O: after LINK *DO *PR, RESET *L0 makes L0 08H 0B88H and the screen output stops; after FILTER *KI *CL, RESET *CL makes every key read return 08H. A later RESET of the device itself (RESET *DO, RESET *KI) brings the 08H back into it, SYSDVC clears bit 3, and the device is left with type 00H, dead until a reboot (independent check). How it happens: Type LINK *DO *PR, then RESET *L0 (the link DCB, as DEVICE (B) names it): the screen stops showing anything; a RESET *DO then leaves the video dead until a reboot. In the code: FIXDCB finds no route, link or filter bit on a link DCB or on the DCB of an active filter (LINK and FILTER give those the device's old type and vector), so RESET of one of them goes on to 2471H, which makes it NIL (type 08H); FILTER refuses an active filter (FILTER module is in use), RESET has no such test. |
| SYS6/SYS B87 | 24ECH (member 10, RESET) | After ROUTE *PR TO LOG/TXT, ROUTE *PR (NIL) and RESET *PR the file is closed a second time with the FCB of the first close: if LOG/TXT was written to or extended in between, its old end of file comes back and the granules past it are given up; if it was killed and its directory slot used again, the new file's entry gets the old file's end of file and extents (independent check). How it happens: Type ROUTE *PR TO LOG/TXT, print, ROUTE *PR (NIL), write more to LOG/TXT with another program, then RESET *PR: LOG/TXT loses what was written after the ROUTE (NIL). In the code: CLSFILS does not test the NIL bit. ROUTE (NIL) of a device routed to a file closes a copy of its FCB but leaves the route bit and vector (NILDCB ORs 08H), and the FCB in high memory keeps its bit 7, so RESET of the device follows the route to that stale FCB and closes the file again. |
| SYS6/SYS B88 | 2560H (member 10, RESET) | After ROUTE *XX (NIL), SET *F1 A/FLT, FILTER *XX *F1, SET *F1 B/FLT, RESET *XX swaps XX and F1 back and forth for ever with the interrupts off (245FH): the clock and BREAK stop too, and only a reset gets out (independent check). How it happens: Only with two filters SET on the same filter device name in turn and then FILTERed: RESET of the filtered device hangs the computer. In the code: FIX2 swaps the device's DCB with the DCB its filter module's DCB word names and goes round again; when two filter modules name the same DCB (SET of a filter DCB that FILTER has left NIL, then SET of it again), the swap brings the filter bit back each time. |
| SYS6/SYS B89 | 2CDBH (member 11, FILTER) | The two messages are swapped: after FILTER *PR *FF, FILTER *DO *FF says Device is not a filter, while FILTER *DO *PR (the filtered device named as the filter) says FILTER module is in use. When the device was already filtered (FILTER *PR *F2 after FILTER *PR *FF) the right message comes. How it happens: Type SET *FF FORMS and FILTER *PR *FF, then FILTER *DO *FF: the message is Device is not a filter, though FF is the filter in use; FILTER *DO *PR says FILTER module is in use. In the code: The in-use test (2CE0H-2CEFH) reads the module that the named DCB's vector leads to now and compares its DCB word with that DCB. After a FILTER of a device that had no filter bit, the filter's DCB holds the device's old type without bit 6, and the filtered device holds the filter's type and module, whose word names the filter's DCB. |
| SYS6/SYS B90 | 2C8FH (member 11, SET) | SET returns Register Pair HL = 00DFH for every Program not found (a spec typed with an extension is loaded twice as it is), not 001FH, and C0H more than the number for any other error of that load (25: 00D9H); the message is right. Seen only by a program that runs SET through @CMNDR, as CLEANUP ignores HL. How it happens: Only for a program that runs SET through @CMNDR and tests the return code: SET *XX NOSUCH returns 00DFH where 001FH is expected. In the code: When the second @LOAD (with /DVR, 2C8AH) fails, LOADERR and IOERR take Register A as @LOAD returned it, the error number OR C0H; only the first load's error is stripped (2C75H). |
| SYS6/SYS B91 | 24F2H (member 12, LIST) | LIST file (LINE=0), and LINE=N, NO, OFF or an empty value (all 0000H), show End of file encountered instead of the file and return 28, after reading the whole file with no BREAK test; a LINE more than one past the last carriage return does the same (one past gives an empty line and 0000H). How it happens: Type LIST with (LINE=0) for any text file shorter than 65535 lines: End of file encountered, and nothing is listed; (LINE=1), or no LINE, lists it. In the code: LINPRM takes one off the value of LINE and counts the rest down to 0 with DEC BC before the test, so LINE=0 becomes 65535 lines to pass over; @GET's end of file there goes to IOERR (24FDH). |
| SYS6/SYS B92 | 2634H, 2647H (member 12, LIST) | A file whose end falls on the end of a hex line (the bytes of its last record a multiple of 16: whole 256 byte sectors with LRL 256, a 16 byte file, 20 bytes with LRL=10) ends with a heading line such as 0000:10 = and no bytes. An empty file gives End of file encountered from @POSN instead. How it happens: Type LIST with (H) for a file whose size is a multiple of 16 bytes (any file of whole 256 byte sectors): after the last record comes a line holding only its record number, offset 00 and the equals sign. In the code: Each hex line's heading (25BCH) is shown before its first @GET, after DISBYTE (2634H) and after DOHEX (2647H). |
| SYS6/SYS B94 | 2C5CH (member 11, SET) | After FILTER *XX *F1 with XX NIL, SET *F1 with a second filter (or with the same one: its resident path writes its own type and module into F1) makes the filter chain lead back into itself: the first byte sent to XX recurses through @CHNIO until the stack overruns memory. Widens B88, which then crashes at the first I/O, not only at RESET. How it happens: Only after FILTER of a NIL device of the user's (FILTER *XX *F1) and a second SET *F1: the first character sent to XX hangs or crashes the computer. In the code: SET reuses any NIL DCB of the user's, also the DCB of a filter in use whose filtered device was NIL (FILTER leaves 08H in it). |
| SYS6/SYS B95 | 2C97H (member 11, SET) | The link DCB or filter DCB behind the device is orphaned: RESET no longer reaches FIX1 or FIX2, the link DCB stays in use with the device's old type, the filter DCB keeps the device's old type for good (FILTER with it gives Device is not a filter) and its module stays in memory. How it happens: Only after ROUTE (NIL) of a linked or filtered user device and a SET of that device: the link or filter can no longer be undone without a reboot. In the code: SET writes 08H over the whole type of a NIL user device it reuses; ROUTE (NIL) only ORs 08H in, so the type may still have the link or filter bit. |
| SYS6/SYS B96 | 2CFEH (member 11, FILTER) | FILTER *F2 *F1 with two filter DCBs SET but not used leaves each DCB leading into the other's module while each module chains through its own DCB: any byte sent to F1 or F2 recurses without end, and a later FILTER with either gives FILTER module is in use. How it happens: Type SET *F1 FORMS, SET *F2 KSM, FILTER *F2 *F1: any output to F1 or F2 (or a device later filtered with them) hangs the computer. In the code: FILTER does not test the device to filter: another unused filter DCB is swapped like any device. |
| SYS6/SYS B97 | 2568H (member 12, LIST) | Without ASCII8 a byte 8DH is sent as 0DH, a new screen line, but LIST stays in its line: no GETCHR, and with NUM no number (AB 8DH CD gives 00001. AB, then CD unnumbered). Only with TAB=13 and a tab earlier in the line does 8DH end the line. How it happens: Type LIST of a text file that holds a byte 8DH (with NUM): the text after it starts a new screen line with no line number. In the code: After a byte with bit 7 set, CALL C,CKPAWS runs before the CP 0DH at 256BH, and CKPAWS returns with Register A = Register C (the dispatcher enters each SVC with A = C) or KFLAG$ after a SHIFT-@ pause. |
| SYS6/SYS B98 | 257AH, 26EDH (member 12, LIST) | A BREAK seen on the last line of a page, or a file whose final carriage return falls there (a 22 line file), makes LIST wait for a key at a page pause before it ends. How it happens: Type LIST of a text file of exactly 22 lines: after the last line LIST waits for a key before LS-DOS Ready. In the code: The carriage returns that GOTERR (end of file) and GOTBRK (BREAK) send go through PUTOUT's page count. |
| SYS6/SYS B99 | 2644H (member 12, LIST) | After record 9999H the carry reaches 2763H, VARCLN's leading space: the headings read 1999A:00, 2999B:00 and on (LRL=1 on a file over 39 KB). How it happens: Only with LIST file (H,LRL=1,REC=39320) or any hex listing past record 9999H: the headings get a leading 1, 2 and so on. In the code: INCNUM, for decimal line numbers, is also called on the hex heading (HL = 2763H) after each record; it carries over every digit 9 to F; @HEX16 rewrites only 2764H-2767H. |
| SYS6/SYS B100 | 2414H, 241BH, 2446H (member 14, LOAD and RUN) | The return code is 00DFH for Program not found and C0H more than the number for any other load error; the message is right. Seen only through @CMNDR; the same fault as SET's B90. How it happens: Only for a program that runs LOAD or RUN (X) through @CMNDR and tests the return code: a missing program returns 00DFH where 001FH is expected. In the code: IOERR (2447H) takes Register A as @LOAD returns it, the error number OR C0H, for LOAD, LOAD (X) and RUN (X). |
| SYS6/SYS B101 | 2424H (member 14, LOAD and RUN) | BREAK at Insert SYSTEM disk ENTER ends the prompt as ENTER does: LOAD (X) returns 0000H and RUN (X) runs the program with the source diskette perhaps still in drive 0; the cursor stays off until the next LS-DOS Ready (all through the program after RUN (X), or after LOAD (X) through @CMNDR). How it happens: Type RUN (X) PROG, swap diskettes at the first prompt, and press BREAK at Insert SYSTEM disk: the program runs anyway, the cursor stays off, and with the system diskette still out the next overlay read fails. In the code: PMTSYS does not test FLASH's result; FLASH's BREAK path (24C3H) erases the line but does not send 0EH, which only Command aborted would. |
| SYS6/SYS B102 | 2428H (member 14, RUN) | A program run with RUN (X) gets Register Pair BC as FLASH left it (250EH after ENTER), not 0420H, and DE = 0210H, not the FCB; DEBUG does not stop before its first instruction, and BREAK cannot reach the debugger while it runs (it runs inside the member's RST28 call, with @DBGHK held at C9H since SYS1's CMD4, 1F12H). How it happens: Type DEBUG, then RUN (X) PROG: the program starts without the debugger; a program that takes INBUF$ from Register Pair BC gets a wrong pointer. In the code: RUN (X) enters the program by PMTSYS's RET, not through @RUN, which gives Register Pair BC = 0420H (1B29H) and enters the debugger first when DEBUG is on (1B32H). |
| SYS6/SYS B103 | 2512H (member 14, LOAD) | The program's bytes stay in memory for DEBUG or any program to read: the protection of EXEC access is lost, where plain LOAD refuses the file (error 37). How it happens: Type LOAD (X) SECRET/CMD on a file of EXEC protection: it loads, and DEBUG can then show its code; LOAD SECRET/CMD refuses it. In the code: LOADIT sets SFLAG$ bit 2 for LOAD (X) as for RUN, so SYS2 gives an EXEC-only file READ access (203BH-2040H); LOAD (X) then returns without running it. |
| SYS6/SYS B104 | 2509H (member 14, LOAD and RUN) | With the source diskette already in drive 0, the return to LS-DOS Ready reads SYS1 from it: Error 07H and @ABORT again and again until the system diskette is back. The fault of COPY's B57. How it happens: Type LOAD (X) PROG, put the program's diskette in, then press BREAK at Insert SOURCE disk: Command aborted, then Error 07H until the system diskette goes back in. In the code: BREAK at Insert SOURCE disk returns to IOERR without PMTSYS; SYS2, brought in by request 84H, has replaced SYS1 at 1E00H. |
| SYS6/SYS B105 | 24FEH (member 13, DO) | With an old SYSTEM/JCL on a write protected drive 0, DO X compiles to drive 1 and runs the new file, but a later DO * runs the old one on drive 0, not the last compile, as the manual says it should. How it happens: Compile once with drive 0 write protected and an old SYSTEM/JCL on it (DO X goes to drive 1), then type DO with an asterisk: the old procedure on drive 0 runs. In the code: DO followed by an asterisk copies SYSJCL into JFCB$ with 03H still at 29EAH (P631G1, 2451H, runs only in the compile path), so @OPEN gets SYSTEM/JCL with no drive and takes the first one in drive order; the 6.3.1 compile writes SYSTEM/JCL to the first drive that is ready and not write protected. |
| SYS6/SYS B106 | 2483H (member 13, DO) | A continuation line of the full 79 characters writes its carriage return over 0470H, the JP of drive 0 in DCT$; with more spaces after DO a shorter line does, and the bytes after it too. The next access of drive 0, usually in the same DO (the first @GET of a JCL file there, or the writes of SYSTEM/JCL), runs DEC C, DEC A, LD C,44H, POP BC and on into drive 1's JP 0E3DH with the stack a word short: a crash. How it happens: Type DO X (A); and at the question mark type a line of 79 characters: drive 0's entry in the drive table is overwritten and the next disk access of drive 0 crashes. In the code: The continuation line (a semicolon after a space or the closing parenthesis on the DO line) is read by @KEYIN from the pointer DO came in with less 2 (247FH-2483H); SYS1 passes the first character after DO and its spaces, 0423H after DO X, so the buffer starts at 0421H or later, and @KEYIN stores up to 80 bytes (79 characters, then each further key and the carriage return on the 80th). |
| SYS6/SYS B107 | 2727H (member 13, DO) | //IF A followed by a space and a comment compiles when A is given and aborts with Bad JCL format when it is not: a JCL file that works with one set of tokens fails with another. How it happens: Put //IF A (comment) into a JCL file: DO X (A) compiles it, DO X gives Bad JCL format. In the code: //IF refuses any separator but the carriage return, a plus or an ampersand after a false term (BADHDR0), but IF05 returns true at once after a true term not followed by an ampersand, so the rest of the line is never read. |
| SYS6/SYS B109 | 282FH, 2831H (member 13, DO) | The rest of a value after a dropped separator or a found substitution is lost (A=1-2 gives 1, #F#x gives F's value alone); after an unknown #token# up to 8 more characters are taken and up to 7 spaces filled past them, so DO X (@L,A=aaaaaaaaaaaaaaaaaaaaaaaaa#Z#1), with Z not given, blanks LBLSAV's first byte: Procedure not found. A value that TOOLNG refuses may run further, over LINENO and SYSJCL, before the refusal. How it happens: Type DO X (A=1-2) and put #A# into the file: it compiles to 1. In the code: PARSER always returns with Register B = 00H; XFRSTR calls it again, after a dropped separator (anything but a space, comma, carriage return, equal sign or parenthesis) and after a substitution, with Register B as it was left: 00H, or 08H from FINDSYM after a token not given. |
| SYS6/SYS B110 | 285FH (member 13, DO) | Two at signs anywhere are Too many Proc labels (//SET A@B then //SET C@D); one alone is dropped (//SET A@B sets AB); an at sign inside a value on the DO line makes the next token the label (DO X (A=a@b,B) looks for @B: Procedure not found), and DO X (A@B) makes AB the label. How it happens: Type DO X (@L,A=a@b): Too many Proc labels; or DO X (A=a@b,B): it looks for a label @B. In the code: PARSER takes an at sign anywhere outside quotes, in any field it reads (the DO line, //SET, //RESET and //ASSIGN names and values, //IF terms, macro names, #token# names), as the mark of the label and drops it: GOTLBL tests and sets 285EH and sets 2516H, which only MOVLBL clears (2516H only). |
| SYS6/SYS B111 | 284CH (member 13, DO) | An unclosed quote in a value (DO X (A="abc) or //ASSIGN A="abc) leaves every later field read as quoted, spaces and separators included (a closing parenthesis becomes part of the value: abc)): //IF KI reads the name IF KI, finds IF and has no term left, so it is false; //SET, //RESET, //ASSIGN, //INCLUDE and any line with #token# give Bad JCL format; //ELSE, //END, //QUIT and the execution macros still act; until another double quote. How it happens: Type DO X (A="abc) with a missing closing quote: every //IF in the file is false and //SET gives Bad JCL format. In the code: PARSER's quote flag (284BH, the operand of the XOR at 284AH) is toggled by each double quote and never set back at the start of a field or a line. |
| SYS6/SYS B112 | 25E8H (member 13, DO) | %xx takes : ; < = > ? and @ as 3 to 9, W X Y Z as 0 to 3, and [ backslash ] ^ _ and the grave accent as 4 to 9, with no error: %:0 gives 30H, %W1 gives 01H. How it happens: Put %:0 into a JCL line: it compiles to the character 0 (30H) with no error. In the code: CVRTHEX subtracts 30H, takes 0-9, then resets bit 5 and subtracts 7 and takes any result below 10H, with no test of the gaps between 9 and A and past F. |
| SYS6/SYS B113 | 27B0H (member 13, DO) | //ASSIGN A= with no value is taken, with length 0 (A is true, #A# is left as written), where the manual says a value is required and the code meant to refuse it. How it happens: Put //ASSIGN A= into a JCL file: it is accepted, and #A# stays in the compiled line. In the code: ASSIGN tests NZ after PARSVAL, but XFRSTR returns only with Z and PARSVAL restores its flags (2817H), so the test never acts. |
| SYS6/SYS B114 | 2607H (member 13, DO) | 2400H-2491H (146 bytes) is always safe; up to 24ABH (172) safe unless an //INCLUDE ends later, as UNNEST is at 2492H; past that CKNEST and CPLFIN, needed at every end, are overwritten, and DOLDIR (2509H), needed by any later //INCLUDE. Six #A# of a 32 character A on a line (193 bytes) crash the end of the compile; five do when an included file ends after them; some fifteen overrun the running CPLJCL code at once. How it happens: //ASSIGN a 32 character value to A and put #A# six times on one line: the compile crashes at the end of the file. In the code: The compiled line is built from 2400H with no length test; each substitution adds up to 32 bytes (LDIR) to a line of up to 80. |
| SYS6/SYS B116 | 2980H (member 13, DO) | A later DO * runs the part of a compile that was refused, the lines before the //QUIT that the manual says keeps them from running. How it happens: Compile a file that ends in //QUIT after some lines, then type DO with an asterisk: the lines before the //QUIT run. In the code: ERREXIT closes JFCB$ whenever its open bit is set, after every compile error and after //QUIT, so SYSTEM/JCL keeps the lines written up to that point and its end of file there. |
| SYS6/SYS B117 | 2834H (member 13, DO) | //ASSIGN G=#F##E# gives F's value and a number sign, then the last number sign starts a substitution that fails: Bad JCL format (#F#.#E# works, the full stop dropped). On the DO line any bad number sign in a value (DO X (A=#B)) goes to BADHDR before a line is read and shows the line number 0 and stale memory from JCLBUF1. How it happens: Put //ASSIGN G=#F##E# into a JCL file after //ASSIGN F=SORT and //ASSIGN E=/CMD: Bad JCL format. In the code: After a substitution in a value XFRSTR loads the next character without INC HL, so a number sign right after the closing one is compared with itself by CPLJCL5 and taken as ##. |
| SYS6/SYS B118 | 252FH (member 13, DO) | DO X (B=x,A=#B#) and DO X (B=x,A=y#B#) give Parameter error; with a comma, a space or no closing parenthesis after the substitution they work. How it happens: Type DO X (B=x,A=#B#): Parameter error. In the code: For the same reason (2834H) a value on the DO line that ends with a substitution right before the closing parenthesis returns with Register Pair HL on the parenthesis; PARAM1 goes to PARSINP, which reads it again. |
| SYS7/SYS B119 | 24BEH (member 3, DEBUG and VERIFY) | DEBUG (ON=N), DEBUG (Y=OFF), VERIFY (ON=NO) and VERIFY (Y=NO) switch the debugger or verify on, the opposite of what was typed; only OFF or N with no value, with =Y, ON or YES, or with a number whose two bytes OR to FFH (OFF=255) switch off. How it happens: Type DEBUG (ON=N), or VERIFY (ON=NO): the debugger or verify is switched on, not off. In the code: NPARM (24B6H) gives Z, switch off, only when the word of OFF and N (its own operand, 24B7H) is not 0000H; ON and Y store their value at YPARM (24C1H), which nothing reads. |
| SYS7/SYS B120 | 24A6H (member 3, DEBUG and VERIFY) | A second DEBUG (ON) while the debugger is on saves the 0 the first one left in bit 3, and DEBUG (OFF) without DEBUG (ON) before it takes bit 7, which is 0: either way bit 3, special characters from C0H-FFH, ends up off and C0H-FFH show as tabs, until a program sends control code 15H, which toggles the bit; a bit 3 set by a program while the debugger is on is taken the same way. How it happens: Type DEBUG twice, then DEBUG (OFF), with the video in its special character mode (a program sent 15H to the screen): the special characters C0H-FFH are shown as spaces from then on. DEBUG (OFF) typed when the debugger was never on does the same. In the code: GET$DO moves whatever is in bit 3 (DEBUG ON) or bit 7 (DEBUG OFF) of DODATA$ (0B94H) into the other bit and clears the first, with no record of whether the state was already saved. |
| SYS7/SYS B121 | 245FH (member 8, AUTO) | AUTO :1BASIC keeps ASIC on drive 1 (the first character of a command written right after the digit is lost); AUTO :1 followed directly by an asterisk and a command drops the asterisk, so the command is kept as breakable; AUTO ?:1X and AUTO =:1X work as the X is not read. How it happens: Type AUTO :1BASIC (no space after the drive number), then AUTO ?:1: it shows ASIC, and a start-up from that diskette runs ASIC (Program not found). In the code: After the drive digit of :d GETDRV moves over the next character unless it is below 0EH (the end of the line), taking it to be the space before the command, without testing it. |
| SYS7/SYS B124 | 24F3H (member 7, CREATE) | FILL alone fills with FFH; FILL=N, FILL=NO and FILL=OFF (value 0000H) fill the file with 00H instead of not filling it; a string (FILL="A") fills with the low byte of the string's address in INBUF$, as the response byte is never read. How it happens: Type CREATE NEW/DAT (REC=10,FILL=N): the file's space is filled with zeros, although no fill was wanted. In the code: FILL is a flag or a number (type D4H); only a high byte of 01H means no fill (the 0100H in the file), and the fill byte is the low byte of the value. |
| SYS7/SYS B125 | 2549H (member 7, CREATE) | CREATE *PR (REC=10) shows Creating: *PR and then File exists larger: Register Pair BC, untouched by @LOF's error path, holds 520DH (R and the 0DH of 249FH), taken as 21005 records; REC=21006 and up gives File not open (for *DO the bound is 4F0DH, 20237). How it happens: Type CREATE *PR (REC=10): Creating: *PR, then File exists larger. In the code: @INIT opens a device spec as a device (SYS2 DEVOPEN: FCB+0 = 10H, FCB+6/+7 the name); CREATE tests bit 7 of FCB+0 only to build the name and goes on; @LOF (24B8H) and @POSN (24CAH) refuse the FCB with error 38, not tested. |
| SYS7/SYS B126 | 24E2H (member 7, CREATE) | CREATE of an existing, smaller file with FILL overwrites the records it already had with the fill byte: CREATE OLD/DAT (REC=100,FILL=0) on a file of 10 records leaves a file of 10 records of 00H. How it happens: Make a file of 10 records, then type CREATE with its name and (REC=100,FILL=0): the 10 records are all zeros afterwards. In the code: With FILL, after @REW the fill writes records 0 to n-1 of the file whatever it held, then 240DH puts the old end of file back (for an LRL below 256 see B129). |
| SYS7/SYS B128 | 2407H (member 8, AUTO) | Even when AUTO survives the kept command (a program at 2600H or above), the caller of @CMNDR gets 0000H, never the kept command's error code. How it happens: Only a program that calls @CMNDR with AUTO =: it gets 0000H back whatever the kept command did. In the code: AUTO = run through @CMNDR returns from @CMNDR to 2407H, which loads Register Pair HL with 0000H. |
| SYS7/SYS B129 | 2410H (member 7, CREATE) | When the records asked for end inside a sector, the file's end of file is wrong: CREATE NEW/DAT (LRL=100,REC=10,FILL=0) gives ERN 4, offset 0 (1024 bytes, 11 records) instead of an empty file; a 10 record LRL 100 file given (REC=50,FILL=0) ends with 51 records. Without FILL, or when the records fill whole sectors, it does not happen. How it happens: Type CREATE NEW/DAT (LRL=100,REC=10,FILL=0), then DIR (A): the new file shows 11 records instead of none. In the code: After FILL with an LRL below 256 the last, partly filled sector is still only in the buffer; 240DH-2415H put @INIT's ERN and offset back, then @CLOSE's SAWBLK calls RWRIT@ (SYS3 1E61H), which writes the sector, steps the NRN and, as the position is now past the end of file just put back, sets FCB+12/13 to the next sector (YESEOF, SYS0 13FEH). |
| SYS7/SYS B130 | 2507H (member 7, CREATE) | The file keeps all the free space of the diskette, with an end of file of 0 and no CREATED bit, until it is removed (or opened and closed again); the manual says a file that needs more space than is free cannot be made. How it happens: Type CREATE BIG/DAT (REC=1000) on a 40 track diskette: Disk space full, and FREE shows no space left until BIG/DAT is removed. In the code: A @WRITE that fails with Disk space full (error 27), after every free granule has been allocated and recorded in the GAT and the directory, goes to IOERR, which shows the error and leaves without a close. |
| SYS7/SYS B131 | 252FH (member 6, DUMP) | Contrary to the manual (an ASCII dump always ends with an ETX, normally 03H; its example DUMP WORD/TXT:0 (S=X'7000',E=X'A000',A) says the ETX will be the normal 03H) the file ends with the last byte of memory and no ETX; LDOS 5.3.1's DUMP always wrote it. How it happens: Type DUMP WORD/TXT (S=X'7000',E=X'7010',A) and LIST the file with HEX: it ends with the byte at 7010H and no 03H after it. In the code: For an ASCII dump the ETX byte is written only when ETXRESP (25E9H), the response byte of ETX, has bit 7 (a number), bit 5 (a string) or bit 6 (a flag) set; with no ETX parameter the response byte is 00H and 252FH jumps to CLSFIL, so the file is closed with no ETX byte; the 0003H in ETXPARM's operand is never used. |
| SYS7/SYS B132 | 2531H (member 6, DUMP) | DUMP ... (A,ETX=OFF) and (A,ETX=N) still end the file with 03H, so leaving ETX out is the only way to have none (B131); (A,ETX="") ends it with 22H, the double quote, and a string of several characters gives its first one with no message. How it happens: Type DUMP WORD/TXT (S=X'7000',E=X'7010',A,ETX=OFF): the file still ends with an 03H; with ETX="" it ends with a double quote. In the code: ETX given as a flag (response bit 6) loads 03H without looking at the value word in Register Pair BC, which @PARAM sets to FFFFH for ETX, ETX=Y, ETX=ON and to 0000H for ETX=N, ETX=NO, ETX=OFF and ETX=; ETX given as a string (bit 5, set for any string) takes the byte at the string's address (2528H) whatever its length, and @PARAM gives an empty string the address of its closing quote. |
| SYS7/SYS B133 | 24BDH (member 6, DUMP) | ASCII=256 (or any multiple of 256, X'100', X'FF00') makes a file with the extension TXT written as a load module: a name record holding the six bytes left at NAMFLD (2616H-261BH), not the file's name, the load blocks and the transfer record; ASCII=1 and ASCII=Y work as ASCII. How it happens: Type DUMP TEST (S=X'7000',E=X'7010',ASCII=256): the file is TEST/TXT, but it holds a load module. In the code: APARM (2448H) tests the whole ASCII word (LD A,B / OR C) to choose the extension TXT and to skip the name loop, but 24BDH, 24F5H and 2517H test only its low byte (2449H) to choose between a load module and an ASCII dump; types are not checked, so ASCII may be given a number. |
| SYS7/SYS B135 | 2425H (member 6, DUMP) | A dumped program with no TRA ends through @EXIT with a non zero return code (0424H for a line PROG): at LS-DOS Ready nothing shows (CLEANUP drops it), but the DO member's notes say SYS11 ends a JCL job on a non zero @EXIT code, so the job stops after the program (to be confirmed with SYS11/SYS: if SYS11 hooks @EXIT through the SVC table word rather than the code at 1B0BH, the jump bypasses it); LDOS 5.3.1 also used its @EXIT (402DH), which looks at no return code. How it happens: Type DUMP PROG/CMD (S=X'7000',E=X'7010'), then run a DO file whose lines are PROG and another command: by the DO member's notes the second command is not run. In the code: When TRA is not given the transfer record holds the address of @EXIT itself (1B0BH, read from the SVC table at dump time); @RUN gives the program Register Pair HL as its caller passed it (EX (SP),HL at 1B26H), from SYS1 the command line pointer after the program's name, and @EXIT takes Register Pair HL as the program's return code. |
| SYS7/SYS B137 | 24BAH (member 9, BUILD) | BUILD *PR gives File already exists, a wrong message for a device; BUILD *PR (APPEND) shows Appending: *KI to *PR and sends the whole text to the printer when the input ends, with lines of at most 79 characters, all of it lost with Device not available when the printer is not ready; with *DO (APPEND) the text is shown a second time, with *KI (APPEND) it is thrown away. How it happens: Type BUILD *PR: File already exists. Type BUILD *PR (APPEND), some lines and BREAK: the lines are printed. In the code: @INIT opens a device spec as a device (SYS2 DEVOPEN, which uses only FCB+1 and FCB+2) and returns Z with the Carry flag clear, as for an existing file; @FEXT has made the spec PR/JCL after its asterisk, so the line length is 79; without APPEND, BUILD closes the device (CLOSDEV) and jumps to EXISTS; with APPEND it calls @PEOF (error 38, not tested) and goes on. |
| SYS7/SYS B138 | 2501H (member 9, BUILD) | Pressing ENTER on an empty line during BUILD (HEX) ends the build with Bad hex digit encountered: nothing typed so far is written, the file is left open and, when it was new, empty in the directory. How it happens: Type BUILD TEST/BLD (HEX), a line 414243 and ENTER, then ENTER on the empty line: Bad hex digit encountered, and TEST/BLD stays empty. In the code: With HEX, HP1 calls CVRTHEX before it looks at the count in Register B, so an empty line (B = 0) has its 0DH read as a digit: SUB 30H gives Carry and BADIGSA jumps to BADIGS. |
| SYS7/SYS B139 | 24D6H (member 9, BUILD) | A program that runs BUILD through @CMNDR stays in memory from 3000H up, and BUILD writes over it after 2048 characters of text (about 26 lines of 79); from LS-DOS Ready an input longer than the memory below HIGH$ overwrites the modules in high memory (filters, drivers, the extended debugger, a spooler's buffer) and, past FFFFH, wraps round to the system at 0000H. How it happens: Only a program that runs BUILD with @CMNDR and gets more than about 2K of text has its own code overwritten; from LS-DOS Ready it takes tens of thousands of characters, as from a DO file that feeds BUILD. In the code: The text is kept in memory from BUFFER, 2800H, upward: each line is read by @KEYIN at the end of the text so far and the pointer moves on (2511H, 251BH) with no test against LOW$, HIGH$ or FFFFH; nothing is written until the input ends. |
| SYS7/SYS B140 | 2564H (member 9, BUILD) | During BUILD (HEX) the characters : ; < = > ? @ [ \ ] ^ _ ` W X Y Z are taken as hex digits with no message: :A gives 3AH, as 3A does, and ZZ gives 33H; only other characters give Bad hex digit encountered, as the manual says. How it happens: Type BUILD TEST/BLD (HEX), the line ZZ and ENTER, then BREAK: the file holds 33H instead of an error. In the code: CVRTHEX subtracts 30H, returns 00H-09H for the digits, then makes bit 5 zero, subtracts 07H and keeps any value below 10H; the signs 3AH-40H come to 03H-09H, the capital letters W, X, Y, Z to 00H-03H and the signs 5BH-60H to 04H-09H (small w to z give 40H-43H and are refused). |
| SYS7/SYS B141 | 2496H (member 9, BUILD) | BUILD of an existing file whose LRL is not 256 shows Logical record length open fault (return code 002AH) instead of the manual's File already exists, and with APPEND it cannot extend the file; the file is not changed. How it happens: Type CREATE DATA/DAT (LRL=80,REC=1), then BUILD DATA/DAT: Logical record length open fault instead of File already exists. In the code: @INIT is given LRL 256 (Register B = 00H); for an existing file of another LRL OPNCB10 opens the FCB and returns NZ with error 42, and BUILD jumps to IOERRA before its test for an existing file (24ACH-24BAH), with the FCB not closed. |
| SYS7/SYS B142 | 2460H (member 2, DATE and TIME) | After DATE into a year of the other kind (a leap year when the system was started in a common year, or the other way round), the roll-over at midnight after 28 February goes to 1 March, skipping the 29th, or to 29 February of a common year, which DATE then shows without a message. How it happens: Start the system with the date 01/01/91, type DATE 02/28/92 and leave the machine on past midnight: the next day is 1 March 1992, and 29 February is skipped. A system started in 1992 and set with DATE 02/28/93 goes on to 29 February 1993. In the code: DATE copies the year, day and month into DATE$ (0033H-0035H) and never sets MAXDAY$+2 (0403H), the length of February that the start-up of SYS0/SYS set for its own year (1EEAH, 1F0DH) and that the clock task's midnight roll-over reads (BOOT/SYS 0770H-0778H); the February that DATE makes 29 (274DH) is the member's own copy. |
| SYS7/SYS B143 | 2492H (member 2, DATE and TIME) | Once a date from the 256th day of a year on has been shown (12 or 13 September), every later date keeps bit 0 set, so DATE$+3 and +4 give a day of the year 256 too high; after DATE into a year of the other kind the leap year flag is wrong. Only a program that reads these bytes sees it; no DOS file paged so far reads them. How it happens: Type DATE 09/30/91, then DATE 01/01/91: the byte at 0037H keeps bit 0, so a program that reads the day of the year at 0036H-0037H gets 257. In the code: DATE ORs bit 8 of the day of the year into bit 0 of DATE$+4 (0037H) without clearing the bit first, and 24BBH keeps bits 7-4 and 0 (AND F1H) when it puts in the day of the week; bit 7, the leap year flag that the start-up sets, is never set or cleared by DATE. |
| SYS7/SYS B144 | 25CFH (member 2, DATE and TIME) | TIME 12:30 (CLOCK), and TIME 12:30 with a space after it, give Bad Time format, although the manual says the seconds may be left out; TIME 12:30:00 (CLOCK) and TIME 12:30 alone work. How it happens: Type TIME 12:30 (CLOCK): Bad Time format. TIME 12:30:00 (CLOCK) works. In the code: PARSDAT accepts the end of the line after the second field (ISTIM 00H, 25CDH-25D8H) only when the carriage return follows the two digits at once; any other separator below 30H (a space, or the opening parenthesis 28H) sends it back to PRS1 for a third field, which must then be two digits. |
| SYS7/SYS B148 | 2547H (member 2, DATE and TIME) | TIME (CLOCK) 12:30 or TIME (CLOCK=OFF) 23:00:00 switches the display, shows the old time and returns 0000H, without setting the time or giving a message. How it happens: Type TIME (CLOCK) 12:30: the clock display comes on and the old time is shown; the time is not changed. TIME 12:30:00 (CLOCK) sets it. In the code: GDPARMS looks only at the first character after the word TIME: when it is the opening parenthesis the time is shown (DSPTIME), and whatever follows the parameter list is never parsed. |
| SYS7/SYS B150 | 2504H (member 1, FREE) | When the footer leaves one line on the page (a map of 129 to 136 cylinders), FREE :d stops twice in a row for a key; while a DO file runs it still stops once. How it happens: FREE :d of a hard drive of 129 to 136 cylinders: two keys are needed after the footer, and one inside a DO file. No floppy format of the release has that many lines. In the code: After the footer of a map FREE waits for a key with @KEY when fewer than two lines are left (24FDH-2504H), without testing SFLAG$ bit 5 as CKPAGE does; the empty line that FRET then shows goes through CKPAGE, whose count reaches 0 on that same line. |
| SYS7/SYS B151 | 24B4H (member 1, FREE) | A drive of fewer than eight cylinders has its one map line labelled 0- 7 over fewer cylinders: a MemDISK of three to seven cylinders (MEMDISK/DCT accepts three or more). How it happens: Install a seven cylinder double density MemDISK (MEMDISK/DCT) and type FREE :d: the map line reads 0- 7 but shows cylinders 0 to 6. In the code: The first map line's cylinder numbers are the fixed text MTRK, 0- 7 (2758H); only the later lines are written by DSPTRK from DCT+6. |
| SYS7/SYS B152 | 24D2H (member 4, ATTRIB) | ATTRIB file (PROT=REMOVE), and PROT=REM, set the level READ (5) instead of REMOVE (1): anyone may then read the file without its password but not rename, remove or write it, and DIR shows it as READ; only PROT=RM, the pair in PROTS$, gives REMOVE. 6.3.0 has the same code. How it happens: Type ATTRIB TEST/DAT (PROT=REMOVE), then DIR (A): TEST/DAT shows the level READ. ATTRIB TEST/DAT (PROT=RM) gives REMOVE. In the code: For a PROT value beginning RE, DOPR02 tests the third letter (24C8H): N gives RENAME (02H); for REMOVE it decrements Register A to 01H and compares Register A with 4DH, the letter M, but Register A now holds 01H, not the third letter, so the compare never matches and LD A,05H (24D6H) gives READ. |
| SYS7/SYS B153 | 2682H (member 4, ATTRIB) | A HIT that cannot be read during ATTRIB :d (LOCK) or (UNLOCK) is reported with a wrong message and return code: record not found (5) becomes FFH, Extended error, HL = X'00FF'; a CRC error (4) FEH and a HIT written with an ordinary data mark (0) FAH, both Unknown error code; never HIT read error (22). How it happens: Only with a diskette whose HIT sector cannot be read (a damaged directory cylinder): ATTRIB :1 (LOCK) then shows Unknown error code or an Extended error instead of HIT read error. In the code: The HIT is read with @RDSSC (2681H), which returns Register A = the error number less 6 (SUB 06H at 18F4H, so that a good system sector gives 00H and Z); on NZ ATTRIB jumps to IOERR with that value as the error number, where GATRD (27B4H), and FREE for the same read, load a number of their own. |
| SYS7/SYS B154 | 2711H (member 4, ATTRIB) | Inside a DO file, ATTRIB :d on a diskette whose master password is not PASSWORD, with no MPW=, or with PW alone, ends with Invalid master password, though nothing was asked or typed; NAME alone shows the right Invalid command during DO processing. How it happens: Give a diskette in drive 1 a master password (ATTRIB :1 (PW="BOSS")), put ATTRIB :1 (UNLOCK) in a DO file and run it: Invalid master password, with no prompt. In the code: GETMPW replaces every 3FH result of GMPW1 with BADMPW$, Invalid master password, meant for the Invalid disk name of a password of the wrong form; but GMPW1 also returns 3FH from CKINDO (27D6H), with NOINDO$, when a prompt is needed while a DO file runs. |
| SYS7/SYS B155 | 27C2H (member 4, ATTRIB) | ATTRIB :1 (LOCK), (UNLOCK) or (PW="X") on a write protected diskette ends with GAT write error (return code 0015H) instead of Write protected disk, nothing written; with NAME the write of sector 2 comes first and does say Write protected disk. How it happens: Put a write protect tab on a diskette in drive 1 and type ATTRIB :1 (LOCK): GAT write error. In the code: GATWR makes every result but the error 6 of a good verify into error 21 (15H): @WRSSC's own error (27BBH), 15 for a write protected diskette, is not kept apart, and @CKDRV's Carry for write protect (25C7H) is never tested; PROT02 (2652H) writes the GAT for every disk form command, LOCK or UNLOCK alone too. |
| SYS7/SYS B156 | 25B3H (member 4, ATTRIB) | ATTRIB(LOCK), with no space after ATTRIB, steps back to the B of the command word: drive 0, @PARAM finds no parameter list at a letter and stores nothing, and ATTRIB ends with Specifications Required; ATTRIB (LOCK) and ATTRIB :0(LOCK) work. How it happens: Type ATTRIB(LOCK): Specifications Required. ATTRIB (LOCK), with the space, works. In the code: PROT steps Register Pair HL back one character to find the colon of a drive spec, relying on @FSPEC having moved past the character it stopped at; @PARSER (SYS1 2115H) stops at an opening parenthesis without moving past it, and SYS1 has already passed the spaces after the command word, so ATTRIB is entered with Register Pair HL at the parenthesis whether or not a space comes first: the step back lands on that space, which does no harm, or with no space on the B of ATTRIB. |
| SYS7/SYS B157 | 27E6H (member 5, PURGE) | When the first date of a range is in a leap year, the second may be 29 February of any year (D="01/01/92-02/29/93"), and when both are, 30 February (D="01/01/92-02/30/96"), with no Bad date format; such a date is packed between the last day of February and 1 March, so as the last date it takes the files up to the last real day of February. How it happens: Type PURGE :1 (D="01/01/92-02/29/93"): no Bad date format, though 1993 has no 29 February. In the code: PAKDAT increments February's length in MAXDAYS (28DDH, 28 in the file) for every date of a leap year it reads and never sets it back; a DATE range reads two dates in one run. |
| SYS7/SYS B160 | 27CAH (member 5, PURGE) | Such an undated file counts as one of 1982 with month and day 0: every last date from 1 January 1982 on (D="-01/01/82"), or every first date before 1982 (D="01/01/80-", D="12/31/81-"), takes it, while D="01/01/82-" does not, though the manual says files without dates are never taken; the question shows it with {}. How it happens: Make a file with @INIT and close it without writing (a program that opens a new file and closes it at once), then type PURGE :1 (D="01/01/80-"): that undated file is offered, shown with {}. In the code: On a diskette dated in the new style UNPACK takes the year from DIR+19 bits 4-0 whether the file has a date or not; a file made by @INIT and closed without being written keeps PW$HASH2 there (B19: 96H 42H for no password, so bits 4-0 = 2) with DIR+1 and DIR+2 00H, and the packed word is 1000H, not the 0000H that 257EH and 2594H take for undated. |
| SYS7/SYS B162 | 2634H (member 4, ATTRIB) | ATTRIB :d (NAME="NEW",PW="") ends with Invalid master password (or Command aborted, or GAT write error), yet sector 2 already holds NEW while GAT+D0H keeps the old name: the name BOOT/SYS loads into PAKNAM$ and the GAT's name differ. How it happens: Type ATTRIB :1 (NAME="NEW",PW=""): Invalid master password. The GAT's name is unchanged, but sector 2 of cylinder 0 (PAKNAM$ at boot) now says NEW. In the code: NPARM reads sector 2 of cylinder 0, puts the new name into PAKNAM$ and writes it with @WRSEC at once, before PPARM checks a new master password (2642H) and before GATWR writes the GAT copy that holds the same name (2652H); a refused PW, BREAK at New master password ?, a PW prompt in a DO file or a failed GAT write end the command after sector 2 is written. |
| SYS7/SYS B163 | 25B3H (member 4, ATTRIB) | ATTRIB:1 (NAME="X"), ATTRIB:1 (LOCK) and the like change the diskette in drive 0, not drive 1, with no message; ATTRIB:1(LOCK) ends with Specifications Required (AUTO has the same reading of AUTO:1, 7.9). How it happens: Type ATTRIB:1 (NAME="ONE"), with no space before the colon: the diskette in drive 0 is renamed ONE and drive 1 is untouched. In the code: SYS1 reads the command word with @FSPEC, so a drive spec typed straight after the word (ATTRIB:1) becomes the drive of the command name and is not passed on; ATTRIB is entered with Register Pair HL at the parenthesis, PROT steps back onto the space, finds no colon and uses drive 0, untested. |
| SYS1/SYS B165 | 2209H | Any space inside a parameter list gives Parameter error (return code 002CH) for every command that uses @PARAM: the manual's ATTRIB :0 (UNLOCK, NAME="MYDISK") and ATTRIB :1 (NAME="DATA", PW="SECRET", MPW="BOSSMAN") fail as printed and change nothing; without the spaces they work. How it happens: Type ATTRIB :0 (UNLOCK, NAME="MYDISK") as the manual prints it: Parameter error. ATTRIB :0 (UNLOCK,NAME="MYDISK") works. In the code: After the opening parenthesis or a comma @PARAM calls @PAR1 at once (2204H): a space there gives an empty word (NZ) and Parameter error; a space after a word is passed over by @PAR1, so the DEC HL at 2207H leaves Register Pair HL on that space, which 2233H-223DH refuse. |
| SYS8/SYS B167 | 24D7H (member 5, SETKI) | SETKI (WAIT=15,RATE=0) ends with Parameter error but the delay is now 15; SETKI (DEFAULT,WAIT=5) puts back 22 and 2 and then gives Parameter error; SETKI (Q,W=5) keeps the rate answered at the prompt; BREAK at the Rate prompt of SETKI (Q) keeps the delay just typed, with the return code FFFFH. How it happens: Type SETKI (WAIT=15,RATE=0): Parameter error; then SETKI shows Wait = 15. In the code: Each value is stored as soon as it is accepted: DEFAULT's 22 and 2 at 2472H-2479H, the answers of QUERY at 249BH and 24B5H, WAIT at 24C8H, so an answer of QUERY is stored before WAIT and RATE from the line are checked; a WAIT refused at 24C5H, a RATE refused at 24D7H or BREAK at a prompt of QUERY (258BH) then ends the command with nothing put back. |
| SYS8/SYS B168 | 2594H (member 5, SETKI) | An answer of 0, 00, 256, 512 or 768 to a prompt of QUERY keeps the old value and goes on with no new prompt, where 6.3.0 asked again; 5 or 128 is still refused and asked again, and the setting stays valid. How it happens: Type SETKI (Q) and answer 0 to the prompt Wait = {22} ?: the delay stays 22 and the Rate prompt follows; an answer of 5 is asked again. In the code: GETIT as the patch SETKI1 makes it returns Z, which QUERY takes for ENTER alone (2494H, 24AEH), whenever the low byte of the value from @DECHEX is 00H; 6.3.0's own DECHEX returned Z only when the answer did not begin with a digit. |
| SYS8/SYS B169 | 2562H (member 2, SYSGEN) | After a successful build a program that ran SYSGEN through @CMNDR does not get control back: its stack and BREAK handler are dropped, ATTRIB runs and LS-DOS Ready (or the next DO line) follows; SYSGEN (OFF), the refusals and the errors return to it normally. How it happens: Only from a program: one that passes SYSGEN to @CMNDR ends at LS-DOS Ready after User configuration built instead of going on. In the code: A successful build ends with JP 0028H and Register A = 18H, @CMNDI, for Attrib CONFIG/SYS.CCC:d (I); @CMNDI's CLEANUP sets the Stack Pointer to 0380H with @EXIT under it and clears the BREAK vector, and CFLAG$ bit 1 (a command given through @CMNDR) is not looked at. |
| SYS8/SYS B171 | 249EH (member 2, SYSGEN) | With a configuration already saved, a rebuild that fails part way (Disk space full, a write fault) leaves a CONFIG/SYS that is new at the front and old after that, up to the old end of file; the next start-up loads it all the same, and the old records out of step can put bytes anywhere in memory or end in Load file format error. How it happens: With a configuration saved, load a large module into high memory and type SYSGEN on a nearly full system diskette: Disk space full; the next start-up loads the broken CONFIG/SYS (hold CLEAR at start-up to skip it). In the code: @INIT opens an existing CONFIG/SYS, which the build then writes from the start; sector 2's switch, 00H from the last SYSGEN, is not set to C9H before the rewrite, and an @PUT or @CLOSE error goes to IOERR with the file not closed (262CH, 252CH). |
| SYS8/SYS B172 | 261DH (member 1, SYSTEM) | SLOW given a number below 256 (SYSTEM (SLOW=1)) makes TIMSL$ 00H: no 1 ever comes out of its rotation, so TIMER$, the clock, the time on the screen, the cursor blink and the tasks of slots 0-10 (type-ahead in 10, the spooler in 9, TRACE in 7, ALIVE in 3) stop until SYSTEM (SLOW) or (FAST); only slot 11 still runs; other numbers make the timer step on the pattern of their high byte (SLOW=256: one interrupt in eight). How it happens: Type SYSTEM (SLOW=1): the clock on the screen stops, the cursor stops blinking, type-ahead and the spooler stop; SYSTEM (SLOW) or SYSTEM (FAST) starts them again. In the code: SETCLK, reached from SETSLOW, stores Register B, the high byte of SLOW's parameter word, into TIMSL$ (002BH); it is FFH only for SLOW alone, SLOW=ON, YES or Y (or a number from FF00H up). |
| SYS8/SYS B173 | 278DH (member 1, SYSTEM) | Each SYSTEM (ALIVE) after the first takes another 41 bytes of high memory; the older copies stay as modules named ALIVE that nothing runs, until MEMORY removes them. How it happens: Type SYSTEM (ALIVE) twice, then MEMORY: two modules named ALIVE, and 41 bytes less free memory than after the first. In the code: ALIVE=ON puts a new ALIVE module below HIGH$ and points task 3 at it without looking for one already in memory (SYSRES has such a test, ALIVE has none). |
| SYS8/SYS B174 | 2973H (member 1, SYSTEM) | SYSTEM (DRIVE=0,CYL=n) for an 8 inch drive 0 leaves the count unchanged and shows nothing, instead of CYL=c invalid on 8" drive; SYSTEM (CYL=n) without DRIVE, meant to pass over 8 inch drives, stops with that message at the first 8 inch default DCT, before any count is written; with DRIVE=0 the unchanged sector is still written back. How it happens: On a system whose drive 0 default DCT says 8 inch: SYSTEM (DRIVE=0,CYL=77) does nothing and says nothing; SYSTEM (CYL=40) gives the 8 inch message. In the code: For a default DCT that says 8 inch, CYLPRM tests the drive with OR A on the low byte of DRIVE's word, where every other test uses INC A (FFH = not given): Z only for DRIVE=0. |
| SYS8/SYS B175 | 29C2H (member 1, SYSTEM) | With STEP given, DELAY and CKDRV are not set for a hard drive or MemDISK: SYSTEM (DRIVE=2,STEP=0,CKDRV=OFF) changes nothing on an alien drive 2, and SYSTEM (STEP=0,DELAY=OFF) without DRIVE leaves the alien drives' delay as it was. How it happens: With a hard drive or MemDISK as drive 2: SYSTEM (DRIVE=2,STEP=0,CKDRV=OFF), then DEVICE shows CKDRV unchanged. In the code: STEP on an alien drive (DCT+4 bit 4) jumps to WDESD (29FDH), past DELAY and CKDRV, not only past its own store. |
| SYS8/SYS B176 | 2A77H (member 1, SYSTEM) | A drive whose DCT a /DCT program changed (MEMDISK/DCT, a hard drive driver) keeps that driver's JP and address with the floppy geometry of the default, and a disabled drive stays disabled, though the manual says BREAK puts the default back; the buffer is not written, so the disk is not changed. How it happens: Install MEMDISK/DCT as drive 2, then SYSTEM (DRIVE=2,DRIVER) and BREAK at the prompt: drive 2 still goes to the MemDISK driver, now with a floppy's geometry. In the code: After BREAK at the DRIVER prompt, DVRB stores the JP or RET opcode into the copy of the default DCT in SBUFF$ (Register Pair HL), not into the drive's DCT (Register Pair DE), and the LDIR copies only DCT+3 to DCT+9; DCT+0 to DCT+2 of the drive are never put back. |
| SYS8/SYS B177 | 2A8CH (member 1, SYSTEM) | SYSTEM (DRIVER) without DRIVE and BREAK at the prompt puts back the default geometry of drive 0 only, not of all eight drives as the source's comment says. How it happens: Change the step rate of drives 0 and 1 with SYSTEM (STEP=3), then SYSTEM (DRIVER) and BREAK: DEVICE shows drive 0 reset and drive 1 still at the new rate. In the code: Without DRIVE, the loop that resets the DCTs after BREAK at the DRIVER prompt jumps back with JR NC after CP C0H: it repeats only when the next DCT's low byte is C0H or more, so it ends after drive 0 (7AH). |
| SYS8/SYS B178 | 2B5EH (member 1, SYSTEM) | For a swap of two drives other than 0, CKDRV=OFF set on the SWAP drive is lost, and the DRIVE drive number keeps its own setting for the other physical drive; for SYSTEM=d the other drive's CKDRV=OFF is lost too. How it happens: SYSTEM (DRIVE=2,CKDRV=OFF), then SYSTEM (DRIVE=1,SWAP=2): DEVICE shows neither drive with CKDRV off. In the code: Before the exchange SWAP resets bit 7 of DCT+4 of the second drive and sets it only from the first drive's bit, which it then clears, so the bit stays with the first drive number (drive 0 when it is in the swap, else the DRIVE drive) and the other drive's own bit is dropped. |
| SYS8/SYS B180 | 2AB5H (member 1, SYSTEM) | SYSTEM (DRIVER="name") for a missing file shows Program not found and returns 00DFH, for a bad name (DRIVER=5) 00D3H, instead of 001FH or 0013H; the message is right and the code is not zero, so only a program that compares the code @CMNDR returns with an error number meets it. How it happens: Nothing shows at the keyboard: a program that runs SYSTEM (DRIVER="NOFILE") with @CMNDR gets Register Pair HL = 00DFH, not 001FH. In the code: After a failed @LOAD of the DRIVER program, IOERR (2AE9H) takes Register A as the error number, but @LOAD returns it with bits 7 and 6 set (C0H plus n, error 24 made 31), and LD L,A puts that into the return code. |
| SYS8/SYS B181 | 2936H (member 1, SYSTEM) | SYSTEM (DRIVE=X'FF00',WP) (or DRIVE=65280) acts on drive 0 only and leaves the loop at 2A01H as if DRIVE were given; DVR4 then pops RST28's return address and SYSTEM returns one level too high (straight to @EXIT at the command level). With DRIVER and BREAK at the prompt, DDCT1 pops 1A77H as the DCT address and the LDIR at 2A81H copies seven bytes from 3377H over 1A7AH-1A80H, RST28's tail and the start of CKMOD@: Error 22H and a crash follow; with DRIVER="name" the program gets Register Pair DE = 1A77H. How it happens: Type SYSTEM (DRIVE=X'FF00',DRIVER) and press BREAK at the prompt: Error 22H and the system hangs instead of returning to LS-DOS Ready. SYSTEM (DRIVE=65280,WP) protects drive 0 only. In the code: INC B / JR Z,2944H takes DRIVE's word as not given whenever its high byte is FFH and pushes no DCT address, while 2970H, 299CH, 29FDH, 2A63H, 2A83H and 2B27H test only the low byte with INC A, so a word FF00H-FF07H is a drive for them. |
| SYS8/SYS B182 | 2456H (member 3, FORMS) | FORMS (QUERY=NO) or (Q=N) asks all ten questions, and FORMS (DEFAULT=NO) puts the filter's starting values back, the counters included, and shows them. How it happens: Type FORMS (Q=N): FORMS asks for every setting all the same. FORMS (D=N) shows the starting values, now in force. In the code: DEFAULT (2456H) and QUERY (2479H, and in INITVAL and the checks at 263AH, 264FH, 267CH) are tested by their response bytes DRESP and QRESP, which @PARAM sets for any value; their values DPARM and QPARM are never read. |
| SYS8/SYS B183 | 2656H (member 3, FORMS) | FORMS (PAGE=51) gives Parameter error while LINES is 66, the setting after installation; the manual says that LINES, when not given, defaults to PAGE; both have to be given (FORMS (P=51,L=51)). How it happens: On a filter just installed type FORMS (PAGE=51): Parameter error. FORMS (PAGE=51,LINES=51) works. In the code: Without QUERY, RPAGE refuses a PAGE below the LINES in force (the LINES given, or the present one that INITVAL put into LPARM); only on the QUERY path does PQUERY (2658H) lower LINES to PAGE. |
| SYS8/SYS B184 | 26A8H (member 3, FORMS) | While CHARS is OFF every MARGIN and INDENT is refused, MARGIN=0 and INDENT=0 too: FORMS (MARGIN=10) gives Parameter error on a filter just installed, and with QUERY every answer to the Margin and Indent prompts is asked again, so only ENTER gets past them; FORMS/FLT itself puts in the margin with or without wrap-around. How it happens: SET *FF FORMS, FILTER *PR *FF, then FORMS (MARGIN=5): Parameter error. FORMS (CHARS=80,MARGIN=5) works. In the code: RMARGIN and RINDENT (through VALID? at 26C6H) require MARGIN and MARGIN plus INDENT to be below CHARS, and CHARS 0 means no wrap-around, the filter's starting value; nothing is below 0. |
| SYS8/SYS B185 | 269CH (member 3, FORMS) | FORMS (MARGIN=76) with CHARS 80 and INDENT 6 gives Parameter error and changes nothing, where the code means to set the margin and make the indent 0, as it does with QUERY. How it happens: FORMS (CHARS=80,INDENT=6), then FORMS (MARGIN=76): Parameter error, and the margin is not set. In the code: Without QUERY too, RMARGIN finding MARGIN plus INDENT not below CHARS makes INDENT 0 and stores 01H into IRESP (CHNGIND) to mark it as given; CKCOMM then checks INDENT, whose response byte 01H is not a number for NUMERIC. |
| SYS8/SYS B186 | 2680H (member 3, FORMS) | FORMS (CHARS=12) after FORMS (CHARS=80,MARGIN=10,INDENT=6) is taken; FORMS/FLT then puts 16 spaces (MARGIN plus INDENT) at the start of a wrapped line, more than its 12 columns, so SETUP wraps again inside @INDENT, which calls itself again without end. The first line that wraps (three or more characters after the margin) sends line after line of 11 spaces while the stack runs down 10 bytes a line over the memory below it: from LS-DOS Ready (stack at 0380H) it overwrote the SO, JL and *FF DCBs (0228H-024FH) after 30 lines and the print failed with an error; with a program's stack higher up it overwrites the program. How it happens: FORMS (CHARS=80,MARGIN=10,INDENT=6), then FORMS (CHARS=12), then print a line of three or more characters: the printer gets line after line of spaces until the print fails or the system crashes. In the code: Without QUERY, RCHARS returns Z for any CHARS 1-255 without comparing it with MARGIN plus INDENT; only MARGIN's and INDENT's own checks compare, and only when they are given. |
| SYS8/SYS B187 | 25BBH (member 3, FORMS) | With the parameter also on the line, STFPRMS installs the refused value: FORMS (Q,P=40), answer 0 to Physical Page Length, then ENTER, sets PAGE 0. Otherwise it is the limit for the later checks: answer 0 at the CHARS prompt, then ENTER, and every Margin and Indent answer is refused; Y at a number prompt leaves 255; a refused MARGIN or INDENT answer kept this way can install a MARGIN not below CHARS: with CHARS 80, FORMS (Q,M=5), answer 90 at Margin Setting, then ENTER, sets MARGIN 90, and the first character printed starts the endless recursion of B186. How it happens: FORMS (Q,P=40), answer 0 at Physical Page Length, then press ENTER at the same prompt and at the rest: FORMS then shows PAGE = 0. In the code: STUFVAL stores the low byte of an answer into the parameter's value before the check is called; a refused answer is asked again, but stays there if ENTER follows. |
| SYS8/SYS B188 | 25EBH (member 3, FORMS) | Changing to a shorter PAGE in the middle of a page (40 lines while 50 of a 66 line page are printed, FORMS (P=40,L=30)) makes the next line end feed 245 lines; with FFHARD one form feed 0CH is sent instead. How it happens: Print 50 lines, FORMS (PAGE=40,LINES=30), print one more line: the printer feeds 245 lines. In the code: STFPRMS stores PAGE and LINES into the filter without resetting its line counter (offset 01H), which only DEFAULT does; FORMS/FLT's DOTOF feeds PAGE less the counter, modulo 256, line feeds when the counter reaches LINES. |
| SYS8/SYS B189 | 2619H (member 3, FORMS) | FORMS (Q,ADDLF): the ADDLF prompt shows {OFF}, and ENTER turns ADDLF on; FORMS (Q,X=X'2A2E') shows {X'00'} at both XLATE prompts, and ENTER installs the translation; FORMS (Q,X="AB") installs a translation made from the string's address (04H into 2CH) and FORMS (Q,A=5) sets ADDLF, both Parameter error without QUERY; FORMS (Q,C=80) shows the present CHARS and ENTER keeps it. How it happens: FORMS (Q,ADDLF) and ENTER at every prompt: the ADDLF prompt said OFF, but FORMS now shows ADDLF = ON. In the code: With QUERY, INITVAL replaces the five numbers given on the line by the present settings, but the switches ADDLF, FFHARD and TAB and the two bytes of XLATE keep the values and response bytes of the line, which STFPRMS installs; CKCOMM is not run on this path, so they are not checked either. |
| SYS8/SYS B190 | 2936H (member 4, SETCOM) | After SETCOM (BREAK=OFF) a received 80H byte (with 8 bit words) and any character with a framing error (the remote's modem break) still set the BREAK bit of KFLAG$ and reach the program as 80H, the system BREAK code; the manual says that with BREAK OFF the driver never sets the BREAK bit. SETCOM (BREAK=0) turns it off. How it happens: With a terminal on the serial line, SETCOM (WORD=8,BREAK=OFF), then send the byte 80H (or a modem break): the BREAK bit is set, as if BREAK had been pressed, and a program reading *CL gets 80H. SETCOM (BREAK=0) stops it. In the code: BREAK=OFF (also BREAK=N, or OFF at the Break prompt) stores 80H into LOGBRK, the driver's BREAK character; COM/DVR's receive routine (CKINP) treats only 00H as no BREAK character, and for any other value takes a received byte equal to it, and any byte with a framing error, as BREAK. |
| SYS8/SYS B191 | 288DH (member 4, SETCOM) | SETCOM (BAUD=1200,WORD=9) gives Parameter error, and SETCOM then shows Baud=1200 while the UART still runs at the old rate; after SETCOM (DEFAULT,STOP=3), also Parameter error, the default line conditions and BREAK character act at once and the control byte A5H reaches the UART with the next character sent (COM/DVR's SEND writes UCIMAGE), but the default 300 baud does not, though the display shows it. How it happens: SETCOM (BAUD=1200,WORD=9): Parameter error; SETCOM then shows Baud=1200, but the line still runs at the old rate until the next SETCOM with a parameter list that succeeds. In the code: DEFAULT (2462H) stores all four bytes of the data area and BAUD (288DH) stores BAUDRT before the later checks, while UCIMAGE and MSMASK are stored after the last check and the rates reach the UART only through @CTL function 2 at 252DH; a refusal in SETPARAM, or BREAK at a QUERY prompt after DEFAULT, ends SETCOM before @CTL (BREAK, 293CH, is stored early too, but no check follows it). |
| SYS8/SYS B192 | 26B3H (member 4, SETCOM) | At the Parity prompt of QUERY the answers EVEN and ODD, the words the display shows, are refused and the prompt comes back; only a switch (ON, OFF, Y, N) or a quoted string starting with E or O is taken, and the quoted form only when every later prompt gets ENTER (B194). On the line, PARITY=EVEN is Parameter error for the same reason. How it happens: SETCOM (Q), and answer EVEN at Parity=: the prompt comes back. Type ON, or "E" (with the quotes) and then ENTER at every later prompt. In the code: GETRSP hands an answer to @PARAM as the value of F; @PARAM takes as a word value only one beginning with Y, N, ON or OF and refuses any other word with NZ, so GETIT asks again with no message. |
| SYS8/SYS B193 | 248FH (member 4, SETCOM) | An answer of 261 at the Word prompt, 257 at the Stop prompt, or 300 or "A" at the Break prompt is taken, every later question is asked, and SETCOM then ends with Parameter error; every answer is lost but a new baud rate, which stays in BAUDRT without reaching the UART (B191). How it happens: SETCOM (Q), answer 261 at Word= (or 300 at Break=): it is taken, and after the CTS prompt SETCOM says Parameter error. In the code: The QUERY checks of WORD (248FH) and STOP (24ABH) read only the low byte of the answer, while SETPARAM (289DH, 28BFH) refuses a high byte other than 00H; the answer at the Break prompt is not checked at all (24E7H), while SETPARAM (2931H) refuses a value of 256 or more, which includes every quoted string. |
| SYS8/SYS B194 | 28E0H (member 4, SETCOM) | After "E" or "O" at Parity=, any answer other than ENTER alone at Break=, DTR=, RTS=, RI=, DSR=, CD= or CTS= puts its second key (or its 0DH) where the letter was: SETCOM ends with Parameter error after the last prompt and the answers are lost (but for the baud rate, B191); an answer whose second letter is E or O sets that parity instead (NO at DTR= makes the parity ODD). How it happens: SETCOM (Q), answer "E" at Parity= and 27 at Break=: after the CTS prompt SETCOM says Parameter error. With ENTER at every prompt after Parity= the "E" is taken. In the code: A quoted answer at the Parity prompt of QUERY leaves in PARITYP (2754H) the address of its first character, 29F0H in INBUF; the check at 24D5H reads it at once, but SETPARAM reads it again at 28E0H after the later prompts, whose answers @KEYIN writes into the same INBUF (29EFH). |
Latent Bugs, Limits and Code With No Effect
These 37 do no harm in the files as shipped (latent), or are limits built into the code.
| File | Where | Bug |
|---|---|---|
| BOOT/SYS B1 | 0805H | With four or more other ENADIS_DO_RAM levels open when the clock interrupt comes (differences 4 to 7 have bit 2 set) KCK@ reports BREAK that nobody pressed: KFLAG$ bit 0 is set and the task processor treats it as BREAK; the source's intent there was to allow no BREAK. How it happens: Nothing a user does at the keyboard: it needs code that has the video and keyboard memory switched in through ENADIS_DO_RAM four levels deep, with interrupts on, when a clock interrupt arrives. In the code: KCK@ jumps to 0805H, which tests bit 2 of Register A as the BREAK key, also from 07FAH when another routine has the keyboard switched in; there Register A holds the low byte of OPREG_SV_PTR less 6FH (the extra ENADIS_DO_RAM levels), not the keyboard row. (Latent) |
| SYS0/SYS B4 | 1756H | On a drive of more than 203 cylinders, GAT bytes CBH and up (the version, cylinder count, format byte, password, name and date) would be taken as cylinder maps and their 0 bits allocated. How it happens: Nothing on a floppy diskette, which has at most 80 cylinders; only a drive described with more than 203 cylinders could meet it. In the code: CG14 to CG16 look for a cylinder with a free granule from AFLAG$ up to the number of cylinders (DCT+6 + 1) with no limit at CBH, where the GAT's cylinder map ends (the extension test at 1734H has the limit). (Latent) |
| SYS0/SYS B6 | 1EDAH | From 2012 on the date cannot be entered at boot: every year after 2011 is refused and the prompt comes back; a 2012 date that survived a reset in memory is refused too. How it happens: Boot LS-DOS 6.3.1 and answer the date prompt with any date in 2012 or later, as 01/15/24: the prompt is asked again and again; only a date from 1980 to 2011 is accepted. In the code: The start-up accepts only years 1980 to 2011 (the year byte less 80 must be below 32; 00 to 11 are taken as 2000 to 2011). (Limit) |
| SYS1/SYS B13 | 21DAH | Contrary to the manual (the response byte is 0 for every parameter not given), a program that calls @PARAM twice on the same table, the second time with no parameters, still finds the responses of the first call. How it happens: Nothing a user does at the keyboard: only a program that calls @PARAM more than once with the same table can meet it. In the code: @PARAM sets the response bytes of an enhanced table to zero only when a parameter list in parentheses follows (21E3H on); at the end of the line or without a parenthesis it returns at once. (Latent) |
| SYS1/SYS B14 | 209DH | A file whose name is TO, ON, OVER or USING, with any extension, password or drive, cannot be named to any command or program that uses @FSPEC: the word is passed over and the next one is taken. How it happens: Create a file called ON/TXT (or TO/DAT, OVER/BAS, USING/CMD) and try to LIST ON/TXT or COPY ON/TXT X/TXT: the name is passed over as a preposition and the command takes the next word as the file. In the code: After a name is parsed, @FSPEC looks it up in PREPTBL (TO, ON, OVER, USING) with @FNDPRM, which matches up to the end of the name only, and on a match parses the next word into the FCB instead. (Limit) |
| SYS2/SYS B16 | 1EF1H | @CKDRV reports a drive whose GAT cannot be read as not ready only because the saved status is not 00H; a driver whose status read returned 00H would have it reported ready (Z, Carry clear) with the write protect state at 2080H, the YFLAG$ bit and DCT+6 left from an earlier call; Register A holds a status byte, not an error code (the same routine in SYS12 and BACKUP loads error 8 first). How it happens: Nothing a user does at the keyboard with the floppy driver of the system, whose controller status after a seek is never 00H; only a drive whose driver returns a status of 00H could meet it. In the code: When the GAT cannot be read, CKDRV jumps to CKDR7, which pops the controller status saved at 1EE6H and returns the flags of OR A on it: the read error in Register A is lost. (Latent) |
| SYS2/SYS B18 | 225AH | A program's new name string is changed, and the two bytes after its end are overwritten when it has no drive; when a file of the new name exists and may be opened, OPNCB0 writes a 32 byte FCB over the string and the bytes after it before error 19 comes back (a new name naming an existing device gets DEVOPEN's 8 bytes); the TRM's own example string NEWNAME/TXT and 0DH is overrun by two bytes. How it happens: Nothing a user does at the keyboard: the RENAME command hands @RENAME a new name that already ends with the drive and checks first that the name is free; only a program that gives @RENAME a short string with no drive, or the name of a file that exists, loses the bytes after it. In the code: RENAME writes a colon, the old drive's digit and 0DH into the caller's new name over its 0DH or 03H (or over its own drive), and opens the new name with Index Register IX at that string as if it were an FCB. (Latent) |
| SYS2/SYS B19 | 218BH | A new file that is closed without being written keeps the password hash (96H 42H with no password, the value DATECONV takes for an old style blank password) as its time; its date bytes DIR+1 and DIR+2 stay zero. How it happens: Run a program that opens a new file with @INIT and closes it without writing to it: the file's directory time field holds the password hash instead of a time. Writing to the file and closing it sets the date and time right. In the code: INIT copies 17 bytes from 22C6H into DIR+5 to DIR+21, so PW$HASH2, the password hash, goes into DIR+18 and DIR+19, which in this version hold the time of the last change (SYS3 writes the time there at close). (Latent) |
| SYS2/SYS B20 | 2174H | If the directory read or write fails, the HIT slot stays taken by a hash with no entry in use: OPEN passes over it (DIR+0 bit 4 clear), but the slot is lost to new files until REPAIR. How it happens: Only after a disk error: a directory sector that cannot be read or written while a file is being created (a bad sector, a diskette pulled out) leaves one directory slot unusable until REPAIR is run. In the code: INIT stores the hash in the free HIT slot and writes the HIT before it reads (2177H) and writes (2194H) the directory entry. (Latent) |
| SYS3/SYS B22 | 1E5EH | The caller is told the close succeeded, but the last buffer is not written, FCB+0 still shows an open file and no specification is put back into the FCB. How it happens: Only a program can meet it: open a file with two FCBs, remove it with @REMOVE through one of them, then close the other: the close returns no error, the data still in that FCB's buffer is lost and the FCB is not closed. It also happens with B23 when the diskette put back has that directory entry free. In the code: When the directory entry of the open file is no longer in use (DIR+0 bit 4 clear), CLOSE returns at once with Z and Register A = 11H (the code @DIRRD leaves). (Latent) |
| SYS3/SYS B23 | 20EBH | With another diskette in the drive, CLOSE reads the entry of the same DEC on it: if that entry is free it returns Z with nothing written (B22); if it is in use, the last buffer is written into a sector of the other diskette, that entry gets the FCB's end of file and date, and the granules past that end of file are freed in the other diskette's GAT. How it happens: Have a program open a file for writing, take the diskette out before the program closes it, and when the CLOSE FAULT message appears put a different diskette in and press ENTER: the close goes ahead on the wrong diskette and changes a file there (its end of file, its date, its last sector, and the space past its new end), or quietly does nothing if that directory entry is free. Put the same diskette back, or press BREAK. In the code: After the CLOSE FAULT message, ENTER goes back to the drive check (CKAGN 1E23H), which only looks for a diskette turning in the drive (and on drive 0 of the release, whose DCT+4 bit 7 is set, and on hard or alien drives, not even that); nothing compares it with the diskette the file was opened on. (Limit) |
| SYS3/SYS B24 | 1E8EH | With two FCBs open on the same file with UPDATE access or better, the one closed last puts its own, older end of file back into the entry and frees the granules past it: what was written through the other FCB beyond that point is lost. How it happens: Only a program can meet it: open the same file twice with two FCBs, add data to its end through the first and close it, then close the second, which did not write (or wrote less): the file is cut back to the length the second FCB knew and the added data is gone. In the code: CLOS1 copies the FCB's EOF offset and ERN into the entry whenever they differ from it, without asking which is later, and CLOS9 then gives back every granule past that ERN; SYS2 does not write the open bit to the disk (NFLAG$ bit 0 is 00H), so a second @OPEN of a file already open with UPDATE access is not refused. (Latent) |
| SYS4/SYS B26 | 1F31H | The two asterisk signs are always written; nothing visible changes, since for error 63, the only case the comment can mean, the header is never shown (B25). How it happens: Nothing anyone can see. In the code: The long header tests bit 6 of Register C (the source: Extended error? / Go if not) before writing the two asterisk signs of the message line, but Register C was masked to bits 5-0 at 1EDBH, so the bit is always 0; what the test was meant to catch cannot be told from the code. (No effect) |
| SYS4/SYS B27 | 200BH | After a long display of an error of an unopened specification (bit 6 of its last word byte set), a later long display of an open device FCB in the same load of SYS4 stores the device's name in the line Device = and shows Open DCB, Device= with the name of an earlier call (xx the first time). How it happens: Only a program can meet it: with SYS4 still in the overlay area, call @ERROR in the long form for an error such as 24 (an unopened file), then for an error such as 15 with JDCB$ at an FCB opened to a device such as *PR: the line reads Open DCB, Device= with xx (or an earlier name) instead of PR. In the code: DSPC2 stores 20EBH (DEV$NAM) into the operand of the device name store at 1FF0H, which is 213AH in the file, and nothing sets it back while SYS4 stays in the overlay area. (Latent) |
| SYS4/SYS B28 | 2031H | A long display of a file whose FCB text runs 24 characters without 03H, 0DH or 00H (not one @FSPEC leaves, whose texts are 23 characters at most) shows them; every later Open FCB line in the same load of SYS4 is an empty line. How it happens: Only a program that builds its own FCB text of 24 characters with no end byte and calls @ERROR in the long form for an error of the file name kind can meet it. In the code: DSPC3 copies up to 24 characters of the FCB's text to 20F5H, and RSPC5 puts 0DH after them: the line FILE$EQ has 23 places before its 0DH at 210CH, so 24 characters end with the 0DH at 210DH, the first byte of OPN$FCB. (Latent) |
| SYS6/SYS B55 | 2925H (member 3, COPY and APPEND) | With LOW$ below 2FFFH (lowered by the program, for example with MEMORY (LOW=X'2800') sent through @CMNDR) the stop page is 2EH or below and is met only after the page wraps past FFH: the read loop reads the source's sectors over 2F00H, the program, high memory and from 0000H the system, so that a file of more than two sectors wrecks the system. How it happens: Only a program can meet it: lower LOW$ below 2FFFH (MEMORY (LOW=X'2800') through @CMNDR) and then send a COPY of two files through @CMNDR: the copy runs over memory and the system. In the code: For a command sent through @CMNDR, DOINIT sets the stop page of the sector loops to the high byte of LOW$ + 1, less 1; the loops start at page 2EH and stop only when the page equals it. (Latent) |
| SYS6/SYS B59 | 26C3H (member 3, COPY) | No effect under LS-DOS 6.3.1, which never compares the user password; under a version 6.2 DOS such a copy has a user password nobody knows, so its protection level cannot be used with any password but the owner's. How it happens: Only a version 6.2 DOS shows it: copy a file with CLONE from a 6.3 diskette to a 6.2 style diskette and use it under TRSDOS 6.2: its access password no longer works. In the code: With CLONE, DIR+16 to DIR+19 of the source are copied whatever the dating styles; only old to new is converted (CKTYP), so a new style source's time bytes go into DIR+18 and DIR+19 of an old style destination, where the old style keeps the user (access) password's hash. (Latent) |
| SYS6/SYS B80 | 2476H (member 9, LINK) | With ten links in use, the next seven link DCBs get names that RESET, ROUTE, LINK and REMOVE cannot name (RESET *L: works on *L and gives Device not available); such a link can be undone only by a RESET of its source or a reboot, and DEVICE (B) still shows the odd name. How it happens: Only with eleven or more links in use at once: the 11th link DCB is named L:, which DEVICE (B) shows but no command can name; RESET of the device that was linked undoes it. In the code: NAMLP names a link DCB L and the first character from 30H up that no DCB has, so past L9 it gives L:, L;, L<, L=, L>, L? and L@; @FSPEC (@PARSER, SYS1 2105H) ends a device spec at any character that is not a letter or digit, so those names cannot be typed in a command. (Limit) |
| SYS6/SYS B93 | 2C06H (member 11, SET) | A driver or filter that would install itself in the low I/O zone without moving HIGH$ (FORMS tests the frozen bit only on its high memory path) cannot be SET while HIGH$ is frozen. How it happens: Only on a system where a program froze HIGH$ (CFLAG$ bit 0): SET *FF FORMS gives No memory space available though FORMS would fit in the low I/O zone. In the code: SET refuses with No memory space available whenever CFLAG$ bit 0 (HIGH$ frozen) is set, before it loads the program. (Limit) |
| SYS6/SYS B108 | 273AH (member 13, DO) | A 32nd to 45th nested //IF keeps its state in BADHDR$ (2B90H-2B9DH): the compile works, only a later error message shows wrong text; from the 46th the state lands in JCLBUF1, which the next line read overwrites with a character, never 00H, so blocks that deep are dropped; the 144th level reaches INPBUF and the sector being read. How it happens: Only a JCL file with more than 31 //IF blocks nested inside each other meets it. In the code: IF04 pushes each //IF's state at CONDPTR + 1 with no test against the 32 bytes of CONDFLG (2B70H-2B8FH). (Limit) |
| SYS6/SYS B115 | 28ABH (member 13, DO) | Some 1300 tokens (on the DO line, its continuation lines and //SET or //ASSIGN lines) reach the top of memory, fewer the modules above HIGH$, which they overwrite. How it happens: Only a JCL file that sets thousands of different tokens meets it. In the code: MOVNAME adds each new token 41 bytes higher in the symbol table from 2E00H, with no test against HIGH$; //RESET only blanks a name, so the entry stays. (Limit) |
| SYS7/SYS B122 | 2442H (member 8, AUTO) | When the kept command loads over 2400H-24A9H (any SYS7 member, every SYS6 member but SET and FILTER at 2C00H, SYS8 members), @CMNDR returns into that program's bytes at 2407H: after a kept DEBUG a jump into memory that holds no code, after AUTO ? a stale Stack Pointer from member 8's own SAVESP, after DATE or TIME a false FFFFH. How it happens: Only a program that calls @CMNDR with AUTO = while the kept command is a library command (DIR, FREE, ...): the program does not get control back properly. In the code: When AUTO = is run through @CMNDR (CFLAG$ bit 1) it gives the kept command to @CMNDR by JP 0028H, so @CMNDR returns to the address on the stack, 2407H in AUTO's own code. (Latent) |
| SYS7/SYS B123 | 2465H (member 7, CREATE) | SIZE=16384 asks for 0 records (a new file gives File exists larger); SIZE=16385 and up ask for (SIZE modulo 16384) x 4 records with no message; SIZE or REC with no value (FFFFH) ask for 65532 or 65535 records and end with Disk space full. No diskette or drive of LS-DOS 6 is that large (the ERN is 16 bits). How it happens: Type CREATE NEW/DAT (SIZE=16384): File exists larger for a file that did not exist. In the code: SIZE in K is multiplied by 4 with two ADD HL,HL into a 16 bit record count, with no overflow test. (Limit) |
| SYS7/SYS B127 | 2408H (member 3, DEBUG and VERIFY) | DEBUG OFF and VERIFY OFF typed without parentheses switch the debugger or verify on, with no message; the manual shows the parentheses. How it happens: Type DEBUG OFF (without parentheses): the debugger is switched on. In the code: @PARAM returns Z at once when no opening parenthesis follows the command word (SYS1 21E1H), and neither DEBUG nor VERIFY looks at the rest of the line. (Limit) |
| SYS7/SYS B134 | 249AH (member 6, DUMP) | The manual says an existing file is overwritten, but a file of another record length (a data file with LRL 80, say) is refused with Logical record length open fault and not written, unless the same LRL is given to DUMP; nothing reaches the directory (the open bit is written only with NFLAG$ bit 0, clear in the release). How it happens: Make a file with CREATE DATA/DAT (LRL=80,REC=1), then type DUMP DATA/DAT (S=X'7000',E=X'7010'): Logical record length open fault, and the file is not written. In the code: @INIT of an existing file compares the LRL in Register B (256 unless LRL is given) with the file's (OPNCB10, SYS2 2096H: FCB+9 against DIR+4) and returns NZ with error 42 and the FCB marked open; DUMP goes to IOERR. (Limit) |
| SYS7/SYS B136 | 2455H (member 9, BUILD) | Never met: the loop always ends at the slash. Without @FEXT's slash it would run on past the 03H through memory, and a 0DH found there would pop 240CH, the return address of the CALL at 2409H. How it happens: Nothing a user can do: the path is never taken. In the code: SLASH? looks through the spec in FCB1 for the slash of the extension and ends at a 0DH with a JR Z to NOTKSM (2457H), whose POP HL takes a word that this path never pushed (the PUSH is at 245DH, after the slash); the spec in an FCB ends with 03H, not 0DH, and @FEXT (2446H) always leaves a slash in it. (No effect) |
| SYS7/SYS B145 | 2438H (member 2, DATE and TIME) | From 2012 on DATE cannot set the date (Bad Date format); a later date reached by the midnight roll-over is still shown correctly up to 2040, but from 2041 the day of the week is wrong, as AND 0FH at 24A2H drops the 16s of the leap day count (1 January 2041, a Tuesday, is shown as Sun). How it happens: Type DATE 01/01/12: Bad Date format. In the code: DATE takes the year typed, makes 00 to 11 into 100 to 111, and accepts it only when it less 80 is 0 to 31: the years 1980 to 2011. (Limit) |
| SYS7/SYS B146 | 2569H (member 1, FREE) | A drive with more than 256 sectors to a cylinder would be shown with a wrong total (16 granules of 17 sectors: 40.00K for 680K), a wrong free space only from 65536 free sectors on, and its possible files from the low byte of the count less 2, too few when that byte is 4 to 33 (10 granules of 26 sectors: 0/16). That needs more than eight granules to a cylinder, which a GAT byte cannot describe and no driver of the release sets up (FORMAT's largest, 8 inch double density two sided, has 6 granules and 60 sectors), and it always comes with B147. How it happens: Nothing a user can do with the release: only a drive whose DCT gives more than eight granules to a cylinder, which no driver of the release sets up. In the code: The sectors of a cylinder are worked out by @MUL8 (SVC 90), whose product is eight bits; 2588H takes 00H to be 256, which is shown right, and DIVHLA (2714H) drops Register H, the high byte of a 24 bit sector count. (Latent) |
| SYS7/SYS B147 | 24D9H (member 1, FREE) | On a drive with ten or more granules to a cylinder each next cylinder of a map line would start 265 bytes after the one before (2B08H, 2C11H, 2D1AH ... 3247H), past LINBUF and up to about 3256H, over memory that a program running FREE through @CMNDR may hold, and each map line would show only its first cylinder; no driver or format of the release has more than six granules. How it happens: Nothing a user can do with the release: only FREE :d of a drive with ten or more granules to a cylinder, which no driver of the release sets up. In the code: The map gives each cylinder nine columns: after DFRE has moved Index Register IX past the granules, 9 less the granules of a cylinder is added to IX as an unsigned byte (Register D = 00H), F9H-FFH for 10 to 16 granules. (Latent) |
| SYS7/SYS B149 | 258DH (member 2, DATE and TIME) | If the clock task's once a second turn falls in that window, it draws the time once at the top right even for CLOCK=OFF with the display already off, and the time stays on the screen. How it happens: Not to be met on purpose: the window is a few microseconds in each second. In the code: CLOCK always sets bit 4 of VFLAG$ (007FH) first and resets it two instructions later (2593H) when the value's low byte is not FFH. (Latent) |
| SYS7/SYS B158 | 2813H (member 5, PURGE) | From 2012 on no DATE value can name its year: D="-01/01/15" purges the files dated 1 January 1980 or earlier instead of those up to 2015, and D="01/01/15-" every dated file from 1980 on, with no message. How it happens: Type PURGE :1 (D="-01/01/15"): only the files of 1 January 1980 and before are offered, not those of the years up to 2015. A four digit year is read the same way: D="02/01/1991" takes 19 as the year, so 1980, and offers every file from 1 February 1980 on. In the code: PAKDAT makes the two digit years 00 to 11 into 2000 to 2011 (631) and takes any year below 80 that is left, 12 to 79, as 1980 (SUB 50H, JR NC, XOR A). (Limit) |
| SYS7/SYS B159 | 27BDH (member 5, PURGE) | On an old style diskette a file closed in 1988 or later counts as one of 1980 to 1987: D="-12/31/85" purges a file of 1990 (stored as 1982), and D="01/01/90-" takes none of the files of 1990. How it happens: On a diskette formatted by an older DOS (old style dating), type PURGE :1 (D="-12/31/85"): files changed in 1988 to 1993 (and 1996 to 2001) are offered too, shown with a year from 80 to 85. In the code: On a diskette dated in the old style (its YFLAG$ bit clear) UNPACK takes the file's year from DIR+2 bits 2-0, the year less 1980 modulo 8 as SYS3 writes it, and compares it with the full year less 1980 of the date typed. (Limit) |
| SYS7/SYS B161 | 266CH (member 5, PURGE) | The 03H goes to 2968H, the 80H that marks PRMTBL$ as an enhanced table; @PARAM has read the table before, nothing reads it after, and the member is read again for the next PURGE, so nothing changes. How it happens: Nothing a user can see: it happens whenever a changed and dated file with a full name and extension is asked about, and has no effect. In the code: The question's line in FCB1$ (294DH-2967H, 27 bytes) is NAME/EXT:d, then a space and a plus sign for a changed file and a space, a brace, the date and 03H: 28 bytes for a name of eight characters with an extension of three. (No effect) |
| SYS7/SYS B164 | 2658H (member 4, ATTRIB) | ATTRIB :d (PW="NEW",UNLOCK,MPW="OLD") unlocks only files whose owner password is NEW; files locked with the old master password keep it, with no message; UNLOCK must be given first, in a command of its own. How it happens: Type ATTRIB :1 (LOCK), then ATTRIB :1 (PW="NEW",UNLOCK): the files stay locked with the old master password. In the code: PPARM stores the new master password's hash into GAT+CEH (2648H) before LOCK or UNLOCK takes GAT+CEH (2658H) as the hash to put or to look for. (Limit) |
| SYS7/SYS B166 | 2780H (member 5, PURGE) | None: a space in the partspec matches any character just as $ does (2555H-255CH), so the field selects the same files as if it were filled with $. How it happens: Nothing a user can see: PURGE A*/B*:1 selects the same files as a field full of $ would. In the code: For an asterisk PRSPEC's PS5 is LD (DE),A / DJNZ PS5 with no INC DE: the $ is stored B times into the same byte of BLANKS, so only the asterisk's own position becomes $ and the rest of the field keeps its spaces. (No effect) |
| SYS8/SYS B170 | 27C4H (member 2, SYSGEN) | None: the @REMOVE byte never changes, and CLEANUP sets @DBGHK from SFLAG$ bit 7, which FLGTAB$'s entry saves, at every @EXIT. How it happens: Nothing a user can see: SYSGEN saves three bytes that are put back unchanged. In the code: The ADRTBL$ entry that the source calls the DEBUG vector and DBGHK saves the three bytes 19A4H-19A6H: EXTDBG$ and the first byte of @REMOVE (3EH); @DBGHK is at 199FH. (No effect) |
| SYS8/SYS B179 | 2BCFH (member 1, SYSTEM) | A diskette whose directory sector 5 has a CRC error is taken as a system diskette when the damaged first byte still has bits 6 and 4 set, and the swap goes ahead; any other read error of sector 5 gives the Insert SYSTEM diskette prompt, as for a data diskette, instead of the read error. How it happens: Only with a diskette whose directory sector 5 cannot be read in the drive that SYSTEM (SYSTEM=d) or SWAP is to make drive 0: a CRC error lets the swap go ahead, any other error asks for a system diskette. In the code: SYSP1 reads directory sector 5 with @RDSSC and does not test the result; after a failed read @RDSSC has read cylinder 0 sector 1 into SBUFF$ and read sector 5 again, so the test at 2BD0H sees the sector 5 data as read with the error (a CRC error) or the boot sector's first byte 00H. (Latent) |