MBASIC: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 24:
 
L'MBASIC non usava tutti i servizi del CP/M ma solo la [[terminale (informatica)|console]], la gestione della stampante e l'accesso ai [[floppy disk|floppy]]: il linguaggio non supportava la modalità [[Computer grafica|grafica]], i colori, i [[joystick]], il [[mouse]], le [[Local Area Network|reti locali]], il suono o gli [[Real-time clock|orologi in tempo reale]]. Inoltre l'MBASIC non supportava le aree utente messe a disposizione del CP/M per l'organizzazione dei file sul disco. Siccome il CP/M era un sistema pensato per computer mono-utente, anche l'MBASIC non supportava nessuna forma di [[multitasking]] come ad esempio il blocco dei file. Nonostante queste limitazioni, l'MBASIC era considerato comunque un BASIC potente e funzionale.
 
===StrutturaL'editor del linguaggio===
L'MBASIC era un [[linguaggio interpretato]]: il [[codice sorgente]] veniva salvato in memoria in forma di [[token (testo)|token]], ossia con le parole chiave del BASIC convertite in un singolo byte per risparmiare memoria. Ogni riga di testo inserita a video che iniziava con un numero veniva considerata come linea di codice e salvata in RAM, tutto il resto era considerato come un comando diretto ed eseguito immediatamente.
 
Il programma salvato in memoria poteva essere stampato a video oppure salvato su disco, sia nella forma compressa in token sia come testo [[ASCII]]. I numeri di riga erano utilizzati dalle istruzioni [[GOTO]] e [[GOSUB]] per le operazioni di salto. L'[[editor (informatica)|editor]] forniva solo funzionalità base, e conveniva salvare il sorgente in formato ASCII per poi modificarlo con un editor di testo vero e proprio.
 
<!--
===Struttura del linguaggio===
L'MBASIC è un [[linguaggio interpretato]]: il [[codice sorgente]] viene salvato in memoria
MBASIC is an [[Interpreter (computing)|interpreter]]. Program source text was stored in memory in [[bytecode|tokenized]] form, with BASIC keywords replaced by one-byte tokens which saved memory space and speeded execution. Any line prefixed with a line number was stored as program text; BASIC statements not prefixed with a line number were executed immediately as commands. Programs could be listed on the screen for editing, or saved to disk in either a compressed binary format or as plain [[ASCII]] text. Every source line was identified with a number, which could be used as the target of a [[GOTO]] or [[GOSUB]] transfer. Only line editing commands were provided. <ref> CP/M products providing full-screen editing support required their own installation routines to customize the software for the specific [[computer terminal]] used as the system console. No support was provided within CP/M to standardize terminal capabilities. </ref> It was often beneficial to save a program as plain text and edit it with a full featured editor.
 
Program text, variables, disk buffers and the CP/M operating system itself all had to share the 64 kilobyte address space of the 8080 processor. Typically when first starting MBASIC there would be less than 32 kB memory available for programs and data, even on a machine equipped with a full 64 kilobytes of RAM. Comment lines, prefixed with the <code> REM </code> keyword or an apostrophe, could be placed in the program text but took up valuable memory space, which discouraged BASIC users from fully documenting their code. To allow larger and more complex programs to be run, later versions of MBASIC supported functions that allowed portions of program text to be read in and executed under program control (the "[[chain loading|<code> CHAIN </code>]]" and <code> MERGE </code> statements). No support for "shell" command execution was provided, though this functionality could be duplicated by a determined programmer.