Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

204

I'm the author of the TPUG article. The "BILL GATES SUCKS" message isn't really an Easter egg; that was just a conceit of mine to make the article a bit more interesting and to turn it into a bit of a puzzle. Here's how it works and how it was created: In any given infinite sequence random numbers, it's a mathematical certainty that a given subsequence of ...


71

POKE 59458,62 was a trick, sometimes called "Fast Print," used to increase screen refresh rates on older PETs. This page describes the trick succinctly: the system no longer waits for the video sync signal, thinking that it's always present, and updates the screen as fast as it can. In later models this POKE could cause problems. The new video circuitry ...


65

Having a programming language built-in gave you a multi-purpose tool into your hands at the flick of a switch (power on). As to the choice of BASIC vs. other programming languages, microcomputer BASIC dialects are - despite some of their shortcomings - quite accessible to novice programmers. They are a bit like using English in an imperative style ("PRINT ...


58

This is an example of BBC BASIC with inline (6502) assembler code. The computer in use would have been a BBC Microcomputer, manufactured by Acorn Computers Ltd. The display was probably a studio monitor of some sort. These could be driven directly using either the RGB output or the composite video output of the microcomputer. It is likely that the actual ...


53

I don't think that's an easter egg. Someone just made an effort to find random seeds that produce the numbers to create the intended words. It would be an easter egg if the seed numbers were in some way related to CBM or Microsoft. A=RND(-A) initializes the (pseudo) random generator with A, generates a random number and stores it in A. The GOSUB20 ...


43

Having BASIC available for the machine was a selling point so early adopters wouldn't have to wait for software to become available--they could write what they need themselves, and they wouldn't need to learn machine language to do it. [Bill] Gates believed that, by providing a BASIC interpreter for the new [MITS Altair] computer, they could make it ...


37

In my view, the brief popularity of BASIC in the 1980s is directly related to the popularity of Javascript today - Simply, it's the Runtime that is Everywhere. That is what BASIC was back then. During the home computer revolution of the 1980s, every new system had to at least have a viable claim to be useful for something in terms of software. By providing ...


36

That interpreter apparently parses the source text, or at least the numerical literal values, at every execution. π is a single-byte magic token, therefore, as soon as it is recognized, it is immediately substituted with the value of Pi, and nothing else needs to be done. When a byte that might occur in a number is parsed, the number parsing routine begins....


35

Except for the very earliest versions of basic, LET was rarely used, but the LET keyword was not always optional. Early BASIC interpreters required it; however, for most versions that came out for the PC (including Microsoft BASIC), the use of LET was optional. Later standards in BASIC often required that the keyword be supported, but since there was no ...


34

Nobody so far has said the magic words, which is Microsoft BASIC. First developed for the Altair 8800 (the first commercially successful personal computer!), Microsoft spent a lot of energy making sure their BASIC would work on every personal computer in the 1970s and licensing it widely. It ran on CP/M, it ran on the TRS-80, and -- of course -- the IBM PC. ...


33

Contrary to other answers, obliging the user to enter BASIC tokens directly doesn't really save meaningful amounts of RAM. Many of its contemporaries such as the BBC Micro had BASICs where you typed keywords in full which were then immediately tokenised when you pressed enter. If anything, tokenised Sinclair BASIC generally had longer byte sequences than ...


32

These tricks are usually done to increase speed or reduce space. For most (especially Microsoft) BASIC, constants are stored within a tokenized line as ASCII (as entered), and converted to a floating point number every time they are evaluated. This is a time consuming process. Assigning the number once to a variable to be used thereafter will skip this part ...


30

There are multiple reasons. First, there was no standards body publishing an official definition of the BASIC language (initially the closest thing to a standard was the Dartmouth version for mainframe computers, eventually the 'de-facto' standard became Microsoft's version simply due to market share). This left people free to fill in perceived gaps in the ...


30

Per Sophie Wilson: To prove that [Steve had] designed the microarchitecture correctly, he wrote, in BBC BASIC, a model of the microarchitecture. To prove that I'd designed the architecture correctly, I wrote an interpreter for the processor's instruction set and wrote programs in it. So, well before any actual commitment to doing things, we could ...


26

The Amstrad CPC machines had a version of Locomotive BASIC clearly heavily inspired by BBC Basic. While they weren't quite as good as the latter they were still light-years ahead of the older versions of Microsoft BASIC being used by the C64 at the time, as well as Sinclair's alternatives. The Commodore 16 had a similar, more advanced BASIC, comparable to ...


25

I am the author of that video. I wrote a little article about that years ago. I will copy that for you here: Original article here: http://www.zxprojects.com/index.php/the-fix-a-spectrum-blog/29-the-oddities-of-the-inves-spectrum The Inves Spectrum+ was a Spectrum 48K clone made by Investronica, the spanish partner of Sinclair Research, and responsible for ...


24

Thraka is right that BASIC served the role of operating system on many 8-bit micros. Some OS was needed, that was beyond doubt. But at the time dedicated operating systems were either very limited (say, Atari DOS), overly complex, big and expensive for the tiny computers (Unix), or - for the middle ground, that was "just right" - in their infancy (CP/M). ...


24

Use the INPUT# command. The INPUT# command is meant for non-interactive I/O on files or devices, i.e. reading from a file on disk, serial port, whatever. Because it is non-interactive, it will not display a prompt anywhere. The keyboard can be opened like any other I/O device, it has device number 0. Knowing that, the implementation is straightforward. 10 ...


23

The weirdest "early computer" capable of booting into an excellent programming language was the Apple Laserwriter. Introduced in 1985, it had an interactive Postscript environment; if you hooked a terminal to it, you could write and execute Postscript programs via its serial port. At that time it was the fastest and most powerful computer Apple sold, with 1....


23

I suspect your confusion is because INKEY$ returns the current state of the keyboard, not a buffered stream of up / down key presses (On serial terminal based systems such as CP/M you'd get the character code which might have buffer depending on the hardware). Basically the code could be written: 10 Wait for all keys to be up. 20 Wait for a key to be ...


22

As far as I know it was included because it was essentially the operating system interface. When you installed MS-DOS on a PC it provided you with commands and allowed you to run programs that executed machine code on the machine. BASIC back then was similar. It provided you with a command prompt, operating system-level commands like reading/writing data ...


22

Some comprehensive BASIC to start with There are BASICly three (*1) kinds of statements to handle single keystrokes in various BASICs (*2): Waiting for a single keyvalue to arrive and returning it. Checking if a key has been pressed, if yes, it's read and returned, otherwise an empty value is returned Delivering the actual state of the (decoded) keyboard ...


21

The BBC Micro's built-in BASIC interpreter was very comprehensive, and supported good structured programming techniques at a time when very few other BASIC interpreters did so. Features included: FN and PROC for functions and procedures, which also supported recursion REPEAT / UNTIL loops direct access to graphics primitives, e.g. PLOT, MOVE, DRAW direct ...


21

Try using the "new" command. This clears BASIC's memory, so that you can write a new program.


21

There are a number of optimisations which, in aggregate, will improve performance somewhat: There are multiple linked lists for the variables, one per first letter of the variable name. This makes name lookup faster compared to a more typical implementation with one linked list. The integer variables @% through Z% have fixed memory locations and do not ...


21

Well, it's a 'trick' to simplify the editor as well as the BASIC editor. After Reset (or NEW) three bytes of Zero are placed at the beginning of the basic RAM. They make it look to the basic interpreter as this looks like the tokenisation of a single, empty BASIC line. Consisting of One byte 00 as line end marker and Two bytes 00 as pointer to the next ...


20

According to http://www.worldofspectrum.org/ZXBasicManual/zxmanchap25.html, addresses 23672-23674 contain a 24 bit count of 50Hz frame ticks in the UK. I wrote a quick program to print the values, which do indeed seem to start at zero on startup and increment at the right rate, and thus serve as an uptime counter. A simple bit of maths indicates that the ...


19

BBC BASIC: inline assembly First one that comes to mind would be the BBC BASIC family. Beside many great features to access the OS, Assembly code could be directly inserted. It would be assembled right between the BASIC lines before and after. 10 P%=8000 : REM set Assembly location 20 [ 30 JSR some_function 40 ] 50 CALL 8000 : REM now execute it The ...


18

In my view, QuickBASIC caused the demise of GW-BASIC/BASIC(A). Microsoft had essentially ceased further development of GW-BASIC when they changed their focus to compiled BASIC in the mid-1980's: note that GW-BASIC never got VGA support, and Microsoft replaced it with QBASIC (a stripped-down version of QuickBASIC with just the interpreter) in MS-DOS 5+. As ...


17

As it says in Wikipedia BASIC: The introduction of the first microcomputers in the mid-1970s was the start of explosive growth for BASIC. It had the advantage that it was fairly well known to the young designers and computer hobbyists who took an interest in microcomputers. ... BASIC was one of the few languages that was both high-level enough to be ...


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