Hot answers tagged

226

Short explation The Windows NT 3.1 kernel is incompatible with enhanced 486 processors. Specifically, it is incompatible with 486 processors providing the CPUID instructions. Kernel debugging works fine with the 486DX-33 that was originally installed in the machine, and with the older non-enhanced core in a write-through Am486DX4-NV8T without SMM. If your ...


58

This is a botched version check error message. Windows 1.x was designed to run under MS-DOS 2.0, 3.0 and 3.10; to ensure it only runs under one of these, it performs a version test on its host DOS. Windows does not merely obtain the officially-advertised version number; to ensure the version number is not spoofed, it also tests whether certain fields of the ...


53

Coding in assembly is brutal. Rogue pointers Assembly languages rely even more on pointers (through address registers) so you can't even rely on the compiler or static analyzing tools to warn you about such memory corruptions / buffer overruns as opposed to C. For instance in C, a good compiler may issue a warning there: char x[10]; x[20] = 'c'; That's ...


39

The problem is simple. At initialisation, Nibbles measures the time it takes to perform 1000 empty iterations of a FOR loop with a DOUBLE counter in order to determine how many such iterations are required to produce a ½ ms delay. Back when this code was written, CPUs were pretty slow (and FPUs even more so, if they were available at all), so it was ...


36

DOSBox, with the default CPU speed of 3000 cycles on this Linux box, runs nibbles.bas without problems.


24

I spent most of my career writing assembler, solo, small teams and large teams (Cray, SGI, Sun, Oracle). I worked on embedded systems, OS, VMs, and bootstrap loaders. Memory corruption was seldom if ever a problem. We hired sharp people, and the ones that failed were managed into different jobs more appropriate to their skills. We also tested fanatically - ...


24

This is a consequence of a buggy overflow check. Internally, MS-DOS uses logical block addressing to access file systems. Since version 4.0, MS-DOS uses 32 bits for sector addresses in order to support disks larger than 32 MiB (i.e. than 65536 sectors). To ensure all sectors are addressable with 32 bits, MS-DOS tries to compute the address of the last ...


20

It’s good ol’ buffer overflow. I diagnosed this in VICE. It turns out that supercat’s hunch that this is caused by clobbering a register of the CIA chip is mostly correct (they only got the register wrong), though the cause is relatively easily discovered even without that hint. Since the primary symptom is the keyboard becoming unresponsive, I decided to ...


19

Simple idiotic errors abound in assembly, no matter how careful you are. It turns out that even stupid compilers for poorly-defined high level languages (like C) constrain a huge range of possible errors as semantically or syntactically invalid. A mistake with a single extra or forgotten keystroke is far more likely to refuse to compile than it is to ...


16

Software can identify those early steppings on the 386 by checking whether the XBTS and/or IBTS instruction can be executed, since these instructions were dropped in later chip revisions. Software must, however, first check whether the CPU is really an 80386 and not 486, because the some early steppings of the 486 temporarily re-used the opcodes of these two ...


14

I wrote the original garbage collector for MDL, a Lisp like language, back in 1971-72. It was quite a challenge for me back then. It was written in MIDAS, an assembler for the PDP-10 running ITS. Avoiding memory corruption was the name of the game in that project. The entire team had dread of a successful demo crashing and burning when the garbage ...


14

The ISO 7185 Pascal standard, section 6.4.3.5 "File-types", says (my emphasis): There shall be a file-type that is denoted by the required structured-type-identifier text. The structure of the type denoted by text shall define an additional sequence-type whose values shall be designated lines. A line shall be a sequence cs ~S(end-of-line), where ...


11

If the compilers you have were based on the P-series, then I believe that there was indeed a bug. In the P-series compilers after P2, the destination of an assignment is determined by a routine named selector, which branches on the klass field of fcp, a variable that holds information about a relevant identifier. When the klass is func, i.e., when the ...


8

That fact is explicitly mentioned in the (Russian) book Ошибки-ловушки при программировании на фортране, 1987 (Errors and pitfalls in FORTRAN programming), page 88. One of the puzzles was to make the sequence of operators J=1 PRINT 1,J 1 FORMAT(' J = ',I1) print 0. The provided solution was PROGRAM TASK CALL ZERO(1) J=1 ...


7

Well, there's a fifth one: A sequence issue not really considered relevant when first published. The underlaying issue is that sprites are not moved during scrolling the background, prior to (re)drawing the screen. While this is rather obvious with large sharp screens, it will be perceived less of an issue on original Game Boy hardware due the small screen ...


7

Memory corruption bugs have always been a common problem in large C programs [...] But there was a time when large programs, including operating systems, were written in assembly, not C. You're aware that there are other languages that were quite common already early on? Like COBOL, FORTRAN or PL/1? Was memory corruption bugs a common problem in large ...


6

I have written OS mods in assembly on CDC G-21, Univac 1108, DECSystem-10, DECSystem-20, all 36 bit systems, plus 2 IBM 1401 assemblers. "Memory corruption" existed, mostly as an entry on a "Things Not To Do" list. On a Univac 1108 I found a hardware error where the first half-word fetch (the interrupt handler address) after a hardware ...


5

I'm too young to remember really old Fortran compilers, but the behaviour that you described occurs in all current Fortran compilers. It's a core part of the language standard, so we can safely assume that any standard-conforming compilers in the past used to work this way as well. Check out this example at https://godbolt.org/z/GKadP9rov (feel free to ...


5

In the 1990s, I worked for a UK company (Polyhedron Software) that produced a suite of code analysis and refactoring tools for Fortran, marketed as PlusFort. The GXCHK module performed static analysis of Fortran code to look for common errors, including: Subprogram argument mismatch or misuse (e.g. constant actual argument is illegally modified by ...


5

You are comparing apples and pears. High level languages were invented because programs reached a size which was unmanageable with assembler. Example: "V1 had 4,501 lines of assembly code for its kernel, initialisation and shell. Of those, 3,976 account for the kernel, and 374 for the shell." (From this answer.) The. V1. Shell. Had. 347. Lines. Of. ...


4

I don't think memory corruption is generally more of a problem in assembly language than in any other language which uses unchecked array-subscripting operations, when comparing programs that perform similar tasks. While writing correct assembly code may require attention to details beyond those that would be relevant in a language like C, some aspects of ...


4

As mentioned by Justin Time, WDM and VXD drivers had a tendency to conflict. This introduced a fairly strong "whether you remember WinME as great or garbage depends on the hardware you ran it on" element to people's recollections of it. I didn't use it myself but the impression I got from people who did was that the rule of thumb was "If you'...


4

Lacking meaningful research avenues, I started surveying YouTube videos, and I think I managed to mine some insights even from that scant evidence. Here is what I found out: The issue is apparently just barely visible, if at all, on the original Game Boy; it probably cannot be noticed on a real handheld unless one is specifically looking for it, as LCD ...


4

Using an emulated IBM 1130 running DM2, I can confirm Leo B.'s example. It took a little modification to run on the 1130: // JOB // FOR *LIST SOURCE PROGRAM *ONE WORD INTEGERS SUBROUTINE ZERO(K) K = 0 RETURN END // DUP *DELETE ZERO *STORE WS UA ZERO // FOR *LIST ALL *IOCS(1132 PRINTER) *ONE WORD INTEGERS J = 1 ...


3

Assembler requires more intimate knowledge of the hardware you're using than other languages like C or Java. The truth is, though, assembler has been in use in almost everything from the first computerized cars, early video game systems up through the 1990's, up to the Internet-of-Things devices we use today. While C offered type safety, it still didn't ...


2

It can be tested by performing various multiplication operations and verifying the result. List of such code that performs ten tests with various memory and register based operands is available for example at pcjs.org, but as others have already pointed out, the problem may only manifest under certain conditions and can depend on e.g. CPU supply voltage, so ...


2

I did a few years of assembler programming, followed by decades of C. Assembler programs did not seem to have more bad pointer bugs than C, but a significant reason for that was that assembler programming is comparatively slow work. The teams I was in wanted to test their work every time they'd written an increment of functionality, which was typically every ...


2

It was a very common problem. IBM's FORTRAN compiler for the 1130 had quite a few: the ones I remember involved cases of incorrect syntax that weren't detected. Moving to machine-near higher level languages didn't obviously help: early Multics systems written in PL/I crashed frequently. I think that programming culture and technique had more to do with ...


1

This discussion is in support of the previous answers. Hopefully, this is not the answer to some other question that was not asked. The question was in reference to passing values without restriction in old compilers, but no reference was given to how old. So lets start at the time of really old. This appears to be a non-standard feature used in Univac ...


1

On the modern CPU the FOR loop executes so quickly that the difference in the TIMER before and after is zero. Hence the line: speed = speed * .5 / (stopTime# - startTime#) gives a divide by zero error, because (stopTime# - startTime#) equals zero. The simplest solution would simply be to set the speed variable manually, until you find something that gives a ...


Only top voted, non community-wiki answers of a minimum length are eligible