HEAPSORT IMPLEMENTATION ERRATA =============================== These items describe issues found during documentation review. The source files have not been changed to fix program behavior. Heapsort_68000_ASM.txt - HeapSort branches to ParseNum, but the defined label is PaseNum, so the parser branch target is missing. - SiftDown scales child indices by 8 bytes even though ArrayBuffer is allocated as longwords (4 bytes each). It therefore compares/swaps the wrong locations. - LongToAscii increments A2 instead of the quotient register while converting digits. This changes the array cursor used by SaveOutput and does not compute the remaining quotient, corrupting formatting and output traversal. - LoadInput requests 32769 bytes into the 32768-byte InputBuffer, allowing a read to overwrite adjacent storage. - StopTimer prints the raw clock-tick difference followed by "SECONDS." without converting ticks to seconds. Heapsort_x64ASM.txt - HeapSortMain ignores the integer count returned by LoadFile and passes the caller's maximum capacity to HeapSort and SaveFile. When fewer values are read, the unused array tail is also sorted and written. - StopTimerAndWriteElapsed reverses the full nanosecond digit string after appending the decimal point and a zero. The decimal point is consequently placed incorrectly, so the displayed elapsed time is not a valid seconds value. - StopTimerAndWriteElapsed modifies RSI, RDI, and R12-R15 without saving them. These are nonvolatile registers under the Windows x64 calling convention, so callers can have their state corrupted. Heapsort_GW_BASIC.txt - The extraction loop reads TEMP from VALUE(0), not VALUES(0). The root value is therefore not read from the array before swapping. Heapsort_6502_ASM.txt - SelectLargestChild calls ChildVsRight, but no ChildVsRight routine is defined in the file. The comparison helper is therefore unresolved. Fixed-capacity input handling - Heapsort_Atari_BASIC.txt, HEapsort_GFA_Basic.txt, Heapsort_GW_BASIC.txt, Heapsort_COBOL.txt, and Heapsort_PASCAL.txt do not stop reading when their fixed array capacity is reached. Inputs exceeding the declared capacity can write beyond the array. - Heapsort_ADA.txt increments Count and checks the limit afterward, so it accepts Max_Values + 1 elements despite declaring Max_Values as the limit. Heapsort_Atari_BASIC.txt - The end-time expression multiplies PEEK(18) by 65535, whereas the start-time expression uses 65536. The two timestamps use different place values, making elapsed time inaccurate. Heapsort_COBOL.txt - Both time conversions subtract START-SECONDS/END-SECONDS instead of adding them. The elapsed-seconds calculation is therefore incorrect. - OUTPUT-LINE has only nine integer digit positions, while VALUE-ENTRY uses a native four-byte signed binary field. Values outside the output picture's range can be truncated or otherwise misrepresented when saved. Heapsort_BorlandCPP.txt - clock() returns clock ticks, but the difference is printed as seconds without dividing by CLOCKS_PER_SEC. Heapsort_PERL.txt - The output close-error message interpolates $1 instead of the system error variable $!, so it does not report the close failure cause. Heapsort_ADA.txt - Save_File iterates from 0 to Count - 1 using Natural. If no values were loaded, Count - 1 underflows and raises a constraint error before the empty loop can complete. Heapsort_VB.NET.txt - The output path is spelled Ouput_VB.NET.txt, which differs from the expected Output_VB.NET.txt filename.